| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 if (i > 0 && currentStep.m_layoutObject == ancestor) { | 74 if (i > 0 && currentStep.m_layoutObject == ancestor) { |
| 75 #if ENABLE(ASSERT) | 75 #if ENABLE(ASSERT) |
| 76 foundAncestor = true; | 76 foundAncestor = true; |
| 77 #endif | 77 #endif |
| 78 break; | 78 break; |
| 79 } | 79 } |
| 80 | 80 |
| 81 // If this box has a transform, it acts as a fixed position container | 81 // If this box has a transform, it acts as a fixed position container |
| 82 // for fixed descendants, which prevents the propagation of 'fixed' | 82 // for fixed descendants, which prevents the propagation of 'fixed' |
| 83 // unless the layer itself is also fixed position. | 83 // unless the layer itself is also fixed position. |
| 84 if (i && currentStep.m_flags & HasTransform && !(currentStep.m_flags & I
sFixedPosition)) | 84 if (i && currentStep.m_flags & ContainsFixedPosition && !(currentStep.m_
flags & IsFixedPosition)) |
| 85 inFixed = false; | 85 inFixed = false; |
| 86 else if (currentStep.m_flags & IsFixedPosition) | 86 else if (currentStep.m_flags & IsFixedPosition) |
| 87 inFixed = true; | 87 inFixed = true; |
| 88 | 88 |
| 89 ASSERT(!i == isTopmostLayoutView(currentStep.m_layoutObject)); | 89 ASSERT(!i == isTopmostLayoutView(currentStep.m_layoutObject)); |
| 90 | 90 |
| 91 if (!i) { | 91 if (!i) { |
| 92 // A null container indicates mapping through the root LayoutView, s
o including its transform (the page scale). | 92 // A null container indicates mapping through the root LayoutView, s
o including its transform (the page scale). |
| 93 if (!ancestor && currentStep.m_transform) | 93 if (!ancestor && currentStep.m_transform) |
| 94 transformState.applyTransform(*currentStep.m_transform.get()); | 94 transformState.applyTransform(*currentStep.m_transform.get()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 113 #ifndef NDEBUG | 113 #ifndef NDEBUG |
| 114 // Handy function to call from gdb while debugging mismatched point/rect errors. | 114 // Handy function to call from gdb while debugging mismatched point/rect errors. |
| 115 void LayoutGeometryMap::dumpSteps() const | 115 void LayoutGeometryMap::dumpSteps() const |
| 116 { | 116 { |
| 117 fprintf(stderr, "LayoutGeometryMap::dumpSteps accumulatedOffset=%d,%d\n", m_
accumulatedOffset.width().toInt(), m_accumulatedOffset.height().toInt()); | 117 fprintf(stderr, "LayoutGeometryMap::dumpSteps accumulatedOffset=%d,%d\n", m_
accumulatedOffset.width().toInt(), m_accumulatedOffset.height().toInt()); |
| 118 for (int i = m_mapping.size() - 1; i >= 0; --i) { | 118 for (int i = m_mapping.size() - 1; i >= 0; --i) { |
| 119 fprintf(stderr, " [%d] %s: offset=%d,%d", i, | 119 fprintf(stderr, " [%d] %s: offset=%d,%d", i, |
| 120 m_mapping[i].m_layoutObject->debugName().ascii().data(), | 120 m_mapping[i].m_layoutObject->debugName().ascii().data(), |
| 121 m_mapping[i].m_offset.width().toInt(), | 121 m_mapping[i].m_offset.width().toInt(), |
| 122 m_mapping[i].m_offset.height().toInt()); | 122 m_mapping[i].m_offset.height().toInt()); |
| 123 if (m_mapping[i].m_flags & HasTransform) | 123 if (m_mapping[i].m_flags & ContainsFixedPosition) |
| 124 fprintf(stderr, " hasTransform"); | 124 fprintf(stderr, " containsFixedPosition"); |
| 125 fprintf(stderr, "\n"); | 125 fprintf(stderr, "\n"); |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 #endif | 128 #endif |
| 129 | 129 |
| 130 FloatQuad LayoutGeometryMap::mapToAncestor(const FloatRect& rect, const LayoutBo
xModelObject* ancestor) const | 130 FloatQuad LayoutGeometryMap::mapToAncestor(const FloatRect& rect, const LayoutBo
xModelObject* ancestor) const |
| 131 { | 131 { |
| 132 FloatQuad result; | 132 FloatQuad result; |
| 133 | 133 |
| 134 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() &
& (!ancestor || (m_mapping.size() && ancestor == m_mapping[0].m_layoutObject)))
{ | 134 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() &
& (!ancestor || (m_mapping.size() && ancestor == m_mapping[0].m_layoutObject)))
{ |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 ASSERT(m_mapping.isEmpty() || isTopmostLayoutView(m_mapping[0].m_layoutObjec
t)); | 168 ASSERT(m_mapping.isEmpty() || isTopmostLayoutView(m_mapping[0].m_layoutObjec
t)); |
| 169 } | 169 } |
| 170 | 170 |
| 171 static bool canMapBetweenLayoutObjects(const LayoutObject* layoutObject, const L
ayoutObject* ancestor) | 171 static bool canMapBetweenLayoutObjects(const LayoutObject* layoutObject, const L
ayoutObject* ancestor) |
| 172 { | 172 { |
| 173 for (const LayoutObject* current = layoutObject; ; current = current->parent
()) { | 173 for (const LayoutObject* current = layoutObject; ; current = current->parent
()) { |
| 174 const ComputedStyle& style = current->styleRef(); | 174 const ComputedStyle& style = current->styleRef(); |
| 175 if (style.position() == FixedPosition || style.isFlippedBlocksWritingMod
e()) | 175 if (style.position() == FixedPosition || style.isFlippedBlocksWritingMod
e()) |
| 176 return false; | 176 return false; |
| 177 | 177 |
| 178 if (current->hasTransformRelatedProperty() || current->isLayoutFlowThrea
d() || current->isSVGRoot()) | 178 if (current->style()->canContainFixedPositionObjects() || current->isLay
outFlowThread() || current->isSVGRoot()) |
| 179 return false; | 179 return false; |
| 180 | 180 |
| 181 if (current == ancestor) | 181 if (current == ancestor) |
| 182 break; | 182 break; |
| 183 } | 183 } |
| 184 | 184 |
| 185 return true; | 185 return true; |
| 186 } | 186 } |
| 187 | 187 |
| 188 void LayoutGeometryMap::pushMappingsToAncestor(const PaintLayer* layer, const Pa
intLayer* ancestorLayer) | 188 void LayoutGeometryMap::pushMappingsToAncestor(const PaintLayer* layer, const Pa
intLayer* ancestorLayer) |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 // If we're not working with multiple LayoutViews, then any view is consider
ed | 320 // If we're not working with multiple LayoutViews, then any view is consider
ed |
| 321 // "topmost" (to preserve original behavior). | 321 // "topmost" (to preserve original behavior). |
| 322 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries)) | 322 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries)) |
| 323 return true; | 323 return true; |
| 324 | 324 |
| 325 return layoutObject->frame()->isMainFrame(); | 325 return layoutObject->frame()->isMainFrame(); |
| 326 } | 326 } |
| 327 #endif | 327 #endif |
| 328 | 328 |
| 329 } // namespace blink | 329 } // namespace blink |
| OLD | NEW |