WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
17152
Paragraphs indented with :first-letter and text-align CSS render incorrectly
https://bugs.webkit.org/show_bug.cgi?id=17152
Summary
Paragraphs indented with :first-letter and text-align CSS render incorrectly
Daniel G. Taylor
Reported
2008-02-02 11:12:08 PST
When using the :first-letter CSS to indent paragraphs and then text-align: justify WebKit will sometimes render parts of the text on top of each other. How to reproduce the problem ----------------------- Go to
http://programmer-art.org
Resize the window horizontally and watch as text shifts around.
Attachments
test case
(2.12 KB, text/html)
2008-02-03 13:18 PST
,
Robert Blaut
no flags
Details
Reduction showing the root cause
(190 bytes, text/html)
2008-02-25 17:40 PST
,
mitz
no flags
Details
Reduction showing the root cause
(203 bytes, text/html)
2008-02-25 17:57 PST
,
mitz
no flags
Details
Improve the logic for when to apply padding, border and margin before a text node
(10.76 KB, patch)
2008-02-25 21:53 PST
,
mitz
sam
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Daniel G. Taylor
Comment 1
2008-02-03 06:37:55 PST
I have uploaded a simpler example with the two CSS rules and a few paragraphs here:
http://programmer-art.org/dropbox/bug.html
Robert Blaut
Comment 2
2008-02-03 13:18:45 PST
Created
attachment 18888
[details]
test case uploaded test case
mitz
Comment 3
2008-02-25 17:34:33 PST
I have just made things worse by changing numSpaces from int to unsigned. The real problem though is that line breaking results in totWidth > availableWidth in computeHorizontalPositionsForLine().
mitz
Comment 4
2008-02-25 17:40:14 PST
Created
attachment 19365
[details]
Reduction showing the root cause This shows that the problem is line breaking.
mitz
Comment 5
2008-02-25 17:57:21 PST
Created
attachment 19368
[details]
Reduction showing the root cause This is not even about first-letter. It is just the assumption expressed in findNextLineBreak(): bool appliedStartWidth = pos > 0; // If the span originated on a previous line, // then assume the start width has been applied.
mitz
Comment 6
2008-02-25 21:53:18 PST
Created
attachment 19370
[details]
Improve the logic for when to apply padding, border and margin before a text node
mitz
Comment 7
2008-02-25 21:56:53 PST
(In reply to
comment #0
)
> When using the :first-letter CSS to indent paragraphs
Out of curiosity, why would you do that instead of using the text-indent property?
mitz
Comment 8
2008-02-25 22:53:47 PST
Fixed in <
http://trac.webkit.org/projects/webkit/changeset/30590
>.
Daniel G. Taylor
Comment 9
2008-02-26 07:03:26 PST
(In reply to
comment #7
)
> (In reply to
comment #0
) > > When using the :first-letter CSS to indent paragraphs > > Out of curiosity, why would you do that instead of using the text-indent > property? >
Good question. In all the years I've used CSS I never knew about that property! Using it on my site now as it seems to be the proper way to do things. Thanks for fixing the bug!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug