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

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

Issue 700703002: Remove more float machinery. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
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 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after
1798 1798
1799 if (updatedDiff.needsPaintInvalidationLayer()) 1799 if (updatedDiff.needsPaintInvalidationLayer())
1800 toRenderLayerModelObject(this)->layer()->setShouldDoFullPaintInvalidatio nIncludingNonCompositingDescendants(); 1800 toRenderLayerModelObject(this)->layer()->setShouldDoFullPaintInvalidatio nIncludingNonCompositingDescendants();
1801 else if (diff.needsPaintInvalidationObject() || updatedDiff.needsPaintInvali dationObject()) 1801 else if (diff.needsPaintInvalidationObject() || updatedDiff.needsPaintInvali dationObject())
1802 setShouldDoFullPaintInvalidation(true); 1802 setShouldDoFullPaintInvalidation(true);
1803 } 1803 }
1804 1804
1805 void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS tyle) 1805 void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS tyle)
1806 { 1806 {
1807 if (m_style) { 1807 if (m_style) {
1808 if (isFloating() && (m_style->floating() != newStyle.floating())) 1808 if (isOutOfFlowPositioned() && (m_style->position() != newStyle.position ()))
1809 // For changes in float styles, we need to conceivably remove oursel ves
1810 // from the floating objects list.
1811 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
1812 else if (isOutOfFlowPositioned() && (m_style->position() != newStyle.pos ition()))
1813 // For changes in positioning styles, we need to conceivably remove ourselves 1809 // For changes in positioning styles, we need to conceivably remove ourselves
1814 // from the positioned objects list. 1810 // from the positioned objects list.
1815 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); 1811 toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
1816 1812
1817 s_affectsParentBlock = isFloatingOrOutOfFlowPositioned() 1813 s_affectsParentBlock = isFloatingOrOutOfFlowPositioned()
1818 && (!newStyle.isFloating() && !newStyle.hasOutOfFlowPosition()) 1814 && !newStyle.hasOutOfFlowPosition()
1819 && parent() && (parent()->isRenderBlockFlow() || parent()->isRenderI nline()); 1815 && parent() && (parent()->isRenderBlockFlow() || parent()->isRenderI nline());
1820 1816
1821 // Clearing these bits is required to avoid leaving stale renderers. 1817 // Clearing these bits is required to avoid leaving stale renderers.
1822 // FIXME: We shouldn't need that hack if our logic was totally correct. 1818 // FIXME: We shouldn't need that hack if our logic was totally correct.
1823 if (diff.needsLayout()) { 1819 if (diff.needsLayout()) {
1824 setFloating(false);
1825 clearPositionedState(); 1820 clearPositionedState();
1826 } 1821 }
1827 } else { 1822 } else {
1828 s_affectsParentBlock = false; 1823 s_affectsParentBlock = false;
1829 } 1824 }
1830 1825
1831 // Elements with non-auto touch-action will send a SetTouchAction message 1826 // Elements with non-auto touch-action will send a SetTouchAction message
1832 // on touchstart in EventHandler::handleTouchEvent, and so effectively have 1827 // on touchstart in EventHandler::handleTouchEvent, and so effectively have
1833 // a touchstart handler that must be reported. 1828 // a touchstart handler that must be reported.
1834 // 1829 //
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
2313 // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion. 2308 // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion.
2314 2309
2315 // Keep our layer hierarchy updated. Optimize for the common case where we d on't have any children 2310 // Keep our layer hierarchy updated. Optimize for the common case where we d on't have any children
2316 // and don't have a layer attached to ourselves. 2311 // and don't have a layer attached to ourselves.
2317 RenderLayer* layer = 0; 2312 RenderLayer* layer = 0;
2318 if (slowFirstChild() || hasLayer()) { 2313 if (slowFirstChild() || hasLayer()) {
2319 layer = parent()->enclosingLayer(); 2314 layer = parent()->enclosingLayer();
2320 addLayers(layer); 2315 addLayers(layer);
2321 } 2316 }
2322 2317
2323 if (!isFloating() && parent()->childrenInline()) 2318 if (parent()->childrenInline())
2324 parent()->dirtyLinesFromChangedChild(this); 2319 parent()->dirtyLinesFromChangedChild(this);
2325 } 2320 }
2326 2321
2327 void RenderObject::willBeRemovedFromTree() 2322 void RenderObject::willBeRemovedFromTree()
2328 { 2323 {
2329 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removal s which would need to be fixed first. 2324 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removal s which would need to be fixed first.
2330 2325
2331 // Keep our layer hierarchy updated. 2326 // Keep our layer hierarchy updated.
2332 if (slowFirstChild() || hasLayer()) 2327 if (slowFirstChild() || hasLayer())
2333 removeLayers(parent()->enclosingLayer()); 2328 removeLayers(parent()->enclosingLayer());
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
2840 { 2835 {
2841 if (object1) { 2836 if (object1) {
2842 const blink::RenderObject* root = object1; 2837 const blink::RenderObject* root = object1;
2843 while (root->parent()) 2838 while (root->parent())
2844 root = root->parent(); 2839 root = root->parent();
2845 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 2840 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
2846 } 2841 }
2847 } 2842 }
2848 2843
2849 #endif 2844 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/line/BreakingContextInlineHeaders.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698