Changeset 195091 in webkit
- Timestamp:
- Jan 14, 2016 10:12:56 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r195010 r195091 1 2016-01-14 Ryosuke Niwa <rniwa@webkit.org> 2 3 createElement should not lowercase non-ASCII characters 4 https://bugs.webkit.org/show_bug.cgi?id=153114 5 6 Reviewed by Alex Christensen. 7 8 Rebaselined the tests for document.createElement now that more test cases are passing. 9 10 * web-platform-tests/dom/nodes/Document-createElement-expected.txt: 11 * web-platform-tests/dom/nodes/Document-getElementsByTagName-expected.txt: 12 * web-platform-tests/dom/nodes/Element-getElementsByTagName-expected.txt: 13 * web-platform-tests/dom/nodes/case-expected.txt: 14 1 15 2016-01-14 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-expected.txt
r189842 r195091 20 20 PASS createElement("math") 21 21 PASS createElement("FOO") 22 FAIL createElement("marK") assert_equals: expected "marK" but got "mark" 23 FAIL createElement("İnput") assert_equals: expected "İnput" but got "i̇nput" 22 PASS createElement("marK") 23 PASS createElement("İnput") 24 24 FAIL createElement("ınput") assert_equals: expected "ıNPUT" but got "INPUT" 25 25 PASS createElement("") -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-getElementsByTagName-expected.txt
r194580 r195091 15 15 PASS Element in non-HTML namespace, prefix, lowercase name 16 16 PASS Element in non-HTML namespace, prefix, uppercase name 17 FAIL Element in HTML namespace, no prefix, non-ascii characters in name assert_equals: expected "aÇ" but got "aç" 17 PASS Element in HTML namespace, no prefix, non-ascii characters in name 18 18 PASS Element in non-HTML namespace, non-ascii characters in name 19 19 PASS Element in HTML namespace, prefix, non-ascii characters in name -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-getElementsByTagName-expected.txt
r194580 r195091 15 15 PASS Element in non-HTML namespace, prefix, lowercase name 16 16 PASS Element in non-HTML namespace, prefix, uppercase name 17 FAIL Element in HTML namespace, no prefix, non-ascii characters in name assert_equals: expected "aÇ" but got "aç" 17 PASS Element in HTML namespace, no prefix, non-ascii characters in name 18 18 PASS Element in non-HTML namespace, non-ascii characters in name 19 19 PASS Element in HTML namespace, prefix, non-ascii characters in name -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/case-expected.txt
r189825 r195091 20 20 PASS getElementsByTagName a:ä 21 21 PASS getElementsByTagName ä 22 FAIL createElement Ä assert_equals: expected "Ä" but got "ä" 22 PASS createElement Ä 23 23 PASS setAttribute Ä 24 24 PASS getAttribute Ä -
trunk/Source/WebCore/ChangeLog
r195090 r195091 1 2016-01-14 Ryosuke Niwa <rniwa@webkit.org> 2 3 createElement should not lowercase non-ASCII characters 4 https://bugs.webkit.org/show_bug.cgi?id=153114 5 6 Reviewed by Alex Christensen. 7 8 According to step 2 in https://dom.spec.whatwg.org/#dom-document-createelement, document.createElement should not 9 lowercase non-ASCII letters, and this is also what Firefox does. Match that behavior by lowercasing the tag name 10 by convertToASCIILowercase() instead of lower() in createElement. 11 12 Also merged HTMLDocument::createElement into Document::createElement for simplicity and avoid duplicating 13 the call to isValidName and setting a DOM exception. 14 15 No new tests since the behavior change is covered by the existing W3C tests. 16 17 * dom/Document.cpp: 18 (WebCore::Document::createElement): Create a HTML element with ASCII-lowercased tag name inside a HTML document. 19 * dom/Document.h: 20 * html/HTMLDocument.cpp: 21 (WebCore::addLocalNameToSet): 22 (WebCore::HTMLDocument::createElement): Merged into Document::createElement. 23 * html/HTMLDocument.h: 24 1 25 2016-01-14 Brady Eidson <beidson@apple.com> 2 26 -
trunk/Source/WebCore/dom/Document.cpp
r195087 r195091 889 889 } 890 890 891 if (isHTMLDocument()) 892 return HTMLElementFactory::createElement(QualifiedName(nullAtom, name.convertToASCIILowercase(), xhtmlNamespaceURI), *this); 893 891 894 if (isXHTMLDocument()) 892 895 return HTMLElementFactory::createElement(QualifiedName(nullAtom, name, xhtmlNamespaceURI), *this); -
trunk/Source/WebCore/dom/Document.h
r195087 r195091 386 386 bool hasManifest() const; 387 387 388 virtualRefPtr<Element> createElement(const AtomicString& tagName, ExceptionCode&);388 WEBCORE_EXPORT RefPtr<Element> createElement(const AtomicString& tagName, ExceptionCode&); 389 389 WEBCORE_EXPORT Ref<DocumentFragment> createDocumentFragment(); 390 390 WEBCORE_EXPORT Ref<Text> createTextNode(const String& data); -
trunk/Source/WebCore/html/HTMLDocument.cpp
r179971 r195091 226 226 // not part of the DOM 227 227 // -------------------------------------------------------------------------- 228 229 RefPtr<Element> HTMLDocument::createElement(const AtomicString& name, ExceptionCode& ec)230 {231 if (!isValidName(name)) {232 ec = INVALID_CHARACTER_ERR;233 return 0;234 }235 return HTMLElementFactory::createElement(QualifiedName(nullAtom, name.lower(), xhtmlNamespaceURI), *this);236 }237 228 238 229 static void addLocalNameToSet(HashSet<AtomicStringImpl*>* set, const QualifiedName& qName) -
trunk/Source/WebCore/html/HTMLDocument.h
r179181 r195091 87 87 88 88 private: 89 virtual RefPtr<Element> createElement(const AtomicString& tagName, ExceptionCode&) override;90 91 89 virtual bool isFrameSet() const override; 92 90 virtual Ref<DocumentParser> createParser() override;
Note: See TracChangeset
for help on using the changeset viewer.