| 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 | 
|  | 7 #include "core/rendering/RenderMultiColumnSpannerPlaceholder.h" | 
|  | 8 | 
|  | 9 #include "core/rendering/RenderMultiColumnFlowThread.h" | 
|  | 10 | 
|  | 11 namespace blink { | 
|  | 12 | 
|  | 13 RenderMultiColumnSpannerPlaceholder* RenderMultiColumnSpannerPlaceholder::create
    Anonymous(RenderMultiColumnFlowThread* flowThread, RenderBox* spanner, RenderSty
    le* parentStyle) | 
|  | 14 { | 
|  | 15     RenderMultiColumnSpannerPlaceholder* renderer = new RenderMultiColumnSpanner
    Placeholder(flowThread, spanner); | 
|  | 16     renderer->setDocumentForAnonymous(&flowThread->document()); | 
|  | 17     RefPtr<RenderStyle> newStyle(RenderStyle::createAnonymousStyleWithDisplay(pa
    rentStyle, BLOCK)); | 
|  | 18 | 
|  | 19     // We don't want floats in the row preceding the spanner to continue on the 
    other side. | 
|  | 20     newStyle->setClear(CBOTH); | 
|  | 21 | 
|  | 22     // A spanner must be padded with a pagination strut, so that contents that c
    ome after the | 
|  | 23     // spanner don't bleed into the column preceding the spanner. | 
|  | 24     newStyle->setColumnBreakBefore(PBALWAYS); | 
|  | 25 | 
|  | 26     renderer->setStyle(newStyle.release()); | 
|  | 27     return renderer; | 
|  | 28 } | 
|  | 29 | 
|  | 30 RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder(RenderM
    ultiColumnFlowThread* flowThread, RenderBox* spanner) | 
|  | 31     : RenderBox(0) | 
|  | 32     , m_flowThread(flowThread) | 
|  | 33     , m_spanner(spanner) | 
|  | 34 { | 
|  | 35 } | 
|  | 36 | 
|  | 37 void RenderMultiColumnSpannerPlaceholder::markForPaginationRelayoutIfNeeded(Subt
    reeLayoutScope& layoutScope) | 
|  | 38 { | 
|  | 39     // Cannot skip spanner placeholder layout. We need to enter in order to adva
    nce to the column | 
|  | 40     // set following the spanner. | 
|  | 41     layoutScope.setChildNeedsLayout(this); | 
|  | 42 } | 
|  | 43 | 
|  | 44 void RenderMultiColumnSpannerPlaceholder::layout() | 
|  | 45 { | 
|  | 46     RenderBox::layout(); | 
|  | 47     m_flowThread->advanceToNextColumnSet(this); | 
|  | 48 } | 
|  | 49 | 
|  | 50 const char* RenderMultiColumnSpannerPlaceholder::renderName() const | 
|  | 51 { | 
|  | 52     return "RenderMultiColumnSpannerPlaceholder"; | 
|  | 53 } | 
|  | 54 | 
|  | 55 } // namespace blink | 
| OLD | NEW | 
|---|