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

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

Issue 1495033002: Clear intruding floats when moving child to inline parent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@558405-5
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 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 } 1003 }
1004 1004
1005 void LayoutBoxModelObject::moveChildTo(LayoutBoxModelObject* toBoxModelObject, L ayoutObject* child, LayoutObject* beforeChild, bool fullRemoveInsert) 1005 void LayoutBoxModelObject::moveChildTo(LayoutBoxModelObject* toBoxModelObject, L ayoutObject* child, LayoutObject* beforeChild, bool fullRemoveInsert)
1006 { 1006 {
1007 // We assume that callers have cleared their positioned objects list for chi ld moves (!fullRemoveInsert) so the 1007 // We assume that callers have cleared their positioned objects list for chi ld moves (!fullRemoveInsert) so the
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
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
1016 // to an an anonymous block. Remove them from their float-lists immediately as markAllDescendantsWithFloatsForLayout
mstensho (USE GERRIT) 2015/12/07 21:14:44 "them" as in "intruding floats"?
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())
1019 toLayoutBlockFlow(child)->removeFloatingObjectsFromDescendants();
1020
1013 if (fullRemoveInsert && (toBoxModelObject->isLayoutBlock() || toBoxModelObje ct->isLayoutInline())) { 1021 if (fullRemoveInsert && (toBoxModelObject->isLayoutBlock() || toBoxModelObje ct->isLayoutInline())) {
1014 // Takes care of adding the new child correctly if toBlock and fromBlock 1022 // Takes care of adding the new child correctly if toBlock and fromBlock
1015 // have different kind of children (block vs inline). 1023 // have different kind of children (block vs inline).
1016 toBoxModelObject->addChild(virtualChildren()->removeChildNode(this, chil d), beforeChild); 1024 toBoxModelObject->addChild(virtualChildren()->removeChildNode(this, chil d), beforeChild);
1017 } else { 1025 } else {
1018 toBoxModelObject->virtualChildren()->insertChildNode(toBoxModelObject, v irtualChildren()->removeChildNode(this, child, fullRemoveInsert), beforeChild, f ullRemoveInsert); 1026 toBoxModelObject->virtualChildren()->insertChildNode(toBoxModelObject, v irtualChildren()->removeChildNode(this, child, fullRemoveInsert), beforeChild, f ullRemoveInsert);
1019 } 1027 }
1020 } 1028 }
1021 1029
1022 void LayoutBoxModelObject::moveChildrenTo(LayoutBoxModelObject* toBoxModelObject , LayoutObject* startChild, LayoutObject* endChild, LayoutObject* beforeChild, b ool fullRemoveInsert) 1030 void LayoutBoxModelObject::moveChildrenTo(LayoutBoxModelObject* toBoxModelObject , LayoutObject* startChild, LayoutObject* endChild, LayoutObject* beforeChild, b ool fullRemoveInsert)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 if (rootElementStyle->hasBackground()) 1065 if (rootElementStyle->hasBackground())
1058 return false; 1066 return false;
1059 1067
1060 if (node() != document().firstBodyElement()) 1068 if (node() != document().firstBodyElement())
1061 return false; 1069 return false;
1062 1070
1063 return true; 1071 return true;
1064 } 1072 }
1065 1073
1066 } // namespace blink 1074 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698