Skip to content

Commit

Permalink
Merge pull request Pauan#17 from Fry-kun/add-maps
Browse files Browse the repository at this point in the history
Added map areas to be treated same as links
  • Loading branch information
Pauan authored Dec 12, 2017
2 parents 4108d16 + e7bc07e commit 16b16a6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/data/AutoScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,16 @@ chrome.storage.local.get(defaults, function (options) {
inner.style.removeProperty("display")
}


const anchor_tags = new Set('a', 'area');
const input_tags = new Set('input', 'textarea');
function isInvalid(elem) {
return elem.isContentEditable ||
(elem.localName === "a" && elem.href) ||
(elem.localName === "textarea") ||
(elem.localName === "input");
(anchor_tags.has(elem.localName) && elem.href) ||
(input_tags.has(elem.localName) && isEditableText(elem));
}

function isEditableText(elem) {
return !(elem.disabled || elem.readOnly);
}

function isValid(elem) {
Expand Down

0 comments on commit 16b16a6

Please sign in to comment.