Come up with a more consistent pattern for inheriting attributes for MozElement Custom Elements
Categories
(Toolkit :: UI Widgets, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox67 | --- | fixed |
People
(Reporter: bgrins, Assigned: bgrins)
References
Details
Attachments
(2 files)
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
13.92 KB,
patch
|
Details | Diff | Splinter Review |
Previous discussions about this can be seen in Bug 1502947 and Bug 1523429 and in the reviews of the patches there.
Current inheritAttribute helper: https://searchfox.org/mozilla-central/rev/cb7faaf6b4ad2528390186f1ce64618dea71031e/toolkit/content/customElements.js#63
Some examples of how we do this currently:
- Explicit (<menulist>): https://searchfox.org/mozilla-central/rev/cb7faaf6b4ad2528390186f1ce64618dea71031e/toolkit/content/widgets/menulist.js#376
- Map + explicit (autocomplete <richlistitem>): https://searchfox.org/mozilla-central/source/toolkit/content/widgets/autocomplete-richlistitem.js#82-114
- Map + [inherit] attribute (<popupnotification>): https://searchfox.org/mozilla-central/rev/cb7faaf6b4ad2528390186f1ce64618dea71031e/toolkit/content/widgets/popupnotification.js#44-60
-- Note: works for content where we don’t nest more elements underneath that will also set [inherits], otherwise we’ll incorrectly map down to nested children. Wouldn’t be a problem with Shadow DOM
Having some kind of static map with type of <selector, <array<attribute>> would allow observedAttributes to be read by processing the map instead of having them declared separately. We'd have to sort out when to cache (and invalidate) the results of querySelector.
| Assignee | ||
Comment 1•7 years ago
|
||
Updated•7 years ago
|
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Updated•7 years ago
|
Comment 2•7 years ago
|
||
Updated•7 years ago
|
Comment 4•7 years ago
|
||
Backed out for merge conflicts on toolkit/content/widgets/popupnotification.js!
Backout link: https://hg.mozilla.org/integration/autoland/rev/79d9076cbaa1c24ca96094e86706952951bb67f6
| Assignee | ||
Comment 5•7 years ago
|
||
(In reply to Cosmin Sabou [:CosminS] from comment #4)
Backed out for merge conflicts on toolkit/content/widgets/popupnotification.js!
Backout link: https://hg.mozilla.org/integration/autoland/rev/79d9076cbaa1c24ca96094e86706952951bb67f6
Rebased and relanded
Comment 7•7 years ago
|
||
| bugherder | ||
Updated•7 years ago
|
Description
•