Closed
Bug 331432
Opened 20 years ago
Closed 20 years ago
crash [@ nsSVGUtils::PaintChildWithEffects] using svg:foreignObject
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: ted, Assigned: roc)
References
()
Details
(Keywords: crash, testcase)
Crash Data
Attachments
(3 files, 1 obsolete file)
|
256 bytes,
application/xml
|
Details | |
|
27.00 KB,
patch
|
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
|
1.67 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
Crashed using my own build and a cairo-gtk2 nightly on the provided URL.
SIGSEGV: Segmentation Fault: (signal 11)
Talkback stack: TB16724212H
nsSVGUtils::PaintChildWithEffects()
nsSVGGFrame::PaintSVG()
nsSVGUtils::PaintChildWithEffects()
nsSVGGFrame::PaintSVG()
nsSVGUtils::PaintChildWithEffects()
nsSVGOuterSVGFrame::Paint()
nsDisplaySVG::Paint()
nsDisplayList::Paint()
nsDisplayWrapList::Paint()
nsDisplayClip::Paint()
nsDisplayList::Paint()
nsLayoutUtils::PaintFrame()
PresShell::Paint()
nsViewManager::RenderViews()
nsViewManager::Refresh()
nsViewManager::DispatchEvent()
HandleEvent()
nsCommonWidget::DispatchEvent()
nsWindow::OnExposeEvent()
expose_event_cb()
libgtk-x11-2.0.so.0 + 0x113c7a (0x4035cc7a)
libgobject-2.0.so.0 + 0x95bb (0x406315bb)
libgobject-2.0.so.0 + 0x18a6d (0x40640a6d)
libgobject-2.0.so.0 + 0x19c05 (0x40641c05)
libgobject-2.0.so.0 + 0x1a1fe (0x406421fe)
libgtk-x11-2.0.so.0 + 0x1f14d8 (0x4043a4d8)
libgtk-x11-2.0.so.0 + 0x1126d6 (0x4035b6d6)
libgdk-x11-2.0.so.0 + 0x2cb1c (0x4054fb1c)
libgdk-x11-2.0.so.0 + 0x2cc1c (0x4054fc1c)
libgdk-x11-2.0.so.0 + 0x2ccc4 (0x4054fcc4)
libglib-2.0.so.0 + 0x27931 (0x40688931)
libglib-2.0.so.0 + 0x253f1 (0x406863f1)
libglib-2.0.so.0 + 0x28647 (0x40689647)
libglib-2.0.so.0 + 0x28b98 (0x40689b98)
libgtk-x11-2.0.so.0 + 0x111849 (0x4035a849)
nsAppShell::Run()
nsAppStartup::Run()
XRE_main()
firefox-bin + 0x63f (0x0804863f)
libc.so.6 + 0x14ed0 (0x40965ed0)
Comment 1•20 years ago
|
||
Are you building foreignObject yet tor? ;-)
Updated•20 years ago
|
| Reporter | ||
Comment 2•20 years ago
|
||
http://lxr.mozilla.org/mozilla/source/layout/svg/base/src/nsSVGUtils.cpp#990
property comes out NULL here.
| Reporter | ||
Comment 3•20 years ago
|
||
And state = 0x00cc0008
| Reporter | ||
Comment 4•20 years ago
|
||
Pretty minimized testcase.
The frame state bits for nsBlockFrame collide with those for SVG.
http://lxr.mozilla.org/seamonkey/source/layout/generic/nsHTMLParts.h#59
http://lxr.mozilla.org/seamonkey/source/layout/svg/base/src/nsSVGUtils.h#75
| Assignee | ||
Comment 6•20 years ago
|
||
oh dear.
Perhaps it's time to make the block an anonymous child of nsSVGForeignObjectFrame?
*** Bug 331762 has been marked as a duplicate of this bug. ***
Comment 8•20 years ago
|
||
Is Mozilla the only browser that doesn't support sound in SVG?
Now that Opera, Safari-webkit and IE with ASV all support sound.
see bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=334920
Comment 9•20 years ago
|
||
on latest-trunk + Ubuntu Dapper, svg:foreignObject doesn't appears. But other element(s) appears.
the firefox doesn't crash.
# or this is another bug ?
| Assignee | ||
Comment 10•20 years ago
|
||
Split foreignObject into a pure-SVG frame containing an anonymous block frame.
Assignee: general → roc
Status: NEW → ASSIGNED
Attachment #223737 -
Flags: superreview?(dbaron)
Attachment #223737 -
Flags: review?(tor)
Comment 11•20 years ago
|
||
Comment on attachment 223737 [details] [diff] [review]
fix
>- if (aTag == nsSVGAtoms::foreignObject) {
>+ if (aTag == nsSVGAtoms::foreignObject) {
Tiny nit - should be nsGkAtoms these days, I believe.
r=tor
Attachment #223737 -
Flags: review?(tor) → review+
| Assignee | ||
Updated•20 years ago
|
Attachment #223737 -
Flags: superreview?(dbaron) → superreview?(bzbarsky)
Comment 12•20 years ago
|
||
Comment on attachment 223737 [details] [diff] [review]
fix
>Index: layout/base/nsCSSFrameConstructor.cpp
>+ nsRefPtr<nsStyleContext> innerPseudoStyle;
>+ innerPseudoStyle = mPresShell->StyleSet()->
>+ ResolvePseudoStyleFor(aContent,
So this will break "inherit" values for kids of the foreignobject. we have that problem with table cells already, so I guess we should just try to fix it in general instead of trying to deal with it here somehow.
>+ if (NS_UNLIKELY(!blockFrame)) {
>+ newFrame->Destroy();
>+ return NS_ERROR_FAILURE;
>+ }
We've already put newFrame into a frame list, no? Destroying it at this point is not really cool, since it will end up with either a destroyed frame in the frame tree or a double-destroy depending on what the caller does.
If ConstructBlock throws, do we need to do any sort of cleanup on newFrame?
>Index: layout/style/ua.css
>-*|*::-moz-anonymous-block, *|*::-moz-cell-content {
>+*|*::-moz-anonymous-block, *|*::-moz-cell-content, *|*::-moz-svg-foreign-content {
> display: block !important;
We probably want position:static !important for the svg foreign content too (and maybe for the cell content?).
>Index: layout/svg/base/src/nsSVGForeignObjectFrame.cpp
>+nsSVGForeignObjectFrame::GetType() const
>+{
>+ return nsGkAtoms::svgForeignObjectFrame;
Does that mean we can nix the corresponding IsFrameOfType() bit?
The rest looks ok (though a bit of an annoyance to merge with reflow branch)... But I'd really like to see a fixed version of the frame construction code.
Attachment #223737 -
Flags: superreview?(bzbarsky) → superreview-
| Assignee | ||
Comment 13•20 years ago
|
||
(In reply to comment #12)
> (From update of attachment 223737 [details] [diff] [review] [edit])
> >Index: layout/base/nsCSSFrameConstructor.cpp
> >+ nsRefPtr<nsStyleContext> innerPseudoStyle;
> >+ innerPseudoStyle = mPresShell->StyleSet()->
> >+ ResolvePseudoStyleFor(aContent,
>
> So this will break "inherit" values for kids of the foreignobject. we have
> that problem with table cells already, so I guess we should just try to fix
> it in general instead of trying to deal with it here somehow.
One way would be a) ensure that the primary frame for some content always has the true style information for the content (hopefully this is already true), and b) have some way to get from some frame for a piece of content to the primary frame (e.g. crawl up to the ancestor-most frame with the same mContent, find first in flow, call virtual function in nsIFrame in case the primary frame is some wrapped frame). Then we could get the parent style context for a child frame from the parent's primary frame.
> >+ if (NS_UNLIKELY(!blockFrame)) {
> >+ newFrame->Destroy();
> >+ return NS_ERROR_FAILURE;
> >+ }
>
> We've already put newFrame into a frame list, no? Destroying it at this
> point is not really cool, since it will end up with either a destroyed frame
> in the frame tree or a double-destroy depending on what the caller does.
Oops, yeah. I'll just not destroy it here, it will be cleaned up the caller.
> If ConstructBlock throws, do we need to do any sort of cleanup on newFrame?
No. It ends up in a frame list which the caller should clean up.
> >Index: layout/style/ua.css
>
> >-*|*::-moz-anonymous-block, *|*::-moz-cell-content {
> >+*|*::-moz-anonymous-block, *|*::-moz-cell-content, *|*::-moz-svg-foreign-content {
> > display: block !important;
>
> We probably want position:static !important for the svg foreign content too
> (and maybe for the cell content?).
Sure. -moz-anonymous-block should be position:static too.
> >Index: layout/svg/base/src/nsSVGForeignObjectFrame.cpp
> >+nsSVGForeignObjectFrame::GetType() const
> >+{
> >+ return nsGkAtoms::svgForeignObjectFrame;
>
> Does that mean we can nix the corresponding IsFrameOfType() bit?
Possibly, but there's no real reason to do that is there?
> The rest looks ok (though a bit of an annoyance to merge with reflow
> branch)...
Yeah. But I want to get foreignobject working again soon so we can test transformed HTML content.
| Assignee | ||
Comment 14•20 years ago
|
||
Attachment #223737 -
Attachment is obsolete: true
Attachment #224495 -
Flags: superreview?(bzbarsky)
Comment 15•20 years ago
|
||
Comment on attachment 224495 [details] [diff] [review]
updated patch
> Oops, yeah. I'll just not destroy it here, it will be cleaned up the caller.
Actually, the caller just ignores the rv. :( Things are OK because your outer frame deals with a null inner, though.
> Possibly, but there's no real reason to do that is there?
Yeah. Let's do a followup on that.
Attachment #224495 -
Flags: superreview?(bzbarsky) → superreview+
Summary: crash @ nsSVGUtils::PaintChildWithEffects() using svg:foreignObject → crash [@ nsSVGUtils::PaintChildWithEffects] using svg:foreignObject
| Assignee | ||
Comment 16•20 years ago
|
||
checked in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment 17•20 years ago
|
||
Comment on attachment 224495 [details] [diff] [review]
updated patch
>Index: layout/style/nsCSSAnonBoxList.h
>+#ifdef MOZ_SVG
>+CSS_ANON_BOX(mozSVGForeignContent, ":-moz-svg-foreign-content")
>+#endif
>Index: layout/style/ua.css
>-*|*::-moz-anonymous-block, *|*::-moz-cell-content {
>+*|*::-moz-anonymous-block, *|*::-moz-cell-content, *|*::-moz-svg-foreign-content {
> display: block !important;
>+ position: static !important;
> }
This causes a CSS error on startup of SVG-disabled builds...
| Assignee | ||
Comment 18•20 years ago
|
||
trivial patch...
Attachment #225231 -
Flags: superreview?(bzbarsky)
Attachment #225231 -
Flags: review?(bzbarsky)
Updated•20 years ago
|
Attachment #225231 -
Flags: superreview?(bzbarsky)
Attachment #225231 -
Flags: superreview+
Attachment #225231 -
Flags: review?(bzbarsky)
Attachment #225231 -
Flags: review+
| Assignee | ||
Comment 19•20 years ago
|
||
checked in.
| Assignee | ||
Comment 20•20 years ago
|
||
I have a feeling this might have reduced Tp a bit on btek.
I find that very frightening.
Comment 21•20 years ago
|
||
I'm getting the following error:
CSS Error (resource://gre/res/svg.css :72.30): Unknown pseudo-class or pseudo-element '-moz-svg-foreign-content'. Ruleset ignored due to bad selector.
| Assignee | ||
Comment 22•20 years ago
|
||
Regression from bug 331883 no doubt. Where is svg.css being loaded? you should be able to fix it for me :-)
Comment 23•20 years ago
|
||
Probably nsDocument::EnsureCatalogStyleSheet, I'd guess.
Comment 24•20 years ago
|
||
(In reply to comment #22)
> Regression from bug 331883 no doubt. Where is svg.css being loaded? you should
> be able to fix it for me :-)
>
raised as bug 342961
Updated•15 years ago
|
Crash Signature: [@ nsSVGUtils::PaintChildWithEffects]
You need to log in
before you can comment on or make changes to this bug.
Description
•