Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutFieldset.h

Issue 2560123003: Revert commit# 415577 "Add grid/flex layout support for <fieldset>" (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 bool isOfType(LayoutObjectType type) const override {
41 LayoutObject* beforeChild = nullptr) override; 41 return type == LayoutObjectFieldset || LayoutBlockFlow::isOfType(type);
42 }
43
44 LayoutObject* layoutSpecialExcludedChild(bool relayoutChildren,
45 SubtreeLayoutScope&) override;
46
47 void computePreferredLogicalWidths() override;
42 bool avoidsFloats() const override { return true; } 48 bool avoidsFloats() const override { return true; }
43 49
44 // We override the two baseline functions because we want our baseline to be
45 // the bottom of our margin box.
46 int baselinePosition(FontBaseline,
47 bool firstLine,
48 LineDirectionMode,
49 LinePositionMode) const override;
50 int inlineBlockBaseline(LineDirectionMode) const override { return -1; }
51
52 void computeIntrinsicLogicalWidths(
53 LayoutUnit& minLogicalWidth,
54 LayoutUnit& maxLogicalWidth) const override;
55 bool createsAnonymousWrapper() const override { return true; }
56 bool isOfType(LayoutObjectType type) const override {
57 return type == LayoutObjectFieldset || LayoutFlexibleBox::isOfType(type);
58 }
59 LayoutObject* layoutSpecialExcludedChild(bool relayoutChildren,
60 SubtreeLayoutScope&) override;
61 void paintBoxDecorationBackground(const PaintInfo&, 50 void paintBoxDecorationBackground(const PaintInfo&,
62 const LayoutPoint&) const override; 51 const LayoutPoint&) const override;
63 void paintMask(const PaintInfo&, const LayoutPoint&) const override; 52 void paintMask(const PaintInfo&, const LayoutPoint&) const override;
64 void updateAnonymousChildStyle(const LayoutObject& child,
65 ComputedStyle& childStyle) const override;
66
67 void createInnerBlock();
68 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft);
69 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop);
70 void removeChild(LayoutObject*) override;
71
72 LayoutBlock* m_innerBlock;
73 }; 53 };
74 54
75 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFieldset, isFieldset()); 55 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFieldset, isFieldset());
76 56
77 } // namespace blink 57 } // namespace blink
78 58
79 #endif // LayoutFieldset_h 59 #endif // LayoutFieldset_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutFieldset.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698