Closed Bug 537837 Opened 15 years ago Closed 15 years ago

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

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 214004

People

(Reporter: zwol, Unassigned)

Details

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
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.