aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/cssstylerule.rs
Commit message (Collapse)AuthorAgeFilesLines
* Fix InsertRule to use the right CssRuleTypes (#32125)Oriol Brufau2024-04-221-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `CSSRule::Type()` returns an u16 for CSSOM. `InsertRule()` was incorrectly using this to create a `CssRuleTypes`. Instead of `CssRuleTypes::from_bits(rule_type)`, it should be something like `CssRuleTypes::from_bits(1 << rule_type)`. However, that would only work when `Type()` provides an actual value, which per https://drafts.csswg.org/cssom/#dom-cssrule-type only happens for old rule types. New rule types just return 0. Therefore, this patch changes the signature of `SpecificCSSRule::ty()` to return the actual `CssRuleType`, and then `CSSRule::Type()` can zero it out when necessary. The fix is only relevant for CSS Nesting, which is currently disabled on Servo, so no test is necessary. <!-- Please describe your changes on the following line: --> --- <!-- 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] These changes do not require tests because the fix is only relevant for CSS Nesting, which is currently disabled <!-- 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. -->
* fixed the `unneeded return` statement warnings. (#31863)Aarya Khandelwal2024-03-261-1/+1
|
* clippy: Fix `explicit_auto_deref` warnings in `components/script` (#31837)Oluwatobi Sofela2024-03-231-1/+1
| | | | | | | | | * clippy: Fix explicit auto-deref warnings * clippy: Fix explicit auto-deref warnings * refactor: Tidy up code * refactor: Fix method not found errors
* clippy: Fix redundant field names warnings (#31793)Oluwatobi Sofela2024-03-201-1/+1
|
* Update Stylo to 2023-07-23 (#31437)Oriol Brufau2024-02-291-2/+4
| | | | | | | | | | | | | | | | | | | * Update Stylo to 2023-07-23 * to_shmem should be local when working with Stylo * Fixup for https://phabricator.services.mozilla.com/D180769 * Fixup for https://phabricator.services.mozilla.com/D181125 * Fixup for https://phabricator.services.mozilla.com/D181162 * Fixup for https://phabricator.services.mozilla.com/D181798 * Fixup for https://phabricator.services.mozilla.com/D182514 * Fixup for https://phabricator.services.mozilla.com/D182539 * Update test expectations
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Further changes required by ServoOriol Brufau2023-11-031-0/+1
|
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-9/+10
| | | | | * strict imports formatting * Reformat all imports
* No tracing of nop traceable fields (#29926)Samson2023-08-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add `no_trace` option to JSTraceable derive * NoTrace wrapper * Port some types to no_trace schematics * Fixing my unsafe mistakes (not tracing traceables) * Add docs & safety guards for no_trace Safety guards (trait shenanigans) guarantees safety usage of `no_trace` * Port canvas_traits to no_trace * Port servo_media to no_trace * Port net_traits to no_trace * Port style to no_trace * Port webgpu to no_trace * Port script_traits to no_trace * Port canvas_traits, devtools_traits, embedder_traits, profile_traits to no_trace * unrooted_must_root lint in seperate file * Add trace_in_no_trace_lint as script_plugin * Composable types in must_not_have_traceable * Introduced HashMapTracedValues wrapper * `HashMap<NoTrace<K>,V>`->`HashMapTracedValues<K,V>` * Port rest of servo's types to no_trace * Port html5ever, euclid, mime and http to no_trace * Port remaining externals to no_trace * Port webxr and Arc<Mutex<_>> * Fix spelling in notrace doc
* Further changes required by ServoOriol Brufau2023-06-091-8/+4
|
* Implements Stylesheet.ownerNodeVincent Ricard2020-10-101-2/+3
|
* Add trait DomObjectWrap to provide WRAP functionYUAN LYU2020-03-201-2/+1
|
* Add invalidate_stylesheets to StyleSheetsListOwner traitFernando Jiménez Moreno2019-04-261-14/+3
|
* Invalidate and flush shadow tree stylesheets where neededFernando Jiménez Moreno2019-04-261-6/+13
|
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Reorder importsPyfisch2018-11-061-3/+3
|
* Sort `use` statementsSimon Sapin2018-11-061-2/+2
|
* `cargo fix --edition`Simon Sapin2018-11-061-11/+11
|
* Format script componentchansuke2018-09-191-12/+31
|
* 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-3/+3
| | | | | | | 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 MutNullableJS<T> to MutNullableDom<T>Anthony Ramine2017-09-261-2/+2
|
* Rename JS<T> to Dom<T>Anthony Ramine2017-09-261-2/+2
|
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-1/+1
|
* Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10)Simon Sapin2017-08-151-1/+1
|
* style: Introduce Chrome UI privilege for parsersTing-Yu Lin2017-08-031-0/+1
| | | | | | | | | | | The motivation is that Chrome XBL stylesheets can be parsed under author level, but we allow some event-state pseudo classes like :-moz-handled-clicktoplay to be used. Also synchronize the privilege of pseudo classes in non_ts_pseudo_class_list.rs and nsCSSPseudoClassList.h (except :fullscreen). MozReview-Commit-ID: 8fUjjC8hbQO
* Replace all uses of the style::stylearc alias with servo_arc.Michael Partheil2017-07-191-1/+1
| | | | | | The alias is left there temporarilly and will be removed completely in a later commit where also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still use the old alias).
* Implement CSSStyleRule.selectorText.Jonathan Chan2017-07-121-1/+36
| | | | | | | | | | | | | | | | | | We parse when assigning using the namespaces of the stylesheet. It isn't clear if the spec says to do that (Firefox doesn't support the setter at all, Chrome does, Safari doesn't); the spec issue is here: https://github.com/w3c/csswg-drafts/issues/1511 Also fix ToCss implementation of AttrSelectorOperator to not pad with spaces, to conform with CSSOM. This means we have to update some unit tests that expect operators with spaces around them in attribute selectors to roundtrip. See the "attribute selector" section of "Serializing Selectors" here: https://drafts.csswg.org/cssom/#serializing-selectors CSSStyleRule.selectorText is specified here: https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext
* Fix up script and layout.Bobby Holley2017-05-021-1/+1
|
* Replace RwLock<StyleRule> with Locked<StyleRule>Simon Sapin2017-03-191-11/+15
|
* Introduce a ToCssWithGuard traitSimon Sapin2017-03-191-2/+3
|
* Make #[dom_struct] a proc_macro attributeAnthony Ramine2017-02-241-0/+1
|
* script: Fix base url for style-rule-owned declarations.Emilio Cobos Álvarez2017-01-281-2/+3
|
* Implement CSSKeyframeRule.styleKeith Yeung2017-01-071-1/+1
|
* Remove and allow some dead code.Ms2ger2016-12-221-4/+0
|
* Implement CSSStyleRule.styleKeith Yeung2016-12-171-3/+23
|
* Make CSSRule always keep a pointer to its parent stylesheetSimon Sapin2016-11-281-4/+5
| | | | even when the parentStylesheet IDL attribute returns null.
* Make parent stylesheet optional for CSSRulesManish Goregaokar2016-11-231-2/+2
|
* Support basic immutable CSSOMManish Goregaokar2016-11-151-0/+50