Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: third_party/WebKit/Source/web/WebAXObject.cpp

Issue 2207633003: Fix crash in WebAXObject::showContextMenu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/accessibility/show-context-menu-crash.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebAXObject.cpp
diff --git a/third_party/WebKit/Source/web/WebAXObject.cpp b/third_party/WebKit/Source/web/WebAXObject.cpp
index 05c7c8b40f5531099fe31a85354349d16bb46d8e..c80ceb5a79ad0b4bc4ebc982d3747983e6a3d657 100644
--- a/third_party/WebKit/Source/web/WebAXObject.cpp
+++ b/third_party/WebKit/Source/web/WebAXObject.cpp
@@ -972,9 +972,13 @@ void WebAXObject::showContextMenu() const
Element* element = nullptr;
if (node->isElementNode()) {
element = toElement(node);
+ } else if (node->isDocumentNode()) {
+ element = node->document().documentElement();
} else {
node->updateDistribution();
ContainerNode* parent = FlatTreeTraversal::parent(*node);
+ if (!parent)
+ return;
ASSERT_WITH_SECURITY_IMPLICATION(parent->isElementNode());
element = toElement(parent);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/accessibility/show-context-menu-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698