Bug 136345 - Add 'initial' keyword support for scroll snap CSS properties
Summary: Add 'initial' keyword support for scroll snap CSS properties
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks: 134283
  Show dependency treegraph
 
Reported: 2014-08-28 09:26 PDT by Jon Lee
Modified: 2015-03-06 15:40 PST (History)
4 users (show)

See Also:


Attachments
Patch (48.52 KB, patch)
2015-03-06 14:50 PST, Brent Fulgham
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Lee 2014-08-28 09:26:03 PDT
Scroll snap CSS properties need to support "initial" value
Comment 1 Radar WebKit Bug Importer 2014-08-28 09:26:10 PDT
<rdar://problem/18162325>
Comment 2 Brent Fulgham 2015-03-06 10:21:57 PST
According to CSS Scroll Snap Points Module Level 1, 6 November 2014 Draft:

scroll-snap-type: none
scroll-snap-points-x: none
scroll-snap-points-y: none
scroll-snap-destination: 0px 0px
scroll-snap-coordinate: none
Comment 3 Brent Fulgham 2015-03-06 14:50:10 PST
Created attachment 248102 [details]
Patch
Comment 4 Dean Jackson 2015-03-06 14:55:23 PST
Comment on attachment 248102 [details]
Patch

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

> Source/WebCore/css/StyleBuilderCustom.h:1709
> +}
> +inline void StyleBuilderCustom::applyInheritWebkitScrollSnapPointsX(StyleResolver& styleResolver)
> +{
> +    styleResolver.style()->setScrollSnapPointsX(styleResolver.parentStyle()->scrollSnapPointsX() ? std::make_unique<ScrollSnapPoints>(*styleResolver.parentStyle()->scrollSnapPointsX()) : nullptr);

Maybe you want some blank lines to separate methods here.

> Source/WebCore/css/StyleBuilderCustom.h:1721
> +#endif
> +
> +    

Two lines.
Comment 5 Brent Fulgham 2015-03-06 14:58:21 PST
Comment on attachment 248102 [details]
Patch

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

>> Source/WebCore/css/StyleBuilderCustom.h:1709
>> +    styleResolver.style()->setScrollSnapPointsX(styleResolver.parentStyle()->scrollSnapPointsX() ? std::make_unique<ScrollSnapPoints>(*styleResolver.parentStyle()->scrollSnapPointsX()) : nullptr);
> 
> Maybe you want some blank lines to separate methods here.

OK!

>> Source/WebCore/css/StyleBuilderCustom.h:1721
>> +    
> 
> Two lines.

OK!
Comment 6 Brent Fulgham 2015-03-06 15:37:12 PST
The test failures on mac/mac-wk2 are because I forgot to rebaseline the scroll-snap-property-computed-styles test after correcting the 'initial' case. I'll correct while landing.
Comment 7 Brent Fulgham 2015-03-06 15:40:20 PST
Committed r181189: <http://trac.webkit.org/changeset/181189>