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

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

Issue 2099643002: Make Editor::replaceSelectionWithFragment() to update layout tree explicitly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-06-24T17:43:28 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
« no previous file with comments | « no previous file | no next file » | 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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 return !noDefaultProcessing; 553 return !noDefaultProcessing;
554 } 554 }
555 555
556 bool Editor::canSmartReplaceWithPasteboard(Pasteboard* pasteboard) 556 bool Editor::canSmartReplaceWithPasteboard(Pasteboard* pasteboard)
557 { 557 {
558 return smartInsertDeleteEnabled() && pasteboard->canSmartReplace(); 558 return smartInsertDeleteEnabled() && pasteboard->canSmartReplace();
559 } 559 }
560 560
561 void Editor::replaceSelectionWithFragment(DocumentFragment* fragment, bool selec tReplacement, bool smartReplace, bool matchStyle) 561 void Editor::replaceSelectionWithFragment(DocumentFragment* fragment, bool selec tReplacement, bool smartReplace, bool matchStyle)
562 { 562 {
563 frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();
563 if (frame().selection().isNone() || !frame().selection().isContentEditable() || !fragment) 564 if (frame().selection().isNone() || !frame().selection().isContentEditable() || !fragment)
564 return; 565 return;
565 566
566 ReplaceSelectionCommand::CommandOptions options = ReplaceSelectionCommand::P reventNesting | ReplaceSelectionCommand::SanitizeFragment; 567 ReplaceSelectionCommand::CommandOptions options = ReplaceSelectionCommand::P reventNesting | ReplaceSelectionCommand::SanitizeFragment;
567 if (selectReplacement) 568 if (selectReplacement)
568 options |= ReplaceSelectionCommand::SelectReplacement; 569 options |= ReplaceSelectionCommand::SelectReplacement;
569 if (smartReplace) 570 if (smartReplace)
570 options |= ReplaceSelectionCommand::SmartReplace; 571 options |= ReplaceSelectionCommand::SmartReplace;
571 if (matchStyle) 572 if (matchStyle)
572 options |= ReplaceSelectionCommand::MatchStyle; 573 options |= ReplaceSelectionCommand::MatchStyle;
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 } 1431 }
1431 1432
1432 DEFINE_TRACE(Editor) 1433 DEFINE_TRACE(Editor)
1433 { 1434 {
1434 visitor->trace(m_frame); 1435 visitor->trace(m_frame);
1435 visitor->trace(m_lastEditCommand); 1436 visitor->trace(m_lastEditCommand);
1436 visitor->trace(m_mark); 1437 visitor->trace(m_mark);
1437 } 1438 }
1438 1439
1439 } // namespace blink 1440 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698