<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Webkit renders the alt text of images w/o src property and using width:auto incorrectly"
href="https://bugs.webkit.org/show_bug.cgi?id=147185">147185</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Webkit renders the alt text of images w/o src property and using width:auto incorrectly
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>528+ (Nightly build)
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>OS</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Major
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>Images
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>wkbugzilla@robertl.fastmail.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=257244" name="attach_257244" title="Minimal html example reporting the img widths using js">attachment 257244</a> <a href="attachment.cgi?id=257244&action=edit" title="Minimal html example reporting the img widths using js">[details]</a></span>
Minimal html example reporting the img widths using js
When the src property of an img tag is missing, the alt text is displayed as expected. However, when a height is specified for the image and width:auto is applicable then the overall width of the element can be very large and is dependent on the length of the alt text and the height e.g. specifying a height="500" with an alt string of 123 chars will result in an image element 18,136px wide - depending on base font size.
The following img tags are identical except for height and the resulting element widths are 181, 1814 and 18136px respectively:
<img height="5" alt="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." style="width:auto;">
<img height="50" alt="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." style="width:auto;">
<img height="500" alt="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." style="width:auto;">
This occurs on Safari Version 8.0.6 (10600.6.3) on OS X 10.10.3 and the current Safari (and related UIWebView) version on iOS 8.4.
Depending on the javascript techniques used on the site (e.g. setting parent.style.width = childImg.scrollWidth) this can cause iOS Safari+Webkit apps to crash.
Note that this does *not* occur if the src attribute is present but the actual image is not found. As per #62774 the alt text is not displayed at all but the resultant element is the correct size.
fwiw Chrome (Version 43.0.2357.134 (64-bit)) and Firefox (39.0) on OS X 10.10.3 and Chrome on iOS render the above img examples identically as expected.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>