angler-fishThe Vulnerability History Project

Use Shadow DOM to display fallback content for images

      This replaces the use of painting in RenderImage to display an image's alt text
with an implementation in shadow DOM. This initial implementation is close in
appearance to the legacy display of alt-text but will ultimately move closer to
the one seen in Firefox and described in http://hixie.ch/specs/alttext.

The alt-text and broken-image icon is now rendered as:

    <style>
        #alttext-container {
        overflow: hidden;
        border: 1px solid silver;
        padding: 1px;          
        display: inline-block;        
        }                                 
        #alttext { display: none; overflow: hidden;}
    </style>                                    
    <div id=&quotalttext-container&quot>                  
        <img src=&quotdata:png, [broken-image-icon]&quot width=&quot16&quot height=&quot16&quot align=&quotleft&quot style=&quotmargin: 0px&quot>
        <div id=&quotalt-text&quot>Alt text in here</div>         
    </div>                                                  

Some notes on the way the fallback content is now rendered: 

    - The fallback content is rendered inside an inline-block so it does not calculate 
      its dimensions the way a replaced element (i.e. an image) would (as defined by
      http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width). So where one of width 
      or height is auto but the other is not, the fallback content will not exactly match 
      the dimensions calculated by RenderImage in error mode currently. We do a modest
      imitation of the logic in quirks mode, but in strict mode it will behave exactly like an inline-block.

    - Where the image has no src attribute and no alt attribute RenderImage.cpp
      still looks after the painting of the element - no fallback content is generated
      and no broken image is displayed. This is consistent with existing behaviour.

    - The only image resource requests that still use the syn
    
commit 1717cf4bfefc8504ff6971d2e8fab1e14ea462bb
+1 -150
+1 -1
-1
+1 -1
+1 -1
+1 -1
+1 -1
+1 -1
+1 -1
+1 -1
+1 -1
+1 -1
+1 -1
+1 -1
+1 -1
+2 -8
-17
-10
+1 -4
+1 -4
-18
-2
+1 -5
+3 -6
-3
-2
+11 -79
+1 -13
-112
-23
+3 -46
-4
+4 -14
+3 -4
+1 -1
+13 -78
-10
-3
+15 -18
+8 -3
+65 -3
+1 -1
+75 -4
+9 -1
+2 -13
expand_less