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

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

Issue 2705373002: Remove unnecessary layout updates from InsertInto/DeleteFromTextNodeCommand (Closed)
Patch Set: Add layout updates for clients requiring that explicitly 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2008 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return; 56 return;
57 57
58 if (passwordEchoEnabled) { 58 if (passwordEchoEnabled) {
59 LayoutText* layoutText = m_node->layoutObject(); 59 LayoutText* layoutText = m_node->layoutObject();
60 if (layoutText && layoutText->isSecure()) 60 if (layoutText && layoutText->isSecure())
61 layoutText->momentarilyRevealLastTypedCharacter(m_offset + 61 layoutText->momentarilyRevealLastTypedCharacter(m_offset +
62 m_text.length() - 1); 62 m_text.length() - 1);
63 } 63 }
64 64
65 m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION_FOR_TESTING); 65 m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION_FOR_TESTING);
66 document().updateStyleAndLayout();
67 } 66 }
68 67
69 void InsertIntoTextNodeCommand::doUnapply() { 68 void InsertIntoTextNodeCommand::doUnapply() {
70 if (!hasEditableStyle(*m_node)) 69 if (!hasEditableStyle(*m_node))
71 return; 70 return;
72 71
73 m_node->deleteData(m_offset, m_text.length(), IGNORE_EXCEPTION_FOR_TESTING); 72 m_node->deleteData(m_offset, m_text.length(), IGNORE_EXCEPTION_FOR_TESTING);
74 document().updateStyleAndLayout();
75 } 73 }
76 74
77 DEFINE_TRACE(InsertIntoTextNodeCommand) { 75 DEFINE_TRACE(InsertIntoTextNodeCommand) {
78 visitor->trace(m_node); 76 visitor->trace(m_node);
79 SimpleEditCommand::trace(visitor); 77 SimpleEditCommand::trace(visitor);
80 } 78 }
81 79
82 } // namespace blink 80 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698