Changeset 88004 in webkit


Ignore:
Timestamp:
Jun 3, 2011 4:10:29 AM (13 years ago)
Author:
mario@webkit.org
Message:

2011-06-03 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Martin Robinson.

Focus and caret position should be updated when same-page links are followed
https://bugs.webkit.org/show_bug.cgi?id=59737

Update the caret position to the anchor's position after scrolling.

This behavior is specific to the Gtk port and requested because of
accessibility needs, that's why it's implemented in AXObjectCache.

Test: platform/gtk/accessibility/caret-browsing-anchor-followed.html

  • accessibility/gtk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::handleScrolledToAnchor): Make sure the caret is updated to be in the anchor's position after scrolling.

2011-06-03 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Martin Robinson.

Focus and caret position should be updated when same-page links are followed
https://bugs.webkit.org/show_bug.cgi?id=59737

New layout test for testing this GTK-specific feature.

  • platform/gtk/accessibility/caret-browsing-anchor-followed-expected.txt: Added.
  • platform/gtk/accessibility/caret-browsing-anchor-followed.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r88002 r88004  
     12011-06-03  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        Focus and caret position should be updated when same-page links are followed
     6        https://bugs.webkit.org/show_bug.cgi?id=59737
     7
     8        New layout test for testing this GTK-specific feature.
     9
     10        * platform/gtk/accessibility/caret-browsing-anchor-followed-expected.txt: Added.
     11        * platform/gtk/accessibility/caret-browsing-anchor-followed.html: Added.
     12
    1132011-06-03  Dominic Cooney  <dominicc@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r88002 r88004  
     12011-06-03  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        Focus and caret position should be updated when same-page links are followed
     6        https://bugs.webkit.org/show_bug.cgi?id=59737
     7
     8        Update the caret position to the anchor's position after scrolling.
     9
     10        This behavior is specific to the Gtk port and requested because of
     11        accessibility needs, that's why it's implemented in AXObjectCache.
     12
     13        Test: platform/gtk/accessibility/caret-browsing-anchor-followed.html
     14
     15        * accessibility/gtk/AXObjectCacheAtk.cpp:
     16        (WebCore::AXObjectCache::handleScrolledToAnchor): Make sure the
     17        caret is updated to be in the anchor's position after scrolling.
     18
    1192011-06-03  Dominic Cooney  <dominicc@chromium.org>
    220
  • trunk/Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp

    r86325 r88004  
    2424#include "AccessibilityObjectWrapperAtk.h"
    2525#include "Document.h"
     26#include "Frame.h"
     27#include "FrameSelection.h"
    2628#include "Element.h"
    2729#include "GOwnPtr.h"
    2830#include "Range.h"
    2931#include "SelectElement.h"
     32#include "TextAffinity.h"
    3033#include "TextIterator.h"
     34#include "htmlediting.h"
    3135
    3236namespace WebCore {
     
    206210}
    207211
    208 void AXObjectCache::handleScrolledToAnchor(const Node*)
    209 {
     212void AXObjectCache::handleScrolledToAnchor(const Node* node)
     213{
     214    // Make sure the caret position is set to the anchor position, so
     215    // further use of arrow keys work as expected.
     216    Document* document = node->document();
     217    if (!document)
     218        return;
     219
     220    Frame* frame = document->frame();
     221    if (!frame)
     222        return;
     223
     224    FrameSelection* selection = frame->selection();
     225    if (!selection)
     226        return;
     227
     228    selection->moveTo(firstPositionInOrBeforeNode(const_cast<Node*>(node)), DOWNSTREAM);
    210229}
    211230
Note: See TracChangeset for help on using the changeset viewer.