LayoutTests:
authorantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2007 18:11:02 +0000 (18:11 +0000)
committerantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2007 18:11:02 +0000 (18:11 +0000)
        Reviewed by Adele.

        Test for <rdar://problem/5333365>
        Calling click() is very slow

        * fast/forms/slow-click-expected.txt: Added.
        * fast/forms/slow-click.html: Added.

WebCore:

        Reviewed by Adele.

        Fix <rdar://problem/5333365>
        Calling click() is very slow

        There is a 100ms delay in ContainerNode::setActive() to do an activation effect. It is used for
        simulated mouse activations (using keyboard for example). However, it shouldn't be done when calling from javascript
        (through click() interface) since it hangs script execution.

        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::click):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@24263 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/forms/slow-click-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/slow-click.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLElement.cpp

index a4f8d9c0b963f2bfbb6a11ef86a5ddecda62e284..ec77ee7a7dc3ce0101251f83a60bf8ec26e497fd 100644 (file)
@@ -1,3 +1,13 @@
+2007-07-13  Antti Koivisto  <antti@apple.com>
+
+        Reviewed by Adele.
+        
+        Test for <rdar://problem/5333365>
+        Calling click() is very slow
+
+        * fast/forms/slow-click-expected.txt: Added.
+        * fast/forms/slow-click.html: Added.
+
 2007-07-14  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Sam.
diff --git a/LayoutTests/fast/forms/slow-click-expected.txt b/LayoutTests/fast/forms/slow-click-expected.txt
new file mode 100644 (file)
index 0000000..c5cd76f
--- /dev/null
@@ -0,0 +1,3 @@
+Test that click() on checkboxes is not slow.
+PASS
diff --git a/LayoutTests/fast/forms/slow-click.html b/LayoutTests/fast/forms/slow-click.html
new file mode 100644 (file)
index 0000000..6bf49f3
--- /dev/null
@@ -0,0 +1,16 @@
+
+<body>
+Test that click() on checkboxes is not slow.<br><input type=checkbox id=cb>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+    
+var starttime = new Date().getTime();
+var cb = document.getElementById('cb');
+for (n=0; n<100; n++) {
+    cb.click();
+}
+var endtime = new Date().getTime() - starttime
+document.write("<br>" + (endtime > 2000 ? "FAIL, took more than 2s to click() 100 times" : "PASS"));
+</script>
+</body>
\ No newline at end of file
index 1cc5cc0339706a231769a143b7bb352edc892b0b..7fd05c61537926199ee4e11f477da9b77fb21d74 100644 (file)
@@ -1,3 +1,17 @@
+2007-07-13  Antti Koivisto  <antti@apple.com>
+
+        Reviewed by Adele.
+        
+        Fix <rdar://problem/5333365>
+        Calling click() is very slow
+        
+        There is a 100ms delay in ContainerNode::setActive() to do an activation effect. It is used for
+        simulated mouse activations (using keyboard for example). However, it shouldn't be done when calling from javascript 
+        (through click() interface) since it hangs script execution.
+
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::click):
+
 2007-07-13  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Dave Hyatt.
index 281d5c3792333fbed462fe819116ba9cf9778b95..6dc28301c33f60409af9ca18f1ed8b8fc2e4e886 100644 (file)
@@ -618,7 +618,7 @@ void HTMLElement::setContentEditable(const String &enabled)
 
 void HTMLElement::click()
 {
-    dispatchSimulatedClick(0);
+    dispatchSimulatedClick(0, false, false);
 }
 
 // accessKeyAction is used by the accessibility support code