| Index: third_party/WebKit/Source/core/html/HTMLElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp
|
| index fd68fa31ba72fa0ed183a71a9b33b27b5f67b11e..109d11ae0a12ef73484586fb6398a6e4c1abb1f1 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp
|
| @@ -954,7 +954,7 @@ HTMLMenuElement* HTMLElement::contextMenu() const
|
| if (contextMenuId.isNull())
|
| return nullptr;
|
|
|
| - Element* element = treeScope().getElementById(contextMenuId);
|
| + Element* element = treeScopeOrDocument().getElementById(contextMenuId);
|
| // Not checking if the menu element is of type "popup".
|
| // Ignoring menu element type attribute is intentional according to the standard.
|
| return isHTMLMenuElement(element) ? toHTMLMenuElement(element) : nullptr;
|
| @@ -975,7 +975,7 @@ void HTMLElement::setContextMenu(HTMLMenuElement* contextMenu)
|
| // Otherwise, the content attribute must be set to the empty string.
|
| const AtomicString& contextMenuId(contextMenu->fastGetAttribute(idAttr));
|
|
|
| - if (!contextMenuId.isNull() && contextMenu == treeScope().getElementById(contextMenuId))
|
| + if (!contextMenuId.isNull() && contextMenu == treeScopeOrDocument().getElementById(contextMenuId))
|
| setAttribute(contextmenuAttr, contextMenuId);
|
| else
|
| setAttribute(contextmenuAttr, "");
|
|
|