Bug 136345

Summary: Add 'initial' keyword support for scroll snap CSS properties
Product: WebKit Reporter: Jon Lee <jonlee>
Component: WebCore Misc.Assignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, hyatt, syoichi, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=142411
https://bugs.webkit.org/show_bug.cgi?id=142414
Bug Depends on:    
Bug Blocks: 134283    
Attachments:
Description Flags
Patch dino: review+

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>