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

Side by Side Diff: sky/engine/core/rendering/RenderBlock.cpp

Issue 1070233002: Remove dead code around anonymous renderers. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « sky/engine/core/dom/PositionIterator.cpp ('k') | sky/engine/core/rendering/RenderBox.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 children()->destroyLeftoverChildren(); 132 children()->destroyLeftoverChildren();
133 133
134 if (!documentBeingDestroyed()) { 134 if (!documentBeingDestroyed()) {
135 if (firstLineBox()) { 135 if (firstLineBox()) {
136 // We can't wait for RenderBox::destroy to clear the selection, 136 // We can't wait for RenderBox::destroy to clear the selection,
137 // because by then we will have nuked the line boxes. 137 // because by then we will have nuked the line boxes.
138 // FIXME: The FrameSelection should be responsible for this when it 138 // FIXME: The FrameSelection should be responsible for this when it
139 // is notified of DOM mutations. 139 // is notified of DOM mutations.
140 if (isSelectionBorder()) 140 if (isSelectionBorder())
141 view()->clearSelection(); 141 view()->clearSelection();
142 142 } else if (parent()) {
143 // If we are an anonymous block, then our line boxes might have chil dren
144 // that will outlast this block. In the non-anonymous block case tho se
145 // children will be destroyed by the time we return from this functi on.
146 if (isAnonymousBlock()) {
147 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLi neBox()) {
148 while (InlineBox* childBox = box->firstChild())
149 childBox->remove();
150 }
151 }
152 } else if (parent())
153 parent()->dirtyLinesFromChangedChild(this); 143 parent()->dirtyLinesFromChangedChild(this);
144 }
154 } 145 }
155 146
156 m_lineBoxes.deleteLineBoxes(); 147 m_lineBoxes.deleteLineBoxes();
157 148
158 RenderBox::willBeDestroyed(); 149 RenderBox::willBeDestroyed();
159 } 150 }
160 151
161 void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle& newSt yle) 152 void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle& newSt yle)
162 { 153 {
163 RenderStyle* oldStyle = style(); 154 RenderStyle* oldStyle = style();
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 paintCarets(paintInfo, paintOffset); 462 paintCarets(paintInfo, paintOffset);
472 } 463 }
473 464
474 bool RenderBlock::shouldPaintSelectionGaps() const 465 bool RenderBlock::shouldPaintSelectionGaps() const
475 { 466 {
476 return selectionState() != SelectionNone && isSelectionRoot(); 467 return selectionState() != SelectionNone && isSelectionRoot();
477 } 468 }
478 469
479 bool RenderBlock::isSelectionRoot() const 470 bool RenderBlock::isSelectionRoot() const
480 { 471 {
481 ASSERT(node() || isAnonymous()); 472 ASSERT(node());
482 473
483 if (node() && node()->parentNode() == document()) 474 if (node() && node()->parentNode() == document())
484 return true; 475 return true;
485 476
486 if (hasOverflowClip() 477 if (hasOverflowClip()
487 || isPositioned() 478 || isPositioned()
488 || isInlineBlock() 479 || isInlineBlock()
489 || hasTransform() 480 || hasTransform()
490 || isFlexItem()) 481 || isFlexItem())
491 return true; 482 return true;
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 816
826 TrackedRendererListHashSet* RenderBlock::positionedObjects() const 817 TrackedRendererListHashSet* RenderBlock::positionedObjects() const
827 { 818 {
828 if (gPositionedDescendantsMap) 819 if (gPositionedDescendantsMap)
829 return gPositionedDescendantsMap->get(this); 820 return gPositionedDescendantsMap->get(this);
830 return 0; 821 return 0;
831 } 822 }
832 823
833 void RenderBlock::insertPositionedObject(RenderBox* o) 824 void RenderBlock::insertPositionedObject(RenderBox* o)
834 { 825 {
835 ASSERT(!isAnonymousBlock());
836 insertIntoTrackedRendererMaps(o, gPositionedDescendantsMap, gPositionedConta inerMap); 826 insertIntoTrackedRendererMaps(o, gPositionedDescendantsMap, gPositionedConta inerMap);
837 } 827 }
838 828
839 void RenderBlock::removePositionedObject(RenderBox* o) 829 void RenderBlock::removePositionedObject(RenderBox* o)
840 { 830 {
841 removeFromTrackedRendererMaps(o, gPositionedDescendantsMap, gPositionedConta inerMap); 831 removeFromTrackedRendererMaps(o, gPositionedDescendantsMap, gPositionedConta inerMap);
842 } 832 }
843 833
844 void RenderBlock::removePositionedObjects(RenderBlock* o, ContainingBlockState c ontainingBlockState) 834 void RenderBlock::removePositionedObjects(RenderBlock* o, ContainingBlockState c ontainingBlockState)
845 { 835 {
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 { 1560 {
1571 return child->isRenderBlock() ? toRenderBlock(child)->hasMarginAfterQuirk() : child->style()->hasMarginAfterQuirk(); 1561 return child->isRenderBlock() ? toRenderBlock(child)->hasMarginAfterQuirk() : child->style()->hasMarginAfterQuirk();
1572 } 1562 }
1573 1563
1574 const char* RenderBlock::renderName() const 1564 const char* RenderBlock::renderName() const
1575 { 1565 {
1576 if (isInlineBlock()) 1566 if (isInlineBlock())
1577 return "RenderBlock (inline-block)"; 1567 return "RenderBlock (inline-block)";
1578 if (isOutOfFlowPositioned()) 1568 if (isOutOfFlowPositioned())
1579 return "RenderBlock (positioned)"; 1569 return "RenderBlock (positioned)";
1580 if (isAnonymousBlock())
1581 return "RenderBlock (anonymous)";
1582 if (isAnonymous())
1583 return "RenderBlock (generated)";
1584 return "RenderBlock"; 1570 return "RenderBlock";
1585 } 1571 }
1586 1572
1587 static bool recalcNormalFlowChildOverflowIfNeeded(RenderObject* renderer) 1573 static bool recalcNormalFlowChildOverflowIfNeeded(RenderObject* renderer)
1588 { 1574 {
1589 if (renderer->isOutOfFlowPositioned() || !renderer->needsOverflowRecalcAfter StyleChange()) 1575 if (renderer->isOutOfFlowPositioned() || !renderer->needsOverflowRecalcAfter StyleChange())
1590 return false; 1576 return false;
1591 1577
1592 ASSERT(renderer->isRenderBlock()); 1578 ASSERT(renderer->isRenderBlock());
1593 return toRenderBlock(renderer)->recalcOverflowAfterStyleChange(); 1579 return toRenderBlock(renderer)->recalcOverflowAfterStyleChange();
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 1674 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
1689 { 1675 {
1690 showRenderObject(); 1676 showRenderObject();
1691 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 1677 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
1692 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 1678 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
1693 } 1679 }
1694 1680
1695 #endif 1681 #endif
1696 1682
1697 } // namespace blink 1683 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/PositionIterator.cpp ('k') | sky/engine/core/rendering/RenderBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698