document.registerElement() rejects a valid unregistered type with U+212A |
||
Issue description
Chrome Version: 61 canary
OS: All but iOS
What steps will reproduce the problem?
(1) Open any page.
(2) Open DevTools console.
(3) Type the following
document.registerElement('x-tkent')
document.registerElement('x-t\u212Aent')
What is the expected result?
These two commands succeed.
What happens instead?
The second registerElement() throws an exception:
Uncaught DOMException: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-tkent'. A type with that name is already registered.
Please use labels and text to provide additional information.
This is due to a wrong usage of AtomicString::DeprecatedLower().
,
Jun 29 2017
Hi Tkent, I searched for the above problem and based on your explanation: In V0CustomElementRegistry::RegisterElement type is being get using AtomicString type = user_supplied_name.DeprecatedLower(); Do we need to call user_supplied_name.LowerASCII() instead ?
,
Jun 29 2017
> Do we need to call user_supplied_name.LowerASCII() instead ? Yeah, I think so. We have another DeprecatedLower() in V0CustomElement::AddEmbedderCustomElementName(). I'm not sure if we need to change it too to fix this.
,
Jun 30 2017
Ok,Sure I will check both.
,
Jun 30 2017
Submitted patch for this https://codereview.chromium.org/2963173004/. It works by only changing here V0CustomElementRegistry::RegisterElementgb
,
Jul 6 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/07ee4ee6fbef420a23efcf927830b2eb6931f46b commit 07ee4ee6fbef420a23efcf927830b2eb6931f46b Author: nikhil.sahni <nikhil.sahni@samsung.com> Date: Thu Jul 06 09:12:13 2017 document.registerElement() rejects a valid unregistered type with U+212A. RegisterElement rejects a valid type due to wrong usage of DeprecatedLower for register and should use LowerASCII instead of that. BUG= 737879 Review-Url: https://codereview.chromium.org/2963173004 Cr-Commit-Position: refs/heads/master@{#484508} [add] https://crrev.com/07ee4ee6fbef420a23efcf927830b2eb6931f46b/third_party/WebKit/LayoutTests/fast/dom/custom/register-element-with-U212A.html [modify] https://crrev.com/07ee4ee6fbef420a23efcf927830b2eb6931f46b/third_party/WebKit/Source/core/html/custom/V0CustomElementRegistry.cpp
,
Jul 6 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by tkent@chromium.org
, Jun 29 2017