Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 647 // If we make an object's children inline we are going to frustrate any futu re attempts to remove | 647 // If we make an object's children inline we are going to frustrate any futu re attempts to remove |
| 648 // floats from its children's float-lists before the next layout happens so clear down all the floatlists | 648 // floats from its children's float-lists before the next layout happens so clear down all the floatlists |
| 649 // now - they will be rebuilt at layout. | 649 // now - they will be rebuilt at layout. |
| 650 toLayoutBlockFlow(this)->removeFloatingObjectsFromDescendants(); | 650 toLayoutBlockFlow(this)->removeFloatingObjectsFromDescendants(); |
| 651 | 651 |
| 652 for (size_t i = 0; i < blocksToRemove.size(); i++) | 652 for (size_t i = 0; i < blocksToRemove.size(); i++) |
| 653 collapseAnonymousBlockChild(this, blocksToRemove[i]); | 653 collapseAnonymousBlockChild(this, blocksToRemove[i]); |
| 654 setChildrenInline(true); | 654 setChildrenInline(true); |
| 655 } | 655 } |
| 656 | 656 |
| 657 bool LayoutBlock::collapseLoneAnonymousBlock(LayoutBlock* child) | |
| 658 { | |
| 659 if (!child->isAnonymousBlock()) | |
| 660 return false; | |
| 661 if (child->beingDestroyed()) | |
|
mstensho (USE GERRIT)
2016/01/18 20:06:24
Do you really need this? collapseAnonymousBlockChi
| |
| 662 return false; | |
| 663 if (child->nextSibling() || child->continuation()) | |
|
mstensho (USE GERRIT)
2016/01/18 20:06:24
Looks like we're missing a child->previousSibling(
| |
| 664 return false; | |
| 665 LayoutBlock* parent = child->containingBlock(); | |
| 666 if (parent->isRubyBase() || parent->isRubyRun()) | |
|
mstensho (USE GERRIT)
2016/01/18 20:06:24
Ah... ruby, out of the blue. But I guess that's ho
| |
| 667 return false; | |
| 668 collapseAnonymousBlockChild(parent, child); | |
| 669 return true; | |
| 670 } | |
| 671 | |
| 657 void LayoutBlock::collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* child) | 672 void LayoutBlock::collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* child) |
| 658 { | 673 { |
| 659 // It's possible that this block's destruction may have been triggered by th e | 674 // It's possible that this block's destruction may have been triggered by th e |
| 660 // child's removal. Just bail if the anonymous child block is already being | 675 // child's removal. Just bail if the anonymous child block is already being |
| 661 // destroyed. See crbug.com/282088 | 676 // destroyed. See crbug.com/282088 |
| 662 if (child->beingDestroyed()) | 677 if (child->beingDestroyed()) |
| 663 return; | 678 return; |
| 664 parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInva lidationReason::ChildAnonymousBlockChanged); | 679 parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInva lidationReason::ChildAnonymousBlockChanged); |
| 665 | 680 |
| 666 child->moveAllChildrenTo(parent, child->nextSibling(), child->hasLayer()); | 681 child->moveAllChildrenTo(parent, child->nextSibling(), child->hasLayer()); |
| (...skipping 2244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2911 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const | 2926 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const |
| 2912 { | 2927 { |
| 2913 showLayoutObject(); | 2928 showLayoutObject(); |
| 2914 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) | 2929 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) |
| 2915 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); | 2930 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); |
| 2916 } | 2931 } |
| 2917 | 2932 |
| 2918 #endif | 2933 #endif |
| 2919 | 2934 |
| 2920 } // namespace blink | 2935 } // namespace blink |
| OLD | NEW |