Closed Bug 1410790 Opened 7 years ago Closed 7 years ago

Add more assertion in CustomElementData::SetCustomElementDefinition and GetCustomElementDefinition to ensure that we only set CustomElementDefinition on a custom element which is "custom"

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: edgar, Assigned: edgar)

References

Details

Attachments

(1 file, 1 obsolete file)

This is a follow-up of bug 1392970. Since we only set CustomElementDefinition on a custom element which is "custom", we could add more assertion to ensure that.
Comment on attachment 8920976 [details] [diff] [review]
Patch, v1

Review of attachment 8920976 [details] [diff] [review]:
-----------------------------------------------------------------

This patch does following things,
- Move mCustomElementDefinition to private member of CustomElementData.
- Add assertion to ensure that we set CustomElementDefinition when the state in CustomElementData is "custom".
- Add assertion to ensure that the type of CustomElementDefinition should match with the element.
- Do sanity check in GetCustomElementDefinition().
Attachment #8920976 - Flags: review?(bugs)
Comment on attachment 8920976 [details] [diff] [review]
Patch, v1

>+CustomElementData::Traverse(nsCycleCollectionTraversalCallback &cb) const
Nit, nsCycleCollectionTraversalCallback& aCb

>+  void Traverse(nsCycleCollectionTraversalCallback &cb) const;
same here
Attachment #8920976 - Flags: review?(bugs) → review+
Address review comment #3.
Attachment #8920976 - Attachment is obsolete: true
Attachment #8922178 - Flags: review+
Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fda6993fe732
Add more assertion in CustomElementData::SetCustomElementDefinition and GetCustomElementDefinition; r=smaug
https://hg.mozilla.org/mozilla-central/rev/fda6993fe732
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: