-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add resolution units support in css image-set
Currently only the 'x' (short alias for dots per pixel) resolution unit is supported, and parsing fails for the other units (dppx, dpi, dpcm). Based on the image set spec, all the resolution units should be supported. This change adds image-set support for all the resolution units, and adds full support for the 'x' resolution unit instead of treating it as only a parse time alias of the 'dppx' unit. Spec definitions: [1] "The syntax for image-set() is: <image-set()> = image-set( <image-set-option># ) <image-set-option> = [ <image> | <string> ] [ <resolution> || type(<string>) ] Each <string> inside image-set() represents a <url>." [2] "Resolution units are dimensions denoted by <resolution>. The resolution unit identifiers are: 'dpi' - Dots per inch. 'dpcm' - Dots per centimeter. 'dppx', 'x' - Dots per px unit. The <resolution> unit represents the size of a single 'dot' in a graphical representation by indicating how many of these dots fit in a CSS 'in', 'cm', or 'px'. For uses, see e.g. the resolution media query in [MEDIAQ] or the image-resolution property defined in [CSS3-IMAGES]. All <resolution> units are compatible, and 'dppx' is their canonical unit." [1] https://w3c.github.io/csswg-drafts/css-images-4/#image-set-notation [2] https://www.w3.org/TR/css-values-4/#resolution-value R=futhark, masonf, pdr Bug: 1400903, 1412016 Low-Coverage-Reason: Previous image-set resolution parsing logic in css_parsing_utils.cc Change-Id: Ic05afa3bc1b5ed6927c309426cd55953da7bf0db Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4201198 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Traian Captan <tcaptan@chromium.org> Cr-Commit-Position: refs/heads/main@{#1100612}
- Loading branch information
1 parent
5d93320
commit 2c84869
Showing
31 changed files
with
230 additions
and
344 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
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
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
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 |
---|---|---|
|
@@ -84,7 +84,7 @@ | |
}, | ||
{ | ||
name: "x", | ||
unit_type: "kDotsPerPixel", | ||
unit_type: "kX", | ||
}, | ||
{ | ||
name: "vw", | ||
|
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
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
Oops, something went wrong.