Last Comment Bug 237119 - property 'display' is ignored for generated content
: property 'display' is ignored for generated content
Status: RESOLVED FIXED
parity-opera
: css2, testcase
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: All All
: -- normal with 8 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: Jet Villegas (:jet)
Mentors:
Depends on: 238072
Blocks:
  Show dependency treegraph
 
Reported: 2004-03-11 05:51 PST by Adam Hauner
Modified: 2008-11-16 07:34 PST (History)
15 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Testcase (418 bytes, text/html)
2004-03-11 05:55 PST, Adam Hauner
no flags Details

Description Adam Hauner 2004-03-11 05:51:20 PST
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>
Comment 1 Adam Hauner 2004-03-11 05:55:46 PST
Created attachment 143590 [details]
Testcase
Comment 2 Boris Zbarsky [:bz] (still a bit busy) 2004-03-11 07:37:14 PST
> 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?
Comment 3 Adam Hauner 2004-03-11 08:21:06 PST
> 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?
Comment 4 Boris Zbarsky [:bz] (still a bit busy) 2004-03-11 09:46:58 PST
Ah, I missed white-space:pre.
Comment 5 Hixie (not reading bugmail) 2004-03-12 05:17:16 PST
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'.
Comment 6 Kelson 2006-02-22 15:33:09 PST
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.
Comment 7 Boris Zbarsky [:bz] (still a bit busy) 2006-02-22 18:04:59 PST
We're aware what the problem is, yes.
Comment 8 j.j. 2008-11-15 23:49:21 PST
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
Comment 9 Boris Zbarsky [:bz] (still a bit busy) 2008-11-16 07:34:41 PST
Yeah.

Note You need to log in before you can comment on or make changes to this bug.