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

Side by Side Diff: third_party/WebKit/Source/web/RotationViewportAnchor.cpp

Issue 1839643009: RELEASE_ASSERT -> CHECK and ASSERT -> DCHECK in web. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return DCHECK_IS_ON checks. Created 4 years, 8 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "web/RotationViewportAnchor.h" 5 #include "web/RotationViewportAnchor.h"
6 6
7 #include "core/dom/ContainerNode.h" 7 #include "core/dom/ContainerNode.h"
8 #include "core/dom/Node.h" 8 #include "core/dom/Node.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 m_normalizedVisualViewportOffset = FloatSize(); 115 m_normalizedVisualViewportOffset = FloatSize();
116 116
117 if (innerViewRect.isEmpty()) 117 if (innerViewRect.isEmpty())
118 return; 118 return;
119 119
120 // Preserve origins at the absolute screen origin 120 // Preserve origins at the absolute screen origin
121 if (innerViewRect.location() == IntPoint::zero()) 121 if (innerViewRect.location() == IntPoint::zero())
122 return; 122 return;
123 123
124 // Inner rectangle should be within the outer one. 124 // Inner rectangle should be within the outer one.
125 ASSERT(outerViewRect.contains(innerViewRect)); 125 DCHECK(outerViewRect.contains(innerViewRect));
126 126
127 // Outer rectangle is used as a scale, we need positive width and height. 127 // Outer rectangle is used as a scale, we need positive width and height.
128 ASSERT(!outerViewRect.isEmpty()); 128 DCHECK(!outerViewRect.isEmpty());
129 129
130 m_normalizedVisualViewportOffset = FloatSize(innerViewRect.location() - oute rViewRect.location()); 130 m_normalizedVisualViewportOffset = FloatSize(innerViewRect.location() - oute rViewRect.location());
131 131
132 // Normalize by the size of the outer rect 132 // Normalize by the size of the outer rect
133 m_normalizedVisualViewportOffset.scale(1.0 / outerViewRect.width(), 1.0 / ou terViewRect.height()); 133 m_normalizedVisualViewportOffset.scale(1.0 / outerViewRect.width(), 1.0 / ou terViewRect.height());
134 134
135 FloatSize anchorOffset(innerViewRect.size()); 135 FloatSize anchorOffset(innerViewRect.size());
136 anchorOffset.scale(m_anchorInInnerViewCoords.width(), m_anchorInInnerViewCoo rds.height()); 136 anchorOffset.scale(m_anchorInInnerViewCoords.width(), m_anchorInInnerViewCoo rds.height());
137 const FloatPoint anchorPoint = FloatPoint(innerViewRect.location()) + anchor Offset; 137 const FloatPoint anchorPoint = FloatPoint(innerViewRect.location()) + anchor Offset;
138 138
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 anchorOffsetFromNode.scale(m_anchorInNodeCoords.width(), m_anchorInNodeCoord s.height()); 204 anchorOffsetFromNode.scale(m_anchorInNodeCoords.width(), m_anchorInNodeCoord s.height());
205 FloatPoint anchorPoint = FloatPoint(currentNodeBounds.location()) + anchorOf fsetFromNode; 205 FloatPoint anchorPoint = FloatPoint(currentNodeBounds.location()) + anchorOf fsetFromNode;
206 206
207 // Compute the new origin point relative to the new anchor point 207 // Compute the new origin point relative to the new anchor point
208 FloatSize anchorOffsetFromOrigin = innerSize; 208 FloatSize anchorOffsetFromOrigin = innerSize;
209 anchorOffsetFromOrigin.scale(m_anchorInInnerViewCoords.width(), m_anchorInIn nerViewCoords.height()); 209 anchorOffsetFromOrigin.scale(m_anchorInInnerViewCoords.width(), m_anchorInIn nerViewCoords.height());
210 return anchorPoint - anchorOffsetFromOrigin; 210 return anchorPoint - anchorOffsetFromOrigin;
211 } 211 }
212 212
213 } // namespace blink 213 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/RemoteFrameOwner.cpp ('k') | third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698