Commit Graph

84 Commits

Author SHA1 Message Date
Cameron McCormack
e95797966a Bug 1539159 - Prevent modification of UA style sheets. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D25661

--HG--
extra : moz-landing-system : lando
2019-04-29 05:34:06 +00:00
Emilio Cobos Álvarez
4c1252347e Bug 1533783 - Avoid crashing when calling insertRule("@import ...") on a detached sheet. r=heycam
This should unblock the fuzzers for now, though it's not the ideal solution.

It's the only reasonably easy solution to unblock them though, I think.

We should probably always keep track of the document a stylesheet was associated
with. We'll need that for constructible stylesheets anyway.

That requires some though on how to get the cycle-collection and such right,
though, and I wouldn't be able to write or land that ASAP.

Differential Revision: https://phabricator.services.mozilla.com/D23584

--HG--
extra : moz-landing-system : lando
2019-03-14 22:30:37 +00:00
Emilio Cobos Álvarez
d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Jonathan Watt
4c1b207664 Bug 1510116. Fix some unified build issues in layout code. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D13039

--HG--
extra : rebase_source : f0b6516484ed97ed52b92e04617f89e4ee8189ff
2018-11-12 22:20:52 +00:00
Sylvestre Ledru
aa37bde79b Bug 1489454 - Remove all trailing whitespaces (again) r=Ehsan
This also includes moving some files to the regular format.

Differential Revision: https://phabricator.services.mozilla.com/D5249

--HG--
extra : moz-landing-system : lando
2018-09-07 14:47:51 +00:00
Cameron McCormack
48fe6dbe69 Bug 1472065 - Initialize mSheet and mParentRule in css::Rule's constructor. r=xidorn
MozReview-Commit-ID: JI3cMiJaH3x

--HG--
extra : rebase_source : 3f45a63c8817df9550c5c638ad5b978421fa051c
2018-06-29 12:56:09 +10:00
Jeff Gilbert
5b753da289 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
c51ac692e3 Bug 1451289 - Part 12: Remove the intermediate macro and make CASE_RULE macro work with CSS*Rule instead r=emilio
MozReview-Commit-ID: GblL8jA23g4

--HG--
extra : rebase_source : b3c394c4ff9b933c6b0e1b153ce3dd96857f7490
2018-06-06 16:26:28 +02:00
Nazım Can Altınova
92dbfe6a5d Bug 1451289 - Part 11: Merge ServoFontFeatureValuesRule and CSSFontFeatureValuesRule r=emilio
MozReview-Commit-ID: 9aXGCHdkZwp

--HG--
extra : rebase_source : f354c915cd38168ba8be3cc11626bc3457b95aa4
2018-06-06 16:10:47 +02:00
Nazım Can Altınova
60852e7cad Bug 1451289 - Part 10: Merge ServoImportRule and CSSImportRule r=emilio
MozReview-Commit-ID: JvHNGoX4AUF

--HG--
extra : rebase_source : 3d30ee1278f035bd480c05ec0d8f35d4a31cf3c7
2018-06-06 15:31:33 +02:00
Nazım Can Altınova
57afced2fc Bug 1451289 - Part 9: Merge ServoDocumentRule and CSSMozDocumentRule r=emilio
MozReview-Commit-ID: BkMMXBWdsfz

--HG--
extra : rebase_source : e14b5907769f45bb109ed4db08b2b3b444eb9c9f
2018-06-05 17:16:51 +02:00
Nazım Can Altınova
96428ffd26 Bug 1451289 - Part 8: Merge ServoSupportsRule and CSSSupportsRule r=emilio
MozReview-Commit-ID: HX6NJNGJi0p

--HG--
extra : rebase_source : 02b885d8dc5eb7c0c31989ccc291973193220a59
2018-06-05 15:17:08 +02:00
Nazım Can Altınova
77fad93235 Bug 1451289 - Part 7: Merge ServoPageRule and CSSPageRule r=emilio
MozReview-Commit-ID: 5kqMLZWXFN5

--HG--
extra : rebase_source : 1ef8e31634b1be81c0df3c36bb56d13f7be9a9a2
2018-06-05 13:39:42 +02:00
Nazım Can Altınova
7849dbc1a0 Bug 1451289 - Part 6: Rename ServoCounterStyleRule to CSSCounterStyleRule r=emilio
MozReview-Commit-ID: 4T4FMJAp9WV

--HG--
rename : layout/style/ServoCounterStyleRule.cpp => layout/style/CSSCounterStyleRule.cpp
rename : layout/style/ServoCounterStyleRule.h => layout/style/CSSCounterStyleRule.h
extra : rebase_source : d007c517b93c7feef2a1afd0a6c9e77ff856dfc4
2018-06-05 02:07:25 +02:00
Nazım Can Altınova
be5df6059a Bug 1451289 - Part 5: Rename ServoFontFaceRule to CSSFontFaceRule r=emilio
MozReview-Commit-ID: 9S7aW0373NL

--HG--
rename : layout/style/ServoFontFaceRule.cpp => layout/style/CSSFontFaceRule.cpp
rename : layout/style/ServoFontFaceRule.h => layout/style/CSSFontFaceRule.h
extra : rebase_source : 60bafd052315c4a9764c6ccc408868b0b840d504
2018-06-05 01:55:11 +02:00
Nazım Can Altınova
425f4c7a17 Bug 1451289 - Part 4: Rename ServoStyleRule to CSSStyleRule r=emilio
MozReview-Commit-ID: L0IH55XNdyE

--HG--
rename : layout/style/ServoStyleRule.cpp => layout/style/CSSStyleRule.cpp
rename : layout/style/ServoStyleRule.h => layout/style/CSSStyleRule.h
extra : rebase_source : 6c27605c579daf76393edf0d4677e0bfa7c9693d
2018-06-04 15:35:50 +02:00
Nazım Can Altınova
772ef770c8 Bug 1451289 - Part 3: Merge ServoMediaRule and CSSMediaRule r=emilio
MozReview-Commit-ID: I7vpKO4LFt4

--HG--
extra : rebase_source : fc3ff2abee2cdc5006da741e717a618b2d3a94ef
2018-06-04 14:14:47 +02:00
Nazım Can Altınova
92aa0e63d1 Bug 1451289 - Part 2: Merge ServoKeyframesRule and CSSKeyframesRule r=emilio
MozReview-Commit-ID: FVwVgQZ0B6Q

--HG--
extra : rebase_source : b10e638097a27e581f9c8b95ae8e21ec7b7ac175
2018-06-04 12:09:11 +02:00
Nazım Can Altınova
6cdcd1d100 Bug 1451289 - Part 1: Merge ServoNamespaceRule and css::CSSNamespaceRule r=emilio
MozReview-Commit-ID: D5kU7f0hluL

--HG--
rename : layout/style/ServoNamespaceRule.cpp => layout/style/CSSNamespaceRule.cpp
extra : rebase_source : 9fd5cb862b6f606b056e935c75655415f40c9b64
2018-06-01 12:35:39 +02:00
Emilio Cobos Álvarez
c556ec7ad0 Bug 1457920: Remove ServoStyleSheet usage. r=xidorn
MozReview-Commit-ID: LIBkovuQ6MB
2018-05-02 04:13:26 +02:00
Emilio Cobos Álvarez
bf64474d79 Bug 1457920: Remove StyleSheet::AsServo. r=xidorn
MozReview-Commit-ID: IkkJvUFHykk
2018-05-02 04:13:21 +02: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
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
10b8b4cdb3 Bug 1437723: Preemptively fix unified bustage in layout/style by adding missing includes/namespaces/forward-decls. r=emilio
MozReview-Commit-ID: 8ljZkAqgT4N

--HG--
extra : rebase_source : bea400511aa6c6c10e76c8418d6dfc8df2b31d17
2018-02-12 16:53:44 -08:00
Cameron McCormack
55dcbea002 Bug 1427512 - Part 16: Remove nsIDOMCSSRule. r=xidorn,jryans,bz
MozReview-Commit-ID: GvVdW9w5Cc4
2018-01-11 16:17:56 +08:00
Xidorn Quan
783034684d Bug 1412145 - Drop more backpointers of CSSOM objects in dtor and unlink. r=bz
MozReview-Commit-ID: Ftg3WMBBNlO

--HG--
extra : rebase_source : 65834280c2ae9736861096172ca3f1d4e789c7a4
extra : source : ecbc4f545e09e969b8212e77d013a6b46b983763
2017-11-28 17:06:51 -06:00
Tiberius Oros
c1f0b328fa Backed out changeset 5043401c5447 (bug 1412145)for failing layout/style/test/test_any_dynamic.html r=backout on a CLOSED TREE
--HG--
extra : amend_source : 7779c8e296c0e8e1a9677608f67d28f171cdf654
2017-11-28 21:50:29 +02:00
Xidorn Quan
80a94641e2 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
486088166d Bug 1395322 Part 1: Enforce consistent use of nsIDOMCSSRule enums for Servo rule types. r=xidorn
MozReview-Commit-ID: DmfaYCe9QAY

--HG--
extra : rebase_source : 6a89bd910de053c4535bdfbdf7df551bf9c83472
2017-09-06 16:58:42 -07:00
Andrew McCreight
78807d8776 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

--HG--
extra : rebase_source : 5388c56b2f6905c6ef969150f0c5b77bf247624d
2017-08-29 16:02:48 -07:00
Nazım Can Altınova
ffc264cb6b 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

--HG--
extra : rebase_source : 6508027f88ff76784ed7d0e5420d6e174f116b38
2017-07-25 18:30:15 -07:00
Emilio Cobos Álvarez
aa8fc8476c 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
f16a67fdd4 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
c5cfde3395 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

--HG--
extra : rebase_source : 1097bae19d1d78d35985b77c1b2b7911a33e24ca
2017-06-27 11:10:47 -07:00
Brad Werth
18d0567044 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

--HG--
extra : rebase_source : e805e56c1f4b64082ebddb9a3d58327da6f2993f
2017-06-23 11:54:00 -07:00
Xidorn Quan
e3c82192cb 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

--HG--
extra : source : 0f2bc306d27b8ab22f1aa08aa9d44af0dba4694d
2017-06-19 15:45:43 +10:00
Xidorn Quan
7db62f5a16 Bug 1359217 part 5 - Fix reversed condition for inserting import rule. r=heycam
MozReview-Commit-ID: 7LU4l83lQ0t

--HG--
extra : source : d6d6c57ccdb0d0851e98f1ed79b4449b2ab7f6e9
2017-06-19 15:45:43 +10:00
Xidorn Quan
1269699516 Bug 1352968 part 8 - Construct @import rule object eagerly. r=heycam
MozReview-Commit-ID: HrgZnW21dHz

--HG--
extra : source : cedc65c6376373d54e623dc5cfadaa2de92909cb
2017-05-30 11:10:25 +10:00
Xidorn Quan
a17c79bc30 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

--HG--
extra : source : b9b78672249f390d56d71fa46dfa4b4cd49ef182
2017-05-30 11:10:25 +10:00
Xidorn Quan
4f83161da8 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

--HG--
extra : source : e45a434d0e9d2e2d8c628b17c2074b8f5de4b1ee
2017-05-30 11:10:25 +10:00
Xidorn Quan
65bfd17373 Bug 1352968 part 0 - Fix up before adding new files. r=heycam
MozReview-Commit-ID: HSrROKVr1dD

--HG--
extra : source : b22cf2f1834994ee89503dfa1b394ff2ec4b81bb
2017-05-30 11:10:25 +10:00
Brad Werth
47826ded85 Bug 1339629 Part 11: Call EnsureUniqueInner from ServoCSSRuleList when a StyleSheet is set. r=heycam
MozReview-Commit-ID: cvdITwpREk

--HG--
extra : rebase_source : 1b3745d2b10337a6a93fe700f4d18efd526ce03b
2017-05-18 15:48:48 -07:00
Xidorn Quan
153f90c76a Bug 1345697 part 3 - Implement CSSKeyframesRule and CSSKeyframeRule for stylo. r=heycam
MozReview-Commit-ID: AeU0BWaBfYe

--HG--
extra : source : 41460384de0116c90dcbcb2caf9f2763a62b5f40
2017-05-19 16:12:34 +10:00
Xidorn Quan
2723728359 Bug 1328319 part 2 - Add basic integration of @counter-style. r=heycam
MozReview-Commit-ID: 68CcxyWuINu

--HG--
extra : rebase_source : 2772c4ab938daf61e4a14fa952b24ecd4220de6b
2017-05-15 14:18:44 +10:00
Fernando Jimenez Moreno
9e66b37474 Bug 1350175 - Part 2: FFI changes to get line and column. r=xidorn
MozReview-Commit-ID: 87pVnoLmjPl

--HG--
extra : rebase_source : 1decaf9bc3aa75d64254aea8fdb08679c2557ca2
2017-04-25 16:24:39 +02:00
Fernando Jimenez Moreno
321888d66f Bug 1361994 - Part 3: Implement CSSOM support for @-moz-document. r=xidorn
MozReview-Commit-ID: HnFDV9h7SYW

--HG--
extra : rebase_source : 326d86d96c34102b31c855d9083316558dd2a3df
2017-05-11 14:11:16 +02:00
Fernando Jimenez Moreno
c98d07f3f9 Bug 1361994 - Part 2: Fix build error in ServoCSSRuleList. r=xidorn
MozReview-Commit-ID: wiowblsACq

--HG--
extra : rebase_source : f679ebfb45fea71b8ed1d2b5b0b09abe221b4736
2017-05-11 14:11:16 +02:00
Xidorn Quan
a82f5a5ae1 Bug 1355394 part 3 - Implement CSSOM support for @supports. r=heycam
MozReview-Commit-ID: AV1t6mIFF0J

--HG--
extra : rebase_source : b69ba50070290aef27dfe00866da8a59d3c8520f
2017-04-26 15:59:29 +08:00
Brad Werth
7c2789c8d2 Bug 1346256 Part 2: Define methods in ServoCSSRuleList to fill a hash of RawServoStyleRule to ServoStyleRule. r=heycam,xidorn
MozReview-Commit-ID: 4Swb9KwV0uO

--HG--
extra : rebase_source : 771ac051648526b2cef59acc8f700548762b73b6
2017-04-07 08:07:37 -07:00