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

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

Issue 132803013: DevTools: [CSS] setStyleSheetText to work with inline stylesheets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address @apavlov comments Created 6 years, 10 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
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 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString , styleSheetId); 1021 InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString , styleSheetId);
1022 if (!inspectorStyleSheet) 1022 if (!inspectorStyleSheet)
1023 return; 1023 return;
1024 1024
1025 inspectorStyleSheet->getText(result); 1025 inspectorStyleSheet->getText(result);
1026 } 1026 }
1027 1027
1028 void InspectorCSSAgent::setStyleSheetText(ErrorString* errorString, const String & styleSheetId, const String& text) 1028 void InspectorCSSAgent::setStyleSheetText(ErrorString* errorString, const String & styleSheetId, const String& text)
1029 { 1029 {
1030 InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString , styleSheetId); 1030 InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString , styleSheetId);
1031 if (!inspectorStyleSheet) 1031 if (!inspectorStyleSheet) {
1032 *errorString = "Style sheet with id " + styleSheetId + " not found.";
1032 return; 1033 return;
1034 }
1033 1035
1034 TrackExceptionState exceptionState; 1036 TrackExceptionState exceptionState;
1035 m_domAgent->history()->perform(adoptPtr(new SetStyleSheetTextAction(inspecto rStyleSheet, text)), exceptionState); 1037 m_domAgent->history()->perform(adoptPtr(new SetStyleSheetTextAction(inspecto rStyleSheet, text)), exceptionState);
1036 *errorString = InspectorDOMAgent::toErrorString(exceptionState); 1038 *errorString = InspectorDOMAgent::toErrorString(exceptionState);
1037 } 1039 }
1038 1040
1039 void InspectorCSSAgent::setPropertyText(ErrorString* errorString, const RefPtr<J SONObject>& fullStyleId, int propertyIndex, const String& text, bool overwrite, RefPtr<TypeBuilder::CSS::CSSStyle>& result) 1041 void InspectorCSSAgent::setPropertyText(ErrorString* errorString, const RefPtr<J SONObject>& fullStyleId, int propertyIndex, const String& text, bool overwrite, RefPtr<TypeBuilder::CSS::CSSStyle>& result)
1040 { 1042 {
1041 InspectorCSSId compoundId(fullStyleId); 1043 InspectorCSSId compoundId(fullStyleId);
1042 ASSERT(!compoundId.isEmpty()); 1044 ASSERT(!compoundId.isEmpty());
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 documentsToChange.add(element->ownerDocument()); 1622 documentsToChange.add(element->ownerDocument());
1621 } 1623 }
1622 1624
1623 m_nodeIdToForcedPseudoState.clear(); 1625 m_nodeIdToForcedPseudoState.clear();
1624 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu mentsToChange.end(); it != end; ++it) 1626 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu mentsToChange.end(); it != end; ++it)
1625 (*it)->setNeedsStyleRecalc(SubtreeStyleChange); 1627 (*it)->setNeedsStyleRecalc(SubtreeStyleChange);
1626 } 1628 }
1627 1629
1628 } // namespace WebCore 1630 } // namespace WebCore
1629 1631
OLDNEW
« no previous file with comments | « LayoutTests/inspector/styles/styles-new-API-expected.txt ('k') | Source/core/inspector/InspectorStyleSheet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698