Closed Bug 331432 Opened 20 years ago Closed 20 years ago

crash [@ nsSVGUtils::PaintChildWithEffects] using svg:foreignObject

Categories

(Core :: SVG, defect)

x86
Linux
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: ted, Assigned: roc)

References

()

Details

(Keywords: crash, testcase)

Crash Data

Attachments

(3 files, 1 obsolete file)

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)
Are you building foreignObject yet tor? ;-)
Severity: normal → critical
Keywords: crash, testcase
And state = 0x00cc0008
Attached file minimized testcase —
Pretty minimized testcase.
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. ***
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
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 ?
Attached patch fix (obsolete) — — Splinter Review
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 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+
Attachment #223737 - Flags: superreview?(dbaron) → superreview?(bzbarsky)
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-
(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.
Attached patch updated patch — — Splinter Review
Attachment #223737 - Attachment is obsolete: true
Attachment #224495 - Flags: superreview?(bzbarsky)
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
checked in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
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...
trivial patch...
Attachment #225231 - Flags: superreview?(bzbarsky)
Attachment #225231 - Flags: review?(bzbarsky)
Attachment #225231 - Flags: superreview?(bzbarsky)
Attachment #225231 - Flags: superreview+
Attachment #225231 - Flags: review?(bzbarsky)
Attachment #225231 - Flags: review+
I have a feeling this might have reduced Tp a bit on btek. I find that very frightening.
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.
Regression from bug 331883 no doubt. Where is svg.css being loaded? you should be able to fix it for me :-)
Probably nsDocument::EnsureCatalogStyleSheet, I'd guess.
Blocks: 342961
(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
Crash Signature: [@ nsSVGUtils::PaintChildWithEffects]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: