Closed Bug 400826 Opened 17 years ago Closed 17 years ago

text-transform ::first-letter and ::first-line affects whole element instead of only the first letter/line

Categories

(Core :: Layout: Text and Fonts, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9beta2

People

(Reporter: me, Assigned: roc)

References

Details

(Keywords: testcase, Whiteboard: [dbaron-1.9:RwCt])

Attachments

(4 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a9pre) Gecko/2007102205 Minefield/3.0a9pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a9pre) Gecko/2007102205 Minefield/3.0a9pre

text-transform uppercase/lowercase in a ::first-letter/::first-line rule is applied to the whole element instead of only the first letter/line. Other formatting rules are correctly only applied to the first elements. The problem disappears if any font-* rules are used (see second paragraph in the testcase).

Reproducible: Always

Steps to Reproduce:
1. Open the testcase with a current nightly build
2. Open the testcase in Firefox 2
3. Compare the rendering (Firefox 2 renders it correctly)
Actual Results:  
The first line of the first paragraph is red and capitalized, the rest of the paragraph is black but also in uppercase.

Expected Results:  
The first line of the first paragraph is red and capitalized, the rest of the paragraph is in lowercase and black.

I have reproduced this bug in current nightly builds on both mac and windows.
Attached file Simple testcase
Duplicate of bug 287088?
Confiming for now and reassigning.
Status: UNCONFIRMED → NEW
Component: Layout: Fonts and Text → Style System (CSS)
Ever confirmed: true
Keywords: testcase
QA Contact: layout.fonts-and-text → style-system
Whiteboard: DUPEME
Version: unspecified → Trunk
Reassigning back.
Component: Style System (CSS) → Layout: Fonts and Text
QA Contact: style-system → layout.fonts-and-text
I've spent about half an hour searching for this bug before filing it to make absolutely sure it was not a duplicate… Oh well, sorry.
Is this a regression?
Well, Fx 2.0.0.8 renders this correctly. That makes it a regression.

This bug is a bit similar to bug 392435 (now fixed) which was a regression from bug 385270. When testing the patch in bug 392435, iirc I tested also with text-transform. Maybe it regressed again. I'll check.
Looks like the testcase in bug 392435 that I checked in doesn't test text-transform. Even if it did, the fact that changing the font properties makes the text-transform work as well probably would have masked this bug.
Assignee: nobody → roc
Flags: blocking1.9?
Interesting test case using font-variant: small-caps;
lifted from the CSS 2.1 test suite.

Resize the window to see the changes in the first line (contains <strong> elements)
Backing out bug 393796 fixes this.
Blocks: 393796
Attached patch fixSplinter Review
We shouldn't build the styles array for transformed textruns assuming every frame in a flow has the same style; instead we should build it frame by frame.
Attachment #286242 - Flags: review?(smontagu)
Whiteboard: [needs review]
Attachment #286242 - Flags: review?(smontagu) → review+
Flags: blocking1.9? → blocking1.9+
Whiteboard: [needs review] → [needs landing]
Whiteboard: [needs landing] → [needs landing][dbaron-1.9:RwCt]
Checking in layout/generic/nsTextFrameThebes.cpp;
/cvsroot/mozilla/layout/generic/nsTextFrameThebes.cpp,v  <--  nsTextFrameThebes.cpp
new revision: 3.118; previous revision: 3.117
done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing][dbaron-1.9:RwCt] → [dbaron-1.9:RwCt]
Target Milestone: --- → mozilla1.9 M10
Flags: in-testsuite?
Attached patch reftestSplinter Review
I'll commit this when I get a chance
checked in reftest
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: