WebCore:
authorjustin.garcia@apple.com <justin.garcia@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Mar 2008 21:57:10 +0000 (21:57 +0000)
committerjustin.garcia@apple.com <justin.garcia@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Mar 2008 21:57:10 +0000 (21:57 +0000)
commit6437ad5e40cdc239042a0d99728bc6d0fa33cf70
tree36a8a3ce99c65e90353090f69f90e82a3d0ffbc0
parent2f795d0e18a44be3abf760f3fcabef04234d0dcf
WebCore:

2008-03-19  Justin Garcia  <justin.garcia@apple.com>

        Reviewed by Oliver.

        <rdar://problem/5794920> Acid3: Assertion failure in VisiblePosition::previous when clicking on results (17004)

        The position inside an empty inline-block was a candidate, but upstream and downstream
        would move across it without stopping.  This confused canonicalPosition, since no more
        than two candidates should have the same upstream/downstream (be visually equivalent).

        Code was added intentionally in isCandidate to make VisiblePositions inside empty
        inline-blocks, so we need to make upstream/downstream understand that.

        * dom/Position.cpp:
        (WebCore::endsOfNodeAreVisuallyDistinctPositions): upstream and downstream used to only
        stop when entering or leaving a non-inline element (referred to as a "block").  We must also
        avoid entering or leaving an empty inline-block.  This will allow a VisiblePosition there, to
        match up with what the code in isCandidate intended.
        (WebCore::enclosingVisualBoundary): Removed enclosingBlock and replaced it with this.
        (WebCore::Position::upstream): Added better comments, called the new functions.
        (WebCore::Position::downstream): Ditto.
        * dom/Position.h:

LayoutTests:

2008-03-19  Justin Garcia  <justin.garcia@apple.com>

        Reviewed by Oliver.

        <rdar://problem/5794920> Acid3: Assertion failure in VisiblePosition::previous when clicking on results (17004)

        * editing/pasteboard/4989774.html: Updated to wait for the images to load before trying to copy it.
        * editing/selection/5794920-1-expected.txt: Added.
        * editing/selection/5794920-1.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@31161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/4989774.html
LayoutTests/editing/selection/5794920-1-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/5794920-1.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/dom/Position.cpp
WebCore/dom/Position.h