Implement CSS `display: flow-root` (modern clearfix)
[WebKit-https.git] / Source / WebCore / rendering / style / StyleGridData.cpp
1 /*
2  * Copyright (C) 2011 Google 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. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
14  *  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16  *  DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
17  *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18  *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20  *  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  *
24  */
25
26 #include "config.h"
27 #include "StyleGridData.h"
28
29 #include "RenderStyle.h"
30
31 namespace WebCore {
32
33 StyleGridData::StyleGridData()
34     : gridColumns(RenderStyle::initialGridColumns())
35     , gridRows(RenderStyle::initialGridRows())
36     , namedGridColumnLines(RenderStyle::initialNamedGridColumnLines())
37     , namedGridRowLines(RenderStyle::initialNamedGridRowLines())
38     , orderedNamedGridColumnLines(RenderStyle::initialOrderedNamedGridColumnLines())
39     , orderedNamedGridRowLines(RenderStyle::initialOrderedNamedGridRowLines())
40     , autoRepeatNamedGridColumnLines(RenderStyle::initialNamedGridColumnLines())
41     , autoRepeatNamedGridRowLines(RenderStyle::initialNamedGridRowLines())
42     , autoRepeatOrderedNamedGridColumnLines(RenderStyle::initialOrderedNamedGridColumnLines())
43     , autoRepeatOrderedNamedGridRowLines(RenderStyle::initialOrderedNamedGridRowLines())
44     , gridAutoFlow(RenderStyle::initialGridAutoFlow())
45     , gridAutoRows(RenderStyle::initialGridAutoRows())
46     , gridAutoColumns(RenderStyle::initialGridAutoColumns())
47     , namedGridArea(RenderStyle::initialNamedGridArea())
48     , namedGridAreaRowCount(RenderStyle::initialNamedGridAreaCount())
49     , namedGridAreaColumnCount(RenderStyle::initialNamedGridAreaCount())
50     , gridAutoRepeatColumns(RenderStyle::initialGridAutoRepeatTracks())
51     , gridAutoRepeatRows(RenderStyle::initialGridAutoRepeatTracks())
52     , autoRepeatColumnsInsertionPoint(RenderStyle::initialGridAutoRepeatInsertionPoint())
53     , autoRepeatRowsInsertionPoint(RenderStyle::initialGridAutoRepeatInsertionPoint())
54     , autoRepeatColumnsType(RenderStyle::initialGridAutoRepeatType())
55     , autoRepeatRowsType(RenderStyle::initialGridAutoRepeatType())
56 {
57 }
58
59 inline StyleGridData::StyleGridData(const StyleGridData& o)
60     : RefCounted<StyleGridData>()
61     , gridColumns(o.gridColumns)
62     , gridRows(o.gridRows)
63     , namedGridColumnLines(o.namedGridColumnLines)
64     , namedGridRowLines(o.namedGridRowLines)
65     , orderedNamedGridColumnLines(o.orderedNamedGridColumnLines)
66     , orderedNamedGridRowLines(o.orderedNamedGridRowLines)
67     , autoRepeatNamedGridColumnLines(o.autoRepeatNamedGridColumnLines)
68     , autoRepeatNamedGridRowLines(o.autoRepeatNamedGridRowLines)
69     , autoRepeatOrderedNamedGridColumnLines(o.autoRepeatOrderedNamedGridColumnLines)
70     , autoRepeatOrderedNamedGridRowLines(o.autoRepeatOrderedNamedGridRowLines)
71     , gridAutoFlow(o.gridAutoFlow)
72     , gridAutoRows(o.gridAutoRows)
73     , gridAutoColumns(o.gridAutoColumns)
74     , namedGridArea(o.namedGridArea)
75     , namedGridAreaRowCount(o.namedGridAreaRowCount)
76     , namedGridAreaColumnCount(o.namedGridAreaColumnCount)
77     , gridAutoRepeatColumns(o.gridAutoRepeatColumns)
78     , gridAutoRepeatRows(o.gridAutoRepeatRows)
79     , autoRepeatColumnsInsertionPoint(o.autoRepeatColumnsInsertionPoint)
80     , autoRepeatRowsInsertionPoint(o.autoRepeatRowsInsertionPoint)
81     , autoRepeatColumnsType(o.autoRepeatColumnsType)
82     , autoRepeatRowsType(o.autoRepeatRowsType)
83 {
84 }
85
86 Ref<StyleGridData> StyleGridData::copy() const
87 {
88     return adoptRef(*new StyleGridData(*this));
89 }
90
91 } // namespace WebCore