Compat final class
Minn\Html\Tree\Compat · public/minn/src/Minn/Html/Tree/Compat.php · 79 lines
The compatibility mode a doctype indicates, by the identifier lists in the HTML standard: quirks for legacy and missing doctypes, limited quirks for the XHTML 1.0 transitional and frameset ones (and HTML 4.01's with a system identifier), no quirks otherwise.
Used by 1
Constants and properties
| private | QUIRKS_PUBLIC = array ( 0 => '-//w3o//dtd w3 html strict 3.0//en//', 1 => '-/w3c/dtd html 4.0 transitional/en', 2 => 'html', ) | |
| private | QUIRKS_PREFIXES = array ( 0 => '+//silmaril//dtd html pro v0r11 19970101//', 1 => '-//as//dtd html 3.0 aswedit + extensions//', 2 => '-//advasoft ltd//dtd html 3.0 aswedit + extensions//', 3 => '-//ietf//dtd html 2.0 level 1//', 4 => '-//ietf//dtd html 2.0 level 2//', 5 => '-//ietf//dtd html 2.0 strict level 1//', 6 => '-//ietf//dtd html 2.0 strict level 2//', 7 => '-//ietf//dtd html 2.0 strict//', 8 => '-//ietf//dtd html 2.0//', 9 => '-//ietf//dtd html 2.1e//', 10 => '-//ietf//dtd html 3.0//', 11 => '-//ietf//dtd html 3.2 final//', 12 => '-//ietf//dtd html 3.2//', 13 => '-//ietf//dtd html 3//', 14 => '-//ietf//dtd html level 0//', 15 => '-//ietf//dtd html level 1//', 16 => '-//ietf//dtd html level 2//', 17 => '-//ietf//dtd html level 3//', 18 => '-//ietf//dtd html strict level 0//', 19 => '-//ietf//dtd html strict level 1//', 20 => '-//ietf//dtd html strict level 2//', 21 => '-//ietf//dtd html strict level 3//', 22 => '-//ietf//dtd html strict//', 23 => '-//ietf//dtd html//', 24 => '-//metrius//dtd metrius presentational//', 25 => '-//microsoft//dtd internet explorer 2.0 html strict//', 26 => '-//microsoft//dtd internet explorer 2.0 html//', 27 => '-//microsoft//dtd internet explorer 2.0 tables//', 28 => '-//microsoft//dtd internet explorer 3.0 html strict//', 29 => '-//microsoft//dtd internet explorer 3.0 html//', 30 => '-//microsoft//dtd internet explorer 3.0 tables//', 31 => '-//netscape comm. corp.//dtd html//', 32 => '-//netscape comm. corp.//dtd strict html//', 33 => '-//o\'reilly and associates//dtd html 2.0//', 34 => '-//o\'reilly and associates//dtd html extended 1.0//', 35 => '-//o\'reilly and associates//dtd html extended relaxed 1.0//', 36 => '-//sq//dtd html 2.0 hotmetal + extensions//', 37 => '-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//', 38 => '-//softquad//dtd hotmetal pro 4.0::19970916::extensions to html 4.0//', 39 => '-//spyglass//dtd html 2.0 extended//', 40 => '-//sun microsystems corp.//dtd hotjava html//', 41 => '-//sun microsystems corp.//dtd hotjava strict html//', 42 => '-//w3c//dtd html 3 1995-03-24//', 43 => '-//w3c//dtd html 3.2 draft//', 44 => '-//w3c//dtd html 3.2 final//', 45 => '-//w3c//dtd html 3.2//', 46 => '-//w3c//dtd html 3.2s draft//', 47 => '-//w3c//dtd html 4.0 frameset//', 48 => '-//w3c//dtd html 4.0 transitional//', 49 => '-//w3c//dtd html experimental 19960712//', 50 => '-//w3c//dtd html experimental 970421//', 51 => '-//w3c//dtd w3 html//', 52 => '-//w3o//dtd w3 html 3.0//', 53 => '-//webtechs//dtd mozilla html 2.0//', 54 => '-//webtechs//dtd mozilla html//', ) | |
| private | HTML401 = array ( 0 => '-//w3c//dtd html 4.01 frameset//', 1 => '-//w3c//dtd html 4.01 transitional//', ) | |
| private | XHTML10 = array ( 0 => '-//w3c//dtd xhtml 1.0 frameset//', 1 => '-//w3c//dtd xhtml 1.0 transitional//', ) |
Public
| static | of(array $doctype): string# | The mode ("no-quirks", "limited-quirks", "quirks") for a doctype's pieces.
| |||
| static | read(string $html): ?array# | A whole doctype token read: its name (lower-cased), identifiers and mode; a malformed one is quirks. Null when the text is not one doctype. @return array{name: ?string, public: ?string, system: ?string, mode: string}|null |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | startsWithAny(string $text, array $prefixes): bool# |
|
Nothing matches.