Closed Bug 237119 Opened 20 years ago Closed 16 years ago

property 'display' is ignored for generated content

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: aha, Unassigned)

References

Details

(Keywords: css2, testcase, Whiteboard: parity-opera)

Attachments

(1 file)

2004031008/trunk/W2K

In the attached testcase generated content should be a block with beige
background and border. Though is declared as display:block, generated content is
rendered as inline.

Testcase:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Testcase</title>
</head>
<style type="text/css">
span:after {
	display:inline;
	content:attr(expl);
	white-space:pre;
	border:1px solid #999;
	background-color:#FDA;
}
</style>
<body>
<span expl="This should
be rendered
as one block.">foo</span>
</body>
</html>
Keywords: testcase
Attached file Testcase
> Though is declared as display:block, generated content is
> rendered as inline.

Our behavior is correct per
http://www.w3.org/TR/CSS2/generate.html#before-after-content

But it looks like in CSS2.1 that whole section on what properties are not
applied to generated content, etc, has been removed.  If so, we need to remove
some code in nsRuleNode.cpp...

Adam, can you please file a separate bug on the wrapping weirdness in that testcase?
Assignee: nobody → dbaron
Component: Layout → Style System (CSS)
OS: Windows 2000 → All
QA Contact: core.layout → ian
Hardware: PC → All
Keywords: css2
> Our behavior is correct per
> http://www.w3.org/TR/CSS2/generate.html#before-after-content

Okay, I didn't look to CSS 2.0 specification neither following resolution of bug
17646.

BTW Opera 7.50 PR 3 is rendering this testcase as CSS 2.1 says.

> Adam, can you please file a separate bug on the wrapping weirdness in that 
> testcase?

I'm sorry, but I don't see any wrapping weirdness =) I wrote attribute value
with line breaks and I hope that Mozilla will display it with white-space:pre;
same on several lines. Or do you mean something completely different?
Whiteboard: parity-opera
Ah, I missed white-space:pre.
Yeah, position, float, display, white-space, etc, they all apply to ::before and 
::after now. In fact about the only thing that _doesn't_ apply is 'binding'.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: 238072
There's an example at http://www.howtocreate.co.uk/wrongWithIE/eightpointbox.html that shows some of what can be done if position and related properties can be applied to generated content.  Compare the Firefox 1.5 and Opera 8.5 renderings.
We're aware what the problem is, yes.
Assignee: dbaron → nobody
QA Contact: ian → style-system
This works (fixed by bug 238072?)

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2pre) Gecko/20081011 Minefield/3.1b2pre
Yeah.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: