Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/script/dom/execcommand/basecommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ impl CommandName {
let mut at_least_two_different_effective_values = false;
let mut previous_effective_value: Option<DOMString> = None;
active_range.for_each_effectively_contained_child(|node| {
if at_least_two_different_effective_values || !node.is_formattable() {
if at_least_two_different_effective_values || !node.is_formattable(cx.no_gc()) {
return;
}
if let Some(effective_command_value) = node.effective_command_value(self) {
Expand Down Expand Up @@ -421,7 +421,7 @@ impl CommandName {
let mut at_least_one_child_is_formattable = false;
let mut all_children_have_matching_command_values = true;
active_range.for_each_effectively_contained_child(|node| {
if !node.is_formattable() {
if !node.is_formattable(cx.no_gc()) {
return;
}
at_least_one_child_is_formattable = true;
Expand Down Expand Up @@ -468,7 +468,7 @@ impl CommandName {
let active_range = selection.active_range()?;

active_range
.first_formattable_contained_node()
.first_formattable_contained_node(cx.no_gc())
.unwrap_or_else(|| active_range.start_container())
.effective_command_value(self)
.unwrap_or_default()
Expand Down
12 changes: 6 additions & 6 deletions components/script/dom/execcommand/commands/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub(crate) fn execute_delete_command(
if offset == 0 &&
let Some(sibling) = node.GetPreviousSibling() &&
sibling.is_editable() &&
sibling.is_invisible()
sibling.is_invisible(cx.no_gc())
{
sibling.remove_self(cx);
continue;
Expand All @@ -71,7 +71,7 @@ pub(crate) fn execute_delete_command(
.map(|node| node.as_rooted());
if let Some(child) = child &&
child.is_editable() &&
child.is_invisible()
child.is_invisible(cx.no_gc())
{
child.remove_self(cx);
offset -= 1;
Expand All @@ -80,7 +80,7 @@ pub(crate) fn execute_delete_command(
}
// Step 4.3. Otherwise, if offset is zero and node is an inline node, or if node is an invisible node,
// set offset to the index of node, then set node to its parent.
if (offset == 0 && node.is_inline_node()) || node.is_invisible() {
if (offset == 0 && node.is_inline_node()) || node.is_invisible(cx.no_gc()) {
offset = node.index();
node = node.GetParentNode().expect("Must always have a parent");
continue;
Expand Down Expand Up @@ -154,7 +154,7 @@ pub(crate) fn execute_delete_command(
) && node
.GetParentNode()
.and_then(|parent| parent.children_unrooted(cx.no_gc()).next())
.is_some_and(|first| first == &node) &&
.is_some_and(|first| **first == *node) &&
offset == 0
{
// Step 7.1. Let items be a list of all lis that are ancestors of node.
Expand Down Expand Up @@ -217,7 +217,7 @@ pub(crate) fn execute_delete_command(
.map(|node| node.as_rooted());
if let Some(child) = child &&
child.is_editable() &&
child.is_invisible()
child.is_invisible(cx.no_gc())
{
child.remove_self(cx);
start_offset -= 1;
Expand Down Expand Up @@ -297,7 +297,7 @@ pub(crate) fn execute_delete_command(
};
// Step 16.1. If start node's child with index start offset minus one
// is editable and invisible, remove it from start node, then subtract one from start offset.
if child.is_editable() && child.is_invisible() {
if child.is_editable() && child.is_invisible(cx.no_gc()) {
child.remove_self(cx);
start_offset -= 1;
} else {
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/execcommand/commands/fontsize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub(crate) fn value_for_fontsize_command(
// the effective command value of the active range's start node,
// in either case interpreted as a number of pixels.
let command_value = active_range
.first_formattable_contained_node()
.first_formattable_contained_node(cx.no_gc())
.unwrap_or_else(|| active_range.start_container())
.effective_command_value(&CommandName::FontSize)?;
// Step 3. Return the legacy font size for pixel size.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,10 @@ pub(crate) fn execute_insert_paragraph_command(
// Step 32. If container has no visible children,
// call createElement("br") on the context object,
// and append the result as the last child of container.
if container.children().all(|child| child.is_invisible()) {
if container
.children()
.all(|child| child.is_invisible(cx.no_gc()))
{
let br = document.create_element(cx, "br");
if container.AppendChild(cx, br.upcast()).is_err() {
unreachable!("Must always be able to append");
Expand All @@ -409,7 +412,7 @@ pub(crate) fn execute_insert_paragraph_command(
// and append the result as the last child of new container.
if new_container_node
.children()
.all(|child| child.is_invisible())
.all(|child| child.is_invisible(cx.no_gc()))
{
let br = document.create_element(cx, "br");
if new_container_node.AppendChild(cx, br.upcast()).is_err() {
Expand Down
Loading