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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 // Try to guess our correct logical top position. In most cases this guess w
ill | 504 // Try to guess our correct logical top position. In most cases this guess w
ill |
505 // be correct. Only if we're wrong (when we compute the real logical top pos
ition) | 505 // be correct. Only if we're wrong (when we compute the real logical top pos
ition) |
506 // will we have to potentially relayout. | 506 // will we have to potentially relayout. |
507 LayoutUnit estimateWithoutPagination; | 507 LayoutUnit estimateWithoutPagination; |
508 LayoutUnit logicalTopEstimate = estimateLogicalTopPosition(child, marginInfo
, estimateWithoutPagination); | 508 LayoutUnit logicalTopEstimate = estimateLogicalTopPosition(child, marginInfo
, estimateWithoutPagination); |
509 | 509 |
510 // Cache our old rect so that we can dirty the proper repaint rects if the c
hild moves. | 510 // Cache our old rect so that we can dirty the proper repaint rects if the c
hild moves. |
511 LayoutRect oldRect = child->frameRect(); | 511 LayoutRect oldRect = child->frameRect(); |
512 LayoutUnit oldLogicalTop = logicalTopForChild(child); | 512 LayoutUnit oldLogicalTop = logicalTopForChild(child); |
513 | 513 |
514 #if !ASSERT_DISABLED | 514 #if ASSERT_ENABLED |
515 LayoutSize oldLayoutDelta = RuntimeEnabledFeatures::repaintAfterLayoutEnable
d() ? LayoutSize() : view()->layoutDelta(); | 515 LayoutSize oldLayoutDelta = RuntimeEnabledFeatures::repaintAfterLayoutEnable
d() ? LayoutSize() : view()->layoutDelta(); |
516 #endif | 516 #endif |
517 // Go ahead and position the child as though it didn't collapse with the top
. | 517 // Go ahead and position the child as though it didn't collapse with the top
. |
518 setLogicalTopForChild(child, logicalTopEstimate, ApplyLayoutDelta); | 518 setLogicalTopForChild(child, logicalTopEstimate, ApplyLayoutDelta); |
519 | 519 |
520 RenderBlock* childRenderBlock = child->isRenderBlock() ? toRenderBlock(child
) : 0; | 520 RenderBlock* childRenderBlock = child->isRenderBlock() ? toRenderBlock(child
) : 0; |
521 RenderBlockFlow* childRenderBlockFlow = (childRenderBlock && child->isRender
BlockFlow()) ? toRenderBlockFlow(child) : 0; | 521 RenderBlockFlow* childRenderBlockFlow = (childRenderBlock && child->isRender
BlockFlow()) ? toRenderBlockFlow(child) : 0; |
522 bool markDescendantsWithFloats = false; | 522 bool markDescendantsWithFloats = false; |
523 if (logicalTopEstimate != oldLogicalTop && !child->avoidsFloats() && childRe
nderBlock && childRenderBlock->containsFloats()) { | 523 if (logicalTopEstimate != oldLogicalTop && !child->avoidsFloats() && childRe
nderBlock && childRenderBlock->containsFloats()) { |
524 markDescendantsWithFloats = true; | 524 markDescendantsWithFloats = true; |
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2244 // Special-case zero- and less-than-zero-height floats: thos
e don't touch | 2244 // Special-case zero- and less-than-zero-height floats: thos
e don't touch |
2245 // the line that they're on, but it still needs to be dirtie
d. This is | 2245 // the line that they're on, but it still needs to be dirtie
d. This is |
2246 // accomplished by pretending they have a height of 1. | 2246 // accomplished by pretending they have a height of 1. |
2247 logicalBottom = max(logicalBottom, logicalTop + 1); | 2247 logicalBottom = max(logicalBottom, logicalTop + 1); |
2248 } | 2248 } |
2249 if (floatingObject->originatingLine()) { | 2249 if (floatingObject->originatingLine()) { |
2250 if (!selfNeedsLayout()) { | 2250 if (!selfNeedsLayout()) { |
2251 ASSERT(floatingObject->originatingLine()->renderer() ==
this); | 2251 ASSERT(floatingObject->originatingLine()->renderer() ==
this); |
2252 floatingObject->originatingLine()->markDirty(); | 2252 floatingObject->originatingLine()->markDirty(); |
2253 } | 2253 } |
2254 #if !ASSERT_DISABLED | 2254 #if ASSERT_ENABLED |
2255 floatingObject->setOriginatingLine(0); | 2255 floatingObject->setOriginatingLine(0); |
2256 #endif | 2256 #endif |
2257 } | 2257 } |
2258 markLinesDirtyInBlockRange(0, logicalBottom); | 2258 markLinesDirtyInBlockRange(0, logicalBottom); |
2259 } | 2259 } |
2260 m_floatingObjects->remove(floatingObject); | 2260 m_floatingObjects->remove(floatingObject); |
2261 } | 2261 } |
2262 } | 2262 } |
2263 } | 2263 } |
2264 | 2264 |
(...skipping 538 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 |