This patch just moves the calculation of the pseudo type earlier in the method
so we can re-use it in the next patch in this series to get the style context
from the Servo backend for the case where we don't need to resolve style.
This patch also renames the local variable from 'type' to 'pseudoType' since
that seems less ambiguous.
MozReview-Commit-ID: 6pi2F1vZYHJ
--HG--
extra : rebase_source : 1b9c610edbe4f07000b6cc2087f45dd04792228b
This change does the following:
* Introduce a new smart pointer called CounterStylePtr which either
holds an AnonymousCounterStyle strongly, or a named CounterStyle
managed by CounterStyleManager weakly, and use it to replace all
RefPtr<CounterStyle> around the codebase.
* Rename CounterStyleManager::mCacheTable to mStyles to reflect the
fact that it is used to manage all styles, not just for caching.
* Add a retired styles list which collect all named CounterStyle
evicted from mStyles, and post a PostRefreshObserver to destroy
objects in that list after next flush.
* Remove helper functions for counter style in nsStyleList and expose
mCounterStyle directly, to make code simpler with the new pointer.
Reason for adding a new smart pointer type rather than making their
AddRef/Release behave like BuiltinCounterStyle is that, it is possible
that after a flush, some stale style structs may still be alive. They
can contain pointer to destroyed CounterStyle objects. Although the
actual content may never be accessed anymore, RefPtr may still access
the object for refcounting during destruction.
MozReview-Commit-ID: xxegwSDhNb
--HG--
extra : rebase_source : bb5443f0eb56eee51cbdfd08e0400335648610e8
It was inconsistent with gecko side and also we needed to pass nsCompatibility enum along with URLExtraData.
MozReview-Commit-ID: 2ceutBfqBrg
--HG--
extra : rebase_source : f342774ed349c65f377cf85865f5905520784ca5
In our current setup, in which links with an href attribute always match either
:link or :visited, no matter whether that attribute's value is a valid URI,
changes to the attribute always put the element into either the "match nothing"
state or the "match :link" state, via calls to Link::ResetLinkState.
The only thing FlushPendingLinkUpdates is needed for is (lazily, in case it
turns out to not be needed because the element got removed from the DOM anyway)
registering a history observer to switch the link state to :visited as needed.
This means that selector matching consumers that would never expose :visited
state to start with don't need to worry about calling FlushPendingLinkUpdates.
This allows us to run SMIL tests that include a combination of additive and
non-additive animation.
MozReview-Commit-ID: 2uVN184h7Ge
--HG--
extra : rebase_source : f6a3dc70e20c09cbfdb8cc3149e2820575866b89
Specifically:
* This patch uses a flag added in a prior patch to let us use the author's
chosen prefix (-webkit or -moz) when serializing. (We treat the -moz version
as a special case, because that makes it more straightforward to unsupport
-moz if/when we can.)
* This patch makes us share the linear-gradient() side-or-corner serialization
codepath when serializing points for -webkit-linear-gradient. (The
alternative is the -moz-linear-gradient codepath, which defaults to
serializing with percent values 0%/100% for sides & corners -- and raw
percentages are invalid in -webkit-linear-gradient(), so we can't share that
codepath.) Notably, we have to skip the "to " token that the
linear-gradient() codepath would normally print out -- that was a late
addition to the spec and so it only exists in the unprefixed modern syntax.
(Instead, -webkit-linear-gradient syntax is implicitly "from" the given
point).
MozReview-Commit-ID: 9Oqo8nG1XDU
--HG--
extra : rebase_source : b15218d9cd97d3371e89365fc472d0bcd2672861
This patch doesn't change our behavior -- we'll still produce the same serialization that we would've before.
MOTIVATION: A later patch will make us share this codepath to serialize into
-webkit-linear-gradient() syntax. That syntax uses the same representation for
points as unprefixed modern linear-gradient() (with box-side-or-corner keywords
"top", "right", etc.), but it does *not* use the word "to". So we'd like to
allow "to"-and-its-subsequent-space-character to be optional. Hence, this patch
groups the space together with "to", rather than as a prefix on the next token,
so that we can skip right to printing the point (without a leading space)
when we add support for -webkit-linear-gradient() serialization.
MozReview-Commit-ID: 5fCzx4NmpcC
--HG--
extra : rebase_source : 9f8b5c801b2f4352dd2ace3b79c40edb1795b361
This avoids conflicts with mozilla::dom::FrameType.
MozReview-Commit-ID: 7aEMbHRaTFk
--HG--
extra : rebase_source : 2d01321f5ce0ec8c0e3f70984674f82678034b3c
In this patch, we implement nsIDOMWindowUtils::GetUnanimatedComputedStyle
which returns computed value of given CSS property without animation rule. This
method is used from the DevTools animation inspector to fill in keyframe values
when the property value is null (indicating that the underlying/base value is
being used).
In order to implement this, we extend nsComputedDOMStyle constructor to fetch
the computed style minus animation style (i.e. the base style). This is somewhat
complicated by the fact that for discrete animation.
StyleAnimationValue::ExtractComputedValue may return ‘unset’, ‘initial’ or
‘inherit’. For example, if the author uses the 'unset' 'initial' or 'inherit'
keyword for a discrete property (e.g. 'align-content’), ExtractComputedValue
returns the keywords as-is. Furthermore, if the user does not set any specific
keyword, ExtractComputedValue returns ‘unset’. We use this new
nsComputedDOMStyle mechanism to resolve these keywords into a valid keyword for
computed style in the same way as other properties (e.g. ‘opacity’).
MozReview-Commit-ID: HffJ9SCDf2k
--HG--
extra : rebase_source : 64df3850b862dada5f8e0767d47dc478d454ba31
Also this patch add nsIAtom as an argument to ResolveTransientStyle() to call
the new function ResolveServoTransientStyle easier. The only call site of the
ResolveTransientStyle() has already nsIAtom* there.
MozReview-Commit-ID: IwxqZbaCSpB
--HG--
extra : rebase_source : b94a3a8723fe53f38eb6144a5926dec3d7796e72
The debug code calls nsStyleContext::GetParent(), which is invalid in stylo.
Let's skip it.
MozReview-Commit-ID: 5opMaSuyoNr
--HG--
extra : rebase_source : e316b5d45ebe634a63ef0e44ed0b7183551551d4
Now, remove Layer::mSourceURI, there are several benefit of doing this:
1. Reduce the size of nsStyleImage::Layer.
2. By storing style image and url information in nsStyleImage, we can remove
many verbose comments. That is becasue there is no need to explain why we use
mSourceURI here, or why we use nsStyleImage there anymore.
3. Since all inforamtion is stored in on place, nsStyleImage, we can setup image
request or URLs by one single Gecko_SetUrlImageValue call.
MozReview-Commit-ID: 7aTQobddTB1
--HG--
extra : rebase_source : 247e3b66c727a9116c58d3d6ff3ae0f7a58f2338
In ensuring that this method does *not* re-use the existing style context if
aStyleType != eAll, I found it easy to miss this check in the multi-condition if
statement due to the way some, but not all, of the conditions are on one line.
I think this would be a little easier to read if this multi-line condition used
one line per condition.
MozReview-Commit-ID: 4UOAGhAndIV
--HG--
extra : rebase_source : 0798cf29d125227587d3cf42eba7352f1a6e40c6
There are currently no call sites of GetStyleContextWithoutAnimation
but there are a couple of places (including this patch series) where we would
like to use such a method, but without the flushing behavior.
This patch drops the flushing from GetStyleContextWithoutAnimation and
renames it to GetUnanimatedStyleContextNoFlush. It also makes a few other minor
tweaks:
* Adds the aStyleType parameter for consistency with GetStyleContextNoFlush and
GetStyleContext
* Moves the implementation of this method and GetStyleContextNoFlush to the
header file since they simply wrap DoGetStyleContextNoFlush.
* Changes the order of these declarations so that the more specialized method
comes later.
* Drops the comment describing the method since both the method name and the
inline definition should now make it obvious what it is doing.
(Actually making this method not return animation styles when it re-uses an
existing style context will happen in the next patch.)
MozReview-Commit-ID: JYeim4A9Imr
--HG--
extra : rebase_source : abf7c27c52dd6b0c20a2710d6d56f2fb3e146ccf
In the next patch we want to add a method called
GetUnanimatedStyleContextForElementNoFlush but that's much too long. Instead it
seems better to just drop 'ForElement' from all these methods since it should be
fairly obvious we are getting the style context for an element given that the
first argument is an element.
MozReview-Commit-ID: JQKaEuCKV2F
--HG--
extra : rebase_source : 3ba51f3b00d1ec7bc91102629d9c0abb88992fef