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

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

Issue 2905763003: Rollback ContextMenu (Closed)
Patch Set: Rebase Created 3 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: 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 1f083b6d7a22177cb1eaa3d0289d3ad013c8558b..0add41423510b2d0c59e48b7d54162f8c8c711df 100644
--- a/third_party/WebKit/Source/core/html/HTMLElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp
@@ -57,7 +57,6 @@
#include "core/html/HTMLDimension.h"
#include "core/html/HTMLFormElement.h"
#include "core/html/HTMLInputElement.h"
-#include "core/html/HTMLMenuElement.h"
#include "core/html/HTMLTemplateElement.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/layout/LayoutBoxModelObject.h"
@@ -1068,49 +1067,6 @@ bool HTMLElement::IsInteractiveContent() const {
return false;
}
-HTMLMenuElement* HTMLElement::AssignedContextMenu() const {
- if (HTMLMenuElement* menu = contextMenu())
- return menu;
-
- return parentElement() && parentElement()->IsHTMLElement()
- ? ToHTMLElement(parentElement())->AssignedContextMenu()
- : nullptr;
-}
-
-HTMLMenuElement* HTMLElement::contextMenu() const {
- const AtomicString& context_menu_id(FastGetAttribute(contextmenuAttr));
- if (context_menu_id.IsNull())
- return nullptr;
-
- Element* element = GetTreeScope().getElementById(context_menu_id);
- // 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;
-}
-
-void HTMLElement::setContextMenu(HTMLMenuElement* context_menu) {
- if (!context_menu) {
- setAttribute(contextmenuAttr, "");
- return;
- }
-
- // http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#reflecting-content-attributes-in-idl-attributes
- // On setting, if the given element has an id attribute, and has the same home
- // subtree as the element of the attribute being set, and the given element is
- // the first element in that home subtree whose ID is the value of that id
- // attribute, then the content attribute must be set to the value of that id
- // attribute. Otherwise, the content attribute must be set to the empty
- // string.
- const AtomicString& context_menu_id(context_menu->FastGetAttribute(idAttr));
-
- if (!context_menu_id.IsNull() &&
- context_menu == GetTreeScope().getElementById(context_menu_id))
- setAttribute(contextmenuAttr, context_menu_id);
- else
- setAttribute(contextmenuAttr, "");
-}
-
void HTMLElement::DefaultEventHandler(Event* event) {
if (event->type() == EventTypeNames::keypress && event->IsKeyboardEvent()) {
HandleKeypressEvent(ToKeyboardEvent(event));
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLElement.h ('k') | third_party/WebKit/Source/core/html/HTMLElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698