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

Side by Side Diff: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp

Issue 1407183002: Rename ShadowRootType::OpenByDefault to ShadowRootType::V0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v1-attach-shadow
Patch Set: Created 5 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
3 * Copyright (C) 2005 Alexey Proskuryakov. 3 * Copyright (C) 2005 Alexey Proskuryakov.
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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 m_iterationProgress = m_iterationProgress < HandledNode ? Handle dNode : m_iterationProgress; 278 m_iterationProgress = m_iterationProgress < HandledNode ? Handle dNode : m_iterationProgress;
279 m_handleShadowRoot = true; 279 m_handleShadowRoot = true;
280 } else { 280 } else {
281 m_iterationProgress = HandledChildren; 281 m_iterationProgress = HandledChildren;
282 } 282 }
283 } else { 283 } else {
284 // Enter author shadow roots, from youngest, if any and if necessary . 284 // Enter author shadow roots, from youngest, if any and if necessary .
285 if (m_iterationProgress < HandledOpenShadowRoots) { 285 if (m_iterationProgress < HandledOpenShadowRoots) {
286 if (entersOpenShadowRoots() && m_node->isElementNode() && toElem ent(m_node)->openShadowRoot()) { 286 if (entersOpenShadowRoots() && m_node->isElementNode() && toElem ent(m_node)->openShadowRoot()) {
287 ShadowRoot* youngestShadowRoot = toElement(m_node)->openShad owRoot(); 287 ShadowRoot* youngestShadowRoot = toElement(m_node)->openShad owRoot();
288 ASSERT(youngestShadowRoot->type() == ShadowRootType::OpenByD efault || youngestShadowRoot->type() == ShadowRootType::Open); 288 ASSERT(youngestShadowRoot->type() == ShadowRootType::V0 || y oungestShadowRoot->type() == ShadowRootType::Open);
289 m_node = youngestShadowRoot; 289 m_node = youngestShadowRoot;
290 m_iterationProgress = HandledNone; 290 m_iterationProgress = HandledNone;
291 ++m_shadowDepth; 291 ++m_shadowDepth;
292 m_fullyClippedStack.pushFullyClippedState(m_node); 292 m_fullyClippedStack.pushFullyClippedState(m_node);
293 continue; 293 continue;
294 } 294 }
295 295
296 m_iterationProgress = HandledOpenShadowRoots; 296 m_iterationProgress = HandledOpenShadowRoots;
297 } 297 }
298 298
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 if (!next && !parentNode && m_shadowDepth > 0) { 368 if (!next && !parentNode && m_shadowDepth > 0) {
369 // 4. Reached the top of a shadow root. If it's created by a uthor, then try to visit the next 369 // 4. Reached the top of a shadow root. If it's created by a uthor, then try to visit the next
370 // sibling shadow root, if any. 370 // sibling shadow root, if any.
371 if (!m_node->isShadowRoot()) { 371 if (!m_node->isShadowRoot()) {
372 ASSERT_NOT_REACHED(); 372 ASSERT_NOT_REACHED();
373 m_shouldStop = true; 373 m_shouldStop = true;
374 return; 374 return;
375 } 375 }
376 ShadowRoot* shadowRoot = toShadowRoot(m_node); 376 ShadowRoot* shadowRoot = toShadowRoot(m_node);
377 if (shadowRoot->type() == ShadowRootType::OpenByDefault || s hadowRoot->type() == ShadowRootType::Open) { 377 if (shadowRoot->type() == ShadowRootType::V0 || shadowRoot-> type() == ShadowRootType::Open) {
378 ShadowRoot* nextShadowRoot = shadowRoot->olderShadowRoot (); 378 ShadowRoot* nextShadowRoot = shadowRoot->olderShadowRoot ();
379 if (nextShadowRoot && nextShadowRoot->type() == ShadowRo otType::OpenByDefault) { 379 if (nextShadowRoot && nextShadowRoot->type() == ShadowRo otType::V0) {
380 m_fullyClippedStack.pop(); 380 m_fullyClippedStack.pop();
381 m_node = nextShadowRoot; 381 m_node = nextShadowRoot;
382 m_iterationProgress = HandledNone; 382 m_iterationProgress = HandledNone;
383 // m_shadowDepth is unchanged since we exit from a s hadow root and enter another. 383 // m_shadowDepth is unchanged since we exit from a s hadow root and enter another.
384 m_fullyClippedStack.pushFullyClippedState(m_node); 384 m_fullyClippedStack.pushFullyClippedState(m_node);
385 } else { 385 } else {
386 // We are the last shadow root; exit from here and g o back to where we were. 386 // We are the last shadow root; exit from here and g o back to where we were.
387 m_node = shadowRoot->host(); 387 m_node = shadowRoot->host();
388 m_iterationProgress = HandledOpenShadowRoots; 388 m_iterationProgress = HandledOpenShadowRoots;
389 --m_shadowDepth; 389 --m_shadowDepth;
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 1119
1120 String plainText(const EphemeralRangeInComposedTree& range, TextIteratorBehavior Flags behavior) 1120 String plainText(const EphemeralRangeInComposedTree& range, TextIteratorBehavior Flags behavior)
1121 { 1121 {
1122 return createPlainText<EditingInComposedTreeStrategy>(range, behavior); 1122 return createPlainText<EditingInComposedTreeStrategy>(range, behavior);
1123 } 1123 }
1124 1124
1125 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingStrategy>; 1125 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingStrategy>;
1126 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingInComposedTreeS trategy>; 1126 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingInComposedTreeS trategy>;
1127 1127
1128 } // namespace blink 1128 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698