Refactored field utilities.

This commit is contained in:
Beka Westberg
2019-08-08 10:45:01 -07:00
parent f539dbe6f6
commit cdc90f4059
21 changed files with 214 additions and 165 deletions

View File

@@ -376,7 +376,7 @@ Blockly.Xml.domToWorkspace = function(xml, workspace) {
width = workspace.getWidth();
}
var newBlockIds = []; // A list of block IDs added by this call.
Blockly.Field.startCache();
Blockly.utils.dom.startTextWidthCache();
// Safari 7.1.3 is known to provide node lists with extra references to
// children beyond the lists' length. Trust the length, do not use the
// looping pattern of checking the index for an object.
@@ -433,7 +433,7 @@ Blockly.Xml.domToWorkspace = function(xml, workspace) {
if (!existingGroup) {
Blockly.Events.setGroup(false);
}
Blockly.Field.stopCache();
Blockly.utils.dom.stopTextWidthCache();
}
// Re-enable workspace resizing.
if (workspace.setResizesEnabled) {