Browse Source

Finished off outerHTML

split-manual
Dustin Wilson 3 years ago
parent
commit
b6c854be11
  1. 22
      lib/DOM/Element.php
  2. 12
      vendor-bin/phpunit/composer.lock

22
lib/DOM/Element.php

@ -52,7 +52,10 @@ class Element extends \DOMElement {
# 2.4 Extensions to the Element interface # 2.4 Extensions to the Element interface
# outerHTML # outerHTML
# #
# On getting, return the result of invoking the fragment serializing algorithm on a fictional node whose only child is the context object providing true for the require well-formed flag (this might throw an exception instead of returning a string). # On getting, return the result of invoking the fragment serializing algorithm
# on a fictional node whose only child is the context object providing true for
# the require well-formed flag (this might throw an exception instead of
# returning a string).
// DEVIATION: Parsing of XML documents will not be handled by this // DEVIATION: Parsing of XML documents will not be handled by this
// implementation, so there's no need for the well-formed flag. // implementation, so there's no need for the well-formed flag.
// OPTIMIZATION: When following the instructions above the fragment serializing // OPTIMIZATION: When following the instructions above the fragment serializing
@ -120,7 +123,7 @@ class Element extends \DOMElement {
// DEVIATION: Normally the tree mutation record would do the actual replacement, // DEVIATION: Normally the tree mutation record would do the actual replacement,
// but there is no scripting in this implementation. Going to simply append the // but there is no scripting in this implementation. Going to simply append the
// fragment instead. // fragment instead.
$this->appendChild($ook); $this->appendChild($frag);
} }
break; break;
@ -145,7 +148,20 @@ class Element extends \DOMElement {
throw new DOMException(DOMException::NO_MODIFICATION_ALLOWED); throw new DOMException(DOMException::NO_MODIFICATION_ALLOWED);
} }
# 4. parent is a DocumentFragment, let parent be a new Element with: # 4. parent is a DocumentFragment, let parent be a new Element with:
# • body as its local name,
# • The HTML namespace as its namespace, and
# • The context object's node document as its node document.
elseif ($parent instanceof DocumentFragment) {
$parent = $this->ownerDocument->createElement('body');
}
# 5. Let fragment be the result of invoking the fragment parsing algorithm with
# the new value as markup, and parent as the context element.
$fragment = Parser::parse($value, $this->ownerDocument, $this->ownerDocument->documentEncoding, $parent);
# 6. Replace the context object with fragment within the context object's
# parent.
$this->parentNode->replaceChild($fragment, $this);
break; break;
} }
} }
@ -161,7 +177,7 @@ class Element extends \DOMElement {
} }
// Since tag names can contain characters that are invalid in PHP's XML DOM // Since tag names can contain characters that are invalid in PHP's XML DOM
// uncoerce the name when printing. // uncoerce the name when printing if necessary.
if (strpos($tagName, 'U') !== false) { if (strpos($tagName, 'U') !== false) {
$tagName = $this->uncoerceName($tagName); $tagName = $this->uncoerceName($tagName);
} }

12
vendor-bin/phpunit/composer.lock

@ -845,16 +845,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "9.5.2", "version": "9.5.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "f661659747f2f87f9e72095bb207bceb0f151cb4" "reference": "27241ac75fc37ecf862b6e002bf713b6566cbe41"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f661659747f2f87f9e72095bb207bceb0f151cb4", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/27241ac75fc37ecf862b6e002bf713b6566cbe41",
"reference": "f661659747f2f87f9e72095bb207bceb0f151cb4", "reference": "27241ac75fc37ecf862b6e002bf713b6566cbe41",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -932,7 +932,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.2" "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.3"
}, },
"funding": [ "funding": [
{ {
@ -944,7 +944,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-02T14:45:58+00:00" "time": "2021-03-17T07:30:34+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",

Loading…
Cancel
Save