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

Unified Diff: Source/core/layout/LayoutMenuList.cpp

Issue 1267113002: PopupMenuImpl should get menu items via PopupMenuClient. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
« no previous file with comments | « Source/core/layout/LayoutMenuList.h ('k') | Source/web/ExternalPopupMenuTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutMenuList.cpp
diff --git a/Source/core/layout/LayoutMenuList.cpp b/Source/core/layout/LayoutMenuList.cpp
index d7ca095422b4bf7009982a7f2006fa03c74e8242..5c3b49f453564aae36a3d36756e33ac5ea8d2024 100644
--- a/Source/core/layout/LayoutMenuList.cpp
+++ b/Source/core/layout/LayoutMenuList.cpp
@@ -400,11 +400,6 @@ Element& LayoutMenuList::ownerElement() const
return *selectElement();
}
-const ComputedStyle* LayoutMenuList::computedStyleForItem(Element& element) const
-{
- return element.computedStyle() ? element.computedStyle() : element.ensureComputedStyle();
-}
-
const ComputedStyle* LayoutMenuList::computedStyleForItem(unsigned listIndex) const
{
Element& element = *selectElement()->listItems()[listIndex];
@@ -440,6 +435,11 @@ void LayoutMenuList::didUpdateActiveOption(int optionIndex)
document().existingAXObjectCache()->handleUpdateActiveMenuOption(this, optionIndex);
}
+Element& LayoutMenuList::itemElement(unsigned listIndex) const
+{
+ return *selectElement()->listItems()[listIndex];
+}
+
String LayoutMenuList::itemText(unsigned listIndex) const
{
HTMLSelectElement* select = selectElement();
@@ -500,7 +500,7 @@ bool LayoutMenuList::itemIsDisplayNone(unsigned listIndex) const
Element& element = *selectElement()->listItems()[listIndex];
if (isHTMLOptionElement(element))
return toHTMLOptionElement(element).isDisplayNone();
- if (const ComputedStyle* style = computedStyleForItem(element))
+ if (const ComputedStyle* style = computedStyleForItem(listIndex))
return style->display() == NONE;
return false;
}
« no previous file with comments | « Source/core/layout/LayoutMenuList.h ('k') | Source/web/ExternalPopupMenuTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698