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

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

Issue 748943002: remove childrenInline & setChildrenInline (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cr comments Created 6 years, 1 month 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 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 Color RenderObject::selectionEmphasisMarkColor() const 1633 Color RenderObject::selectionEmphasisMarkColor() const
1634 { 1634 {
1635 return selectionColor(CSSPropertyWebkitTextEmphasisColor); 1635 return selectionColor(CSSPropertyWebkitTextEmphasisColor);
1636 } 1636 }
1637 1637
1638 void RenderObject::selectionStartEnd(int& spos, int& epos) const 1638 void RenderObject::selectionStartEnd(int& spos, int& epos) const
1639 { 1639 {
1640 view()->selectionStartEnd(spos, epos); 1640 view()->selectionStartEnd(spos, epos);
1641 } 1641 }
1642 1642
1643 void RenderObject::handleDynamicFloatPositionChange()
1644 {
1645 // FIXME(sky): Inline this function.
1646
1647 // We have gone from not affecting the inline status of the parent flow to s uddenly
1648 // having an impact. See if there is a mismatch between the parent flow's
1649 // childrenInline() state and our state.
1650 setInline(style()->isDisplayInlineType());
1651 ASSERT(isInline() == parent()->childrenInline());
1652 }
1653
1654 StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff) const 1643 StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff) const
1655 { 1644 {
1656 // If transform changed, and the layer does not paint into its own separate backing, then we need to invalidate paints. 1645 // If transform changed, and the layer does not paint into its own separate backing, then we need to invalidate paints.
1657 if (diff.transformChanged()) { 1646 if (diff.transformChanged()) {
1658 // Text nodes share style with their parents but transforms don't apply to them, 1647 // Text nodes share style with their parents but transforms don't apply to them,
1659 // hence the !isText() check. 1648 // hence the !isText() check.
1660 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer( )->hasStyleDeterminedDirectCompositingReasons())) 1649 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer( )->hasStyleDeterminedDirectCompositingReasons()))
1661 diff.setNeedsPaintInvalidationLayer(); 1650 diff.setNeedsPaintInvalidationLayer();
1662 } 1651 }
1663 1652
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1806 return a->cursors() && b->cursors() && *a->cursors() == *b->cursors(); 1795 return a->cursors() && b->cursors() && *a->cursors() == *b->cursors();
1807 } 1796 }
1808 1797
1809 static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b) 1798 static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b)
1810 { 1799 {
1811 return a->cursor() == b->cursor() && (a->cursors() == b->cursors() || areNon IdenticalCursorListsEqual(a, b)); 1800 return a->cursor() == b->cursor() && (a->cursors() == b->cursors() || areNon IdenticalCursorListsEqual(a, b));
1812 } 1801 }
1813 1802
1814 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt yle) 1803 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt yle)
1815 { 1804 {
1816 if (s_affectsParentBlock) 1805 if (s_affectsParentBlock) {
1817 handleDynamicFloatPositionChange(); 1806 // An object that was floating or positioned became a normal flow object again. We have to make sure the
1807 // render tree updates as needed to accommodate the new normal flow obje ct.
1808 setInline(style()->isDisplayInlineType());
1809 ASSERT(isInline() == parent()->isRenderParagraph());
1810 }
1818 1811
1819 if (!m_parent) 1812 if (!m_parent)
1820 return; 1813 return;
1821 1814
1822 if (diff.needsFullLayout()) { 1815 if (diff.needsFullLayout()) {
1823 // If the object already needs layout, then setNeedsLayout won't do 1816 // If the object already needs layout, then setNeedsLayout won't do
1824 // any work. But if the containing block has changed, then we may need 1817 // any work. But if the containing block has changed, then we may need
1825 // to mark the new containing blocks for layout. The change that can 1818 // to mark the new containing blocks for layout. The change that can
1826 // directly affect the containing block of this object is a change to 1819 // directly affect the containing block of this object is a change to
1827 // the position style. 1820 // the position style.
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
2171 // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion. 2164 // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion.
2172 2165
2173 // Keep our layer hierarchy updated. Optimize for the common case where we d on't have any children 2166 // Keep our layer hierarchy updated. Optimize for the common case where we d on't have any children
2174 // and don't have a layer attached to ourselves. 2167 // and don't have a layer attached to ourselves.
2175 RenderLayer* layer = 0; 2168 RenderLayer* layer = 0;
2176 if (slowFirstChild() || hasLayer()) { 2169 if (slowFirstChild() || hasLayer()) {
2177 layer = parent()->enclosingLayer(); 2170 layer = parent()->enclosingLayer();
2178 addLayers(layer); 2171 addLayers(layer);
2179 } 2172 }
2180 2173
2181 if (parent()->childrenInline()) 2174 if (parent()->isRenderParagraph())
2182 parent()->dirtyLinesFromChangedChild(this); 2175 parent()->dirtyLinesFromChangedChild(this);
2183 } 2176 }
2184 2177
2185 void RenderObject::willBeRemovedFromTree() 2178 void RenderObject::willBeRemovedFromTree()
2186 { 2179 {
2187 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removal s which would need to be fixed first. 2180 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removal s which would need to be fixed first.
2188 2181
2189 // Keep our layer hierarchy updated. 2182 // Keep our layer hierarchy updated.
2190 if (slowFirstChild() || hasLayer()) 2183 if (slowFirstChild() || hasLayer())
2191 removeLayers(parent()->enclosingLayer()); 2184 removeLayers(parent()->enclosingLayer());
2192 2185
2193 if (isOutOfFlowPositioned() && parent()->childrenInline()) 2186 if (isOutOfFlowPositioned() && parent()->isRenderParagraph())
2194 parent()->dirtyLinesFromChangedChild(this); 2187 parent()->dirtyLinesFromChangedChild(this);
2195 } 2188 }
2196 2189
2197 void RenderObject::destroyAndCleanupAnonymousWrappers() 2190 void RenderObject::destroyAndCleanupAnonymousWrappers()
2198 { 2191 {
2199 // If the tree is destroyed, there is no need for a clean-up phase. 2192 // If the tree is destroyed, there is no need for a clean-up phase.
2200 if (documentBeingDestroyed()) { 2193 if (documentBeingDestroyed()) {
2201 destroy(); 2194 destroy();
2202 return; 2195 return;
2203 } 2196 }
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2610 { 2603 {
2611 if (object1) { 2604 if (object1) {
2612 const blink::RenderObject* root = object1; 2605 const blink::RenderObject* root = object1;
2613 while (root->parent()) 2606 while (root->parent())
2614 root = root->parent(); 2607 root = root->parent();
2615 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 2608 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
2616 } 2609 }
2617 } 2610 }
2618 2611
2619 #endif 2612 #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