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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 document().updateStyleAndLayoutTree(); 49 document().updateStyleAndLayoutTree();
50 if (!hasEditableStyle(*m_node)) 50 if (!hasEditableStyle(*m_node))
51 return; 51 return;
52 52
53 DummyExceptionStateForTesting exceptionState; 53 DummyExceptionStateForTesting exceptionState;
54 m_text = m_node->substringData(m_offset, m_count, exceptionState); 54 m_text = m_node->substringData(m_offset, m_count, exceptionState);
55 if (exceptionState.hadException()) 55 if (exceptionState.hadException())
56 return; 56 return;
57 57
58 m_node->deleteData(m_offset, m_count, exceptionState); 58 m_node->deleteData(m_offset, m_count, exceptionState);
59 m_node->document().updateStyleAndLayout();
60 } 59 }
61 60
62 void DeleteFromTextNodeCommand::doUnapply() { 61 void DeleteFromTextNodeCommand::doUnapply() {
63 DCHECK(m_node); 62 DCHECK(m_node);
64 63
65 if (!hasEditableStyle(*m_node)) 64 if (!hasEditableStyle(*m_node))
66 return; 65 return;
67 66
68 m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION_FOR_TESTING); 67 m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION_FOR_TESTING);
69 m_node->document().updateStyleAndLayout();
70 } 68 }
71 69
72 DEFINE_TRACE(DeleteFromTextNodeCommand) { 70 DEFINE_TRACE(DeleteFromTextNodeCommand) {
73 visitor->trace(m_node); 71 visitor->trace(m_node);
74 SimpleEditCommand::trace(visitor); 72 SimpleEditCommand::trace(visitor);
75 } 73 }
76 74
77 } // namespace blink 75 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698