You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ const xml = slimdom.serializeToWellFormedString(document);
43
43
44
44
Some DOM API's, such as the `DocumentFragment` constructor, require the presence of a global document, for instance to set their initial `ownerDocument` property. In these cases, slimdom will use the instance exposed through `slimdom.document`. Although you could mutate this document, it is recommended to always create your own documents (using the `Document` constructor) to avoid conflicts with other code using slimdom in your application.
45
45
46
-
When using a `Range`, make sure to call `detach` when you don't need it anymore. As we do not have a way to detect when a Range is no longer used, this library needs to be notified when it can stop updating the range for mutations to the surrounding nodes.
46
+
When using a `Range`, make sure to call `detach` when you don't need it anymore. Unless you are only targeting environments that implement the WeakRef proposal, we do not have a way to detect when we can stop updating the range for mutations to the surrounding nodes. In environments that support WeakRef, calling detach is optional.
"docComment": "/**\n * Stops tracking the range.\n *\n * (non-standard) According to the spec, this method must do nothing. However, as it is not possible to rely on garbage collection to determine when to stop updating a range for node mutations, this implementation requires calling detach to stop such updates from affecting the range.\n */\n",
9304
+
"docComment": "/**\n * Stops tracking the range.\n *\n * (non-standard) According to the spec, this method must do nothing. However, it is not yet possible in all browsers to allow garbage collection while keeping track of active ranges to be updated by mutations. Therefore, unless your code will only run in environments that implement the WeakRef proposal (https://github.com/tc39/proposal-weakrefs), make sure to call this method to stop updating the range and free up its resources.\n */\n",
0 commit comments