diff options
author | Russell Brenner <russellbrenner@google.com> | 2010-11-18 17:33:13 -0800 |
---|---|---|
committer | Russell Brenner <russellbrenner@google.com> | 2010-12-02 13:47:21 -0800 |
commit | 6b70adc33054f8aee8c54d0f460458a9df11b8a5 (patch) | |
tree | 103a13998c33944d6ab3b8318c509a037e639460 /WebCore/html/HTMLScriptElement.cpp | |
parent | bdf4ebc8e70b2d221b6ee7a65660918ecb1d33aa (diff) | |
download | external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.zip external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.tar.gz external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.tar.bz2 |
Merge WebKit at r72274: Initial merge by git.
Change-Id: Ie51f0b4a16da82942bd516dce59cfb79ebbe25fb
Diffstat (limited to 'WebCore/html/HTMLScriptElement.cpp')
-rw-r--r-- | WebCore/html/HTMLScriptElement.cpp | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/WebCore/html/HTMLScriptElement.cpp b/WebCore/html/HTMLScriptElement.cpp index 9e776e6..0ee93df 100644 --- a/WebCore/html/HTMLScriptElement.cpp +++ b/WebCore/html/HTMLScriptElement.cpp @@ -35,17 +35,16 @@ namespace WebCore { using namespace HTMLNames; -inline HTMLScriptElement::HTMLScriptElement(const QualifiedName& tagName, Document* document, bool createdByParser) +inline HTMLScriptElement::HTMLScriptElement(const QualifiedName& tagName, Document* document, bool createdByParser, bool isEvaluated) : HTMLElement(tagName, document) - , m_data(this, this) + , ScriptElement(this, createdByParser, isEvaluated) { ASSERT(hasTagName(scriptTag)); - m_data.setCreatedByParser(createdByParser); } PassRefPtr<HTMLScriptElement> HTMLScriptElement::create(const QualifiedName& tagName, Document* document, bool createdByParser) { - return adoptRef(new HTMLScriptElement(tagName, document, createdByParser)); + return adoptRef(new HTMLScriptElement(tagName, document, createdByParser, false)); } bool HTMLScriptElement::isURLAttribute(Attribute* attr) const @@ -53,14 +52,9 @@ bool HTMLScriptElement::isURLAttribute(Attribute* attr) const return attr->name() == srcAttr; } -bool HTMLScriptElement::shouldExecuteAsJavaScript() const -{ - return m_data.shouldExecuteAsJavaScript(); -} - void HTMLScriptElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) { - ScriptElement::childrenChanged(m_data); + ScriptElement::childrenChanged(); HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); } @@ -69,7 +63,7 @@ void HTMLScriptElement::parseMappedAttribute(Attribute* attr) const QualifiedName& attrName = attr->name(); if (attrName == srcAttr) - handleSourceAttribute(m_data, attr->value()); + handleSourceAttribute(attr->value()); else if (attrName == onloadAttr) setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attr)); else if (attrName == onbeforeloadAttr) @@ -82,25 +76,20 @@ void HTMLScriptElement::parseMappedAttribute(Attribute* attr) void HTMLScriptElement::finishParsingChildren() { - ScriptElement::finishParsingChildren(m_data, sourceAttributeValue()); + ScriptElement::finishParsingChildren(sourceAttributeValue()); HTMLElement::finishParsingChildren(); } void HTMLScriptElement::insertedIntoDocument() { HTMLElement::insertedIntoDocument(); - ScriptElement::insertedIntoDocument(m_data, sourceAttributeValue()); + ScriptElement::insertedIntoDocument(sourceAttributeValue()); } void HTMLScriptElement::removedFromDocument() { HTMLElement::removedFromDocument(); - ScriptElement::removedFromDocument(m_data); -} - -String HTMLScriptElement::text() const -{ - return m_data.scriptContent(); + ScriptElement::removedFromDocument(); } void HTMLScriptElement::setText(const String &value) @@ -124,16 +113,6 @@ KURL HTMLScriptElement::src() const return document()->completeURL(sourceAttributeValue()); } -String HTMLScriptElement::scriptCharset() const -{ - return m_data.scriptCharset(); -} - -String HTMLScriptElement::scriptContent() const -{ - return m_data.scriptContent(); -} - void HTMLScriptElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const { HTMLElement::addSubresourceAttributeURLs(urls); @@ -183,8 +162,8 @@ bool HTMLScriptElement::deferAttributeValue() const void HTMLScriptElement::dispatchLoadEvent() { - ASSERT(!m_data.haveFiredLoadEvent()); - m_data.setHaveFiredLoadEvent(true); + ASSERT(!haveFiredLoadEvent()); + setHaveFiredLoadEvent(true); dispatchEvent(Event::create(eventNames().loadEvent, false, false)); } @@ -194,4 +173,9 @@ void HTMLScriptElement::dispatchErrorEvent() dispatchEvent(Event::create(eventNames().errorEvent, true, false)); } +PassRefPtr<Element> HTMLScriptElement::cloneElementWithoutAttributesAndChildren() const +{ + return adoptRef(new HTMLScriptElement(tagQName(), document(), false, isEvaluated())); +} + } |