Commit 59d80701 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Null check the computed style

Bug: 1065763
Change-Id: I154a3446d3893916831c66f6a5ecbd36d94b4f57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2127428
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756359}
parent 721c5c2f
...@@ -1710,6 +1710,8 @@ bool AXObject::IsHiddenViaStyle() const { ...@@ -1710,6 +1710,8 @@ bool AXObject::IsHiddenViaStyle() const {
auto* element = DynamicTo<Element>(node); auto* element = DynamicTo<Element>(node);
while (element && !element->GetLayoutObject()) { while (element && !element->GetLayoutObject()) {
const ComputedStyle* style = element->EnsureComputedStyle(); const ComputedStyle* style = element->EnsureComputedStyle();
if (!style)
continue;
if (is_first_loop && style->Visibility() != EVisibility::kVisible) if (is_first_loop && style->Visibility() != EVisibility::kVisible)
return true; return true;
// CSS Display: // CSS Display:
...@@ -1750,6 +1752,8 @@ bool AXObject::IsHiddenForTextAlternativeCalculation() const { ...@@ -1750,6 +1752,8 @@ bool AXObject::IsHiddenForTextAlternativeCalculation() const {
auto* element = DynamicTo<Element>(node); auto* element = DynamicTo<Element>(node);
if (element && node->isConnected()) { if (element && node->isConnected()) {
const ComputedStyle* style = element->EnsureComputedStyle(); const ComputedStyle* style = element->EnsureComputedStyle();
if (!style)
return false;
return style->Display() == EDisplay::kNone || return style->Display() == EDisplay::kNone ||
style->Visibility() != EVisibility::kVisible; style->Visibility() != EVisibility::kVisible;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment