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

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

Issue 2555413002: Revert commit# 415577 "Add grid/flex layout support for <fieldset>" (Closed)
Patch Set: Created 4 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) 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. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 } 349 }
350 350
351 void LayoutBlock::removeLeftoverAnonymousBlock(LayoutBlock* child) { 351 void LayoutBlock::removeLeftoverAnonymousBlock(LayoutBlock* child) {
352 ASSERT(child->isAnonymousBlock()); 352 ASSERT(child->isAnonymousBlock());
353 ASSERT(!child->childrenInline()); 353 ASSERT(!child->childrenInline());
354 ASSERT(child->parent() == this); 354 ASSERT(child->parent() == this);
355 355
356 if (child->continuation()) 356 if (child->continuation())
357 return; 357 return;
358 358
359 if (isFieldset())
360 return;
361
362 // Promote all the leftover anonymous block's children (to become children of 359 // Promote all the leftover anonymous block's children (to become children of
363 // this block instead). We still want to keep the leftover block in the tree 360 // this block instead). We still want to keep the leftover block in the tree
364 // for a moment, for notification purposes done further below (flow threads 361 // for a moment, for notification purposes done further below (flow threads
365 // and grids). 362 // and grids).
366 child->moveAllChildrenTo(this, child->nextSibling()); 363 child->moveAllChildrenTo(this, child->nextSibling());
367 364
368 // Remove all the information in the flow thread associated with the leftover 365 // Remove all the information in the flow thread associated with the leftover
369 // anonymous block. 366 // anonymous block.
370 child->removeFromLayoutFlowThread(); 367 child->removeFromLayoutFlowThread();
371 368
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1986 LayoutBlock* LayoutBlock::createAnonymousWithParentAndDisplay( 1983 LayoutBlock* LayoutBlock::createAnonymousWithParentAndDisplay(
1987 const LayoutObject* parent, 1984 const LayoutObject* parent,
1988 EDisplay display) { 1985 EDisplay display) {
1989 // FIXME: Do we need to convert all our inline displays to block-type in the 1986 // FIXME: Do we need to convert all our inline displays to block-type in the
1990 // anonymous logic ? 1987 // anonymous logic ?
1991 EDisplay newDisplay; 1988 EDisplay newDisplay;
1992 LayoutBlock* newBox = nullptr; 1989 LayoutBlock* newBox = nullptr;
1993 if (display == EDisplay::Flex || display == EDisplay::InlineFlex) { 1990 if (display == EDisplay::Flex || display == EDisplay::InlineFlex) {
1994 newBox = LayoutFlexibleBox::createAnonymous(&parent->document()); 1991 newBox = LayoutFlexibleBox::createAnonymous(&parent->document());
1995 newDisplay = EDisplay::Flex; 1992 newDisplay = EDisplay::Flex;
1996 } else if (display == EDisplay::Grid || display == EDisplay::InlineGrid) {
1997 newBox = LayoutGrid::createAnonymous(&parent->document());
1998 newDisplay = EDisplay::Grid;
1999 } else { 1993 } else {
2000 newBox = LayoutBlockFlow::createAnonymous(&parent->document()); 1994 newBox = LayoutBlockFlow::createAnonymous(&parent->document());
2001 newDisplay = EDisplay::Block; 1995 newDisplay = EDisplay::Block;
2002 } 1996 }
2003 1997
2004 RefPtr<ComputedStyle> newStyle = 1998 RefPtr<ComputedStyle> newStyle =
2005 ComputedStyle::createAnonymousStyleWithDisplay(parent->styleRef(), 1999 ComputedStyle::createAnonymousStyleWithDisplay(parent->styleRef(),
2006 newDisplay); 2000 newDisplay);
2007 parent->updateAnonymousChildStyle(*newBox, *newStyle); 2001 parent->updateAnonymousChildStyle(*newBox, *newStyle);
2008 newBox->setStyle(newStyle.release()); 2002 newBox->setStyle(newStyle.release());
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
2207 } 2201 }
2208 2202
2209 return availableHeight; 2203 return availableHeight;
2210 } 2204 }
2211 2205
2212 bool LayoutBlock::hasDefiniteLogicalHeight() const { 2206 bool LayoutBlock::hasDefiniteLogicalHeight() const {
2213 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); 2207 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1);
2214 } 2208 }
2215 2209
2216 } // namespace blink 2210 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698