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 "config.h" | 5 #include "config.h" |
6 #include "core/rendering/RenderMultiColumnSpannerPlaceholder.h" | 6 #include "core/rendering/RenderMultiColumnSpannerPlaceholder.h" |
7 | 7 |
8 namespace blink { | 8 namespace blink { |
9 | 9 |
10 RenderMultiColumnSpannerPlaceholder* RenderMultiColumnSpannerPlaceholder::create
Anonymous(RenderStyle* parentStyle, RenderBox* rendererInFlowThread) | 10 RenderMultiColumnSpannerPlaceholder* RenderMultiColumnSpannerPlaceholder::create
Anonymous(RenderStyle* parentStyle, RenderBox* rendererInFlowThread) |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 bool RenderMultiColumnSpannerPlaceholder::needsPreferredWidthsRecalculation() co
nst | 42 bool RenderMultiColumnSpannerPlaceholder::needsPreferredWidthsRecalculation() co
nst |
43 { | 43 { |
44 return m_rendererInFlowThread->needsPreferredWidthsRecalculation(); | 44 return m_rendererInFlowThread->needsPreferredWidthsRecalculation(); |
45 } | 45 } |
46 | 46 |
47 void RenderMultiColumnSpannerPlaceholder::layout() | 47 void RenderMultiColumnSpannerPlaceholder::layout() |
48 { | 48 { |
49 ASSERT(needsLayout()); | 49 ASSERT(needsLayout()); |
50 | 50 |
51 // FIXME: actual spanner positioning isn't implemented yet. Just set it to 0
,0 for consistency | |
52 // (in case the spanner used to be something else that was laid out properly
). | |
53 m_rendererInFlowThread->setLogicalTop(LayoutUnit()); | |
54 m_rendererInFlowThread->setLogicalLeft(LayoutUnit()); | |
55 | |
56 // Lay out the actual column-span:all element. | 51 // Lay out the actual column-span:all element. |
57 m_rendererInFlowThread->layoutIfNeeded(); | 52 m_rendererInFlowThread->layoutIfNeeded(); |
58 | 53 |
| 54 // The spanner has now been laid out, so its height is known. Time to update
the placeholder's |
| 55 // height as well, so that we take up the correct amount of space in the mul
ticol container. |
| 56 updateLogicalHeight(); |
| 57 |
59 clearNeedsLayout(); | 58 clearNeedsLayout(); |
60 } | 59 } |
61 | 60 |
| 61 void RenderMultiColumnSpannerPlaceholder::computeLogicalHeight(LayoutUnit, Layou
tUnit logicalTop, LogicalExtentComputedValues& computedValues) const |
| 62 { |
| 63 computedValues.m_extent = m_rendererInFlowThread->logicalHeight(); |
| 64 computedValues.m_position = logicalTop; |
| 65 } |
| 66 |
62 void RenderMultiColumnSpannerPlaceholder::invalidateTreeIfNeeded(const PaintInva
lidationState& paintInvalidationState) | 67 void RenderMultiColumnSpannerPlaceholder::invalidateTreeIfNeeded(const PaintInva
lidationState& paintInvalidationState) |
63 { | 68 { |
64 if (paintInvalidationStateIsDirty()) | 69 if (paintInvalidationStateIsDirty()) |
65 clearPaintInvalidationState(paintInvalidationState); | 70 clearPaintInvalidationState(paintInvalidationState); |
66 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is, paintInvalidationState.paintInvalidationContainer()); | 71 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is, paintInvalidationState.paintInvalidationContainer()); |
67 m_rendererInFlowThread->invalidateTreeIfNeeded(newPaintInvalidationState); | 72 m_rendererInFlowThread->invalidateTreeIfNeeded(newPaintInvalidationState); |
68 } | 73 } |
69 | 74 |
| 75 void RenderMultiColumnSpannerPlaceholder::paint(const PaintInfo& paintInfo, cons
t LayoutPoint& paintOffset) |
| 76 { |
| 77 if (!m_rendererInFlowThread->hasSelfPaintingLayer()) |
| 78 m_rendererInFlowThread->paint(paintInfo, paintOffset); |
| 79 } |
| 80 |
| 81 bool RenderMultiColumnSpannerPlaceholder::nodeAtPoint(const HitTestRequest& requ
est, HitTestResult& result, const HitTestLocation& locationInContainer, const La
youtPoint& accumulatedOffset, HitTestAction action) |
| 82 { |
| 83 return !m_rendererInFlowThread->hasSelfPaintingLayer() && m_rendererInFlowTh
read->nodeAtPoint(request, result, locationInContainer, accumulatedOffset, actio
n); |
| 84 } |
| 85 |
70 const char* RenderMultiColumnSpannerPlaceholder::renderName() const | 86 const char* RenderMultiColumnSpannerPlaceholder::renderName() const |
71 { | 87 { |
72 return "RenderMultiColumnSpannerPlaceholder"; | 88 return "RenderMultiColumnSpannerPlaceholder"; |
73 } | 89 } |
74 | 90 |
75 } | 91 } |
OLD | NEW |