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

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

Issue 2882193002: [devtools] Add DOMSnapshot domain for dom+layout+style snapshots. (Closed)
Patch Set: add domain to schema agent Created 3 years, 7 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 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after
2295 text_bounds, owner_element->GetDocument(), nullptr, colors); 2295 text_bounds, owner_element->GetDocument(), nullptr, colors);
2296 } 2296 }
2297 } 2297 }
2298 2298
2299 *result = protocol::Array<String>::create(); 2299 *result = protocol::Array<String>::create();
2300 for (auto color : colors) 2300 for (auto color : colors)
2301 result->fromJust()->addItem(color.SerializedAsCSSComponentValue()); 2301 result->fromJust()->addItem(color.SerializedAsCSSComponentValue());
2302 return Response::OK(); 2302 return Response::OK();
2303 } 2303 }
2304 2304
2305 Response InspectorCSSAgent::getLayoutTreeAndStyles( 2305 Response InspectorCSSAgent::getLayoutTreeAndStyles(
pfeldman 2017/05/15 18:42:18 Do we still need it?
Eric Seckler 2017/05/17 10:44:31 Not really. I was going to remove it and move the
2306 std::unique_ptr<protocol::Array<String>> style_whitelist, 2306 std::unique_ptr<protocol::Array<String>> style_whitelist,
2307 std::unique_ptr<protocol::Array<protocol::CSS::LayoutTreeNode>>* 2307 std::unique_ptr<protocol::Array<protocol::CSS::LayoutTreeNode>>*
2308 layout_tree_nodes, 2308 layout_tree_nodes,
2309 std::unique_ptr<protocol::Array<protocol::CSS::ComputedStyle>>* 2309 std::unique_ptr<protocol::Array<protocol::CSS::ComputedStyle>>*
2310 computed_styles) { 2310 computed_styles) {
2311 dom_agent_->GetDocument()->UpdateStyleAndLayoutTree(); 2311 Document* document = dom_agent_->GetDocument();
2312 if (!document)
2313 return Response::Error("Document is not available");
2314
2315 document->UpdateStyleAndLayoutTree();
2312 2316
2313 // Look up the CSSPropertyIDs for each entry in |styleWhitelist|. 2317 // Look up the CSSPropertyIDs for each entry in |styleWhitelist|.
2314 Vector<std::pair<String, CSSPropertyID>> css_property_whitelist; 2318 Vector<std::pair<String, CSSPropertyID>> css_property_whitelist;
2315 for (size_t i = 0; i < style_whitelist->length(); i++) { 2319 for (size_t i = 0; i < style_whitelist->length(); i++) {
2316 CSSPropertyID property_id = cssPropertyID(style_whitelist->get(i)); 2320 CSSPropertyID property_id = cssPropertyID(style_whitelist->get(i));
2317 if (property_id == CSSPropertyInvalid) 2321 if (property_id == CSSPropertyInvalid)
2318 continue; 2322 continue;
2319 css_property_whitelist.push_back( 2323 css_property_whitelist.push_back(
2320 std::make_pair(style_whitelist->get(i), property_id)); 2324 std::make_pair(style_whitelist->get(i), property_id));
2321 } 2325 }
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
2536 visitor->Trace(css_style_sheet_to_inspector_style_sheet_); 2540 visitor->Trace(css_style_sheet_to_inspector_style_sheet_);
2537 visitor->Trace(document_to_css_style_sheets_); 2541 visitor->Trace(document_to_css_style_sheets_);
2538 visitor->Trace(invalidated_documents_); 2542 visitor->Trace(invalidated_documents_);
2539 visitor->Trace(node_to_inspector_style_sheet_); 2543 visitor->Trace(node_to_inspector_style_sheet_);
2540 visitor->Trace(inspector_user_agent_style_sheet_); 2544 visitor->Trace(inspector_user_agent_style_sheet_);
2541 visitor->Trace(tracker_); 2545 visitor->Trace(tracker_);
2542 InspectorBaseAgent::Trace(visitor); 2546 InspectorBaseAgent::Trace(visitor);
2543 } 2547 }
2544 2548
2545 } // namespace blink 2549 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698