OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "config.h" | |
6 #include "core/rendering/RenderMultiColumnSpannerPlaceholder.h" | |
7 | |
8 namespace blink { | |
9 | |
10 RenderMultiColumnSpannerPlaceholder* RenderMultiColumnSpannerPlaceholder::create Anonymous(RenderStyle* parentStyle, RenderBox* rendererInFlowThread) | |
11 { | |
12 RenderMultiColumnSpannerPlaceholder* newSpanner = new RenderMultiColumnSpann erPlaceholder(rendererInFlowThread); | |
13 Document& document = rendererInFlowThread->document(); | |
14 newSpanner->setDocumentForAnonymous(&document); | |
15 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parentStyle, BLOCK); | |
16 newSpanner->setStyle(newStyle); | |
17 return newSpanner; | |
18 } | |
19 | |
20 RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder(RenderB ox* rendererInFlowThread) | |
21 : RenderBox(0) | |
22 , m_rendererInFlowThread(rendererInFlowThread) | |
23 { | |
24 } | |
25 | |
26 void RenderMultiColumnSpannerPlaceholder::spannerWillBeRemoved() | |
27 { | |
28 ASSERT(m_rendererInFlowThread); | |
29 RenderBox* renderer = m_rendererInFlowThread; | |
30 m_rendererInFlowThread = 0; | |
31 flowThread()->flowThreadDescendantWillBeRemoved(renderer); | |
32 // |this| should be destroyed by now. | |
33 } | |
34 | |
35 void RenderMultiColumnSpannerPlaceholder::willBeRemovedFromTree() | |
36 { | |
37 if (m_rendererInFlowThread) | |
38 m_rendererInFlowThread->setSpannerPlaceholder(0); | |
39 RenderBox::willBeRemovedFromTree(); | |
40 } | |
41 | |
42 bool RenderMultiColumnSpannerPlaceholder::needsPreferredWidthsRecalculation() co nst | |
43 { | |
44 return m_rendererInFlowThread->needsPreferredWidthsRecalculation(); | |
45 } | |
46 | |
47 void RenderMultiColumnSpannerPlaceholder::layout() | |
48 { | |
49 ASSERT(needsLayout()); | |
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. | |
57 m_rendererInFlowThread->layoutIfNeeded(); | |
58 | |
59 clearNeedsLayout(); | |
60 } | |
61 | |
62 void RenderMultiColumnSpannerPlaceholder::invalidateTreeIfNeeded(const PaintInva lidationState& paintInvalidationState) | |
63 { | |
64 if (paintInvalidationStateIsDirty()) | |
65 clearPaintInvalidationState(paintInvalidationState); | |
66 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th is, paintInvalidationState.paintInvalidationContainer()); | |
67 m_rendererInFlowThread->invalidateTreeIfNeeded(newPaintInvalidationState); | |
Julien - ping for review
2014/12/11 19:09:38
A normal implementation would call into the base c
mstensho (USE GERRIT)
2014/12/11 21:01:14
There'll be no children, but yes, I really think w
Julien - ping for review
2014/12/11 23:45:44
The fact that we need such fake overridden functio
| |
68 } | |
69 | |
70 const char* RenderMultiColumnSpannerPlaceholder::renderName() const | |
71 { | |
72 return "RenderMultiColumnSpannerPlaceholder"; | |
73 } | |
74 | |
75 } | |
OLD | NEW |