OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 * | 21 * |
22 */ | 22 */ |
23 | 23 |
24 #ifndef LayoutFieldset_h | 24 #ifndef LayoutFieldset_h |
25 #define LayoutFieldset_h | 25 #define LayoutFieldset_h |
26 | 26 |
27 #include "core/layout/LayoutBlockFlow.h" | 27 #include "core/layout/LayoutFlexibleBox.h" |
28 | 28 |
29 namespace blink { | 29 namespace blink { |
30 | 30 |
31 class LayoutFieldset final : public LayoutBlockFlow { | 31 class LayoutFieldset final : public LayoutFlexibleBox { |
32 public: | 32 public: |
33 explicit LayoutFieldset(Element*); | 33 explicit LayoutFieldset(Element*); |
34 | 34 |
35 LayoutBox* findInFlowLegend() const; | 35 LayoutBox* findInFlowLegend() const; |
36 | 36 |
37 const char* name() const override { return "LayoutFieldset"; } | 37 const char* name() const override { return "LayoutFieldset"; } |
38 | 38 |
39 private: | 39 private: |
40 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectFieldset || LayoutBlockFlow::isOfType(type); } | 40 void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nullptr) o
verride; |
41 | |
42 LayoutObject* layoutSpecialExcludedChild(bool relayoutChildren, SubtreeLayou
tScope&) override; | |
43 | |
44 void computePreferredLogicalWidths() override; | |
45 bool avoidsFloats() const override { return true; } | 41 bool avoidsFloats() const override { return true; } |
46 | 42 |
| 43 // We override the two baseline functions because we want our baseline to be
the bottom of our margin box. |
| 44 int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePo
sitionMode) const override; |
| 45 int inlineBlockBaseline(LineDirectionMode) const override { return -1; } |
| 46 |
| 47 void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit&
maxLogicalWidth) const override; |
| 48 bool createsAnonymousWrapper() const override { return true; } |
| 49 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectFieldset || LayoutFlexibleBox::isOfType(type); } |
| 50 LayoutObject* layoutSpecialExcludedChild(bool relayoutChildren, SubtreeLayou
tScope&) override; |
47 void paintBoxDecorationBackground(const PaintInfo&, const LayoutPoint&) cons
t override; | 51 void paintBoxDecorationBackground(const PaintInfo&, const LayoutPoint&) cons
t override; |
48 void paintMask(const PaintInfo&, const LayoutPoint&) const override; | 52 void paintMask(const PaintInfo&, const LayoutPoint&) const override; |
| 53 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; |
| 54 void updateAnonymousChildStyle(const LayoutObject& child, ComputedStyle& chi
ldStyle) const override; |
| 55 |
| 56 void createInnerBlock(); |
| 57 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft); |
| 58 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop); |
| 59 void removeChild(LayoutObject*) override; |
| 60 |
| 61 LayoutBlock* m_innerBlock; |
49 }; | 62 }; |
50 | 63 |
51 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFieldset, isFieldset()); | 64 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFieldset, isFieldset()); |
52 | 65 |
53 } // namespace blink | 66 } // namespace blink |
54 | 67 |
55 #endif // LayoutFieldset_h | 68 #endif // LayoutFieldset_h |
OLD | NEW |