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

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

Issue 1206833003: Devtools[LayoutEditor]: Pass data about property change from InspectorOverlayPage (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address pfeldman's comment Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InspectorCSSAgent.h ('k') | Source/core/inspector/InspectorOverlay.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 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 Element* element = toElement(m_domAgent->nodeForId(state.key)); 1510 Element* element = toElement(m_domAgent->nodeForId(state.key));
1511 if (element && element->ownerDocument()) 1511 if (element && element->ownerDocument())
1512 documentsToChange.add(element->ownerDocument()); 1512 documentsToChange.add(element->ownerDocument());
1513 } 1513 }
1514 1514
1515 m_nodeIdToForcedPseudoState.clear(); 1515 m_nodeIdToForcedPseudoState.clear();
1516 for (auto& document : documentsToChange) 1516 for (auto& document : documentsToChange)
1517 document->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTr acing::create(StyleChangeReason::Inspector)); 1517 document->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTr acing::create(StyleChangeReason::Inspector));
1518 } 1518 }
1519 1519
1520 void InspectorCSSAgent::setCSSPropertyValue(Node* node, CSSPropertyID propertyId , float newValue)
1521 {
1522 Element* element = toElement(node);
1523 if (element) {
1524 TrackExceptionState exceptionState;
1525 String newText = getPropertyNameString(propertyId) + " : " + String::nu mber(newValue) + "px";
1526 element->style()->setCSSText(newText, exceptionState);
1527 }
1528 }
1529
1520 DEFINE_TRACE(InspectorCSSAgent) 1530 DEFINE_TRACE(InspectorCSSAgent)
1521 { 1531 {
1522 visitor->trace(m_domAgent); 1532 visitor->trace(m_domAgent);
1523 visitor->trace(m_pageAgent); 1533 visitor->trace(m_pageAgent);
1524 visitor->trace(m_resourceAgent); 1534 visitor->trace(m_resourceAgent);
1525 #if ENABLE(OILPAN) 1535 #if ENABLE(OILPAN)
1526 visitor->trace(m_idToInspectorStyleSheet); 1536 visitor->trace(m_idToInspectorStyleSheet);
1527 visitor->trace(m_idToInspectorStyleSheetForInlineStyle); 1537 visitor->trace(m_idToInspectorStyleSheetForInlineStyle);
1528 visitor->trace(m_cssStyleSheetToInspectorStyleSheet); 1538 visitor->trace(m_cssStyleSheetToInspectorStyleSheet);
1529 visitor->trace(m_documentToCSSStyleSheets); 1539 visitor->trace(m_documentToCSSStyleSheets);
1530 visitor->trace(m_invalidatedDocuments); 1540 visitor->trace(m_invalidatedDocuments);
1531 visitor->trace(m_nodeToInspectorStyleSheet); 1541 visitor->trace(m_nodeToInspectorStyleSheet);
1532 visitor->trace(m_documentToViaInspectorStyleSheet); 1542 visitor->trace(m_documentToViaInspectorStyleSheet);
1533 #endif 1543 #endif
1534 visitor->trace(m_inspectorUserAgentStyleSheet); 1544 visitor->trace(m_inspectorUserAgentStyleSheet);
1535 InspectorBaseAgent::trace(visitor); 1545 InspectorBaseAgent::trace(visitor);
1536 } 1546 }
1537 1547
1538 } // namespace blink 1548 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorCSSAgent.h ('k') | Source/core/inspector/InspectorOverlay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698