Closed Bug 167292 Opened 20 years ago Closed 14 years ago

Incorrect behavior when rule for floating :first-letter removed/added


(Core :: CSS Parsing and Computation, defect)

Not set





(Reporter: Maniac, Unassigned)




(Keywords: helpwanted, testcase)

CSS2 selectors with display:block loose formatting on alternate stylesheet change

Build ID: 2002090308 (trunk)

Steps to reproduce:

1. Go to URL. Page has 2 stylesheet with P:first-letter set to display:block;
float:left and some color.
2. Page displayed correctly: a word 'Test' with first letter red.
3. Change stylesheet from menu View, Use style

Actual behaviour:

Color (and actually any style) is lost and word 'Test' displayed twice (!)

Expected behaviour:

First letter of word 'Test' changes its color to blue, as specified in second

P.S. This doesn't occur without setting display:block; float:left;
Confirming bug, 2002-09-05-08 trunk Linux
Ever confirmed: true
Keywords: testcase
OS: Windows 98 → All
Summary: CSS2 selectors with display:block loose formatting on alternate stylesheet change → [RR/RCF]Incorrect behavior when rule for floating :first-letter removed/added
I feel that this is the same issue: Mozilla also refuses to display :before and
:after pseudo-elements after stylesheet change. May be the overview should sound
like '[RR/RCF]Incorrect behavior when rule for CSS2 selectors (:first-letter,
:after, :before) removed/added'?
This is NOT the same bug as issues relating to :before and :after.
Keywords: helpwanted
Hardware: PC → All
Summary: [RR/RCF]Incorrect behavior when rule for floating :first-letter removed/added → Incorrect behavior when rule for floating :first-letter removed/added
Blocks: 229764
So there are several basic ways to fix this problem:

1)  Simply reframe if we used to have a first-letter pseudo and no longer do.
2)  Make the mContent for first-letter be the block, not the textnode
3)  Make ReResolveStyleContext append a reframe hint for the block if the
    first-letter needs a reframe.

#1 will fix this bug, but not bugs where a first-letter reframe is triggered
without removing all first-letter styles.  #2 and #3 will both work in general;
#3 may be safer, but #2 seems cleaner to me....

David, Robert, thoughts?
Oh, and I think the key here is that when we go to ContentRemoved on the
textnode we want to reframe (since that's the mContent for the first-letter),
the block doesn't have a first-letter frame anymore, so we don't
RemoveLetterFrames, though we really should....
Blocks: 261760
I'm not really up to speed on first-letter machinations.
Blocks: 303076
Assignee: dbaron → nobody
QA Contact: ian → style-system
No longer blocks: 229764
URL is 404, so duping forward to bug 303076, which has a testcase.
Closed: 14 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 303076
You need to log in before you can comment on or make changes to this bug.