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

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

Issue 1213213004: Introduce use counters for shadow DOM handling in plainText() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-07-03T14:40:27 Rebase Created 5 years, 5 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/Element.cpp ('k') | Source/core/editing/Editor.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, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 setBaseAndExtent(n, 0, n, n->countChildren(), exceptionState); 498 setBaseAndExtent(n, 0, n, n->countChildren(), exceptionState);
499 } 499 }
500 500
501 String DOMSelection::toString() 501 String DOMSelection::toString()
502 { 502 {
503 if (!m_frame) 503 if (!m_frame)
504 return String(); 504 return String();
505 505
506 Position start, end; 506 Position start, end;
507 if (m_frame->selection().selection().toNormalizedPositions(start, end)) 507 if (m_frame->selection().selection().toNormalizedPositions(start, end))
508 return plainText(start, end); 508 return plainText(start, end, TextIteratorForSelectionToString);
509 return emptyString(); 509 return emptyString();
510 } 510 }
511 511
512 Node* DOMSelection::shadowAdjustedNode(const Position& position) const 512 Node* DOMSelection::shadowAdjustedNode(const Position& position) const
513 { 513 {
514 if (position.isNull()) 514 if (position.isNull())
515 return 0; 515 return 0;
516 516
517 Node* containerNode = position.containerNode(); 517 Node* containerNode = position.containerNode();
518 Node* adjustedNode = m_treeScope->ancestorInThisScope(containerNode); 518 Node* adjustedNode = m_treeScope->ancestorInThisScope(containerNode);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa geSource, ErrorMessageLevel, message)); 558 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa geSource, ErrorMessageLevel, message));
559 } 559 }
560 560
561 DEFINE_TRACE(DOMSelection) 561 DEFINE_TRACE(DOMSelection)
562 { 562 {
563 visitor->trace(m_treeScope); 563 visitor->trace(m_treeScope);
564 DOMWindowProperty::trace(visitor); 564 DOMWindowProperty::trace(visitor);
565 } 565 }
566 566
567 } // namespace blink 567 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698