diff options
Diffstat (limited to 'src/HTML5/Parser/DOMTreeBuilder.php')
-rw-r--r-- | src/HTML5/Parser/DOMTreeBuilder.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/HTML5/Parser/DOMTreeBuilder.php b/src/HTML5/Parser/DOMTreeBuilder.php index 5df4177..a5a20ba 100644 --- a/src/HTML5/Parser/DOMTreeBuilder.php +++ b/src/HTML5/Parser/DOMTreeBuilder.php @@ -81,6 +81,16 @@ class DOMTreeBuilder implements EventHandler { } /** + * Get the DOM fragment for the body. + * + * This returns a DOMNodeList because a fragment may have zero or more + * DOMNodes at its root. + */ + public function fragment() { + return $this->doc->documentElement->childNodes; + } + + /** * Provide an instruction processor. * * This is used for handling Processor Instructions as they are |