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

Unified Diff: Source/WebCore/rendering/HitTestResult.cpp

Issue 10540108: Merge 119733 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 6 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 | « LayoutTests/fast/dom/nodesFromRect-culled-inlines-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/HitTestResult.cpp
===================================================================
--- Source/WebCore/rendering/HitTestResult.cpp (revision 120005)
+++ Source/WebCore/rendering/HitTestResult.cpp (working copy)
@@ -582,21 +582,23 @@
mutableRectBasedTestResult().add(node);
- if (node->renderer()->isInline()) {
+ bool regionFilled = rect.contains(rectForPoint(pointInContainer));
+ // FIXME: This code (incorrectly) attempts to correct for culled inline nodes. See https://bugs.webkit.org/show_bug.cgi?id=85849.
+ if (node->renderer()->isInline() && !regionFilled) {
for (RenderObject* curr = node->renderer()->parent(); curr; curr = curr->parent()) {
if (!curr->isRenderInline())
break;
-
+
// We need to make sure the nodes for culled inlines get included.
RenderInline* currInline = toRenderInline(curr);
if (currInline->alwaysCreateLineBoxes())
break;
-
+
if (currInline->visibleToHitTesting() && currInline->node())
mutableRectBasedTestResult().add(currInline->node()->shadowAncestorNode());
}
}
- return !rect.contains(rectForPoint(pointInContainer));
+ return !regionFilled;
}
bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const LayoutPoint& pointInContainer, const FloatRect& rect)
@@ -615,21 +617,23 @@
mutableRectBasedTestResult().add(node);
- if (node->renderer()->isInline()) {
+ bool regionFilled = rect.contains(rectForPoint(pointInContainer));
+ // FIXME: This code (incorrectly) attempts to correct for culled inline nodes. See https://bugs.webkit.org/show_bug.cgi?id=85849.
+ if (node->renderer()->isInline() && !regionFilled) {
for (RenderObject* curr = node->renderer()->parent(); curr; curr = curr->parent()) {
if (!curr->isRenderInline())
break;
-
+
// We need to make sure the nodes for culled inlines get included.
RenderInline* currInline = toRenderInline(curr);
if (currInline->alwaysCreateLineBoxes())
break;
-
+
if (currInline->visibleToHitTesting() && currInline->node())
mutableRectBasedTestResult().add(currInline->node()->shadowAncestorNode());
}
}
- return !rect.contains(rectForPoint(pointInContainer));
+ return !regionFilled;
}
void HitTestResult::append(const HitTestResult& other)
« no previous file with comments | « LayoutTests/fast/dom/nodesFromRect-culled-inlines-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698