| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 #endif | 75 #endif |
| 76 { | 76 { |
| 77 } | 77 } |
| 78 | 78 |
| 79 PassOwnPtr<FloatingObject> FloatingObject::create(LayoutBox* layoutObject) | 79 PassOwnPtr<FloatingObject> FloatingObject::create(LayoutBox* layoutObject) |
| 80 { | 80 { |
| 81 OwnPtr<FloatingObject> newObj = adoptPtr(new FloatingObject(layoutObject)); | 81 OwnPtr<FloatingObject> newObj = adoptPtr(new FloatingObject(layoutObject)); |
| 82 newObj->setShouldPaint(!layoutObject->hasSelfPaintingLayer()); // If a layer
exists, the float will paint itself. Otherwise someone else will. | 82 newObj->setShouldPaint(!layoutObject->hasSelfPaintingLayer()); // If a layer
exists, the float will paint itself. Otherwise someone else will. |
| 83 newObj->setIsDescendant(true); | 83 newObj->setIsDescendant(true); |
| 84 | 84 |
| 85 return newObj.release(); | 85 return newObj; |
| 86 } | 86 } |
| 87 | 87 |
| 88 PassOwnPtr<FloatingObject> FloatingObject::copyToNewContainer(LayoutSize offset,
bool shouldPaint, bool isDescendant) const | 88 PassOwnPtr<FloatingObject> FloatingObject::copyToNewContainer(LayoutSize offset,
bool shouldPaint, bool isDescendant) const |
| 89 { | 89 { |
| 90 return adoptPtr(new FloatingObject(layoutObject(), getType(), LayoutRect(fra
meRect().location() - offset, frameRect().size()), shouldPaint, isDescendant, is
LowestNonOverhangingFloatInChild())); | 90 return adoptPtr(new FloatingObject(layoutObject(), getType(), LayoutRect(fra
meRect().location() - offset, frameRect().size()), shouldPaint, isDescendant, is
LowestNonOverhangingFloatInChild())); |
| 91 } | 91 } |
| 92 | 92 |
| 93 PassOwnPtr<FloatingObject> FloatingObject::unsafeClone() const | 93 PassOwnPtr<FloatingObject> FloatingObject::unsafeClone() const |
| 94 { | 94 { |
| 95 OwnPtr<FloatingObject> cloneObject = adoptPtr(new FloatingObject(layoutObjec
t(), getType(), m_frameRect, m_shouldPaint, m_isDescendant, false)); | 95 OwnPtr<FloatingObject> cloneObject = adoptPtr(new FloatingObject(layoutObjec
t(), getType(), m_frameRect, m_shouldPaint, m_isDescendant, false)); |
| 96 cloneObject->m_isPlaced = m_isPlaced; | 96 cloneObject->m_isPlaced = m_isPlaced; |
| 97 return cloneObject.release(); | 97 return cloneObject; |
| 98 } | 98 } |
| 99 | 99 |
| 100 template <FloatingObject::Type FloatTypeValue> | 100 template <FloatingObject::Type FloatTypeValue> |
| 101 class ComputeFloatOffsetAdapter { | 101 class ComputeFloatOffsetAdapter { |
| 102 public: | 102 public: |
| 103 typedef FloatingObjectInterval IntervalType; | 103 typedef FloatingObjectInterval IntervalType; |
| 104 | 104 |
| 105 ComputeFloatOffsetAdapter(const LayoutBlockFlow* layoutObject, LayoutUnit li
neTop, LayoutUnit lineBottom, LayoutUnit offset) | 105 ComputeFloatOffsetAdapter(const LayoutBlockFlow* layoutObject, LayoutUnit li
neTop, LayoutUnit lineBottom, LayoutUnit offset) |
| 106 : m_layoutObject(layoutObject) | 106 : m_layoutObject(layoutObject) |
| 107 , m_lineTop(lineTop) | 107 , m_lineTop(lineTop) |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 { | 381 { |
| 382 for (size_t i = 0; i < sizeof(m_lowestFloatBottomCache) / sizeof(FloatBottom
CachedValue); ++i) | 382 for (size_t i = 0; i < sizeof(m_lowestFloatBottomCache) / sizeof(FloatBottom
CachedValue); ++i) |
| 383 m_lowestFloatBottomCache[i].dirty = true; | 383 m_lowestFloatBottomCache[i].dirty = true; |
| 384 } | 384 } |
| 385 | 385 |
| 386 void FloatingObjects::moveAllToFloatInfoMap(LayoutBoxToFloatInfoMap& map) | 386 void FloatingObjects::moveAllToFloatInfoMap(LayoutBoxToFloatInfoMap& map) |
| 387 { | 387 { |
| 388 while (!m_set.isEmpty()) { | 388 while (!m_set.isEmpty()) { |
| 389 OwnPtr<FloatingObject> floatingObject = m_set.takeFirst(); | 389 OwnPtr<FloatingObject> floatingObject = m_set.takeFirst(); |
| 390 LayoutBox* layoutObject = floatingObject->layoutObject(); | 390 LayoutBox* layoutObject = floatingObject->layoutObject(); |
| 391 map.add(layoutObject, floatingObject.release()); | 391 map.add(layoutObject, std::move(floatingObject)); |
| 392 } | 392 } |
| 393 clear(); | 393 clear(); |
| 394 } | 394 } |
| 395 | 395 |
| 396 inline void FloatingObjects::increaseObjectsCount(FloatingObject::Type type) | 396 inline void FloatingObjects::increaseObjectsCount(FloatingObject::Type type) |
| 397 { | 397 { |
| 398 if (type == FloatingObject::FloatLeft) | 398 if (type == FloatingObject::FloatLeft) |
| 399 m_leftObjectsCount++; | 399 m_leftObjectsCount++; |
| 400 else | 400 else |
| 401 m_rightObjectsCount++; | 401 m_rightObjectsCount++; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 } | 618 } |
| 619 | 619 |
| 620 String ValueToString<FloatingObject*>::toString(const FloatingObject* floatingOb
ject) | 620 String ValueToString<FloatingObject*>::toString(const FloatingObject* floatingOb
ject) |
| 621 { | 621 { |
| 622 return String::format("%p (%gx%g %gx%g)", floatingObject, floatingObject->fr
ameRect().x().toFloat(), floatingObject->frameRect().y().toFloat(), floatingObje
ct->frameRect().maxX().toFloat(), floatingObject->frameRect().maxY().toFloat()); | 622 return String::format("%p (%gx%g %gx%g)", floatingObject, floatingObject->fr
ameRect().x().toFloat(), floatingObject->frameRect().y().toFloat(), floatingObje
ct->frameRect().maxX().toFloat(), floatingObject->frameRect().maxY().toFloat()); |
| 623 } | 623 } |
| 624 #endif | 624 #endif |
| 625 | 625 |
| 626 | 626 |
| 627 } // namespace blink | 627 } // namespace blink |
| OLD | NEW |