Title: [144702] trunk
Revision
144702
Author
[email protected]
Date
2013-03-04 17:45:30 -0800 (Mon, 04 Mar 2013)

Log Message

Unreviewed, rolling out r144595.
http://trac.webkit.org/changeset/144595
https://bugs.webkit.org/show_bug.cgi?id=90341

Causing multiple crashes in fast/dom/Element/* tests (hits
assert in Attr.cp:215)

Source/WebCore:

* dom/Element.cpp:
(WebCore::Element::setAttributeNode):

LayoutTests:

* fast/dom/Element/setAttributeNode-case-insensitivity-expected.txt: Removed.
* fast/dom/Element/setAttributeNode-case-insensitivity.html: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (144701 => 144702)


--- trunk/LayoutTests/ChangeLog	2013-03-05 01:42:20 UTC (rev 144701)
+++ trunk/LayoutTests/ChangeLog	2013-03-05 01:45:30 UTC (rev 144702)
@@ -1,5 +1,17 @@
 2013-03-04  Rafael Weinstein  <[email protected]>
 
+        Unreviewed, rolling out r144595.
+        http://trac.webkit.org/changeset/144595
+        https://bugs.webkit.org/show_bug.cgi?id=90341
+
+        Causing multiple crashes in fast/dom/Element/* tests (hits
+        assert in Attr.cp:215)
+
+        * fast/dom/Element/setAttributeNode-case-insensitivity-expected.txt: Removed.
+        * fast/dom/Element/setAttributeNode-case-insensitivity.html: Removed.
+
+2013-03-04  Rafael Weinstein  <[email protected]>
+
         Unreviewed gardening.
 
         * platform/chromium/TestExpectations: touch-gesture-noscroll-body-* are failing on mac.

Deleted: trunk/LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity-expected.txt (144701 => 144702)


--- trunk/LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity-expected.txt	2013-03-05 01:42:20 UTC (rev 144701)
+++ trunk/LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity-expected.txt	2013-03-05 01:45:30 UTC (rev 144702)
@@ -1,16 +0,0 @@
-Test for Bugzilla bug: 90341: createAttribute/setAttributeNode does not properly normalize case.
-This test verifies that the setAttributeNode() API checks for existing attributes case-insensitively. Thus the value of an existing attribute with the same name but in a different case should get replaced by the new value specified via the setAttributeNode() method. The issue can be manually verified if a green colored block is displayed instead of a red one.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS test.getAttribute('style') is test.getAttribute('STYLE')
-PASS test.getAttributeNode('style').value is test.getAttributeNode('STYLE').value
-Verifying 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.
-PASS test.getAttributeNodeNS('ns1', 'newattr').value is 'newattr1'
-PASS test.getAttributeNodeNS('ns2', 'newattr').value is 'newattr2'
-Verifying that attributes with same name but different case and having same namespaces are treated as same. In the following test the new attribute should overwrite the value of the existing one.
-PASS test.getAttributeNodeNS('ns1', 'newattr').value is 'newattr3'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity.html (144701 => 144702)


--- trunk/LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity.html	2013-03-05 01:42:20 UTC (rev 144701)
+++ trunk/LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity.html	2013-03-05 01:45:30 UTC (rev 144702)
@@ -1,61 +0,0 @@
-<html>
-<head>
-<style>
-#test {
-    font-family: ahem;
-    width: 50;
-    height: 50;
-}
-</style>
-<script src=""
-<script>
-function runTest()
-{
-    description("This test verifies that the setAttributeNode() API checks for existing attributes case-insensitively. Thus the value of an existing attribute with the same name but in a different case should get replaced by the new value specified via the setAttributeNode() method.\nThe issue can be manually verified if a green colored block is displayed instead of a red one.");
-    
-    var test = document.getElementById("test");
-    var newStyleAttr = document.createAttribute("STYLE");
-    newStyleAttr.value = "background-color: green";
-    test.setAttributeNode(newStyleAttr);
-    if (window.testRunner) {
-        shouldBe("test.getAttribute('style')", "test.getAttribute('STYLE')");
-        shouldBe("test.getAttributeNode('style').value", "test.getAttributeNode('STYLE').value");
-    }
-
-    debug("Verifying 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.");
-    var newAttr1 = document.createAttributeNS("ns1", "newattr");
-    newAttr1.prefix = "prefix1";
-    newAttr1.value = "newattr1";
-    test.setAttributeNode(newAttr1);
-    var newAttr2 = document.createAttributeNS("ns2", "newattr");
-    newAttr2.prefix = "prefix2";
-    newAttr2.value = "newattr2";
-    test.setAttributeNode(newAttr2);
-    if (window.testRunner) {
-        shouldBe("test.getAttributeNodeNS('ns1', 'newattr').value", "'newattr1'");
-        shouldBe("test.getAttributeNodeNS('ns2', 'newattr').value", "'newattr2'");
-    }
-
-    debug("Verifying that attributes with same name but different case and having same namespaces are treated as same. In the following test the new attribute should overwrite the value of the existing one.");
-    var newAttr3 = document.createAttributeNS("ns1", "NEWATTR");
-    newAttr3.prefix = "prefix2";
-    newAttr3.value = "newattr3";
-    test.setAttributeNode(newAttr3);
-
-    if (window.testRunner) {
-        shouldBe("test.getAttributeNodeNS('ns1', 'newattr').value", "'newattr3'");
-    
-        isSuccessfullyParsed();    
-        test.style.display = 'none';
-    }
-    
-}
-</script>
-</head>
-<body _onload_="runTest()">
-<div>Test for Bugzilla bug:<a href="" 90341:</a>  createAttribute/setAttributeNode does not properly normalize case.</div>
-<div id="test" style="background-color: red">&nbsp;</div>
-<div id="description"></div>
-<div id="console"></div>
-</body>
-</html>

Modified: trunk/Source/WebCore/ChangeLog (144701 => 144702)


--- trunk/Source/WebCore/ChangeLog	2013-03-05 01:42:20 UTC (rev 144701)
+++ trunk/Source/WebCore/ChangeLog	2013-03-05 01:45:30 UTC (rev 144702)
@@ -1,3 +1,15 @@
+2013-03-04  Rafael Weinstein  <[email protected]>
+
+        Unreviewed, rolling out r144595.
+        http://trac.webkit.org/changeset/144595
+        https://bugs.webkit.org/show_bug.cgi?id=90341
+
+        Causing multiple crashes in fast/dom/Element/* tests (hits
+        assert in Attr.cp:215)
+
+        * dom/Element.cpp:
+        (WebCore::Element::setAttributeNode):
+
 2013-02-26  Kentaro Hara  <[email protected]>
 
         [chromium] Implement TRACE_EVENT macros for sampling profiling

Modified: trunk/Source/WebCore/dom/Element.cpp (144701 => 144702)


--- trunk/Source/WebCore/dom/Element.cpp	2013-03-05 01:42:20 UTC (rev 144701)
+++ trunk/Source/WebCore/dom/Element.cpp	2013-03-05 01:45:30 UTC (rev 144702)
@@ -1708,9 +1708,7 @@
         return 0;
     }
 
-    const QualifiedName& attrName = attrNode->qualifiedName();
-
-    RefPtr<Attr> oldAttrNode = attrIfExists(attrName);
+    RefPtr<Attr> oldAttrNode = attrIfExists(attrNode->qualifiedName());
     if (oldAttrNode.get() == attrNode)
         return attrNode; // This Attr is already attached to the element.
 
@@ -1724,16 +1722,15 @@
     synchronizeAllAttributes();
     UniqueElementData* elementData = ensureUniqueElementData();
 
-    const QualifiedName& caseAdjustedName = shouldIgnoreAttributeCase(this) ? QualifiedName(attrName.prefix(), attrName.localName().lower(), attrName.namespaceURI()) : attrName;
-    size_t index = elementData->getAttributeItemIndex(caseAdjustedName);
+    size_t index = elementData->getAttributeItemIndex(attrNode->qualifiedName());
     if (index != notFound) {
         if (oldAttrNode)
             detachAttrNodeFromElementWithValue(oldAttrNode.get(), elementData->attributeItem(index)->value());
         else
-            oldAttrNode = Attr::create(document(), attrName, elementData->attributeItem(index)->value());
+            oldAttrNode = Attr::create(document(), attrNode->qualifiedName(), elementData->attributeItem(index)->value());
     }
 
-    setAttributeInternal(index, index != notFound ? caseAdjustedName : attrName, attrNode->value(), NotInSynchronizationOfLazyAttribute);
+    setAttributeInternal(index, attrNode->qualifiedName(), attrNode->value(), NotInSynchronizationOfLazyAttribute);
 
     attrNode->attachToElement(this);
     ensureAttrNodeListForElement(this)->append(attrNode);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to