OLD | NEW |
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 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 } | 1224 } |
1225 *errorString = InspectorDOMAgent::toErrorString(es); | 1225 *errorString = InspectorDOMAgent::toErrorString(es); |
1226 } | 1226 } |
1227 | 1227 |
1228 void InspectorCSSAgent::addRule(ErrorString* errorString, const int contextNodeI
d, const String& selector, RefPtr<TypeBuilder::CSS::CSSRule>& result) | 1228 void InspectorCSSAgent::addRule(ErrorString* errorString, const int contextNodeI
d, const String& selector, RefPtr<TypeBuilder::CSS::CSSRule>& result) |
1229 { | 1229 { |
1230 Node* node = m_domAgent->assertNode(errorString, contextNodeId); | 1230 Node* node = m_domAgent->assertNode(errorString, contextNodeId); |
1231 if (!node) | 1231 if (!node) |
1232 return; | 1232 return; |
1233 | 1233 |
1234 InspectorStyleSheet* inspectorStyleSheet = viaInspectorStyleSheet(node->docu
ment(), true); | 1234 InspectorStyleSheet* inspectorStyleSheet = viaInspectorStyleSheet(&node->doc
ument(), true); |
1235 if (!inspectorStyleSheet) { | 1235 if (!inspectorStyleSheet) { |
1236 *errorString = "No target stylesheet found"; | 1236 *errorString = "No target stylesheet found"; |
1237 return; | 1237 return; |
1238 } | 1238 } |
1239 | 1239 |
1240 TrackExceptionState es; | 1240 TrackExceptionState es; |
1241 OwnPtr<AddRuleAction> action = adoptPtr(new AddRuleAction(inspectorStyleShee
t, selector)); | 1241 OwnPtr<AddRuleAction> action = adoptPtr(new AddRuleAction(inspectorStyleShee
t, selector)); |
1242 AddRuleAction* rawAction = action.get(); | 1242 AddRuleAction* rawAction = action.get(); |
1243 bool success = m_domAgent->history()->perform(action.release(), es); | 1243 bool success = m_domAgent->history()->perform(action.release(), es); |
1244 if (!success) { | 1244 if (!success) { |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1777 documentsToChange.add(element->ownerDocument()); | 1777 documentsToChange.add(element->ownerDocument()); |
1778 } | 1778 } |
1779 | 1779 |
1780 m_nodeIdToForcedPseudoState.clear(); | 1780 m_nodeIdToForcedPseudoState.clear(); |
1781 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu
mentsToChange.end(); it != end; ++it) | 1781 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu
mentsToChange.end(); it != end; ++it) |
1782 (*it)->setNeedsStyleRecalc(); | 1782 (*it)->setNeedsStyleRecalc(); |
1783 } | 1783 } |
1784 | 1784 |
1785 } // namespace WebCore | 1785 } // namespace WebCore |
1786 | 1786 |
OLD | NEW |