Bug 3793 - Width of monospace text blocks can be incorrectly calculated
Summary: Width of monospace text blocks can be incorrectly calculated
Status: RESOLVED DUPLICATE of bug 3692
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Minor
Assignee: Dave Hyatt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-01 11:07 PDT by Oliver Hunt
Modified: 2005-08-17 02:58 PDT (History)
0 users

See Also:


Attachments
Testcase (276 bytes, text/html)
2005-07-01 11:09 PDT, Oliver Hunt
no flags Details
Patch to correct output (1.29 KB, patch)
2005-07-01 11:44 PDT, Oliver Hunt
no flags Details | Formatted Diff | Diff
über-test-case (2.08 KB, text/html)
2005-07-01 12:23 PDT, Joost de Valk (AlthA)
no flags Details
screenshot of firefox behavior (138.07 KB, image/tiff)
2005-07-01 12:40 PDT, Joost de Valk (AlthA)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2005-07-01 11:07:47 PDT
Width of a text block with monospace font is miscalculated if a word-spacing is specified.  This leads to 
rendering bugs if more than one block appears on a line.
Comment 1 Oliver Hunt 2005-07-01 11:09:39 PDT
Created attachment 2731 [details]
Testcase

Simple, minimal testcase
Comment 2 Oliver Hunt 2005-07-01 11:44:35 PDT
Created attachment 2732 [details]
Patch to correct output

Okay this should work
Comment 3 Dave Hyatt 2005-07-01 11:49:34 PDT
Are you adding in the word-spacing with every space encountered?  What if someone types "A[space]
[space][space]B"?
Comment 4 Dave Hyatt 2005-07-01 11:49:53 PDT
Test in Firefox.
Comment 5 Oliver Hunt 2005-07-01 12:12:17 PDT
(In reply to comment #3)
> Are you adding in the word-spacing with every space encountered?  What if someone types "A[space]
> [space][space]B"?
> 

It should be fine, by the time we calculate hte width of text blocks all the extraneous white space ha been 
removed.
Comment 6 Joost de Valk (AlthA) 2005-07-01 12:23:02 PDT
Created attachment 2733 [details]
über-test-case
Comment 7 Joost de Valk (AlthA) 2005-07-01 12:40:34 PDT
Created attachment 2735 [details]
screenshot of firefox behavior
Comment 8 Oliver Hunt 2005-07-01 13:33:06 PDT
Okay the current patch borks when a comment is placed in whitespace, in a monospace text block.

Looking at the rendertree a the leading space following the comment is not being removed -- it is if the 
font is not monospaced.  The fact that this is only in monospace makes me hope it will be reasonably easy 
to find... ho hum... this irks me..
Comment 9 Oliver Hunt 2005-07-02 01:08:49 PDT
I think this bug is fixed with the patch... am going to open another bug covering the comment issue.
Comment 10 Oliver Hunt 2005-07-02 06:14:59 PDT
spurious spacing around comment tags is due to the use of pre tags rather than font-family: monospace;

I'm going to do a few checks but i think the current patch is in fact correct.
Comment 11 Oliver Hunt 2005-08-17 02:58:10 PDT

*** This bug has been marked as a duplicate of 3692 ***