Title: [119396] trunk/Source/WebCore
Revision
119396
Author
rwlb...@webkit.org
Date
2012-06-04 08:00:47 -0700 (Mon, 04 Jun 2012)

Log Message

Hit ASSERT when editing attribute value in Element in SVG Document
https://bugs.webkit.org/show_bug.cgi?id=88179

Patch by Rob Buis <rb...@rim.com> on 2012-06-04
Reviewed by Pavel Feldman.

Make sure the <span> is created as a HTML Element regardless of document in use.

* inspector/InspectorDOMAgent.cpp:
(WebCore):
(WebCore::InspectorDOMAgent::setAttributesAsText):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (119395 => 119396)


--- trunk/Source/WebCore/ChangeLog	2012-06-04 14:57:17 UTC (rev 119395)
+++ trunk/Source/WebCore/ChangeLog	2012-06-04 15:00:47 UTC (rev 119396)
@@ -1,3 +1,16 @@
+2012-06-04  Rob Buis  <rb...@rim.com>
+
+        Hit ASSERT when editing attribute value in Element in SVG Document
+        https://bugs.webkit.org/show_bug.cgi?id=88179
+
+        Reviewed by Pavel Feldman.
+
+        Make sure the <span> is created as a HTML Element regardless of document in use.
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore):
+        (WebCore::InspectorDOMAgent::setAttributesAsText):
+
 2012-06-04  Yoshifumi Inoue  <yo...@chromium.org>
 
         [Forms] Change function and variable names independent from "double" type

Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (119395 => 119396)


--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2012-06-04 14:57:17 UTC (rev 119395)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2012-06-04 15:00:47 UTC (rev 119396)
@@ -61,9 +61,9 @@
 #include "EventTarget.h"
 #include "Frame.h"
 #include "FrameTree.h"
-#include "HitTestResult.h"
 #include "HTMLElement.h"
 #include "HTMLFrameOwnerElement.h"
+#include "HitTestResult.h"
 #include "IdentifiersFactory.h"
 #include "InjectedScriptManager.h"
 #include "InspectorClient.h"
@@ -89,6 +89,7 @@
 #include "Text.h"
 #include "XPathResult.h"
 
+#include "htmlediting.h"
 #include "markup.h"
 
 #include <wtf/text/CString.h>
@@ -100,6 +101,8 @@
 
 namespace WebCore {
 
+using namespace HTMLNames;
+
 namespace DOMAgentState {
 static const char documentRequested[] = "documentRequested";
 
@@ -576,19 +579,14 @@
     if (!element)
         return;
 
+    RefPtr<HTMLElement> parsedElement = createHTMLElement(element->document(), spanTag);
     ExceptionCode ec = 0;
-    RefPtr<Element> parsedElement = element->document()->createElement("span", ec);
+    parsedElement.get()->setInnerHTML("<span " + text + "></span>", ec);
     if (ec) {
         *errorString = InspectorDOMAgent::toErrorString(ec);
         return;
     }
 
-    toHTMLElement(parsedElement.get())->setInnerHTML("<span " + text + "></span>", ec);
-    if (ec) {
-        *errorString = InspectorDOMAgent::toErrorString(ec);
-        return;
-    }
-
     Node* child = parsedElement->firstChild();
     if (!child) {
         *errorString = "Could not parse value as attributes";
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to