Commit graph

32 commits

Author SHA1 Message Date
Vincent Ricard
66223f7596 Implements StyleSheet.media 2020-10-16 10:55:00 +02:00
Vincent Ricard
e7199c029f Implements Stylesheet.ownerNode 2020-10-10 21:21:00 +02:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Fernando Jiménez Moreno
d77b9c6775 Add invalidate_stylesheets to StyleSheetsListOwner trait 2019-04-26 11:31:17 +02:00
Fernando Jiménez Moreno
519cc2c317 Invalidate and flush shadow tree stylesheets where needed 2019-04-26 10:17:47 +02:00
sbansal3096
13eebbfe56 Fix insertRule crash by exposing getter on stylesheet's owner 2019-03-22 15:45:18 +05:30
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
Simon Sapin
aa15dc269f Remove use of unstable box syntax.
http://www.robohornet.org gives a score of 101.36 on master,
and 102.68 with this PR. The latter is slightly better,
but probably within noise level.
So it looks like this PR does not affect DOM performance.

This is expected since `Box::new` is defined as:

```rust
impl<T> Box<T> {
    #[inline(always)]
    pub fn new(x: T) -> Box<T> {
        box x
    }
}
```

With inlining, it should compile to the same as box syntax.
2017-10-16 17:16:20 +02:00
Anthony Ramine
f87c2a8d76 Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
2017-09-26 09:49:10 +02:00
Anthony Ramine
c52fd0a780 Rename MutNullableJS<T> to MutNullableDom<T> 2017-09-26 09:49:02 +02:00
Anthony Ramine
7be32fb237 Rename JS<T> to Dom<T> 2017-09-26 09:48:55 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
Michael Partheil
b07ebbae6b Replace all uses of the style::stylearc alias with servo_arc.
The alias is left there temporarilly and will be removed completely in a later commit where
also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still
use the old alias).
2017-07-19 09:29:05 +02:00
Emilio Cobos Álvarez
1263075776
stylo: Fix StyleSheetInner/Stylesheet mapping
The key of this patch is the split between Stylesheet and StylesheetContents.

Gecko will use StylesheetContents, which maps to a ServoStyleSheetInner.
2017-07-02 15:49:40 +02:00
Bobby Holley
7b0679848b Fix up script and layout. 2017-05-02 17:35:45 -07:00
Simon Sapin
f35b4e27b3 Replace RwLock<CssRules> with Locked<CssRules> 2017-03-19 22:30:35 +01:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Nazım Can Altınova
fd950a7309 Support origins in CSSOM stylesheets 2017-01-20 22:00:49 +03:00
Anthony Ramine
1327ebd52f Remove HeapGCValue
It could be used to have mutable JSVal fields without GC barriers.
With the removal of that trait, MutHeap and MutNullableHeap can respectively
be replaced by MutJS and MutNullableJS.
2016-12-12 10:47:54 -10:00
Corey Farwell
449f6337d4 Rename Reflectable to DomObject.
Fixes https://github.com/servo/servo/issues/8473.
2016-12-08 08:50:35 -10:00
Simon Sapin
70b250fe2a Use stylesheet’s base URL and ns prefixes in CSSOM insert/appendRule. 2016-11-28 18:01:02 +01:00
Simon Sapin
f1d49d3773 Make CSSRule always keep a pointer to its parent stylesheet
even when the parentStylesheet IDL attribute returns null.
2016-11-28 16:50:38 +01:00
Cameron McCormack
64ff6dc103 Implement StyleSheet.disabled. 2016-11-25 11:27:51 +08:00
Manish Goregaokar
95cbf1a885 Address review comments 2016-11-23 10:15:58 -08:00
Manish Goregaokar
53c99662bc Make parent stylesheet optional for CSSRules 2016-11-23 09:32:40 -08:00
Manish Goregaokar
52a3a71be3 Add support for keyframe-backed CSSRules, CSSKeyframesRule.cssRules and CSSKeyframeRule 2016-11-23 09:32:39 -08:00
Manish Goregaokar
2793d5f0a9 Handle parser state in CSSOM insert_rule 2016-11-23 09:31:29 -08:00
Manish Goregaokar
1d20d75cb2 Add insertRule() and deleteRule() on CSSStyleSheet 2016-11-23 09:30:29 -08:00
Manish Goregaokar
177d6fa4ee Support basic immutable CSSOM 2016-11-15 06:56:18 -08:00