Commit Graph

78 Commits

Author SHA1 Message Date
Cameron McCormack
bd44a6c7df Bug 1472065 - Initialize mSheet and mParentRule in css::Rule's constructor. r=xidorn
MozReview-Commit-ID: JI3cMiJaH3x
2018-06-29 12:56:09 +10:00
Jeff Gilbert
70a22b2878 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Nazım Can Altınova
5b3f99406c Bug 1451289 - Part 12: Remove the intermediate macro and make CASE_RULE macro work with CSS*Rule instead r=emilio
MozReview-Commit-ID: GblL8jA23g4
2018-06-06 16:26:28 +02:00
Nazım Can Altınova
3e0cd0498c Bug 1451289 - Part 11: Merge ServoFontFeatureValuesRule and CSSFontFeatureValuesRule r=emilio
MozReview-Commit-ID: 9aXGCHdkZwp
2018-06-06 16:10:47 +02:00
Nazım Can Altınova
3dfbc40cf8 Bug 1451289 - Part 10: Merge ServoImportRule and CSSImportRule r=emilio
MozReview-Commit-ID: JvHNGoX4AUF
2018-06-06 15:31:33 +02:00
Nazım Can Altınova
bf32c74970 Bug 1451289 - Part 9: Merge ServoDocumentRule and CSSMozDocumentRule r=emilio
MozReview-Commit-ID: BkMMXBWdsfz
2018-06-05 17:16:51 +02:00
Nazım Can Altınova
09ea267978 Bug 1451289 - Part 8: Merge ServoSupportsRule and CSSSupportsRule r=emilio
MozReview-Commit-ID: HX6NJNGJi0p
2018-06-05 15:17:08 +02:00
Nazım Can Altınova
7afde10da7 Bug 1451289 - Part 7: Merge ServoPageRule and CSSPageRule r=emilio
MozReview-Commit-ID: 5kqMLZWXFN5
2018-06-05 13:39:42 +02:00
Nazım Can Altınova
e045c26321 Bug 1451289 - Part 6: Rename ServoCounterStyleRule to CSSCounterStyleRule r=emilio
MozReview-Commit-ID: 4T4FMJAp9WV
2018-06-05 02:07:25 +02:00
Nazım Can Altınova
51f2b96946 Bug 1451289 - Part 5: Rename ServoFontFaceRule to CSSFontFaceRule r=emilio
MozReview-Commit-ID: 9S7aW0373NL
2018-06-05 01:55:11 +02:00
Nazım Can Altınova
fbf67eaa2c Bug 1451289 - Part 4: Rename ServoStyleRule to CSSStyleRule r=emilio
MozReview-Commit-ID: L0IH55XNdyE
2018-06-04 15:35:50 +02:00
Nazım Can Altınova
37223ed150 Bug 1451289 - Part 3: Merge ServoMediaRule and CSSMediaRule r=emilio
MozReview-Commit-ID: I7vpKO4LFt4
2018-06-04 14:14:47 +02:00
Nazım Can Altınova
1cb0536cec Bug 1451289 - Part 2: Merge ServoKeyframesRule and CSSKeyframesRule r=emilio
MozReview-Commit-ID: FVwVgQZ0B6Q
2018-06-04 12:09:11 +02:00
Nazım Can Altınova
bc1692d4e3 Bug 1451289 - Part 1: Merge ServoNamespaceRule and css::CSSNamespaceRule r=emilio
MozReview-Commit-ID: D5kU7f0hluL
2018-06-01 12:35:39 +02:00
Emilio Cobos Álvarez
be43ec910e Bug 1457920: Remove ServoStyleSheet usage. r=xidorn
MozReview-Commit-ID: LIBkovuQ6MB
2018-05-02 04:13:26 +02:00
Emilio Cobos Álvarez
c7e1c095c7 Bug 1457920: Remove StyleSheet::AsServo. r=xidorn
MozReview-Commit-ID: IkkJvUFHykk
2018-05-02 04:13:21 +02:00
Xidorn Quan
ec8553a3f8 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
2018-04-05 08:41:28 +10:00
Xidorn Quan
431f177e6f 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
2018-04-04 08:42:10 +10:00
Daniel Holbert
c243a70ecb Bug 1437723: Preemptively fix unified bustage in layout/style by adding missing includes/namespaces/forward-decls. r=emilio
MozReview-Commit-ID: 8ljZkAqgT4N
2018-02-12 16:53:44 -08:00
Cameron McCormack
90e1256cb0 Bug 1427512 - Part 16: Remove nsIDOMCSSRule. r=xidorn,jryans,bz
MozReview-Commit-ID: GvVdW9w5Cc4
2018-01-11 16:17:56 +08:00
Xidorn Quan
bf834867de Bug 1412145 - Drop more backpointers of CSSOM objects in dtor and unlink. r=bz
MozReview-Commit-ID: Ftg3WMBBNlO
2017-11-28 17:06:51 -06:00
Tiberius Oros
662da4c6c2 Backed out changeset 5043401c5447 (bug 1412145)for failing layout/style/test/test_any_dynamic.html r=backout on a CLOSED TREE 2017-11-28 21:50:29 +02:00
Xidorn Quan
5d76b68ffd Bug 1412145 - Drop more backpointers of CSSOM objects in dtor and unlink. r=bz
MozReview-Commit-ID: Ftg3WMBBNlO
2017-10-24 12:20:50 +11:00
Brad Werth
a9bb6f2955 Bug 1395322 Part 1: Enforce consistent use of nsIDOMCSSRule enums for Servo rule types. r=xidorn
MozReview-Commit-ID: DmfaYCe9QAY
2017-09-06 16:58:42 -07:00
Andrew McCreight
84ee98de3c Bug 1391005 - Eliminate NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED. r=peterv
Replace it with NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION, because it
has been the same for a while.

MozReview-Commit-ID: 5agRGFyUry1
2017-08-29 16:02:48 -07:00
Nazım Can Altınova
252d311438 Bug 1365900 - Create ServoFontFeatureValuesRule and bind servo data r=xidorn
Add ServoFontFeatureValuesRule for CSSOM representation of
@font-feature-values rule and wire up with bindings.

MozReview-Commit-ID: B4Lpj43bvKX
2017-07-25 18:30:15 -07:00
Emilio Cobos Álvarez
e310a60d66 Bug 1372041: Refactor @import so it also respects the stylesheet's media properly. r=heycam
MozReview-Commit-ID: EBmd8nG877t
2017-07-02 17:19:08 +02:00
Emilio Cobos Álvarez
6941d33a8e Bug 1372041: Refactor a bunch of stuff so link rel="media" is honored. r=heycam
This still leaves one annoying refactoring of @import so we also fix it for
them.

MozReview-Commit-ID: 4s0WExDEH75
2017-07-02 17:19:07 +02:00
Brad Werth
c80cd85f53 Bug 1371453 Part 2: Update ConstructImportRule callsites and other affected code to tolerate ServoImportRules with no attached raw sheet. r=xidorn
MozReview-Commit-ID: HOLPcRvjnq1
2017-06-27 11:10:47 -07:00
Brad Werth
4eaf316f47 Bug 1371453 Part 1: Relax the logic ServoCSSRuleList::InsertRule to fail soft when processing an @import rule with a malformed URL. r=xidorn
MozReview-Commit-ID: Ejt3CzETGPU
2017-06-23 11:54:00 -07:00
Xidorn Quan
d7fcde119b Bug 1359217 part 6 - Add ServoStyleRuleMap to handle style rule mapping. r=heycam
This commit adds class ServoStyleRuleMap which caches the mapping from
raw Servo style rule to Gecko's wrapper object.

It is a per-document object, and is added as an observer of document
when constructed, so that it updates data inside when possible.

For safety consideration, this change also makes ServoStyleRule support
weak pointer, and use weak pointer inside ServoStyleRuleMap.

MozReview-Commit-ID: YxBnZ88tjf
2017-06-19 15:45:43 +10:00
Xidorn Quan
303b59f32e Bug 1359217 part 5 - Fix reversed condition for inserting import rule. r=heycam
MozReview-Commit-ID: 7LU4l83lQ0t
2017-06-19 15:45:43 +10:00
Xidorn Quan
b134804bb8 Bug 1352968 part 8 - Construct @import rule object eagerly. r=heycam
MozReview-Commit-ID: HrgZnW21dHz
2017-05-30 11:10:25 +10:00
Xidorn Quan
d8327da769 Bug 1352968 part 5 - Add a param to ctor of ServoCSSRuleList for top level list. r=heycam
@import rules can only exist in top level rule lists, and we need the
stylesheet to construct the import rules.

MozReview-Commit-ID: APCyGW8re8f
2017-05-30 11:10:25 +10:00
Xidorn Quan
a675c144ab Bug 1352968 part 3 - Add basic CSSOM support for @import rule. r=heycam
Initialization of mChildSheet will be implemented in a later patch.

MozReview-Commit-ID: 3SX3GJEhpBQ
2017-05-30 11:10:25 +10:00
Xidorn Quan
9cd84daeea Bug 1352968 part 0 - Fix up before adding new files. r=heycam
MozReview-Commit-ID: HSrROKVr1dD
2017-05-30 11:10:25 +10:00
Brad Werth
a996558825 Bug 1339629 Part 11: Call EnsureUniqueInner from ServoCSSRuleList when a StyleSheet is set. r=heycam
MozReview-Commit-ID: cvdITwpREk
2017-05-18 15:48:48 -07:00
Xidorn Quan
27f1a7dbf9 Bug 1345697 part 3 - Implement CSSKeyframesRule and CSSKeyframeRule for stylo. r=heycam
MozReview-Commit-ID: AeU0BWaBfYe
2017-05-19 16:12:34 +10:00
Xidorn Quan
7e831c2741 Bug 1328319 part 2 - Add basic integration of @counter-style. r=heycam
MozReview-Commit-ID: 68CcxyWuINu
2017-05-15 14:18:44 +10:00
Fernando Jimenez Moreno
0374c674f9 Bug 1350175 - Part 2: FFI changes to get line and column. r=xidorn
MozReview-Commit-ID: 87pVnoLmjPl
2017-04-25 16:24:39 +02:00
Fernando Jimenez Moreno
184d446ac8 Bug 1361994 - Part 3: Implement CSSOM support for @-moz-document. r=xidorn
MozReview-Commit-ID: HnFDV9h7SYW
2017-05-11 14:11:16 +02:00
Fernando Jimenez Moreno
fd64e4dce6 Bug 1361994 - Part 2: Fix build error in ServoCSSRuleList. r=xidorn
MozReview-Commit-ID: wiowblsACq
2017-05-11 14:11:16 +02:00
Xidorn Quan
44c00ddff8 Bug 1355394 part 3 - Implement CSSOM support for @supports. r=heycam
MozReview-Commit-ID: AV1t6mIFF0J
2017-04-26 15:59:29 +08:00
Brad Werth
10293e6ca2 Bug 1346256 Part 2: Define methods in ServoCSSRuleList to fill a hash of RawServoStyleRule to ServoStyleRule. r=heycam,xidorn
MozReview-Commit-ID: 4Swb9KwV0uO
2017-04-07 08:07:37 -07:00
J. Ryan Stinnett
2f336ddffd Bug 1345206 - Wire up bindings for @page rule. r=xidorn
Connect the Servo types and functions for working with @page rules to Gecko.

This also adjusts the Stylo test expectations to match the current state with
@page support.

MozReview-Commit-ID: 513d05m51wK
2017-03-30 21:25:22 -05:00
Xidorn Quan
bc7331dfe8 Bug 1352763 part 4 - Pass CSS loader to Servo for insertRule. r=emilio
MozReview-Commit-ID: 6yalz8D8BWc
2017-04-03 20:04:32 +10:00
Xidorn Quan
bf22378ea2 Bug 1352763 part 3 - Have ServoStyleSheet also implement nsICSSLoaderObserver. r=heycam
MozReview-Commit-ID: 1Z6jAmQ9CY6
2017-04-03 19:55:06 +10:00
Xidorn Quan
277ab4b1f9 Bug 1345696 part 6 - Fix cycle collection for font-face rule. r=heycam,mccr8
Having Servo's FontFaceRule owning Gecko's nsCSSFontFaceRule object opens an
untracked edge, because we generally don't track the reference through Servo
objects, so there is a chance that nsCSSFontFaceRule can form a undroppable
reference cycle.

This patch adds a workaround that we track @font-face rule twice in CSS rule
list. This is not perfect, but the idea is that, if someone wants to put some
reference on the @font-face rule, the rule itself and its parent list should
have been constructed in the CSSOM tree. If they are not there, we are
probably safe from cycle reference.

For @font-face rule, that assumption isn't strictly true. Script can still
get a font-face rule via layout inspector's nsIDOMFontFace::rule. If some
script puts an object which references the stylesheet of the rule or any of
its parent rule / rule list into font-face rule's expando, we would leak
again... But as far as that is an internal interface, we are probably safe?

MozReview-Commit-ID: DDMJh3mxDCH
2017-03-28 16:11:44 +11:00
Xidorn Quan
1fafb4f93f Bug 1345696 part 5 - Support CSSOM access to @font-face rules. r=manishearth
MozReview-Commit-ID: Gm4Bm0zgsh3
2017-03-27 14:49:26 +11:00
Xidorn Quan
f184739faf Bug 1345698 part 5 - Add support of CSSNamespaceRule for stylo. r=heycam
MozReview-Commit-ID: Kl4Wd3eh9ll
2017-03-14 18:51:59 +11:00