mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
Merge pull request #924 from lightpanda-io/fix-null-owner
node: check owner null before using it
This commit is contained in:
@@ -206,7 +206,7 @@ pub const Node = struct {
|
|||||||
// the parent's ownerDocument.
|
// the parent's ownerDocument.
|
||||||
// This process is known as adoption.
|
// This process is known as adoption.
|
||||||
// (7.1) https://dom.spec.whatwg.org/#concept-node-insert
|
// (7.1) https://dom.spec.whatwg.org/#concept-node-insert
|
||||||
if (child_owner == null or (child_owner.? != self_owner.?)) {
|
if (child_owner == null or (self_owner != null and child_owner.? != self_owner.?)) {
|
||||||
const w = Walker{};
|
const w = Walker{};
|
||||||
var current = child;
|
var current = child;
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -319,7 +319,7 @@ pub const Node = struct {
|
|||||||
// the parent's ownerDocument.
|
// the parent's ownerDocument.
|
||||||
// This process is known as adoption.
|
// This process is known as adoption.
|
||||||
// (7.1) https://dom.spec.whatwg.org/#concept-node-insert
|
// (7.1) https://dom.spec.whatwg.org/#concept-node-insert
|
||||||
if (new_node_owner == null or (new_node_owner.? != self_owner.?)) {
|
if (new_node_owner == null or (self_owner != null and new_node_owner.? != self_owner.?)) {
|
||||||
const w = Walker{};
|
const w = Walker{};
|
||||||
var current = new_node;
|
var current = new_node;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|||||||
Reference in New Issue
Block a user