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

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

Issue 417953002: Oilpan: Prepare moving InspectorStyle to Oilpan (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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.h » ('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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 attributesStyle = attributes ? attributes.release() : nullptr; 723 attributesStyle = attributes ? attributes.release() : nullptr;
724 } 724 }
725 725
726 void InspectorCSSAgent::getComputedStyleForNode(ErrorString* errorString, int no deId, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >& s tyle) 726 void InspectorCSSAgent::getComputedStyleForNode(ErrorString* errorString, int no deId, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >& s tyle)
727 { 727 {
728 Node* node = m_domAgent->assertNode(errorString, nodeId); 728 Node* node = m_domAgent->assertNode(errorString, nodeId);
729 if (!node) 729 if (!node)
730 return; 730 return;
731 731
732 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSCompu tedStyleDeclaration::create(node, true); 732 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSCompu tedStyleDeclaration::create(node, true);
733 RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSI d(), computedStyleInfo, 0); 733 RefPtrWillBeRawPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(I nspectorCSSId(), computedStyleInfo, 0);
734 style = inspectorStyle->buildArrayForComputedStyle(); 734 style = inspectorStyle->buildArrayForComputedStyle();
735 } 735 }
736 736
737 void InspectorCSSAgent::collectPlatformFontsForRenderer(RenderText* renderer, Ha shCountedSet<String>* fontStats) 737 void InspectorCSSAgent::collectPlatformFontsForRenderer(RenderText* renderer, Ha shCountedSet<String>* fontStats)
738 { 738 {
739 for (InlineTextBox* box = renderer->firstTextBox(); box; box = box->nextText Box()) { 739 for (InlineTextBox* box = renderer->firstTextBox(); box; box = box->nextText Box()) {
740 RenderStyle* style = renderer->style(box->isFirstLineStyle()); 740 RenderStyle* style = renderer->style(box->isFirstLineStyle());
741 const Font& font = style->font(); 741 const Font& font = style->font();
742 TextRun run = box->constructTextRunForInspector(style, font); 742 TextRun run = box->constructTextRunForInspector(style, font);
743 WidthIterator it(&font, run, 0, false); 743 WidthIterator it(&font, run, 0, false);
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 if (!element->isStyledElement()) 1355 if (!element->isStyledElement())
1356 return nullptr; 1356 return nullptr;
1357 1357
1358 // FIXME: Ugliness below. 1358 // FIXME: Ugliness below.
1359 StylePropertySet* attributeStyle = const_cast<StylePropertySet*>(element->pr esentationAttributeStyle()); 1359 StylePropertySet* attributeStyle = const_cast<StylePropertySet*>(element->pr esentationAttributeStyle());
1360 if (!attributeStyle) 1360 if (!attributeStyle)
1361 return nullptr; 1361 return nullptr;
1362 1362
1363 MutableStylePropertySet* mutableAttributeStyle = toMutableStylePropertySet(a ttributeStyle); 1363 MutableStylePropertySet* mutableAttributeStyle = toMutableStylePropertySet(a ttributeStyle);
1364 1364
1365 RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSI d(), mutableAttributeStyle->ensureCSSStyleDeclaration(), 0); 1365 RefPtrWillBeRawPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(I nspectorCSSId(), mutableAttributeStyle->ensureCSSStyleDeclaration(), 0);
1366 return inspectorStyle->buildObjectForStyle(); 1366 return inspectorStyle->buildObjectForStyle();
1367 } 1367 }
1368 1368
1369 void InspectorCSSAgent::didRemoveDocument(Document* document) 1369 void InspectorCSSAgent::didRemoveDocument(Document* document)
1370 { 1370 {
1371 if (document) 1371 if (document)
1372 m_documentToViaInspectorStyleSheet.remove(document); 1372 m_documentToViaInspectorStyleSheet.remove(document);
1373 } 1373 }
1374 1374
1375 void InspectorCSSAgent::didRemoveDOMNode(Node* node) 1375 void InspectorCSSAgent::didRemoveDOMNode(Node* node)
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 visitor->trace(m_invalidatedDocuments); 1446 visitor->trace(m_invalidatedDocuments);
1447 visitor->trace(m_nodeToInspectorStyleSheet); 1447 visitor->trace(m_nodeToInspectorStyleSheet);
1448 visitor->trace(m_documentToViaInspectorStyleSheet); 1448 visitor->trace(m_documentToViaInspectorStyleSheet);
1449 #endif 1449 #endif
1450 visitor->trace(m_inspectorUserAgentStyleSheet); 1450 visitor->trace(m_inspectorUserAgentStyleSheet);
1451 InspectorBaseAgent::trace(visitor); 1451 InspectorBaseAgent::trace(visitor);
1452 } 1452 }
1453 1453
1454 } // namespace blink 1454 } // namespace blink
1455 1455
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InspectorStyleSheet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698