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

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

Issue 201403002: Use new is*Element() helper functions more in core/ code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | 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) 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 215
216 return minNode; 216 return minNode;
217 } 217 }
218 218
219 // This function appears to heuristically guess whether to include a background 219 // This function appears to heuristically guess whether to include a background
220 // image in the smart clip. It seems to want to include sprites created from 220 // image in the smart clip. It seems to want to include sprites created from
221 // CSS background images but to skip actual backgrounds. 221 // CSS background images but to skip actual backgrounds.
222 bool SmartClip::shouldSkipBackgroundImage(Node* node) 222 bool SmartClip::shouldSkipBackgroundImage(Node* node)
223 { 223 {
224 ASSERT(node);
224 // Apparently we're only interested in background images on spans and divs. 225 // Apparently we're only interested in background images on spans and divs.
225 if (!node->hasTagName(HTMLNames::spanTag) && !node->hasTagName(HTMLNames::di vTag)) 226 if (!isHTMLSpanElement(*node) && !isHTMLDivElement(*node))
226 return true; 227 return true;
227 228
228 // This check actually makes a bit of sense. If you're going to sprite an 229 // This check actually makes a bit of sense. If you're going to sprite an
229 // image out of a CSS background, you're probably going to specify a height 230 // image out of a CSS background, you're probably going to specify a height
230 // or a width. On the other hand, if we've got a legit background image, 231 // or a width. On the other hand, if we've got a legit background image,
231 // it's very likely the height or the width will be set to auto. 232 // it's very likely the height or the width will be set to auto.
232 RenderObject* renderer = node->renderer(); 233 RenderObject* renderer = node->renderer();
233 if (renderer && (renderer->style()->logicalHeight().isAuto() || renderer->st yle()->logicalWidth().isAuto())) 234 if (renderer && (renderer->style()->logicalHeight().isAuto() || renderer->st yle()->logicalWidth().isAuto()))
234 return true; 235 return true;
235 236
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 287
287 result.append(nodeValue); 288 result.append(nodeValue);
288 } 289 }
289 } 290 }
290 } 291 }
291 292
292 return result.toString(); 293 return result.toString();
293 } 294 }
294 295
295 } // namespace WebCore 296 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698