| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { | 226 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { |
| 227 // Calculate the non-auto content box height, or set it to 0 if it's aut
o. We need to know | 227 // Calculate the non-auto content box height, or set it to 0 if it's aut
o. We need to know |
| 228 // this before layout, so that we can figure out where to insert column
breaks. We also | 228 // this before layout, so that we can figure out where to insert column
breaks. We also |
| 229 // treat LayoutView (which may be paginated, which uses the multicol imp
lmentation) as | 229 // treat LayoutView (which may be paginated, which uses the multicol imp
lmentation) as |
| 230 // having non-auto height, since its height is deduced from the viewport
height. We use | 230 // having non-auto height, since its height is deduced from the viewport
height. We use |
| 231 // computeLogicalHeight() to calculate the content box height. That meth
od will clamp | 231 // computeLogicalHeight() to calculate the content box height. That meth
od will clamp |
| 232 // against max-height and min-height. Since we're now at the beginning o
f layout, and we | 232 // against max-height and min-height. Since we're now at the beginning o
f layout, and we |
| 233 // don't know the actual height of the content yet, only call that metho
d when height is | 233 // don't know the actual height of the content yet, only call that metho
d when height is |
| 234 // definite, or we might fool ourselves into believing that columns have
a definite height | 234 // definite, or we might fool ourselves into believing that columns have
a definite height |
| 235 // when they in fact don't. | 235 // when they in fact don't. |
| 236 // To check if we've a definite height we verify that percentage height
is resolvable |
| 237 // on the first in-flow child. |
| 236 LayoutUnit columnHeight; | 238 LayoutUnit columnHeight; |
| 237 if (hasDefiniteLogicalHeight() || isLayoutView()) { | 239 if (!firstInFlowChildBox() || firstInFlowChildBox()->percentageLogicalHe
ightIsResolvable() || isLayoutView()) { |
| 238 LogicalExtentComputedValues computedValues; | 240 LogicalExtentComputedValues computedValues; |
| 239 computeLogicalHeight(LayoutUnit(), logicalTop(), computedValues); | 241 computeLogicalHeight(LayoutUnit(), logicalTop(), computedValues); |
| 240 columnHeight = computedValues.m_extent - borderAndPaddingLogicalHeig
ht() - scrollbarLogicalHeight(); | 242 columnHeight = computedValues.m_extent - borderAndPaddingLogicalHeig
ht() - scrollbarLogicalHeight(); |
| 241 } | 243 } |
| 242 pageLogicalHeightChanged = columnHeight != flowThread->columnHeightAvail
able(); | 244 pageLogicalHeightChanged = columnHeight != flowThread->columnHeightAvail
able(); |
| 243 flowThread->setColumnHeightAvailable(std::max(columnHeight, LayoutUnit()
)); | 245 flowThread->setColumnHeightAvailable(std::max(columnHeight, LayoutUnit()
)); |
| 244 } else if (isLayoutFlowThread()) { | 246 } else if (isLayoutFlowThread()) { |
| 245 LayoutFlowThread* flowThread = toLayoutFlowThread(this); | 247 LayoutFlowThread* flowThread = toLayoutFlowThread(this); |
| 246 | 248 |
| 247 // FIXME: This is a hack to always make sure we have a page logical heig
ht, if said height | 249 // FIXME: This is a hack to always make sure we have a page logical heig
ht, if said height |
| (...skipping 3579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3827 if (!rect.isEmpty()) | 3829 if (!rect.isEmpty()) |
| 3828 rects.append(rect); | 3830 rects.append(rect); |
| 3829 } | 3831 } |
| 3830 } | 3832 } |
| 3831 | 3833 |
| 3832 if (inlineElementContinuation) | 3834 if (inlineElementContinuation) |
| 3833 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in
lineElementContinuation->containingBlock()->location() - location()), includeBlo
ckOverflows); | 3835 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in
lineElementContinuation->containingBlock()->location() - location()), includeBlo
ckOverflows); |
| 3834 } | 3836 } |
| 3835 | 3837 |
| 3836 } // namespace blink | 3838 } // namespace blink |
| OLD | NEW |