2010-04-22 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Apr 2010 05:47:06 +0000 (05:47 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Apr 2010 05:47:06 +0000 (05:47 +0000)
commita37664ef7bb587d802572019735fa34eae3b148b
tree42b8e3bdd2197df56db62c257059a710c181575f
parentaeb2f12b9791c9e8a05425e40cc3aa3e0889ff97
2010-04-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dan Bernstein.

        Links around blocks (e.g. divs) results in too many VoiceOver call outs
        https://bugs.webkit.org/show_bug.cgi?id=37079

        The basic change is to modify the AccessibilityRenderObject tree
        traversal methods to account for inline continuations in the
        render tree and make the accessibility tree look as if
        continuations didn't exist - the same as if CSS blocks could just
        sit in CSS inlines. This is slightly tricky code but creates a
        much saner accessibility tree.

        Tests: accessibility/image-link-inline-cont.html
               accessibility/image-link.html
               accessibility/inline-continuations.html

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::isInlineWithContinuation): Helper function for traversal functions to use in accounting for continuations.
        (WebCore::firstChildInContinuation): ditto
        (WebCore::firstChildConsideringContinuation): ditto
        (WebCore::lastChildConsideringContinuation): ditto
        (WebCore::startOfContinuations): ditto
        (WebCore::endOfContinuations): ditto
        (WebCore::childBeforeConsideringContinuations): ditto
        (WebCore::firstChildIsInlineContinuation): ditto
        (WebCore::lastChildHasContinuation): ditto
        (WebCore::AccessibilityRenderObject::firstChild): Account for inline continuations.
        (WebCore::AccessibilityRenderObject::lastChild): ditto
        (WebCore::AccessibilityRenderObject::previousSibling): Account for inline continuations
        and their anonymous block parents.
        (WebCore::AccessibilityRenderObject::nextSibling): ditto
        (WebCore::AccessibilityRenderObject::parentObjectIfExists): Account for inline continuations.
        (WebCore::AccessibilityRenderObject::parentObject): Account for inline continuations.
        * rendering/RenderInline.h: Make RenderInline::inlineContinuation public.
2010-04-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dan Bernstein.

        Links around blocks (e.g. divs) results in too many VoiceOver call outs
        https://bugs.webkit.org/show_bug.cgi?id=37079

        The new test cases verify the accessibility tree created by an image inside a link, and verify
        that adding a div with role=presentation now has no effect on the accessibility tree (as expected).

        * accessibility/image-link-inline-cont-expected.txt: Added.
        * accessibility/image-link-inline-cont.html: Added.
        * accessibility/image-link.html: Added.
        * platform/gtk/Skipped:
        * platform/mac/accessibility/image-link-expected.txt: Added.
        * platform/win/Skipped:

        Test to check that accessibility tree doesn't get duplicate content in the presence
        of inline continuations (this was a bug in an earlier version of this patch).

        * accessibility/inline-continuations-expected.txt: Added.
        * accessibility/inline-continuations.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/image-link-inline-cont-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/image-link-inline-cont.html [new file with mode: 0644]
LayoutTests/accessibility/image-link.html [new file with mode: 0644]
LayoutTests/accessibility/inline-continuations-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/inline-continuations.html [new file with mode: 0644]
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/mac/accessibility/image-link-expected.txt [new file with mode: 0644]
LayoutTests/platform/win/Skipped
WebCore/ChangeLog
WebCore/accessibility/AccessibilityRenderObject.cpp
WebCore/rendering/RenderInline.h