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

Unified Diff: WebCore/css/StyleSheet.cpp

Issue 5601001: Merge 72924 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years 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 side-by-side diff with in-line comments
Download patch
Index: WebCore/css/StyleSheet.cpp
===================================================================
--- WebCore/css/StyleSheet.cpp (revision 73165)
+++ WebCore/css/StyleSheet.cpp (working copy)
@@ -56,6 +56,14 @@
{
if (m_media)
m_media->setParent(0);
+
+ // For style rules outside the document, .parentStyleSheet can become null even if the style rule
+ // is still observable from JavaScript. This matches the behavior of .parentNode for nodes, but
+ // it's not ideal because it makes the CSSOM's behavior depend on the timing of garbage collection.
+ for (unsigned i = 0; i < length(); ++i) {
+ ASSERT(item(i)->parent() == this);
+ item(i)->setParent(0);
+ }
}
StyleSheet* StyleSheet::parentStyleSheet() const
« no previous file with comments | « LayoutTests/fast/dom/StyleSheet/detached-stylesheet-without-wrapper-expected.txt ('k') | WebCore/svg/SVGFontFaceElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698