Bug 138208

Summary: Move -webkit-marquee-increment property to the new StyleBuilder
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: CSSAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, kling, koivisto, rniwa, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 137910    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Chris Dumez 2014-10-29 21:20:52 PDT
Move -webkit-marquee-increment property from DeprecatedStyleBuilder to the new StyleBuilder so that it is generated from CSSPropertyNames.in.
Comment 1 Chris Dumez 2014-10-29 21:52:53 PDT
Created attachment 240657 [details]
Patch
Comment 2 Sam Weinig 2014-10-30 06:08:46 PDT
Comment on attachment 240657 [details]
Patch

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

> Source/WebCore/css/StyleBuilderCustom.h:47
> +    auto& primitiveValue = downcast<CSSPrimitiveValue>(value);

What guarantees this cast is safe? Could we have applyValueWebkitMarqueeIncrement() take a CSSPrimitiveValue instead of a CSSValue?
Comment 3 Chris Dumez 2014-10-30 10:29:22 PDT
Created attachment 240680 [details]
Patch
Comment 4 Chris Dumez 2014-10-30 10:33:46 PDT
Comment on attachment 240657 [details]
Patch

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

>> Source/WebCore/css/StyleBuilderCustom.h:47
>> +    auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
> 
> What guarantees this cast is safe? Could we have applyValueWebkitMarqueeIncrement() take a CSSPrimitiveValue instead of a CSSValue?

The CSS Parser is already marking sure the value for -webkit-marquee-increment property is a CSSPrimitiveValue so this cast should be safe and the assertion in downcast<>() should protect us against a mismatch between the CSS Parser and the StyleBuilder. The reason the StyleBuilder functions take a CSSValue and not a CSSPrimitiveValue is because not all properties have a CSSPrimitiveValue as value. Some have a CSSValueList for e.g. and make prop.pl does not have any way to know as far as I can tell because this information is coded in the CSSParser, not CSSPropertyNames.in.

I have added a new layout test in the latest patch iteration to gain coverage for non CSSPrimitive values on  -webkit-marquee-increment, and make sure we don't crash.
Comment 5 Chris Dumez 2014-10-30 14:37:13 PDT
Created attachment 240702 [details]
Patch
Comment 6 Chris Dumez 2014-10-30 20:42:42 PDT
Created attachment 240723 [details]
Patch
Comment 7 Chris Dumez 2014-10-31 09:58:09 PDT
ping review?
Comment 8 Andreas Kling 2014-10-31 16:19:26 PDT
Comment on attachment 240723 [details]
Patch

r=me
Comment 9 WebKit Commit Bot 2014-10-31 16:46:15 PDT
Comment on attachment 240723 [details]
Patch

Clearing flags on attachment: 240723

Committed r175439: <http://trac.webkit.org/changeset/175439>
Comment 10 WebKit Commit Bot 2014-10-31 16:46:20 PDT
All reviewed patches have been landed.  Closing bug.