| Summary: | Move -webkit-marquee-increment property to the new StyleBuilder | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||||
| Component: | CSS | Assignee: | 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
Chris Dumez
2014-10-29 21:20:52 PDT
Created attachment 240657 [details]
Patch
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? Created attachment 240680 [details]
Patch
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. Created attachment 240702 [details]
Patch
Created attachment 240723 [details]
Patch
ping review? Comment on attachment 240723 [details]
Patch
r=me
Comment on attachment 240723 [details] Patch Clearing flags on attachment: 240723 Committed r175439: <http://trac.webkit.org/changeset/175439> All reviewed patches have been landed. Closing bug. |