Closed Bug 1859852 Opened 6 months ago Closed 5 months ago

[cssom-view] Extend checkVisibility to expose content-visibility: auto state

Categories

(Core :: Layout, defect)

defect

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: mozilla-apprentice, Assigned: jihye, NeedInfo)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(2 files)

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

[css-contain-2] API to expose skipped content state

  • RESOLVED: Extend checkVisibility to expose content-visibility: auto state

Discussion.

We probably want to wait on exact spec-text here, but I figured I'd let mozilla-apprentice file this as a placeholder, since I think this will be actionable once spec text appears.

Summary: [css-contain-2] API to expose skipped content state → [css-contain-2] Extend checkVisibility to expose content-visibility: auto state

The name was resolved to be contentVisibilityAuto. See https://github.com/w3c/csswg-drafts/pull/9549

Summary: [css-contain-2] Extend checkVisibility to expose content-visibility: auto state → [cssom-view] Extend checkVisibility to expose content-visibility: auto state

There is a pending PR to update the spec here: https://github.com/w3c/csswg-drafts/pull/9549

The corresponding WPT test has already been updated: https://wpt.fyi/results/css/cssom-view/checkVisibility.html?label=master&label=experimental&aligned

Attached is a simple patch doing the required change.

This patch adds contentVisibilityAuto as well as alternative names opacityProperty and visibilityProperty for deprecated options.

Related spec edit: https://github.com/w3c/csswg-drafts/pull/9549/files

Attachment #9367857 - Attachment description: WIP: Bug 1859852 - Add options to check for content-visibility: auto to element.checkVisibility() → Bug 1859852 - Add options to check for content-visibility: auto to element.checkVisibility()
Assignee: nobody → jihye
Status: NEW → ASSIGNED
Pushed by cathiechen@igalia.com:
https://hg.mozilla.org/integration/autoland/rev/d504adb7e409
Add options to check for content-visibility: auto to element.checkVisibility() r=emilio
Keywords: dev-doc-needed
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch

FF122 MDN docs work for this can be tracked in https://github.com/mdn/content/issues/31107

Do we consider the new options to Element.checkVisibility() to be behind the flag/in preview? My gut feeling is "no". I think checkVisibility() will always give correct answers whether or not you are in preview - the new aliases will already work too. Am I right, or should these be documented as being behind the flag/preview?

In addition, could I please have a sanity check on the implementation. According to the spec the method should return false by default (with no options set) under two conditions:

    1. If |this| does not have an associated [=CSS/box=], return false.
    1. If an ancestor of |this| in the [=flat tree=] has ''content-visibility: hidden'', return false.

The second point seems to be ignored by our implementation. Specifically if you try this Example on latest Firefox Nightly and select the content-visibility: hidden selector you will see the test box disappear, but the default test does not return false. By contrast, if you set the display: none the test does return false for the default value. The CSS for opacity and visibility does the right thing. The PR for those particular docs is here https://github.com/mdn/content/pull/31322

Flags: needinfo?(jihye)

Note, I have marked as dev-doc-complete but things are still in review, and more work might be needed following your response above.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: