<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>15210</bug_id>
          
          <creation_ts>2007-09-13 17:39:14 -0700</creation_ts>
          <short_desc>Draw image outline for broken images</short_desc>
          <delta_ts>2007-10-14 05:09:21 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Images</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Peter Kasting">pkasting</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>513</commentid>
    <comment_count>0</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2007-09-13 17:39:14 -0700</bug_when>
    <thetext>In Firefox, a broken image is displayed as a hollow outline the size of the image (when known), with a broken image icon in the upper left.  In Safari, a broken image is displayed as an icon centered where the image would go, but with no border.  The lack of a border can make it harder to figure out what images on a page, exactly, are broken, and with very large images means it&apos;s easy to miss the icon entirely.  It would be nice to extend RenderImage.cpp to show a border in this case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>506</commentid>
    <comment_count>1</comment_count>
      <attachid>16286</attachid>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2007-09-13 18:11:40 -0700</bug_when>
    <thetext>Created attachment 16286
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 &quot;land all the changes in SNAZZY_WEBKIT_BRANCH_3&quot; affairs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>505</commentid>
    <comment_count>2</comment_count>
      <attachid>16286</attachid>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2007-09-13 20:24:47 -0700</bug_when>
    <thetext>Comment on attachment 16286
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&apos;ll need to discuss this change I think, since it constitutes a UI change to Safari.  It&apos;s definitely too late to make a change like this for Leopard, so it will have to wait for a bit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>502</commentid>
    <comment_count>3</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2007-09-13 20:26:19 -0700</bug_when>
    <thetext>alt text has the same bug (already).  That should be fixed too.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>500</commentid>
    <comment_count>4</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2007-09-13 22:44:58 -0700</bug_when>
    <thetext>Honestly it seems OK if the error image draws over the outline (as long as the two aren&apos;t crazily alpha-blended), but I&apos;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&apos;m not totally clear on what the schedule for such things is.  Maybe there&apos;s already a wiki page explaining such things?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>468</commentid>
    <comment_count>5</comment_count>
      <attachid>16295</attachid>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2007-09-14 13:44:04 -0700</bug_when>
    <thetext>Created attachment 16295
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&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>378</commentid>
    <comment_count>6</comment_count>
      <attachid>16311</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-09-18 07:50:29 -0700</bug_when>
    <thetext>Created attachment 16311
Test case (broken image)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57399</commentid>
    <comment_count>7</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2007-09-29 19:34:13 -0700</bug_when>
    <thetext>I asked some of the more UI-oriented people on the Safari team what they think of this change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57412</commentid>
    <comment_count>8</comment_count>
      <attachid>16295</attachid>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2007-09-29 23:25:58 -0700</bug_when>
    <thetext>Comment on attachment 16295
patch v2

r=me for feature-branch (or after feature-branch is merged back).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58496</commentid>
    <comment_count>9</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-10-14 05:09:21 -0700</bug_when>
    <thetext>Landed in r26591.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>16286</attachid>
            <date>2007-09-13 18:11:40 -0700</date>
            <delta_ts>2007-09-14 13:44:04 -0700</delta_ts>
            <desc>patch v1</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <size>1658</size>
            <attacher name="Peter Kasting">pkasting</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAyNTU1NSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGN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tlKTsKLSAgICAgICAgICAgICAgICBjb250ZXh0LT5zZXRT
dHJva2VDb2xvcihDb2xvcjo6bGlnaHRHcmF5KTsKLSAgICAgICAgICAgICAgICBjb250ZXh0LT5z
ZXRGaWxsQ29sb3IoQ29sb3I6OnRyYW5zcGFyZW50KTsKLSAgICAgICAgICAgICAgICBjb250ZXh0
LT5kcmF3UmVjdChJbnRSZWN0KHR4ICsgbGVmdEJvcmRlciArIGxlZnRQYWQsIHR5ICsgdG9wQm9y
ZGVyICsgdG9wUGFkLCBjV2lkdGgsIGNIZWlnaHQpKTsKLSAgICAgICAgICAgIH0KKyAgICAgICAg
ICAgIC8vIERyYXcgYW4gb3V0bGluZSByZWN0IHdoZXJlIHRoZSBpbWFnZSBzaG91bGQgYmUuCisg
ICAgICAgICAgICBjb250ZXh0LT5zZXRTdHJva2VTdHlsZShTb2xpZFN0cm9rZSk7CisgICAgICAg
ICAgICBjb250ZXh0LT5zZXRTdHJva2VDb2xvcihDb2xvcjo6bGlnaHRHcmF5KTsKKyAgICAgICAg
ICAgIGNvbnRleHQtPnNldEZpbGxDb2xvcihDb2xvcjo6dHJhbnNwYXJlbnQpOworICAgICAgICAg
ICAgY29udGV4dC0+ZHJhd1JlY3QoSW50UmVjdCh0eCArIGxlZnRCb3JkZXIgKyBsZWZ0UGFkLCB0
eSArIHRvcEJvcmRlciArIHRvcFBhZCwgY1dpZHRoLCBjSGVpZ2h0KSk7CiAKICAgICAgICAgICAg
IGJvb2wgZXJyb3JQaWN0dXJlRHJhd24gPSBmYWxzZTsKICAgICAgICAgICAgIGludCBpbWFnZVgg
PSAwOwo=
</data>
<flag name="review"
          id="6850"
          type_id="1"
          status="-"
          setter="hyatt"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>16295</attachid>
            <date>2007-09-14 13:44:04 -0700</date>
            <delta_ts>2007-09-29 23:25:58 -0700</delta_ts>
            <desc>patch v2</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <size>2228</size>
            <attacher name="Peter Kasting">pkasting</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAyNTU1NSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTMgQEAKKzIwMDctMDktMTMgIFBldGVyIEthc3RpbmcgIDx6ZXJvZHB4QGdtYWls
LmNvbT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBo
dHRwOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xNTIxMAorICAgICAgICBEcmF3
IHRoZSBpbWFnZSBvdXRsaW5lIGV2ZW4gZm9yIGJyb2tlbiBpbWFnZXMuCisKKyAgICAgICAgKiBy
ZW5kZXJpbmcvUmVuZGVySW1hZ2UuY3BwOgorICAgICAgICAoV2ViQ29yZTo6UmVuZGVySW1hZ2U6
OnBhaW50KToKKwogMjAwNy0wOS0xMyAgQnJhZHkgRWlkc29uICA8YmVpZHNvbkBhcHBsZS5jb20+
CiAKICAgICAgICAgUnViYmVyc3RhbXBlZCBieSBHZW9mZiBhbmQgTWFjaWVqCkluZGV4OiBXZWJD
b3JlL3JlbmRlcmluZy9SZW5kZXJJbWFnZS5jcHAKPT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gV2ViQ29yZS9yZW5k
ZXJpbmcvUmVuZGVySW1hZ2UuY3BwCShyZXZpc2lvbiAyNTU1MykKKysrIFdlYkNvcmUvcmVuZGVy
aW5nL1JlbmRlckltYWdlLmNwcAkod29ya2luZyBjb3B5KQpAQCAtMjIzLDE4IC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N0dXJlRHJhd24gPSBmYWxzZTsKICAgICAgICAgICAgIGludCBpbWFnZVgg
PSAwOwogICAgICAgICAgICAgaW50IGltYWdlWSA9IDA7Ci0gICAgICAgICAgICBpbnQgdXNhYmxl
V2lkdGggPSBjV2lkdGg7Ci0gICAgICAgICAgICBpbnQgdXNhYmxlSGVpZ2h0ID0gY0hlaWdodDsK
KyAgICAgICAgICAgIC8vIFdoZW4gY2FsY3VsYXRpbmcgdGhlIHVzYWJsZSBkaW1lbnNpb25zLCBl
eGNsdWRlIHRoZSBwaXhlbHMgb2YKKyAgICAgICAgICAgIC8vIHRoZSBvdWxpbmUgcmVjdCBzbyB0
aGUgZXJyb3IgaW1hZ2UvYWx0IHRleHQgZG9lc24ndCBkcmF3IG9uIGl0LgorICAgICAgICAgICAg
aW50IHVzYWJsZVdpZHRoID0gY1dpZHRoIC0gMjsKKyAgICAgICAgICAgIGludCB1c2FibGVIZWln
aHQgPSBjSGVpZ2h0IC0gMjsKIAogICAgICAgICAgICAgaWYgKGVycm9yT2NjdXJyZWQoKSAmJiAh
aW1hZ2UoKS0+aXNOdWxsKCkgJiYgKHVzYWJsZVdpZHRoID49IGltYWdlKCktPndpZHRoKCkpICYm
ICh1c2FibGVIZWlnaHQgPj0gaW1hZ2UoKS0+aGVpZ2h0KCkpKSB7CiAgICAgICAgICAgICAgICAg
Ly8gQ2VudGVyIHRoZSBlcnJvciBpbWFnZSwgYWNjb3VudGluZyBmb3IgYm9yZGVyIGFuZCBwYWRk
aW5nLgo=
</data>
<flag name="review"
          id="6857"
          type_id="1"
          status="+"
          setter="mjs"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>16311</attachid>
            <date>2007-09-18 07:50:29 -0700</date>
            <delta_ts>2007-09-18 07:50:29 -0700</delta_ts>
            <desc>Test case (broken image)</desc>
            <filename>bug-15210-test.html</filename>
            <type>text/html</type>
            <size>45</size>
            <attacher name="David Kilzer (:ddkilzer)">ddkilzer</attacher>
            
              <data encoding="base64">PGltZyBzcmM9ImZvby5naWYiIHdpZHRoPSI1MDAiIGhlaWdodD0iNTAwIj4K
</data>

          </attachment>
      

    </bug>

</bugzilla>