<?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>146383</bug_id>
          
          <creation_ts>2015-06-27 06:22:32 -0700</creation_ts>
          <short_desc>If src is empty in img tag it shows a gray border around the image</short_desc>
          <delta_ts>2016-11-17 00:50:14 -0800</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>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="paladox">thomasmulhall410</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>jonlee</cc>
    
    <cc>pdr</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>thomasmulhall410</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1105170</commentid>
    <comment_count>0</comment_count>
    <who name="paladox">thomasmulhall410</who>
    <bug_when>2015-06-27 06:22:32 -0700</bug_when>
    <thetext>Hi if you have src empty for example &lt;img class=&quot;class&quot; &lt;!-- no src=&quot;&quot; --&gt; /&gt; it shows a gray border around the image. Internet Explorer doesent show a gray border arrounf the img if the src is empty.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1251930</commentid>
    <comment_count>1</comment_count>
    <who name="paladox">thomasmulhall410</who>
    <bug_when>2016-11-16 11:19:51 -0800</bug_when>
    <thetext>Hi is there any update on this please?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252055</commentid>
    <comment_count>2</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2016-11-16 15:29:15 -0800</bug_when>
    <thetext>I tried to look for the specs of drawing the broken images but I could not find this part. WebKit, Chrome and FireFox intentionally draw this gray rect for the broken image. WebKit does that in RenderImage::paintReplaced() below the the statement:

 if (!imageResource().hasImage() || imageResource().errorOccurred()) 

This request is little bit strange. What exactly you are trying to achieve? If drawing the gray rect is bothering you, you can set the width and/or the height of the image to zero. When the src attribute is set to the image, the width and the height can be changed to the desired size. If you want to keep the empty space of the broken image but not to draw the gray rectangle, you can put the &lt;img&gt; inside a box with the desired size but set the width and the height of the image itself to zero.

I attached a test case showing two broken images, one image has size = (100, 100) which shows the gray rectangle. The other image has size = (0, 0) but it is inside a box with size = (100, 100).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252056</commentid>
    <comment_count>3</comment_count>
      <attachid>294982</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2016-11-16 15:29:35 -0800</bug_when>
    <thetext>Created attachment 294982
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252057</commentid>
    <comment_count>4</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2016-11-16 15:30:15 -0800</bug_when>
    <thetext>Reopen if you think you have a valid test case for this request.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252060</commentid>
    <comment_count>5</comment_count>
      <attachid>294983</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2016-11-16 15:34:06 -0800</bug_when>
    <thetext>Created attachment 294983
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252066</commentid>
    <comment_count>6</comment_count>
      <attachid>294987</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2016-11-16 15:39:31 -0800</bug_when>
    <thetext>Created attachment 294987
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252077</commentid>
    <comment_count>7</comment_count>
    <who name="paladox">thomasmulhall410</who>
    <bug_when>2016-11-16 15:59:53 -0800</bug_when>
    <thetext>Hi I am trying to get img to work without having to set src. I am trying to use css background-image property to set the image but when I doint set the src, it creates a grey border. But on Internet Explorer this works (uses different web engine).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252078</commentid>
    <comment_count>8</comment_count>
    <who name="Jon Lee">jonlee</who>
    <bug_when>2016-11-16 16:00:50 -0800</bug_when>
    <thetext>So what are you doing on other browsers that also show a gray border?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252082</commentid>
    <comment_count>9</comment_count>
    <who name="paladox">thomasmulhall410</who>
    <bug_when>2016-11-16 16:08:36 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; So what are you doing on other browsers that also show a gray border?

I&apos;m trying to not set src because I have created a patch for gerrit but I not really know how to program in java so I just had to re use a public function that allowed me to get the image I wanted. But the image was inside a background-image: css property. But if I only add a class to img and doint set a valid image in src, it will show a grey border. I would really like it if the grey border could be removed please?

See here https://gerrit-review.googlesource.com/#/c/91471/10/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/Labels.java

scroll to line

203

and

211

I had to set that src with a blank image otherwise a grey border will show.

But it is unlikely they will merge the patch since that is just a work around.

Line 202 is where I set the class for the image

same for line 210</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252153</commentid>
    <comment_count>10</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2016-11-16 18:03:40 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; Hi I am trying to get img to work without having to set src. I am trying to
&gt; use css background-image property to set the image but when I doint set the
&gt; src, it creates a grey border. But on Internet Explorer this works (uses
&gt; different web engine).

You should not use the &lt;img&gt; element in this case. You can apply the css background-image property to any other element like &lt;span&gt; or &lt;div&gt; for example. The background image is rendered by the same routine for all elements.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252248</commentid>
    <comment_count>11</comment_count>
    <who name="paladox">thomasmulhall410</who>
    <bug_when>2016-11-17 00:50:14 -0800</bug_when>
    <thetext>Oh I tryed using that but it just moves the other elements out of place.

But Internet Explorer dosent get a grey border if you do this.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>294982</attachid>
            <date>2016-11-16 15:29:35 -0800</date>
            <delta_ts>2016-11-16 15:34:06 -0800</delta_ts>
            <desc>test case</desc>
            <filename>test216.html</filename>
            <type>text/html</type>
            <size>393</size>
            <attacher name="Said Abou-Hallawa">sabouhallawa</attacher>
            
              <data encoding="base64">PHN0eWxlPgogICAgLmJveCB7CiAgICAgICAgd2lkdGg6IDEwMHB4OwogICAgICAgIGhlaWdodDog
MTAwcHg7CiAgICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrOwogICAgfQo8L3N0eWxlPgo8Ym9k
eT4KICAgIDxzcGFuPlRoaXMgaXMgYSBicm9rZW4gaW1hZ2Ugd2l0aCBzaXplID0gKDEwMCwgMTAw
KTo8L3NwYW4+CiAgICA8aW1nIHNyYz0iIiBjbGFzcz0iYm94Ij4KICAgIDxzcGFuPi4uLi48L3Nw
YW4+CiAgICA8YnI+CiAgICA8c3Bhbj5UaGlzIGlzIGEgYnJva2VuIGltYWdlIHdpdGggc2l6ZSA9
ICgwLDApIGluc2lkZSBhIGJveCBvZiBzaXplID0gKDEwMCwgMTAwKTo8L3NwYW4+CiAgICA8c3Bh
biBjbGFzcz0iYm94Ij48L3NwYW4+CiAgICA8c3Bhbj4uLi4uPC9zcGFuPgo8L2JvZHk+
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>294983</attachid>
            <date>2016-11-16 15:34:06 -0800</date>
            <delta_ts>2016-11-16 15:39:31 -0800</delta_ts>
            <desc>test case</desc>
            <filename>test216.html</filename>
            <type>text/html</type>
            <size>416</size>
            <attacher name="Said Abou-Hallawa">sabouhallawa</attacher>
            
              <data encoding="base64">PHN0eWxlPgogICAgLmJveCB7CiAgICAgICAgd2lkdGg6IDEwMHB4OwogICAgICAgIGhlaWdodDog
MTAwcHg7CiAgICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrOwogICAgfQo8L3N0eWxlPgo8Ym9k
eT4KICAgIDxzcGFuPlRoaXMgaXMgYSBicm9rZW4gaW1hZ2Ugd2l0aCBzaXplID0gKDEwMCwgMTAw
KTo8L3NwYW4+CiAgICA8aW1nIHNyYz0iIiBjbGFzcz0iYm94Ij4KICAgIDxzcGFuPi4uLi48L3Nw
YW4+CiAgICA8YnI+CiAgICA8c3Bhbj5UaGlzIGlzIGEgYnJva2VuIGltYWdlIHdpdGggc2l6ZSA9
ICgwLDApIGluc2lkZSBhIGJveCBvZiBzaXplID0gKDEwMCwgMTAwKToKICAgIDxpbWcgc3JjPSIi
PgogICAgPC9zcGFuPgogICAgPHNwYW4gY2xhc3M9ImJveCI+PC9zcGFuPgogICAgPHNwYW4+Li4u
Ljwvc3Bhbj4KPC9ib2R5Pgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>294987</attachid>
            <date>2016-11-16 15:39:31 -0800</date>
            <delta_ts>2016-11-16 15:39:31 -0800</delta_ts>
            <desc>test case</desc>
            <filename>test216.html</filename>
            <type>text/html</type>
            <size>443</size>
            <attacher name="Said Abou-Hallawa">sabouhallawa</attacher>
            
              <data encoding="base64">PHN0eWxlPgogICAgLmJveCB7CiAgICAgICAgd2lkdGg6IDEwMHB4OwogICAgICAgIGhlaWdodDog
MTAwcHg7CiAgICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrOwogICAgICAgIHZlcnRpY2FsLWFs
aWduOiBib3R0b207CiAgICB9Cjwvc3R5bGU+Cjxib2R5PgogICAgPHNwYW4+VGhpcyBpcyBhIGJy
b2tlbiBpbWFnZSB3aXRoIHNpemUgPSAoMTAwLCAxMDApOjwvc3Bhbj4KICAgIDxpbWcgc3JjPSIi
IGNsYXNzPSJib3giPgogICAgPHNwYW4+Li4uLjwvc3Bhbj4KICAgIDxicj4KICAgIDxzcGFuPlRo
aXMgaXMgYSBicm9rZW4gaW1hZ2Ugd2l0aCBzaXplID0gKDAsMCkgaW5zaWRlIGEgYm94IG9mIHNp
emUgPSAoMTAwLCAxMDApOgogICAgPC9zcGFuPgogICAgPHNwYW4gY2xhc3M9ImJveCI+PGltZyBz
cmM9IiI+PC9zcGFuPgogICAgPHNwYW4+Li4uLjwvc3Bhbj4KPC9ib2R5Pgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>