Changeset 44571 in webkit


Ignore:
Timestamp:
Jun 10, 2009 10:27:53 AM (15 years ago)
Author:
xan@webkit.org
Message:

2009-06-10 Xan Lopez <xlopez@igalia.com>

Reviewed by Gustavo Noronha.

https://bugs.webkit.org/show_bug.cgi?id=25671
[GTK] Implement support for set_caret_offset

Make an implementation that actually works.

  • accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: (webkit_accessible_text_set_caret_offset):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r44569 r44571  
     12009-06-10  Xan Lopez  <xlopez@igalia.com>
     2
     3        Reviewed by Gustavo Noronha.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=25671
     6        [GTK] Implement support for set_caret_offset
     7
     8        Make an implementation that actually works.
     9
     10        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
     11        (webkit_accessible_text_set_caret_offset):
     12
    1132009-06-10  Darin Fisher  <darin@chromium.org>
    214
  • trunk/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

    r44567 r44571  
    653653static gboolean webkit_accessible_text_set_caret_offset(AtkText* text, gint offset)
    654654{
    655     // TODO: Verify
    656     //core(text)->setSelectedTextRange(PlainTextRange(offset, 0));
    657655    AccessibilityObject* coreObject = core(text);
    658     coreObject->setSelectedVisiblePositionRange(coreObject->visiblePositionRangeForRange(PlainTextRange(offset, 0)));
     656
     657    // FIXME: We need to reimplement visiblePositionRangeForRange here
     658    // because the actual function checks the offset is within the
     659    // boundaries of text().length(), but text() only works for text
     660    // controls...
     661    VisiblePosition startPosition = coreObject->visiblePositionForIndex(offset);
     662    startPosition.setAffinity(DOWNSTREAM);
     663    VisiblePosition endPosition = coreObject->visiblePositionForIndex(offset);
     664    VisiblePositionRange range = VisiblePositionRange(startPosition, endPosition);
     665
     666    coreObject->setSelectedVisiblePositionRange(range);
    659667    return TRUE;
    660668}
Note: See TracChangeset for help on using the changeset viewer.