Closed
Bug 1274505
Opened 9 years ago
Closed 8 years ago
Remove support of SVG-based custom element
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla50
Tracking | Status | |
---|---|---|
firefox50 | --- | fixed |
People
(Reporter: edgar, Assigned: jdai)
References
Details
(Whiteboard: btpp-active, dom-ce-m1)
Attachments
(1 file, 6 obsolete files)
(deleted),
patch
|
jdai
:
review+
jdai
:
feedback+
|
Details | Diff | Splinter Review |
SVG-based custom element is removed from latest spec [1], we could remove related code from gecko as well.
[1] https://www.w3.org/TR/custom-elements/
Updated•9 years ago
|
Whiteboard: btpp-backlog
Assignee | ||
Comment 1•9 years ago
|
||
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → jdai
Whiteboard: btpp-backlog → btpp-active
Assignee | ||
Comment 2•8 years ago
|
||
Revised patch description.
Hi Edgar, may I have your feedback? Thank you.
Attachment #8759100 -
Attachment is obsolete: true
Attachment #8770021 -
Flags: feedback?(echen)
Assignee | ||
Comment 3•8 years ago
|
||
Comment on attachment 8770021 [details] [diff] [review]
Bug 1274505 - Remove SVG-based custom element support. v1
Need to remove svg testcase as well. Cancel feedback first.
Attachment #8770021 -
Flags: feedback?(echen)
Assignee | ||
Comment 4•8 years ago
|
||
Attachment #8770021 -
Attachment is obsolete: true
Attachment #8770052 -
Flags: feedback?(echen)
Reporter | ||
Comment 5•8 years ago
|
||
Comment on attachment 8770052 [details] [diff] [review]
Bug 1274505 - Remove SVG-based custom element support. v2
Review of attachment 8770052 [details] [diff] [review]:
-----------------------------------------------------------------
Please also remove following lines from nsDocument.cpp:
1. https://dxr.mozilla.org/mozilla-central/rev/88bebcaca249aeaca9197382e89d35b02be8292e/dom/base/nsDocument.cpp#177
2. https://dxr.mozilla.org/mozilla-central/rev/88bebcaca249aeaca9197382e89d35b02be8292e/dom/base/nsDocument.cpp#195
3. https://dxr.mozilla.org/mozilla-central/rev/88bebcaca249aeaca9197382e89d35b02be8292e/dom/base/nsDocument.cpp#6406-6411
And for following lines in test_document_register.html. Although we can pass them, but I think we should still remove them.
The exception is threw due to other reason, not the condition that we want to test.
1. https://dxr.mozilla.org/mozilla-central/rev/88bebcaca249aeaca9197382e89d35b02be8292e/dom/tests/mochitest/webcomponents/test_document_register.html#49
2. https://dxr.mozilla.org/mozilla-central/rev/88bebcaca249aeaca9197382e89d35b02be8292e/dom/tests/mochitest/webcomponents/test_document_register.html#99
::: dom/base/nsDocument.cpp
@@ -6390,5 @@
> }
>
> known =
> ps->HTMLCaseSensitiveAtomTagToId(nameAtom) != eHTMLTag_userdefined;
> - } else {
namespace is always kNameSpaceID_XHTML after we remove svg supporting, so we can remove `if (namespaceID == kNameSpaceID_XHTML) {` as well.
::: dom/tests/mochitest/webcomponents/test_document_register.html
@@ -72,5 @@
> testRegisterSimple("x-invalid-boolean", false, true);
> testRegisterSimple("x-invalid-float", 1.0, true);
> - // Can not register with a prototype that inherits from SVGElement
> - // without extending an existing element type.
> - testRegisterSimple("x-html-obj-svg", Object.create(SVGElement.prototype), true);
Per offline discussion, I am surprised that you said you can not pass this test after removing SVG stuff.
I thought registering an element whose prototype isn't inheriting from HTMLElement should throw an exception, but it not. Could you help to check why?
And I think we should also add some tests for such case.
@@ -149,1 @@
> var extendedText = document.createElementNS("http://www.w3.org/2000/svg", "text", "x-extended-text");
Remove this line.
@@ -149,2 @@
> var extendedText = document.createElementNS("http://www.w3.org/2000/svg", "text", "x-extended-text");
> is(extendedText.tagName, "text", "Created element should have a local name of |text|.");
Ditto.
@@ -152,1 @@
> is(extendedText.getAttribute("is"), "x-extended-text", "The |is| attribute of the created element should be the extended type.");
Ditto.
Attachment #8770052 -
Flags: feedback?(echen)
Assignee | ||
Comment 6•8 years ago
|
||
Comment on attachment 8770052 [details] [diff] [review]
Bug 1274505 - Remove SVG-based custom element support. v2
Review of attachment 8770052 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/base/nsDocument.cpp
@@ -6390,5 @@
> }
>
> known =
> ps->HTMLCaseSensitiveAtomTagToId(nameAtom) != eHTMLTag_userdefined;
> - } else {
Will do.
::: dom/tests/mochitest/webcomponents/test_document_register.html
@@ -72,5 @@
> testRegisterSimple("x-invalid-boolean", false, true);
> testRegisterSimple("x-invalid-float", 1.0, true);
> - // Can not register with a prototype that inherits from SVGElement
> - // without extending an existing element type.
> - testRegisterSimple("x-html-obj-svg", Object.create(SVGElement.prototype), true);
Per offline discussion, the spec[1] said, "Interface objects that do not inherit from HTMLElement (for example TextTrack), or classes defined in the JavaScript specification (such as Set), will pass this step without throwing a TypeError. However, they will later cause create an element to fail".
Since create an element will follow new spec, I think we don't need to add test for this bug.
[1]https://html.spec.whatwg.org/multipage/scripting.html#dom-customelementsregistry-define
@@ -149,1 @@
> var extendedText = document.createElementNS("http://www.w3.org/2000/svg", "text", "x-extended-text");
Will do.
@@ -149,2 @@
> var extendedText = document.createElementNS("http://www.w3.org/2000/svg", "text", "x-extended-text");
> is(extendedText.tagName, "text", "Created element should have a local name of |text|.");
Will do.
@@ -152,1 @@
> is(extendedText.getAttribute("is"), "x-extended-text", "The |is| attribute of the created element should be the extended type.");
Will do.
Assignee | ||
Comment 7•8 years ago
|
||
Addressed comment 5.
Attachment #8770052 -
Attachment is obsolete: true
Reporter | ||
Comment 8•8 years ago
|
||
(In reply to John Dai[:jdai] from comment #6)
> Comment on attachment 8770052 [details] [diff] [review]
> Bug 1274505 - Remove SVG-based custom element support. v2
>
> Review of attachment 8770052 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Per offline discussion, the spec[1] said, "Interface objects that do not
> inherit from HTMLElement (for example TextTrack), or classes defined in the
> JavaScript specification (such as Set), will pass this step without throwing
> a TypeError. However, they will later cause create an element to fail".
> Since create an element will follow new spec, I think we don't need to add
> test for this bug.
>
> [1]https://html.spec.whatwg.org/multipage/scripting.html#dom-
> customelementsregistry-define
Yes, you are right, thanks for clarifying this. :)
Assignee | ||
Comment 9•8 years ago
|
||
Add back non SVG-based custom element code.
Attachment #8771306 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Attachment #8771849 -
Flags: feedback?(echen)
Assignee | ||
Comment 10•8 years ago
|
||
Reporter | ||
Comment 11•8 years ago
|
||
Comment on attachment 8771849 [details] [diff] [review]
Bug 1274505 - Remove SVG-based custom element support. v3
Review of attachment 8771849 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/tests/mochitest/webcomponents/test_document_register.html
@@ -58,5 @@
> // Registering without a prototype should automatically create one inheriting from HTMLElement.
> testRegisterSimple("x-elem-no-proto", null, false);
> - var simpleElem = document.createElement("x-elem-no-proto");
> - is(simpleElem.__proto__.__proto__, HTMLElement.prototype, "Default prototype should inherit from HTMLElement");
> -
Nit: keep this blank line.
@@ -154,2 @@
> // document.createElement with different namespace than definition for extended element.
> var htmlText = document.createElement("text", "x-extended-text");
It seems we can remove `htmlText`, too.
Attachment #8771849 -
Flags: feedback?(echen) → feedback+
Assignee | ||
Comment 12•8 years ago
|
||
Addressed comment 11.
Attachment #8771849 -
Attachment is obsolete: true
Attachment #8772330 -
Flags: review?(wchen)
Attachment #8772330 -
Flags: feedback+
Updated•8 years ago
|
Whiteboard: btpp-active → btpp-active, dom-ce-m1
Comment 13•8 years ago
|
||
Comment on attachment 8772330 [details] [diff] [review]
Bug 1274505 - Remove SVG-based custom element support. v4
Review of attachment 8772330 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/base/nsDocument.cpp
@@ +6367,3 @@
> }
>
> + known =
You can move the declaration of |known| here.
Attachment #8772330 -
Flags: review?(wchen) → review+
Assignee | ||
Comment 14•8 years ago
|
||
Addressed comment 13.
Try result: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f5bca8cd2b3c7c1031f9471f4fc3c98a7e19703c&filter-tier=1
Attachment #8772330 -
Attachment is obsolete: true
Attachment #8774625 -
Flags: review+
Attachment #8774625 -
Flags: feedback+
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 15•8 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/930128b88444
Remove SVG-based custom element support. r=wchen
Keywords: checkin-needed
Comment 16•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox50:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•