By doing this we avoid triggering assertions in the Servo code that ensure
we have registered the thread with Servo and set the proper state on it.
MozReview-Commit-ID: K6qHrYoQDLm
--HG--
extra : rebase_source : d01b0aad42273f6b92b7cfd5f5fe17ffe7b4cda0
In addition to the sourceMappingURL comment, there is a second special
comment, "sourceURL", that can be used to set the "display name" of a
style sheet for developer tools. This name is also used as the base
URL for the source-map URL resolution algorithm. sourceURL is
described here:
https://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/
This patch changes Firefox to record this URL, if specified, and to
expose it (chrome-only) vai StyleSheet.webidl.
MozReview-Commit-ID: 7NwXsOf7nbY
--HG--
extra : rebase_source : bd5d25b4d44f5f220a4624db346edbc4236c9886
We have about 11,500 of these when loading gmail in a Stylo-enabled build, from
SpecifiedUrls; the objects themselves account for about 1.3 MiB of memory, and
the strings within them about 2.9 MiB.
We also have a very small number of them on the Gecko side.
The variables (basicShapeSVGBoxValues, etc.) in property_database.js are
moved to the beginning of the file so that they're defined before usage.
MozReview-Commit-ID: 7L3obIY1alP
--HG--
extra : rebase_source : 6c3dff5ecbdad8ef6cf1a49953e4ad1001620b6c
`MallocSizeOfOps::enclosing_size_of_op` is an `Option<>` type, and the panic in
question is caused by not providing a value in a case where it's needed for
measuring a HashSet.
HashMaps and HashSets are common enough that it makes sense to make
`enclosing_size_of_op` non-optional, which this patch does.
MozReview-Commit-ID: IB2aRuXHj8E
--HG--
extra : rebase_source : a6f593b718ca9e92a7a36ca7e2063a01e11c7e04
This reduces sizeof(ImageValue) from 104 to 96. When heap-allocated, this moves
it from the 112 byte bin to the 96 byte bin. Loading gmail with Stylo, there
are about 11,500 ImageValues on the heap, so this saves about 184,000 bytes.
MozReview-Commit-ID: JLe2cJ54IlL
--HG--
extra : rebase_source : 6c74d1d606db0cb1d09392f5585cc1cbadc92ebd
We have about 11,500 of these when loading gmail in a Stylo-enabled build, from
SpecifiedUrls; the objects themselves account for about 1.3 MiB of memory, and the
strings within them about 2.9 MiB.
We also have a very small number of them on the Gecko side.
MozReview-Commit-ID: AduCIaDIzGG
--HG--
extra : rebase_source : ee2a20921a17b9091b60a5d9e389a6c6f2fa192b
This property accepts a color. It's inherited and defaults to transparent.
Its value is respected on macOS when rendering text into transparent pixels.
This property should be used for text that is placed on top of "vibrant"
-moz-appearances, in order to achieve high quality text rendering for such text.
In most cases, the property should be set to a named system color; an upcoming
patch in this patch series will add one such color for each vibrant
-moz-appearance value.
However, in some cases it can also be useful to use a custom color: If text
is rendered into an intermediate surface, for example because a mask is applied
to it, and the background color behind that intermediate surface is known, then
this property can be set to that background color in order to achieve subpixel
AA for the text inside the mask effect. In that case, the font smoothing
background color is respected because text is rendered into transparent pixels
*inside the intermediate surface*. At the moment, the only example of that use
case is the text of the active tab in the state where the text is overflowing.
MozReview-Commit-ID: D98qQnxoFaq
The old code doesn't work because mScriptHandlingObject is a nsWeakPtr,
which cannot be casted to nsPIDOMWindowInner directly.
Since scriptHandlingObject is a strong reference to the same object, we
can just try casting that.
MozReview-Commit-ID: JRBs5N6xxc0
--HG--
extra : rebase_source : cd0237553198182b00ff9c667a17271b23464567
A single transition value that includes 'none' for transition-property is
valid, so we should store whole specified values (if it's valid). Whereas,
the spec [1] clearly says for the case where there are multiple entries;
If there is more than one <single-transition> in the shorthand, and any of
the transitions has none as the <single-transition-property>, then the
declaration is invalid.
'none 2s linear 2s' is a test case for the former, '1s width, 2s none' is a
test case for the latter.
Note that with this patch, 'transition: none' is serialized as 'none 0s ease 0s'
instead of 'none' but it matches Gecko.
[1] https://drafts.csswg.org/css-transitions/#single-transition
MozReview-Commit-ID: 3o3z5GFyMqh
--HG--
extra : rebase_source : c553af804124c0c76554fb8ad007e78e2813d321
MozReview-Commit-ID: 5eTW5dCcxzP
This patch reverts the code changes, but not the test changes from changeset bf9cf6f393eb. There is a crashtest here which is valuable to keep.
--HG--
extra : rebase_source : e6f5d7234eca396a0302c1d562fc54663b274c6c
This removes the double-include macro hackery that we use to define two
separate string types (nsAString and nsACString) in favor of a templated
solution.
Annotations for Valgrind and the JS hazard analysis are updated as well as
the rust binding generations for string code.
--HG--
extra : rebase_source : 63ab2c4620cfcd4b764d42d654c82f30f984d016
extra : source : 9115364cd4aa078c49bba7911069f8178e55166f
These tests no longer assert so we can remove the stylo annotations.
MozReview-Commit-ID: 7sWWTkoFp1G
--HG--
extra : rebase_source : e42f418ef1756a08bc0f11b02b42b2a1737deb76
If there is no font feature values inside document we should avoid creating
unnecessary objects.
MozReview-Commit-ID: HJKMzQvQAPR
--HG--
extra : rebase_source : 06dc792d2c4848c4c8ca49b9eb98630d5d475006
Example output from the Obama Wikipedia page:
> ├──2,315,600 B (01.16%) -- stylist
> │ ├──1,916,928 B (00.96%) ── invalidation-map
> │ ├────228,800 B (00.11%) ── rule-tree
> │ ├────142,336 B (00.07%) ── element-and-pseudos-maps
> │ ├─────14,336 B (00.01%) ── revalidation-selectors
> │ ├──────9,648 B (00.00%) ── other
> │ └──────3,552 B (00.00%) ── precomputed-pseudos
This change requires new code to measure HashMaps, which uses the new
'malloc_enclosing_size_of' functions that can measure a heap block from an
interior pointer.
The patch changes MallocSizeOfFn to a newtype, and introduces
MallocEnclosingSizeOfFn alongside.
It also adds new traits: MallocSizeOfBox, MallocSizeOfVec, MallocSizeOfHash.
These each contain a single method that does shallow measurement of the
relevant type, which is often useful. (This is a different style to the
existing MallocSizeOf trait, which does deep measurement, but I'm moving away
from the always-deep-measurement style because it's less flexible.)
MozReview-Commit-ID: FgJCCmdw0ZF
--HG--
extra : rebase_source : c692c2073aa66020224489b97247c49de95a99a4
The Servo_KeyframesRule_GetKeyframe binding function has been empowerd and
renamed to Servo_KeyframesRule_GetKeyframeAt in the servo side patch. In this
patch, we use Servo_KeyframesRule_GetKeyframeAt to get line and column
information for ServoKeyframeRule, so that the inspector can present Keyframe
rules on the devtool panel properly.
MozReview-Commit-ID: BGd9FFsC3Nz
--HG--
extra : rebase_source : f2b5ff73a84a3cd4e5d0b17d5e0c5ac5fd57f817
In a number of places, there's no substantial use of maps any more
after the segue.
The ELEMENT segue tries the FragmentOrElement QI, but that is
redundant with the Element QI.
This lets me use a few higher-level macros.
MozReview-Commit-ID: Gstq3Cm8LDl
--HG--
extra : rebase_source : f0c7dbf5281ce7375b1369b49db095a211569d6c
This changes the CSS lexer to extract sourceMappingURL directives from
comments and preserve them; then changes the parser to expose this value
as the style sheet's sourceMapURL.
MozReview-Commit-ID: LfMamJ1PsU0
--HG--
extra : rebase_source : 258827720282d415f97f1d49d870b7c2448d39f4
When an animation is newly created while the same property transition is
running, the transition style rule persists until we call RequestRestyle() for
transitions level. That means if user calls getComputedStyle for the property
right after creating animation, the style obtained by getComputedStyle still
included the transitions level rule. As a result, the transitions level style
overrides newly created animation style until the next normal restyling process
happens (i.e. process transition level restyle request). Vice versa, in the
case where an animation is removed, transitions level style does not appear
until the next normal restyling.
This patch fixes this problem by trigerring a resyle of the transitions level
when an animation is created or removed.
MozReview-Commit-ID: HY6amLmDHTi
--HG--
extra : rebase_source : 67e58dc9a6c695299c3eef684bf7357153c5168b
The motivation of this patch is that clearing mPresContext should be an
implementation detail of XBL style set, so I create a method for that, and
remove ClearPresContext().
MozReview-Commit-ID: Ftta0rcAqu6
--HG--
extra : rebase_source : 0bdb1ac3e2c988e5a0220172f19ab4b006e883d7
This fixed layout/style/test/test_media_queries_dynamic.html after Part 3 is added.
MozReview-Commit-ID: 7ZpSunCnkIc
--HG--
extra : rebase_source : 6acab11ba784b801b90afc0558c32baabcc3f271
The method always returns NS_OK, and no other caller checks the nsresult.
Hence the patch.
MozReview-Commit-ID: CnYCZ8VchG
--HG--
extra : rebase_source : 8626332e2774c1d6f42c7afa5e9679091a3aeaa2
… in the C++ style system, to align with Stylo and the CSSOM spec.
MozReview-Commit-ID: HaDUeNjumnY
--HG--
extra : rebase_source : 3a4d2856bb6b3702d0bc7ec9b7a8e472758ab9f0
This allows us to avoid posting animation-related restyles when removing
elements from the document tree.
MozReview-Commit-ID: CzN4S0DTUMa
--HG--
extra : rebase_source : a5b94d9ad5b1b2243abd0a5b188eec2b334df74d
The method always returns NS_OK, and no other caller checks the nsresult.
Hence the patch.
MozReview-Commit-ID: CnYCZ8VchG
--HG--
extra : rebase_source : 062d643308b309dfe442384301860ffeec2dff9f
Prefixed linear gradients use direction keyword to indicate starting point of the
gradient but modern syntax uses this keyword to indicate ending point of the gradient.
Top-to-bottom direction is the default value for gradients. Therefore `top` is default
value of prefixed linear gradients and `to bottom` is default one for unprefixed one.
For brevity, we omit the direction keyword from our serialization when it matches the
default direction, but we were incorrectly trying to remove `bottom` keyword from
prefixed computed values.
MozReview-Commit-ID: 8UCsFE44LRX
--HG--
extra : rebase_source : 6185aec4c3c1b0647015d00d31e0120c9448867e
We now have jemalloc_ptr_info() and moz_malloc_enclosing_size_of(), which can
be used to measure heap blocks via interior pointers. This patch does the
following.
- Adds MOZ_DEFINE_MALLOC_ENCLOSING_SIZE_OF, for defining
measure-via-interior-pointer functions.
- Uses these functions to replace some horrid pointer arithmetic in functions
measuring Rust types.
--HG--
extra : rebase_source : 5128408256c128222025153ae3e0f924b2499a2a
The change in CounterStyleManager::BuildCounterStyle converts a case-
insensitive comparison to a case-sensitive comparison by comparing atom
pointer directly. But this is fine because all names of builtin counter
styles should have been lowercased by the parser. For Gecko, it is done
in CSSParserImpl::ParseCounterStyleName, and for Servo, it is done in
counter_style::parse_counter_style_name.
MozReview-Commit-ID: JHHmzEaNIpn
--HG--
extra : rebase_source : aa43d45042c3cbd85e925596586a9a2ea51c6e4a
Doing this at compile time would save a bit of our startup time, which
I've promised to do since @counter-style was initially implemented, see
bug 966166 comment 103 (the paragraph with "constexpr").
Also, having this implemented here makes using atom instead of string
on name of builtin counter styles easier, for later patches.
MozReview-Commit-ID: C9HYcuShBQv
--HG--
extra : rebase_source : 273eb3d23ee770722d27b26aafaa291d7375b8ee
nsDocument::GetAnimationController() will lazily create an animation controller
which, in some call sites, is unnecessary.
This patch first calls HasAnimationController() and only calls
GetAnimationController() if it returns true. This avoids creating an animation
controller in situations where one is not necessarily required.
MozReview-Commit-ID: 4cdpLRvMVJU
--HG--
extra : rebase_source : 125a59c0b0535d5df9a9964538b3784ddb1212c7
This patch splits up the existing "layout/style-sets" measurement into
"layout/gecko-style-sets", or "layout/servo-style-sets/stylist/rule-tree" and
"layout/servo-style-sets/other". (Additional things will be measured under
"layout/servo-style-sets/" later, such as cascade data.)
This requires introducing a new type, ServoStyleSetSizes, for transferring the
multiple measurements from Rust code to C++ code.
MozReview-Commit-ID: FbmzpsjBpgI
--HG--
extra : rebase_source : f2d1441705139e6674d355792255302fcd89f748
We need to check whether the function fails or not in order to check whether
we support the specified paced animation values.
Current servo returns 0.0 when failed computing distance, so servo doesn't
distinguish its failure. This patch makes Servo_AnimationValue_ComputeDistance
return a negative value when the function fails.
MozReview-Commit-ID: 43Q4gu4xwHc
--HG--
extra : rebase_source : fa159b4b03e2e84c0a365455de4c0d2cf5d4f2ce
Back when it was added (for Windows CE, in bug 488608), mozjemalloc was
C and all the supported compilers didn't support C99 bools. Now
mozjemalloc is C++, and all the supported compilers support C99 bools
for the cases where the type is used from C.
--HG--
extra : rebase_source : b9c710a0c48dc36cb473af59e3119131d13523ce
Replace it with NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION, because it
has been the same for a while.
MozReview-Commit-ID: 5agRGFyUry1
--HG--
extra : rebase_source : 5388c56b2f6905c6ef969150f0c5b77bf247624d
In our UA sheet the only style we apply to ::-moz-table-column is "display: table-column".
Per spec, the only styles that apply to table columns are border props,
background props, 'width', and 'visibility'.
The only one of those that inherits is 'visibility'. And the only relevant
value per spec is "collapse". But an anonymous column can only be "visibility:
collapse" in Gecko right now if its colgroup is, and then the colgroup will get
collapsed away as a whole. So it doesn't matter whether the column inherits the
visibility style.
In practice, we do something special for "hidden" on a table-column as well,
during display list building, which affects hit-testing. Per
https://github.com/w3c/csswg-drafts/issues/1763 it's not clear that we should be
doing this at all, but for now we just keep our existing behavior and ensure
that the parent colgroup's visibility style is taken into account for anonymous
columns when building display lists.
CLOSED TREE
--HG--
extra : amend_source : 7618f27e1cf71347f12384935374d303d5c1ab23
extra : histedit_source : 1143d226673ace563bb5d9ff3c420ded33439791%2C9746a30097304bd2214a0072773dc00c767d31cd
There are two issues with this test:
(a) It fails to flush style when it intends to trigger the first transition.
Specifically, `getComputedStyle(div)` alone does not flush style. Instead we
need `getComputedStyle(div).transform`.
This patch replaces that line with a call to `div.getAnimations()` which
*does* flush style ensuring the first transition is triggered.
(b) It fails to ensure that the first transition has progressed past the first
frame on the main thread before triggering the second transition.
If the first transition is still on its first frame, the computed value of
'transform' will be 'matrix(1, 0, 0, 1, 0, 0)'. If we then update the
specified value of 'transform' to 'translateX(0px)', no transition will be
generated (although the first transition will be canceled) since there is no
change.
This patch fixes that by making the end point of the second transition NOT
match the start point of the first transition (and not be somewhere inside
the range of the first transition).
As an extra precautionary measure, to be sure that the animation has started
progressing on both the main thread and compositor, this patch alters the
initial wait condition for the first transition to also wait on the first
transition's ready promise.
MozReview-Commit-ID: E1OJuHBSMfr
--HG--
extra : rebase_source : aede0fa00f261e1c7d1be61857b6fd0537a0f7e7
In Stylo, we read font related user prefs to set the default font size only
if we set 'font-size' property. However, users are allowed to set their
preferred minimum font size through the user prefs, even without using
'font-size' property.
Gecko used to do this in nsRuleNode::SetDefaultOnRoot, which calles the
default constructor of nsStyleFont and does the minimum font size applying
right after. Moving the minimum font size applying into the default
constructor of nsStyleFont shoud be no harm to Gecko, but makes Stylo
share the same code path and behave the same.
MozReview-Commit-ID: BDcJX92o0uR
--HG--
extra : rebase_source : 88d9c73d0eb793ffe8a5dc424361f21f6acd078b
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.
--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
Sometimes, we may get a 2d transform matrix like this:
matrix(0, 1, -1, 0.33, 0, 0)
The reason is we might have "rotate(90deg)" in the test case, so the 1st or
the 4th element could be 0.0, and we shouldn't assume they are 1.0 while
converting matrix2d into matrix3d, or we will get a weird result, like this:
matrix3d(1, 1, 0, 0,
-1, 0.33, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1)
m11 shouldn't be "1" here.
Add a "defined()" function to return the first defined object as the
matrix element because we should be testing the defined-ness, instead of
truthiness.
MozReview-Commit-ID: HSTt2PR02AU
--HG--
extra : rebase_source : 417438239635f9bbf0eb4818b39c611ab90b9a10
Bindgen bitfield enums don't work as return values with the Linux 32-bit ABI at
the moment because they wrap the value in a struct.
This causes the Rust side to believe the caller will pass along space for the
struct return value, while C++ believes it's just an integer value.
MozReview-Commit-ID: JHDp0XAmQCG
A lot of this involves copy-pasting the existing Servo style structs code.
Note that nsArenaSizes had to be moved after nsStyleSizes, because the former
now contains an instance of the latter.
MozReview-Commit-ID: 3hrkobxbX9b
--HG--
extra : rebase_source : f6b29bd7cb9bd60f2da65f5f907e161299333287
Another plumbing-only change, which is a precursor for the next patch.
ComputedValues are a Servo-only thing, so in order to use nsStyleSizes for both
Gecko and Servo, the ComputedValues sizes must be moved out.
MozReview-Commit-ID: BOnQSzzV0vC
--HG--
extra : rebase_source : 025c6161e509401a36525349083dd98bfda35621
This is a purely non-functional plumbing change. Instead of passing a
SizeOfState and an nsStyleSizes a bunch of places, we pass an nsWindowSizes,
which contains both of them.
This is a necessary precursor for the next patch.
MozReview-Commit-ID: Ek03wDM50rB
--HG--
extra : rebase_source : 7b05708bd21dc4e3812ea041647fa74bb413d0b9
For the Obama wikipedia page, this covers about 85% of the unmeasured
ComputedValues structs. The about:memory output looks like this:
> +---2,443,648 B (02.41%) -- computed-values
> | +--1,088,272 B (01.07%) -- dom
> | +----945,744 B (00.93%) -- non-dom
> | +----409,632 B (00.40%) -- visited
I'm not sure why some CVs are still being missed.
MozReview-Commit-ID: 1bYWwSi4ihn
--HG--
extra : rebase_source : 14e4bd36a54bbbd8fd265f559704bec5a5e3b154
Not sure about the name, or whether making it a static or not (a static seemed
slightly clearer, but nbd, feel free to bikeshed about it).
MozReview-Commit-ID: FHGmcoprN2Q
--HG--
extra : rebase_source : 2f68a55ee861d9eacc56004cb98470a518574626
This is a temporary step until we implement bug 1391537. It is needed to
maintain consistent behavior with Gecko and provide sensible output,
particularly in the case where we have longhands whose values are drawn from
unparsed shorthands.
MozReview-Commit-ID: 9aD2tsLagBp
--HG--
extra : rebase_source : cdabb26be17b96a574ea8b2e8093e11abb1af430
This test passes both before and after the code changes in the following patch
in this series. However, both tests fail if we try to expand variables in
Servo_StyleSet_GetKeyframesForName.
MozReview-Commit-ID: LHOsK39WDLq
--HG--
extra : rebase_source : 225cfccbf439c35df943d0aed969825051354dec
GTK is definitely not thread-safe, and unless proven otherwise, I suspect the
other widgets aren't either.
Mutex the calls to get the system color stuff.
There are chances to make this more fine-grained moving the mutexes into the
specific widget code and when needed. That is more analysis work which I'm not
sure we should waste time on, since the chances on racing here seem quite
unlikely in practice (system colors are uncommon enough in content, I guess).
MozReview-Commit-ID: AOQQ2jtkgpx
I've verified with the profiler that we use the parallel traversal for
loading a foreground tab, but not for a tab opened with ctrl-click.
MozReview-Commit-ID: 2SiVDlLLyah
In the spec [1], computed value for column-gap is defined as
'as specified, with <length>s made absolute'.
[1] https://drafts.csswg.org/css-multicol-1/#column-gap
MozReview-Commit-ID: IO22V33z8pz
--HG--
extra : rebase_source : 63167965a0e89fd298df3a22a7c5e41ed34dd1e9
As for Gecko we can't interpolate between value with color and value without
color yet (bug 726550) so that transition does not happen for the cases.
As for Servo we can interpolate them but the results are wrong (bug 1390697).
MozReview-Commit-ID: 9T0ELBUP0pL
--HG--
extra : rebase_source : eb0ba751a2d0a1081a7883b7292da6f1d20e4caf
This field will be needed for servo side alias pref handling on the
next patch.
MozReview-Commit-ID: LyH2UwZEvMy
--HG--
extra : rebase_source : f3f921581a0cdcc9c63520b528bd0f1e12568958
The reason of the previous failure is we wrongly use default color for drop-shadow
functions that without specified color component. Since this has been resolved in
bug 1388220, we can enable these two tests now.
MozReview-Commit-ID: C3bPcLYQwvW
--HG--
extra : rebase_source : c39d1465658e358110bdccb32649a7fdea4c562c
Bindgen bitfield enums don't work as return values with the Linux 32-bit ABI at
the moment because they wrap the value in a struct.
This causes the Rust side to believe the caller will pass along space for the
struct return value, while C++ believes it's just an integer value.
MozReview-Commit-ID: LY6z7lEKgOp
--HG--
extra : rebase_source : deb9739bd100e2162e7c93d6d45d7029d7793355
Bindgen bitfield enums don't work as return values with the Linux 32-bit ABI at
the moment because they wrap the value in a struct.
This causes the Rust side to believe the caller will pass along space for the
struct return value, while C++ believes it's just an integer value.
MozReview-Commit-ID: 6qqVVfU8Mb2
--HG--
extra : rebase_source : 825985977307b50ae8a80ab182e54a3f7b95eafc