Index: third_party/WebKit/Source/core/dom/IntersectionObservation.cpp |
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp |
index 0667ca6c8cac1e265b30e29ec07aba64b6fe725c..36e55dad88cd4bc77683577d897866424fda3990 100644 |
--- a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp |
+++ b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp |
@@ -143,7 +143,8 @@ bool IntersectionObservation::computeGeometry(IntersectionGeometry& geometry) co |
// effectively means "if the previous observed state was that root and target were |
// intersecting, then generate a notification indicating that they are no longer |
// intersecting." This happens, for example, when root or target is removed from the |
- // DOM tree and not reinserted before the next frame is generated. |
+ // DOM tree and not reinserted before the next frame is generated, or display:none |
+ // is set on the root or target. |
Element* targetElement = target(); |
if (!targetElement) |
return false; |
@@ -156,13 +157,13 @@ bool IntersectionObservation::computeGeometry(IntersectionGeometry& geometry) co |
LayoutObject* rootLayoutObject = m_observer->rootLayoutObject(); |
if (!rootLayoutObject || !rootLayoutObject->isBoxModelObject()) |
- return false; |
+ return true; |
// TODO(szager): Support SVG |
LayoutObject* targetLayoutObject = targetElement->layoutObject(); |
if (!targetLayoutObject) |
- return false; |
+ return true; |
if (!targetLayoutObject->isBoxModelObject() && !targetLayoutObject->isText()) |
- return false; |
+ return true; |
if (!isContainingBlockChainDescendant(targetLayoutObject, rootLayoutObject)) |
return true; |