Index: Source/core/inspector/InspectorStyleSheet.cpp |
diff --git a/Source/core/inspector/InspectorStyleSheet.cpp b/Source/core/inspector/InspectorStyleSheet.cpp |
index d82532290b04448f41616618e7020081db410dd8..e556b8494031aecfb2f168929ad982da3117eec9 100644 |
--- a/Source/core/inspector/InspectorStyleSheet.cpp |
+++ b/Source/core/inspector/InspectorStyleSheet.cpp |
@@ -67,7 +67,6 @@ class ParsedStyleSheet { |
public: |
ParsedStyleSheet(); |
- WebCore::CSSStyleSheet* cssStyleSheet() const { return m_parserOutput; } |
const String& text() const { ASSERT(m_hasText); return m_text; } |
void setText(const String& text); |
bool hasText() const { return m_hasText; } |
@@ -78,16 +77,13 @@ public: |
private: |
void flattenSourceData(RuleSourceDataList*); |
- // StyleSheet constructed while parsing m_text. |
- WebCore::CSSStyleSheet* m_parserOutput; |
String m_text; |
bool m_hasText; |
OwnPtr<RuleSourceDataList> m_sourceData; |
}; |
ParsedStyleSheet::ParsedStyleSheet() |
- : m_parserOutput(0) |
- , m_hasText(false) |
+ : m_hasText(false) |
{ |
} |
@@ -560,9 +556,6 @@ bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText, |
return false; |
} |
- Vector<InspectorStyleProperty> allProperties; |
- populateAllProperties(allProperties); |
- |
if (!propertyText.stripWhiteSpace().isEmpty()) { |
RefPtr<MutableStylePropertySet> tempMutableStyle = MutableStylePropertySet::create(); |
String declarationText = propertyText + " " + bogusPropertyName + ": none"; |
@@ -598,6 +591,9 @@ bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText, |
return false; |
} |
+ Vector<InspectorStyleProperty> allProperties; |
+ populateAllProperties(allProperties); |
+ |
InspectorStyleTextEditor editor(&allProperties, text, newLineAndWhitespaceDelimiters()); |
if (overwrite) { |
if (index >= allProperties.size()) { |
@@ -671,11 +667,9 @@ bool InspectorStyle::styleText(String* result) const |
void InspectorStyle::populateAllProperties(Vector<InspectorStyleProperty>& result) const |
{ |
- HashSet<String> foundShorthands; |
HashSet<String> sourcePropertyNames; |
RefPtr<CSSRuleSourceData> sourceData = extractSourceData(); |
- OwnPtr<CSSParser> cssParser; |
if (sourceData) { |
String styleDeclaration; |
bool isStyleTextKnown = styleText(&styleDeclaration); |
@@ -700,9 +694,6 @@ void InspectorStyle::populateAllProperties(Vector<InspectorStyleProperty>& resul |
PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyle::styleWithProperties() const |
{ |
- Vector<InspectorStyleProperty> properties; |
- populateAllProperties(properties); |
- |
RefPtr<Array<TypeBuilder::CSS::CSSProperty> > propertiesObject = Array<TypeBuilder::CSS::CSSProperty>::create(); |
RefPtr<Array<TypeBuilder::CSS::ShorthandEntry> > shorthandEntries = Array<TypeBuilder::CSS::ShorthandEntry>::create(); |
HashMap<String, RefPtr<TypeBuilder::CSS::CSSProperty> > propertyNameToPreviousActiveProperty; |
@@ -713,6 +704,9 @@ PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyle::styleWithProperties() con |
RefPtr<CSSRuleSourceData> sourceData = extractSourceData(); |
unsigned ruleBodyRangeStart = sourceData ? sourceData->ruleBodyRange.start : 0; |
+ Vector<InspectorStyleProperty> properties; |
+ populateAllProperties(properties); |
+ |
for (Vector<InspectorStyleProperty>::iterator it = properties.begin(), itEnd = properties.end(); it != itEnd; ++it) { |
const CSSPropertySourceData& propertyEntry = it->sourceData; |
const String& name = propertyEntry.name; |