Index: Source/core/html/HTMLElement.cpp |
diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp |
index c7e6eec81e8fdc6f9b10e2aff060bc58ae8fedb9..491e4145d135fabfbdd3770c07523b5cbcc6e159 100644 |
--- a/Source/core/html/HTMLElement.cpp |
+++ b/Source/core/html/HTMLElement.cpp |
@@ -45,6 +45,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" |
@@ -903,6 +904,17 @@ bool HTMLElement::isInteractiveContent() const |
return false; |
} |
+HTMLMenuElement* HTMLElement::menuElement() const |
+{ |
+ Element* element = treeScope().getElementById(fastGetAttribute(contextmenuAttr)); |
+ if (!element) |
+ return 0; |
+ if (!isHTMLMenuElement(*element)) |
esprehn
2014/06/06 22:30:42
You can combine all these checks into:
return isH
pals
2014/06/10 10:42:39
Done.
|
+ return 0; |
+ |
+ return toHTMLMenuElement(element); |
+} |
+ |
void HTMLElement::defaultEventHandler(Event* event) |
{ |
if (event->type() == EventTypeNames::keypress && event->isKeyboardEvent()) { |