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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 236083003: Use document's contentSize when the HTML element is selected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 | « no previous file | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 3864f1e434b710a86a5094e2334c9fbe2d909701..820c38343069b5195e065e03e2b43e7fe17a4a85 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -867,7 +867,10 @@ void WebViewImpl::getSelectionRootBounds(WebRect& bounds) const
&& toHTMLInputElement(*shadowHost).isText())))
root = shadowHost;
- IntRect boundingBox = root->pixelSnappedBoundingBox();
+ IntRect boundingBox = isHTMLHtmlElement(root)
+ ? IntRect(IntPoint(0, 0), root->document().frame()->view()->contentsSize())
+ : root->pixelSnappedBoundingBox();
+
boundingBox = root->document().frame()->view()->contentsToWindow(boundingBox);
boundingBox.scale(pageScaleFactor());
bounds = boundingBox;
@@ -2192,6 +2195,7 @@ bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const
if (!selection.selection().isBaseFirst())
std::swap(anchor, focus);
+
jochen (gone - plz use gerrit) 2014/04/14 07:12:16 unrelated change?
mlamouri (slow - plz ping) 2014/04/14 07:25:54 Removed.
return true;
}
« no previous file with comments | « no previous file | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698