diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php
index b8b2eaa..ec88a7d 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php
@@ -392,6 +392,19 @@ function pre_render($result) {
   }
 
   /**
+   * Renders a single view of a grouped content.
+   */
+  public function renderSingle(array $rows = array()) {
+    $theme_functions = views_theme_functions('views_view_grouping', $this->view, $this->view->display_handler->display);
+
+    return array(
+      '#theme' => $theme_functions,
+      '#view' => $this->view,
+      '#rows' => $rows,
+    );
+  }
+
+  /**
    * Render the display in this style.
    */
   function render() {
@@ -431,14 +444,11 @@ function render_grouping_sets($sets, $level = 0) {
       $row = reset($set['rows']);
       // Render as a grouping set.
       if (is_array($row) && isset($row['group'])) {
-        $output[] = array(
-          '#theme' => $theme_functions,
-          '#view' => $this->view,
-          '#grouping' => $this->options['grouping'][$level],
-          '#grouping_level' => $level,
-          '#rows' => $set['rows'],
-          '#title' => $set['group'],
-        );
+        $group_output = $this->renderSingle($set['rows']);
+        $group_output['#grouping'] = $this->options['grouping'][$level];
+        $group_output['#grouping_level'] = $level;
+        $group_output['#title'] = $set['group'];
+        $output[] = $group_output;
       }
       // Render as a record set.
       else {
@@ -451,14 +461,10 @@ function render_grouping_sets($sets, $level = 0) {
           }
         }
 
-        $output[] = array(
-          '#theme' => $this->themeFunctions(),
-          '#view' => $this->view,
-          '#options' => $this->options,
-          '#grouping_level' => $level,
-          '#rows' => $set['rows'],
-          '#title' => $set['group'],
-        );
+        $single_output = $this->renderSingle($set['rows']);
+        $single_output['#grouping_level'] = $level;
+        $single_output['#title'] = $set['group'];
+        $output[] = $single_output;
       }
     }
     unset($this->view->row_index);
