Changeset 201443 in webkit
- Timestamp:
- May 26, 2016 6:41:18 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r201439 r201443 1 2016-05-26 Nan Wang <n_wang@apple.com> 2 3 AX: Wrong CharacterOffset from VisiblePosition with composed characters 4 https://bugs.webkit.org/show_bug.cgi?id=158138 5 6 Reviewed by Chris Fleizach. 7 8 * accessibility/mac/character-offset-visible-position-conversion-with-emoji-expected.txt: Added. 9 * accessibility/mac/character-offset-visible-position-conversion-with-emoji.html: Added. 10 1 11 2016-05-26 Brent Fulgham <bfulgham@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r201441 r201443 1 2016-05-26 Nan Wang <n_wang@apple.com> 2 3 AX: Wrong CharacterOffset from VisiblePosition with composed characters 4 https://bugs.webkit.org/show_bug.cgi?id=158138 5 6 Reviewed by Chris Fleizach. 7 8 The conversion logic is not correct when the text node contains composed characters. 9 We should use VisiblePosition's offset directly for text nodes so we won't mess things up. 10 11 Test: accessibility/mac/character-offset-visible-position-conversion-with-emoji.html 12 13 * accessibility/AXObjectCache.cpp: 14 (WebCore::AXObjectCache::visiblePositionFromCharacterOffset): 15 (WebCore::AXObjectCache::characterOffsetFromVisiblePosition): 16 1 17 2016-05-26 Darin Adler <darin@apple.com> 2 18 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r200922 r201443 1953 1953 return VisiblePosition(); 1954 1954 1955 RefPtr<AccessibilityObject> obj = this->getOrCreate(characterOffset.node); 1956 if (!obj) 1957 return VisiblePosition(); 1958 1959 // nextVisiblePosition means advancing one character. Use this to calculate the character offset. 1960 VisiblePositionRange vpRange = obj->visiblePositionRange(); 1961 VisiblePosition start = vpRange.start; 1962 1963 // Sometimes vpRange.start will be the previous node's end position and VisiblePosition will count the leading line break as 1 offset. 1964 int characterCount = start.deepEquivalent().deprecatedNode() == characterOffset.node ? characterOffset.offset : characterOffset.offset + characterOffset.startIndex; 1965 VisiblePosition result = start; 1966 for (int i = 0; i < characterCount; i++) 1967 result = obj->nextVisiblePosition(result); 1968 1969 return result; 1955 // Create a collapsed range and use that to form a VisiblePosition, so that the case with 1956 // composed characters will be covered. 1957 RefPtr<Range> range = rangeForUnorderedCharacterOffsets(characterOffset, characterOffset); 1958 return VisiblePosition(range->startPosition()); 1970 1959 } 1971 1960 … … 1978 1967 Node* domNode = deepPos.deprecatedNode(); 1979 1968 ASSERT(domNode); 1969 1970 if (domNode->offsetInCharacters()) 1971 return CharacterOffset(domNode, 0, deepPos.deprecatedEditingOffset(), 0); 1980 1972 1981 1973 RefPtr<AccessibilityObject> obj = this->getOrCreate(domNode);
Note: See TracChangeset
for help on using the changeset viewer.