1/*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann <hausmann@kde.org>
5 * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
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
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 *
22 */
23
24#pragma once
25
26#include "HTMLElement.h"
27#include <wtf/UniqueArray.h>
28
29namespace WebCore {
30
31class HTMLFrameSetElement final : public HTMLElement {
32 WTF_MAKE_ISO_ALLOCATED(HTMLFrameSetElement);
33public:
34 static Ref<HTMLFrameSetElement> create(const QualifiedName&, Document&);
35
36 bool hasFrameBorder() const { return m_frameborder; }
37 bool noResize() const { return m_noresize; }
38
39 int totalRows() const { return m_totalRows; }
40 int totalCols() const { return m_totalCols; }
41 int border() const { return hasFrameBorder() ? m_border : 0; }
42
43 bool hasBorderColor() const { return m_borderColorSet; }
44
45 const Length* rowLengths() const { return m_rowLengths.get(); }
46 const Length* colLengths() const { return m_colLengths.get(); }
47
48 static RefPtr<HTMLFrameSetElement> findContaining(Element* descendant);
49
50 Vector<AtomString> supportedPropertyNames() const;
51 WindowProxy* namedItem(const AtomString&);
52
53private:
54 HTMLFrameSetElement(const QualifiedName&, Document&);
55
56 void parseAttribute(const QualifiedName&, const AtomString&) final;
57 bool isPresentationAttribute(const QualifiedName&) const final;
58 void collectStyleForPresentationAttribute(const QualifiedName&, const AtomString&, MutableStyleProperties&) final;
59
60 void willAttachRenderers() final;
61 bool rendererIsNeeded(const RenderStyle&) final;
62 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
63
64 void defaultEventHandler(Event&) final;
65
66 void willRecalcStyle(Style::Change) final;
67
68 InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) final;
69 void removedFromAncestor(RemovalType, ContainerNode&) final;
70
71 UniqueArray<Length> m_rowLengths;
72 UniqueArray<Length> m_colLengths;
73
74 int m_totalRows;
75 int m_totalCols;
76
77 int m_border;
78 bool m_borderSet;
79
80 bool m_borderColorSet;
81
82 bool m_frameborder;
83 bool m_frameborderSet;
84 bool m_noresize;
85};
86
87} // namespace WebCore
88