Title: [111653] trunk
Revision
111653
Author
yu...@chromium.org
Date
2012-03-21 23:17:24 -0700 (Wed, 21 Mar 2012)

Log Message

Web Inspector: event listeners section is broken for about:blank page
https://bugs.webkit.org/show_bug.cgi?id=81795

Source/WebCore:

Parse about:blank as a valid URL.

Reviewed by Pavel Feldman.

Test: inspector/elements/event-listeners-about-blank.html

* inspector/front-end/utilities.js:
(String.prototype.asParsedURL):

LayoutTests:

Reviewed by Pavel Feldman.

* inspector/elements/event-listeners-about-blank-expected.txt: Added.
* inspector/elements/event-listeners-about-blank.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (111652 => 111653)


--- trunk/LayoutTests/ChangeLog	2012-03-22 04:58:22 UTC (rev 111652)
+++ trunk/LayoutTests/ChangeLog	2012-03-22 06:17:24 UTC (rev 111653)
@@ -1,3 +1,13 @@
+2012-03-21  Yury Semikhatsky  <yu...@chromium.org>
+
+        Web Inspector: event listeners section is broken for about:blank page
+        https://bugs.webkit.org/show_bug.cgi?id=81795
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/elements/event-listeners-about-blank-expected.txt: Added.
+        * inspector/elements/event-listeners-about-blank.html: Added.
+
 2012-03-21  Raphael Kubo da Costa  <rak...@freebsd.org>
 
         [EFL] Unreviewed gardening.

Added: trunk/LayoutTests/inspector/elements/event-listeners-about-blank-expected.txt (0 => 111653)


--- trunk/LayoutTests/inspector/elements/event-listeners-about-blank-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/elements/event-listeners-about-blank-expected.txt	2012-03-22 06:17:24 UTC (rev 111653)
@@ -0,0 +1,24 @@
+Tests event listeners output in the Elements sidebar panel when the listeners are added on an element in about:blank page.
+
+
+
+======== click ========
+[expanded] body event-listeners-about-blank.html:9
+    isAttribute: false
+    lineNumber: 9
+    listenerBody: function f() {}
+    node: HTMLBodyElement
+    sourceName: [clipped-for-test]/LayoutTests/inspector/elements/event-listeners-about-blank.html
+    type: click
+    useCapture: true
+
+======== hover ========
+[expanded] div#div-in-iframe event-listeners-about-blank.html:9
+    isAttribute: false
+    lineNumber: 9
+    listenerBody: function f() {}
+    node: HTMLDivElement
+    sourceName: [clipped-for-test]/LayoutTests/inspector/elements/event-listeners-about-blank.html
+    type: hover
+    useCapture: true
+
Property changes on: trunk/LayoutTests/inspector/elements/event-listeners-about-blank-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/inspector/elements/event-listeners-about-blank.html (0 => 111653)


--- trunk/LayoutTests/inspector/elements/event-listeners-about-blank.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/elements/event-listeners-about-blank.html	2012-03-22 06:17:24 UTC (rev 111653)
@@ -0,0 +1,46 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+
+function setupEventListeners()
+{
+    function f() {}
+    var frame = document.getElementById("myframe");
+    var body = frame.contentDocument.body;
+    body.addEventListener("click", f, true);
+    var div = frame.contentDocument.createElement("div");
+    div.id = "div-in-iframe";
+    div.addEventListener("hover", f, true);
+    body.appendChild(div);
+}
+
+function test()
+{
+    WebInspector.settings.eventListenersFilter.set("all");
+    InspectorTest.selectNodeWithId("div-in-iframe", step1);
+
+    function step1()
+    {
+        InspectorTest.expandAndDumpSelectedElementEventListeners(InspectorTest.completeTest);
+    }
+}
+
+function onloadHandler()
+{
+    setupEventListeners();
+    runTest();
+}
+</script>
+</head>
+
+<body _onload_="onloadHandler()">
+<p>
+Tests event listeners output in the Elements sidebar panel when the listeners are added on an element in about:blank page.
+</p>
+
+<iframe id="myframe"></iframe>
+
+</body>
+</html>
Property changes on: trunk/LayoutTests/inspector/elements/event-listeners-about-blank.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (111652 => 111653)


--- trunk/Source/WebCore/ChangeLog	2012-03-22 04:58:22 UTC (rev 111652)
+++ trunk/Source/WebCore/ChangeLog	2012-03-22 06:17:24 UTC (rev 111653)
@@ -1,3 +1,17 @@
+2012-03-21  Yury Semikhatsky  <yu...@chromium.org>
+
+        Web Inspector: event listeners section is broken for about:blank page
+        https://bugs.webkit.org/show_bug.cgi?id=81795
+
+        Parse about:blank as a valid URL.
+
+        Reviewed by Pavel Feldman.
+
+        Test: inspector/elements/event-listeners-about-blank.html
+
+        * inspector/front-end/utilities.js:
+        (String.prototype.asParsedURL):
+
 2012-03-21  Dan Bernstein  <m...@apple.com>
 
         REGRESSION (r111635): Assertion failure in RenderFlexibleBox::layoutFlexItems() (!lineContexts.size()) in many flexbox tests

Modified: trunk/Source/WebCore/inspector/front-end/utilities.js (111652 => 111653)


--- trunk/Source/WebCore/inspector/front-end/utilities.js	2012-03-22 04:58:22 UTC (rev 111652)
+++ trunk/Source/WebCore/inspector/front-end/utilities.js	2012-03-22 06:17:24 UTC (rev 111653)
@@ -458,8 +458,15 @@
     // 4 - ?path
     // 5 - ?fragment
     var match = this.match(/^([^:]+):\/\/([^\/:]*)(?::([\d]+))?(?:(\/[^#]*)(?:#(.*))?)?$/i);
-    if (!match)
+    if (!match) {
+        if (this == "about:blank") {
+            return { scheme: "about",
+                     host: "blank",
+                     path: "/",
+                     lastPathComponent: ""};
+        }
         return null;
+    }
     var result = {};
     result.scheme = match[1].toLowerCase();
     result.host = match[2];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to