[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

jamesr at google.com jamesr at google.com
Thu Apr 8 01:58:30 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit c3cbb6fe81a6ec7c4f7e61ca0dd572032eca0585
Author: jamesr at google.com <jamesr at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 24 23:17:52 2010 +0000

    2010-02-24  James Robinson  <jamesr at chromium.org>
    
            Reviewed by Dmitry Titov.
    
            Do not fire focus events while a modal dialog is up.
            https://bugs.webkit.org/show_bug.cgi?id=33962
    
            Modifies the FocusController to check the frame's page's defersLoading() flag before firing blur/focus events.
            This flag is set while a modal dialog (like a window.alert or window.confirm) is up.  Firing the events causes
            assertion failures, since when the dialog is dismissed the PageGroupLoadDeferrer assumes that no script has run.
    
            Manual tests only as DumpRenderTree does not support modal dialogs
    
            * manual-tests/modal-dialog-blur-selfclose.html: Added.
            * manual-tests/modal-dialog-blur.html: Added.
            * page/FocusController.cpp:
            (WebCore::dispatchEventsOnWindowAndFocusedNode):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 402651b..1b91289 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-02-24  James Robinson  <jamesr at chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Do not fire focus events while a modal dialog is up.
+        https://bugs.webkit.org/show_bug.cgi?id=33962
+
+        Modifies the FocusController to check the frame's page's defersLoading() flag before firing blur/focus events.
+        This flag is set while a modal dialog (like a window.alert or window.confirm) is up.  Firing the events causes
+        assertion failures, since when the dialog is dismissed the PageGroupLoadDeferrer assumes that no script has run.
+
+        Manual tests only as DumpRenderTree does not support modal dialogs
+
+        * manual-tests/modal-dialog-blur-selfclose.html: Added.
+        * manual-tests/modal-dialog-blur.html: Added.
+        * page/FocusController.cpp:
+        (WebCore::dispatchEventsOnWindowAndFocusedNode):
+
 2010-02-24  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/WebCore/manual-tests/modal-dialog-blur-selfclose.html b/WebCore/manual-tests/modal-dialog-blur-selfclose.html
new file mode 100644
index 0000000..c6b2da8
--- /dev/null
+++ b/WebCore/manual-tests/modal-dialog-blur-selfclose.html
@@ -0,0 +1,3 @@
+<script>
+window.close()
+</script>
diff --git a/WebCore/manual-tests/modal-dialog-blur.html b/WebCore/manual-tests/modal-dialog-blur.html
new file mode 100644
index 0000000..bd72aa5
--- /dev/null
+++ b/WebCore/manual-tests/modal-dialog-blur.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head><title>
+Tests blur/focus events with modal dialogs
+</title></head>
+<script>
+var failed = "";
+function failBlur() {
+  failed = "blur";
+}
+function failFocus() {
+  failed = "focus";
+}
+
+var inputElement;
+
+function test() {
+  inputElement = document.getElementById("i")
+  inputElement.focus();
+  inputElement.addEventListener("blur", failBlur, false);
+  inputElement.addEventListener("focus", failFocus, false);
+  window.showModalDialog("modal-dialog-blur-selfclose.html");
+  if (failed) {
+    document.getElementById("status").innerHTML = "FAIL, " + failed;
+  } else {
+    document.getElementById("status").innerHTML = "SUCCESS";
+  }
+}
+</script>
+<body onload="test()">
+<input id="i"></input>
+<div id="status">RUNNING...</div>
+</body>
+</html>
diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp
index bdd3151..21779f9 100644
--- a/WebCore/page/FocusController.cpp
+++ b/WebCore/page/FocusController.cpp
@@ -61,6 +61,10 @@ static inline void dispatchEventsOnWindowAndFocusedNode(Document* document, bool
     // If we have a focused node we should dispatch blur on it before we blur the window.
     // If we have a focused node we should dispatch focus on it after we focus the window.
     // https://bugs.webkit.org/show_bug.cgi?id=27105
+  
+    // Do not fire events while modal dialogs are up.  See https://bugs.webkit.org/show_bug.cgi?id=33962
+    if (document->page()->defersLoading())
+        return;
     if (!focused && document->focusedNode())
         document->focusedNode()->dispatchBlurEvent();
     document->dispatchWindowEvent(Event::create(focused ? eventNames().focusEvent : eventNames().blurEvent, false, false));

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list