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#ifndef HTMLBodyElement_h
25#define HTMLBodyElement_h
26
27#include "HTMLElement.h"
28
29namespace WebCore {
30
31class Document;
32
33class HTMLBodyElement final : public HTMLElement {
34public:
35    static PassRefPtr<HTMLBodyElement> create(Document&);
36    static PassRefPtr<HTMLBodyElement> create(const QualifiedName&, Document&);
37    virtual ~HTMLBodyElement();
38
39    // Declared virtual in Element
40    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(blur);
41    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(error);
42    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(focus);
43    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(load);
44
45    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(beforeunload);
46    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(hashchange);
47    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(message);
48    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(offline);
49    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(online);
50    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(popstate);
51    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(resize);
52    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(storage);
53    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(unload);
54
55#if ENABLE(ORIENTATION_EVENTS)
56    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(orientationchange);
57#endif
58
59private:
60    HTMLBodyElement(const QualifiedName&, Document&);
61
62    virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
63    virtual bool isPresentationAttribute(const QualifiedName&) const override;
64    virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) override;
65
66    virtual InsertionNotificationRequest insertedInto(ContainerNode&) override;
67
68    virtual bool isURLAttribute(const Attribute&) const override;
69
70    virtual bool supportsFocus() const override;
71
72    virtual int scrollLeft() override;
73    virtual void setScrollLeft(int) override;
74
75    virtual int scrollTop() override;
76    virtual void setScrollTop(int) override;
77
78    virtual int scrollHeight() override;
79    virtual int scrollWidth() override;
80
81    virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const override;
82};
83
84NODE_TYPE_CASTS(HTMLBodyElement)
85
86} //namespace
87
88#endif
89