Index: Source/core/html/HTMLElement.cpp |
diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp |
index d5c9c754a92cbefc8fa757afb46179696f09b339..784e34af3dc3fcf45919f0c28f955851b8b5c86e 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,17 @@ bool HTMLElement::isInteractiveContent() const |
return false; |
} |
+PassRefPtrWillBeRawPtr<HTMLMenuElement> HTMLElement::contextMenu() const |
+{ |
+ Element* element = treeScope().getElementById(fastGetAttribute(contextmenuAttr)); |
+ return isHTMLMenuElement(element) ? toHTMLMenuElement(element) : 0; |
+} |
+ |
+void HTMLElement::setContextMenu(PassRefPtrWillBeRawPtr<HTMLMenuElement> contextMenu) |
+{ |
+ setAttribute(contextmenuAttr, contextMenu->elementData()->idForStyleResolution()); |
tkent
2014/07/31 06:07:55
Does this behavior conform to the standard?
pals
2014/08/01 10:03:07
Specification says that the contextmenu attribute
tkent
2014/08/04 02:26:12
The HTML specification must have a detailed algori
pals
2014/08/04 08:58:27
Now I am checking if id is null and I have added
|
+} |
+ |
void HTMLElement::defaultEventHandler(Event* event) |
{ |
if (event->type() == EventTypeNames::keypress && event->isKeyboardEvent()) { |