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

Unified Diff: sky/engine/core/rendering/RenderBox.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/RenderBlock.cpp ('k') | sky/engine/core/rendering/RenderBoxModelObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderBox.cpp
diff --git a/sky/engine/core/rendering/RenderBox.cpp b/sky/engine/core/rendering/RenderBox.cpp
index f809797691387ddbe47c2b6fc73d1eb4368a4d7c..2f358d2c71f323e9acd6842038f379beb28583b9 100644
--- a/sky/engine/core/rendering/RenderBox.cpp
+++ b/sky/engine/core/rendering/RenderBox.cpp
@@ -1556,14 +1556,11 @@ void RenderBox::mapLocalToContainer(const RenderLayerModelObject* paintInvalidat
if (!o)
return;
- bool isFixedPos = style()->position() == FixedPosition;
bool hasTransform = hasLayer() && layer()->transform();
// If this box has a transform, it acts as a fixed position container for fixed descendants,
// and may itself also be fixed position. So propagate 'fixed' up only if this box is fixed position.
- if (hasTransform && !isFixedPos)
+ if (hasTransform)
mode &= ~IsFixed;
- else if (isFixedPos)
- mode |= IsFixed;
if (wasFixed)
*wasFixed = mode & IsFixed;
@@ -1593,14 +1590,12 @@ void RenderBox::mapLocalToContainer(const RenderLayerModelObject* paintInvalidat
void RenderBox::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState& transformState) const
{
- bool isFixedPos = style()->position() == FixedPosition;
bool hasTransform = hasLayer() && layer()->transform();
- if (hasTransform && !isFixedPos) {
+ if (hasTransform) {
// If this box has a transform, it acts as a fixed position container for fixed descendants,
// and may itself also be fixed position. So propagate 'fixed' up only if this box is fixed position.
mode &= ~IsFixed;
- } else if (isFixedPos)
- mode |= IsFixed;
+ }
RenderBoxModelObject::mapAbsoluteToLocalPoint(mode, transformState);
}
@@ -1726,7 +1721,7 @@ void RenderBox::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
// included into the visual overflow for repaint, we wouldn't have this issue.
inflatePaintInvalidationRectForReflectionAndFilter(rect);
- if (paintInvalidationState && paintInvalidationState->canMapToContainer(paintInvalidationContainer) && position != FixedPosition) {
+ if (paintInvalidationState && paintInvalidationState->canMapToContainer(paintInvalidationContainer)) {
if (layer() && layer()->transform())
rect = layer()->transform()->mapRect(pixelSnappedIntRect(rect));
@@ -2455,15 +2450,6 @@ LayoutUnit RenderBox::containingBlockLogicalWidthForPositioned(const RenderBoxMo
if (checkForPerpendicularWritingMode && containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode())
return containingBlockLogicalHeightForPositioned(containingBlock, false);
- // Use viewport as container for top-level fixed-position elements.
- if (style()->position() == FixedPosition && containingBlock->isRenderView()) {
- const RenderView* view = toRenderView(containingBlock);
- if (FrameView* frameView = view->frameView()) {
- LayoutRect viewportRect = frameView->visibleContentRect();
- return containingBlock->isHorizontalWritingMode() ? viewportRect.width() : viewportRect.height();
- }
- }
-
if (containingBlock->isBox())
return toRenderBox(containingBlock)->clientLogicalWidth();
@@ -2495,15 +2481,6 @@ LayoutUnit RenderBox::containingBlockLogicalHeightForPositioned(const RenderBoxM
if (checkForPerpendicularWritingMode && containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode())
return containingBlockLogicalWidthForPositioned(containingBlock, false);
- // Use viewport as container for top-level fixed-position elements.
- if (style()->position() == FixedPosition && containingBlock->isRenderView()) {
- const RenderView* view = toRenderView(containingBlock);
- if (FrameView* frameView = view->frameView()) {
- LayoutRect viewportRect = frameView->visibleContentRect();
- return containingBlock->isHorizontalWritingMode() ? viewportRect.height() : viewportRect.width();
- }
- }
-
if (containingBlock->isBox()) {
const RenderBlock* cb = containingBlock->isRenderBlock() ?
toRenderBlock(containingBlock) : containingBlock->containingBlock();
« no previous file with comments | « sky/engine/core/rendering/RenderBlock.cpp ('k') | sky/engine/core/rendering/RenderBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698