Chromium Code Reviews

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; Renaming of some methods and small changes in StyleDifference Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | 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 1800 matching lines...)
1811 1811
1812 void RenderBlockFlow::createFloatingObjects() 1812 void RenderBlockFlow::createFloatingObjects()
1813 { 1813 {
1814 m_floatingObjects = adoptPtr(new FloatingObjects(this, isHorizontalWritingMo de())); 1814 m_floatingObjects = adoptPtr(new FloatingObjects(this, isHorizontalWritingMo de()));
1815 } 1815 }
1816 1816
1817 void RenderBlockFlow::styleWillChange(StyleDifference diff, const RenderStyle& n ewStyle) 1817 void RenderBlockFlow::styleWillChange(StyleDifference diff, const RenderStyle& n ewStyle)
1818 { 1818 {
1819 RenderStyle* oldStyle = style(); 1819 RenderStyle* oldStyle = style();
1820 s_canPropagateFloatIntoSibling = oldStyle ? !isFloatingOrOutOfFlowPositioned () && !avoidsFloats() : false; 1820 s_canPropagateFloatIntoSibling = oldStyle ? !isFloatingOrOutOfFlowPositioned () && !avoidsFloats() : false;
1821 if (oldStyle && parent() && diff == StyleDifferenceLayout && oldStyle->posit ion() != newStyle.position() 1821 if (oldStyle && parent() && diff.needsFullLayout() && oldStyle->position() ! = newStyle.position()
1822 && containsFloats() && !isFloating() && !isOutOfFlowPositioned() && newS tyle.hasOutOfFlowPosition()) 1822 && containsFloats() && !isFloating() && !isOutOfFlowPositioned() && newS tyle.hasOutOfFlowPosition())
1823 markAllDescendantsWithFloatsForLayout(); 1823 markAllDescendantsWithFloatsForLayout();
1824 1824
1825 RenderBlock::styleWillChange(diff, newStyle); 1825 RenderBlock::styleWillChange(diff, newStyle);
1826 } 1826 }
1827 1827
1828 void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* ol dStyle) 1828 void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* ol dStyle)
1829 { 1829 {
1830 RenderBlock::styleDidChange(diff, oldStyle); 1830 RenderBlock::styleDidChange(diff, oldStyle);
1831 1831
1832 // After our style changed, if we lose our ability to propagate floats into next sibling 1832 // After our style changed, if we lose our ability to propagate floats into next sibling
1833 // blocks, then we need to find the top most parent containing that overhang ing float and 1833 // blocks, then we need to find the top most parent containing that overhang ing float and
1834 // then mark its descendants with floats for layout and clear all floats fro m its next 1834 // then mark its descendants with floats for layout and clear all floats fro m its next
1835 // sibling blocks that exist in our floating objects list. See bug 56299 and 62875. 1835 // sibling blocks that exist in our floating objects list. See bug 56299 and 62875.
1836 bool canPropagateFloatIntoSibling = !isFloatingOrOutOfFlowPositioned() && !a voidsFloats(); 1836 bool canPropagateFloatIntoSibling = !isFloatingOrOutOfFlowPositioned() && !a voidsFloats();
1837 if (diff == StyleDifferenceLayout && s_canPropagateFloatIntoSibling && !canP ropagateFloatIntoSibling && hasOverhangingFloats()) { 1837 if (diff.needsFullLayout() && s_canPropagateFloatIntoSibling && !canPropagat eFloatIntoSibling && hasOverhangingFloats()) {
1838 RenderBlockFlow* parentBlockFlow = this; 1838 RenderBlockFlow* parentBlockFlow = this;
1839 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 1839 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
1840 FloatingObjectSetIterator end = floatingObjectSet.end(); 1840 FloatingObjectSetIterator end = floatingObjectSet.end();
1841 1841
1842 for (RenderObject* curr = parent(); curr && !curr->isRenderView(); curr = curr->parent()) { 1842 for (RenderObject* curr = parent(); curr && !curr->isRenderView(); curr = curr->parent()) {
1843 if (curr->isRenderBlockFlow()) { 1843 if (curr->isRenderBlockFlow()) {
1844 RenderBlockFlow* currBlock = toRenderBlockFlow(curr); 1844 RenderBlockFlow* currBlock = toRenderBlockFlow(curr);
1845 1845
1846 if (currBlock->hasOverhangingFloats()) { 1846 if (currBlock->hasOverhangingFloats()) {
1847 for (FloatingObjectSetIterator it = floatingObjectSet.begin( ); it != end; ++it) { 1847 for (FloatingObjectSetIterator it = floatingObjectSet.begin( ); it != end; ++it) {
1848 RenderBox* renderer = (*it)->renderer(); 1848 RenderBox* renderer = (*it)->renderer();
1849 if (currBlock->hasOverhangingFloat(renderer)) { 1849 if (currBlock->hasOverhangingFloat(renderer)) {
1850 parentBlockFlow = currBlock; 1850 parentBlockFlow = currBlock;
1851 break; 1851 break;
1852 } 1852 }
1853 } 1853 }
1854 } 1854 }
1855 } 1855 }
1856 } 1856 }
1857 1857
1858 parentBlockFlow->markAllDescendantsWithFloatsForLayout(); 1858 parentBlockFlow->markAllDescendantsWithFloatsForLayout();
1859 parentBlockFlow->markSiblingsWithFloatsForLayout(); 1859 parentBlockFlow->markSiblingsWithFloatsForLayout();
1860 } 1860 }
1861 1861
1862 if (diff == StyleDifferenceLayout || !oldStyle) 1862 if (diff.needsFullLayout() || !oldStyle)
1863 createOrDestroyMultiColumnFlowThreadIfNeeded(); 1863 createOrDestroyMultiColumnFlowThreadIfNeeded();
1864 } 1864 }
1865 1865
1866 void RenderBlockFlow::updateStaticInlinePositionForChild(RenderBox* child, Layou tUnit logicalTop) 1866 void RenderBlockFlow::updateStaticInlinePositionForChild(RenderBox* child, Layou tUnit logicalTop)
1867 { 1867 {
1868 if (child->style()->isOriginalDisplayInlineType()) 1868 if (child->style()->isOriginalDisplayInlineType())
1869 setStaticInlinePositionForChild(child, logicalTop, startAlignedOffsetFor Line(logicalTop, false)); 1869 setStaticInlinePositionForChild(child, logicalTop, startAlignedOffsetFor Line(logicalTop, false));
1870 else 1870 else
1871 setStaticInlinePositionForChild(child, logicalTop, startOffsetForContent ()); 1871 setStaticInlinePositionForChild(child, logicalTop, startOffsetForContent ());
1872 } 1872 }
(...skipping 920 matching lines...)
2793 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() 2793 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData()
2794 { 2794 {
2795 if (m_rareData) 2795 if (m_rareData)
2796 return *m_rareData; 2796 return *m_rareData;
2797 2797
2798 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); 2798 m_rareData = adoptPtr(new RenderBlockFlowRareData(this));
2799 return *m_rareData; 2799 return *m_rareData;
2800 } 2800 }
2801 2801
2802 } // namespace WebCore 2802 } // namespace WebCore
OLDNEW

Powered by Google App Engine