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

KHTML

  • sources
  • kde-4.12
  • kdelibs
  • 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 
35 namespace WebCore {
36 
37 //using namespace HTMLNames;
38 
39 SVGStyleElement::SVGStyleElement(const QualifiedName& tagName, Document* doc)
40  : SVGElement(tagName, doc)
41  , m_createdByParser(false)
42  , m_sheet(0)
43 {
44 }
45 
46 DOMString SVGStyleElement::xmlspace() const
47 {
48  // ### shouldn't this provide default?
49  return getAttribute(ATTR_XML_SPACE);
50 }
51 
52 void SVGStyleElement::setXmlspace(const DOMString&, ExceptionCode& ec)
53 {
54  ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
55 }
56 
57 const 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 
64 void SVGStyleElement::setType(const DOMString&, ExceptionCode& ec)
65 {
66  ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
67 }
68 
69 const 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 
76 void SVGStyleElement::setMedia(const DOMString&, ExceptionCode& ec)
77 {
78  ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
79 }
80 
81 String SVGStyleElement::title() const
82 {
83  return getAttribute(ATTR_TITLE);
84 }
85 
86 void SVGStyleElement::setTitle(const DOMString&, ExceptionCode& ec)
87 {
88  ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
89 }
90 
91 void 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 
100 void SVGStyleElement::finishParsingChildren()
101 {
102  //StyleElement::sheet(this);
103  m_createdByParser = false;
104  SVGElement::finishParsingChildren();
105 }
106 
107 void 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 
117 void SVGStyleElement::removedFromDocument()
118 {
119  SVGElement::removedFromDocument();
120  /*StyleElement::removedFromDocument(document());*/
121  // Copy implementation from HTMLStyleElementImpl for KHTML
122  kDebug() << "not implemented" << endl;
123 }
124 
125 void 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 
138 StyleSheet* SVGStyleElement::sheet()
139 {
140  //return StyleElement::sheet(this);
141  return m_sheet;
142 }
143 
144 bool SVGStyleElement::sheetLoaded()
145 {
146  //document()->removePendingSheet();
147  document()->styleSheetLoaded();
148  return true;
149 }
150 
151 // khtml compatibility methods:
152 quint32 SVGStyleElement::id() const
153 {
154  return SVGNames::styleTag.id();
155 }
156 
157 }
158 
159 // vim:ts=4
160 #endif // ENABLE(SVG)
WebCore::SVGNames::styleTag
DOM::QualifiedName styleTag
Definition: SVGNames.cpp:90
DOM::QualifiedName::id
unsigned id() const
Definition: QualifiedName.cpp:90
quint32
kDebug
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
ExceptionCode.h
SVGStyleElement.h
WebCore::String
DOM::DOMString String
Definition: PlatformString.h:8
defaultValue
QString defaultValue(const QString &t)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:22 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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