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

Side by Side Diff: Source/core/html/HTMLElement.cpp

Issue 721603002: If an element A has a parent element, then A's assigned context menu is the assigned context menu o… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: assignedContextMenu Created 6 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 unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLElement.h ('k') | Source/core/page/ContextMenuController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-2008, 2013, 2014 Apple Inc. All rights reserved. 4 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved.
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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 parsedColor.setRGB(parseColorStringWithCrazyLegacyRules(colorString)); 927 parsedColor.setRGB(parseColorStringWithCrazyLegacyRules(colorString));
928 928
929 style->setProperty(propertyID, cssValuePool().createColorValue(parsedColor.r gb())); 929 style->setProperty(propertyID, cssValuePool().createColorValue(parsedColor.r gb()));
930 } 930 }
931 931
932 bool HTMLElement::isInteractiveContent() const 932 bool HTMLElement::isInteractiveContent() const
933 { 933 {
934 return false; 934 return false;
935 } 935 }
936 936
937 HTMLMenuElement* HTMLElement::assignedContextMenu() const
938 {
939 HTMLMenuElement* menu = contextMenu();
940 if (menu)
tkent 2014/11/12 09:37:18 nit: if (HTMLMenuElement* menu = contextMenu()
pals 2014/11/12 09:43:59 Done.
941 return menu;
942
943 return parentElement() && parentElement()->isHTMLElement() ? toHTMLElement(p arentElement())->assignedContextMenu() :nullptr;
tkent 2014/11/12 09:37:18 nit: need a space after :
pals 2014/11/12 09:43:58 Done.
944 }
937 945
938 HTMLMenuElement* HTMLElement::contextMenu() const 946 HTMLMenuElement* HTMLElement::contextMenu() const
939 { 947 {
940 const AtomicString& contextMenuId(fastGetAttribute(contextmenuAttr)); 948 const AtomicString& contextMenuId(fastGetAttribute(contextmenuAttr));
941 if (contextMenuId.isNull()) 949 if (contextMenuId.isNull())
942 return nullptr; 950 return nullptr;
943 951
944 Element* element = treeScope().getElementById(contextMenuId); 952 Element* element = treeScope().getElementById(contextMenuId);
945 // Not checking if the menu element is of type "popup". 953 // Not checking if the menu element is of type "popup".
946 // Ignoring menu element type attribute is intentional according to the stan dard. 954 // Ignoring menu element type attribute is intentional according to the stan dard.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 #ifndef NDEBUG 1034 #ifndef NDEBUG
1027 1035
1028 // For use in the debugger 1036 // For use in the debugger
1029 void dumpInnerHTML(blink::HTMLElement*); 1037 void dumpInnerHTML(blink::HTMLElement*);
1030 1038
1031 void dumpInnerHTML(blink::HTMLElement* element) 1039 void dumpInnerHTML(blink::HTMLElement* element)
1032 { 1040 {
1033 printf("%s\n", element->innerHTML().ascii().data()); 1041 printf("%s\n", element->innerHTML().ascii().data());
1034 } 1042 }
1035 #endif 1043 #endif
OLDNEW
« no previous file with comments | « Source/core/html/HTMLElement.h ('k') | Source/core/page/ContextMenuController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698