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/RenderPagedFlowThread.h"
7
8namespace blink {
9
10RenderPagedFlowThread* RenderPagedFlowThread::createAnonymous(Document& document, RenderStyle* parentStyle)
11{
12    RenderPagedFlowThread* renderer = new RenderPagedFlowThread();
13    renderer->setDocumentForAnonymous(&document);
14    renderer->setStyle(RenderStyle::createAnonymousStyleWithDisplay(parentStyle, BLOCK));
15    return renderer;
16}
17
18const char* RenderPagedFlowThread::renderName() const
19{
20    return "RenderPagedFlowThread";
21}
22
23bool RenderPagedFlowThread::needsNewWidth() const
24{
25    return progressionIsInline() != pagedBlockFlow()->style()->hasInlinePaginationAxis();
26}
27
28void RenderPagedFlowThread::updateLogicalWidth()
29{
30    // As long as we inherit from RenderMultiColumnFlowThread, we need to bypass its implementation
31    // here. We're not split into columns, so the flow thread width will just be whatever is
32    // available in the containing block.
33    RenderFlowThread::updateLogicalWidth();
34}
35
36void RenderPagedFlowThread::layout()
37{
38    setProgressionIsInline(pagedBlockFlow()->style()->hasInlinePaginationAxis());
39    RenderMultiColumnFlowThread::layout();
40}
41
42} // namespace blink
43