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

Unified Diff: Source/core/editing/RenderedPosition.cpp

Issue 454643002: Route selection bounds updates through WebLayerTreeView (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 3 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/core/editing/RenderedPosition.h ('k') | Source/core/frame/FrameView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/RenderedPosition.cpp
diff --git a/Source/core/editing/RenderedPosition.cpp b/Source/core/editing/RenderedPosition.cpp
index f350387d5fbcf04f916dbf4edf91106410d482d4..2f61555b8f1a5e3782b5fee09ea74c1c4cb1e76e 100644
--- a/Source/core/editing/RenderedPosition.cpp
+++ b/Source/core/editing/RenderedPosition.cpp
@@ -33,6 +33,8 @@
#include "core/dom/Position.h"
#include "core/editing/VisiblePosition.h"
+#include "core/rendering/RenderLayer.h"
+#include "core/rendering/compositing/CompositedSelectionBound.h"
namespace blink {
@@ -231,6 +233,24 @@ IntRect RenderedPosition::absoluteRect(LayoutUnit* extraWidthToEndOfLine) const
return localRect == IntRect() ? IntRect() : m_renderer->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
}
+void RenderedPosition::positionInGraphicsLayerBacking(CompositedSelectionBound& bound) const
+{
+ bound.layer = nullptr;
+ bound.edgeTopInLayer = bound.edgeBottomInLayer = FloatPoint();
+
+ if (isNull())
+ return;
+
+ LayoutRect rect = m_renderer->localCaretRect(m_inlineBox, m_offset);
+ if (rect == LayoutRect())
+ return;
+
+ RenderLayer* layer;
+ bound.edgeTopInLayer = m_renderer->localToInvalidationBackingPoint(rect.minXMinYCorner(), &layer);
+ bound.edgeBottomInLayer = m_renderer->localToInvalidationBackingPoint(rect.minXMaxYCorner(), nullptr);
+ bound.layer = layer->graphicsLayerBacking();
+}
+
bool renderObjectContainsPosition(RenderObject* target, const Position& position)
{
for (RenderObject* renderer = rendererFromPosition(position); renderer && renderer->node(); renderer = renderer->parent()) {
« no previous file with comments | « Source/core/editing/RenderedPosition.h ('k') | Source/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698