Skip to content

Commit

Permalink
Have scale function and scale property accept percentage value.
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D55012

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1597642
gecko-commit: 79c674504d23705095f572227f1f167dabede843
gecko-integration-branch: autoland
gecko-reviewers: emilio
  • Loading branch information
nordzilla authored and moz-wptsync-bot committed Dec 1, 2019
1 parent 5df56b2 commit 9c100c3
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 3 deletions.
14 changes: 14 additions & 0 deletions css/css-transforms/parsing/scale-parsing-valid.html
Expand Up @@ -14,14 +14,28 @@
test_valid_value("scale", "none");

test_valid_value("scale", "1");
test_valid_value("scale", "1%", "0.01");

test_valid_value("scale", "100");
test_valid_value("scale", "100%", "1");
test_valid_value("scale", "100 100", "100");
test_valid_value("scale", "100% 100%", "1");
test_valid_value("scale", "100 100 1", "100");
test_valid_value("scale", "100% 100% 1", "1");

test_valid_value("scale", "-100");
test_valid_value("scale", "-100%", "-1");
test_valid_value("scale", "-100 -100", "-100");
test_valid_value("scale", "-100% -100%", "-1");
test_valid_value("scale", "-100 -100 1", "-100");
test_valid_value("scale", "-100% -100% 1", "-1");

test_valid_value("scale", "100 200");
test_valid_value("scale", "100% 200%", "1 2");
test_valid_value("scale", "100 200 1", "100 200");
test_valid_value("scale", "100% 200% 1", "1 2");
test_valid_value("scale", "100 200 300");

</script>
</body>
</html>
3 changes: 3 additions & 0 deletions css/css-transforms/parsing/transform-invalid.html
Expand Up @@ -23,10 +23,13 @@
test_invalid_value("transform", "translateY(4%, 5%)");

test_invalid_value("transform", "scale(6, 7, 8)");
test_invalid_value("transform", "scale(6%, 7%, 8%)");

test_invalid_value("transform", "scaleX(1, 2)");
test_invalid_value("transform", "scaleX(1%, 2%)");

test_invalid_value("transform", "scaleY(3, 4)");
test_invalid_value("transform", "scaleY(3%, 4%)");

test_invalid_value("transform", "rotate(0, 0)");
test_invalid_value("transform", "rotate(0, 0, 0)");
Expand Down
16 changes: 16 additions & 0 deletions css/css-transforms/parsing/transform-valid.html
Expand Up @@ -26,11 +26,27 @@

test_valid_value("transform", "scale(2)");
test_valid_value("transform", "scale(3, 4)");

test_valid_value("transform", "scale(-2)");
test_valid_value("transform", "scale(-5, -6)");

test_valid_value("transform", "scale(250%)", "scale(2.5)");
test_valid_value("transform", "scale(325%, 475%)", "scale(3.25, 4.75)");

test_valid_value("transform", "scale(-250%)", "scale(-2.5)");
test_valid_value("transform", "scale(-500%, -620%)", "scale(-5, -6.2)");

test_valid_value("transform", "scaleX(7)");
test_valid_value("transform", "scaleX(720%)", "scaleX(7.2)");

test_valid_value("transform", "scaleY(-8)");
test_valid_value("transform", "scaleY(-85%)", "scaleY(-0.85)");

test_valid_value("transform", "scale3d(0.5, 2.5, 3)");
test_valid_value("transform", "scale3d(50%, 250%, 300%)", "scale3d(0.5, 2.5, 3)");

test_valid_value("transform", "scale3d(-0.5, 2.5, -3)");
test_valid_value("transform", "scale3d(-50%, 250%, -300%)", "scale3d(-0.5, 2.5, -3)");

test_valid_value("transform", "rotate(0)", "rotate(0deg)");
test_valid_value("transform", "rotate(90deg)");
Expand Down
6 changes: 3 additions & 3 deletions css/css-transforms/transform-scale-percent-001.html
Expand Up @@ -6,15 +6,15 @@
<link rel="author" title="Aryeh Gregor" href="mailto:ayg@aryeh.name">
<link rel="help" href="http://www.w3.org/TR/css-transforms-1/#two-d-transform-functions">
<link rel="help" href="http://www.w3.org/TR/css-transforms-1/#funcdef-scale">
<meta name="assert" content='This tests that scale(50%, 50%) does nothing,
because scale() is defined to take numbers and not percentages.'>
<meta name="assert" content='This tests that scale(50%, 75%) is equivalent to scale(0.5, 0.75),
because scale() is defined to accept both numbers and percentages.'>
<link rel="match" href="transform-scale-percent-ref.html">
<style>
div {
background: green;
width: 100px;
height: 100px;
transform: scale(50%, 50%);
transform: scale(50%, 75%);
}
</style>
</head>
Expand Down
1 change: 1 addition & 0 deletions css/css-transforms/transform-scale-percent-ref.html
Expand Up @@ -9,6 +9,7 @@
background: green;
width: 100px;
height: 100px;
transform: scale(0.5, 0.75)
}
</style>
</head>
Expand Down

4 comments on commit 9c100c3

@community-tc-integration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitting the task to Taskcluster failed. Details

InterpreterError at template.tasks: object has no property after

@community-tc-integration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitting the task to Taskcluster failed. Details

InterpreterError at template.tasks: object has no property after

@community-tc-integration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitting the task to Taskcluster failed. Details

Schema Validation Failed!
Rejecting Schema: https://community-tc.services.mozilla.com/schemas/queue/v1/create-task-request.json#
Errors:

  • data.metadata.owner should match format "email"

  • method: createTask
  • errorCode: InputValidationError
  • statusCode: 400
  • time: 2019-12-02T00:33:08.404Z

@community-tc-integration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitting the task to Taskcluster failed. Details

Schema Validation Failed!
Rejecting Schema: https://community-tc.services.mozilla.com/schemas/queue/v1/create-task-request.json#
Errors:

  • data.metadata.owner should match format "email"

  • method: createTask
  • errorCode: InputValidationError
  • statusCode: 400
  • time: 2019-12-02T00:33:12.672Z

Please sign in to comment.