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

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

Issue 2640163004: Replace ENABLE(ASSERT) with DCHECK_IS_ON(). (Closed)
Patch Set: Created 3 years, 11 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
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // If the mapping includes something like columns, we have to go via 55 // If the mapping includes something like columns, we have to go via
56 // layoutObjects. 56 // layoutObjects.
57 if (hasNonUniformStep()) { 57 if (hasNonUniformStep()) {
58 m_mapping.back().m_layoutObject->mapLocalToAncestor( 58 m_mapping.back().m_layoutObject->mapLocalToAncestor(
59 ancestor, transformState, ApplyContainerFlip | m_mapCoordinatesFlags); 59 ancestor, transformState, ApplyContainerFlip | m_mapCoordinatesFlags);
60 transformState.flatten(); 60 transformState.flatten();
61 return; 61 return;
62 } 62 }
63 63
64 bool inFixed = false; 64 bool inFixed = false;
65 #if ENABLE(ASSERT) 65 #if DCHECK_IS_ON()
66 bool foundAncestor = !ancestor || (m_mapping.size() && 66 bool foundAncestor = !ancestor || (m_mapping.size() &&
67 m_mapping[0].m_layoutObject == ancestor); 67 m_mapping[0].m_layoutObject == ancestor);
68 #endif 68 #endif
69 69
70 for (int i = m_mapping.size() - 1; i >= 0; --i) { 70 for (int i = m_mapping.size() - 1; i >= 0; --i) {
71 const LayoutGeometryMapStep& currentStep = m_mapping[i]; 71 const LayoutGeometryMapStep& currentStep = m_mapping[i];
72 72
73 // If container is the root LayoutView (step 0) we want to apply its fixed 73 // If container is the root LayoutView (step 0) we want to apply its fixed
74 // position offset. 74 // position offset.
75 if (i > 0 && currentStep.m_layoutObject == ancestor) { 75 if (i > 0 && currentStep.m_layoutObject == ancestor) {
76 #if ENABLE(ASSERT) 76 #if DCHECK_IS_ON()
77 foundAncestor = true; 77 foundAncestor = true;
78 #endif 78 #endif
79 break; 79 break;
80 } 80 }
81 81
82 // If this box has a transform, it acts as a fixed position container 82 // If this box has a transform, it acts as a fixed position container
83 // for fixed descendants, which prevents the propagation of 'fixed' 83 // for fixed descendants, which prevents the propagation of 'fixed'
84 // unless the layer itself is also fixed position. 84 // unless the layer itself is also fixed position.
85 if (i && currentStep.m_flags & ContainsFixedPosition && 85 if (i && currentStep.m_flags & ContainsFixedPosition &&
86 !(currentStep.m_flags & IsFixedPosition)) 86 !(currentStep.m_flags & IsFixedPosition))
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 (m_mapping.size() && ancestor == m_mapping[0].m_layoutObject))) { 146 (m_mapping.size() && ancestor == m_mapping[0].m_layoutObject))) {
147 result = rect; 147 result = rect;
148 result.move(m_accumulatedOffset); 148 result.move(m_accumulatedOffset);
149 } else { 149 } else {
150 TransformState transformState(TransformState::ApplyTransformDirection, 150 TransformState transformState(TransformState::ApplyTransformDirection,
151 rect.center(), rect); 151 rect.center(), rect);
152 mapToAncestor(transformState, ancestor); 152 mapToAncestor(transformState, ancestor);
153 result = transformState.lastPlanarQuad(); 153 result = transformState.lastPlanarQuad();
154 } 154 }
155 155
156 #if ENABLE(ASSERT) 156 #if DCHECK_IS_ON()
157 if (m_mapping.size() > 0) { 157 if (m_mapping.size() > 0) {
158 const LayoutObject* lastLayoutObject = m_mapping.back().m_layoutObject; 158 const LayoutObject* lastLayoutObject = m_mapping.back().m_layoutObject;
159 159
160 FloatRect layoutObjectMappedResult = 160 FloatRect layoutObjectMappedResult =
161 lastLayoutObject 161 lastLayoutObject
162 ->localToAncestorQuad(rect, ancestor, m_mapCoordinatesFlags) 162 ->localToAncestorQuad(rect, ancestor, m_mapCoordinatesFlags)
163 .boundingBox(); 163 .boundingBox();
164 164
165 // Inspector creates layoutObjects with negative width 165 // Inspector creates layoutObjects with negative width
166 // <https://bugs.webkit.org/show_bug.cgi?id=87194>. 166 // <https://bugs.webkit.org/show_bug.cgi?id=87194>.
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 ASSERT(m_transformedStepsCount); 357 ASSERT(m_transformedStepsCount);
358 --m_transformedStepsCount; 358 --m_transformedStepsCount;
359 } 359 }
360 360
361 if (step.m_flags & IsFixedPosition) { 361 if (step.m_flags & IsFixedPosition) {
362 ASSERT(m_fixedStepsCount); 362 ASSERT(m_fixedStepsCount);
363 --m_fixedStepsCount; 363 --m_fixedStepsCount;
364 } 364 }
365 } 365 }
366 366
367 #if ENABLE(ASSERT) 367 #if DCHECK_IS_ON()
368 bool LayoutGeometryMap::isTopmostLayoutView( 368 bool LayoutGeometryMap::isTopmostLayoutView(
369 const LayoutObject* layoutObject) const { 369 const LayoutObject* layoutObject) const {
370 if (!layoutObject->isLayoutView()) 370 if (!layoutObject->isLayoutView())
371 return false; 371 return false;
372 372
373 // If we're not working with multiple LayoutViews, then any view is considered 373 // If we're not working with multiple LayoutViews, then any view is considered
374 // "topmost" (to preserve original behavior). 374 // "topmost" (to preserve original behavior).
375 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries)) 375 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries))
376 return true; 376 return true;
377 377
378 return layoutObject->frame()->isMainFrame(); 378 return layoutObject->frame()->isMainFrame();
379 } 379 }
380 #endif 380 #endif
381 381
382 } // namespace blink 382 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698