Commit Graph

13554 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
b6bb80b714 Bug 1452080: Rename ComputedStyle::PresContext to PresContextForFrame. r=xidorn
And make nsIFrame its only caller, modulo a safety assertion.

The safety assertion will be removed at the same time as the pres context
member, since the only purpose of it is to ensure we don't keep a pres context
reference for too long.

MozReview-Commit-ID: CD5zOHVO9ub
2018-04-09 09:57:57 +02:00
Emilio Cobos Álvarez
2a427429ff Bug 1452080: Remove ComputedStyle::PresContext usage from layout and canvas code. r=xidorn
Couldn't find an easy way of splitting these up :(

MozReview-Commit-ID: 2kTZ5McREUT
2018-04-09 09:57:55 +02:00
Emilio Cobos Álvarez
e128bf7b1a Bug 1447827: Remove ServoRestyleManager. r=xidorn
MozReview-Commit-ID: CFafQsb4rQn
2018-04-07 15:50:06 +02:00
Emilio Cobos Álvarez
b508e66696 Bug 1447827: Move members from ServoRestyleManager to RestyleManager. r=xidorn
This leaves ServoRestyleManager as just a typedef.

MozReview-Commit-ID: 5wfTkiDc2Nr
2018-04-07 15:40:00 +02:00
Emilio Cobos Álvarez
c0f2f96f66 Bug 1303605: Remove the undisplayed maps. r=bz,mats
This is mostly code removal, changing GetDisplayContentsStyle(..) checks by an
FFI call to Servo.

The tricky parts are:

 * MaybeCreateLazily, which I fixed to avoid setting bits under display: none
   stuff. This was a pre-existing problem, which was wallpapered by the
   sc->IsInDisplayNoneSubtree() check, which effectively made the whole
   assertion useless (see bug 1381017 for the only crashtest that hit this
   though).

 * ContentRemoved, where we can no longer know for sure whether the element is
   actually display: contents if we're removing it as a response to a style
   change. See the comment there. That kinda sucks, but that case is relatively
   weird, and it's better than adding tons of complexity to handle that.

 * GetParentComputedStyle, which also has a comment there. Also, this function
   has only one caller now, so we should maybe try to remove it.

The different assertions after DestroyFramesForAndRestyle are changed for a
single assertion in the function itself, and the node bit used as an
optimization to avoid hashtable lookups is taken back.

MozReview-Commit-ID: AZm822QnhF9
2018-04-07 15:21:56 +02:00
Brindusan Cristian
74a6eccce8 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-04-07 12:59:20 +03:00
Brindusan Cristian
c5ba0f0766 Merge inbound to mozilla-central. a=merge 2018-04-07 12:57:02 +03:00
Jonathan Watt
f8cb572b4e Bug 1452169 - Remove nsNthIndexCache.h. r=dholbert 2018-04-06 19:10:43 +01:00
Jonathan Watt
81ccf0c0e4 Bug 1452040 - Get rid of NS_STYLE_FONT_WEIGHT_NORMAL and NS_STYLE_FONT_WEIGHT_BOLD. r=emilio 2018-04-06 14:53:25 +01:00
Noemi Erli
eb61878455 Merge inbound to mozilla-central. a=merge 2018-04-07 00:55:15 +03:00
Bobby Holley
5c354190dc Bug 1451421 - Stop using Gecko namespace ids in servo. r=xidorn
MozReview-Commit-ID: 2532dHCGPXW
2018-04-06 15:30:58 -07:00
Cameron McCormack
80e0b61efb Bug 1079292 - Re-enable test 18 of test_font_loading_api.html. r=xidorn
MozReview-Commit-ID: IPcebw8CC4i

--HG--
extra : rebase_source : a80cd84bfc5c736d464d10eb9fc33d54b20f9883
2018-04-05 18:31:47 +10:00
Andreea Pavel
eed7d2803f Merge mozilla-central to autoland. a=merge on a CLOSED TREE 2018-04-06 17:54:45 +03:00
Emilio Cobos Álvarez
f1145db772 Bug 1339656: [css-align] Upstream our shorthand serialization tests. r=mats
MozReview-Commit-ID: 2EYnkBavecs
2018-04-06 14:27:40 +02:00
Emilio Cobos Álvarez
2dbc4842b7 Bug 1339656: Make the shorthand serialization test account for 'unsafe' serialization. r=mats
This should make the test upstreamable.

MozReview-Commit-ID: DeJt5HzMJHE
2018-04-06 14:27:31 +02:00
Emilio Cobos Álvarez
fff326ce5c Bug 1339656: [css-align] Don't restrict shorthand parsing now that's not ambiguous. r=mats
MozReview-Commit-ID: AnYBt6zwnPl
2018-04-06 14:27:12 +02:00
Jonathan Watt
af9d95013e Bug 1452057 - Remove remaining AsGecko() cruft. r=emilio 2018-04-04 08:53:06 +01:00
Jonathan Watt
3a5bebcfbf Bug 1452052 - Remove nsCSSRules.h. r=emilio 2018-04-03 12:47:20 +01:00
Boris Zbarsky
a0b6e32bba Bug 1449631 part 12. Remove the Nullable smuggling from nsIDOMEventTarget. r=smaug
MozReview-Commit-ID: 73qhRSCpr3S
2018-04-05 13:42:42 -04:00
Boris Zbarsky
4292bca4ee Bug 1449631 part 6. Remove nsIDOMEventTarget::DispatchEvent. r=smaug
MozReview-Commit-ID: 8YMgmMwZkAL
2018-04-05 13:42:41 -04:00
Noemi Erli
d0413b711d Merge inbound to mozilla-central. a=merge 2018-04-05 18:15:37 +03:00
Boris Zbarsky
71517dfd71 Bug 1451199. Fix the handling of .onchange in MediaQueryList to match the handling of addEventListener('change'). r=emilio
MozReview-Commit-ID: 4YvJ0m0BOnQ
2018-04-05 08:34:46 -04:00
Noemi Erli
ff466e94c1 Merge inbound to mozilla-central. a=merge 2018-04-05 13:02:11 +03:00
Ben Kelly
d44ca0b854 Bug 1450358 P4 Add a MediaQueryList event listener leak test. r=baku 2018-04-04 11:25:43 -07:00
Xidorn Quan
d7f3530f07 Bug 1449068 part 2 - Use Servo data to back @counter-style rule. r=emilio
This patch basically does:
* Add descriptor setters and generation count to CounterStyleRule in
  Servo. (This code is mostly based on the old code inside
  nsCSSCounterStyleRule for handling mutation.)
* Use RawServoCounterStyleRule in CounterStyleManager.
* Add ServoCounterStyleRule and remove nsCSSCounterStyleRule.

Test change:
* "fixed" was parsed as and thus serialized to "fixed 1", but Servo
  doesn't do so. It preserves whether the number presents. Either way
  is probably fine.

MozReview-Commit-ID: EtKTeu32isi

--HG--
extra : rebase_source : ec44f01c581003ce4b6ef69435a05de7f3da5469
2018-04-05 08:41:28 +10:00
Xidorn Quan
0be3ea5159 Bug 1449068 part 1 - Wrap content of ServoStyleSetInlines.h in mozilla namespace. r=emilio
MozReview-Commit-ID: HiIZdZwdTeZ

--HG--
extra : rebase_source : b731a0b5dd7cad68afcd6caf944e62fbf02a0b01
2018-04-05 08:41:28 +10:00
Margareta Eliza Balazs
210797c4c1 Merge inbound to mozilla-central. a=merge 2018-04-04 12:43:55 +03:00
Emilio Cobos Álvarez
f004e39cd6 Bug 1441136: Add a fast way to enumerate ShadowRoots in a document. r=smaug
MozReview-Commit-ID: 7QffP56jsyk
2018-04-04 07:40:34 +02:00
Ciure Andrei
5ffac2bcd3 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2018-04-04 00:58:50 +03:00
Ciure Andrei
7208a2fee8 Merge inbound to mozilla-central. a=merge 2018-04-04 00:54:16 +03:00
Xidorn Quan
67fd806b66 Bug 1449087 part 2 - Use Servo data to back @font-face rule. r=emilio
This patch does the following things:
* Create a new class ServoFontFaceRule for CSSOM of @font-face rule
  which mostly follows how nsCSSFontFaceRule was implemented.
* Remove the old nsCSSFontFaceRule and binding code to create it.
* Have FontFace backed by Servo data via making mRule and mDescriptors
  of the class hold RawServoFontFaceRule like ServoFontFaceRule.

To keep this patch small, it effectively just delays the conversion
from Servo data to nsCSSValue from parsing to using. This may cause
worse performance if the font set is flushed repeatedly. Supposing we
don't flush font set very frequently, it may not be a big deal.

We may still want to remove the intermediate nsCSSValue conversion at
some point, and have everything converted to their final form directly
when used, but that can happen in followups.

There are some unfortunate bits from this change:
* We lose style sheet for logging in FontFaceSet. This is probably not
  all that worse, because we wouldn't have that before either if the
  page doesn't use CSSOM to visit it. But we should figure out some
  approach to fix it anyway.
* InspectorFontFace no longer shares the same rule object as CSSOM.
  This isn't really a problem if the @font-face rule isn't very mutable.
  Unless we want to make the rule returned from InspectorFontFace to be
  mutable (i.e. via inspector), not using the same object probably isn't
  too bad.

This patch switches the code we use to serialize stuff in FontFace and
CSSFontFaceRule, which leads to some failures in tests. Specifically,
the expected changes including:
* Value of font-family now can be serialized to identifier sequence like
  font-family property. The old code always serializes it to string,
  but it doesn't seem to have different requirement than the property.
  Blink can serialize to identifier as well.
* Family name inside local() is also changed to use the same way as
  family names elsewhere (i.e. can be identifier sequence). Blink has
  the same behavior as the old code, but I don't think it's a big deal.
* The order of descriptors serialized gets changed. I don't think it
  matters at all.
* Empty string as font-family via using string syntax is no longer
  considered invalid for FontFace. I don't find it is mentioned anywhere
  that it should be specifically treated invalid.


MozReview-Commit-ID: 32Fk3Fi9uTs

--HG--
extra : rebase_source : 6221ec8fc56de357b06dd27e770fb175348a2f77
2018-04-04 08:42:10 +10:00
Daniel Holbert
6ef9cafcf6 Bug 1450390 part 1: Extend mochitest to cover transitions to/from flex-basis "content" keyword. r=emilio
MozReview-Commit-ID: ABZn5GgH9Kr

--HG--
extra : rebase_source : 17e83cd4434773d2ed97ad2e4c2cb03830f2a24c
2018-04-03 15:09:43 -07:00
Ionut Goldan
c7032b6211 Bug 1436018 - Disable Stylo microbenchmark on Windows r=jmaher
MozReview-Commit-ID: 2AJ0lUxMMZb

--HG--
extra : rebase_source : a503d2763c23487a683da8afe926f61b6fb7523b
2018-04-02 15:07:20 +03:00
arthur.iakab
b310d9523e Merge inbound to mozilla-central. a=merge 2018-04-03 12:31:23 +03:00
Nicholas Nethercote
94289ab246 Bug 1448225 - Convert StylePrefs to StaticPrefs. r=emilio
The new StaticPrefs machinery means that StylePrefs can be removed.

Note that this approach mirrors all static prefs into Rust, but I have only
updated structs.rs for the prefs that Stylo uses.

On a CLOSED TREE, since a sheriff closed the tree while I was about to land this
via autoland.

MozReview-Commit-ID: G1SY0987WJ7
2018-04-03 09:06:20 +02:00
Cameron McCormack
c14a8ffa84 Bug 1450859 - Remove layout.css.expensive-style-struct-assertions.enabled pref. r=emilio
With the old style system removed, this pref has no effect.

--HG--
extra : rebase_source : ddc8462a0044225a46522f53f4bbb131627fb7f1
2018-04-03 15:58:32 +10:00
Nicholas Nethercote
9ea93c4f7b Bug 1449395 - Remove nsStaticAtomSetup. r=froydnj
Each nsStaticAtomSetup contains a pointer to a static atom, and also a pointer
to the canonical pointer to that static atom. Which is pretty weird! The
notable thing thing about it is that these structs are in an array, and that
gives us the only way to iterate over all static atoms in a single class, for
registration and lookups.

But thanks to various other recent changes to the implementation of static
atoms, we can now put the static atoms themselves into an array, which can be
iterated over. So this patch does that. With that done, nsStaticAtomSetup is no
longer necessary.

According to the `size` utility, on Linux64 this reduces the size of libxul.so
by the following amounts:

> text:  62008 bytes
> data:  20992 bytes
> bss:   21040 bytes
> total: 104040 bytes

- The bss reduction is one word per atom, because the canonical static atom
  pointers (e.g. nsGkAtoms::foo) have moved from .bss to .data, because they're
  now initialized at compile time instead of runtime.

- The data reduction is one word per atom, because we remove two words per atom
  for the nsStaticAtomSetup removal, but gain one word per atom from the
  previous bullet point.

- I'm not sure about the text reduction. It's three words per atom. Maybe
  because there is one less relocation per atom?

Other notable things in the patch:

- nsICSSAnonBoxPseudo and nsICSSPseudoElement now inherit from nsStaticAtom,
  not nsAtom, because that's more precise.

- Each static atoms array now has an enum associated with it, which is used in
  various ways.

- In the big comment about the macros at the top of nsStaticAtom.h, the pre-
  and post-expansion forms are now shown interleaved. The interleaving reduces
  duplication and makes the comment much easier to read and maintain. The
  comment also has an introduction that explains the constraints and goals of
  the implementation.

- The SUBCLASS macro variations are gone. There are few enough users of these
  macros now that always passing the atom type has become simpler.

MozReview-Commit-ID: 1GmfKidLjaU

--HG--
extra : rebase_source : 2352590101fc6693ba388f885ca4714a42963943
2018-03-29 11:48:18 +11:00
Nicholas Nethercote
4b941e22d0 Bug 1449395 - Remove unnecessary nsStaticAtom.h includes. r=froydnj
For nsCSSAnonBoxes.cpp, nsCSSPseudoElements.cpp, nsDirectoryService.cpp, the
corresponding .h file includes nsStaticAtom.h. For the other files in this
patch, nsStaticAtom.h is not needed at all.

MozReview-Commit-ID: IpMmbXwZHhu

--HG--
extra : rebase_source : 46d0a6b40a41ee233adad7c205cf907fa27de34a
2018-03-29 09:08:54 +11:00
Ryan VanderMeulen
e5ec40f40c Backed out 11 changesets (bug 1404222) for static analysis failures on a CLOSED TREE.
Backed out changeset a6a99136300c (bug 1404222)
Backed out changeset 7183b8104399 (bug 1404222)
Backed out changeset a1e4294c1c59 (bug 1404222)
Backed out changeset b79d6e8318db (bug 1404222)
Backed out changeset 0450620fdabd (bug 1404222)
Backed out changeset 026c74a92d04 (bug 1404222)
Backed out changeset 50ac4167f702 (bug 1404222)
Backed out changeset 59038f2db68a (bug 1404222)
Backed out changeset f6b9096da915 (bug 1404222)
Backed out changeset 4e0baffdd79b (bug 1404222)
Backed out changeset 57eeb849ab88 (bug 1404222)
2018-04-02 17:57:27 -04:00
Daniel Holbert
2f5d7919b0 Bug 1404222 followup: add 'explicit' keyword to fix static analysis build error. (no review, trivial bustagefix) 2018-04-02 14:08:33 -07:00
Ben Kelly
9d0c860356 Bug 1450271 Make MediaQueryList bind to its document's inner window. r=baku 2018-04-02 08:35:52 -07:00
Daniel Holbert
81c1d19a77 Bug 1105111 part 2: Add support for 'flex-basis:content' in the style system (gecko / getComputedStyle side). r=mats
MozReview-Commit-ID: E0crFCy7Jfk
2018-04-02 04:30:37 +02:00
Mats Palmgren
4fd8ffd48e Bug 1398537 part 2 - [css-multicol] Implement percentages for 'column-gap' (Gecko part). r=dholbert 2018-04-02 01:56:19 +02:00
Brad Werth
d0b51c156c Bug 1404222 Part 7: Turn off a 'todo' in a mochitest. r=dholbert
MozReview-Commit-ID: 18bkqA6rxoZ
2018-02-07 14:59:43 -08:00
Brad Werth
a4dd74b531 Bug 1404222 Part 7: Turn off a 'todo' in a mochitest. r=dholbert
MozReview-Commit-ID: 18bkqA6rxoZ
2018-02-07 14:59:43 -08:00
Xidorn Quan
12ad13c3fd Bug 1451216 - Remove Rule::Clone method. r=emilio
MozReview-Commit-ID: 6Re8DENmdUT

--HG--
extra : rebase_source : a39ad55f43a8cddccef94e4f0add2c77eb57c245
2018-04-05 18:18:17 +10:00
Xidorn Quan
3356a5f95f Bug 1448763 part 9 - Remove nsCSSRect. r=emilio
MozReview-Commit-ID: BOsjszpdKwt

--HG--
extra : rebase_source : 7061396323ec4e851517a7be2027447e16e8e77f
2018-04-05 18:27:33 +10:00
Xidorn Quan
8c5331160e Bug 1448763 part 8 - Remove CSSCalc.h. r=emilio
MozReview-Commit-ID: eecZRhdxH8

--HG--
extra : rebase_source : a25a8d4de1916a92ff736303848daf259a9b265c
2018-04-05 18:27:33 +10:00
Xidorn Quan
3248eb765c Bug 1448763 part 7 - Remove nsCSSCornerSizes. r=emilio
MozReview-Commit-ID: jjSjoskIB8

--HG--
extra : rebase_source : a6d939852f06e595ad5e2c4ca7115872d30eca8e
2018-04-05 18:27:33 +10:00
Xidorn Quan
7d3cec4977 Bug 1448763 part 6 - Remove nsCSSValueTriplet. r=emilio
MozReview-Commit-ID: 29GtK1gtreU

--HG--
extra : rebase_source : 9b6b5c0a729228112260d3ae51db1207d003111b
2018-04-05 18:27:33 +10:00