<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[207285] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/207285">207285</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2016-10-13 04:58:07 -0700 (Thu, 13 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Revert patch landed with wrong commit message.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserModeh">trunk/Source/WebCore/css/parser/CSSParserMode.h</a></li>
<li><a href="#trunkSourceWebCoredomInlineStyleSheetOwnercpp">trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp</a></li>
<li><a href="#trunkSourceWebCoredomInlineStyleSheetOwnerh">trunk/Source/WebCore/dom/InlineStyleSheetOwner.h</a></li>
<li><a href="#trunkSourceWebCoreplatformMemoryPressureHandlercpp">trunk/Source/WebCore/platform/MemoryPressureHandler.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207284 => 207285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-13 11:47:41 UTC (rev 207284)
+++ trunk/Source/WebCore/ChangeLog        2016-10-13 11:58:07 UTC (rev 207285)
</span><span class="lines">@@ -1,3 +1,7 @@
</span><ins>+2016-10-13 Antti Koivisto <antti@apple.com>
+
+ Revert patch landed with wrong commit message.
+
</ins><span class="cx"> 2016-10-12 Per Arne Vollan <pvollan@apple.com>
</span><span class="cx">
</span><span class="cx"> [Win] Encode function pointers.
</span><span class="lines">@@ -76,37 +80,6 @@
</span><span class="cx">
</span><span class="cx"> 2016-10-13 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><del>- Share inline stylesheets between shadow trees
- https://bugs.webkit.org/show_bug.cgi?id=163353
-
- Reviewed by Ryosuke Niwa and Andreas Kling.
-
- If shadow trees have identical inline stylesheets the data structures can be shared.
- In future this will also allow sharing style resolvers.
-
- * css/parser/CSSParserMode.h:
- (WebCore::CSSParserContextHash::hash):
- (WebCore::CSSParserContextHash::equal):
- (WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
- (WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue):
- (WTF::HashTraits<WebCore::CSSParserContext>::emptyValue):
-
- Make CSSParserContext hashable.
-
- * dom/InlineStyleSheetOwner.cpp:
- (WebCore::makeInlineStyleSheetCacheKey):
- (WebCore::inlineStyleSheetCache):
-
- Implement a simple cache for sharing stylesheets with identical text and context.
-
- (WebCore::InlineStyleSheetOwner::createSheet):
- (WebCore::InlineStyleSheetOwner::clearCache):
- * dom/InlineStyleSheetOwner.h:
- * platform/MemoryPressureHandler.cpp:
- (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
-
-2016-10-13 Antti Koivisto <antti@apple.com>
-
</del><span class="cx"> Support scoped style for user agent shadow trees
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=163212
</span><span class="cx"> <rdar://problem/28715318>
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserModeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserMode.h (207284 => 207285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserMode.h        2016-10-13 11:47:41 UTC (rev 207284)
+++ trunk/Source/WebCore/css/parser/CSSParserMode.h        2016-10-13 11:58:07 UTC (rev 207285)
</span><span class="lines">@@ -32,9 +32,6 @@
</span><span class="cx"> #define CSSParserMode_h
</span><span class="cx">
</span><span class="cx"> #include "URL.h"
</span><del>-#include "URLHash.h"
-#include <wtf/HashFunctions.h>
-#include <wtf/text/StringHash.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -117,50 +114,6 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT const CSSParserContext& strictCSSParserContext();
</span><span class="cx">
</span><del>-struct CSSParserContextHash {
- static unsigned hash(const CSSParserContext& key)
- {
- auto hash = URLHash::hash(key.baseURL);
- hash ^= StringHash::hash(key.charset);
- unsigned bits = key.isHTMLDocument << 0
- & key.isHTMLDocument << 1
-#if ENABLE(CSS_GRID_LAYOUT)
- & key.cssGridLayoutEnabled << 2
-#endif
-#if ENABLE(TEXT_AUTOSIZING)
- & key.textAutosizingEnabled << 3
-#endif
- & key.needsSiteSpecificQuirks << 4
- & key.enforcesCSSMIMETypeInNoQuirksMode << 5
- & key.useLegacyBackgroundSizeShorthandBehavior << 6
- & key.springTimingFunctionEnabled << 7
- & key.useNewParser << 8
-#if ENABLE(VARIATION_FONTS)
- & key.variationFontsEnabled << 9
-#endif
- & key.mode << 10;
- hash ^= WTF::intHash(bits);
- return hash;
- }
- static bool equal(const CSSParserContext& a, const CSSParserContext& b)
- {
- return a == b;
- }
- static const bool safeToCompareToEmptyOrDeleted = false;
</del><span class="cx"> };
</span><span class="cx">
</span><del>-}
-
-namespace WTF {
-template<> struct HashTraits<WebCore::CSSParserContext> : GenericHashTraits<WebCore::CSSParserContext> {
- static void constructDeletedValue(WebCore::CSSParserContext& slot) { new (NotNull, &slot.baseURL) WebCore::URL(WTF::HashTableDeletedValue); }
- static bool isDeletedValue(const WebCore::CSSParserContext& value) { return value.baseURL.isHashTableDeletedValue(); }
- static WebCore::CSSParserContext emptyValue() { return WebCore::CSSParserContext(WebCore::HTMLStandardMode); }
-};
-
-template<> struct DefaultHash<WebCore::CSSParserContext> {
- typedef WebCore::CSSParserContextHash Hash;
-};
-}
-
</del><span class="cx"> #endif // CSSParserMode_h
</span></span></pre></div>
<a id="trunkSourceWebCoredomInlineStyleSheetOwnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp (207284 => 207285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp        2016-10-13 11:47:41 UTC (rev 207284)
+++ trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp        2016-10-13 11:58:07 UTC (rev 207285)
</span><span class="lines">@@ -30,40 +30,10 @@
</span><span class="cx"> #include "StyleScope.h"
</span><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx"> #include "TextNodeTraversal.h"
</span><del>-#include <wtf/HashMap.h>
</del><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-using InlineStyleSheetCacheKey = std::pair<String, CSSParserContext>;
-using InlineStyleSheetCache = HashMap<InlineStyleSheetCacheKey, RefPtr<StyleSheetContents>>;
-
-static InlineStyleSheetCache& inlineStyleSheetCache()
-{
- static NeverDestroyed<InlineStyleSheetCache> cache;
- return cache;
-}
-
-static URL inlineStyleSheetBaseURLForElement(const Element& element)
-{
- auto* shadowRoot = element.containingShadowRoot();
- // User agent shadow trees can't contain document-relative URLs. Use blank URL as base allowing cross-document sharing.
- return shadowRoot && shadowRoot->mode() == ShadowRoot::Mode::UserAgent ? blankURL() : element.document().baseURL();
-}
-
-static Optional<InlineStyleSheetCacheKey> makeInlineStyleSheetCacheKey(const String& text, const Element& element)
-{
- if (text.isEmpty())
- return { };
- // Only cache for shadow trees. Main document inline stylesheets are generally unique and can't be shared between documents.
- // FIXME: This could be relaxed when a stylesheet does not contain document-relative URLs (or #urls).
- if (!element.isInShadowTree())
- return { };
-
- CSSParserContext context { element.document(), inlineStyleSheetBaseURLForElement(element) };
- return std::make_pair(text, context);
-}
-
</del><span class="cx"> InlineStyleSheetOwner::InlineStyleSheetOwner(Document& document, bool createdByParser)
</span><span class="cx"> : m_isParsingChildren(createdByParser)
</span><span class="cx"> , m_loading(false)
</span><span class="lines">@@ -182,20 +152,9 @@
</span><span class="cx"> if (m_styleScope)
</span><span class="cx"> m_styleScope->addPendingSheet();
</span><span class="cx">
</span><del>- auto cacheKey = makeInlineStyleSheetCacheKey(text, element);
- if (cacheKey) {
- if (auto* cachedSheet = inlineStyleSheetCache().get(*cacheKey)) {
- ASSERT(cachedSheet->isCacheable());
- m_sheet = CSSStyleSheet::create(*cachedSheet, element);
- sheetLoaded(element);
- element.notifyLoadedSheetAndAllCriticalSubresources(false);
- return;
- }
- }
-
</del><span class="cx"> m_loading = true;
</span><span class="cx">
</span><del>- m_sheet = CSSStyleSheet::createInline(element, inlineStyleSheetBaseURLForElement(element), m_startTextPosition, document.encoding());
</del><ins>+ m_sheet = CSSStyleSheet::createInline(element, URL(), m_startTextPosition, document.encoding());
</ins><span class="cx"> m_sheet->setMediaQueries(mediaQueries.releaseNonNull());
</span><span class="cx"> m_sheet->setTitle(element.title());
</span><span class="cx"> m_sheet->contents().parseStringAtPosition(text, m_startTextPosition, m_isParsingChildren);
</span><span class="lines">@@ -204,15 +163,6 @@
</span><span class="cx">
</span><span class="cx"> if (m_sheet)
</span><span class="cx"> m_sheet->contents().checkLoaded();
</span><del>-
- if (cacheKey && m_sheet && m_sheet->contents().isCacheable()) {
- inlineStyleSheetCache().add(*cacheKey, &m_sheet->contents());
-
- // Prevent pathological growth.
- const size_t maximumInlineStyleSheetCacheSize = 50;
- if (inlineStyleSheetCache().size() > maximumInlineStyleSheetCacheSize)
- inlineStyleSheetCache().remove(inlineStyleSheetCache().begin());
- }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool InlineStyleSheetOwner::isLoading() const
</span><span class="lines">@@ -239,9 +189,4 @@
</span><span class="cx"> m_styleScope->addPendingSheet();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InlineStyleSheetOwner::clearCache()
-{
- inlineStyleSheetCache().clear();
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoredomInlineStyleSheetOwnerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/InlineStyleSheetOwner.h (207284 => 207285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/InlineStyleSheetOwner.h        2016-10-13 11:47:41 UTC (rev 207284)
+++ trunk/Source/WebCore/dom/InlineStyleSheetOwner.h        2016-10-13 11:58:07 UTC (rev 207285)
</span><span class="lines">@@ -52,8 +52,6 @@
</span><span class="cx">
</span><span class="cx"> Style::Scope* styleScope() { return m_styleScope; }
</span><span class="cx">
</span><del>- static void clearCache();
-
</del><span class="cx"> private:
</span><span class="cx"> void createSheet(Element&, const String& text);
</span><span class="cx"> void createSheetFromTextContents(Element&);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMemoryPressureHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.cpp (207284 => 207285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2016-10-13 11:47:41 UTC (rev 207284)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2016-10-13 11:58:07 UTC (rev 207285)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include "FontCache.h"
</span><span class="cx"> #include "GCController.h"
</span><span class="cx"> #include "HTMLMediaElement.h"
</span><del>-#include "InlineStyleSheetOwner.h"
</del><span class="cx"> #include "InspectorInstrumentation.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "MemoryCache.h"
</span><span class="lines">@@ -104,11 +103,6 @@
</span><span class="cx"> ReliefLogger log("Prune presentation attribute cache");
</span><span class="cx"> StyledElement::clearPresentationAttributeCache();
</span><span class="cx"> }
</span><del>-
- {
- ReliefLogger log("Clear inline stylesheet cache");
- InlineStyleSheetOwner::clearCache();
- }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MemoryPressureHandler::releaseCriticalMemory(Synchronous synchronous)
</span></span></pre>
</div>
</div>
</body>
</html>