/**
* Updates the current frame of the stack.
*
* @param array &$element
* The element of the render array that has just been rendered. The stack
* frame for this element will be updated with the bubbleable rendering
* metadata of this element.
*/
public function update(&
$element) { // The latest frame represents the bubbleable metadata for the subtree.
$frame =
$this->
pop();
// Update the frame, but also update the current element, to ensure it
// contains up-to-date information in case it gets render cached.
$updated_frame = BubbleableMetadata::
createFromRenderArray($element)->
merge($frame);
$updated_frame->
applyTo($element);
$this->
push($updated_frame);
} /**
* Bubbles the stack.
*
* Whenever another level in the render array has been rendered, the stack
* must be bubbled, to merge its rendering metadata with that of the parent
* element.
*/