| 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. 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 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 return currentStyle.isHorizontalWritingMode() | 1194 return currentStyle.isHorizontalWritingMode() |
| 1195 ? LayoutRect(x, y, caretWidth(), height) | 1195 ? LayoutRect(x, y, caretWidth(), height) |
| 1196 : LayoutRect(y, x, height, caretWidth()); | 1196 : LayoutRect(y, x, height, caretWidth()); |
| 1197 } | 1197 } |
| 1198 | 1198 |
| 1199 const LayoutObject* LayoutBoxModelObject::pushMappingToContainer( | 1199 const LayoutObject* LayoutBoxModelObject::pushMappingToContainer( |
| 1200 const LayoutBoxModelObject* ancestorToStopAt, | 1200 const LayoutBoxModelObject* ancestorToStopAt, |
| 1201 LayoutGeometryMap& geometryMap) const { | 1201 LayoutGeometryMap& geometryMap) const { |
| 1202 ASSERT(ancestorToStopAt != this); | 1202 ASSERT(ancestorToStopAt != this); |
| 1203 | 1203 |
| 1204 bool ancestorSkipped; | 1204 AncestorSkipInfo skipInfo(ancestorToStopAt); |
| 1205 LayoutObject* container = this->container(ancestorToStopAt, &ancestorSkipped); | 1205 LayoutObject* container = this->container(&skipInfo); |
| 1206 if (!container) | 1206 if (!container) |
| 1207 return nullptr; | 1207 return nullptr; |
| 1208 | 1208 |
| 1209 bool isInline = isLayoutInline(); | 1209 bool isInline = isLayoutInline(); |
| 1210 bool isFixedPos = !isInline && style()->position() == FixedPosition; | 1210 bool isFixedPos = !isInline && style()->position() == FixedPosition; |
| 1211 bool containsFixedPosition = canContainFixedPositionObjects(); | 1211 bool containsFixedPosition = canContainFixedPositionObjects(); |
| 1212 | 1212 |
| 1213 LayoutSize adjustmentForSkippedAncestor; | 1213 LayoutSize adjustmentForSkippedAncestor; |
| 1214 if (ancestorSkipped) { | 1214 if (skipInfo.ancestorSkipped()) { |
| 1215 // There can't be a transform between paintInvalidationContainer and | 1215 // There can't be a transform between paintInvalidationContainer and |
| 1216 // ancestorToStopAt, because transforms create containers, so it should be | 1216 // ancestorToStopAt, because transforms create containers, so it should be |
| 1217 // safe to just subtract the delta between the ancestor and | 1217 // safe to just subtract the delta between the ancestor and |
| 1218 // ancestorToStopAt. | 1218 // ancestorToStopAt. |
| 1219 adjustmentForSkippedAncestor = | 1219 adjustmentForSkippedAncestor = |
| 1220 -ancestorToStopAt->offsetFromAncestorContainer(container); | 1220 -ancestorToStopAt->offsetFromAncestorContainer(container); |
| 1221 } | 1221 } |
| 1222 | 1222 |
| 1223 LayoutSize containerOffset = offsetFromContainer(container); | 1223 LayoutSize containerOffset = offsetFromContainer(container); |
| 1224 bool offsetDependsOnPoint; | 1224 bool offsetDependsOnPoint; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1244 TransformationMatrix t; | 1244 TransformationMatrix t; |
| 1245 getTransformFromContainer(container, containerOffset, t); | 1245 getTransformFromContainer(container, containerOffset, t); |
| 1246 t.translateRight(adjustmentForSkippedAncestor.width().toFloat(), | 1246 t.translateRight(adjustmentForSkippedAncestor.width().toFloat(), |
| 1247 adjustmentForSkippedAncestor.height().toFloat()); | 1247 adjustmentForSkippedAncestor.height().toFloat()); |
| 1248 geometryMap.push(this, t, flags, LayoutSize()); | 1248 geometryMap.push(this, t, flags, LayoutSize()); |
| 1249 } else { | 1249 } else { |
| 1250 containerOffset += adjustmentForSkippedAncestor; | 1250 containerOffset += adjustmentForSkippedAncestor; |
| 1251 geometryMap.push(this, containerOffset, flags, LayoutSize()); | 1251 geometryMap.push(this, containerOffset, flags, LayoutSize()); |
| 1252 } | 1252 } |
| 1253 | 1253 |
| 1254 return ancestorSkipped ? ancestorToStopAt : container; | 1254 return skipInfo.ancestorSkipped() ? ancestorToStopAt : container; |
| 1255 } | 1255 } |
| 1256 | 1256 |
| 1257 void LayoutBoxModelObject::moveChildTo(LayoutBoxModelObject* toBoxModelObject, | 1257 void LayoutBoxModelObject::moveChildTo(LayoutBoxModelObject* toBoxModelObject, |
| 1258 LayoutObject* child, | 1258 LayoutObject* child, |
| 1259 LayoutObject* beforeChild, | 1259 LayoutObject* beforeChild, |
| 1260 bool fullRemoveInsert) { | 1260 bool fullRemoveInsert) { |
| 1261 // We assume that callers have cleared their positioned objects list for child | 1261 // We assume that callers have cleared their positioned objects list for child |
| 1262 // moves (!fullRemoveInsert) so the positioned layoutObject maps don't become | 1262 // moves (!fullRemoveInsert) so the positioned layoutObject maps don't become |
| 1263 // stale. It would be too slow to do the map lookup on each call. | 1263 // stale. It would be too slow to do the map lookup on each call. |
| 1264 ASSERT(!fullRemoveInsert || !isLayoutBlock() || | 1264 ASSERT(!fullRemoveInsert || !isLayoutBlock() || |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 if (rootElementStyle->hasBackground()) | 1340 if (rootElementStyle->hasBackground()) |
| 1341 return false; | 1341 return false; |
| 1342 | 1342 |
| 1343 if (node() != document().firstBodyElement()) | 1343 if (node() != document().firstBodyElement()) |
| 1344 return false; | 1344 return false; |
| 1345 | 1345 |
| 1346 return true; | 1346 return true; |
| 1347 } | 1347 } |
| 1348 | 1348 |
| 1349 } // namespace blink | 1349 } // namespace blink |
| OLD | NEW |