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

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

Issue 183763029: DevTools: move InspectorStyleSheet::ensureSourceData to ParsedStyleSheet (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drive-by: remove unused typedef InspectorStyleMap Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 public: 165 public:
166 class Listener { 166 class Listener {
167 public: 167 public:
168 Listener() { } 168 Listener() { }
169 virtual ~Listener() { } 169 virtual ~Listener() { }
170 virtual void styleSheetChanged(InspectorStyleSheet*) = 0; 170 virtual void styleSheetChanged(InspectorStyleSheet*) = 0;
171 virtual void willReparseStyleSheet() = 0; 171 virtual void willReparseStyleSheet() = 0;
172 virtual void didReparseStyleSheet() = 0; 172 virtual void didReparseStyleSheet() = 0;
173 }; 173 };
174 174
175 typedef HashMap<CSSStyleDeclaration*, RefPtr<InspectorStyle> > InspectorStyl eMap;
176 static PassRefPtr<InspectorStyleSheet> create(InspectorPageAgent*, Inspector ResourceAgent*, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, Type Builder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Listener*); 175 static PassRefPtr<InspectorStyleSheet> create(InspectorPageAgent*, Inspector ResourceAgent*, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, Type Builder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Listener*);
177 static String styleSheetURL(CSSStyleSheet* pageStyleSheet); 176 static String styleSheetURL(CSSStyleSheet* pageStyleSheet);
178 static void collectFlatRules(PassRefPtr<CSSRuleList>, CSSRuleVector* result) ; 177 static void collectFlatRules(PassRefPtr<CSSRuleList>, CSSRuleVector* result) ;
179 178
180 virtual ~InspectorStyleSheet(); 179 virtual ~InspectorStyleSheet();
181 180
182 String id() const { return m_id; } 181 String id() const { return m_id; }
183 String finalURL() const; 182 String finalURL() const;
184 virtual Document* ownerDocument() const; 183 virtual Document* ownerDocument() const;
185 bool canBind() const { return m_origin != TypeBuilder::CSS::StyleSheetOrigin ::User_agent && m_origin != TypeBuilder::CSS::StyleSheetOrigin::User; } 184 bool canBind() const { return m_origin != TypeBuilder::CSS::StyleSheetOrigin ::User_agent && m_origin != TypeBuilder::CSS::StyleSheetOrigin::User; }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 219
221 // Also accessed by friend class InspectorStyle. 220 // Also accessed by friend class InspectorStyle.
222 virtual bool setStyleText(CSSStyleDeclaration*, const String&); 221 virtual bool setStyleText(CSSStyleDeclaration*, const String&);
223 virtual PassOwnPtr<Vector<unsigned> > lineEndings() const; 222 virtual PassOwnPtr<Vector<unsigned> > lineEndings() const;
224 223
225 private: 224 private:
226 friend class InspectorStyle; 225 friend class InspectorStyle;
227 226
228 bool checkPageStyleSheet(ExceptionState&) const; 227 bool checkPageStyleSheet(ExceptionState&) const;
229 bool ensureText() const; 228 bool ensureText() const;
230 bool ensureSourceData();
231 void ensureFlatRules() const; 229 void ensureFlatRules() const;
232 bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newS tyleText, String* result); 230 bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newS tyleText, String* result);
233 void revalidateStyle(CSSStyleDeclaration*); 231 void revalidateStyle(CSSStyleDeclaration*);
234 bool originalStyleSheetText(String* result) const; 232 bool originalStyleSheetText(String* result) const;
235 bool resourceStyleSheetText(String* result) const; 233 bool resourceStyleSheetText(String* result) const;
236 bool inlineStyleSheetText(String* result) const; 234 bool inlineStyleSheetText(String* result) const;
237 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou rce(const CSSRuleSourceData*, const String&) const; 235 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou rce(const CSSRuleSourceData*, const String&) const;
238 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty leRule*); 236 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty leRule*);
239 String url() const; 237 String url() const;
240 bool hasSourceURL() const; 238 bool hasSourceURL() const;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 288
291 // Contains "style" attribute value. 289 // Contains "style" attribute value.
292 mutable String m_styleText; 290 mutable String m_styleText;
293 mutable bool m_isStyleTextValid; 291 mutable bool m_isStyleTextValid;
294 }; 292 };
295 293
296 294
297 } // namespace WebCore 295 } // namespace WebCore
298 296
299 #endif // !defined(InspectorStyleSheet_h) 297 #endif // !defined(InspectorStyleSheet_h)
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698