| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 RenderObject* result = parent->firstChild(); | 261 RenderObject* result = parent->firstChild(); |
| 262 while (result && result->isListMarker()) | 262 while (result && result->isListMarker()) |
| 263 result = result->nextSibling(); | 263 result = result->nextSibling(); |
| 264 return result; | 264 return result; |
| 265 } | 265 } |
| 266 | 266 |
| 267 void RenderListItem::updateMarkerLocation() | 267 void RenderListItem::updateMarkerLocation() |
| 268 { | 268 { |
| 269 // Sanity check the location of our marker. | 269 // Sanity check the location of our marker. |
| 270 if (m_marker) { | 270 if (m_marker) { |
| 271 RenderObject* markerPar = m_marker->parent(); | 271 RenderObject* markerParent = m_marker->parent(); |
| 272 RenderObject* lineBoxParent = getParentOfFirstLineBox(this, m_marker); | 272 RenderObject* lineBoxParent = getParentOfFirstLineBox(this, m_marker); |
| 273 if (!lineBoxParent) { | 273 if (!lineBoxParent) { |
| 274 // If the marker is currently contained inside an anonymous box, | 274 // If the marker is currently contained inside an anonymous box, |
| 275 // then we are the only item in that anonymous box (since no line bo
x | 275 // then we are the only item in that anonymous box (since no line bo
x |
| 276 // parent was found). It's ok to just leave the marker where it is | 276 // parent was found). It's ok to just leave the marker where it is |
| 277 // in this case. | 277 // in this case. |
| 278 if (markerPar && markerPar->isAnonymousBlock()) | 278 if (markerParent && markerParent->isAnonymousBlock()) |
| 279 lineBoxParent = markerPar; | 279 lineBoxParent = markerParent; |
| 280 else | 280 else |
| 281 lineBoxParent = this; | 281 lineBoxParent = this; |
| 282 } | 282 } |
| 283 | 283 |
| 284 if (markerPar != lineBoxParent || m_marker->preferredLogicalWidthsDirty(
)) { | 284 if (markerParent != lineBoxParent || m_marker->preferredLogicalWidthsDir
ty()) { |
| 285 // Removing and adding the marker can trigger repainting in | 285 // Removing and adding the marker can trigger repainting in |
| 286 // containers other than ourselves, so we need to disable LayoutStat
e. | 286 // containers other than ourselves, so we need to disable LayoutStat
e. |
| 287 LayoutStateDisabler layoutStateDisabler(view()); | 287 LayoutStateDisabler layoutStateDisabler(view()); |
| 288 updateFirstLetter(); | 288 updateFirstLetter(); |
| 289 m_marker->remove(); | 289 m_marker->remove(); |
| 290 if (markerParent) |
| 291 markerParent->dirtyLinesFromChangedChild(m_marker); |
| 290 if (!lineBoxParent) | 292 if (!lineBoxParent) |
| 291 lineBoxParent = this; | 293 lineBoxParent = this; |
| 292 lineBoxParent->addChild(m_marker, firstNonMarkerChild(lineBoxParent)
); | 294 lineBoxParent->addChild(m_marker, firstNonMarkerChild(lineBoxParent)
); |
| 293 m_marker->updateMarginsAndContent(); | 295 m_marker->updateMarginsAndContent(); |
| 294 // If markerPar is an anonymous block that has lost all its children
, destroy it. | 296 // If markerParent is an anonymous block that has lost all its child
ren, destroy it. |
| 295 if (markerPar && markerPar->isAnonymousBlock() && !markerPar->firstC
hild() && !toRenderBlock(markerPar)->continuation()) | 297 if (markerParent && markerParent->isAnonymousBlock() && !markerParen
t->firstChild() && !toRenderBlock(markerParent)->continuation()) |
| 296 markerPar->destroy(); | 298 markerParent->destroy(); |
| 297 } | 299 } |
| 298 } | 300 } |
| 299 } | 301 } |
| 300 | 302 |
| 301 void RenderListItem::layout() | 303 void RenderListItem::layout() |
| 302 { | 304 { |
| 303 StackStats::LayoutCheckPoint layoutCheckPoint; | 305 StackStats::LayoutCheckPoint layoutCheckPoint; |
| 304 ASSERT(needsLayout()); | 306 ASSERT(needsLayout()); |
| 305 | 307 |
| 306 updateMarkerLocation(); | 308 updateMarkerLocation(); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 // assume that all the following ones have too. | 505 // assume that all the following ones have too. |
| 504 // This gives us the opportunity to stop here and avoid | 506 // This gives us the opportunity to stop here and avoid |
| 505 // marking the same nodes again. | 507 // marking the same nodes again. |
| 506 break; | 508 break; |
| 507 } | 509 } |
| 508 item->updateValue(); | 510 item->updateValue(); |
| 509 } | 511 } |
| 510 } | 512 } |
| 511 | 513 |
| 512 } // namespace WebCore | 514 } // namespace WebCore |
| OLD | NEW |