• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.4 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 
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 {
43 }
44 
45 DOMString SVGStyleElement::xmlspace() const
46 {
47  // ### shouldn't this provide default?
48  return getAttribute(ATTR_XML_SPACE);
49 }
50 
51 void SVGStyleElement::setXmlspace(const DOMString&, ExceptionCode& ec)
52 {
53  ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
54 }
55 
56 const DOMString SVGStyleElement::type() const
57 {
58  static const DOMString defaultValue("text/css");
59  DOMString n = getAttribute(ATTR_TYPE);
60  return n.isNull() ? defaultValue : n;
61 }
62 
63 void SVGStyleElement::setType(const DOMString&, ExceptionCode& ec)
64 {
65  ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
66 }
67 
68 const DOMString SVGStyleElement::media() const
69 {
70  static const DOMString defaultValue("all");
71  DOMString n = getAttribute(ATTR_MEDIA);
72  return n.isNull() ? defaultValue : n;
73 }
74 
75 void SVGStyleElement::setMedia(const DOMString&, ExceptionCode& ec)
76 {
77  ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
78 }
79 
80 String SVGStyleElement::title() const
81 {
82  return getAttribute(ATTR_TITLE);
83 }
84 
85 void SVGStyleElement::setTitle(const DOMString&, ExceptionCode& ec)
86 {
87  ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
88 }
89 
90 void SVGStyleElement::parseMappedAttribute(MappedAttribute* attr)
91 {
92  kDebug() << "parse: " << attr->id() << attr->localName() << attr->value() << endl;
93  if (/*attr->name() == titleAttr*/attr->id() == ATTR_TITLE && m_sheet)
94  ;//FIXME m_sheet->setTitle(attr->value());
95  else
96  SVGElement::parseMappedAttribute(attr);
97 }
98 
99 void SVGStyleElement::finishParsingChildren()
100 {
101  //StyleElement::sheet(this);
102  m_createdByParser = false;
103  SVGElement::finishParsingChildren();
104 }
105 
106 void SVGStyleElement::insertedIntoDocument()
107 {
108  SVGElement::insertedIntoDocument();
109 
110  /*if (!m_createdByParser)
111  StyleElement::insertedIntoDocument(document(), this);*/
112  // Copy implementation from HTMLStyleElementImpl for KHTML
113  kDebug() << "not implemented" << endl;
114 }
115 
116 void SVGStyleElement::removedFromDocument()
117 {
118  SVGElement::removedFromDocument();
119  /*StyleElement::removedFromDocument(document());*/
120  // Copy implementation from HTMLStyleElementImpl for KHTML
121  kDebug() << "not implemented" << endl;
122 }
123 
124 void SVGStyleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
125 {
126  Q_UNUSED(changedByParser);
127  Q_UNUSED(beforeChange);
128  Q_UNUSED(afterChange);
129  Q_UNUSED(childCountDelta);
130  //SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
131  SVGElement::childrenChanged();
132  /*StyleElement::process(this);*/
133  // Copy implementation from HTMLStyleElementImpl for KHTML
134  kDebug() << "not implemented" << endl;
135 }
136 
137 StyleSheet* SVGStyleElement::sheet()
138 {
139  //return StyleElement::sheet(this);
140  return m_sheet;
141 }
142 
143 bool SVGStyleElement::sheetLoaded()
144 {
145  //document()->removePendingSheet();
146  document()->styleSheetLoaded();
147  return true;
148 }
149 
150 // khtml compatibility methods:
151 quint32 SVGStyleElement::id() const
152 {
153  return SVGNames::styleTag.id();
154 }
155 
156 }
157 
158 // vim:ts=4
159 #endif // ENABLE(SVG)
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jun 1 2013 12:11:07 by doxygen 1.8.1.1 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.10.4 API Reference

Skip menu "kdelibs-4.10.4 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