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

Unified Diff: sky/engine/core/rendering/RenderObject.cpp

Issue 686633002: First pass at removing position:fixed. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/RenderView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderObject.cpp
diff --git a/sky/engine/core/rendering/RenderObject.cpp b/sky/engine/core/rendering/RenderObject.cpp
index 42e20cbb39e12c2e7fd2448a2903f7574311a6c6..9312d61b8df0cc899d23b2204c451583047d4422 100644
--- a/sky/engine/core/rendering/RenderObject.cpp
+++ b/sky/engine/core/rendering/RenderObject.cpp
@@ -622,28 +622,10 @@ void RenderObject::invalidateContainerPreferredLogicalWidths()
}
}
-RenderBlock* RenderObject::containerForFixedPosition(const RenderLayerModelObject* paintInvalidationContainer, bool* paintInvalidationContainerSkipped) const
-{
- ASSERT(!paintInvalidationContainerSkipped || !*paintInvalidationContainerSkipped);
- ASSERT(!isText());
- ASSERT(style()->position() == FixedPosition);
-
- RenderObject* ancestor = parent();
- for (; ancestor && !ancestor->canContainFixedPositionObjects(); ancestor = ancestor->parent()) {
- if (paintInvalidationContainerSkipped && ancestor == paintInvalidationContainer)
- *paintInvalidationContainerSkipped = true;
- }
-
- ASSERT(!ancestor || !ancestor->isAnonymousBlock());
- return toRenderBlock(ancestor);
-}
-
RenderBlock* RenderObject::containingBlock() const
{
RenderObject* o = parent();
- if (!isText() && m_style->position() == FixedPosition) {
- return containerForFixedPosition();
- } else if (!isText() && m_style->position() == AbsolutePosition) {
+ if (!isText() && m_style->position() == AbsolutePosition) {
while (o) {
// For relpositioned inlines, we return the nearest non-anonymous enclosing block. We don't try
// to return the inline itself. This allows us to avoid having a positioned objects
@@ -2300,9 +2282,7 @@ RenderObject* RenderObject::container(const RenderLayerModelObject* paintInvalid
return o;
EPosition pos = m_style->position();
- if (pos == FixedPosition) {
- return containerForFixedPosition(paintInvalidationContainer, paintInvalidationContainerSkipped);
- } else if (pos == AbsolutePosition) {
+ if (pos == AbsolutePosition) {
// We technically just want our containing block, but
// we may not have one if we're part of an uninstalled
// subtree. We'll climb as high as we can though.
@@ -2684,9 +2664,6 @@ Element* RenderObject::offsetParent() const
if (isDocumentElement())
return 0;
- if (isOutOfFlowPositioned() && style()->position() == FixedPosition)
- return 0;
-
// If A is an area HTML element which has a map HTML element somewhere in the ancestor
// chain return the nearest ancestor map HTML element and stop this algorithm.
// FIXME: Implement!
« no previous file with comments | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/RenderView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698