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

Side by Side Diff: Source/core/dom/Position.cpp

Issue 428533006: Use ContainerNode::hasChildren() instead of firstChild() in conditionals (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: build fix Created 6 years, 4 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/dom/NodeTraversal.h ('k') | Source/core/dom/ScriptLoader.cpp » ('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) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2009 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 // Don't include inline tables. 490 // Don't include inline tables.
491 if (isHTMLTableElement(*node)) 491 if (isHTMLTableElement(*node))
492 return false; 492 return false;
493 493
494 // A Marquee elements are moving so we should assume their ends are always 494 // A Marquee elements are moving so we should assume their ends are always
495 // visibily distinct. 495 // visibily distinct.
496 if (isHTMLMarqueeElement(*node)) 496 if (isHTMLMarqueeElement(*node))
497 return true; 497 return true;
498 498
499 // There is a VisiblePosition inside an empty inline-block container. 499 // There is a VisiblePosition inside an empty inline-block container.
500 return node->renderer()->isReplaced() && canHaveChildrenForEditing(node) && toRenderBox(node->renderer())->height() != 0 && !node->firstChild(); 500 return node->renderer()->isReplaced() && canHaveChildrenForEditing(node) && toRenderBox(node->renderer())->height() != 0 && !node->hasChildren();
501 } 501 }
502 502
503 static Node* enclosingVisualBoundary(Node* node) 503 static Node* enclosingVisualBoundary(Node* node)
504 { 504 {
505 while (node && !endsOfNodeAreVisuallyDistinctPositions(node)) 505 while (node && !endsOfNodeAreVisuallyDistinctPositions(node))
506 node = node->parentNode(); 506 node = node->parentNode();
507 507
508 return node; 508 return node;
509 } 509 }
510 510
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 pos.showTreeForThis(); 1304 pos.showTreeForThis();
1305 } 1305 }
1306 1306
1307 void showTree(const blink::Position* pos) 1307 void showTree(const blink::Position* pos)
1308 { 1308 {
1309 if (pos) 1309 if (pos)
1310 pos->showTreeForThis(); 1310 pos->showTreeForThis();
1311 } 1311 }
1312 1312
1313 #endif 1313 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/NodeTraversal.h ('k') | Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698