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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp

Issue 2173963002: Ensure that we consistently check contains: paint for fixed position containment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove trailing whitespace Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 { 1017 {
1018 ASSERT(ancestorToStopAt != this); 1018 ASSERT(ancestorToStopAt != this);
1019 1019
1020 bool ancestorSkipped; 1020 bool ancestorSkipped;
1021 LayoutObject* container = this->container(ancestorToStopAt, &ancestorSkipped ); 1021 LayoutObject* container = this->container(ancestorToStopAt, &ancestorSkipped );
1022 if (!container) 1022 if (!container)
1023 return nullptr; 1023 return nullptr;
1024 1024
1025 bool isInline = isLayoutInline(); 1025 bool isInline = isLayoutInline();
1026 bool isFixedPos = !isInline && style()->position() == FixedPosition; 1026 bool isFixedPos = !isInline && style()->position() == FixedPosition;
1027 bool hasTransform = !isInline && hasLayer() && layer()->transform(); 1027 bool containsFixedPosition = canContainFixedPositionObjects();
1028 1028
1029 LayoutSize adjustmentForSkippedAncestor; 1029 LayoutSize adjustmentForSkippedAncestor;
1030 if (ancestorSkipped) { 1030 if (ancestorSkipped) {
1031 // There can't be a transform between paintInvalidationContainer and anc estorToStopAt, because transforms create containers, so it should be safe 1031 // There can't be a transform between paintInvalidationContainer and anc estorToStopAt, because transforms create containers, so it should be safe
1032 // to just subtract the delta between the ancestor and ancestorToStopAt. 1032 // to just subtract the delta between the ancestor and ancestorToStopAt.
1033 adjustmentForSkippedAncestor = -ancestorToStopAt->offsetFromAncestorCont ainer(container); 1033 adjustmentForSkippedAncestor = -ancestorToStopAt->offsetFromAncestorCont ainer(container);
1034 } 1034 }
1035 1035
1036 LayoutSize containerOffset = offsetFromContainer(container); 1036 LayoutSize containerOffset = offsetFromContainer(container);
1037 bool offsetDependsOnPoint; 1037 bool offsetDependsOnPoint;
1038 if (isLayoutFlowThread()) { 1038 if (isLayoutFlowThread()) {
1039 containerOffset += columnOffset(LayoutPoint()); 1039 containerOffset += columnOffset(LayoutPoint());
1040 offsetDependsOnPoint = true; 1040 offsetDependsOnPoint = true;
1041 } else { 1041 } else {
1042 offsetDependsOnPoint = container->style()->isFlippedBlocksWritingMode() && container->isBox(); 1042 offsetDependsOnPoint = container->style()->isFlippedBlocksWritingMode() && container->isBox();
1043 } 1043 }
1044 1044
1045 bool preserve3D = container->style()->preserves3D() || style()->preserves3D( ); 1045 bool preserve3D = container->style()->preserves3D() || style()->preserves3D( );
1046 GeometryInfoFlags flags = 0; 1046 GeometryInfoFlags flags = 0;
1047 if (preserve3D) 1047 if (preserve3D)
1048 flags |= AccumulatingTransform; 1048 flags |= AccumulatingTransform;
1049 if (offsetDependsOnPoint) 1049 if (offsetDependsOnPoint)
1050 flags |= IsNonUniform; 1050 flags |= IsNonUniform;
1051 if (isFixedPos) 1051 if (isFixedPos)
1052 flags |= IsFixedPosition; 1052 flags |= IsFixedPosition;
1053 if (hasTransform) 1053 if (containsFixedPosition)
1054 flags |= HasTransform; 1054 flags |= ContainsFixedPosition;
1055 if (shouldUseTransformFromContainer(container)) { 1055 if (shouldUseTransformFromContainer(container)) {
1056 TransformationMatrix t; 1056 TransformationMatrix t;
1057 getTransformFromContainer(container, containerOffset, t); 1057 getTransformFromContainer(container, containerOffset, t);
1058 t.translateRight(adjustmentForSkippedAncestor.width().toFloat(), adjustm entForSkippedAncestor.height().toFloat()); 1058 t.translateRight(adjustmentForSkippedAncestor.width().toFloat(), adjustm entForSkippedAncestor.height().toFloat());
1059 geometryMap.push(this, t, flags, LayoutSize()); 1059 geometryMap.push(this, t, flags, LayoutSize());
1060 } else { 1060 } else {
1061 containerOffset += adjustmentForSkippedAncestor; 1061 containerOffset += adjustmentForSkippedAncestor;
1062 geometryMap.push(this, containerOffset, flags, LayoutSize()); 1062 geometryMap.push(this, containerOffset, flags, LayoutSize());
1063 } 1063 }
1064 1064
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 if (rootElementStyle->hasBackground()) 1134 if (rootElementStyle->hasBackground())
1135 return false; 1135 return false;
1136 1136
1137 if (node() != document().firstBodyElement()) 1137 if (node() != document().firstBodyElement())
1138 return false; 1138 return false;
1139 1139
1140 return true; 1140 return true;
1141 } 1141 }
1142 1142
1143 } // namespace blink 1143 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698