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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |