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

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

Issue 314923003: Make SVG elements not to consider editable. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-06-09T04:22:19 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 | « Source/core/dom/Position.cpp ('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) 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // If conditions lose consitency, VisiblePosition::canonicalPosition 158 // If conditions lose consitency, VisiblePosition::canonicalPosition
159 // will fail on |canonicalizeCandidate(previousCandidate(position))|, 159 // will fail on |canonicalizeCandidate(previousCandidate(position))|,
160 // because previousCandidate returns a Position converted from 160 // because previousCandidate returns a Position converted from
161 // a "Candidate" PositionIterator and cannonicalizeCandidate(Position) 161 // a "Candidate" PositionIterator and cannonicalizeCandidate(Position)
162 // assumes the Position is "Candidate". 162 // assumes the Position is "Candidate".
163 return !m_offsetInAnchor && (!m_anchorNode->hasChildren() || m_nodeAfter PositionInAnchor) && !Position::nodeIsUserSelectNone(m_anchorNode->parentNode()) ; 163 return !m_offsetInAnchor && (!m_anchorNode->hasChildren() || m_nodeAfter PositionInAnchor) && !Position::nodeIsUserSelectNone(m_anchorNode->parentNode()) ;
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()) {
169 // We don't consider SVG elements are contenteditable except for
170 // associated renderer returns isText() true, e.g. RenderSVGInlineText.
171 return false;
172 }
173
168 if (isRenderedTableElement(m_anchorNode) || editingIgnoresContent(m_anchorNo de)) 174 if (isRenderedTableElement(m_anchorNode) || editingIgnoresContent(m_anchorNo de))
169 return (atStartOfNode() || atEndOfNode()) && !Position::nodeIsUserSelect None(m_anchorNode->parentNode()); 175 return (atStartOfNode() || atEndOfNode()) && !Position::nodeIsUserSelect None(m_anchorNode->parentNode());
170 176
171 if (!isHTMLHtmlElement(*m_anchorNode) && renderer->isRenderBlockFlow()) { 177 if (!isHTMLHtmlElement(*m_anchorNode) && renderer->isRenderBlockFlow()) {
172 if (toRenderBlock(renderer)->logicalHeight() || isHTMLBodyElement(*m_anc horNode)) { 178 if (toRenderBlock(renderer)->logicalHeight() || isHTMLBodyElement(*m_anc horNode)) {
173 if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer )) 179 if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer ))
174 return atStartOfNode() && !Position::nodeIsUserSelectNone(m_anch orNode); 180 return atStartOfNode() && !Position::nodeIsUserSelectNone(m_anch orNode);
175 return m_anchorNode->rendererIsEditable() && !Position::nodeIsUserSe lectNone(m_anchorNode) && Position(*this).atEditingBoundary(); 181 return m_anchorNode->rendererIsEditable() && !Position::nodeIsUserSe lectNone(m_anchorNode) && Position(*this).atEditingBoundary();
176 } 182 }
177 } 183 }
178 184
179 return false; 185 return false;
180 } 186 }
181 187
182 } // namespace WebCore 188 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Position.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698