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 25 matching lines...) Expand all Loading... |
36 void* pointers[2]; | 36 void* pointers[2]; |
37 LayoutRect rect; | 37 LayoutRect rect; |
38 int paginationStrut; | 38 int paginationStrut; |
39 uint32_t bitfields : 8; | 39 uint32_t bitfields : 8; |
40 }; | 40 }; |
41 | 41 |
42 static_assert(sizeof(FloatingObject) == sizeof(SameSizeAsFloatingObject), "Float
ingObject should stay small"); | 42 static_assert(sizeof(FloatingObject) == sizeof(SameSizeAsFloatingObject), "Float
ingObject should stay small"); |
43 | 43 |
44 FloatingObject::FloatingObject(LayoutBox* layoutObject) | 44 FloatingObject::FloatingObject(LayoutBox* layoutObject) |
45 : m_layoutObject(layoutObject) | 45 : m_layoutObject(layoutObject) |
46 , m_originatingLine(0) | 46 , m_originatingLine(nullptr) |
47 , m_paginationStrut(0) | 47 , m_paginationStrut(0) |
48 , m_shouldPaint(true) | 48 , m_shouldPaint(true) |
49 , m_isDescendant(false) | 49 , m_isDescendant(false) |
50 , m_isPlaced(false) | 50 , m_isPlaced(false) |
51 #if ENABLE(ASSERT) | 51 #if ENABLE(ASSERT) |
52 , m_isInPlacedTree(false) | 52 , m_isInPlacedTree(false) |
53 #endif | 53 #endif |
54 { | 54 { |
55 EFloat type = layoutObject->style()->floating(); | 55 EFloat type = layoutObject->style()->floating(); |
56 ASSERT(type != NoFloat); | 56 ASSERT(type != NoFloat); |
57 if (type == LeftFloat) | 57 if (type == LeftFloat) |
58 m_type = FloatLeft; | 58 m_type = FloatLeft; |
59 else if (type == RightFloat) | 59 else if (type == RightFloat) |
60 m_type = FloatRight; | 60 m_type = FloatRight; |
61 } | 61 } |
62 | 62 |
63 FloatingObject::FloatingObject(LayoutBox* layoutObject, Type type, const LayoutR
ect& frameRect, bool shouldPaint, bool isDescendant) | 63 FloatingObject::FloatingObject(LayoutBox* layoutObject, Type type, const LayoutR
ect& frameRect, bool shouldPaint, bool isDescendant) |
64 : m_layoutObject(layoutObject) | 64 : m_layoutObject(layoutObject) |
65 , m_originatingLine(0) | 65 , m_originatingLine(nullptr) |
66 , m_frameRect(frameRect) | 66 , m_frameRect(frameRect) |
67 , m_paginationStrut(0) | 67 , m_paginationStrut(0) |
68 , m_type(type) | 68 , m_type(type) |
69 , m_shouldPaint(shouldPaint) | 69 , m_shouldPaint(shouldPaint) |
70 , m_isDescendant(isDescendant) | 70 , m_isDescendant(isDescendant) |
71 , m_isPlaced(true) | 71 , m_isPlaced(true) |
72 #if ENABLE(ASSERT) | 72 #if ENABLE(ASSERT) |
73 , m_isInPlacedTree(false) | 73 , m_isInPlacedTree(false) |
74 #endif | 74 #endif |
75 { | 75 { |
(...skipping 24 matching lines...) Expand all Loading... |
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, int lineTop,
int lineBottom, LayoutUnit offset) | 105 ComputeFloatOffsetAdapter(const LayoutBlockFlow* layoutObject, int lineTop,
int lineBottom, LayoutUnit offset) |
106 : m_layoutObject(layoutObject) | 106 : m_layoutObject(layoutObject) |
107 , m_lineTop(lineTop) | 107 , m_lineTop(lineTop) |
108 , m_lineBottom(lineBottom) | 108 , m_lineBottom(lineBottom) |
109 , m_offset(offset) | 109 , m_offset(offset) |
110 , m_outermostFloat(0) | 110 , m_outermostFloat(nullptr) |
111 { | 111 { |
112 } | 112 } |
113 | 113 |
114 virtual ~ComputeFloatOffsetAdapter() { } | 114 virtual ~ComputeFloatOffsetAdapter() { } |
115 | 115 |
116 int lowValue() const { return m_lineTop; } | 116 int lowValue() const { return m_lineTop; } |
117 int highValue() const { return m_lineBottom; } | 117 int highValue() const { return m_lineBottom; } |
118 void collectIfNeeded(const IntervalType&); | 118 void collectIfNeeded(const IntervalType&); |
119 | 119 |
120 LayoutUnit offset() const { return m_offset; } | 120 LayoutUnit offset() const { return m_offset; } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 FloatingObjects::~FloatingObjects() | 163 FloatingObjects::~FloatingObjects() |
164 { | 164 { |
165 } | 165 } |
166 void FloatingObjects::clearLineBoxTreePointers() | 166 void FloatingObjects::clearLineBoxTreePointers() |
167 { | 167 { |
168 // Clear references to originating lines, since the lines are being deleted | 168 // Clear references to originating lines, since the lines are being deleted |
169 FloatingObjectSetIterator end = m_set.end(); | 169 FloatingObjectSetIterator end = m_set.end(); |
170 for (FloatingObjectSetIterator it = m_set.begin(); it != end; ++it) { | 170 for (FloatingObjectSetIterator it = m_set.begin(); it != end; ++it) { |
171 ASSERT(!((*it)->originatingLine()) || (*it)->originatingLine()->layoutOb
ject() == m_layoutObject); | 171 ASSERT(!((*it)->originatingLine()) || (*it)->originatingLine()->layoutOb
ject() == m_layoutObject); |
172 (*it)->setOriginatingLine(0); | 172 (*it)->setOriginatingLine(nullptr); |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 FloatingObjects::FloatingObjects(const LayoutBlockFlow* layoutObject, bool horiz
ontalWritingMode) | 176 FloatingObjects::FloatingObjects(const LayoutBlockFlow* layoutObject, bool horiz
ontalWritingMode) |
177 : m_placedFloatsTree(UninitializedTree) | 177 : m_placedFloatsTree(UninitializedTree) |
178 , m_leftObjectsCount(0) | 178 , m_leftObjectsCount(0) |
179 , m_rightObjectsCount(0) | 179 , m_rightObjectsCount(0) |
180 , m_horizontalWritingMode(horizontalWritingMode) | 180 , m_horizontalWritingMode(horizontalWritingMode) |
181 , m_layoutObject(layoutObject) | 181 , m_layoutObject(layoutObject) |
182 , m_cachedHorizontalWritingMode(false) | 182 , m_cachedHorizontalWritingMode(false) |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |