New issue
Advanced search Search tips

Issue 737879 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 627682



Sign in to add a comment

document.registerElement() rejects a valid unregistered type with U+212A

Project Member Reported by tkent@chromium.org, Jun 29 2017

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().

 
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 ?

Comment 3 by tkent@chromium.org, 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.

Ok,Sure I will check both.
Submitted patch for this https://codereview.chromium.org/2963173004/.

It works by only changing here  V0CustomElementRegistry::RegisterElementgb
Project Member

Comment 6 by bugdroid1@chromium.org, 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

Comment 7 by tkent@chromium.org, Jul 6 2017

Labels: M-61
Status: Fixed (was: Available)

Sign in to add a comment