]> source.dussan.org Git - jquery.git/commit
Selector:Manipulation: Fix DOM manip within template contents
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Tue, 15 Nov 2022 14:43:18 +0000 (15:43 +0100)
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Wed, 16 Nov 2022 22:58:17 +0000 (23:58 +0100)
commit5318e3111afd4c307ad6851682620d7413824fc5
tree07f7f1d7306a6157162c766e376922eeb931f2b3
parenta1b7ae3b3fb86b184bd50666c211f08bbc2ee686
Selector:Manipulation: Fix DOM manip within template contents

The `<template/>` element `contents` property is a document fragment that may
have a `null` `documentElement`. In Safari 16 this happens in more cases due
to recent spec changes - in particular, even if that document fragment is
explicitly adopted into an outer document. We're testing both of those cases
now.

The crash used to happen in `jQuery.contains` which is an alias for
`Sizzle.contains` in jQuery 3.x.

The Sizzle fix is at jquery/sizzle#490, released in Sizzle `2.3.8`. This
version of Sizzle is included in the parent commit.

A fix similar to the one from gh-5158 has also been applied here to the
`selector-native` version.

Fixes gh-5147
Closes gh-5159
Ref jquery/sizzle#490
Ref gh-5158
src/selector-native.js
test/unit/manipulation.js