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

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

Issue 2709503003: Expand FrameSeleciton::isContentEditable() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-22T08:13:55 rebase Created 3 years, 10 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 | « no previous file | third_party/WebKit/Source/core/editing/FrameSelection.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 /* 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 return smartInsertDeleteEnabled() && pasteboard->canSmartReplace(); 598 return smartInsertDeleteEnabled() && pasteboard->canSmartReplace();
599 } 599 }
600 600
601 void Editor::replaceSelectionWithFragment(DocumentFragment* fragment, 601 void Editor::replaceSelectionWithFragment(DocumentFragment* fragment,
602 bool selectReplacement, 602 bool selectReplacement,
603 bool smartReplace, 603 bool smartReplace,
604 bool matchStyle, 604 bool matchStyle,
605 InputEvent::InputType inputType) { 605 InputEvent::InputType inputType) {
606 DCHECK(!frame().document()->needsLayoutTreeUpdate()); 606 DCHECK(!frame().document()->needsLayoutTreeUpdate());
607 if (frame().selection().isNone() || 607 if (frame().selection().isNone() ||
608 !frame().selection().isContentEditable() || !fragment) 608 !frame()
609 .selection()
610 .computeVisibleSelectionInDOMTreeDeprecated()
611 .isContentEditable() ||
612 !fragment)
609 return; 613 return;
610 614
611 ReplaceSelectionCommand::CommandOptions options = 615 ReplaceSelectionCommand::CommandOptions options =
612 ReplaceSelectionCommand::PreventNesting | 616 ReplaceSelectionCommand::PreventNesting |
613 ReplaceSelectionCommand::SanitizeFragment; 617 ReplaceSelectionCommand::SanitizeFragment;
614 if (selectReplacement) 618 if (selectReplacement)
615 options |= ReplaceSelectionCommand::SelectReplacement; 619 options |= ReplaceSelectionCommand::SelectReplacement;
616 if (smartReplace) 620 if (smartReplace)
617 options |= ReplaceSelectionCommand::SmartReplace; 621 options |= ReplaceSelectionCommand::SmartReplace;
618 if (matchStyle) 622 if (matchStyle)
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1740 1744
1741 DEFINE_TRACE(Editor) { 1745 DEFINE_TRACE(Editor) {
1742 visitor->trace(m_frame); 1746 visitor->trace(m_frame);
1743 visitor->trace(m_lastEditCommand); 1747 visitor->trace(m_lastEditCommand);
1744 visitor->trace(m_undoStack); 1748 visitor->trace(m_undoStack);
1745 visitor->trace(m_mark); 1749 visitor->trace(m_mark);
1746 visitor->trace(m_typingStyle); 1750 visitor->trace(m_typingStyle);
1747 } 1751 }
1748 1752
1749 } // namespace blink 1753 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698