OLD | NEW |
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 if (style()->listStyleType() != NoneListStyle | 56 if (style()->listStyleType() != NoneListStyle |
57 || (style()->listStyleImage() && !style()->listStyleImage()->errorOccurr
ed())) { | 57 || (style()->listStyleImage() && !style()->listStyleImage()->errorOccurr
ed())) { |
58 if (!m_marker) | 58 if (!m_marker) |
59 m_marker = LayoutListMarker::createAnonymous(this); | 59 m_marker = LayoutListMarker::createAnonymous(this); |
60 m_marker->listItemStyleDidChange(); | 60 m_marker->listItemStyleDidChange(); |
61 notifyOfSubtreeChange(); | 61 notifyOfSubtreeChange(); |
62 } else if (m_marker) { | 62 } else if (m_marker) { |
63 m_marker->destroy(); | 63 m_marker->destroy(); |
64 m_marker = nullptr; | 64 m_marker = nullptr; |
65 } | 65 } |
| 66 |
| 67 StyleImage* oldImage = oldStyle ? oldStyle->listStyleImage() : nullptr; |
| 68 if (oldImage != style()->listStyleImage()) { |
| 69 if (oldImage) |
| 70 oldImage->removeClient(this); |
| 71 if (style()->listStyleImage()) |
| 72 style()->listStyleImage()->addClient(this); |
| 73 } |
66 } | 74 } |
67 | 75 |
68 void LayoutListItem::willBeDestroyed() | 76 void LayoutListItem::willBeDestroyed() |
69 { | 77 { |
70 if (m_marker) { | 78 if (m_marker) { |
71 m_marker->destroy(); | 79 m_marker->destroy(); |
72 m_marker = nullptr; | 80 m_marker = nullptr; |
73 } | 81 } |
| 82 |
74 LayoutBlockFlow::willBeDestroyed(); | 83 LayoutBlockFlow::willBeDestroyed(); |
| 84 |
| 85 if (style() && style()->listStyleImage()) |
| 86 style()->listStyleImage()->removeClient(this); |
75 } | 87 } |
76 | 88 |
77 void LayoutListItem::insertedIntoTree() | 89 void LayoutListItem::insertedIntoTree() |
78 { | 90 { |
79 LayoutBlockFlow::insertedIntoTree(); | 91 LayoutBlockFlow::insertedIntoTree(); |
80 | 92 |
81 updateListMarkerNumbers(); | 93 updateListMarkerNumbers(); |
82 } | 94 } |
83 | 95 |
84 void LayoutListItem::willBeRemovedFromTree() | 96 void LayoutListItem::willBeRemovedFromTree() |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 // assume that all the following ones have too. | 510 // assume that all the following ones have too. |
499 // This gives us the opportunity to stop here and avoid | 511 // This gives us the opportunity to stop here and avoid |
500 // marking the same nodes again. | 512 // marking the same nodes again. |
501 break; | 513 break; |
502 } | 514 } |
503 item->updateValue(); | 515 item->updateValue(); |
504 } | 516 } |
505 } | 517 } |
506 | 518 |
507 } // namespace blink | 519 } // namespace blink |
OLD | NEW |