Auto merge of #16157 - n0max:perspective_parse_non_negative, r=emilio

Parse perspective property as non negative and add tests

<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15449  (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16157)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-03-29 15:12:07 -05:00 committed by GitHub
commit b783cacc54
4 changed files with 50 additions and 0 deletions

View file

@ -11123,6 +11123,12 @@
{}
]
],
"css/perspective.html": [
[
"/_mozilla/css/perspective.html",
{}
]
],
"css/stylesheet_media_queries.html": [
[
"/_mozilla/css/stylesheet_media_queries.html",
@ -22782,6 +22788,10 @@
"001acfd664f89e45ab321bf549803ca24d44e098",
"support"
],
"css/perspective.html": [
"6d455ef4b9c815d89917f496999268d7410cfa62",
"testharness"
],
"css/perspective_zero.html": [
"bcb877f51808e896d8024877f945ce289dbc6b36",
"reftest"

View file

@ -0,0 +1,28 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: parsing perspective property</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="test"></div>
<script>
test(function () {
var test = document.getElementById('test');
var tests = [
["none", "none"],
["0px", "0px"],
["100px", "100px"],
["-200px", ""],
["300PX", "300px"],
];
for (var i = 0; i < tests.length; ++i) {
var specified = tests[i][0];
var expected = tests[i][1];
test.style.perspective = specified;
assert_equals(test.style.perspective, expected);
test.style.perspective = '';
}
}, "Parsing of the perspective property");
</script>