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

Unified Diff: Source/core/css/StyleSheetList.h

Issue 170403002: StyleSheetList::document() should return null after detaching the StyleSheetList from document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added a layout test Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/shadow/access-document-of-detached-stylesheetlist-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StyleSheetList.h
diff --git a/Source/core/css/StyleSheetList.h b/Source/core/css/StyleSheetList.h
index 9750565e646be405ebd403569ceb4e3fc8dbc28d..2e371195692ac0581f70ca11f63c67f2d856c3c4 100644
--- a/Source/core/css/StyleSheetList.h
+++ b/Source/core/css/StyleSheetList.h
@@ -43,8 +43,7 @@ public:
HTMLStyleElement* getNamedItem(const AtomicString&) const;
- // FIXME: Should return a reference.
- Document* document() { return &m_treeScope->document(); }
+ Document* document() { return m_treeScope ? &m_treeScope->document() : 0; }
void detachFromDocument();
CSSStyleSheet* anonymousNamedGetter(const AtomicString&);
« no previous file with comments | « LayoutTests/fast/dom/shadow/access-document-of-detached-stylesheetlist-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698