| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. |
| 5 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> | 5 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #ifndef HTMLScriptElement_h | 24 #ifndef HTMLScriptElement_h |
| 25 #define HTMLScriptElement_h | 25 #define HTMLScriptElement_h |
| 26 | 26 |
| 27 #include "core/dom/ScriptElement.h" | 27 #include "core/dom/ScriptElement.h" |
| 28 #include "core/html/HTMLElement.h" | 28 #include "core/html/HTMLElement.h" |
| 29 | 29 |
| 30 namespace WebCore { | 30 namespace WebCore { |
| 31 | 31 |
| 32 class HTMLScriptElement FINAL : public HTMLElement, public ScriptElement { | 32 class HTMLScriptElement FINAL : public HTMLElement, public ScriptElementClient { |
| 33 public: | 33 public: |
| 34 static PassRefPtr<HTMLScriptElement> create(const QualifiedName&, Document*,
bool wasInsertedByParser, bool alreadyStarted = false); | 34 static PassRefPtr<HTMLScriptElement> create(const QualifiedName&, Document*,
bool wasInsertedByParser, bool alreadyStarted = false); |
| 35 | 35 |
| 36 String text() const { return scriptContent(); } | 36 String text() { return textFromChildren(); } |
| 37 void setText(const String&); | 37 void setText(const String&); |
| 38 | 38 |
| 39 KURL src() const; | 39 KURL src() const; |
| 40 | 40 |
| 41 void setAsync(bool); | 41 void setAsync(bool); |
| 42 bool async() const; | 42 bool async() const; |
| 43 | 43 |
| 44 ScriptElement* scriptElement() const { return m_scriptElement.get(); } |
| 45 |
| 44 private: | 46 private: |
| 45 HTMLScriptElement(const QualifiedName&, Document*, bool wasInsertedByParser,
bool alreadyStarted); | 47 HTMLScriptElement(const QualifiedName&, Document*, bool wasInsertedByParser,
bool alreadyStarted); |
| 46 | 48 |
| 47 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 49 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
| 48 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; | 50 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; |
| 49 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0); | 51 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0); |
| 50 | 52 |
| 51 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; | 53 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; |
| 52 | 54 |
| 53 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; | 55 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; |
| 54 | 56 |
| 55 virtual String sourceAttributeValue() const; | 57 virtual String sourceAttributeValue() const; |
| 56 virtual String charsetAttributeValue() const; | 58 virtual String charsetAttributeValue() const; |
| 57 virtual String typeAttributeValue() const; | 59 virtual String typeAttributeValue() const; |
| 58 virtual String languageAttributeValue() const; | 60 virtual String languageAttributeValue() const; |
| 59 virtual String forAttributeValue() const; | 61 virtual String forAttributeValue() const; |
| 60 virtual String eventAttributeValue() const; | 62 virtual String eventAttributeValue() const; |
| 61 virtual bool asyncAttributeValue() const; | 63 virtual bool asyncAttributeValue() const; |
| 62 virtual bool deferAttributeValue() const; | 64 virtual bool deferAttributeValue() const; |
| 63 virtual bool hasSourceAttribute() const; | 65 virtual bool hasSourceAttribute() const; |
| 64 | 66 |
| 65 virtual void dispatchLoadEvent(); | 67 virtual void dispatchLoadEvent(); |
| 66 | 68 |
| 67 virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren(); | 69 virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren(); |
| 70 |
| 71 OwnPtr<ScriptElement> m_scriptElement; |
| 68 }; | 72 }; |
| 69 | 73 |
| 70 inline HTMLScriptElement* toHTMLScriptElement(Node* node) | 74 inline HTMLScriptElement* toHTMLScriptElement(Node* node) |
| 71 { | 75 { |
| 72 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(HTMLNames::script
Tag)); | 76 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(HTMLNames::script
Tag)); |
| 73 return static_cast<HTMLScriptElement*>(node); | 77 return static_cast<HTMLScriptElement*>(node); |
| 74 } | 78 } |
| 75 | 79 |
| 76 } //namespace | 80 } //namespace |
| 77 | 81 |
| 78 #endif | 82 #endif |
| OLD | NEW |