| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 LayoutUnit pageLogicalHeight = row.logicalHeight(); | 81 LayoutUnit pageLogicalHeight = row.logicalHeight(); |
| 82 ASSERT(pageLogicalHeight); // It's not allowed to call this method if the he
ight is unknown. | 82 ASSERT(pageLogicalHeight); // It's not allowed to call this method if the he
ight is unknown. |
| 83 LayoutUnit pageLogicalBottom = row.columnLogicalTopForOffset(offsetInFlowThr
ead) + pageLogicalHeight; | 83 LayoutUnit pageLogicalBottom = row.columnLogicalTopForOffset(offsetInFlowThr
ead) + pageLogicalHeight; |
| 84 LayoutUnit remainingLogicalHeight = pageLogicalBottom - offsetInFlowThread; | 84 LayoutUnit remainingLogicalHeight = pageLogicalBottom - offsetInFlowThread; |
| 85 | 85 |
| 86 if (pageBoundaryRule == AssociateWithFormerPage) { | 86 if (pageBoundaryRule == AssociateWithFormerPage) { |
| 87 // An offset exactly at a column boundary will act as being part of the
former column in | 87 // An offset exactly at a column boundary will act as being part of the
former column in |
| 88 // question (i.e. no remaining space), rather than being part of the lat
ter (i.e. one whole | 88 // question (i.e. no remaining space), rather than being part of the lat
ter (i.e. one whole |
| 89 // column length of remaining space). | 89 // column length of remaining space). |
| 90 remainingLogicalHeight = intMod(remainingLogicalHeight, pageLogicalHeigh
t); | 90 remainingLogicalHeight = intMod(remainingLogicalHeight, pageLogicalHeigh
t); |
| 91 } else if (!remainingLogicalHeight) { |
| 92 // When pageBoundaryRule is AssociateWithLatterPage, we should never ret
urn 0, because if |
| 93 // there's no space left, it means that we should be at a column boundar
y, in which case we |
| 94 // should return the amount of space remaining in the *next* column. But
this is not true if |
| 95 // the offset is "infinite" (saturated), so allow this to happen in that
case. |
| 96 ASSERT(offsetInFlowThread.mightBeSaturated()); |
| 97 remainingLogicalHeight = pageLogicalHeight; |
| 91 } | 98 } |
| 92 return remainingLogicalHeight; | 99 return remainingLogicalHeight; |
| 93 } | 100 } |
| 94 | 101 |
| 95 bool LayoutMultiColumnSet::isPageLogicalHeightKnown() const | 102 bool LayoutMultiColumnSet::isPageLogicalHeightKnown() const |
| 96 { | 103 { |
| 97 return firstFragmentainerGroup().logicalHeight(); | 104 return firstFragmentainerGroup().logicalHeight(); |
| 98 } | 105 } |
| 99 | 106 |
| 100 LayoutUnit LayoutMultiColumnSet::nextLogicalTopForUnbreakableContent(LayoutUnit
flowThreadOffset, LayoutUnit contentLogicalHeight) const | 107 LayoutUnit LayoutMultiColumnSet::nextLogicalTopForUnbreakableContent(LayoutUnit
flowThreadOffset, LayoutUnit contentLogicalHeight) const |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 426 |
| 420 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const | 427 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const |
| 421 { | 428 { |
| 422 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi
dth(), logicalHeightInFlowThread()); | 429 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi
dth(), logicalHeightInFlowThread()); |
| 423 if (!isHorizontalWritingMode()) | 430 if (!isHorizontalWritingMode()) |
| 424 return portionRect.transposedRect(); | 431 return portionRect.transposedRect(); |
| 425 return portionRect; | 432 return portionRect; |
| 426 } | 433 } |
| 427 | 434 |
| 428 } // namespace blink | 435 } // namespace blink |
| OLD | NEW |