mirror of
https://github.com/google/blockly.git
synced 2026-01-07 17:10:11 +01:00
chore: 'compareDocumentPosition' to 'contains' (#6982)
The 'compareDocumentPosition' call was inherited from Closure Library, in order to work with IE 8 and earlier. Use the more modern 'contains' call instead. This change was originally added here: https://github.com/google/blockly/pull/1991 Remove the DOCUMENT_POSITION_CONTAINED_BY constant which is not a NodeType and should never have been part of that enum. This change was originally added here: https://github.com/google/blockly/pull/2736
This commit is contained in:
@@ -47,8 +47,8 @@ export function inject(
|
||||
containerElement = container;
|
||||
}
|
||||
// Verify that the container is in document.
|
||||
if (!containerElement || !dom.containsNode(document, containerElement)) {
|
||||
throw Error('Error: container is not in current document.');
|
||||
if (!document.contains(containerElement)) {
|
||||
throw Error('Error: container is not in current document');
|
||||
}
|
||||
const options = new Options(opt_options || {} as BlocklyOptions);
|
||||
const subContainer = (document.createElement('div'));
|
||||
@@ -56,7 +56,7 @@ export function inject(
|
||||
subContainer.tabIndex = 0;
|
||||
aria.setState(subContainer, aria.State.LABEL, Msg['WORKSPACE_ARIA_LABEL']);
|
||||
|
||||
containerElement.appendChild(subContainer);
|
||||
containerElement!.appendChild(subContainer);
|
||||
const svg = createDom(subContainer, options);
|
||||
|
||||
// Create surfaces for dragging things. These are optimizations
|
||||
|
||||
Reference in New Issue
Block a user