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

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

Issue 2140733003: [Editing][CodeHealth] Make Node::rootEditableElement static (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 if (!startContainer || !endContainer) 304 if (!startContainer || !endContainer)
305 return false; 305 return false;
306 306
307 if (!startContainer->hasEditableStyle() || !endContainer->hasEditableStyle() ) 307 if (!startContainer->hasEditableStyle() || !endContainer->hasEditableStyle() )
308 return false; 308 return false;
309 309
310 if (range.isCollapsed()) { 310 if (range.isCollapsed()) {
311 VisiblePosition start = createVisiblePosition(range.startPosition()); 311 VisiblePosition start = createVisiblePosition(range.startPosition());
312 VisiblePosition previous = previousPositionOf(start); 312 VisiblePosition previous = previousPositionOf(start);
313 // FIXME: We sometimes allow deletions at the start of editable roots, l ike when the caret is in an empty list item. 313 // FIXME: We sometimes allow deletions at the start of editable roots, l ike when the caret is in an empty list item.
314 if (previous.isNull() || previous.deepEquivalent().anchorNode()->rootEdi tableElement() != startContainer->rootEditableElement()) 314 if (previous.isNull() || rootEditableElement(*previous.deepEquivalent(). anchorNode()) != rootEditableElement(*startContainer))
315 return false; 315 return false;
316 } 316 }
317 return true; 317 return true;
318 } 318 }
319 319
320 bool Editor::smartInsertDeleteEnabled() const 320 bool Editor::smartInsertDeleteEnabled() const
321 { 321 {
322 if (Settings* settings = frame().settings()) 322 if (Settings* settings = frame().settings())
323 return settings->smartInsertDeleteEnabled(); 323 return settings->smartInsertDeleteEnabled();
324 return false; 324 return false;
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 1423
1424 DEFINE_TRACE(Editor) 1424 DEFINE_TRACE(Editor)
1425 { 1425 {
1426 visitor->trace(m_frame); 1426 visitor->trace(m_frame);
1427 visitor->trace(m_lastEditCommand); 1427 visitor->trace(m_lastEditCommand);
1428 visitor->trace(m_undoStack); 1428 visitor->trace(m_undoStack);
1429 visitor->trace(m_mark); 1429 visitor->trace(m_mark);
1430 } 1430 }
1431 1431
1432 } // namespace blink 1432 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698