Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutGeometryMap.cpp

Issue 1514243004: Remove check for invisible subtrees in LayoutGeometryMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698