New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 649279 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

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/
 

Comment 1 by kojii@chromium.org, Sep 26 2016

Cc: kojii@chromium.org dominicc@chromium.org
Labels: -Pri-2 -OS-Mac OS-All Pri-3
Status: Available (was: Unconfirmed)
The step 2 of document.createElement():
https://dom.spec.whatwg.org/#dom-document-createelement
says:
> If the context object is an HTML document, let localName be converted to ASCII lowercase.

Comment 2 by kojii@chromium.org, Sep 26 2016

Components: -Blink Blink>WebComponents
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?

Comment 4 by hayato@chromium.org, Oct 12 2016

Components: -Blink>WebComponents Blink>HTML>CustomElements
Owner: dominicc@chromium.org
Status: Started (was: Available)
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.
Labels: Needs-Bisect
Would be handy to have a bisect of this.

Comment 7 by woxxom@gmail.com, 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.
Status: Fixed (was: Started)
 Issue 685959  has been merged into this issue.

Sign in to add a comment