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

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

Issue 2372593005: Restrict type attribute on menuitem (Closed)
Patch Set: Rebase Created 4 years, 1 month 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/HTMLMenuItemElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMenuItemElement.cpp b/third_party/WebKit/Source/core/html/HTMLMenuItemElement.cpp
index d3c1267408474e903d48be8f0c4319b4544e242c..44a94a41a439109cae78f8ed10326c4103f465fd 100644
--- a/third_party/WebKit/Source/core/html/HTMLMenuItemElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMenuItemElement.cpp
@@ -48,6 +48,24 @@ void HTMLMenuItemElement::defaultEventHandler(Event* event) {
}
}
+AtomicString HTMLMenuItemElement::type() const {
+ const AtomicString& menuItemType = fastGetAttribute(typeAttr);
+ if (equalIgnoringCase(menuItemType, "radio")) {
tkent 2016/11/14 03:47:09 Do you want equalIgnoringCase(), not equalIgnoring
rwlbuis 2016/11/14 15:22:26 Yes, very likely. However I will go the autogenera
+ DEFINE_STATIC_LOCAL(const AtomicString, radio, ("radio"));
+ return radio;
+ }
+ if (equalIgnoringCase(menuItemType, "checkbox")) {
+ DEFINE_STATIC_LOCAL(const AtomicString, checkbox, ("checkbox"));
+ return checkbox;
+ }
+ DEFINE_STATIC_LOCAL(const AtomicString, command, ("command"));
+ return command;
+}
+
+void HTMLMenuItemElement::setType(const AtomicString& menuItemType) {
+ setAttribute(typeAttr, menuItemType);
+}
+
DEFINE_NODE_FACTORY(HTMLMenuItemElement)
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698