<http://webkit.org/b/78890>
Reviewed by Anders Carlsson.
Move logic from attributeChanged() overrides into parseAttribute().
This is a step towards making attributeChanged() non-virtual.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLMediaElement.h:
(HTMLMediaElement):
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::parseAttribute):
* html/HTMLScriptElement.h:
(HTMLScriptElement):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::parseAttribute):
* html/HTMLTrackElement.h:
(HTMLTrackElement):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108165
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2012-02-18 Andreas Kling <awesomekling@apple.com>
+ HTML: Remove unnecessary attributeChange() overrides.
+ <http://webkit.org/b/78890>
+
+ Reviewed by Anders Carlsson.
+
+ Move logic from attributeChanged() overrides into parseAttribute().
+ This is a step towards making attributeChanged() non-virtual.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::parseAttribute):
+ * html/HTMLMediaElement.h:
+ (HTMLMediaElement):
+ * html/HTMLScriptElement.cpp:
+ (WebCore::HTMLScriptElement::parseAttribute):
+ * html/HTMLScriptElement.h:
+ (HTMLScriptElement):
+ * html/HTMLTrackElement.cpp:
+ (WebCore::HTMLTrackElement::parseAttribute):
+ * html/HTMLTrackElement.h:
+ (HTMLTrackElement):
+
+2012-02-18 Andreas Kling <awesomekling@apple.com>
+
Remove Element::createAttribute().
<http://webkit.org/b/78965>
return false;
}
-void HTMLMediaElement::attributeChanged(Attribute* attr)
+void HTMLMediaElement::parseAttribute(Attribute* attr)
{
- HTMLElement::attributeChanged(attr);
-
const QualifiedName& attrName = attr->name();
+
if (attrName == srcAttr) {
// Trigger a reload, as long as the 'src' attribute is present.
if (fastHasAttribute(srcAttr))
else if (attrName == loopAttr)
updateDisableSleep();
#endif
-}
-
-void HTMLMediaElement::parseAttribute(Attribute* attr)
-{
- const QualifiedName& attrName = attr->name();
-
- if (attrName == preloadAttr) {
+ else if (attrName == preloadAttr) {
String value = attr->value();
if (equalIgnoringCase(value, "none"))
virtual bool supportsFocus() const;
virtual bool isMouseFocusable() const;
- virtual void attributeChanged(Attribute*) OVERRIDE;
virtual bool rendererIsNeeded(const NodeRenderingContext&);
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
virtual void insertedIntoDocument();
HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
}
-void HTMLScriptElement::attributeChanged(Attribute* attr)
-{
- if (attr->name() == asyncAttr)
- handleAsyncAttribute();
- HTMLElement::attributeChanged(attr);
-}
-
void HTMLScriptElement::parseAttribute(Attribute* attr)
{
const QualifiedName& attrName = attr->name();
if (attrName == srcAttr)
handleSourceAttribute(attr->value());
+ else if (attr->name() == asyncAttr)
+ handleAsyncAttribute();
else if (attrName == onloadAttr)
setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attr));
else if (attrName == onbeforeloadAttr)
virtual void parseAttribute(Attribute*) OVERRIDE;
virtual void insertedIntoDocument();
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
- virtual void attributeChanged(Attribute*) OVERRIDE;
virtual bool isURLAttribute(Attribute*) const;
{
const QualifiedName& attrName = attribute->name();
+ if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) {
+ if (attrName == srcAttr) {
+ if (!attribute->isEmpty() && mediaElement())
+ scheduleLoad();
+ // 4.8.10.12.3 Sourcing out-of-band text tracks
+ // As the kind, label, and srclang attributes are set, changed, or removed, the text track must update accordingly...
+ } else if (attrName == kindAttr)
+ track()->setKind(attribute->value());
+ else if (attrName == labelAttr)
+ track()->setLabel(attribute->value());
+ else if (attrName == srclangAttr)
+ track()->setLanguage(attribute->value());
+ }
+
if (attrName == onloadAttr)
setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attribute));
else if (attrName == onerrorAttr)
HTMLElement::parseAttribute(attribute);
}
-void HTMLTrackElement::attributeChanged(Attribute* attr)
-{
- HTMLElement::attributeChanged(attr);
-
- if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled())
- return;
-
- const QualifiedName& attrName = attr->name();
- if (attrName == srcAttr) {
- if (!getAttribute(srcAttr).isEmpty() && mediaElement())
- scheduleLoad();
-
- // 4.8.10.12.3 Sourcing out-of-band text tracks
- // As the kind, label, and srclang attributes are set, changed, or removed, the text track must update accordingly...
- } else if (attrName == kindAttr)
- track()->setKind(attr->value());
- else if (attrName == labelAttr)
- track()->setLabel(attr->value());
- else if (attrName == srclangAttr)
- track()->setLanguage(attr->value());
-}
-
KURL HTMLTrackElement::src() const
{
return document()->completeURL(getAttribute(srcAttr));
virtual ~HTMLTrackElement();
virtual void parseAttribute(Attribute*) OVERRIDE;
- virtual void attributeChanged(Attribute*) OVERRIDE;
virtual void insertedIntoDocument() OVERRIDE;
virtual void removedFromDocument() OVERRIDE;