Bug 32495

Summary: REGRESSION (r47440): font-size:small with background-color causes text to get clipped
Product: WebKit Reporter: Ojan Vafai <ojan>
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, hyatt, jparent, linus, mitz
Priority: P1 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
none
Patch mitz: review+, hyatt: commit-queue-

Description Ojan Vafai 2009-12-13 14:03:13 PST
In FF3.5, IE7 and Safari 4, the text it not clipped in this test case. In nightlies the first line of text is clipped.

The offending HTML:
<span style="background-color: white; font-size: 20px;">
<span style="font-size: small; ">FOOBARBAZ<br>BAZBARFOO</span></span>
Comment 1 Ojan Vafai 2009-12-13 14:04:44 PST
Marking P1 as it's a regression.
Comment 2 mitz 2009-12-13 14:20:02 PST
<rdar://problem/7468078>
Comment 3 mitz 2009-12-13 19:38:03 PST
Caused by <http://trac.webkit.org/changeset/47440>.
Comment 4 mitz 2009-12-23 14:17:41 PST
(In reply to comment #3)
> Caused by <http://trac.webkit.org/changeset/47440>.

Specifically, this part:
“Significant changes have been made to the "almost strict mode" line box quirk where objects with no
text children have no effect on the height of a line. Instead of making the height() of the objects
variable and dependent on overflow, the objects now have their full height and get placed on
the baseline properly. They simply don't contribute to overflow above lineTop/Bottom.”

Since the box is full height, it paints the background through the entire height.
Comment 5 mitz 2009-12-23 14:37:54 PST
Hyatt, do you have any ideas how to fix this?
Comment 6 Dave Hyatt 2010-01-13 12:51:48 PST
Created attachment 46493 [details]
Patch
Comment 7 Dave Hyatt 2010-01-13 12:57:40 PST
Created attachment 46495 [details]
Patch
Comment 8 Ojan Vafai 2010-01-13 13:00:00 PST
The code in paintBoxDecorations and paintMask looks suspiciously similar. Is there a reason not to put it in a helper function? It would make the code more readable to and constrain the quirk to one place in the code.
Comment 9 mitz 2010-01-13 13:01:07 PST
Comment on attachment 46495 [details]
Patch

r=me (with updated test)
Comment 10 Dave Hyatt 2010-01-13 13:23:52 PST
Fixed in r53200.