Bug 32495 - REGRESSION (r47440): font-size:small with background-color causes text to get clipped
Summary: REGRESSION (r47440): font-size:small with background-color causes text to get...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P1 Normal
Assignee: Dave Hyatt
URL:
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2009-12-13 14:03 PST by Ojan Vafai
Modified: 2010-01-13 13:23 PST (History)
5 users (show)

See Also:


Attachments
Patch (37.83 KB, patch)
2010-01-13 12:51 PST, Dave Hyatt
no flags Details | Formatted Diff | Diff
Patch (37.83 KB, patch)
2010-01-13 12:57 PST, Dave Hyatt
mitz: review+
hyatt: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.