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

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

Issue 434393003: Use tighter typing in editing: VisiblePosition & VisibleSelection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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/Position.cpp ('k') | Source/core/editing/BreakBlockquoteCommand.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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 164 }
165 if (renderer->isText()) 165 if (renderer->isText())
166 return !Position::nodeIsUserSelectNone(m_anchorNode) && Position(*this). inRenderedText(); 166 return !Position::nodeIsUserSelectNone(m_anchorNode) && Position(*this). inRenderedText();
167 167
168 if (renderer->isSVG()) { 168 if (renderer->isSVG()) {
169 // We don't consider SVG elements are contenteditable except for 169 // We don't consider SVG elements are contenteditable except for
170 // associated renderer returns isText() true, e.g. RenderSVGInlineText. 170 // associated renderer returns isText() true, e.g. RenderSVGInlineText.
171 return false; 171 return false;
172 } 172 }
173 173
174 if (isRenderedTableElement(m_anchorNode) || editingIgnoresContent(m_anchorNo de)) 174 if (isRenderedHTMLTableElement(m_anchorNode) || editingIgnoresContent(m_anch orNode))
175 return (atStartOfNode() || atEndOfNode()) && !Position::nodeIsUserSelect None(m_anchorNode->parentNode()); 175 return (atStartOfNode() || atEndOfNode()) && !Position::nodeIsUserSelect None(m_anchorNode->parentNode());
176 176
177 if (!isHTMLHtmlElement(*m_anchorNode) && renderer->isRenderBlockFlow()) { 177 if (!isHTMLHtmlElement(*m_anchorNode) && renderer->isRenderBlockFlow()) {
178 if (toRenderBlock(renderer)->logicalHeight() || isHTMLBodyElement(*m_anc horNode)) { 178 if (toRenderBlock(renderer)->logicalHeight() || isHTMLBodyElement(*m_anc horNode)) {
179 if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer )) 179 if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer ))
180 return atStartOfNode() && !Position::nodeIsUserSelectNone(m_anch orNode); 180 return atStartOfNode() && !Position::nodeIsUserSelectNone(m_anch orNode);
181 return m_anchorNode->hasEditableStyle() && !Position::nodeIsUserSele ctNone(m_anchorNode) && Position(*this).atEditingBoundary(); 181 return m_anchorNode->hasEditableStyle() && !Position::nodeIsUserSele ctNone(m_anchorNode) && Position(*this).atEditingBoundary();
182 } 182 }
183 } 183 }
184 184
185 return false; 185 return false;
186 } 186 }
187 187
188 } // namespace blink 188 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Position.cpp ('k') | Source/core/editing/BreakBlockquoteCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698