property 'display' is ignored for generated content

RESOLVED FIXED

Status

()

Core
CSS Parsing and Computation
RESOLVED FIXED
14 years ago
9 years ago

People

(Reporter: Adam Hauner, Unassigned)

Tracking

({css2, testcase})

Trunk
css2, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: parity-opera)

Attachments

(1 attachment)

(Reporter)

Description

14 years ago
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>
(Reporter)

Updated

14 years ago
Keywords: testcase
(Reporter)

Comment 1

14 years ago
Created attachment 143590 [details]
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

Updated

14 years ago
Keywords: css2
(Reporter)

Comment 3

14 years ago
> 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'.

Updated

14 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: 238072

Comment 6

12 years ago
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
No longer blocks: 238072
Depends on: 238072

Comment 8

9 years ago
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
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.