Changeset 150653 in webkit
- Timestamp:
- May 24, 2013 12:41:37 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r150652 r150653 1 2013-05-24 Thomas Deniau <deniau@apple.com> 2 3 Add more lines to the context during Dictionary lookups 4 https://bugs.webkit.org/show_bug.cgi?id=115256 5 6 Reviewed by Ryosuke Niwa. 7 8 No new tests - no new functionality. 9 10 * WebCore.exp.in: Export a few methods in VisibleUnits needed to be able 11 to call previousLinePosition(), nextLinePosition(), startOfLine() and 12 endOfLine() in WebPageMac.mm when determining the context while looking 13 up a dictionary definition. These symbols used to be exported for iOS 14 only, export them on the desktop too. 15 1 16 2013-05-24 Anders Carlsson <andersca@apple.com> 2 17 -
trunk/Source/WebCore/WebCore.exp.in
r150633 r150653 169 169 __ZN7WebCore11iBeamCursorEv 170 170 __ZN7WebCore11memoryCacheEv 171 __ZN7WebCore11startOfLineERKNS_15VisiblePositionE 171 172 __ZN7WebCore11startOfWordERKNS_15VisiblePositionENS_9EWordSideE 172 173 __ZN7WebCore11writeToFileEiPKci … … 567 568 __ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE 568 569 __ZN7WebCore16isUserVisibleURLEP8NSString 570 __ZN7WebCore16nextLinePositionERKNS_15VisiblePositionEiNS_12EditableTypeE 569 571 __ZN7WebCore16scriptNameToCodeERKN3WTF6StringE 570 572 __ZN7WebCore16startOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE … … 687 689 __ZN7WebCore20deleteEmptyDirectoryERKN3WTF6StringE 688 690 __ZN7WebCore20makeRGBA32FromFloatsEffff 691 __ZN7WebCore20previousLinePositionERKNS_15VisiblePositionEiNS_12EditableTypeE 689 692 __ZN7WebCore20protocolIsJavaScriptERKN3WTF6StringE 690 693 __ZN7WebCore20toUInt32EnforceRangeEPN3JSC9ExecStateENS0_7JSValueE … … 1265 1268 __ZN7WebCore9TimerBaseD2Ev 1266 1269 __ZN7WebCore9closeFileERi 1270 __ZN7WebCore9endOfLineERKNS_15VisiblePositionE 1267 1271 __ZN7WebCore9endOfWordERKNS_15VisiblePositionENS_9EWordSideE 1268 1272 __ZN7WebCore9fontCacheEv … … 1450 1454 __ZNK7WebCore15VisiblePosition14localCaretRectERPNS_12RenderObjectE 1451 1455 __ZNK7WebCore15VisiblePosition19absoluteCaretBoundsEv 1456 __ZNK7WebCore15VisiblePosition45lineDirectionPointForBlockDirectionNavigationEv 1452 1457 __ZNK7WebCore15VisiblePosition4nextENS_27EditingBoundaryCrossingRuleE 1453 1458 __ZNK7WebCore15VisiblePosition8previousENS_27EditingBoundaryCrossingRuleE … … 1639 1644 __ZNK7WebCore8Position25leadingWhitespacePositionENS_9EAffinityEb 1640 1645 __ZNK7WebCore8Position26trailingWhitespacePositionENS_9EAffinityEb 1646 __ZNK7WebCore8Position28offsetForPositionAfterAnchorEv 1641 1647 __ZNK7WebCore8Position8upstreamENS_27EditingBoundaryCrossingRuleE 1642 1648 __ZNK7WebCore9DOMWindow27pendingUnloadEventListenersEv … … 2071 2077 __ZN7WebCore11MemoryCache20removeImageFromCacheERKNS_4KURLE 2072 2078 __ZN7WebCore11isEndOfLineERKNS_15VisiblePositionE 2073 __ZN7WebCore11startOfLineERKNS_15VisiblePositionE2074 2079 __ZN7WebCore12EventHandler10mouseMovedEP8WebEvent 2075 2080 __ZN7WebCore12EventHandler10wheelEventEP8WebEvent … … 2120 2125 __ZN7WebCore16VisibleSelectionC1Ev 2121 2126 __ZN7WebCore16jsStringWithCacheSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_10StringHashENS3_10HashTraitsIS6_EENSB_IS9_EEEES6_ 2122 __ZN7WebCore16nextLinePositionERKNS_15VisiblePositionEiNS_12EditableTypeE2123 2127 __ZN7WebCore16nextWordPositionERKNS_15VisiblePositionE 2124 2128 __ZN7WebCore17CredentialStorage16clearCredentialsEv … … 2135 2139 __ZN7WebCore20networkStateNotifierEv 2136 2140 __ZN7WebCore20nextSentencePositionERKNS_15VisiblePositionE 2137 __ZN7WebCore20previousLinePositionERKNS_15VisiblePositionEiNS_12EditableTypeE2138 2141 __ZN7WebCore20previousWordPositionERKNS_15VisiblePositionE 2139 2142 __ZN7WebCore21MemoryPressureHandler19clearMemoryPressureEv … … 2215 2218 __ZN7WebCore9TileCache14drainLayerPoolEv 2216 2219 __ZN7WebCore9TileCache20setLayerPoolCapacityEj 2217 __ZN7WebCore9endOfLineERKNS_15VisiblePositionE2218 2220 __ZNK7WebCore10FloatPointcv7CGPointEv 2219 2221 __ZNK7WebCore14FrameSelection17wordOffsetInRangeEPKNS_5RangeE … … 2229 2231 __ZNK7WebCore14FrameSelection36elementRangeContainingCaretSelectionEv 2230 2232 __ZNK7WebCore14SecurityOrigin8toStringEv 2231 __ZNK7WebCore15VisiblePosition45lineDirectionPointForBlockDirectionNavigationEv2232 2233 __ZNK7WebCore15VisiblePosition4leftEb 2233 2234 __ZNK7WebCore15VisiblePosition5rightEb … … 2257 2258 __ZNK7WebCore7IntSizecv6CGSizeEv 2258 2259 __ZNK7WebCore8Document31isTelephoneNumberParsingEnabledEv 2259 __ZNK7WebCore8Position28offsetForPositionAfterAnchorEv2260 2260 __ZNK7WebCore9FloatRectcv6CGRectEv 2261 2261 __ZNK7WebCore9FloatSizecv6CGSizeEv -
trunk/Source/WebKit2/ChangeLog
r150648 r150653 1 2013-05-24 Thomas Deniau <deniau@apple.com> 2 3 Add more lines to the context during Dictionary lookups 4 https://bugs.webkit.org/show_bug.cgi?id=115256 5 6 Reviewed by Ryosuke Niwa. 7 8 * WebProcess/WebPage/mac/WebPageMac.mm: 9 (WebKit::WebPage::performDictionaryLookupAtLocation): 10 Instead of using the current paragraph as the context (which stops at 11 line breaks), get a few lines before and after the point, so that the 12 context contains at least four lines in each direction. 13 This way the Dictionary will be able to look up things that extend past 14 the current line. 15 1 16 2013-05-24 Anders Carlsson <andersca@apple.com> 2 17 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
r150243 r150653 508 508 NSDictionary *options = nil; 509 509 510 // As context, we are going to use the surrounding paragraph of text. 511 VisiblePosition paragraphStart = startOfParagraph(position); 512 VisiblePosition paragraphEnd = endOfParagraph(position); 513 514 NSRange rangeToPass = NSMakeRange(TextIterator::rangeLength(makeRange(paragraphStart, position).get()), 0); 515 516 RefPtr<Range> fullCharacterRange = makeRange(paragraphStart, paragraphEnd); 510 // As context, we are going to use four lines of text before and after the point. (Dictionary can sometimes look up things that are four lines long) 511 const int numberOfLinesOfContext = 4; 512 VisiblePosition contextStart = position; 513 VisiblePosition contextEnd = position; 514 for (int i = 0; i < numberOfLinesOfContext; i++) { 515 VisiblePosition n = previousLinePosition(contextStart, contextStart.lineDirectionPointForBlockDirectionNavigation()); 516 if (n.isNull() || n == contextStart) 517 break; 518 contextStart = n; 519 } 520 for (int i = 0; i < numberOfLinesOfContext; i++) { 521 VisiblePosition n = nextLinePosition(contextEnd, contextEnd.lineDirectionPointForBlockDirectionNavigation()); 522 if (n.isNull() || n == contextEnd) 523 break; 524 contextEnd = n; 525 } 526 contextStart = startOfLine(contextStart); 527 contextEnd = endOfLine(contextEnd); 528 529 NSRange rangeToPass = NSMakeRange(TextIterator::rangeLength(makeRange(contextStart, position).get()), 0); 530 531 RefPtr<Range> fullCharacterRange = makeRange(contextStart, contextEnd); 517 532 String fullPlainTextString = plainText(fullCharacterRange.get()); 518 533
Note: See TracChangeset
for help on using the changeset viewer.