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

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

Issue 309993002: Make isEditablePosition to work with Position objects other than PositionIsOffsetInAnchor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-06-06T06:24:03 Created 6 years, 6 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/execCommand/format-block-with-uneditable-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 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 if (isHTMLBodyElement(*node)) 147 if (isHTMLBodyElement(*node))
148 break; 148 break;
149 node = node->parentNode(); 149 node = node->parentNode();
150 } 150 }
151 151
152 return 0; 152 return 0;
153 } 153 }
154 154
155 bool isEditablePosition(const Position& p, EditableType editableType, EUpdateSty le updateStyle) 155 bool isEditablePosition(const Position& p, EditableType editableType, EUpdateSty le updateStyle)
156 { 156 {
157 Node* node = p.deprecatedNode(); 157 Node* node = p.parentAnchoredEquivalent().anchorNode();
158 if (!node) 158 if (!node)
159 return false; 159 return false;
160 if (updateStyle == UpdateStyle) 160 if (updateStyle == UpdateStyle)
161 node->document().updateLayoutIgnorePendingStylesheets(); 161 node->document().updateLayoutIgnorePendingStylesheets();
162 else 162 else
163 ASSERT(updateStyle == DoNotUpdateStyle); 163 ASSERT(updateStyle == DoNotUpdateStyle);
164 164
165 if (isRenderedTableElement(node)) 165 if (isRenderedTableElement(node))
166 node = node->parentNode(); 166 node = node->parentNode();
167 167
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 // if the selection starts just before a paragraph break, skip over it 1113 // if the selection starts just before a paragraph break, skip over it
1114 if (isEndOfParagraph(visiblePosition)) 1114 if (isEndOfParagraph(visiblePosition))
1115 return visiblePosition.next().deepEquivalent().downstream(); 1115 return visiblePosition.next().deepEquivalent().downstream();
1116 1116
1117 // otherwise, make sure to be at the start of the first selected node, 1117 // otherwise, make sure to be at the start of the first selected node,
1118 // instead of possibly at the end of the last node before the selection 1118 // instead of possibly at the end of the last node before the selection
1119 return visiblePosition.deepEquivalent().downstream(); 1119 return visiblePosition.deepEquivalent().downstream();
1120 } 1120 }
1121 1121
1122 } // namespace WebCore 1122 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/editing/execCommand/format-block-with-uneditable-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698