mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Some goog.dom removal (#1991)
This commit is contained in:
@@ -946,3 +946,14 @@ Blockly.utils.toRadians = function(angleDegrees) {
|
||||
Blockly.utils.toDegrees = function(angleRadians) {
|
||||
return angleRadians * 180 / Math.PI;
|
||||
};
|
||||
|
||||
/**
|
||||
* Whether a node contains another node.
|
||||
* @param {!Node} parent The node that should contain the other node.
|
||||
* @param {!Node} descendant The node to test presence of.
|
||||
* @return {boolean} Whether the parent node contains the descendant node.
|
||||
*/
|
||||
Blockly.utils.containsNode = function(parent, descendant) {
|
||||
return !!(parent.compareDocumentPosition(descendant) &
|
||||
Node.DOCUMENT_POSITION_CONTAINED_BY);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user