| 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 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 bool floatIsNewExtreme = updateOffsetIfNeeded(*floatingObject); | 478 bool floatIsNewExtreme = updateOffsetIfNeeded(*floatingObject); |
| 479 if (floatIsNewExtreme) | 479 if (floatIsNewExtreme) |
| 480 m_outermostFloat = floatingObject; | 480 m_outermostFloat = floatingObject; |
| 481 } | 481 } |
| 482 | 482 |
| 483 template<> | 483 template<> |
| 484 inline bool ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::u
pdateOffsetIfNeeded(const FloatingObject& floatingObject) | 484 inline bool ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::u
pdateOffsetIfNeeded(const FloatingObject& floatingObject) |
| 485 { | 485 { |
| 486 LayoutUnit logicalRight = m_layoutObject->logicalRightForFloat(&floatingObje
ct); | 486 LayoutUnit logicalRight = m_layoutObject->logicalRightForFloat(&floatingObje
ct); |
| 487 if (ShapeOutsideInfo* shapeOutside = floatingObject.layoutObject()->shapeOut
sideInfo()) { | 487 if (ShapeOutsideInfo* shapeOutside = floatingObject.layoutObject()->shapeOut
sideInfo()) { |
| 488 ShapeOutsideDeltas shapeDeltas = shapeOutside->computeDeltasForContainin
gBlockLine(*m_layoutObject, floatingObject, m_lineTop, m_lineBottom - m_lineTop)
; | 488 ShapeOutsideDeltas shapeDeltas = shapeOutside->computeDeltasForContainin
gBlockLine(const_cast<LayoutBlockFlow*>(m_layoutObject), floatingObject, m_lineT
op, m_lineBottom - m_lineTop); |
| 489 if (!shapeDeltas.lineOverlapsShape()) | 489 if (!shapeDeltas.lineOverlapsShape()) |
| 490 return false; | 490 return false; |
| 491 | 491 |
| 492 logicalRight += shapeDeltas.rightMarginBoxDelta(); | 492 logicalRight += shapeDeltas.rightMarginBoxDelta(); |
| 493 } | 493 } |
| 494 if (logicalRight > m_offset) { | 494 if (logicalRight > m_offset) { |
| 495 m_offset = logicalRight; | 495 m_offset = logicalRight; |
| 496 return true; | 496 return true; |
| 497 } | 497 } |
| 498 | 498 |
| 499 return false; | 499 return false; |
| 500 } | 500 } |
| 501 | 501 |
| 502 template<> | 502 template<> |
| 503 inline bool ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::
updateOffsetIfNeeded(const FloatingObject& floatingObject) | 503 inline bool ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::
updateOffsetIfNeeded(const FloatingObject& floatingObject) |
| 504 { | 504 { |
| 505 LayoutUnit logicalLeft = m_layoutObject->logicalLeftForFloat(&floatingObject
); | 505 LayoutUnit logicalLeft = m_layoutObject->logicalLeftForFloat(&floatingObject
); |
| 506 if (ShapeOutsideInfo* shapeOutside = floatingObject.layoutObject()->shapeOut
sideInfo()) { | 506 if (ShapeOutsideInfo* shapeOutside = floatingObject.layoutObject()->shapeOut
sideInfo()) { |
| 507 ShapeOutsideDeltas shapeDeltas = shapeOutside->computeDeltasForContainin
gBlockLine(*m_layoutObject, floatingObject, m_lineTop, m_lineBottom - m_lineTop)
; | 507 ShapeOutsideDeltas shapeDeltas = shapeOutside->computeDeltasForContainin
gBlockLine(const_cast<LayoutBlockFlow*>(m_layoutObject), floatingObject, m_lineT
op, m_lineBottom - m_lineTop); |
| 508 if (!shapeDeltas.lineOverlapsShape()) | 508 if (!shapeDeltas.lineOverlapsShape()) |
| 509 return false; | 509 return false; |
| 510 | 510 |
| 511 logicalLeft += shapeDeltas.leftMarginBoxDelta(); | 511 logicalLeft += shapeDeltas.leftMarginBoxDelta(); |
| 512 } | 512 } |
| 513 if (logicalLeft < m_offset) { | 513 if (logicalLeft < m_offset) { |
| 514 m_offset = logicalLeft; | 514 m_offset = logicalLeft; |
| 515 return true; | 515 return true; |
| 516 } | 516 } |
| 517 | 517 |
| 518 return false; | 518 return false; |
| 519 } | 519 } |
| 520 | 520 |
| 521 #ifndef NDEBUG | 521 #ifndef NDEBUG |
| 522 // These helpers are only used by the PODIntervalTree for debugging purposes. | 522 // These helpers are only used by the PODIntervalTree for debugging purposes. |
| 523 String ValueToString<int>::string(const int value) | 523 String ValueToString<int>::string(const int value) |
| 524 { | 524 { |
| 525 return String::number(value); | 525 return String::number(value); |
| 526 } | 526 } |
| 527 | 527 |
| 528 String ValueToString<FloatingObject*>::string(const FloatingObject* floatingObje
ct) | 528 String ValueToString<FloatingObject*>::string(const FloatingObject* floatingObje
ct) |
| 529 { | 529 { |
| 530 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->fr
ameRect().pixelSnappedX(), floatingObject->frameRect().pixelSnappedY(), floating
Object->frameRect().pixelSnappedMaxX(), floatingObject->frameRect().pixelSnapped
MaxY()); | 530 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->fr
ameRect().pixelSnappedX(), floatingObject->frameRect().pixelSnappedY(), floating
Object->frameRect().pixelSnappedMaxX(), floatingObject->frameRect().pixelSnapped
MaxY()); |
| 531 } | 531 } |
| 532 #endif | 532 #endif |
| 533 | 533 |
| 534 | 534 |
| 535 } // namespace blink | 535 } // namespace blink |
| OLD | NEW |