<rdar://problem/4386640> AX: AXPreviousSentenceStartTextMarkerForTextMarker...
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Apr 2006 00:21:46 +0000 (00:21 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Apr 2006 00:21:46 +0000 (00:21 +0000)
        <rdar://problem/4414575> AX: Dictionary popup cannot find some words on Dictionary.app

        * editing/editing.js:
        Add sentence navigation/selection.

        * editing/selection/extend-by-sentence-001-expected.txt: Added.
        * editing/selection/extend-by-sentence-001.html: Added.
        Test for both <rdar://problem/4386640> and <rdar://problem/4414575>.

        * fast/dom/inner-text-001-expected.txt: Added.
        * fast/dom/inner-text-001.html: Added.
        Tests innerText on a variety of elements.

        * fast/dom/HTMLObjectElement/form/test1-expected.txt:
        * fast/events/mouseclick-target-and-positioning-expected.txt:
        * fast/forms/button-in-forms-collection-expected.txt:
        * fast/forms/focus-control-to-page-expected.txt:
        * fast/forms/focus-expected.txt:
        * fast/forms/textarea-hard-linewrap-expected.txt:
        * fast/forms/textarea-setvalue-submit-expected.txt:
        * fast/loader/loadInProgress-expected.txt:
        Updated for innerText changes that emit newlines for more kinds of blocks.

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

14 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/editing.js
LayoutTests/editing/selection/extend-by-sentence-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/extend-by-sentence-001.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLObjectElement/form/test1-expected.txt
LayoutTests/fast/dom/inner-text-001-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/inner-text-001.html [new file with mode: 0644]
LayoutTests/fast/events/mouseclick-target-and-positioning-expected.txt
LayoutTests/fast/forms/button-in-forms-collection-expected.txt
LayoutTests/fast/forms/focus-control-to-page-expected.txt
LayoutTests/fast/forms/focus-expected.txt
LayoutTests/fast/forms/textarea-hard-linewrap-expected.txt
LayoutTests/fast/forms/textarea-setvalue-submit-expected.txt
LayoutTests/fast/loader/loadInProgress-expected.txt

index 8d5a5734857f4ab832f16a0845d25cfb386a093d..d0549ae8b0e25055c136c709a8ba03fb74a4f144 100644 (file)
@@ -1,3 +1,29 @@
+2006-04-12  David Harrison  <harrison@apple.com>
+
+        <rdar://problem/4386640> AX: AXPreviousSentenceStartTextMarkerForTextMarker does not respect paragraph boundary
+        <rdar://problem/4414575> AX: Dictionary popup cannot find some words on Dictionary.app
+
+        * editing/editing.js:
+        Add sentence navigation/selection.
+        
+        * editing/selection/extend-by-sentence-001-expected.txt: Added.
+        * editing/selection/extend-by-sentence-001.html: Added.
+        Test for both <rdar://problem/4386640> and <rdar://problem/4414575>.
+        
+        * fast/dom/inner-text-001-expected.txt: Added.
+        * fast/dom/inner-text-001.html: Added.
+        Tests innerText on a variety of elements.
+        
+        * fast/dom/HTMLObjectElement/form/test1-expected.txt:
+        * fast/events/mouseclick-target-and-positioning-expected.txt:
+        * fast/forms/button-in-forms-collection-expected.txt:
+        * fast/forms/focus-control-to-page-expected.txt:
+        * fast/forms/focus-expected.txt:
+        * fast/forms/textarea-hard-linewrap-expected.txt:
+        * fast/forms/textarea-setvalue-submit-expected.txt:
+        * fast/loader/loadInProgress-expected.txt:
+        Updated for innerText changes that emit newlines for more kinds of blocks.
+
 2006-04-12  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by darin
index 0ee507726c0a1667d8ba9230b3cc982b74683bed..ef09bdd042000704be7398d029a7d8a2eef9fdda 100644 (file)
@@ -84,6 +84,36 @@ function extendSelectionForwardByWordCommand() {
 
 //-------------------------------------------------------------------------------------------------------
 
+function execMoveSelectionForwardBySentenceCommand() {
+    selection.modify("move", "forward", "sentence");
+}
+function moveSelectionForwardBySentenceCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execMoveSelectionForwardBySentenceCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execMoveSelectionForwardBySentenceCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execExtendSelectionForwardBySentenceCommand() {
+    selection.modify("extend", "forward", "sentence");
+}
+function extendSelectionForwardBySentenceCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execExtendSelectionForwardBySentenceCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execExtendSelectionForwardBySentenceCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
 function execMoveSelectionForwardByLineCommand() {
     selection.modify("move", "forward", "line");
 }
@@ -174,6 +204,36 @@ function extendSelectionBackwardByWordCommand() {
 
 //-------------------------------------------------------------------------------------------------------
 
+function execMoveSelectionBackwardBySentenceCommand() {
+    selection.modify("move", "backward", "sentence");
+}
+function moveSelectionBackwardBySentenceCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execMoveSelectionBackwardBySentenceCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execMoveSelectionBackwardBySentenceCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execExtendSelectionBackwardBySentenceCommand() {
+    selection.modify("extend", "backward", "sentence");
+}
+function extendSelectionBackwardBySentenceCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execExtendSelectionBackwardBySentenceCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execExtendSelectionBackwardBySentenceCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
 function execMoveSelectionBackwardByLineCommand() {
     selection.modify("move", "backward", "line");
 }
diff --git a/LayoutTests/editing/selection/extend-by-sentence-001-expected.txt b/LayoutTests/editing/selection/extend-by-sentence-001-expected.txt
new file mode 100644 (file)
index 0000000..3499ce4
--- /dev/null
@@ -0,0 +1,27 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+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 784x584
+      RenderBlock {DIV} at (0,0) size 784x84 [border: (2px solid #FF0000)]
+        RenderBlock {FRIJOLE} at (14,14) size 756x56
+          RenderBlock (anonymous) at (0,0) size 756x28
+            RenderText {TEXT} at (0,0) size 132x28
+              text run at (0,0) width 132: "one two three"
+            RenderInline {FRIJOLE} at (0,0) size 0x0
+              RenderText {TEXT} at (0,0) size 0x0
+          RenderBlock (anonymous) at (0,28) size 756x28
+            RenderBlock {DOODAD} at (0,0) size 756x28
+              RenderText {TEXT} at (0,0) size 118x28
+                text run at (0,0) width 118: "four five six"
+          RenderBlock (anonymous) at (0,56) size 756x0
+            RenderInline {FRIJOLE} at (0,0) size 0x0
+selection start: position 0 of child 0 {TEXT} of child 1 {DOODAD} of child 1 {FRIJOLE} of child 1 {FRIJOLE} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+selection end:   position 13 of child 0 {TEXT} of child 1 {DOODAD} of child 1 {FRIJOLE} of child 1 {FRIJOLE} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/selection/extend-by-sentence-001.html b/LayoutTests/editing/selection/extend-by-sentence-001.html
new file mode 100644 (file)
index 0000000..0698272
--- /dev/null
@@ -0,0 +1,41 @@
+<html> 
+<head>
+
+<style>
+.editing { 
+    border: 2px solid red; 
+    padding: 12px; 
+    font-size: 24px; 
+}
+.cell { 
+    padding: 12px; 
+    font-size: 24px;
+    height: 48px; 
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+       moveSelectionForwardByLineCommand();    
+       moveSelectionForwardByWordCommand();    
+       moveSelectionBackwardBySentenceCommand();    
+       extendSelectionForwardBySentenceCommand();    
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<frijole style="display:block;" id="test">one two three<frijole>
+<doodad style="display:block;">four five six</doodad>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/inner-text-001-expected.txt b/LayoutTests/fast/dom/inner-text-001-expected.txt
new file mode 100644 (file)
index 0000000..0323e50
--- /dev/null
@@ -0,0 +1,49 @@
+Test innerText
+
+Check lists, tables, styled text, and images.
+
+Block flow elements get line breaks before and after. Table cells are tab separated.
+Item 1
+Item 2
+1      2       3
+4      5       6
+
+Right here is an inline block. 
+And an inline  table   with    one     row is here, too. 
+And an inline  table   with    rows not far behind.
+Check collapsed margins
+
+Collapsed margins are supposed to result in an extra line break.
+First header
+
+Second header
+
+First list element
+Second list element
+This line contains  an image.
+The innerText of the above:
+
+Test innerText
+
+Check lists, tables, styled text, and images.
+
+Block flow elements get line breaks before and after. Table cells are tab separated.
+Item 1
+Item 2
+1      2       3
+4      5       6
+
+Right here is an inline block. 
+And an inline  table   with    one     row is here, too. 
+And an inline  table   with    rows not far behind.
+Check collapsed margins
+
+Collapsed margins are supposed to result in an extra line break.
+First header
+
+Second header
+
+First list element
+Second list element
+This line contains  an image.
+
diff --git a/LayoutTests/fast/dom/inner-text-001.html b/LayoutTests/fast/dom/inner-text-001.html
new file mode 100644 (file)
index 0000000..399dae3
--- /dev/null
@@ -0,0 +1,61 @@
+<html>
+<head>
+    <style type="text/css">
+      ul.colored { 
+        background: yellow; 
+        margin: 12px 12px 12px 12px;
+        padding: 3px 3px 3px 3px;
+      }
+      li.colored { 
+        color: white; 
+        background: blue;
+        margin: 12px 12px 12px 12px;
+        padding: 12px 0px 12px 12px;
+        list-style: none;
+      }
+      h4.colored {
+        color: white; 
+        background: blue;
+        margin: 12px 12px 12px 12px;
+        padding: 12px 0px 12px 12px;
+      }
+    </style>
+</head>
+
+<body style="font-size: 12px;">
+<div contenteditable id="test" style="border-style:solid; border-color:red">
+<h2>Test innerText</h1>
+<h3>Check lists, tables, styled text, and images.</h3>
+Block flow elements get line breaks before and after.  Table cells are tab separated.
+<ul>
+<li>Item 1</li>
+<li>Item 2</li>
+</ul>
+<table border=1><tr><td>1</td><td>2</td><td><span">3</span></td></tr><tr><td>4</td><td>5</td><td><span">6</span></td></tr></table>
+<br>
+Right <h4 style="display:inline">here</h4> is an inline block.
+<br>
+And an <table border=1 style="display:inline"><td>inline</td><td>table</td><td>with</td><td>one</td><td>row</td></table> is here, too.
+<br>
+And an <table border=1 style="display:inline"><tr><td>inline</td><td>table</td></tr><tr><td>with</td><td>rows</td></tr></table> not far behind.
+<h3>Check collapsed margins</h3>
+Collapsed margins are supposed to result in an extra line break.
+<h4 class="colored">First header</h4>
+<h4 class="colored">Second header</h4>
+<ul class="colored">
+  <li class="colored">First list element</li>
+  <li class="colored">Second list element</li>
+</ul>
+This <b>line</b> contains <img src="../replaced/resources/compass.jpg"> an image.
+</div>
+<p><b><u>The innerText of the above:</u></b></p>
+<pre id="innertext"></pre>
+<script>
+    if (window.layoutTestController)
+        window.layoutTestController.dumpAsText();
+    
+    document.getElementById("innertext").innerText = document.getElementById("test").innerText; 
+</script>
+</body>
+
+</html>
\ No newline at end of file
index 9afd1047d7488adb02569ced6d1d75a99484a137..e814343895a0ed6bb6be916a1c90f75b931f8c95 100644 (file)
@@ -2,7 +2,8 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 This page tests whether a click event propogates with the correct target and positioning. See rdar://problem/4477126.
 
-click inside the red box:[]
+click inside the red box:
+[]
 PASS: event target should be [object SPAN] and is
 PASS: event.pageX should be 175 and is
 PASS: event.pageY should be 105 and is
index 83d703ca114f5a6cff1c8e3b02f252111547081c..315c1263f3d62257628d1c0d63224b19ed1ed3aa 100644 (file)
@@ -1,6 +1,7 @@
 The following tests for regression against 4405: <button> not listed in form collections. You should see a series of lines starting with PASS.
 
  Button2
+
 PASS document.test.elements.length is 2
 PASS document.test.elements[0].name is "foo"
 PASS document.test.elements[1].name is "bla"
index 3075cb56acc8a8951d0071c7a9926a3c23791b89..c5c5f88581ea812b269e5669aa83e5db8350b534 100644 (file)
@@ -7,9 +7,8 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 19 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 19 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 This test checks whether you can tab between AppKit controls and engine-rendered controls or other focusable object in the page like contentEditable areas. As you tab through, select one, text, select two and contentEditable div should focus, in that order.
 
-   
-contentEditable div
- FOCUS: select one
+   contentEditable div
+FOCUS: select one
 FOCUS: text
 FOCUS: select two
 FOCUS: contentEditable div
index f29b783f978f3e8bc237bf31a25d906b5f131783..1470c270ed5cb572e0d99f455aa9415eabaebf9e 100644 (file)
@@ -8,7 +8,8 @@ This test checks to see if focus methods work on a couple types of elements.
 If the test passes, you should see a line saying "focused 1", then 2, then 3.
 
 
-LegendLabel2 Label3
+Legend
+Label2 Label3
 
 focused 1
 focused 2
index 75c22b8d2b92c0bf9672ec7c23e902c15be1c159..3a1fc8b0c3ed00d397a8fd28c2c5f89598acc729 100644 (file)
@@ -2,4 +2,5 @@ This tests that a textarea's default value is submitted with hard line wraps (ca
 
 Due to a bug, the textarea is actually a bit wider than we specify via the cols attribute, so, the number and position of the carriage returns in the submitted data is not what you'd expect. The expected results for this testcase should be updated when http://bugzilla.opendarwin.org/show_bug.cgi?id=7505 is fixed.
 
- Success
+Success
index 30af02b2a61fb0284c4ab3ea958b72d9c0624d89..e871b6041e797e153bccaf7732b36625aecff642 100644 (file)
@@ -1,2 +1,3 @@
 ALERT: Test passed: [object FORM]
 
+