| 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/LayoutFlexibleBox.h" | 27 #include "core/layout/LayoutBlockFlow.h" |
| 28 | 28 |
| 29 namespace blink { | 29 namespace blink { |
| 30 | 30 |
| 31 class LayoutFieldset final : public LayoutFlexibleBox { | 31 class LayoutFieldset final : public LayoutBlockFlow { |
| 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 void addChild(LayoutObject* newChild, | 40 // We override the two baseline functions because we want our baseline to be |
| 41 LayoutObject* beforeChild = nullptr) override; | 41 // the bottom of our margin box. |
| 42 bool isOfType(LayoutObjectType type) const override { |
| 43 return type == LayoutObjectFieldset || LayoutBlockFlow::isOfType(type); |
| 44 } |
| 45 |
| 46 LayoutObject* layoutSpecialExcludedChild(bool relayoutChildren, |
| 47 SubtreeLayoutScope&) override; |
| 48 |
| 49 void computePreferredLogicalWidths() override; |
| 42 bool avoidsFloats() const override { return true; } | 50 bool avoidsFloats() const override { return true; } |
| 43 | 51 |
| 44 // We override the two baseline functions because we want our baseline to be t
he bottom of our margin box. | |
| 45 int baselinePosition(FontBaseline, | |
| 46 bool firstLine, | |
| 47 LineDirectionMode, | |
| 48 LinePositionMode) const override; | |
| 49 int inlineBlockBaseline(LineDirectionMode) const override { return -1; } | |
| 50 | |
| 51 void computeIntrinsicLogicalWidths( | |
| 52 LayoutUnit& minLogicalWidth, | |
| 53 LayoutUnit& maxLogicalWidth) const override; | |
| 54 bool createsAnonymousWrapper() const override { return true; } | |
| 55 bool isOfType(LayoutObjectType type) const override { | |
| 56 return type == LayoutObjectFieldset || LayoutFlexibleBox::isOfType(type); | |
| 57 } | |
| 58 LayoutObject* layoutSpecialExcludedChild(bool relayoutChildren, | |
| 59 SubtreeLayoutScope&) override; | |
| 60 void paintBoxDecorationBackground(const PaintInfo&, | 52 void paintBoxDecorationBackground(const PaintInfo&, |
| 61 const LayoutPoint&) const override; | 53 const LayoutPoint&) const override; |
| 62 void paintMask(const PaintInfo&, const LayoutPoint&) const override; | 54 void paintMask(const PaintInfo&, const LayoutPoint&) const override; |
| 63 void updateAnonymousChildStyle(const LayoutObject& child, | |
| 64 ComputedStyle& childStyle) const override; | |
| 65 | |
| 66 void createInnerBlock(); | |
| 67 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft); | |
| 68 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop); | |
| 69 void removeChild(LayoutObject*) override; | |
| 70 | |
| 71 LayoutBlock* m_innerBlock; | |
| 72 }; | 55 }; |
| 73 | 56 |
| 74 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFieldset, isFieldset()); | 57 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFieldset, isFieldset()); |
| 75 | 58 |
| 76 } // namespace blink | 59 } // namespace blink |
| 77 | 60 |
| 78 #endif // LayoutFieldset_h | 61 #endif // LayoutFieldset_h |
| OLD | NEW |