Title: [105298] branches/safari-534.54-branch

Diff

Modified: branches/safari-534.54-branch/LayoutTests/ChangeLog (105297 => 105298)


--- branches/safari-534.54-branch/LayoutTests/ChangeLog	2012-01-18 18:51:40 UTC (rev 105297)
+++ branches/safari-534.54-branch/LayoutTests/ChangeLog	2012-01-18 18:57:40 UTC (rev 105298)
@@ -1,5 +1,19 @@
 2011-01-18  Lucas Forschler  <[email protected]>
 
+    Merge 104275
+
+    2012-01-05  Kent Tamura  <[email protected]>
+
+            Fix a crash by importing an element of which local name ends with ":input".
+            https://bugs.webkit.org/show_bug.cgi?id=75103
+
+            Reviewed by Ryosuke Niwa.
+
+            * fast/dom/importNode-confusing-localName-expected.txt: Added.
+            * fast/dom/importNode-confusing-localName.html: Added.
+
+2011-01-18  Lucas Forschler  <[email protected]>
+
     Merge 97088
 
     2011-10-10  Jeremy Apthorp  <[email protected]>

Copied: branches/safari-534.54-branch/LayoutTests/fast/dom/importNode-confusing-localName-expected.txt (from rev 104275, trunk/LayoutTests/fast/dom/importNode-confusing-localName-expected.txt) (0 => 105298)


--- branches/safari-534.54-branch/LayoutTests/fast/dom/importNode-confusing-localName-expected.txt	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/dom/importNode-confusing-localName-expected.txt	2012-01-18 18:57:40 UTC (rev 105298)
@@ -0,0 +1,5 @@
+PASS imported.constructor is source.constructor
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: branches/safari-534.54-branch/LayoutTests/fast/dom/importNode-confusing-localName.html (from rev 104275, trunk/LayoutTests/fast/dom/importNode-confusing-localName.html) (0 => 105298)


--- branches/safari-534.54-branch/LayoutTests/fast/dom/importNode-confusing-localName.html	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/dom/importNode-confusing-localName.html	2012-01-18 18:57:40 UTC (rev 105298)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<xht:input id="test"></xht:input>
+<script>
+var source = document.getElementById('test');
+var imported = document.importNode(source, true);
+shouldBe('imported.constructor', 'source.constructor');
+</script>
+<script src=""
+</body>
+</html>

Modified: branches/safari-534.54-branch/Source/WebCore/ChangeLog (105297 => 105298)


--- branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-18 18:51:40 UTC (rev 105297)
+++ branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-18 18:57:40 UTC (rev 105298)
@@ -1,5 +1,23 @@
 2011-01-18  Lucas Forschler  <[email protected]>
 
+    Merge 104275
+
+    2012-01-05  Kent Tamura  <[email protected]>
+
+            Fix a crash by importing an element of which local name ends with ":input".
+            https://bugs.webkit.org/show_bug.cgi?id=75103
+
+            Reviewed by Ryosuke Niwa.
+
+            Test: fast/dom/importNode-confusing-localName.html
+
+            * dom/Document.cpp:
+            (WebCore::Document::importNode): Pass QualifiedName of the source elemnt
+            to createElement() in order to avoid unnecessary serialization and
+            parsing of the qualified name
+
+2011-01-18  Lucas Forschler  <[email protected]>
+
     Merge 97088
 
     2011-10-10  Jeremy Apthorp  <[email protected]>

Modified: branches/safari-534.54-branch/Source/WebCore/dom/Document.cpp (105297 => 105298)


--- branches/safari-534.54-branch/Source/WebCore/dom/Document.cpp	2012-01-18 18:51:40 UTC (rev 105297)
+++ branches/safari-534.54-branch/Source/WebCore/dom/Document.cpp	2012-01-18 18:57:40 UTC (rev 105298)
@@ -809,8 +809,13 @@
         return createComment(importedNode->nodeValue());
     case ELEMENT_NODE: {
         Element* oldElement = static_cast<Element*>(importedNode);
-        RefPtr<Element> newElement = createElementNS(oldElement->namespaceURI(), oldElement->tagQName().toString(), ec);
-                    
+        // FIXME: The following check might be unnecessary. Is it possible that
+        // oldElement has mismatched prefix/namespace?
+        if (hasPrefixNamespaceMismatch(oldElement->tagQName())) {
+            ec = NAMESPACE_ERR;
+            return 0;
+        }
+        RefPtr<Element> newElement = createElement(oldElement->tagQName(), ec);
         if (ec)
             return 0;
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to