Skip to content

Commit

Permalink
perf(htmlcs): improve heading order detection
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed May 4, 2023
1 parent 5653197 commit 2adea2f
Show file tree
Hide file tree
Showing 22 changed files with 193 additions and 212 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ complete. The performance increases we made to the project were not only done at
make the ability of auditing at the MS level for almost any website. Right now, the project is moving forward based on performance
and accuracy for ensuring minimal to no false positives.

## Next Level
## Teleportation like Speeds

As we set the foundation to mark test cases that can pass and increase our target on automating accessibility we have a couple of layers that
can make a major difference to the project. The following will save drastic time and money if done.
Expand Down
8 changes: 4 additions & 4 deletions a11y-js/lib/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
};

// Truncate the html.
const getElementContext = (element) => {
const getElementContext = (element: Element) => {
let outerHTML = element.outerHTML;

if (!outerHTML) {
Expand All @@ -53,19 +53,19 @@
if (element.innerHTML.length > 31) {
outerHTML = outerHTML.replace(
element.innerHTML,
`${element.innerHTML.substring(0, 31)}...`
`${element.innerHTML.substring(0, 32)}...`
);
}

if (outerHTML.length > 251) {
outerHTML = `${outerHTML.substring(0, 250)}...`;
outerHTML = `${outerHTML.substring(0, 251)}...`;
}

return outerHTML;
};

// valid element node
const isElementNode = (element) =>
const isElementNode = (element: Element) =>
element.nodeType === window.Node.ELEMENT_NODE;

// get css selelector
Expand Down
2 changes: 1 addition & 1 deletion a11y-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "a11y-js",
"version": "0.3.44",
"version": "0.3.45",
"description": "Extremely fast accessibility evaluation for nodejs",
"main": "./build/index.js",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion fast_htmlcs/HTMLCS.Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ _global.HTMLCS.util = {
| { red: number; blue: number; green: number; alpha?: number } =
color.toLowerCase();

if (colour.substring(0, 3) === "rgb") {
if (colour.substr(0, 3) === "rgb") {
// rgb[a](0, 0, 0[, 0]) format.
const matches = /^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)([^)]*)\)$/.exec(
colour
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_4 = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
process: function (element, top) {
process: function (element, _) {
HTMLCS.addMessage(
HTMLCS.NOTICE,
element,
Expand Down
Loading

0 comments on commit 2adea2f

Please sign in to comment.