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

Unified Diff: sky/engine/core/dom/StyleEngine.cpp

Issue 800083003: Remove hasSyntacticallyValidCSSHeader. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « sky/engine/core/css/parser/BisonCSSParser-in.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/StyleEngine.cpp
diff --git a/sky/engine/core/dom/StyleEngine.cpp b/sky/engine/core/dom/StyleEngine.cpp
index ee38518b7963a002fa26bf4f053d639a7e632434..907a2e60b6e65d17e865a150fc7a3945c8998d57 100644
--- a/sky/engine/core/dom/StyleEngine.cpp
+++ b/sky/engine/core/dom/StyleEngine.cpp
@@ -376,13 +376,6 @@ void StyleEngine::markDocumentDirty()
document().importsController()->master()->styleEngine()->markDocumentDirty();
}
-static bool isCacheableForStyleElement(const StyleSheetContents& contents)
-{
- if (!contents.hasSyntacticallyValidCSSHeader())
- return false;
- return true;
-}
-
PassRefPtr<CSSStyleSheet> StyleEngine::createSheet(Element* e, const String& text)
{
RefPtr<CSSStyleSheet> styleSheet;
@@ -392,14 +385,13 @@ PassRefPtr<CSSStyleSheet> StyleEngine::createSheet(Element* e, const String& tex
if (result.isNewEntry || !result.storedValue->value) {
styleSheet = CSSStyleSheet::createInline(e, KURL());
styleSheet->contents()->parseString(text);
- if (result.isNewEntry && isCacheableForStyleElement(*styleSheet->contents())) {
+ if (result.isNewEntry) {
result.storedValue->value = styleSheet->contents();
m_sheetToTextCache.add(styleSheet->contents(), textContent);
}
} else {
StyleSheetContents* contents = result.storedValue->value;
ASSERT(contents);
- ASSERT(isCacheableForStyleElement(*contents));
ASSERT(contents->singleOwnerDocument() == e->document());
styleSheet = CSSStyleSheet::createInline(contents, e);
}
« no previous file with comments | « sky/engine/core/css/parser/BisonCSSParser-in.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698