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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2194793006: Do not commit: Revert of r404081 and r402757 for perf testing purposes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index 78d02a87c11a1c59fab1f61efe381b2dd8aebd62..4f4997278c8b7b0c4a1a1260574944a6c6d2bfb8 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -3213,12 +3213,12 @@ void LayoutObject::imageChanged(ImageResource* image, const IntRect* rect)
imageChanged(static_cast<WrappedImagePtr>(image), rect);
}
-Element* LayoutObject::offsetParent(const Element* unclosedBase) const
+Element* LayoutObject::offsetParent() const
{
if (isDocumentElement() || isBody())
return nullptr;
- if (isFixedPositioned())
+ if (isOutOfFlowPositioned() && style()->position() == FixedPosition)
return nullptr;
float effectiveZoom = style()->effectiveZoom();
@@ -3231,16 +3231,6 @@ Element* LayoutObject::offsetParent(const Element* unclosedBase) const
if (!node)
continue;
- // TODO(kochi): If |unclosedBase| or |node| is nested deep in shadow roots, this loop may
- // get expensive, as isUnclosedNodeOf() can take up to O(N+M) time (N and M are depths).
- if (unclosedBase && (!node->isUnclosedNodeOf(*unclosedBase) || (node->isInShadowTree() && node->containingShadowRoot()->type() == ShadowRootType::UserAgent))) {
- // If 'position: fixed' node is found while traversing up, terminate the loop and
- // return null.
- if (ancestor->isFixedPositioned())
- return nullptr;
- continue;
- }
-
if (ancestor->isPositioned())
break;
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutVideo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698