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

Unified Diff: Source/core/inspector/InspectorStyleSheet.h

Issue 1181213007: DevTools: introduce CSS.setStyleText, we'll migrate setPropertyText to it later. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: win fixed Created 5 years, 6 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
« no previous file with comments | « Source/core/inspector/InspectorCSSAgent.cpp ('k') | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorStyleSheet.h
diff --git a/Source/core/inspector/InspectorStyleSheet.h b/Source/core/inspector/InspectorStyleSheet.h
index 6179cf01c48973aef9a57fa94f41e1c999d02f71..e86895a14f5bb5e932046876a09b7b5b1b84253f 100644
--- a/Source/core/inspector/InspectorStyleSheet.h
+++ b/Source/core/inspector/InspectorStyleSheet.h
@@ -141,6 +141,7 @@ public:
PassRefPtr<TypeBuilder::CSS::CSSStyle> buildObjectForStyle(CSSStyleDeclaration*);
bool findPropertyByRange(const SourceRange&, unsigned* ruleIndex, unsigned* propertyIndex, bool* overwrite);
bool lineNumberAndColumnToOffset(unsigned lineNumber, unsigned columnNumber, unsigned* offset);
+ virtual bool isInlineStyle() = 0;
protected:
InspectorStyleSheetBase(const String& id, Listener*);
@@ -175,9 +176,10 @@ public:
virtual Document* ownerDocument() const override;
virtual bool setText(const String&, ExceptionState&) override;
virtual bool getText(String* result) const override;
- CSSStyleRule* setRuleSelector(const SourceRange&, const String& selector, SourceRange* newRange, String* oldSelector, ExceptionState&);
- CSSMediaRule* setMediaRuleText(const SourceRange&, const String& selector, SourceRange* newRange, String* oldSelector, ExceptionState&);
- CSSStyleRule* addRule(const String& ruleText, const SourceRange& location, SourceRange* addedRange, ExceptionState&);
+ RefPtrWillBeRawPtr<CSSStyleRule> setRuleSelector(const SourceRange&, const String& selector, SourceRange* newRange, String* oldSelector, ExceptionState&);
+ RefPtrWillBeRawPtr<CSSStyleRule> setStyleText(const SourceRange&, const String& text, SourceRange* newRange, String* oldSelector, ExceptionState&);
+ RefPtrWillBeRawPtr<CSSMediaRule> setMediaRuleText(const SourceRange&, const String& selector, SourceRange* newRange, String* oldSelector, ExceptionState&);
+ RefPtrWillBeRawPtr<CSSStyleRule> addRule(const String& ruleText, const SourceRange& location, SourceRange* addedRange, ExceptionState&);
bool deleteRule(const SourceRange&, ExceptionState&);
CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet.get(); }
@@ -195,7 +197,7 @@ public:
virtual unsigned indexOf(CSSStyleDeclaration*) const override;
virtual CSSStyleDeclaration* styleAt(unsigned ruleIndex) const override;
virtual bool setStyleText(unsigned ruleIndex, const String&) override;
-
+ bool isInlineStyle() override { return false; }
const CSSRuleVector& flatRules();
protected:
@@ -210,12 +212,10 @@ private:
InspectorStyleSheet(InspectorResourceAgent*, const String& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, InspectorCSSAgent*);
unsigned ruleIndexBySourceRange(const CSSMediaRule* parentMediaRule, const SourceRange&);
bool findRuleByHeaderRange(const SourceRange&, CSSRule**, CSSRuleSourceData**);
+ bool findRuleByBodyRange(const SourceRange&, CSSRule**, CSSRuleSourceData**);
CSSStyleRule* insertCSSOMRuleInStyleSheet(const SourceRange&, const String& ruleText, ExceptionState&);
CSSStyleRule* insertCSSOMRuleInMediaRule(CSSMediaRule*, const SourceRange&, const String& ruleText, ExceptionState&);
CSSStyleRule* insertCSSOMRuleBySourceRange(const SourceRange&, const String& ruleText, ExceptionState&);
- bool verifyRuleText(const String& ruleText);
- bool verifySelectorText(const String& selectorText);
- bool verifyMediaText(const String& mediaText);
String sourceMapURL() const;
String sourceURL() const;
bool ensureText() const;
@@ -256,6 +256,7 @@ public:
virtual CSSStyleDeclaration* styleAt(unsigned ruleIndex) const override { ASSERT_UNUSED(ruleIndex, !ruleIndex); return inlineStyle(); }
virtual unsigned indexOf(CSSStyleDeclaration* style) const override { return 0; }
virtual bool setStyleText(unsigned ruleIndex, const String&) override;
+ CSSStyleDeclaration* inlineStyle() const;
DECLARE_VIRTUAL_TRACE();
@@ -266,10 +267,10 @@ protected:
// Also accessed by friend class InspectorStyle.
virtual bool ensureParsedDataReady() override;
virtual PassRefPtrWillBeRawPtr<CSSRuleSourceData> ruleSourceDataAt(unsigned ruleIndex) const override { ASSERT_UNUSED(ruleIndex, !ruleIndex); return m_ruleSourceData; }
+ bool isInlineStyle() override { return true; }
private:
InspectorStyleSheetForInlineStyle(const String& id, PassRefPtrWillBeRawPtr<Element>, Listener*);
- CSSStyleDeclaration* inlineStyle() const;
const String& elementStyleText() const;
PassRefPtrWillBeRawPtr<CSSRuleSourceData> getStyleAttributeData() const;
@@ -283,6 +284,7 @@ private:
};
+
} // namespace blink
WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::InspectorStyleProperty);
« no previous file with comments | « Source/core/inspector/InspectorCSSAgent.cpp ('k') | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698