mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
refactor: add CanGc as argument to methods in CSSKeyframeRule, CSSMediaRule, CSSRule (#35796)
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
parent
78f7d525cc
commit
16aeeaec85
7 changed files with 30 additions and 17 deletions
|
@ -239,7 +239,7 @@ pub(crate) fn handle_get_stylesheet_style(
|
|||
|
||||
let styles = (0..list.Length())
|
||||
.filter_map(move |i| {
|
||||
let rule = list.Item(i)?;
|
||||
let rule = list.Item(i, can_gc)?;
|
||||
let style = rule.downcast::<CSSStyleRule>()?;
|
||||
if *selector != *style.SelectorText() {
|
||||
return None;
|
||||
|
@ -270,6 +270,7 @@ pub(crate) fn handle_get_selectors(
|
|||
pipeline: PipelineId,
|
||||
node_id: String,
|
||||
reply: IpcSender<Option<Vec<(String, usize)>>>,
|
||||
can_gc: CanGc,
|
||||
) {
|
||||
let msg = (|| {
|
||||
let node = find_node_by_unique_id(documents, pipeline, &node_id)?;
|
||||
|
@ -285,7 +286,7 @@ pub(crate) fn handle_get_selectors(
|
|||
let elem = node.downcast::<Element>()?;
|
||||
|
||||
Some((0..list.Length()).filter_map(move |j| {
|
||||
let rule = list.Item(j)?;
|
||||
let rule = list.Item(j, can_gc)?;
|
||||
let style = rule.downcast::<CSSStyleRule>()?;
|
||||
let selector = style.SelectorText();
|
||||
elem.Matches(selector.clone()).ok()?.then_some(())?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue