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

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

Issue 23890025: WIP (Introduce WTF::NonNullPtr<T>.) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/shadow/ShadowRoot.h ('k') | Source/core/editing/VisibleSelection.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) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 return selectionRoot ? selectionRoot : m_frame->document()->documentElement( ); 107 return selectionRoot ? selectionRoot : m_frame->document()->documentElement( );
108 } 108 }
109 109
110 Node* FrameSelection::rootEditableElementOrTreeScopeRootNode() const 110 Node* FrameSelection::rootEditableElementOrTreeScopeRootNode() const
111 { 111 {
112 Element* selectionRoot = m_selection.rootEditableElement(); 112 Element* selectionRoot = m_selection.rootEditableElement();
113 if (selectionRoot) 113 if (selectionRoot)
114 return selectionRoot; 114 return selectionRoot;
115 115
116 Node* node = m_selection.base().containerNode(); 116 Node* node = m_selection.base().containerNode();
117 return node ? node->treeScope().rootNode() : 0; 117 return node ? node->treeScope()->rootNode() : 0;
118 } 118 }
119 119
120 Element* FrameSelection::rootEditableElementRespectingShadowTree() const 120 Element* FrameSelection::rootEditableElementRespectingShadowTree() const
121 { 121 {
122 Element* selectionRoot = m_selection.rootEditableElement(); 122 Element* selectionRoot = m_selection.rootEditableElement();
123 if (selectionRoot && selectionRoot->isInShadowTree()) 123 if (selectionRoot && selectionRoot->isInShadowTree())
124 selectionRoot = selectionRoot->shadowHost(); 124 selectionRoot = selectionRoot->shadowHost();
125 return selectionRoot; 125 return selectionRoot;
126 } 126 }
127 127
(...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 sel.showTreeForThis(); 1958 sel.showTreeForThis();
1959 } 1959 }
1960 1960
1961 void showTree(const WebCore::FrameSelection* sel) 1961 void showTree(const WebCore::FrameSelection* sel)
1962 { 1962 {
1963 if (sel) 1963 if (sel)
1964 sel->showTreeForThis(); 1964 sel->showTreeForThis();
1965 } 1965 }
1966 1966
1967 #endif 1967 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/shadow/ShadowRoot.h ('k') | Source/core/editing/VisibleSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698