Summary: | Draw image outline for broken images | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Peter Kasting <pkasting> | ||||||||
Component: | Images | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Enhancement | Keywords: | HasReduction | ||||||||
Priority: | P2 | ||||||||||
Version: | 523.x (Safari 3) | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
Attachments: |
|
Description
Peter Kasting
2007-09-13 17:39:14 PDT
Created attachment 16286 [details]
patch v1
Simple patch. Some archaeology in trac tells me that this code dates from almost the very beginning of WebCore, back when all the commits were huge "land all the changes in SNAZZY_WEBKIT_BRANCH_3" affairs.
Comment on attachment 16286 [details]
patch v1
You need to adjust the usableWidth/Height to exclude the drawn outline, since the error image will potentially draw on top of the outline otherwise.
We'll need to discuss this change I think, since it constitutes a UI change to Safari. It's definitely too late to make a change like this for Leopard, so it will have to wait for a bit.
alt text has the same bug (already). That should be fixed too. Honestly it seems OK if the error image draws over the outline (as long as the two aren't crazily alpha-blended), but I'll take a look at making that change for both the broken image icon and the alt text in the next iteration of the patch. Waiting for the trunk to go to some post-Leopard-branch state is fine with me, but I'm not totally clear on what the schedule for such things is. Maybe there's already a wiki page explaining such things? Created attachment 16295 [details]
patch v2
This subtracts off the outline pixels when calculating the usable dimensions.
It might be good to go even further and subtract 4 in each direction instead of 2, to leave a 1 px buffer inside the outline. Another possible change to this patch is that, when there's an error, we could avoid drawing the outline if the error image would fit without it but not with it (since if you have to pick one or the other, the error image is probably better than the outline). Input welcome.
Created attachment 16311 [details]
Test case (broken image)
I asked some of the more UI-oriented people on the Safari team what they think of this change. Comment on attachment 16295 [details]
patch v2
r=me for feature-branch (or after feature-branch is merged back).
|