Bug 82364 - cssText should not generate literal 'initial' in shorthand properties
Summary: cssText should not generate literal 'initial' in shorthand properties
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on: 81737
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-27 12:02 PDT by Yi Shen
Modified: 2012-03-27 15:01 PDT (History)
8 users (show)

See Also:


Attachments
Fixes the bug (6.90 KB, patch)
2012-03-27 13:57 PDT, Ryosuke Niwa
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>