Auto merge of #13159 - emilio:negative-calc, r=notriddle

style: Don't incorrectly clamp values in calc that might not be only lengths.

<!-- 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 #__ (github issue number if applicable).

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

<!-- 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/13159)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-09-02 11:10:01 -05:00 committed by GitHub
commit 51bb125189
12 changed files with 97 additions and 48 deletions

View file

@ -3648,6 +3648,18 @@
"url": "/_mozilla/css/multiple_css_class_a.html"
}
],
"css/negative-calc-cv.html": [
{
"path": "css/negative-calc-cv.html",
"references": [
[
"/_mozilla/css/negative-calc-cv-ref.html",
"=="
]
],
"url": "/_mozilla/css/negative-calc-cv.html"
}
],
"css/negative_margin_uncle_a.html": [
{
"path": "css/negative_margin_uncle_a.html",
@ -13030,6 +13042,18 @@
"url": "/_mozilla/css/multiple_css_class_a.html"
}
],
"css/negative-calc-cv.html": [
{
"path": "css/negative-calc-cv.html",
"references": [
[
"/_mozilla/css/negative-calc-cv-ref.html",
"=="
]
],
"url": "/_mozilla/css/negative-calc-cv.html"
}
],
"css/negative_margin_uncle_a.html": [
{
"path": "css/negative_margin_uncle_a.html",

View file

@ -0,0 +1,16 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test Reference</title>
<style>
.container {
width: 500px;
}
.kid {
height: 50px;
background: green;
width: 40px;
}
</style>
<div class="container">
<div class="kid"></div>
</div>

View file

@ -0,0 +1,17 @@
<!doctype html>
<meta charset="utf-8">
<title>A negative length in a calc() expression isn't incorrectly clamped.</title>
<link rel="match" href="negative-calc-cv-ref.html">
<style>
.container {
width: 500px;
}
.kid {
height: 50px;
background: green;
width: calc(-10px + 10%);
}
</style>
<div class="container">
<div class="kid"></div>
</div>