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

Unified Diff: Source/core/html/HTMLElement.cpp

Issue 721603002: If an element A has a parent element, then A's assigned context menu is the assigned context menu o… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
Index: Source/core/html/HTMLElement.cpp
diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp
index 59e0cba45f063250b31e2a2163e13c282a11bf59..4ab1c11099959fb332a711f7e30e85f470736434 100644
--- a/Source/core/html/HTMLElement.cpp
+++ b/Source/core/html/HTMLElement.cpp
@@ -938,8 +938,11 @@ bool HTMLElement::isInteractiveContent() const
HTMLMenuElement* HTMLElement::contextMenu() const
{
const AtomicString& contextMenuId(fastGetAttribute(contextmenuAttr));
+ // If an element A has a parent element, then A's assigned context menu is
tkent 2014/11/12 07:17:21 You should not change this function. The specific
pals 2014/11/12 09:30:05 Done.
+ // the assigned context menu of its parent element. Otherwise, A's assigned
+ // context menu is null.
if (contextMenuId.isNull())
- return nullptr;
+ return parentElement() ? toHTMLElement(parentElement())->contextMenu() : nullptr;
tkent 2014/11/12 07:17:21 This line has a bad cast. parentElement might not
pals 2014/11/12 09:30:05 Done.
Element* element = treeScope().getElementById(contextMenuId);
// Not checking if the menu element is of type "popup".

Powered by Google App Engine
This is Rietveld 408576698