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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2761413002: Fix position of floating layer whose containing block is also floating (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index abd609c8f6e5c374e79065e6f3e944837b4054fa..0fa096a60ab977b08d8db58791e7687908a9c4da 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -869,24 +869,28 @@ PaintLayer* PaintLayer::containingLayer(const PaintLayer* ancestor,
if (skippedAncestor)
*skippedAncestor = false;
- LayoutObject& layoutObject = this->layoutObject();
- if (layoutObject.isColumnSpanAll() ||
- layoutObject.isFloatingWithNonContainingBlockParent()) {
chrishtr 2017/03/21 21:48:46 Do the other callsites of isFloatingWithNonContain
Xianzhu 2017/03/22 15:03:15 The function is still good for checking if a float
+ LayoutObject* layoutObject = &this->layoutObject();
+ if (layoutObject->isColumnSpanAll() || layoutObject->isFloating()) {
Optional<LayoutObject::AncestorSkipInfo> skipInfo;
if (skippedAncestor)
skipInfo.emplace(&ancestor->layoutObject());
- if (auto containingBlock = layoutObject.containingBlock(
- skippedAncestor ? &*skipInfo : nullptr)) {
+ while (auto containingBlock = layoutObject->containingBlock(
+ skippedAncestor ? &*skipInfo : nullptr)) {
if (skippedAncestor && skipInfo->ancestorSkipped())
*skippedAncestor = true;
+ if (layoutObject->isFloating() && containingBlock->isFloating() &&
+ !containingBlock->hasLayer()) {
+ layoutObject = containingBlock;
+ continue;
+ }
return containingBlock->enclosingLayer();
}
return nullptr;
}
- if (layoutObject.isOutOfFlowPositioned()) {
+ if (layoutObject->isOutOfFlowPositioned()) {
auto canContainThisLayer =
- layoutObject.isFixedPositioned()
+ layoutObject->isFixedPositioned()
? &LayoutObject::canContainFixedPositionObjects
: &LayoutObject::canContainAbsolutePositionObjects;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698