Title: [205068] trunk/Source/WebCore
Revision
205068
Author
[email protected]
Date
2016-08-26 19:53:37 -0700 (Fri, 26 Aug 2016)

Log Message

REGRESSION (r203535): Web Inspector: Inspector overlay node info has disappeared
https://bugs.webkit.org/show_bug.cgi?id=161264

Patch by Devin Rousso <[email protected]> on 2016-08-26
Reviewed by Joseph Pecoraro.

No new tests.  Fixing _javascript_ error in Inspector overlay.

* inspector/InspectorOverlay.cpp:
(evaluateCommandInOverlay):
(WebCore::InspectorOverlay::evaluateInOverlay):
Add ASSERT to ensure that errors in the Inspector overlay will cause tests to crash.

* inspector/InspectorOverlayPage.js:
(DOMBuilder.prototype.appendTextNode):
Move textContent value to parameter of document.createTextNode.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (205067 => 205068)


--- trunk/Source/WebCore/ChangeLog	2016-08-27 02:51:24 UTC (rev 205067)
+++ trunk/Source/WebCore/ChangeLog	2016-08-27 02:53:37 UTC (rev 205068)
@@ -1,3 +1,21 @@
+2016-08-26  Devin Rousso  <[email protected]>
+
+        REGRESSION (r203535): Web Inspector: Inspector overlay node info has disappeared
+        https://bugs.webkit.org/show_bug.cgi?id=161264
+
+        Reviewed by Joseph Pecoraro.
+
+        No new tests.  Fixing _javascript_ error in Inspector overlay.
+
+        * inspector/InspectorOverlay.cpp:
+        (evaluateCommandInOverlay):
+        (WebCore::InspectorOverlay::evaluateInOverlay):
+        Add ASSERT to ensure that errors in the Inspector overlay will cause tests to crash.
+
+        * inspector/InspectorOverlayPage.js:
+        (DOMBuilder.prototype.appendTextNode):
+        Move textContent value to parameter of document.createTextNode.
+
 2016-08-26  Sam Weinig  <[email protected]>
 
         Remove support for ENABLE_LEGACY_WEB_AUDIO

Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (205067 => 205068)


--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp	2016-08-27 02:51:24 UTC (rev 205067)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp	2016-08-27 02:53:37 UTC (rev 205068)
@@ -921,11 +921,18 @@
     evaluateInOverlay("reset", WTFMove(configObject));
 }
 
+static void evaluateCommandInOverlay(Page* page, Ref<InspectorArray>&& command)
+{
+    JSC::JSValue result = page->mainFrame().script().evaluate(ScriptSourceCode(makeString("dispatch(", command->toJSONString(), ')')));
+    ASSERT_UNUSED(result, result); // There should never be exceptions when evaluating in the overlay page.
+}
+
 void InspectorOverlay::evaluateInOverlay(const String& method)
 {
     Ref<InspectorArray> command = InspectorArray::create();
     command->pushString(method);
-    overlayPage()->mainFrame().script().evaluate(ScriptSourceCode(makeString("dispatch(", command->toJSONString(), ')')));
+
+    evaluateCommandInOverlay(overlayPage(), WTFMove(command));
 }
 
 void InspectorOverlay::evaluateInOverlay(const String& method, const String& argument)
@@ -933,7 +940,8 @@
     Ref<InspectorArray> command = InspectorArray::create();
     command->pushString(method);
     command->pushString(argument);
-    overlayPage()->mainFrame().script().evaluate(ScriptSourceCode(makeString("dispatch(", command->toJSONString(), ')')));
+
+    evaluateCommandInOverlay(overlayPage(), WTFMove(command));
 }
 
 void InspectorOverlay::evaluateInOverlay(const String& method, RefPtr<InspectorValue>&& argument)
@@ -941,7 +949,8 @@
     Ref<InspectorArray> command = InspectorArray::create();
     command->pushString(method);
     command->pushValue(WTFMove(argument));
-    overlayPage()->mainFrame().script().evaluate(ScriptSourceCode(makeString("dispatch(", command->toJSONString(), ')')));
+
+    evaluateCommandInOverlay(overlayPage(), WTFMove(command));
 }
 
 void InspectorOverlay::freePage()

Modified: trunk/Source/WebCore/inspector/InspectorOverlayPage.js (205067 => 205068)


--- trunk/Source/WebCore/inspector/InspectorOverlayPage.js	2016-08-27 02:51:24 UTC (rev 205067)
+++ trunk/Source/WebCore/inspector/InspectorOverlayPage.js	2016-08-27 02:53:37 UTC (rev 205068)
@@ -221,8 +221,7 @@
 
 DOMBuilder.prototype.appendTextNode = function(content)
 {
-    var node = document.createTextNode();
-    node.textContent = content;
+    let node = document.createTextNode(content);
     this.element.appendChild(node);
     return node;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to