Closed Bug 1274526 Opened 8 years ago Closed 8 years ago

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

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: edgar, Assigned: edgar)

References

(Blocks 1 open bug, )

Details

(Keywords: dev-doc-complete)

Attachments

(2 files, 3 obsolete files)

      No description provided.
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
Attached 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.
Attachment #8754757 - Attachment is obsolete: true
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.
Address review comment #9.
Attachment #8755254 - Attachment is obsolete: true
Attachment #8755299 - Flags: review+
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
https://hg.mozilla.org/mozilla-central/rev/929092ee1097
https://hg.mozilla.org/mozilla-central/rev/bfa847fd5f53
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: