Closed Bug 1596800 Opened 5 months ago Closed 5 months ago

Remove document.getBindingParent and document.getAnonymousNodes DOM APIs.


(Core :: DOM: Core & HTML, task)

Not set



Tracking Status
firefox72 --- fixed


(Reporter: emilio, Assigned: emilio)


(Blocks 1 open bug)



(8 files)

There are various callers in devtools that use it. Most of it want to deal with NAC or shadow separately.

There's other callers that want it like PluginChild, which just wants the containing shadow host.

We should expose APIs that allow devtools to work with these easily without document.getBindingParent.

I propose:

partial interface Node {
    ShadowRoot? containingShadowRoot;
    boolean isNativeAnonymous;

Maybe we could expose more conveniences like containingShadowHost or closestNonNativeAnonymousNode or something, but these two would do the job I think.

Then we can remove document.getBindingParent.

We don't need layout flushes to attach XBL bindings anymore, as there are no XBL
bindings. This is drive-by.

Depends on D53336

It wants to get the containing shadow host of the target to get to the plugin.
Do that explicitly.

Depends on D53337

When the focus moves elsewhere inside the <tree> blur events aren't dispatched
outside the shadow tree (as expected), so checking the originalTarget is always

Furthermore, the event handler does nothing if the input isn't focused, and
when the input is blurred the tree takes care of calling stopEditing itself, so
this change should be pretty safe in general:

It's not clear to me whether the blur event handler is doing anything at all
after bug 1547382 (before this patch), as the binding parent is not a
<xul:textbox> anymore, so <input>.getBindingParent() will return the <tree>...

Depends on D53338

This removes the concept of shadowAnonymous, which doesn't make a lot of sense,
and re-enables the shadow dom tests which were disabled when we removed the old
style system (as stylo didn't supported shadow DOM yet by then).

This is a change in behavior as you can now remove nodes from shadow DOM (no
reason you weren't able to, before).

Depends on D53339

This preserves the behavior, though I think we could probably remove that block

Depends on D53340

As it always returns null.

Depends on D53342

Jorg, there are a few uses of this API in comm-central/suite/. I think you don't care about that code, but just double-checking.

Let me know if you do and I can land most of the removal without removing the actual API for now, or what not.

Flags: needinfo?(jorgk)
Assignee: nobody → emilio

Hi Emilio. SeaMonkey (using the suite/ code) isn't in a good shape beyond the equivalent of mozilla60 (sixty, no typo), which they haven't even released yet. TB with about 10 staff has replaced all overlays, XBL bindings and are now working on the XUL to XHTML transition. SM has done none of that work, so at trunk, they can compile but not start :-( - We removed getAnonymousNodes in bug 1591361, so do whatever you need to do.

Flags: needinfo?(jorgk)
See Also: → 1597245
See Also: → 1597318
Duplicate of this bug: 1591147
Blocks: 1584019
Summary: Remove document.getBindingParent DOM API. → Remove document.getBindingParent and document.getAnonymousNodes DOM APIs.
Pushed by
Add two chromeonly attributes to replace getBindingParent. r=smaug
Pushed by
Remove unneeded forced layout flush in PluginChild.jsm. r=mconley
Remove document.getBindingParent usage from PluginChild.jsm. r=mconley
Remove document.getBindingParent usage from preferences search. r=mconley
Remove document.getBindingParent usage from devtools. r=jdescottes
Remove document.getBindingParent usage from autocomplete-popup. r=mconley
Remove document.getBindingParent. r=smaug
Remove document.getAnonymousNodes as well. r=smaug
You need to log in before you can comment on or make changes to this bug.