Closed Bug 1560061 Opened 6 years ago Closed 6 years ago

ConnectRoot(this.shadowRoot) not working

Categories

(Core :: Internationalization, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: danielleleb12, Assigned: zbraniecki)

Details

Attachments

(1 file)

document.l10n.connectRoot(this.shadowRoot) throws the console error "TypeError: Argument 1 of DOMLocalization.connectRoot does not implement interface Element."

To handle that we need to accept a type that can be a shadowRoot or an Element, and use the same type for DOMLocalization::mRoots.

smaug - what type should I use?

Flags: needinfo?(bugs)

nsINode would be the common type.
But should .l10n live in Document or in DocumentOrShadowRoot interface?

Flags: needinfo?(bugs)

(In reply to Olli Pettay [:smaug] from comment #2)

nsINode would be the common type.
Or nsIContent

Component: General → Localization
Product: Firefox → Core
Component: Localization → Internationalization
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Priority: -- → P2

Added a sanity test. There's more to solve wrt. shadow dom that :jaws is handling in bug 1555947 and bug 1553176, but this will allow for the document's l10n context to be used to cover shadowRoot.

Pushed by zbraniecki@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/287a417a3f89 Make DOMLocalization support ShadowDOM as roots. r=smaug
Pushed by malexandru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0581a4a4bdf3 Fix linting issues in test_connectRoot_webcomponent.html r=gandalf CLOSED TREE
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69

== Change summary for alert #21628 (as of Thu, 27 Jun 2019 09:58:05 GMT) ==

Improvements:

36% build times linux32-shippable opt nightly taskcluster-m4.4xlarge 7,558.74 -> 4,871.14

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=21628

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

Attachment

General

Created:
Updated:
Size: