Commit graph

123 commits

Author SHA1 Message Date
komuhangi
89a4820519
Fixed some clippy warnings in components (#32025)
* Fixed some clippy warnings in components

* Updated the simplification of bolean expressions in componets/script/dom/range.rs
2024-04-10 07:50:01 +00:00
komuhangi
df457c43c8
Fixed some clippy warning by adding default implementations (#31989)
* Fixed some clippy warning by adding default implementations

* Updated PR that adds default implementation of structs

* Clean up and extend `Default` implementations

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-04 09:33:30 +00:00
Rosemary Ajayi
00c4d798c9
clippy: Fix a few problems in components/script/dom (#31955)
* fixed various clippy warnings

* fixed various clippy warnings

* fixed various clippy warnings
2024-03-31 23:15:13 +00:00
Aarya Khandelwal
bd39e03eeb
changed match to 'matches!' (#31850) 2024-03-25 11:28:12 +00:00
Oluwatobi Sofela
3c05b58221
clippy: Fix explicit_auto_deref warnings in components/script (#31837)
* clippy: Fix explicit auto-deref warnings

* clippy: Fix explicit auto-deref warnings

* refactor: Tidy up code

* refactor: Fix method not found errors
2024-03-23 11:29:20 +00:00
cathiechen
cb275e086c
Implement StaticRange (#31809)
* Add DOM interface for AbstractRange

* Add DOM interface for StaticRange

* Update WPT tests for StaticRange-constructor.html

* Fix formatting

* Add AbstractRange & StaticRange in interfaces.html

* rebased the code and fixed the failures

Signed-off-by: Cathie Chen <cathiechen@igalia.com>

* update the expected result in idlharness.window.js.ini file

* Addressed the code review comments

* updae the test result of legacy layout

---------

Signed-off-by: Cathie Chen <cathiechen@igalia.com>
Co-authored-by: Nipun Garg <nipung271@gmail.com>
2024-03-22 15:02:01 +00:00
Oluwatobi Sofela
02a0cdd6fa
clippy: Fix dereferenced warnings (#31770) 2024-03-20 08:07:22 +00:00
Samson
604979e367
Replace script_plugins with a clippy like rustc driver (named crown) (#30508)
* Remove script_plugins

* Use crown instead of script_plugins

* crown_is_not_used

* Use crown in command base

* bootstrap crown

* tidy happy

* disable sccache

* Bring crown in tree

* Install crown from tree

* fix windows ci

* fix warning

* fix mac

libscript_plugins.dylib is not available anymore

* Update components/script/lib.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update for nightly-2023-03-18

Mostly just based off https://github.com/servo/servo/pull/30630

* Always install crown

it's slow only when there is new version

* Run crown test with `mach test-unit`

* Small fixups; better trace_in_no_trace tests

* Better doc

* crown in config.toml

* Fix tidy for real

* no sccache on rustc_wrapper

* document rustc overrides

* fixup of compiletest

* Make a few minor comment adjustments

* Fix a typo in python/servo/platform/base.py

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>

* Proper test types

* Ignore tidy on crown/tests

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-12-01 15:50:52 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Samson
711dbbd4af
remove extern crate (#30311)
* remove extern crate

* Update components/script_plugins/lib.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-09-08 12:11:31 +00:00
Josh Matthews
cc07e27864 Rename reflect_dom_object2. 2023-05-31 23:03:32 -04:00
Josh Matthews
dbff26bce0 Support arbitrary protos when wrapping DOM objects with constructors. 2023-05-28 23:23:12 -04:00
Utsav Oza
962e620529 Do not panic on navigating across documents 2020-07-30 16:34:30 +05:30
Anthony Ramine
036f123c4e Implement concept of dirty root 2020-05-19 16:26:36 +02:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Patrick Shaughnessy
5ef3358951 Selection interface working for synthetic operations 2020-02-13 20:09:27 -05:00
Kunal Mohan
f7db4b7f80
Modify script to prevent further violations of snake_case 2020-01-18 14:22:15 +05:30
Patrick Shaughnessy
67e9fc8c0a Attr is a Node, with consequences for many Node methods 2019-12-23 19:10:16 -05:00
Simon Sapin
bea73951db Use #![register_tool] instead of #![register_attr]
CC https://github.com/rust-lang/rust/issues/66079
2019-11-15 17:24:42 +01:00
Simon Sapin
c38c964f1b Upgrade to rustc 1.38.0-nightly (dddb7fca0 2019-07-30) 2019-07-31 13:34:01 +02:00
Fernando Jiménez Moreno
8eba587547 Merge Node::shadow_including_inclusive_ancestors into inclusive_ancestors 2019-04-26 11:42:38 +02:00
Fernando Jiménez Moreno
bdd2f32c0f Minor tweaks: rename composed_parent_node_ref, remove or update outdated comments... 2019-04-26 11:42:37 +02:00
Fernando Jiménez Moreno
3ccd622c9b Introduce ShadowIncluding enum for tree traversals 2019-04-26 11:31:17 +02:00
Fernando Jiménez Moreno
2e5c058463 Implement concept of shadow including tree order 2019-04-26 10:17:46 +02:00
Fernando Jiménez Moreno
6a85409ffe Throw NotSupported when trying to deep clone a shadow root 2019-04-26 10:17:46 +02:00
Fernando Jiménez Moreno
4304ee28dc Partial ShadowRoot implementation of DocumentOrShadowRoot 2019-04-26 10:17:44 +02:00
Fernando Jiménez Moreno
18ae0fcbd6 ShadowRoot interface 2019-04-26 10:17:44 +02:00
George Roman
4b8282b3b1 Implement CDATASection interface and createCDATASection method 2019-03-14 21:41:02 +02:00
Anthony Ramine
5fe5e5d6de Remove most RootedReference uses
We can replace all uses of RootedReference for Option<T> by Option::deref calls.
2019-03-10 17:51:35 +01:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +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
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07: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
d29335040d Rename MutJS<T> to MutDom<T> 2017-09-26 09:49:00 +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
Simon Sapin
b5a4b8d6a0 Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10) 2017-08-15 14:10:44 +02:00
Simon Sapin
7af5a7fd54 Untry script 2017-06-18 13:21:49 +02:00
Anthony Ramine
57291e5609 Remove obsolete step from Text::SplitText
https://github.com/whatwg/dom/pull/419
2017-03-07 13:31:22 +01:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Anthony Ramine
8bcf36b9a5 Change #[privatize] into #[derive(DenyPublicFields)] 2017-02-15 10:24:01 +01: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
Anthony Ramine
620a67ff14 Mark JSTraceable and its method as unsafe 2016-12-06 13:15:06 -10:00
Anthony Ramine
03e04179ae Refactor fragment parsing 2016-12-01 11:55:06 +01:00