Chromium Code Reviews| Index: Source/core/html/HTMLOptGroupElement.cpp |
| diff --git a/Source/core/html/HTMLOptGroupElement.cpp b/Source/core/html/HTMLOptGroupElement.cpp |
| index 1f1a4130aa0caff817bf9eacb4a8fd9dc4c9d8dc..8623728554187ab2c24975a67e5f117688bac29d 100644 |
| --- a/Source/core/html/HTMLOptGroupElement.cpp |
| +++ b/Source/core/html/HTMLOptGroupElement.cpp |
| @@ -84,8 +84,15 @@ void HTMLOptGroupElement::recalcSelectOptions() |
| void HTMLOptGroupElement::attach(const AttachContext& context) |
| { |
| - updateNonRenderStyle(); |
| - HTMLElement::attach(context); |
| + AttachContext optGroupContext(context); |
| + if (context.resolvedStyle) { |
| + ASSERT(!m_style || m_style == context.resolvedStyle); |
| + m_style = context.resolvedStyle; |
| + } else { |
| + updateNonRenderStyle(); |
| + optGroupContext.resolvedStyle = m_style.get(); |
|
esprehn
2014/02/19 00:04:16
Why do you need this branch? Shouldn't the createR
rune
2014/02/19 09:47:26
Done.
|
| + } |
| + HTMLElement::attach(optGroupContext); |
| } |
| void HTMLOptGroupElement::detach(const AttachContext& context) |
| @@ -106,15 +113,10 @@ RenderStyle* HTMLOptGroupElement::nonRendererStyle() const |
| PassRefPtr<RenderStyle> HTMLOptGroupElement::customStyleForRenderer() |
| { |
| + updateNonRenderStyle(); |
| return m_style; |
| } |
| -void HTMLOptGroupElement::willRecalcStyle(StyleRecalcChange change) |
| -{ |
| - if (!needsAttach() && (needsStyleRecalc() || change >= Inherit)) |
| - updateNonRenderStyle(); |
| -} |
| - |
| String HTMLOptGroupElement::groupLabelText() const |
| { |
| String itemText = getAttribute(labelAttr); |