Martin Robinson
e8f75c9aea
script: Expose node helpers as NodeTraits
and give more descriptive names ( #34832 )
...
This puts a few commonly used `Node` helpers into a trait (`NodeTraits`)
and gives them more descriptive names and documentation. The renames:
- `document_from_node` -> `NodeTraits::owner_document`
- `window_from_node` -> `NodeTraits::owner_window`
- `stylesheets_owner_from_node<T:` -> `NodeTraits::stylesheet_list_owner`
- `containing_shadow_root` -> `NodeTraits::containing_shadow_root`
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-03 18:55:01 +00:00
Domenico Rizzo
0e9746fbbe
Add CanGc argument to reflect_dom_object ( #34606 )
...
* applied mach fmt
Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
Refinements
Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
Modified reflect_dom_object signature and all its calls
Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
* fix function calls when parameter is passed up
Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
---------
Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2024-12-13 15:51:59 +00:00
Simon Wülker
97e9841d47
Implement ShadowRoot.clonable
attribute ( #34514 )
...
* Implement ShadowRoot clonable attribute
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* ./mach test-tidy fixes
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* fix clippy warnings
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-12-07 14:24:18 +00:00
Josh Matthews
4242ff9626
Make traverse_preorder follow shadow roots ( #34503 )
...
* script: Ensure shadow-inclusve preorder traversals follow hosted shadow roots.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Handle unregistering element id/name values inside of a shadow root.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Merge shadow root tree iteration logic.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-12-07 04:28:34 +00:00
Simon Wülker
f1e89c58a6
Don't register unconnected shadow roots with their owner document ( #34361 )
...
* Don't falsely register Shadow Roots as connected
Previously, a shadowroot would be registered as connected
during the shadow hosts bind_to_tree call, even if the host
was being bound to an element that was not itself
connected to a document.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Move bind/unbind methods into a VirtualMethod impl
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Add DocumentFragment/Shadowroot to vtable_for
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-12-02 18:33:25 +00:00
Josh Matthews
e956f3124c
Generate a trait abstracting over all known DOM interfaces ( #34357 )
...
* script: Generate trait for all DOM interfaces and parameterize generated Methods traits over it.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Update trait implementations with new generic type.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Formatting.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-11-24 07:35:14 +00:00
Simon Wülker
1198b26ec9
Implement ShadowRoot.innerHtml
attribute ( #34335 )
...
* Implement DocumentFragment::fragment_serialization_algorithm
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement ShadowRoot innerHtml attribute
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* cargo-clippy
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Reuse existing serialization code and move helpers into Node
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Fix typo
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-11-22 17:07:01 +00:00
Simon Wülker
527e2d426d
Implement element.shadowRoot
attribute ( #34306 )
...
* Implement Element.shadowRoot attribute
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Remove comments about shadowdom not being exposed for web content
This is obviously not the case anymore.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-11-21 00:22:42 +00:00
chickenleaf
9acb25521e
CanGc changes from fontfaceset.rs ( #33920 )
...
* CanGc changes from fontfaceset.rs
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* Update components/script/dom/bindings/codegen/Bindings.conf
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: chickenleaf <lashwinib@gmail.com>
---------
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
Signed-off-by: chickenleaf <lashwinib@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2024-10-21 12:28:56 +00:00
Richard Dushime
01ca220f83
clippy: Fix many warnings in components/script
( #31717 )
...
* Fix Several clippy warnings
* Fix Build errors
* Fix Unused import
* Fix requested changes
* Fix rustfmt
* Minor fixes
---------
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-19 16:05:56 +00:00
Martin Robinson
5c1723c983
rustdoc: Fix many rustdoc errors ( #31147 )
...
This fixes many rustdoc errors that occur due to raw URLs in rustdoc
comments as well as unescaped Rust code that should be in backticks.
2024-01-22 13:13:48 +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
ebd41d4101
Use Foo_Binding instead of FooBinding for namespace modules ( #30447 )
...
* Update Codegen.py to emit Foo_Binding instead of FooBinding
* s/FooBinding/Foo_Binding/g
2023-09-30 00:52:04 +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
450f8193a5
Use mozjs tracing infrastructure ( #29918 )
...
* Update mozjs
64711ec2e6
also fixes https://github.com/servo/servo/issues/30043
* Move to mozjs Traceable and introduce CustomTraceable
2023-08-10 21:46:06 +00:00
Oriol Brufau
60e206143c
Further changes required by Servo
2023-05-16 13:00:18 +02:00
Anthony Ramine
15db31769c
Make DomRefCell not mutate the borrow flag non-atomically
2020-05-18 10:23:46 +02:00
Anthony Ramine
4e64a1c682
Add some comments and remove obsolete allow attributes
2020-04-01 11:40:56 +02:00
Anthony Ramine
295f120425
Make LayoutShadowRootHelpers::get_style_data_for_layout return a &CascadeData
...
That return type is Sync, which thus means that the method can be safe.
2020-04-01 11:40:55 +02:00
Anthony Ramine
f712b0bcf8
Make LayoutShadowRootHelpers::get_host_for_layout be safe
2020-03-31 22:30:42 +02:00
Anthony Ramine
4a17950331
Make LayoutShadowRootHelpers methods take self
2020-03-30 13:07:27 +02:00
Anthony Ramine
86296b84ff
Clean up LayoutShadowRootHelpers::get_style_data_for_layout
...
Parameter E is unused and the result should be bound by 'dom.
2020-03-30 13:07:25 +02:00
Anthony Ramine
dba6a635e5
Give a lifetime parameter to LayoutDom
2020-03-28 15:37:57 +01:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function
2020-03-20 22:16:56 -04:00
Patrick Shaughnessy
e48eac6879
Doc named getter improvements
2020-02-13 15:37:03 -05:00
Fernando Jiménez Moreno
a3d0d95b61
Moar detach shadow improvements
2019-07-22 17:40:17 +02:00
Fernando Jiménez Moreno
ef02196dd8
More detach shadow changes
2019-07-22 17:40:17 +02:00
Fernando Jiménez Moreno
1f3c879a85
Detach shadow clean up
2019-07-22 17:40:16 +02:00
Fernando Jiménez Moreno
5c39097edd
Remove unused ShadowRoot constructor argument
2019-07-22 17:40:16 +02:00
Fernando Jiménez Moreno
e344203c11
Only allow UA widgets as children of media elements
...
Do not allow pseudo-elements for replaced elements
2019-07-22 17:40:15 +02:00
Fernando Jiménez Moreno
a664449681
Media UI basic functionality
2019-07-22 17:40:14 +02:00
Fernando Jiménez Moreno
1c02fc94a8
Barebones media UI
2019-07-22 17:40:14 +02:00
Fernando Jiménez Moreno
d0b2e826ef
Move StylesheetSetRef to script
2019-04-26 12:00:26 +02:00
Fernando Jiménez Moreno
e4f34fde1b
Rename StylesheetSet to StylesheetSetRef
2019-04-26 12:00:26 +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
740aae06ba
Register named elements in either the document or shadow tree
2019-04-26 11:31:18 +02:00
Fernando Jiménez Moreno
ccf8a43649
Document owner_shadow_root
2019-04-26 11:31:18 +02:00
Fernando Jiménez Moreno
2350f0e3d1
Make StyleSheetListOwner an enum instead of a trait object
2019-04-26 11:31:18 +02:00
Fernando Jiménez Moreno
8b353ee3ce
Make StylesheetSet an enum instead of a trait object
2019-04-26 11:31:18 +02:00
Fernando Jiménez Moreno
d77b9c6775
Add invalidate_stylesheets to StyleSheetsListOwner trait
2019-04-26 11:31:17 +02:00
Fernando Jiménez Moreno
2674a3e717
Flush shadow roots stylesheets only if they changed
2019-04-26 11:31:17 +02:00
Fernando Jiménez Moreno
e66438de48
Fix the way the IS_CONNECTED flag is set
2019-04-26 11:31:16 +02:00
Fernando Jiménez Moreno
2515966db6
Fix formatting issues
2019-04-26 11:31:16 +02:00
Fernando Jiménez Moreno
07e2f41c34
Retarget result of shadowRoot.element(s)FromPoint
2019-04-26 10:17:48 +02:00
Fernando Jiménez Moreno
519cc2c317
Invalidate and flush shadow tree stylesheets where needed
2019-04-26 10:17:47 +02:00
Fernando Jiménez Moreno
cd07574235
Expose a way to flush shadow root stylesheets from layout
2019-04-26 10:17:47 +02:00
Fernando Jiménez Moreno
e9f0e76d3c
Implement TShadowRoot::style_data
2019-04-26 10:17:47 +02:00
Fernando Jiménez Moreno
23b92d54d4
Remove stylesheets ownership from DocumentOrShadowRoot
2019-04-26 10:17:47 +02:00
Fernando Jiménez Moreno
3bb50cc479
ShadowRoot stylesheet list
2019-04-26 10:17:47 +02:00
Fernando Jiménez Moreno
0d6bd24245
Move stylesheets related code to DocumentOrShadowRoot
2019-04-26 10:17:47 +02:00