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

Side by Side Diff: sky/engine/core/rendering/RenderObject.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/rendering/RenderObject.h ('k') | sky/engine/core/rendering/RenderParagraph.cpp » ('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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 while (object) { 476 while (object) {
477 if (object->selfNeedsLayout()) 477 if (object->selfNeedsLayout())
478 return; 478 return;
479 479
480 // Don't mark the outermost object of an unrooted subtree. That object w ill be 480 // Don't mark the outermost object of an unrooted subtree. That object w ill be
481 // marked when the subtree is added to the document. 481 // marked when the subtree is added to the document.
482 RenderObject* container = object->container(); 482 RenderObject* container = object->container();
483 if (!container && !object->isRenderView()) 483 if (!container && !object->isRenderView())
484 return; 484 return;
485 if (!last->isText() && last->style()->hasOutOfFlowPosition()) { 485 if (!last->isText() && last->style()->hasOutOfFlowPosition()) {
486 bool willSkipRelativelyPositionedInlines = !object->isRenderBlock() || object->isAnonymousBlock(); 486 bool willSkipRelativelyPositionedInlines = !object->isRenderBlock();
487 // Skip relatively positioned inlines and anonymous blocks to get to the enclosing RenderBlock. 487 // Skip relatively positioned inlines and anonymous blocks to get to the enclosing RenderBlock.
488 while (object && (!object->isRenderBlock() || object->isAnonymousBlo ck())) 488 while (object && !object->isRenderBlock())
489 object = object->container(); 489 object = object->container();
490 if (!object || object->posChildNeedsLayout()) 490 if (!object || object->posChildNeedsLayout())
491 return; 491 return;
492 if (willSkipRelativelyPositionedInlines) 492 if (willSkipRelativelyPositionedInlines)
493 container = object->container(); 493 container = object->container();
494 object->setPosChildNeedsLayout(true); 494 object->setPosChildNeedsLayout(true);
495 simplifiedNormalFlowLayout = true; 495 simplifiedNormalFlowLayout = true;
496 ASSERT(!object->isSetNeedsLayoutForbidden()); 496 ASSERT(!object->isSetNeedsLayoutForbidden());
497 } else if (simplifiedNormalFlowLayout) { 497 } else if (simplifiedNormalFlowLayout) {
498 if (object->needsSimplifiedNormalFlowLayout()) 498 if (object->needsSimplifiedNormalFlowLayout())
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 if (o->style()->hasInFlowPosition() && o->isInline() && !o->isReplac ed()) { 587 if (o->style()->hasInFlowPosition() && o->isInline() && !o->isReplac ed()) {
588 o = o->containingBlock(); 588 o = o->containingBlock();
589 break; 589 break;
590 } 590 }
591 591
592 o = o->parent(); 592 o = o->parent();
593 } 593 }
594 594
595 if (o && !o->isRenderBlock()) 595 if (o && !o->isRenderBlock())
596 o = o->containingBlock(); 596 o = o->containingBlock();
597
598 while (o && o->isAnonymousBlock())
599 o = o->containingBlock();
600 } else { 597 } else {
601 while (o && ((o->isInline() && !o->isReplaced()) || !o->isRenderBlock()) ) 598 while (o && ((o->isInline() && !o->isReplaced()) || !o->isRenderBlock()) )
602 o = o->parent(); 599 o = o->parent();
603 } 600 }
604 601
605 if (!o || !o->isRenderBlock()) 602 if (!o || !o->isRenderBlock())
606 return 0; // This can still happen in case of an orphaned tree 603 return 0; // This can still happen in case of an orphaned tree
607 604
608 return toRenderBlock(o); 605 return toRenderBlock(o);
609 } 606 }
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removal s which would need to be fixed first. 1580 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removal s which would need to be fixed first.
1584 1581
1585 // Keep our layer hierarchy updated. 1582 // Keep our layer hierarchy updated.
1586 if (slowFirstChild() || hasLayer()) 1583 if (slowFirstChild() || hasLayer())
1587 removeLayers(parent()->enclosingLayer()); 1584 removeLayers(parent()->enclosingLayer());
1588 1585
1589 if (isOutOfFlowPositioned() && parent()->isRenderParagraph()) 1586 if (isOutOfFlowPositioned() && parent()->isRenderParagraph())
1590 parent()->dirtyLinesFromChangedChild(this); 1587 parent()->dirtyLinesFromChangedChild(this);
1591 } 1588 }
1592 1589
1593 void RenderObject::destroyAndCleanupAnonymousWrappers()
1594 {
1595 // If the tree is destroyed, there is no need for a clean-up phase.
1596 if (documentBeingDestroyed()) {
1597 destroy();
1598 return;
1599 }
1600
1601 RenderObject* destroyRoot = this;
1602 for (RenderObject* destroyRootParent = destroyRoot->parent(); destroyRootPar ent && destroyRootParent->isAnonymous(); destroyRoot = destroyRootParent, destro yRootParent = destroyRootParent->parent()) {
1603 if (destroyRootParent->slowFirstChild() != this || destroyRootParent->sl owLastChild() != this)
1604 break;
1605 }
1606
1607 destroyRoot->destroy();
1608
1609 // WARNING: |this| is deleted here.
1610 }
1611
1612 void RenderObject::destroy() 1590 void RenderObject::destroy()
1613 { 1591 {
1614 #if ENABLE(ASSERT) && ENABLE(OILPAN) 1592 #if ENABLE(ASSERT) && ENABLE(OILPAN)
1615 ASSERT(!m_didCallDestroy); 1593 ASSERT(!m_didCallDestroy);
1616 m_didCallDestroy = true; 1594 m_didCallDestroy = true;
1617 #endif 1595 #endif
1618 willBeDestroyed(); 1596 willBeDestroyed();
1619 postDestroy(); 1597 postDestroy();
1620 } 1598 }
1621 1599
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
1932 { 1910 {
1933 if (object1) { 1911 if (object1) {
1934 const blink::RenderObject* root = object1; 1912 const blink::RenderObject* root = object1;
1935 while (root->parent()) 1913 while (root->parent())
1936 root = root->parent(); 1914 root = root->parent();
1937 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 1915 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
1938 } 1916 }
1939 } 1917 }
1940 1918
1941 #endif 1919 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/RenderParagraph.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698