It feels safer to use a function with a new name, rather than just changing the
behaviour of the existing function.
For most of these cases the PL_DHashTableLookup() result was checked with
PL_DHASH_ENTRY_IS_{FREE,BUSY} so the conversion was easy. A few of them
preceded that check with a useless null check, but the intent of these was
still easy to determine.
I'll do the trickier ones in subsequent patches.
--HG--
extra : rebase_source : ab37a7a30be563861ded8631771181aacf054fd4
This matches what Chrome and WebKit do for a single-item background
shorthand, per discussion on today's CSS teleconference. (At least
Chrome has bugs for multiple-items.)
The added test fails without the patch and passes with the patch.
Currently the setting of PLDHashTable::ops is very haphazard.
- PLDHashTable has no constructor, so it's not auto-nulled, so lots of places
null it themselves.
- In the fallible PLDHashTable::Init() function, if the entry storage
allocation fails we'll be left with a table that has |ops| set -- indicating
it's been initialized -- but has null entry storage. I'm not certain this can
cause problems but it feels unsafe, and some (but not all) callers of Init()
null it on failure.
- PLDHashTable does not null |ops| in Finish(), so some (but not all) callers
do this themselves.
This patch makes things simpler.
- It adds a constructor that zeroes |ops|.
- It modifies Init() so that it only sets |ops| once success is ensured.
- It zeroes |ops| in Finish().
- Finally, it removes all the now-unnecessary |ops| nulling done by the users
of PLDHashTable.
--HG--
extra : rebase_source : bb34979c218d152562a2f9c7e5215256c111cc5b
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).