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

Side by Side Diff: Source/core/rendering/RenderGeometryMap.cpp

Issue 27104002: Fix ASSERT failure in RenderGeometryMap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: +test Created 7 years, 2 months 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 | Annotate | Revision Log
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() & & (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) { 148 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() & & (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) {
149 result = rect; 149 result = rect;
150 result.move(m_accumulatedOffset); 150 result.move(m_accumulatedOffset);
151 } else { 151 } else {
152 TransformState transformState(TransformState::ApplyTransformDirection, r ect.center(), rect); 152 TransformState transformState(TransformState::ApplyTransformDirection, r ect.center(), rect);
153 mapToContainer(transformState, container); 153 mapToContainer(transformState, container);
154 result = transformState.lastPlanarQuad().boundingBox(); 154 result = transformState.lastPlanarQuad().boundingBox();
155 } 155 }
156 156
157 #if !ASSERT_DISABLED 157 #if !ASSERT_DISABLED
158 FloatRect rendererMappedResult = m_mapping.last().m_renderer->localToContain erQuad(rect, container, m_mapCoordinatesFlags).boundingBox(); 158 const RenderObject* lastRenderer = m_mapping.last().m_renderer;
159 // Inspector creates renderers with negative width <https://bugs.webkit.org/ show_bug.cgi?id=87194>. 159 const RenderLayer* layer = lastRenderer->enclosingLayer();
160 // Taking FloatQuad bounds avoids spurious assertions because of that. 160
161 ASSERT(enclosingIntRect(rendererMappedResult) == enclosingIntRect(FloatQuad( result).boundingBox())); 161 // Bounds for invisible layers are intentionally not calculated, and are
162 // if (enclosingIntRect(rendererMappedResult) != enclosingIntRect(FloatQuad(r esult).boundingBox())) 162 // therefore not necessarily expected to be correct here. This is ok,
163 // fprintf(stderr, "Mismatched rects\n"); 163 // because they will be recomputed if the layer becomes visible.
164 if (!layer || !layer->subtreeIsInvisible()) {
165 FloatRect rendererMappedResult = lastRenderer->localToContainerQuad(rect , container, m_mapCoordinatesFlags).boundingBox();
166
167 // Inspector creates renderers with negative width <https://bugs.webkit. org/show_bug.cgi?id=87194>.
168 // Taking FloatQuad bounds avoids spurious assertions because of that.
169 ASSERT(enclosingIntRect(rendererMappedResult) == enclosingIntRect(FloatQ uad(result).boundingBox()));
170 // if (enclosingIntRect(rendererMappedResult) != enclosingIntRect(FloatQu ad(result).boundingBox()))
171 // fprintf(stderr, "Mismatched rects\n");
172 }
164 #endif 173 #endif
165 174
166 return result; 175 return result;
167 } 176 }
168 177
169 void RenderGeometryMap::pushMappingsToAncestor(const RenderObject* renderer, con st RenderLayerModelObject* ancestorRenderer) 178 void RenderGeometryMap::pushMappingsToAncestor(const RenderObject* renderer, con st RenderLayerModelObject* ancestorRenderer)
170 { 179 {
171 // We need to push mappings in reverse order here, so do insertions rather t han appends. 180 // We need to push mappings in reverse order here, so do insertions rather t han appends.
172 TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.size() ); 181 TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.size() );
173 do { 182 do {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 // "topmost" (to preserve original behavior). 330 // "topmost" (to preserve original behavior).
322 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries)) 331 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries))
323 return true; 332 return true;
324 333
325 Frame* thisFrame = renderer->frame(); 334 Frame* thisFrame = renderer->frame();
326 return thisFrame == thisFrame->page()->mainFrame(); 335 return thisFrame == thisFrame->page()->mainFrame();
327 } 336 }
328 #endif 337 #endif
329 338
330 } // namespace WebCore 339 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698