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

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

Issue 397733004: Allow assertions to be enabled in Blink Release builds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 5 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/editing/TextIterator.cpp ('k') | Source/core/events/EventDispatcher.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) 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 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. 3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 { 89 {
90 Position pos = previousVisuallyDistinctCandidate(m_deepPosition); 90 Position pos = previousVisuallyDistinctCandidate(m_deepPosition);
91 91
92 // return null visible position if there is no previous visible position 92 // return null visible position if there is no previous visible position
93 if (pos.atStartOfTree()) 93 if (pos.atStartOfTree())
94 return VisiblePosition(); 94 return VisiblePosition();
95 95
96 VisiblePosition prev = VisiblePosition(pos, DOWNSTREAM); 96 VisiblePosition prev = VisiblePosition(pos, DOWNSTREAM);
97 ASSERT(prev != *this); 97 ASSERT(prev != *this);
98 98
99 #ifndef NDEBUG 99 #if ENABLE(ASSERT)
100 // we should always be able to make the affinity DOWNSTREAM, because going p revious from an 100 // we should always be able to make the affinity DOWNSTREAM, because going p revious from an
101 // UPSTREAM position can never yield another UPSTREAM position (unless line wrap length is 0!). 101 // UPSTREAM position can never yield another UPSTREAM position (unless line wrap length is 0!).
102 if (prev.isNotNull() && m_affinity == UPSTREAM) { 102 if (prev.isNotNull() && m_affinity == UPSTREAM) {
103 VisiblePosition temp = prev; 103 VisiblePosition temp = prev;
104 temp.setAffinity(UPSTREAM); 104 temp.setAffinity(UPSTREAM);
105 ASSERT(inSameLine(temp, prev)); 105 ASSERT(inSameLine(temp, prev));
106 } 106 }
107 #endif 107 #endif
108 108
109 switch (rule) { 109 switch (rule) {
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 if (vpos) 804 if (vpos)
805 vpos->showTreeForThis(); 805 vpos->showTreeForThis();
806 } 806 }
807 807
808 void showTree(const WebCore::VisiblePosition& vpos) 808 void showTree(const WebCore::VisiblePosition& vpos)
809 { 809 {
810 vpos.showTreeForThis(); 810 vpos.showTreeForThis();
811 } 811 }
812 812
813 #endif 813 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/TextIterator.cpp ('k') | Source/core/events/EventDispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698