OLD | NEW |
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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if | 323 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if |
324 // we overflow or not. | 324 // we overflow or not. |
325 updateScrollInfoAfterLayout(); | 325 updateScrollInfoAfterLayout(); |
326 | 326 |
327 // Repaint with our new bounds if they are different from our old bounds. | 327 // Repaint with our new bounds if they are different from our old bounds. |
328 bool didFullRepaint = repainter.repaintAfterLayout(); | 328 bool didFullRepaint = repainter.repaintAfterLayout(); |
329 if (!didFullRepaint && m_repaintLogicalTop != m_repaintLogicalBottom && (sty
le()->visibility() == VISIBLE || enclosingLayer()->hasVisibleContent())) { | 329 if (!didFullRepaint && m_repaintLogicalTop != m_repaintLogicalBottom && (sty
le()->visibility() == VISIBLE || enclosingLayer()->hasVisibleContent())) { |
330 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 330 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
331 setShouldInvalidateOverflowForPaint(true); | 331 setShouldInvalidateOverflowForPaint(true); |
332 else | 332 else |
333 repaintOverflow(); | 333 invalidatePaintForOverflow(); |
334 } | 334 } |
335 clearNeedsLayout(); | 335 clearNeedsLayout(); |
336 } | 336 } |
337 | 337 |
338 inline bool RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit &
pageLogicalHeight, SubtreeLayoutScope& layoutScope) | 338 inline bool RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit &
pageLogicalHeight, SubtreeLayoutScope& layoutScope) |
339 { | 339 { |
340 LayoutUnit oldLeft = logicalLeft(); | 340 LayoutUnit oldLeft = logicalLeft(); |
341 if (updateLogicalWidthAndColumnWidth()) | 341 if (updateLogicalWidthAndColumnWidth()) |
342 relayoutChildren = true; | 342 relayoutChildren = true; |
343 | 343 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 // descendants. An exception is if we need a layout. In this case, we kn
ow we're going to | 631 // descendants. An exception is if we need a layout. In this case, we kn
ow we're going to |
632 // repaint ourselves (and the child) anyway. | 632 // repaint ourselves (and the child) anyway. |
633 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && childHadLayou
t && !selfNeedsLayout()) | 633 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && childHadLayou
t && !selfNeedsLayout()) |
634 child->repaintOverhangingFloats(true); | 634 child->repaintOverhangingFloats(true); |
635 else if (childHadLayout && !selfNeedsLayout() && child->checkForRepaintD
uringLayout()) | 635 else if (childHadLayout && !selfNeedsLayout() && child->checkForRepaintD
uringLayout()) |
636 child->repaintDuringLayoutIfMoved(oldRect); | 636 child->repaintDuringLayoutIfMoved(oldRect); |
637 } | 637 } |
638 | 638 |
639 if (!childHadLayout && child->checkForRepaint()) { | 639 if (!childHadLayout && child->checkForRepaint()) { |
640 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 640 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
641 child->repaint(); | 641 child->paintInvalidationForWholeRenderer(); |
642 child->repaintOverhangingFloats(true); | 642 child->repaintOverhangingFloats(true); |
643 } | 643 } |
644 | 644 |
645 if (paginated) { | 645 if (paginated) { |
646 // Check for an after page/column break. | 646 // Check for an after page/column break. |
647 LayoutUnit newHeight = applyAfterBreak(child, logicalHeight(), marginInf
o); | 647 LayoutUnit newHeight = applyAfterBreak(child, logicalHeight(), marginInf
o); |
648 if (newHeight != height()) | 648 if (newHeight != height()) |
649 setLogicalHeight(newHeight); | 649 setLogicalHeight(newHeight); |
650 } | 650 } |
651 | 651 |
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1946 // is our responsibility to paint (m_shouldPaint is set). When paintAllD
escendants is true, the latter | 1946 // is our responsibility to paint (m_shouldPaint is set). When paintAllD
escendants is true, the latter |
1947 // condition is replaced with being a descendant of us. | 1947 // condition is replaced with being a descendant of us. |
1948 if (logicalBottomForFloat(floatingObject) > logicalHeight() | 1948 if (logicalBottomForFloat(floatingObject) > logicalHeight() |
1949 && !floatingObject->renderer()->hasSelfPaintingLayer() | 1949 && !floatingObject->renderer()->hasSelfPaintingLayer() |
1950 && (floatingObject->shouldPaint() || (paintAllDescendants && floatin
gObject->renderer()->isDescendantOf(this)))) { | 1950 && (floatingObject->shouldPaint() || (paintAllDescendants && floatin
gObject->renderer()->isDescendantOf(this)))) { |
1951 | 1951 |
1952 RenderBox* floatingRenderer = floatingObject->renderer(); | 1952 RenderBox* floatingRenderer = floatingObject->renderer(); |
1953 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 1953 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
1954 floatingRenderer->setShouldDoFullPaintInvalidationAfterLayout(tr
ue); | 1954 floatingRenderer->setShouldDoFullPaintInvalidationAfterLayout(tr
ue); |
1955 else | 1955 else |
1956 floatingRenderer->repaint(); | 1956 floatingRenderer->paintInvalidationForWholeRenderer(); |
1957 | 1957 |
1958 floatingRenderer->repaintOverhangingFloats(false); | 1958 floatingRenderer->repaintOverhangingFloats(false); |
1959 } | 1959 } |
1960 } | 1960 } |
1961 } | 1961 } |
1962 | 1962 |
1963 void RenderBlockFlow::repaintOverflow() | 1963 void RenderBlockFlow::invalidatePaintForOverflow() |
1964 { | 1964 { |
1965 // FIXME: We could tighten up the left and right invalidation points if we l
et layoutInlineChildren fill them in based off the particular lines | 1965 // FIXME: We could tighten up the left and right invalidation points if we l
et layoutInlineChildren fill them in based off the particular lines |
1966 // it had to lay out. We wouldn't need the hasOverflowClip() hack in that ca
se either. | 1966 // it had to lay out. We wouldn't need the hasOverflowClip() hack in that ca
se either. |
1967 LayoutUnit repaintLogicalLeft = logicalLeftVisualOverflow(); | 1967 LayoutUnit repaintLogicalLeft = logicalLeftVisualOverflow(); |
1968 LayoutUnit repaintLogicalRight = logicalRightVisualOverflow(); | 1968 LayoutUnit repaintLogicalRight = logicalRightVisualOverflow(); |
1969 if (hasOverflowClip()) { | 1969 if (hasOverflowClip()) { |
1970 // If we have clipped overflow, we should use layout overflow as well, s
ince visual overflow from lines didn't propagate to our block's overflow. | 1970 // If we have clipped overflow, we should use layout overflow as well, s
ince visual overflow from lines didn't propagate to our block's overflow. |
1971 // Note the old code did this as well but even for overflow:visible. The
addition of hasOverflowClip() at least tightens up the hack a bit. | 1971 // Note the old code did this as well but even for overflow:visible. The
addition of hasOverflowClip() at least tightens up the hack a bit. |
1972 // layoutInlineChildren should be patched to compute the entire repaint
rect. | 1972 // layoutInlineChildren should be patched to compute the entire repaint
rect. |
1973 repaintLogicalLeft = min(repaintLogicalLeft, logicalLeftLayoutOverflow()
); | 1973 repaintLogicalLeft = min(repaintLogicalLeft, logicalLeftLayoutOverflow()
); |
(...skipping 15 matching lines...) Expand all Loading... |
1989 | 1989 |
1990 // Don't allow this rect to spill out of our overflow box. | 1990 // Don't allow this rect to spill out of our overflow box. |
1991 repaintRect.intersect(LayoutRect(LayoutPoint(), size())); | 1991 repaintRect.intersect(LayoutRect(LayoutPoint(), size())); |
1992 } | 1992 } |
1993 | 1993 |
1994 // Make sure the rect is still non-empty after intersecting for overflow abo
ve | 1994 // Make sure the rect is still non-empty after intersecting for overflow abo
ve |
1995 if (!repaintRect.isEmpty()) { | 1995 if (!repaintRect.isEmpty()) { |
1996 // Hits in media/event-attributes.html | 1996 // Hits in media/event-attributes.html |
1997 DisableCompositingQueryAsserts disabler; | 1997 DisableCompositingQueryAsserts disabler; |
1998 | 1998 |
1999 repaintRectangle(repaintRect); // We need to do a partial repaint of our
content. | 1999 invalidatePaintRectangle(repaintRect); // We need to do a partial repain
t of our content. |
2000 if (hasReflection()) | 2000 if (hasReflection()) |
2001 repaintRectangle(reflectedRect(repaintRect)); | 2001 invalidatePaintRectangle(reflectedRect(repaintRect)); |
2002 } | 2002 } |
2003 | 2003 |
2004 m_repaintLogicalTop = 0; | 2004 m_repaintLogicalTop = 0; |
2005 m_repaintLogicalBottom = 0; | 2005 m_repaintLogicalBottom = 0; |
2006 } | 2006 } |
2007 | 2007 |
2008 void RenderBlockFlow::paintFloats(PaintInfo& paintInfo, const LayoutPoint& paint
Offset, bool preservePhase) | 2008 void RenderBlockFlow::paintFloats(PaintInfo& paintInfo, const LayoutPoint& paint
Offset, bool preservePhase) |
2009 { | 2009 { |
2010 if (!m_floatingObjects) | 2010 if (!m_floatingObjects) |
2011 return; | 2011 return; |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2803 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() | 2803 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() |
2804 { | 2804 { |
2805 if (m_rareData) | 2805 if (m_rareData) |
2806 return *m_rareData; | 2806 return *m_rareData; |
2807 | 2807 |
2808 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); | 2808 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); |
2809 return *m_rareData; | 2809 return *m_rareData; |
2810 } | 2810 } |
2811 | 2811 |
2812 } // namespace WebCore | 2812 } // namespace WebCore |
OLD | NEW |