Changeset 37611 in webkit
- Timestamp:
- Oct 15, 2008 1:32:43 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r37610 r37611 1 2008-10-14 Maxime Britto <britto@apple.com> 2 3 Reviewed by Darin Adler, tweaked and landed by Beth. 4 5 * WebCore.base.exp: Exposes two functions to be able to create a 6 selection from a point on the screen. Also exposes the new 7 TextIterator::currentNode function. 8 * WebCore/editing/TextIterator.cpp: 9 (TextIterator::currentNode) : New function that returns the current 10 text node or NULL if there is no text node. 11 1 12 2008-10-15 Marco Barisione <marco.barisione@collabora.co.uk> 2 13 -
trunk/WebCore/WebCore.base.exp
r37511 r37611 131 131 __ZN7WebCore10EventNames12keydownEventE 132 132 __ZN7WebCore10MouseEventC1ERKNS_12AtomicStringEbbN3WTF10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_15EventTargetNodeEEENS5_INS_9ClipboardEEEb 133 __ZN7WebCore10ScrollView17setScrollbarModesENS_13ScrollbarModeES1_ 134 __ZN7WebCore10ScrollView20setCanHaveScrollbarsEb 133 135 __ZN7WebCore10StringImpl7replaceEtt 134 136 __ZN7WebCore10StringImplD1Ev … … 468 470 __ZN7WebCore5Frame20setSelectionFromNoneEv 469 471 __ZN7WebCore5Frame21markAllMatchesForTextERKNS_6StringEbj 472 __ZN7WebCore5Frame23visiblePositionForPointERKNS_8IntPointE 470 473 __ZN7WebCore5Frame24computeAndSetTypingStyleEPNS_19CSSStyleDeclarationENS_10EditActionE 471 474 __ZN7WebCore5Frame24setExcludeFromTextSearchEb … … 532 535 __ZN7WebCore6StringC1EPKcj 533 536 __ZN7WebCore6StringC1ERKN3JSC7UStringE 537 __ZN7WebCore6Widget12setFrameRectERKNS_7IntRectE 534 538 __ZN7WebCore6Widget16removeFromParentEv 535 __ZN7WebCore6Widget12setFrameRectERKNS_7IntRectE536 539 __ZN7WebCore6Widget20retainPlatformWidgetEv 537 540 __ZN7WebCore6Widget21releasePlatformWidgetEv … … 613 616 __ZN7WebCore9FrameView18updateControlTintsEv 614 617 __ZN7WebCore9FrameView22setBaseBackgroundColorENS_5ColorE 618 __ZN7WebCore9FrameView23layoutIfNeededRecursiveEv 615 619 __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb 616 620 __ZN7WebCore9FrameViewC1EPNS_5FrameE 617 __ZN7WebCore9HTMLNames8frameTagE 618 __ZN7WebCore9HTMLNames9iframeTagE 621 __ZN7WebCore9FrameViewC1EPNS_5FrameERKNS_7IntSizeE 619 622 __ZN7WebCore9HTMLNames10listingTagE 620 623 __ZN7WebCore9HTMLNames13blockquoteTagE … … 644 647 __ZN7WebCore9HTMLNames7formTagE 645 648 __ZN7WebCore9HTMLNames7srcAttrE 649 __ZN7WebCore9HTMLNames8frameTagE 646 650 __ZN7WebCore9HTMLNames8hrefAttrE 647 651 __ZN7WebCore9HTMLNames8inputTagE 652 __ZN7WebCore9HTMLNames9iframeTagE 648 653 __ZN7WebCore9PageCache11setCapacityEi 649 654 __ZN7WebCore9PageCache27releaseAutoreleasedPagesNowEv … … 654 659 __ZN7WebCore9Selection22expandUsingGranularityENS_15TextGranularityE 655 660 __ZN7WebCore9SelectionC1EPKNS_5RangeENS_9EAffinityE 661 __ZN7WebCore9SelectionC1ERKNS_15VisiblePositionES3_ 656 662 __ZN7WebCore9TimerBase4stopEv 657 663 __ZN7WebCore9TimerBase5startEdd … … 665 671 __ZNK7WebCore10PluginData16supportsMimeTypeERKNS_6StringE 666 672 __ZNK7WebCore10ScrollView12documentViewEv 667 __ZN7WebCore10ScrollView17setScrollbarModesENS_13ScrollbarModeES1_668 __ZN7WebCore10ScrollView20setCanHaveScrollbarsEb669 673 __ZNK7WebCore10ScrollView14scrollbarModesERNS_13ScrollbarModeES2_ 670 674 __ZNK7WebCore11CachedImage5imageEv … … 711 715 __ZNK7WebCore12SharedBuffer4sizeEv 712 716 __ZNK7WebCore12TextEncoding6decodeEPKcmbRb 717 __ZNK7WebCore12TextIterator4nodeEv 713 718 __ZNK7WebCore12TextIterator5rangeEv 719 __ZNK7WebCore13ContainerNode14childNodeCountEv 720 __ZNK7WebCore13ContainerNode9childNodeEj 714 721 __ZNK7WebCore13HitTestResult10isLiveLinkEv 715 722 __ZNK7WebCore13HitTestResult10isSelectedEv … … 726 733 __ZNK7WebCore13HitTestResult9imageRectEv 727 734 __ZNK7WebCore13ResourceErrorcvP7NSErrorEv 728 __ZNK7WebCore13ContainerNode14childNodeCountEv729 735 __ZNK7WebCore14DocumentLoader10requestURLEv 730 736 __ZNK7WebCore14DocumentLoader11frameLoaderEv … … 773 779 __ZNK7WebCore4Node18getSubresourceURLsERN3WTF6VectorINS_4KURLELm0EEE 774 780 __ZNK7WebCore4Node9nodeIndexEv 775 __ZNK7WebCore13ContainerNode9childNodeEj776 781 __ZNK7WebCore4Page10pluginDataEv 777 782 __ZNK7WebCore4Page34inLowQualityImageInterpolationModeEv … … 861 866 __ZNK7WebCore9FrameTree6parentEb 862 867 __ZNK7WebCore9FrameView11needsLayoutEv 863 __ZN7WebCore9FrameView23layoutIfNeededRecursiveEv864 __ZN7WebCore9FrameViewC1EPNS_5FrameERKNS_7IntSizeE865 868 __ZNK7WebCore9Selection17isContentEditableEv 866 869 __ZNK7WebCore9Selection19rootEditableElementEv -
trunk/WebCore/editing/TextIterator.cpp
r34822 r37611 713 713 return 0; 714 714 } 715 716 Node* TextIterator::node() const 717 { 718 RefPtr<Range> textRange = range(); 719 if (!textRange) 720 return 0; 721 722 Node* node = textRange->startContainer(); 723 if (!node) 724 return 0; 725 if (node->offsetInCharacters()) 726 return node; 727 728 return node->childNode(textRange->startOffset()); 729 } 715 730 716 731 // -------- -
trunk/WebCore/editing/TextIterator.h
r34822 r37611 66 66 67 67 PassRefPtr<Range> range() const; 68 Node* node() const; 68 69 69 70 static int rangeLength(const Range*, bool spacesForReplacedElements = false); -
trunk/WebKit/ChangeLog
r37312 r37611 1 2008-10-14 Maxime Britto <britto@apple.com> 2 3 Reviewed by Darin Adler. 4 5 * WebKit.xcodeproj/project.pbxproj: Added two files for the 6 WebTextIterator, and made the WebTextIterator.h private 7 1 8 2008-10-04 Mark Rowe <mrowe@apple.com> 2 9 -
trunk/WebKit/WebKit.xcodeproj/project.pbxproj
r37312 r37611 295 295 EDE983800BCDF5FE00FDAE28 /* WebNSArrayExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE9837E0BCDF5FE00FDAE28 /* WebNSArrayExtras.h */; }; 296 296 EDE983810BCDF5FE00FDAE28 /* WebNSArrayExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = EDE9837F0BCDF5FE00FDAE28 /* WebNSArrayExtras.m */; }; 297 F834AAD70E64B1C700E2737C /* WebTextIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = F834AAD50E64B1C700E2737C /* WebTextIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 298 F834AAD80E64B1C700E2737C /* WebTextIterator.mm in Sources */ = {isa = PBXBuildFile; fileRef = F834AAD60E64B1C700E2737C /* WebTextIterator.mm */; }; 297 299 /* End PBXBuildFile section */ 298 300 … … 591 593 F7EBEEAA03F9DBA103CA0DE6 /* HIWebView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HIWebView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 592 594 F7EBEEAB03F9DBA103CA0DE6 /* HIWebView.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = HIWebView.m; sourceTree = "<group>"; usesTabs = 0; }; 595 F834AAD50E64B1C700E2737C /* WebTextIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTextIterator.h; sourceTree = "<group>"; }; 596 F834AAD60E64B1C700E2737C /* WebTextIterator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebTextIterator.mm; sourceTree = "<group>"; }; 593 597 F8CA15B5029A39D901000122 /* WebAuthenticationPanel.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebAuthenticationPanel.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 594 598 F8CA15B6029A39D901000122 /* WebAuthenticationPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebAuthenticationPanel.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; … … 920 924 isa = PBXGroup; 921 925 children = ( 926 F834AAD50E64B1C700E2737C /* WebTextIterator.h */, 927 F834AAD60E64B1C700E2737C /* WebTextIterator.mm */, 922 928 F52CA6BD02DF9D0F018635CA /* HTML */, 923 929 51E94C0706C02CA300A9B09E /* PDF */, … … 1304 1310 1A2D75500DE4810E00F0A648 /* WebIconFetcherInternal.h in Headers */, 1305 1311 5D1638F30E35B45D00F3038E /* EmptyProtocolDefinitions.h in Headers */, 1312 F834AAD70E64B1C700E2737C /* WebTextIterator.h in Headers */, 1306 1313 ); 1307 1314 runOnlyForDeploymentPostprocessing = 0; … … 1586 1593 1AEA6A510DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.mm in Sources */, 1587 1594 1A2D754E0DE480B900F0A648 /* WebIconFetcher.mm in Sources */, 1595 F834AAD80E64B1C700E2737C /* WebTextIterator.mm in Sources */, 1588 1596 ); 1589 1597 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKit/mac/ChangeLog
r37606 r37611 1 2008-10-14 Maxime Britto <britto@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Added SPI to use WebCore's TextIterator with WebKit. 6 7 * WebView/WebTextIterator.h: Added. 8 * WebView/WebTextIterator.mm: Added. 9 (-[WebTextIteratorPrivate dealloc]): 10 (-[WebTextIterator dealloc]): 11 (-[WebTextIterator initWithRange:]): Creates a TextIterator 12 instance 13 (-[WebTextIterator advance]): Asks the iterator to advance() . 14 (-[WebTextIterator currentNode]): Returns the current DOMNode from 15 the iterator 16 (-[WebTextIterator currentText]): Returns the current text from the 17 iterator 18 (-[WebTextIterator atEnd]): Indicated whether the iterator has 19 reached the end of the range. 20 * WebView/WebView.h: 21 * WebView/WebView.mm: 22 (-[WebView textIteratorForRect:]): Returns a WebTextIterator with 23 the DOMRange contained in the rectangle given as a parameter. 24 1 25 2008-10-15 Timothy Hatcher <timothy@apple.com> 2 26 -
trunk/WebKit/mac/WebView/WebView.mm
r37606 r37611 85 85 #import "WebPreferenceKeysPrivate.h" 86 86 #import "WebPreferencesPrivate.h" 87 #import "WebTextIterator.h" 87 88 #import "WebUIDelegate.h" 88 89 #import "WebUIDelegatePrivate.h" … … 1935 1936 } 1936 1937 1938 - (WebTextIterator *)textIteratorForRect:(NSRect)rect 1939 { 1940 IntPoint rectStart(rect.origin.x, rect.origin.y); 1941 IntPoint rectEnd(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height); 1942 1943 Frame* coreFrame = core([self mainFrame]); 1944 if (!coreFrame) 1945 return nil; 1946 1947 Selection selectionInsideRect(coreFrame->visiblePositionForPoint(rectStart), coreFrame->visiblePositionForPoint(rectEnd)); 1948 1949 return [[[WebTextIterator alloc] initWithRange:[DOMRange _wrapRange:selectionInsideRect.toRange().get()]] autorelease]; 1950 } 1951 1937 1952 - (void)handleAuthenticationForResource:(id)identifier challenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource 1938 1953 { -
trunk/WebKit/mac/WebView/WebViewPrivate.h
r37606 r37611 46 46 @class WebInspector; 47 47 @class WebPreferences; 48 @class WebTextIterator; 48 49 49 50 @protocol WebFormDelegate; … … 362 363 - (void)setUsesPageCache:(BOOL)usesPageCache; 363 364 365 /*! 366 @method textIteratorForRect: 367 @param rectangle from which we want the WebTextIterator to load text from 368 @result a WebtextIterator object. 369 */ 370 - (WebTextIterator *)textIteratorForRect:(NSRect)rect; 371 364 372 #if ENABLE_DASHBOARD_SUPPORT 365 373 // <rdar://problem/5217124> Clients other than dashboard, don't use this.
Note: See TracChangeset
for help on using the changeset viewer.