Support 'q' absolute length units from CSS3 values and units

RESOLVED FIXED in Firefox 49

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: edgar, Assigned: edgar)

Tracking

(Blocks: 1 bug, {dev-doc-complete})

unspecified
mozilla49
dev-doc-complete
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox49 fixed)

Details

(URL)

Attachments

(2 attachments, 3 obsolete attachments)

Comment hidden (empty)
Summary: Support → Support 'q' absolute length units from CSS3 values and units
https://www.w3.org/TR/css-values/#absolute-lengths

unit  | name                  | equivalence 
------+-----------------------+--------------------
q     | quarter-millimeters   | 1q = 1/40th of 1cm
I have a WIP patch, will attach it soon.
Assignee: nobody → echen
Posted patch WIP Patch, v1 (obsolete) — Splinter Review
Test case: http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=4221
Expect result: all div block should have the exact same width and height.
Comment on attachment 8755254 [details] [diff] [review]
Part 1: Implement support for 'q' absolute length units in CSS, v2

Review of attachment 8755254 [details] [diff] [review]:
-----------------------------------------------------------------

Add support for 'q' absolute length unit, see spec https://www.w3.org/TR/css-values/#absolute-lengths.
And also add test case for 'q' unit in test_pixel_lengths.html.

Hi Cameron, may I have your review? Thank you.
Attachment #8755254 - Flags: review?(cam)
Comment on attachment 8755255 [details] [diff] [review]
Part 2: Update web-platform-test expectation for parse-a-sizes-attribute.html, v1

Review of attachment 8755255 [details] [diff] [review]:
-----------------------------------------------------------------

Patch part1 adds the support for 'q' length unit, so we can pass some tests in parse-a-sizes-attribute.html.
Hi Josh, may I have your review? Thank you.
Attachment #8755255 - Flags: review?(josh)
Comment on attachment 8755254 [details] [diff] [review]
Part 1: Implement support for 'q' absolute length units in CSS, v2

Review of attachment 8755254 [details] [diff] [review]:
-----------------------------------------------------------------

This looks fine, although I wonder if it's important to support the "q" unit.  It is in the CSS Values & Units CR, but as far as I know no other browser implements it.  I see it's the last length unit from css-values-3 that we don't support, though, and it's easy, so I guess there's little downside.

::: layout/style/nsCSSValue.h
@@ +364,5 @@
>    eCSSUnit_Millimeter   = 902,    // (float) 96/25.4 CSS pixels
>    eCSSUnit_Centimeter   = 903,    // (float) 96/2.54 CSS pixels
>    eCSSUnit_Pica         = 904,    // (float) 12 points == 16 CSS pixls
>    eCSSUnit_Pixel        = 905,    // (float) CSS pixel unit
> +  eCSSUnit_Quarter      = 906,    // (float) 96/101.6 CSS pixels

In a way I think it's nice to have eCSSUnit_Pixel be the last one in this group of absolute lengths.  Can you make eCSSUnit_Quarter = 905 and eCSSUnit_Pixel = 906?
Attachment #8755254 - Flags: review?(cam) → review+
Attachment #8755255 - Flags: review?(josh) → review+
(In reply to Cameron McCormack (:heycam) from comment #9)
> Comment on attachment 8755254 [details] [diff] [review]
> Part 1: Implement support for 'q' absolute length units in CSS, v2
> 
> Review of attachment 8755254 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> This looks fine, although I wonder if it's important to support the "q"
> unit.  It is in the CSS Values & Units CR, but as far as I know no other
> browser implements it.  I see it's the last length unit from css-values-3
> that we don't support, though, and it's easy, so I guess there's little
> downside.
> 
> ::: layout/style/nsCSSValue.h
> @@ +364,5 @@
> >    eCSSUnit_Millimeter   = 902,    // (float) 96/25.4 CSS pixels
> >    eCSSUnit_Centimeter   = 903,    // (float) 96/2.54 CSS pixels
> >    eCSSUnit_Pica         = 904,    // (float) 12 points == 16 CSS pixls
> >    eCSSUnit_Pixel        = 905,    // (float) CSS pixel unit
> > +  eCSSUnit_Quarter      = 906,    // (float) 96/101.6 CSS pixels
> 
> In a way I think it's nice to have eCSSUnit_Pixel be the last one in this
> group of absolute lengths.  Can you make eCSSUnit_Quarter = 905 and
> eCSSUnit_Pixel = 906?

Will do. Thank you.
Just update reviewer field to 'r=heycam' in commit message.
Attachment #8755301 - Flags: review+
Attachment #8755255 - Attachment is obsolete: true
Keywords: checkin-needed
Status: NEW → ASSIGNED
Keywords: dev-doc-needed

Comment 15

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/929092ee1097
https://hg.mozilla.org/mozilla-central/rev/bfa847fd5f53
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox49: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Updated documentation here:
https://developer.mozilla.org/en-US/docs/Web/CSS/length

And added a developer release info here:
https://developer.mozilla.org/en-US/Firefox/Releases/49#CSS

Sebastian
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.