Bug 123295 - [CSS Shapes] Image valued shape size and position should conform to the spec
Summary: [CSS Shapes] Image valued shape size and position should conform to the spec
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Hans Muller
URL:
Keywords:
Depends on:
Blocks: 116348
  Show dependency treegraph
 
Reported: 2013-10-24 15:32 PDT by Hans Muller
Modified: 2014-01-23 16:02 PST (History)
7 users (show)

See Also:


Attachments
Patch (17.31 KB, patch)
2014-01-22 12:02 PST, Hans Muller
no flags Details | Formatted Diff | Diff
Patch (17.33 KB, patch)
2014-01-22 16:29 PST, Hans Muller
no flags Details | Formatted Diff | Diff
Patch (17.34 KB, patch)
2014-01-22 19:05 PST, Hans Muller
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.