| 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 11 matching lines...) Expand all  Loading... | 
| 22  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 22  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 
| 23  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 
| 24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | 24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | 
| 25  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | 25  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | 
| 26  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 26  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 
| 27  * SUCH DAMAGE. | 27  * SUCH DAMAGE. | 
| 28  */ | 28  */ | 
| 29 | 29 | 
| 30 #include "core/layout/LayoutFlowThread.h" | 30 #include "core/layout/LayoutFlowThread.h" | 
| 31 | 31 | 
|  | 32 #include "core/layout/FragmentainerIterator.h" | 
| 32 #include "core/layout/LayoutMultiColumnSet.h" | 33 #include "core/layout/LayoutMultiColumnSet.h" | 
| 33 | 34 | 
| 34 namespace blink { | 35 namespace blink { | 
| 35 | 36 | 
| 36 LayoutFlowThread::LayoutFlowThread() | 37 LayoutFlowThread::LayoutFlowThread() | 
| 37     : LayoutBlockFlow(nullptr) | 38     : LayoutBlockFlow(nullptr) | 
| 38     , m_columnSetsInvalidated(false) | 39     , m_columnSetsInvalidated(false) | 
| 39     , m_pageLogicalSizeChanged(false) | 40     , m_pageLogicalSizeChanged(false) | 
| 40 { | 41 { | 
| 41 } | 42 } | 
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 114 { | 115 { | 
| 115     computedValues.m_position = logicalTop; | 116     computedValues.m_position = logicalTop; | 
| 116     computedValues.m_extent = LayoutUnit(); | 117     computedValues.m_extent = LayoutUnit(); | 
| 117 | 118 | 
| 118     for (LayoutMultiColumnSetList::const_iterator iter = m_multiColumnSetList.be
     gin(); iter != m_multiColumnSetList.end(); ++iter) { | 119     for (LayoutMultiColumnSetList::const_iterator iter = m_multiColumnSetList.be
     gin(); iter != m_multiColumnSetList.end(); ++iter) { | 
| 119         LayoutMultiColumnSet* columnSet = *iter; | 120         LayoutMultiColumnSet* columnSet = *iter; | 
| 120         computedValues.m_extent += columnSet->logicalHeightInFlowThread(); | 121         computedValues.m_extent += columnSet->logicalHeightInFlowThread(); | 
| 121     } | 122     } | 
| 122 } | 123 } | 
| 123 | 124 | 
|  | 125 void LayoutFlowThread::absoluteQuadsForDescendant(const LayoutBox& descendant, V
     ector<FloatQuad>& quads) | 
|  | 126 { | 
|  | 127     LayoutPoint offsetFromFlowThread; | 
|  | 128     for (const LayoutObject* object = &descendant; object != this;) { | 
|  | 129         const LayoutObject* container = object->container(); | 
|  | 130         offsetFromFlowThread += object->offsetFromContainer(container); | 
|  | 131         object = container; | 
|  | 132     } | 
|  | 133     LayoutRect boundingRectInFlowThread(offsetFromFlowThread, descendant.frameRe
     ct().size()); | 
|  | 134     // Set up a fragments relative to the descendant, in the flow thread coordin
     ate space, and | 
|  | 135     // convert each of them, individually, to absolute coordinates. | 
|  | 136     for (FragmentainerIterator iterator(*this, boundingRectInFlowThread); !itera
     tor.atEnd(); iterator.advance()) { | 
|  | 137         LayoutRect fragment = boundingRectInFlowThread; | 
|  | 138         // We use inclusiveIntersect() because intersect() would reset the coord
     inates for | 
|  | 139         // zero-height objects. | 
|  | 140         fragment.inclusiveIntersect(iterator.fragmentainerInFlowThread()); | 
|  | 141         fragment.moveBy(-offsetFromFlowThread); | 
|  | 142         quads.append(descendant.localToAbsoluteQuad(FloatRect(fragment))); | 
|  | 143     } | 
|  | 144 } | 
|  | 145 | 
| 124 bool LayoutFlowThread::nodeAtPoint(HitTestResult& result, const HitTestLocation&
      locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTes
     tAction) | 146 bool LayoutFlowThread::nodeAtPoint(HitTestResult& result, const HitTestLocation&
      locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTes
     tAction) | 
| 125 { | 147 { | 
| 126     if (hitTestAction == HitTestBlockBackground) | 148     if (hitTestAction == HitTestBlockBackground) | 
| 127         return false; | 149         return false; | 
| 128     return LayoutBlockFlow::nodeAtPoint(result, locationInContainer, accumulated
     Offset, hitTestAction); | 150     return LayoutBlockFlow::nodeAtPoint(result, locationInContainer, accumulated
     Offset, hitTestAction); | 
| 129 } | 151 } | 
| 130 | 152 | 
| 131 LayoutUnit LayoutFlowThread::pageLogicalHeightForOffset(LayoutUnit offset) | 153 LayoutUnit LayoutFlowThread::pageLogicalHeightForOffset(LayoutUnit offset) | 
| 132 { | 154 { | 
| 133     LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offset, AssociateWi
     thLatterPage); | 155     LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offset, AssociateWi
     thLatterPage); | 
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 194 | 216 | 
| 195 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded(const MultiC
     olumnSetInterval& interval) | 217 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded(const MultiC
     olumnSetInterval& interval) | 
| 196 { | 218 { | 
| 197     if (m_result) | 219     if (m_result) | 
| 198         return; | 220         return; | 
| 199     if (interval.low() <= m_offset && interval.high() > m_offset) | 221     if (interval.low() <= m_offset && interval.high() > m_offset) | 
| 200         m_result = interval.data(); | 222         m_result = interval.data(); | 
| 201 } | 223 } | 
| 202 | 224 | 
| 203 } // namespace blink | 225 } // namespace blink | 
| OLD | NEW | 
|---|