Bug 65968 - Setting the content css property on img elements has unpredictable and unexpected results
Summary: Setting the content css property on img elements has unpredictable and unexpe...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: http://jsfiddle.net/AAw9w/
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 01:59 PDT by Jake Archibald
Modified: 2021-09-06 11:59 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jake Archibald 2011-08-10 01:59:03 PDT
The CSS3 spec allows the 'content' property on all elements (not just pseudo elements such as ::before), as far as I know this isn't supported in Webkit currently, but it appears to have some effect on img elements.

http://jsfiddle.net/AAw9w/
http://jsfiddle.net/AAw9w/show/

View those pages & hit refresh a few times. Sometimes an img is displayed, sometimes nothing. The img sometimes displayed is the one specified by the 'content' property in the css.

Setting 'content' to a string, which should be displayed instead of the image, results in no output.

Expected behaviour would be to display the img as specified in the content property of the css (ideally not downloading the original img), or ignore the rule if it's unsupported.

Tested in: Safari 5.1, Chrome 13, Chrome Canary all on OSX 10.6.8.
Comment 1 Uday Kiran 2013-02-18 14:38:59 PST
Seems like working fine with WebKit 537.17 (@140072) Chrome 24
Comment 2 Simon Fraser (smfr) 2021-09-06 11:59:14 PDT
Seems to work OK now?