LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Aug 2007 21:29:27 +0000 (21:29 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Aug 2007 21:29:27 +0000 (21:29 +0000)
        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=14971
        REGRESSION: cannot select reporter's e-mail in bugzilla

        * editing/selection/14971-expected.checksum: Added.
        * editing/selection/14971-expected.png: Added.
        * editing/selection/14971-expected.txt: Added.
        * editing/selection/14971.html: Added.

WebCore:

        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=14971
        REGRESSION: cannot select reporter's e-mail in bugzilla

        * page/EventHandler.cpp:
        (WebCore::EventHandler::canMouseDragExtendSelect): Allow drag-selecting inside
        a -webkit-user-select:ignore region.

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

LayoutTests/ChangeLog
LayoutTests/editing/selection/14971-expected.checksum [new file with mode: 0644]
LayoutTests/editing/selection/14971-expected.png [new file with mode: 0644]
LayoutTests/editing/selection/14971-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/14971.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/EventHandler.cpp

index 1cc4e772a0d7473a124b20b873d527544e39e08f..9f81e4945e077ce2678634d0ba036eb4ee443b1e 100644 (file)
@@ -1,3 +1,15 @@
+2007-08-15  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by Darin.
+        
+        http://bugs.webkit.org/show_bug.cgi?id=14971
+        REGRESSION: cannot select reporter's e-mail in bugzilla
+        
+        * editing/selection/14971-expected.checksum: Added.
+        * editing/selection/14971-expected.png: Added.
+        * editing/selection/14971-expected.txt: Added.
+        * editing/selection/14971.html: Added.
+
 2007-08-15  Beth Dakin  <bdakin@apple.com>
 
         Test for new support of empty style sheets.
diff --git a/LayoutTests/editing/selection/14971-expected.checksum b/LayoutTests/editing/selection/14971-expected.checksum
new file mode 100644 (file)
index 0000000..5f6c685
--- /dev/null
@@ -0,0 +1 @@
+198af7c33016ab39f4ea94e07d2aa3a1
\ No newline at end of file
diff --git a/LayoutTests/editing/selection/14971-expected.png b/LayoutTests/editing/selection/14971-expected.png
new file mode 100644 (file)
index 0000000..8ac5e4b
Binary files /dev/null and b/LayoutTests/editing/selection/14971-expected.png differ
diff --git a/LayoutTests/editing/selection/14971-expected.txt b/LayoutTests/editing/selection/14971-expected.txt
new file mode 100644 (file)
index 0000000..c09e16e
--- /dev/null
@@ -0,0 +1,21 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 756x36
+          text run at (0,0) width 599: "This tests to make sure that a drag-selecting through a -webkit-user-select:ignore region works. "
+          text run at (599,0) width 157: "The selection should end"
+          text run at (0,18) width 270: "somewhere inside the word 'World' below."
+      RenderBlock {DIV} at (0,52) size 784x18
+        RenderInline {SPAN} at (0,0) size 35x18
+          RenderText {#text} at (0,0) size 35x18
+            text run at (0,0) width 35: "Hello"
+        RenderText {#text} at (35,0) size 4x18
+          text run at (35,0) width 4: " "
+        RenderInline {SPAN} at (0,0) size 40x18
+          RenderText {#text} at (39,0) size 40x18
+            text run at (39,0) width 40: "World"
+selection start: position 0 of child 0 {#text} of child 0 {SPAN} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
+selection end:   position 2 of child 0 {#text} of child 2 {SPAN} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/selection/14971.html b/LayoutTests/editing/selection/14971.html
new file mode 100644 (file)
index 0000000..3ad19fd
--- /dev/null
@@ -0,0 +1,25 @@
+<p>This tests to make sure that a drag-selecting through a -webkit-user-select:ignore region works.  The selection should end somewhere inside the word 'World' below.</p>
+<div><span id="start">Hello</span> <span id="end" style="-webkit-user-select:ignore;">World</span></div>
+
+<script>
+if (window.layoutTestController) {
+    start = document.getElementById("start");
+    end = document.getElementById("end");
+
+    x = start.offsetParent.offsetLeft + start.offsetLeft - 5;
+    y = start.offsetParent.offsetTop + start.offsetTop + start.offsetHeight / 2;
+    
+    eventSender.mouseMoveTo(x, y);
+    eventSender.mouseDown();
+    
+    eventSender.mouseMoveTo(x + 10, y);
+    eventSender.mouseMoveTo(x + 20, y);
+    eventSender.mouseMoveTo(x + 30, y);
+    
+    x = end.offsetParent.offsetLeft + end.offsetLeft + end.offsetWidth / 2;
+    y = end.offsetParent.offsetTop + end.offsetTop + end.offsetHeight / 2;
+    
+    eventSender.mouseMoveTo(x, y);
+    eventSender.mouseUp();
+}
+</script>
index 56236f9d1148f927cb62daa4589146f8b8edd156..2d1935d6734e0587267bae3f57e56be493d3d36e 100644 (file)
@@ -1,3 +1,14 @@
+2007-08-15  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by Darin.
+        
+        http://bugs.webkit.org/show_bug.cgi?id=14971
+        REGRESSION: cannot select reporter's e-mail in bugzilla
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::canMouseDragExtendSelect): Allow drag-selecting inside
+        a -webkit-user-select:ignore region.
+
 2007-08-15  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by Hyatt.
index 819fd903f925a54131a921881955e053673c1204..3cf1926beb568f43f904a24596b64d45a6a4d6a8 100644 (file)
@@ -1377,7 +1377,14 @@ bool EventHandler::canMouseDownStartSelect(Node* node)
 
 bool EventHandler::canMouseDragExtendSelect(Node* node)
 {
-    return canMouseDownStartSelect(node);
+    if (!node || !node->renderer())
+        return true;
+            
+    for (RenderObject* curr = node->renderer(); curr; curr = curr->parent())    
+        if (Node* node = curr->element())
+            return EventTargetNodeCast(node)->dispatchHTMLEvent(selectstartEvent, true, true);
+    
+    return true;
 }
 
 void EventHandler::setResizingFrameSet(HTMLFrameSetElement* frameSet)