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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp

Issue 2149343002: AX hittest shouldn't crash when <option> element doesn't have corresponding <select> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/accessibility-hit-test-crash-expected.txt ('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/modules/accessibility/AXLayoutObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
index 109ce6a7fd73d77a726e80761d2b9058de9c5a4e..3cf57b9846c1fbab4ead98a655ade10a90b46edd 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -1500,27 +1500,30 @@ IntPoint AXLayoutObject::clickPoint()
AXObject* AXLayoutObject::accessibilityHitTest(const IntPoint& point) const
{
if (!m_layoutObject || !m_layoutObject->hasLayer())
- return 0;
+ return nullptr;
PaintLayer* layer = toLayoutBox(m_layoutObject)->layer();
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
HitTestResult hitTestResult = HitTestResult(request, point);
layer->hitTest(hitTestResult);
- if (!hitTestResult.innerNode())
- return 0;
Node* node = hitTestResult.innerNode();
+ if (!node)
+ return nullptr;
if (isHTMLAreaElement(node))
return accessibilityImageMapHitTest(toHTMLAreaElement(node), point);
- if (isHTMLOptionElement(node))
+ if (isHTMLOptionElement(node)) {
node = toHTMLOptionElement(*node).ownerSelectElement();
+ if (!node)
+ return nullptr;
+ }
LayoutObject* obj = node->layoutObject();
if (!obj)
- return 0;
+ return nullptr;
AXObject* result = axObjectCache().getOrCreate(obj);
result->updateChildrenIfNecessary();
« no previous file with comments | « third_party/WebKit/LayoutTests/accessibility/accessibility-hit-test-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698