1/* 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 4 * Copyright (C) 2013 Apple Inc. All rights reserved. 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public License 17 * along with this library; see the file COPYING.LIB. If not, write to 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 */ 21 22#ifndef SVGStyleElement_h 23#define SVGStyleElement_h 24 25#include "InlineStyleSheetOwner.h" 26#include "SVGElement.h" 27 28namespace WebCore { 29 30class SVGStyleElement final : public SVGElement { 31public: 32 static PassRefPtr<SVGStyleElement> create(const QualifiedName&, Document&, bool createdByParser); 33 virtual ~SVGStyleElement(); 34 35 CSSStyleSheet* sheet() const { return m_styleSheetOwner.sheet(); } 36 37 bool disabled() const; 38 void setDisabled(bool); 39 40 const AtomicString& type() const; 41 void setType(const AtomicString&, ExceptionCode&); 42 43 const AtomicString& media() const; 44 void setMedia(const AtomicString&, ExceptionCode&); 45 46 String title() const override; 47 void setTitle(const AtomicString&, ExceptionCode&); 48 49private: 50 SVGStyleElement(const QualifiedName&, Document&, bool createdByParser); 51 52 bool isSupportedAttribute(const QualifiedName&); 53 virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; 54 virtual InsertionNotificationRequest insertedInto(ContainerNode&) override; 55 virtual void removedFrom(ContainerNode&) override; 56 virtual void childrenChanged(const ChildChange&) override; 57 58 virtual bool rendererIsNeeded(const RenderStyle&) override { return false; } 59 60 virtual void finishParsingChildren() override; 61 62 virtual bool isLoading() const { return m_styleSheetOwner.isLoading(); } 63 virtual bool sheetLoaded() override { return m_styleSheetOwner.sheetLoaded(document()); } 64 virtual void startLoadingDynamicSheet() override { m_styleSheetOwner.startLoadingDynamicSheet(document()); } 65 virtual Timer<SVGElement>* svgLoadEventTimer() override { return &m_svgLoadEventTimer; } 66 67 InlineStyleSheetOwner m_styleSheetOwner; 68 Timer<SVGElement> m_svgLoadEventTimer; 69}; 70 71NODE_TYPE_CASTS(SVGStyleElement) 72 73} // namespace WebCore 74 75#endif // SVGStyleElement_h 76