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 { |
Manuel Rego
2016/07/20 06:00:23
Are we sure we want to do this change?
Inheriting
Gleb Lanbin
2016/07/21 18:25:31
please see the reply from cbiesenger@ on a similar
| |
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 // Let the 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 updateLogicalWidth() override; | |
55 | |
56 void adjustInnerStyle(); | |
57 void createInnerBlock(); | |
58 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft); | |
59 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop); | |
60 void removeChild(LayoutObject*) override; | |
61 | |
62 LayoutBlock* m_innerBlock; | |
49 }; | 63 }; |
50 | 64 |
51 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFieldset, isFieldset()); | 65 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFieldset, isFieldset()); |
52 | 66 |
53 } // namespace blink | 67 } // namespace blink |
54 | 68 |
55 #endif // LayoutFieldset_h | 69 #endif // LayoutFieldset_h |
OLD | NEW |