Browse Source

Adding individual element classes and seeing what affect it has

element-classes
Dustin Wilson 3 years ago
parent
commit
584329f090
  1. 123
      lib/Document.php
  2. 2
      lib/ElementMap.php
  3. 9
      lib/HTMLAnchorElement.php
  4. 10
      lib/HTMLAreaElement.php
  5. 10
      lib/HTMLAudioElement.php
  6. 10
      lib/HTMLBRElement.php
  7. 10
      lib/HTMLBaseElement.php
  8. 10
      lib/HTMLBodyElement.php
  9. 10
      lib/HTMLButtonElement.php
  10. 10
      lib/HTMLCanvasElement.php
  11. 10
      lib/HTMLDListElement.php
  12. 10
      lib/HTMLDataElement.php
  13. 10
      lib/HTMLDataListElement.php
  14. 10
      lib/HTMLDetailsElement.php
  15. 10
      lib/HTMLDialogElement.php
  16. 10
      lib/HTMLDivElement.php
  17. 6
      lib/HTMLElement.php
  18. 10
      lib/HTMLEmbedElement.php
  19. 10
      lib/HTMLFieldSetElement.php
  20. 10
      lib/HTMLFormElement.php
  21. 10
      lib/HTMLHRElement.php
  22. 10
      lib/HTMLHeadElement.php
  23. 10
      lib/HTMLHeadingElement.php
  24. 9
      lib/HTMLHtmlElement.php
  25. 10
      lib/HTMLIFrameElement.php
  26. 10
      lib/HTMLImageElement.php
  27. 10
      lib/HTMLInputElement.php
  28. 10
      lib/HTMLLIElement.php
  29. 10
      lib/HTMLLegendElement.php
  30. 10
      lib/HTMLLinkElement.php
  31. 10
      lib/HTMLMapElement.php
  32. 10
      lib/HTMLMediaElement.php
  33. 10
      lib/HTMLMetaElement.php
  34. 10
      lib/HTMLMeterElement.php
  35. 10
      lib/HTMLModElement.php
  36. 10
      lib/HTMLOListElement.php
  37. 10
      lib/HTMLObjectElement.php
  38. 10
      lib/HTMLOptGroupElement.php
  39. 10
      lib/HTMLOptionElement.php
  40. 10
      lib/HTMLOptionsElement.php
  41. 10
      lib/HTMLOutputElement.php
  42. 10
      lib/HTMLParagraphElement.php
  43. 10
      lib/HTMLParamElement.php
  44. 10
      lib/HTMLPictureElement.php
  45. 10
      lib/HTMLPreElement.php
  46. 10
      lib/HTMLProgressElement.php
  47. 10
      lib/HTMLQuoteElement.php
  48. 10
      lib/HTMLScriptElement.php
  49. 10
      lib/HTMLSelectElement.php
  50. 10
      lib/HTMLSlotElement.php
  51. 10
      lib/HTMLSourceElement.php
  52. 10
      lib/HTMLSpanElement.php
  53. 10
      lib/HTMLStyleElement.php
  54. 10
      lib/HTMLTableCaptionElement.php
  55. 10
      lib/HTMLTableCellElement.php
  56. 10
      lib/HTMLTableColElement.php
  57. 10
      lib/HTMLTableElement.php
  58. 10
      lib/HTMLTableRowElement.php
  59. 10
      lib/HTMLTableSectionElement.php
  60. 20
      lib/HTMLTemplateElement.php
  61. 10
      lib/HTMLTextAreaElement.php
  62. 10
      lib/HTMLTitleElement.php
  63. 10
      lib/HTMLTrackElement.php
  64. 10
      lib/HTMLUListElement.php
  65. 10
      lib/HTMLUnknownElement.php
  66. 10
      lib/HTMLVideoElement.php
  67. 11
      lib/MathMLElement.php
  68. 10
      lib/SVGAElement.php
  69. 10
      lib/SVGAnimateElement.php
  70. 10
      lib/SVGAnimateMotionElement.php
  71. 10
      lib/SVGAnimateTransformElement.php
  72. 10
      lib/SVGAnimationElement.php
  73. 10
      lib/SVGCircleElement.php
  74. 10
      lib/SVGClipPathElement.php
  75. 10
      lib/SVGColorMatrixElement.php
  76. 10
      lib/SVGComponentTransferElement.php
  77. 10
      lib/SVGComponentTransferFunctionElement.php
  78. 10
      lib/SVGCursorElement.php
  79. 10
      lib/SVGDefsElement.php
  80. 10
      lib/SVGDescElement.php
  81. 11
      lib/SVGElement.php
  82. 10
      lib/SVGEllipseElement.php
  83. 10
      lib/SVGFEBlendElement.php
  84. 10
      lib/SVGFECompositeElement.php
  85. 10
      lib/SVGFEConvolveMatrixElement.php
  86. 10
      lib/SVGFEDiffuseLightingElement.php
  87. 10
      lib/SVGFEDisplacementMapElement.php
  88. 10
      lib/SVGFEDistantLightElement.php
  89. 10
      lib/SVGFEDropShadowElement.php
  90. 10
      lib/SVGFEFloodElement.php
  91. 10
      lib/SVGFEFuncAElement.php
  92. 10
      lib/SVGFEFuncBElement.php
  93. 10
      lib/SVGFEFuncGElement.php
  94. 10
      lib/SVGFEFuncRElement.php
  95. 10
      lib/SVGFEGaussianBlurElement.php
  96. 10
      lib/SVGFEImageElement.php
  97. 10
      lib/SVGFEMergeElement.php
  98. 10
      lib/SVGFEMorphologyElement.php
  99. 10
      lib/SVGFEOffsetElement.php
  100. 10
      lib/SVGFEPointLightElement.php

123
lib/Document.php

@ -181,13 +181,11 @@ class Document extends AbstractDocument {
$qualifiedName = ($namespaceURI === null) ? strtolower(trim($qualifiedName)) : trim($qualifiedName);
try {
if ($qualifiedName !== 'template' || $namespaceURI !== null) {
$className = $this->qualifiedNameToClassName($qualifiedName, $namespaceURI);
if ($className === null) {
$e = parent::createElementNS($namespaceURI, $qualifiedName, $value);
} else {
$e = new HTMLTemplateElement($this, $qualifiedName, $value);
// Template elements need to have a reference kept in userland
ElementMap::set($e);
$e->content = $this->createDocumentFragment();
$e = new $className($this, $qualifiedName, $value);
}
return $e;
@ -212,7 +210,7 @@ class Document extends AbstractDocument {
public function importNode(\DOMNode $node, bool $deep = false) {
$node = parent::importNode($node, $deep);
if ($node instanceof \DOMElement) {
if ($node instanceof Element && !$node instanceof HTMLElement && !$node instanceof SVGElement && !$node instanceof MathMLElement) {
$node = $this->convertElementToSubClass($node);
}
@ -229,7 +227,7 @@ class Document extends AbstractDocument {
return true;
}
public function loadDOM(\DOMDocument $source, ?string $encoding = null, int $quirksMode = 0) {
public function loadDOM(\DOMDocument $source, ?string $encoding = null, int $quirksMode = 0): bool {
if (!$source instanceof \DOMDocument) {
throw new DOMException(DOMException::ARGUMENT_TYPE_ERROR, 1, 'source', '\DOMDocument', gettype($source));
}
@ -251,16 +249,44 @@ class Document extends AbstractDocument {
}
}
$templates = $this->walk(function($n) {
if ($n instanceof Element && $n->namespaceURI === null && $n->nodeName === 'template') {
return true;
/*while (true) {
$elements = $this->walk(function($n) {
if ($n instanceof Element && !$n instanceof HTMLElement && !$n instanceof SVGElement && !$n instanceof MathMLElement && $n->nodeName !== 'template' && $this->qualifiedNameToClassName($n->nodeName, $n->namespaceURI) !== null) {
return true;
}
});
echo (memory_get_peak_usage() / 1024 / 1024) . "\n";
$element = $elements->current();
if ($element !== null) {
$element->parentNode->replaceChild($this->convertElementToSubClass($element), $element);
continue;
}
});
foreach ($templates as $template) {
$template->replaceWith($this->convertElementToSubClass($template));
break;
}
while (true) {
// Do templates last so any child elements can be converted to their appropriate
// sub classes before the template is converted.
$elements = $this->walk(function($n) {
if ($n instanceof Element && !$n instanceof HTMLElement && !$n instanceof SVGElement && !$n instanceof MathMLElement && $n->namespaceURI === null && $n->nodeName === 'template') {
return true;
}
});
echo (memory_get_peak_usage() / 1024 / 1024) . "\n";
$element = $elements->current();
if ($element !== null) {
$element->parentNode->replaceChild($this->convertElementToSubClass($element), $element);
continue;
}
break;
}*/
return true;
}
@ -786,22 +812,83 @@ class Document extends AbstractDocument {
private function convertElementToSubClass(\DOMElement $element): \DOMElement {
if ($element->namespaceURI === null && $element->nodeName === 'template') {
$template = $this->createElement('template');
$className = $this->qualifiedNameToClassName($element->nodeName, $element->namespaceURI);
if ($className !== null) {
$newElement = $this->createElement($element->nodeName);
while ($element->attributes->length > 0) {
$template->setAttributeNode($element->attributes->item(0));
$newElement->setAttributeNode($element->attributes->item(0));
}
$target = (!$newElement instanceof HTMLTemplateElement) ? $newElement : $newElement->content;
while ($element->hasChildNodes()) {
$template->content->appendChild($element->firstChild);
$target->appendChild($element->firstChild);
}
$element = $template;
$element = $newElement;
}
return $element;
}
private function qualifiedNameToClassName(string $qualifiedName, ?string $namespaceURI = null): ?string {
if ($namespaceURI === null) {
switch ($qualifiedName) {
case 'a': $className = 'HTMLAnchorElement';
break;
case 'area': $className = 'HTMLAreaElement';
break;
case 'audio': $className = 'HTMLAudioElement';
break;
case 'base': $className = 'HTMLBaseElement';
break;
case 'body': $className = 'HTMLBodyElement';
break;
case 'br': $className = 'HTMLBRElement';
break;
case 'button': $className = 'HTMLButtonElement';
break;
case 'canvas': $className = 'HTMLCanvasElement';
break;
case 'data': $className = 'HTMLDataElement';
break;
case 'datalist': $className = 'HTMLDataListElement';
break;
case 'details': $className = 'HTMLDetailsElement';
break;
case 'dialog': $className = 'HTMLDetailsElement';
break;
case 'head': $className = 'HTMLHeadElement';
break;
case 'h1':
case 'h2':
case 'h3':
case 'h4':
case 'h5':
case 'h6': $className = 'HTMLHeadingElement';
break;
case 'html': $className = 'HTMLHtmlElement';
break;
case 'p': $className = 'HTMLParagraphElement';
break;
case 'template': $className = 'HTMLTemplateElement';
break;
default: return null;
}
} /*elseif ($namespaceURI === Parser::SVG_NAMESPACE) {
return null;
}*/ else {
return null;
}
return __NAMESPACE__ . "\\$className";
}
public function __destruct() {
ElementMap::destroy($this);
}
public function __toString() {
return $this->saveHTML();

2
lib/ElementMap.php

@ -10,7 +10,7 @@ namespace MensBeam\HTML\DOM;
// This is a write-only map of elements which need to be kept in memory; it
// exists because values of properties on derived DOM classes are lost unless at
// least one PHP reference is kept for the element somewhere in userspace. This
// is that somewhere. It is at present only used for template elements.
// is that somewhere.
class ElementMap {
protected static $_storage = [];

9
lib/HTMLAnchorElement.php

@ -0,0 +1,9 @@
<?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;
class HTMLAnchorElement extends HTMLElement {}

10
lib/HTMLAreaElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLAreaElement extends HTMLElement {}

10
lib/HTMLAudioElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLAudioElement extends HTMLElement {}

10
lib/HTMLBRElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLBRElement extends HTMLElement {}

10
lib/HTMLBaseElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLBaseElement extends HTMLElement {}

10
lib/HTMLBodyElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLBodyElement extends HTMLElement {}

10
lib/HTMLButtonElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLButtonElement extends HTMLElement {}

10
lib/HTMLCanvasElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLCanvasElement extends HTMLElement {}

10
lib/HTMLDListElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLDListElement extends HTMLElement {}

10
lib/HTMLDataElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLDataElement extends HTMLElement {}

10
lib/HTMLDataListElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLDataListElement extends HTMLElement {}

10
lib/HTMLDetailsElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLDetailsElement extends HTMLElement {}

10
lib/HTMLDialogElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLDialogElement extends HTMLElement {}

10
lib/HTMLDivElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLDivElement extends HTMLElement {}

6
lib/HTMLElement.php

@ -6,7 +6,9 @@
declare(strict_types=1);
namespace MensBeam\HTML\DOM;
class HTMLElement extends Element {
abstract class HTMLElement extends Element {
use HTMLOrForeignElement;
protected function __get_accessKey(): string {
# The accessKey IDL attribute must reflect the accesskey content attribute.
return $this->getAttribute('accesskey');
@ -39,7 +41,7 @@ class HTMLElement extends Element {
# be set to the string "false", and otherwise the attribute setter must throw a
# "SyntaxError" DOMException.
switch ($value) {
case 'inherit'
case 'inherit':
$this->removeAttribute('contenteditable');
case 'false':
case 'true':

10
lib/HTMLEmbedElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLEmbedElement extends HTMLElement {}

10
lib/HTMLFieldSetElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLFieldSetElement extends HTMLElement {}

10
lib/HTMLFormElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLFormElement extends HTMLElement {}

10
lib/HTMLHRElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLHRElement extends HTMLElement {}

10
lib/HTMLHeadElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLHeadElement extends HTMLElement {}

10
lib/HTMLHeadingElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLHeadingElement extends HTMLElement {}

9
lib/HTMLHtmlElement.php

@ -0,0 +1,9 @@
<?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;
class HTMLHtmlElement extends HTMLElement {}

10
lib/HTMLIFrameElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLIFrameElement extends HTMLElement {}

10
lib/HTMLImageElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLImageElement extends HTMLElement {}

10
lib/HTMLInputElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLInputElement extends HTMLElement {}

10
lib/HTMLLIElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLLIElement extends HTMLElement {}

10
lib/HTMLLegendElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLLegendElement extends HTMLElement {}

10
lib/HTMLLinkElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLLinkElement extends HTMLElement {}

10
lib/HTMLMapElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLMapElement extends HTMLElement {}

10
lib/HTMLMediaElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLMediaElement extends HTMLElement {}

10
lib/HTMLMetaElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLMetaElement extends HTMLElement {}

10
lib/HTMLMeterElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLMeterElement extends HTMLElement {}

10
lib/HTMLModElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLModElement extends HTMLElement {}

10
lib/HTMLOListElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLOListElement extends HTMLElement {}

10
lib/HTMLObjectElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLObjectElement extends HTMLElement {}

10
lib/HTMLOptGroupElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLOptGroupElement extends HTMLElement {}

10
lib/HTMLOptionElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLOptionElement extends HTMLElement {}

10
lib/HTMLOptionsElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLOptionsElement extends HTMLElement {}

10
lib/HTMLOutputElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLOutputElement extends HTMLElement {}

10
lib/HTMLParagraphElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLParagraphElement extends HTMLElement {}

10
lib/HTMLParamElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLParamElement extends HTMLElement {}

10
lib/HTMLPictureElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLPictureElement extends HTMLElement {}

10
lib/HTMLPreElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLPreElement extends HTMLElement {}

10
lib/HTMLProgressElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLProgressElement extends HTMLElement {}

10
lib/HTMLQuoteElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLQuoteElement extends HTMLElement {}

10
lib/HTMLScriptElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLScriptElement extends HTMLElement {}

10
lib/HTMLSelectElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLSelectElement extends HTMLElement {}

10
lib/HTMLSlotElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLSlotElement extends HTMLElement {}

10
lib/HTMLSourceElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLSourceElement extends HTMLElement {}

10
lib/HTMLSpanElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLSpanElement extends HTMLElement {}

10
lib/HTMLStyleElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLStyleElement extends HTMLElement {}

10
lib/HTMLTableCaptionElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLTableCaptionElement extends HTMLElement {}

10
lib/HTMLTableCellElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLTableCellElement extends HTMLElement {}

10
lib/HTMLTableColElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLTableColElement extends HTMLElement {}

10
lib/HTMLTableElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLTableElement extends HTMLElement {}

10
lib/HTMLTableRowElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLTableRowElement extends HTMLElement {}

10
lib/HTMLTableSectionElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLTableSectionElement extends HTMLElement {}

20
lib/HTMLTemplateElement.php

@ -7,23 +7,13 @@ declare(strict_types=1);
namespace MensBeam\HTML\DOM;
/** Class specifically for template elements to handle its content property. */
class HTMLTemplateElement extends Element {
class HTMLTemplateElement extends HTMLElement {
/** @var DocumentFragment */
public $content = null;
public function __construct(Document $ownerDocument, string $qualifiedName, ?string $value = null, string $namespace = '') {
parent::__construct($qualifiedName, $value, $namespace);
// Elements that are created by their constructor in PHP aren't owned by any
// document and are readonly until owned by one. Temporarily append to a
// document fragment so the element will be owned by the supplied owner
// document.
$frag = $ownerDocument->createDocumentFragment();
$frag->appendChild($this);
$frag->removeChild($this);
unset($frag);
}
public function __destruct() {
ElementMap::delete($this);
public function __construct(Document $ownerDocument, string $qualifiedName, ?string $value = null, string $namespace = "") {
parent::__construct($ownerDocument, $qualifiedName, $value, $namespace);
$this->content = $ownerDocument->createDocumentFragment();
}
}

10
lib/HTMLTextAreaElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLTextAreaElement extends HTMLElement {}

10
lib/HTMLTitleElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLTitleElement extends HTMLElement {}

10
lib/HTMLTrackElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLTrackElement extends HTMLElement {}

10
lib/HTMLUListElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLUListElement extends HTMLElement {}

10
lib/HTMLUnknownElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLUnknownElement extends HTMLElement {}

10
lib/HTMLVideoElement.php

@ -0,0 +1,10 @@
<?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;
class HTMLVideoElement extends HTMLElement {}

11
lib/MathMLElement.php

@ -0,0 +1,11 @@
<?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;
class MathMLElement extends Element {
use HTMLOrForeignElement;
}

10
lib/SVGAElement.php

@ -0,0 +1,10 @@
<?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;
class SVGAElement extends HTMLElement {}

10
lib/SVGAnimateElement.php

@ -0,0 +1,10 @@
<?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;
class SVGAnimateElement extends HTMLElement {}

10
lib/SVGAnimateMotionElement.php

@ -0,0 +1,10 @@
<?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;
class SVGAnimateMotionElement extends HTMLElement {}

10
lib/SVGAnimateTransformElement.php

@ -0,0 +1,10 @@
<?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;
class SVGAnimateTransformElement extends HTMLElement {}

10
lib/SVGAnimationElement.php

@ -0,0 +1,10 @@
<?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;
class SVGAnimationElement extends HTMLElement {}

10
lib/SVGCircleElement.php

@ -0,0 +1,10 @@
<?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;
class SVGCircleElement extends HTMLElement {}

10
lib/SVGClipPathElement.php

@ -0,0 +1,10 @@
<?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;
class SVGClipPathElement extends HTMLElement {}

10
lib/SVGColorMatrixElement.php

@ -0,0 +1,10 @@
<?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;
class SVGColorMatrixElement extends HTMLElement {}

10
lib/SVGComponentTransferElement.php

@ -0,0 +1,10 @@
<?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;
class SVGComponentTransferElement extends HTMLElement {}

10
lib/SVGComponentTransferFunctionElement.php

@ -0,0 +1,10 @@
<?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;
class SVGComponentTransferFunctionElement extends HTMLElement {}

10
lib/SVGCursorElement.php

@ -0,0 +1,10 @@
<?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;
class SVGCursorElement extends HTMLElement {}

10
lib/SVGDefsElement.php

@ -0,0 +1,10 @@
<?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;
class SVGDefsElement extends HTMLElement {}

10
lib/SVGDescElement.php

@ -0,0 +1,10 @@
<?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;
class SVGDescElement extends HTMLElement {}

11
lib/SVGElement.php

@ -0,0 +1,11 @@
<?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;
abstract class SVGElement extends Element {
use HTMLOrForeignElement;
}

10
lib/SVGEllipseElement.php

@ -0,0 +1,10 @@
<?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;
class SVGEllipseElement extends HTMLElement {}

10
lib/SVGFEBlendElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEBlendElement extends HTMLElement {}

10
lib/SVGFECompositeElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFECompositeElement extends HTMLElement {}

10
lib/SVGFEConvolveMatrixElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEConvolveMatrixElement extends HTMLElement {}

10
lib/SVGFEDiffuseLightingElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEDiffuseLightingElement extends HTMLElement {}

10
lib/SVGFEDisplacementMapElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEDisplacementMapElement extends HTMLElement {}

10
lib/SVGFEDistantLightElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEDistantLightElement extends HTMLElement {}

10
lib/SVGFEDropShadowElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEDropShadowElement extends HTMLElement {}

10
lib/SVGFEFloodElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEFloodElement extends HTMLElement {}

10
lib/SVGFEFuncAElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEFuncAElement extends HTMLElement {}

10
lib/SVGFEFuncBElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEFuncBElement extends HTMLElement {}

10
lib/SVGFEFuncGElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEFuncGElement extends HTMLElement {}

10
lib/SVGFEFuncRElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEFuncRElement extends HTMLElement {}

10
lib/SVGFEGaussianBlurElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEGaussianBlurElement extends HTMLElement {}

10
lib/SVGFEImageElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEImageElement extends HTMLElement {}

10
lib/SVGFEMergeElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEMergeElement extends HTMLElement {}

10
lib/SVGFEMorphologyElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEMorphologyElement extends HTMLElement {}

10
lib/SVGFEOffsetElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEOffsetElement extends HTMLElement {}

10
lib/SVGFEPointLightElement.php

@ -0,0 +1,10 @@
<?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;
class SVGFEPointLightElement extends HTMLElement {}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save