Index: Source/core/html/HTMLMenuItemElement.cpp |
diff --git a/Source/core/html/HTMLMenuItemElement.cpp b/Source/core/html/HTMLMenuItemElement.cpp |
index e0774e7552ac538ebad2d36115441908ff55c6e5..79d6759ffca96ab5b80873e38fc0bade7e363d41 100644 |
--- a/Source/core/html/HTMLMenuItemElement.cpp |
+++ b/Source/core/html/HTMLMenuItemElement.cpp |
@@ -6,14 +6,30 @@ |
#include "core/html/HTMLMenuItemElement.h" |
#include "core/HTMLNames.h" |
+#include "core/events/Event.h" |
namespace blink { |
+using namespace HTMLNames; |
+ |
inline HTMLMenuItemElement::HTMLMenuItemElement(Document& document) |
: HTMLElement(HTMLNames::menuitemTag, document) |
{ |
} |
+void HTMLMenuItemElement::defaultEventHandler(Event* event) |
+{ |
+ if (event->type() == EventTypeNames::click) { |
+ if (equalIgnoringCase(fastGetAttribute(typeAttr), "checkbox")) { |
+ if (fastHasAttribute(checkedAttr)) |
+ removeAttribute(checkedAttr); |
+ else |
+ setAttribute(checkedAttr, "checked"); |
+ } |
+ event->setDefaultHandled(); |
+ } |
+} |
+ |
DEFINE_NODE_FACTORY(HTMLMenuItemElement) |
} // namespace blink |