Closed Bug 1596800 Opened 5 years ago Closed 5 years ago

Remove document.getBindingParent and document.getAnonymousNodes DOM APIs.

Categories

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

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(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
bogus.

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:

https://searchfox.org/mozilla-central/rev/492214c05cde6e6db5feff9465ece4920400acc3/toolkit/content/widgets/tree.js#1083

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
altogether?

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
Summary: Remove document.getBindingParent DOM API. → Remove document.getBindingParent and document.getAnonymousNodes DOM APIs.
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5a76ddcb1ac1
Add two chromeonly attributes to replace getBindingParent. r=smaug
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/85408aaba4a3
Remove unneeded forced layout flush in PluginChild.jsm. r=mconley
https://hg.mozilla.org/integration/autoland/rev/5bc4fbe48df7
Remove document.getBindingParent usage from PluginChild.jsm. r=mconley
https://hg.mozilla.org/integration/autoland/rev/cceae677e859
Remove document.getBindingParent usage from preferences search. r=mconley
https://hg.mozilla.org/integration/autoland/rev/c2817cb86453
Remove document.getBindingParent usage from devtools. r=jdescottes
https://hg.mozilla.org/integration/autoland/rev/d5db2146b9c5
Remove document.getBindingParent usage from autocomplete-popup. r=mconley
https://hg.mozilla.org/integration/autoland/rev/26d109ef85da
Remove document.getBindingParent. r=smaug
https://hg.mozilla.org/integration/autoland/rev/ba115d212e18
Remove document.getAnonymousNodes as well. r=smaug
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: