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

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

Issue 2215133005: Add grid/flex layout support for <fieldset> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed more ClusterFuzz tests Created 4 years, 3 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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 325
326 void LayoutBlock::removeLeftoverAnonymousBlock(LayoutBlock* child) 326 void LayoutBlock::removeLeftoverAnonymousBlock(LayoutBlock* child)
327 { 327 {
328 ASSERT(child->isAnonymousBlock()); 328 ASSERT(child->isAnonymousBlock());
329 ASSERT(!child->childrenInline()); 329 ASSERT(!child->childrenInline());
330 ASSERT(child->parent() == this); 330 ASSERT(child->parent() == this);
331 331
332 if (child->continuation()) 332 if (child->continuation())
333 return; 333 return;
334 334
335 if (isFieldset())
336 return;
337
335 // Promote all the leftover anonymous block's children (to become children o f this block 338 // Promote all the leftover anonymous block's children (to become children o f this block
336 // instead). We still want to keep the leftover block in the tree for a mome nt, for notification 339 // instead). We still want to keep the leftover block in the tree for a mome nt, for notification
337 // purposes done further below (flow threads and grids). 340 // purposes done further below (flow threads and grids).
338 child->moveAllChildrenTo(this, child->nextSibling()); 341 child->moveAllChildrenTo(this, child->nextSibling());
339 342
340 // Remove all the information in the flow thread associated with the leftove r anonymous block. 343 // Remove all the information in the flow thread associated with the leftove r anonymous block.
341 child->removeFromLayoutFlowThread(); 344 child->removeFromLayoutFlowThread();
342 345
343 // LayoutGrid keeps track of its children, we must notify it about changes i n the tree. 346 // LayoutGrid keeps track of its children, we must notify it about changes i n the tree.
344 if (child->parent()->isLayoutGrid()) 347 if (child->parent()->isLayoutGrid())
(...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after
1733 } 1736 }
1734 1737
1735 LayoutBlock* LayoutBlock::createAnonymousWithParentAndDisplay(const LayoutObject * parent, EDisplay display) 1738 LayoutBlock* LayoutBlock::createAnonymousWithParentAndDisplay(const LayoutObject * parent, EDisplay display)
1736 { 1739 {
1737 // FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ? 1740 // FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ?
1738 EDisplay newDisplay; 1741 EDisplay newDisplay;
1739 LayoutBlock* newBox = nullptr; 1742 LayoutBlock* newBox = nullptr;
1740 if (display == FLEX || display == INLINE_FLEX) { 1743 if (display == FLEX || display == INLINE_FLEX) {
1741 newBox = LayoutFlexibleBox::createAnonymous(&parent->document()); 1744 newBox = LayoutFlexibleBox::createAnonymous(&parent->document());
1742 newDisplay = FLEX; 1745 newDisplay = FLEX;
1746 } else if (display == GRID || display == INLINE_GRID) {
1747 newBox = LayoutGrid::createAnonymous(&parent->document());
1748 newDisplay = GRID;
1743 } else { 1749 } else {
1744 newBox = LayoutBlockFlow::createAnonymous(&parent->document()); 1750 newBox = LayoutBlockFlow::createAnonymous(&parent->document());
1745 newDisplay = BLOCK; 1751 newDisplay = BLOCK;
1746 } 1752 }
1747 1753
1748 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp lay(parent->styleRef(), newDisplay); 1754 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp lay(parent->styleRef(), newDisplay);
1749 parent->updateAnonymousChildStyle(*newBox, *newStyle); 1755 parent->updateAnonymousChildStyle(*newBox, *newStyle);
1750 newBox->setStyle(newStyle.release()); 1756 newBox->setStyle(newStyle.release());
1751 return newBox; 1757 return newBox;
1752 } 1758 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda ntSet->begin(); it != end; ++it) { 1877 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda ntSet->begin(); it != end; ++it) {
1872 LayoutBox* currBox = *it; 1878 LayoutBox* currBox = *it;
1873 ASSERT(!currBox->needsLayout()); 1879 ASSERT(!currBox->needsLayout());
1874 } 1880 }
1875 } 1881 }
1876 } 1882 }
1877 1883
1878 #endif 1884 #endif
1879 1885
1880 } // namespace blink 1886 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698