Commit graph

91 commits

Author SHA1 Message Date
eri
a7ad92d9a3
clippy: Fix from_over_into warnings (#31946) 2024-03-30 11:30:14 +00:00
Ekta Siwach
b0196ad373
clippy: Fix a variety of warnings in components/script/dom (#31894) 2024-03-29 14:43:10 +00:00
Oluwatobi Sofela
c3b6d40f90
clippy: Fix len_zero warnings (#31935) 2024-03-29 10:05:20 +00:00
Azhar Ismagulova
0728378424
clippy: remove unneeded return statements (#31923) 2024-03-28 16:17:47 +00:00
Rosemary Ajayi
7100465d1a
clippy: Fix various clippy warnings in components/scripts/dom/bindings (#31901)
* single-character string constant used as pattern

* singuse of  with literal radix of 16
2024-03-28 11:49:36 +00:00
Azhar Ismagulova
ff95ce5abd
fix: omitted the let bindings (#31908) 2024-03-27 20:22:51 +00:00
Rosemary Ajayi
a5bcae212a
clippy: Fix clippy problems in components/script/dom (#31891)
* deref on an immutable reference

* use of  with literal radix of 10

* fix
2024-03-27 18:36:16 +00:00
Oluwatobi Sofela
b71de92569
clippy: Fix single_match warnings (#31876) 2024-03-26 14:01:10 +00:00
Oluwatobi Sofela
bae77671f8
clippy: Fix unnecessary_cast warnings in components/script (#31823)
* clippy: Fix unnecessary cast warnings

* clippy: Replace redundant field names with their shorthand alternatives

* clippy: Delete struct pattern dereferencings
2024-03-22 13:48:03 +00:00
eri
da696b7e57
clippy: fix result_unit_err warnings (#31791)
* clippy: fix `result_unit_err` warnings

* feat: fix result warnings in script

* doc: document `generate_key` return type

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

* feat: add back result to RangeRequestBounds::get_final

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

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-21 12:51:45 +00:00
Oluwatobi Sofela
8cbad332c3
rusdoc: Fix idl warning in components/script/dom/bindings (#31643)
* rusdoc: Add valid domstring link

* rustdoc: Replace unused idl link ref
2024-03-13 17:59:27 +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
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
Martin Robinson
bd2503ceac
Fix warnings after chrono upgrade (#30165)
Some functions are now deprecated, so use the suggested ones and do a
general cleanup of the affected lines of code.
2023-08-23 00:44:00 +00:00
teapotd
779552ee7d Form constraints validation 2020-04-02 10:16:46 +02:00
Patrick Shaughnessy
6dc8f67f8f Make sure input value=12:30:01 doesn't turn into 12:30:1 2020-02-12 11:50:40 -05:00
Patrick Shaughnessy
87e86c81b9 stepUp, stepDown, valueAsNumber, valueAsDate, and list work and have tests 2020-01-10 20:09:51 -05:00
glowe
576f51f598 Add DOMString floating point string test and fix
Fixes an issue where DOMString::is_valid_floating_point_number_string
was returning true for strings that began with whitespace characters-
TAB, LF, FF, or CR. Also added a unit test to cover this since the
corresponding web-platform-tests are incomplete.
2019-11-30 23:29:09 -05:00
Kagami Sascha Rosylight
b697621b05 Support WebIDL record<> 2019-10-15 17:14:00 +09:00
Simon Sapin
1d38bc0419 Fix some new warnings 2019-06-22 14:59:09 +02:00
est31
8b6ed3d182 Remove unused code from script* crates 2019-06-02 07:12:26 +02:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Dan Robertson
c46508e497
Update src/href attributes to be a USVString
The following IDLs have the src/href attributes typed as a DOMString
while in the spec the attribute has been updated to be a USVString:

 - HTMLIFrameElement
 - HTMLImageElement
 - HTMLInputElement
 - HTMLLinkElement
 - HTMLMediaElement
 - HTMLScriptElement
2018-12-17 15:28:42 +00:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Jim Berlage
1f99bf4631 Fixes panic on DOMString::strip_leading_and_trailing_ascii_whitespace 2018-11-08 16:16:28 -06:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Simon Sapin
3d6614e314 Upgrade to rustc 1.27.0-nightly (056f589fb 2018-04-07) 2018-04-09 21:43:25 +02:00
tigercosmos
b29230bd76 implement range input sanitization 2018-01-17 16:27:21 +08:00
Nathan
5b6e821559 input type=number validations 2018-01-09 20:08:09 -06:00
tigercosmos
b43424111e implement valid Date time Local input 2018-01-07 18:31:32 +08:00
tigercosmos
54c6028033 implement valid week string 2017-12-17 16:57:01 +08:00
tigercosmos
927fd1d044 implement "Date type inputs", "Month type inputs" 2017-12-05 09:44:51 +08:00
Simon Wörner
a999239f28 Added time input sanitization:
- Implemented is_valid_time_string for DOMString.
- Use is_valid_time_string for sanitize_value with time input.
- Improved input type change test
2017-12-04 11:21:28 +01:00
bors-servo
338e2ae520 Auto merge of #18262 - KiChjang:value-sanitization, r=nox
Implement value sanitization on HTMLInputElement

https://html.spec.whatwg.org/multipage/input.html#value-sanitization-algorithm

<!-- 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/18262)
<!-- Reviewable:end -->
2017-11-09 18:35:07 -06:00
Simon Sapin
793bebfc0e Upgrade to rustc 1.23.0-nightly (02004ef78 2017-11-08) 2017-11-09 16:56:39 +01:00
Keith Yeung
9d60333af9 Implement string stripping utilities from the Infra spec 2017-11-08 11:58:18 -08: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
Josh Matthews
16166d6673 Derive the Default trait for dictionaries containing GC values. 2017-09-25 16:10:58 -04:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Fernando Jiménez Moreno
52348f1fcc Performance Timeline API 2017-08-17 11:48:34 +02:00
Simon Sapin
eb98ae6e04 Update cssparser to 0.18
https://github.com/servo/rust-cssparser/pull/171
2017-07-24 11:39:12 +02:00
Matt Brubeck
f511a77ec5 Stop using the unstable optin_builtin_traits feature 2017-06-28 15:00:21 -07:00
Simon Sapin
b83afdedc8 Upgrade cssparser to 0.15 2017-06-16 15:05:46 +02:00
Cameron McCormack
524794c09a script: Move extended_filtering to the style crate.
We'll need to call it from the style crate in later patches, when matching
:lang() against element snapshots.
2017-06-08 09:37:09 +08:00
Simon Sapin
6c518c89b9 Upgrade to html5ever 0.16 2017-05-02 19:24:28 +02:00
SendilKumar N
b6e6e84bcf ext. filtering for lang matching 2017-03-07 10:20:16 +08:00
Anthony Ramine
ac254046e4 Implement document.open and document.close (fixes #14591) 2017-02-03 16:50:12 +01:00
Simon Sapin
137e30b825 Introduce enums for identifying CSS properties.
* `LonghandId` and `ShorthandId` are C-like enums
* `Atom` is used for the name of custom properties.
* `PropertyDeclarationId` is the identifier for `PropertyDeclaration`,
  after parsing and shorthand expansion. (Longhand or custom property.)
* `PropertyId` represents any CSS property, e.g. in CSSOM.
  (Longhand, shorthand, or custom.)

Using these instead of strings avoids some memory allocations and copies.
2016-12-09 10:56:22 -10:00