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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp

Issue 1765463002: One instead of three resolverChanged replacing source in inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSStyleSheet.cpp ('k') | no next file » | 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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 return pageStyleSheet->contents()->baseURL().string(); 959 return pageStyleSheet->contents()->baseURL().string();
960 return emptyString(); 960 return emptyString();
961 } 961 }
962 962
963 String InspectorStyleSheet::finalURL() 963 String InspectorStyleSheet::finalURL()
964 { 964 {
965 String url = styleSheetURL(m_pageStyleSheet.get()); 965 String url = styleSheetURL(m_pageStyleSheet.get());
966 return url.isEmpty() ? m_documentURL : url; 966 return url.isEmpty() ? m_documentURL : url;
967 } 967 }
968 968
969 bool InspectorStyleSheet::setText(const String& text, ExceptionState& exceptionS tate) 969 bool InspectorStyleSheet::setText(const String& text, ExceptionState&)
970 { 970 {
971 innerSetText(text, true); 971 innerSetText(text, true);
972 972
973 if (listener()) 973 if (listener())
974 listener()->willReparseStyleSheet(); 974 listener()->willReparseStyleSheet();
975 975
976 { 976 m_pageStyleSheet->setText(text);
977 // Have a separate scope for clearRules() (bug 95324).
978 CSSStyleSheet::RuleMutationScope mutationScope(m_pageStyleSheet.get());
979 m_pageStyleSheet->contents()->clearRules();
980 m_pageStyleSheet->clearChildRuleCSSOMWrappers();
981 }
982 {
983 CSSStyleSheet::RuleMutationScope mutationScope(m_pageStyleSheet.get());
984 m_pageStyleSheet->contents()->parseString(text);
985 }
986 977
987 if (listener()) 978 if (listener())
988 listener()->didReparseStyleSheet(); 979 listener()->didReparseStyleSheet();
989 onStyleSheetTextChanged(); 980 onStyleSheetTextChanged();
990 m_pageStyleSheet->ownerDocument()->styleEngine().resolverChanged(FullStyleUp date);
991 return true; 981 return true;
992 } 982 }
993 983
994 RefPtrWillBeRawPtr<CSSStyleRule> InspectorStyleSheet::setRuleSelector(const Sour ceRange& range, const String& text, SourceRange* newRange, String* oldText, Exce ptionState& exceptionState) 984 RefPtrWillBeRawPtr<CSSStyleRule> InspectorStyleSheet::setRuleSelector(const Sour ceRange& range, const String& text, SourceRange* newRange, String* oldText, Exce ptionState& exceptionState)
995 { 985 {
996 if (!verifySelectorText(m_pageStyleSheet->ownerDocument(), text)) { 986 if (!verifySelectorText(m_pageStyleSheet->ownerDocument(), text)) {
997 exceptionState.throwDOMException(SyntaxError, "Selector or media text is not valid."); 987 exceptionState.throwDOMException(SyntaxError, "Selector or media text is not valid.");
998 return nullptr; 988 return nullptr;
999 } 989 }
1000 990
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1786 } 1776 }
1787 1777
1788 DEFINE_TRACE(InspectorStyleSheetForInlineStyle) 1778 DEFINE_TRACE(InspectorStyleSheetForInlineStyle)
1789 { 1779 {
1790 visitor->trace(m_element); 1780 visitor->trace(m_element);
1791 visitor->trace(m_inspectorStyle); 1781 visitor->trace(m_inspectorStyle);
1792 InspectorStyleSheetBase::trace(visitor); 1782 InspectorStyleSheetBase::trace(visitor);
1793 } 1783 }
1794 1784
1795 } // namespace blink 1785 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSStyleSheet.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698