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

Unified Diff: Source/core/layout/Layer.cpp

Issue 869813003: Implement elementsFromPoint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup, add a better test for tables Created 5 years, 10 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/layout/HitTestResult.cpp ('k') | Source/core/layout/LayoutImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/Layer.cpp
diff --git a/Source/core/layout/Layer.cpp b/Source/core/layout/Layer.cpp
index 11b07ec731e6b520e7923cf2d9f93fa1a3a525a3..e768cfc8a052ebee6ddfda5ed363676a385eedfa 100644
--- a/Source/core/layout/Layer.cpp
+++ b/Source/core/layout/Layer.cpp
@@ -1907,16 +1907,16 @@ Layer* Layer::hitTestLayer(Layer* rootLayer, Layer* containerLayer, const HitTes
bool insideFragmentForegroundRect = false;
if (hitTestContentsForFragments(layerFragments, request, tempResult, hitTestLocation, HitTestDescendants, insideFragmentForegroundRect)
&& isHitCandidate(this, false, zOffsetForContentsPtr, unflattenedTransformState.get())) {
- if (result.isRectBasedTest())
- result.append(tempResult);
+ if (request.listBased())
+ result.append(tempResult, request);
else
result = tempResult;
if (!depthSortDescendants)
return this;
// Foreground can depth-sort with descendant layers, so keep this as a candidate.
candidateLayer = this;
- } else if (insideFragmentForegroundRect && result.isRectBasedTest()) {
- result.append(tempResult);
+ } else if (insideFragmentForegroundRect && request.listBased()) {
+ result.append(tempResult, request);
}
}
@@ -1939,13 +1939,13 @@ Layer* Layer::hitTestLayer(Layer* rootLayer, Layer* containerLayer, const HitTes
if (hitTestContentsForFragments(layerFragments, request, tempResult, hitTestLocation, HitTestSelf, insideFragmentBackgroundRect)
&& isHitCandidate(this, false, zOffsetForContentsPtr, unflattenedTransformState.get())) {
if (result.isRectBasedTest())
- result.append(tempResult);
+ result.append(tempResult, request);
else
result = tempResult;
return this;
}
- if (insideFragmentBackgroundRect && result.isRectBasedTest())
- result.append(tempResult);
+ if (insideFragmentBackgroundRect && request.listBased())
+ result.append(tempResult, request);
}
return 0;
@@ -2044,7 +2044,7 @@ bool Layer::hitTestContents(const HitTestRequest& request, HitTestResult& result
if (!renderer()->hitTest(request, result, hitTestLocation, toLayoutPoint(layerBounds.location() - renderBoxLocation()), hitTestFilter)) {
// It's wrong to set innerNode, but then claim that you didn't hit anything, unless it is
// a rect-based test.
- ASSERT(!result.innerNode() || (result.isRectBasedTest() && result.rectBasedTestResult().size()));
+ ASSERT(!result.innerNode() || (request.listBased() && result.listBasedTestResult().size()));
return false;
}
@@ -2085,14 +2085,15 @@ Layer* Layer::hitTestChildren(ChildrenIteration childrentoVisit, Layer* rootLaye
else
hitLayer = childLayer->hitTestLayer(rootLayer, this, request, tempResult, hitTestRect, hitTestLocation, false, transformState, zOffsetForDescendants);
- // If it a rect-based test, we can safely append the temporary result since it might had hit
+ // If it is a list-based test, we can safely append the temporary result since it might had hit
// nodes but not necesserily had hitLayer set.
- if (result.isRectBasedTest())
- result.append(tempResult);
+ ASSERT(!result.isRectBasedTest() || request.listBased());
+ if (request.listBased())
+ result.append(tempResult, request);
if (isHitCandidate(hitLayer, depthSortDescendants, zOffset, unflattenedTransformState)) {
resultLayer = hitLayer;
- if (!result.isRectBasedTest())
+ if (!request.listBased())
result = tempResult;
if (!depthSortDescendants)
break;
« no previous file with comments | « Source/core/layout/HitTestResult.cpp ('k') | Source/core/layout/LayoutImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698