Closed Bug 1813467 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 38250 - Add resolution units support in css image-set (1 of 2)

Categories

(Core :: Layout: Images, Video, and HTML Frames, task, P4)

task

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 38250 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/38250
Details from upstream follow.

Traian Captan <tcaptan@chromium.org> wrote:

Add resolution units support in css image-set (1 of 2)

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 parsing 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.

The next change, #2, will address the computed style value which
is expected to be converted to the canonical unit for resolution
type (dppx).

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
Low-Coverage-Reason: Previous image-set resolution parsing logic in css_parsing_utils.cc
Change-Id: Ic05afa3bc1b5ed6927c309426cd55953da7bf0db

Reviewed-on: https://chromium-review.googlesource.com/4201198
WPT-Export-Revision: b7847aabf915eb33c426adb05e4475d39b9a89ce

Component: web-platform-tests → Layout: Images, Video, and HTML Frames
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/83000f597e19 [wpt PR 38250] - Add resolution units support in css image-set, a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Regressions: 1815080
You need to log in before you can comment on or make changes to this bug.