-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace calls to GetDoubleValue for Media Queries parsing
Bug: 40946458 Change-Id: I59020d16a477edba85f9ded8caef6c58a9b13c2e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5666802 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Daniil Sakhapov <[email protected]> Cr-Commit-Position: refs/heads/main@{#1323686}
- Loading branch information
1 parent
54100d5
commit b62a0d3
Showing
6 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!doctype html> | ||
<title>Test: support for calc with sign() in Media Queries</title> | ||
<link rel="author" title="Daniil Sakhapov" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#units"> | ||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht"> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background-color: red; | ||
} | ||
|
||
@media (width > calc(1px * (1 + sign(16px - 1rem)))) { | ||
div { | ||
background-color: green; | ||
} | ||
} | ||
</style> | ||
|
||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<title>Test: support for calc with sign() in Media Queries</title> | ||
<link rel="author" title="Daniil Sakhapov" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#units"> | ||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht"> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background-color: red; | ||
} | ||
|
||
@media (width > calc(-1px * sign(15px - 1rem))) { | ||
div { | ||
background-color: green; | ||
} | ||
} | ||
</style> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<title>Test: support for calc with sign() in Media Queries</title> | ||
<link rel="author" title="Daniil Sakhapov" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#units"> | ||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht"> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background-color: red; | ||
} | ||
|
||
@media screen and (aspect-ratio > calc(sign(17px - 1rem) * 59) / calc(79 * sign(17px - 1rem))) { | ||
div { | ||
background-color: green; | ||
} | ||
} | ||
</style> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<title>Test: support for calc with sign() in Media Queries</title> | ||
<link rel="author" title="Daniil Sakhapov" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#units"> | ||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht"> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background-color: red; | ||
} | ||
|
||
@media (resolution > calc(-1dppx * sign(17px - 1rem))) { | ||
div { | ||
background-color: green; | ||
} | ||
} | ||
</style> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<title>Test: support for calc with sign() in Media Queries</title> | ||
<link rel="author" title="Daniil Sakhapov" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#units"> | ||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht"> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background-color: red; | ||
} | ||
|
||
@media (grid: calc(2 * sign(16px - 1rem))) { | ||
div { | ||
background-color: green; | ||
} | ||
} | ||
</style> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<title>Test: support for calc with sign() in Media Queries</title> | ||
<link rel="author" title="Daniil Sakhapov" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation"> | ||
<link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#units"> | ||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht"> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background-color: green; | ||
} | ||
|
||
@media (grid: calc(2 * sign(17px - 1rem))) { | ||
div { | ||
background-color: red; | ||
} | ||
} | ||
</style> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> |