RESOLVED FIXED 130369
[CSS Shapes] shape-margin in percentage units always computes to 0px
https://bugs.webkit.org/show_bug.cgi?id=130369
Summary [CSS Shapes] shape-margin in percentage units always computes to 0px
Rebecca Hauck
Reported 2014-03-17 16:48:51 PDT
The following shape definition results in at shape-margin: 0px: -webkit-shape-margin: 10%; -webkit-shape-outside: inset(40px 100px 40px 0px); I've attached two ref files to go with the test file - one is with just a simple green square element, the other is with the same shape defined with the shape-margin: 20px, which should be the computed value of the 10% in the test file (containing block is 200px x 200px)
Attachments
Test case for bug (1.13 KB, text/html)
2014-03-17 16:49 PDT, Rebecca Hauck
no flags
ref file #1 for test - uses shape-margin in px units on the same exact shape (1.13 KB, text/html)
2014-03-17 16:50 PDT, Rebecca Hauck
no flags
ref file #2 for test - uses simple green square (457 bytes, text/html)
2014-03-17 16:51 PDT, Rebecca Hauck
no flags
Patch (11.99 KB, patch)
2014-04-03 16:27 PDT, Bem Jones-Bey
no flags
Rebecca Hauck
Comment 1 2014-03-17 16:49:45 PDT
Created attachment 226979 [details] Test case for bug
Rebecca Hauck
Comment 2 2014-03-17 16:50:41 PDT
Created attachment 226980 [details] ref file #1 for test - uses shape-margin in px units on the same exact shape
Rebecca Hauck
Comment 3 2014-03-17 16:51:21 PDT
Created attachment 226981 [details] ref file #2 for test - uses simple green square
Bem Jones-Bey
Comment 4 2014-04-03 16:27:22 PDT
Zoltan Horvath
Comment 5 2014-04-03 16:51:46 PDT
Comment on attachment 228556 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=228556&action=review > Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp:163 > + float margin = floatValueForLength(m_renderer.style().shapeMargin(), m_renderer.containingBlock() ? m_renderer.containingBlock()->contentWidth() : LayoutUnit()); I like this change! The floatValueForLength will present only here, not in every shape types. Also, Shape class stores a float, so we won't be passing Length all around! Looks good to me.
Andreas Kling
Comment 6 2014-04-04 09:41:00 PDT
Comment on attachment 228556 [details] Patch r=me
WebKit Commit Bot
Comment 7 2014-04-04 10:14:53 PDT
Comment on attachment 228556 [details] Patch Clearing flags on attachment: 228556 Committed r166787: <http://trac.webkit.org/changeset/166787>
WebKit Commit Bot
Comment 8 2014-04-04 10:14:57 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.