Skip to content

Document named properties: drop object/embed exposedness - #62149

Merged
annevk merged 1 commit into
masterfrom
document-named-properties-exposedness
Aug 24, 2026
Merged

Document named properties: drop object/embed exposedness#62149
annevk merged 1 commit into
masterfrom
document-named-properties-exposedness

Conversation

@annevk

@annevk annevk commented Aug 22, 2026

Copy link
Copy Markdown
Member

Per the proposal in whatwg/html#12787, stop filtering <object>/<embed> elements by exposedness for document named properties, matching Gecko.

@zcorpan

zcorpan commented Aug 24, 2026

Copy link
Copy Markdown
Member

Can you rebase? The META.yml issue seems to have been fixed.

zcorpan pushed a commit to whatwg/html that referenced this pull request Aug 24, 2026
The "exposed" concept filtered object and embed elements out of a
Document's supported property names and named property lookup, based on
fallback content state, object and embed descendants, and, recursively,
object ancestors. No implementation matched it: Gecko ignored it
entirely, while Blink and WebKit ignored fallback content state for
lookup and ignored exposedness altogether for supported property names,
so Object.getOwnPropertyNames(document) could report a name that
resolved to undefined.

Follow Gecko and drop the filtering. These are legacy features and
choosing a corrected version of the nesting-based approximation is not
worth the complexity. This removes the only use of "exposed".

Tests: web-platform-tests/wpt#62149

Fixes #12787.
No browser implements the "exposed" filtering for document named
properties consistently, and the nested-object assertions in
nameditem-names.html fail everywhere. Follow the proposal in
whatwg/html#12787 and stop distinguishing exposed from unexposed
object and embed elements.

Also add coverage for the named property value algorithm with nested
object and embed elements, which had none: nameditem-names.html only
exercises the supported property names algorithm, so the fact that
implementations disagree between the two went untested.

For whatwg/html#12787.
webkit-commit-queue pushed a commit to annevk/WebKit that referenced this pull request Aug 24, 2026
… by exposedness

https://bugs.webkit.org/show_bug.cgi?id=322330

Reviewed by Chris Dumez.

The HTML specification's "exposed" concept, which no engine implemented
consistently, is being removed: whatwg/html#12787

WebKit applied isExposed() when resolving a name but not when enumerating
supported property names, so Object.getOwnPropertyNames(document) could
report a name that resolved to undefined. Stop consulting it, matching
Gecko. Two behavior changes: an object or embed element nested in an
object element with the same name or id now matches alongside its
ancestor, so lookup returns an HTMLCollection rather than the innermost
element; and an object element with object or embed descendants is now
reachable by its name and id.

Tests imported from web-platform-tests/wpt#62149

Tests: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-empty-name-dynamic-crash.html
       imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-img-name-added-cached-list.html
       imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-img-name-added.html
       imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-img-name-dynamic.html
       imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-img-name-removed.html
       imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-no-shadowing.tentative.html
       imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-tree-order.html

Canonical link: https://commits.webkit.org/319699@main
@annevk
annevk force-pushed the document-named-properties-exposedness branch from 11185ac to 594a0da Compare August 24, 2026 14:54
@annevk
annevk enabled auto-merge (rebase) August 24, 2026 14:54
@annevk
annevk merged commit 422f0eb into master Aug 24, 2026
24 of 25 checks passed
@annevk
annevk deleted the document-named-properties-exposedness branch August 24, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants