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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 348 |
349 LayoutUnit lineTop = root.lineTop(); | 349 LayoutUnit lineTop = root.lineTop(); |
350 LayoutUnit lineBottom = root.lineBottom(); | 350 LayoutUnit lineBottom = root.lineBottom(); |
351 | 351 |
352 // TODO(jchaffraix): Propagating the overflow to the line boxes seems | 352 // TODO(jchaffraix): Propagating the overflow to the line boxes seems |
353 // pretty wrong (https://crbug.com/554160). | 353 // pretty wrong (https://crbug.com/554160). |
354 // FIXME: Need to account for relative positioning in the layout overflo
w. | 354 // FIXME: Need to account for relative positioning in the layout overflo
w. |
355 if (style()->isLeftToRightDirection()) { | 355 if (style()->isLeftToRightDirection()) { |
356 LayoutUnit leftLineOffset = logicalLeftOffsetForLine(blockOffset, lo
gicalLeftOffsetForLine(blockOffset, DoNotIndentText), DoNotIndentText); | 356 LayoutUnit leftLineOffset = logicalLeftOffsetForLine(blockOffset, lo
gicalLeftOffsetForLine(blockOffset, DoNotIndentText), DoNotIndentText); |
357 markerLogicalLeft = leftLineOffset - lineOffset - paddingStart() - b
orderStart() + m_marker->marginStart(); | 357 markerLogicalLeft = leftLineOffset - lineOffset - paddingStart() - b
orderStart() + m_marker->marginStart(); |
358 m_marker->inlineBoxWrapper()->moveInInlineDirection((markerLogicalLe
ft - markerOldLogicalLeft).toFloat()); | 358 m_marker->inlineBoxWrapper()->moveInInlineDirection(markerLogicalLef
t - markerOldLogicalLeft); |
359 for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); bo
x; box = box->parent()) { | 359 for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); bo
x; box = box->parent()) { |
360 LayoutRect newLogicalVisualOverflowRect = box->logicalVisualOver
flowRect(lineTop, lineBottom); | 360 LayoutRect newLogicalVisualOverflowRect = box->logicalVisualOver
flowRect(lineTop, lineBottom); |
361 LayoutRect newLogicalLayoutOverflowRect = box->logicalLayoutOver
flowRect(lineTop, lineBottom); | 361 LayoutRect newLogicalLayoutOverflowRect = box->logicalLayoutOver
flowRect(lineTop, lineBottom); |
362 if (markerLogicalLeft < newLogicalVisualOverflowRect.x() && !hit
SelfPaintingLayer) { | 362 if (markerLogicalLeft < newLogicalVisualOverflowRect.x() && !hit
SelfPaintingLayer) { |
363 newLogicalVisualOverflowRect.setWidth(newLogicalVisualOverfl
owRect.maxX() - markerLogicalLeft); | 363 newLogicalVisualOverflowRect.setWidth(newLogicalVisualOverfl
owRect.maxX() - markerLogicalLeft); |
364 newLogicalVisualOverflowRect.setX(markerLogicalLeft); | 364 newLogicalVisualOverflowRect.setX(markerLogicalLeft); |
365 if (box == root) | 365 if (box == root) |
366 adjustOverflow = true; | 366 adjustOverflow = true; |
367 } | 367 } |
368 if (markerLogicalLeft < newLogicalLayoutOverflowRect.x()) { | 368 if (markerLogicalLeft < newLogicalLayoutOverflowRect.x()) { |
369 newLogicalLayoutOverflowRect.setWidth(newLogicalLayoutOverfl
owRect.maxX() - markerLogicalLeft); | 369 newLogicalLayoutOverflowRect.setWidth(newLogicalLayoutOverfl
owRect.maxX() - markerLogicalLeft); |
370 newLogicalLayoutOverflowRect.setX(markerLogicalLeft); | 370 newLogicalLayoutOverflowRect.setX(markerLogicalLeft); |
371 if (box == root) | 371 if (box == root) |
372 adjustOverflow = true; | 372 adjustOverflow = true; |
373 } | 373 } |
374 box->overrideOverflowFromLogicalRects(newLogicalLayoutOverflowRe
ct, newLogicalVisualOverflowRect, lineTop, lineBottom); | 374 box->overrideOverflowFromLogicalRects(newLogicalLayoutOverflowRe
ct, newLogicalVisualOverflowRect, lineTop, lineBottom); |
375 if (box->boxModelObject().hasSelfPaintingLayer()) | 375 if (box->boxModelObject().hasSelfPaintingLayer()) |
376 hitSelfPaintingLayer = true; | 376 hitSelfPaintingLayer = true; |
377 } | 377 } |
378 } else { | 378 } else { |
379 LayoutUnit rightLineOffset = logicalRightOffsetForLine(blockOffset,
logicalRightOffsetForLine(blockOffset, DoNotIndentText), DoNotIndentText); | 379 LayoutUnit rightLineOffset = logicalRightOffsetForLine(blockOffset,
logicalRightOffsetForLine(blockOffset, DoNotIndentText), DoNotIndentText); |
380 markerLogicalLeft = rightLineOffset - lineOffset + paddingStart() +
borderStart() + m_marker->marginEnd(); | 380 markerLogicalLeft = rightLineOffset - lineOffset + paddingStart() +
borderStart() + m_marker->marginEnd(); |
381 m_marker->inlineBoxWrapper()->moveInInlineDirection((markerLogicalLe
ft - markerOldLogicalLeft).toFloat()); | 381 m_marker->inlineBoxWrapper()->moveInInlineDirection(markerLogicalLef
t - markerOldLogicalLeft); |
382 for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); bo
x; box = box->parent()) { | 382 for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); bo
x; box = box->parent()) { |
383 LayoutRect newLogicalVisualOverflowRect = box->logicalVisualOver
flowRect(lineTop, lineBottom); | 383 LayoutRect newLogicalVisualOverflowRect = box->logicalVisualOver
flowRect(lineTop, lineBottom); |
384 LayoutRect newLogicalLayoutOverflowRect = box->logicalLayoutOver
flowRect(lineTop, lineBottom); | 384 LayoutRect newLogicalLayoutOverflowRect = box->logicalLayoutOver
flowRect(lineTop, lineBottom); |
385 if (markerLogicalLeft + m_marker->logicalWidth() > newLogicalVis
ualOverflowRect.maxX() && !hitSelfPaintingLayer) { | 385 if (markerLogicalLeft + m_marker->logicalWidth() > newLogicalVis
ualOverflowRect.maxX() && !hitSelfPaintingLayer) { |
386 newLogicalVisualOverflowRect.setWidth(markerLogicalLeft + m_
marker->logicalWidth() - newLogicalVisualOverflowRect.x()); | 386 newLogicalVisualOverflowRect.setWidth(markerLogicalLeft + m_
marker->logicalWidth() - newLogicalVisualOverflowRect.x()); |
387 if (box == root) | 387 if (box == root) |
388 adjustOverflow = true; | 388 adjustOverflow = true; |
389 } | 389 } |
390 if (markerLogicalLeft + m_marker->logicalWidth() > newLogicalLay
outOverflowRect.maxX()) { | 390 if (markerLogicalLeft + m_marker->logicalWidth() > newLogicalLay
outOverflowRect.maxX()) { |
391 newLogicalLayoutOverflowRect.setWidth(markerLogicalLeft + m_
marker->logicalWidth() - newLogicalLayoutOverflowRect.x()); | 391 newLogicalLayoutOverflowRect.setWidth(markerLogicalLeft + m_
marker->logicalWidth() - newLogicalLayoutOverflowRect.x()); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 // assume that all the following ones have too. | 510 // assume that all the following ones have too. |
511 // This gives us the opportunity to stop here and avoid | 511 // This gives us the opportunity to stop here and avoid |
512 // marking the same nodes again. | 512 // marking the same nodes again. |
513 break; | 513 break; |
514 } | 514 } |
515 item->updateValue(); | 515 item->updateValue(); |
516 } | 516 } |
517 } | 517 } |
518 | 518 |
519 } // namespace blink | 519 } // namespace blink |
OLD | NEW |