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

Side by Side 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: Rebased global-constructors-listing-expected.txt Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserv ed.
5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 30 matching lines...) Expand all
41 #include "core/dom/Text.h" 41 #include "core/dom/Text.h"
42 #include "core/dom/shadow/ElementShadow.h" 42 #include "core/dom/shadow/ElementShadow.h"
43 #include "core/dom/shadow/ShadowRoot.h" 43 #include "core/dom/shadow/ShadowRoot.h"
44 #include "core/editing/markup.h" 44 #include "core/editing/markup.h"
45 #include "core/events/EventListener.h" 45 #include "core/events/EventListener.h"
46 #include "core/events/KeyboardEvent.h" 46 #include "core/events/KeyboardEvent.h"
47 #include "core/frame/Settings.h" 47 #include "core/frame/Settings.h"
48 #include "core/html/HTMLBRElement.h" 48 #include "core/html/HTMLBRElement.h"
49 #include "core/html/HTMLFormElement.h" 49 #include "core/html/HTMLFormElement.h"
50 #include "core/html/HTMLInputElement.h" 50 #include "core/html/HTMLInputElement.h"
51 #include "core/html/HTMLMenuElement.h"
51 #include "core/html/HTMLTemplateElement.h" 52 #include "core/html/HTMLTemplateElement.h"
52 #include "core/html/HTMLTextFormControlElement.h" 53 #include "core/html/HTMLTextFormControlElement.h"
53 #include "core/html/parser/HTMLParserIdioms.h" 54 #include "core/html/parser/HTMLParserIdioms.h"
54 #include "core/rendering/RenderObject.h" 55 #include "core/rendering/RenderObject.h"
55 #include "platform/text/BidiResolver.h" 56 #include "platform/text/BidiResolver.h"
56 #include "platform/text/BidiTextRun.h" 57 #include "platform/text/BidiTextRun.h"
57 #include "platform/text/TextRunIterator.h" 58 #include "platform/text/TextRunIterator.h"
58 #include "wtf/StdLibExtras.h" 59 #include "wtf/StdLibExtras.h"
59 #include "wtf/text/CString.h" 60 #include "wtf/text/CString.h"
60 61
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 parsedColor.setRGB(parseColorStringWithCrazyLegacyRules(colorString)); 886 parsedColor.setRGB(parseColorStringWithCrazyLegacyRules(colorString));
886 887
887 style->setProperty(propertyID, cssValuePool().createColorValue(parsedColor.r gb())); 888 style->setProperty(propertyID, cssValuePool().createColorValue(parsedColor.r gb()));
888 } 889 }
889 890
890 bool HTMLElement::isInteractiveContent() const 891 bool HTMLElement::isInteractiveContent() const
891 { 892 {
892 return false; 893 return false;
893 } 894 }
894 895
896 HTMLMenuElement* HTMLElement::menuElement() const
897 {
898 Element* element = treeScope().getElementById(fastGetAttribute(contextmenuAt tr));
899 return isHTMLMenuElement(element) ? toHTMLMenuElement(element) : 0;
900 }
901
895 void HTMLElement::defaultEventHandler(Event* event) 902 void HTMLElement::defaultEventHandler(Event* event)
896 { 903 {
897 if (event->type() == EventTypeNames::keypress && event->isKeyboardEvent()) { 904 if (event->type() == EventTypeNames::keypress && event->isKeyboardEvent()) {
898 handleKeypressEvent(toKeyboardEvent(event)); 905 handleKeypressEvent(toKeyboardEvent(event));
899 if (event->defaultHandled()) 906 if (event->defaultHandled())
900 return; 907 return;
901 } 908 }
902 909
903 Element::defaultEventHandler(event); 910 Element::defaultEventHandler(event);
904 } 911 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 #ifndef NDEBUG 957 #ifndef NDEBUG
951 958
952 // For use in the debugger 959 // For use in the debugger
953 void dumpInnerHTML(blink::HTMLElement*); 960 void dumpInnerHTML(blink::HTMLElement*);
954 961
955 void dumpInnerHTML(blink::HTMLElement* element) 962 void dumpInnerHTML(blink::HTMLElement* element)
956 { 963 {
957 printf("%s\n", element->innerHTML().ascii().data()); 964 printf("%s\n", element->innerHTML().ascii().data());
958 } 965 }
959 #endif 966 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698