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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 LayoutObject* firstChild = curr->firstChild(); | 250 LayoutObject* firstChild = curr->firstChild(); |
251 if (!firstChild) | 251 if (!firstChild) |
252 return nullptr; | 252 return nullptr; |
253 | 253 |
254 bool inQuirksMode = curr->document().inQuirksMode(); | 254 bool inQuirksMode = curr->document().inQuirksMode(); |
255 for (LayoutObject* currChild = firstChild; currChild; | 255 for (LayoutObject* currChild = firstChild; currChild; |
256 currChild = currChild->nextSibling()) { | 256 currChild = currChild->nextSibling()) { |
257 if (currChild == marker) | 257 if (currChild == marker) |
258 continue; | 258 continue; |
259 | 259 |
| 260 // Shouldn't add marker into Overflow box, instead, add marker |
| 261 // into listitem |
| 262 if (currChild->hasOverflowClip()) |
| 263 break; |
| 264 |
260 if (currChild->isInline() && | 265 if (currChild->isInline() && |
261 (!currChild->isLayoutInline() || | 266 (!currChild->isLayoutInline() || |
262 curr->generatesLineBoxesForInlineChild(currChild))) | 267 curr->generatesLineBoxesForInlineChild(currChild))) |
263 return curr; | 268 return curr; |
264 | 269 |
265 if (currChild->isFloating() || currChild->isOutOfFlowPositioned()) | 270 if (currChild->isFloating() || currChild->isOutOfFlowPositioned()) |
266 continue; | 271 continue; |
267 | 272 |
268 if (!currChild->isLayoutBlockFlow() || | 273 if (!currChild->isLayoutBlockFlow() || |
269 (currChild->isBox() && toLayoutBox(currChild)->isWritingModeRoot())) | 274 (currChild->isBox() && toLayoutBox(currChild)->isWritingModeRoot())) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 } | 334 } |
330 | 335 |
331 return false; | 336 return false; |
332 } | 337 } |
333 | 338 |
334 void LayoutListItem::addOverflowFromChildren() { | 339 void LayoutListItem::addOverflowFromChildren() { |
335 LayoutBlockFlow::addOverflowFromChildren(); | 340 LayoutBlockFlow::addOverflowFromChildren(); |
336 positionListMarker(); | 341 positionListMarker(); |
337 } | 342 } |
338 | 343 |
| 344 void LayoutListItem::addLogicalHeightFromChild(const LayoutBox& child) { |
| 345 // Outside marker inside an anonymous box with sibling shouldn't effect the |
| 346 // height of listitem, so that marker can be positioned at the left of sibling |
| 347 // not top-left. |
| 348 if (m_marker && !m_marker->isInside() && child.isAnonymous() && |
| 349 child.isLayoutBlock() && firstChild() == child && child.nextSibling()) |
| 350 return; |
| 351 setLogicalHeight(logicalHeight() + logicalHeightForChild(child)); |
| 352 } |
| 353 |
339 void LayoutListItem::positionListMarker() { | 354 void LayoutListItem::positionListMarker() { |
340 if (m_marker && m_marker->parent() && m_marker->parent()->isBox() && | 355 if (m_marker && m_marker->parent() && m_marker->parent()->isBox() && |
341 !m_marker->isInside() && m_marker->inlineBoxWrapper()) { | 356 !m_marker->isInside() && m_marker->inlineBoxWrapper()) { |
342 LayoutUnit markerOldLogicalLeft = m_marker->logicalLeft(); | 357 LayoutUnit markerOldLogicalLeft = m_marker->logicalLeft(); |
343 LayoutUnit blockOffset; | 358 LayoutUnit blockOffset; |
344 LayoutUnit lineOffset; | 359 LayoutUnit lineOffset; |
345 for (LayoutBox* o = m_marker->parentBox(); o != this; o = o->parentBox()) { | 360 for (LayoutBox* o = m_marker->parentBox(); o != this; o = o->parentBox()) { |
346 blockOffset += o->logicalTop(); | 361 blockOffset += o->logicalTop(); |
347 lineOffset += o->logicalLeft(); | 362 lineOffset += o->logicalLeft(); |
348 } | 363 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 // assume that all the following ones have too. | 556 // assume that all the following ones have too. |
542 // This gives us the opportunity to stop here and avoid | 557 // This gives us the opportunity to stop here and avoid |
543 // marking the same nodes again. | 558 // marking the same nodes again. |
544 break; | 559 break; |
545 } | 560 } |
546 item->updateValue(); | 561 item->updateValue(); |
547 } | 562 } |
548 } | 563 } |
549 | 564 |
550 } // namespace blink | 565 } // namespace blink |
OLD | NEW |