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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // FIXME: implement this, once we have support for multiple rows. | 61 // FIXME: implement this, once we have support for multiple rows. |
62 return m_fragmentainerGroups.first(); | 62 return m_fragmentainerGroups.first(); |
63 } | 63 } |
64 | 64 |
65 const MultiColumnFragmentainerGroup& LayoutMultiColumnSet::fragmentainerGroupAtV
isualPoint(const LayoutPoint&) const | 65 const MultiColumnFragmentainerGroup& LayoutMultiColumnSet::fragmentainerGroupAtV
isualPoint(const LayoutPoint&) const |
66 { | 66 { |
67 // FIXME: implement this, once we have support for multiple rows. | 67 // FIXME: implement this, once we have support for multiple rows. |
68 return m_fragmentainerGroups.first(); | 68 return m_fragmentainerGroups.first(); |
69 } | 69 } |
70 | 70 |
71 LayoutUnit LayoutMultiColumnSet::pageLogicalHeight() const | 71 LayoutUnit LayoutMultiColumnSet::pageLogicalHeightForOffset(LayoutUnit offsetInF
lowThread) const |
72 { | 72 { |
73 // FIXME: pageLogicalHeight() needs to take a flow thread offset parameter,
so that we can | 73 return fragmentainerGroupAtFlowThreadOffset(offsetInFlowThread).logicalHeigh
t(); |
74 // locate the right row. | 74 } |
| 75 |
| 76 LayoutUnit LayoutMultiColumnSet::pageRemainingLogicalHeightForOffset(LayoutUnit
offsetInFlowThread, PageBoundaryRule pageBoundaryRule) const |
| 77 { |
| 78 const MultiColumnFragmentainerGroup& row = fragmentainerGroupAtFlowThreadOff
set(offsetInFlowThread); |
| 79 LayoutUnit pageLogicalHeight = row.logicalHeight(); |
| 80 ASSERT(pageLogicalHeight); // It's not allowed to call this method if the he
ight is unknown. |
| 81 LayoutUnit pageLogicalBottom = row.columnLogicalTopForOffset(offsetInFlowThr
ead) + pageLogicalHeight; |
| 82 LayoutUnit remainingLogicalHeight = pageLogicalBottom - offsetInFlowThread; |
| 83 |
| 84 if (pageBoundaryRule == IncludePageBoundary) { |
| 85 // If IncludePageBoundary is set, the line exactly on the top edge of a |
| 86 // column will act as being part of the previous column. |
| 87 remainingLogicalHeight = intMod(remainingLogicalHeight, pageLogicalHeigh
t); |
| 88 } |
| 89 return remainingLogicalHeight; |
| 90 } |
| 91 |
| 92 bool LayoutMultiColumnSet::isPageLogicalHeightKnown() const |
| 93 { |
75 return firstFragmentainerGroup().logicalHeight(); | 94 return firstFragmentainerGroup().logicalHeight(); |
76 } | 95 } |
77 | 96 |
78 LayoutMultiColumnSet* LayoutMultiColumnSet::nextSiblingMultiColumnSet() const | 97 LayoutMultiColumnSet* LayoutMultiColumnSet::nextSiblingMultiColumnSet() const |
79 { | 98 { |
80 for (LayoutObject* sibling = nextSibling(); sibling; sibling = sibling->next
Sibling()) { | 99 for (LayoutObject* sibling = nextSibling(); sibling; sibling = sibling->next
Sibling()) { |
81 if (sibling->isLayoutMultiColumnSet()) | 100 if (sibling->isLayoutMultiColumnSet()) |
82 return toLayoutMultiColumnSet(sibling); | 101 return toLayoutMultiColumnSet(sibling); |
83 } | 102 } |
84 return nullptr; | 103 return nullptr; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 336 |
318 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const | 337 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const |
319 { | 338 { |
320 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi
dth(), logicalHeightInFlowThread()); | 339 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi
dth(), logicalHeightInFlowThread()); |
321 if (!isHorizontalWritingMode()) | 340 if (!isHorizontalWritingMode()) |
322 return portionRect.transposedRect(); | 341 return portionRect.transposedRect(); |
323 return portionRect; | 342 return portionRect; |
324 } | 343 } |
325 | 344 |
326 } | 345 } |
OLD | NEW |