Title: [154543] trunk/Source/WebCore
- Revision
- 154543
- Author
- [email protected]
- Date
- 2013-08-24 04:24:10 -0700 (Sat, 24 Aug 2013)
Log Message
Web Inspector: Cleanup Inspector Agents a bit
https://bugs.webkit.org/show_bug.cgi?id=120218
Patch by Joseph Pecoraro <[email protected]> on 2013-08-24
Reviewed by Andreas Kling.
Merge https://chromium.googlesource.com/chromium/blink/+/8693dcb8ba42a5c225f516c664fb0f453c8ba6f0.
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::elementForId):
* inspector/InspectorStyleSheet.cpp:
(ParsedStyleSheet::ParsedStyleSheet):
(WebCore::InspectorStyle::setPropertyText):
(WebCore::InspectorStyle::populateAllProperties):
(WebCore::InspectorStyleSheet::inlineStyleSheetText):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (154542 => 154543)
--- trunk/Source/WebCore/ChangeLog 2013-08-24 11:21:22 UTC (rev 154542)
+++ trunk/Source/WebCore/ChangeLog 2013-08-24 11:24:10 UTC (rev 154543)
@@ -1,3 +1,20 @@
+2013-08-24 Joseph Pecoraro <[email protected]>
+
+ Web Inspector: Cleanup Inspector Agents a bit
+ https://bugs.webkit.org/show_bug.cgi?id=120218
+
+ Reviewed by Andreas Kling.
+
+ Merge https://chromium.googlesource.com/chromium/blink/+/8693dcb8ba42a5c225f516c664fb0f453c8ba6f0.
+
+ * inspector/InspectorCSSAgent.cpp:
+ (WebCore::InspectorCSSAgent::elementForId):
+ * inspector/InspectorStyleSheet.cpp:
+ (ParsedStyleSheet::ParsedStyleSheet):
+ (WebCore::InspectorStyle::setPropertyText):
+ (WebCore::InspectorStyle::populateAllProperties):
+ (WebCore::InspectorStyleSheet::inlineStyleSheetText):
+
2013-08-24 Andreas Kling <[email protected]>
Let Document keep its RenderView during render tree detach.
Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (154542 => 154543)
--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp 2013-08-24 11:21:22 UTC (rev 154542)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp 2013-08-24 11:24:10 UTC (rev 154543)
@@ -1146,7 +1146,7 @@
*errorString = "No node with given id found";
return 0;
}
- if (node->nodeType() != Node::ELEMENT_NODE) {
+ if (!node->isElementNode()) {
*errorString = "Not an element node";
return 0;
}
Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp (154542 => 154543)
--- trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp 2013-08-24 11:21:22 UTC (rev 154542)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp 2013-08-24 11:24:10 UTC (rev 154543)
@@ -75,7 +75,6 @@
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; }
@@ -86,16 +85,13 @@
private:
- // 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)
{
}
@@ -369,9 +365,6 @@
return false;
}
- Vector<InspectorStyleProperty> allProperties;
- populateAllProperties(&allProperties);
-
if (propertyText.stripWhiteSpace().length()) {
RefPtr<MutableStylePropertySet> tempMutableStyle = MutableStylePropertySet::create();
RefPtr<CSSRuleSourceData> sourceData = CSSRuleSourceData::create(CSSRuleSourceData::STYLE_RULE);
@@ -406,6 +399,9 @@
return false;
}
+ Vector<InspectorStyleProperty> allProperties;
+ populateAllProperties(&allProperties);
+
InspectorStyleTextEditor editor(&allProperties, &m_disabledProperties, text, newLineAndWhitespaceDelimiters());
if (overwrite) {
if (index >= allProperties.size()) {
@@ -480,7 +476,6 @@
bool InspectorStyle::populateAllProperties(Vector<InspectorStyleProperty>* result) const
{
- HashSet<String> foundShorthands;
HashSet<String> sourcePropertyNames;
unsigned disabledIndex = 0;
unsigned disabledLength = m_disabledProperties.size();
@@ -1397,7 +1392,7 @@
return false;
Node* ownerNode = m_pageStyleSheet->ownerNode();
- if (!ownerNode || ownerNode->nodeType() != Node::ELEMENT_NODE)
+ if (!ownerNode || !ownerNode->isElementNode())
return false;
Element* ownerElement = toElement(ownerNode);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes