Fixed/added layout tests for:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Nov 2005 01:35:21 +0000 (01:35 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Nov 2005 01:35:21 +0000 (01:35 +0000)
        <http://bugzilla.opendarwin.org/show_bug.cgi?id=5354>
        Corner case where you can select outside the bounds of an editable block.

        Reviewed by darin

        * editing/inserting/insert-div-023-expected.txt:
        * editing/pasteboard/paste-4035648-fix-expected.txt:
        * editing/selection/3690719-expected.checksum:
        * editing/selection/3690719-expected.png:
        * editing/selection/3690719-expected.txt:
        * editing/selection/leave-requested-block-expected.checksum: Added.
        * editing/selection/leave-requested-block-expected.png: Added.
        * editing/selection/leave-requested-block-expected.txt: Added.
        * editing/selection/leave-requested-block.html: Added.
        * editing/style/block-style-004-expected.txt:

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

LayoutTests/ChangeLog
LayoutTests/editing/inserting/insert-div-023-expected.txt
LayoutTests/editing/pasteboard/paste-4035648-fix-expected.txt
LayoutTests/editing/selection/3690719-expected.checksum
LayoutTests/editing/selection/3690719-expected.png
LayoutTests/editing/selection/3690719-expected.txt
LayoutTests/editing/selection/leave-requested-block-expected.checksum [new file with mode: 0644]
LayoutTests/editing/selection/leave-requested-block-expected.png [new file with mode: 0644]
LayoutTests/editing/selection/leave-requested-block-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/leave-requested-block.html [new file with mode: 0644]
LayoutTests/editing/style/block-style-004-expected.txt

index 156fe7ca10add15dde21b9b027536bd055a2b140..7307e5769a13d99a2654cf2cd71d6afb7d713ac2 100644 (file)
@@ -1,3 +1,22 @@
+2005-11-28  Justin Garcia  <justin.garcia@apple.com>
+
+        Fixed/added layout tests for:
+        <http://bugzilla.opendarwin.org/show_bug.cgi?id=5354>
+        Corner case where you can select outside the bounds of an editable block.
+
+        Reviewed by darin
+
+        * editing/inserting/insert-div-023-expected.txt:
+        * editing/pasteboard/paste-4035648-fix-expected.txt:
+        * editing/selection/3690719-expected.checksum:
+        * editing/selection/3690719-expected.png:
+        * editing/selection/3690719-expected.txt:
+        * editing/selection/leave-requested-block-expected.checksum: Added.
+        * editing/selection/leave-requested-block-expected.png: Added.
+        * editing/selection/leave-requested-block-expected.txt: Added.
+        * editing/selection/leave-requested-block.html: Added.
+        * editing/style/block-style-004-expected.txt:
+
 2005-11-28  Justin Garcia  <justin.garcia@apple.com>
         
         I overlooked this layout test when fixing 4108909.
index bf6aa0868adfd992a9562af386a55c5ded2fe73a..be9f62988371629819361b0575972311a318cf98 100644 (file)
@@ -17,6 +17,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > B > P > B
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of P > BODY > HTML > #document to 0 of P > BODY > HTML > #document toDOMRange:range from 0 of P > BODY > HTML > #document to 0 of P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BR to 0 of BR toDOMRange:range from 1 of #text > B > P > BODY > HTML > #document to 1 of #text > B > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index 0d52f97e1d2cffcea25ce42011612f18fe1e74c7..4d9fd39c179d119e37b45f32ec1f130edd6c88c6 100644 (file)
@@ -47,7 +47,8 @@ layer at (0,0) size 800x600
           RenderInline {B} at (0,0) size 45x28
             RenderText {TEXT} at (2,30) size 45x28
               text run at (2,30) width 45: "bold"
+          RenderInline {B} at (0,0) size 0x28
             RenderBR {BR} at (0,0) size 0x0
           RenderText {TEXT} at (2,58) size 49x28
             text run at (2,58) width 49: "plain"
-caret: position 5 of child 2 {TEXT} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+caret: position 5 of child 3 {TEXT} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index e37100ccca4a6a252715dcb916d9f373d65c0ba2..85ad57c8adb77ccd405d4709845562e559616a1c 100644 (file)
@@ -1 +1 @@
-d0e914bd352192b9c7183d5b72050e8c
\ No newline at end of file
+35810d7f795607272b4af3452332c614
\ No newline at end of file
index 294ecb0cf50025585813afdef91adab5a78c23b3..78587ba970a9317edb0c77fe9d0f6d5748755d3c 100644 (file)
Binary files a/LayoutTests/editing/selection/3690719-expected.png and b/LayoutTests/editing/selection/3690719-expected.png differ
index ec6865553d956ce986986c86e21f83e878589284..73094d8723cd97a95e90fb1b0d0871a5296af1c2 100644 (file)
@@ -1,5 +1,5 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of TD > TR > TBODY > TABLE > DIV > CENTER > BODY > HTML > #document to 0 of TD > TR > TBODY > TABLE > DIV > CENTER > BODY > HTML > #document toDOMRange:range from 0 of #text > B > FONT > TD > TR > TBODY > TABLE > DIV > CENTER > BODY > HTML > #document to 6 of CENTER > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of TD > TR > TBODY > TABLE > DIV > CENTER > BODY > HTML > #document to 0 of TD > TR > TBODY > TABLE > DIV > CENTER > BODY > HTML > #document toDOMRange:range from 0 of #text > B > FONT > TD > TR > TBODY > TABLE > DIV > CENTER > BODY > HTML > #document to 1 of #text > FONT > DIV > CENTER > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 layer at (0,0) size 800x600
   RenderCanvas at (0,0) size 800x600
@@ -139,4 +139,4 @@ layer at (0,0) size 800x600
             RenderText {TEXT} at (362,0) size 60x13
               text run at (362,0) width 60: "\x{A9}2005 Google"
 selection start: position 0 of child 0 {TEXT} of child 0 {B} of child 0 {FONT} of child 0 {TD} of child 0 {TR} of child 0 {TBODY} of child 1 {TABLE} of child 4 {DIV} of child 0 {CENTER} of child 1 {BODY} of child 0 {HTML} of document
-selection end:   position 0 of child 6 {BR} of child 0 {CENTER} of child 1 {BODY} of child 0 {HTML} of document
+selection end:   position 1 of child 3 {TEXT} of child 4 {FONT} of child 4 {DIV} of child 0 {CENTER} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/selection/leave-requested-block-expected.checksum b/LayoutTests/editing/selection/leave-requested-block-expected.checksum
new file mode 100644 (file)
index 0000000..44216b0
--- /dev/null
@@ -0,0 +1 @@
+ca85ee06268556851a0cb0e2fa6678c7
\ No newline at end of file
diff --git a/LayoutTests/editing/selection/leave-requested-block-expected.png b/LayoutTests/editing/selection/leave-requested-block-expected.png
new file mode 100644 (file)
index 0000000..0198221
Binary files /dev/null and b/LayoutTests/editing/selection/leave-requested-block-expected.png differ
diff --git a/LayoutTests/editing/selection/leave-requested-block-expected.txt b/LayoutTests/editing/selection/leave-requested-block-expected.txt
new file mode 100644 (file)
index 0000000..e6da43e
--- /dev/null
@@ -0,0 +1,30 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x576
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {TEXT} at (0,0) size 127x18
+          text run at (0,0) width 127: "Test case for fix for "
+        RenderInline {A} at (0,0) size 343x18 [color=#0000EE]
+          RenderText {TEXT} at (127,0) size 343x18
+            text run at (127,0) width 343: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5354"
+        RenderText {TEXT} at (470,0) size 4x18
+          text run at (470,0) width 4: "."
+      RenderBlock {P} at (0,34) size 784x36
+        RenderText {TEXT} at (0,0) size 772x36
+          text run at (0,0) width 772: "Changes were made to VisiblePosition's so that init() will not leave the block containing the requested position unless there"
+          text run at (0,18) width 231: "are no VisiblePositions in that block."
+      RenderBlock {P} at (0,86) size 784x0
+      RenderBlock {DIV} at (0,86) size 784x54 [border: (2px solid #AAAAFF)]
+        RenderBlock {P} at (2,18) size 780x18
+          RenderText {TEXT} at (0,0) size 682x18
+            text run at (0,0) width 682: "Select All while inside this editable block should create a selection that does not extend outside of this block."
+layer at (8,164) size 784x18
+  RenderBlock {P} at (0,156) size 784x18
+    RenderText {TEXT} at (0,0) size 424x18
+      text run at (0,0) width 424: "This is a paragraph outside the editable block with overflow:hidden"
+selection start: position 0 of child 0 {TEXT} of child 1 {P} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+selection end:   position 113 of child 0 {TEXT} of child 1 {P} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/selection/leave-requested-block.html b/LayoutTests/editing/selection/leave-requested-block.html
new file mode 100644 (file)
index 0000000..bea8030
--- /dev/null
@@ -0,0 +1,34 @@
+<html> 
+<head>
+
+<link rel=stylesheet href="../editingStyle.css" type="text/css">
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+    for (var i = 0; i < 30; i++) {
+        extendSelectionForwardByLineCommand();
+    }
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+
+<body>
+<p>Test case for fix for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=5354">http://bugzilla.opendarwin.org/show_bug.cgi?id=5354</a>.</p>
+<p>Changes were made to VisiblePosition's so that init() will not leave the block containing the requested position unless there are no VisiblePositions in that block.<p>
+                               
+               <div class="editableblock" id="test" contenteditable="true">
+                       <p>Select All while inside this editable block should create a selection that does not extend outside of this block.</p>
+               </div>
+                       
+               <p style="overflow: hidden;">This is a paragraph outside the editable block with overflow:hidden</p>
+               
+<script>
+runEditingTest();
+</script>
+       </body>
+</html>
index b0df461d1c081c170fe6b0c582921521b30acb03..c5932ad2d268ef0840f79f4cc0c1724aaf479a31 100644 (file)
@@ -16,6 +16,7 @@ EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
   RenderCanvas at (0,0) size 800x600