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. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
6 * All rights reserved. | 6 * All rights reserved. |
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // By default, subclasses do not have inline children. | 105 // By default, subclasses do not have inline children. |
106 } | 106 } |
107 | 107 |
108 void LayoutBlock::removeFromGlobalMaps() { | 108 void LayoutBlock::removeFromGlobalMaps() { |
109 if (hasPositionedObjects()) { | 109 if (hasPositionedObjects()) { |
110 std::unique_ptr<TrackedLayoutBoxListHashSet> descendants = | 110 std::unique_ptr<TrackedLayoutBoxListHashSet> descendants = |
111 gPositionedDescendantsMap->take(this); | 111 gPositionedDescendantsMap->take(this); |
112 ASSERT(!descendants->isEmpty()); | 112 ASSERT(!descendants->isEmpty()); |
113 for (LayoutBox* descendant : *descendants) { | 113 for (LayoutBox* descendant : *descendants) { |
114 ASSERT(gPositionedContainerMap->get(descendant) == this); | 114 ASSERT(gPositionedContainerMap->get(descendant) == this); |
115 gPositionedContainerMap->remove(descendant); | 115 gPositionedContainerMap->erase(descendant); |
116 } | 116 } |
117 } | 117 } |
118 if (hasPercentHeightDescendants()) { | 118 if (hasPercentHeightDescendants()) { |
119 std::unique_ptr<TrackedLayoutBoxListHashSet> descendants = | 119 std::unique_ptr<TrackedLayoutBoxListHashSet> descendants = |
120 gPercentHeightDescendantsMap->take(this); | 120 gPercentHeightDescendantsMap->take(this); |
121 ASSERT(!descendants->isEmpty()); | 121 ASSERT(!descendants->isEmpty()); |
122 for (LayoutBox* descendant : *descendants) { | 122 for (LayoutBox* descendant : *descendants) { |
123 ASSERT(descendant->percentHeightContainer() == this); | 123 ASSERT(descendant->percentHeightContainer() == this); |
124 descendant->setPercentHeightContainer(nullptr); | 124 descendant->setPercentHeightContainer(nullptr); |
125 } | 125 } |
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 | 1005 |
1006 LayoutBlock* container = gPositionedContainerMap->take(o); | 1006 LayoutBlock* container = gPositionedContainerMap->take(o); |
1007 if (!container) | 1007 if (!container) |
1008 return; | 1008 return; |
1009 | 1009 |
1010 TrackedLayoutBoxListHashSet* positionedDescendants = | 1010 TrackedLayoutBoxListHashSet* positionedDescendants = |
1011 gPositionedDescendantsMap->get(container); | 1011 gPositionedDescendantsMap->get(container); |
1012 ASSERT(positionedDescendants && positionedDescendants->contains(o)); | 1012 ASSERT(positionedDescendants && positionedDescendants->contains(o)); |
1013 positionedDescendants->remove(o); | 1013 positionedDescendants->remove(o); |
1014 if (positionedDescendants->isEmpty()) { | 1014 if (positionedDescendants->isEmpty()) { |
1015 gPositionedDescendantsMap->remove(container); | 1015 gPositionedDescendantsMap->erase(container); |
1016 container->m_hasPositionedObjects = false; | 1016 container->m_hasPositionedObjects = false; |
1017 } | 1017 } |
1018 } | 1018 } |
1019 | 1019 |
1020 PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded( | 1020 PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded( |
1021 const PaintInvalidationState& paintInvalidationState) { | 1021 const PaintInvalidationState& paintInvalidationState) { |
1022 return LayoutBox::invalidatePaintIfNeeded(paintInvalidationState); | 1022 return LayoutBox::invalidatePaintIfNeeded(paintInvalidationState); |
1023 } | 1023 } |
1024 | 1024 |
1025 PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded( | 1025 PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 if (p) | 1065 if (p) |
1066 p->setChildNeedsLayout(); | 1066 p->setChildNeedsLayout(); |
1067 | 1067 |
1068 deadObjects.push_back(positionedObject); | 1068 deadObjects.push_back(positionedObject); |
1069 } | 1069 } |
1070 } | 1070 } |
1071 | 1071 |
1072 for (auto object : deadObjects) { | 1072 for (auto object : deadObjects) { |
1073 ASSERT(gPositionedContainerMap->get(object) == this); | 1073 ASSERT(gPositionedContainerMap->get(object) == this); |
1074 positionedDescendants->remove(object); | 1074 positionedDescendants->remove(object); |
1075 gPositionedContainerMap->remove(object); | 1075 gPositionedContainerMap->erase(object); |
1076 } | 1076 } |
1077 if (positionedDescendants->isEmpty()) { | 1077 if (positionedDescendants->isEmpty()) { |
1078 gPositionedDescendantsMap->remove(this); | 1078 gPositionedDescendantsMap->erase(this); |
1079 m_hasPositionedObjects = false; | 1079 m_hasPositionedObjects = false; |
1080 } | 1080 } |
1081 } | 1081 } |
1082 | 1082 |
1083 void LayoutBlock::addPercentHeightDescendant(LayoutBox* descendant) { | 1083 void LayoutBlock::addPercentHeightDescendant(LayoutBox* descendant) { |
1084 if (descendant->percentHeightContainer()) { | 1084 if (descendant->percentHeightContainer()) { |
1085 if (descendant->percentHeightContainer() == this) { | 1085 if (descendant->percentHeightContainer() == this) { |
1086 ASSERT(hasPercentHeightDescendant(descendant)); | 1086 ASSERT(hasPercentHeightDescendant(descendant)); |
1087 return; | 1087 return; |
1088 } | 1088 } |
(...skipping 12 matching lines...) Expand all Loading... |
1101 descendantSet->add(descendant); | 1101 descendantSet->add(descendant); |
1102 | 1102 |
1103 m_hasPercentHeightDescendants = true; | 1103 m_hasPercentHeightDescendants = true; |
1104 } | 1104 } |
1105 | 1105 |
1106 void LayoutBlock::removePercentHeightDescendant(LayoutBox* descendant) { | 1106 void LayoutBlock::removePercentHeightDescendant(LayoutBox* descendant) { |
1107 if (TrackedLayoutBoxListHashSet* descendants = percentHeightDescendants()) { | 1107 if (TrackedLayoutBoxListHashSet* descendants = percentHeightDescendants()) { |
1108 descendants->remove(descendant); | 1108 descendants->remove(descendant); |
1109 descendant->setPercentHeightContainer(nullptr); | 1109 descendant->setPercentHeightContainer(nullptr); |
1110 if (descendants->isEmpty()) { | 1110 if (descendants->isEmpty()) { |
1111 gPercentHeightDescendantsMap->remove(this); | 1111 gPercentHeightDescendantsMap->erase(this); |
1112 m_hasPercentHeightDescendants = false; | 1112 m_hasPercentHeightDescendants = false; |
1113 } | 1113 } |
1114 } | 1114 } |
1115 } | 1115 } |
1116 | 1116 |
1117 TrackedLayoutBoxListHashSet* LayoutBlock::percentHeightDescendantsInternal() | 1117 TrackedLayoutBoxListHashSet* LayoutBlock::percentHeightDescendantsInternal() |
1118 const { | 1118 const { |
1119 return gPercentHeightDescendantsMap ? gPercentHeightDescendantsMap->get(this) | 1119 return gPercentHeightDescendantsMap ? gPercentHeightDescendantsMap->get(this) |
1120 : nullptr; | 1120 : nullptr; |
1121 } | 1121 } |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2205 } | 2205 } |
2206 | 2206 |
2207 return availableHeight; | 2207 return availableHeight; |
2208 } | 2208 } |
2209 | 2209 |
2210 bool LayoutBlock::hasDefiniteLogicalHeight() const { | 2210 bool LayoutBlock::hasDefiniteLogicalHeight() const { |
2211 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); | 2211 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); |
2212 } | 2212 } |
2213 | 2213 |
2214 } // namespace blink | 2214 } // namespace blink |
OLD | NEW |