mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
refactor: add CanGc as argument to methods in Document (#36392)
Add CanGc as arguments in methods in Document Testing: These changes do not require tests because they are a refactor. Addressed part of https://github.com/servo/servo/issues/34573. Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
parent
9bdc46d66b
commit
76e0b8ec06
6 changed files with 61 additions and 55 deletions
|
@ -553,7 +553,7 @@ pub(crate) fn handle_find_element_tag_name(
|
|||
pipeline: PipelineId,
|
||||
selector: String,
|
||||
reply: IpcSender<Result<Option<String>, ErrorStatus>>,
|
||||
_can_gc: CanGc,
|
||||
can_gc: CanGc,
|
||||
) {
|
||||
reply
|
||||
.send(
|
||||
|
@ -562,7 +562,7 @@ pub(crate) fn handle_find_element_tag_name(
|
|||
.ok_or(ErrorStatus::UnknownError)
|
||||
.map(|document| {
|
||||
document
|
||||
.GetElementsByTagName(DOMString::from(selector))
|
||||
.GetElementsByTagName(DOMString::from(selector), can_gc)
|
||||
.elements_iter()
|
||||
.next()
|
||||
})
|
||||
|
@ -621,14 +621,14 @@ pub(crate) fn handle_find_elements_tag_name(
|
|||
pipeline: PipelineId,
|
||||
selector: String,
|
||||
reply: IpcSender<Result<Vec<String>, ErrorStatus>>,
|
||||
_can_gc: CanGc,
|
||||
can_gc: CanGc,
|
||||
) {
|
||||
reply
|
||||
.send(
|
||||
documents
|
||||
.find_document(pipeline)
|
||||
.ok_or(ErrorStatus::UnknownError)
|
||||
.map(|document| document.GetElementsByTagName(DOMString::from(selector)))
|
||||
.map(|document| document.GetElementsByTagName(DOMString::from(selector), can_gc))
|
||||
.map(|nodes| {
|
||||
nodes
|
||||
.elements_iter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue