summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/core/inspector/InspectorStyleTextEditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/inspector/InspectorStyleTextEditor.cpp')
-rw-r--r--chromium/third_party/WebKit/Source/core/inspector/InspectorStyleTextEditor.cpp29
1 files changed, 3 insertions, 26 deletions
diff --git a/chromium/third_party/WebKit/Source/core/inspector/InspectorStyleTextEditor.cpp b/chromium/third_party/WebKit/Source/core/inspector/InspectorStyleTextEditor.cpp
index 1c538ea1245..3bb615b8b7e 100644
--- a/chromium/third_party/WebKit/Source/core/inspector/InspectorStyleTextEditor.cpp
+++ b/chromium/third_party/WebKit/Source/core/inspector/InspectorStyleTextEditor.cpp
@@ -31,7 +31,7 @@
namespace WebCore {
-InspectorStyleTextEditor::InspectorStyleTextEditor(Vector<InspectorStyleProperty>* allProperties, const String& styleText, const NewLineAndWhitespace& format)
+InspectorStyleTextEditor::InspectorStyleTextEditor(WillBeHeapVector<InspectorStyleProperty>* allProperties, const String& styleText, const NewLineAndWhitespace& format)
: m_allProperties(allProperties)
, m_styleText(styleText)
, m_format(format)
@@ -93,11 +93,11 @@ void InspectorStyleTextEditor::insertProperty(unsigned index, const String& prop
textToSet.insert(formatLineFeed, formattingPrependOffset);
}
if (!isHTMLLineBreak(m_styleText[propertyStart]))
- textToSet.append(formatLineFeed);
+ textToSet = textToSet + formatLineFeed;
} else {
String fullPrefix = formatLineFeed + formatPropertyPrefix;
long fullPrefixLength = fullPrefix.length();
- textToSet.append(fullPrefix);
+ textToSet = textToSet + fullPrefix;
if (insertFirstInSource && (propertyStart < fullPrefixLength || m_styleText.substring(propertyStart - fullPrefixLength, fullPrefixLength) != fullPrefix))
textToSet.insert(fullPrefix, formattingPrependOffset);
}
@@ -110,29 +110,6 @@ void InspectorStyleTextEditor::replaceProperty(unsigned index, const String& new
internalReplaceProperty(m_allProperties->at(index), newText);
}
-void InspectorStyleTextEditor::removeProperty(unsigned index)
-{
- replaceProperty(index, "");
-}
-
-void InspectorStyleTextEditor::enableProperty(unsigned index)
-{
- InspectorStyleProperty& disabledProperty = m_allProperties->at(index);
- ASSERT(disabledProperty.sourceData.disabled);
- internalReplaceProperty(disabledProperty, disabledProperty.rawText.substring(2, disabledProperty.rawText.length() - 4).stripWhiteSpace());
-}
-
-void InspectorStyleTextEditor::disableProperty(unsigned index)
-{
- ASSERT(!m_allProperties->at(index).sourceData.disabled);
-
- InspectorStyleProperty& property = m_allProperties->at(index);
- property.setRawTextFromStyleDeclaration(m_styleText);
- property.sourceData.disabled = true;
-
- internalReplaceProperty(property, "/* " + property.rawText + " */");
-}
-
void InspectorStyleTextEditor::internalReplaceProperty(const InspectorStyleProperty& property, const String& newText)
{
const SourceRange& range = property.sourceData.range;