Changeset 112851 in webkit


Ignore:
Timestamp:
Apr 2, 2012 3:28:26 AM (12 years ago)
Author:
mario@webkit.org
Message:

in page anchor and keyboard navigation
https://bugs.webkit.org/show_bug.cgi?id=17450

Reviewed by Chris Fleizach.

Source/WebCore:

Ensure that the position of the caret and the focused element
get updated when following an anchor link.

The implementation is moved from platform specific files out to
AXObjectCache.cpp since it should be a cross-platform valid
solution. However, the new code is currently activated for the Mac
and GTK ports only, since the windows and chromium ports provide
their own specific code, and removing it now might break things.

Test: accessibility/anchor-link-selection-and-focus.html

  • accessibility/AXObjectCache.cpp:

(WebCore):
(WebCore::AXObjectCache::handleScrolledToAnchor): Cross-platform
implementation of the fix, only activated for Mac and GTK for now.

  • accessibility/gtk/AXObjectCacheAtk.cpp: Removed the GTK-specific

implementation of WebCore::AXObjectCache::handleScrolledToAnchor.

  • accessibility/mac/AXObjectCacheMac.mm: Removed the Mac-specific

implementation of WebCore::AXObjectCache::handleScrolledToAnchor.

LayoutTests:

Added new test and expectations.

  • accessibility/anchor-link-selection-and-focus-expected.txt: Added.
  • accessibility/anchor-link-selection-and-focus.html: Added.
  • platform/gtk/accessibility/anchor-link-selection-and-focus-expected.txt: Added.
  • platform/chromium/test_expectations.txt: Skipped test for chromium.
Location:
trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r112850 r112851  
     12012-04-02  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        in page anchor and keyboard navigation
     4        https://bugs.webkit.org/show_bug.cgi?id=17450
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Added new test and expectations.
     9
     10        * accessibility/anchor-link-selection-and-focus-expected.txt: Added.
     11        * accessibility/anchor-link-selection-and-focus.html: Added.
     12        * platform/gtk/accessibility/anchor-link-selection-and-focus-expected.txt: Added.
     13        * platform/chromium/test_expectations.txt: Skipped test for chromium.
     14
    1152012-04-02  Philippe Normand  <pnormand@igalia.com>
    216
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r112815 r112851  
    12761276BUGCR10322 SKIP : platform/mac/accessibility = PASS FAIL
    12771277BUGCR10322 SKIP : platform/win/accessibility = PASS FAIL
     1278BUGCR10322 SKIP : accessibility/anchor-link-selection-and-focus.html = TEXT
    12781279BUGCR10322 SKIP : accessibility/aria-activedescendant-crash.html = TEXT
    12791280BUGCR10322 SKIP : accessibility/aria-combobox.html = TEXT
  • trunk/Source/WebCore/ChangeLog

    r112845 r112851  
     12012-04-02  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        in page anchor and keyboard navigation
     4        https://bugs.webkit.org/show_bug.cgi?id=17450
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Ensure that the position of the caret and the focused element
     9        get updated when following an anchor link.
     10
     11        The implementation is moved from platform specific files out to
     12        AXObjectCache.cpp since it should be a cross-platform valid
     13        solution. However, the new code is currently activated for the Mac
     14        and GTK ports only, since the windows and chromium ports provide
     15        their own specific code, and removing it now might break things.
     16
     17        Test: accessibility/anchor-link-selection-and-focus.html
     18
     19        * accessibility/AXObjectCache.cpp:
     20        (WebCore):
     21        (WebCore::AXObjectCache::handleScrolledToAnchor): Cross-platform
     22        implementation of the fix, only activated for Mac and GTK for now.
     23        * accessibility/gtk/AXObjectCacheAtk.cpp: Removed the GTK-specific
     24        implementation of WebCore::AXObjectCache::handleScrolledToAnchor.
     25        * accessibility/mac/AXObjectCacheMac.mm: Removed the Mac-specific
     26        implementation of WebCore::AXObjectCache::handleScrolledToAnchor.
     27
    1282012-04-02  Hayato Ito  <hayato@chromium.org>
    229
  • trunk/Source/WebCore/accessibility/AXObjectCache.cpp

    r104350 r112851  
    5555#include "FocusController.h"
    5656#include "Frame.h"
     57#include "FrameSelection.h"
    5758#include "HTMLAreaElement.h"
    5859#include "HTMLImageElement.h"
     
    7273#include "RenderView.h"
    7374#include "ScrollView.h"
    74 
     75#include "TextAffinity.h"
     76#include "htmlediting.h"
    7577#include <wtf/PassRefPtr.h>
    7678
     
    156158    return obj;
    157159}
     160
     161#if HAVE(ACCESSIBILITY) && (PLATFORM(MAC) || PLATFORM(GTK))
     162void AXObjectCache::handleScrolledToAnchor(const Node* node)
     163{
     164    ASSERT(node);
     165
     166    Document* document = node->document();
     167    if (!document)
     168        return;
     169
     170    RefPtr<Node> refNode = const_cast<Node*>(node);
     171    document->setFocusedNode(refNode);
     172
     173    Frame* frame = document->frame();
     174    if (!frame)
     175        return;
     176
     177    FrameSelection* selection = frame->selection();
     178    if (!selection)
     179        return;
     180
     181    Position targetPosition = firstPositionInOrBeforeNode(refNode.get());
     182    selection->moveTo(targetPosition, DOWNSTREAM);
     183}
     184#endif
    158185
    159186AccessibilityObject* AXObjectCache::get(Widget* widget)
  • trunk/Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp

    r111354 r112851  
    232232}
    233233
    234 void AXObjectCache::handleScrolledToAnchor(const Node*)
    235 {
    236 }
    237 
    238234} // namespace WebCore
  • trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm

    r110823 r112851  
    145145}
    146146
    147 void AXObjectCache::handleScrolledToAnchor(const Node*)
    148 {
    149 }
    150 
    151147}
    152148
Note: See TracChangeset for help on using the changeset viewer.