Open Bug 298579 Opened 20 years ago Updated 2 years ago

inline boxes with negative width (e.g. from negative letter-spacing/word-spacing) are treated as width zero

Categories

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

x86
Linux
defect

Tracking

()

People

(Reporter: ian, Unassigned)

References

()

Details

(Keywords: helpwanted, testcase)

Attachments

(3 files)

STEPS TO REPRODUCE
1. Make letter-spacing be very negative.

ACTUAL RESULTS
   Text disappears.

EXPECTED RESULT
   Text renders, but backwards.

TESTCASE
   http://bugzilla.opendarwin.org/attachment.cgi?id=2580

This bug derived from webkit bug number 3676.
   http://bugzilla.opendarwin.org/show_bug.cgi?id=3676
Attached file Testcase
Bug also occurs with negative 'word-spacing'
Keywords: testcase
Summary: large negative letter-spacing makes text disappear → large negative letter-spacing/word-spacing makes text disappear
Attached image Screenshot #1
I'm a bit curious what the correct rendering would be - does this screenshot
look correct to you?
Yeah, that seems roughly correct.
dbaron: Do you agree this bug is valid?
Fixing this would break MIR image replacement.

http://www.stuffandnonsense.co.uk/archives/mir_image_replacement.html
Sorry, just read the webkit bug linked in the original report - ignore me.
Ian, can we add some tests for this to the CSS2.1 test suite just to make sure this edge case is done interoperably?
Keywords: helpwanted
This testcase triggers an assertion (see bug 334107) :

###!!! ASSERTION: bad width: 'metrics.width>=0', file
/Users/admin/trunk/mozilla/layout/generic/nsLineLayout.cpp, line 1069
Blocks: 334107
We should really fix this, imo.  Esp. if us not fixing it is cause for Safari to start breaking the spec...
Flags: blocking1.9a2?
We should fix it, but it might be very hard because we don't really support negative-width frames. Maybe we can do it by getting the right overflow area and then finding a way to get a negative X-advance reported to nsLineLayout.
Yeah, that's what I was more or less thinking...
Flags: blocking1.9a2? → blocking1.9-
Whiteboard: [wanted-1.9]
The current layout is very close to that of Safari 3.0.4, so the
layout is much improved compared to Firefox 2.
We still set the box height to zero in some cases though.
I don't see the assertion in comment 8 on either testcase.
Severity: normal → minor
Flags: wanted1.9+
Whiteboard: [wanted-1.9]
Flags: wanted1.9-
Flags: wanted1.9+
Flags: wanted-next+
Attached file test case #2 (simpler)
I have a simpler test case for this bug.  There are two lines, which should be rendered nearly identically (the inter-glyph spacing may not be exactly the same).  Instead, the top line is rendered with groups of three numbers painted on top of each other.

This highlights what's actually going wrong here: when an inline box (== layout frame, probably) has negative width, the next box is placed as if the negative-width box had had width zero.  I think this is what roc is getting at in comment 10 when he says "we don't really support negative-width frames."
Summary: large negative letter-spacing/word-spacing makes text disappear → inline boxes with negative width (e.g. from negative letter-spacing/word-spacing) are treated as width zero
I am interested to work on this bug and I would I like to know more details about this bug. I would also like to know where I should get started.
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: