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

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

Issue 1033943002: Rename LayoutStyle to papayawhip (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ensureComputedStyle Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/html/HTMLAppletElement.h » ('j') | 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 227 }
228 } 228 }
229 229
230 String SmartClip::extractTextFromNode(Node* node) 230 String SmartClip::extractTextFromNode(Node* node)
231 { 231 {
232 // Science has proven that no text nodes are ever positioned at y == -99999. 232 // Science has proven that no text nodes are ever positioned at y == -99999.
233 int prevYPos = -99999; 233 int prevYPos = -99999;
234 234
235 StringBuilder result; 235 StringBuilder result;
236 for (Node& currentNode : NodeTraversal::inclusiveDescendantsOf(*node)) { 236 for (Node& currentNode : NodeTraversal::inclusiveDescendantsOf(*node)) {
237 const LayoutStyle* style = currentNode.computedStyle(); 237 const ComputedStyle* style = currentNode.ensureComputedStyle();
238 if (style && style->userSelect() == SELECT_NONE) 238 if (style && style->userSelect() == SELECT_NONE)
239 continue; 239 continue;
240 240
241 if (Node* nodeFromFrame = nodeInsideFrame(&currentNode)) 241 if (Node* nodeFromFrame = nodeInsideFrame(&currentNode))
242 result.append(extractTextFromNode(nodeFromFrame)); 242 result.append(extractTextFromNode(nodeFromFrame));
243 243
244 IntRect nodeRect = currentNode.pixelSnappedBoundingBox(); 244 IntRect nodeRect = currentNode.pixelSnappedBoundingBox();
245 if (currentNode.layoutObject() && !nodeRect.isEmpty()) { 245 if (currentNode.layoutObject() && !nodeRect.isEmpty()) {
246 if (currentNode.isTextNode()) { 246 if (currentNode.isTextNode()) {
247 String nodeValue = currentNode.nodeValue(); 247 String nodeValue = currentNode.nodeValue();
(...skipping 10 matching lines...) Expand all
258 258
259 result.append(nodeValue); 259 result.append(nodeValue);
260 } 260 }
261 } 261 }
262 } 262 }
263 263
264 return result.toString(); 264 return result.toString();
265 } 265 }
266 266
267 } // namespace blink 267 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/html/HTMLAppletElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698