Commit 42aeffc3 authored by eseidel's avatar eseidel

Bug #: 3249

Submitted by: eseidel
Reviewed by: hyatt
        The first part of the big KDOM-DOM merger.
        This section covers the additions necessary to the khtml/kwq side
        in order to support ksvg2 on top of WebCore's DOM.  All changes
        are enclosed within SVG_SUPPORT blocks for easy disabling.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=3249

        * ForwardingHeaders/ksvg2/KSVGPart.h: to KDOMHeaders.h
        * ForwardingHeaders/ksvg2/KSVGView.h: to KDOMHeaders.h
        * WebCore-svg.exp: removed Draw* symbols
        * WebCorePrefix.h: map KDOM to DOM
        * khtml/css/css_valueimpl.h:
        (DOM::CSSValueImpl::cssValueType): defaults to CSS_CUSTOM
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue): calls parseSVGValue as necessary
        (DOM::CSSParser::lex):
        * khtml/css/cssparser.h:
        * khtml/css/cssstyleselector.cpp: svg specific support
        (khtml::CSSStyleSelector::loadDefaultStyle): loads svg UA sheet
        (khtml::CSSStyleSelector::applyProperty): calls applySVGProperty
        * khtml/css/cssstyleselector.h:
        * khtml/css/parser.y: calls KSVG::get(Property|Value)ID
        * khtml/ecma/domparser.cpp:
        (KJS::DOMParserProtoFunc::callAsFunction): use isXMLMIMEType
        * khtml/ecma/kjs_dom.cpp:
        (KJS::DOMDocument::getValueProperty): impl -> implementation
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::getValueProperty): use isXMLMIMEType
        * khtml/html/html_documentimpl.cpp: remove referrer
        * khtml/html/html_documentimpl.h: remove referrer
        * khtml/khtml_part.cpp:
        (KHTMLPart::init):
        (KHTMLPart::begin):
        * khtml/khtml_part.h:
        * khtml/rendering/render_canvas.cpp: m_renderingDevice && m_registry support.
        (RenderCanvas::RenderCanvas):
        (RenderCanvas::~RenderCanvas):
        (RenderCanvas::renderingDevice): new method for svg
        (RenderCanvas::registry): new method for svg
        * khtml/rendering/render_canvas.h:
        * khtml/rendering/render_container.h: private -> protected (child manipulation)
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::isKCanvasContainer): new for svg
        (khtml::RenderObject::isRenderPath): new for svg
        (khtml::RenderObject::bbox): new for svg
        * khtml/rendering/render_style.cpp: svg support
        (m_affectedByAttributeSelectors):
        (RenderStyle::RenderStyle):
        (RenderStyle::inheritFrom):
        (RenderStyle::operator==):
        (RenderStyle::contentDataEquivalent):
        * khtml/rendering/render_style.h: add m_svgStyle
        (khtml::RenderStyle::svgStyle):
        * khtml/xml/EventNames.h: add zoom event
        * khtml/xml/dom_docimpl.cpp: add referrer
        (DOMImplementationImpl::hasFeature): made const
        (DOMImplementationImpl::createDocument):
        (DOMImplementationImpl::isXMLMIMEType): new function
        (DocumentImpl::implementation): renamed function
        (DocumentImpl::createElementNS): svg support
        (DocumentImpl::recalcStyleSelector): svg <style> support
        (DocumentImpl::createEvent): SVGEvent support
        (DocumentImpl::referrer): moved from HTMLDocument
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentTypeImpl::implementation): renamed function
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::hasAttribute): convenience function
        (ElementImpl::rendererIsNeeded): disable renderers for unknown elements in svg
        * khtml/xml/dom_elementimpl.h:
        * khtml/xml/dom_nodeimpl.cpp:
        (DOM::NodeImpl::createRendererIfNeeded): null check on returned rederer
        * khtml/xml/dom_nodeimpl.h:
        (DOM::NodeImpl::isSVGElement): added for svg
        * khtml/xml/dom_stringimpl.cpp:
        (DOM::DOMStringImpl::DOMStringImpl): init from QString
        * khtml/xml/dom_stringimpl.h:
        * khtml/xml/dom_textimpl.cpp:
        (TextImpl::rendererIsNeeded): don't create RenderText in SVG trees
        * khtml/xsl/xslt_processorimpl.cpp:
        (DOM::XSLTProcessorImpl::createDocumentFromSource): impl -> implementation
        * kwq/DOM.mm:
        (-[DOMDocument implementation]): impl -> implementation
        * kwq/KWQRenderTreeDebug.cpp:
        (write): dispatch to kcanvas write functions
        (externalRepresentation): dump registry
        * kwq/KWQRenderTreeDebug.h: export write function for kcanvas to use


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@11272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7811b780
2005-11-20 Eric Seidel <eseidel@apple.com>
Reviewed by hyatt.
The first part of the big KDOM-DOM merger.
This section covers the additions necessary to the khtml/kwq side
in order to support ksvg2 on top of WebCore's DOM. All changes
are enclosed within SVG_SUPPORT blocks for easy disabling.
http://bugzilla.opendarwin.org/show_bug.cgi?id=3249
* ForwardingHeaders/ksvg2/KSVGPart.h: to KDOMHeaders.h
* ForwardingHeaders/ksvg2/KSVGView.h: to KDOMHeaders.h
* WebCore-svg.exp: removed Draw* symbols
* WebCorePrefix.h: map KDOM to DOM
* khtml/css/css_valueimpl.h:
(DOM::CSSValueImpl::cssValueType): defaults to CSS_CUSTOM
* khtml/css/cssparser.cpp:
(CSSParser::parseValue): calls parseSVGValue as necessary
(DOM::CSSParser::lex):
* khtml/css/cssparser.h:
* khtml/css/cssstyleselector.cpp: svg specific support
(khtml::CSSStyleSelector::loadDefaultStyle): loads svg UA sheet
(khtml::CSSStyleSelector::applyProperty): calls applySVGProperty
* khtml/css/cssstyleselector.h:
* khtml/css/parser.y: calls KSVG::get(Property|Value)ID
* khtml/ecma/domparser.cpp:
(KJS::DOMParserProtoFunc::callAsFunction): use isXMLMIMEType
* khtml/ecma/kjs_dom.cpp:
(KJS::DOMDocument::getValueProperty): impl -> implementation
* khtml/ecma/xmlhttprequest.cpp:
(KJS::XMLHttpRequest::getValueProperty): use isXMLMIMEType
* khtml/html/html_documentimpl.cpp: remove referrer
* khtml/html/html_documentimpl.h: remove referrer
* khtml/khtml_part.cpp:
(KHTMLPart::init):
(KHTMLPart::begin):
* khtml/khtml_part.h:
* khtml/rendering/render_canvas.cpp: m_renderingDevice && m_registry support.
(RenderCanvas::RenderCanvas):
(RenderCanvas::~RenderCanvas):
(RenderCanvas::renderingDevice): new method for svg
(RenderCanvas::registry): new method for svg
* khtml/rendering/render_canvas.h:
* khtml/rendering/render_container.h: private -> protected (child manipulation)
* khtml/rendering/render_object.h:
(khtml::RenderObject::isKCanvasContainer): new for svg
(khtml::RenderObject::isRenderPath): new for svg
(khtml::RenderObject::bbox): new for svg
* khtml/rendering/render_style.cpp: svg support
(m_affectedByAttributeSelectors):
(RenderStyle::RenderStyle):
(RenderStyle::inheritFrom):
(RenderStyle::operator==):
(RenderStyle::contentDataEquivalent):
* khtml/rendering/render_style.h: add m_svgStyle
(khtml::RenderStyle::svgStyle):
* khtml/xml/EventNames.h: add zoom event
* khtml/xml/dom_docimpl.cpp: add referrer
(DOMImplementationImpl::hasFeature): made const
(DOMImplementationImpl::createDocument):
(DOMImplementationImpl::isXMLMIMEType): new function
(DocumentImpl::implementation): renamed function
(DocumentImpl::createElementNS): svg support
(DocumentImpl::recalcStyleSelector): svg <style> support
(DocumentImpl::createEvent): SVGEvent support
(DocumentImpl::referrer): moved from HTMLDocument
* khtml/xml/dom_docimpl.h:
(DOM::DocumentTypeImpl::implementation): renamed function
* khtml/xml/dom_elementimpl.cpp:
(ElementImpl::hasAttribute): convenience function
(ElementImpl::rendererIsNeeded): disable renderers for unknown elements in svg
* khtml/xml/dom_elementimpl.h:
* khtml/xml/dom_nodeimpl.cpp:
(DOM::NodeImpl::createRendererIfNeeded): null check on returned rederer
* khtml/xml/dom_nodeimpl.h:
(DOM::NodeImpl::isSVGElement): added for svg
* khtml/xml/dom_stringimpl.cpp:
(DOM::DOMStringImpl::DOMStringImpl): init from QString
* khtml/xml/dom_stringimpl.h:
* khtml/xml/dom_textimpl.cpp:
(TextImpl::rendererIsNeeded): don't create RenderText in SVG trees
* khtml/xsl/xslt_processorimpl.cpp:
(DOM::XSLTProcessorImpl::createDocumentFromSource): impl -> implementation
* kwq/DOM.mm:
(-[DOMDocument implementation]): impl -> implementation
* kwq/KWQRenderTreeDebug.cpp:
(write): dispatch to kcanvas write functions
(externalRepresentation): dump registry
* kwq/KWQRenderTreeDebug.h: export write function for kcanvas to use
2005-11-20 eseidel <eseidel@apple.com>
Reviewed by mjs.
#include <KWQKSVGPart.h>
#include "KDOMHeaders.h"
#include <KWQKSVGView.h>
#include "KDOMHeaders.h"
.objc_class_name_DrawDocument
.objc_class_name_DrawView
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -72,3 +72,9 @@
#define new ("if you use new/delete make sure to include config.h at the top of the file"())
#define delete ("if you use new/delete make sure to include config.h at the top of the file"())
#endif
#define KDOM DOM
#define KSVGView KHTMLView
#define KDOMView KHTMLView
#define KDOMPart KHTMLPart
......@@ -91,7 +91,7 @@ private:
class CSSValueImpl : public StyleBaseImpl
{
public:
virtual unsigned short cssValueType() const = 0;
virtual unsigned short cssValueType() const { return CSSValue::CSS_CUSTOM; }
virtual DOMString cssText() const = 0;
void setCssText(const DOMString &) { } // FIXME: Not implemented.
......@@ -338,7 +338,6 @@ public:
virtual ~CSSBorderImageValueImpl();
virtual DOMString cssText() const;
virtual unsigned short cssValueType() const { return CSSValue::CSS_CUSTOM; }
public:
// The border image.
......@@ -372,9 +371,7 @@ class FontValueImpl : public CSSValueImpl
public:
FontValueImpl();
virtual ~FontValueImpl();
virtual unsigned short cssValueType() const { return CSSValue::CSS_CUSTOM; }
virtual DOMString cssText() const;
virtual bool isFontValue() { return true; }
......@@ -394,9 +391,7 @@ public:
ShadowValueImpl(CSSPrimitiveValueImpl* _x, CSSPrimitiveValueImpl* _y,
CSSPrimitiveValueImpl* _blur, CSSPrimitiveValueImpl* _color);
virtual ~ShadowValueImpl();
virtual unsigned short cssValueType() const { return CSSValue::CSS_CUSTOM; }
virtual DOMString cssText() const;
CSSPrimitiveValueImpl* x;
......
......@@ -38,12 +38,16 @@
#include "xml/dom_docimpl.h"
#include "csshelper.h"
using namespace DOM;
#include <stdlib.h>
#if SVG_SUPPORT
#include "SVGPaintImpl.h"
#endif
void qFatal ( const char * msg ) {}
using namespace DOM;
ValueList::ValueList()
{
values = (Value *)fastMalloc(16 * sizeof(Value));
......@@ -74,8 +78,6 @@ void ValueList::addValue(const Value &val)
}
using namespace DOM;
#if YYDEBUG > 0
extern int cssyydebug;
#endif
......@@ -1246,6 +1248,10 @@ bool CSSParser::parseValue( int propId, bool important )
// #ifdef CSS_DEBUG
// kdDebug( 6080 ) << "illegal or CSS2 Aural property: " << val << endl;
// #endif
#if SVG_SUPPORT
if (parseSVGValue(propId, important))
return true;
#endif
break;
}
......@@ -2612,7 +2618,7 @@ static inline int yyerror( const char *str ) {
return 1;
}
#define END 0
#define END_TOKEN 0
#include "parser.h"
......@@ -2623,7 +2629,7 @@ int DOM::CSSParser::lex( void *_yylval ) {
unsigned short *t = text( &length );
#ifdef TOKEN_DEBUG
qDebug("CSSTokenizer: got token %d: '%s'", token, token == END ? "" : QString( (QChar *)t, length ).latin1() );
qDebug("CSSTokenizer: got token %d: '%s'", token, token == END_TOKEN ? "" : QString( (QChar *)t, length ).latin1() );
#endif
switch( token ) {
case WHITESPACE:
......@@ -2821,6 +2827,10 @@ unsigned short *DOM::CSSParser::text(int *length)
return start;
}
#if SVG_SUPPORT
#include "ksvg2/css/KSVGCSSParser.cpp"
#endif
#define YY_DECL int DOM::CSSParser::lex()
#define yyconst const
......@@ -2839,9 +2849,8 @@ typedef unsigned int YY_CHAR;
#define YY_RULE_SETUP
#define INITIAL 0
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
#define yyterminate() yyTok = END; return yyTok
#define yyterminate() yyTok = END_TOKEN; return yyTok
#define YY_FATAL_ERROR(a) qFatal(a)
#define BEGIN yy_start = 1 + 2 *
#define COMMENT 1
#include "tokenizer.cpp"
......@@ -145,6 +145,13 @@ namespace DOM {
CSSValueListImpl *parseFontFamily();
CSSPrimitiveValueImpl *parseColor();
CSSPrimitiveValueImpl *parseColorFromValue(Value* val);
#if SVG_SUPPORT
bool parseSVGValue(int propId, bool important, int expected = 1);
CSSValueImpl *parseSVGPaint();
CSSValueImpl *parseSVGColor();
CSSValueImpl *parseSVGStrokeDasharray();
#endif
static bool parseColor(const QString &name, QRgb& rgb);
......
......@@ -215,6 +215,9 @@ CSSRuleSet *CSSStyleSelector::defaultPrintStyle = 0;
CSSStyleSheetImpl *CSSStyleSelector::defaultSheet = 0;
RenderStyle* CSSStyleSelector::styleNotYetAvailable = 0;
CSSStyleSheetImpl *CSSStyleSelector::quirksSheet = 0;
#if SVG_SUPPORT
CSSStyleSheetImpl *CSSStyleSelector::svgSheet = 0;
#endif
static CSSStyleSelector::Encodedurl *currentEncodedURL = 0;
static PseudoState pseudoState;
......@@ -338,6 +341,12 @@ void CSSStyleSelector::loadDefaultStyle(const KHTMLSettings *s)
quirksSheet = parseUASheet(0, "khtml/css/quirks.css");
defaultQuirksStyle = new CSSRuleSet();
defaultQuirksStyle->addRulesFromSheet(quirksSheet, "screen");
#if SVG_SUPPORT
svgSheet = parseUASheet(0, "ksvg2/css/svg.css");
defaultStyle->addRulesFromSheet(svgSheet, "screen");
defaultPrintStyle->addRulesFromSheet(svgSheet, "print");
#endif
}
void CSSStyleSelector::addMatchedRule(CSSRuleData* rule)
......@@ -3969,6 +3978,10 @@ void CSSStyleSelector::applyProperty( int id, CSSValueImpl *value )
}
default:
#if SVG_SUPPORT
// Try the SVG properties
applySVGProperty(id, value);
#endif
return;
}
}
......
......@@ -167,6 +167,9 @@ namespace khtml
static DOM::CSSStyleSheetImpl *defaultSheet;
static DOM::CSSStyleSheetImpl *quirksSheet;
#if SVG_SUPPORT
static DOM::CSSStyleSheetImpl *svgSheet;
#endif
static CSSRuleSet* defaultStyle;
static CSSRuleSet* defaultQuirksStyle;
static CSSRuleSet* defaultPrintStyle;
......@@ -226,6 +229,9 @@ public:
bool isXMLDoc;
void applyProperty(int id, DOM::CSSValueImpl *value);
#if SVG_SUPPORT
void applySVGProperty(int id, DOM::CSSValueImpl *value);
#endif
};
class CSSRuleData {
......
......@@ -37,6 +37,11 @@
#include <kdebug.h>
// #define CSS_DEBUG
#if SVG_SUPPORT
#include "ksvgcssproperties.h"
#include "ksvgcssvalues.h"
#endif
using namespace DOM;
using namespace HTMLNames;
......@@ -958,6 +963,10 @@ property:
IDENT maybe_space {
QString str = qString($1);
$$ = getPropertyID( str.lower().latin1(), str.length() );
#if SVG_SUPPORT
if ($$ == 0)
$$ = KSVG::getPropertyID(str.lower().latin1(), str.length());
#endif
}
;
......@@ -1009,6 +1018,10 @@ term:
| IDENT maybe_space {
QString str = qString( $1 );
$$.id = getValueID( str.lower().latin1(), str.length() );
#if SVG_SUPPORT
if ($$.id == 0)
$$.id = KSVG::getValueID(str.lower().latin1(), str.length());
#endif
$$.unit = CSSPrimitiveValue::CSS_IDENT;
$$.string = $1;
}
......
......@@ -25,6 +25,7 @@
#include "html/html_documentimpl.h"
using DOM::DocumentImpl;
using DOM::DOMImplementationImpl;
////////////////////// DOMParser Object ////////////////////////
......@@ -78,15 +79,14 @@ ValueImp *DOMParserProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj
switch (id) {
case DOMParser::ParseFromString:
{
if (args.size() != 2) {
return Undefined();
}
if (args.size() != 2)
return jsUndefined();
QString str = args[0]->toString(exec).qstring();
QString contentType = args[1]->toString(exec).qstring().stripWhiteSpace();
if (contentType == "text/xml" || contentType == "application/xml" || contentType == "application/xhtml+xml") {
DocumentImpl *docImpl = parser->doc->impl()->createDocument();
if (DOMImplementationImpl::isXMLMIMEType(contentType)) {
DocumentImpl *docImpl = parser->doc->implementation()->createDocument();
docImpl->open();
docImpl->write(str);
......
......@@ -956,7 +956,7 @@ ValueImp *DOMDocument::getValueProperty(ExecState *exec, int token) const
case DocType:
return getDOMNode(exec,doc.doctype());
case Implementation:
return getDOMDOMImplementation(exec,doc.impl());
return getDOMDOMImplementation(exec, doc.implementation());
case DocumentElement:
return getDOMNode(exec,doc.documentElement());
case StyleSheets:
......
......@@ -43,6 +43,7 @@
#include "xmlhttprequest.lut.h"
using DOM::DocumentImpl;
using DOM::DOMImplementationImpl;
using DOM::EventImpl;
using namespace DOM::EventNames;
......@@ -150,9 +151,8 @@ ValueImp *XMLHttpRequest::getValueProperty(ExecState *exec, int token) const
mimeType = MIMETypeOverride;
}
if (mimeType == "text/xml" || mimeType == "application/xml" || mimeType == "application/xhtml+xml" ||
mimeType == "text/xsl" || mimeType == "application/rss+xml" || mimeType == "application/atom+xml") {
responseXML.reset(doc->impl()->createDocument());
if (typeIsXML = DOMImplementationImpl::isXMLMIMEType(mimeType)) {
responseXML.reset(doc->implementation()->createDocument());
DocumentImpl *docImpl = responseXML.get();
......@@ -160,9 +160,6 @@ ValueImp *XMLHttpRequest::getValueProperty(ExecState *exec, int token) const
docImpl->write(response);
docImpl->finishParsing();
docImpl->close();
typeIsXML = true;
} else {
typeIsXML = false;
}
createdDocument = true;
}
......
......@@ -132,13 +132,6 @@ ElementImpl* HTMLDocumentImpl::documentElement() const
return static_cast<ElementImpl*>(_first);
}
DOMString HTMLDocumentImpl::referrer() const
{
if ( part() )
return KWQ(part())->incomingReferrer();
return DOMString();
}
DOMString HTMLDocumentImpl::lastModified() const
{
if ( part() )
......
......@@ -47,7 +47,6 @@ public:
virtual bool isHTMLDocument() const { return true; }
virtual ElementImpl *documentElement() const;
DOMString referrer() const;
DOMString lastModified() const;
DOMString cookie() const;
void setCookie( const DOMString &);
......
......@@ -58,6 +58,9 @@
#include "xml/dom2_rangeimpl.h"
#include "xml/EventNames.h"
#include "xml/xml_tokenizer.h"
#if SVG_SUPPORT
#include "SVGNames.h"
#endif
using namespace DOM;
using namespace HTMLNames;
......@@ -195,6 +198,9 @@ void KHTMLPart::init( KHTMLView *view, GUIProfile prof )
QualifiedName::init();
EventNames::init();
HTMLNames::init(); // FIXME: We should make this happen only when HTML is used.
#if SVG_SUPPORT
KSVG::SVGNames::init();
#endif
if ( prof == DefaultGUI )
setXMLFile( "khtml.rc" );
else if ( prof == BrowserViewGUI )
......@@ -1010,13 +1016,8 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
baseurl = m_url;
}
if (args.serviceType == "text/xml" || args.serviceType == "application/xml" || args.serviceType == "application/xhtml+xml" ||
args.serviceType == "text/xsl" || args.serviceType == "application/rss+xml" || args.serviceType == "application/atom+xml")
if (DOMImplementationImpl::isXMLMIMEType(args.serviceType))
d->m_doc = DOMImplementationImpl::instance()->createDocument( d->m_view );
#if SVG_SUPPORT
else if (args.serviceType == "image/svg+xml")
d->m_doc = DOMImplementationImpl::instance()->createKDOMDocument(d->m_view);
#endif
else
d->m_doc = DOMImplementationImpl::instance()->createHTMLDocument( d->m_view );
......
......@@ -89,6 +89,12 @@ namespace khtml
class XMLTokenizer;
}
#ifdef SVG_SUPPORT
namespace KSVG {
class SVGAElementImpl;
}
#endif
namespace KJS {
class DOMDocument;
class Selection;
......@@ -171,6 +177,9 @@ class KHTMLPart : public KParts::ReadOnlyPart
friend class khtml::RenderWidget;
friend class khtml::CSSStyleSelector;
friend class KHTMLPartIface;
#ifdef SVG_SUPPORT
friend class KSVG::SVGAElementImpl;
#endif
Q_PROPERTY( bool javaScriptEnabled READ jScriptEnabled WRITE setJScriptEnabled )
Q_PROPERTY( bool javaEnabled READ javaEnabled WRITE setJavaEnabled )
......
......@@ -29,6 +29,10 @@
#include "khtml_part.h"
#if SVG_SUPPORT
#include "KRenderingDeviceQuartz.h"
#endif
using namespace khtml;
//#define BOX_DEBUG
......@@ -69,10 +73,17 @@ RenderCanvas::RenderCanvas(DOM::NodeImpl* node, KHTMLView *view)
// Create a new root layer for our layer hierarchy.
m_layer = new (node->getDocument()->renderArena()) RenderLayer(this);
#if SVG_SUPPORT
m_renderingDevice = 0;
#endif
}
RenderCanvas::~RenderCanvas()
{
#if SVG_SUPPORT
delete m_renderingDevice;
#endif
}
void RenderCanvas::calcHeight()
......@@ -642,3 +653,12 @@ void RenderCanvas::setBestTruncatedAt(int y, RenderObject *forRenderer, bool for
m_bestTruncatedAt = y;
}
}
#if SVG_SUPPORT
KRenderingDevice *RenderCanvas::renderingDevice()
{
if (!m_renderingDevice)
m_renderingDevice = new KRenderingDeviceQuartz();
return m_renderingDevice;
}
#endif
......@@ -28,6 +28,10 @@
class KHTMLView;
class QScrollView;
#if SVG_SUPPORT
class KRenderingDevice;
#endif
namespace khtml {
class RenderCanvas : public RenderBlock
......@@ -102,6 +106,10 @@ public:
void updateWidgetPositions();
void addWidget(RenderObject *);
void removeWidget(RenderObject *);
#if SVG_SUPPORT
KRenderingDevice *renderingDevice();
#endif
protected:
......@@ -129,6 +137,10 @@ protected:
typedef HashSet<RenderObject *, PointerHash<RenderObject *> > RenderObjectSet;
RenderObjectSet m_widgets;
#if SVG_SUPPORT
KRenderingDevice *m_renderingDevice;
#endif
};
};
......
......@@ -64,7 +64,7 @@ public:
virtual VisiblePosition positionForCoordinates(int x, int y);
private:
protected:
void setFirstChild(RenderObject *first) { m_first = first; }
void setLastChild(RenderObject *last) { m_last = last; }
......
......@@ -28,6 +28,9 @@
#include <qcolor.h>
#include <qrect.h>
#include <assert.h>
#if SVG_SUPPORT
#include <qwmatrix.h>
#endif
#include "editing/text_affinity.h"
#include "misc/khtmllayout.h"
......@@ -209,14 +212,14 @@ public:
virtual void insertChildNode(RenderObject* child, RenderObject* before);
//////////////////////////////////////////
private:
protected:
//////////////////////////////////////////
// Helper functions. Dangerous to use!
void setPreviousSibling(RenderObject *previous) { m_previous = previous; }
void setNextSibling(RenderObject *next) { m_next = next; }
void setParent(RenderObject *parent) { m_parent = parent; }
//////////////////////////////////////////
private:
void addAbsoluteRectForLayer(QRect& result);
public:
......@@ -275,6 +278,15 @@ public:
virtual bool isFrameSet() const { return false; }
virtual bool isApplet() const { return false; }
#if SVG_SUPPORT
virtual bool isKCanvasContainer() const { return false; }
virtual bool isRenderPath() const { return false; }
virtual QRect bbox(bool includeStroke = true) { return QRect(); }
// We may eventually want to make these non-virtual
virtual QMatrix localTransform() const { return QMatrix(); }
virtual void setLocalTransform(const QMatrix&) { }
#endif
virtual bool isEditable() const;
bool isHTMLMarquee() const;
......
......@@ -28,6 +28,10 @@
#include "css/cssstyleselector.h"
#include "render_arena.h"
#if SVG_SUPPORT
#include "SVGRenderStyle.h"
#endif
#include "kdebug.h"
using namespace khtml;
......@@ -525,6 +529,10 @@ RenderStyle::RenderStyle()
inherited = _default->inherited;
#if SVG_SUPPORT
m_svgStyle = new KSVG::SVGRenderStyle();
#endif
setBitDefaults();
pseudoStyle = 0;
......@@ -545,6 +553,10 @@ RenderStyle::RenderStyle(bool)
css3NonInheritedData.access()->marquee.init();
css3InheritedData.init();
inherited.init();
#if SVG_SUPPORT
m_svgStyle = new KSVG::SVGRenderStyle(true);
#endif