| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Simon Hausmann <hausmann@kde.org> | 3 * (C) 2000 Simon Hausmann <hausmann@kde.org> |
| 4 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| 11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
| 15 * | 15 * |
| 16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
| 17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
| 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
| 20 * | 20 * |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 #ifndef LayoutFrameSet_h | 23 #ifndef LayoutFrameSet_h |
| 24 #define LayoutFrameSet_h | 24 #define LayoutFrameSet_h |
| 25 | 25 |
| 26 #include "core/rendering/RenderBox.h" | 26 #include "core/layout/LayoutBox.h" |
| 27 | 27 |
| 28 namespace blink { | 28 namespace blink { |
| 29 | 29 |
| 30 class HTMLDimension; | 30 class HTMLDimension; |
| 31 class HTMLFrameSetElement; | 31 class HTMLFrameSetElement; |
| 32 class MouseEvent; | 32 class MouseEvent; |
| 33 | 33 |
| 34 enum FrameEdge { LeftFrameEdge, RightFrameEdge, TopFrameEdge, BottomFrameEdge }; | 34 enum FrameEdge { LeftFrameEdge, RightFrameEdge, TopFrameEdge, BottomFrameEdge }; |
| 35 | 35 |
| 36 struct FrameEdgeInfo { | 36 struct FrameEdgeInfo { |
| 37 FrameEdgeInfo(bool preventResize = false, bool allowBorder = true) | 37 FrameEdgeInfo(bool preventResize = false, bool allowBorder = true) |
| 38 : m_preventResize(4) | 38 : m_preventResize(4) |
| 39 , m_allowBorder(4) | 39 , m_allowBorder(4) |
| 40 { | 40 { |
| 41 m_preventResize.fill(preventResize); | 41 m_preventResize.fill(preventResize); |
| 42 m_allowBorder.fill(allowBorder); | 42 m_allowBorder.fill(allowBorder); |
| 43 } | 43 } |
| 44 | 44 |
| 45 bool preventResize(FrameEdge edge) const { return m_preventResize[edge]; } | 45 bool preventResize(FrameEdge edge) const { return m_preventResize[edge]; } |
| 46 bool allowBorder(FrameEdge edge) const { return m_allowBorder[edge]; } | 46 bool allowBorder(FrameEdge edge) const { return m_allowBorder[edge]; } |
| 47 | 47 |
| 48 void setPreventResize(FrameEdge edge, bool preventResize) { m_preventResize[
edge] = preventResize; } | 48 void setPreventResize(FrameEdge edge, bool preventResize) { m_preventResize[
edge] = preventResize; } |
| 49 void setAllowBorder(FrameEdge edge, bool allowBorder) { m_allowBorder[edge]
= allowBorder; } | 49 void setAllowBorder(FrameEdge edge, bool allowBorder) { m_allowBorder[edge]
= allowBorder; } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 Vector<bool> m_preventResize; | 52 Vector<bool> m_preventResize; |
| 53 Vector<bool> m_allowBorder; | 53 Vector<bool> m_allowBorder; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 class LayoutFrameSet final : public RenderBox { | 56 class LayoutFrameSet final : public LayoutBox { |
| 57 public: | 57 public: |
| 58 LayoutFrameSet(HTMLFrameSetElement*); | 58 LayoutFrameSet(HTMLFrameSetElement*); |
| 59 virtual ~LayoutFrameSet(); | 59 virtual ~LayoutFrameSet(); |
| 60 | 60 |
| 61 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } | 61 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } |
| 62 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } | 62 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } |
| 63 | 63 |
| 64 // If you have a LayoutFrameSet, use firstChild or lastChild instead. | 64 // If you have a LayoutFrameSet, use firstChild or lastChild instead. |
| 65 void slowFirstChild() const = delete; | 65 void slowFirstChild() const = delete; |
| 66 void slowLastChild() const = delete; | 66 void slowLastChild() const = delete; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 95 const GridAxis& rows() { return m_rows; } | 95 const GridAxis& rows() { return m_rows; } |
| 96 const GridAxis& columns() { return m_cols; } | 96 const GridAxis& columns() { return m_cols; } |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 static const int noSplit = -1; | 99 static const int noSplit = -1; |
| 100 | 100 |
| 101 virtual LayoutObjectChildList* virtualChildren() override { return children(
); } | 101 virtual LayoutObjectChildList* virtualChildren() override { return children(
); } |
| 102 virtual const LayoutObjectChildList* virtualChildren() const override { retu
rn children(); } | 102 virtual const LayoutObjectChildList* virtualChildren() const override { retu
rn children(); } |
| 103 | 103 |
| 104 virtual const char* renderName() const override { return "LayoutFrameSet"; } | 104 virtual const char* renderName() const override { return "LayoutFrameSet"; } |
| 105 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectFrameSet || RenderBox::isOfType(type); } | 105 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectFrameSet || LayoutBox::isOfType(type); } |
| 106 | 106 |
| 107 virtual void layout() override; | 107 virtual void layout() override; |
| 108 virtual void paint(const PaintInfo&, const LayoutPoint&) override; | 108 virtual void paint(const PaintInfo&, const LayoutPoint&) override; |
| 109 virtual void computePreferredLogicalWidths() override; | 109 virtual void computePreferredLogicalWidths() override; |
| 110 virtual bool isChildAllowed(LayoutObject*, const LayoutStyle&) const overrid
e; | 110 virtual bool isChildAllowed(LayoutObject*, const LayoutStyle&) const overrid
e; |
| 111 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const overrid
e; | 111 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const overrid
e; |
| 112 | 112 |
| 113 void setIsResizing(bool); | 113 void setIsResizing(bool); |
| 114 | 114 |
| 115 void layOutAxis(GridAxis&, const Vector<HTMLDimension>&, int availableSpace)
; | 115 void layOutAxis(GridAxis&, const Vector<HTMLDimension>&, int availableSpace)
; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 130 | 130 |
| 131 bool m_isResizing; | 131 bool m_isResizing; |
| 132 bool m_isChildResizing; | 132 bool m_isChildResizing; |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFrameSet, isFrameSet()); | 135 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFrameSet, isFrameSet()); |
| 136 | 136 |
| 137 } // namespace blink | 137 } // namespace blink |
| 138 | 138 |
| 139 #endif // LayoutFrameSet_h | 139 #endif // LayoutFrameSet_h |
| OLD | NEW |