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 articles showing cookie information in reader mode #746

Merged
merged 5 commits into from
Jan 19, 2023

Conversation

tthhtao
Copy link
Contributor

@tthhtao tthhtao commented Apr 15, 2022

Applying the aria-modal property to an element with role="dialog" replaces the technique of using aria-hidden in the background. So I think this kind of element should also be considered "invisible" to the reader.

@tthhtao tthhtao marked this pull request as draft April 15, 2022 07:09
@tthhtao tthhtao marked this pull request as ready for review April 15, 2022 07:09
@tthhtao tthhtao marked this pull request as draft April 15, 2022 18:48
@tthhtao tthhtao marked this pull request as ready for review April 15, 2022 18:49
@tigleym tigleym requested review from niklasbaumgardner and tigleym and removed request for niklasbaumgardner April 19, 2022 16:14
Copy link
Contributor

@tigleym tigleym left a comment

Choose a reason for hiding this comment

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

Thanks @tthhtao ! This works nicely, but I think we should address the comment I have here.

Readability.js Outdated
Comment on lines 907 to 911
// User is not able to see elements applied with both "aria-modla = true" and "role = dialog"
if (node.getAttribute("aria-modal") == "true" && node.getAttribute("role") == "dialog") {
node = this._removeAndGetNext(node);
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be added to the check in isProbablyVisible.

Copy link
Contributor

@tigleym tigleym May 4, 2022

Choose a reason for hiding this comment

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

We should remove this check since it should be handled in the one above now

EDIT

On second thought, perhaps it makes sense to keep this check separate. Let's keep this here and remove the check added in isProbablyVisible. Sorry about that!

Readability.js Outdated
@@ -2202,7 +2208,9 @@ Readability.prototype = {
return (!node.style || node.style.display != "none")
&& !node.hasAttribute("hidden")
//check for "fallback-image" so that wikimedia math images are displayed
&& (!node.hasAttribute("aria-hidden") || node.getAttribute("aria-hidden") != "true" || (node.className && node.className.indexOf && node.className.indexOf("fallback-image") !== -1));
&& (!node.hasAttribute("aria-hidden") || node.getAttribute("aria-hidden") != "true" || (node.className && node.className.indexOf && node.className.indexOf("fallback-image") !== -1))
// user can not see element applied with both attribute "aria-modla = true" and "role = dialog"
Copy link
Contributor

Choose a reason for hiding this comment

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

"arial-modal"

Readability.js Outdated
Comment on lines 907 to 911
// User is not able to see elements applied with both "aria-modla = true" and "role = dialog"
if (node.getAttribute("aria-modal") == "true" && node.getAttribute("role") == "dialog") {
node = this._removeAndGetNext(node);
continue;
}
Copy link
Contributor

@tigleym tigleym May 4, 2022

Choose a reason for hiding this comment

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

We should remove this check since it should be handled in the one above now

EDIT

On second thought, perhaps it makes sense to keep this check separate. Let's keep this here and remove the check added in isProbablyVisible. Sorry about that!

@gijsk
Copy link
Contributor

gijsk commented Jan 19, 2023

I think all the review comments were addressed so let's get this merged.

@gijsk gijsk merged commit e6ee917 into mozilla:master Jan 19, 2023
@gijsk
Copy link
Contributor

gijsk commented Jan 19, 2023

@tthhtao sorry this sat for such a long time!

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