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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { | 241 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { |
242 // Calculate the non-auto content box height, or set it to 0 if it's aut
o. We need to know | 242 // Calculate the non-auto content box height, or set it to 0 if it's aut
o. We need to know |
243 // this before layout, so that we can figure out where to insert column
breaks. We also | 243 // this before layout, so that we can figure out where to insert column
breaks. We also |
244 // treat LayoutView (which may be paginated, which uses the multicol imp
lmentation) as | 244 // treat LayoutView (which may be paginated, which uses the multicol imp
lmentation) as |
245 // having non-auto height, since its height is deduced from the viewport
height. We use | 245 // having non-auto height, since its height is deduced from the viewport
height. We use |
246 // computeLogicalHeight() to calculate the content box height. That meth
od will clamp | 246 // computeLogicalHeight() to calculate the content box height. That meth
od will clamp |
247 // against max-height and min-height. Since we're now at the beginning o
f layout, and we | 247 // against max-height and min-height. Since we're now at the beginning o
f layout, and we |
248 // don't know the actual height of the content yet, only call that metho
d when height is | 248 // don't know the actual height of the content yet, only call that metho
d when height is |
249 // definite, or we might fool ourselves into believing that columns have
a definite height | 249 // definite, or we might fool ourselves into believing that columns have
a definite height |
250 // when they in fact don't. | 250 // when they in fact don't. |
251 // To check if we've a definite height we verify that percentage height
is resolvable | |
252 // on the first in-flow child. | |
253 LayoutUnit columnHeight; | 251 LayoutUnit columnHeight; |
254 if (!firstInFlowChildBox() || firstInFlowChildBox()->percentageLogicalHe
ightIsResolvable() || isLayoutView()) { | 252 if (hasDefiniteLogicalHeight() || isLayoutView()) { |
255 LogicalExtentComputedValues computedValues; | 253 LogicalExtentComputedValues computedValues; |
256 computeLogicalHeight(LayoutUnit(), logicalTop(), computedValues); | 254 computeLogicalHeight(LayoutUnit(), logicalTop(), computedValues); |
257 columnHeight = computedValues.m_extent - borderAndPaddingLogicalHeig
ht() - scrollbarLogicalHeight(); | 255 columnHeight = computedValues.m_extent - borderAndPaddingLogicalHeig
ht() - scrollbarLogicalHeight(); |
258 } | 256 } |
259 pageLogicalHeightChanged = columnHeight != flowThread->columnHeightAvail
able(); | 257 pageLogicalHeightChanged = columnHeight != flowThread->columnHeightAvail
able(); |
260 flowThread->setColumnHeightAvailable(std::max(columnHeight, LayoutUnit()
)); | 258 flowThread->setColumnHeightAvailable(std::max(columnHeight, LayoutUnit()
)); |
261 } else if (isLayoutFlowThread()) { | 259 } else if (isLayoutFlowThread()) { |
262 LayoutFlowThread* flowThread = toLayoutFlowThread(this); | 260 LayoutFlowThread* flowThread = toLayoutFlowThread(this); |
263 | 261 |
264 // FIXME: This is a hack to always make sure we have a page logical heig
ht, if said height | 262 // FIXME: This is a hack to always make sure we have a page logical heig
ht, if said height |
(...skipping 3488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3753 | 3751 |
3754 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); | 3752 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); |
3755 } | 3753 } |
3756 | 3754 |
3757 void LayoutBlockFlow::invalidateDisplayItemClients(PaintInvalidationReason inval
idationReason) const | 3755 void LayoutBlockFlow::invalidateDisplayItemClients(PaintInvalidationReason inval
idationReason) const |
3758 { | 3756 { |
3759 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(invalidationRe
ason); | 3757 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(invalidationRe
ason); |
3760 } | 3758 } |
3761 | 3759 |
3762 } // namespace blink | 3760 } // namespace blink |
OLD | NEW |