Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1068)

Unified Diff: Source/core/html/HTMLElement.cpp

Issue 243403006: Implement contextmenu attribute with basic support of <menu> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added unit tests Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()) {

Powered by Google App Engine
This is Rietveld 408576698