mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
style: Don't incorrectly clamp values in calc that might not be only lengths.
Expressions with percentages may be negative or positive at computed value time. So, we can only clamp lengths at computed value time, which is what the other browsers do.
This commit is contained in:
parent
fbf77e40fe
commit
d02c5b0281
12 changed files with 97 additions and 48 deletions
|
@ -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",
|
||||
|
|
16
tests/wpt/mozilla/tests/css/negative-calc-cv-ref.html
Normal file
16
tests/wpt/mozilla/tests/css/negative-calc-cv-ref.html
Normal 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>
|
17
tests/wpt/mozilla/tests/css/negative-calc-cv.html
Normal file
17
tests/wpt/mozilla/tests/css/negative-calc-cv.html
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue