Bug 7301 - Text shadow does not repaint correctly
Summary: Text shadow does not repaint correctly
Status: VERIFIED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-16 07:29 PST by mitz
Modified: 2006-04-04 01:48 PDT (History)
0 users

See Also:


Attachments
Testcase (172 bytes, text/html)
2006-02-16 07:30 PST, mitz
no flags Details
Patch w/o test and change log (3.07 KB, patch)
2006-03-20 12:43 PST, mitz
no flags Details | Formatted Diff | Diff
Patch w/o test and change log (3.11 KB, patch)
2006-03-21 09:57 PST, mitz
no flags Details | Formatted Diff | Diff
Incomplete patch (3.78 KB, patch)
2006-03-22 08:22 PST, mitz
no flags Details | Formatted Diff | Diff
Separate vertical overflow from vertical selection bounds and handle horizontal shadow overflow (14.20 KB, patch)
2006-03-25 11:38 PST, mitz
no flags Details | Formatted Diff | Diff
Patch including tests and change log (28.89 KB, patch)
2006-03-27 08:50 PST, mitz
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2006-02-16 07:29:22 PST
Text shadow is not accounted for in repaint. In the attached testcase, press Test to move the gray div and note how the part of the (blue) shadow that overflows the div is not erased from the old position nor painted in the new position.
Comment 1 mitz 2006-02-16 07:30:54 PST
Created attachment 6541 [details]
Testcase
Comment 2 mitz 2006-03-20 12:43:28 PST
Created attachment 7193 [details]
Patch w/o test and change log

This patch fixes the repaint issues by treating the shadows as overflow. This has the side effect that the selection highlight also grows to cover the shadow, but on the other hand, it eats into the next line's highlighting.
Comment 3 mitz 2006-03-20 22:51:12 PST
The patch breaks the appearance of the "segmented control" in the Web Inspector: the selected segment's label is scrolled up.
Comment 4 mitz 2006-03-21 09:57:24 PST
Created attachment 7215 [details]
Patch w/o test and change log
Comment 5 mitz 2006-03-22 08:22:34 PST
Created attachment 7231 [details]
Incomplete patch

This patch takes care of vertical overflow (with the side-effect on selection highlighting) and of horizontal overflow for InlineFlowBox (and blocks), but not for InlineTextBox itself. This means that if only the shadow is in the damage rect, it still won't be painted (e.g. if you highlight only "bar" in "<span style="text-shadow: green 10px 5px;">foo</span>bar").

A possible solution that won't involve adding data to InlineTextBox is to cache the max horizontal overflow per InlineFlowBox.
Comment 6 mitz 2006-03-25 11:38:17 PST
Created attachment 7295 [details]
Separate vertical overflow from vertical selection bounds and handle horizontal shadow overflow

This version addresses horizontal overflow and also separates vertical painting overflow from vertical selection bounds, so the selection highlight is not affected by shadows. As a bonus, it makes inline blocks with overflow repaint correctly.

I removed parts of the previous patch that are now part of bug 7916, so this patch alone doesn't even fix this bug's test case. I also didn't make a test because I want to make an automated one once DumpRenderTree supports repaint tests.
Comment 7 mitz 2006-03-25 11:40:50 PST
Forgot to add that I think this mechanism could be used to fix bug 6274 once you figure out how to tell how far a given font can really paint.
Comment 8 mitz 2006-03-27 08:50:24 PST
Created attachment 7334 [details]
Patch including tests and change log
Comment 9 Darin Adler 2006-03-30 08:42:41 PST
Comment on attachment 7334 [details]
Patch including tests and change log

It's sad that we have to add all these fields, but I think it's justified.

r=me
Comment 10 mitz 2006-04-04 01:48:45 PDT
Verified in r13675 nightly.