Changeset 196699 in webkit
- Timestamp:
- Feb 17, 2016 10:16:50 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r196697 r196699 1 2016-02-17 Nan Wang <n_wang@apple.com> 2 3 AX: Implement sentence related text marker functions using TextIterator 4 https://bugs.webkit.org/show_bug.cgi?id=154312 5 6 Reviewed by Chris Fleizach. 7 8 * accessibility/mac/text-marker-paragraph-nav-expected.txt: 9 * accessibility/mac/text-marker-paragraph-nav.html: 10 * accessibility/mac/text-marker-sentence-nav-expected.txt: Added. 11 * accessibility/mac/text-marker-sentence-nav.html: Added. 12 1 13 2016-02-17 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/LayoutTests/accessibility/mac/text-marker-paragraph-nav-expected.txt
r196546 r196699 11 11 text 12 12 this is my first paragraph. Of text. it has some text. 13 14 13 15 this is my second paragraph. Of text. it has some text. 14 16 this is my third paragraph. Of text. it has some text. … … 69 71 70 72 Paragraph: this is my first paragraph. Of text. it has some text. 73 Paragraph: 74 Paragraph: 71 75 Paragraph: this is my second paragraph. Of text. it has some text. 72 76 Paragraph: this is my third paragraph. Of text. it has some text. 73 77 Paragraph: this is my third paragraph. Of text. it has some text. 74 78 Paragraph: this is my second paragraph. Of text. it has some text. 79 Paragraph: 80 Paragraph: 75 81 Paragraph: this is my first paragraph. Of text. it has some text. 76 82 Test going forward. -
trunk/LayoutTests/accessibility/mac/text-marker-paragraph-nav.html
r196546 r196699 47 47 </div> 48 48 49 <div id="text9">this is my first paragraph. Of text. it has some text.<br> 49 <div id="text9">this is my first paragraph. Of text. it has some text.<br><br><br> 50 50 this is my second paragraph. Of text. it has some text.<br> 51 51 this is my third paragraph. Of text. it has some text.<br><br> … … 122 122 startMarker = text.nextTextMarker(startMarker); 123 123 var endMarker = text.endTextMarkerForTextMarkerRange(textMarkerRange); 124 verifyParagraphs(text, startMarker, 3);124 verifyParagraphs(text, startMarker, 5); 125 125 126 126 // Check the paragraph marker runs from start to end, and backwards. … … 161 161 162 162 function verifyParagraphs(obj, startMarker, paragraphCount) { 163 // Move to the end of first paragraph, so the first paragraph 164 // won't print twice. 165 var current = obj.nextParagraphEndTextMarkerForTextMarker(startMarker); 163 var current = startMarker; 166 164 var i = 0; 167 165 while(i < paragraphCount) { 166 current = obj.nextParagraphEndTextMarkerForTextMarker(current); 168 167 var currRange = obj.paragraphTextMarkerRangeForTextMarker(current); 169 168 var currParagraph = obj.stringForTextMarkerRange(currRange); 170 169 debug("Paragraph: " + currParagraph); 171 current = obj.nextParagraphEndTextMarkerForTextMarker(current);172 170 i++; 173 171 } 174 172 175 173 // Backwards. 176 current = obj.previousParagraphStartTextMarkerForTextMarker(current);177 174 i = 0; 178 175 while(i < paragraphCount) { 176 current = obj.previousParagraphStartTextMarkerForTextMarker(current); 179 177 var currRange = obj.paragraphTextMarkerRangeForTextMarker(current); 180 178 var currParagraph = obj.stringForTextMarkerRange(currRange); 181 179 debug("Paragraph: " + currParagraph); 182 current = obj.previousParagraphStartTextMarkerForTextMarker(current);183 180 i++; 184 181 } -
trunk/Source/WebCore/ChangeLog
r196691 r196699 1 2016-02-17 Nan Wang <n_wang@apple.com> 2 3 AX: Implement sentence related text marker functions using TextIterator 4 https://bugs.webkit.org/show_bug.cgi?id=154312 5 6 Reviewed by Chris Fleizach. 7 8 Using CharacterOffset to implement sentence related text marker calls. Reused 9 logic from VisibleUnits class. Also fixed an issue where paragraph navigation 10 should skip preceding and following BR nodes. 11 12 Test: accessibility/mac/text-marker-sentence-nav.html 13 14 * accessibility/AXObjectCache.cpp: 15 (WebCore::resetNodeAndOffsetForReplacedNode): 16 (WebCore::setRangeStartOrEndWithCharacterOffset): 17 (WebCore::AXObjectCache::characterOffsetForNodeAndOffset): 18 (WebCore::AXObjectCache::previousCharacterOffset): 19 (WebCore::AXObjectCache::startCharacterOffsetOfWord): 20 (WebCore::AXObjectCache::endCharacterOffsetOfWord): 21 (WebCore::AXObjectCache::previousWordStartCharacterOffset): 22 (WebCore::AXObjectCache::leftWordRange): 23 (WebCore::AXObjectCache::rightWordRange): 24 (WebCore::AXObjectCache::characterBefore): 25 (WebCore::characterOffsetNodeIsBR): 26 (WebCore::parentEditingBoundary): 27 (WebCore::AXObjectCache::nextBoundary): 28 (WebCore::AXObjectCache::previousBoundary): 29 (WebCore::AXObjectCache::paragraphForCharacterOffset): 30 (WebCore::AXObjectCache::nextParagraphEndCharacterOffset): 31 (WebCore::AXObjectCache::previousParagraphStartCharacterOffset): 32 (WebCore::AXObjectCache::startCharacterOffsetOfSentence): 33 (WebCore::AXObjectCache::endCharacterOffsetOfSentence): 34 (WebCore::AXObjectCache::sentenceForCharacterOffset): 35 (WebCore::AXObjectCache::nextSentenceEndCharacterOffset): 36 (WebCore::AXObjectCache::previousSentenceStartCharacterOffset): 37 (WebCore::AXObjectCache::rootAXEditableElement): 38 (WebCore::startWordBoundary): Deleted. 39 (WebCore::endWordBoundary): Deleted. 40 (WebCore::AXObjectCache::nextWordBoundary): Deleted. 41 (WebCore::AXObjectCache::previousWordBoundary): Deleted. 42 * accessibility/AXObjectCache.h: 43 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: 44 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): 45 * editing/VisibleUnits.cpp: 46 (WebCore::startWordBoundary): 47 (WebCore::startOfWord): 48 (WebCore::endWordBoundary): 49 (WebCore::startSentenceBoundary): 50 (WebCore::startOfSentence): 51 (WebCore::endSentenceBoundary): 52 * editing/VisibleUnits.h: 53 1 54 2016-02-17 Manuel Rego Casasnovas <rego@igalia.com> 2 55 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r196546 r196699 1610 1610 } 1611 1611 1612 static void setRangeStartOrEndWithCharacterOffset(RefPtr<Range> range, CharacterOffset& characterOffset, bool isStart, ExceptionCode& ec)1612 static void setRangeStartOrEndWithCharacterOffset(RefPtr<Range> range, const CharacterOffset& characterOffset, bool isStart, ExceptionCode& ec) 1613 1613 { 1614 1614 if (!range) { … … 1739 1739 } else 1740 1740 return CharacterOffset(); 1741 if ( !offset)1741 if (charOffset.offset == offset) 1742 1742 break; 1743 1743 } 1744 1744 if (offset > 0) 1745 charOffset = characterOffsetForNodeAndOffset(*charOffset.node, charOffset.offset - offset );1745 charOffset = characterOffsetForNodeAndOffset(*charOffset.node, charOffset.offset - offset, TraverseOptionIncludeStart); 1746 1746 return charOffset; 1747 1747 } … … 1920 1920 } 1921 1921 1922 static unsigned startWordBoundary(StringView text, unsigned offset, BoundarySearchContextAvailability mayHaveMoreContext, bool& needMoreContext)1923 {1924 ASSERT(offset);1925 if (mayHaveMoreContext && !startOfLastWordBoundaryContext(text.substring(0, offset))) {1926 needMoreContext = true;1927 return 0;1928 }1929 needMoreContext = false;1930 int start, end;1931 U16_BACK_1(text, 0, offset);1932 findWordBoundary(text, offset, &start, &end);1933 return start;1934 }1935 1936 static unsigned endWordBoundary(StringView text, unsigned offset, BoundarySearchContextAvailability mayHaveMoreContext, bool& needMoreContext)1937 {1938 ASSERT(offset <= text.length());1939 if (mayHaveMoreContext && endOfFirstWordBoundaryContext(text.substring(offset)) == text.length() - offset) {1940 needMoreContext = true;1941 return text.length();1942 }1943 needMoreContext = false;1944 int end;1945 findEndWordBoundary(text, offset, &end);1946 return end;1947 }1948 1949 1922 CharacterOffset AXObjectCache::startCharacterOffsetOfWord(const CharacterOffset& characterOffset, EWordSide side) 1950 1923 { … … 1963 1936 } 1964 1937 1965 return previous WordBoundary(c, startWordBoundary);1938 return previousBoundary(c, startWordBoundary); 1966 1939 } 1967 1940 … … 1982 1955 } 1983 1956 1984 return next WordBoundary(c, endWordBoundary);1957 return nextBoundary(c, endWordBoundary); 1985 1958 } 1986 1959 … … 2011 1984 RefPtr<Range> AXObjectCache::leftWordRange(const CharacterOffset& characterOffset) 2012 1985 { 2013 CharacterOffset start = previousWordStartCharacterOffset(characterOffset);1986 CharacterOffset start = startCharacterOffsetOfWord(characterOffset, LeftWordIfOnBoundary); 2014 1987 CharacterOffset end = endCharacterOffsetOfWord(start); 2015 1988 return rangeForUnorderedCharacterOffsets(start, end); … … 2019 1992 { 2020 1993 CharacterOffset start = startCharacterOffsetOfWord(characterOffset); 2021 CharacterOffset end = nextWordEndCharacterOffset(start);1994 CharacterOffset end = endCharacterOffsetOfWord(start); 2022 1995 return rangeForUnorderedCharacterOffsets(start, end); 2023 1996 } … … 2044 2017 return characterForCharacterOffset(characterOffset); 2045 2018 } 2019 2020 static bool characterOffsetNodeIsBR(const CharacterOffset& characterOffset) 2021 { 2022 if (characterOffset.isNull()) 2023 return false; 2024 2025 return characterOffset.node->hasTagName(brTag); 2026 } 2046 2027 2047 2028 static Node* parentEditingBoundary(Node* node) … … 2061 2042 } 2062 2043 2063 CharacterOffset AXObjectCache::next WordBoundary(CharacterOffset& characterOffset, BoundarySearchFunction searchFunction)2044 CharacterOffset AXObjectCache::nextBoundary(const CharacterOffset& characterOffset, BoundarySearchFunction searchFunction) 2064 2045 { 2065 2046 if (characterOffset.isNull()) … … 2093 2074 if (it.atEnd() && next == string.size()) 2094 2075 return end; 2076 2077 // The endSentenceBoundary function will include a line break at the end of the sentence. 2078 if (searchFunction == endSentenceBoundary && string[next - 1] == '\n') 2079 next--; 2080 2095 2081 if (next > prefixLength) 2096 2082 return characterOffsetForNodeAndOffset(*characterOffset.node, characterOffset.offset + next - prefixLength); … … 2099 2085 } 2100 2086 2101 CharacterOffset AXObjectCache::previous WordBoundary(CharacterOffset& characterOffset, BoundarySearchFunction searchFunction)2087 CharacterOffset AXObjectCache::previousBoundary(const CharacterOffset& characterOffset, BoundarySearchFunction searchFunction) 2102 2088 { 2103 2089 if (characterOffset.isNull()) … … 2142 2128 2143 2129 int characterCount = characterOffset.offset - (string.size() - suffixLength - next); 2130 // We don't want to go to the previous node if the node is at the start of a new line. 2131 if (characterCount < 0 && (characterOffsetNodeIsBR(characterOffset) || string[string.size() - 1] == '\n')) 2132 characterCount = 0; 2144 2133 return characterOffsetForNodeAndOffset(*characterOffset.node, characterCount, TraverseOptionIncludeStart); 2145 2134 } … … 2199 2188 { 2200 2189 CharacterOffset start = startCharacterOffsetOfParagraph(characterOffset); 2201 CharacterOffset end = endCharacterOffsetOfParagraph( characterOffset);2190 CharacterOffset end = endCharacterOffsetOfParagraph(start); 2202 2191 2203 2192 return rangeForUnorderedCharacterOffsets(start, end); … … 2207 2196 { 2208 2197 // make sure we move off of a paragraph end 2209 return endCharacterOffsetOfParagraph(nextCharacterOffset(characterOffset)); 2198 CharacterOffset next = nextCharacterOffset(characterOffset); 2199 2200 // We should skip the following BR node. 2201 if (characterOffsetNodeIsBR(next) && !characterOffsetNodeIsBR(characterOffset)) 2202 next = nextCharacterOffset(next); 2203 2204 return endCharacterOffsetOfParagraph(next); 2210 2205 } 2211 2206 … … 2213 2208 { 2214 2209 // make sure we move off of a paragraph start 2215 return startCharacterOffsetOfParagraph(previousCharacterOffset(characterOffset, false)); 2210 CharacterOffset previous = previousCharacterOffset(characterOffset, false); 2211 2212 // We should skip the preceding BR node. 2213 if (characterOffsetNodeIsBR(previous) && !characterOffsetNodeIsBR(characterOffset)) 2214 previous = previousCharacterOffset(previous, false); 2215 2216 return startCharacterOffsetOfParagraph(previous); 2217 } 2218 2219 CharacterOffset AXObjectCache::startCharacterOffsetOfSentence(const CharacterOffset& characterOffset) 2220 { 2221 return previousBoundary(characterOffset, startSentenceBoundary); 2222 } 2223 2224 CharacterOffset AXObjectCache::endCharacterOffsetOfSentence(const CharacterOffset& characterOffset) 2225 { 2226 return nextBoundary(characterOffset, endSentenceBoundary); 2227 } 2228 2229 RefPtr<Range> AXObjectCache::sentenceForCharacterOffset(const CharacterOffset& characterOffset) 2230 { 2231 CharacterOffset start = startCharacterOffsetOfSentence(characterOffset); 2232 CharacterOffset end = endCharacterOffsetOfSentence(start); 2233 return rangeForUnorderedCharacterOffsets(start, end); 2234 } 2235 2236 CharacterOffset AXObjectCache::nextSentenceEndCharacterOffset(const CharacterOffset& characterOffset) 2237 { 2238 // Make sure we move off of a sentence end. 2239 return endCharacterOffsetOfSentence(nextCharacterOffset(characterOffset)); 2240 } 2241 2242 CharacterOffset AXObjectCache::previousSentenceStartCharacterOffset(const CharacterOffset& characterOffset) 2243 { 2244 // Make sure we move off of a sentence start. 2245 CharacterOffset previous = previousCharacterOffset(characterOffset, false); 2246 2247 // We should skip the preceding BR node. 2248 if (!previous.isNull() && previous.node->hasTagName(brTag) && !characterOffset.node->hasTagName(brTag)) 2249 previous = previousCharacterOffset(previous, false); 2250 2251 return startCharacterOffsetOfSentence(previous); 2216 2252 } 2217 2253 -
trunk/Source/WebCore/accessibility/AXObjectCache.h
r196546 r196699 215 215 CharacterOffset nextParagraphEndCharacterOffset(const CharacterOffset&); 216 216 CharacterOffset previousParagraphStartCharacterOffset(const CharacterOffset&); 217 218 // Sentence 219 RefPtr<Range> sentenceForCharacterOffset(const CharacterOffset&); 220 CharacterOffset nextSentenceEndCharacterOffset(const CharacterOffset&); 221 CharacterOffset previousSentenceStartCharacterOffset(const CharacterOffset&); 217 222 218 223 enum AXNotification { … … 318 323 CharacterOffset startOrEndCharacterOffsetForRange(RefPtr<Range>, bool); 319 324 CharacterOffset characterOffsetForNodeAndOffset(Node&, int, TraverseOption = TraverseOptionDefault); 320 CharacterOffset previous WordBoundary(CharacterOffset&, BoundarySearchFunction);321 CharacterOffset next WordBoundary(CharacterOffset&, BoundarySearchFunction);325 CharacterOffset previousBoundary(const CharacterOffset&, BoundarySearchFunction); 326 CharacterOffset nextBoundary(const CharacterOffset&, BoundarySearchFunction); 322 327 CharacterOffset startCharacterOffsetOfWord(const CharacterOffset&, EWordSide = RightWordIfOnBoundary); 323 328 CharacterOffset endCharacterOffsetOfWord(const CharacterOffset&, EWordSide = RightWordIfOnBoundary); 324 329 CharacterOffset startCharacterOffsetOfParagraph(const CharacterOffset&, EditingBoundaryCrossingRule = CannotCrossEditingBoundary); 325 330 CharacterOffset endCharacterOffsetOfParagraph(const CharacterOffset&, EditingBoundaryCrossingRule = CannotCrossEditingBoundary); 331 CharacterOffset startCharacterOffsetOfSentence(const CharacterOffset&); 332 CharacterOffset endCharacterOffsetOfSentence(const CharacterOffset&); 326 333 327 334 private: -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
r196546 r196699 4113 4113 4114 4114 if ([attribute isEqualToString:@"AXSentenceTextMarkerRangeForTextMarker"]) { 4115 VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)]; 4116 VisiblePositionRange vpRange = m_object->sentenceForPosition(visiblePos); 4117 return [self textMarkerRangeFromVisiblePositions:vpRange.start endPosition:vpRange.end]; 4115 AXObjectCache* cache = m_object->axObjectCache(); 4116 if (!cache) 4117 return nil; 4118 CharacterOffset characterOffset = [self characterOffsetForTextMarker:textMarker]; 4119 RefPtr<Range> range = cache->sentenceForCharacterOffset(characterOffset); 4120 return [self textMarkerRangeFromRange:range]; 4118 4121 } 4119 4122 … … 4156 4159 4157 4160 if ([attribute isEqualToString:@"AXNextSentenceEndTextMarkerForTextMarker"]) { 4158 VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)]; 4159 return [self textMarkerForVisiblePosition:m_object->nextSentenceEndPosition(visiblePos)]; 4161 AXObjectCache* cache = m_object->axObjectCache(); 4162 if (!cache) 4163 return nil; 4164 CharacterOffset characterOffset = [self characterOffsetForTextMarker:textMarker]; 4165 CharacterOffset nextEnd = cache->nextSentenceEndCharacterOffset(characterOffset); 4166 return [self textMarkerForCharacterOffset:nextEnd]; 4160 4167 } 4161 4168 4162 4169 if ([attribute isEqualToString:@"AXPreviousSentenceStartTextMarkerForTextMarker"]) { 4163 VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)]; 4164 return [self textMarkerForVisiblePosition:m_object->previousSentenceStartPosition(visiblePos)]; 4170 AXObjectCache* cache = m_object->axObjectCache(); 4171 if (!cache) 4172 return nil; 4173 CharacterOffset characterOffset = [self characterOffsetForTextMarker:textMarker]; 4174 CharacterOffset previousStart = cache->previousSentenceStartCharacterOffset(characterOffset); 4175 return [self textMarkerForCharacterOffset:previousStart]; 4165 4176 } 4166 4177 4167 4178 if ([attribute isEqualToString:@"AXNextParagraphEndTextMarkerForTextMarker"]) { 4168 VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)]; 4169 return [self textMarkerForVisiblePosition:m_object->nextParagraphEndPosition(visiblePos)]; 4179 AXObjectCache* cache = m_object->axObjectCache(); 4180 if (!cache) 4181 return nil; 4182 CharacterOffset characterOffset = [self characterOffsetForTextMarker:textMarker]; 4183 CharacterOffset nextEnd = cache->nextParagraphEndCharacterOffset(characterOffset); 4184 return [self textMarkerForCharacterOffset:nextEnd]; 4170 4185 } 4171 4186 -
trunk/Source/WebCore/editing/VisibleUnits.cpp
r196546 r196699 659 659 // --------- 660 660 661 staticunsigned startWordBoundary(StringView text, unsigned offset, BoundarySearchContextAvailability mayHaveMoreContext, bool& needMoreContext)661 unsigned startWordBoundary(StringView text, unsigned offset, BoundarySearchContextAvailability mayHaveMoreContext, bool& needMoreContext) 662 662 { 663 663 ASSERT(offset); … … 690 690 } 691 691 692 staticunsigned endWordBoundary(StringView text, unsigned offset, BoundarySearchContextAvailability mayHaveMoreContext, bool& needMoreContext)692 unsigned endWordBoundary(StringView text, unsigned offset, BoundarySearchContextAvailability mayHaveMoreContext, bool& needMoreContext) 693 693 { 694 694 ASSERT(offset <= text.length()); … … 1097 1097 // --------- 1098 1098 1099 staticunsigned startSentenceBoundary(StringView text, unsigned, BoundarySearchContextAvailability, bool&)1099 unsigned startSentenceBoundary(StringView text, unsigned, BoundarySearchContextAvailability, bool&) 1100 1100 { 1101 1101 // FIXME: The following function can return -1; we don't handle that. … … 1108 1108 } 1109 1109 1110 staticunsigned endSentenceBoundary(StringView text, unsigned, BoundarySearchContextAvailability, bool&)1110 unsigned endSentenceBoundary(StringView text, unsigned, BoundarySearchContextAvailability, bool&) 1111 1111 { 1112 1112 return textBreakNext(sentenceBreakIterator(text)); -
trunk/Source/WebCore/editing/VisibleUnits.h
r196546 r196699 113 113 enum BoundarySearchContextAvailability { DontHaveMoreContext, MayHaveMoreContext }; 114 114 typedef unsigned (*BoundarySearchFunction)(StringView, unsigned offset, BoundarySearchContextAvailability, bool& needMoreContext); 115 unsigned startWordBoundary(StringView, unsigned, BoundarySearchContextAvailability, bool&); 116 unsigned endWordBoundary(StringView, unsigned, BoundarySearchContextAvailability, bool&); 117 unsigned startSentenceBoundary(StringView, unsigned, BoundarySearchContextAvailability, bool&); 118 unsigned endSentenceBoundary(StringView, unsigned, BoundarySearchContextAvailability, bool&); 115 119 unsigned suffixLengthForRange(RefPtr<Range>, Vector<UChar, 1024>&); 116 120 unsigned prefixLengthForRange(RefPtr<Range>, Vector<UChar, 1024>&); -
trunk/Tools/ChangeLog
r196622 r196699 1 2016-02-17 Nan Wang <n_wang@apple.com> 2 3 AX: Implement sentence related text marker functions using TextIterator 4 https://bugs.webkit.org/show_bug.cgi?id=154312 5 6 Reviewed by Chris Fleizach. 7 8 * DumpRenderTree/AccessibilityUIElement.cpp: 9 (nextParagraphEndTextMarkerForTextMarkerCallback): 10 (sentenceTextMarkerRangeForTextMarkerCallback): 11 (previousSentenceStartTextMarkerForTextMarkerCallback): 12 (nextSentenceEndTextMarkerForTextMarkerCallback): 13 (setSelectedVisibleTextRangeCallback): 14 (AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker): 15 (AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker): 16 (AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker): 17 (AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker): 18 (AccessibilityUIElement::getJSClass): 19 * DumpRenderTree/AccessibilityUIElement.h: 20 * DumpRenderTree/ios/AccessibilityUIElementIOS.mm: 21 (AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker): 22 (AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker): 23 (AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker): 24 (AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker): 25 * DumpRenderTree/mac/AccessibilityUIElementMac.mm: 26 (AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker): 27 (AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker): 28 (AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker): 29 (AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker): 30 (AccessibilityUIElement::supportedActions): 31 * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: 32 (WTR::AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker): 33 (WTR::AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker): 34 (WTR::AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker): 35 (WTR::AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker): 36 (WTR::AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker): 37 (WTR::AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker): 38 * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: 39 * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: 40 * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: 41 (WTR::AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker): 42 (WTR::AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker): 43 (WTR::AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker): 44 (WTR::AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker): 45 (WTR::AccessibilityUIElement::mathPostscriptsDescription): 46 * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: 47 (WTR::AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker): 48 (WTR::AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker): 49 (WTR::AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker): 50 (WTR::AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker): 51 (WTR::_convertMathMultiscriptPairsToString): 52 1 53 2016-02-15 Brent Fulgham <bfulgham@apple.com> 2 54 -
trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp
r196546 r196699 1038 1038 } 1039 1039 1040 static JSValueRef sentenceTextMarkerRangeForTextMarkerCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 1041 { 1042 AccessibilityTextMarker* marker = nullptr; 1043 if (argumentCount == 1) 1044 marker = toTextMarker(JSValueToObject(context, arguments[0], exception)); 1045 1046 return AccessibilityTextMarkerRange::makeJSAccessibilityTextMarkerRange(context, toAXElement(thisObject)->sentenceTextMarkerRangeForTextMarker(marker)); 1047 } 1048 1049 static JSValueRef previousSentenceStartTextMarkerForTextMarkerCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 1050 { 1051 AccessibilityTextMarker* marker = nullptr; 1052 if (argumentCount == 1) 1053 marker = toTextMarker(JSValueToObject(context, arguments[0], exception)); 1054 1055 return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->previousSentenceStartTextMarkerForTextMarker(marker)); 1056 } 1057 1058 static JSValueRef nextSentenceEndTextMarkerForTextMarkerCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 1059 { 1060 AccessibilityTextMarker* marker = nullptr; 1061 if (argumentCount == 1) 1062 marker = toTextMarker(JSValueToObject(context, arguments[0], exception)); 1063 1064 return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->nextSentenceEndTextMarkerForTextMarker(marker)); 1065 } 1066 1040 1067 static JSValueRef setSelectedVisibleTextRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 1041 1068 { … … 1659 1686 1660 1687 AccessibilityTextMarker AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker(AccessibilityTextMarker*) 1688 { 1689 return nullptr; 1690 } 1691 1692 AccessibilityTextMarkerRange AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker(AccessibilityTextMarker*) 1693 { 1694 return nullptr; 1695 } 1696 1697 AccessibilityTextMarker AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker*) 1698 { 1699 return nullptr; 1700 } 1701 1702 AccessibilityTextMarker AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker*) 1661 1703 { 1662 1704 return nullptr; … … 1850 1892 { "previousParagraphStartTextMarkerForTextMarker", previousParagraphStartTextMarkerForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1851 1893 { "nextParagraphEndTextMarkerForTextMarker", nextParagraphEndTextMarkerForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1894 { "sentenceTextMarkerRangeForTextMarker", sentenceTextMarkerRangeForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1895 { "previousSentenceStartTextMarkerForTextMarker", previousSentenceStartTextMarkerForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1896 { "nextSentenceEndTextMarkerForTextMarker", nextSentenceEndTextMarkerForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1852 1897 { "setSelectedChild", setSelectedChildCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1853 1898 { "setSelectedChildAtIndex", setSelectedChildAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/Tools/DumpRenderTree/AccessibilityUIElement.h
r196546 r196699 268 268 AccessibilityTextMarker previousParagraphStartTextMarkerForTextMarker(AccessibilityTextMarker*); 269 269 AccessibilityTextMarker nextParagraphEndTextMarkerForTextMarker(AccessibilityTextMarker*); 270 AccessibilityTextMarkerRange sentenceTextMarkerRangeForTextMarker(AccessibilityTextMarker*); 271 AccessibilityTextMarker previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker*); 272 AccessibilityTextMarker nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker*); 270 273 AccessibilityTextMarkerRange selectedTextMarkerRange(); 271 274 void resetSelectedTextMarkerRange(); -
trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
r196546 r196699 586 586 } 587 587 588 AccessibilityTextMarkerRange AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker(AccessibilityTextMarker*) 589 { 590 return nullptr; 591 } 592 593 AccessibilityTextMarker AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker*) 594 { 595 return nullptr; 596 } 597 598 AccessibilityTextMarker AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker*) 599 { 600 return nullptr; 601 } 602 588 603 #endif // SUPPORTS_AX_TEXTMARKERS && PLATFORM(IOS) 589 604 -
trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
r196546 r196699 1917 1917 } 1918 1918 1919 AccessibilityTextMarkerRange AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker) 1920 { 1921 BEGIN_AX_OBJC_EXCEPTIONS 1922 id textMarkerRange = [m_element accessibilityAttributeValue:@"AXSentenceTextMarkerRangeForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; 1923 return AccessibilityTextMarkerRange(textMarkerRange); 1924 END_AX_OBJC_EXCEPTIONS 1925 1926 return nullptr; 1927 } 1928 1929 AccessibilityTextMarker AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker* textMarker) 1930 { 1931 BEGIN_AX_OBJC_EXCEPTIONS 1932 id previousTextMarker = [m_element accessibilityAttributeValue:@"AXPreviousSentenceStartTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; 1933 return AccessibilityTextMarker(previousTextMarker); 1934 END_AX_OBJC_EXCEPTIONS 1935 1936 return nullptr; 1937 } 1938 1939 AccessibilityTextMarker AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker* textMarker) 1940 { 1941 BEGIN_AX_OBJC_EXCEPTIONS 1942 id nextTextMarker = [m_element accessibilityAttributeValue:@"AXNextSentenceEndTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; 1943 return AccessibilityTextMarker(nextTextMarker); 1944 END_AX_OBJC_EXCEPTIONS 1945 1946 return nullptr; 1947 } 1948 1919 1949 #endif // SUPPORTS_AX_TEXTMARKERS && PLATFORM(MAC) 1920 1950 -
trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp
r196546 r196699 253 253 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker(AccessibilityTextMarker*) { return nullptr; } 254 254 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker(AccessibilityTextMarker*) { return nullptr; } 255 PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker(AccessibilityTextMarker*) { return nullptr; } 256 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker*) { return nullptr; } 257 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker*) { return nullptr; } 255 258 #endif 256 259 -
trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
r196546 r196699 259 259 PassRefPtr<AccessibilityTextMarker> nextParagraphEndTextMarkerForTextMarker(AccessibilityTextMarker*); 260 260 PassRefPtr<AccessibilityTextMarker> previousParagraphStartTextMarkerForTextMarker(AccessibilityTextMarker*); 261 PassRefPtr<AccessibilityTextMarkerRange> sentenceTextMarkerRangeForTextMarker(AccessibilityTextMarker*); 262 PassRefPtr<AccessibilityTextMarker> nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker*); 263 PassRefPtr<AccessibilityTextMarker> previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker*); 261 264 262 265 // Returns an ordered list of supported actions for an element. -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
r196546 r196699 209 209 AccessibilityTextMarker previousParagraphStartTextMarkerForTextMarker(AccessibilityTextMarker textMarker); 210 210 AccessibilityTextMarker nextParagraphEndTextMarkerForTextMarker(AccessibilityTextMarker textMarker); 211 AccessibilityTextMarkerRange sentenceTextMarkerRangeForTextMarker(AccessibilityTextMarker textMarker); 212 AccessibilityTextMarker previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker textMarker); 213 AccessibilityTextMarker nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker textMarker); 211 214 212 215 // Returns an ordered list of supported actions for an element. -
trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
r196546 r196699 1132 1132 } 1133 1133 1134 PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker) 1135 { 1136 return nullptr; 1137 } 1138 1139 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker* textMarker) 1140 { 1141 return nullptr; 1142 } 1143 1144 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker* textMarker) 1145 { 1146 return nullptr; 1147 } 1148 1134 1149 JSRetainPtr<JSStringRef> AccessibilityUIElement::mathPostscriptsDescription() const 1135 1150 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm
r196546 r196699 1944 1944 } 1945 1945 1946 PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker) 1947 { 1948 BEGIN_AX_OBJC_EXCEPTIONS 1949 id textMarkerRange = [m_element accessibilityAttributeValue:@"AXSentenceTextMarkerRangeForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; 1950 return AccessibilityTextMarkerRange::create(textMarkerRange); 1951 END_AX_OBJC_EXCEPTIONS 1952 1953 return nullptr; 1954 } 1955 1956 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker* textMarker) 1957 { 1958 BEGIN_AX_OBJC_EXCEPTIONS 1959 id previousParagraphStartMarker = [m_element accessibilityAttributeValue:@"AXPreviousSentenceStartTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; 1960 return AccessibilityTextMarker::create(previousParagraphStartMarker); 1961 END_AX_OBJC_EXCEPTIONS 1962 1963 return nullptr; 1964 } 1965 1966 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker* textMarker) 1967 { 1968 BEGIN_AX_OBJC_EXCEPTIONS 1969 id nextParagraphEndMarker = [m_element accessibilityAttributeValue:@"AXNextSentenceEndTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; 1970 return AccessibilityTextMarker::create(nextParagraphEndMarker); 1971 END_AX_OBJC_EXCEPTIONS 1972 1973 return nullptr; 1974 } 1975 1946 1976 static NSString *_convertMathMultiscriptPairsToString(NSArray *pairs) 1947 1977 {
Note: See TracChangeset
for help on using the changeset viewer.