aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/validitystate.rs
Commit message (Collapse)AuthorAgeFilesLines
* Support single-value `<select>` elements (#35684)Simon Wülker2025-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/user-attachments/assets/9aba75ff-4190-4a85-89ed-d3f3aa53d3b0 Among other things this adds a new `EmbedderMsg::ShowSelectElementMenu` to tell the embedder to display a select popup at the given location. This is a draft because some small style adjustments need to be made: * the select element should always have the width of the largest option * the border should be part of the shadow tree Apart from that, it's mostly ready for review. <details><summary>HTML for demo video</summary> ```html <html> <body> <select id="c" name="choice"> <option value="first">First Value</option> <option value="second">Second Value</option> <option value="third">Third Value</option> </select> </body> </html> ``` </details> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] Part of https://github.com/servo/servo/issues/3551 - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* resolve issue #36074 new_js_regex and matches_js_regex need a CanGc argument ↵Kunga Derick Abongho2025-03-291-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#36111) * new_js_regex and matches_js_regex need a CanGc argument Signed-off-by: dericko681 <abonghoderick@gmail.com> * new_js_regex and matches_js_regex need a CanGc argument Signed-off-by: dericko681 <abonghoderick@gmail.com> * edit Propagate CanGc arguments through new_js_regex and matches_js_regex Signed-off-by: dericko681 <abonghoderick@gmail.com> * Propagate CanGc arguments through new_js_regex and matches_js_regex Signed-off-by: dericko681 <abonghoderick@gmail.com> * Propagate CanGc arguments through new_js_regex and matches_js_regex Signed-off-by: dericko681 <abonghoderick@gmail.com> * Propagate CanGc arguments through new_js_regex and matches_js_regex Signed-off-by: dericko681 <abonghoderick@gmail.com> --------- Signed-off-by: dericko681 <abonghoderick@gmail.com>
* Use new stylo crate renames (#35898)Nico Burns2025-03-121-1/+1
| | | Signed-off-by: Nico Burns <nico@nicoburns.com>
* Update rustfmt to the 2024 style edition (#35764)Simon Wülker2025-03-031-1/+1
| | | | | | | | | | | | | * 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>
* Propagate `CanGc` arguments through callers in constructors (#35541)Auguste Baum2025-02-201-2/+2
| | | Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
* script: Limit public exports. (#34915)Josh Matthews2025-01-101-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Add CanGc argument to reflect_dom_object (#34606)Domenico Rizzo2024-12-131-1/+6
| | | | | | | | | | | | | | | | | | | | | * 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>
* Generate a trait abstracting over all known DOM interfaces (#34357)Josh Matthews2024-11-241-1/+1
| | | | | | | | | | | | | | | | | * 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>
* Upgrade stylo to 2024-07-16 (#32812)Martin Robinson2024-07-241-1/+1
| | | | | | | | | | | | | | * Upgrade stylo to 2024-07-16 Signed-off-by: Martin Robinson <mrobinson@igalia.com> * Use the new `dom` crate from stylo Signed-off-by: Martin Robinson <mrobinson@igalia.com> --------- Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Implement form-associated custom elements and their ElementInternals (#31980)cathiechen2024-04-111-10/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * FACEs work, setFormValue test is awful so now has _mozilla backup * 1. Impl Validatable in ElementInternals instead of HTMLElement. 2. Reuse the code in Validatable trait. 3. The form associated custom element is not a customized built-in element. * add some comments * support readonly attribute and complete barred from constraint validation * Addressed the code review comments * Updated the legacy-layout results * Fixed the WPT failures in ElementInternals-validation.html * Addressed the code review comments * Review suggestions * Fixed silly mistakes and update the test result outside elementinternals * update the test results --------- Co-authored-by: Patrick Shaughnessy <pshaughn@comcast.net> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Further changes required by ServoOriol Brufau2023-10-021-8/+5
|
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-6/+8
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-0/+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>
* build(deps): bump bitflags from 1.3.2 to 2.3.1 (#30273)Martin Robinson2023-09-011-2/+4
| | | | | | Bumps [bitflags](https://github.com/bitflags/bitflags) from 1.3.2 to 2.3.1. - [Release notes](https://github.com/bitflags/bitflags/releases) - [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md) - [Commits](https://github.com/bitflags/bitflags/compare/1.3.2...2.3.1)
* Implement :valid :invalid pseudo classes (#26729)John Poge II2023-07-211-33/+88
| | | Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Form constraints validationteapotd2020-04-021-29/+78
|
* Add trait DomObjectWrap to provide WRAP functionYUAN LYU2020-03-201-6/+1
|
* Rustfmt has changed its default style :/Simon Sapin2018-12-281-1/+1
|
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Reorder importsPyfisch2018-11-061-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-061-6/+6
|
* Format script componentchansuke2018-09-191-7/+8
|
* Bump bitflags to 1.0 in every servo crateBastien Orivel2017-10-301-11/+11
|
* Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest ↵Gecko Backout2017-10-191-11/+11
| | | | | | failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE Backs out https://github.com/servo/servo/pull/18809
* Update bitflags to 1.0 in every servo crateBastien Orivel2017-10-191-11/+11
| | | | | It still needs dependencies update to remove all the other bitflags versions.
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* Remove use of unstable box syntax.Simon Sapin2017-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | 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.
* Rename Root<T> to DomRoot<T>Anthony Ramine2017-09-261-2/+2
| | | | | | | 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 JS<T> to Dom<T>Anthony Ramine2017-09-261-3/+3
|
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-1/+1
|
* order derivable traits listsClément DAVID2017-08-231-1/+1
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Make #[dom_struct] a proc_macro attributeAnthony Ramine2017-02-241-0/+1
|
* Remove and allow some dead code.Ms2ger2016-12-221-2/+2
|
* Auto merge of #13969 - bbansalWolfPack:master, r=jdmbors-servo2016-11-251-0/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | html form validation initial steps with test html file <!-- Please describe your changes on the following line: --> Added code for initial steps in html form validation. 1. Added methods for trait validatable 2. implemented stub methods for elements like HTMLInputElement, HTMLButtonElement, etc <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X ] `./mach build -d` does not report any errors - [ X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13969) <!-- Reviewable:end -->
| * html form validation initial steps with test html file, added stub methods, ↵Bhavya Bansal2016-11-231-0/+15
| | | | | | | | added code to handle validations
* | Make #[derive(JSTraceable)] a procedural macroAnthony Ramine2016-11-031-1/+1
| |
* | Use heapsize_derive instead of heapsize_pluginSimon Sapin2016-11-031-1/+1
|/
* Make reflect_dom_object take a &GlobalScopeAnthony Ramine2016-10-061-2/+1
|
* Remove empty lines following braces.Josh Matthews2016-05-271-1/+0
|
* Implement initial pieces of form validation.Sagar Muchhal2016-03-241-6/+86
|
* more refactoringrohan.prinja2015-10-301-1/+1
|
* Link to the HTML multipage spec, not the single-page one.Eli Friedman2015-10-131-1/+1
|
* make dom_struct derive HeapSizeOf,João Oliveira2015-08-271-2/+0
| | | | closes #7357
* Measure heap memory usage for more types. Fixes #6951Bogdan Cuza2015-08-131-0/+1
|
* Upgrade to SM 39Michael Wu2015-06-191-2/+2
|
* Add links to spec for script::dom structs/methodsCorey Farwell2015-03-281-0/+1
|
* Remove manual impls of Reflectors (autogen)Manish Goregaokar2014-12-271-6/+1
| | | | | | | | | Obtained via: `find . -maxdepth 1 -type f -print0 | xargs -0 sed -z -i "s/\\nimpl Reflectable for[^{]*{[^}]*}[^}]*}\\n//"` `find . -maxdepth 1 -type f -print0 |xargs -0 grep -lZ dom_struct | xargs -0 grep -LZ "reflector()\\|Reflector::new" |xargs -0 sed -z -i "s/use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};/use dom::bindings::utils::reflect_dom_object;/"` followed by semi-automated removal of leftover imports
* script: Remove glob imports added in #4405Tetsuharu OHZEKI2014-12-191-2/+2
|
* Updated reflect_dom_object to be passed by valueMichael Booth2014-11-301-1/+1
|
* Use #[dom_struct] everywhereManish Goregaokar2014-10-161-3/+1
|