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

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

Issue 23717008: Remove useless null checks from Node::document() call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/NodeIterator.cpp ('k') | Source/core/editing/FrameSelection.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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 Position prevPosition = upstream(CanCrossEditingBoundary); 421 Position prevPosition = upstream(CanCrossEditingBoundary);
422 if (atLastEditingPositionForNode() && prevPosition.isNotNull() && !prevPosit ion.deprecatedNode()->rendererIsEditable()) 422 if (atLastEditingPositionForNode() && prevPosition.isNotNull() && !prevPosit ion.deprecatedNode()->rendererIsEditable())
423 return true; 423 return true;
424 424
425 return nextPosition.isNotNull() && !nextPosition.deprecatedNode()->rendererI sEditable() 425 return nextPosition.isNotNull() && !nextPosition.deprecatedNode()->rendererI sEditable()
426 && prevPosition.isNotNull() && !prevPosition.deprecatedNode()->rendererI sEditable(); 426 && prevPosition.isNotNull() && !prevPosition.deprecatedNode()->rendererI sEditable();
427 } 427 }
428 428
429 Node* Position::parentEditingBoundary() const 429 Node* Position::parentEditingBoundary() const
430 { 430 {
431 if (!m_anchorNode || !m_anchorNode->document()) 431 if (!m_anchorNode)
432 return 0; 432 return 0;
433 433
434 Node* documentElement = m_anchorNode->document()->documentElement(); 434 Node* documentElement = m_anchorNode->document()->documentElement();
435 if (!documentElement) 435 if (!documentElement)
436 return 0; 436 return 0;
437 437
438 Node* boundary = m_anchorNode.get(); 438 Node* boundary = m_anchorNode.get();
439 while (boundary != documentElement && boundary->nonShadowBoundaryParentNode( ) && m_anchorNode->rendererIsEditable() == boundary->parentNode()->rendererIsEdi table()) 439 while (boundary != documentElement && boundary->nonShadowBoundaryParentNode( ) && m_anchorNode->rendererIsEditable() == boundary->parentNode()->rendererIsEdi table())
440 boundary = boundary->nonShadowBoundaryParentNode(); 440 boundary = boundary->nonShadowBoundaryParentNode();
441 441
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 pos.showTreeForThis(); 1390 pos.showTreeForThis();
1391 } 1391 }
1392 1392
1393 void showTree(const WebCore::Position* pos) 1393 void showTree(const WebCore::Position* pos)
1394 { 1394 {
1395 if (pos) 1395 if (pos)
1396 pos->showTreeForThis(); 1396 pos->showTreeForThis();
1397 } 1397 }
1398 1398
1399 #endif 1399 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/NodeIterator.cpp ('k') | Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698