Chromium Code Reviews| Index: Source/web/WebViewImpl.cpp |
| diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
| index 3c85d43798bb3be0d6975084f87b2a395a3f37d2..d638c750b7714f7edc71adbbf736e453f3c8277c 100644 |
| --- a/Source/web/WebViewImpl.cpp |
| +++ b/Source/web/WebViewImpl.cpp |
| @@ -2144,6 +2144,31 @@ bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const |
| return true; |
| } |
| +bool WebViewImpl::selectionRootBounds(WebRect& bounds) const |
| +{ |
| + const LocalFrame* frame = focusedWebCoreFrame(); |
| + if (!frame) |
| + return false; |
| + |
| + Element* root = frame->selection().rootEditableElementOrDocumentElement(); |
| + if (!root) |
| + return false; |
| + |
| + // Special casing textarea because of http://crbug.com/348945 |
| + if (root->shadowHost() |
|
tkent
2014/03/05 04:48:10
nit: You don't need to wrap this line.
mlamouri (slow - plz ping)
2014/03/05 09:52:45
Done.
|
| + && root->shadowHost()->hasTagName(HTMLNames::textareaTag)) { |
| + root = root->shadowHost(); |
| + } |
| + |
| + IntRect boundingBox = root->pixelSnappedBoundingBox(); |
| + boundingBox = |
|
tkent
2014/03/05 04:48:10
nit: You don't need to wrap this line.
mlamouri (slow - plz ping)
2014/03/05 09:52:45
Done.
|
| + root->document().frame()->view()->contentsToWindow(boundingBox); |
| + boundingBox.scale(pageScaleFactor()); |
| + bounds = boundingBox; |
| + |
| + return true; |
| +} |
| + |
| InputMethodContext* WebViewImpl::inputMethodContext() |
| { |
| if (!m_imeAcceptEvents) |