Bug 129404 - [CSS Shapes] Serialize circle positions
Summary: [CSS Shapes] Serialize circle positions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Bear Travis
URL:
Keywords:
Depends on:
Blocks: 127802
  Show dependency treegraph
 
Reported: 2014-02-26 16:02 PST by Bear Travis
Modified: 2014-03-03 12:18 PST (History)
10 users (show)

See Also:


Attachments
Initial Patch (15.85 KB, patch)
2014-02-26 16:42 PST, Bear Travis
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2 (459.86 KB, application/zip)
2014-02-26 17:39 PST, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion (497.93 KB, application/zip)
2014-02-26 18:14 PST, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion (494.45 KB, application/zip)
2014-02-26 19:07 PST, Build Bot
no flags Details
Updated patch (18.41 KB, patch)
2014-02-27 14:01 PST, Bear Travis
no flags Details | Formatted Diff | Diff
Updating Patch (18.49 KB, patch)
2014-02-28 13:12 PST, Bear Travis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bear Travis 2014-02-26 16:02:53 PST
The circle basic shape should serialize its positions based on the spec.

http://dev.w3.org/csswg/css-shapes/#basic-shape-serialization
Comment 1 Bear Travis 2014-02-26 16:42:14 PST
Created attachment 225321 [details]
Initial Patch
Comment 2 Build Bot 2014-02-26 17:39:36 PST
Comment on attachment 225321 [details]
Initial Patch

Attachment 225321 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5820055455531008

New failing tests:
svg/masking/mask-negative-scale.svg
fast/masking/parsing-clip-path-shape.html
Comment 3 Build Bot 2014-02-26 17:39:38 PST
Created attachment 225330 [details]
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-13  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 4 Build Bot 2014-02-26 18:14:33 PST
Comment on attachment 225321 [details]
Initial Patch

Attachment 225321 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5159757383991296

New failing tests:
svg/masking/mask-negative-scale.svg
fast/masking/parsing-clip-path-shape.html
Comment 5 Build Bot 2014-02-26 18:14:37 PST
Created attachment 225334 [details]
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-07  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 6 Build Bot 2014-02-26 19:07:54 PST
Comment on attachment 225321 [details]
Initial Patch

Attachment 225321 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5822013960617984

New failing tests:
fast/masking/parsing-clip-path-shape.html
Comment 7 Build Bot 2014-02-26 19:07:58 PST
Created attachment 225337 [details]
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-06  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 8 Rob Buis 2014-02-27 06:20:46 PST
Comment on attachment 225321 [details]
Initial Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=225321&action=review

The code looks good to me. I think the tests is something astearns should look at.

> Source/WebCore/css/CSSBasicShapes.cpp:126
> +    }

Would it be possible to combine this with the next if/else block? I am not sure if the side == CSSValueCenter needs to do the later if checks or not.
Comment 9 Bear Travis 2014-02-27 14:01:46 PST
Created attachment 225407 [details]
Updated patch

Fixing up clip-path test and adding some extra position test cases
Comment 10 Bear Travis 2014-02-28 13:12:47 PST
Created attachment 225483 [details]
Updating Patch
Comment 11 Dirk Schulze 2014-03-03 03:30:53 PST
Comment on attachment 225483 [details]
Updating Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=225483&action=review

Sorry for the delay. Have some comments to the test results that I would like to clarify before landing.

> LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt:76
> +PASS getCSSText("-webkit-shape-inside", "circle(closest-side)") is "circle(closest-side at 50% 50%)"

This is not correct IMO. From the spec "omitting components when possible without changing the meaning" There is even an example that is very similar to this one.

> LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt:98
> +PASS getCSSText("-webkit-shape-inside", "circle(10px at right 0px bottom 0px)") is "circle(10px at 100% 100%)"

That looks like the code is more intelligent than it should be. According to the spec this needs calc(right - 0px) and therefore must be written as right 0px.

> LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt:99
> +PASS getComputedStyleValue("-webkit-shape-inside", "circle(10px at right 0px bottom 0px)") is "circle(10px at 100% 100%)"

Ditto.

> LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt:92
> +PASS getCSSText("-webkit-shape-outside", "circle(10px at left top 10px)") is "circle(10px at 0% 10px)"

This seems more intelligent than it should be as well. I read the spec that this should be serialized to "circle(10px at left 0% top 10px)"

> LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt:94
> +PASS getCSSText("-webkit-shape-outside", "circle(10px at top 10px left 10px)") is "circle(10px at 10px 10px)"

Ditto.

> LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt:98
> +PASS getCSSText("-webkit-shape-outside", "circle(10px at right 0px bottom 0px)") is "circle(10px at 100% 100%)"

Ditto.

> LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt:99
> +PASS getComputedStyleValue("-webkit-shape-outside", "circle(10px at right 0px bottom 0px)") is "circle(10px at 100% 100%)"

Ditto.
Comment 12 Alan Stearns 2014-03-03 08:24:32 PST
(In reply to comment #11)
> (From update of attachment 225483 [details])
> > LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt:76
> > +PASS getCSSText("-webkit-shape-inside", "circle(closest-side)") is "circle(closest-side at 50% 50%)"
> 
> This is not correct IMO. From the spec "omitting components when possible without changing the meaning" There is even an example that is very similar to this one.

The test is correct. <position> values always use the 2- or 4-value form, so you can't omit the default <position>

> > LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt:98
> > +PASS getCSSText("-webkit-shape-inside", "circle(10px at right 0px bottom 0px)") is "circle(10px at 100% 100%)"
> 
> That looks like the code is more intelligent than it should be. According to the spec this needs calc(right - 0px) and therefore must be written as right 0px.

Since right 0px can be written using a left offset without calc, the test is correct that it should serialize as 100%. And the same applies to the rest of your comments.

All of the tests you mention are correct.
Comment 13 Alan Stearns 2014-03-03 08:29:22 PST
(In reply to comment #12)
> (In reply to comment #11)
> > (From update of attachment 225483 [details] [details])
> > > LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt:76
> > > +PASS getCSSText("-webkit-shape-inside", "circle(closest-side)") is "circle(closest-side at 50% 50%)"
> > 
> > This is not correct IMO. From the spec "omitting components when possible without changing the meaning" There is even an example that is very similar to this one.
> 
> The test is correct. <position> values always use the 2- or 4-value form, so you can't omit the default <position>

Whoops - I was only looking at <position>. You are correct that closest-side should be omitted.
Comment 14 Bear Travis 2014-03-03 09:12:22 PST
(In reply to comment #13)
> (In reply to comment #12)
> > (In reply to comment #11)
> > > (From update of attachment 225483 [details] [details] [details])
> > > > LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt:76
> > > > +PASS getCSSText("-webkit-shape-inside", "circle(closest-side)") is "circle(closest-side at 50% 50%)"
> > > 
> > > This is not correct IMO. From the spec "omitting components when possible without changing the meaning" There is even an example that is very similar to this one.
> > 
> > The test is correct. <position> values always use the 2- or 4-value form, so you can't omit the default <position>
> 
> Whoops - I was only looking at <position>. You are correct that closest-side should be omitted.

Yep, the closest-side should be omitted, but that will fall under a subsequent patch. This patch only covers the <position> argument to the circle function.
Comment 15 Dirk Schulze 2014-03-03 11:28:57 PST
Comment on attachment 225483 [details]
Updating Patch

r=me then.
Comment 16 WebKit Commit Bot 2014-03-03 12:18:52 PST
Comment on attachment 225483 [details]
Updating Patch

Clearing flags on attachment: 225483

Committed r164998: <http://trac.webkit.org/changeset/164998>
Comment 17 WebKit Commit Bot 2014-03-03 12:18:56 PST
All reviewed patches have been landed.  Closing bug.