Closed Bug 1610815 Opened 4 years ago Closed 2 years ago

[css-values-4] Add svh/svw, lvh/lvw, dvh/dvw length units (and *i/*b logical versions)

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: mozilla-apprentice, Assigned: hiro)

References

(Blocks 4 open bugs, )

Details

(Keywords: dev-doc-complete)

Attachments

(5 files)

A resolution was made for csswg-drafts/#4329.

[css-values-4] Add vhc value

  • RESOLVED: Add a set of viewport units (vhc for ex.) that reflect the size of the layout viewport less all UA UI

Discussion.

(Note that the WG may still bikeshed the actual names to be used.)

vhc has been replaced by the small (sv*), large (lv*) and dynamic (dv*) viewport units in CSS Values 4, following these two decisions: one, two. Will this bug be renamed and repurposed to cover it? If so, it should block https://bugzilla.mozilla.org/show_bug.cgi?id=1531237.

Flags: needinfo?(dholbert)

(In reply to Luke from comment #3)

vhc has been replaced by the small (sv*), large (lv*) and dynamic (dv*) viewport units in CSS Values 4, following these two decisions: one, two.

Thanks for noting that. This was ~expected, per comment 1 here.

Will this bug be renamed and repurposed to cover it?

Yes.

If so, it should block https://bugzilla.mozilla.org/show_bug.cgi?id=1531237.

Yup, makes sense.

Blocks: css-values-4
Flags: needinfo?(dholbert)
Summary: [css-values-4] Add vhc value → [css-values-4] Add svh/svw, lvh/lvw, dvh/dvw length units (and *i/*b logical versions)
Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED

Depends on D143252

Depends on: 1763741

This applies on top of the current version of D143252 and was sorta what I meant. Does something like this make sense to you? I don't think we need to care about the viewport vs dynamic viewport distinction in the computed style, in the sense that I expect elements using viewport units to be few, but if you think otherwise we can keep it.

The main thing I wanted is not having two different code paths to invalidate these, this makes the media query codepath call into InvalidateForViewportUnits(). What do you think about something like this?

Flags: needinfo?(hikezoe.birchill)
Comment on attachment 9271421 [details] [diff] [review]
Invalidation tweaks.

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

::: servo/ports/geckolib/glue.rs
@@ +7369,5 @@
> +    let device = document_data.stylist.device();
> +    if !device.used_viewport_size() {
> +        return;
> +    }
> +    if dynamic_only && !device.used_viewport_size() {

This should be used_dynamic_viewport_size of course, d'oh.
Pushed by hikezoe.birchill@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f0bf24a9a519
Implement new {small,large,dynamic} viewport units. r=emilio
https://hg.mozilla.org/integration/autoland/rev/d9a19df80e22
Implement new *vi and *vb units. r=emilio
https://hg.mozilla.org/integration/autoland/rev/32d002922d49
Fix a race condition in viewport-units-keyframes.html where an animation inside an iframe gets started before the iframe gets sized. r=emilio
https://hg.mozilla.org/integration/autoland/rev/f7e13fe01ee4
Use standards mode and specify `height:100%` to <body> not reply on a weird quirk mode behavior. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/33599 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Severity: normal → --
Type: defect → enhancement
Component: Layout → CSS Parsing and Computation
Flags: needinfo?(hikezoe.birchill)

Documentation has been updated for new viewport sizes and new viewport-percentage units. Documentation has also been updated for the support of vi and vb units.
Doc: https://developer.mozilla.org/en-US/docs/Web/CSS/length#relative_length_units_based_on_viewport
Release note: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/101
Doc issue tracker (including issues pending review and approval): https://github.com/mdn/content/issues/15465

Regressions: 1774224
Depends on: 1779396

I suppose bug 1779396 needs this new viewport units work.

Blocks: 1779396
No longer depends on: 1779396
Regressions: 1839238
Blocks: 1839238
No longer regressions: 1839238
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: