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