• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • khtml
  • svg
SVGStyleElement.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
3 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 Copyright (C) 2006 Apple Computer, Inc.
5
6 This file is part of the KDE project
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
17
18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA.
22*/
23
24#include "config.h"
25#include "wtf/Platform.h"
26#if ENABLE(SVG)
27#include "SVGStyleElement.h"
28
29//#include "CSSStyleSheet.h"
30#include "Document.h"
31#include "ExceptionCode.h"
32//#include "HTMLNames.h"
33//#include "XMLNames.h"
34
35namespace WebCore {
36
37//using namespace HTMLNames;
38
39SVGStyleElement::SVGStyleElement(const QualifiedName& tagName, Document* doc)
40 : SVGElement(tagName, doc)
41 , m_createdByParser(false)
42 , m_sheet(0)
43{
44}
45
46DOMString SVGStyleElement::xmlspace() const
47{
48 // ### shouldn't this provide default?
49 return getAttribute(ATTR_XML_SPACE);
50}
51
52void SVGStyleElement::setXmlspace(const DOMString&, ExceptionCode& ec)
53{
54 ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
55}
56
57const DOMString SVGStyleElement::type() const
58{
59 static const DOMString defaultValue("text/css");
60 DOMString n = getAttribute(ATTR_TYPE);
61 return n.isNull() ? defaultValue : n;
62}
63
64void SVGStyleElement::setType(const DOMString&, ExceptionCode& ec)
65{
66 ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
67}
68
69const DOMString SVGStyleElement::media() const
70{
71 static const DOMString defaultValue("all");
72 DOMString n = getAttribute(ATTR_MEDIA);
73 return n.isNull() ? defaultValue : n;
74}
75
76void SVGStyleElement::setMedia(const DOMString&, ExceptionCode& ec)
77{
78 ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
79}
80
81String SVGStyleElement::title() const
82{
83 return getAttribute(ATTR_TITLE);
84}
85
86void SVGStyleElement::setTitle(const DOMString&, ExceptionCode& ec)
87{
88 ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
89}
90
91void SVGStyleElement::parseMappedAttribute(MappedAttribute* attr)
92{
93 kDebug() << "parse: " << attr->id() << attr->localName() << attr->value() << endl;
94 if (/*attr->name() == titleAttr*/attr->id() == ATTR_TITLE && m_sheet)
95 ;//FIXME m_sheet->setTitle(attr->value());
96 else
97 SVGElement::parseMappedAttribute(attr);
98}
99
100void SVGStyleElement::finishParsingChildren()
101{
102 //StyleElement::sheet(this);
103 m_createdByParser = false;
104 SVGElement::finishParsingChildren();
105}
106
107void SVGStyleElement::insertedIntoDocument()
108{
109 SVGElement::insertedIntoDocument();
110
111 /*if (!m_createdByParser)
112 StyleElement::insertedIntoDocument(document(), this);*/
113 // Copy implementation from HTMLStyleElementImpl for KHTML
114 kDebug() << "not implemented" << endl;
115}
116
117void SVGStyleElement::removedFromDocument()
118{
119 SVGElement::removedFromDocument();
120 /*StyleElement::removedFromDocument(document());*/
121 // Copy implementation from HTMLStyleElementImpl for KHTML
122 kDebug() << "not implemented" << endl;
123}
124
125void SVGStyleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
126{
127 Q_UNUSED(changedByParser);
128 Q_UNUSED(beforeChange);
129 Q_UNUSED(afterChange);
130 Q_UNUSED(childCountDelta);
131 //SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
132 SVGElement::childrenChanged();
133 /*StyleElement::process(this);*/
134 // Copy implementation from HTMLStyleElementImpl for KHTML
135 kDebug() << "not implemented" << endl;
136}
137
138StyleSheet* SVGStyleElement::sheet()
139{
140 //return StyleElement::sheet(this);
141 return m_sheet;
142}
143
144bool SVGStyleElement::sheetLoaded()
145{
146 //document()->removePendingSheet();
147 document()->styleSheetLoaded();
148 return true;
149}
150
151// khtml compatibility methods:
152quint32 SVGStyleElement::id() const
153{
154 return SVGNames::styleTag.id();
155}
156
157}
158
159// vim:ts=4
160#endif // ENABLE(SVG)
ExceptionCode.h
SVGStyleElement.h
kDebug
#define kDebug
defaultValue
QString defaultValue(const QString &t)
WebCore
Definition: CSSHelper.h:7
WebCore::String
DOM::DOMString String
Definition: PlatformString.h:8
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal