Changeset 195248 in webkit


Ignore:
Timestamp:
Jan 18, 2016 11:37:32 PM (8 years ago)
Author:
rniwa@webkit.org
Message:

createAttribute should lowercase the attribute name in a HTML document
https://bugs.webkit.org/show_bug.cgi?id=153112

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline a test now that it's passing all test cases.

  • web-platform-tests/dom/nodes/Document-createAttribute-expected.txt:

Source/WebCore:

In a HTML document, we should always lowercase localName in document.createAttribute as specified in
https://dom.spec.whatwg.org/#dom-document-createattribute:

  1. If localName does not match the Name production in XML, throw an InvalidCharacterError exception.
  2. If the context object is an HTML document, let localName be converted to ASCII lowercase.
  3. Return a new attribute whose local name is localName.

Change WebKit's behavior to match the spec as well as Firefox. document.createAttributeNS will
continue to preserve the case as spec'ed.

No new tests are added since the behavior change is covered by existing tests.

  • dom/Document.cpp:

(WebCore::Document::createAttribute):

LayoutTests:

Update tests, rebaseline tests, and add more test cases as needed.

createAttribute lowercases localName and getAttributeNode finds attribute ignoring cases
whereas createAttributeNS preserves localName's case and getAttributeNodeNS finds attribute preserving cases

  • fast/dom/Element/mozilla-dom-base-tests/test_bug1075702-expected.txt: Since the test is adding "aa" as well

as "AA" as Attr nodes, we should be able to get both.

  • fast/dom/Element/mozilla-dom-base-tests/test_bug1075702.xhtml: Renamed from .html file since test cases here

are more relevant for XHTML documents.

  • fast/dom/Element/getAttribute-check-case-sensitivity-expected.txt:
  • fast/dom/Element/script-tests/getAttribute-check-case-sensitivity.js:

(testGetAttributeNodeMixedCase): Change the test case to retrieve the attribute name with lowercase name
since createAttribute always lowercases the name in a HTML document.
(testAttribNodeNamePreservesCase): Use getAttributeNode instead of getAttributeNodeNS since the former does
case insensitive lookup as needed here.
(testAttribNodeNamePreservesCaseGetNode): Ditto.
(testAttribNodeNamePreservesCaseGetNode2): Ditto. Use createAttributeNS to create a case-preserving Attr node.

  • fast/dom/Element/setAttributeNode-case-insensitivity-expected.txt:
  • fast/dom/Element/setAttributeNode-case-insensitivity.html: Since getAttributeNode does a case-insensitive

lookup, we should be getting the same Attr node for both 'style' and 'STYLE'.

  • fast/dom/Element/setAttributeNode-for-existing-attribute-expected.txt: Rebaselined. This is a progression

since we're now getting "green" when querying style.backgroundColor as expected.

  • fast/dom/Element/setAttributeNode-overriding-lowercase-values-1-expected.txt:
  • fast/dom/Element/setAttributeNode-overriding-lowercase-values-1.html: Updated test cases for new behavior.
  • fast/dom/Element/setAttributeNode-overriding-lowercase-values-1-xml-expected.txt: Added.
  • fast/dom/Element/setAttributeNode-overriding-lowercase-values-1-xml.xhtml: Added. Test behaviors in a XML

document.

Location:
trunk
Files:
1 added
13 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195247 r195248  
     12016-01-18  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        createAttribute should lowercase the attribute name in a HTML document
     4        https://bugs.webkit.org/show_bug.cgi?id=153112
     5
     6        Reviewed by Darin Adler.
     7
     8        Update tests, rebaseline tests, and add more test cases as needed.
     9
     10        createAttribute lowercases localName and getAttributeNode finds attribute ignoring cases
     11        whereas createAttributeNS preserves localName's case and getAttributeNodeNS finds attribute preserving cases
     12
     13        * fast/dom/Element/mozilla-dom-base-tests/test_bug1075702-expected.txt: Since the test is adding "aa" as well
     14        as "AA" as Attr nodes, we should be able to get both.
     15        * fast/dom/Element/mozilla-dom-base-tests/test_bug1075702.xhtml: Renamed from .html file since test cases here
     16        are more relevant for XHTML documents.
     17
     18        * fast/dom/Element/getAttribute-check-case-sensitivity-expected.txt:
     19        * fast/dom/Element/script-tests/getAttribute-check-case-sensitivity.js:
     20        (testGetAttributeNodeMixedCase): Change the test case to retrieve the attribute name with lowercase name
     21        since createAttribute always lowercases the name in a HTML document.
     22        (testAttribNodeNamePreservesCase): Use getAttributeNode instead of getAttributeNodeNS since the former does
     23        case insensitive lookup as needed here.
     24        (testAttribNodeNamePreservesCaseGetNode): Ditto.
     25        (testAttribNodeNamePreservesCaseGetNode2): Ditto. Use createAttributeNS to create a case-preserving Attr node.
     26
     27        * fast/dom/Element/setAttributeNode-case-insensitivity-expected.txt:
     28        * fast/dom/Element/setAttributeNode-case-insensitivity.html: Since getAttributeNode does a case-insensitive
     29        lookup, we should be getting the same Attr node for both 'style' and 'STYLE'.
     30
     31        * fast/dom/Element/setAttributeNode-for-existing-attribute-expected.txt: Rebaselined. This is a progression
     32        since we're now getting "green" when querying style.backgroundColor as expected.
     33
     34        * fast/dom/Element/setAttributeNode-overriding-lowercase-values-1-expected.txt:
     35        * fast/dom/Element/setAttributeNode-overriding-lowercase-values-1.html: Updated test cases for new behavior.
     36
     37        * fast/dom/Element/setAttributeNode-overriding-lowercase-values-1-xml-expected.txt: Added.
     38        * fast/dom/Element/setAttributeNode-overriding-lowercase-values-1-xml.xhtml: Added. Test behaviors in a XML
     39        document.
     40
    1412016-01-18  Brady Eidson  <beidson@apple.com>
    242
  • trunk/LayoutTests/fast/dom/Element/getAttribute-check-case-sensitivity-expected.txt

    r179497 r195248  
    1010PASS testGetAttributeNodeLowerCase() is "x"
    1111PASS testSetAttributeNodeKeepsRef() is "1"
    12 PASS testAttribNodeNamePreservesCase() is "A,A"
    13 PASS testAttribNodeNamePreservesCaseGetNode() is "A,A"
     12PASS testAttribNodeNamePreservesCase() is "a,a"
     13PASS testAttribNodeNamePreservesCaseGetNode() is "a,a"
    1414PASS testAttribNodeNamePreservesCaseGetNode2() is "B,B"
    1515PASS testAttribNodeNameGetMutate() is "1"
    16 PASS (new XMLSerializer).serializeToString(node) is "<div xmlns=\"http://www.w3.org/1999/xhtml\" myAttrib=\"XXX\"></div>"
    17 PASS node.getAttributeNodeNS('', 'myAttrib').name is "myAttrib"
    18 PASS node.getAttributeNodeNS('', 'myattrib') is null
    19 PASS attrib.name is "myAttrib"
     16PASS (new XMLSerializer).serializeToString(node) is "<div xmlns=\"http://www.w3.org/1999/xhtml\" myattrib=\"XXX\" myAttrib2=\"XXX\"></div>"
     17PASS node.getAttributeNodeNS('', 'myattrib') is attrib
     18PASS node.getAttributeNodeNS('', 'myAttrib') is null
     19PASS attrib.name is "myattrib"
     20PASS node.getAttributeNodeNS('', 'myAttrib2') is attrib2
     21PASS node.getAttributeNodeNS('', 'myattrib2') is null
     22PASS attrib2.name is "myAttrib2"
    2023PASS successfullyParsed is true
    2124
  • trunk/LayoutTests/fast/dom/Element/mozilla-dom-base-tests/test_bug1075702-expected.txt

    r189825 r195248  
    44
    55
    6 PASS document.documentElement.hasAttributeNS("", "aa") is false
    7 PASS document.documentElement.getAttributeNS("", "aa") is null
     6PASS document.documentElement.hasAttributeNS("", "aa") is true
     7PASS document.documentElement.getAttributeNS("", "aa") is "lowercase"
    88PASS document.documentElement.hasAttributeNS("", "AA") is true
    99PASS document.documentElement.getAttributeNS("", "AA") is "UPPERCASE"
  • trunk/LayoutTests/fast/dom/Element/mozilla-dom-base-tests/test_bug1075702.xhtml

    r195247 r195248  
    1 <!DOCTYPE HTML>
    2 <html>
     1<!DOCTYPE html>
     2<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    33<!--
    44https://bugzilla.mozilla.org/show_bug.cgi?id=1075702
    55-->
    66<head>
    7     <meta charset="utf-8">
     7    <meta charset="utf-8"/>
    88    <script src="../../../../resources/js-test-pre.js"></script>
    99</head>
     
    2929  document.documentElement.setAttributeNode(a2);
    3030
    31   shouldBeFalse('document.documentElement.hasAttributeNS("", "aa")');
    32   shouldBeNull('document.documentElement.getAttributeNS("", "aa")');
     31  shouldBeTrue('document.documentElement.hasAttributeNS("", "aa")');
     32  shouldBeEqualToString('document.documentElement.getAttributeNS("", "aa")', 'lowercase');
    3333  shouldBeTrue('document.documentElement.hasAttributeNS("", "AA")');
    3434  shouldBeEqualToString('document.documentElement.getAttributeNS("", "AA")', 'UPPERCASE');
  • trunk/LayoutTests/fast/dom/Element/script-tests/getAttribute-check-case-sensitivity.js

    r179497 r195248  
    2020    a.nodeValue = "x";
    2121    div.setAttributeNode(a);
    22     return div.getAttributeNS("", "mixedCaseAttrib");
     22    return div.getAttributeNS("", "mixedcaseattrib");
    2323}
    2424
     
    6262}
    6363
    64 shouldBe("testAttribNodeNamePreservesCase()", '"A,A"');
     64shouldBe("testAttribNodeNamePreservesCase()", '"a,a"');
    6565
    6666   
     
    7575    body.setAttributeNode(a);
    7676
    77     a = document.body.getAttributeNodeNS("", "A");
     77    a = document.body.getAttributeNode("A");
    7878    if (!a)
    7979        return "FAIL";
     
    8383}
    8484
    85 shouldBe("testAttribNodeNamePreservesCaseGetNode()", '"A,A"');
     85shouldBe("testAttribNodeNamePreservesCaseGetNode()", '"a,a"');
    8686
    8787function testAttribNodeNamePreservesCaseGetNode2()
     
    9595    body.setAttributeNode(a);
    9696
    97     a = document.body.getAttributeNodeNS("", "B");
     97    a = document.body.getAttributeNodeNS("", "b");
    9898    if (!a)
    9999        return "FAIL";
    100100
    101     // Now create node second time -- this time case is preserved in FF!
    102     a = body.ownerDocument.createAttribute("B");
     101    a = body.ownerDocument.createAttributeNS("", "B");
    103102    a.nodeValue = "x";
    104103    body.setAttributeNode(a);
     
    136135node.setAttributeNode(attrib);
    137136
    138 shouldBe("(new XMLSerializer).serializeToString(node)", '"<div xmlns=\\"http://www.w3.org/1999/xhtml\\" myAttrib=\\"XXX\\"></div>"');
    139 shouldBe("node.getAttributeNodeNS('', 'myAttrib').name", '"myAttrib"');
    140 shouldBe("node.getAttributeNodeNS('', 'myattrib')", 'null');
    141 shouldBe("attrib.name", '"myAttrib"');
     137var attrib2 = document.createAttributeNS("", "myAttrib2");
     138attrib2.nodeValue = "XXX";
     139node.setAttributeNode(attrib2);
     140
     141shouldBe("(new XMLSerializer).serializeToString(node)", '"<div xmlns=\\"http://www.w3.org/1999/xhtml\\" myattrib=\\"XXX\\" myAttrib2=\\"XXX\\"></div>"');
     142shouldBe("node.getAttributeNodeNS('', 'myattrib')", 'attrib');
     143shouldBeNull("node.getAttributeNodeNS('', 'myAttrib')");
     144shouldBe("attrib.name", '"myattrib"');
     145
     146shouldBe("node.getAttributeNodeNS('', 'myAttrib2')", 'attrib2');
     147shouldBeNull("node.getAttributeNodeNS('', 'myattrib2')");
     148shouldBe("attrib2.name", '"myAttrib2"');
  • trunk/LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity-expected.txt

    r179497 r195248  
    55
    66PASS test.getAttribute('style') is test.getAttribute('STYLE')
    7 PASS test.getAttributeNode('style') is null
     7PASS test.getAttributeNode('style') is test.getAttributeNode('STYLE')
    88Verifying that attributes with the same name but different namespaces are treated as unique entities. For the following test two different attribute values should be returned.
    99PASS test.getAttributeNodeNS('ns1', 'newattr').value is 'newattr1'
  • trunk/LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity.html

    r179497 r195248  
    1717        test.setAttributeNode(newStyleAttr);
    1818        shouldBe("test.getAttribute('style')", "test.getAttribute('STYLE')");
    19         shouldBe("test.getAttributeNode('style')", "null");
     19        shouldBe("test.getAttributeNode('style')", "test.getAttributeNode('STYLE')");
    2020
    2121
  • trunk/LayoutTests/fast/dom/Element/setAttributeNode-for-existing-attribute-expected.txt

    r179497 r195248  
    33Testcase for bug 120293: setAttributeNode() does not set the new value to an existing attribute if specified attribute is in a different case.\nThe issue can be manually verified by ascertaining that a green colored block is displayed instead of a red one.
    44 
    5 background-color specified with lowercase style attribute was: red and specified with uppercase style attribute is:
     5background-color specified with lowercase style attribute was: red and specified with uppercase style attribute is: green
  • trunk/LayoutTests/fast/dom/Element/setAttributeNode-overriding-lowercase-values-1-expected.txt

    r189825 r195248  
    1414PASS document.documentElement.attributes.length is 1
    1515PASS camelCaseFoobar is not oldAttributeNode
    16 PASS document.documentElement.getAttribute("foobar") is null
    17 PASS document.documentElement.hasAttribute("foobar") is false
    18 PASS document.documentElement.getAttribute("FooBar") is null
    19 PASS document.documentElement.hasAttribute("FooBar") is false
    20 PASS document.documentElement.getAttributeNS("", "foobar") is null
    21 PASS document.documentElement.hasAttributeNS("", "foobar") is false
    22 PASS document.documentElement.getAttributeNS("", "FooBar") is "Rocks!"
    23 PASS document.documentElement.hasAttributeNS("", "FooBar") is true
    24 PASS oldAttributeNode2 is null
     16PASS document.documentElement.getAttribute("foobar") is "Rocks!"
     17PASS document.documentElement.hasAttribute("foobar") is true
     18PASS document.documentElement.getAttribute("FooBar") is "Rocks!"
     19PASS document.documentElement.hasAttribute("FooBar") is true
     20PASS document.documentElement.getAttributeNS("", "foobar") is "Rocks!"
     21PASS document.documentElement.hasAttributeNS("", "foobar") is true
     22PASS document.documentElement.getAttributeNS("", "FooBar") is null
     23PASS document.documentElement.hasAttributeNS("", "FooBar") is false
     24PASS oldAttributeNode2 is camelCaseFoobar
    2525PASS document.documentElement.getAttribute("foobar") is "WebKit2"
    2626PASS document.documentElement.hasAttribute("foobar") is true
     
    2929PASS document.documentElement.getAttributeNS("", "foobar") is "WebKit2"
    3030PASS document.documentElement.hasAttributeNS("", "foobar") is true
    31 PASS document.documentElement.getAttributeNS("", "FooBar") is "Rocks!"
    32 PASS document.documentElement.hasAttributeNS("", "FooBar") is true
     31PASS document.documentElement.getAttributeNS("", "FooBar") is null
     32PASS document.documentElement.hasAttributeNS("", "FooBar") is false
    3333PASS successfullyParsed is true
    3434
  • trunk/LayoutTests/fast/dom/Element/setAttributeNode-overriding-lowercase-values-1-xml.xhtml

    r195247 r195248  
    11<!DOCTYPE html>
    2 <html>
     2<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    33<head>
    4 <meta charset="utf-8">
     4<meta charset="utf-8"/>
    55<script src="../../../resources/js-test-pre.js"></script>
    66</head>
     
    1313document.documentElement.setAttribute('FooBar', 'WebKit');
    1414
    15 shouldBeEqualToString('document.documentElement.getAttribute("foobar")', 'WebKit');
    16 shouldBeTrue('document.documentElement.hasAttribute("foobar")');
     15shouldBeNull('document.documentElement.getAttribute("foobar")');
     16shouldBeFalse('document.documentElement.hasAttribute("foobar")');
    1717shouldBeEqualToString('document.documentElement.getAttribute("FooBar")', 'WebKit');
    1818shouldBeTrue('document.documentElement.hasAttribute("FooBar")');
    1919
    20 shouldBeEqualToString('document.documentElement.getAttributeNS("", "foobar")', 'WebKit');
    21 shouldBeTrue('document.documentElement.hasAttributeNS("", "foobar")');
    22 shouldBe('document.documentElement.getAttributeNS("", "FooBar")', 'null');
    23 shouldBeFalse('document.documentElement.hasAttributeNS("", "FooBar")');
     20shouldBeNull('document.documentElement.getAttributeNS("", "foobar")', 'WebKit');
     21shouldBeFalse('document.documentElement.hasAttributeNS("", "foobar")');
     22shouldBeEqualToString('document.documentElement.getAttributeNS("", "FooBar")', 'WebKit');
     23shouldBeTrue('document.documentElement.hasAttributeNS("", "FooBar")');
    2424
    2525
    26 shouldBe('document.documentElement.attributes.length', '1');
     26shouldBe('document.documentElement.attributes.length', '3');
    2727
    28 // "FooBar" should nuke the "foobar" value while itself having the "FooBar" name.
     28// Should replace the value of "FooBar" by "WebKit".
    2929var camelCaseFoobar = document.createAttribute("FooBar");
    3030camelCaseFoobar.value = 'Rocks!'
     
    3535shouldBe('document.documentElement.getAttribute("foobar")', 'null');
    3636shouldBeFalse('document.documentElement.hasAttribute("foobar")');
    37 shouldBe('document.documentElement.getAttribute("FooBar")', 'null');
    38 shouldBeFalse('document.documentElement.hasAttribute("FooBar")');
     37shouldBeEqualToString('document.documentElement.getAttribute("FooBar")', 'Rocks!');
     38shouldBeTrue('document.documentElement.hasAttribute("FooBar")');
    3939
    4040shouldBe('document.documentElement.getAttributeNS("", "foobar")', 'null');
     
    5252shouldBeEqualToString('document.documentElement.getAttribute("foobar")', 'WebKit2');
    5353shouldBeTrue('document.documentElement.hasAttribute("foobar")');
    54 shouldBeEqualToString('document.documentElement.getAttribute("FooBar")', 'WebKit2');
     54shouldBeEqualToString('document.documentElement.getAttribute("FooBar")', 'Rocks!');
    5555shouldBeTrue('document.documentElement.hasAttribute("FooBar")');
    5656
  • trunk/LayoutTests/fast/dom/Element/setAttributeNode-overriding-lowercase-values-1.html

    r179497 r195248  
    2626shouldBe('document.documentElement.attributes.length', '1');
    2727
    28 // "FooBar" should nuke the "foobar" value while itself having the "FooBar" name.
     28// "FooBar" should nuke the "foobar" value and itself having the "foobar" name.
    2929var camelCaseFoobar = document.createAttribute("FooBar");
    3030camelCaseFoobar.value = 'Rocks!'
     
    3333shouldNotBe('camelCaseFoobar', 'oldAttributeNode');
    3434
    35 shouldBe('document.documentElement.getAttribute("foobar")', 'null');
    36 shouldBeFalse('document.documentElement.hasAttribute("foobar")');
    37 shouldBe('document.documentElement.getAttribute("FooBar")', 'null');
    38 shouldBeFalse('document.documentElement.hasAttribute("FooBar")');
     35shouldBeEqualToString('document.documentElement.getAttribute("foobar")', 'Rocks!');
     36shouldBeTrue('document.documentElement.hasAttribute("foobar")');
     37shouldBeEqualToString('document.documentElement.getAttribute("FooBar")', 'Rocks!');
     38shouldBeTrue('document.documentElement.hasAttribute("FooBar")');
    3939
    40 shouldBe('document.documentElement.getAttributeNS("", "foobar")', 'null');
    41 shouldBeFalse('document.documentElement.hasAttributeNS("", "foobar")');
    42 shouldBeEqualToString('document.documentElement.getAttributeNS("", "FooBar")', 'Rocks!');
    43 shouldBeTrue('document.documentElement.hasAttributeNS("", "FooBar")');
     40shouldBeEqualToString('document.documentElement.getAttributeNS("", "foobar")', 'Rocks!');
     41shouldBeTrue('document.documentElement.hasAttributeNS("", "foobar")');
     42shouldBeNull('document.documentElement.getAttributeNS("", "FooBar")');
     43shouldBeFalse('document.documentElement.hasAttributeNS("", "FooBar")');
    4444
    4545// "foobar" should exist alongside "FooBar".
     
    4848var oldAttributeNode2 = document.documentElement.setAttributeNode(lowerCaseFoobar);
    4949
    50 shouldBe('oldAttributeNode2', 'null');
     50shouldBe('oldAttributeNode2', 'camelCaseFoobar');
    5151
    5252shouldBeEqualToString('document.documentElement.getAttribute("foobar")', 'WebKit2');
     
    5757shouldBeEqualToString('document.documentElement.getAttributeNS("", "foobar")', 'WebKit2');
    5858shouldBeTrue('document.documentElement.hasAttributeNS("", "foobar")');
    59 shouldBeEqualToString('document.documentElement.getAttributeNS("", "FooBar")', 'Rocks!');
    60 shouldBeTrue('document.documentElement.hasAttributeNS("", "FooBar")');
     59shouldBeNull('document.documentElement.getAttributeNS("", "FooBar")');
     60shouldBeFalse('document.documentElement.hasAttributeNS("", "FooBar")');
    6161</script>
    6262<script src="../../../resources/js-test-post.js"></script>
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r195229 r195248  
     12016-01-18  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        createAttribute should lowercase the attribute name in a HTML document
     4        https://bugs.webkit.org/show_bug.cgi?id=153112
     5
     6        Reviewed by Darin Adler.
     7
     8        Rebaseline a test now that it's passing all test cases.
     9
     10        * web-platform-tests/dom/nodes/Document-createAttribute-expected.txt:
     11
    1122016-01-18  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createAttribute-expected.txt

    r191379 r195248  
    1616PASS HTML document.createAttribute("title")
    1717PASS XML document.createAttribute("title")
    18 FAIL HTML document.createAttribute("TITLE") assert_equals: expected "title" but got "TITLE"
     18PASS HTML document.createAttribute("TITLE")
    1919PASS XML document.createAttribute("TITLE")
    2020PASS HTML document.createAttribute(null)
  • trunk/Source/WebCore/ChangeLog

    r195247 r195248  
     12016-01-18  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        createAttribute should lowercase the attribute name in a HTML document
     4        https://bugs.webkit.org/show_bug.cgi?id=153112
     5
     6        Reviewed by Darin Adler.
     7
     8        In a HTML document, we should always lowercase localName in document.createAttribute as specified in
     9        https://dom.spec.whatwg.org/#dom-document-createattribute:
     10
     11        1. If localName does not match the Name production in XML, throw an InvalidCharacterError exception.
     12        2. If the context object is an HTML document, let localName be converted to ASCII lowercase.
     13        3. Return a new attribute whose local name is localName.
     14
     15        Change WebKit's behavior to match the spec as well as Firefox. document.createAttributeNS will
     16        continue to preserve the case as spec'ed.
     17
     18        No new tests are added since the behavior change is covered by existing tests.
     19
     20        * dom/Document.cpp:
     21        (WebCore::Document::createAttribute):
     22
    1232016-01-18  Brady Eidson  <beidson@apple.com>
    224
  • trunk/Source/WebCore/dom/Document.cpp

    r195142 r195248  
    49204920RefPtr<Attr> Document::createAttribute(const String& name, ExceptionCode& ec)
    49214921{
    4922     return createAttributeNS(String(), name, ec, true);
     4922    return createAttributeNS(String(), isHTMLDocument() ? name.convertToASCIILowercase() : name, ec, true);
    49234923}
    49244924
Note: See TracChangeset for help on using the changeset viewer.