document.createElement is case-sensitive for Custom Elements
Reported by
adam.tim...@gmail.com,
Sep 22 2016
|
||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2868.0 Safari/537.36
Steps to reproduce the problem:
1. Define a custom element using customElements.define w/ a connectedCallback function;
2. Create the aforementioned element using document.createElement, but specify its name in all uppercase chars;
3. Append the created element to the DOM.
What is the expected behavior?
connectedCallback should be invoked as HTML is case-insensitive, works when adding <CUSTOM-ELEMENT /> to the DOM directly, but document.createElement('CUSTOM-ELEMENT') does not invoke the callback once you appendChild.
What went wrong?
connectedCallback should be invoked in all cases regardless of the case.
Did this work before? N/A
Chrome version: 55.0.2868.0 Channel: canary
OS Version: OS X 10.11.5
Flash Version: Shockwave Flash 23.0 r0
Fiddle demonstrating the problem: https://jsfiddle.net/emdnz2jo/
,
Sep 26 2016
,
Sep 26 2016
I noticed the related https://bugs.chromium.org/p/chromium/issues/detail?id=282467 issue report, which appears to have deemed that "creating custom element should not be case sensitive", and thus seems like a regression?
,
Oct 12 2016
,
Oct 24 2016
Thanks for the bug report. I tried your repro and this jsbin http://jsbin.com/qazupihuhi/1/edit?js,output in Chrome Linux 54.0.2840.71 (Official Build) (64-bit) and Chromium at r427006 so it looks like this regressed sometime between then and now.
,
Oct 24 2016
Would be handy to have a bisect of this.
,
Oct 24 2016
The issue 282467 linked in #3 was resolved with https://crrev/442343002 that added convertLocalName(name) to lowercase the local name. However, https://crrev.com/2054433002 added the new if-clause for custom elements that lacks the convertLocalName(name) call.
,
Oct 24 2016
Patch up at https://codereview.chromium.org/2442223003
,
Oct 25 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/be2411a995a513d8bbcb18cbe9c53cb8b664b634 commit be2411a995a513d8bbcb18cbe9c53cb8b664b634 Author: dominicc <dominicc@chromium.org> Date: Tue Oct 25 02:14:51 2016 Make createElement tag name case handling consistent for custom elements BUG= 649279 Review-Url: https://codereview.chromium.org/2442223003 Cr-Commit-Position: refs/heads/master@{#427241} [modify] https://crrev.com/be2411a995a513d8bbcb18cbe9c53cb8b664b634/third_party/WebKit/Source/core/BUILD.gn [modify] https://crrev.com/be2411a995a513d8bbcb18cbe9c53cb8b664b634/third_party/WebKit/Source/core/dom/Document.cpp [modify] https://crrev.com/be2411a995a513d8bbcb18cbe9c53cb8b664b634/third_party/WebKit/Source/core/dom/custom/CustomElementRegistryTest.cpp [modify] https://crrev.com/be2411a995a513d8bbcb18cbe9c53cb8b664b634/third_party/WebKit/Source/core/dom/custom/CustomElementTest.cpp [add] https://crrev.com/be2411a995a513d8bbcb18cbe9c53cb8b664b634/third_party/WebKit/Source/core/dom/custom/CustomElementTestHelpers.cpp [modify] https://crrev.com/be2411a995a513d8bbcb18cbe9c53cb8b664b634/third_party/WebKit/Source/core/dom/custom/CustomElementTestHelpers.h
,
Oct 25 2016
,
Jan 31 2017
Issue 685959 has been merged into this issue. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by kojii@chromium.org
, Sep 26 2016Labels: -Pri-2 -OS-Mac OS-All Pri-3
Status: Available (was: Unconfirmed)