Commit f07cd31f authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Chromium LUCI CQ

Fix crash in AccessibilityMediaElement

R=aboxhall@chromium.org

Bug: 1167269
Change-Id: I5bb0f5fac139dcf16631482e4a21a85e41bd92c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2636892
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845141}
parent aa4d8958
...@@ -58,15 +58,21 @@ AXRestriction AccessibilityMediaElement::Restriction() const { ...@@ -58,15 +58,21 @@ AXRestriction AccessibilityMediaElement::Restriction() const {
} }
bool AccessibilityMediaElement::HasControls() const { bool AccessibilityMediaElement::HasControls() const {
if (IsDetached())
return false;
return To<HTMLMediaElement>(GetNode())->ShouldShowControls(); return To<HTMLMediaElement>(GetNode())->ShouldShowControls();
} }
bool AccessibilityMediaElement::HasEmptySource() const { bool AccessibilityMediaElement::HasEmptySource() const {
if (IsDetached())
return false;
return To<HTMLMediaElement>(GetNode())->getNetworkState() == return To<HTMLMediaElement>(GetNode())->getNetworkState() ==
HTMLMediaElement::kNetworkEmpty; HTMLMediaElement::kNetworkEmpty;
} }
bool AccessibilityMediaElement::IsUnplayable() const { bool AccessibilityMediaElement::IsUnplayable() const {
if (IsDetached())
return true;
HTMLMediaElement* element = HTMLMediaElement* element =
static_cast<HTMLMediaElement*>(layout_object_->GetNode()); static_cast<HTMLMediaElement*>(layout_object_->GetNode());
HTMLMediaElement::NetworkState network_state = element->getNetworkState(); HTMLMediaElement::NetworkState network_state = element->getNetworkState();
......
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