Bug 123295

Summary: [CSS Shapes] Image valued shape size and position should conform to the spec
Product: WebKit Reporter: Hans Muller <giles_joplin>
Component: CSSAssignee: Hans Muller <giles_joplin>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, kling, kondapallykalyan, lmcliste, zalan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 116348    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Hans Muller 2013-10-24 15:32:09 PDT
The CSS Shapes spec (http://dev.w3.org/csswg/css-shapes/#shapes-from-image) implies that an image's shape may be scaled and translated relative to the original image and the origin:

"The image is sized and positioned as if it were a replaced element with a specified width and height of the element's used content-box size."

The current implementation defines the shape in terms of the image's native resolution and the origin of the content box.
Comment 1 Hans Muller 2014-01-22 12:02:08 PST
Created attachment 221886 [details]
Patch

Implement image valued shape-outside scaling and translation per the spec, http://dev.w3.org/csswg/css-shapes/#shapes-from-image:

"The image is sized and positioned as if it were a replaced element whose specified width and height are the same as the elements used content box size."

This change doesn't completely fulfill the spec, it's limited to image elements and shape-outside.
Comment 2 Hans Muller 2014-01-22 16:29:11 PST
Created attachment 221921 [details]
Patch

Just a cosmetic change - removed the createRasterShape() local image variable definition, since it's only used once.
Comment 3 Hans Muller 2014-01-22 19:05:30 PST
Created attachment 221936 [details]
Patch

Use RenderImage instead of RenderReplaced in getImageRect() (ShapeInfo.cpp).
Comment 4 Andreas Kling 2014-01-23 14:34:33 PST
Comment on attachment 221936 [details]
Patch

r=me
Comment 5 WebKit Commit Bot 2014-01-23 16:02:22 PST
Comment on attachment 221936 [details]
Patch

Clearing flags on attachment: 221936

Committed r162659: <http://trac.webkit.org/changeset/162659>
Comment 6 WebKit Commit Bot 2014-01-23 16:02:34 PST
All reviewed patches have been landed.  Closing bug.