Bug 119080 - [CSS Masking] -webkit-mask-repeat: round does not work
Summary: [CSS Masking] -webkit-mask-repeat: round does not work
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.8
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 95389
  Show dependency treegraph
 
Reported: 2013-07-25 04:49 PDT by Andrei Parvu
Modified: 2013-08-01 06:02 PDT (History)
7 users (show)

See Also:


Attachments
Example of -webkit-mask-repeat: round usage which doesn't work. (814 bytes, text/html)
2013-07-25 04:54 PDT, Andrei Parvu
no flags Details
Patch (23.53 KB, patch)
2013-07-29 03:37 PDT, Andrei Parvu
no flags Details | Formatted Diff | Diff
Patch (40.90 KB, patch)
2013-08-01 02:02 PDT, Andrei Parvu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Parvu 2013-07-25 04:49:31 PDT
When using -webkit-mask-repeat with a value of 'round' the image isn't scaled to fit a whole number of times in the background but isn't repeated at all.

Looking through the code, I noticed that everything different from -webkit-mask-repeat: repeat is treated like -webkit-mask-repeat: no-repeat, so the space repeat style is not implemented.
Comment 1 Andrei Parvu 2013-07-25 04:54:01 PDT
Created attachment 207449 [details]
Example of -webkit-mask-repeat: round usage which doesn't work.
Comment 2 Andrei Parvu 2013-07-29 03:37:42 PDT
Created attachment 207633 [details]
Patch
Comment 3 Dirk Schulze 2013-07-31 05:38:35 PDT
Comment on attachment 207633 [details]
Patch

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

> Source/WebCore/ChangeLog:7
> +        Added the round functionality to -webkit-mask-repeat.
> +        https://bugs.webkit.org/show_bug.cgi?id=119080
> +

Please add some more lines of comments what you did and how it influenced the bahavior on the dimension calculation code.

> Source/WebCore/rendering/RenderBoxModelObject.cpp:1312
> +    if (backgroundRepeatX == RoundFill && positioningAreaSize.width() > 0 && fillTileSize.width() > 0) {

Doesn't background call the same code path? When it works for background, why doesn't it work for -webkit-mask? If the code exists for background somewhere, we should make sure that we reuse the code.

Do we have tests for background-repeat and "round"?

> Source/WebCore/rendering/RenderBoxModelObject.cpp:1314
> +        int nrTiles = ceil((double)positioningAreaSize.width() /
> +            fillTileSize.width());

why do you split the line here? You don't do it later?
Comment 4 Andrei Parvu 2013-08-01 02:02:09 PDT
Created attachment 207907 [details]
Patch
Comment 5 Andrei Parvu 2013-08-01 02:04:20 PDT
This also fixes the background-repeat. I added background-repeat tests and addressed your comments.
Comment 6 Dirk Schulze 2013-08-01 05:38:46 PDT
Comment on attachment 207907 [details]
Patch

r=me.
Comment 7 WebKit Commit Bot 2013-08-01 06:02:31 PDT
Comment on attachment 207907 [details]
Patch

Clearing flags on attachment: 207907

Committed r153582: <http://trac.webkit.org/changeset/153582>
Comment 8 WebKit Commit Bot 2013-08-01 06:02:35 PDT
All reviewed patches have been landed.  Closing bug.