<!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>[209794] trunk</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/209794">209794</a></dd>
<dt>Author</dt> <dd>barraclough@apple.com</dd>
<dt>Date</dt> <dd>2016-12-14 00:23:23 -0800 (Wed, 14 Dec 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>
Source/WebCore:
Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/209792">r209792</a>.
https://bugs.webkit.org/show_bug.cgi?id=165841
Cause build failures (Requested by yusukesuzuki on #webkit).
Reverted changeset:
"Use JSValue::toWTFString instead of calling toString(exec)
and value(exec)"
https://bugs.webkit.org/show_bug.cgi?id=165795
http://trac.webkit.org/changeset/209792
Patch by Commit Queue <commit-queue@webkit.org> on 2016-12-13
LayoutTests:
ASSERTION FAILED: hasParserBlockingScript() seen with js/dom/modules/module-will-fire-beforeload.html
https://bugs.webkit.org/show_bug.cgi?id=164883
Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2016-12-13
Reviewed by Ryosuke Niwa.
* platform/mac-wk2/TestExpectations:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk1TestExpectations">trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2TestExpectations">trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFaceSetcpp">trunk/Source/WebCore/css/CSSFontFaceSet.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSKeyframesRulecpp">trunk/Source/WebCore/css/CSSKeyframesRule.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSKeyframesRuleh">trunk/Source/WebCore/css/CSSKeyframesRule.h</a></li>
<li><a href="#trunkSourceWebCorecssDOMCSSNamespacecpp">trunk/Source/WebCore/css/DOMCSSNamespace.cpp</a></li>
<li><a href="#trunkSourceWebCorecssElementRuleCollectorcpp">trunk/Source/WebCore/css/ElementRuleCollector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssFontFacecpp">trunk/Source/WebCore/css/FontFace.cpp</a></li>
<li><a href="#trunkSourceWebCorecssMediaListcpp">trunk/Source/WebCore/css/MediaList.cpp</a></li>
<li><a href="#trunkSourceWebCorecssPropertySetCSSStyleDeclarationcpp">trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertiescpp">trunk/Source/WebCore/css/StyleProperties.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertiesh">trunk/Source/WebCore/css/StyleProperties.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleRulecpp">trunk/Source/WebCore/css/StyleRule.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleRuleh">trunk/Source/WebCore/css/StyleRule.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleSheetContentscpp">trunk/Source/WebCore/css/StyleSheetContents.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleSheetContentsh">trunk/Source/WebCore/css/StyleSheetContents.h</a></li>
<li><a href="#trunkSourceWebCorecssWebKitCSSMatrixcpp">trunk/Source/WebCore/css/WebKitCSSMatrix.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParsercpp">trunk/Source/WebCore/css/parser/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserh">trunk/Source/WebCore/css/parser/CSSParser.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserFastPathscpp">trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserFastPathsh">trunk/Source/WebCore/css/parser/CSSParserFastPaths.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserImplcpp">trunk/Source/WebCore/css/parser/CSSParserImpl.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserImplh">trunk/Source/WebCore/css/parser/CSSParserImpl.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserTokenRangecpp">trunk/Source/WebCore/css/parser/CSSParserTokenRange.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserTokenRangeh">trunk/Source/WebCore/css/parser/CSSParserTokenRange.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParsercpp">trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSTokenizercpp">trunk/Source/WebCore/css/parser/CSSTokenizer.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSTokenizerh">trunk/Source/WebCore/css/parser/CSSTokenizer.h</a></li>
<li><a href="#trunkSourceWebCorecssparserMediaQueryParsercpp">trunk/Source/WebCore/css/parser/MediaQueryParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserMediaQueryParserh">trunk/Source/WebCore/css/parser/MediaQueryParser.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li>trunk/LayoutTests/fast/css/deferred-parsing/</li>
<li><a href="#trunkSourceWebCorecssparserCSSDeferredParsercpp">trunk/Source/WebCore/css/parser/CSSDeferredParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSDeferredParserh">trunk/Source/WebCore/css/parser/CSSDeferredParser.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/LayoutTests/ChangeLog        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -320,35 +320,6 @@
</span><span class="cx"> * fast/multicol/columns-on-body-expected.html: Added.
</span><span class="cx"> * fast/multicol/columns-on-body.html: Added.
</span><span class="cx">
</span><del>-2016-12-11 Dave Hyatt <hyatt@apple.com>
-
- [CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
- https://bugs.webkit.org/show_bug.cgi?id=165743
-
- Reviewed by Darin Adler.
-
- * fast/css/deferred-parsing: Added.
- * fast/css/deferred-parsing/dynamic-external-style-expected.txt: Added.
- * fast/css/deferred-parsing/dynamic-external-style.html: Added.
- * fast/css/deferred-parsing/dynamic-style-in-document-expected.txt: Added.
- * fast/css/deferred-parsing/dynamic-style-in-document.html: Added.
- * fast/css/deferred-parsing/hover-test-expected.txt: Added.
- * fast/css/deferred-parsing/hover-test.html: Added.
- * fast/css/deferred-parsing/keyframes-rule-expected.txt: Added.
- * fast/css/deferred-parsing/keyframes-rule.html: Added.
- * fast/css/deferred-parsing/media-print-expected.txt: Added.
- * fast/css/deferred-parsing/media-print.html: Added.
- * fast/css/deferred-parsing/nth-of-type-expected.txt: Added.
- * fast/css/deferred-parsing/nth-of-type.html: Added.
- * fast/css/deferred-parsing/resources: Added.
- * fast/css/deferred-parsing/resources/basic-sheet.css: Added.
- * fast/css/deferred-parsing/simple-external-style-expected.txt: Added.
- * fast/css/deferred-parsing/simple-external-style.html: Added.
- * fast/css/deferred-parsing/simple-style-in-document-expected.txt: Added.
- * fast/css/deferred-parsing/simple-style-in-document.html: Added.
- * fast/css/deferred-parsing/supports-rule-expected.txt: Added.
- * fast/css/deferred-parsing/supports-rule.html: Added.
-
</del><span class="cx"> 2016-12-09 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Autoplay isn't working in iPhone MediaDocuments
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -2755,6 +2755,3 @@
</span><span class="cx"> fast/selectors/040.html
</span><span class="cx">
</span><span class="cx"> webkit.org/b/165691 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html [ Pass Failure ]
</span><del>-
-# Hover test does not apply
-fast/css/deferred-parsing/hover-test.html [ Skip ]
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -1885,7 +1885,3 @@
</span><span class="cx"> imported/blink/imported/csswg-test/css-writing-modes-3/block-embed-001.html [ Pass ImageOnlyFailure ]
</span><span class="cx"> imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count.html [ Crash Pass ]
</span><span class="cx"> imported/mozilla/svg/text/clipPath-content.svg [ Pass ImageOnlyFailure ]
</span><del>-
-# Hover test does not apply
-fast/css/deferred-parsing/hover-test.html [ Skip ]
-
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -1919,7 +1919,3 @@
</span><span class="cx"> webkit.org/b/165165 [ Release ] http/tests/security/contentSecurityPolicy/1.1/scriptnonce-invalidnonce.html [ Pass Timeout ]
</span><span class="cx">
</span><span class="cx"> webkit.org/b/165344 [ Release ] http/tests/security/module-incorrect-mime-types.html [ Pass Timeout ]
</span><del>-
-# Hover test does not apply
-fast/css/deferred-parsing/hover-test.html [ Skip ]
-
</del></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -1370,7 +1370,6 @@
</span><span class="cx"> css/WebKitCSSViewportRule.cpp
</span><span class="cx">
</span><span class="cx"> css/parser/CSSAtRuleID.cpp
</span><del>- css/parser/CSSDeferredParser.cpp
</del><span class="cx"> css/parser/CSSParser.cpp
</span><span class="cx"> css/parser/CSSParserFastPaths.cpp
</span><span class="cx"> css/parser/CSSParserIdioms.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/ChangeLog        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -885,24 +885,6 @@
</span><span class="cx"> * html/shadow/MediaControlElements.cpp:
</span><span class="cx"> (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
</span><span class="cx">
</span><del>-2016-12-12 Dave Hyatt <hyatt@apple.com>
-
- [CSS Parser] MediaQueryParser should use Ref and not RefPtr
- https://bugs.webkit.org/show_bug.cgi?id=165771
-
- Reviewed by Simon Fraser.
-
- * css/MediaList.cpp:
- (WebCore::MediaQuerySet::create):
- * css/parser/CSSParserImpl.cpp:
- (WebCore::CSSParserImpl::consumeImportRule):
- (WebCore::CSSParserImpl::consumeMediaRule):
- * css/parser/MediaQueryParser.cpp:
- (WebCore::MediaQueryParser::parseMediaQuerySet):
- (WebCore::MediaQueryParser::parseMediaCondition):
- (WebCore::MediaQueryParser::parseInternal):
- * css/parser/MediaQueryParser.h:
-
</del><span class="cx"> 2016-12-12 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> The CSS 'columns' property when set on the <body> element makes short columns
</span><span class="lines">@@ -925,259 +907,6 @@
</span><span class="cx"> * rendering/RenderBlockFlow.cpp:
</span><span class="cx"> (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
</span><span class="cx">
</span><del>-2016-12-11 Dave Hyatt <hyatt@apple.com>
-
- [CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
- https://bugs.webkit.org/show_bug.cgi?id=165743
-
- Reviewed by Darin Adler.
-
- Added new tests in fast/css/deferred-parsing.
-
- This patch implements deferred parsing in CSS. By default, when parsing
- author stylesheets, the parser goes into a deferred mode where it leaves
- the declaration block of all style rules unparsed initially. Instead of
- creating and setting an ImmutableStyleProperties object on the StyleRule,
- the parser creates a DeferredStyleProperties object instead that is
- capable of calling into CSSDeferredParser to parse the properties and values
- only when the properties are finally asked for.
-
- In addition, this patch defers the parsing of the interior of @media,
- @supports, and @keyframes rules. @media blocks that are never matched will
- never parse any of the rules inside. @supports conditions for unsupported
- features will also not be parsed. For @keyframes, if the animation is never
- referenced/used, then the @keyframes child rules will never be parsed.
-
- * CMakeLists.txt:
- * WebCore.xcodeproj/project.pbxproj:
- Add CSSDeferredParser to the build.
-
- * css/CSSFontFaceSet.cpp:
- (WebCore::CSSFontFaceSet::matchingFaces):
- Patched to drop the StyleSheetContents* argument from parseValue, since it
- is no longer needed.
-
- * css/CSSKeyframesRule.cpp:
- (WebCore::StyleRuleKeyframes::StyleRuleKeyframes):
- (WebCore::StyleRuleKeyframes::parseDeferredRulesIfNeeded):
- (WebCore::StyleRuleKeyframes::keyframes):
- (WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
- (WebCore::StyleRuleKeyframes::wrapperRemoveKeyframe):
- (WebCore::StyleRuleKeyframes::findKeyframeIndex):
- * css/CSSKeyframesRule.h:
- Keyframes now hold both a keyframes Vector and a DeferredStyleGroupRuleList
- object. The keyframes vector won't be populated until it is needed, and the
- population is done by DeferredStyleGroupRuleList, which holds both the original
- CSSParserTokenRange of the keyframes rule interior, and a references to the
- CSSDeferredParser that will do the parsing.
-
- * css/DOMCSSNamespace.cpp:
- (WebCore::DOMCSSNamespace::supports):
- Patched to drop the StyleSheetContents* argument from parseValue, since it
- is no longer needed.
-
- * css/ElementRuleCollector.cpp:
- (WebCore::ElementRuleCollector::collectMatchingRulesForList):
- ElementRuleCollector tests to see if a rule is empty by counting properties(),
- but we don't want to initiate deferred parsing just to check this. Instead we
- invoke propertiesWithoutDeferredParsing, which will hand back a nullptr if
- the properties haven't been parsed yet. In order to ensure this optimization
- continues to work, any rules whose interiors consist of only whitespace do
- not get deferred.
-
- * css/FontFace.cpp:
- (WebCore::FontFace::setVariant):
- * css/PropertySetCSSStyleDeclaration.cpp:
- (WebCore::PropertySetCSSStyleDeclaration::setProperty):
- (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
- Patched to drop the StyleSheetContents* argument from parseValue, since it
- is no longer needed.
-
- * css/StyleProperties.cpp:
- (WebCore::MutableStyleProperties::MutableStyleProperties):
- (WebCore::MutableStyleProperties::setProperty):
- (WebCore::DeferredStyleProperties::create):
- (WebCore::DeferredStyleProperties::DeferredStyleProperties):
- (WebCore::DeferredStyleProperties::~DeferredStyleProperties):
- (WebCore::DeferredStyleProperties::parseDeferredProperties):
- * css/StyleProperties.h:
- (WebCore::StylePropertiesBase::type):
- (WebCore::StylePropertiesBase::cssParserMode):
- (WebCore::StylePropertiesBase::StylePropertiesBase):
- (WebCore::StyleProperties::isMutable):
- (WebCore::StyleProperties::StyleProperties):
- (WebCore::StylePropertiesBase::deref):
- (isType):
- (WebCore::StyleProperties::cssParserMode): Deleted.
- (WebCore::StyleProperties::deref): Deleted.
- Right now StyleProperties has two subclasses, ImmutableStyleProperties (which
- is created by the parser when not deferring), and MutableStyleProperties (used
- when making changes and doing DOM Manipulations).
-
- This patch adds a new base class called StylePropertiesBase, and StyleProperties
- now derives from it. DeferredStyleProperties derives from this base. The members
- of StyleProperties have been moved up into StylePropertiesBase.
-
- The m_isMutable bit, used to determine the type for downcasting has been enhanced
- to m_type (2 bits), since there are now three possible subclasses.
-
- * css/StyleRule.cpp:
- (WebCore::StyleRule::StyleRule):
- (WebCore::StyleRule::properties):
- (WebCore::StyleRule::mutableProperties):
- (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
- Patched to ensure that when properties() are accessed, that if the current
- stored StylePropertyBase in the rule is a DeferredStyleProperties, we then
- parse and replace DeferredStyleProperties with ImmutableStyleProperties on the
- rule. By using a common base class, we avoid increasing memory usage in
- StyleRule.
-
- (WebCore::DeferredStyleGroupRuleList::create):
- (WebCore::DeferredStyleGroupRuleList::DeferredStyleGroupRuleList):
- (WebCore::DeferredStyleGroupRuleList::parseDeferredRules):
- (WebCore::DeferredStyleGroupRuleList::parseDeferredKeyframes):
- DeferredStyleGroupList is used to handle deferred parsing of objects with
- child rules. These include @media, @supports and @keyframes.
-
- (WebCore::StyleRuleGroup::StyleRuleGroup):
- (WebCore::StyleRuleGroup::childRules):
- (WebCore::StyleRuleGroup::wrapperInsertRule):
- (WebCore::StyleRuleGroup::wrapperRemoveRule):
- (WebCore::StyleRuleGroup::parseDeferredRulesIfNeeded):
- (WebCore::StyleRuleMedia::StyleRuleMedia):
- (WebCore::StyleRuleSupports::StyleRuleSupports):
- StyleRuleGroup now holds both a child rules Vector and a
- DeferredStyleGroupRuleList. If DeferredStyleGroupRuleList is set, then
- when the childRules are finally accessed, we will populate the childRules
- Vector and then null out the DeferredStyleGroupRuleList.
-
- * css/StyleRule.h:
- (WebCore::StyleRule::propertiesWithoutDeferredParsing):
- (WebCore::StyleRuleGroup::childRulesWithoutDeferredParsing):
- (WebCore::StyleRuleGroup::childRules): Deleted.
- Add new accesors for fetching properties and child rules without causing
- deferred parsing to happen.
-
- * css/StyleSheetContents.cpp:
- (WebCore::StyleSheetContents::parseAuthorStyleSheet):
- (WebCore::StyleSheetContents::parseString):
- Patched to turn on deferred parsing for author sheets and for all
- non-UA stylesheets parsed from a string (e.g., <style>).
-
- (WebCore::traverseSubresourcesInRules):
- The broken resource check was aggressively accessing properties(). Patch
- it to call propertiesWithoutDeferredParsing() instead so that it doesn't
- defeat the new optimization.
-
- * css/WebKitCSSMatrix.cpp:
- (WebCore::WebKitCSSMatrix::setMatrixValue):
- Patched to drop the StyleSheetContents* argument from parseValue, since it
- is no longer needed.
-
- * css/parser/CSSDeferredParser.cpp: Added.
- (WebCore::CSSDeferredParser::CSSDeferredParser):
- (WebCore::CSSDeferredParser::parseDeclaration):
- (WebCore::CSSDeferredParser::parseRuleList):
- (WebCore::CSSDeferredParser::parseKeyframeList):
- * css/parser/CSSDeferredParser.h: Added.
- (WebCore::CSSDeferredParser::create):
- (WebCore::CSSDeferredParser::tokenizer):
- (WebCore::CSSDeferredParser::mode):
- (WebCore::CSSDeferredParser::context):
- (WebCore::CSSDeferredParser::styleSheet):
- The CSSDeferredParser. It caches the original CSSTokenizer used to parse
- the sheet, which in turn retains all the tokens and escaped strings. Because
- the CSSDeferredParser is referenced by all the rules that have yet to parse,
- it will stay alive until all rules in the stylesheet has been fully parsed.
-
- The parser receives CSSParserTokenRanges from DeferredStyleProperties or
- DeferredStyleGroupRuleList and feeds them to CSSParserImpl, which then
- is able to do the parsing as it would have occurred originally had the
- range not been deferred.
-
- * css/parser/CSSParser.cpp:
- (WebCore::CSSParser::parseSheet):
- (WebCore::CSSParser::parseSupportsCondition):
- (WebCore::CSSParser::parseSingleValue):
- (WebCore::CSSParser::parseValue):
- * css/parser/CSSParser.h:
- * css/parser/CSSParserFastPaths.cpp:
- (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
- (WebCore::parseKeywordValue):
- (WebCore::CSSParserFastPaths::maybeParseValue):
- * css/parser/CSSParserFastPaths.h:
- Drop the StyleSheetContents* argument from the methods that no longer need
- them.
-
- * css/parser/CSSParserImpl.cpp:
- (WebCore::CSSParserImpl::CSSParserImpl):
- (WebCore::CSSParserImpl::tokenizer):
- (WebCore::CSSParserImpl::parseValue):
- (WebCore::CSSParserImpl::parseCustomPropertyValue):
- (WebCore::CSSParserImpl::parseDeclarationList):
- (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
- (WebCore::CSSParserImpl::parseRule):
- (WebCore::CSSParserImpl::parseStyleSheet):
- (WebCore::CSSParserImpl::parseDeclarationListForInspector):
- (WebCore::CSSParserImpl::parseStyleSheetForInspector):
- (WebCore::CSSParserImpl::consumeQualifiedRule):
- (WebCore::CSSParserImpl::consumeMediaRule):
- (WebCore::CSSParserImpl::consumeSupportsRule):
- (WebCore::CSSParserImpl::consumeKeyframesRule):
- (WebCore::CSSParserImpl::consumeStyleRule):
- Drop the StyleSheetContents* argument from the methods that no longer need
- them.
-
- (WebCore::CSSParserImpl::createDeferredStyleProperties):
- (WebCore::CSSParserImpl::parseDeferredDeclaration):
- (WebCore::CSSParserImpl::parseDeferredRuleList):
- (WebCore::CSSParserImpl::parseDeferredKeyframeList):
- The methods that handle deferred parsing. They make sure to initialize
- new CSSParserImpls with the original deferred parser, and then call existing
- methods to do the parsing.
-
- * css/parser/CSSParserImpl.h:
- Patched to remove StyleSheetContents* arguments from some methods and
- to add the new deferred parsing methods.
-
- * css/parser/CSSParserTokenRange.cpp:
- (WebCore::CSSParserTokenRange::consumeBlockCheckingForEditability):
- * css/parser/CSSParserTokenRange.h:
- In order to preserve the editability optimization from r180867, when
- a style rule's block is consumed, we use a special method that looks
- for -webkit-user-modify tokens. If one is seen, then the editability
- optimization is turned off. Because we do this at the token level,
- the optimization keeps working even if properties don't get parsed.
-
- * css/parser/CSSPropertyParser.cpp:
- (WebCore::CSSPropertyParser::parseSingleValue):
- (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
- (WebCore::CSSPropertyParser::consumeFont):
- (WebCore::CSSPropertyParser::parseShorthand):
- Patched to remove StyleSheetContents* arguments now that the editability
- check is in CSSTokenizer instead.
-
- * css/parser/CSSTokenizer.cpp:
- (WebCore::CSSTokenizer::tokenRange):
- * css/parser/CSSTokenizer.h:
- Make tokenRange() const.
-
- * html/canvas/CanvasRenderingContext2D.cpp:
- (WebCore::CanvasRenderingContext2D::setFont):
- Patched to drop the StyleSheetContents* argument.
-
- * testing/Internals.cpp:
- (WebCore::deferredStyleRulesCountForList):
- (WebCore::Internals::deferredStyleRulesCount):
- (WebCore::deferredGroupRulesCountForList):
- (WebCore::Internals::deferredGroupRulesCount):
- (WebCore::deferredKeyframesRulesCountForList):
- (WebCore::Internals::deferredKeyframesRulesCount):
- * testing/Internals.h:
- * testing/Internals.idl:
- Add new testing methods that can count the deferred style rules and
- group child rule lists. These methods are used by the new layout tests.
-
</del><span class="cx"> 2016-12-09 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Autoplay isn't working in iPhone MediaDocuments
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -3507,8 +3507,6 @@
</span><span class="cx">                 9444CBE81D8861C20073A074 /* CSSVariableData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBDD1D8861580073A074 /* CSSVariableData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 9444CBE91D8861CA0073A074 /* CSSVariableReferenceValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9444CBDC1D8861580073A074 /* CSSVariableReferenceValue.cpp */; };
</span><span class="cx">                 9444CBEA1D8861CA0073A074 /* CSSVariableReferenceValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBDB1D8861580073A074 /* CSSVariableReferenceValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                94476BDA1DFCAC0300690E23 /* CSSDeferredParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94476BD81DFCA4A700690E23 /* CSSDeferredParser.cpp */; };
-                94476BDB1DFCAC0300690E23 /* CSSDeferredParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 94476BD91DFCA4A700690E23 /* CSSDeferredParser.h */; };
</del><span class="cx">                 946D372D1D6CB2940077084F /* CSSParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946D37281D6CB28B0077084F /* CSSParser.cpp */; };
</span><span class="cx">                 946D372E1D6CB2940077084F /* CSSParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D37291D6CB28B0077084F /* CSSParser.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 946D372F1D6CB2940077084F /* CSSParserMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D372A1D6CB28B0077084F /* CSSParserMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -11066,8 +11064,6 @@
</span><span class="cx">                 9444CBDE1D8861580073A074 /* CSSVariableData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSVariableData.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 9444CBE11D8861580073A074 /* CSSCustomIdentValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSCustomIdentValue.h; sourceTree = "<group>"; };
</span><span class="cx">                 9444CBE21D8861580073A074 /* CSSCustomIdentValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSCustomIdentValue.cpp; sourceTree = "<group>"; };
</span><del>-                94476BD81DFCA4A700690E23 /* CSSDeferredParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSDeferredParser.cpp; path = parser/CSSDeferredParser.cpp; sourceTree = "<group>"; };
-                94476BD91DFCA4A700690E23 /* CSSDeferredParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSDeferredParser.h; path = parser/CSSDeferredParser.h; sourceTree = "<group>"; };
</del><span class="cx">                 946D37281D6CB28B0077084F /* CSSParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSParser.cpp; path = parser/CSSParser.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 946D37291D6CB28B0077084F /* CSSParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParser.h; path = parser/CSSParser.h; sourceTree = "<group>"; };
</span><span class="cx">                 946D372A1D6CB28B0077084F /* CSSParserMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParserMode.h; path = parser/CSSParserMode.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -19011,8 +19007,6 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 94DE5C7F1D7F39D000164F2A /* CSSAtRuleID.cpp */,
</span><span class="cx">                                 94DE5C801D7F39D000164F2A /* CSSAtRuleID.h */,
</span><del>-                                94476BD81DFCA4A700690E23 /* CSSDeferredParser.cpp */,
-                                94476BD91DFCA4A700690E23 /* CSSDeferredParser.h */,
</del><span class="cx">                                 946D37281D6CB28B0077084F /* CSSParser.cpp */,
</span><span class="cx">                                 946D37291D6CB28B0077084F /* CSSParser.h */,
</span><span class="cx">                                 949C76FE1D6E1D8C00C0DE4F /* CSSParserFastPaths.cpp */,
</span><span class="lines">@@ -27660,7 +27654,6 @@
</span><span class="cx">                                 832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */,
</span><span class="cx">                                 B22279930D00BF220071B782 /* SVGAnimateMotionElement.h in Headers */,
</span><span class="cx">                                 B22279950D00BF220071B782 /* SVGAnimateTransformElement.h in Headers */,
</span><del>-                                94476BDB1DFCAC0300690E23 /* CSSDeferredParser.h in Headers */,
</del><span class="cx">                                 B22279980D00BF220071B782 /* SVGAnimationElement.h in Headers */,
</span><span class="cx">                                 439D334513A6911C00C20F4F /* SVGAnimatorFactory.h in Headers */,
</span><span class="cx">                                 08FB3F8413BC754C0099FC18 /* SVGAttributeToPropertyMap.h in Headers */,
</span><span class="lines">@@ -30933,7 +30926,6 @@
</span><span class="cx">                                 99CC0B5718BE984A006CEBCC /* ReplayInputCreationMethods.cpp in Sources */,
</span><span class="cx">                                 99CC0B5818BE984A006CEBCC /* ReplayInputDispatchMethods.cpp in Sources */,
</span><span class="cx">                                 99CC0B5918BE984A006CEBCC /* ReplaySession.cpp in Sources */,
</span><del>-                                94476BDA1DFCAC0300690E23 /* CSSDeferredParser.cpp in Sources */,
</del><span class="cx">                                 99CC0B5B18BE984A006CEBCC /* ReplaySessionSegment.cpp in Sources */,
</span><span class="cx">                                 F55B3DCF1251F12D003EF269 /* ResetInputType.cpp in Sources */,
</span><span class="cx">                                 934F713E0D5A6F2800018D69 /* ResourceErrorBase.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFaceSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFaceSet.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSet.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/CSSFontFaceSet.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -328,7 +328,7 @@
</span><span class="cx"> ExceptionOr<Vector<std::reference_wrapper<CSSFontFace>>> CSSFontFaceSet::matchingFaces(const String& font, const String& string)
</span><span class="cx"> {
</span><span class="cx"> auto style = MutableStyleProperties::create();
</span><del>- auto parseResult = CSSParser::parseValue(style, CSSPropertyFont, font, true, HTMLStandardMode);
</del><ins>+ auto parseResult = CSSParser::parseValue(style, CSSPropertyFont, font, true, HTMLStandardMode, nullptr);
</ins><span class="cx"> if (parseResult == CSSParser::ParseResult::Error)
</span><span class="cx"> return Exception { SYNTAX_ERR };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSKeyframesRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSKeyframesRule.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSKeyframesRule.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/CSSKeyframesRule.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "CSSKeyframesRule.h"
</span><span class="cx">
</span><del>-#include "CSSDeferredParser.h"
</del><span class="cx"> #include "CSSKeyframeRule.h"
</span><span class="cx"> #include "CSSParser.h"
</span><span class="cx"> #include "CSSRuleList.h"
</span><span class="lines">@@ -38,20 +37,11 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-StyleRuleKeyframes::StyleRuleKeyframes(const AtomicString& name)
</del><ins>+StyleRuleKeyframes::StyleRuleKeyframes()
</ins><span class="cx"> : StyleRuleBase(Keyframes)
</span><del>- , m_name(name)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-StyleRuleKeyframes::StyleRuleKeyframes(const AtomicString& name, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredRules)
- : StyleRuleBase(Keyframes)
- , m_name(name)
- , m_deferredRules(WTFMove(deferredRules))
-{
-
-}
-
</del><span class="cx"> StyleRuleKeyframes::StyleRuleKeyframes(const StyleRuleKeyframes& o)
</span><span class="cx"> : StyleRuleBase(o)
</span><span class="cx"> , m_name(o.m_name)
</span><span class="lines">@@ -65,21 +55,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void StyleRuleKeyframes::parseDeferredRulesIfNeeded() const
-{
- if (!m_deferredRules)
- return;
-
- m_deferredRules->parseDeferredKeyframes(const_cast<StyleRuleKeyframes&>(*this));
- m_deferredRules = nullptr;
-}
-
-const Vector<Ref<StyleKeyframe>>& StyleRuleKeyframes::keyframes() const
-{
- parseDeferredRulesIfNeeded();
- return m_keyframes;
-}
-
</del><span class="cx"> void StyleRuleKeyframes::parserAppendKeyframe(RefPtr<StyleKeyframe>&& keyframe)
</span><span class="cx"> {
</span><span class="cx"> if (!keyframe)
</span><span class="lines">@@ -89,20 +64,16 @@
</span><span class="cx">
</span><span class="cx"> void StyleRuleKeyframes::wrapperAppendKeyframe(Ref<StyleKeyframe>&& keyframe)
</span><span class="cx"> {
</span><del>- parseDeferredRulesIfNeeded();
</del><span class="cx"> m_keyframes.append(WTFMove(keyframe));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index)
</span><span class="cx"> {
</span><del>- parseDeferredRulesIfNeeded();
</del><span class="cx"> m_keyframes.remove(index);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> size_t StyleRuleKeyframes::findKeyframeIndex(const String& key) const
</span><span class="cx"> {
</span><del>- parseDeferredRulesIfNeeded();
-
</del><span class="cx"> auto keys = CSSParser::parseKeyframeKeyList(key);
</span><span class="cx">
</span><span class="cx"> for (size_t i = m_keyframes.size(); i--; ) {
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSKeyframesRuleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSKeyframesRule.h (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSKeyframesRule.h        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/CSSKeyframesRule.h        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -39,17 +39,12 @@
</span><span class="cx">
</span><span class="cx"> class StyleRuleKeyframes final : public StyleRuleBase {
</span><span class="cx"> public:
</span><del>- static Ref<StyleRuleKeyframes> create(const AtomicString& name) { return adoptRef(*new StyleRuleKeyframes(name)); }
- static Ref<StyleRuleKeyframes> create(const AtomicString& name, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredRules) { return adoptRef(*new StyleRuleKeyframes(name, WTFMove(deferredRules))); }
</del><ins>+ static Ref<StyleRuleKeyframes> create() { return adoptRef(*new StyleRuleKeyframes()); }
</ins><span class="cx">
</span><span class="cx"> ~StyleRuleKeyframes();
</span><span class="cx">
</span><del>- const Vector<Ref<StyleKeyframe>>& keyframes() const;
- const Vector<Ref<StyleKeyframe>>* keyframesWithoutDeferredParsing() const
- {
- return !m_deferredRules ? &m_keyframes : nullptr;
- }
-
</del><ins>+ const Vector<Ref<StyleKeyframe>>& keyframes() const { return m_keyframes; }
+
</ins><span class="cx"> void parserAppendKeyframe(RefPtr<StyleKeyframe>&&);
</span><span class="cx"> void wrapperAppendKeyframe(Ref<StyleKeyframe>&&);
</span><span class="cx"> void wrapperRemoveKeyframe(unsigned);
</span><span class="lines">@@ -56,22 +51,17 @@
</span><span class="cx">
</span><span class="cx"> const AtomicString& name() const { return m_name; }
</span><span class="cx"> void setName(const AtomicString& name) { m_name = name; }
</span><del>-
</del><ins>+
</ins><span class="cx"> size_t findKeyframeIndex(const String& key) const;
</span><span class="cx">
</span><span class="cx"> Ref<StyleRuleKeyframes> copy() const { return adoptRef(*new StyleRuleKeyframes(*this)); }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- StyleRuleKeyframes(const AtomicString&);
- StyleRuleKeyframes(const AtomicString&, std::unique_ptr<DeferredStyleGroupRuleList>&&);
</del><ins>+ StyleRuleKeyframes();
</ins><span class="cx"> StyleRuleKeyframes(const StyleRuleKeyframes&);
</span><span class="cx">
</span><del>- void parseDeferredRulesIfNeeded() const;
-
- mutable Vector<Ref<StyleKeyframe>> m_keyframes;
</del><ins>+ Vector<Ref<StyleKeyframe>> m_keyframes;
</ins><span class="cx"> AtomicString m_name;
</span><del>-
- mutable std::unique_ptr<DeferredStyleGroupRuleList> m_deferredRules;
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class CSSKeyframesRule final : public CSSRule {
</span></span></pre></div>
<a id="trunkSourceWebCorecssDOMCSSNamespacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DOMCSSNamespace.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DOMCSSNamespace.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/DOMCSSNamespace.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> auto dummyStyle = MutableStyleProperties::create();
</span><del>- return CSSParser::parseValue(dummyStyle, propertyID, normalizedValue, false, document) != CSSParser::ParseResult::Error;
</del><ins>+ return CSSParser::parseValue(dummyStyle, propertyID, normalizedValue, false, document, nullptr) != CSSParser::ParseResult::Error;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool DOMCSSNamespace::supports(Document& document, const String& conditionText)
</span></span></pre></div>
<a id="trunkSourceWebCorecssElementRuleCollectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/ElementRuleCollector.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/ElementRuleCollector.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/ElementRuleCollector.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -484,10 +484,8 @@
</span><span class="cx"> StyleRule* rule = ruleData.rule();
</span><span class="cx">
</span><span class="cx"> // If the rule has no properties to apply, then ignore it in the non-debug mode.
</span><del>- // Note that if we get null back here, it means we have a rule with deferred properties,
- // and that means we always have to consider it.
- const StyleProperties* properties = rule->propertiesWithoutDeferredParsing();
- if (properties && properties->isEmpty() && !matchRequest.includeEmptyRules)
</del><ins>+ const StyleProperties& properties = rule->properties();
+ if (properties.isEmpty() && !matchRequest.includeEmptyRules)
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> // FIXME: Exposing the non-standard getMatchedCSSRules API to web is the only reason this is needed.
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFace.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFace.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/FontFace.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx"> return Exception { SYNTAX_ERR };
</span><span class="cx">
</span><span class="cx"> auto style = MutableStyleProperties::create();
</span><del>- auto result = CSSParser::parseValue(style, CSSPropertyFontVariant, variant, true, HTMLStandardMode);
</del><ins>+ auto result = CSSParser::parseValue(style, CSSPropertyFontVariant, variant, true, HTMLStandardMode, nullptr);
</ins><span class="cx"> if (result == CSSParser::ParseResult::Error)
</span><span class="cx"> return Exception { SYNTAX_ERR };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaList.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaList.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/MediaList.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx"> if (mediaString.isEmpty())
</span><span class="cx"> return MediaQuerySet::create();
</span><span class="cx">
</span><del>- return MediaQueryParser::parseMediaQuerySet(mediaString);
</del><ins>+ return MediaQueryParser::parseMediaQuerySet(mediaString).releaseNonNull();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MediaQuerySet::MediaQuerySet()
</span></span></pre></div>
<a id="trunkSourceWebCorecssPropertySetCSSStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -249,7 +249,7 @@
</span><span class="cx"> if (propertyID == CSSPropertyCustom)
</span><span class="cx"> changed = m_propertySet->setCustomProperty(propertyName, value, important, cssParserContext());
</span><span class="cx"> else
</span><del>- changed = m_propertySet->setProperty(propertyID, value, important, cssParserContext());
</del><ins>+ changed = m_propertySet->setProperty(propertyID, value, important, cssParserContext(), contextStyleSheet());
</ins><span class="cx">
</span><span class="cx"> didMutate(changed ? PropertyChanged : NoChanges);
</span><span class="cx">
</span><span class="lines">@@ -304,7 +304,7 @@
</span><span class="cx"> if (!willMutate())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- bool changed = m_propertySet->setProperty(propertyID, value, important, cssParserContext());
</del><ins>+ bool changed = m_propertySet->setProperty(propertyID, value, important, cssParserContext(), contextStyleSheet());
</ins><span class="cx">
</span><span class="cx"> didMutate(changed ? PropertyChanged : NoChanges);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleProperties.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleProperties.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/StyleProperties.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx">
</span><span class="cx"> #include "CSSComputedStyleDeclaration.h"
</span><span class="cx"> #include "CSSCustomPropertyValue.h"
</span><del>-#include "CSSDeferredParser.h"
</del><span class="cx"> #include "CSSParser.h"
</span><span class="cx"> #include "CSSPendingSubstitutionValue.h"
</span><span class="cx"> #include "CSSValueKeywords.h"
</span><span class="lines">@@ -72,12 +71,12 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MutableStyleProperties::MutableStyleProperties(CSSParserMode cssParserMode)
</span><del>- : StyleProperties(cssParserMode, MutablePropertiesType)
</del><ins>+ : StyleProperties(cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MutableStyleProperties::MutableStyleProperties(const CSSProperty* properties, unsigned length)
</span><del>- : StyleProperties(HTMLStandardMode, MutablePropertiesType)
</del><ins>+ : StyleProperties(HTMLStandardMode)
</ins><span class="cx"> {
</span><span class="cx"> m_propertyVector.reserveInitialCapacity(length);
</span><span class="cx"> for (unsigned i = 0; i < length; ++i)
</span><span class="lines">@@ -108,9 +107,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MutableStyleProperties::MutableStyleProperties(const StyleProperties& other)
</span><del>- : StyleProperties(other.cssParserMode(), MutablePropertiesType)
</del><ins>+ : StyleProperties(other.cssParserMode())
</ins><span class="cx"> {
</span><del>- ASSERT(other.type() != DeferredPropertiesType);
</del><span class="cx"> if (is<MutableStyleProperties>(other))
</span><span class="cx"> m_propertyVector = downcast<MutableStyleProperties>(other).m_propertyVector;
</span><span class="cx"> else {
</span><span class="lines">@@ -721,7 +719,7 @@
</span><span class="cx"> return propertyAt(foundPropertyIndex).isImplicit();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool MutableStyleProperties::setProperty(CSSPropertyID propertyID, const String& value, bool important, CSSParserContext parserContext)
</del><ins>+bool MutableStyleProperties::setProperty(CSSPropertyID propertyID, const String& value, bool important, CSSParserContext parserContext, StyleSheetContents* contextStyleSheet)
</ins><span class="cx"> {
</span><span class="cx"> // Setting the value to an empty string just removes the property in both IE and Gecko.
</span><span class="cx"> // Setting it to null seems to produce less consistent results, but we treat it just the same.
</span><span class="lines">@@ -732,7 +730,7 @@
</span><span class="cx">
</span><span class="cx"> // When replacing an existing property value, this moves the property to the end of the list.
</span><span class="cx"> // Firefox preserves the position, and MSIE moves the property to the beginning.
</span><del>- return CSSParser::parseValue(*this, propertyID, value, important, parserContext) == CSSParser::ParseResult::Changed;
</del><ins>+ return CSSParser::parseValue(*this, propertyID, value, important, parserContext, contextStyleSheet) == CSSParser::ParseResult::Changed;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MutableStyleProperties::setProperty(CSSPropertyID propertyID, const String& value, bool important)
</span><span class="lines">@@ -1363,26 +1361,6 @@
</span><span class="cx"> result.append(';');
</span><span class="cx"> return result.toString();
</span><span class="cx"> }
</span><del>-
-Ref<DeferredStyleProperties> DeferredStyleProperties::create(const CSSParserTokenRange& tokenRange, CSSDeferredParser& parser)
-{
- return adoptRef(*new DeferredStyleProperties(tokenRange, parser));
-}
</del><span class="cx">
</span><del>-DeferredStyleProperties::DeferredStyleProperties(const CSSParserTokenRange& tokenRange, CSSDeferredParser& parser)
- : StylePropertiesBase(parser.mode(), DeferredPropertiesType)
- , m_range(tokenRange)
- , m_parser(parser)
-{
-}
-
-DeferredStyleProperties::~DeferredStyleProperties()
-{
-}
</del><span class="cx">
</span><del>-Ref<ImmutableStyleProperties> DeferredStyleProperties::parseDeferredProperties()
-{
- return m_parser->parseDeclaration(m_range);
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleProperties.h (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleProperties.h        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/StyleProperties.h        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -22,7 +22,6 @@
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><span class="cx"> #include "CSSParserMode.h"
</span><del>-#include "CSSParserTokenRange.h"
</del><span class="cx"> #include "CSSProperty.h"
</span><span class="cx"> #include "CSSValueKeywords.h"
</span><span class="cx"> #include <memory>
</span><span class="lines">@@ -33,7 +32,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class CSSDeferredParser;
</del><span class="cx"> class CSSStyleDeclaration;
</span><span class="cx"> class CachedResource;
</span><span class="cx"> class ImmutableStyleProperties;
</span><span class="lines">@@ -44,39 +42,13 @@
</span><span class="cx"> class StylePropertyShorthand;
</span><span class="cx"> class StyleSheetContents;
</span><span class="cx">
</span><del>-enum StylePropertiesType { ImmutablePropertiesType, MutablePropertiesType, DeferredPropertiesType };
-
-class StylePropertiesBase : public RefCounted<StylePropertiesBase> {
</del><ins>+class StyleProperties : public RefCounted<StyleProperties> {
+ friend class PropertyReference;
</ins><span class="cx"> public:
</span><span class="cx"> // Override RefCounted's deref() to ensure operator delete is called on
</span><span class="cx"> // the appropriate subclass type.
</span><span class="cx"> void deref();
</span><del>-
- StylePropertiesType type() const { return static_cast<StylePropertiesType>(m_type); }
</del><span class="cx">
</span><del>- CSSParserMode cssParserMode() const { return static_cast<CSSParserMode>(m_cssParserMode); }
-
-protected:
- StylePropertiesBase(CSSParserMode cssParserMode, StylePropertiesType type)
- : m_cssParserMode(cssParserMode)
- , m_type(type)
- , m_arraySize(0)
- { }
-
- StylePropertiesBase(CSSParserMode cssParserMode, unsigned immutableArraySize)
- : m_cssParserMode(cssParserMode)
- , m_type(ImmutablePropertiesType)
- , m_arraySize(immutableArraySize)
- { }
-
- unsigned m_cssParserMode : 3;
- mutable unsigned m_type : 2;
- unsigned m_arraySize : 27;
-};
-
-class StyleProperties : public StylePropertiesBase {
- friend class PropertyReference;
-public:
</del><span class="cx"> class PropertyReference {
</span><span class="cx"> public:
</span><span class="cx"> PropertyReference(const StylePropertyMetadata& metadata, const CSSValue* value)
</span><span class="lines">@@ -122,6 +94,8 @@
</span><span class="cx">
</span><span class="cx"> Ref<MutableStyleProperties> copyBlockProperties() const;
</span><span class="cx">
</span><ins>+ CSSParserMode cssParserMode() const { return static_cast<CSSParserMode>(m_cssParserMode); }
+
</ins><span class="cx"> WEBCORE_EXPORT Ref<MutableStyleProperties> mutableCopy() const;
</span><span class="cx"> Ref<ImmutableStyleProperties> immutableCopyIfNeeded() const;
</span><span class="cx">
</span><span class="lines">@@ -129,8 +103,8 @@
</span><span class="cx">
</span><span class="cx"> String asText() const;
</span><span class="cx">
</span><ins>+ bool isMutable() const { return m_isMutable; }
</ins><span class="cx"> bool hasCSSOMWrapper() const;
</span><del>- bool isMutable() const { return type() == MutablePropertiesType; }
</del><span class="cx">
</span><span class="cx"> bool traverseSubresources(const std::function<bool (const CachedResource&)>& handler) const;
</span><span class="cx">
</span><span class="lines">@@ -143,17 +117,25 @@
</span><span class="cx"> bool propertyMatches(CSSPropertyID, const CSSValue*) const;
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- StyleProperties(CSSParserMode cssParserMode, StylePropertiesType type)
- : StylePropertiesBase(cssParserMode, type)
</del><ins>+ StyleProperties(CSSParserMode cssParserMode)
+ : m_cssParserMode(cssParserMode)
+ , m_isMutable(true)
+ , m_arraySize(0)
</ins><span class="cx"> { }
</span><span class="cx">
</span><span class="cx"> StyleProperties(CSSParserMode cssParserMode, unsigned immutableArraySize)
</span><del>- : StylePropertiesBase(cssParserMode, immutableArraySize)
</del><ins>+ : m_cssParserMode(cssParserMode)
+ , m_isMutable(false)
+ , m_arraySize(immutableArraySize)
</ins><span class="cx"> { }
</span><span class="cx">
</span><span class="cx"> int findPropertyIndex(CSSPropertyID) const;
</span><span class="cx"> int findCustomPropertyIndex(const String& propertyName) const;
</span><del>-
</del><ins>+
+ unsigned m_cssParserMode : 3;
+ mutable unsigned m_isMutable : 1;
+ unsigned m_arraySize : 28;
+
</ins><span class="cx"> private:
</span><span class="cx"> String getShorthandValue(const StylePropertyShorthand&) const;
</span><span class="cx"> String getCommonValue(const StylePropertyShorthand&) const;
</span><span class="lines">@@ -217,7 +199,7 @@
</span><span class="cx"> bool addParsedProperty(const CSSProperty&);
</span><span class="cx">
</span><span class="cx"> // These expand shorthand properties into multiple properties.
</span><del>- bool setProperty(CSSPropertyID, const String& value, bool important, CSSParserContext);
</del><ins>+ bool setProperty(CSSPropertyID, const String& value, bool important, CSSParserContext, StyleSheetContents* = nullptr);
</ins><span class="cx"> bool setProperty(CSSPropertyID, const String& value, bool important = false);
</span><span class="cx"> void setProperty(CSSPropertyID, RefPtr<CSSValue>&&, bool important = false);
</span><span class="cx">
</span><span class="lines">@@ -260,20 +242,6 @@
</span><span class="cx"> friend class StyleProperties;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-class DeferredStyleProperties final : public StylePropertiesBase {
-public:
- WEBCORE_EXPORT ~DeferredStyleProperties();
- static Ref<DeferredStyleProperties> create(const CSSParserTokenRange&, CSSDeferredParser&);
-
- Ref<ImmutableStyleProperties> parseDeferredProperties();
-
-private:
- DeferredStyleProperties(const CSSParserTokenRange&, CSSDeferredParser&);
-
- CSSParserTokenRange m_range;
- Ref<CSSDeferredParser> m_parser;
-};
-
</del><span class="cx"> inline ImmutableStyleProperties::PropertyReference ImmutableStyleProperties::propertyAt(unsigned index) const
</span><span class="cx"> {
</span><span class="cx"> return PropertyReference(metadataArray()[index], valueArray()[index]);
</span><span class="lines">@@ -299,7 +267,7 @@
</span><span class="cx"> return downcast<ImmutableStyleProperties>(*this).propertyCount();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void StylePropertiesBase::deref()
</del><ins>+inline void StyleProperties::deref()
</ins><span class="cx"> {
</span><span class="cx"> if (!derefBase())
</span><span class="cx"> return;
</span><span class="lines">@@ -306,10 +274,8 @@
</span><span class="cx">
</span><span class="cx"> if (is<MutableStyleProperties>(*this))
</span><span class="cx"> delete downcast<MutableStyleProperties>(this);
</span><del>- else if (is<ImmutableStyleProperties>(*this))
</del><ins>+ else
</ins><span class="cx"> delete downcast<ImmutableStyleProperties>(this);
</span><del>- else
- delete downcast<DeferredStyleProperties>(this);
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline int StyleProperties::findPropertyIndex(CSSPropertyID propertyID) const
</span><span class="lines">@@ -328,18 +294,10 @@
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><del>-SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleProperties)
- static bool isType(const WebCore::StylePropertiesBase& set) { return set.type() != WebCore::DeferredPropertiesType; }
-SPECIALIZE_TYPE_TRAITS_END()
-
</del><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::MutableStyleProperties)
</span><del>- static bool isType(const WebCore::StylePropertiesBase& set) { return set.type() == WebCore::MutablePropertiesType; }
</del><ins>+ static bool isType(const WebCore::StyleProperties& set) { return set.isMutable(); }
</ins><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ImmutableStyleProperties)
</span><del>- static bool isType(const WebCore::StylePropertiesBase& set) { return set.type() == WebCore::ImmutablePropertiesType; }
</del><ins>+ static bool isType(const WebCore::StyleProperties& set) { return !set.isMutable(); }
</ins><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><del>-
-SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::DeferredStyleProperties)
- static bool isType(const WebCore::StylePropertiesBase& set) { return set.type() == WebCore::DeferredPropertiesType; }
-SPECIALIZE_TYPE_TRAITS_END()
</del></span></pre></div>
<a id="trunkSourceWebCorecssStyleRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleRule.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleRule.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/StyleRule.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -22,7 +22,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "StyleRule.h"
</span><span class="cx">
</span><del>-#include "CSSDeferredParser.h"
</del><span class="cx"> #include "CSSFontFaceRule.h"
</span><span class="cx"> #include "CSSImportRule.h"
</span><span class="cx"> #include "CSSKeyframeRule.h"
</span><span class="lines">@@ -208,7 +207,7 @@
</span><span class="cx"> return sizeof(StyleRule) + sizeof(CSSSelector) + StyleProperties::averageSizeInBytes();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-StyleRule::StyleRule(Ref<StylePropertiesBase>&& properties)
</del><ins>+StyleRule::StyleRule(Ref<StyleProperties>&& properties)
</ins><span class="cx"> : StyleRuleBase(Style)
</span><span class="cx"> , m_properties(WTFMove(properties))
</span><span class="cx"> {
</span><span class="lines">@@ -216,7 +215,7 @@
</span><span class="cx">
</span><span class="cx"> StyleRule::StyleRule(const StyleRule& o)
</span><span class="cx"> : StyleRuleBase(o)
</span><del>- , m_properties(o.properties().mutableCopy())
</del><ins>+ , m_properties(o.m_properties->mutableCopy())
</ins><span class="cx"> , m_selectorList(o.m_selectorList)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -225,17 +224,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const StyleProperties& StyleRule::properties() const
-{
- if (m_properties->type() == DeferredPropertiesType)
- m_properties = downcast<DeferredStyleProperties>(m_properties.get()).parseDeferredProperties();
- return downcast<StyleProperties>(m_properties.get());
-}
-
</del><span class="cx"> MutableStyleProperties& StyleRule::mutableProperties()
</span><span class="cx"> {
</span><span class="cx"> if (!is<MutableStyleProperties>(m_properties.get()))
</span><del>- m_properties = properties().mutableCopy();
</del><ins>+ m_properties = m_properties->mutableCopy();
</ins><span class="cx"> return downcast<MutableStyleProperties>(m_properties.get());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -264,7 +256,7 @@
</span><span class="cx"> componentsInThisSelector.append(component);
</span><span class="cx">
</span><span class="cx"> if (componentsInThisSelector.size() + componentsSinceLastSplit.size() > maxCount && !componentsSinceLastSplit.isEmpty()) {
</span><del>- rules.append(create(componentsSinceLastSplit, const_cast<StyleProperties&>(properties())));
</del><ins>+ rules.append(create(componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get())));
</ins><span class="cx"> componentsSinceLastSplit.clear();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -272,7 +264,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!componentsSinceLastSplit.isEmpty())
</span><del>- rules.append(create(componentsSinceLastSplit, const_cast<StyleProperties&>(properties())));
</del><ins>+ rules.append(create(componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get())));
</ins><span class="cx">
</span><span class="cx"> return rules;
</span><span class="cx"> }
</span><span class="lines">@@ -324,22 +316,6 @@
</span><span class="cx"> return downcast<MutableStyleProperties>(m_properties.get());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-DeferredStyleGroupRuleList::DeferredStyleGroupRuleList(const CSSParserTokenRange& range, CSSDeferredParser& parser)
- : m_range(range)
- , m_parser(parser)
-{
-}
-
-void DeferredStyleGroupRuleList::parseDeferredRules(Vector<RefPtr<StyleRuleBase>>& childRules)
-{
- m_parser->parseRuleList(m_range, childRules);
-}
-
-void DeferredStyleGroupRuleList::parseDeferredKeyframes(StyleRuleKeyframes& keyframesRule)
-{
- m_parser->parseKeyframeList(m_range, keyframesRule);
-}
-
</del><span class="cx"> StyleRuleGroup::StyleRuleGroup(Type type, Vector<RefPtr<StyleRuleBase>>& adoptRule)
</span><span class="cx"> : StyleRuleBase(type)
</span><span class="cx"> {
</span><span class="lines">@@ -346,47 +322,25 @@
</span><span class="cx"> m_childRules.swap(adoptRule);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-StyleRuleGroup::StyleRuleGroup(Type type, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredRules)
- : StyleRuleBase(type)
- , m_deferredRules(WTFMove(deferredRules))
-{
-}
-
</del><span class="cx"> StyleRuleGroup::StyleRuleGroup(const StyleRuleGroup& o)
</span><span class="cx"> : StyleRuleBase(o)
</span><span class="cx"> {
</span><del>- m_childRules.reserveInitialCapacity(o.childRules().size());
- for (auto& childRule : o.childRules())
</del><ins>+ m_childRules.reserveInitialCapacity(o.m_childRules.size());
+ for (auto& childRule : o.m_childRules)
</ins><span class="cx"> m_childRules.uncheckedAppend(childRule->copy());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const Vector<RefPtr<StyleRuleBase>>& StyleRuleGroup::childRules() const
-{
- parseDeferredRulesIfNeeded();
- return m_childRules;
-}
-
</del><span class="cx"> void StyleRuleGroup::wrapperInsertRule(unsigned index, Ref<StyleRuleBase>&& rule)
</span><span class="cx"> {
</span><del>- parseDeferredRulesIfNeeded();
</del><span class="cx"> m_childRules.insert(index, WTFMove(rule));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void StyleRuleGroup::wrapperRemoveRule(unsigned index)
</span><span class="cx"> {
</span><del>- parseDeferredRulesIfNeeded();
</del><span class="cx"> m_childRules.remove(index);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void StyleRuleGroup::parseDeferredRulesIfNeeded() const
-{
- if (!m_deferredRules)
- return;
-
- m_deferredRules->parseDeferredRules(m_childRules);
- m_deferredRules = nullptr;
-}
-
</del><ins>+
</ins><span class="cx"> StyleRuleMedia::StyleRuleMedia(Ref<MediaQuerySet>&& media, Vector<RefPtr<StyleRuleBase>>& adoptRules)
</span><span class="cx"> : StyleRuleGroup(Media, adoptRules)
</span><span class="cx"> , m_mediaQueries(WTFMove(media))
</span><span class="lines">@@ -393,12 +347,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-StyleRuleMedia::StyleRuleMedia(Ref<MediaQuerySet>&& media, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredRules)
- : StyleRuleGroup(Media, WTFMove(deferredRules))
- , m_mediaQueries(WTFMove(media))
-{
-}
-
</del><span class="cx"> StyleRuleMedia::StyleRuleMedia(const StyleRuleMedia& o)
</span><span class="cx"> : StyleRuleGroup(o)
</span><span class="cx"> {
</span><span class="lines">@@ -414,13 +362,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool conditionIsSupported, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredRules)
- : StyleRuleGroup(Supports, WTFMove(deferredRules))
- , m_conditionText(conditionText)
- , m_conditionIsSupported(conditionIsSupported)
-{
-}
-
</del><span class="cx"> StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o)
</span><span class="cx"> : StyleRuleGroup(o)
</span><span class="cx"> , m_conditionText(o.m_conditionText)
</span><span class="lines">@@ -439,7 +380,7 @@
</span><span class="cx"> , m_selectorList(WTFMove(selectors))
</span><span class="cx"> {
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> StyleRuleRegion::StyleRuleRegion(const StyleRuleRegion& o)
</span><span class="cx"> : StyleRuleGroup(o)
</span><span class="cx"> , m_selectorList(o.m_selectorList)
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleRuleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleRule.h (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleRule.h        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/StyleRule.h        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -35,8 +35,7 @@
</span><span class="cx"> class MutableStyleProperties;
</span><span class="cx"> class StyleKeyframe;
</span><span class="cx"> class StyleProperties;
</span><del>-class StyleRuleKeyframes;
-
</del><ins>+
</ins><span class="cx"> class StyleRuleBase : public WTF::RefCountedBase {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="lines">@@ -100,7 +99,7 @@
</span><span class="cx"> ~StyleRuleBase() { }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- WEBCORE_EXPORT void destroy();
</del><ins>+ void destroy();
</ins><span class="cx">
</span><span class="cx"> RefPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const;
</span><span class="cx">
</span><span class="lines">@@ -110,7 +109,7 @@
</span><span class="cx"> class StyleRule final : public StyleRuleBase {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- static Ref<StyleRule> create(Ref<StylePropertiesBase>&& properties)
</del><ins>+ static Ref<StyleRule> create(Ref<StyleProperties>&& properties)
</ins><span class="cx"> {
</span><span class="cx"> return adoptRef(*new StyleRule(WTFMove(properties)));
</span><span class="cx"> }
</span><span class="lines">@@ -118,11 +117,9 @@
</span><span class="cx"> ~StyleRule();
</span><span class="cx">
</span><span class="cx"> const CSSSelectorList& selectorList() const { return m_selectorList; }
</span><ins>+ const StyleProperties& properties() const { return m_properties; }
+ MutableStyleProperties& mutableProperties();
</ins><span class="cx">
</span><del>- const StyleProperties& properties() const;
- MutableStyleProperties& mutableProperties();
- const StyleProperties* propertiesWithoutDeferredParsing() const;
-
</del><span class="cx"> void parserAdoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(selectors); }
</span><span class="cx"> void wrapperAdoptSelectorList(CSSSelectorList& selectors) { m_selectorList = WTFMove(selectors); }
</span><span class="cx"> void parserAdoptSelectorArray(CSSSelector* selectors) { m_selectorList.adoptSelectorArray(selectors); }
</span><span class="lines">@@ -134,20 +131,15 @@
</span><span class="cx"> static unsigned averageSizeInBytes();
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- StyleRule(Ref<StylePropertiesBase>&&);
</del><ins>+ StyleRule(Ref<StyleProperties>&&);
</ins><span class="cx"> StyleRule(const StyleRule&);
</span><span class="cx">
</span><span class="cx"> static Ref<StyleRule> create(const Vector<const CSSSelector*>&, Ref<StyleProperties>&&);
</span><span class="cx">
</span><del>- mutable Ref<StylePropertiesBase> m_properties;
</del><ins>+ Ref<StyleProperties> m_properties;
</ins><span class="cx"> CSSSelectorList m_selectorList;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-inline const StyleProperties* StyleRule::propertiesWithoutDeferredParsing() const
-{
- return m_properties->type() != DeferredPropertiesType ? &downcast<StyleProperties>(m_properties.get()) : nullptr;
-}
-
</del><span class="cx"> class StyleRuleFontFace final : public StyleRuleBase {
</span><span class="cx"> public:
</span><span class="cx"> static Ref<StyleRuleFontFace> create(Ref<StyleProperties>&& properties) { return adoptRef(*new StyleRuleFontFace(WTFMove(properties))); }
</span><span class="lines">@@ -189,43 +181,21 @@
</span><span class="cx"> CSSSelectorList m_selectorList;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-class DeferredStyleGroupRuleList final {
</del><ins>+class StyleRuleGroup : public StyleRuleBase {
</ins><span class="cx"> public:
</span><del>- DeferredStyleGroupRuleList(const CSSParserTokenRange&, CSSDeferredParser&);
</del><ins>+ const Vector<RefPtr<StyleRuleBase>>& childRules() const { return m_childRules; }
</ins><span class="cx">
</span><del>- void parseDeferredRules(Vector<RefPtr<StyleRuleBase>>&);
- void parseDeferredKeyframes(StyleRuleKeyframes&);
-
-private:
- CSSParserTokenRange m_range;
- Ref<CSSDeferredParser> m_parser;
-};
-
-class StyleRuleGroup : public StyleRuleBase {
-public:
- const Vector<RefPtr<StyleRuleBase>>& childRules() const;
- const Vector<RefPtr<StyleRuleBase>>* childRulesWithoutDeferredParsing() const;
-
</del><span class="cx"> void wrapperInsertRule(unsigned, Ref<StyleRuleBase>&&);
</span><span class="cx"> void wrapperRemoveRule(unsigned);
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- StyleRuleGroup(Type, Vector<RefPtr<StyleRuleBase>>&);
- StyleRuleGroup(Type, std::unique_ptr<DeferredStyleGroupRuleList>&&);
</del><ins>+ StyleRuleGroup(Type, Vector<RefPtr<StyleRuleBase>>& adoptRule);
</ins><span class="cx"> StyleRuleGroup(const StyleRuleGroup&);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- void parseDeferredRulesIfNeeded() const;
-
- mutable Vector<RefPtr<StyleRuleBase>> m_childRules;
- mutable std::unique_ptr<DeferredStyleGroupRuleList> m_deferredRules;
</del><ins>+ Vector<RefPtr<StyleRuleBase>> m_childRules;
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-inline const Vector<RefPtr<StyleRuleBase>>* StyleRuleGroup::childRulesWithoutDeferredParsing() const
-{
- return !m_deferredRules ? &m_childRules : nullptr;
-}
-
</del><span class="cx"> class StyleRuleMedia final : public StyleRuleGroup {
</span><span class="cx"> public:
</span><span class="cx"> static Ref<StyleRuleMedia> create(Ref<MediaQuerySet>&& media, Vector<RefPtr<StyleRuleBase>>& adoptRules)
</span><span class="lines">@@ -233,11 +203,6 @@
</span><span class="cx"> return adoptRef(*new StyleRuleMedia(WTFMove(media), adoptRules));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- static Ref<StyleRuleMedia> create(Ref<MediaQuerySet>&& media, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredChildRules)
- {
- return adoptRef(*new StyleRuleMedia(WTFMove(media), WTFMove(deferredChildRules)));
- }
-
</del><span class="cx"> MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); }
</span><span class="cx">
</span><span class="cx"> Ref<StyleRuleMedia> copy() const { return adoptRef(*new StyleRuleMedia(*this)); }
</span><span class="lines">@@ -244,7 +209,6 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> StyleRuleMedia(Ref<MediaQuerySet>&&, Vector<RefPtr<StyleRuleBase>>& adoptRules);
</span><del>- StyleRuleMedia(Ref<MediaQuerySet>&&, std::unique_ptr<DeferredStyleGroupRuleList>&&);
</del><span class="cx"> StyleRuleMedia(const StyleRuleMedia&);
</span><span class="cx">
</span><span class="cx"> RefPtr<MediaQuerySet> m_mediaQueries;
</span><span class="lines">@@ -256,11 +220,6 @@
</span><span class="cx"> {
</span><span class="cx"> return adoptRef(*new StyleRuleSupports(conditionText, conditionIsSupported, adoptRules));
</span><span class="cx"> }
</span><del>-
- static Ref<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredChildRules)
- {
- return adoptRef(*new StyleRuleSupports(conditionText, conditionIsSupported, WTFMove(deferredChildRules)));
- }
</del><span class="cx">
</span><span class="cx"> String conditionText() const { return m_conditionText; }
</span><span class="cx"> bool conditionIsSupported() const { return m_conditionIsSupported; }
</span><span class="lines">@@ -268,8 +227,6 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase>>& adoptRules);
</span><del>- StyleRuleSupports(const String& conditionText, bool conditionIsSupported, std::unique_ptr<DeferredStyleGroupRuleList>&&);
-
</del><span class="cx"> StyleRuleSupports(const StyleRuleSupports&);
</span><span class="cx">
</span><span class="cx"> String m_conditionText;
</span><span class="lines">@@ -295,7 +252,6 @@
</span><span class="cx"> private:
</span><span class="cx"> StyleRuleRegion(Vector<std::unique_ptr<CSSParserSelector>>*, Vector<RefPtr<StyleRuleBase>>& adoptRules);
</span><span class="cx"> StyleRuleRegion(CSSSelectorList&, Vector<RefPtr<StyleRuleBase>>&);
</span><del>-
</del><span class="cx"> StyleRuleRegion(const StyleRuleRegion&);
</span><span class="cx">
</span><span class="cx"> CSSSelectorList m_selectorList;
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleSheetContentscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleSheetContents.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleSheetContents.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/StyleSheetContents.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -330,7 +330,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> CSSParser p(parserContext());
</span><del>- p.parseSheet(this, sheetText, CSSParser::RuleParsing::Deferred);
</del><ins>+ p.parseSheet(this, sheetText);
</ins><span class="cx">
</span><span class="cx"> if (m_parserContext.needsSiteSpecificQuirks && isStrictParserMode(m_parserContext.mode)) {
</span><span class="cx"> // Work around <https://bugs.webkit.org/show_bug.cgi?id=28350>.
</span><span class="lines">@@ -346,7 +346,7 @@
</span><span class="cx"> bool StyleSheetContents::parseString(const String& sheetText)
</span><span class="cx"> {
</span><span class="cx"> CSSParser p(parserContext());
</span><del>- p.parseSheet(this, sheetText, parserContext().mode != UASheetMode ? CSSParser::RuleParsing::Deferred : CSSParser::RuleParsing::Normal);
</del><ins>+ p.parseSheet(this, sheetText);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -428,22 +428,18 @@
</span><span class="cx"> {
</span><span class="cx"> for (auto& rule : rules) {
</span><span class="cx"> switch (rule->type()) {
</span><del>- case StyleRuleBase::Style: {
- auto* properties = downcast<StyleRule>(*rule).propertiesWithoutDeferredParsing();
- if (properties && properties->traverseSubresources(handler))
</del><ins>+ case StyleRuleBase::Style:
+ if (downcast<StyleRule>(*rule).properties().traverseSubresources(handler))
</ins><span class="cx"> return true;
</span><span class="cx"> break;
</span><del>- }
</del><span class="cx"> case StyleRuleBase::FontFace:
</span><span class="cx"> if (downcast<StyleRuleFontFace>(*rule).properties().traverseSubresources(handler))
</span><span class="cx"> return true;
</span><span class="cx"> break;
</span><del>- case StyleRuleBase::Media: {
- auto* childRules = downcast<StyleRuleMedia>(*rule).childRulesWithoutDeferredParsing();
- if (childRules && traverseSubresourcesInRules(*childRules, handler))
</del><ins>+ case StyleRuleBase::Media:
+ if (traverseSubresourcesInRules(downcast<StyleRuleMedia>(*rule).childRules(), handler))
</ins><span class="cx"> return true;
</span><span class="cx"> break;
</span><del>- }
</del><span class="cx"> case StyleRuleBase::Region:
</span><span class="cx"> if (traverseSubresourcesInRules(downcast<StyleRuleRegion>(*rule).childRules(), handler))
</span><span class="cx"> return true;
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleSheetContentsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleSheetContents.h (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleSheetContents.h        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/StyleSheetContents.h        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include <wtf/ListHashSet.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><del>-#include <wtf/WeakPtr.h>
</del><span class="cx"> #include <wtf/text/AtomicStringHash.h>
</span><span class="cx"> #include <wtf/text/TextPosition.h>
</span><span class="cx">
</span><span class="lines">@@ -143,8 +142,6 @@
</span><span class="cx">
</span><span class="cx"> void shrinkToFit();
</span><span class="cx">
</span><del>- WeakPtr<StyleSheetContents> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
-
</del><span class="cx"> private:
</span><span class="cx"> WEBCORE_EXPORT StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, const CSSParserContext&);
</span><span class="cx"> StyleSheetContents(const StyleSheetContents&);
</span><span class="lines">@@ -174,8 +171,6 @@
</span><span class="cx"> CSSParserContext m_parserContext;
</span><span class="cx">
</span><span class="cx"> Vector<CSSStyleSheet*> m_clients;
</span><del>-
- WeakPtrFactory<StyleSheetContents> m_weakPtrFactory { this };
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorecssWebKitCSSMatrixcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/WebKitCSSMatrix.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/WebKitCSSMatrix.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/WebKitCSSMatrix.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx"> return { };
</span><span class="cx">
</span><span class="cx"> auto styleDeclaration = MutableStyleProperties::create();
</span><del>- if (CSSParser::parseValue(styleDeclaration, CSSPropertyTransform, string, true, HTMLStandardMode) == CSSParser::ParseResult::Error)
</del><ins>+ if (CSSParser::parseValue(styleDeclaration, CSSPropertyTransform, string, true, HTMLStandardMode, nullptr) == CSSParser::ParseResult::Error)
</ins><span class="cx"> return Exception { SYNTAX_ERR };
</span><span class="cx">
</span><span class="cx"> // Convert to TransformOperations. This can fail if a property requires style (i.e., param uses 'ems' or 'exs')
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSDeferredParsercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/css/parser/CSSDeferredParser.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSDeferredParser.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSDeferredParser.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -1,57 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "CSSDeferredParser.h"
-
-#include "CSSParserImpl.h"
-#include "StyleSheetContents.h"
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-CSSDeferredParser::CSSDeferredParser(const String& sheetText, const CSSParserContext& context, StyleSheetContents& styleSheet)
- : m_tokenizer(sheetText)
- , m_context(context)
- , m_styleSheet(styleSheet.createWeakPtr())
-{
-}
-
-Ref<ImmutableStyleProperties> CSSDeferredParser::parseDeclaration(const CSSParserTokenRange& range)
-{
- return CSSParserImpl::parseDeferredDeclaration(range, m_context, m_styleSheet.get());
-}
-
-void CSSDeferredParser::parseRuleList(const CSSParserTokenRange& range, Vector<RefPtr<StyleRuleBase>>& childRules)
-{
- CSSParserImpl::parseDeferredRuleList(range, *this, childRules);
-}
-
-void CSSDeferredParser::parseKeyframeList(const CSSParserTokenRange& range, StyleRuleKeyframes&keyframesRule)
-{
- CSSParserImpl::parseDeferredKeyframeList(range, *this, keyframesRule);
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSDeferredParserh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/css/parser/CSSDeferredParser.h (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSDeferredParser.h        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSDeferredParser.h        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -1,65 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "CSSParserMode.h"
-#include "CSSTokenizer.h"
-#include <wtf/RefCounted.h>
-#include <wtf/WeakPtr.h>
-
-namespace WebCore {
-
-class ImmutableStyleProperties;
-class StyleRuleKeyframes;
-class StyleRuleBase;
-
-class CSSDeferredParser : public RefCounted<CSSDeferredParser> {
-public:
- static Ref<CSSDeferredParser> create(const String& sheetText, const CSSParserContext& parserContext, StyleSheetContents& styleSheet)
- {
- return adoptRef(*new CSSDeferredParser(sheetText, parserContext, styleSheet));
- }
-
- const CSSTokenizer& tokenizer() const { return m_tokenizer; }
- CSSParserMode mode() const { return m_context.mode; }
-
- const CSSParserContext& context() const { return m_context; }
- StyleSheetContents* styleSheet() const { return m_styleSheet.get(); }
-
- Ref<ImmutableStyleProperties> parseDeclaration(const CSSParserTokenRange&);
- void parseRuleList(const CSSParserTokenRange&, Vector<RefPtr<StyleRuleBase>>&);
- void parseKeyframeList(const CSSParserTokenRange&, StyleRuleKeyframes&);
-
-private:
- CSSDeferredParser(const String&, const CSSParserContext&, StyleSheetContents&);
-
- CSSTokenizer m_tokenizer;
- CSSParserContext m_context;
-
- WeakPtr<StyleSheetContents> m_styleSheet;
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParser.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -133,9 +133,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSParser::parseSheet(StyleSheetContents* sheet, const String& string, RuleParsing ruleParsing)
</del><ins>+void CSSParser::parseSheet(StyleSheetContents* sheet, const String& string)
</ins><span class="cx"> {
</span><del>- return CSSParserImpl::parseStyleSheet(string, m_context, sheet, ruleParsing);
</del><ins>+ return CSSParserImpl::parseStyleSheet(string, m_context, sheet);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CSSParser::parseSheetForInspector(const CSSParserContext& context, StyleSheetContents* sheet, const String& string, CSSParserObserver& observer)
</span><span class="lines">@@ -156,8 +156,10 @@
</span><span class="cx">
</span><span class="cx"> bool CSSParser::parseSupportsCondition(const String& condition)
</span><span class="cx"> {
</span><del>- CSSParserImpl parser(m_context, condition);
- return CSSSupportsParser::supportsCondition(parser.tokenizer().tokenRange(), parser) == CSSSupportsParser::Supported;
</del><ins>+ CSSTokenizer tokenizer(condition);
+ CSSParserTokenRange range = tokenizer.tokenRange();
+ CSSParserImpl parser(m_context);
+ return CSSSupportsParser::supportsCondition(range, parser) == CSSSupportsParser::Supported;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Color CSSParser::parseColor(const String& string, bool strict)
</span><span class="lines">@@ -200,16 +202,16 @@
</span><span class="cx"> {
</span><span class="cx"> if (string.isEmpty())
</span><span class="cx"> return nullptr;
</span><del>- if (RefPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(propertyID, string, context.mode))
</del><ins>+ if (RefPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(propertyID, string, context.mode, nullptr))
</ins><span class="cx"> return value;
</span><span class="cx"> CSSTokenizer tokenizer(string);
</span><span class="cx"> return CSSPropertyParser::parseSingleValue(propertyID, tokenizer.tokenRange(), context, nullptr);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CSSParser::ParseResult CSSParser::parseValue(MutableStyleProperties& declaration, CSSPropertyID propertyID, const String& string, bool important, const CSSParserContext& context)
</del><ins>+CSSParser::ParseResult CSSParser::parseValue(MutableStyleProperties& declaration, CSSPropertyID propertyID, const String& string, bool important, const CSSParserContext& context, StyleSheetContents* contextStyleSheet)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(!string.isEmpty());
</span><del>- RefPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(propertyID, string, context.mode);
</del><ins>+ RefPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(propertyID, string, context.mode, contextStyleSheet);
</ins><span class="cx"> if (value)
</span><span class="cx"> return declaration.addParsedProperty(CSSProperty(propertyID, WTFMove(value), important)) ? CSSParser::ParseResult::Changed : CSSParser::ParseResult::Unchanged;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParser.h (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParser.h        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSParser.h        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -47,11 +47,10 @@
</span><span class="cx"> Error
</span><span class="cx"> };
</span><span class="cx">
</span><del>- WEBCORE_EXPORT explicit CSSParser(const CSSParserContext&);
</del><ins>+ WEBCORE_EXPORT CSSParser(const CSSParserContext&);
</ins><span class="cx"> WEBCORE_EXPORT ~CSSParser();
</span><span class="cx">
</span><del>- enum class RuleParsing { Normal, Deferred };
- void parseSheet(StyleSheetContents*, const String&, RuleParsing = RuleParsing::Normal);
</del><ins>+ void parseSheet(StyleSheetContents*, const String&);
</ins><span class="cx">
</span><span class="cx"> static RefPtr<StyleRuleBase> parseRule(const CSSParserContext&, StyleSheetContents*, const String&);
</span><span class="cx">
</span><span class="lines">@@ -63,7 +62,7 @@
</span><span class="cx"> static void parseSheetForInspector(const CSSParserContext&, StyleSheetContents*, const String&, CSSParserObserver&);
</span><span class="cx"> static void parseDeclarationForInspector(const CSSParserContext&, const String&, CSSParserObserver&);
</span><span class="cx">
</span><del>- static ParseResult parseValue(MutableStyleProperties&, CSSPropertyID, const String&, bool important, const CSSParserContext&);
</del><ins>+ static ParseResult parseValue(MutableStyleProperties&, CSSPropertyID, const String&, bool important, const CSSParserContext&, StyleSheetContents*);
</ins><span class="cx"> static ParseResult parseCustomPropertyValue(MutableStyleProperties&, const AtomicString& propertyName, const String&, bool important, const CSSParserContext&);
</span><span class="cx">
</span><span class="cx"> static RefPtr<CSSValue> parseFontFaceDescriptor(CSSPropertyID, const String&, const CSSParserContext&);
</span><span class="lines">@@ -72,7 +71,7 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT bool parseDeclaration(MutableStyleProperties&, const String&);
</span><span class="cx"> static Ref<ImmutableStyleProperties> parseInlineStyleDeclaration(const String&, Element*);
</span><del>-
</del><ins>+
</ins><span class="cx"> void parseSelector(const String&, CSSSelectorList&);
</span><span class="cx">
</span><span class="cx"> RefPtr<CSSValue> parseValueWithVariableReferences(CSSPropertyID, const CSSValue&, const CustomPropertyValueMap& customProperties, TextDirection, WritingMode);
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserFastPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -496,7 +496,7 @@
</span><span class="cx"> return CSSValuePool::singleton().createColorValue(color);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID, CSSParserMode parserMode)
</del><ins>+bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID, CSSParserMode parserMode, StyleSheetContents* styleSheetContents)
</ins><span class="cx"> {
</span><span class="cx"> if (valueID == CSSValueInvalid || !isValueAllowedInMode(valueID, parserMode))
</span><span class="cx"> return false;
</span><span class="lines">@@ -751,9 +751,21 @@
</span><span class="cx"> case CSSPropertyWebkitUserDrag: // auto | none | element
</span><span class="cx"> return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueElement;
</span><span class="cx"> case CSSPropertyWebkitUserModify: // read-only | read-write
</span><del>- return valueID == CSSValueReadOnly || valueID == CSSValueReadWrite || valueID == CSSValueReadWritePlaintextOnly;
</del><ins>+ if (valueID == CSSValueReadOnly || valueID == CSSValueReadWrite || valueID == CSSValueReadWritePlaintextOnly) {
+ if (styleSheetContents)
+ styleSheetContents->parserSetUsesStyleBasedEditability();
+ return true;
+ }
+ return false;
</ins><span class="cx"> case CSSPropertyWebkitUserSelect: // auto | none | text | all
</span><del>- return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueText || valueID == CSSValueAll;
</del><ins>+ if (valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueText)
+ return true;
+ if (valueID == CSSValueAll) {
+ if (styleSheetContents)
+ styleSheetContents->parserSetUsesStyleBasedEditability();
+ return true;
+ }
+ return false;
</ins><span class="cx"> case CSSPropertyWritingMode:
</span><span class="cx"> // Note that horizontal-bt is not supported by the unprefixed version of
</span><span class="cx"> // the property, only by the -webkit- version.
</span><span class="lines">@@ -1014,7 +1026,7 @@
</span><span class="cx"> || equalLettersIgnoringASCIICase(string, "revert");
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static RefPtr<CSSValue> parseKeywordValue(CSSPropertyID propertyId, const String& string, CSSParserMode parserMode)
</del><ins>+static RefPtr<CSSValue> parseKeywordValue(CSSPropertyID propertyId, const String& string, CSSParserMode parserMode, StyleSheetContents* styleSheetContents)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(!string.isEmpty());
</span><span class="cx">
</span><span class="lines">@@ -1046,7 +1058,7 @@
</span><span class="cx"> if (valueID == CSSValueRevert)
</span><span class="cx"> return CSSValuePool::singleton().createRevertValue();
</span><span class="cx">
</span><del>- if (CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyId, valueID, parserMode))
</del><ins>+ if (CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyId, valueID, parserMode, styleSheetContents))
</ins><span class="cx"> return CSSPrimitiveValue::createIdentifier(valueID);
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -1260,7 +1272,7 @@
</span><span class="cx"> return parseSimpleTransformList(string.characters16(), string.length());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String& string, CSSParserMode parserMode)
</del><ins>+RefPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String& string, CSSParserMode parserMode, StyleSheetContents* styleSheetContents)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<CSSValue> result = parseSimpleLengthValue(propertyID, string, parserMode);
</span><span class="cx"> if (result)
</span><span class="lines">@@ -1267,7 +1279,7 @@
</span><span class="cx"> return result;
</span><span class="cx"> if (isColorPropertyID(propertyID))
</span><span class="cx"> return parseColor(string, parserMode);
</span><del>- result = parseKeywordValue(propertyID, string, parserMode);
</del><ins>+ result = parseKeywordValue(propertyID, string, parserMode, styleSheetContents);
</ins><span class="cx"> if (result)
</span><span class="cx"> return result;
</span><span class="cx"> result = parseSimpleTransform(propertyID, string);
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserFastPathsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.h (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.h        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.h        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -43,11 +43,11 @@
</span><span class="cx"> public:
</span><span class="cx"> // Parses simple values like '10px' or 'green', but makes no guarantees
</span><span class="cx"> // about handling any property completely.
</span><del>- static RefPtr<CSSValue> maybeParseValue(CSSPropertyID, const String&, CSSParserMode);
</del><ins>+ static RefPtr<CSSValue> maybeParseValue(CSSPropertyID, const String&, CSSParserMode, StyleSheetContents*);
</ins><span class="cx">
</span><span class="cx"> // Properties handled here shouldn't be explicitly handled in CSSPropertyParser
</span><span class="cx"> static bool isKeywordPropertyID(CSSPropertyID);
</span><del>- static bool isValidKeywordPropertyAndValue(CSSPropertyID, CSSValueID, CSSParserMode);
</del><ins>+ static bool isValidKeywordPropertyAndValue(CSSPropertyID, CSSValueID, CSSParserMode, StyleSheetContents*);
</ins><span class="cx">
</span><span class="cx"> static RefPtr<CSSValue> parseColor(const String&, CSSParserMode);
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserImpl.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx">
</span><span class="cx"> #include "CSSAtRuleID.h"
</span><span class="cx"> #include "CSSCustomPropertyValue.h"
</span><del>-#include "CSSDeferredParser.h"
</del><span class="cx"> #include "CSSKeyframeRule.h"
</span><span class="cx"> #include "CSSKeyframesRule.h"
</span><span class="cx"> #include "CSSParserObserver.h"
</span><span class="lines">@@ -59,42 +58,20 @@
</span><span class="cx"> CSSParserImpl::CSSParserImpl(const CSSParserContext& context, StyleSheetContents* styleSheet)
</span><span class="cx"> : m_context(context)
</span><span class="cx"> , m_styleSheet(styleSheet)
</span><ins>+ , m_observerWrapper(nullptr)
</ins><span class="cx"> {
</span><del>-
</del><span class="cx"> }
</span><span class="cx">
</span><del>-CSSParserImpl::CSSParserImpl(CSSDeferredParser& deferredParser)
- : m_context(deferredParser.context())
- , m_styleSheet(deferredParser.styleSheet())
- , m_deferredParser(&deferredParser)
-{
-}
-
-CSSParserImpl::CSSParserImpl(const CSSParserContext& context, const String& string, StyleSheetContents* styleSheet, CSSParserObserverWrapper* wrapper, CSSParser::RuleParsing ruleParsing)
- : m_context(context)
- , m_styleSheet(styleSheet)
- , m_observerWrapper(wrapper)
-{
- if (!wrapper && styleSheet && ruleParsing == CSSParser::RuleParsing::Deferred)
- m_deferredParser = CSSDeferredParser::create(string, context, *styleSheet);
- else
- m_tokenizer = wrapper ? std::make_unique<CSSTokenizer>(string, *wrapper) : std::make_unique<CSSTokenizer>(string);
-}
-
-const CSSTokenizer& CSSParserImpl::tokenizer() const
-{
- return m_deferredParser ? m_deferredParser->tokenizer() : *m_tokenizer;
-}
-
</del><span class="cx"> CSSParser::ParseResult CSSParserImpl::parseValue(MutableStyleProperties* declaration, CSSPropertyID propertyID, const String& string, bool important, const CSSParserContext& context)
</span><span class="cx"> {
</span><del>- CSSParserImpl parser(context, string);
</del><ins>+ CSSParserImpl parser(context);
</ins><span class="cx"> StyleRule::Type ruleType = StyleRule::Style;
</span><span class="cx"> #if ENABLE(CSS_DEVICE_ADAPTATION)
</span><span class="cx"> if (declaration->cssParserMode() == CSSViewportRuleMode)
</span><span class="cx"> ruleType = StyleRule::Viewport;
</span><span class="cx"> #endif
</span><del>- parser.consumeDeclarationValue(parser.tokenizer().tokenRange(), propertyID, important, ruleType);
</del><ins>+ CSSTokenizer tokenizer(string);
+ parser.consumeDeclarationValue(tokenizer.tokenRange(), propertyID, important, ruleType);
</ins><span class="cx"> if (parser.m_parsedProperties.isEmpty())
</span><span class="cx"> return CSSParser::ParseResult::Error;
</span><span class="cx"> return declaration->addParsedProperties(parser.m_parsedProperties) ? CSSParser::ParseResult::Changed : CSSParser::ParseResult::Unchanged;
</span><span class="lines">@@ -102,8 +79,9 @@
</span><span class="cx">
</span><span class="cx"> CSSParser::ParseResult CSSParserImpl::parseCustomPropertyValue(MutableStyleProperties* declaration, const AtomicString& propertyName, const String& string, bool important, const CSSParserContext& context)
</span><span class="cx"> {
</span><del>- CSSParserImpl parser(context, string);
- parser.consumeCustomPropertyValue(parser.tokenizer().tokenRange(), propertyName, important);
</del><ins>+ CSSParserImpl parser(context);
+ CSSTokenizer tokenizer(string);
+ parser.consumeCustomPropertyValue(tokenizer.tokenRange(), propertyName, important);
</ins><span class="cx"> if (parser.m_parsedProperties.isEmpty())
</span><span class="cx"> return CSSParser::ParseResult::Error;
</span><span class="cx"> return declaration->addParsedProperties(parser.m_parsedProperties) ? CSSParser::ParseResult::Changed : CSSParser::ParseResult::Unchanged;
</span><span class="lines">@@ -139,12 +117,6 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<DeferredStyleProperties> CSSParserImpl::createDeferredStyleProperties(const CSSParserTokenRange& propertyRange)
-{
- ASSERT(m_deferredParser);
- return DeferredStyleProperties::create(propertyRange, *m_deferredParser);
-}
-
</del><span class="cx"> static Ref<ImmutableStyleProperties> createStyleProperties(ParsedPropertyVector& parsedProperties, CSSParserMode mode)
</span><span class="cx"> {
</span><span class="cx"> std::bitset<numCSSProperties> seenProperties;
</span><span class="lines">@@ -165,51 +137,22 @@
</span><span class="cx"> CSSParserContext context(element->document());
</span><span class="cx"> context.mode = strictToCSSParserMode(element->isHTMLElement() && !element->document().inQuirksMode());
</span><span class="cx">
</span><del>- CSSParserImpl parser(context, string);
- parser.consumeDeclarationList(parser.tokenizer().tokenRange(), StyleRule::Style);
</del><ins>+ CSSParserImpl parser(context);
+ CSSTokenizer tokenizer(string);
+ parser.consumeDeclarationList(tokenizer.tokenRange(), StyleRule::Style);
</ins><span class="cx"> return createStyleProperties(parser.m_parsedProperties, context.mode);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<ImmutableStyleProperties> CSSParserImpl::parseDeferredDeclaration(CSSParserTokenRange tokenRange, const CSSParserContext& context, StyleSheetContents* styleSheet)
-{
- if (!styleSheet) {
- ParsedPropertyVector properties;
- return createStyleProperties(properties, context.mode);
- }
- CSSParserImpl parser(context, styleSheet);
- parser.consumeDeclarationList(tokenRange, StyleRule::Style);
- return createStyleProperties(parser.m_parsedProperties, context.mode);
-}
-
-void CSSParserImpl::parseDeferredRuleList(CSSParserTokenRange tokenRange, CSSDeferredParser& deferredParser, Vector<RefPtr<StyleRuleBase>>& childRules)
-{
- if (!deferredParser.styleSheet())
- return;
- CSSParserImpl parser(deferredParser);
- parser.consumeRuleList(tokenRange, RegularRuleList, [&childRules](const RefPtr<StyleRuleBase>& rule) {
- childRules.append(rule);
- });
-}
-
-void CSSParserImpl::parseDeferredKeyframeList(CSSParserTokenRange tokenRange, CSSDeferredParser& deferredParser, StyleRuleKeyframes& keyframeRule)
-{
- if (!deferredParser.styleSheet())
- return;
- CSSParserImpl parser(deferredParser);
- parser.consumeRuleList(tokenRange, KeyframesRuleList, [&keyframeRule](const RefPtr<StyleRuleBase>& keyframe) {
- keyframeRule.parserAppendKeyframe(downcast<const StyleKeyframe>(keyframe.get()));
- });
-}
-
</del><span class="cx"> bool CSSParserImpl::parseDeclarationList(MutableStyleProperties* declaration, const String& string, const CSSParserContext& context)
</span><span class="cx"> {
</span><del>- CSSParserImpl parser(context, string);
</del><ins>+ CSSParserImpl parser(context);
</ins><span class="cx"> StyleRule::Type ruleType = StyleRule::Style;
</span><span class="cx"> #if ENABLE(CSS_DEVICE_ADAPTATION)
</span><span class="cx"> if (declaration->cssParserMode() == CSSViewportRuleMode)
</span><span class="cx"> ruleType = StyleRule::Viewport;
</span><span class="cx"> #endif
</span><del>- parser.consumeDeclarationList(parser.tokenizer().tokenRange(), ruleType);
</del><ins>+ CSSTokenizer tokenizer(string);
+ parser.consumeDeclarationList(tokenizer.tokenRange(), ruleType);
</ins><span class="cx"> if (parser.m_parsedProperties.isEmpty())
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="lines">@@ -226,8 +169,9 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<StyleRuleBase> CSSParserImpl::parseRule(const String& string, const CSSParserContext& context, StyleSheetContents* styleSheet, AllowedRulesType allowedRules)
</span><span class="cx"> {
</span><del>- CSSParserImpl parser(context, string, styleSheet);
- CSSParserTokenRange range = parser.tokenizer().tokenRange();
</del><ins>+ CSSParserImpl parser(context, styleSheet);
+ CSSTokenizer tokenizer(string);
+ CSSParserTokenRange range = tokenizer.tokenRange();
</ins><span class="cx"> range.consumeWhitespace();
</span><span class="cx"> if (range.atEnd())
</span><span class="cx"> return nullptr; // Parse error, empty rule
</span><span class="lines">@@ -244,10 +188,11 @@
</span><span class="cx"> return rule;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSParserImpl::parseStyleSheet(const String& string, const CSSParserContext& context, StyleSheetContents* styleSheet, CSSParser::RuleParsing ruleParsing)
</del><ins>+void CSSParserImpl::parseStyleSheet(const String& string, const CSSParserContext& context, StyleSheetContents* styleSheet)
</ins><span class="cx"> {
</span><del>- CSSParserImpl parser(context, string, styleSheet, nullptr, ruleParsing);
- bool firstRuleValid = parser.consumeRuleList(parser.tokenizer().tokenRange(), TopLevelRuleList, [&styleSheet](RefPtr<StyleRuleBase> rule) {
</del><ins>+ CSSTokenizer tokenizer(string);
+ CSSParserImpl parser(context, styleSheet);
+ bool firstRuleValid = parser.consumeRuleList(tokenizer.tokenRange(), TopLevelRuleList, [&styleSheet](RefPtr<StyleRuleBase> rule) {
</ins><span class="cx"> if (rule->isCharsetRule())
</span><span class="cx"> return;
</span><span class="cx"> styleSheet->parserAppendRule(rule.releaseNonNull());
</span><span class="lines">@@ -313,18 +258,22 @@
</span><span class="cx">
</span><span class="cx"> void CSSParserImpl::parseDeclarationListForInspector(const String& declaration, const CSSParserContext& context, CSSParserObserver& observer)
</span><span class="cx"> {
</span><ins>+ CSSParserImpl parser(context);
</ins><span class="cx"> CSSParserObserverWrapper wrapper(observer);
</span><del>- CSSParserImpl parser(context, declaration, nullptr, &wrapper);
</del><ins>+ parser.m_observerWrapper = &wrapper;
+ CSSTokenizer tokenizer(declaration, wrapper);
</ins><span class="cx"> observer.startRuleHeader(StyleRule::Style, 0);
</span><span class="cx"> observer.endRuleHeader(1);
</span><del>- parser.consumeDeclarationList(parser.tokenizer().tokenRange(), StyleRule::Style);
</del><ins>+ parser.consumeDeclarationList(tokenizer.tokenRange(), StyleRule::Style);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CSSParserImpl::parseStyleSheetForInspector(const String& string, const CSSParserContext& context, StyleSheetContents* styleSheet, CSSParserObserver& observer)
</span><span class="cx"> {
</span><ins>+ CSSParserImpl parser(context, styleSheet);
</ins><span class="cx"> CSSParserObserverWrapper wrapper(observer);
</span><del>- CSSParserImpl parser(context, string, styleSheet, &wrapper);
- bool firstRuleValid = parser.consumeRuleList(parser.tokenizer().tokenRange(), TopLevelRuleList, [&styleSheet](RefPtr<StyleRuleBase> rule) {
</del><ins>+ parser.m_observerWrapper = &wrapper;
+ CSSTokenizer tokenizer(string, wrapper);
+ bool firstRuleValid = parser.consumeRuleList(tokenizer.tokenRange(), TopLevelRuleList, [&styleSheet](RefPtr<StyleRuleBase> rule) {
</ins><span class="cx"> if (rule->isCharsetRule())
</span><span class="cx"> return;
</span><span class="cx"> styleSheet->parserAppendRule(rule.releaseNonNull());
</span><span class="lines">@@ -468,7 +417,7 @@
</span><span class="cx"> return nullptr; // Parse error, EOF instead of qualified rule block
</span><span class="cx">
</span><span class="cx"> CSSParserTokenRange prelude = range.makeSubRange(preludeStart, &range.peek());
</span><del>- CSSParserTokenRange block = range.consumeBlockCheckingForEditability(m_styleSheet.get());
</del><ins>+ CSSParserTokenRange block = range.consumeBlock();
</ins><span class="cx">
</span><span class="cx"> if (allowedRules <= RegularRules)
</span><span class="cx"> return consumeStyleRule(prelude, block);
</span><span class="lines">@@ -519,7 +468,7 @@
</span><span class="cx"> m_observerWrapper->observer().endRuleBody(endOffset);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return StyleRuleImport::create(uri, MediaQueryParser::parseMediaQuerySet(prelude));
</del><ins>+ return StyleRuleImport::create(uri, MediaQueryParser::parseMediaQuerySet(prelude).releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<StyleRuleNamespace> CSSParserImpl::consumeNamespaceRule(CSSParserTokenRange prelude)
</span><span class="lines">@@ -537,9 +486,6 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<StyleRuleMedia> CSSParserImpl::consumeMediaRule(CSSParserTokenRange prelude, CSSParserTokenRange block)
</span><span class="cx"> {
</span><del>- if (m_deferredParser)
- return StyleRuleMedia::create(MediaQueryParser::parseMediaQuerySet(prelude), std::make_unique<DeferredStyleGroupRuleList>(block, *m_deferredParser));
-
</del><span class="cx"> Vector<RefPtr<StyleRuleBase>> rules;
</span><span class="cx">
</span><span class="cx"> if (m_observerWrapper) {
</span><span class="lines">@@ -555,7 +501,7 @@
</span><span class="cx"> if (m_observerWrapper)
</span><span class="cx"> m_observerWrapper->observer().endRuleBody(m_observerWrapper->endOffset(block));
</span><span class="cx">
</span><del>- return StyleRuleMedia::create(MediaQueryParser::parseMediaQuerySet(prelude), rules);
</del><ins>+ return StyleRuleMedia::create(MediaQueryParser::parseMediaQuerySet(prelude).releaseNonNull(), rules);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<StyleRuleSupports> CSSParserImpl::consumeSupportsRule(CSSParserTokenRange prelude, CSSParserTokenRange block)
</span><span class="lines">@@ -564,9 +510,6 @@
</span><span class="cx"> if (supported == CSSSupportsParser::Invalid)
</span><span class="cx"> return nullptr; // Parse error, invalid @supports condition
</span><span class="cx">
</span><del>- if (m_deferredParser)
- return StyleRuleSupports::create(prelude.serialize().stripWhiteSpace(), supported, std::make_unique<DeferredStyleGroupRuleList>(block, *m_deferredParser));
-
</del><span class="cx"> if (m_observerWrapper) {
</span><span class="cx"> m_observerWrapper->observer().startRuleHeader(StyleRule::Supports, m_observerWrapper->startOffset(prelude));
</span><span class="cx"> m_observerWrapper->observer().endRuleHeader(m_observerWrapper->endOffset(prelude));
</span><span class="lines">@@ -635,9 +578,6 @@
</span><span class="cx"> else
</span><span class="cx"> return nullptr; // Parse error; expected ident token in @keyframes header
</span><span class="cx">
</span><del>- if (m_deferredParser)
- return StyleRuleKeyframes::create(name, std::make_unique<DeferredStyleGroupRuleList>(block, *m_deferredParser));
-
</del><span class="cx"> if (m_observerWrapper) {
</span><span class="cx"> m_observerWrapper->observer().startRuleHeader(StyleRule::Keyframes, m_observerWrapper->startOffset(rangeCopy));
</span><span class="cx"> m_observerWrapper->observer().endRuleHeader(m_observerWrapper->endOffset(prelude));
</span><span class="lines">@@ -645,11 +585,12 @@
</span><span class="cx"> m_observerWrapper->observer().endRuleBody(m_observerWrapper->endOffset(block));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<StyleRuleKeyframes> keyframeRule = StyleRuleKeyframes::create(name);
- consumeRuleList(block, KeyframesRuleList, [keyframeRule](const RefPtr<StyleRuleBase>& keyframe) {
- keyframeRule->parserAppendKeyframe(downcast<const StyleKeyframe>(keyframe.get()));
</del><ins>+ RefPtr<StyleRuleKeyframes> keyframeRule = StyleRuleKeyframes::create();
+ consumeRuleList(block, KeyframesRuleList, [keyframeRule](RefPtr<StyleRuleBase> keyframe) {
+ RefPtr<StyleKeyframe> key = static_cast<StyleKeyframe*>(keyframe.get());
+ keyframeRule->parserAppendKeyframe(key.releaseNonNull());
</ins><span class="cx"> });
</span><del>-
</del><ins>+ keyframeRule->setName(name);
</ins><span class="cx"> // FIXME-NEWPARSER: Find out why this is done. Behavior difference when prefixed?
</span><span class="cx"> // keyframeRule->setVendorPrefixed(webkitPrefixed);
</span><span class="cx"> return keyframeRule;
</span><span class="lines">@@ -753,26 +694,12 @@
</span><span class="cx"> if (!selectorList.isValid())
</span><span class="cx"> return nullptr; // Parse error, invalid selector list
</span><span class="cx">
</span><del>- RefPtr<StyleRule> rule;
</del><span class="cx"> if (m_observerWrapper)
</span><span class="cx"> observeSelectors(*m_observerWrapper, prelude);
</span><del>-
- if (m_deferredParser) {
- // If a rule is empty (i.e., only whitespace), don't bother using
- // deferred parsing. This allows the empty rule optimization in ElementRuleCollector
- // to continue to work. Note we don't have to consider CommentTokens, since those
- // are stripped out.
- CSSParserTokenRange blockCopy = block;
- blockCopy.consumeWhitespace();
- if (!blockCopy.atEnd()) {
- rule = StyleRule::create(createDeferredStyleProperties(block));
- rule->wrapperAdoptSelectorList(selectorList);
- return rule;
- }
- }
</del><span class="cx">
</span><span class="cx"> consumeDeclarationList(block, StyleRule::Style);
</span><del>- rule = StyleRule::create(createStyleProperties(m_parsedProperties, m_context.mode));
</del><ins>+
+ RefPtr<StyleRule> rule = StyleRule::create(createStyleProperties(m_parsedProperties, m_context.mode));
</ins><span class="cx"> rule->wrapperAdoptSelectorList(selectorList);
</span><span class="cx"> return rule;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.h (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserImpl.h        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.h        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx">
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><del>-#include "CSSDeferredParser.h"
</del><span class="cx"> #include "CSSParser.h"
</span><span class="cx"> #include "CSSParserMode.h"
</span><span class="cx"> #include "CSSParserTokenRange.h"
</span><span class="lines">@@ -47,7 +46,6 @@
</span><span class="cx"> class CSSParserObserver;
</span><span class="cx"> class CSSParserObserverWrapper;
</span><span class="cx"> class CSSSelectorList;
</span><del>-class CSSTokenizer;
</del><span class="cx"> class StyleKeyframe;
</span><span class="cx"> class StyleRule;
</span><span class="cx"> class StyleRuleBase;
</span><span class="lines">@@ -68,7 +66,7 @@
</span><span class="cx"> class CSSParserImpl {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(CSSParserImpl);
</span><span class="cx"> public:
</span><del>- CSSParserImpl(const CSSParserContext&, const String&, StyleSheetContents* = nullptr, CSSParserObserverWrapper* = nullptr, CSSParser::RuleParsing = CSSParser::RuleParsing::Normal);
</del><ins>+ CSSParserImpl(const CSSParserContext&, StyleSheetContents* = nullptr);
</ins><span class="cx">
</span><span class="cx"> enum AllowedRulesType {
</span><span class="cx"> // As per css-syntax, css-cascade and css-namespaces, @charset rules
</span><span class="lines">@@ -90,7 +88,7 @@
</span><span class="cx"> static Ref<ImmutableStyleProperties> parseInlineStyleDeclaration(const String&, Element*);
</span><span class="cx"> static bool parseDeclarationList(MutableStyleProperties*, const String&, const CSSParserContext&);
</span><span class="cx"> static RefPtr<StyleRuleBase> parseRule(const String&, const CSSParserContext&, StyleSheetContents*, AllowedRulesType);
</span><del>- static void parseStyleSheet(const String&, const CSSParserContext&, StyleSheetContents*, CSSParser::RuleParsing);
</del><ins>+ static void parseStyleSheet(const String&, const CSSParserContext&, StyleSheetContents*);
</ins><span class="cx"> static CSSSelectorList parsePageSelector(CSSParserTokenRange, StyleSheetContents*);
</span><span class="cx">
</span><span class="cx"> static std::unique_ptr<Vector<double>> parseKeyframeKeyList(const String&);
</span><span class="lines">@@ -100,16 +98,7 @@
</span><span class="cx"> static void parseDeclarationListForInspector(const String&, const CSSParserContext&, CSSParserObserver&);
</span><span class="cx"> static void parseStyleSheetForInspector(const String&, const CSSParserContext&, StyleSheetContents*, CSSParserObserver&);
</span><span class="cx">
</span><del>- static Ref<ImmutableStyleProperties> parseDeferredDeclaration(CSSParserTokenRange, const CSSParserContext&, StyleSheetContents*);
- static void parseDeferredRuleList(CSSParserTokenRange, CSSDeferredParser&, Vector<RefPtr<StyleRuleBase>>&);
- static void parseDeferredKeyframeList(CSSParserTokenRange, CSSDeferredParser&, StyleRuleKeyframes&);
-
- const CSSTokenizer& tokenizer() const;
-
</del><span class="cx"> private:
</span><del>- CSSParserImpl(const CSSParserContext&, StyleSheetContents*);
- CSSParserImpl(CSSDeferredParser&);
-
</del><span class="cx"> enum RuleListType {
</span><span class="cx"> TopLevelRuleList,
</span><span class="cx"> RegularRuleList,
</span><span class="lines">@@ -151,8 +140,6 @@
</span><span class="cx">
</span><span class="cx"> static std::unique_ptr<Vector<double>> consumeKeyframeKeyList(CSSParserTokenRange);
</span><span class="cx">
</span><del>- Ref<DeferredStyleProperties> createDeferredStyleProperties(const CSSParserTokenRange& propertyRange);
-
</del><span class="cx"> // FIXME: Can we build StylePropertySets directly?
</span><span class="cx"> // FIXME: Investigate using a smaller inline buffer
</span><span class="cx"> ParsedPropertyVector m_parsedProperties;
</span><span class="lines">@@ -160,14 +147,8 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<StyleSheetContents> m_styleSheet;
</span><span class="cx">
</span><del>- // For deferred property parsing.
- RefPtr<CSSDeferredParser> m_deferredParser;
-
- // For normal parsing.
- std::unique_ptr<CSSTokenizer> m_tokenizer;
-
</del><span class="cx"> // For the inspector
</span><del>- CSSParserObserverWrapper* m_observerWrapper { nullptr };
</del><ins>+ CSSParserObserverWrapper* m_observerWrapper;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserTokenRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserTokenRange.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserTokenRange.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSParserTokenRange.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "CSSParserTokenRange.h"
</span><span class="cx">
</span><del>-#include "StyleSheetContents.h"
</del><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><span class="lines">@@ -70,27 +69,6 @@
</span><span class="cx"> return makeSubRange(start, m_first - 1);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CSSParserTokenRange CSSParserTokenRange::consumeBlockCheckingForEditability(StyleSheetContents* styleSheet)
-{
- ASSERT(peek().getBlockType() == CSSParserToken::BlockStart);
- const auto* start = &peek() + 1;
- unsigned nestingLevel = 0;
- do {
- const auto& token = consume();
- if (token.getBlockType() == CSSParserToken::BlockStart)
- nestingLevel++;
- else if (token.getBlockType() == CSSParserToken::BlockEnd)
- nestingLevel--;
-
- if (styleSheet && !styleSheet->usesStyleBasedEditability() && token.type() == IdentToken && equalLettersIgnoringASCIICase(token.value(), "-webkit-user-modify"))
- styleSheet->parserSetUsesStyleBasedEditability();
- } while (nestingLevel && m_first < m_last);
-
- if (nestingLevel)
- return makeSubRange(start, m_first); // Ended at EOF
- return makeSubRange(start, m_first - 1);
-}
-
</del><span class="cx"> void CSSParserTokenRange::consumeComponentValue()
</span><span class="cx"> {
</span><span class="cx"> // FIXME: This is going to do multiple passes over large sections of a stylesheet.
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserTokenRangeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserTokenRange.h (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserTokenRange.h        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSParserTokenRange.h        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -75,7 +75,6 @@
</span><span class="cx">
</span><span class="cx"> // The returned range doesn't include the brackets
</span><span class="cx"> CSSParserTokenRange consumeBlock();
</span><del>- CSSParserTokenRange consumeBlockCheckingForEditability(StyleSheetContents*);
</del><span class="cx">
</span><span class="cx"> void consumeComponentValue();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -3712,7 +3712,7 @@
</span><span class="cx"> RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSSPropertyID currentShorthand)
</span><span class="cx"> {
</span><span class="cx"> if (CSSParserFastPaths::isKeywordPropertyID(property)) {
</span><del>- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context.mode))
</del><ins>+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context.mode, m_styleSheetContents))
</ins><span class="cx"> return nullptr;
</span><span class="cx"> return consumeIdent(m_range);
</span><span class="cx"> }
</span><span class="lines">@@ -4257,7 +4257,7 @@
</span><span class="cx"> case CSSPropertyFontStretch:
</span><span class="cx"> case CSSPropertyFontStyle: {
</span><span class="cx"> CSSValueID id = m_range.consumeIncludingWhitespace().id();
</span><del>- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id, m_context.mode))
</del><ins>+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id, m_context.mode, m_styleSheetContents))
</ins><span class="cx"> return false;
</span><span class="cx"> parsedValue = CSSValuePool::singleton().createIdentifierValue(id);
</span><span class="cx"> break;
</span><span class="lines">@@ -4342,7 +4342,7 @@
</span><span class="cx"> // FIXME-NEWPARSER: Implement. RefPtr<CSSPrimitiveValue> fontStretch;
</span><span class="cx"> while (!m_range.atEnd()) {
</span><span class="cx"> CSSValueID id = m_range.peek().id();
</span><del>- if (!fontStyle && CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStyle, id, m_context.mode)) {
</del><ins>+ if (!fontStyle && CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStyle, id, m_context.mode, m_styleSheetContents)) {
</ins><span class="cx"> fontStyle = consumeIdent(m_range);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="lines">@@ -5347,7 +5347,7 @@
</span><span class="cx"> switch (property) {
</span><span class="cx"> case CSSPropertyWebkitMarginCollapse: {
</span><span class="cx"> CSSValueID id = m_range.consumeIncludingWhitespace().id();
</span><del>- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginBeforeCollapse, id, m_context.mode))
</del><ins>+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginBeforeCollapse, id, m_context.mode, m_styleSheetContents))
</ins><span class="cx"> return false;
</span><span class="cx"> addProperty(CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginCollapse, CSSValuePool::singleton().createIdentifierValue(id), important);
</span><span class="cx"> if (m_range.atEnd()) {
</span><span class="lines">@@ -5355,7 +5355,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> id = m_range.consumeIncludingWhitespace().id();
</span><del>- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginAfterCollapse, id, m_context.mode))
</del><ins>+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginAfterCollapse, id, m_context.mode, m_styleSheetContents))
</ins><span class="cx"> return false;
</span><span class="cx"> addProperty(CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarginCollapse, CSSValuePool::singleton().createIdentifierValue(id), important);
</span><span class="cx"> return true;
</span><span class="lines">@@ -5362,7 +5362,7 @@
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyOverflow: {
</span><span class="cx"> CSSValueID id = m_range.consumeIncludingWhitespace().id();
</span><del>- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyOverflowY, id, m_context.mode))
</del><ins>+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyOverflowY, id, m_context.mode, m_styleSheetContents))
</ins><span class="cx"> return false;
</span><span class="cx"> if (!m_range.atEnd())
</span><span class="cx"> return false;
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSTokenizercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSTokenizer.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSTokenizer.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSTokenizer.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> wrapper.finalizeConstruction(m_tokens.begin());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CSSParserTokenRange CSSTokenizer::tokenRange() const
</del><ins>+CSSParserTokenRange CSSTokenizer::tokenRange()
</ins><span class="cx"> {
</span><span class="cx"> return m_tokens;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSTokenizerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSTokenizer.h (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSTokenizer.h        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/CSSTokenizer.h        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> CSSTokenizer(const String&);
</span><span class="cx"> CSSTokenizer(const String&, CSSParserObserverWrapper&); // For the inspector
</span><span class="cx">
</span><del>- CSSParserTokenRange tokenRange() const;
</del><ins>+ CSSParserTokenRange tokenRange();
</ins><span class="cx"> unsigned tokenCount();
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserMediaQueryParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/MediaQueryParser.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/MediaQueryParser.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/MediaQueryParser.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -36,17 +36,17 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-Ref<MediaQuerySet> MediaQueryParser::parseMediaQuerySet(const String& queryString)
</del><ins>+RefPtr<MediaQuerySet> MediaQueryParser::parseMediaQuerySet(const String& queryString)
</ins><span class="cx"> {
</span><span class="cx"> return parseMediaQuerySet(CSSTokenizer(queryString).tokenRange());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<MediaQuerySet> MediaQueryParser::parseMediaQuerySet(CSSParserTokenRange range)
</del><ins>+RefPtr<MediaQuerySet> MediaQueryParser::parseMediaQuerySet(CSSParserTokenRange range)
</ins><span class="cx"> {
</span><span class="cx"> return MediaQueryParser(MediaQuerySetParser).parseInternal(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<MediaQuerySet> MediaQueryParser::parseMediaCondition(CSSParserTokenRange range)
</del><ins>+RefPtr<MediaQuerySet> MediaQueryParser::parseMediaCondition(CSSParserTokenRange range)
</ins><span class="cx"> {
</span><span class="cx"> return MediaQueryParser(MediaConditionParser).parseInternal(range);
</span><span class="cx"> }
</span><span class="lines">@@ -246,7 +246,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // The state machine loop
</span><del>-Ref<MediaQuerySet> MediaQueryParser::parseInternal(CSSParserTokenRange range)
</del><ins>+RefPtr<MediaQuerySet> MediaQueryParser::parseInternal(CSSParserTokenRange range)
</ins><span class="cx"> {
</span><span class="cx"> while (!range.atEnd())
</span><span class="cx"> processToken(range.consume());
</span><span class="lines">@@ -261,7 +261,7 @@
</span><span class="cx"> } else if (m_mediaQueryData.currentMediaQueryChanged())
</span><span class="cx"> commitMediaQuery();
</span><span class="cx">
</span><del>- return WTFMove(m_querySet);
</del><ins>+ return m_querySet;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MediaQueryData::MediaQueryData()
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserMediaQueryParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/MediaQueryParser.h (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/MediaQueryParser.h        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/css/parser/MediaQueryParser.h        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -76,9 +76,9 @@
</span><span class="cx"> class MediaQueryParser {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(MediaQueryParser);
</span><span class="cx"> public:
</span><del>- static Ref<MediaQuerySet> parseMediaQuerySet(const String&);
- static Ref<MediaQuerySet> parseMediaQuerySet(CSSParserTokenRange);
- static Ref<MediaQuerySet> parseMediaCondition(CSSParserTokenRange);
</del><ins>+ static RefPtr<MediaQuerySet> parseMediaQuerySet(const String&);
+ static RefPtr<MediaQuerySet> parseMediaQuerySet(CSSParserTokenRange);
+ static RefPtr<MediaQuerySet> parseMediaCondition(CSSParserTokenRange);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> enum ParserType {
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> MediaQueryParser(ParserType);
</span><span class="cx"> virtual ~MediaQueryParser();
</span><span class="cx">
</span><del>- Ref<MediaQuerySet> parseInternal(CSSParserTokenRange);
</del><ins>+ RefPtr<MediaQuerySet> parseInternal(CSSParserTokenRange);
</ins><span class="cx">
</span><span class="cx"> void processToken(const CSSParserToken&);
</span><span class="cx">
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx"> State m_state;
</span><span class="cx"> ParserType m_parserType;
</span><span class="cx"> MediaQueryData m_mediaQueryData;
</span><del>- Ref<MediaQuerySet> m_querySet;
</del><ins>+ RefPtr<MediaQuerySet> m_querySet;
</ins><span class="cx"> MediaQueryBlockWatcher m_blockWatcher;
</span><span class="cx">
</span><span class="cx"> const static State ReadRestrictor;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -2117,7 +2117,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> auto parsedStyle = MutableStyleProperties::create();
</span><del>- CSSParser::parseValue(parsedStyle, CSSPropertyFont, newFont, true, strictToCSSParserMode(!m_usesCSSCompatibilityParseMode));
</del><ins>+ CSSParser::parseValue(parsedStyle, CSSPropertyFont, newFont, true, strictToCSSParserMode(!m_usesCSSCompatibilityParseMode), nullptr);
</ins><span class="cx"> if (parsedStyle->isEmpty())
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -34,10 +34,6 @@
</span><span class="cx"> #include "Autofill.h"
</span><span class="cx"> #include "BackForwardController.h"
</span><span class="cx"> #include "BitmapImage.h"
</span><del>-#include "CSSKeyframesRule.h"
-#include "CSSMediaRule.h"
-#include "CSSStyleRule.h"
-#include "CSSSupportsRule.h"
</del><span class="cx"> #include "CachedImage.h"
</span><span class="cx"> #include "CachedResourceLoader.h"
</span><span class="cx"> #include "Chrome.h"
</span><span class="lines">@@ -123,7 +119,6 @@
</span><span class="cx"> #include "SourceBuffer.h"
</span><span class="cx"> #include "SpellChecker.h"
</span><span class="cx"> #include "StaticNodeList.h"
</span><del>-#include "StyleRule.h"
</del><span class="cx"> #include "StyleScope.h"
</span><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx"> #include "TextIterator.h"
</span><span class="lines">@@ -850,101 +845,6 @@
</span><span class="cx"> return element.setPseudo(id);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static unsigned deferredStyleRulesCountForList(const Vector<RefPtr<StyleRuleBase>>& childRules)
-{
- unsigned count = 0;
- for (auto rule : childRules) {
- if (is<StyleRule>(rule.get())) {
- auto* cssRule = downcast<StyleRule>(rule.get());
- if (!cssRule->propertiesWithoutDeferredParsing())
- count++;
- continue;
- }
-
- StyleRuleGroup* groupRule = nullptr;
- if (is<StyleRuleMedia>(rule.get()))
- groupRule = downcast<StyleRuleMedia>(rule.get());
- else if (is<StyleRuleSupports>(rule.get()))
- groupRule = downcast<StyleRuleSupports>(rule.get());
- if (!groupRule)
- continue;
-
- auto* groupChildRules = groupRule->childRulesWithoutDeferredParsing();
- if (!groupChildRules)
- continue;
-
- count += deferredStyleRulesCountForList(*groupChildRules);
- }
-
- return count;
-}
-
-unsigned Internals::deferredStyleRulesCount(StyleSheet& styleSheet)
-{
- return deferredStyleRulesCountForList(downcast<CSSStyleSheet>(styleSheet).contents().childRules());
-}
-
-static unsigned deferredGroupRulesCountForList(const Vector<RefPtr<StyleRuleBase>>& childRules)
-{
- unsigned count = 0;
- for (auto rule : childRules) {
- StyleRuleGroup* groupRule = nullptr;
- if (is<StyleRuleMedia>(rule.get()))
- groupRule = downcast<StyleRuleMedia>(rule.get());
- else if (is<StyleRuleSupports>(rule.get()))
- groupRule = downcast<StyleRuleSupports>(rule.get());
- if (!groupRule)
- continue;
-
- auto* groupChildRules = groupRule->childRulesWithoutDeferredParsing();
- if (!groupChildRules)
- count++;
- else
- count += deferredGroupRulesCountForList(*groupChildRules);
- }
- return count;
-}
-
-unsigned Internals::deferredGroupRulesCount(StyleSheet& styleSheet)
-{
- return deferredGroupRulesCountForList(downcast<CSSStyleSheet>(styleSheet).contents().childRules());
-}
-
-static unsigned deferredKeyframesRulesCountForList(const Vector<RefPtr<StyleRuleBase>>& childRules)
-{
- unsigned count = 0;
- for (auto rule : childRules) {
- if (is<StyleRuleKeyframes>(rule.get())) {
- auto* cssRule = downcast<StyleRuleKeyframes>(rule.get());
- if (!cssRule->keyframesWithoutDeferredParsing())
- count++;
- continue;
- }
-
- StyleRuleGroup* groupRule = nullptr;
- if (is<StyleRuleMedia>(rule.get()))
- groupRule = downcast<StyleRuleMedia>(rule.get());
- else if (is<StyleRuleSupports>(rule.get()))
- groupRule = downcast<StyleRuleSupports>(rule.get());
- if (!groupRule)
- continue;
-
- auto* groupChildRules = groupRule->childRulesWithoutDeferredParsing();
- if (!groupChildRules)
- continue;
-
- count += deferredKeyframesRulesCountForList(*groupChildRules);
- }
-
- return count;
-}
-
-unsigned Internals::deferredKeyframesRulesCount(StyleSheet& styleSheet)
-{
- StyleSheetContents& contents = downcast<CSSStyleSheet>(styleSheet).contents();
- return deferredKeyframesRulesCountForList(contents.childRules());
-}
-
</del><span class="cx"> ExceptionOr<bool> Internals::isTimerThrottled(int timeoutId)
</span><span class="cx"> {
</span><span class="cx"> DOMTimer* timer = scriptExecutionContext()->findTimeout(timeoutId);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/testing/Internals.h        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -67,7 +67,6 @@
</span><span class="cx"> class RTCPeerConnection;
</span><span class="cx"> class SerializedScriptValue;
</span><span class="cx"> class SourceBuffer;
</span><del>-class StyleSheet;
</del><span class="cx"> class TimeRanges;
</span><span class="cx"> class TypeConversions;
</span><span class="cx"> class XMLHttpRequest;
</span><span class="lines">@@ -118,11 +117,6 @@
</span><span class="cx"> String shadowPseudoId(Element&);
</span><span class="cx"> void setShadowPseudoId(Element&, const String&);
</span><span class="cx">
</span><del>- // CSS Deferred Parsing Testing
- unsigned deferredStyleRulesCount(StyleSheet&);
- unsigned deferredGroupRulesCount(StyleSheet&);
- unsigned deferredKeyframesRulesCount(StyleSheet&);
-
</del><span class="cx"> // DOMTimers throttling testing.
</span><span class="cx"> ExceptionOr<bool> isTimerThrottled(int timeoutId);
</span><span class="cx"> bool isRequestAnimationFrameThrottled() const;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (209793 => 209794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2016-12-14 07:20:33 UTC (rev 209793)
+++ trunk/Source/WebCore/testing/Internals.idl        2016-12-14 08:23:23 UTC (rev 209794)
</span><span class="lines">@@ -108,11 +108,6 @@
</span><span class="cx"> Node ensureUserAgentShadowRoot(Element host);
</span><span class="cx"> Node shadowRoot(Element host);
</span><span class="cx">
</span><del>- // CSS Deferred Parsing Testing.
- long deferredStyleRulesCount(StyleSheet sheet);
- long deferredGroupRulesCount(StyleSheet sheet);
- long deferredKeyframesRulesCount(StyleSheet sheet);
-
</del><span class="cx"> [MayThrowException] DOMString shadowRootType(Node root);
</span><span class="cx"> DOMString shadowPseudoId(Element element);
</span><span class="cx"> void setShadowPseudoId(Element element, DOMString id);
</span></span></pre>
</div>
</div>
</body>
</html>