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

Unified Diff: Source/core/testing/Internals.cpp

Issue 23516004: Have CSSParserContext take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | « Source/core/inspector/InspectorStyleSheet.cpp ('k') | Source/web/WebDocument.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index f188102cfe0d3187e6f7d6e1b7286b6083c5f436..2a6480ca33f5f43be97344253115e4b368044c97 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -1859,7 +1859,10 @@ void Internals::allowRoundingHacks() const
void Internals::insertAuthorCSS(Document* document, const String& css) const
{
- RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document);
+ if (!document)
+ return;
+
+ RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(*document);
parsedSheet->setIsUserStyleSheet(false);
parsedSheet->parseString(css);
document->styleSheetCollections()->addAuthorSheet(parsedSheet);
@@ -1867,7 +1870,10 @@ void Internals::insertAuthorCSS(Document* document, const String& css) const
void Internals::insertUserCSS(Document* document, const String& css) const
{
- RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document);
+ if (!document)
+ return;
+
+ RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(*document);
parsedSheet->setIsUserStyleSheet(true);
parsedSheet->parseString(css);
document->styleSheetCollections()->addUserSheet(parsedSheet);
« no previous file with comments | « Source/core/inspector/InspectorStyleSheet.cpp ('k') | Source/web/WebDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698