| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" | 5 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutMultiColumnFlowThread.h" | 7 #include "core/layout/LayoutMultiColumnFlowThread.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 static void copyMarginProperties(ComputedStyle& placeholderStyle, const Computed
Style& spannerStyle) | 11 static void copyMarginProperties(ComputedStyle& placeholderStyle, const Computed
Style& spannerStyle) |
| 12 { | 12 { |
| 13 // We really only need the block direction margins, but there are no setters
for that in | 13 // We really only need the block direction margins, but there are no setters
for that in |
| 14 // ComputedStyle. Just copy all margin sides. The inline ones don't matter a
nyway. | 14 // ComputedStyle. Just copy all margin sides. The inline ones don't matter a
nyway. |
| 15 placeholderStyle.setMarginLeft(spannerStyle.marginLeft()); | 15 placeholderStyle.setMarginLeft(spannerStyle.marginLeft()); |
| 16 placeholderStyle.setMarginRight(spannerStyle.marginRight()); | 16 placeholderStyle.setMarginRight(spannerStyle.marginRight()); |
| 17 placeholderStyle.setMarginTop(spannerStyle.marginTop()); | 17 placeholderStyle.setMarginTop(spannerStyle.marginTop()); |
| 18 placeholderStyle.setMarginBottom(spannerStyle.marginBottom()); | 18 placeholderStyle.setMarginBottom(spannerStyle.marginBottom()); |
| 19 } | 19 } |
| 20 | 20 |
| 21 LayoutMultiColumnSpannerPlaceholder* LayoutMultiColumnSpannerPlaceholder::create
Anonymous(const ComputedStyle& parentStyle, LayoutBox& layoutObjectInFlowThread) | 21 LayoutMultiColumnSpannerPlaceholder* LayoutMultiColumnSpannerPlaceholder::create
Anonymous(const ComputedStyle& parentStyle, LayoutBox& layoutObjectInFlowThread) |
| 22 { | 22 { |
| 23 LayoutMultiColumnSpannerPlaceholder* newSpanner = new LayoutMultiColumnSpann
erPlaceholder(&layoutObjectInFlowThread); | 23 LayoutMultiColumnSpannerPlaceholder* newSpanner = new LayoutMultiColumnSpann
erPlaceholder(&layoutObjectInFlowThread); |
| 24 Document& document = layoutObjectInFlowThread.document(); | 24 Document& document = layoutObjectInFlowThread.document(); |
| 25 newSpanner->setDocumentForAnonymous(&document); | 25 newSpanner->setDocumentForAnonymous(&document); |
| 26 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp
lay(parentStyle, BLOCK); | 26 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp
lay(parentStyle, EDisplay::Block); |
| 27 copyMarginProperties(*newStyle, layoutObjectInFlowThread.styleRef()); | 27 copyMarginProperties(*newStyle, layoutObjectInFlowThread.styleRef()); |
| 28 newSpanner->setStyle(newStyle); | 28 newSpanner->setStyle(newStyle); |
| 29 return newSpanner; | 29 return newSpanner; |
| 30 } | 30 } |
| 31 | 31 |
| 32 LayoutMultiColumnSpannerPlaceholder::LayoutMultiColumnSpannerPlaceholder(LayoutB
ox* layoutObjectInFlowThread) | 32 LayoutMultiColumnSpannerPlaceholder::LayoutMultiColumnSpannerPlaceholder(LayoutB
ox* layoutObjectInFlowThread) |
| 33 : LayoutBox(nullptr) | 33 : LayoutBox(nullptr) |
| 34 , m_layoutObjectInFlowThread(layoutObjectInFlowThread) | 34 , m_layoutObjectInFlowThread(layoutObjectInFlowThread) |
| 35 { | 35 { |
| 36 } | 36 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 if (!m_layoutObjectInFlowThread->hasSelfPaintingLayer()) | 140 if (!m_layoutObjectInFlowThread->hasSelfPaintingLayer()) |
| 141 m_layoutObjectInFlowThread->paint(paintInfo, paintOffset); | 141 m_layoutObjectInFlowThread->paint(paintInfo, paintOffset); |
| 142 } | 142 } |
| 143 | 143 |
| 144 bool LayoutMultiColumnSpannerPlaceholder::nodeAtPoint(HitTestResult& result, con
st HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, H
itTestAction action) | 144 bool LayoutMultiColumnSpannerPlaceholder::nodeAtPoint(HitTestResult& result, con
st HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, H
itTestAction action) |
| 145 { | 145 { |
| 146 return !m_layoutObjectInFlowThread->hasSelfPaintingLayer() && m_layoutObject
InFlowThread->nodeAtPoint(result, locationInContainer, accumulatedOffset, action
); | 146 return !m_layoutObjectInFlowThread->hasSelfPaintingLayer() && m_layoutObject
InFlowThread->nodeAtPoint(result, locationInContainer, accumulatedOffset, action
); |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace blink | 149 } // namespace blink |
| OLD | NEW |