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

Side by Side Diff: Source/core/inspector/InspectorCSSAgent.cpp

Issue 203633003: DevTools: cleanup InspectorStyleSheet (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 virtual bool perform(ExceptionState& exceptionState) OVERRIDE 181 virtual bool perform(ExceptionState& exceptionState) OVERRIDE
182 { 182 {
183 if (!m_styleSheet->getText(&m_oldText)) 183 if (!m_styleSheet->getText(&m_oldText))
184 return false; 184 return false;
185 return redo(exceptionState); 185 return redo(exceptionState);
186 } 186 }
187 187
188 virtual bool undo(ExceptionState& exceptionState) OVERRIDE 188 virtual bool undo(ExceptionState& exceptionState) OVERRIDE
189 { 189 {
190 if (m_styleSheet->setText(m_oldText, exceptionState)) { 190 return m_styleSheet->setText(m_oldText, exceptionState);
191 m_styleSheet->reparseStyleSheet(m_oldText);
192 return true;
193 }
194 return false;
195 } 191 }
196 192
197 virtual bool redo(ExceptionState& exceptionState) OVERRIDE 193 virtual bool redo(ExceptionState& exceptionState) OVERRIDE
198 { 194 {
199 if (m_styleSheet->setText(m_text, exceptionState)) { 195 return m_styleSheet->setText(m_text, exceptionState);
200 m_styleSheet->reparseStyleSheet(m_text);
201 return true;
202 }
203 return false;
204 } 196 }
205 197
206 virtual String mergeId() OVERRIDE 198 virtual String mergeId() OVERRIDE
207 { 199 {
208 return String::format("SetStyleSheetText %s", m_styleSheet->id().utf8(). data()); 200 return String::format("SetStyleSheetText %s", m_styleSheet->id().utf8(). data());
209 } 201 }
210 202
211 virtual void merge(PassOwnPtr<Action> action) OVERRIDE 203 virtual void merge(PassOwnPtr<Action> action) OVERRIDE
212 { 204 {
213 ASSERT(action->mergeId() == mergeId()); 205 ASSERT(action->mergeId() == mergeId());
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 documentsToChange.add(element->ownerDocument()); 1348 documentsToChange.add(element->ownerDocument());
1357 } 1349 }
1358 1350
1359 m_nodeIdToForcedPseudoState.clear(); 1351 m_nodeIdToForcedPseudoState.clear();
1360 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu mentsToChange.end(); it != end; ++it) 1352 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu mentsToChange.end(); it != end; ++it)
1361 (*it)->setNeedsStyleRecalc(SubtreeStyleChange); 1353 (*it)->setNeedsStyleRecalc(SubtreeStyleChange);
1362 } 1354 }
1363 1355
1364 } // namespace WebCore 1356 } // namespace WebCore
1365 1357
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InspectorStyleSheet.h » ('j') | Source/core/inspector/InspectorStyleSheet.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698