[Webkit-unassigned] [Bug 147185] New: Webkit renders the alt text of images w/o src property and using width:auto incorrectly
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jul 21 23:34:42 PDT 2015
https://bugs.webkit.org/show_bug.cgi?id=147185
Bug ID: 147185
Summary: Webkit renders the alt text of images w/o src property
and using width:auto incorrectly
Classification: Unclassified
Product: WebKit
Version: 528+ (Nightly build)
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Major
Priority: P2
Component: Images
Assignee: webkit-unassigned at lists.webkit.org
Reporter: wkbugzilla at robertl.fastmail.com
Created attachment 257244
--> https://bugs.webkit.org/attachment.cgi?id=257244&action=review
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.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150722/ef26a282/attachment.html>
More information about the webkit-unassigned
mailing list