 core/modules/block/block.module |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index b191748..a2edd52 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -487,13 +487,13 @@ function template_preprocess_block(&$variables) {
   $variables['attributes']['class'][] = 'block';
   $variables['attributes']['class'][] = drupal_html_class('block-' . $variables['configuration']['module']);
 
-  // The block template provides a wrapping element for the content. Render the
-  // #attributes of the content on this wrapping element rather than passing
-  // them through to the content's #theme function/template. This allows the
-  // content to not require a function/template at all, or if it does use one,
-  // to not require it to output an extra wrapping element.
+  // If a block's content has #attributes set, then that means it wants set
+  // attributes on the block's container element itself. For example: rendering
+  // a custom block means that a block's $variables['content'] contains a
+  // rendered entity. Setting #attributes on an entity means that it should be
+  // set on the entity's container, which is in this case the block's container.
   if (isset($variables['content']['#attributes'])) {
-    $variables['content_attributes'] = NestedArray::mergeDeep($variables['content_attributes'], $variables['content']['#attributes']);
+    $variables['attributes'] = NestedArray::mergeDeep($variables['attributes'], $variables['content']['#attributes']);
     unset($variables['content']['#attributes']);
   }
 
