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

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

Issue 1195743002: Have StyledMarkupSerializer work on the Composed tree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: reviews Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/editing/EditingStrategy.h ('k') | Source/core/editing/StyledMarkupSerializer.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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/editing/EditingStrategy.h" 6 #include "core/editing/EditingStrategy.h"
7 7
8 #include "core/dom/shadow/ElementShadow.h"
8 #include "core/editing/htmlediting.h" 9 #include "core/editing/htmlediting.h"
9 10
10 namespace blink { 11 namespace blink {
11 12
12 template <typename Traversal> 13 template <typename Traversal>
13 bool EditingAlgorithm<Traversal>::isEmptyNonEditableNodeInEditable(const Node* n ode) 14 bool EditingAlgorithm<Traversal>::isEmptyNonEditableNodeInEditable(const Node* n ode)
14 { 15 {
15 // Editability is defined the DOM tree rather than the composed tree. For ex ample: 16 // Editability is defined the DOM tree rather than the composed tree. For ex ample:
16 // DOM: 17 // DOM:
17 // <host><span>unedittable</span><shadowroot><div ce><content /></div></sh adowroot></host> 18 // <host><span>unedittable</span><shadowroot><div ce><content /></div></sh adowroot></host>
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 if (n == childB) 139 if (n == childB)
139 return 1; // A is after B 140 return 1; // A is after B
140 n = Traversal::nextSibling(*n); 141 n = Traversal::nextSibling(*n);
141 } 142 }
142 143
143 // Should never reach this point. 144 // Should never reach this point.
144 ASSERT_NOT_REACHED(); 145 ASSERT_NOT_REACHED();
145 return 0; 146 return 0;
146 } 147 }
147 148
149 bool EditingInComposedTreeStrategy::isSelectionBoundaryShadowHost(const Node& no de)
150 {
151 if (!node.isElementNode())
152 return false;
153 ElementShadow* shadow = toElement(node).shadow();
154 if (!shadow)
155 return false;
156 return shadow->youngestShadowRoot()->type() == ShadowRoot::UserAgentShadowRo ot;
157 }
158
148 ContainerNode* EditingInComposedTreeStrategy::parentOrShadowHostNode(const Node& node) 159 ContainerNode* EditingInComposedTreeStrategy::parentOrShadowHostNode(const Node& node)
149 { 160 {
150 return parent(node); 161 return parent(node);
151 } 162 }
152 163
153 template class EditingAlgorithm<NodeTraversal>; 164 template class EditingAlgorithm<NodeTraversal>;
154 template class EditingAlgorithm<ComposedTreeTraversal>; 165 template class EditingAlgorithm<ComposedTreeTraversal>;
155 166
156 } // namespace blink 167 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/EditingStrategy.h ('k') | Source/core/editing/StyledMarkupSerializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698