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

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

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated change after Doug's review. Created 5 years, 10 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/svg/SVGElement.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 5e1629e01cf2362d3fe8885dd842726b0399234c..fa73582b5a6b71cf6c4eb75eb6730c8bb64e6cee 100644
--- a/Source/core/rendering/RenderMenuList.cpp
+++ b/Source/core/rendering/RenderMenuList.cpp
@@ -155,7 +155,7 @@ void RenderMenuList::styleDidChange(StyleDifference diff, const LayoutStyle* old
RenderBlock::styleDidChange(diff, oldStyle);
if (m_buttonText)
- m_buttonText->setStyle(style());
+ m_buttonText->setStyle(mutableStyle());
if (m_innerBlock) // RenderBlock handled updating the anonymous block's style.
adjustInnerStyle();
@@ -244,7 +244,7 @@ void RenderMenuList::setTextFromOption(int optionIndex)
HTMLOptionElement* selectedOptionElement = toHTMLOptionElement(listItems[firstSelectedIndex]);
ASSERT(selectedOptionElement->selected());
text = selectedOptionElement->textIndentedToRespectGroupLabel();
- m_optionStyle = selectedOptionElement->layoutStyle();
+ m_optionStyle = selectedOptionElement->mutableLayoutStyle();
} else {
Locale& locale = select->locale();
String localizedNumberString = locale.convertToLocalizedNumber(String::number(selectedCount));
@@ -257,7 +257,7 @@ void RenderMenuList::setTextFromOption(int optionIndex)
Element* element = listItems[i];
if (isHTMLOptionElement(*element)) {
text = toHTMLOptionElement(element)->textIndentedToRespectGroupLabel();
- m_optionStyle = element->layoutStyle();
+ m_optionStyle = element->mutableLayoutStyle();
}
}
}
@@ -277,7 +277,7 @@ void RenderMenuList::setText(const String& s)
if (m_buttonText)
m_buttonText->destroy();
m_buttonText = new LayoutBR(&document());
- m_buttonText->setStyle(style());
+ m_buttonText->setStyle(mutableStyle());
addChild(m_buttonText);
}
} else {
@@ -290,7 +290,7 @@ void RenderMenuList::setText(const String& s)
if (m_buttonText)
m_buttonText->destroy();
m_buttonText = new RenderText(&document(), s.impl());
- m_buttonText->setStyle(style());
+ m_buttonText->setStyle(mutableStyle());
// We need to set the text explicitly though it was specified in the
// constructor because RenderText doesn't refer to the text
// specified in the constructor in a case of re-transforming.
@@ -390,7 +390,7 @@ Element& RenderMenuList::ownerElement() const
const LayoutStyle* RenderMenuList::layoutStyleForItem(Element& element) const
{
- return element.layoutStyle() ? element.layoutStyle() : element.computedStyle();
+ return element.layoutStyle() ? element.mutableLayoutStyle() : element.computedStyle();
}
void RenderMenuList::didSetSelectedIndex(int listIndex)
« no previous file with comments | « Source/core/rendering/RenderListMarker.cpp ('k') | Source/core/svg/SVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698