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

Unified Diff: Source/WebKit2/WebProcess/WebPage/WebPage.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebKit2/WebProcess/WebPage/WebPage.h ('k') | Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit2/WebProcess/WebPage/WebPage.cpp
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 036f6d1b9314e66da6ac3d0227c0c7e5a3dd4836..43a78e3df63cbc7db7b8fb1e12bb5224517c5651 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -803,35 +803,6 @@ WebContextMenu* WebPage::contextMenu()
return m_contextMenu.get();
}
-void WebPage::getLocationAndLengthFromRange(Range* range, uint64_t& location, uint64_t& length)
-{
- location = notFound;
- length = 0;
-
- if (!range || !range->startContainer())
- return;
-
- Element* selectionRoot = range->ownerDocument()->frame()->selection()->rootEditableElement();
- Element* scope = selectionRoot ? selectionRoot : range->ownerDocument()->documentElement();
-
- // Mouse events may cause TSM to attempt to create an NSRange for a portion of the view
- // that is not inside the current editable region. These checks ensure we don't produce
- // potentially invalid data when responding to such requests.
- if (range->startContainer() != scope && !range->startContainer()->isDescendantOf(scope))
- return;
- if (range->endContainer() != scope && !range->endContainer()->isDescendantOf(scope))
- return;
-
- RefPtr<Range> testRange = Range::create(scope->document(), scope, 0, range->startContainer(), range->startOffset());
- ASSERT(testRange->startContainer() == scope);
- location = TextIterator::rangeLength(testRange.get());
-
- ExceptionCode ec;
- testRange->setEnd(range->endContainer(), range->endOffset(), ec);
- ASSERT(testRange->startContainer() == scope);
- length = TextIterator::rangeLength(testRange.get()) - location;
-}
-
// Events
static const WebEvent* g_currentEvent = 0;
« no previous file with comments | « Source/WebKit2/WebProcess/WebPage/WebPage.h ('k') | Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698