Skip to content

Commit

Permalink
Use getAttribute instead
Browse files Browse the repository at this point in the history
  • Loading branch information
developit authored Apr 21, 2017
1 parent 8a16f72 commit 713e4f2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cq-prolyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -1221,11 +1221,9 @@ function filterRulesByElementAndProp(rules, element, prop) {
if (element.id) {
foundRules = foundRules.concat(rules['#' + element.id] || []);
}
if (element.className) {
element.className.split(/\s+/).forEach(function(className) {
foundRules = foundRules.concat(rules['.' + className] || []);
});
}
(element.getAttribute('class') || '').split(/\s+/).forEach(function(className) {
foundRules = foundRules.concat(rules['.' + className] || []);
});
foundRules = foundRules
.concat(rules[element.tagName.toLowerCase()] || [])
.concat(rules['*'] || []);
Expand Down

0 comments on commit 713e4f2

Please # to comment.