We need to ensure we transfer (or clear) all subproperties of a
shorthand that is only enabled in UA style sheets or in certified apps.
Otherwise, the shorthand will parse correctly and get stored on the
nsCSSExpandedDataBlock but the transfer (or clear) method will skip
all of the subproperties.
Requiring that UA style sheet-only shorthand properties only have UA
style sheet-only subproperties makes it easier to deal with the
subproperties outside of the CSS parser (which is where the information
about whether a given property is enabled only in UA style sheets is
stored). Similarly for certified app-only shorthands.
This includes removing:
* the box property directional source constants
* the CSS_PROPERTY_DIRECTIONAL_SOURCE property flag
* the CSS_PROPERTY_REPORT_OTHER_NAME property flag
* nsCSSProps::OtherNameFor
* methods on the CSS parser to parse directional box properties and set
the old *-source and *-value properties
* the resolution of logical and physical properties in nsRuleNode during
style computation, since that's now done as part of the cascade in
nsCSSExpandedDataBlock::MapRuleInfoInto
Here we convert the logical padding properties into their new resolved-at-
cascade-time implementations. This involves:
* converting -moz-padding-{start,end} into logical longhand properties
* adding padding-inline-{start,end} aliases for -moz-padding-{start,end}
* converting padding-{left,right} into longhand properties
* removing padding-{left,right}-value and
padding-{left,right}-{ltr,rtl}-source internal properties
The CSS parser and various tests are simplified a bit as a result.
We will add cases to EnsurePhysicalProperty's switch statement as we
convert the existing shorthand-implemented logical properties to the
new, CSS_PROPERTY_LOGICAL-bearing properties.
We define a new flag CSS_PROPERTY_LOGICAL to be used for logical longhand
properties and a new CSS_PROP_LOGICAL macro in nsCSSPropList.h to
define them.
When using CSS_PROP to capture all properties, includers must now
explicitly indicate whether logical properties are included or not,
by defining CSS_PROP_LIST_EXCLUDE_LOGICAL (to exclude them),
CSS_PROP_LIST_INCLUDE_LOGICAL (to include them), or CSS_PROP_LOGICAL
(to capture them separately from other properties).
This tests a case that is fixed by patch 6. In particular, I tested that:
* with none of the patches in the bug applied, the two added tests
fail, both reporting rgb(255, 255, 0)
* with all patches 1-7 applied, the two added tests pass
* with only patches 4-6 applied, the two added tests pass
* with only patches 4-5 applied, the two added tests fail, both
reporting rgb(255, 255, 0)
Note that this test is structured in a rather particular way (with two
separate restyles triggered by attributes on different elements, queued
in a particular order) to avoid triggering bug 1111451. (Though I ended
up fixing that anyway in the revision of these patches, so it's probably
doesn't require as particular a structure anymore. FIXME: In fact, I
should probably add some additional tests.)