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

Side by Side Diff: Source/core/rendering/RenderBlockFlow.cpp

Issue 236203020: Separate repaint and layout requirements of StyleDifference (Step 1) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase, Fix break Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderBlock.cpp ('k') | Source/core/rendering/RenderBox.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1796 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 1807
1808 void RenderBlockFlow::createFloatingObjects() 1808 void RenderBlockFlow::createFloatingObjects()
1809 { 1809 {
1810 m_floatingObjects = adoptPtr(new FloatingObjects(this, isHorizontalWritingMo de())); 1810 m_floatingObjects = adoptPtr(new FloatingObjects(this, isHorizontalWritingMo de()));
1811 } 1811 }
1812 1812
1813 void RenderBlockFlow::styleWillChange(StyleDifference diff, const RenderStyle& n ewStyle) 1813 void RenderBlockFlow::styleWillChange(StyleDifference diff, const RenderStyle& n ewStyle)
1814 { 1814 {
1815 RenderStyle* oldStyle = style(); 1815 RenderStyle* oldStyle = style();
1816 s_canPropagateFloatIntoSibling = oldStyle ? !isFloatingOrOutOfFlowPositioned () && !avoidsFloats() : false; 1816 s_canPropagateFloatIntoSibling = oldStyle ? !isFloatingOrOutOfFlowPositioned () && !avoidsFloats() : false;
1817 if (oldStyle && parent() && diff == StyleDifferenceLayout && oldStyle->posit ion() != newStyle.position() 1817 if (oldStyle && parent() && diff.needsFullLayout() && oldStyle->position() ! = newStyle.position()
1818 && containsFloats() && !isFloating() && !isOutOfFlowPositioned() && newS tyle.hasOutOfFlowPosition()) 1818 && containsFloats() && !isFloating() && !isOutOfFlowPositioned() && newS tyle.hasOutOfFlowPosition())
1819 markAllDescendantsWithFloatsForLayout(); 1819 markAllDescendantsWithFloatsForLayout();
1820 1820
1821 RenderBlock::styleWillChange(diff, newStyle); 1821 RenderBlock::styleWillChange(diff, newStyle);
1822 } 1822 }
1823 1823
1824 void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* ol dStyle) 1824 void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* ol dStyle)
1825 { 1825 {
1826 RenderBlock::styleDidChange(diff, oldStyle); 1826 RenderBlock::styleDidChange(diff, oldStyle);
1827 1827
1828 // After our style changed, if we lose our ability to propagate floats into next sibling 1828 // After our style changed, if we lose our ability to propagate floats into next sibling
1829 // blocks, then we need to find the top most parent containing that overhang ing float and 1829 // blocks, then we need to find the top most parent containing that overhang ing float and
1830 // then mark its descendants with floats for layout and clear all floats fro m its next 1830 // then mark its descendants with floats for layout and clear all floats fro m its next
1831 // sibling blocks that exist in our floating objects list. See bug 56299 and 62875. 1831 // sibling blocks that exist in our floating objects list. See bug 56299 and 62875.
1832 bool canPropagateFloatIntoSibling = !isFloatingOrOutOfFlowPositioned() && !a voidsFloats(); 1832 bool canPropagateFloatIntoSibling = !isFloatingOrOutOfFlowPositioned() && !a voidsFloats();
1833 if (diff == StyleDifferenceLayout && s_canPropagateFloatIntoSibling && !canP ropagateFloatIntoSibling && hasOverhangingFloats()) { 1833 if (diff.needsFullLayout() && s_canPropagateFloatIntoSibling && !canPropagat eFloatIntoSibling && hasOverhangingFloats()) {
1834 RenderBlockFlow* parentBlockFlow = this; 1834 RenderBlockFlow* parentBlockFlow = this;
1835 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 1835 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
1836 FloatingObjectSetIterator end = floatingObjectSet.end(); 1836 FloatingObjectSetIterator end = floatingObjectSet.end();
1837 1837
1838 for (RenderObject* curr = parent(); curr && !curr->isRenderView(); curr = curr->parent()) { 1838 for (RenderObject* curr = parent(); curr && !curr->isRenderView(); curr = curr->parent()) {
1839 if (curr->isRenderBlockFlow()) { 1839 if (curr->isRenderBlockFlow()) {
1840 RenderBlockFlow* currBlock = toRenderBlockFlow(curr); 1840 RenderBlockFlow* currBlock = toRenderBlockFlow(curr);
1841 1841
1842 if (currBlock->hasOverhangingFloats()) { 1842 if (currBlock->hasOverhangingFloats()) {
1843 for (FloatingObjectSetIterator it = floatingObjectSet.begin( ); it != end; ++it) { 1843 for (FloatingObjectSetIterator it = floatingObjectSet.begin( ); it != end; ++it) {
1844 RenderBox* renderer = (*it)->renderer(); 1844 RenderBox* renderer = (*it)->renderer();
1845 if (currBlock->hasOverhangingFloat(renderer)) { 1845 if (currBlock->hasOverhangingFloat(renderer)) {
1846 parentBlockFlow = currBlock; 1846 parentBlockFlow = currBlock;
1847 break; 1847 break;
1848 } 1848 }
1849 } 1849 }
1850 } 1850 }
1851 } 1851 }
1852 } 1852 }
1853 1853
1854 parentBlockFlow->markAllDescendantsWithFloatsForLayout(); 1854 parentBlockFlow->markAllDescendantsWithFloatsForLayout();
1855 parentBlockFlow->markSiblingsWithFloatsForLayout(); 1855 parentBlockFlow->markSiblingsWithFloatsForLayout();
1856 } 1856 }
1857 1857
1858 if (diff == StyleDifferenceLayout || !oldStyle) 1858 if (diff.needsFullLayout() || !oldStyle)
1859 createOrDestroyMultiColumnFlowThreadIfNeeded(); 1859 createOrDestroyMultiColumnFlowThreadIfNeeded();
1860 } 1860 }
1861 1861
1862 void RenderBlockFlow::updateStaticInlinePositionForChild(RenderBox* child, Layou tUnit logicalTop) 1862 void RenderBlockFlow::updateStaticInlinePositionForChild(RenderBox* child, Layou tUnit logicalTop)
1863 { 1863 {
1864 if (child->style()->isOriginalDisplayInlineType()) 1864 if (child->style()->isOriginalDisplayInlineType())
1865 setStaticInlinePositionForChild(child, logicalTop, startAlignedOffsetFor Line(logicalTop, false)); 1865 setStaticInlinePositionForChild(child, logicalTop, startAlignedOffsetFor Line(logicalTop, false));
1866 else 1866 else
1867 setStaticInlinePositionForChild(child, logicalTop, startOffsetForContent ()); 1867 setStaticInlinePositionForChild(child, logicalTop, startOffsetForContent ());
1868 } 1868 }
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
2789 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() 2789 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData()
2790 { 2790 {
2791 if (m_rareData) 2791 if (m_rareData)
2792 return *m_rareData; 2792 return *m_rareData;
2793 2793
2794 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); 2794 m_rareData = adoptPtr(new RenderBlockFlowRareData(this));
2795 return *m_rareData; 2795 return *m_rareData;
2796 } 2796 }
2797 2797
2798 } // namespace WebCore 2798 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlock.cpp ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698