renderer for <svg> element

Slava Tokarev tsjoker at gmail.com
Sat May 31 19:18:54 BST 2008


Hi, khtml devs,

I'm working on my gsoc project: porting SVG from WebKit to khtml. So far
I've managed to port part of the DOM, enough to create <svg> element, and I
hope <rect> element too.
The next step that I want to take is porting rendering code (on in worse
case partly writing one) to render <svg> and <rect> in some bounded cases.
I've tried to copy implementation of RenderSVGRoot class (renderer for
<svg>) from WebCore. I've attached the original files from WC. But I have
problems with it. (of course I had to comment almost all methods, maybe it's
the problem but I really doubt that)
it crashes on small example:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg">

<!--<rect width="300" height="100"
style="fill:rgb(0,0,255);stroke-width:1;
stroke:rgb(0,0,0)"/>-->

</svg>

BackTrace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb58f7a20 (LWP 12790)]
0xb77484b9 in khtml::RenderBox::dirtyInlineBoxes (this=0x855919c,
fullLayout=true) at
/home/tsjoker/kde/src/kdelibs/khtml/rendering/render_box.cpp:269
269                 m_placeHolderBox->detach(renderArena(), true
/*noRemove*/
);
(gdb)
bt

#0  0xb77484b9 in khtml::RenderBox::dirtyInlineBoxes (this=0x855919c,
fullLayout=true) at
/home/tsjoker/kde/src/kdelibs/khtml/rendering/render_box.cpp:269
#1  0xb770bd1c in khtml::RenderBlock::layoutInlineChildren (this=0x8559060,
relayoutChildren=true,
breakBeforeLine=0)
    at
/home/tsjoker/kde/src/kdelibs/khtml/rendering/bidi.cpp:1437

#2  0xb771a864 in khtml::RenderBlock::layoutBlock (this=0x8559060,
relayoutChildren=true)

    at
/home/tsjoker/kde/src/kdelibs/khtml/rendering/render_block.cpp:782

#3  0xb778f90c in khtml::RenderCanvas::layout (this=0x8559060) at
/home/tsjoker/kde/src/kdelibs/khtml/rendering/render_canvas.cpp:187

#4  0xb75c8783 in KHTMLView::layout (this=0x81c0f00) at
/home/tsjoker/kde/src/kdelibs/khtml/khtmlview.cpp:966

#5  0xb75c8c66 in KHTMLView::timerEvent (this=0x81c0f00, e=0xbfe69498) at
/home/tsjoker/kde/src/kdelibs/khtml/khtmlview.cpp:4011

#6  0xb7e45c9a in QObject::event () from
/usr/lib/libQtCore.so.4

#7  0xb6131c6f in QWidget::event () from
/usr/lib/libQtGui.so.4

#8  0xb6467063 in QFrame::event () from
/usr/lib/libQtGui.so.4

#9  0xb64fb211 in QAbstractScrollArea::event () from
/usr/lib/libQtGui.so.4

#10 0xb64ff08f in QScrollArea::event () from
/usr/lib/libQtGui.so.4

#11 0xb75c64dd in KHTMLView::event (this=0x81c0f00, e=0xbfe69498) at
/home/tsjoker/kde/src/kdelibs/khtml/khtmlview.cpp:524

#12 0xb60dac0c in QApplicationPrivate::notify_helper () from
/usr/lib/libQtGui.so.4

#13 0xb60df898 in QApplication::notify () from
/usr/lib/libQtGui.so.4

#14 0xb70cc00b in KApplication::notify (this=0xbfe69770, receiver=0x81c0f00,
event=0xbfe69498)

    at
/home/tsjoker/kde/src/kdelibs/kdeui/kernel/kapplication.cpp:311

#15 0xb7e356a9 in QCoreApplication::notifyInternal () from
/usr/lib/libQtCore.so.4

#16 0xb7e631a1 in ?? () from
/usr/lib/libQtCore.so.4

#17 0xb7e60a40 in ?? () from
/usr/lib/libQtCore.so.4

#18 0xb5bbabf8 in g_main_context_dispatch () from
/usr/lib/libglib-2.0.so.0

#19 0xb5bbde5e in ?? () from
/usr/lib/libglib-2.0.so.0

#20 0x08073058 in ??
()

#21 0x00000000 in ??
()


Is the inheritance correct for RenderSVGRoot <- RenderContainer <-
RenderObject in case of khtml?
I would appreciate any thoughts/ideas/advices about rendering stuff and
especially this case.

p.s. my working branch is branches/work/khtml-blaze.

Thanks,
Vyacheslav Tokarev (vtokarev)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20080601/26794140/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RenderSVGRoot.h
Type: text/x-chdr
Size: 2553 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20080601/26794140/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RenderSVGRoot.cpp
Type: text/x-c++src
Size: 11248 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20080601/26794140/attachment.cpp>


More information about the kfm-devel mailing list