::first-letter styles should be applied within descendant elements

RESOLVED DUPLICATE of bug 214004

Status

()

Core
CSS Parsing and Computation
RESOLVED DUPLICATE of bug 214004
8 years ago
8 years ago

People

(Reporter: zwol, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
Firefox (tried 3.5, 3.6beta, and trunk as of two weeks ago) makes the first 'x' red in

<!doctype html><style>div ::first-letter{color:red}</style><div><p>xx</p></div>

but not in

<!doctype html><style>div::first-letter{color:red}</style><div><p>xx</p></div>

Opera 10 does the same. Webkit and IE make the first 'x' red in both cases.

My reading of CSS2.1 §5.1.2 is that the Webkit behavior is correct:

# The :first-letter pseudo-element can be used with all such elements that contain
# text, or that have a descendant in the same flow that contains text. A UA should 
# act as if the fictional start tag of the first-letter pseudo-element is just before 
# the first text of the element, even if that first text is in a descendant.

Similar text appears in css3-selectors §7.2.1.
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 214004
You need to log in before you can comment on or make changes to this bug.