Closed Bug 333961 Opened 18 years ago Closed 17 years ago

CSS pseudo class :first-letter problem with floating property if arabic words inside the html code

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: maxime.goepp, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Win98; fr; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Win98; fr; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

If there are, anywere in the page, caracters form a right-to-left language, the first letter - if floating - is "doubled" (even if the text that is affected by the :first-letter class isn't in arabic.

Reproducible: Always

Steps to Reproduce:
1.build a html page : 
<p>test</p>
2.insert arabic, or hebraic words, any were
<p>Foo</p>
<div>&#1593;</div>
3.
create a :first-letter css (that didn't affect the arabic text) with a floating position.
<style type="text/css">
<!-- 
p:first-letter {float: left;}
-->
</style>
Actual Results:  
the first letter appears two times. Once correctly, and, juste after, another time, without the :first-letter style.
I can see the bug with a 2006-01-18 trunk build, but not anymore with a 2006-04-10 build.
Component: General → Layout
Product: Firefox → Core
QA Contact: general → layout
Version: unspecified → 1.8 Branch
ere is a complete code that allows to see the bug

<html>
<head>

<style type="text/css">
<!-- 
p:first-letter {float: left;}
-->
</style>

</head>
<body>

<p>Foo</p>
<div>&#1593;</div>

</body>
</html>
Keywords: testcase
Confirming. I can reproduce this on Mac with a trunk build:

Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060410 Firefox/3.0a1

This is NOT fixed by the patch for bug 198928.
Status: UNCONFIRMED → NEW
Component: Layout → Layout: BiDi Hebrew & Arabic
Ever confirmed: true
Hardware: PC → All
Version: 1.8 Branch → Trunk
the bug is a bit different under linux (UBUNTU) with Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)

ce first letter appears two times, but two times without any style.
Bug is the same with every language that "works" from right to left (i've just listed hebrew and arabic, there must be other ones) :)
Note to self (or anybody else interested):
This has to do with the fact that in the special case of a floated first-letter, the continuation frame for it is created "in advance", i.e., before bidi resolution (which then doesn't handle well the situation it's presented with).

See http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/base/nsCSSFrameConstructor.cpp&rev=1.1218&mark=12258-12260#12223
As roc pointed out in bug 331883, properties such as float shouldn't apply to :first-letter at all.  See the "certain restrictions" section of http://www.w3.org/TR/REC-CSS2/selector.html#first-line-pseudo .
Sorry, ignore me.  I was looking at the first-line section, not the first-letter section.  http://www.w3.org/TR/REC-CSS2/selector.html#first-letter does allow float on :first-letter.
This was somehow fixed by the new TextFrame, although various problems with bidi and floated first-letters still exist.
Status: NEW → RESOLVED
Closed: 17 years ago
Depends on: 367177
Resolution: --- → FIXED
Flags: in-testsuite?
Component: Layout: BiDi Hebrew & Arabic → Layout: Text
QA Contact: layout → layout.fonts-and-text
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: