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

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

Issue 1980473002: Move collapseAnonymousBlockChild() to LayoutBlockFlow, and make it non-static. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 if (child->parent()->isLayoutGrid()) 483 if (child->parent()->isLayoutGrid())
484 toLayoutGrid(child->parent())->dirtyGrid(); 484 toLayoutGrid(child->parent())->dirtyGrid();
485 485
486 // Now remove the leftover anonymous block from the tree, and destroy it. We 'll rip it out 486 // Now remove the leftover anonymous block from the tree, and destroy it. We 'll rip it out
487 // manually from the tree before destroying it, because we don't want to tri gger any tree 487 // manually from the tree before destroying it, because we don't want to tri gger any tree
488 // adjustments with regards to anonymous blocks (or any other kind of undesi red chain-reaction). 488 // adjustments with regards to anonymous blocks (or any other kind of undesi red chain-reaction).
489 children()->removeChildNode(this, child, false); 489 children()->removeChildNode(this, child, false);
490 child->destroy(); 490 child->destroy();
491 } 491 }
492 492
493 void LayoutBlock::collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* child)
494 {
495 if (!parent->canCollapseAnonymousBlockChild())
496 return;
497 // It's possible that this block's destruction may have been triggered by th e
498 // child's removal. Just bail if the anonymous child block is already being
499 // destroyed. See crbug.com/282088
500 if (child->beingDestroyed())
501 return;
502 if (child->continuation())
503 return;
504 // Ruby elements use anonymous wrappers for ruby runs and ruby bases by desi gn, so we don't remove them.
505 if (child->isRubyRun() || child->isRubyBase())
506 return;
507 parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInva lidationReason::ChildAnonymousBlockChanged);
508
509 child->moveAllChildrenTo(parent, child->nextSibling(), child->hasLayer());
510 parent->setChildrenInline(child->childrenInline());
511
512 parent->children()->removeChildNode(parent, child, child->hasLayer());
513 child->destroy();
514 }
515
516 void LayoutBlock::startDelayUpdateScrollInfo() 493 void LayoutBlock::startDelayUpdateScrollInfo()
517 { 494 {
518 if (gDelayUpdateScrollInfo == 0) { 495 if (gDelayUpdateScrollInfo == 0) {
519 ASSERT(!gDelayedUpdateScrollInfoSet); 496 ASSERT(!gDelayedUpdateScrollInfoSet);
520 gDelayedUpdateScrollInfoSet = new DelayedUpdateScrollInfoSet; 497 gDelayedUpdateScrollInfoSet = new DelayedUpdateScrollInfoSet;
521 } 498 }
522 ASSERT(gDelayedUpdateScrollInfoSet); 499 ASSERT(gDelayedUpdateScrollInfoSet);
523 ++gDelayUpdateScrollInfo; 500 ++gDelayUpdateScrollInfo;
524 } 501 }
525 502
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
2079 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda ntSet->begin(); it != end; ++it) { 2056 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda ntSet->begin(); it != end; ++it) {
2080 LayoutBox* currBox = *it; 2057 LayoutBox* currBox = *it;
2081 ASSERT(!currBox->needsLayout()); 2058 ASSERT(!currBox->needsLayout());
2082 } 2059 }
2083 } 2060 }
2084 } 2061 }
2085 2062
2086 #endif 2063 #endif
2087 2064
2088 } // namespace blink 2065 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698