blob: 5e09bd192537e3405f74f496b5a7a6449172f3f8 [file] [log] [blame]
ggaren2e40fc12006-10-17 21:17:28 +00001/*
ggaren2e40fc12006-10-17 21:17:28 +00002 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann <hausmann@kde.org>
darin@apple.com08bbae82009-08-17 07:35:02 +00005 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
ggaren2e40fc12006-10-17 21:17:28 +00006 *
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
ddkilzerc8eccec2007-09-26 02:29:57 +000019 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
ggaren2e40fc12006-10-17 21:17:28 +000021 *
22 */
23
24#ifndef HTMLFrameElementBase_h
25#define HTMLFrameElementBase_h
26
mrowe@apple.combf5eaa62014-04-03 00:51:04 +000027#include "FrameLoaderTypes.h"
darincb3524a2006-12-11 23:40:47 +000028#include "HTMLFrameOwnerElement.h"
darin60e537f52006-11-15 01:29:46 +000029#include "ScrollTypes.h"
ggaren2e40fc12006-10-17 21:17:28 +000030
31namespace WebCore {
32
darincb3524a2006-12-11 23:40:47 +000033class HTMLFrameElementBase : public HTMLFrameOwnerElement {
ggaren2e40fc12006-10-17 21:17:28 +000034public:
darin@apple.com5ffbb5c2013-09-27 16:39:41 +000035 URL location() const;
ggaren2e40fc12006-10-17 21:17:28 +000036 void setLocation(const String&);
37
darin@apple.com11ff47c2016-03-04 16:47:55 +000038 ScrollbarMode scrollingMode() const override final { return m_scrolling; }
hyatt8f83b0e2007-03-19 04:50:45 +000039
dbates@webkit.org77185ce2010-12-28 00:21:23 +000040 int marginWidth() const { return m_marginWidth; }
41 int marginHeight() const { return m_marginHeight; }
ggaren2e40fc12006-10-17 21:17:28 +000042
commit-queue@webkit.org7e978e12011-07-20 21:12:30 +000043 int width();
44 int height();
ggaren2e40fc12006-10-17 21:17:28 +000045
darin@apple.com11ff47c2016-03-04 16:47:55 +000046 bool canContainRangeEndPoint() const override final { return false; }
rniwa@webkit.org2a3b3f72011-05-14 18:10:14 +000047
ggaren2e40fc12006-10-17 21:17:28 +000048protected:
weinig@apple.comdedf67e2013-09-15 05:23:01 +000049 HTMLFrameElementBase(const QualifiedName&, Document&);
darincb3524a2006-12-11 23:40:47 +000050
darin@apple.com08bbae82009-08-17 07:35:02 +000051 bool isURLAllowed() const;
darin@apple.comcf9dd0f2009-08-23 06:55:57 +000052
darin@apple.com11ff47c2016-03-04 16:47:55 +000053 void parseAttribute(const QualifiedName&, const AtomicString&) override;
54 InsertionNotificationRequest insertedInto(ContainerNode&) override final;
55 void finishedInsertingSubtree() override final;
56 void didAttachRenderers() override;
darin@apple.comcf9dd0f2009-08-23 06:55:57 +000057
58private:
darin@apple.com11ff47c2016-03-04 16:47:55 +000059 bool supportsFocus() const override final;
60 void setFocus(bool) override final;
darin@apple.comcf9dd0f2009-08-23 06:55:57 +000061
darin@apple.com11ff47c2016-03-04 16:47:55 +000062 bool isURLAttribute(const Attribute&) const override final;
63 bool isHTMLContentAttribute(const Attribute&) const override final;
tsepez@chromium.org336485f2013-03-30 18:31:52 +000064
darin@apple.com11ff47c2016-03-04 16:47:55 +000065 bool isFrameElementBase() const override final { return true; }
darin@apple.comcf9dd0f2009-08-23 06:55:57 +000066
andersca2d8ce332007-07-18 03:46:10 +000067 void setNameAndOpenURL();
mrowe@apple.combf5eaa62014-04-03 00:51:04 +000068 void openURL(LockHistory = LockHistory::Yes, LockBackForwardList = LockBackForwardList::Yes);
ggaren2e40fc12006-10-17 21:17:28 +000069
ggaren2e40fc12006-10-17 21:17:28 +000070 AtomicString m_URL;
dbates@webkit.org949216b2010-10-30 06:13:22 +000071 AtomicString m_frameName;
ggaren2e40fc12006-10-17 21:17:28 +000072
73 ScrollbarMode m_scrolling;
74
75 int m_marginWidth;
76 int m_marginHeight;
ggaren2e40fc12006-10-17 21:17:28 +000077};
78
ggaren2e40fc12006-10-17 21:17:28 +000079} // namespace WebCore
80
cdumez@apple.com3e58f0f2014-09-30 21:32:55 +000081SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::HTMLFrameElementBase)
82 static bool isType(const WebCore::HTMLElement& element) { return is<WebCore::HTMLFrameElement>(element) || is<WebCore::HTMLIFrameElement>(element); }
83 static bool isType(const WebCore::Node& node) { return is<WebCore::HTMLElement>(node) && isType(downcast<WebCore::HTMLElement>(node)); }
84SPECIALIZE_TYPE_TRAITS_END()
85
ggaren2e40fc12006-10-17 21:17:28 +000086#endif // HTMLFrameElementBase_h