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+

Yi Shen
Reported 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"
Attachments
Fixes the bug (6.90 KB, patch)
2012-03-27 13:57 PDT, Ryosuke Niwa
koivisto: review+
Ryosuke Niwa
Comment 1 2012-03-27 13:57:20 PDT
Created attachment 134129 [details] Fixes the bug
Ryosuke Niwa
Comment 2 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.
Alexis Menard (darktears)
Comment 3 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.
Yi Shen
Comment 4 2012-03-27 14:17:00 PDT
Just curious, how about StylePropertySet::get4Values(), can it generate a string contains "initial"
Alexis Menard (darktears)
Comment 5 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.
Alexis Menard (darktears)
Comment 6 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.
Antti Koivisto
Comment 7 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.
Ryosuke Niwa
Comment 8 2012-03-27 15:01:10 PDT
Note You need to log in before you can comment on or make changes to this bug.