Skip to content

Commit

Permalink
Remove code needed to extract element attributes
Browse files Browse the repository at this point in the history
Done upstream in whatwg/html#6752
  • Loading branch information
dontcallmedom committed Jun 9, 2021
1 parent 9486eb6 commit 097d012
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions src/browserlib/extract-dfns.mjs
Expand Up @@ -355,12 +355,6 @@ function preProcessHTML() {
[...document.querySelectorAll("dfn[id]:not([data-dfn-type]):not([data-skip])")]
.forEach(el => {
// Hard coded rules for special ids
// hyphen in attribute name throws off other match rules
if (el.id === "attr-form-accept-charset") {
el.dataset.dfnType = 'element-attr';
el.dataset.dfnFor = "form";
return;
}
// dom-style is defined elsewhere
if (el.id === "dom-style") {
el.dataset.dfnType = 'attribute';
Expand Down Expand Up @@ -392,32 +386,6 @@ function preProcessHTML() {
return;
}
}
if ((m = el.id.match(/^attr-([^-]+)-([^-]+)$/))) {
// e.g. attr-ul-type
el.dataset.dfnType = 'element-attr';
let _for = fromIdToElement(m[1]);
// special casing usemap attribute
if (m[1] === "hyperlink" && m[2] === "usemap") {
_for = "img,object";
return;
}
if (m[1] === "aria") {
// reference to external defined elements, noexport
el.dataset.noexport = true;
return;
}
// "loading", "crossorigin", "autocapitalize" are used in middle position
// when describing possible keywords
if (["loading", "crossorigin", "autocapitalize"].includes(m[1])) {
el.dataset.dfnType = 'dfn';
// Not sure how to indicate this is for an attribute value
// _for = m[1];
}
if (_for && !el.dataset.dfnFor) {
el.dataset.dfnFor = _for;
}
return;
}
if ((m = el.id.match(/^attr-([^-]+)$/))) {
el.dataset.dfnType = 'element-attr';
// not sure how to encode "every html element"?
Expand Down

0 comments on commit 097d012

Please sign in to comment.