Closed
Bug 1462798
Opened 6 years ago
Closed 6 years ago
Create a base custom element class that shares the parseXULToFragment helper
Categories
(Toolkit :: UI Widgets, task)
Toolkit
UI Widgets
Tracking
()
RESOLVED
FIXED
mozilla62
Tracking | Status | |
---|---|---|
firefox62 | --- | fixed |
People
(Reporter: bgrins, Assigned: bgrins)
References
Details
Attachments
(1 file)
We'll want to share the parseXULToFragment function (and other helpers) across multiple elements. For more discussion, see https://bugzilla.mozilla.org/show_bug.cgi?id=1459556#c36 and https://bugzilla.mozilla.org/show_bug.cgi?id=1459556#c37. One way to achieve this would be to make a new customElements.js file, move the stuff happening during "document-element-inserted" in MainProcessSingleton in there, and load just that file from MainProcessSingleton. Then we could attach a class like MozXULElement to the window, with a static parseXULToFragment function. CE classes would then extend MozXULElement.
Assignee | ||
Updated•6 years ago
|
Blocks: war-on-xbl
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 5•6 years ago
|
||
Paolo, what do you think about landing this change ahead of Bug 1459556 instead of vice versa? Would limit the amount of churn if that changeset could use the shared helper right away.
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Comment hidden (mozreview-request) |
Comment 7•6 years ago
|
||
Comment on attachment 8977114 [details] Bug 1462798 - Create a base custom element class that shares the parseXULToFragment helper; Super! When we introduce classes that extend something different from XULElement, we may want to add the mixin part, but for now this looks great!
Attachment #8977114 -
Flags: review?(paolo.mozmail) → review+
Assignee | ||
Comment 8•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=711d0b0b82179659910b5d67132d50a6f03bd6f7
Assignee | ||
Comment 9•6 years ago
|
||
For some reason the r+ didn't get carried over into mozreview so I can't push this to autoland.
Flags: needinfo?(paolo.mozmail)
Assignee | ||
Comment 10•6 years ago
|
||
Switching to block bug 1459556 as suggested in Comment 5
Comment 11•6 years ago
|
||
mozreview-review |
Comment on attachment 8977114 [details] Bug 1462798 - Create a base custom element class that shares the parseXULToFragment helper; https://reviewboard.mozilla.org/r/245192/#review251310
Comment 12•6 years ago
|
||
mozreview-review |
Comment on attachment 8977114 [details] Bug 1462798 - Create a base custom element class that shares the parseXULToFragment helper; https://reviewboard.mozilla.org/r/245192/#review251314 ::: toolkit/content/customElements.js:53 (Diff revision 5) > + // stripped out, so we simply remove all text nodes after using the parser. > + let nodeIterator = doc.createNodeIterator(doc, NodeFilter.SHOW_TEXT); > + let currentNode = nodeIterator.nextNode(); > + while (currentNode) { > + currentNode.remove(); > + currentNode = nodeIterator.nextNode(); nit: you can use the double parenthesis here to reduce repetition and pass the linter, like while((a = b())).
Comment 13•6 years ago
|
||
Pushed by bgrinstead@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7c4c86f3913f Create a base custom element class that shares the parseXULToFragment helper;r=Paolo
Comment 14•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7c4c86f3913f
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox62:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Updated•6 years ago
|
Flags: needinfo?(paolo.mozmail)
Updated•5 years ago
|
Type: enhancement → task
You need to log in
before you can comment on or make changes to this bug.
Description
•