| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 } | 207 } |
| 208 | 208 |
| 209 LayoutUnit lowestFloatBottom = 0; | 209 LayoutUnit lowestFloatBottom = 0; |
| 210 const FloatingObjectSet& floatingObjectSet = set(); | 210 const FloatingObjectSet& floatingObjectSet = set(); |
| 211 FloatingObjectSetIterator end = floatingObjectSet.end(); | 211 FloatingObjectSetIterator end = floatingObjectSet.end(); |
| 212 if (floatType == FloatingObject::FloatLeftRight) { | 212 if (floatType == FloatingObject::FloatLeftRight) { |
| 213 LayoutUnit lowestFloatBottomLeft = 0; | 213 LayoutUnit lowestFloatBottomLeft = 0; |
| 214 LayoutUnit lowestFloatBottomRight = 0; | 214 LayoutUnit lowestFloatBottomRight = 0; |
| 215 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end
; ++it) { | 215 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end
; ++it) { |
| 216 FloatingObject* floatingObject = (*it).get(); | 216 FloatingObject* floatingObject = it->get(); |
| 217 if (floatingObject->isPlaced()) { | 217 if (floatingObject->isPlaced()) { |
| 218 FloatingObject::Type curType = floatingObject->type(); | 218 FloatingObject::Type curType = floatingObject->type(); |
| 219 LayoutUnit curFloatLogicalBottom = m_renderer->logicalBottomForF
loat(floatingObject); | 219 LayoutUnit curFloatLogicalBottom = m_renderer->logicalBottomForF
loat(floatingObject); |
| 220 if (curType & FloatingObject::FloatLeft) | 220 if (curType & FloatingObject::FloatLeft) |
| 221 lowestFloatBottomLeft = max(lowestFloatBottomLeft, curFloatL
ogicalBottom); | 221 lowestFloatBottomLeft = max(lowestFloatBottomLeft, curFloatL
ogicalBottom); |
| 222 if (curType & FloatingObject::FloatRight) | 222 if (curType & FloatingObject::FloatRight) |
| 223 lowestFloatBottomRight = max(lowestFloatBottomRight, curFloa
tLogicalBottom); | 223 lowestFloatBottomRight = max(lowestFloatBottomRight, curFloa
tLogicalBottom); |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 lowestFloatBottom = max(lowestFloatBottomLeft, lowestFloatBottomRight); | 226 lowestFloatBottom = max(lowestFloatBottomLeft, lowestFloatBottomRight); |
| 227 setCachedLowestFloatLogicalBottom(isInHorizontalWritingMode, FloatingObj
ect::FloatLeft, lowestFloatBottomLeft); | 227 setCachedLowestFloatLogicalBottom(isInHorizontalWritingMode, FloatingObj
ect::FloatLeft, lowestFloatBottomLeft); |
| 228 setCachedLowestFloatLogicalBottom(isInHorizontalWritingMode, FloatingObj
ect::FloatRight, lowestFloatBottomRight); | 228 setCachedLowestFloatLogicalBottom(isInHorizontalWritingMode, FloatingObj
ect::FloatRight, lowestFloatBottomRight); |
| 229 } else { | 229 } else { |
| 230 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end
; ++it) { | 230 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end
; ++it) { |
| 231 FloatingObject* floatingObject = (*it).get(); | 231 FloatingObject* floatingObject = it->get(); |
| 232 if (floatingObject->isPlaced() && floatingObject->type() == floatTyp
e) | 232 if (floatingObject->isPlaced() && floatingObject->type() == floatTyp
e) |
| 233 lowestFloatBottom = max(lowestFloatBottom, m_renderer->logicalBo
ttomForFloat(floatingObject)); | 233 lowestFloatBottom = max(lowestFloatBottom, m_renderer->logicalBo
ttomForFloat(floatingObject)); |
| 234 } | 234 } |
| 235 setCachedLowestFloatLogicalBottom(isInHorizontalWritingMode, floatType,
lowestFloatBottom); | 235 setCachedLowestFloatLogicalBottom(isInHorizontalWritingMode, floatType,
lowestFloatBottom); |
| 236 } | 236 } |
| 237 | 237 |
| 238 return lowestFloatBottom; | 238 return lowestFloatBottom; |
| 239 } | 239 } |
| 240 | 240 |
| 241 bool FloatingObjects::hasLowestFloatLogicalBottomCached(bool isHorizontal, Float
ingObject::Type type) const | 241 bool FloatingObjects::hasLowestFloatLogicalBottomCached(bool isHorizontal, Float
ingObject::Type type) const |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 356 |
| 357 void FloatingObjects::computePlacedFloatsTree() | 357 void FloatingObjects::computePlacedFloatsTree() |
| 358 { | 358 { |
| 359 ASSERT(!m_placedFloatsTree.isInitialized()); | 359 ASSERT(!m_placedFloatsTree.isInitialized()); |
| 360 if (m_set.isEmpty()) | 360 if (m_set.isEmpty()) |
| 361 return; | 361 return; |
| 362 m_placedFloatsTree.initIfNeeded(m_renderer->view()->intervalArena()); | 362 m_placedFloatsTree.initIfNeeded(m_renderer->view()->intervalArena()); |
| 363 FloatingObjectSetIterator it = m_set.begin(); | 363 FloatingObjectSetIterator it = m_set.begin(); |
| 364 FloatingObjectSetIterator end = m_set.end(); | 364 FloatingObjectSetIterator end = m_set.end(); |
| 365 for (; it != end; ++it) { | 365 for (; it != end; ++it) { |
| 366 FloatingObject* floatingObject = (*it).get(); | 366 FloatingObject* floatingObject = it->get(); |
| 367 if (floatingObject->isPlaced()) | 367 if (floatingObject->isPlaced()) |
| 368 m_placedFloatsTree.add(intervalForFloatingObject(floatingObject)); | 368 m_placedFloatsTree.add(intervalForFloatingObject(floatingObject)); |
| 369 } | 369 } |
| 370 } | 370 } |
| 371 | 371 |
| 372 LayoutUnit FloatingObjects::logicalLeftOffsetForPositioningFloat(LayoutUnit fixe
dOffset, LayoutUnit logicalTop, LayoutUnit *heightRemaining) | 372 LayoutUnit FloatingObjects::logicalLeftOffsetForPositioningFloat(LayoutUnit fixe
dOffset, LayoutUnit logicalTop, LayoutUnit *heightRemaining) |
| 373 { | 373 { |
| 374 int logicalTopAsInt = roundToInt(logicalTop); | 374 int logicalTopAsInt = roundToInt(logicalTop); |
| 375 ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft> adapter(m
_renderer, logicalTopAsInt, logicalTopAsInt, fixedOffset); | 375 ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft> adapter(m
_renderer, logicalTopAsInt, logicalTopAsInt, fixedOffset); |
| 376 placedFloatsTree().allOverlapsWithAdapter(adapter); | 376 placedFloatsTree().allOverlapsWithAdapter(adapter); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 } | 536 } |
| 537 | 537 |
| 538 String ValueToString<FloatingObject*>::string(const FloatingObject* floatingObje
ct) | 538 String ValueToString<FloatingObject*>::string(const FloatingObject* floatingObje
ct) |
| 539 { | 539 { |
| 540 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->fr
ameRect().pixelSnappedX(), floatingObject->frameRect().pixelSnappedY(), floating
Object->frameRect().pixelSnappedMaxX(), floatingObject->frameRect().pixelSnapped
MaxY()); | 540 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->fr
ameRect().pixelSnappedX(), floatingObject->frameRect().pixelSnappedY(), floating
Object->frameRect().pixelSnappedMaxX(), floatingObject->frameRect().pixelSnapped
MaxY()); |
| 541 } | 541 } |
| 542 #endif | 542 #endif |
| 543 | 543 |
| 544 | 544 |
| 545 } // namespace WebCore | 545 } // namespace WebCore |
| OLD | NEW |