Chromium Code Reviews| 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". |