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

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: Update layout test expectations 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
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 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 1819
1820 void RenderBlockFlow::createFloatingObjects() 1820 void RenderBlockFlow::createFloatingObjects()
1821 { 1821 {
1822 m_floatingObjects = adoptPtr(new FloatingObjects(this, isHorizontalWritingMo de())); 1822 m_floatingObjects = adoptPtr(new FloatingObjects(this, isHorizontalWritingMo de()));
1823 } 1823 }
1824 1824
1825 void RenderBlockFlow::styleWillChange(StyleDifference diff, const RenderStyle& n ewStyle) 1825 void RenderBlockFlow::styleWillChange(StyleDifference diff, const RenderStyle& n ewStyle)
1826 { 1826 {
1827 RenderStyle* oldStyle = style(); 1827 RenderStyle* oldStyle = style();
1828 s_canPropagateFloatIntoSibling = oldStyle ? !isFloatingOrOutOfFlowPositioned () && !avoidsFloats() : false; 1828 s_canPropagateFloatIntoSibling = oldStyle ? !isFloatingOrOutOfFlowPositioned () && !avoidsFloats() : false;
1829 if (oldStyle && parent() && diff == StyleDifferenceLayout && oldStyle->posit ion() != newStyle.position() 1829 if (oldStyle && parent() && diff.needsFullLayout() && oldStyle->position() ! = newStyle.position()
1830 && containsFloats() && !isFloating() && !isOutOfFlowPositioned() && newS tyle.hasOutOfFlowPosition()) 1830 && containsFloats() && !isFloating() && !isOutOfFlowPositioned() && newS tyle.hasOutOfFlowPosition())
1831 markAllDescendantsWithFloatsForLayout(); 1831 markAllDescendantsWithFloatsForLayout();
1832 1832
1833 RenderBlock::styleWillChange(diff, newStyle); 1833 RenderBlock::styleWillChange(diff, newStyle);
1834 } 1834 }
1835 1835
1836 void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* ol dStyle) 1836 void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* ol dStyle)
1837 { 1837 {
1838 RenderBlock::styleDidChange(diff, oldStyle); 1838 RenderBlock::styleDidChange(diff, oldStyle);
1839 1839
1840 // After our style changed, if we lose our ability to propagate floats into next sibling 1840 // After our style changed, if we lose our ability to propagate floats into next sibling
1841 // blocks, then we need to find the top most parent containing that overhang ing float and 1841 // blocks, then we need to find the top most parent containing that overhang ing float and
1842 // then mark its descendants with floats for layout and clear all floats fro m its next 1842 // then mark its descendants with floats for layout and clear all floats fro m its next
1843 // sibling blocks that exist in our floating objects list. See bug 56299 and 62875. 1843 // sibling blocks that exist in our floating objects list. See bug 56299 and 62875.
1844 bool canPropagateFloatIntoSibling = !isFloatingOrOutOfFlowPositioned() && !a voidsFloats(); 1844 bool canPropagateFloatIntoSibling = !isFloatingOrOutOfFlowPositioned() && !a voidsFloats();
1845 if (diff == StyleDifferenceLayout && s_canPropagateFloatIntoSibling && !canP ropagateFloatIntoSibling && hasOverhangingFloats()) { 1845 if (diff.needsFullLayout() && s_canPropagateFloatIntoSibling && !canPropagat eFloatIntoSibling && hasOverhangingFloats()) {
1846 RenderBlockFlow* parentBlockFlow = this; 1846 RenderBlockFlow* parentBlockFlow = this;
1847 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 1847 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
1848 FloatingObjectSetIterator end = floatingObjectSet.end(); 1848 FloatingObjectSetIterator end = floatingObjectSet.end();
1849 1849
1850 for (RenderObject* curr = parent(); curr && !curr->isRenderView(); curr = curr->parent()) { 1850 for (RenderObject* curr = parent(); curr && !curr->isRenderView(); curr = curr->parent()) {
1851 if (curr->isRenderBlockFlow()) { 1851 if (curr->isRenderBlockFlow()) {
1852 RenderBlockFlow* currBlock = toRenderBlockFlow(curr); 1852 RenderBlockFlow* currBlock = toRenderBlockFlow(curr);
1853 1853
1854 if (currBlock->hasOverhangingFloats()) { 1854 if (currBlock->hasOverhangingFloats()) {
1855 for (FloatingObjectSetIterator it = floatingObjectSet.begin( ); it != end; ++it) { 1855 for (FloatingObjectSetIterator it = floatingObjectSet.begin( ); it != end; ++it) {
1856 RenderBox* renderer = (*it)->renderer(); 1856 RenderBox* renderer = (*it)->renderer();
1857 if (currBlock->hasOverhangingFloat(renderer)) { 1857 if (currBlock->hasOverhangingFloat(renderer)) {
1858 parentBlockFlow = currBlock; 1858 parentBlockFlow = currBlock;
1859 break; 1859 break;
1860 } 1860 }
1861 } 1861 }
1862 } 1862 }
1863 } 1863 }
1864 } 1864 }
1865 1865
1866 parentBlockFlow->markAllDescendantsWithFloatsForLayout(); 1866 parentBlockFlow->markAllDescendantsWithFloatsForLayout();
1867 parentBlockFlow->markSiblingsWithFloatsForLayout(); 1867 parentBlockFlow->markSiblingsWithFloatsForLayout();
1868 } 1868 }
1869 1869
1870 if (diff == StyleDifferenceLayout || !oldStyle) 1870 if (diff.needsFullLayout() || !oldStyle)
1871 createOrDestroyMultiColumnFlowThreadIfNeeded(); 1871 createOrDestroyMultiColumnFlowThreadIfNeeded();
1872 } 1872 }
1873 1873
1874 void RenderBlockFlow::updateStaticInlinePositionForChild(RenderBox* child, Layou tUnit logicalTop) 1874 void RenderBlockFlow::updateStaticInlinePositionForChild(RenderBox* child, Layou tUnit logicalTop)
1875 { 1875 {
1876 if (child->style()->isOriginalDisplayInlineType()) 1876 if (child->style()->isOriginalDisplayInlineType())
1877 setStaticInlinePositionForChild(child, logicalTop, startAlignedOffsetFor Line(logicalTop, false)); 1877 setStaticInlinePositionForChild(child, logicalTop, startAlignedOffsetFor Line(logicalTop, false));
1878 else 1878 else
1879 setStaticInlinePositionForChild(child, logicalTop, startOffsetForContent ()); 1879 setStaticInlinePositionForChild(child, logicalTop, startOffsetForContent ());
1880 } 1880 }
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
2804 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() 2804 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData()
2805 { 2805 {
2806 if (m_rareData) 2806 if (m_rareData)
2807 return *m_rareData; 2807 return *m_rareData;
2808 2808
2809 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); 2809 m_rareData = adoptPtr(new RenderBlockFlowRareData(this));
2810 return *m_rareData; 2810 return *m_rareData;
2811 } 2811 }
2812 2812
2813 } // namespace WebCore 2813 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698