|
|
@ -159,10 +159,11 @@ class RoboFile extends \Robo\Tasks { |
|
|
|
|
|
|
|
public function constants(): Result { |
|
|
|
$c = $this->collectionBuilder()->addCode(function() { |
|
|
|
$out = ['elem' => [], 'attr' => []]; |
|
|
|
$elems = []; |
|
|
|
$atrs = []; |
|
|
|
// retrieve the single-page HTML specification (this is around 15MB in size) |
|
|
|
$spec = file_get_contents("https://html.spec.whatwg.org/"); |
|
|
|
$attrs = []; |
|
|
|
// retrieve the single-page HTML specification (this is around 12MB in size) |
|
|
|
$spec = file_get_contents("html.html"); //$spec = file_get_contents("https://html.spec.whatwg.org/"); |
|
|
|
// parse it (this may take several seconds |
|
|
|
if ($spec) { |
|
|
|
$p = new DOMParser; |
|
|
@ -186,7 +187,11 @@ class RoboFile extends \Robo\Tasks { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// do a second pass over what's been collected to find global attributes and normalize them to a single "*" entry |
|
|
|
} |
|
|
|
//$spec = file_get_contents("aria.html"); //$spec = file_get_contents("https://www.w3.org/TR/wai-aria/"); |
|
|
|
//$spec = file_get_contents("svg-elem.html"); //$spec = file_get_contents("https://www.w3.org/TR/SVG2/eltindex.html"); |
|
|
|
//$spec = file_get_contents("svg-attr.html"); //$spec = file_get_contents("https://www.w3.org/TR/SVG2/attindex.html"); |
|
|
|
// sort and filter the results for unqiueness |
|
|
|
sort($elems); |
|
|
|
ksort($attrs); |
|
|
|