Closed Bug 1527680 Opened 5 years ago Closed 5 years ago

Come up with a more consistent pattern for inheriting attributes for MozElement Custom Elements

Categories

(Toolkit :: UI Widgets, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: bgrins, Assigned: bgrins)

References

Details

Attachments

(2 files)

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:

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.

Attachment #9043709 - Attachment description: Bug 1527680 - WIP - Add helper for automatically inheriting attributes based on a map of selectors to attributes → Bug 1527680 - Add MozElement `inheritedAttributes` helper for automatically inheriting attributes based on a Map of selectors to attributes
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Summary: Come up with a more consistent patter for inheriting attributes for MozElement Custom Elements → Come up with a more consistent pattern for inheriting attributes for MozElement Custom Elements
Blocks: 1500626, 1519502
Blocks: 1528268
Attachment #9043709 - Attachment description: Bug 1527680 - Add MozElement `inheritedAttributes` helper for automatically inheriting attributes based on a Map of selectors to attributes → Bug 1527680 - Add MozElement `inheritedAttributes` helper for automatically inheriting attributes based on a map of selectors to attributes
Pushed by bgrinstead@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/66082f22ae11
Add MozElement `inheritedAttributes` helper for automatically inheriting attributes based on a map of selectors to attributes r=paolo

Backed out for merge conflicts on toolkit/content/widgets/popupnotification.js!
Backout link: https://hg.mozilla.org/integration/autoland/rev/79d9076cbaa1c24ca96094e86706952951bb67f6

Flags: needinfo?(bgrinstead)

(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

Flags: needinfo?(bgrinstead)
Pushed by bgrinstead@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/27280189b6fa
Add MozElement `inheritedAttributes` helper for automatically inheriting attributes based on a map of selectors to attributes r=paolo
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Blocks: 1534685
Type: enhancement → task
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: