OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2011 Adobe Systems Incorporated. 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 24 matching lines...) Expand all Loading... |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 LayoutFlowThread::LayoutFlowThread() | 37 LayoutFlowThread::LayoutFlowThread() |
38 : LayoutBlockFlow(nullptr), | 38 : LayoutBlockFlow(nullptr), |
39 m_columnSetsInvalidated(false), | 39 m_columnSetsInvalidated(false), |
40 m_pageLogicalSizeChanged(false) {} | 40 m_pageLogicalSizeChanged(false) {} |
41 | 41 |
42 LayoutFlowThread* LayoutFlowThread::locateFlowThreadContainingBlockOf( | 42 LayoutFlowThread* LayoutFlowThread::locateFlowThreadContainingBlockOf( |
43 const LayoutObject& descendant, | 43 const LayoutObject& descendant, |
44 AncestorSearchConstraint constraint) { | 44 AncestorSearchConstraint constraint) { |
45 ASSERT(descendant.isInsideFlowThread()); | 45 DCHECK(descendant.isInsideFlowThread()); |
46 LayoutObject* curr = const_cast<LayoutObject*>(&descendant); | 46 LayoutObject* curr = const_cast<LayoutObject*>(&descendant); |
47 while (curr) { | 47 while (curr) { |
48 if (curr->isSVGChild()) | 48 if (curr->isSVGChild()) |
49 return nullptr; | 49 return nullptr; |
50 if (curr->isLayoutFlowThread()) | 50 if (curr->isLayoutFlowThread()) |
51 return toLayoutFlowThread(curr); | 51 return toLayoutFlowThread(curr); |
52 LayoutObject* container = curr->container(); | 52 LayoutObject* container = curr->container(); |
53 // If we're inside something strictly unbreakable (due to having scrollbars | 53 // If we're inside something strictly unbreakable (due to having scrollbars |
54 // or being writing mode roots, for instance), it's also strictly | 54 // or being writing mode roots, for instance), it's also strictly |
55 // unbreakable in any outer fragmentation context. As such, what goes on | 55 // unbreakable in any outer fragmentation context. As such, what goes on |
(...skipping 13 matching lines...) Expand all Loading... |
69 return nullptr; | 69 return nullptr; |
70 } | 70 } |
71 curr = curr->parent(); | 71 curr = curr->parent(); |
72 } | 72 } |
73 } | 73 } |
74 return nullptr; | 74 return nullptr; |
75 } | 75 } |
76 | 76 |
77 void LayoutFlowThread::removeColumnSetFromThread( | 77 void LayoutFlowThread::removeColumnSetFromThread( |
78 LayoutMultiColumnSet* columnSet) { | 78 LayoutMultiColumnSet* columnSet) { |
79 ASSERT(columnSet); | 79 DCHECK(columnSet); |
80 m_multiColumnSetList.erase(columnSet); | 80 m_multiColumnSetList.erase(columnSet); |
81 invalidateColumnSets(); | 81 invalidateColumnSets(); |
82 // Clear the interval tree right away, instead of leaving it around with dead | 82 // Clear the interval tree right away, instead of leaving it around with dead |
83 // objects. Not that anyone _should_ try to access the interval tree when the | 83 // objects. Not that anyone _should_ try to access the interval tree when the |
84 // column sets are marked as invalid, but this is actually possible if other | 84 // column sets are marked as invalid, but this is actually possible if other |
85 // parts of the engine has bugs that cause us to not lay out everything that | 85 // parts of the engine has bugs that cause us to not lay out everything that |
86 // was marked for layout, so that LayoutObject::assertLaidOut() (and a LOT | 86 // was marked for layout, so that LayoutObject::assertLaidOut() (and a LOT |
87 // of other assertions) fails. | 87 // of other assertions) fails. |
88 m_multiColumnSetIntervalTree.clear(); | 88 m_multiColumnSetIntervalTree.clear(); |
89 } | 89 } |
90 | 90 |
91 void LayoutFlowThread::validateColumnSets() { | 91 void LayoutFlowThread::validateColumnSets() { |
92 m_columnSetsInvalidated = false; | 92 m_columnSetsInvalidated = false; |
93 // Called to get the maximum logical width for the columnSet. | 93 // Called to get the maximum logical width for the columnSet. |
94 updateLogicalWidth(); | 94 updateLogicalWidth(); |
95 generateColumnSetIntervalTree(); | 95 generateColumnSetIntervalTree(); |
96 } | 96 } |
97 | 97 |
98 bool LayoutFlowThread::mapToVisualRectInAncestorSpaceInternal( | 98 bool LayoutFlowThread::mapToVisualRectInAncestorSpaceInternal( |
99 const LayoutBoxModelObject* ancestor, | 99 const LayoutBoxModelObject* ancestor, |
100 TransformState& transformState, | 100 TransformState& transformState, |
101 VisualRectFlags visualRectFlags) const { | 101 VisualRectFlags visualRectFlags) const { |
102 // A flow thread should never be an invalidation container. | 102 // A flow thread should never be an invalidation container. |
103 DCHECK(ancestor != this); | 103 DCHECK_NE(ancestor, this); |
104 transformState.flatten(); | 104 transformState.flatten(); |
105 LayoutRect rect(transformState.lastPlanarQuad().boundingBox()); | 105 LayoutRect rect(transformState.lastPlanarQuad().boundingBox()); |
106 rect = fragmentsBoundingBox(rect); | 106 rect = fragmentsBoundingBox(rect); |
107 transformState.setQuad(FloatQuad(FloatRect(rect))); | 107 transformState.setQuad(FloatQuad(FloatRect(rect))); |
108 return LayoutBlockFlow::mapToVisualRectInAncestorSpaceInternal( | 108 return LayoutBlockFlow::mapToVisualRectInAncestorSpaceInternal( |
109 ancestor, transformState, visualRectFlags); | 109 ancestor, transformState, visualRectFlags); |
110 } | 110 } |
111 | 111 |
112 void LayoutFlowThread::layout() { | 112 void LayoutFlowThread::layout() { |
113 m_pageLogicalSizeChanged = m_columnSetsInvalidated && everHadLayout(); | 113 m_pageLogicalSizeChanged = m_columnSetsInvalidated && everHadLayout(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 LayoutMultiColumnSet* columnSet = | 205 LayoutMultiColumnSet* columnSet = |
206 columnSetAtBlockOffset(flowThreadOffset, AssociateWithLatterPage); | 206 columnSetAtBlockOffset(flowThreadOffset, AssociateWithLatterPage); |
207 if (!columnSet) | 207 if (!columnSet) |
208 return flowThreadOffset; | 208 return flowThreadOffset; |
209 return columnSet->nextLogicalTopForUnbreakableContent(flowThreadOffset, | 209 return columnSet->nextLogicalTopForUnbreakableContent(flowThreadOffset, |
210 contentLogicalHeight); | 210 contentLogicalHeight); |
211 } | 211 } |
212 | 212 |
213 LayoutRect LayoutFlowThread::fragmentsBoundingBox( | 213 LayoutRect LayoutFlowThread::fragmentsBoundingBox( |
214 const LayoutRect& layerBoundingBox) const { | 214 const LayoutRect& layerBoundingBox) const { |
215 ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled() || | 215 DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled() || |
216 !m_columnSetsInvalidated); | 216 !m_columnSetsInvalidated); |
217 | 217 |
218 LayoutRect result; | 218 LayoutRect result; |
219 for (auto* columnSet : m_multiColumnSetList) | 219 for (auto* columnSet : m_multiColumnSetList) |
220 result.unite(columnSet->fragmentsBoundingBox(layerBoundingBox)); | 220 result.unite(columnSet->fragmentsBoundingBox(layerBoundingBox)); |
221 | 221 |
222 return result; | 222 return result; |
223 } | 223 } |
224 | 224 |
225 void LayoutFlowThread::flowThreadToContainingCoordinateSpace( | 225 void LayoutFlowThread::flowThreadToContainingCoordinateSpace( |
(...skipping 18 matching lines...) Expand all Loading... |
244 | 244 |
245 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded( | 245 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded( |
246 const MultiColumnSetInterval& interval) { | 246 const MultiColumnSetInterval& interval) { |
247 if (m_result) | 247 if (m_result) |
248 return; | 248 return; |
249 if (interval.low() <= m_offset && interval.high() > m_offset) | 249 if (interval.low() <= m_offset && interval.high() > m_offset) |
250 m_result = interval.data(); | 250 m_result = interval.data(); |
251 } | 251 } |
252 | 252 |
253 } // namespace blink | 253 } // namespace blink |
OLD | NEW |