Bug 82364

Summary: cssText should not generate literal 'initial' in shorthand properties
Product: WebKit Reporter: Yi Shen <max.hong.shen>
Component: CSSAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: enrica, kling, koivisto, macpherson, menard, rniwa, simon.fraser, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 81737    
Bug Blocks:    
Attachments:
Description Flags
Fixes the bug koivisto: review+

Description Yi Shen 2012-03-27 12:02:45 PDT
After the code change for bug 81737, the new markup is using shorthand notations as desired, however, it may generate a string like "border: initial solid red", which is an invalid declaration because the "initial" keyword is now combined with other component values in the same declaration.

"border: initial solid red" should be "border: solid red"
Comment 1 Ryosuke Niwa 2012-03-27 13:57:20 PDT
Created attachment 134129 [details]
Fixes the bug
Comment 2 Ryosuke Niwa 2012-03-27 13:57:50 PDT
This is causing a regression in editing because copy & pasted markup now has literal "initial" in some cases, and CSS parser can't handle that.
Comment 3 Alexis Menard (darktears) 2012-03-27 14:06:48 PDT
Comment on attachment 134129 [details]
Fixes the bug

Looks ok to me as a workaround. We really need to nail this problem better in the future. Happy to see that my proposed solution worked.
Comment 4 Yi Shen 2012-03-27 14:17:00 PDT
Just curious, how about StylePropertySet::get4Values(), can it generate a string contains "initial"
Comment 5 Alexis Menard (darktears) 2012-03-27 14:19:44 PDT
(In reply to comment #4)
> Just curious, how about StylePropertySet::get4Values(), can it generate a string contains "initial"

Possibly according to the code. Maybe we should fix it there as in theory getPropertyValue could return something buggy. Needs to be tested though.
Comment 6 Alexis Menard (darktears) 2012-03-27 14:21:22 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > Just curious, how about StylePropertySet::get4Values(), can it generate a string contains "initial"
> 
> Possibly according to the code. Maybe we should fix it there as in theory getPropertyValue could return something buggy. Needs to be tested though.

But it will return only initial once.
Comment 7 Antti Koivisto 2012-03-27 14:26:27 PDT
Comment on attachment 134129 [details]
Fixes the bug

This probably should differentiate between implicit and explicit initial. r=me in any case as this fixes a regression.
Comment 8 Ryosuke Niwa 2012-03-27 15:01:10 PDT
Committed r112321: <http://trac.webkit.org/changeset/112321>