summaryrefslogtreecommitdiff
path: root/src/HTML5/Parser/EventHandler.php
blob: 8d200b12232da4d46c59369bb3ac34b8556fc819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace HTML5\Parser;

/**
 * Standard events for HTML5.
 *
 * See HTML5 spec section 8.2.4
 */
interface EventHandler {
  /**
   * A doctype declaration.
   */
  public function doctype($name, $publicID, $systemID, $quirks = FALSE);
  /**
   * A start tag.
   */
  public function startTag($name, $attributes = array(), $selfClosing = FALSE);
  /**
   * An end-tag.
   */
  public function endTag($name);
  /**
   * A comment section (unparsed character data).
   */
  public function comment($cdata);
  /**
   * A unit of parsed character data.
   *
   * Entities in this text are *already decoded*.
   */
  public function text($cdata);
  /**
   * Indicates that the document has been entirely processed.
   */
  public function eof();
  /**
   * Emitted when the parser encounters an error condition.
   */
  public function parseError($msg, $line, $col);

  // Do we need...
  // public function cdata();
  // public function processorInstruction();
}