DescriptionMove generic shorthand serialization checks out of specific routines
This patch moves generic shorthand serialization checks out of the
specific shorthand serialization routines into a single location.
For a shorthand to successfully serialize, all longhands must be set
and the important flag must be set consistently.
If all longhands are the same css-wide keyword (initial or inherit,
unset not yet supported properly), then the shorthand serializes to
that keyword. If css-wide keywords are otherwise used, the serialization
of a shorthand should fail, but currently we allow initial for certain
properties.
This patch also makes a couple of other changes. These changes would
make some behavior incorrect if they are left out or done separately.
- No longer skip serializing implicit initial values in cssText. This
affects the case where a shorthand is set and other longhands are
overridden so we can't serialize as a shorthand.
- Remove separate background serialization codepath. Currently we call
appendBackgroundPropertyAsText() when serializing cssText if any
background properties are present, which serializes either the
background shorthand or the longhands individually. This is removed
in this patch so we just treat background like any other shorthand,
so background properties are no longer moved to the end of cssText
and now ordered as output by the parser.
This patch will make it easier to fix serialization of unset, and also
fix variables references in shorthands (bug 612634).
BUG=612363, 471917
Committed: https://crrev.com/9f45f2b736d341572758154cc9c37614ac4a013c
Cr-Commit-Position: refs/heads/master@{#395295}
Patch Set 1 #
Total comments: 13
Patch Set 2 : #
Total comments: 2
Patch Set 3 : use string return type #Patch Set 4 : rebase #Patch Set 5 : update one more test #Patch Set 6 : actually fix test #Messages
Total messages: 32 (17 generated)
|