]>
git.saurik.com Git - iphone-api.git/blob - WebCore/HTMLScriptElement.h
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
5 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
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.
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.
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.
24 #ifndef HTMLScriptElement_h
25 #define HTMLScriptElement_h
27 #include "ScriptElement.h"
28 #include "HTMLElement.h"
32 class HTMLScriptElement
: public HTMLElement
33 , public ScriptElement
{
35 HTMLScriptElement(const QualifiedName
&, Document
*, bool createdByParser
);
38 bool shouldExecuteAsJavaScript() const;
39 virtual String
scriptContent() const;
41 virtual HTMLTagStatus
endTagRequirement() const { return TagStatusRequired
; }
42 virtual int tagPriority() const { return 1; }
43 virtual bool checkDTD(const Node
* newChild
) { return newChild
->isTextNode(); }
45 virtual void parseMappedAttribute(MappedAttribute
*);
46 virtual void insertedIntoDocument();
47 virtual void removedFromDocument();
48 virtual void childrenChanged(bool changedByParser
= false, Node
* beforeChange
= 0, Node
* afterChange
= 0, int childCountDelta
= 0);
50 virtual bool isURLAttribute(Attribute
*) const;
51 virtual void finishParsingChildren();
54 void setText(const String
&);
56 String
htmlFor() const;
57 void setHtmlFor(const String
&);
60 void setEvent(const String
&);
62 String
charset() const;
63 void setCharset(const String
&);
69 void setSrc(const String
&);
72 void setType(const String
&);
74 virtual String
scriptCharset() const;
76 virtual void addSubresourceAttributeURLs(ListHashSet
<KURL
>&) const;
79 virtual String
sourceAttributeValue() const;
80 virtual String
charsetAttributeValue() const;
81 virtual String
typeAttributeValue() const;
82 virtual String
languageAttributeValue() const;
84 virtual void dispatchLoadEvent();
85 virtual void dispatchErrorEvent();
88 ScriptElementData m_data
;