Closed Bug 212137 Opened 21 years ago Closed 21 years ago

::first-letter doesn't work properly when ::before/::after generated content is present

Categories

(Core :: CSS Parsing and Computation, defect, P4)

defect

Tracking

()

VERIFIED FIXED
Future

People

(Reporter: annevk, Assigned: dbaron)

Details

(Keywords: testcase)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5a) Gecko/20030707
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5a) Gecko/20030707

I made to testcases about this problem: 
:before / ::before
http://www.annevankesteren.nl/css/testcase/pseudo_before.html
:after / ::after
http://www.annevankesteren.nl/css/testcase/pseudo_after.html

The second table on each page shows the problem.

Unrelated: You can't select generated text, Mozilla applies the css on invalid
attributes.

Reproducible: Always

Steps to Reproduce:
OS: Windows XP → All
Priority: -- → P4
Hardware: PC → All
Summary: Doesn't apply :first-letter on :before / :after or ::first-letter on ::before / ::after → ::first-letter doesn't work when ::before/::after generated content present
Target Milestone: --- → Future
selecting generated content is bug 12460
From http://www.w3.org/TR/CSS21/selector.html#first-letter :
"The :first-letter pseudo-element matches parts of block-level elements only."

If you change EM to P in the examples they work better (except "css3-test-21"
and "css3-test-22" for which you have a typo in the style rules).

There is one thing that doesn't seem to work though, the text-decoration
property isn't applied to the :first-letter.
Typos and incorrect implementation from the standard have been fixed in both
examples. Changed the summary als o a bit so it fits better to the problem.

//
I had also another problem with generated content in mozilla. Opera shows
something, but does not apply everything.

That was also about an inline element (code), but I set it to a block-level
element with css. Should I put this into it's own bug? Example:
http://www.annevankesteren.nl/css/testcase/generated_content.html
Summary: ::first-letter doesn't work when ::before/::after generated content present → ::first-letter doesn't work properly when ::before/::after generated content is present
> Should I put this into it's own bug?

Yes, please open a new bug on that.

I don't really see what the problem is in this bug though (apart from text-
decoration and selection not working).  I see a green "G" everywhere in the
lower part of both your examples.  Would you mind explaining "actual behaviour"
and "expected behaviour" for one of those examples?
Well actually is was an extended testcase for the CSS3 testcase:
http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/full/flat/css3-modsel-39.html
http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/full/flat/css3-modsel-39a.html
http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/full/flat/css3-modsel-39c.html
http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/full/flat/css3-modsel-39b.html

In those (39a and 39c) tests it seems that Mozilla doesn't support it. The
text-decoration wasn't really the expected behavior, but now it's a bug :).

The expected behaviour stands above the tables. I you're pointing at something
else please notice me, since this is my very first Mozilla bug report.

Thank you.
OK, thanks.  Looking at those tests though (39a and 39c), it seems they have
a bug in them.  There is a comma in between the rules that shouldn't be there.
I'm going to attach cleaned up versions of those two tests.
Severity: normal → minor
AFAICT, those tests are still bogus since the selectors have equal specificity
and then the last (red) should be the background-color to use, no?
Keywords: testcase
The W3C says this:

"When the ::first-letter and ::first-line pseudo-elements are combined with
::before and ::after, they apply to the first letter or line of the element
including the inserted text."

Source:
http://www.w3.org/TR/css3-selectors/#gen-content

So I think it should be totally green and not red.
I've spawned of bug 212149 for the text-decoration problem.
(tests have been fixed, expect the new tests uploaded soon)
This bug was fixed by the patch in bug 212149, see bug 212149 comment 4.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Verified fixed, 2003-07-11-22 trunk Linux
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: