Closed Bug 158192 Opened 22 years ago Closed 22 years ago

An element w/o :after or :before changed to having :after or :before does not display the generated content

Categories

(Core :: Layout, defect, P3)

x86
Windows NT
defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: bugzilla, Assigned: attinasi)

References

Details

(Keywords: testcase)

Attachments

(1 file)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.1b) Gecko/20020717
BuildID:    2002071708

If you have an element which intially does not have any :before or :after
generated content and make a change that makes it so it now should have :before
or :after generated content, that content does not appear.

Reproducible: Always
Steps to Reproduce:
1. Open attached testcase
2. Click first hyperlink
3. Click second hyperlink

Actual Results:  When first hyperlink in clicked, nothing happens.
When second hyperlink is clicked, hyperlink changes to "[B] Change class"

Expected Results:  Both hyperlinks should change to "[B] Change class" when clicked

Testcase contains this stylesheet:

  .a:before { content: "[A] " }
  .b:before { content: "[B] " }

Both links change the link class to b so they should both have the "[B] "
:before text after clicking.  However, only the second link, which started out
as class a and had :before text intially, displays the class b :before text
properly after clicking.
Attached file Original testcase
This also happens if you change style sheets, where the new stylesheet has
:before or :after generated text for an element which didn't before.
Keywords: testcase
Over to layout.
Assignee: jst → attinasi
Component: DOM Other → Layout
QA Contact: gerardok → petersen
If you add .c:before { content: ""} to the testcase, it works as expected. 
However, this should not be needed.

My guess is that the :before content node is not created, and therefore is not
displayed when the class changes.
It also works as expected if you add .c:after { content: "" }
Priority: -- → P3
Target Milestone: --- → Future
patch in bug 126072 fixes this.
Depends on: 126072
fixed by checkin for bug 126072
Status: NEW → RESOLVED
Closed: 22 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: