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

Unified Diff: Source/core/inspector/InspectorCSSAgent.cpp

Issue 211193006: DevTools: [CSS] use setStyleText as undo action for setPropertyText (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add testcase 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/inspector/InspectorCSSAgent.cpp
diff --git a/Source/core/inspector/InspectorCSSAgent.cpp b/Source/core/inspector/InspectorCSSAgent.cpp
index 69aa4364f9ac238456ecb0d9888b54f6db2bf304..73eef80389b9e5eea94c37784be7685338962a82 100644
--- a/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/Source/core/inspector/InspectorCSSAgent.cpp
@@ -229,7 +229,7 @@ public:
virtual String toString() OVERRIDE
{
- return mergeId() + ": " + m_oldText + " -> " + m_text;
+ return mergeId() + ": " + m_oldStyleText + " -> " + m_text;
}
virtual bool perform(ExceptionState& exceptionState) OVERRIDE
@@ -240,14 +240,14 @@ public:
virtual bool undo(ExceptionState& exceptionState) OVERRIDE
{
String placeholder;
- return m_styleSheet->setPropertyText(m_cssId, m_propertyIndex, m_overwrite ? m_oldText : "", true, &placeholder, exceptionState);
+ return m_styleSheet->setStyleText(m_cssId, m_oldStyleText);
}
virtual bool redo(ExceptionState& exceptionState) OVERRIDE
{
- String oldText;
- bool result = m_styleSheet->setPropertyText(m_cssId, m_propertyIndex, m_text, m_overwrite, &oldText, exceptionState);
- m_oldText = oldText.stripWhiteSpace();
+ if (!m_styleSheet->getStyleText(m_cssId, &m_oldStyleText))
+ return false;
+ bool result = m_styleSheet->setPropertyText(m_cssId, m_propertyIndex, m_text, m_overwrite, exceptionState);
return result;
}
@@ -269,7 +269,7 @@ private:
InspectorCSSId m_cssId;
unsigned m_propertyIndex;
String m_text;
- String m_oldText;
+ String m_oldStyleText;
bool m_overwrite;
};

Powered by Google App Engine
This is Rietveld 408576698