diff --git a/core/block_render_svg.js b/core/block_render_svg.js index ebe6012bd..6987b45d6 100644 --- a/core/block_render_svg.js +++ b/core/block_render_svg.js @@ -317,10 +317,6 @@ Blockly.BlockSvg.prototype.getHeightWidth = function() { * If true, also render block's parent, grandparent, etc. Defaults to true. */ Blockly.BlockSvg.prototype.render = function(opt_bubble) { - if (!this.workspace) { - // This block is being deleted so don't try to render it. - return; - } Blockly.Field.startCache(); this.rendered = true; diff --git a/core/rendered_connection.js b/core/rendered_connection.js index 6ac5c5a60..b9ab29a16 100644 --- a/core/rendered_connection.js +++ b/core/rendered_connection.js @@ -226,7 +226,6 @@ Blockly.RenderedConnection.prototype.highlight = function() { * attached to this connection. This happens when a block is expanded. * Also unhides down-stream comments. * @return {!Array.} List of blocks to render. - * @protected */ Blockly.RenderedConnection.prototype.unhideAll = function() { this.setHidden(false); @@ -274,7 +273,6 @@ Blockly.RenderedConnection.prototype.unhighlight = function() { /** * Set whether this connections is hidden (not tracked in a database) or not. * @param {boolean} hidden True if connection is hidden. - * @protected */ Blockly.RenderedConnection.prototype.setHidden = function(hidden) { this.hidden_ = hidden; @@ -283,19 +281,12 @@ Blockly.RenderedConnection.prototype.setHidden = function(hidden) { } else if (!hidden && !this.inDB_) { this.db_.addConnection(this); } - if (this.isSuperior() && this.targetBlock()) { - var display = hidden ? 'none' : 'block'; - var renderedBlock = this.targetBlock(); - renderedBlock.getSvgRoot().style.display = display; - renderedBlock.rendered = !hidden; - } }; /** * Hide this connection, as well as all down-stream connections on any block * attached to this connection. This happens when a block is collapsed. * Also hides down-stream comments. - * @protected */ Blockly.RenderedConnection.prototype.hideAll = function() { this.setHidden(true); @@ -334,44 +325,6 @@ Blockly.RenderedConnection.prototype.isConnectionAllowed = function(candidate, candidate); }; -/** - * Connect this connection to another connection. - * @param {!Blockly.Connection} otherConnection Connection to connect to. - * @override - */ -Blockly.RenderedConnection.prototype.connect = function(otherConnection) { - Blockly.RenderedConnection.superClass_.connect.call(this, otherConnection); - - // This is a quick check to make sure we aren't doing unecessary work. - if (this.hidden_ || otherConnection.hidden_) { - var superiorConnection = this.isSuperior() ? this : otherConnection; - if (superiorConnection.hidden_) { - superiorConnection.hideAll(); - } else { - superiorConnection.unhideAll(); - } - } -}; - -/** - * Disconnect this connection. - * @override - */ -Blockly.RenderedConnection.prototype.disconnect = function() { - var superiorConnection = this.isSuperior() ? this : this.targetConnection; - var rehide = false; - if (this.targetConnection && superiorConnection.hidden_) { - superiorConnection.unhideAll(); - rehide = true; - } - Blockly.RenderedConnection.superClass_.disconnect.call(this); - if (rehide) { - // Set the hidden state for the connection back to true so shadow blocks - // will be hidden. - superiorConnection.hideAll(); - } -}; - /** * Disconnect two blocks that are connected by this connection. * @param {!Blockly.Block} parentBlock The superior block. @@ -409,7 +362,7 @@ Blockly.RenderedConnection.prototype.respawnShadow_ = function() { } blockShadow.initSvg(); blockShadow.render(false); - if (parentBlock.rendered && !this.hidden_) { + if (parentBlock.rendered) { parentBlock.render(); } } diff --git a/tests/mocha/connection_test.js b/tests/mocha/connection_test.js index 8dd57ac95..ef3714228 100644 --- a/tests/mocha/connection_test.js +++ b/tests/mocha/connection_test.js @@ -2,7 +2,7 @@ suite('Connections', function() { - suite('Rendered', function() { + suite.skip('Rendered', function() { function assertAllConnectionsHiddenState(block, hidden) { var connections = block.getConnections_(true); for (var i = 0; i < connections.length; i++) {