| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 result.move(m_accumulatedOffset); | 130 result.move(m_accumulatedOffset); |
| 131 } else { | 131 } else { |
| 132 TransformState transformState(TransformState::ApplyTransformDirection, r
ect.center(), rect); | 132 TransformState transformState(TransformState::ApplyTransformDirection, r
ect.center(), rect); |
| 133 mapToContainer(transformState, container); | 133 mapToContainer(transformState, container); |
| 134 result = transformState.lastPlanarQuad(); | 134 result = transformState.lastPlanarQuad(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 #if ENABLE(ASSERT) | 137 #if ENABLE(ASSERT) |
| 138 if (m_mapping.size() > 0) { | 138 if (m_mapping.size() > 0) { |
| 139 const LayoutObject* lastLayoutObject = m_mapping.last().m_layoutObject; | 139 const LayoutObject* lastLayoutObject = m_mapping.last().m_layoutObject; |
| 140 const PaintLayer* layer = lastLayoutObject->enclosingLayer(); | |
| 141 | 140 |
| 142 // Bounds for invisible layers are intentionally not calculated, and are | 141 FloatRect layoutObjectMappedResult = lastLayoutObject->localToContainerQ
uad(rect, container, m_mapCoordinatesFlags).boundingBox(); |
| 143 // therefore not necessarily expected to be correct here. This is ok, | |
| 144 // because they will be recomputed if the layer becomes visible. | |
| 145 if (!layer->subtreeIsInvisible() && lastLayoutObject->style()->visibilit
y() == VISIBLE) { | |
| 146 FloatRect layoutObjectMappedResult = lastLayoutObject->localToContai
nerQuad(rect, container, m_mapCoordinatesFlags).boundingBox(); | |
| 147 | 142 |
| 148 // Inspector creates layoutObjects with negative width <https://bugs
.webkit.org/show_bug.cgi?id=87194>. | 143 // Inspector creates layoutObjects with negative width <https://bugs.web
kit.org/show_bug.cgi?id=87194>. |
| 149 // Taking FloatQuad bounds avoids spurious assertions because of tha
t. | 144 // Taking FloatQuad bounds avoids spurious assertions because of that. |
| 150 ASSERT(enclosingIntRect(layoutObjectMappedResult) == enclosingIntRec
t(result.boundingBox()) | 145 ASSERT(enclosingIntRect(layoutObjectMappedResult) == enclosingIntRect(re
sult.boundingBox()) |
| 151 || layoutObjectMappedResult.mayNotHaveExactIntRectRepresentation
() | 146 || layoutObjectMappedResult.mayNotHaveExactIntRectRepresentation() |
| 152 || result.boundingBox().mayNotHaveExactIntRectRepresentation()); | 147 || result.boundingBox().mayNotHaveExactIntRectRepresentation()); |
| 153 } | |
| 154 } | 148 } |
| 155 #endif | 149 #endif |
| 156 | 150 |
| 157 return result; | 151 return result; |
| 158 } | 152 } |
| 159 | 153 |
| 160 void LayoutGeometryMap::pushMappingsToAncestor(const LayoutObject* layoutObject,
const LayoutBoxModelObject* ancestorLayoutObject) | 154 void LayoutGeometryMap::pushMappingsToAncestor(const LayoutObject* layoutObject,
const LayoutBoxModelObject* ancestorLayoutObject) |
| 161 { | 155 { |
| 162 // We need to push mappings in reverse order here, so do insertions rather t
han appends. | 156 // We need to push mappings in reverse order here, so do insertions rather t
han appends. |
| 163 TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.size()
); | 157 TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.size()
); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 // If we're not working with multiple LayoutViews, then any view is consider
ed | 306 // If we're not working with multiple LayoutViews, then any view is consider
ed |
| 313 // "topmost" (to preserve original behavior). | 307 // "topmost" (to preserve original behavior). |
| 314 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries)) | 308 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries)) |
| 315 return true; | 309 return true; |
| 316 | 310 |
| 317 return layoutObject->frame()->isMainFrame(); | 311 return layoutObject->frame()->isMainFrame(); |
| 318 } | 312 } |
| 319 #endif | 313 #endif |
| 320 | 314 |
| 321 } // namespace blink | 315 } // namespace blink |
| OLD | NEW |