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

Unified Diff: Source/core/rendering/RenderMenuList.cpp

Issue 19697011: Change rendering code to use RenderObject::resolveColor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderListMarker.cpp ('k') | Source/core/rendering/RenderMultiColumnSet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderMenuList.cpp
diff --git a/Source/core/rendering/RenderMenuList.cpp b/Source/core/rendering/RenderMenuList.cpp
index 2071418dd14f20d08592d46ee71bc36a987f7e3f..b984d7ea5e151c3ea58d8dec7715dca7b5a28724 100644
--- a/Source/core/rendering/RenderMenuList.cpp
+++ b/Source/core/rendering/RenderMenuList.cpp
@@ -475,7 +475,7 @@ PopupMenuStyle RenderMenuList::itemStyle(unsigned listIndex) const
getItemBackgroundColor(listIndex, itemBackgroundColor, itemHasCustomBackgroundColor);
RenderStyle* style = element->renderStyle() ? element->renderStyle() : element->computedStyle();
- return style ? PopupMenuStyle(style->visitedDependentColor(CSSPropertyColor), itemBackgroundColor, style->font(), style->visibility() == VISIBLE,
+ return style ? PopupMenuStyle(resolveColor(style, CSSPropertyColor), itemBackgroundColor, style->font(), style->visibility() == VISIBLE,
style->display() == NONE, style->textIndent(), style->direction(), isOverride(style->unicodeBidi()),
itemHasCustomBackgroundColor ? PopupMenuStyle::CustomBackgroundColor : PopupMenuStyle::DefaultBackgroundColor) : menuStyle();
}
@@ -484,7 +484,7 @@ void RenderMenuList::getItemBackgroundColor(unsigned listIndex, Color& itemBackg
{
const Vector<HTMLElement*>& listItems = selectElement()->listItems();
if (listIndex >= listItems.size()) {
- itemBackgroundColor = style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ itemBackgroundColor = resolveColor(CSSPropertyBackgroundColor);
itemHasCustomBackgroundColor = false;
return;
}
@@ -492,7 +492,7 @@ void RenderMenuList::getItemBackgroundColor(unsigned listIndex, Color& itemBackg
Color backgroundColor;
if (element->renderStyle())
- backgroundColor = element->renderStyle()->visitedDependentColor(CSSPropertyBackgroundColor);
+ backgroundColor = resolveColor(element->renderStyle(), CSSPropertyBackgroundColor);
itemHasCustomBackgroundColor = backgroundColor.isValid() && backgroundColor.alpha();
// If the item has an opaque background color, return that.
if (!backgroundColor.hasAlpha()) {
@@ -501,7 +501,7 @@ void RenderMenuList::getItemBackgroundColor(unsigned listIndex, Color& itemBackg
}
// Otherwise, the item's background is overlayed on top of the menu background.
- backgroundColor = style()->visitedDependentColor(CSSPropertyBackgroundColor).blend(backgroundColor);
+ backgroundColor = resolveColor(CSSPropertyBackgroundColor).blend(backgroundColor);
if (!backgroundColor.hasAlpha()) {
itemBackgroundColor = backgroundColor;
return;
@@ -513,8 +513,9 @@ void RenderMenuList::getItemBackgroundColor(unsigned listIndex, Color& itemBackg
PopupMenuStyle RenderMenuList::menuStyle() const
{
- RenderStyle* s = m_innerBlock ? m_innerBlock->style() : style();
- return PopupMenuStyle(s->visitedDependentColor(CSSPropertyColor), s->visitedDependentColor(CSSPropertyBackgroundColor), s->font(), s->visibility() == VISIBLE,
+ const RenderObject* o = m_innerBlock ? m_innerBlock : this;
+ const RenderStyle* s = o->style();
+ return PopupMenuStyle(o->resolveColor(CSSPropertyColor), o->resolveColor(CSSPropertyBackgroundColor), s->font(), s->visibility() == VISIBLE,
s->display() == NONE, s->textIndent(), style()->direction(), isOverride(style()->unicodeBidi()));
}
« no previous file with comments | « Source/core/rendering/RenderListMarker.cpp ('k') | Source/core/rendering/RenderMultiColumnSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698