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

Unified Diff: Source/web/LinkHighlight.cpp

Issue 448593002: Make Gesture Tap be aware of Shadow DOM. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use useMockHighlight() Created 6 years, 4 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/web/LinkHighlight.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/LinkHighlight.cpp
diff --git a/Source/web/LinkHighlight.cpp b/Source/web/LinkHighlight.cpp
index 251507bc60117717c3667958ccf3a7dd60e3e896..0b51e66ea6a8e6352ddde4c9bb515a6fc7a9d580 100644
--- a/Source/web/LinkHighlight.cpp
+++ b/Source/web/LinkHighlight.cpp
@@ -179,25 +179,19 @@ static void addQuadToPath(const FloatQuad& quad, Path& path)
path.closeSubpath();
}
-void LinkHighlight::computeQuads(Node* node, Vector<FloatQuad>& outQuads) const
+void LinkHighlight::computeQuads(RenderObject& renderer, Vector<FloatQuad>& outQuads) const
{
- if (!node || !node->renderer())
- return;
-
- RenderObject* renderer = node->renderer();
-
// For inline elements, absoluteQuads will return a line box based on the line-height
// and font metrics, which is technically incorrect as replaced elements like images
// should use their intristic height and expand the linebox as needed. To get an
// appropriately sized highlight we descend into the children and have them add their
// boxes.
- if (renderer->isRenderInline()) {
- for (Node* child = node->firstChild(); child; child = child->nextSibling())
- computeQuads(child, outQuads);
+ if (renderer.isRenderInline()) {
+ for (RenderObject* child = renderer.slowFirstChild(); child; child = child->nextSibling())
+ computeQuads(*child, outQuads);
} else {
- renderer->absoluteQuads(outQuads);
+ renderer.absoluteQuads(outQuads);
}
-
}
bool LinkHighlight::computeHighlightLayerPathAndPosition(RenderLayer* compositingLayer)
@@ -209,7 +203,7 @@ bool LinkHighlight::computeHighlightLayerPathAndPosition(RenderLayer* compositin
// Get quads for node in absolute coordinates.
Vector<FloatQuad> quads;
- computeQuads(m_node.get(), quads);
+ computeQuads(*m_node->renderer(), quads);
ASSERT(quads.size());
// Adjust for offset between target graphics layer and the node's renderer.
« no previous file with comments | « Source/web/LinkHighlight.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698