Open Bug 214004 Opened 21 years ago Updated 2 years ago

::first-letter isn't applied if first letter is inside a child block

Categories

(Core :: Layout: Block and Inline, defect)

defect

Tracking

()

People

(Reporter: annevk, Unassigned)

References

(Blocks 2 open bugs, )

Details

(Keywords: testcase)

Attachments

(1 file)

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

This bug is spawned off from http://bugzilla.mozilla.org/show_bug.cgi?id=212145.
The generated content is now applied, but ::first-letter isn't applied.

Reproducible: Always

Steps to Reproduce:
1. Visit http://www.annevankesteren.nl/css/testcase/generated_content.html
2. The bold generated content should have a capitalized first letter.

Actual Results:  
The first letter of the bold generated content wasn't capitalized.

Expected Results:  
Capitalize the first letter

Related to http://bugzilla.mozilla.org/show_bug.cgi?id=212145
Attached file Testcase
This seems like an issue with nested blocks, not with generated content...
OS: Windows XP → All
Hardware: PC → All
Summary: CSS ::first-letter isn't applied on generated content → CSS ::first-letter isn't applied if first letter is inside a child block
Not sure if this can help, but Opera 6.06 applies this correct.
Anne, the question here is what "correct" is.  The CSS spec is not clear on
whether the ::first-letter applies through block children.
It does. The next draft of CSS2.1 will contain explicit text for this. It'll be
out Real Soon Now.
Besided that, it is a "pseudo element" and a "element" may be styled either
inline or block if I am correct.
OK.  Taking bug, in that case.  This should not be that hard to fix, I _think_
(though there may be some issues with nested blocks each of which has a
first-letter set on it).

Anne, I'm not sure what you're getting at in comment 5.
Assignee: dbaron → bz-vacation
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Target Milestone: --- → mozilla1.6beta
Sorry for being unclear in comment 5. What I meant to say is that ::before is a
pseudo-element. A pseudo-element/element may be styled using the display
property. This way you can alter a pseudo-element from inline to block-level and
from block-level to inline.

Second thing is that the pseudo-element first-letter applies on the first letter
of generated content (e.g. ::before). If you combine this with the information
in the previous paragraph you understand why ::first-letter should apply on:

<div>
 <div>aaa</div>
</div>

I hope this is a better explanation.
I'm not sure if bug 219770 is the same bug. I don't know _anything_ on the way
Mozilla works. Could someone take a look at it?
CSS2.1 is totally redefining how first-letter and first-line work, so we're
probably going to have to totally rewrite all the relevant code....
Priority: P3 → P5
Target Milestone: mozilla1.6beta → Future
not so much "redefining" as "defining", but yeah.

Original testcase is now 404:
   http://www.annevankesteren.nl/css/testcase/generated_content.html

Attached testcase (attachment 128595 [details]), while not guidelines-compliant, is valid, 
in that the first "a" should match the grandparent node's :first-letter pseudo.
Summary: CSS ::first-letter isn't applied if first letter is inside a child block → ::first-letter isn't applied if first letter is inside a child block
Not going to get to this any reasonable time.
Assignee: bzbarsky → nobody
Component: Style System (CSS) → Layout: Block and Inline
Priority: P5 → --
QA Contact: ian → core.layout.block-and-inline
Target Milestone: Future → ---
http://www.w3.org/TR/REC-CSS2/selector.html seems to be pretty clear about it..
(despite a grammar issue ;)) 

"Note that the :first-letter pseudo-element tags abut the content (i.e., the
initial character), while the :first-line pseudo-element start tag is inserted
right after the start tag of the element to which it is attached."

the fictional html sequence they use for this:

<P>
<SPAN>
<P:first-letter>
T
</P:first-letter>he first
</SPAN> 
few words of an article in the Economist.
</P>
Please read and quote from CSS 2.1; the specification Mozilla is going to follow.
Submitted related test to CSS 2.1 test suite:

CSS Test: First-letter - in-flow block descendant that contains text
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/first-letter-selector-028.htm

Gérard
Keywords: testcase
See Also: → 1490281

CSS Test: First-letter - in-flow block descendant that contains text
http://wpt.live/css/CSS2/selectors/first-letter-selector-028.xht

Severity: normal → S3

The severity field for this bug is relatively low, S3. However, the bug has 3 duplicates.
:jfkthame, could you consider increasing the bug severity?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jfkthame)

The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.

Flags: needinfo?(jfkthame)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: