Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle noscript and template in dom.isVisible #1257

Merged
merged 4 commits into from
Nov 27, 2018

Conversation

jeeyyy
Copy link
Contributor

@jeeyyy jeeyyy commented Nov 23, 2018

Whilst solving for a non-reproducible region rule bug (#864), decided to enhance current dom.isVisible implementation to cater for noscript and template tags.

Closes issue: NA

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Follows the commit message policy, appropriate for next version
  • Has documentation updated, a DU ticket, or requires no documentation change
  • Includes new tests, or was unnecessary
  • Code is reviewed for security by: dylanb

@jeeyyy jeeyyy requested a review from a team as a code owner November 23, 2018 11:47
@@ -56,8 +56,7 @@ dom.isVisible = function(el, screenReader, recursed) {

if (
style.getPropertyValue('display') === 'none' ||
nodeName.toUpperCase() === 'STYLE' ||
nodeName.toUpperCase() === 'SCRIPT' ||
['STYLE', 'SCRIPT', 'NOSCRIPT', 'TEMPLATE'].includes(nodeName) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is nodeName always uppercase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dylanb
Copy link
Contributor

dylanb commented Nov 27, 2018

@JKODU I would prefer if this change could be squashed or rebased before merging.

@jeeyyy jeeyyy merged commit e67fc65 into develop Nov 27, 2018
@jeeyyy jeeyyy deleted the update-is-visible-fn branch November 27, 2018 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants