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

RESOLVED FIXED in Firefox 58

Status

()

Core
DOM
P3
normal
RESOLVED FIXED
28 days ago
24 days ago

People

(Reporter: edgar, Assigned: edgar)

Tracking

Trunk
mozilla58
Points:
---

Firefox Tracking Flags

(firefox58 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

28 days ago
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.
(Assignee)

Comment 1

28 days ago
Created attachment 8920976 [details] [diff] [review]
Patch, v1

https://treeherder.mozilla.org/#/jobs?repo=try&revision=1d9c8b96ae1d62484d95ffcb5b0b8b03c3f81c85
(Assignee)

Comment 2

27 days ago
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 3

27 days ago
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+
(Assignee)

Comment 4

25 days ago
Created attachment 8922178 [details] [diff] [review]
Patch, v2, r=smaug

Address review comment #3.
Attachment #8920976 - Attachment is obsolete: true
Attachment #8922178 - Flags: review+

Comment 5

25 days ago
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
Last Resolved: 24 days ago
status-firefox58: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.