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 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is, paintInvalidationState.paintInvalidationContainer()); | 69 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is, paintInvalidationState.paintInvalidationContainer()); |
65 m_rendererInFlowThread->invalidateTreeIfNeeded(newPaintInvalidationState); | 70 m_rendererInFlowThread->invalidateTreeIfNeeded(newPaintInvalidationState); |
66 RenderBox::invalidateTreeIfNeeded(paintInvalidationState); | 71 RenderBox::invalidateTreeIfNeeded(paintInvalidationState); |
67 } | 72 } |
68 | 73 |
| 74 void RenderMultiColumnSpannerPlaceholder::paint(const PaintInfo& paintInfo, cons
t LayoutPoint& paintOffset) |
| 75 { |
| 76 if (!m_rendererInFlowThread->hasSelfPaintingLayer()) |
| 77 m_rendererInFlowThread->paint(paintInfo, paintOffset); |
| 78 } |
| 79 |
| 80 bool RenderMultiColumnSpannerPlaceholder::nodeAtPoint(const HitTestRequest& requ
est, HitTestResult& result, const HitTestLocation& locationInContainer, const La
youtPoint& accumulatedOffset, HitTestAction action) |
| 81 { |
| 82 return !m_rendererInFlowThread->hasSelfPaintingLayer() && m_rendererInFlowTh
read->nodeAtPoint(request, result, locationInContainer, accumulatedOffset, actio
n); |
| 83 } |
| 84 |
69 const char* RenderMultiColumnSpannerPlaceholder::renderName() const | 85 const char* RenderMultiColumnSpannerPlaceholder::renderName() const |
70 { | 86 { |
71 return "RenderMultiColumnSpannerPlaceholder"; | 87 return "RenderMultiColumnSpannerPlaceholder"; |
72 } | 88 } |
73 | 89 |
74 } | 90 } |
OLD | NEW |