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

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

Issue 1153503010: Devtools: Margin resizer in overlay experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/InspectorHighlight.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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 428 }
429 429
430 // static 430 // static
431 CSSMediaRule* InspectorCSSAgent::asCSSMediaRule(CSSRule* rule) 431 CSSMediaRule* InspectorCSSAgent::asCSSMediaRule(CSSRule* rule)
432 { 432 {
433 if (!rule || rule->type() != CSSRule::MEDIA_RULE) 433 if (!rule || rule->type() != CSSRule::MEDIA_RULE)
434 return nullptr; 434 return nullptr;
435 return toCSSMediaRule(rule); 435 return toCSSMediaRule(rule);
436 } 436 }
437 437
438 InspectorCSSAgent::InspectorCSSAgent(InspectorDOMAgent* domAgent, InspectorPageA gent* pageAgent, InspectorResourceAgent* resourceAgent) 438 InspectorCSSAgent::InspectorCSSAgent(InspectorDOMAgent* domAgent, InspectorPageA gent* pageAgent, InspectorResourceAgent* resourceAgent, InspectorOverlay* overla y)
439 : InspectorBaseAgent<InspectorCSSAgent, InspectorFrontend::CSS>("CSS") 439 : InspectorBaseAgent<InspectorCSSAgent, InspectorFrontend::CSS>("CSS")
440 , m_domAgent(domAgent) 440 , m_domAgent(domAgent)
441 , m_pageAgent(pageAgent) 441 , m_pageAgent(pageAgent)
442 , m_resourceAgent(resourceAgent) 442 , m_resourceAgent(resourceAgent)
443 , m_lastStyleSheetId(1) 443 , m_lastStyleSheetId(1)
444 , m_styleSheetsPendingMutation(0) 444 , m_styleSheetsPendingMutation(0)
445 , m_styleDeclarationPendingMutation(false) 445 , m_styleDeclarationPendingMutation(false)
446 , m_creatingViaInspectorStyleSheet(false) 446 , m_creatingViaInspectorStyleSheet(false)
447 , m_isSettingStyleSheetText(false) 447 , m_isSettingStyleSheetText(false)
448 , m_overlay(overlay)
448 { 449 {
449 m_domAgent->setDOMListener(this); 450 m_domAgent->setDOMListener(this);
451 m_overlay->setCSSListener(this);
450 } 452 }
451 453
452 InspectorCSSAgent::~InspectorCSSAgent() 454 InspectorCSSAgent::~InspectorCSSAgent()
453 { 455 {
454 #if !ENABLE(OILPAN) 456 #if !ENABLE(OILPAN)
455 ASSERT(!m_domAgent); 457 ASSERT(!m_domAgent);
456 reset(); 458 reset();
457 #endif 459 #endif
458 } 460 }
459 461
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 Element* element = toElement(m_domAgent->nodeForId(state.key)); 1571 Element* element = toElement(m_domAgent->nodeForId(state.key));
1570 if (element && element->ownerDocument()) 1572 if (element && element->ownerDocument())
1571 documentsToChange.add(element->ownerDocument()); 1573 documentsToChange.add(element->ownerDocument());
1572 } 1574 }
1573 1575
1574 m_nodeIdToForcedPseudoState.clear(); 1576 m_nodeIdToForcedPseudoState.clear();
1575 for (auto& document : documentsToChange) 1577 for (auto& document : documentsToChange)
1576 document->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTr acing::create(StyleChangeReason::Inspector)); 1578 document->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTr acing::create(StyleChangeReason::Inspector));
1577 } 1579 }
1578 1580
1581 void InspectorCSSAgent::updateCSSProperty(Node* node, long newValue)
1582 {
1583 frontend()->cssPropertyEdited(m_domAgent->boundNodeId(node), newValue);
1584 }
1585
1579 DEFINE_TRACE(InspectorCSSAgent) 1586 DEFINE_TRACE(InspectorCSSAgent)
1580 { 1587 {
1581 visitor->trace(m_domAgent); 1588 visitor->trace(m_domAgent);
1582 visitor->trace(m_pageAgent); 1589 visitor->trace(m_pageAgent);
1583 visitor->trace(m_resourceAgent); 1590 visitor->trace(m_resourceAgent);
1584 #if ENABLE(OILPAN) 1591 #if ENABLE(OILPAN)
1585 visitor->trace(m_idToInspectorStyleSheet); 1592 visitor->trace(m_idToInspectorStyleSheet);
1586 visitor->trace(m_idToInspectorStyleSheetForInlineStyle); 1593 visitor->trace(m_idToInspectorStyleSheetForInlineStyle);
1587 visitor->trace(m_cssStyleSheetToInspectorStyleSheet); 1594 visitor->trace(m_cssStyleSheetToInspectorStyleSheet);
1588 visitor->trace(m_documentToCSSStyleSheets); 1595 visitor->trace(m_documentToCSSStyleSheets);
1589 visitor->trace(m_invalidatedDocuments); 1596 visitor->trace(m_invalidatedDocuments);
1590 visitor->trace(m_nodeToInspectorStyleSheet); 1597 visitor->trace(m_nodeToInspectorStyleSheet);
1591 visitor->trace(m_documentToViaInspectorStyleSheet); 1598 visitor->trace(m_documentToViaInspectorStyleSheet);
1592 #endif 1599 #endif
1593 visitor->trace(m_inspectorUserAgentStyleSheet); 1600 visitor->trace(m_inspectorUserAgentStyleSheet);
1594 InspectorBaseAgent::trace(visitor); 1601 InspectorBaseAgent::trace(visitor);
1595 } 1602 }
1596 1603
1597 } // namespace blink 1604 } // namespace blink
1598 1605
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorCSSAgent.h ('k') | Source/core/inspector/InspectorHighlight.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698