You are here

public function DOMTreeBuilder::doctype in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php \Masterminds\HTML5\Parser\DOMTreeBuilder::doctype()

A doctype declaration.

Parameters

string $name: The name of the root element.

int $idType: One of DOCTYPE_NONE, DOCTYPE_PUBLIC, or DOCTYPE_SYSTEM.

string $id: The identifier. For DOCTYPE_PUBLIC, this is the public ID. If DOCTYPE_SYSTEM, then this is a system ID.

boolean $quirks: Indicates whether the builder should enter quirks mode.

Overrides EventHandler::doctype

File

vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php, line 237

Class

DOMTreeBuilder
Create an HTML5 DOM tree from events.

Namespace

Masterminds\HTML5\Parser

Code

public function doctype($name, $idType = 0, $id = null, $quirks = false) {

  // This is used solely for setting quirks mode. Currently we don't
  // try to preserve the inbound DT. We convert it to HTML5.
  $this->quirks = $quirks;
  if ($this->insertMode > static::IM_INITIAL) {
    $this
      ->parseError("Illegal placement of DOCTYPE tag. Ignoring: " . $name);
    return;
  }
  $this->insertMode = static::IM_BEFORE_HTML;
}