| Index: Source/core/inspector/InspectorStyleSheet.h
|
| diff --git a/Source/core/inspector/InspectorStyleSheet.h b/Source/core/inspector/InspectorStyleSheet.h
|
| index 3ffcb8b68b30d21357c6e196e3e5778bf81b172f..96793e7ff39b998652eed837e9ed4b4364d8ee57 100644
|
| --- a/Source/core/inspector/InspectorStyleSheet.h
|
| +++ b/Source/core/inspector/InspectorStyleSheet.h
|
| @@ -169,6 +169,10 @@ public:
|
| virtual void willReparseStyleSheet() = 0;
|
| virtual void didReparseStyleSheet() = 0;
|
| };
|
| + struct EditRangeResult {
|
| + RefPtr<CSSStyleRule> rule;
|
| + RefPtr<CSSStyleDeclaration> style;
|
| + };
|
|
|
| static PassRefPtr<InspectorStyleSheet> create(InspectorPageAgent*, InspectorResourceAgent*, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Listener*);
|
| static String styleSheetURL(CSSStyleSheet* pageStyleSheet);
|
| @@ -183,6 +187,7 @@ public:
|
| CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet.get(); }
|
| virtual void reparseStyleSheet(const String&);
|
| virtual bool setText(const String&, ExceptionState&);
|
| + virtual bool editRange(const String&, unsigned startOffset, unsigned endOffset, EditRangeResult*, ExceptionState&);
|
| String ruleSelector(const InspectorCSSId&, ExceptionState&);
|
| bool setRuleSelector(const InspectorCSSId&, const String& selector, ExceptionState&);
|
| CSSStyleRule* addRule(const String& selector, ExceptionState&);
|
| @@ -202,8 +207,14 @@ public:
|
|
|
| InspectorCSSId ruleId(CSSStyleRule*) const;
|
| InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleOrStyleId(style); }
|
| + bool lineNumberAndColumnToOffset(unsigned lineNumber, unsigned columnNumber, unsigned* offset) const;
|
|
|
| protected:
|
| + enum PropertyScopeEditType {
|
| + EditExistingProperty = 0,
|
| + AppendNewProperty
|
| + };
|
| +
|
| InspectorStyleSheet(InspectorPageAgent*, InspectorResourceAgent*, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Listener*);
|
|
|
| InspectorCSSId ruleOrStyleId(CSSStyleDeclaration* style) const;
|
| @@ -218,6 +229,7 @@ protected:
|
| // Also accessed by friend class InspectorStyle.
|
| virtual bool setStyleText(CSSStyleDeclaration*, const String&);
|
| virtual PassOwnPtr<Vector<unsigned> > lineEndings() const;
|
| + bool handlePropertyScope(const CSSStyleSourceData* originalData, const CSSStyleSourceData* modifiedData, const unsigned ruleIndex, const PropertyScopeEditType, EditRangeResult*, ExceptionState&);
|
|
|
| private:
|
| friend class InspectorStyle;
|
| @@ -234,6 +246,8 @@ private:
|
| String url() const;
|
| bool hasSourceURL() const;
|
| bool startsAtZero() const;
|
| + bool handleSelectorEditScope(const CSSRuleSourceData* originalData, const CSSRuleSourceData* modifiedData, const String& modifiedText, const unsigned ruleIndex, EditRangeResult*, ExceptionState&);
|
| + bool handleStyleSheetEditScope(const ParsedStyleSheet* originalData, const ParsedStyleSheet* modifiedData, EditRangeResult*, ExceptionState&);
|
|
|
| InspectorPageAgent* m_pageAgent;
|
| InspectorResourceAgent* m_resourceAgent;
|
| @@ -254,6 +268,7 @@ public:
|
| void didModifyElementAttribute();
|
| virtual void reparseStyleSheet(const String&) OVERRIDE;
|
| virtual bool setText(const String&, ExceptionState&) OVERRIDE;
|
| + virtual bool editRange(const String&, unsigned startOffset, unsigned endOffset, EditRangeResult*, ExceptionState&);
|
| virtual bool getText(String* result) const OVERRIDE;
|
| virtual CSSStyleDeclaration* styleForId(const InspectorCSSId& id) const OVERRIDE { ASSERT_UNUSED(id, !id.ordinal()); return inlineStyle(); }
|
| virtual TypeBuilder::CSS::StyleSheetOrigin::Enum origin() const OVERRIDE { return TypeBuilder::CSS::StyleSheetOrigin::Regular; }
|
|
|