| Index: Source/core/html/HTMLElement.cpp
|
| diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp
|
| index 27946c5916c246c3fad01ed76b68b23c42353bb5..1b13f31a495e605140d895d2f614739e8805ac17 100644
|
| --- a/Source/core/html/HTMLElement.cpp
|
| +++ b/Source/core/html/HTMLElement.cpp
|
| @@ -48,6 +48,7 @@
|
| #include "core/html/HTMLBRElement.h"
|
| #include "core/html/HTMLFormElement.h"
|
| #include "core/html/HTMLInputElement.h"
|
| +#include "core/html/HTMLMenuElement.h"
|
| #include "core/html/HTMLTemplateElement.h"
|
| #include "core/html/HTMLTextFormControlElement.h"
|
| #include "core/html/parser/HTMLParserIdioms.h"
|
| @@ -900,6 +901,25 @@ bool HTMLElement::isInteractiveContent() const
|
| return false;
|
| }
|
|
|
| +HTMLMenuElement* HTMLElement::contextMenu() const
|
| +{
|
| + const AtomicString& contextMenuId(fastGetAttribute(contextmenuAttr));
|
| + if (contextMenuId.isNull())
|
| + return nullptr;
|
| +
|
| + Element* element = treeScope().getElementById(contextMenuId);
|
| + return isHTMLMenuElement(element) ? toHTMLMenuElement(element) : nullptr;
|
| +}
|
| +
|
| +void HTMLElement::setContextMenu(HTMLMenuElement* contextMenu)
|
| +{
|
| + const AtomicString& contextMenuId(contextMenu->fastGetAttribute(idAttr));
|
| + if (!contextMenuId.isNull() && contextMenu->inDocument())
|
| + setAttribute(contextmenuAttr, contextMenuId);
|
| + else
|
| + setAttribute(contextmenuAttr, "");
|
| +}
|
| +
|
| void HTMLElement::defaultEventHandler(Event* event)
|
| {
|
| if (event->type() == EventTypeNames::keypress && event->isKeyboardEvent()) {
|
|
|