Closed Bug 281260 Opened 21 years ago Closed 19 years ago

display:none on foreignObject content can't be removed

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: harald.albrecht, Unassigned)

References

Details

(Whiteboard: [reflow-refactor])

Attachments

(4 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b) Gecko/20050201 Firefox/1.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b) Gecko/20050201 Firefox/1.0+ (X)HTML elements (such as <div>) inside <foreignObject> are not shown if they have been created first with "display:none" and this CSS property has later been changed to "display:block". Normally this should make the XHTML elements appear. Reproducible: Always Steps to Reproduce: 1. Load attached testcase Actual Results: Only an empty canvas. The rectangle is not shown. Expected Results: A red dotted rectangled should be shown after one second.
Load the example. The inner <div> is first hidden (display:none). After one second its CSS property "display" is set to "block" which should ordinarily make the div appear on screen. Instead, nothing happens. The alert box shows that the "display:block" has been set after one second.
Attachment #173532 - Attachment mime type: text/xml → text/xhtml
Attachment #173532 - Attachment mime type: text/xhtml → text/html
Attachment #173532 - Attachment mime type: text/html → text/xml
sorry for the mimetyp changes but I had the wrong browser window open and did not see anything, this testcase triggers ###!!! ASSERTION: zero axis length: 'd!=0.0f', file e:/moz_src/mozilla/content/svg/content/src/nsSVGLength.cpp, line 551
Confirming. Interestingly, setting the CSS display property to values other than 'none' seems to work okay, but as soon as display is to 'none', setting it to another value fails to cause the element to show again.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: "display" CSS property is not honered properly → display:none on foreignObject content can't be removed
Attached file another testcase —
Does this work if display is toggled for a grandchild of a foreignObject?
So with the first testcase, the first problem is that the positioned node ends up not being a child of the foreignObject, since the foreignObject is not detected as an absolute containing block by nsCSSFrameConstructor::GetAbsoluteContainingBlock... Not sure what's going on in the other testcases, offhand.
In the second testcase, a click gives me: ###!!! ASSERTION: uh oh. the block we need to reframe has no parent!: 'Error', file /home/bzbarsky/mozilla/xlib/mozilla/layout/base/nsCSSFrameConstructor.cpp, line 13329 This keeps the frame for the child from even being created. This is WipeContainingBlock, so the problem is that the foreignobject frame has display:inline, which means we look for the block containing it and try to reframe the whole thing, since we think we're in an {ib} split. Probably worth filing a bug on that, as well as on the abs pos issue I pointed out in comment 7. The third testcase works if I change the sizedReflowState to explicitly have a "Initial" reflow reason. So it's some issue with blocks and the bizarre reflow state and such they get from this code (unconstrained computed width and height, weird mRect, etc, etc). It's almost worth just waiting for the reflow branch and seeing whether the problem remains at that point.
Whiteboard: [reflow-refactor]
Flags: blocking1.9?
This works for me now.
Yeah, I think that patch would have this effect.
Status: NEW → RESOLVED
Closed: 19 years ago
Depends on: 368101
Flags: in-testsuite?
Resolution: --- → FIXED
Attached image better testcase —
Flags: in-testsuite? → in-testsuite+
OS: Windows 2000 → All
Hardware: PC → All
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: