Commit graph

27 commits

Author SHA1 Message Date
Josh Matthews
c94ac5bccb
Move various reflector types and traits to script_bindings (#35279)
* 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>
2025-02-04 06:58:08 +00:00
Josh Matthews
875e387004
script: Feature-gate all crown support. (#35055)
* script: Feature-gate all crown support.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Use cfg(crown) instead of a cargo feature.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-18 21:36:15 +00:00
webbeef
c936dd6c4e
Implement HTMLCanvasElement.transferControlToOffscreen (#34959)
This follows the spec by introducing a new "Placeholder" canvas context
mode. The underlying offscreen canvas is kept accessible from the DOM
element to allow for the drawImage() implementation to work with canvases
that have transfered their control.

Signed-off-by: webbeef <me@webbeef.org>
2025-01-13 04:09:02 +00:00
Josh Matthews
c94d909a86
script: Limit public exports. (#34915)
* 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>
2025-01-10 08:19:19 +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
chickenleaf
1f0b88934b
script: Throw a TypeError when trying to create an OffscreenCanvas with an unknown context type (#34276)
* fixing test failures that involves throwing TypeError

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* handle all unknown values in a single fallback case

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* updating few more test- expectations

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

---------

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-11-21 22:53:52 +00:00
Josh Matthews
7d931e673a
script: Include constructors and static methods in generated DOM traits (#33665)
* Add all constructors, special operations, and static methods to generated DOM interface traits.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Move all constructors and static methods defined in bare impl blocks inside FooMethods trait impls.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Add missing doc links.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-10-08 01:51:58 +00:00
Josh Matthews
60ef6bc461
Start marking functions that can transitively trigger a GC (#33144)
* Mark JS reflector wrappers as CanGc.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Propagate CanGc from reflect_dom_object_with_proto.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Mark DOM constructors as GC operations.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-22 11:42:36 +00:00
Oluwatobi Sofela
a8976ff00a
clippy: Fix option_as_ref_deref warnings (#31936) 2024-03-29 11:52:45 +00:00
Oluwatobi Sofela
694e86ecff
clippy: Fix dereferencing a tuple pattern warnings (#31811) 2024-03-21 17:04:18 +00:00
Oluwatobi Sofela
15bf32a4e6
clippy: Fix unneeded return statement warnings (#31776) 2024-03-20 14:11:40 +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
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
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
pylbrecht
423b86e439 Add canvas usability checks to drawImage() 2020-02-03 22:49:46 +01:00
Kunal Mohan
f7db4b7f80
Modify script to prevent further violations of snake_case 2020-01-18 14:22:15 +05:30
Kunal Mohan
02c1612cb0
Add accountable-refcell as optional build time feature 2020-01-08 09:44:41 +05:30
Bailey Blankenship
deae103042 Addresses Issue: Support OffscreenCanvas as CanvasImageSource #24269
Added methods to canvas_data to support drawing an offscreen canvas onto another canvas
Bug fix: Swapped OffscreenCanvas width and height parameters to match Mozilla spec
Tests: Updated metadata for 866 tests
2019-12-04 18:23:28 -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
Bailey Blankenship
ec2961920b Addresses issues raised in #24465; removes redundancy in set_bitmap_dimensions
Removed passing test .ini files and moved euclid extensions to euclidext.rs to factor out redundant code
2019-11-10 18:37:14 -05:00
marmeladema
2c5d0a6ebc Convert CGTraitInterface to use safe JSContext instead of raw JSContext 2019-07-24 08:24:50 +01:00
Emilio Cobos Álvarez
3d57c22e9c Update euclid.
There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.

Given the size of this patch, I think it's useful to get this landed as-is.
2019-07-23 23:09:55 +02:00
Maharsh
85c20db495 Extract canvas operations for reuse by OffscreenCanvas. 2019-05-22 10:24:54 -04:00
Jan Andre Ikenmeyer
97deef4e19
Update MPL license to https 2019-05-10 15:03:19 +02:00
Maharsh
0f17273276 Initial Steps OffScreenCanvas API 2019-01-15 22:45:34 -05:00