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

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

Issue 1513303005: Clear child's floats when moving from parent with block children to parent with inline children (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 5 years 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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 // positioned layoutObject maps don't become stale. It would be too slow to do the map lookup on each call. 1008 // positioned layoutObject maps don't become stale. It would be too slow to do the map lookup on each call.
1009 ASSERT(!fullRemoveInsert || !isLayoutBlock() || !toLayoutBlock(this)->hasPos itionedObjects()); 1009 ASSERT(!fullRemoveInsert || !isLayoutBlock() || !toLayoutBlock(this)->hasPos itionedObjects());
1010 1010
1011 ASSERT(this == child->parent()); 1011 ASSERT(this == child->parent());
1012 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); 1012 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent());
1013 1013
1014 // If a child is moving from a block-flow to an inline-flow parent then any floats currently intruding into 1014 // If a child is moving from a block-flow to an inline-flow parent then any floats currently intruding into
1015 // the child can no longer do so. This can happen if a block becomes floatin g or out-of-flow and is moved 1015 // the child can no longer do so. This can happen if a block becomes floatin g or out-of-flow and is moved
1016 // to an anonymous block. Remove all floats from their float-lists immediate ly as markAllDescendantsWithFloatsForLayout 1016 // to an anonymous block. Remove all floats from their float-lists immediate ly as markAllDescendantsWithFloatsForLayout
1017 // won't attempt to remove floats from parents that have inline-flow if we t ry later. 1017 // won't attempt to remove floats from parents that have inline-flow if we t ry later.
1018 if (child->isLayoutBlockFlow() && toBoxModelObject->childrenInline() && !chi ld->childrenInline() && !childrenInline()) { 1018 if (child->isLayoutBlockFlow() && toBoxModelObject->childrenInline() && !chi ldrenInline()) {
1019 toLayoutBlockFlow(child)->removeFloatingObjectsFromDescendants(); 1019 toLayoutBlockFlow(child)->removeFloatingObjectsFromDescendants();
1020 ASSERT(!toLayoutBlockFlow(child)->containsFloats()); 1020 ASSERT(!toLayoutBlockFlow(child)->containsFloats());
1021 } 1021 }
1022 1022
1023 if (fullRemoveInsert && isLayoutBlock() && child->isBox()) 1023 if (fullRemoveInsert && isLayoutBlock() && child->isBox())
1024 LayoutBlock::removePercentHeightDescendantIfNeeded(toLayoutBox(child)); 1024 LayoutBlock::removePercentHeightDescendantIfNeeded(toLayoutBox(child));
1025 1025
1026 if (fullRemoveInsert && (toBoxModelObject->isLayoutBlock() || toBoxModelObje ct->isLayoutInline())) { 1026 if (fullRemoveInsert && (toBoxModelObject->isLayoutBlock() || toBoxModelObje ct->isLayoutInline())) {
1027 // Takes care of adding the new child correctly if toBlock and fromBlock 1027 // Takes care of adding the new child correctly if toBlock and fromBlock
1028 // have different kind of children (block vs inline). 1028 // have different kind of children (block vs inline).
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 if (rootElementStyle->hasBackground()) 1071 if (rootElementStyle->hasBackground())
1072 return false; 1072 return false;
1073 1073
1074 if (node() != document().firstBodyElement()) 1074 if (node() != document().firstBodyElement())
1075 return false; 1075 return false;
1076 1076
1077 return true; 1077 return true;
1078 } 1078 }
1079 1079
1080 } // namespace blink 1080 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/block/float/clear-intruding-floats-when-moving-to-inline-parent-3-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698