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

Side by Side Diff: Source/core/inspector/InspectorCSSAgent.h

Issue 1310923003: Devtools [LayoutEditor]: Patch values in the selected rule (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@medias
Patch Set: Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 DECLARE_VIRTUAL_TRACE(); 108 DECLARE_VIRTUAL_TRACE();
109 109
110 bool forcePseudoState(Element*, CSSSelector::PseudoType); 110 bool forcePseudoState(Element*, CSSSelector::PseudoType);
111 void discardAgent() override; 111 void discardAgent() override;
112 void didCommitLoadForLocalFrame(LocalFrame*) override; 112 void didCommitLoadForLocalFrame(LocalFrame*) override;
113 void restore() override; 113 void restore() override;
114 void flushPendingProtocolNotifications() override; 114 void flushPendingProtocolNotifications() override;
115 void disable(ErrorString*) override; 115 void disable(ErrorString*) override;
116 void reset(); 116 void reset();
117 void mediaQueryResultChanged(); 117 void mediaQueryResultChanged();
118 void setCSSPropertyValue(ErrorString*, Element*, CSSPropertyID, const String &);
119 118
120 void activeStyleSheetsUpdated(Document*); 119 void activeStyleSheetsUpdated(Document*);
121 void documentDetached(Document*); 120 void documentDetached(Document*);
122 121
123 void addEditedStyleSheet(const String& url, const String& content); 122 void addEditedStyleSheet(const String& url, const String& content);
124 bool getEditedStyleSheet(const String& url, String* content); 123 bool getEditedStyleSheet(const String& url, String* content);
125 124
126 void addEditedStyleElement(int backendNodeId, const String& content); 125 void addEditedStyleElement(int backendNodeId, const String& content);
127 bool getEditedStyleElement(int backendNodeId, String* content); 126 bool getEditedStyleElement(int backendNodeId, String* content);
128 127
129 void enable(ErrorString*, PassRefPtrWillBeRawPtr<EnableCallback>) override; 128 void enable(ErrorString*, PassRefPtrWillBeRawPtr<EnableCallback>) override;
130 void getComputedStyleForNode(ErrorString*, int nodeId, RefPtr<TypeBuilder::A rray<TypeBuilder::CSS::CSSComputedStyleProperty>>&) override; 129 void getComputedStyleForNode(ErrorString*, int nodeId, RefPtr<TypeBuilder::A rray<TypeBuilder::CSS::CSSComputedStyleProperty>>&) override;
131 void getPlatformFontsForNode(ErrorString*, int nodeId, RefPtr<TypeBuilder::A rray<TypeBuilder::CSS::PlatformFontUsage>>&) override; 130 void getPlatformFontsForNode(ErrorString*, int nodeId, RefPtr<TypeBuilder::A rray<TypeBuilder::CSS::PlatformFontUsage>>&) override;
132 void getInlineStylesForNode(ErrorString*, int nodeId, RefPtr<TypeBuilder::CS S::CSSStyle>& inlineStyle, RefPtr<TypeBuilder::CSS::CSSStyle>& attributes) overr ide; 131 void getInlineStylesForNode(ErrorString*, int nodeId, RefPtr<TypeBuilder::CS S::CSSStyle>& inlineStyle, RefPtr<TypeBuilder::CSS::CSSStyle>& attributes) overr ide;
133 void getMatchedStylesForNode(ErrorString*, int nodeId, const bool* excludePs eudo, const bool* excludeInherited, RefPtr<TypeBuilder::Array<TypeBuilder::CSS:: RuleMatch>>& matchedCSSRules, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::Pseudo IdMatches>>&, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry>>& inheritedEntries) override; 132 void getMatchedStylesForNode(ErrorString*, int nodeId, const bool* excludePs eudo, const bool* excludeInherited, RefPtr<TypeBuilder::Array<TypeBuilder::CSS:: RuleMatch>>& matchedCSSRules, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::Pseudo IdMatches>>&, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry>>& inheritedEntries) override;
134 void getStyleSheetText(ErrorString*, const String& styleSheetId, String* res ult) override; 133 void getStyleSheetText(ErrorString*, const String& styleSheetId, String* res ult) override;
135 void setStyleSheetText(ErrorString*, const String& styleSheetId, const Strin g& text) override; 134 void setStyleSheetText(ErrorString*, const String& styleSheetId, const Strin g& text) override;
136 void setRuleSelector(ErrorString*, const String& styleSheetId, const RefPtr< JSONObject>& range, const String& selector, RefPtr<TypeBuilder::CSS::CSSRule>& r esult) override; 135 void setRuleSelector(ErrorString*, const String& styleSheetId, const RefPtr< JSONObject>& range, const String& selector, RefPtr<TypeBuilder::CSS::CSSRule>& r esult) override;
137 void setStyleText(ErrorString*, const String& styleSheetId, const RefPtr<JSO NObject>& range, const String& text, RefPtr<TypeBuilder::CSS::CSSStyle>& result) override; 136 void setStyleText(ErrorString*, const String& styleSheetId, const RefPtr<JSO NObject>& range, const String& text, RefPtr<TypeBuilder::CSS::CSSStyle>& result) override;
138 void setMediaText(ErrorString*, const String& styleSheetId, const RefPtr<JSO NObject>& range, const String& text, RefPtr<TypeBuilder::CSS::CSSMedia>& result) override; 137 void setMediaText(ErrorString*, const String& styleSheetId, const RefPtr<JSO NObject>& range, const String& text, RefPtr<TypeBuilder::CSS::CSSMedia>& result) override;
139 void createStyleSheet(ErrorString*, const String& frameId, TypeBuilder::CSS: :StyleSheetId* outStyleSheetId) override; 138 void createStyleSheet(ErrorString*, const String& frameId, TypeBuilder::CSS: :StyleSheetId* outStyleSheetId) override;
140 void addRule(ErrorString*, const String& styleSheetId, const String& ruleTex t, const RefPtr<JSONObject>& location, RefPtr<TypeBuilder::CSS::CSSRule>& result ) override; 139 void addRule(ErrorString*, const String& styleSheetId, const String& ruleTex t, const RefPtr<JSONObject>& location, RefPtr<TypeBuilder::CSS::CSSRule>& result ) override;
141 void forcePseudoState(ErrorString*, int nodeId, const RefPtr<JSONArray>& for cedPseudoClasses) override; 140 void forcePseudoState(ErrorString*, int nodeId, const RefPtr<JSONArray>& for cedPseudoClasses) override;
142 void getMediaQueries(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::CS S::CSSMedia>>& medias) override; 141 void getMediaQueries(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::CS S::CSSMedia>>& medias) override;
143 void setEffectivePropertyValueForNode(ErrorString*, int nodeId, const String & propertyName, const String& value) override; 142 void setEffectivePropertyValueForNode(ErrorString*, int nodeId, const String & propertyName, const String& value) override;
144 void collectMediaQueriesFromRule(CSSRule*, TypeBuilder::Array<TypeBuilder::C SS::CSSMedia>* mediaArray); 143 void collectMediaQueriesFromRule(CSSRule*, TypeBuilder::Array<TypeBuilder::C SS::CSSMedia>* mediaArray);
145 void collectMediaQueriesFromStyleSheet(CSSStyleSheet*, TypeBuilder::Array<Ty peBuilder::CSS::CSSMedia>* mediaArray); 144 void collectMediaQueriesFromStyleSheet(CSSStyleSheet*, TypeBuilder::Array<Ty peBuilder::CSS::CSSMedia>* mediaArray);
146 PassRefPtr<TypeBuilder::CSS::CSSMedia> buildMediaObject(const MediaList*, Me diaListSource, const String&, CSSStyleSheet*); 145 PassRefPtr<TypeBuilder::CSS::CSSMedia> buildMediaObject(const MediaList*, Me diaListSource, const String&, CSSStyleSheet*);
147 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSMedia> > buildMediaListCh ain(CSSRule*); 146 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSMedia> > buildMediaListCh ain(CSSRule*);
148 PassRefPtrWillBeRawPtr<CSSStyleDeclaration> findEffectiveDeclaration(Element *, CSSPropertyID);
149 147
148 PassRefPtrWillBeRawPtr<CSSStyleDeclaration> findEffectiveDeclaration(CSSProp ertyID, CSSRuleList* matchedRulesList, CSSStyleDeclaration* inlineStyle);
149 void setCSSPropertyValue(ErrorString*, Element*, RefPtrWillBeRawPtr<CSSStyle Declaration>, CSSPropertyID, const String& value, bool forceImportant = false);
150
151 PassRefPtrWillBeRawPtr<CSSRuleList> matchedRulesList(Element*);
150 private: 152 private:
151 class StyleSheetAction; 153 class StyleSheetAction;
152 class SetStyleSheetTextAction; 154 class SetStyleSheetTextAction;
153 class ModifyRuleAction; 155 class ModifyRuleAction;
154 class SetElementStyleAction; 156 class SetElementStyleAction;
155 class AddRuleAction; 157 class AddRuleAction;
156 158
157 static void collectStyleSheets(CSSStyleSheet*, WillBeHeapVector<RawPtrWillBe Member<CSSStyleSheet> >&); 159 static void collectStyleSheets(CSSStyleSheet*, WillBeHeapVector<RawPtrWillBe Member<CSSStyleSheet> >&);
158 160
159 InspectorCSSAgent(InspectorDOMAgent*, InspectorPageAgent*, InspectorResource Agent*, InspectorResourceContentLoader*); 161 InspectorCSSAgent(InspectorDOMAgent*, InspectorPageAgent*, InspectorResource Agent*, InspectorResourceContentLoader*);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 bool m_isSettingStyleSheetText; 224 bool m_isSettingStyleSheetText;
223 225
224 friend class InspectorResourceContentLoaderCallback; 226 friend class InspectorResourceContentLoaderCallback;
225 friend class StyleSheetBinder; 227 friend class StyleSheetBinder;
226 }; 228 };
227 229
228 230
229 } // namespace blink 231 } // namespace blink
230 232
231 #endif // !defined(InspectorCSSAgent_h) 233 #endif // !defined(InspectorCSSAgent_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698