summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLAudioElement.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-09-17 17:07:48 +0200
committerAllan Sandfeld Jensen <allan.jensen@digia.com>2014-09-19 16:29:10 +0200
commitd84668b5124b2dd973644da18dad281953414242 (patch)
tree8785fd44202bde8f08e2dd93cb59de86268f0813 /Source/WebCore/html/HTMLAudioElement.h
parent55f814fc556631b390f0c5764bb4ee3ceeea1d45 (diff)
downloadqtwebkit-d84668b5124b2dd973644da18dad281953414242.tar.gz
Need to check if some HTML child elements are HTMLUnknownElement
Based on upstream fix http://trac.webkit.org/changeset/156953 The check for whether an element is an HTMLAudioElement or not was incomplete. An element can have the 'audio' tag-name but still be another element if media elements have been disabled. In this case it will be an HTMLUnknownElement. Task-number: QTBUG-41360 Change-Id: I6a3e366b9dc268b0dbebe5880ba68945bcb42a27 Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Source/WebCore/html/HTMLAudioElement.h')
-rw-r--r--Source/WebCore/html/HTMLAudioElement.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/WebCore/html/HTMLAudioElement.h b/Source/WebCore/html/HTMLAudioElement.h
index 07ca48dd4..0d2483668 100644
--- a/Source/WebCore/html/HTMLAudioElement.h
+++ b/Source/WebCore/html/HTMLAudioElement.h
@@ -43,14 +43,19 @@ private:
HTMLAudioElement(const QualifiedName&, Document*, bool);
};
-inline bool isHTMLAudioElement(Node* node)
+inline bool isHTMLAudioElement(HTMLElement* element)
{
- return node->hasTagName(HTMLNames::audioTag);
+ return !element->isHTMLUnknownElement() && element->hasTagName(HTMLNames::audioTag);
}
inline bool isHTMLAudioElement(Element* element)
{
- return element->hasTagName(HTMLNames::audioTag);
+ return element->isHTMLElement() && isHTMLAudioElement(toHTMLElement(element));
+}
+
+inline bool isHTMLAudioElement(Node* node)
+{
+ return node->isHTMLElement() && isHTMLAudioElement(toHTMLElement(node));
}
inline HTMLAudioElement* toHTMLAudioElement(Node* node)