[cssom-view] Extend checkVisibility to expose content-visibility: auto state
Categories
(Core :: Layout, defect)
Tracking
()
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
Comment 1•6 months ago
|
||
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.
Comment 2•6 months ago
|
||
The name was resolved to be contentVisibilityAuto
. See https://github.com/w3c/csswg-drafts/pull/9549
Comment 3•5 months ago
|
||
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.
Assignee | ||
Comment 4•5 months ago
|
||
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
Updated•5 months ago
|
Updated•5 months ago
|
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
Updated•5 months ago
|
Comment 6•5 months ago
|
||
bugherder |
Comment 7•4 months ago
•
|
||
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
Comment 8•4 months ago
|
||
Note, I have marked as dev-doc-complete but things are still in review, and more work might be needed following your response above.
Description
•