blob: 344919c15bbd7aade184a4f85f8d63c54be22344 [file] [log] [blame]
hyatt@apple.com56afe452012-03-19 20:59:10 +00001/*
2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
mjs@apple.com92047332014-03-15 04:08:27 +000016 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
hyatt@apple.com56afe452012-03-19 20:59:10 +000017 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
commit-queue@webkit.org46c0f522016-11-13 10:05:43 +000026#pragma once
hyatt@apple.com56afe452012-03-19 20:59:10 +000027
28#include "RenderRegion.h"
29#include "RenderBoxRegionInfo.h"
30
31namespace WebCore {
32
33class RenderFlowThread;
34
35// RenderRegionSet represents a set of regions that all have the same width and height. It is a "composite region box" that
36// can be used to represent a single run of contiguous regions.
37//
38// By combining runs of same-size columns or pages into a single object, we significantly reduce the number of unique RenderObjects
39// required to represent those objects.
40//
41// This class is abstract and is only intended for use by renderers that generate anonymous runs of identical regions, i.e.,
42// columns and printing. RenderMultiColumnSet and RenderPageSet represent runs of columns and pages respectively.
43//
44// FIXME: For now we derive from RenderRegion, but this may change at some point.
45
46class RenderRegionSet : public RenderRegion {
hyatt@apple.comc1c39032014-04-15 23:25:58 +000047public:
48 void expandToEncompassFlowThreadContentsIfNeeded();
49
hyatt@apple.com98e65282013-02-21 02:02:24 +000050protected:
antti@apple.com454418f2016-04-25 19:49:23 +000051 RenderRegionSet(Document&, RenderStyle&&, RenderFlowThread&);
hyatt@apple.com98e65282013-02-21 02:02:24 +000052
hyatt@apple.com56afe452012-03-19 20:59:10 +000053private:
darin@apple.com49cc03e2016-03-04 17:20:46 +000054 void installFlowThread() final;
hyatt@apple.com6ccaec32012-08-21 18:15:39 +000055
darin@apple.com11ff47c2016-03-04 16:47:55 +000056 const char* renderName() const override = 0;
hyatt@apple.com07569c82012-08-31 15:47:04 +000057
darin@apple.com49cc03e2016-03-04 17:20:46 +000058 bool isRenderRegionSet() const final { return true; }
hyatt@apple.com56afe452012-03-19 20:59:10 +000059};
60
61} // namespace WebCore