OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |