aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/create.rs
Commit message (Collapse)AuthorAgeFilesLines
* Set `is` value when constructing custom elements with the `new` operator ↵Simon Wülker2025-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | (#35930) * Add doc comments throughout the code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Set is-value for elements constructed with the "new" operator Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Allow custom elements to extend <slot> 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>
* Update rustfmt to the 2024 style edition (#35764)Simon Wülker2025-03-031-3/+3
| | | | | | | | | | | | | * Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* refactor: propagate CanGc arguments through callers (#35591)Auguste Baum2025-02-231-1/+1
| | | Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
* make report_pending_exception safe and adjust callers (#35351)Nolen Scaife2025-02-081-5/+4
| | | Signed-off-by: Nolen Scaife <nolen@scaife.org>
* script: Annotate steps for custom element creation. (#35354)Josh Matthews2025-02-071-31/+65
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Move various reflector types and traits to script_bindings (#35279)Josh Matthews2025-02-041-1/+1
| | | | | | | | | | | | | * script: Move Reflector to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Extract global() helper from DomObject into new trait. Move DomObject and related traits to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Implement shadow dom slots (#35013)Simon Wülker2025-01-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement slot-related algorithms Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Hook up slot elements to DOM creation logic Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Set a slot assignment mode for servo-internal shadow roots Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Assign slots when a slottable's slot attribute changes Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Properly compute slot name Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * ./mach test-tidy Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update <slot> name when name attribute changes Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement fast path for Node::assign_slottables_for_a_tree assign_slottables_for_a_tree traverses all descendants of the node and is potentially very expensive. If the node is not a shadow root then assigning slottables to it won't have any effect, so we take a fast path out. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Move slottable data into ElementRareData This shrinks all element descendants back to their original size. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Address review comments 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>
* api: Flatten and simplify Servo preferences (#34966)Martin Robinson2025-01-141-1/+1
| | | | | | | | | | | | | | | | | | | Flatten and simplify Servo's preferences code. In addition, have both preferences and options passed in as arguments to `Servo::new()` and make sure not to use the globally set preferences in `servoshell` (as much as possible now). Instead of a complex procedural macro to generate preferences, just expose a very simple derive macro that adds string based getters and setters. - All command-line parsing is moved to servoshell. - There is no longer the concept of a missing preference. - Preferences no longer have to be part of the resources bundle because they now have reasonable default values. - servoshell specific preferences are no longer part of the preferences exposed by the Servo API. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Limit public exports. (#34915)Josh Matthews2025-01-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Restrict reexport visibility of DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Mass pub->pub(crate) conversion. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Hide existing dead code warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix unit tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * More formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* cangc fixes in node.rs (#33984)chickenleaf2024-10-231-7/+8
| | | Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* CanGc fixes in `errorevent.rs` (#33960)tanishka2024-10-221-1/+1
| | | | | | | | | | | | | * CanGc fixes in errorevent.rs Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * Allow too_many_arguments to avoid lint error Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> --------- Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* clippy: Fix too_many_arguments warnings (#33648)tanishka2024-10-041-0/+1
| | | Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Propagate `CanGc` from `Document::new()` (#33386)Andriy Sultanov2024-09-091-3/+8
| | | | | | | | | | | | | * Add canGc as a parameter to autogenerated trait methods Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com> * Propagate CanGc from Document::new() Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com> --------- Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
* clippy: Fix `explicit_auto_deref` warnings in `components/script` (#31837)Oluwatobi Sofela2024-03-231-5/+5
| | | | | | | | | * clippy: Fix explicit auto-deref warnings * clippy: Fix explicit auto-deref warnings * refactor: Tidy up code * refactor: Fix method not found errors
* Treat the `keygen` element as obsolete (#30429)Ennui Langeweile2023-09-261-0/+2
| | | | | | | | | * Eradicate the `keygen` element * Run `./mach fmt` * Fix relevant Servo test * Fix outdated manifest
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-5/+5
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-1/+1
| | | | | | | | | | | * 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>
* Support arbitrary protos when wrapping DOM objects with constructors.Josh Matthews2023-05-281-11/+18
|
* Make GlobalScope.get_cx a static method.Josh Matthews2023-05-201-1/+1
|
* Introduce ElementCSSInlineStyle for SVGElementCYBAI2020-06-051-1/+2
|
* Always pass InRealm to GlobalScope::from_context to avoid getting null globalCYBAI2020-02-161-4/+3
|
* :defined worksPatrick Shaughnessy2020-01-301-0/+2
|
* Implement HTMLMenuElementPatrick Shaughnessy2020-01-231-0/+2
|
* apply is: to Document.createElement even when name isn't registered yetPatrick Shaughnessy2019-12-221-6/+13
|
* Use safe JSContext as first argument for throw_dom_exceptionmarmeladema2019-08-091-1/+1
|
* Modify *::get_cx methods to return a safe JSContext instead of a raw onemarmeladema2019-07-241-3/+3
|
* Update to SpiderMonkey 66.Josh Matthews2019-05-101-5/+3
|
* Add custom elements related stuff into ElementRareDataFernando Jiménez Moreno2019-04-261-2/+4
|
* #8539 Config preferences backend restructurePeter Hall2019-03-201-2/+2
|
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Sort `use` statementsSimon Sapin2018-11-061-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-061-77/+77
|
* Remove the HTMLTable{Header,Data}CellElement interfacesSimon Pieters2018-10-021-4/+3
| | | | Fixes #17222.
* Format script componentchansuke2018-09-191-162/+173
|
* Implement HTMLPictureElement interface.Rakhi Sharma2018-01-291-0/+2
|
* Use specific assertion for DOM createCYBAI2018-01-261-2/+2
|
* script: Remove HTMLAppletElement.Emilio Cobos Álvarez2017-11-061-8/+7
| | | | It was removed from the spec, there's no reason to keep it in tree.
* Rename Root<T> to DomRoot<T>Anthony Ramine2017-09-261-11/+11
| | | | | | | 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.
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-1/+1
|
* Track custom element stateConnor Brewster2017-08-091-4/+18
|
* Enqueue upgradesConnor Brewster2017-08-091-4/+16
|
* Check namespace during ce def lookupConnor Brewster2017-08-091-1/+1
|
* Use HTMLElement interface for possible CEsConnor Brewster2017-08-091-1/+4
|
* Support custom element callback reactionsConnor Brewster2017-07-171-1/+4
|
* Allow element prefix to be setConnor Brewster2017-06-231-1/+1
| | | | | Implements step 6.1.10 of https://dom.spec.whatwg.org/#concept-create-element
* Add flag for sync/async CE creationConnor Brewster2017-06-231-20/+28
|
* Support `is` option when creating elementsConnor Brewster2017-06-231-4/+10
|
* Hook CE registry into element creationConnor Brewster2017-06-231-0/+35
|
* Implement HTMLConstructorConnor Brewster2017-06-151-4/+12
|
* Solving merge conficts related to the html5ever_atoms -> html5ever changeChristian Poveda2017-05-031-6/+2
|\