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

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

Issue 14821010: DevTools: Do not unbind stylesheets in multiframe documents (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 { 729 {
730 if (namedFlow->flowState() == NamedFlow::FlowStateNull) 730 if (namedFlow->flowState() == NamedFlow::FlowStateNull)
731 return; 731 return;
732 732
733 ErrorString errorString; 733 ErrorString errorString;
734 RefPtr<NamedFlow> protector(namedFlow); 734 RefPtr<NamedFlow> protector(namedFlow);
735 735
736 m_frontend->regionLayoutUpdated(buildObjectForNamedFlow(&errorString, namedF low, documentNodeId)); 736 m_frontend->regionLayoutUpdated(buildObjectForNamedFlow(&errorString, namedF low, documentNodeId));
737 } 737 }
738 738
739 void InspectorCSSAgent::activeStyleSheetsUpdated(const Vector<RefPtr<StyleSheet> >& newSheets) 739 void InspectorCSSAgent::activeStyleSheetsUpdated(Document* document, const Vecto r<RefPtr<StyleSheet> >& newSheets)
740 { 740 {
741 HashSet<CSSStyleSheet*> removedSheets; 741 HashSet<CSSStyleSheet*> removedSheets;
742 for (CSSStyleSheetToInspectorStyleSheet::iterator it = m_cssStyleSheetToInsp ectorStyleSheet.begin(); it != m_cssStyleSheetToInspectorStyleSheet.end(); ++it) { 742 for (CSSStyleSheetToInspectorStyleSheet::iterator it = m_cssStyleSheetToInsp ectorStyleSheet.begin(); it != m_cssStyleSheetToInspectorStyleSheet.end(); ++it) {
743 if (it->value->canBind()) 743 if (it->value->canBind() && (!it->key->ownerDocument() || it->key->owner Document() == document))
vsevik 2013/05/07 08:11:47 Please make sure this works correctly for seamless
744 removedSheets.add(it->key); 744 removedSheets.add(it->key);
745 } 745 }
746 746
747 Vector<CSSStyleSheet*> newSheetsVector; 747 Vector<CSSStyleSheet*> newSheetsVector;
748 for (size_t i = 0, size = newSheets.size(); i < size; ++i) { 748 for (size_t i = 0, size = newSheets.size(); i < size; ++i) {
749 StyleSheet* newSheet = newSheets.at(i).get(); 749 StyleSheet* newSheet = newSheets.at(i).get();
750 if (newSheet->isCSSStyleSheet()) { 750 if (newSheet->isCSSStyleSheet()) {
751 StyleSheetAppender appender(m_cssStyleSheetToInspectorStyleSheet, ne wSheetsVector); 751 StyleSheetAppender appender(m_cssStyleSheetToInspectorStyleSheet, ne wSheetsVector);
752 appender.run(static_cast<CSSStyleSheet*>(newSheet)); 752 appender.run(static_cast<CSSStyleSheet*>(newSheet));
753 } 753 }
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 documentsToChange.add(element->ownerDocument()); 1464 documentsToChange.add(element->ownerDocument());
1465 } 1465 }
1466 1466
1467 m_nodeIdToForcedPseudoState.clear(); 1467 m_nodeIdToForcedPseudoState.clear();
1468 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu mentsToChange.end(); it != end; ++it) 1468 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu mentsToChange.end(); it != end; ++it)
1469 (*it)->styleResolverChanged(RecalcStyleImmediately); 1469 (*it)->styleResolverChanged(RecalcStyleImmediately);
1470 } 1470 }
1471 1471
1472 } // namespace WebCore 1472 } // namespace WebCore
1473 1473
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698