Do some minor revisions in struct ComputedTiming.
1. Use Nullable<double> mProgress, so remove the static const kNullProgress.
The generated ComputedTimingProperties dictionary uses "Nullable" variable,
so we replace the origin type in ComputedTiming to make it more consistent
with that in ComputedTimingProperties dictionary.
2. Use scoped enums for AnimationPhase.
--HG--
extra : rebase_source : 31280c867a30e7bcdcfe831cbc72ca08c8ddc762
This fixes a type bug in CSSVariableDeclarations::MapRuleInfoInto(). The
existing code passes aRuleData->mVariables.get(), which has type
|CSSVariableDeclarations*|, into the |void*| parameter to EnumerateRead(). It
then extracts that in EnumerateVariableForMapRuleInfoInto() via a cast to a
different type, |nsDataHashtable<nsStringHashKey, nsString>*|. It's missing an
intermediate access of CSSVariableDeclarations::mVariables.
It's likely that this hasn't (seemingly) caused problems prior to now because
mVariables is the only field in CSSVariableDeclarations, so
mVariables->mVariables is at the same address as mVariables.
--HG--
extra : rebase_source : 577c032bf52dfb30eaffeb0f4d93b45f801bfcb3
This backs out all of the patch except that it retains some of the
comment changes for nsStyleContext::mBits.
--HG--
extra : commitid : 9mBuaxmSDjX
extra : rebase_source : 57935f302f350331f46f98dac86f8f833264c5da
This requires a little bit of gymnastics since it has to add the inverse
of tests, since the is-a-reset-struct tests originally added in patch 8
were made unconditional in patch 9, and with this backout we now want to
execute the code only for inherited structs.
This also doesn't back out the cleanup to use NS_STYLE_INHERIT_BIT() for
constants rather than nsCachedStyleData::GetBitForSID.
This backs out the part of bug 1209603 whose speed I was concerned about.
--HG--
extra : commitid : 6BWdXCpywlU
extra : rebase_source : 15597857a721a3a399432c8454ecfc7b789e5e2d
This leaves the half related to inherited structs, since we can still
bail early for them even without mBits.
--HG--
extra : commitid : 28h25awejXa
extra : rebase_source : 9b92da7d25fc2963c33cab063bca4fef4388a816
This is another case similar to the problem fixed in bug 1209603 patch 9.
This should make things faster by caching structs on the style context
more reliably.
--HG--
extra : commitid : GdalxPoI0wr
extra : rebase_source : 103e678a237f723b386b517d478e70214a75467e
This is needed to avoid hitting the assertion:
Assertion failure: !!(structsFound & (1 << uint64_t(eStyleStruct_Visibility))) == !!PeekStyleVisibility() (PeekStyleData results must not change in the middle of difference calculation.), at ./nsStyleStructList.h:62
once exact PeekStyleData is backed out in the later patches.
Without this patch, we can compute a new nsStyleVisibility struct inside
of nsStylePosition::CalcDifference. This patch ensures we use
PeekStyleVisibility() instead of StyleVisibility().
--HG--
extra : commitid : eVWnVp7V0P
extra : rebase_source : ee6541397d09c724a7a6c4628bbfbbe2d2f152c0
This makes mWordSpacing a lot more like mLetterSpacing, while maintaining the
existing "'normal' computes to 0px" behaviour.
--HG--
extra : rebase_source : d3273f60d4de6a9a0f05f1dbf2ed095f0f7e6c0e
It is a slight hassle for code to have to create a Declaration object to
pass in to nsCSSParser::ParseProperty when all it wants is the resulting
single nsCSSValue, if parsing a longhand property. Declaration is also
inaccessible outside layout/style/.
To fix bustage I landed a minimal change to fix the mistake in the first
patch (using the value of nsStyleVisibility::mWritingMode in
SetWritingModeDependency instead of WritingMode::GetBits), but this does
some further simplification given that we need a WritingMode now.
--HG--
extra : transplant_source : %D2%88%F0%94%27%C9%0FN%5B%3F%D0%5B%FAS%F7X%CF%1Cj5
This is a mechanism that should not exist; any use of it means
nonconformance with http://www.w3.org/TR/CSS/#partial .
--HG--
extra : commitid : fI2rko2cf4
We're violating http://www.w3.org/TR/CSS/#partial by leaving this
implementation in when we don't actually support the properties.
We're also incorrectly parsing marks and size in style rules rather than
@page rules; they were only intended for @page rules.
--HG--
extra : commitid : EV7bQDBQUp8
This assertion catches the condition that led to the bug.
I confirmed that without patch 10 on this bug, the assert fires on the
reftest added in patch 4, but does not fire on slight modifications of
that testcase that don't show the bug.
--HG--
extra : commitid : 6VMNCelDQg9
This fixes the bug because it prevents a cache conditions check for a
later PeekStyle* in nsStyleContext::CalcStyleDifference from computing a
struct that was null when we checked it earlier in CalcStyleDifference.
This, in turn, could allow the old context to be retained (and
reparented to the new parent) even though it now has incorrect data in
the font or visibility struct that was computed while checking the
conditions for another struct.
This should also improve performance in some cases of style changes on
not-yet-presented frames because we have fewer change hints to process.
--HG--
extra : commitid : 16o8oS0RLfx
This means we obey the invariant that if we've requested an inherited
struct on a context, that struct will be cached on the style context. I
believe bug 527977 intended to do make us obey this invariant, but it
missed the case where nsRuleNode::GetStyle* found cached data already on
the rule node, and the case where nsRuleNode::WalkRuleTree found a
usable struct higher in the rule tree.
Without this change, patch 10 will not function correctly for inherited
structs when we encounter this case, and will cause assertions in
dom/base/test/test_bug560780.html due to triggering style change hints
on text nodes that inherited a color struct from a parent on whose rule
node the struct was stored. (It may also have caused some of the other
test failures.)
This should be a clear performance improvement, since the path that's
being slowed down by the added work in this patch will, with the patch,
now only execute once because of that work.
--HG--
extra : commitid : 5hueOZihqNx
I'm a little worried about the performance of the change to
nsRuleNode::GetStyle*, which sets a bit on the style context every time
a struct getter goes through it. It's not obvious how that compares to
the performance benefit from patch 10.
--HG--
extra : commitid : J2XERgJ7mh2
We currently only use the style struct bits in mBits when the style
context has the relevant struct cached. The bit being set indicates
whether or not the context owns the struct.
This patch conditions the necessary tests on a cached struct being
present so that we can use (for reset structs, i.e., those with
non-inherited properties) mBits to mean something different when the
cached storage is null.
--HG--
extra : commitid : 5UtmPx56nae
Moving it to the header allows its use by another method in the header
file, in patch 6.
Making it public allows its use in assertions in nsRuleNode in patch 7.
--HG--
extra : commitid : EL4WTKW32KS
The only substantive change here, apart from a few variables changing in
size from uint16_t to uint8_t, is FontFaceSet's use of SheetType::Unknown
(0xFF) instead of 0 for FontFaceRecords for script-created FontFaces.
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout. The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.
CLOSED TREE makes big refactorings like this a piece of cake.
# The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
xargs perl -p -i -e '
s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
s/nsRefPtr ?</RefPtr</g; # handle declarations and variables
'
# Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h
# Handle nsRefPtr.h itself, a couple places that define constructors
# from nsRefPtr, and code generators specially. We do this here, rather
# than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
# things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
mfbt/nsRefPtr.h \
xpcom/glue/nsCOMPtr.h \
xpcom/base/OwningNonNull.h \
ipc/ipdl/ipdl/lower.py \
ipc/ipdl/ipdl/builtin.py \
dom/bindings/Codegen.py \
python/lldbutils/lldbutils/utils.py
# In our indiscriminate substitution above, we renamed
# nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'
if [ -d .git ]; then
git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
(This patch renames the function to "ParseWebkitPrefixedGradientWithService", indicating that this is the version that calls out to the CSSUnprefixingService.)