-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add calc() resolution parsing support
R=xiaochengh, futhark, pdr Bug: 983613 Change-Id: I53be579cca601cddbd87981cebe08a62b914b79c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4330619 Commit-Queue: Traian Captan <[email protected]> Reviewed-by: Xiaocheng Hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1121484}
- Loading branch information
1 parent
4548f5b
commit dbc697f
Showing
7 changed files
with
87 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
16 changes: 16 additions & 0 deletions
16
css/css-images/image-set/image-set-calc-x-rendering-2.html
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,16 @@ | ||
<!DOCTYPE html> | ||
<title>Image set calc x rendering</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-images-4/#image-set-notation"> | ||
<link rel="match" href="reference/image-set-rendering-ref.html"> | ||
<meta name="assert" content="image-set calc x rendering"> | ||
<style> | ||
#test { | ||
background-image: image-set( | ||
url("/images/green.png") calc(0.5x * 2), | ||
url("/images/red.png") 2x | ||
); | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
<div id="test"></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,13 @@ | ||
<!DOCTYPE html> | ||
<title>Image set calc x rendering</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-images-4/#image-set-notation"> | ||
<link rel="match" href="reference/image-set-rendering-ref.html"> | ||
<meta name="assert" content="image-set calc x rendering"> | ||
<style> | ||
#test { | ||
background-image: image-set(url("/images/green.png") calc(0.5x * 2)); | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
<div id="test"></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
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
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,20 @@ | ||
<!DOCTYPE html> | ||
<title>Test: support for calc resolution in Media Queries</title> | ||
<link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation"> | ||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht"> | ||
<meta name="assert" content="calc resolution can be used in Media Queries"> | ||
<style> | ||
#test { | ||
width: 100px; | ||
height: 100px; | ||
background-color: red; | ||
} | ||
|
||
@media (resolution >= calc(2x - 96dpi)){ | ||
#test { | ||
background-color: green; | ||
} | ||
} | ||
</style> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div id="test"></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