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

Side by Side Diff: third_party/WebKit/Source/core/frame/SmartClip.cpp

Issue 2858963002: Replace ASSERT with DCHECK in core/ (Closed)
Patch Set: WorkerBackingThread Created 3 years, 7 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 node = NodeTraversal::Next(*node, root_node); 195 node = NodeTraversal::Next(*node, root_node);
196 } 196 }
197 197
198 return min_node; 198 return min_node;
199 } 199 }
200 200
201 // This function appears to heuristically guess whether to include a background 201 // This function appears to heuristically guess whether to include a background
202 // image in the smart clip. It seems to want to include sprites created from 202 // image in the smart clip. It seems to want to include sprites created from
203 // CSS background images but to skip actual backgrounds. 203 // CSS background images but to skip actual backgrounds.
204 bool SmartClip::ShouldSkipBackgroundImage(Node* node) { 204 bool SmartClip::ShouldSkipBackgroundImage(Node* node) {
205 ASSERT(node); 205 DCHECK(node);
206 // Apparently we're only interested in background images on spans and divs. 206 // Apparently we're only interested in background images on spans and divs.
207 if (!isHTMLSpanElement(*node) && !isHTMLDivElement(*node)) 207 if (!isHTMLSpanElement(*node) && !isHTMLDivElement(*node))
208 return true; 208 return true;
209 209
210 // This check actually makes a bit of sense. If you're going to sprite an 210 // This check actually makes a bit of sense. If you're going to sprite an
211 // image out of a CSS background, you're probably going to specify a height 211 // image out of a CSS background, you're probably going to specify a height
212 // or a width. On the other hand, if we've got a legit background image, 212 // or a width. On the other hand, if we've got a legit background image,
213 // it's very likely the height or the width will be set to auto. 213 // it's very likely the height or the width will be set to auto.
214 LayoutObject* layout_object = node->GetLayoutObject(); 214 LayoutObject* layout_object = node->GetLayoutObject();
215 if (layout_object && (layout_object->Style()->LogicalHeight().IsAuto() || 215 if (layout_object && (layout_object->Style()->LogicalHeight().IsAuto() ||
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 266
267 result.Append(node_value); 267 result.Append(node_value);
268 } 268 }
269 } 269 }
270 } 270 }
271 271
272 return result.ToString(); 272 return result.ToString();
273 } 273 }
274 274
275 } // namespace blink 275 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/RootFrameViewport.h ('k') | third_party/WebKit/Source/core/frame/SuspendableTimer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698