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)
commiteeb14748b0e83d8d27848ede4deedb026ba1fbca
tree6904d8e33da6dea382e35632f0663fac1636d751
parenta4db0467f356866e5e24994b7838f19a34497fa1
LayoutTests:

        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