OLD | NEW |
---|---|
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 | 87 |
88 VisiblePosition VisiblePosition::previous(EditingBoundaryCrossingRule rule) cons t | 88 VisiblePosition VisiblePosition::previous(EditingBoundaryCrossingRule rule) cons t |
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 if (prev == *this) |
Yuta Kitamura
2014/06/05 09:17:13
I would like to understand how this could happen.
yosin_UTC9
2014/06/06 02:14:33
I updated description.
When we hit assertion fail
| |
98 return VisiblePosition(); | |
98 | 99 |
99 #ifndef NDEBUG | 100 #ifndef NDEBUG |
100 // we should always be able to make the affinity DOWNSTREAM, because going p revious from an | 101 // 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!). | 102 // UPSTREAM position can never yield another UPSTREAM position (unless line wrap length is 0!). |
102 if (prev.isNotNull() && m_affinity == UPSTREAM) { | 103 if (prev.isNotNull() && m_affinity == UPSTREAM) { |
103 VisiblePosition temp = prev; | 104 VisiblePosition temp = prev; |
104 temp.setAffinity(UPSTREAM); | 105 temp.setAffinity(UPSTREAM); |
105 ASSERT(inSameLine(temp, prev)); | 106 ASSERT(inSameLine(temp, prev)); |
106 } | 107 } |
107 #endif | 108 #endif |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
804 if (vpos) | 805 if (vpos) |
805 vpos->showTreeForThis(); | 806 vpos->showTreeForThis(); |
806 } | 807 } |
807 | 808 |
808 void showTree(const WebCore::VisiblePosition& vpos) | 809 void showTree(const WebCore::VisiblePosition& vpos) |
809 { | 810 { |
810 vpos.showTreeForThis(); | 811 vpos.showTreeForThis(); |
811 } | 812 } |
812 | 813 |
813 #endif | 814 #endif |
OLD | NEW |