Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(669)

Side by Side Diff: Source/WebCore/page/Frame.cpp

Issue 6532004: DO NOT SUBMIT (Closed) Base URL: git://git.webkit.org/WebKit.git@master
Patch Set: Address feedback Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/page/Frame.h ('k') | Source/WebKit/chromium/WebKit.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 return 0; 797 return 0;
798 798
799 IntPoint pt = view()->windowToContents(point); 799 IntPoint pt = view()->windowToContents(point);
800 HitTestResult result = HitTestResult(pt); 800 HitTestResult result = HitTestResult(pt);
801 801
802 if (contentRenderer()) 802 if (contentRenderer())
803 result = eventHandler()->hitTestResultAtPoint(pt, false); 803 result = eventHandler()->hitTestResultAtPoint(pt, false);
804 return result.innerNode() ? result.innerNode()->document() : 0; 804 return result.innerNode() ? result.innerNode()->document() : 0;
805 } 805 }
806 806
807 PassRefPtr<Range> Frame::rangeForPoint(const IntPoint& framePoint)
808 {
809 VisiblePosition position = visiblePositionForPoint(framePoint);
810 if (position.isNull())
811 return 0;
812
813 VisiblePosition previous = position.previous();
814 if (previous.isNotNull()) {
815 RefPtr<Range> previousCharacterRange = makeRange(previous, position);
816 IntRect rect = editor()->firstRectForRange(previousCharacterRange.get()) ;
817 if (rect.contains(framePoint))
818 return previousCharacterRange.release();
819 }
820
821 VisiblePosition next = position.next();
822 if (next.isNotNull()) {
823 RefPtr<Range> nextCharacterRange = makeRange(position, next);
824 IntRect rect = editor()->firstRectForRange(nextCharacterRange.get());
825 if (rect.contains(framePoint))
826 return nextCharacterRange.release();
827 }
828
829 return 0;
830 }
831
807 void Frame::createView(const IntSize& viewportSize, 832 void Frame::createView(const IntSize& viewportSize,
808 const Color& backgroundColor, bool transparent, 833 const Color& backgroundColor, bool transparent,
809 const IntSize& fixedLayoutSize, bool useFixedLayout, 834 const IntSize& fixedLayoutSize, bool useFixedLayout,
810 ScrollbarMode horizontalScrollbarMode, bool horizontalLoc k, 835 ScrollbarMode horizontalScrollbarMode, bool horizontalLoc k,
811 ScrollbarMode verticalScrollbarMode, bool verticalLock) 836 ScrollbarMode verticalScrollbarMode, bool verticalLock)
812 { 837 {
813 ASSERT(this); 838 ASSERT(this);
814 ASSERT(m_page); 839 ASSERT(m_page);
815 840
816 bool isMainFrame = this == m_page->mainFrame(); 841 bool isMainFrame = this == m_page->mainFrame();
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 #endif 1032 #endif
1008 1033
1009 if (FrameView* view = this->view()) { 1034 if (FrameView* view = this->view()) {
1010 if (document->renderer() && document->renderer()->needsLayout() && view- >didFirstLayout()) 1035 if (document->renderer() && document->renderer()->needsLayout() && view- >didFirstLayout())
1011 view->layout(); 1036 view->layout();
1012 view->setScrollPosition(origin); 1037 view->setScrollPosition(origin);
1013 } 1038 }
1014 } 1039 }
1015 1040
1016 } // namespace WebCore 1041 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/page/Frame.h ('k') | Source/WebKit/chromium/WebKit.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698