Closed Bug 245633 Opened 20 years ago Closed 20 years ago

img:before { content: "text"; } no longer works [GC]

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bugzilla, Assigned: dbaron)

References

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040604 Firefox/0.8.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040604 Firefox/0.8.0+

Using CSS such as img:before {content: "text"; } was working in the Firefox 0.8
release. Using a recent Firefox 0.9 branch build [Mozilla/5.0 (Windows; U;
Windows NT 5.0; en-US; rv:1.7) Gecko/20040604 Firefox/0.8.0+] this CSS no longer
works.

I have been unable to find any mention of this in Bugzilla, but saw the
following post in the forums:

http://forums.mozillazine.org/viewtopic.php?t=69087

Reproducible: Always
Steps to Reproduce:
1. Add the following CSS to a page: img:before { content: "text"; }

Actual Results:  
The text does not appear.

Expected Results:  
The text should appear before all images.
'::before' and/or '::after' don't apply to replaced elements.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Oh yes? Then how did this example creep into the CSS2 specification:
-----
12.2 The 'content' property
(...)
The next rule inserts the text of the HTML "alt" attribute before the image. If
the image is not displayed, the reader will still see the "alt" text.

IMG:before { content: attr(alt) }
-----
In case this was changed in CSS2.1, CSS3 or with an Errata then at least say so.
You should not look in CSS 2.0. It is bogus for quite some parts, especially
that example is really bad. They never really thought about it, I guess.
(In reply to comment #3)
Ok, after looking at 169334 I see the Mozilla crew has decided that the current
implementation is the right one. 
I don't no whether it matters but I think duplicate of bug 169334 would be the
better resolution of this bug: to point people searching bugzilla for an
explanation why that example doesn't work any more in the right direction.
*** Bug 252834 has been marked as a duplicate of this bug. ***
*** Bug 257934 has been marked as a duplicate of this bug. ***
Summary: img:before { content: "text"; } no longer works → img:before { content: "text"; } no longer works [GC]
*** Bug 259770 has been marked as a duplicate of this bug. ***
*** Bug 292849 has been marked as a duplicate of this bug. ***
*** Bug 319849 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.