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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 LayoutMultiColumnSet* LayoutMultiColumnFlowThread::lastMultiColumnSet() const | 67 LayoutMultiColumnSet* LayoutMultiColumnFlowThread::lastMultiColumnSet() const |
68 { | 68 { |
69 for (LayoutObject* sibling = multiColumnBlockFlow()->lastChild(); sibling; s
ibling = sibling->previousSibling()) { | 69 for (LayoutObject* sibling = multiColumnBlockFlow()->lastChild(); sibling; s
ibling = sibling->previousSibling()) { |
70 if (sibling->isLayoutMultiColumnSet()) | 70 if (sibling->isLayoutMultiColumnSet()) |
71 return toLayoutMultiColumnSet(sibling); | 71 return toLayoutMultiColumnSet(sibling); |
72 } | 72 } |
73 return nullptr; | 73 return nullptr; |
74 } | 74 } |
75 | 75 |
| 76 // Find the next layout object that has the multicol container in its containing
block chain. |
76 static LayoutObject* nextInPreOrderAfterChildrenSkippingOutOfFlow(LayoutMultiCol
umnFlowThread* flowThread, LayoutObject* descendant) | 77 static LayoutObject* nextInPreOrderAfterChildrenSkippingOutOfFlow(LayoutMultiCol
umnFlowThread* flowThread, LayoutObject* descendant) |
77 { | 78 { |
78 ASSERT(descendant->isDescendantOf(flowThread)); | 79 ASSERT(descendant->isDescendantOf(flowThread)); |
79 LayoutObject* object = descendant->nextInPreOrderAfterChildren(flowThread); | 80 LayoutObject* object = descendant->nextInPreOrderAfterChildren(flowThread); |
80 while (object) { | 81 while (object) { |
81 // Walk through the siblings and find the first one which is either in-f
low or has this | 82 // Walk through the siblings and find the first one which is either in-f
low or has this |
82 // flow thread as its containing block flow thread. | 83 // flow thread as its containing block flow thread. |
83 if (!object->isOutOfFlowPositioned()) | 84 if (!object->isOutOfFlowPositioned()) |
84 break; | 85 break; |
85 if (object->containingBlock()->flowThreadContainingBlock() == flowThread
) { | 86 if (object->containingBlock()->flowThreadContainingBlock() == flowThread
) { |
86 // This out-of-flow object is still part of the flow thread, because
its containing | 87 // This out-of-flow object is still part of the flow thread, because
its containing |
87 // block (probably relatively positioned) is part of the flow thread
. | 88 // block (probably relatively positioned) is part of the flow thread
. |
88 break; | 89 break; |
89 } | 90 } |
90 object = object->nextInPreOrderAfterChildren(flowThread); | 91 object = object->nextInPreOrderAfterChildren(flowThread); |
91 } | 92 } |
92 return object; | 93 return object; |
93 } | 94 } |
94 | 95 |
| 96 // Find the previous layout object that has the multicol container in its contai
ning block chain. |
95 static LayoutObject* previousInPreOrderSkippingOutOfFlow(LayoutMultiColumnFlowTh
read* flowThread, LayoutObject* descendant) | 97 static LayoutObject* previousInPreOrderSkippingOutOfFlow(LayoutMultiColumnFlowTh
read* flowThread, LayoutObject* descendant) |
96 { | 98 { |
97 ASSERT(descendant->isDescendantOf(flowThread)); | 99 ASSERT(descendant->isDescendantOf(flowThread)); |
98 LayoutObject* object = descendant->previousInPreOrder(flowThread); | 100 LayoutObject* object = descendant->previousInPreOrder(flowThread); |
99 while (object && object != flowThread) { | 101 while (object && object != flowThread) { |
100 // Walk through the siblings and find the first one which is either in-f
low or has this | 102 if (object->isColumnSpanAll() || object->flowThreadContainingBlock() ==
flowThread) |
101 // flow thread as its containing block flow thread. | |
102 if (!object->isOutOfFlowPositioned()) | |
103 break; | 103 break; |
104 if (object->containingBlock()->flowThreadContainingBlock() == flowThread
) { | 104 // We're inside something that's out-of-flow. Keep looking upwards and b
ackwards in the tree. |
105 // This out-of-flow object is still part of the flow thread, because
its containing | |
106 // block (probably relatively positioned) is part of the flow thread
. | |
107 break; | |
108 } | |
109 object = object->previousInPreOrder(flowThread); | 105 object = object->previousInPreOrder(flowThread); |
110 } | 106 } |
111 return object && object != flowThread ? object : nullptr; | 107 return object && object != flowThread ? object : nullptr; |
112 } | 108 } |
113 | 109 |
114 static LayoutObject* firstLayoutObjectInSet(LayoutMultiColumnSet* multicolSet) | 110 static LayoutObject* firstLayoutObjectInSet(LayoutMultiColumnSet* multicolSet) |
115 { | 111 { |
116 LayoutBox* sibling = multicolSet->previousSiblingMultiColumnBox(); | 112 LayoutBox* sibling = multicolSet->previousSiblingMultiColumnBox(); |
117 if (!sibling) | 113 if (!sibling) |
118 return multicolSet->flowThread()->firstChild(); | 114 return multicolSet->flowThread()->firstChild(); |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 } | 793 } |
798 | 794 |
799 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const | 795 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const |
800 { | 796 { |
801 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) | 797 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) |
802 return columnSet->pageLogicalHeight(); | 798 return columnSet->pageLogicalHeight(); |
803 return false; | 799 return false; |
804 } | 800 } |
805 | 801 |
806 } | 802 } |
OLD | NEW |