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

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

Issue 290313002: Use RecalcStyleDeferred for inspector style changes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 m_pageStyleSheet->clearChildRuleCSSOMWrappers(); 993 m_pageStyleSheet->clearChildRuleCSSOMWrappers();
994 } 994 }
995 { 995 {
996 CSSStyleSheet::RuleMutationScope mutationScope(m_pageStyleSheet.get()); 996 CSSStyleSheet::RuleMutationScope mutationScope(m_pageStyleSheet.get());
997 m_pageStyleSheet->contents()->parseString(text); 997 m_pageStyleSheet->contents()->parseString(text);
998 } 998 }
999 999
1000 if (listener()) 1000 if (listener())
1001 listener()->didReparseStyleSheet(); 1001 listener()->didReparseStyleSheet();
1002 fireStyleSheetChanged(); 1002 fireStyleSheetChanged();
1003 m_pageStyleSheet->ownerDocument()->styleResolverChanged(RecalcStyleImmediate ly, FullStyleUpdate); 1003 m_pageStyleSheet->ownerDocument()->styleResolverChanged(RecalcStyleDeferred, FullStyleUpdate);
vsevik 2014/05/19 09:32:39 This is needed to make sure StyleSheetAdded/Remove
1004 return true; 1004 return true;
1005 } 1005 }
1006 1006
1007 String InspectorStyleSheet::ruleSelector(const InspectorCSSId& id, ExceptionStat e& exceptionState) 1007 String InspectorStyleSheet::ruleSelector(const InspectorCSSId& id, ExceptionStat e& exceptionState)
1008 { 1008 {
1009 CSSStyleRule* rule = ruleForId(id); 1009 CSSStyleRule* rule = ruleForId(id);
1010 if (!rule) { 1010 if (!rule) {
1011 exceptionState.throwDOMException(NotFoundError, "No rule was found for t he given ID."); 1011 exceptionState.throwDOMException(NotFoundError, "No rule was found for t he given ID.");
1012 return ""; 1012 return "";
1013 } 1013 }
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 1665
1666 RefPtrWillBeRawPtr<MutableStylePropertySet> tempDeclaration = MutableStylePr opertySet::create(); 1666 RefPtrWillBeRawPtr<MutableStylePropertySet> tempDeclaration = MutableStylePr opertySet::create();
1667 RuleSourceDataList ruleSourceDataResult; 1667 RuleSourceDataList ruleSourceDataResult;
1668 StyleSheetHandler handler(m_styleText, &m_element->document(), m_element->do cument().elementSheet().contents(), &ruleSourceDataResult); 1668 StyleSheetHandler handler(m_styleText, &m_element->document(), m_element->do cument().elementSheet().contents(), &ruleSourceDataResult);
1669 BisonCSSParser(parserContextForDocument(&m_element->document())).parseDeclar ation(tempDeclaration.get(), m_styleText, &handler, m_element->document().elemen tSheet().contents()); 1669 BisonCSSParser(parserContextForDocument(&m_element->document())).parseDeclar ation(tempDeclaration.get(), m_styleText, &handler, m_element->document().elemen tSheet().contents());
1670 return ruleSourceDataResult.first().release(); 1670 return ruleSourceDataResult.first().release();
1671 } 1671 }
1672 1672
1673 } // namespace WebCore 1673 } // namespace WebCore
1674 1674
OLDNEW
« Source/core/inspector/InspectorPageAgent.cpp ('K') | « Source/core/inspector/InspectorPageAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698