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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InspectorStyleSheet.cpp ('k') | Source/web/WebDocument.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after
1852 memoryCache()->evictResources(); 1852 memoryCache()->evictResources();
1853 } 1853 }
1854 1854
1855 void Internals::allowRoundingHacks() const 1855 void Internals::allowRoundingHacks() const
1856 { 1856 {
1857 TextRun::setAllowsRoundingHacks(true); 1857 TextRun::setAllowsRoundingHacks(true);
1858 } 1858 }
1859 1859
1860 void Internals::insertAuthorCSS(Document* document, const String& css) const 1860 void Internals::insertAuthorCSS(Document* document, const String& css) const
1861 { 1861 {
1862 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document ); 1862 if (!document)
1863 return;
1864
1865 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(*documen t);
1863 parsedSheet->setIsUserStyleSheet(false); 1866 parsedSheet->setIsUserStyleSheet(false);
1864 parsedSheet->parseString(css); 1867 parsedSheet->parseString(css);
1865 document->styleSheetCollections()->addAuthorSheet(parsedSheet); 1868 document->styleSheetCollections()->addAuthorSheet(parsedSheet);
1866 } 1869 }
1867 1870
1868 void Internals::insertUserCSS(Document* document, const String& css) const 1871 void Internals::insertUserCSS(Document* document, const String& css) const
1869 { 1872 {
1870 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document ); 1873 if (!document)
1874 return;
1875
1876 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(*documen t);
1871 parsedSheet->setIsUserStyleSheet(true); 1877 parsedSheet->setIsUserStyleSheet(true);
1872 parsedSheet->parseString(css); 1878 parsedSheet->parseString(css);
1873 document->styleSheetCollections()->addUserSheet(parsedSheet); 1879 document->styleSheetCollections()->addUserSheet(parsedSheet);
1874 } 1880 }
1875 1881
1876 String Internals::counterValue(Element* element) 1882 String Internals::counterValue(Element* element)
1877 { 1883 {
1878 if (!element) 1884 if (!element)
1879 return String(); 1885 return String();
1880 1886
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 return false; 2211 return false;
2206 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); 2212 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB);
2207 // To prevent tests that call loseSharedGraphicsContext3D from being 2213 // To prevent tests that call loseSharedGraphicsContext3D from being
2208 // flaky, we call finish so that the context is guaranteed to be lost 2214 // flaky, we call finish so that the context is guaranteed to be lost
2209 // synchronously (i.e. before returning). 2215 // synchronously (i.e. before returning).
2210 sharedContext->finish(); 2216 sharedContext->finish();
2211 return true; 2217 return true;
2212 } 2218 }
2213 2219
2214 } 2220 }
OLDNEW
« 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