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

Side by Side Diff: Source/core/rendering/RenderListItem.cpp

Issue 644073002: Avoid layout when list color changes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /** 1 /**
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 visitor->trace(m_marker); 52 visitor->trace(m_marker);
53 RenderBlockFlow::trace(visitor); 53 RenderBlockFlow::trace(visitor);
54 } 54 }
55 55
56 void RenderListItem::styleDidChange(StyleDifference diff, const RenderStyle* old Style) 56 void RenderListItem::styleDidChange(StyleDifference diff, const RenderStyle* old Style)
57 { 57 {
58 RenderBlockFlow::styleDidChange(diff, oldStyle); 58 RenderBlockFlow::styleDidChange(diff, oldStyle);
59 59
60 if (style()->listStyleType() != NoneListStyle 60 if (style()->listStyleType() != NoneListStyle
61 || (style()->listStyleImage() && !style()->listStyleImage()->errorOccurr ed())) { 61 || (style()->listStyleImage() && !style()->listStyleImage()->errorOccurr ed())) {
62 RefPtr<RenderStyle> newStyle = RenderStyle::create();
63 // The marker always inherits from the list item, regardless of where it might end
64 // up (e.g., in some deeply nested line box). See CSS3 spec.
65 newStyle->inheritFrom(style());
66 if (!m_marker) 62 if (!m_marker)
67 m_marker = RenderListMarker::createAnonymous(this); 63 m_marker = RenderListMarker::createAnonymous(this);
68 m_marker->setStyle(newStyle.release()); 64 m_marker->listItemStyleDidChange();
69 } else if (m_marker) { 65 } else if (m_marker) {
70 m_marker->destroy(); 66 m_marker->destroy();
71 m_marker = nullptr; 67 m_marker = nullptr;
72 } 68 }
73 } 69 }
74 70
75 void RenderListItem::willBeDestroyed() 71 void RenderListItem::willBeDestroyed()
76 { 72 {
77 if (m_marker) { 73 if (m_marker) {
78 m_marker->destroy(); 74 m_marker->destroy();
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 // assume that all the following ones have too. 518 // assume that all the following ones have too.
523 // This gives us the opportunity to stop here and avoid 519 // This gives us the opportunity to stop here and avoid
524 // marking the same nodes again. 520 // marking the same nodes again.
525 break; 521 break;
526 } 522 }
527 item->updateValue(); 523 item->updateValue();
528 } 524 }
529 } 525 }
530 526
531 } // namespace blink 527 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/lists/list-color-change-no-layout-expected.txt ('k') | Source/core/rendering/RenderListMarker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698