Chris@0: pop(); Chris@0: // Update the frame, but also update the current element, to ensure it Chris@0: // contains up-to-date information in case it gets render cached. Chris@0: $updated_frame = BubbleableMetadata::createFromRenderArray($element)->merge($frame); Chris@0: $updated_frame->applyTo($element); Chris@0: $this->push($updated_frame); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Bubbles the stack. Chris@0: * Chris@0: * Whenever another level in the render array has been rendered, the stack Chris@0: * must be bubbled, to merge its rendering metadata with that of the parent Chris@0: * element. Chris@0: */ Chris@0: public function bubble() { Chris@0: // If there's only one frame on the stack, then this is the root call, and Chris@0: // we can't bubble up further. ::renderRoot() will reset the stack, but we Chris@0: // must not reset it here to allow users of ::executeInRenderContext() to Chris@0: // access the stack directly. Chris@0: if ($this->count() === 1) { Chris@0: return; Chris@0: } Chris@0: Chris@0: // Merge the current and the parent stack frame. Chris@0: $current = $this->pop(); Chris@0: $parent = $this->pop(); Chris@0: $this->push($current->merge($parent)); Chris@0: } Chris@0: Chris@0: }