| 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 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 if (!gPositionedContainerMap) | 1023 if (!gPositionedContainerMap) |
| 1024 return; | 1024 return; |
| 1025 | 1025 |
| 1026 LayoutBlock* container = gPositionedContainerMap->take(o); | 1026 LayoutBlock* container = gPositionedContainerMap->take(o); |
| 1027 if (!container) | 1027 if (!container) |
| 1028 return; | 1028 return; |
| 1029 | 1029 |
| 1030 TrackedLayoutBoxListHashSet* positionedDescendants = | 1030 TrackedLayoutBoxListHashSet* positionedDescendants = |
| 1031 gPositionedDescendantsMap->at(container); | 1031 gPositionedDescendantsMap->at(container); |
| 1032 ASSERT(positionedDescendants && positionedDescendants->contains(o)); | 1032 ASSERT(positionedDescendants && positionedDescendants->contains(o)); |
| 1033 positionedDescendants->remove(o); | 1033 positionedDescendants->erase(o); |
| 1034 if (positionedDescendants->isEmpty()) { | 1034 if (positionedDescendants->isEmpty()) { |
| 1035 gPositionedDescendantsMap->erase(container); | 1035 gPositionedDescendantsMap->erase(container); |
| 1036 container->m_hasPositionedObjects = false; | 1036 container->m_hasPositionedObjects = false; |
| 1037 } | 1037 } |
| 1038 } | 1038 } |
| 1039 | 1039 |
| 1040 PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded( | 1040 PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded( |
| 1041 const PaintInvalidationState& paintInvalidationState) { | 1041 const PaintInvalidationState& paintInvalidationState) { |
| 1042 return LayoutBox::invalidatePaintIfNeeded(paintInvalidationState); | 1042 return LayoutBox::invalidatePaintIfNeeded(paintInvalidationState); |
| 1043 } | 1043 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 p = p->parent(); | 1089 p = p->parent(); |
| 1090 if (p) | 1090 if (p) |
| 1091 p->setChildNeedsLayout(); | 1091 p->setChildNeedsLayout(); |
| 1092 | 1092 |
| 1093 deadObjects.push_back(positionedObject); | 1093 deadObjects.push_back(positionedObject); |
| 1094 } | 1094 } |
| 1095 } | 1095 } |
| 1096 | 1096 |
| 1097 for (auto object : deadObjects) { | 1097 for (auto object : deadObjects) { |
| 1098 ASSERT(gPositionedContainerMap->at(object) == this); | 1098 ASSERT(gPositionedContainerMap->at(object) == this); |
| 1099 positionedDescendants->remove(object); | 1099 positionedDescendants->erase(object); |
| 1100 gPositionedContainerMap->erase(object); | 1100 gPositionedContainerMap->erase(object); |
| 1101 } | 1101 } |
| 1102 if (positionedDescendants->isEmpty()) { | 1102 if (positionedDescendants->isEmpty()) { |
| 1103 gPositionedDescendantsMap->erase(this); | 1103 gPositionedDescendantsMap->erase(this); |
| 1104 m_hasPositionedObjects = false; | 1104 m_hasPositionedObjects = false; |
| 1105 } | 1105 } |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 void LayoutBlock::addPercentHeightDescendant(LayoutBox* descendant) { | 1108 void LayoutBlock::addPercentHeightDescendant(LayoutBox* descendant) { |
| 1109 if (descendant->percentHeightContainer()) { | 1109 if (descendant->percentHeightContainer()) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1123 descendantSet = new TrackedLayoutBoxListHashSet; | 1123 descendantSet = new TrackedLayoutBoxListHashSet; |
| 1124 gPercentHeightDescendantsMap->set(this, WTF::wrapUnique(descendantSet)); | 1124 gPercentHeightDescendantsMap->set(this, WTF::wrapUnique(descendantSet)); |
| 1125 } | 1125 } |
| 1126 descendantSet->insert(descendant); | 1126 descendantSet->insert(descendant); |
| 1127 | 1127 |
| 1128 m_hasPercentHeightDescendants = true; | 1128 m_hasPercentHeightDescendants = true; |
| 1129 } | 1129 } |
| 1130 | 1130 |
| 1131 void LayoutBlock::removePercentHeightDescendant(LayoutBox* descendant) { | 1131 void LayoutBlock::removePercentHeightDescendant(LayoutBox* descendant) { |
| 1132 if (TrackedLayoutBoxListHashSet* descendants = percentHeightDescendants()) { | 1132 if (TrackedLayoutBoxListHashSet* descendants = percentHeightDescendants()) { |
| 1133 descendants->remove(descendant); | 1133 descendants->erase(descendant); |
| 1134 descendant->setPercentHeightContainer(nullptr); | 1134 descendant->setPercentHeightContainer(nullptr); |
| 1135 if (descendants->isEmpty()) { | 1135 if (descendants->isEmpty()) { |
| 1136 gPercentHeightDescendantsMap->erase(this); | 1136 gPercentHeightDescendantsMap->erase(this); |
| 1137 m_hasPercentHeightDescendants = false; | 1137 m_hasPercentHeightDescendants = false; |
| 1138 } | 1138 } |
| 1139 } | 1139 } |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 TrackedLayoutBoxListHashSet* LayoutBlock::percentHeightDescendantsInternal() | 1142 TrackedLayoutBoxListHashSet* LayoutBlock::percentHeightDescendantsInternal() |
| 1143 const { | 1143 const { |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 } | 2227 } |
| 2228 | 2228 |
| 2229 return availableHeight; | 2229 return availableHeight; |
| 2230 } | 2230 } |
| 2231 | 2231 |
| 2232 bool LayoutBlock::hasDefiniteLogicalHeight() const { | 2232 bool LayoutBlock::hasDefiniteLogicalHeight() const { |
| 2233 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); | 2233 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); |
| 2234 } | 2234 } |
| 2235 | 2235 |
| 2236 } // namespace blink | 2236 } // namespace blink |
| OLD | NEW |