You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
857 B
29 lines
857 B
3 years ago
|
<?php
|
||
|
/**
|
||
|
* @license MIT
|
||
|
* Copyright 2017 Dustin Wilson, J. King, et al.
|
||
|
* See LICENSE and AUTHORS files for details
|
||
|
*/
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
namespace MensBeam\HTML\DOM;
|
||
3 years ago
|
use MensBeam\HTML\DOM\Inner\Reflection;
|
||
3 years ago
|
|
||
|
|
||
3 years ago
|
class HTMLTemplateElement extends HTMLElement {
|
||
3 years ago
|
protected DocumentFragment $_content;
|
||
|
|
||
3 years ago
|
// Templates can contain content in both light and shadow, so its content
|
||
|
// fragment must be stored here instead of in PHP's main inner document tree.
|
||
3 years ago
|
protected function __get_content(): DocumentFragment {
|
||
|
return $this->_content;
|
||
|
}
|
||
|
|
||
3 years ago
|
|
||
3 years ago
|
protected function __construct(\DOMElement $element) {
|
||
3 years ago
|
parent::__construct($element);
|
||
|
|
||
3 years ago
|
$this->_content = $this->ownerDocument->createDocumentFragment();
|
||
3 years ago
|
Reflection::setProtectedProperties($this->_content, [ 'host' => \WeakReference::create($this) ]);
|
||
3 years ago
|
}
|
||
|
}
|