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

Side by Side Diff: Source/WebCore/editing/VisiblePosition.cpp

Issue 8199007: Merge 96868 - Crash in VisiblePosition::canonicalPosition. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 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
« no previous file with comments | « LayoutTests/editing/selection/selection-plugin-clear-crash-expected.txt ('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) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 Position position = passedPosition; 477 Position position = passedPosition;
478 478
479 // FIXME (9535): Canonicalizing to the leftmost candidate means that if we' re at a line wrap, we will 479 // FIXME (9535): Canonicalizing to the leftmost candidate means that if we' re at a line wrap, we will
480 // ask renderers to paint downstream carets for other renderers. 480 // ask renderers to paint downstream carets for other renderers.
481 // To fix this, we need to either a) add code to all paintCarets to pass the responsibility off to 481 // To fix this, we need to either a) add code to all paintCarets to pass the responsibility off to
482 // the appropriate renderer for VisiblePosition's like these, or b) canonica lize to the rightmost candidate 482 // the appropriate renderer for VisiblePosition's like these, or b) canonica lize to the rightmost candidate
483 // unless the affinity is upstream. 483 // unless the affinity is upstream.
484 if (position.isNull()) 484 if (position.isNull())
485 return Position(); 485 return Position();
486 486
487 Node* node = position.containerNode();
488
489 ASSERT(position.document()); 487 ASSERT(position.document());
490 position.document()->updateLayoutIgnorePendingStylesheets(); 488 position.document()->updateLayoutIgnorePendingStylesheets();
491 489
490 Node* node = position.containerNode();
491
492 Position candidate = position.upstream(); 492 Position candidate = position.upstream();
493 if (candidate.isCandidate()) 493 if (candidate.isCandidate())
494 return candidate; 494 return candidate;
495 candidate = position.downstream(); 495 candidate = position.downstream();
496 if (candidate.isCandidate()) 496 if (candidate.isCandidate())
497 return candidate; 497 return candidate;
498 498
499 // When neither upstream or downstream gets us to a candidate (upstream/down stream won't leave 499 // When neither upstream or downstream gets us to a candidate (upstream/down stream won't leave
500 // blocks or enter new ones), we search forward and backward until we find o ne. 500 // blocks or enter new ones), we search forward and backward until we find o ne.
501 Position next = canonicalizeCandidate(nextCandidate(position)); 501 Position next = canonicalizeCandidate(nextCandidate(position));
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 if (vpos) 718 if (vpos)
719 vpos->showTreeForThis(); 719 vpos->showTreeForThis();
720 } 720 }
721 721
722 void showTree(const WebCore::VisiblePosition& vpos) 722 void showTree(const WebCore::VisiblePosition& vpos)
723 { 723 {
724 vpos.showTreeForThis(); 724 vpos.showTreeForThis();
725 } 725 }
726 726
727 #endif 727 #endif
OLDNEW
« no previous file with comments | « LayoutTests/editing/selection/selection-plugin-clear-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698