Chromium Code Reviews| Index: Source/core/rendering/RenderListItem.cpp |
| diff --git a/Source/core/rendering/RenderListItem.cpp b/Source/core/rendering/RenderListItem.cpp |
| index 6c251c4263ad53e95a8804e375c1e8ec97d2d89d..df84cc1ae55f3626471955fd8edace91dcb812cd 100644 |
| --- a/Source/core/rendering/RenderListItem.cpp |
| +++ b/Source/core/rendering/RenderListItem.cpp |
| @@ -63,8 +63,15 @@ void RenderListItem::styleDidChange(StyleDifference diff, const RenderStyle* old |
| // The marker always inherits from the list item, regardless of where it might end |
| // up (e.g., in some deeply nested line box). See CSS3 spec. |
| newStyle->inheritFrom(style()); |
| - if (!m_marker) |
| + if (m_marker) { |
| + // Reuse the current margins otherwise resetting the margins to initial values |
|
mstensho (USE GERRIT)
2014/10/14 19:06:03
I don't think RenderListItem should have to know t
Xianzhu
2014/10/14 19:33:59
Good catch! Though set{margin-left, margin-right}
|
| + // would trigger unnecessary layout. |
| + newStyle->setMarginLeft(m_marker->style()->marginLeft()); |
| + newStyle->setMarginRight(m_marker->style()->marginRight()); |
| + } else { |
| m_marker = RenderListMarker::createAnonymous(this); |
| + } |
| + |
| m_marker->setStyle(newStyle.release()); |
| } else if (m_marker) { |
| m_marker->destroy(); |