Changeset 219424 in webkit


Ignore:
Timestamp:
Jul 12, 2017 1:57:43 PM (7 years ago)
Author:
Matt Lewis
Message:

Unreviewed, rolling out r219409.

The revision caused the Windows builds to fail.

Reverted changeset:

"AX: [iOS] Implement a way to retrieve a text marker range
with desired text that is closest to a position"
https://bugs.webkit.org/show_bug.cgi?id=174393
http://trac.webkit.org/changeset/219409

Location:
trunk
Files:
2 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r219421 r219424  
     12017-07-12  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r219409.
     4
     5        The revision caused the Windows builds to fail.
     6
     7        Reverted changeset:
     8
     9        "AX: [iOS] Implement a way to retrieve a text marker range
     10        with desired text that is closest to a position"
     11        https://bugs.webkit.org/show_bug.cgi?id=174393
     12        http://trac.webkit.org/changeset/219409
     13
    1142017-07-12  Commit Queue  <commit-queue@webkit.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r219422 r219424  
     12017-07-12  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r219409.
     4
     5        The revision caused the Windows builds to fail.
     6
     7        Reverted changeset:
     8
     9        "AX: [iOS] Implement a way to retrieve a text marker range
     10        with desired text that is closest to a position"
     11        https://bugs.webkit.org/show_bug.cgi?id=174393
     12        http://trac.webkit.org/changeset/219409
     13
    1142017-07-12  Alicia Boya García  <aboya@igalia.com>
    215
  • trunk/Source/WebCore/accessibility/AXObjectCache.cpp

    r219409 r219424  
    17271727    return WTFMove(range);
    17281728}
    1729    
    1730 static VisiblePosition visiblePositionForPositionWithOffset(const VisiblePosition& position, int32_t offset)
    1731 {
    1732     RefPtr<ContainerNode> root;
    1733     unsigned startIndex = indexForVisiblePosition(position, root);
    1734     return visiblePositionForIndex(startIndex + offset, root.get());
    1735 }
    1736    
    1737 RefPtr<Range> AXObjectCache::rangeMatchesTextNearRange(RefPtr<Range> originalRange, const String& matchText)
    1738 {
    1739     if (!originalRange)
    1740         return nullptr;
    1741    
    1742     // Create a large enough range for searching the text within.
    1743     unsigned textLength = matchText.length();
    1744     auto startPosition = visiblePositionForPositionWithOffset(originalRange->startPosition(), -textLength);
    1745     auto endPosition = visiblePositionForPositionWithOffset(originalRange->startPosition(), 2 * textLength);
    1746    
    1747     if (startPosition.isNull())
    1748         startPosition = firstPositionInOrBeforeNode(&originalRange->startContainer());
    1749     if (endPosition.isNull())
    1750         endPosition = lastPositionInOrAfterNode(&originalRange->endContainer());
    1751    
    1752     RefPtr<Range> searchRange = Range::create(m_document, startPosition, endPosition);
    1753     if (!searchRange || searchRange->collapsed())
    1754         return nullptr;
    1755    
    1756     RefPtr<Range> range = Range::create(m_document, startPosition, originalRange->startPosition());
    1757     unsigned targetOffset = TextIterator::rangeLength(range.get(), true);
    1758     return findClosestPlainText(*searchRange.get(), matchText, 0, targetOffset);
    1759 }
    17601729
    17611730static bool isReplacedNodeOrBR(Node* node)
  • trunk/Source/WebCore/accessibility/AXObjectCache.h

    r219409 r219424  
    333333    void deferTextChangedIfNeeded(Node*);
    334334    void performDeferredCacheUpdate();
    335    
    336     RefPtr<Range> rangeMatchesTextNearRange(RefPtr<Range>, const String&);
    337    
    338335
    339336protected:
  • trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

    r219409 r219424  
    5353#import "SVGNames.h"
    5454#import "SVGElement.h"
    55 #import "SelectionRect.h"
    5655#import "TextIterator.h"
    5756#import "WAKScrollView.h"
     
    25902589}
    25912590
    2592 - (RefPtr<Range>)rangeFromMarkers:(NSArray *)markers withText:(NSString *)text
    2593 {
    2594     RefPtr<Range> originalRange = [self rangeForTextMarkers:markers];
    2595     if (!originalRange)
    2596         return nil;
    2597    
    2598     AXObjectCache* cache = m_object->axObjectCache();
    2599     if (!cache)
    2600         return nil;
    2601    
    2602     return cache->rangeMatchesTextNearRange(originalRange, text);
    2603 }
    2604 
    2605 // This is only used in the layout test.
    2606 - (NSArray *)textMarkerRangeFromMarkers:(NSArray *)markers withText:(NSString *)text
    2607 {
    2608     return [self textMarkersForRange:[self rangeFromMarkers:markers withText:text]];
    2609 }
    2610 
    2611 - (NSArray *)textRectsFromMarkers:(NSArray *)markers withText:(NSString *)text
    2612 {
    2613     if (![self _prepareAccessibilityCall])
    2614         return nil;
    2615    
    2616     RefPtr<Range> range = [self rangeFromMarkers:markers withText:text];
    2617     if (!range || range->collapsed())
    2618         return nil;
    2619    
    2620     Vector<WebCore::SelectionRect> selectionRects;
    2621     range->collectSelectionRectsWithoutUnionInteriorLines(selectionRects);
    2622     return [self rectsForSelectionRects:selectionRects];
    2623 }
    2624 
    2625 - (NSArray *)rectsForSelectionRects:(const Vector<WebCore::SelectionRect>&)selectionRects
    2626 {
    2627     unsigned size = selectionRects.size();
    2628     if (!size)
    2629         return nil;
    2630    
    2631     NSMutableArray *rects = [NSMutableArray arrayWithCapacity:size];
    2632     for (unsigned i = 0; i < size; i++) {
    2633         const WebCore::SelectionRect& coreRect = selectionRects[i];
    2634         IntRect selectionRect = coreRect.rect();
    2635         CGRect rect = [self convertRectToScreenSpace:selectionRect];
    2636         [rects addObject:[NSValue valueWithRect:rect]];
    2637     }
    2638    
    2639     return rects;
    2640 }
    2641 
    26422591- (WebAccessibilityTextMarker *)textMarkerForPoint:(CGPoint)point
    26432592{
  • trunk/Tools/ChangeLog

    r219409 r219424  
     12017-07-12  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r219409.
     4
     5        The revision caused the Windows builds to fail.
     6
     7        Reverted changeset:
     8
     9        "AX: [iOS] Implement a way to retrieve a text marker range
     10        with desired text that is closest to a position"
     11        https://bugs.webkit.org/show_bug.cgi?id=174393
     12        http://trac.webkit.org/changeset/219409
     13
    1142017-07-12  Nan Wang  <n_wang@apple.com>
    215
  • trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp

    r219409 r219424  
    928928static JSValueRef textMarkerRangeForMarkersCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    929929{
    930     AccessibilityTextMarker* startMarker = nullptr;
    931     AccessibilityTextMarker* endMarker = nullptr;
     930    AccessibilityTextMarker* startMarker = 0;
     931    AccessibilityTextMarker* endMarker = 0;
    932932    if (argumentCount == 2) {
    933933        startMarker = toTextMarker(JSValueToObject(context, arguments[0], exception));
     
    14821482{
    14831483    return JSValueMakeBoolean(context, toAXElement(thisObject)->hasContainedByFieldsetTrait());
    1484 }
    1485 
    1486 static JSValueRef textMarkerRangeMatchesTextNearMarkersCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    1487 {
    1488     JSStringRef searchText = nullptr;
    1489     AccessibilityTextMarker* startMarker = nullptr;
    1490     AccessibilityTextMarker* endMarker = nullptr;
    1491     if (argumentCount == 3) {
    1492         searchText = JSValueToStringCopy(context, arguments[0], exception);
    1493         startMarker = toTextMarker(JSValueToObject(context, arguments[1], exception));
    1494         endMarker = toTextMarker(JSValueToObject(context, arguments[2], exception));
    1495     }
    1496    
    1497     JSValueRef result = AccessibilityTextMarkerRange::makeJSAccessibilityTextMarkerRange(context, toAXElement(thisObject)->textMarkerRangeMatchesTextNearMarkers(searchText, startMarker, endMarker));
    1498     if (searchText)
    1499         JSStringRelease(searchText);
    1500     return result;
    15011484}
    15021485
     
    17181701
    17191702AccessibilityTextMarker AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker*)
    1720 {
    1721     return nullptr;
    1722 }
    1723 
    1724 AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers(JSStringRef, AccessibilityTextMarker*, AccessibilityTextMarker*)
    17251703{
    17261704    return nullptr;
     
    19431921        { "assistiveTechnologySimulatedFocus", assistiveTechnologySimulatedFocusCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    19441922        { "fieldsetAncestorElement", fieldsetAncestorElementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    1945         { "textMarkerRangeMatchesTextNearMarkers", textMarkerRangeMatchesTextNearMarkersCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    19461923#endif
    19471924        { 0, 0, 0 }
  • trunk/Tools/DumpRenderTree/AccessibilityUIElement.h

    r219409 r219424  
    307307    bool isSearchField() const;
    308308   
    309     AccessibilityTextMarkerRange textMarkerRangeMatchesTextNearMarkers(JSStringRef, AccessibilityTextMarker*, AccessibilityTextMarker*);
    310    
    311309#endif // PLATFORM(IOS)
    312310
  • trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm

    r219409 r219424  
    114114- (id)lineStartMarkerForMarker:(id)marker;
    115115- (id)lineEndMarkerForMarker:(id)marker;
    116 - (NSArray *)textMarkerRangeFromMarkers:(NSArray *)markers withText:(NSString *)text;
    117116@end
    118117
     
    622621}
    623622
    624 AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers(JSStringRef text, AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
    625 {
    626     NSArray *textMarkers = nil;
    627     if (startMarker->platformTextMarker() && endMarker->platformTextMarker())
    628         textMarkers = [NSArray arrayWithObjects:(id)startMarker->platformTextMarker(), (id)endMarker->platformTextMarker(), nil];
    629     id textMarkerRange = [m_element textMarkerRangeFromMarkers:textMarkers withText:[NSString stringWithJSStringRef:text]];
    630     return AccessibilityTextMarkerRange(textMarkerRange);
    631 }
    632 
    633 
    634623#endif // SUPPORTS_AX_TEXTMARKERS && PLATFORM(IOS)
    635624
  • trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp

    r219409 r219424  
    7575bool AccessibilityUIElement::isSearchField() const { return false; }
    7676bool AccessibilityUIElement::isTextArea() const { return false; }
    77 RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers(JSStringRef, AccessibilityTextMarker*, AccessibilityTextMarker*) { return nullptr; }
     77
    7878#endif
    7979   
  • trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h

    r219409 r219424  
    290290    RefPtr<AccessibilityTextMarker> nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker*);
    291291    RefPtr<AccessibilityTextMarker> previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker*);
    292     RefPtr<AccessibilityTextMarkerRange> textMarkerRangeMatchesTextNearMarkers(JSStringRef, AccessibilityTextMarker*, AccessibilityTextMarker*);
    293292
    294293    // Returns an ordered list of supported actions for an element.
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl

    r219409 r219424  
    227227    AccessibilityTextMarker previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker textMarker);
    228228    AccessibilityTextMarker nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker textMarker);
    229     AccessibilityTextMarkerRange textMarkerRangeMatchesTextNearMarkers(DOMString text, AccessibilityTextMarker startMarker, AccessibilityTextMarker endMarker);
    230229
    231230    // Returns an ordered list of supported actions for an element.
  • trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm

    r219409 r219424  
    9292- (id)lineStartMarkerForMarker:(id)marker;
    9393- (id)lineEndMarkerForMarker:(id)marker;
    94 - (NSArray *)textMarkerRangeFromMarkers:(NSArray *)markers withText:(NSString *)text;
    9594@end
    9695
     
    12011200{
    12021201    return nullptr;
    1203 }
    1204    
    1205 RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers(JSStringRef text, AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
    1206 {
    1207     NSArray *textMarkers = nil;
    1208     if (startMarker->platformTextMarker() && endMarker->platformTextMarker())
    1209         textMarkers = [NSArray arrayWithObjects:(id)startMarker->platformTextMarker(), (id)endMarker->platformTextMarker(), nil];
    1210     id textMarkerRange = [m_element textMarkerRangeFromMarkers:textMarkers withText:[NSString stringWithJSStringRef:text]];
    1211     return AccessibilityTextMarkerRange::create(textMarkerRange);
    12121202}
    12131203
Note: See TracChangeset for help on using the changeset viewer.