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

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

Issue 2882193002: [devtools] Add DOMSnapshot domain for dom+layout+style snapshots. (Closed)
Patch Set: back to DOMSnapshot domain, with custom node types + traversal. Created 3 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 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 std::unique_ptr<protocol::CSS::CSSMedia> BuildMediaObject(const MediaList*, 210 std::unique_ptr<protocol::CSS::CSSMedia> BuildMediaObject(const MediaList*,
211 MediaListSource, 211 MediaListSource,
212 const String&, 212 const String&,
213 CSSStyleSheet*); 213 CSSStyleSheet*);
214 std::unique_ptr<protocol::Array<protocol::CSS::CSSMedia>> BuildMediaListChain( 214 std::unique_ptr<protocol::Array<protocol::CSS::CSSMedia>> BuildMediaListChain(
215 CSSRule*); 215 CSSRule*);
216 216
217 CSSStyleDeclaration* FindEffectiveDeclaration( 217 CSSStyleDeclaration* FindEffectiveDeclaration(
218 CSSPropertyID, 218 CSSPropertyID,
219 const HeapVector<Member<CSSStyleDeclaration>>& styles); 219 const HeapVector<Member<CSSStyleDeclaration>>& styles);
220 protocol::Response getLayoutTreeAndStyles(
221 std::unique_ptr<protocol::Array<String>> style_whitelist,
222 std::unique_ptr<protocol::Array<protocol::CSS::LayoutTreeNode>>*
223 layout_tree_nodes,
224 std::unique_ptr<protocol::Array<protocol::CSS::ComputedStyle>>*
225 computed_styles) override;
226 220
227 HeapVector<Member<CSSStyleDeclaration>> MatchingStyles(Element*); 221 HeapVector<Member<CSSStyleDeclaration>> MatchingStyles(Element*);
228 String StyleSheetId(CSSStyleSheet*); 222 String StyleSheetId(CSSStyleSheet*);
229 223
230 private: 224 private:
231 class StyleSheetAction; 225 class StyleSheetAction;
232 class SetStyleSheetTextAction; 226 class SetStyleSheetTextAction;
233 class ModifyRuleAction; 227 class ModifyRuleAction;
234 class SetElementStyleAction; 228 class SetElementStyleAction;
235 class AddRuleAction; 229 class AddRuleAction;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 void DidAddDocument(Document*) override; 295 void DidAddDocument(Document*) override;
302 void DidRemoveDocument(Document*) override; 296 void DidRemoveDocument(Document*) override;
303 void DidRemoveDOMNode(Node*) override; 297 void DidRemoveDOMNode(Node*) override;
304 void DidModifyDOMAttr(Element*) override; 298 void DidModifyDOMAttr(Element*) override;
305 299
306 // InspectorStyleSheet::Listener implementation 300 // InspectorStyleSheet::Listener implementation
307 void StyleSheetChanged(InspectorStyleSheetBase*) override; 301 void StyleSheetChanged(InspectorStyleSheetBase*) override;
308 302
309 void ResetPseudoStates(); 303 void ResetPseudoStates();
310 304
311 struct VectorStringHashTraits;
312 using ComputedStylesMap = WTF::HashMap<Vector<String>,
313 int,
314 VectorStringHashTraits,
315 VectorStringHashTraits>;
316
317 void VisitLayoutTreeNodes(
318 Node*,
319 protocol::Array<protocol::CSS::LayoutTreeNode>& layout_tree_nodes,
320 const Vector<std::pair<String, CSSPropertyID>>& css_property_whitelist,
321 ComputedStylesMap& style_to_index_map,
322 protocol::Array<protocol::CSS::ComputedStyle>& computed_styles);
323
324 // A non-zero index corresponds to a style in |computedStyles|, -1 means an
325 // empty style.
326 int GetStyleIndexForNode(
327 Node*,
328 const Vector<std::pair<String, CSSPropertyID>>& css_property_whitelist,
329 ComputedStylesMap& style_to_index_map,
330 protocol::Array<protocol::CSS::ComputedStyle>& computed_styles);
331
332 Member<InspectorDOMAgent> dom_agent_; 305 Member<InspectorDOMAgent> dom_agent_;
333 Member<InspectedFrames> inspected_frames_; 306 Member<InspectedFrames> inspected_frames_;
334 Member<InspectorNetworkAgent> network_agent_; 307 Member<InspectorNetworkAgent> network_agent_;
335 Member<InspectorResourceContentLoader> resource_content_loader_; 308 Member<InspectorResourceContentLoader> resource_content_loader_;
336 Member<InspectorResourceContainer> resource_container_; 309 Member<InspectorResourceContainer> resource_container_;
337 310
338 IdToInspectorStyleSheet id_to_inspector_style_sheet_; 311 IdToInspectorStyleSheet id_to_inspector_style_sheet_;
339 IdToInspectorStyleSheetForInlineStyle 312 IdToInspectorStyleSheetForInlineStyle
340 id_to_inspector_style_sheet_for_inline_style_; 313 id_to_inspector_style_sheet_for_inline_style_;
341 HeapHashMap<Member<CSSStyleSheet>, Member<InspectorStyleSheet>> 314 HeapHashMap<Member<CSSStyleSheet>, Member<InspectorStyleSheet>>
(...skipping 14 matching lines...) Expand all
356 int resource_content_loader_client_id_; 329 int resource_content_loader_client_id_;
357 bool was_enabled_ = false; 330 bool was_enabled_ = false;
358 331
359 friend class InspectorResourceContentLoaderCallback; 332 friend class InspectorResourceContentLoaderCallback;
360 friend class StyleSheetBinder; 333 friend class StyleSheetBinder;
361 }; 334 };
362 335
363 } // namespace blink 336 } // namespace blink
364 337
365 #endif // !defined(InspectorCSSAgent_h) 338 #endif // !defined(InspectorCSSAgent_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698