HTMLElement::nodeName should not upper case non-ASCII characters
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Jan 2016 02:04:41 +0000 (02:04 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Jan 2016 02:04:41 +0000 (02:04 +0000)
commitcd6bdd4ea36444adabd9470cccd3e7833a64146a
tree99c1f70948f8dbb61f01b9d37d7d51c51d17edab
parent405d6c48bc8440440cf7eddd401df5d12d403c7a
HTMLElement::nodeName should not upper case non-ASCII characters
https://bugs.webkit.org/show_bug.cgi?id=153231

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaselined the test now that all test cases pass.

* web-platform-tests/dom/nodes/Document-createElement-expected.txt:

Source/WebCore:

Use the newly added convertToASCIIUppercase to generate the string for tagName and nodeName.

Test: fast/dom/Element/tagName-must-be-ASCII-uppercase-in-HTML-document.html

* dom/QualifiedName.cpp:
(WebCore::QualifiedName::localNameUpper): Use convertToASCIIUppercase.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::nodeName): Use convertToASCIIUppercase.

Source/WTF:

Added convertToASCIIUppercase to AtomicString, String, and StringImpl.

* wtf/text/AtomicString.cpp:
(WTF::AtomicString::convertASCIICase): Generalized from convertToASCIILowercase.
(WTF::AtomicString::convertToASCIILowercase):
(WTF::AtomicString::convertToASCIIUppercase):
* wtf/text/AtomicString.h:
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertASCIICase): Generalized from convertToASCIILowercase.
(WTF::StringImpl::convertToASCIILowercase):
(WTF::StringImpl::convertToASCIIUppercase):
* wtf/text/StringImpl.h:
* wtf/text/WTFString.cpp:
(WTF::String::convertToASCIIUppercase): Added.
* wtf/text/WTFString.h:

LayoutTests:

Added a regression test since the rebaselined W3C test case is very simple and doesn't all permutations.

* fast/dom/Element/tagName-must-be-ASCII-uppercase-in-HTML-document-expected.txt: Added.
* fast/dom/Element/tagName-must-be-ASCII-uppercase-in-HTML-document.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@195501 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/Element/tagName-must-be-ASCII-uppercase-in-HTML-document-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/tagName-must-be-ASCII-uppercase-in-HTML-document.html [new file with mode: 0644]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-expected.txt
Source/WTF/ChangeLog
Source/WTF/wtf/text/AtomicString.cpp
Source/WTF/wtf/text/AtomicString.h
Source/WTF/wtf/text/StringImpl.cpp
Source/WTF/wtf/text/StringImpl.h
Source/WTF/wtf/text/WTFString.cpp
Source/WTF/wtf/text/WTFString.h
Source/WebCore/ChangeLog
Source/WebCore/dom/QualifiedName.cpp
Source/WebCore/html/HTMLElement.cpp