LayoutTests:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 May 2006 19:32:21 +0000 (19:32 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 May 2006 19:32:21 +0000 (19:32 +0000)
        Reviewed by Justin.

        - tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=8159
          REGRESSION: Clicking outside new text field focuses the field

        * fast/forms/input-text-click-inside-expected.png: Added.
        * fast/forms/input-text-click-inside-expected.txt: Added.
        * fast/forms/input-text-click-inside-expected.checksum: Added.
        * fast/forms/input-text-click-inside.html: Added.
        * fast/forms/input-text-click-outside-expected.png: Added.
        * fast/forms/input-text-click-outside-expected.txt: Added.
        * fast/forms/input-text-click-outside-expected.checksum: Added.
        * fast/forms/input-text-click-outside.html: Added.
        Test clicks both inside and outside an input element.

        * editing/selection/contenteditable-click-inside-expected.png: Added.
        * editing/selection/contenteditable-click-inside-expected.txt: Added.
        * editing/selection/contenteditable-click-inside-expected.checksum: Added.
        * editing/selection/contenteditable-click-inside.html: Added.
        * editing/selection/contenteditable-click-outside-expected.png: Added.
        * editing/selection/contenteditable-click-outside-expected.txt: Added.
        * editing/selection/contenteditable-click-outside-expected.checksum: Added.
        * editing/selection/contenteditable-click-outside.html: Added.
        Added a test for the same situation, but with a div element set
        to have editable content.

        * editing/inserting/insert-3851164-fix-expected.txt:
        * editing/inserting/insert-3851164-fix.html:
        * editing/inserting/insert-3907422-fix-expected.txt:
        * editing/inserting/insert-3907422-fix.html:
        * editing/pasteboard/paste-text-011-expected.txt:
        * editing/pasteboard/paste-text-011.html:
        Update some tests that were relying on a bug that would cause a
        Select All in a document that contained a single content-editable
        element select the contents of that element.

        * fast/lists/drag-into-marker-expected.checksum:
        * fast/lists/drag-into-marker-expected.png:
        * fast/lists/drag-into-marker-expected.txt:
        * fast/lists/drag-into-marker.html:
        Changed test so that it no longer tests what happens when you drag to a marker
        that is outside the content-editable element. We may still want to make that
        case behave as before, but that's a separate issue.

        * editing/pasteboard/drop-text-without-selection-expected.txt:
        * editing/pasteboard/merge-start-blockquote-expected.txt:
        * editing/pasteboard/merge-start-list-expected.txt:
        * editing/selection/select-all-iframe-expected.txt:
        * fast/events/div-focus-expected.txt:
        * fast/events/drag-outside-window-expected.txt:
        * fast/forms/focus-control-to-page-expected.txt:
        * fast/forms/input-changing-value-expected.txt:
        * fast/forms/input-maxlength-2-expected.txt:
        * fast/forms/input-paste-undo-expected.txt:
        * fast/forms/input-text-paste-maxlength-expected.txt:
        * fast/forms/input-truncate-newline-expected.txt:
        * fast/forms/plaintext-mode-2-expected.txt:
        * fast/text/textIteratorNilRenderer-expected.txt:
        Update tests where the DOM range endpoints passed to the delegate are slightly
        different, but equivalent and still OK.

        * editing/pasteboard/paste-4039777-fix-expected.txt:
        Updated tests where the resulting tree is slightly different, but still OK.

        * editing/unsupported-content/list-delete-002-expected.checksum:
        * editing/unsupported-content/list-delete-002-expected.png:
        * editing/unsupported-content/list-delete-002-expected.txt:
        Update test where the new code eliminates an unwanted extra space that we
        got with the old code.

        * editing/deleting/delete-4038408-fix-expected.txt:
        * editing/deleting/delete-4038408-fix.html:
        * editing/input/text-input-controller-expected.txt:
        * editing/input/text-input-controller.html:
        * fast/forms/attributed-strings-expected.txt:
        * fast/forms/attributed-strings.html:
        Update tests that were relying on the behavior of Select All putting the
        selection inside a content-editable element if that element was the first
        in the body; the patch breaks that behavior.

        * fast/events/updateLayoutForHitTest-expected.checksum:
        * fast/events/updateLayoutForHitTest-expected.png:
        Update a test that no longer shows a visible selection.

        * editing/selection/3690703-2-expected.checksum:
        * editing/selection/3690703-2-expected.png:
        * editing/selection/3690703-2-expected.txt:
        * editing/selection/3690703-expected.checksum:
        * editing/selection/3690703-expected.png:
        * editing/selection/3690703-expected.txt:
        Updated results for these tests, which have examples of form elements
        inside a content-editable area. The old results were wrong; the new results
        are not much better, but are OK.

        - update some other misc. pixel-test results

        * fast/inspector/style-expected.checksum:
        * fast/inspector/style-expected.png:
        Updated since the name changed to include "-webkit-".

        * fast/overflow/childFocusRingClip-expected.checksum:
        * fast/overflow/childFocusRingClip-expected.png:
        Updated results that now seem to show correct clipping of the focus ring.

        * fast/frames/empty-cols-attribute-expected.checksum:
        * fast/frames/empty-cols-attribute-expected.png: Added.
        Checksum was wrong, png was missing.

        * fast/parser/001-expected.checksum:
        * fast/parser/001-expected.png:
        Checksum and png were incorrect -- changed a while back.

        * plugins/embed-attributes-style-expected.checksum: Added.
        * plugins/embed-attributes-style-expected.png: Added.
        Added pixel-test results for tests that don't have them.

WebCore:

        Reviewed by Justin.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8159
          REGRESSION: Clicking outside new text field focuses the field

        This bug has always been present for "content editable" HTML, but
        now affects <input type=text> as well. The problem is with the editing
        concept of a "deep equivalent". When computing the deep equivalent,
        the code can move from outside an editable area to inside. To fix this,
        I removed all use of the "deep equivalent" concept.

        * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
        Changed argument names from _x and _y to just x and y. When the element
        is the editable root, changed things so that clicks that are not within
        the element at all return positions before or after the element, rather than
        always choosing the closest point within the element. This gets us off on
        the right foot, by not choosing a position inside an editable root when you
        click outside that editable root. This code handles shadowParentNode as well,
        and also calls positionForCoordinates on children rather than calling
        positionForRenderer (which I believe is now a function that can be removed).

        * editing/VisiblePosition.h: Removed the deepEquivalent function.
        * editing/VisiblePosition.cpp:
        (WebCore::VisiblePosition::previousVisiblePosition): Removed use of the
        deepEquivalent function. Also, to make this function easier to understand
        I separated out the case where the start point is "in rendered content"
        and the case where it's not into two separate loops.
        (WebCore::VisiblePosition::nextVisiblePosition): Ditto.
        (WebCore::VisiblePosition::initDeepPosition): Removed use of the deepEquivalent
        function. Also added code to make sure that this work never turns a position
        outside an editable element into a position inside that editable element, or
        vice versa. Reorganized the code a bit.

        * dom/Position.cpp:
        (WebCore::Position::upstream): Removed use of the deepEquivalent function.
        (WebCore::Position::downstream): Ditto.

        * editing/htmlediting.cpp:
        (WebCore::editingIgnoresContent): Changed to use isReplaced instead of isWidget
        and isImage to determine if editing should ignore content.
        (WebCore::firstInSpecialElement): Rewrote isFirstVisiblePositionInSpecialElement
        to have code to share with positionBeforeContainingSpecialElement. And changed
        to allow both the position just before a table and the position just inside a
        table to qualify. While this is slightly sloppy, the old code worked because
        of the "deep equivalent" technique. This change is needed to get the desired
        results even without that technique.
        (WebCore::lastInSpecialElement): Ditto.
        (WebCore::isFirstVisiblePositionInSpecialElement): Changed to use the new function.
        (WebCore::positionBeforeContainingSpecialElement): Ditto.
        (WebCore::isLastVisiblePositionInSpecialElement): Ditto.
        (WebCore::positionAfterContainingSpecialElement): Ditto.

        * dom/Node.cpp: (WebCore::Node::rootEditableElement): Rewrote to remove
        special case for body tag.

        - other changes

        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::setOuterHTML): Added a FIXME about the fact
        that this won't merge neighboring text nodes the way setOuterText does.
        (WebCore::HTMLElement::setInnerText): Added a FIXME about the fact that
        this creates a text node even when setting to empty text.
        (WebCore::HTMLElement::setOuterText): Ditto.

        * editing/DeleteSelectionCommand.cpp: Removed some #if 1 and #if 0.
        * editing/ReplaceSelectionCommand.cpp: A little reformatting.
        * rendering/render_button.h: Tiny formatting tweak.

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

77 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/delete-4038408-fix-expected.txt
LayoutTests/editing/deleting/delete-4038408-fix.html
LayoutTests/editing/input/text-input-controller-expected.txt
LayoutTests/editing/input/text-input-controller.html
LayoutTests/editing/inserting/insert-3851164-fix-expected.txt
LayoutTests/editing/inserting/insert-3851164-fix.html
LayoutTests/editing/inserting/insert-3907422-fix-expected.txt
LayoutTests/editing/inserting/insert-3907422-fix.html
LayoutTests/editing/pasteboard/drop-text-without-selection-expected.txt
LayoutTests/editing/pasteboard/merge-start-blockquote-expected.txt
LayoutTests/editing/pasteboard/merge-start-list-expected.txt
LayoutTests/editing/pasteboard/paste-4039777-fix-expected.txt
LayoutTests/editing/pasteboard/paste-text-011-expected.txt
LayoutTests/editing/pasteboard/paste-text-011.html
LayoutTests/editing/selection/3690703-2-expected.checksum
LayoutTests/editing/selection/3690703-2-expected.png
LayoutTests/editing/selection/3690703-2-expected.txt
LayoutTests/editing/selection/3690703-expected.checksum
LayoutTests/editing/selection/3690703-expected.png
LayoutTests/editing/selection/3690703-expected.txt
LayoutTests/editing/selection/contenteditable-click-inside-expected.checksum [new file with mode: 0644]
LayoutTests/editing/selection/contenteditable-click-inside-expected.png [new file with mode: 0644]
LayoutTests/editing/selection/contenteditable-click-inside-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/contenteditable-click-inside.html [new file with mode: 0644]
LayoutTests/editing/selection/contenteditable-click-outside-expected.checksum [new file with mode: 0644]
LayoutTests/editing/selection/contenteditable-click-outside-expected.png [new file with mode: 0644]
LayoutTests/editing/selection/contenteditable-click-outside-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/contenteditable-click-outside.html [new file with mode: 0644]
LayoutTests/editing/selection/select-all-iframe-expected.txt
LayoutTests/editing/unsupported-content/list-delete-002-expected.checksum
LayoutTests/editing/unsupported-content/list-delete-002-expected.png
LayoutTests/editing/unsupported-content/list-delete-002-expected.txt
LayoutTests/fast/events/drag-outside-window-expected.txt
LayoutTests/fast/events/updateLayoutForHitTest-expected.checksum
LayoutTests/fast/events/updateLayoutForHitTest-expected.png
LayoutTests/fast/forms/attributed-strings-expected.txt
LayoutTests/fast/forms/attributed-strings.html
LayoutTests/fast/forms/input-changing-value-expected.txt
LayoutTests/fast/forms/input-maxlength-2-expected.txt
LayoutTests/fast/forms/input-paste-undo-expected.txt
LayoutTests/fast/forms/input-text-click-inside-expected.checksum [new file with mode: 0644]
LayoutTests/fast/forms/input-text-click-inside-expected.png [new file with mode: 0644]
LayoutTests/fast/forms/input-text-click-inside-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/input-text-click-inside.html [new file with mode: 0644]
LayoutTests/fast/forms/input-text-click-outside-expected.checksum [new file with mode: 0644]
LayoutTests/fast/forms/input-text-click-outside-expected.png [new file with mode: 0644]
LayoutTests/fast/forms/input-text-click-outside-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/input-text-click-outside.html [new file with mode: 0644]
LayoutTests/fast/forms/input-text-paste-maxlength-expected.txt
LayoutTests/fast/forms/input-truncate-newline-expected.txt
LayoutTests/fast/forms/plaintext-mode-2-expected.txt
LayoutTests/fast/frames/empty-cols-attribute-expected.checksum
LayoutTests/fast/frames/empty-cols-attribute-expected.png [new file with mode: 0644]
LayoutTests/fast/inspector/style-expected.checksum
LayoutTests/fast/inspector/style-expected.png
LayoutTests/fast/lists/drag-into-marker-expected.checksum
LayoutTests/fast/lists/drag-into-marker-expected.png
LayoutTests/fast/lists/drag-into-marker-expected.txt
LayoutTests/fast/lists/drag-into-marker.html
LayoutTests/fast/overflow/childFocusRingClip-expected.checksum
LayoutTests/fast/overflow/childFocusRingClip-expected.png
LayoutTests/fast/parser/001-expected.checksum
LayoutTests/fast/parser/001-expected.png
LayoutTests/plugins/embed-attributes-style-expected.checksum [new file with mode: 0644]
LayoutTests/plugins/embed-attributes-style-expected.png [new file with mode: 0644]
WebCore/ChangeLog
WebCore/dom/Node.cpp
WebCore/dom/Position.cpp
WebCore/editing/DeleteSelectionCommand.cpp
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/editing/VisiblePosition.cpp
WebCore/editing/VisiblePosition.h
WebCore/editing/htmlediting.cpp
WebCore/html/HTMLElement.cpp
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/render_button.h

index 26c3041..b25b144 100644 (file)
@@ -1,3 +1,121 @@
+2006-05-03  Darin Adler  <darin@apple.com>
+
+        Reviewed by Justin.
+
+        - tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=8159
+          REGRESSION: Clicking outside new text field focuses the field
+
+        * fast/forms/input-text-click-inside-expected.png: Added.
+        * fast/forms/input-text-click-inside-expected.txt: Added.
+        * fast/forms/input-text-click-inside-expected.checksum: Added.
+        * fast/forms/input-text-click-inside.html: Added.
+        * fast/forms/input-text-click-outside-expected.png: Added.
+        * fast/forms/input-text-click-outside-expected.txt: Added.
+        * fast/forms/input-text-click-outside-expected.checksum: Added.
+        * fast/forms/input-text-click-outside.html: Added.
+        Test clicks both inside and outside an input element.
+
+        * editing/selection/contenteditable-click-inside-expected.png: Added.
+        * editing/selection/contenteditable-click-inside-expected.txt: Added.
+        * editing/selection/contenteditable-click-inside-expected.checksum: Added.
+        * editing/selection/contenteditable-click-inside.html: Added.
+        * editing/selection/contenteditable-click-outside-expected.png: Added.
+        * editing/selection/contenteditable-click-outside-expected.txt: Added.
+        * editing/selection/contenteditable-click-outside-expected.checksum: Added.
+        * editing/selection/contenteditable-click-outside.html: Added.
+        Added a test for the same situation, but with a div element set
+        to have editable content.
+
+        * editing/inserting/insert-3851164-fix-expected.txt:
+        * editing/inserting/insert-3851164-fix.html:
+        * editing/inserting/insert-3907422-fix-expected.txt:
+        * editing/inserting/insert-3907422-fix.html:
+        * editing/pasteboard/paste-text-011-expected.txt:
+        * editing/pasteboard/paste-text-011.html:
+        Update some tests that were relying on a bug that would cause a
+        Select All in a document that contained a single content-editable
+        element select the contents of that element.
+
+        * fast/lists/drag-into-marker-expected.checksum:
+        * fast/lists/drag-into-marker-expected.png:
+        * fast/lists/drag-into-marker-expected.txt:
+        * fast/lists/drag-into-marker.html:
+        Changed test so that it no longer tests what happens when you drag to a marker
+        that is outside the content-editable element. We may still want to make that
+        case behave as before, but that's a separate issue.
+
+        * editing/pasteboard/drop-text-without-selection-expected.txt:
+        * editing/pasteboard/merge-start-blockquote-expected.txt:
+        * editing/pasteboard/merge-start-list-expected.txt:
+        * editing/selection/select-all-iframe-expected.txt:
+        * fast/events/div-focus-expected.txt:
+        * fast/events/drag-outside-window-expected.txt:
+        * fast/forms/focus-control-to-page-expected.txt:
+        * fast/forms/input-changing-value-expected.txt:
+        * fast/forms/input-maxlength-2-expected.txt:
+        * fast/forms/input-paste-undo-expected.txt:
+        * fast/forms/input-text-paste-maxlength-expected.txt:
+        * fast/forms/input-truncate-newline-expected.txt:
+        * fast/forms/plaintext-mode-2-expected.txt:
+        * fast/text/textIteratorNilRenderer-expected.txt:
+        Update tests where the DOM range endpoints passed to the delegate are slightly
+        different, but equivalent and still OK.
+
+        * editing/pasteboard/paste-4039777-fix-expected.txt:
+        Updated tests where the resulting tree is slightly different, but still OK.
+
+        * editing/unsupported-content/list-delete-002-expected.checksum:
+        * editing/unsupported-content/list-delete-002-expected.png:
+        * editing/unsupported-content/list-delete-002-expected.txt:
+        Update test where the new code eliminates an unwanted extra space that we
+        got with the old code.
+
+        * editing/deleting/delete-4038408-fix-expected.txt:
+        * editing/deleting/delete-4038408-fix.html:
+        * editing/input/text-input-controller-expected.txt:
+        * editing/input/text-input-controller.html:
+        * fast/forms/attributed-strings-expected.txt:
+        * fast/forms/attributed-strings.html:
+        Update tests that were relying on the behavior of Select All putting the
+        selection inside a content-editable element if that element was the first
+        in the body; the patch breaks that behavior.
+
+        * fast/events/updateLayoutForHitTest-expected.checksum:
+        * fast/events/updateLayoutForHitTest-expected.png:
+        Update a test that no longer shows a visible selection.
+
+        * editing/selection/3690703-2-expected.checksum:
+        * editing/selection/3690703-2-expected.png:
+        * editing/selection/3690703-2-expected.txt:
+        * editing/selection/3690703-expected.checksum:
+        * editing/selection/3690703-expected.png:
+        * editing/selection/3690703-expected.txt:
+        Updated results for these tests, which have examples of form elements
+        inside a content-editable area. The old results were wrong; the new results
+        are not much better, but are OK.
+
+        - update some other misc. pixel-test results
+
+        * fast/inspector/style-expected.checksum:
+        * fast/inspector/style-expected.png:
+        Updated since the name changed to include "-webkit-".
+
+        * fast/overflow/childFocusRingClip-expected.checksum:
+        * fast/overflow/childFocusRingClip-expected.png:
+        Updated results that now seem to show correct clipping of the focus ring.
+
+        * fast/frames/empty-cols-attribute-expected.checksum:
+        * fast/frames/empty-cols-attribute-expected.png: Added.
+        Checksum was wrong, png was missing.
+
+        * fast/parser/001-expected.checksum:
+        * fast/parser/001-expected.png:
+        Checksum and png were incorrect -- changed a while back.
+
+        * plugins/embed-attributes-style-expected.checksum: Added.
+        * plugins/embed-attributes-style-expected.png: Added.
+        Added pixel-test results for tests that don't have them.
+
 2006-05-02  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
         Reviewed by darin
         
         <http://bugzilla.opendarwin.org/show_bug.cgi?id=7059>
-        TinyMCE: Select All + delete sends you Back intsead of deleting
+        TinyMCE: Select All + delete sends you Back instead of deleting
 
         * editing/resources/select-all-iframe-src.html: Added.
         * editing/selection/select-all-iframe-expected.checksum: Added.
index ecdd0d2..8a5a57f 100644 (file)
@@ -1,7 +1,8 @@
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 13 of DIV > BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 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 #text > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
index d8649ce..218c7f3 100644 (file)
@@ -39,23 +39,23 @@ function editingTest() {
 <title>Editing Test</title> 
 </head> 
 <body>
-<div contenteditable id="root" class="editing">
+<div contenteditable id="test" class="editing">
 <div>Radar: <a href="rdar://problems/4038408&4154187&4125087&4125381">rdar://problems/4038408&4154187&4125087&4125381</a></div>
 <div>Deletion of reply text should not produce reply text style unless the caret is inside the reply text blockquote.</div>
-<div><BR class=3D"khtml-block-placeholder"></div>
+<div><BR class="khtml-block-placeholder"></div>
 <div>This tests deletion from underneath quoted text:</div>
-<div><BR class=3D"khtml-block-placeholder"></div>
+<div><BR class="khtml-block-placeholder"></div>
 <div>
 <blockquote style="color:blue;" type="cite">
 <div>Here is some reply text</div>
 <div>It should have the reply text style</div>
-<div><BR class=3D"khtml-block-placeholder"></div>
-<div><BR class=3D"khtml-block-placeholder"></div>
-<div><BR class=3D"khtml-block-placeholder"></div>
+<div><BR class="khtml-block-placeholder"></div>
+<div><BR class="khtml-block-placeholder"></div>
+<div><BR class="khtml-block-placeholder"></div>
 </blockquote>
 
 
-<div><BR class=3D"khtml-block-placeholder"></div>
+<div><BR class="khtml-block-placeholder"></div>
 </div>
 
 </div>
index 1ea8499..be49f3a 100644 (file)
@@ -1,7 +1,8 @@
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: shouldInsertText:to be deleted replacingDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document givenAction:WebViewInsertActionTyped
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 13 of #text > DIV > BODY > HTML > #document to 13 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index 2126704..155433c 100644 (file)
@@ -5,7 +5,7 @@ body { margin: 0; padding: 0 }
 </style>
 </head>
 <body>
-<div contenteditable>FAILURE</div>
+<div id="test" contenteditable>FAILURE</div>
 <script type="text/javascript">
 
     if (window.layoutTestController) {
@@ -13,6 +13,7 @@ body { margin: 0; padding: 0 }
         try {
         
             layoutTestController.dumpAsText();
+            document.getElementById("test").focus();
             document.execCommand("SelectAll");
         
             textInputController.insertText("to be deleted");
index 73170ea..a848abd 100644 (file)
@@ -1,7 +1,8 @@
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > P > BODY > HTML > #document to 19 of #text > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 3 of BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of P > BODY > HTML > #document to 0 of P > BODY > HTML > #document toDOMRange:range from 0 of #text > P > BODY > HTML > #document to 19 of #text > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) 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
index e932a30..3a3187b 100644 (file)
@@ -22,7 +22,7 @@ function editingTest() {
 
 <title>Editing Test</title> 
 </head> 
-<body contenteditable id="root" class="editing"><P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 24.0px Gill Sans">@@ -571,6 +607,7 @@</P>
+<body contenteditable id="test" class="editing"><P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 24.0px Gill Sans">@@ -571,6 +607,7 @@</P>
 
 <script>
 runEditingTest();
index cb3ff16..35c92f0 100644 (file)
@@ -1,7 +1,8 @@
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 5 of BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index 94fceee..ea8422e 100644 (file)
@@ -23,7 +23,7 @@ function editingTest() {
 
 <title>Editing Test</title> 
 </head> 
-<body contenteditable id="root" class="editing">
+<body contenteditable id="test" class="editing">
 <div>foo<blockquote>bar</blockquote>baz</div>
 
 <!-- Buggy code before fix would insert blockquote after body element in second paste -->
index b812ae7..4f35cdd 100644 (file)
@@ -1,6 +1,6 @@
 EDITING DELEGATE: shouldInsertText:http://www.ibm.com/ replacingDOMRange:range from 0 of DIV to 0 of DIV givenAction:WebViewInsertActionDropped
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 0 of #text > DIV to 19 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 0 of #text > DIV to 19 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index c1df7b2..7558975 100644 (file)
@@ -1,7 +1,7 @@
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BLOCKQUOTE > DIV > BODY > HTML > #document to 0 of BLOCKQUOTE > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > BLOCKQUOTE > DIV > BODY > HTML > #document to 3 of #text > BLOCKQUOTE > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > BLOCKQUOTE > DIV > BODY > HTML > #document to 3 of #text > BLOCKQUOTE > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index d61877c..dd72d69 100644 (file)
@@ -1,7 +1,7 @@
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of LI > UL > DIV > BODY > HTML > #document to 0 of LI > UL > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > LI > UL > DIV > BODY > HTML > #document to 3 of #text > LI > UL > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > LI > UL > DIV > BODY > HTML > #document to 3 of #text > LI > UL > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 2d1039f..23b024b 100644 (file)
@@ -52,16 +52,23 @@ layer at (0,0) size 800x600
                   text run at (0,28) width 16: "C"
       RenderBlock {DIV} at (0,364) size 784x120
         RenderBlock {UL} at (0,0) size 784x28
+          RenderBlock (anonymous) at (40,0) size 744x0
+            RenderInline {FONT} at (0,0) size 0x0
+            RenderInline {SPAN} at (0,0) size 0x0
           RenderListItem {LI} at (40,0) size 744x28
             RenderListMarker at (-17,8) size 7x18
-            RenderInline {FONT} at (0,0) size 0x28
-            RenderInline {SPAN} at (0,0) size 0x28
             RenderInline {FONT} at (0,0) size 17x28
               RenderInline {SPAN} at (0,0) size 17x28
                 RenderText {#text} at (727,0) size 17x28
                   text run at (727,0) width 17: "A"
         RenderBlock {DIV} at (0,44) size 784x56
+          RenderBlock (anonymous) at (0,0) size 784x0
+            RenderInline {FONT} at (0,0) size 0x0
+            RenderInline {SPAN} at (0,0) size 0x0
           RenderBlock {UL} at (0,0) size 784x56
+            RenderBlock (anonymous) at (40,0) size 744x0
+              RenderInline {FONT} at (0,0) size 0x0
+              RenderInline {SPAN} at (0,0) size 0x0
             RenderListItem {LI} at (40,0) size 744x56
               RenderListMarker at (-17,8) size 7x18
               RenderInline {A} at (0,0) size 16x18 [color=#0000EE]
@@ -69,13 +76,18 @@ layer at (0,0) size 800x600
                   RenderInline {SPAN} at (0,0) size 16x28
                     RenderText {#text} at (0,0) size 16x28
                       text run at (0,0) width 16: "B"
-              RenderInline {FONT} at (0,0) size 22x56
-                RenderInline {SPAN} at (0,0) size 22x56
+              RenderInline {FONT} at (0,0) size 6x28
+                RenderInline {SPAN} at (0,0) size 6x28
                   RenderText {#text} at (16,0) size 6x28
                     text run at (16,0) width 6: " "
+              RenderInline {FONT} at (0,0) size 0x28
+                RenderInline {SPAN} at (0,0) size 0x28
                   RenderBR {BR} at (22,22) size 0x0
+              RenderInline {FONT} at (0,0) size 16x28
+                RenderInline {SPAN} at (0,0) size 16x28
                   RenderText {#text} at (0,28) size 16x28
                     text run at (0,28) width 16: "C"
         RenderBlock {DIV} at (0,116) size 784x4 [border: (2px solid #FF0000)]
+          RenderBlock (anonymous) at (2,2) size 780x0
           RenderBlock {DIV} at (2,2) size 780x0
-caret: position 1 of child 2 {#text} of child 0 {SPAN} of child 1 {FONT} of child 0 {LI} of child 0 {UL} of child 2 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+caret: position 1 of child 0 {#text} of child 0 {SPAN} of child 3 {FONT} of child 2 {LI} of child 2 {UL} of child 2 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 0004505..3f5dd3d 100644 (file)
@@ -1,7 +1,8 @@
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > B > FONT > P > BODY > HTML > #document to 5 of #text > B > FONT > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 6 of BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of P > BODY > HTML > #document to 0 of P > BODY > HTML > #document toDOMRange:range from 0 of #text > B > FONT > P > BODY > HTML > #document to 5 of #text > B > FONT > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > B > FONT > P > BODY > HTML > #document to 5 of #text > B > FONT > 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
index 5e6e9dd..c01ce38 100644 (file)
@@ -28,7 +28,7 @@ function editingTest() {
 
 <title>Editing Test</title> 
 </head> 
-<body contenteditable id="root" id="test">
+<body contenteditable id="test">
 <p><font face="Monaco"><b>hello</b></font></p>
 <p><font face="Monaco"><b>there</b></font></p>
  
index 65985d9..178bfd5 100644 (file)
@@ -1 +1 @@
-91550c1cd1cbe65448b23240a3f5dc27
\ No newline at end of file
+1359a67c7dc24fc1858e62d60f658a4a
\ No newline at end of file
index bc1476f..cccd015 100644 (file)
Binary files a/LayoutTests/editing/selection/3690703-2-expected.png and b/LayoutTests/editing/selection/3690703-2-expected.png differ
index 8fa276a..1448c1a 100644 (file)
@@ -3,8 +3,8 @@ EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of DIV > CENTER > BODY > HTML > #document to 6 of DIV > CENTER > BODY > HTML > #document
-EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 layer at (0,0) size 800x600
   RenderCanvas at (0,0) size 800x600
@@ -145,4 +145,5 @@ layer at (0,0) size 800x600
               text run at (362,0) width 60: "\x{A9}2005 Google"
 layer at (206,85) size 385x13
   RenderBlock {DIV} at (3,3) size 385x13
-caret: position 0 of child 0 {DIV} of child 1 {INPUT} of child 1 {TD} of child 0 {TR} of child 0 {TBODY} of child 2 {TABLE} of child 4 {DIV} of child 0 {CENTER} of child 1 {BODY} of child 0 {HTML} of document
+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 2 {BR} of child 1 {TD} of child 0 {TR} of child 0 {TBODY} of child 2 {TABLE} of child 4 {DIV} of child 0 {CENTER} of child 1 {BODY} of child 0 {HTML} of document
index ccb8730..54edaac 100644 (file)
@@ -1 +1 @@
-778c7b571f58dbb073870920cb76bded
\ No newline at end of file
+348682498d72c255547545ca349de34e
\ No newline at end of file
index df2febb..893f1f7 100644 (file)
Binary files a/LayoutTests/editing/selection/3690703-expected.png and b/LayoutTests/editing/selection/3690703-expected.png differ
index b1ee7c5..78e460d 100644 (file)
@@ -144,4 +144,4 @@ layer at (0,0) size 800x600
 layer at (206,85) size 385x13
   RenderBlock {DIV} at (3,3) size 385x13
 selection start: position 0 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 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
+selection end:   position 0 of child 2 {BR} of child 1 {TD} of child 0 {TR} of child 0 {TBODY} of child 2 {TABLE} of child 4 {DIV} of child 0 {CENTER} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/selection/contenteditable-click-inside-expected.checksum b/LayoutTests/editing/selection/contenteditable-click-inside-expected.checksum
new file mode 100644 (file)
index 0000000..dd450ee
--- /dev/null
@@ -0,0 +1 @@
+3d66d9ba6c812ad8c9ffe3826ccf1897
\ No newline at end of file
diff --git a/LayoutTests/editing/selection/contenteditable-click-inside-expected.png b/LayoutTests/editing/selection/contenteditable-click-inside-expected.png
new file mode 100644 (file)
index 0000000..a1dd216
Binary files /dev/null and b/LayoutTests/editing/selection/contenteditable-click-inside-expected.png differ
diff --git a/LayoutTests/editing/selection/contenteditable-click-inside-expected.txt b/LayoutTests/editing/selection/contenteditable-click-inside-expected.txt
new file mode 100644 (file)
index 0000000..e15ddad
--- /dev/null
@@ -0,0 +1,11 @@
+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 {DIV} at (0,0) size 425x75 [bgcolor=#FFFF00]
+        RenderBlock {DIV} at (25,25) size 100x20 [bgcolor=#FFFFFF]
+      RenderBlock {P} at (0,91) size 784x36
+        RenderText {#text} at (0,0) size 780x36
+          text run at (0,0) width 780: "This test clicks inside an editable div element, and must result in the element receiving focus. If the test succeeds the element"
+          text run at (0,18) width 158: "should have a focus ring."
diff --git a/LayoutTests/editing/selection/contenteditable-click-inside.html b/LayoutTests/editing/selection/contenteditable-click-inside.html
new file mode 100644 (file)
index 0000000..a046583
--- /dev/null
@@ -0,0 +1,9 @@
+<div style="width: 400px; height: 50px; padding: 25px 0 0 25px; background: yellow;"><div contenteditable="true" style="background: white; height:20px; width:100px"></div></div>
+<p>This test clicks inside an editable div element, and must result in the element receiving focus. If the test succeeds the element should have a focus ring.</p>
+<script>
+if (window.eventSender) {
+    eventSender.moveTo(100, 45);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+}
+</script>
diff --git a/LayoutTests/editing/selection/contenteditable-click-outside-expected.checksum b/LayoutTests/editing/selection/contenteditable-click-outside-expected.checksum
new file mode 100644 (file)
index 0000000..e0381a7
--- /dev/null
@@ -0,0 +1 @@
+0391efc68a4087a1759e88f36572cc32
\ No newline at end of file
diff --git a/LayoutTests/editing/selection/contenteditable-click-outside-expected.png b/LayoutTests/editing/selection/contenteditable-click-outside-expected.png
new file mode 100644 (file)
index 0000000..079acce
Binary files /dev/null and b/LayoutTests/editing/selection/contenteditable-click-outside-expected.png differ
diff --git a/LayoutTests/editing/selection/contenteditable-click-outside-expected.txt b/LayoutTests/editing/selection/contenteditable-click-outside-expected.txt
new file mode 100644 (file)
index 0000000..7c0a6dd
--- /dev/null
@@ -0,0 +1,11 @@
+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 {DIV} at (0,0) size 425x75 [bgcolor=#FFFF00]
+        RenderBlock {DIV} at (25,25) size 100x20 [bgcolor=#FFFFFF]
+      RenderBlock {P} at (0,91) size 784x36
+        RenderText {#text} at (0,0) size 759x36
+          text run at (0,0) width 759: "This test clicks outside an editable div element, and must not result in the element receiving focus. If the test succeeds the"
+          text run at (0,18) width 235: "element should not have a focus ring."
diff --git a/LayoutTests/editing/selection/contenteditable-click-outside.html b/LayoutTests/editing/selection/contenteditable-click-outside.html
new file mode 100644 (file)
index 0000000..ebf22e1
--- /dev/null
@@ -0,0 +1,9 @@
+<div style="width: 400px; height: 50px; padding: 25px 0 0 25px; background: yellow;"><div contenteditable="true" style="background: white; height:20px; width:100px"></div></div>
+<p>This test clicks outside an editable div element, and must not result in the element receiving focus. If the test succeeds the element should not have a focus ring.</p>
+<script>
+if (window.eventSender) {
+    eventSender.moveTo(225, 45);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+}
+</script>
index 1dbbb36..d626ad7 100644 (file)
@@ -1,9 +1,8 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 4 of BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 11 of #text > DIV > BODY > HTML > #document to 11 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 11 of #text > DIV > BODY > HTML > #document to 11 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 11 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 11 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index ce4ae28..83b354f 100644 (file)
Binary files a/LayoutTests/editing/unsupported-content/list-delete-002-expected.png and b/LayoutTests/editing/unsupported-content/list-delete-002-expected.png differ
index 33a091b..e445308 100644 (file)
@@ -14,7 +14,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -57,8 +57,8 @@ layer at (0,0) size 800x600
           text run at (2,2) width 113: "before after"
       RenderBlock {DIV} at (0,302) size 784x32
         RenderBlock {DIV} at (0,0) size 784x32 [border: (2px solid #FF0000)]
-          RenderText {#text} at (2,2) size 68x28
-            text run at (2,2) width 68: "before "
-          RenderText {#text} at (70,2) size 45x28
-            text run at (70,2) width 45: "after"
-caret: position 8 of child 0 {#text} of child 1 {DIV} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+          RenderText {#text} at (2,2) size 62x28
+            text run at (2,2) width 62: "before"
+          RenderText {#text} at (64,2) size 45x28
+            text run at (64,2) width 45: "after"
+caret: position 7 of child 0 {#text} of child 1 {DIV} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index d2b9809..72a32ae 100644 (file)
@@ -1,5 +1,5 @@
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 31 of #text > P > BODY > HTML > #document to 31 of #text > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) 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: shouldChangeSelectedDOMRange:range from 31 of #text > P > BODY > HTML > #document to 31 of #text > P > BODY > HTML > #document toDOMRange:range from 31 of #text > P > BODY > HTML > #document to 31 of #text > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+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
 ALERT: Test result: PASS
 
index 3368dc4..d2c10d8 100644 (file)
@@ -1 +1 @@
-cdf5ee18124d98312633f363ed46e908
\ No newline at end of file
+43c66494d30dd1b36b91ea149d61cbc5
\ No newline at end of file
index 829cbd7..0051678 100644 (file)
Binary files a/LayoutTests/fast/events/updateLayoutForHitTest-expected.png and b/LayoutTests/fast/events/updateLayoutForHitTest-expected.png differ
index 9172e43..e4f7955 100644 (file)
@@ -1,7 +1,8 @@
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: shouldInsertText:test replacingDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document givenAction:WebViewInsertActionTyped
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index 660dadb..d30232d 100644 (file)
@@ -5,7 +5,7 @@ body { margin: 0; padding: 0 }
 </style>
 </head>
 <body>
-<div contenteditable>FAILURE</div>
+<div id="test" contenteditable>FAILURE</div>
 <p id="console"></p>
 <script type="text/javascript">
        
@@ -23,6 +23,7 @@ body { margin: 0; padding: 0 }
                try {
 
                        layoutTestController.dumpAsText();
+                        document.getElementById("test").focus();
 
                        var substr = textInputController.attributedSubstringFromRange(0, 2);
 //                     log(substr); -- attributedSubstringFromRange is not implemented in WebKit yet
index ba01d37..760d33c 100644 (file)
@@ -1,5 +1,5 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 4 of #text > DIV to 4 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 4 of #text > DIV to 4 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 This test changes the value of the text field by simulating typing, and then gets the value. 
index 7f4b60f..2d085c2 100644 (file)
@@ -1,5 +1,5 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 5 of #text > DIV to 5 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 5 of #text > DIV to 5 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index e59f041..38d4848 100644 (file)
@@ -7,7 +7,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertText:Text to paste replacingDOMRange:range from 0 of DIV to 0 of DIV givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 13 of #text > DIV to 13 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 13 of #text > DIV to 13 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV to 0 of DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
diff --git a/LayoutTests/fast/forms/input-text-click-inside-expected.checksum b/LayoutTests/fast/forms/input-text-click-inside-expected.checksum
new file mode 100644 (file)
index 0000000..8468904
--- /dev/null
@@ -0,0 +1 @@
+55d1ea4ffc968baf25045a1afd9c9fe0
\ No newline at end of file
diff --git a/LayoutTests/fast/forms/input-text-click-inside-expected.png b/LayoutTests/fast/forms/input-text-click-inside-expected.png
new file mode 100644 (file)
index 0000000..1e35846
Binary files /dev/null and b/LayoutTests/fast/forms/input-text-click-inside-expected.png differ
diff --git a/LayoutTests/fast/forms/input-text-click-inside-expected.txt b/LayoutTests/fast/forms/input-text-click-inside-expected.txt
new file mode 100644 (file)
index 0000000..2f5afa3
--- /dev/null
@@ -0,0 +1,13 @@
+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 {DIV} at (0,0) size 425x75 [bgcolor=#FFFF00]
+        RenderTextField {INPUT} at (27,27) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderBlock {P} at (0,91) size 784x36
+        RenderText {#text} at (0,0) size 739x36
+          text run at (0,0) width 739: "This test clicks inside an input element, and must result in the element receiving focus. If the test succeeds the element"
+          text run at (0,18) width 158: "should have a focus ring."
+layer at (38,38) size 142x13
+  RenderBlock {DIV} at (3,3) size 142x13
diff --git a/LayoutTests/fast/forms/input-text-click-inside.html b/LayoutTests/fast/forms/input-text-click-inside.html
new file mode 100644 (file)
index 0000000..850cc9b
--- /dev/null
@@ -0,0 +1,9 @@
+<div style="width: 400px; height: 50px; padding: 25px 0 0 25px; background: yellow;"><input></div>
+<p>This test clicks inside an input element, and must result in the element receiving focus. If the test succeeds the element should have a focus ring.</p>
+<script>
+if (window.eventSender) {
+    eventSender.moveTo(100, 45);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+}
+</script>
diff --git a/LayoutTests/fast/forms/input-text-click-outside-expected.checksum b/LayoutTests/fast/forms/input-text-click-outside-expected.checksum
new file mode 100644 (file)
index 0000000..857c458
--- /dev/null
@@ -0,0 +1 @@
+9b57ff27683b14b3bfdc8fb7cb162177
\ No newline at end of file
diff --git a/LayoutTests/fast/forms/input-text-click-outside-expected.png b/LayoutTests/fast/forms/input-text-click-outside-expected.png
new file mode 100644 (file)
index 0000000..903be95
Binary files /dev/null and b/LayoutTests/fast/forms/input-text-click-outside-expected.png differ
diff --git a/LayoutTests/fast/forms/input-text-click-outside-expected.txt b/LayoutTests/fast/forms/input-text-click-outside-expected.txt
new file mode 100644 (file)
index 0000000..401986d
--- /dev/null
@@ -0,0 +1,13 @@
+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 {DIV} at (0,0) size 425x75 [bgcolor=#FFFF00]
+        RenderTextField {INPUT} at (27,27) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderBlock {P} at (0,91) size 784x36
+        RenderText {#text} at (0,0) size 771x36
+          text run at (0,0) width 771: "This test clicks outside an input element, and must not result in the element receiving focus. If the test succeeds the element"
+          text run at (0,18) width 182: "should not have a focus ring."
+layer at (38,38) size 142x13
+  RenderBlock {DIV} at (3,3) size 142x13
diff --git a/LayoutTests/fast/forms/input-text-click-outside.html b/LayoutTests/fast/forms/input-text-click-outside.html
new file mode 100644 (file)
index 0000000..b76942e
--- /dev/null
@@ -0,0 +1,9 @@
+<div style="width: 400px; height: 50px; padding: 25px 0 0 25px; background: yellow;"><input></div>
+<p>This test clicks outside an input element, and must not result in the element receiving focus. If the test succeeds the element should not have a focus ring.</p>
+<script>
+if (window.eventSender) {
+    eventSender.moveTo(225, 45);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+}
+</script>
index 73d0dbd..6a4f8a5 100644 (file)
@@ -1,39 +1,39 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 5 of #text > DIV to 5 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 5 of #text > DIV to 5 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 5 of #text > DIV to 5 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 5 of #text > DIV to 5 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 3 of #text > DIV to 3 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 3 of #text > DIV to 3 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 3 of #text > DIV to 3 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 3 of #text > DIV to 3 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 7 of #text > DIV to 7 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 7 of #text > DIV to 7 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 7 of #text > DIV to 7 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 7 of #text > DIV to 7 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 3 of #text > DIV to 3 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 3 of #text > DIV to 3 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 3 of #text > DIV to 3 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 3 of #text > DIV to 3 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 6 of #text > DIV to 6 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 6 of #text > DIV to 6 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index c56de48..d602e37 100644 (file)
@@ -8,7 +8,7 @@ EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertText:Test
 Failed replacingDOMRange:range from 0 of DIV to 0 of DIV givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 4 of #text > DIV to 4 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 4 of #text > DIV to 4 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 This tests that when newlines are pasted into text fields, the text gets truncated properly. 
index d1dd56c..24723e0 100644 (file)
@@ -2,7 +2,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertText:This styled text, and link will be pasted into the textfield. All richness should be stripped. replacingDOMRange:range from 0 of DIV to 0 of DIV givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 94 of #text > DIV to 94 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 94 of #text > DIV to 94 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 5bf1e84..ba855ef 100644 (file)
@@ -1,2 +1 @@
-4ba76443f17a0b4b19c9d0505b0323d9
-\ No newline at end of file
+4ba76443f17a0b4b19c9d0505b0323d9
\ No newline at end of file
diff --git a/LayoutTests/fast/frames/empty-cols-attribute-expected.png b/LayoutTests/fast/frames/empty-cols-attribute-expected.png
new file mode 100644 (file)
index 0000000..297888a
Binary files /dev/null and b/LayoutTests/fast/frames/empty-cols-attribute-expected.png differ
index 44ac38e..2a084b0 100644 (file)
@@ -1 +1 @@
-621f18fa2942ebb003ed1d74340dbb07
\ No newline at end of file
+a75da5679b1c42d597a716e9710c3a76
\ No newline at end of file
index 5f06840..80821e9 100644 (file)
Binary files a/LayoutTests/fast/inspector/style-expected.png and b/LayoutTests/fast/inspector/style-expected.png differ
index 2de7ed6..599a064 100644 (file)
@@ -1 +1 @@
-720296de5356ea7c8b963a39d88d5ff2
\ No newline at end of file
+315d733f8d7589801b2213dacda2ef63
\ No newline at end of file
index b820b74..8c9194d 100644 (file)
Binary files a/LayoutTests/fast/lists/drag-into-marker-expected.png and b/LayoutTests/fast/lists/drag-into-marker-expected.png differ
index 57a89a9..3b9e6ef 100644 (file)
@@ -1,4 +1,4 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of LI > UL > BODY > HTML > #document to 2 of LI > UL > BODY > HTML > #document
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 6 of BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 2 of #text > SPAN > LI > UL > BODY > HTML > #document to 2 of #text > SPAN > LI > UL > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
@@ -22,12 +22,12 @@ layer at (0,0) size 800x600
           RenderText {#text} at (124,0) size 95x55
             text run at (124,0) width 95: "hello"
       RenderBlock {P} at (0,73) size 784x72
-        RenderText {#text} at (0,0) size 764x72
+        RenderText {#text} at (0,0) size 768x72
           text run at (0,0) width 562: "This is an automated test for elementAtPoint for points over position:outside list markers. "
-          text run at (562,0) width 168: "The dictionary returned by"
+          text run at (562,0) width 172: "The dictionary returned by "
           text run at (0,18) width 743: "elementAtPoint should contain the list item as the DOMNode, not the list, for points over position:outside list markers."
           text run at (0,36) width 743: "elementAtPoint is used to determine the drag operation that will occur when something is dropped over a given point. "
-          text run at (743,36) width 21: "So,"
+          text run at (743,36) width 25: "So, "
           text run at (0,54) width 371: "this test drags a bit of text over the list marker and drops it. "
           text run at (371,54) width 386: "It should be pasted into the list item, which is contenteditable."
 selection start: position 0 of child 0 {#text} of child 0 {SPAN} of child 0 {LI} of child 1 {UL} of child 0 {BODY} of child 0 {HTML} of document
index 0be7749..27d816f 100644 (file)
@@ -1,4 +1,4 @@
-<body>
+<body contenteditable="true">
 
 <ul id="ul" style="margin:1em; border:1px solid black;"><li id="li" contenteditable="true" style="list-style-type: square; font-size: 3em;">hello <span id="spanToDrag">world</span></a></div></li></ul>
 
index 7c52db0..c2a7fd3 100644 (file)
@@ -1 +1 @@
-be24b5f8a81be5e160a9a05d46b7c642
\ No newline at end of file
+106e200348dc751b6bb041817aec3a29
\ No newline at end of file
index 66b603e..c737f16 100644 (file)
Binary files a/LayoutTests/fast/overflow/childFocusRingClip-expected.png and b/LayoutTests/fast/overflow/childFocusRingClip-expected.png differ
index 6db58cf..d233d1d 100644 (file)
@@ -1 +1 @@
-5f100d8f4e73e5bba1c10129c16dfcae
\ No newline at end of file
+f60b77fa76763613d412f13226c21fa0
\ No newline at end of file
index 4f6e02e..869827b 100644 (file)
Binary files a/LayoutTests/fast/parser/001-expected.png and b/LayoutTests/fast/parser/001-expected.png differ
diff --git a/LayoutTests/plugins/embed-attributes-style-expected.checksum b/LayoutTests/plugins/embed-attributes-style-expected.checksum
new file mode 100644 (file)
index 0000000..03f9029
--- /dev/null
@@ -0,0 +1 @@
+0e5a8de4cbce88294fe528515966eb21
\ No newline at end of file
diff --git a/LayoutTests/plugins/embed-attributes-style-expected.png b/LayoutTests/plugins/embed-attributes-style-expected.png
new file mode 100644 (file)
index 0000000..d198448
Binary files /dev/null and b/LayoutTests/plugins/embed-attributes-style-expected.png differ
index e0c13ed..9fff87a 100644 (file)
@@ -1,3 +1,73 @@
+2006-05-03  Darin Adler  <darin@apple.com>
+
+        Reviewed by Justin.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8159
+          REGRESSION: Clicking outside new text field focuses the field
+
+        This bug has always been present for "content editable" HTML, but
+        now affects <input type=text> as well. The problem is with the editing
+        concept of a "deep equivalent". When computing the deep equivalent,
+        the code can move from outside an editable area to inside. To fix this,
+        I removed all use of the "deep equivalent" concept.
+
+        * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
+        Changed argument names from _x and _y to just x and y. When the element
+        is the editable root, changed things so that clicks that are not within
+        the element at all return positions before or after the element, rather than
+        always choosing the closest point within the element. This gets us off on
+        the right foot, by not choosing a position inside an editable root when you
+        click outside that editable root. This code handles shadowParentNode as well,
+        and also calls positionForCoordinates on children rather than calling
+        positionForRenderer (which I believe is now a function that can be removed).
+
+        * editing/VisiblePosition.h: Removed the deepEquivalent function.
+        * editing/VisiblePosition.cpp:
+        (WebCore::VisiblePosition::previousVisiblePosition): Removed use of the
+        deepEquivalent function. Also, to make this function easier to understand
+        I separated out the case where the start point is "in rendered content"
+        and the case where it's not into two separate loops.
+        (WebCore::VisiblePosition::nextVisiblePosition): Ditto.
+        (WebCore::VisiblePosition::initDeepPosition): Removed use of the deepEquivalent
+        function. Also added code to make sure that this work never turns a position
+        outside an editable element into a position inside that editable element, or
+        vice versa. Reorganized the code a bit.
+
+        * dom/Position.cpp:
+        (WebCore::Position::upstream): Removed use of the deepEquivalent function.
+        (WebCore::Position::downstream): Ditto.
+
+        * editing/htmlediting.cpp:
+        (WebCore::editingIgnoresContent): Changed to use isReplaced instead of isWidget
+        and isImage to determine if editing should ignore content.
+        (WebCore::firstInSpecialElement): Rewrote isFirstVisiblePositionInSpecialElement
+        to have code to share with positionBeforeContainingSpecialElement. And changed
+        to allow both the position just before a table and the position just inside a
+        table to qualify. While this is slightly sloppy, the old code worked because
+        of the "deep equivalent" technique. This change is needed to get the desired
+        results even without that technique.
+        (WebCore::lastInSpecialElement): Ditto.
+        (WebCore::isFirstVisiblePositionInSpecialElement): Changed to use the new function.
+        (WebCore::positionBeforeContainingSpecialElement): Ditto.
+        (WebCore::isLastVisiblePositionInSpecialElement): Ditto.
+        (WebCore::positionAfterContainingSpecialElement): Ditto.
+
+        * dom/Node.cpp: (WebCore::Node::rootEditableElement): Rewrote to remove
+        special case for body tag.
+
+        - other changes
+
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::setOuterHTML): Added a FIXME about the fact
+        that this won't merge neighboring text nodes the way setOuterText does.
+        (WebCore::HTMLElement::setInnerText): Added a FIXME about the fact that
+        this creates a text node even when setting to empty text.
+        (WebCore::HTMLElement::setOuterText): Ditto.
+
+        * editing/DeleteSelectionCommand.cpp: Removed some #if 1 and #if 0.
+        * editing/ReplaceSelectionCommand.cpp: A little reformatting.
+        * rendering/render_button.h: Tiny formatting tweak.
+
 2006-05-02  Adele Peterson  <adele@apple.com>
 
         Reviewed by Beth.
 
         Reviewed by eric.
 
-        WARNING: NO TEST CASES ADDED OR CHANGED
-
         * WebCore.vcproj/WebCore/WebCore.vcproj: defined NDEBUG in release build
         * bridge/win/FrameWin.cpp:
         (WebCore::FrameWin::FrameWin): turned on javascript.
 
         Reviewed by darin
 
-        WARNING: NO TEST CASES ADDED OR CHANGED
-
         * loader/Cache.cpp:
         * loader/CachedImage.cpp:
         (WebCore::CachedImage::data):
index bc2ba3e..2897a93 100644 (file)
@@ -1041,28 +1041,13 @@ Element *Node::enclosingInlineElement() const
     return 0;
 }
 
-Element *Node::rootEditableElement() const
+ElementNode::rootEditableElement() const
 {
-    if (!isContentEditable())
-        return 0;
-
-    Node *n = const_cast<Node *>(this);
-    if (n->hasTagName(bodyTag))
-        return static_cast<Element *>(n);
-
-    Node *result = n->isEditableBlock() ? n : 0;
-    while (1) {
-        n = n->parentNode();
-        if (!n || !n->isContentEditable())
-            break;
-        if (n->hasTagName(bodyTag)) {
-            result = n;
-            break;
-        }
-        if (n->isBlockFlow())
-            result = n;
-    }
-    return static_cast<Element *>(result);
+    Element* result = 0;
+    for (Node* n = const_cast<Node*>(this); n && n->isContentEditable(); n = n->parentNode())
+        if (n->isBlockFlow() && n->isElementNode())
+            result = static_cast<Element*>(n);
+    return result;
 }
 
 bool Node::inSameRootEditableElement(Node *n)
index 40fe8fc..0ee81c8 100644 (file)
@@ -276,7 +276,7 @@ static bool isStreamer(const Position &pos)
 Position Position::upstream() const
 {
     // start at equivalent deep position
-    Position start = VisiblePosition::deepEquivalent(*this);
+    Position start = *this;
     Node *startNode = start.node();
     if (!startNode)
         return Position();
@@ -363,7 +363,7 @@ Position Position::upstream() const
 // P.downstream() returns the end of the range of positions that map to the same VisiblePosition as P.
 Position Position::downstream() const
 {
-    Position start = VisiblePosition::deepEquivalent(*this);
+    Position start = *this;
     Node *startNode = start.node();
     if (!startNode)
         return Position();
@@ -443,7 +443,7 @@ Position Position::downstream() const
     return lastVisible;
 }
 
-bool hasRenderedChildrenWithHeight(RenderObject *renderer)
+static bool hasRenderedChildrenWithHeight(RenderObject *renderer)
 {
     if (!renderer->firstChild())
         return false;
index ea7688b..4d90c2c 100644 (file)
@@ -64,23 +64,19 @@ static void debugNode(const char *prefix, const Node *node)
         LOG(Editing, "%s%s %p", prefix, node->nodeName().deprecatedString().latin1(), node);
 }
 
-#if 1
 static Position positionBeforePossibleContainingSpecialElement(const Position &pos, Node **containingSpecialElement)
- {
+{
     if (isFirstVisiblePositionInSpecialElement(pos))
-        return positionBeforeContainingSpecialElement(pos, containingSpecialElement);
+        return positionBeforeContainingSpecialElement(pos, containingSpecialElement); 
      return pos;
- }
+}
  
 static Position positionAfterPossibleContainingSpecialElement(const Position &pos, Node **containingSpecialElement)
- {
+{
     if (isLastVisiblePositionInSpecialElement(pos))
         return positionAfterContainingSpecialElement(pos, containingSpecialElement);
-     return pos;
- }
-#endif
+    return pos;
+}
 
 DeleteSelectionCommand::DeleteSelectionCommand(Document *document, bool smartDelete, bool mergeBlocksAfterDelete)
     : CompositeEditCommand(document), 
@@ -111,19 +107,11 @@ DeleteSelectionCommand::DeleteSelectionCommand(Document *document, const Selecti
 
 void DeleteSelectionCommand::initializeStartEnd()
  {
-#if 0
-    Position start = m_selectionToDelete.start();
-    Position end = m_selectionToDelete.end();
-    m_upstreamStart = start.upstream();
-    m_downstreamStart = start.downstream();
-    m_upstreamEnd = end.upstream();
-    m_downstreamEnd = end.downstream();
-#else
-    Node *startSpecialContainer = 0;
-    Node *endSpecialContainer = 0;
+    Node* startSpecialContainer = 0;
+    Node* endSpecialContainer = 0;
     
     Position start = positionOutsideContainingSpecialElement(m_selectionToDelete.start(), &startSpecialContainer);
-    Position end   = positionOutsideContainingSpecialElement(m_selectionToDelete.end(), &endSpecialContainer);
+    Position end = positionOutsideContainingSpecialElement(m_selectionToDelete.end(), &endSpecialContainer);
     
     m_upstreamStart = positionBeforePossibleContainingSpecialElement(start.upstream(), &startSpecialContainer);
     m_downstreamStart = positionBeforePossibleContainingSpecialElement(start.downstream(), 0);
@@ -141,7 +129,6 @@ void DeleteSelectionCommand::initializeStartEnd()
             m_downstreamEnd = end.downstream();
         }
     }
-#endif
 }
 
 void DeleteSelectionCommand::initializePositionData()
@@ -515,6 +502,9 @@ void DeleteSelectionCommand::mergeParagraphs()
         
     VisiblePosition endOfParagraphToMove = endOfParagraph(startOfParagraphToMove);
     
+    if (mergeDestination == endOfParagraphToMove)
+        return;
+        
     moveParagraph(startOfParagraphToMove, endOfParagraphToMove, mergeDestination);
 }
 
index 310c973..d0d75bc 100644 (file)
@@ -674,7 +674,7 @@ void ReplaceSelectionCommand::doApply()
     if (fragment.firstChild()) {
         RefPtr<Node> refNode = fragment.firstChild();
         RefPtr<Node> node = refNode ? refNode->nextSibling() : 0;
-        Node *insertionBlock = insertionPos.node()->enclosingBlockFlowElement();
+        NodeinsertionBlock = insertionPos.node()->enclosingBlockFlowElement();
         Node* insertionRoot = insertionPos.node()->rootEditableElement();
         bool insertionBlockIsRoot = insertionBlock == insertionRoot;
         VisiblePosition visibleInsertionPos(insertionPos);
@@ -710,7 +710,7 @@ void ReplaceSelectionCommand::doApply()
         }
         
         while (node) {
-            Node *next = node->nextSibling();
+            Nodenext = node->nextSibling();
             fragment.removeNode(node);
             insertNodeAfterAndUpdateNodesInserted(node.get(), refNode.get());
             refNode = node;
index d33e849..156b61a 100644 (file)
@@ -89,123 +89,108 @@ VisiblePosition VisiblePosition::previous() const
     return result;
 }
 
-Position VisiblePosition::previousVisiblePosition(const Position &pos)
+Position VisiblePosition::previousVisiblePosition(const Positionpos)
 {
-    if (pos.isNull() || pos.atStart())
+    if (!pos.inRenderedContent()) {
+        Position current = pos;
+        while (!current.atStart()) {
+            current = current.previous(UsingComposedCharacters);
+            if (current.inRenderedContent())
+                return current;
+        }
         return Position();
+    }
 
-    Position test = deepEquivalent(pos);
-    Position downstreamTest = test.downstream();
-    bool acceptAnyVisiblePosition = !test.inRenderedContent();
-
-    Position current = test;
+    Position downstreamStart = pos.downstream();
+    Position current = pos;
     while (!current.atStart()) {
         current = current.previous(UsingComposedCharacters);
-        if (current.inRenderedContent() && (acceptAnyVisiblePosition || (downstreamTest != current.downstream()))) {
+        if (current.inRenderedContent() && downstreamStart != current.downstream())
             return current;
-        }
     }
-
-     return Position();
+    return Position();
 }
 
-Position VisiblePosition::nextVisiblePosition(const Position &pos)
+Position VisiblePosition::nextVisiblePosition(const Positionpos)
 {
-    if (pos.isNull() || pos.atEnd())
+    if (!pos.inRenderedContent()) {
+        Position current = pos;
+        while (!current.atEnd()) {
+            current = current.next(UsingComposedCharacters);
+            if (current.inRenderedContent())
+                return current;
+        }
         return Position();
+    }
 
-    Position test = deepEquivalent(pos);
-    bool acceptAnyVisiblePosition = !test.inRenderedContent();
-
-    Position current = test;
-    Position downstreamTest = test.downstream();
+    Position downstreamStart = pos.downstream();
+    Position current = pos;
     while (!current.atEnd()) {
         current = current.next(UsingComposedCharacters);
-        if (current.inRenderedContent() && (acceptAnyVisiblePosition || (downstreamTest != current.downstream()))) {
+        if (current.inRenderedContent() && downstreamStart != current.downstream())
             return current;
-        }
     }
-    
     return Position();
 }
 
 void VisiblePosition::initDeepPosition(const Position& position, EAffinity affinity)
 {
-    if (position.isNull()) {
+    // FIXME: No need for affinity parameter.
+    // FIXME: Would read nicer if this was a function that returned a Position.
+
+    Node* node = position.node();
+    if (!node) {
         m_deepPosition = Position();
         return;
     }
 
-    position.node()->document()->updateLayoutIgnorePendingStylesheets();
-    Position deepPos = deepEquivalent(position);
+    node->document()->updateLayoutIgnorePendingStylesheets();
+
     // If two visually equivalent positions are both candidates for being made the m_deepPosition,
     // (this can happen when two rendered positions have only collapsed whitespace between them),
     // we always choose the one that occurs first in the DOM to canonicalize VisiblePositions.
-    m_deepPosition = deepPos.upstream();
+    m_deepPosition = position.upstream();
     if (m_deepPosition.inRenderedContent())
         return;
-    
-    m_deepPosition = deepPos;
+    m_deepPosition = position;
     if (m_deepPosition.inRenderedContent())
         return;
-
-    m_deepPosition = deepPos.downstream();
+    m_deepPosition = position.downstream();
     if (m_deepPosition.inRenderedContent())
         return;
-        
-    // Do something rational for an input position inside unrendered whitespace that isn't really 
-    // equivalent to any rendered position, such as: <div>foo</div>{unrendered whitespace}<div>bar</div>
-    Position next = nextVisiblePosition(deepPos);
-    Position prev = previousVisiblePosition(deepPos);
-    
-    if (next.isNull() && prev.isNull())
-        m_deepPosition = Position();
-    else if (next.isNull())
+
+    // When neither upstream or downstream gets us to a visible position,
+    // look at the next and previous visible position.
+    Position next = nextVisiblePosition(position);
+    Position prev = previousVisiblePosition(position);
+    Node* nextNode = next.node();
+    Node* prevNode = prev.node();
+
+    // The new position must be in the same editable element. Enforce that first.
+    Node* editingRoot = node->rootEditableElement();
+    bool prevIsInSameEditableElement = prevNode && prevNode->rootEditableElement() == editingRoot;
+    bool nextIsInSameEditableElement = nextNode && nextNode->rootEditableElement() == editingRoot;
+    if (prevIsInSameEditableElement && !nextIsInSameEditableElement) {
         m_deepPosition = prev;
-    else if (prev.isNull())
-        m_deepPosition = next;
-    else {
-        Node *originalBlock = position.node()->enclosingBlockFlowElement();
-        bool nextIsOutsideOriginalBlock = !next.node()->isAncestor(originalBlock) && next.node() != originalBlock;
-        bool prevIsOutsideOriginalBlock = !prev.node()->isAncestor(originalBlock) && prev.node() != originalBlock;
-        
-        if (nextIsOutsideOriginalBlock && !prevIsOutsideOriginalBlock)
-            m_deepPosition = prev;
-        else
-            m_deepPosition = next;
+        return;
     }
-}
-
-Position VisiblePosition::deepEquivalent(const Position &pos)
-{
-    Node *node = pos.node();
-    int offset = pos.offset();
-
-    if (!node)
-        return Position();
-    
-    if (pos.inRenderedContent() || isAtomicNode(node))
-        return pos;
-
-    if (offset >= (int)node->childNodeCount()) {
-        do {
-            Node *child = node->lastChild();
-            if (!child)
-                break;
-            node = child;
-        } while (!(Position(node, maxDeepOffset(node)).inRenderedContent()) && !isAtomicNode(node));
-        return Position(node, maxDeepOffset(node));
+    if (nextIsInSameEditableElement && !prevIsInSameEditableElement) {
+        m_deepPosition = next;
+        return;
     }
-    
-    node = node->childNode(offset);
-    ASSERT(node);
-    while (!(Position(node, 0).inRenderedContent()) && !isAtomicNode(node)) {
-        Node *child = node->firstChild();
-        if (!child)
-            break;
-        node = child;
+    if (!nextIsInSameEditableElement && !prevIsInSameEditableElement) {
+        m_deepPosition = Position();
+        return;
     }
-    return Position(node, 0);
+
+    // The new position should be in the same block flow element. Favor that.
+    Node *originalBlock = node->enclosingBlockFlowElement();
+    bool nextIsOutsideOriginalBlock = !nextNode->isAncestor(originalBlock) && nextNode != originalBlock;
+    bool prevIsOutsideOriginalBlock = !prevNode->isAncestor(originalBlock) && prevNode != originalBlock;
+    if (nextIsOutsideOriginalBlock && !prevIsOutsideOriginalBlock)
+        m_deepPosition = prev;
+    else
+        m_deepPosition = next;
 }
 
 int VisiblePosition::maxOffset(const Node *node)
index f96657e..3cc4649 100644 (file)
@@ -70,8 +70,6 @@ public:
     
     void debugPosition(const char* msg = "") const;
     
-    static Position deepEquivalent(const Position&);
-    
     Element* rootEditableElement() const { return m_deepPosition.isNotNull() ? m_deepPosition.node()->rootEditableElement() : 0; }
 
 #ifndef NDEBUG
index e6df903..59f9362 100644 (file)
@@ -55,10 +55,10 @@ bool editingIgnoresContent(const Node *node)
         return false;
     
     if (node->renderer()) {
-        if (node->renderer()->isWidget())
-            return true;
-        if (node->renderer()->isImage())
+        if (node->renderer()->isReplaced() && !node->renderer()->canHaveChildren())
             return true;
+        ASSERT(!node->renderer()->isWidget());
+        ASSERT(!node->renderer()->isImage());
     } else {
         // widgets
         if (static_cast<const HTMLElement *>(node)->isGenericFormElement())
@@ -206,7 +206,6 @@ static int maxRangeOffset(Node *n)
     return 1;
 }
 
-#if 1
 // FIXME: need to dump this
 bool isSpecialElement(const Node *n)
 {
@@ -238,111 +237,71 @@ bool isSpecialElement(const Node *n)
     return false;
 }
 
-bool isFirstVisiblePositionInSpecialElement(const Position& pos)
+static Node* firstInSpecialElement(const Position& pos)
 {
-    VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM);
-
-    for (Node *n = pos.node(); n; n = n->parentNode()) {
-        VisiblePosition checkVP = VisiblePosition(n, 0, DOWNSTREAM);
-        if (checkVP != vPos) {
-            if (isTableElement(n) && checkVP.next() == vPos)
-                return true;
-            return false;
+    Node* rootEditableElement = pos.node()->rootEditableElement();
+    for (Node* n = pos.node(); n && n->rootEditableElement() == rootEditableElement; n = n->parentNode())
+        if (isSpecialElement(n)) {
+            VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM);
+            VisiblePosition firstInElement = VisiblePosition(n, 0, DOWNSTREAM);
+            if (isTableElement(n) && vPos == firstInElement.next())
+                return n;
+            if (vPos == firstInElement)
+                return n;
         }
-        if (n->rootEditableElement() == NULL)
-            return false;
-        if (isSpecialElement(n))
-            return true;
-    }
+    return 0;
+}
 
-    return false;
+static Node* lastInSpecialElement(const Position& pos)
+{
+    Node* rootEditableElement = pos.node()->rootEditableElement();
+    for (Node* n = pos.node(); n && n->rootEditableElement() == rootEditableElement; n = n->parentNode())
+        if (isSpecialElement(n)) {
+            VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM);
+            VisiblePosition lastInElement = VisiblePosition(n, n->childNodeCount(), DOWNSTREAM);
+            if (isTableElement(n) && vPos == lastInElement.previous())
+                return n;
+            if (vPos == lastInElement)
+                return n;
+        }
+    return 0;
 }
 
-Position positionBeforeContainingSpecialElement(const Position& pos, Node **containingSpecialElement)
+bool isFirstVisiblePositionInSpecialElement(const Position& pos)
 {
-    ASSERT(isFirstVisiblePositionInSpecialElement(pos));
+    return firstInSpecialElement(pos);
+}
 
-    VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM);
-    
-    Node *outermostSpecialElement = NULL;
-
-    for (Node *n = pos.node(); n; n = n->parentNode()) {
-        VisiblePosition checkVP = VisiblePosition(n, 0, DOWNSTREAM);
-        if (checkVP != vPos) {
-            if (isTableElement(n) && checkVP.next() == vPos)
-                outermostSpecialElement = n;
-            break;
-        }
-        if (n->rootEditableElement() == NULL)
-            break;
-        if (isSpecialElement(n))
-            outermostSpecialElement = n;
-    }
-    
-    ASSERT(outermostSpecialElement);
-    if (containingSpecialElement)
-        *containingSpecialElement = outermostSpecialElement;
-        
-    Position result = positionBeforeNode(outermostSpecialElement);
-    if (result.isNull() || !result.node()->rootEditableElement())
+Position positionBeforeContainingSpecialElement(const Position& pos, Node** containingSpecialElement)
+{
+    Node* n = firstInSpecialElement(pos);
+    ASSERT(n);
+    if (!n)
         return pos;
-    
+    Position result = positionBeforeNode(n);
+    if (result.isNull() || result.node()->rootEditableElement() != pos.node()->rootEditableElement())
+        return pos;
+    if (containingSpecialElement)
+        *containingSpecialElement = n;
     return result;
 }
 
 bool isLastVisiblePositionInSpecialElement(const Position& pos)
 {
-    // make sure to get a range-compliant version of the position
-    // FIXME: rangePos isn't being used to create DOM Ranges, so why does it need to be range compliant?
-    Position rangePos = rangeCompliantEquivalent(VisiblePosition(pos, DOWNSTREAM));
-
-    VisiblePosition vPos = VisiblePosition(rangePos, DOWNSTREAM);
-
-    for (Node *n = rangePos.node(); n; n = n->parentNode()) {
-        VisiblePosition checkVP = VisiblePosition(n, maxRangeOffset(n), DOWNSTREAM);
-        if (checkVP != vPos)
-            return (isTableElement(n) && checkVP.previous() == vPos);
-        if (n->rootEditableElement() == NULL)
-            return false;
-        if (isSpecialElement(n))
-            return true;
-    }
-
-    return false;
+    return lastInSpecialElement(pos);
 }
 
 Position positionAfterContainingSpecialElement(const Position& pos, Node **containingSpecialElement)
 {
-    ASSERT(isLastVisiblePositionInSpecialElement(pos));
-
-    // make sure to get a range-compliant version of the position
-    // FIXME: rangePos isn't being used to create DOM Ranges, so why does it need to be range compliant?
-    Position rangePos = rangeCompliantEquivalent(VisiblePosition(pos, DOWNSTREAM));
-    VisiblePosition vPos = VisiblePosition(rangePos, DOWNSTREAM);
-
-    Node *outermostSpecialElement = NULL;
-
-    for (Node *n = rangePos.node(); n; n = n->parentNode()) {
-        VisiblePosition checkVP = VisiblePosition(n, maxRangeOffset(n), DOWNSTREAM);
-        if (checkVP != vPos) {
-            if (isTableElement(n) && checkVP.previous() == vPos)
-                outermostSpecialElement = n;
-            break;
-        }
-        if (n->rootEditableElement() == NULL)
-            break;
-        if (isSpecialElement(n))
-            outermostSpecialElement = n;
-    }
-    
-    ASSERT(outermostSpecialElement);
-    if (containingSpecialElement)
-        *containingSpecialElement = outermostSpecialElement;
-
-    Position result = positionAfterNode(outermostSpecialElement);
-    if (result.isNull() || !result.node()->rootEditableElement())
+    Node* n = lastInSpecialElement(pos);
+    ASSERT(n);
+    if (!n)
         return pos;
-    
+    Position result = positionAfterNode(n);
+    if (result.isNull() || result.node()->rootEditableElement() != pos.node()->rootEditableElement())
+        return pos;
+    if (containingSpecialElement)
+        *containingSpecialElement = n;
     return result;
 }
 
@@ -350,13 +309,10 @@ Position positionOutsideContainingSpecialElement(const Position &pos, Node **con
 {
     if (isFirstVisiblePositionInSpecialElement(pos))
         return positionBeforeContainingSpecialElement(pos, containingSpecialElement);
-    
     if (isLastVisiblePositionInSpecialElement(pos))
         return positionAfterContainingSpecialElement(pos, containingSpecialElement);
-
     return pos;
 }
-#endif
 
 Position positionBeforeNode(const Node *node)
 {
index 66f8c13..58b8ce4 100644 (file)
@@ -319,6 +319,8 @@ void HTMLElement::setOuterHTML(const String &html, ExceptionCode& ec)
         return;
     }
 
+    // FIXME: Why doesn't this have code to merge neighboring text nodes the
+    // way setOuterText does?
     parent->replaceChild(fragment.release(), this, ec);
 }
 
@@ -338,6 +340,7 @@ void HTMLElement::setInnerText(const String& text, ExceptionCode& ec)
     }
 
     removeChildren();
+    // FIXME: This creates a new text node even when the text is empty.
     appendChild(new Text(document(), text), ec);
 }
 
@@ -362,6 +365,7 @@ void HTMLElement::setOuterText(const String &text, ExceptionCode& ec)
         return;
     }
 
+    // FIXME: This creates a new text node even when the text is empy.
     RefPtr<Text> t = new Text(document(), text);
     ec = 0;
     parent->replaceChild(t, this, ec);
index 460184c..78610b6 100644 (file)
@@ -2571,10 +2571,10 @@ Position RenderBlock::positionForRenderer(RenderObject *renderer, bool start) co
     return Position(node, offset);
 }
 
-VisiblePosition RenderBlock::positionForCoordinates(int _x, int _y)
+VisiblePosition RenderBlock::positionForCoordinates(int x, int y)
 {
     if (isTable())
-        return RenderFlow::positionForCoordinates(_x, _y); 
+        return RenderFlow::positionForCoordinates(x, y); 
 
     int absx, absy;
     absolutePositionForContent(absx, absy);
@@ -2582,24 +2582,55 @@ VisiblePosition RenderBlock::positionForCoordinates(int _x, int _y)
     int top = absy + borderTop() + paddingTop();
     int bottom = top + contentHeight();
 
-    if (_y < top)
-        // y coordinate is above block
-        return VisiblePosition(positionForRenderer(firstLeafChild(), true), DOWNSTREAM);
+    int left = absx + borderLeft() + paddingLeft();
+    int right = left + contentWidth();
 
-    if (_y >= bottom)
-        // y coordinate is below block
-        return VisiblePosition(positionForRenderer(lastLeafChild(), false), DOWNSTREAM);
+    Node* n = element();
+
+    bool isEditableRoot = n && n->rootEditableElement() == n;
+
+    if (y < top || (isEditableRoot && (y < bottom && x < left))) {
+        if (!isEditableRoot)
+            if (RenderObject* c = firstChild()) {
+                VisiblePosition p = c->positionForCoordinates(x, y);
+                if (p.isNotNull())
+                    return p;
+            }
+        if (n) {
+            if (Node* sp = n->shadowParentNode())
+                n = sp;
+            if (Node* p = n->parent())
+                return VisiblePosition(p, n->nodeIndex(), DOWNSTREAM);
+        }
+        return VisiblePosition(n, 0, DOWNSTREAM);
+    }
+
+    if (y >= bottom || (isEditableRoot && (y >= top && x >= right))) {
+        if (!isEditableRoot)
+            if (RenderObject* c = lastChild()) {
+                VisiblePosition p = c->positionForCoordinates(x, y);
+                if (p.isNotNull())
+                    return p;
+            }
+        if (n) {
+            if (Node* sp = n->shadowParentNode())
+                n = sp;
+            if (Node* p = n->parent())
+                return VisiblePosition(p, n->nodeIndex() + 1, DOWNSTREAM);
+        }
+        return VisiblePosition(n, 0, DOWNSTREAM);
+    }
 
     if (childrenInline()) {
         if (!firstRootBox())
-            return VisiblePosition(element(), 0, DOWNSTREAM);
+            return VisiblePosition(n, 0, DOWNSTREAM);
             
-        if (_y >= top && _y < absy + firstRootBox()->topOverflow())
+        if (y >= top && y < absy + firstRootBox()->topOverflow())
             // y coordinate is above first root line box
             return VisiblePosition(positionForBox(firstRootBox()->firstLeafChild(), true), DOWNSTREAM);
         
         // look for the closest line box in the root box which is at the passed-in y coordinate
-        for (RootInlineBox *root = firstRootBox(); root; root = root->nextRootBox()) {
+        for (RootInlineBoxroot = firstRootBox(); root; root = root->nextRootBox()) {
             top = absy + root->topOverflow();
             // set the bottom based on whether there is a next root box
             if (root->nextRootBox())
@@ -2607,47 +2638,45 @@ VisiblePosition RenderBlock::positionForCoordinates(int _x, int _y)
             else
                 bottom = absy + root->bottomOverflow();
             // check if this root line box is located at this y coordinate
-            if (_y >= top && _y < bottom && root->firstChild()) {
-                InlineBox *closestBox = root->closestLeafChildForXPos(_x, absx);
-                if (closestBox) {
+            if (y >= top && y < bottom && root->firstChild()) {
+                InlineBox* closestBox = root->closestLeafChildForXPos(x, absx);
+                if (closestBox)
                     // pass the box a y position that is inside it
-                    return closestBox->object()->positionForCoordinates(_x, absy + closestBox->m_y);
-                }
+                    return closestBox->object()->positionForCoordinates(x, absy + closestBox->m_y);
             }
         }
 
         if (lastRootBox())
             // y coordinate is below last root line box
             return VisiblePosition(positionForBox(lastRootBox()->lastLeafChild(), false), DOWNSTREAM);
-        
-        return VisiblePosition(element(), 0, DOWNSTREAM);
+
+        return VisiblePosition(n, 0, DOWNSTREAM);
     }
     
     // see if any child blocks exist at this y coordinate
-    RenderObject *lastVisibleChild = 0;
-    for (RenderObject *renderer = firstChild(); renderer; renderer = renderer->nextSibling()) {
+    RenderObjectlastVisibleChild = 0;
+    for (RenderObjectrenderer = firstChild(); renderer; renderer = renderer->nextSibling()) {
         if (renderer->height() == 0 || renderer->style()->visibility() != VISIBLE || renderer->isFloatingOrPositioned())
             continue;
         renderer->absolutePositionForContent(absx, top);
-        RenderObject *next = renderer->nextSibling();
+        RenderObjectnext = renderer->nextSibling();
         while (next && next->isFloatingOrPositioned())
             next = next->nextSibling();
         if (next) 
             next->absolutePositionForContent(absx, bottom);
         else
             bottom = top + contentHeight();
-        if (_y >= top && _y < bottom) {
-            return renderer->positionForCoordinates(_x, _y);
-        }
+        if (y >= top && y < bottom)
+            return renderer->positionForCoordinates(x, y);
         lastVisibleChild = renderer;
     }
 
     // pass along to the last child we saw that had a height and is visible.
     if (lastVisibleChild)
-        return lastVisibleChild->positionForCoordinates(_x, _y);
+        return lastVisibleChild->positionForCoordinates(x, y);
     
     // still no luck...return this render object's element and offset 0
-    return VisiblePosition(element(), 0, DOWNSTREAM);
+    return VisiblePosition(n, 0, DOWNSTREAM);
 }
 
 void RenderBlock::calcMinMaxWidth()
index c4a6dda..fe54dc6 100644 (file)
@@ -45,7 +45,7 @@ public:
 
     virtual void paintObject(PaintInfo&, int tx, int ty);
 
-    virtual const char *renderName() const { return "RenderButton"; }
+    virtual const charrenderName() const { return "RenderButton"; }
 
 protected:
     RenderText* m_buttonText;