diff options
Diffstat (limited to 'Source/WebCore/html/track/WebVTTElement.h')
-rw-r--r-- | Source/WebCore/html/track/WebVTTElement.h | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/Source/WebCore/html/track/WebVTTElement.h b/Source/WebCore/html/track/WebVTTElement.h index f49412c26..a08f42410 100644 --- a/Source/WebCore/html/track/WebVTTElement.h +++ b/Source/WebCore/html/track/WebVTTElement.h @@ -10,10 +10,10 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR @@ -23,9 +23,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #if ENABLE(VIDEO_TRACK) #include "HTMLElement.h" +#include <wtf/NeverDestroyed.h> namespace WebCore { @@ -43,10 +46,10 @@ enum WebVTTNodeType { class WebVTTElement final : public Element { public: - static PassRefPtr<WebVTTElement> create(const WebVTTNodeType, Document&); - PassRefPtr<HTMLElement> createEquivalentHTMLElement(Document&); + static Ref<WebVTTElement> create(const WebVTTNodeType, Document&); + Ref<HTMLElement> createEquivalentHTMLElement(Document&); - virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren() override; + Ref<Element> cloneElementWithoutAttributesAndChildren(Document&) override; void setWebVTTNodeType(WebVTTNodeType type) { m_webVTTNodeType = static_cast<unsigned>(type); } WebVTTNodeType webVTTNodeType() const { return static_cast<WebVTTNodeType>(m_webVTTNodeType); } @@ -59,20 +62,20 @@ public: static const QualifiedName& voiceAttributeName() { - DEFINE_STATIC_LOCAL(QualifiedName, voiceAttr, (nullAtom, "voice", nullAtom)); + static NeverDestroyed<QualifiedName> voiceAttr(nullAtom, "voice", nullAtom); return voiceAttr; } static const QualifiedName& langAttributeName() { - DEFINE_STATIC_LOCAL(QualifiedName, voiceAttr, (nullAtom, "lang", nullAtom)); + static NeverDestroyed<QualifiedName> voiceAttr(nullAtom, "lang", nullAtom); return voiceAttr; } private: WebVTTElement(WebVTTNodeType, Document&); - virtual bool isWebVTTElement() const override { return true; } + bool isWebVTTElement() const override { return true; } unsigned m_isPastNode : 1; unsigned m_webVTTNodeType : 4; @@ -80,10 +83,10 @@ private: AtomicString m_language; }; -void isWebVTTElement(const WebVTTElement&); // Catch unnecessary runtime check of type known at compile time. -inline bool isWebVTTElement(const Node& node) { return node.isWebVTTElement(); } -NODE_TYPE_CASTS(WebVTTElement) - } // namespace WebCore -#endif +SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::WebVTTElement) + static bool isType(const WebCore::Node& node) { return node.isWebVTTElement(); } +SPECIALIZE_TYPE_TRAITS_END() + +#endif // ENABLE(VIDEO_TRACK) |