| Index: Source/core/dom/StyleEngine.cpp
|
| diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp
|
| index ac540ebdadbc4d517b723ac45d3f74ba5a61df43..8a3986c684b50a0cf1cb6e0313e7ffac11164cab 100644
|
| --- a/Source/core/dom/StyleEngine.cpp
|
| +++ b/Source/core/dom/StyleEngine.cpp
|
| @@ -603,26 +603,21 @@ PassRefPtrWillBeRawPtr<CSSStyleSheet> StyleEngine::createSheet(Element* e, const
|
|
|
| e->document().styleEngine().addPendingSheet();
|
|
|
| - if (!e->document().inQuirksMode()) {
|
| - AtomicString textContent(text);
|
| -
|
| - WillBeHeapHashMap<AtomicString, RawPtrWillBeMember<StyleSheetContents>>::AddResult result = m_textToSheetCache.add(textContent, nullptr);
|
| - if (result.isNewEntry || !result.storedValue->value) {
|
| - styleSheet = StyleEngine::parseSheet(e, text, startPosition, createdByParser);
|
| - if (result.isNewEntry && isCacheableForStyleElement(*styleSheet->contents())) {
|
| - 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, startPosition);
|
| + AtomicString textContent(text);
|
| +
|
| + WillBeHeapHashMap<AtomicString, RawPtrWillBeMember<StyleSheetContents>>::AddResult result = m_textToSheetCache.add(textContent, nullptr);
|
| + if (result.isNewEntry || !result.storedValue->value) {
|
| + styleSheet = StyleEngine::parseSheet(e, text, startPosition, createdByParser);
|
| + if (result.isNewEntry && isCacheableForStyleElement(*styleSheet->contents())) {
|
| + result.storedValue->value = styleSheet->contents();
|
| + m_sheetToTextCache.add(styleSheet->contents(), textContent);
|
| }
|
| } else {
|
| - // FIXME: currently we don't cache StyleSheetContents inQuirksMode.
|
| - styleSheet = StyleEngine::parseSheet(e, text, startPosition, createdByParser);
|
| + StyleSheetContents* contents = result.storedValue->value;
|
| + ASSERT(contents);
|
| + ASSERT(isCacheableForStyleElement(*contents));
|
| + ASSERT(contents->singleOwnerDocument() == e->document());
|
| + styleSheet = CSSStyleSheet::createInline(contents, e, startPosition);
|
| }
|
|
|
| ASSERT(styleSheet);
|
|
|