<!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>[230184] tags/Safari-606.1.7.4/Source</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/230184">230184</a></dd>
<dt>Author</dt> <dd>jmarcell@apple.com</dd>
<dt>Date</dt> <dd>2018-04-02 14:06:22 -0700 (Mon, 02 Apr 2018)</dd>
</dl>

<h3>Log Message</h3>
<pre>Cherry-pick <a href="http://trac.webkit.org/projects/webkit/changeset/229654">r229654</a>. rdar://problem/38382934

    Create MediaQueryParserContext to provide additional context for the evaluation of media queries
    https://bugs.webkit.org/show_bug.cgi?id=183677

    Reviewed by Tim Horton.

    We need additional context for parsing media queries to make sure they are parsed correctly and valid.

    Source/WebCore:

    Not currently testable, will add tests in a later patch.

    * WebCore.xcodeproj/project.pbxproj:
    * css/MediaList.cpp:
    (WebCore::MediaQuerySet::create):
    (WebCore::MediaQuerySet::set):
    (WebCore::MediaQuerySet::add):
    (WebCore::MediaQuerySet::remove):
    * css/MediaList.h:
    * css/MediaQueryEvaluator.cpp:
    (WebCore::MediaQueryEvaluator::mediaAttributeMatches):
    * css/MediaQueryExpression.cpp:
    (WebCore::featureWithValidIdent):
    (WebCore::featureWithValidDensity):
    (WebCore::featureWithValidPositiveLength):
    (WebCore::featureWithPositiveInteger):
    (WebCore::featureWithPositiveNumber):
    (WebCore::featureWithZeroOrOne):
    (WebCore::isFeatureValidWithoutValue):
    (WebCore::MediaQueryExpression::MediaQueryExpression):
    * css/MediaQueryExpression.h:
    * css/MediaQueryMatcher.cpp:
    (WebCore::MediaQueryMatcher::matchMedia):
    * css/MediaQueryParserContext.cpp: Added.
    (WebCore::MediaQueryParserContext::MediaQueryParserContext):
    * css/MediaQueryParserContext.h: Added.
    (WebCore::MediaQueryParserContext::MediaQueryParserContext):
    * css/StyleMedia.cpp:
    (WebCore::StyleMedia::matchMedium const):
    * css/StyleRuleImport.cpp:
    (WebCore::StyleRuleImport::StyleRuleImport):
    (WebCore::StyleRuleImport::setCSSStyleSheet):
    * css/parser/CSSParser.cpp:
    (WebCore::CSSParserContext::CSSParserContext):
    (WebCore::operator==):
    * css/parser/CSSParserImpl.cpp:
    (WebCore::CSSParserImpl::consumeImportRule):
    (WebCore::CSSParserImpl::consumeMediaRule):
    * css/parser/MediaQueryParser.cpp:
    (WebCore::MediaQueryParser::parseMediaQuerySet):
    (WebCore::MediaQueryParser::parseMediaCondition):
    (WebCore::MediaQueryParser::MediaQueryParser):
    (WebCore::MediaQueryData::addExpression):
    * css/parser/MediaQueryParser.h:
    (WebCore::MediaQueryData::setMediaQueryParserContext):
    * css/parser/SizesAttributeParser.cpp:
    (WebCore::SizesAttributeParser::parse):
    * dom/DOMImplementation.cpp:
    (WebCore::DOMImplementation::createCSSStyleSheet):
    * dom/InlineStyleSheetOwner.cpp:
    (WebCore::InlineStyleSheetOwner::createSheet):
    * dom/ProcessingInstruction.cpp:
    (WebCore::ProcessingInstruction::setCSSStyleSheet):
    * html/HTMLImageElement.cpp:
    (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
    * html/HTMLLinkElement.cpp:
    (WebCore::HTMLLinkElement::process):
    (WebCore::HTMLLinkElement::initializeStyleSheet):
    (WebCore::HTMLLinkElement::setCSSStyleSheet):
    * html/HTMLLinkElement.h:
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::selectNextSourceChild):
    * html/HTMLSourceElement.cpp:
    (WebCore::HTMLSourceElement::parsedMediaAttribute const):
    * html/HTMLSourceElement.h:
    * html/HTMLStyleElement.cpp:
    (WebCore::HTMLStyleElement::parseAttribute):
    * html/parser/HTMLPreloadScanner.cpp:
    (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):

    Source/WebKitLegacy/mac:

    * DOM/DOM.mm:
    (-[DOMHTMLLinkElement _mediaQueryMatches]):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229654 268f45cc-cd09-0410-ab3c-d52691b4dbfc</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#tagsSafari606174SourceWebCoreChangeLog">tags/Safari-606.1.7.4/Source/WebCore/ChangeLog</a></li>
<li><a href="#tagsSafari606174SourceWebCoreSourcestxt">tags/Safari-606.1.7.4/Source/WebCore/Sources.txt</a></li>
<li><a href="#tagsSafari606174SourceWebCoreWebCorexcodeprojprojectpbxproj">tags/Safari-606.1.7.4/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssMediaListcpp">tags/Safari-606.1.7.4/Source/WebCore/css/MediaList.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssMediaListh">tags/Safari-606.1.7.4/Source/WebCore/css/MediaList.h</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssMediaQueryEvaluatorcpp">tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryEvaluator.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssMediaQueryExpressioncpp">tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryExpression.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssMediaQueryExpressionh">tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryExpression.h</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssMediaQueryMatchercpp">tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryMatcher.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssStyleMediacpp">tags/Safari-606.1.7.4/Source/WebCore/css/StyleMedia.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssStyleRuleImportcpp">tags/Safari-606.1.7.4/Source/WebCore/css/StyleRuleImport.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssparserCSSParsercpp">tags/Safari-606.1.7.4/Source/WebCore/css/parser/CSSParser.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssparserCSSParserImplcpp">tags/Safari-606.1.7.4/Source/WebCore/css/parser/CSSParserImpl.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssparserMediaQueryParsercpp">tags/Safari-606.1.7.4/Source/WebCore/css/parser/MediaQueryParser.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssparserMediaQueryParserh">tags/Safari-606.1.7.4/Source/WebCore/css/parser/MediaQueryParser.h</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssparserSizesAttributeParsercpp">tags/Safari-606.1.7.4/Source/WebCore/css/parser/SizesAttributeParser.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCoredomInlineStyleSheetOwnercpp">tags/Safari-606.1.7.4/Source/WebCore/dom/InlineStyleSheetOwner.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCoredomProcessingInstructioncpp">tags/Safari-606.1.7.4/Source/WebCore/dom/ProcessingInstruction.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorehtmlHTMLImageElementcpp">tags/Safari-606.1.7.4/Source/WebCore/html/HTMLImageElement.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorehtmlHTMLLinkElementcpp">tags/Safari-606.1.7.4/Source/WebCore/html/HTMLLinkElement.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorehtmlHTMLLinkElementh">tags/Safari-606.1.7.4/Source/WebCore/html/HTMLLinkElement.h</a></li>
<li><a href="#tagsSafari606174SourceWebCorehtmlHTMLMediaElementcpp">tags/Safari-606.1.7.4/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorehtmlHTMLSourceElementcpp">tags/Safari-606.1.7.4/Source/WebCore/html/HTMLSourceElement.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorehtmlHTMLSourceElementh">tags/Safari-606.1.7.4/Source/WebCore/html/HTMLSourceElement.h</a></li>
<li><a href="#tagsSafari606174SourceWebCorehtmlHTMLStyleElementcpp">tags/Safari-606.1.7.4/Source/WebCore/html/HTMLStyleElement.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorehtmlparserHTMLPreloadScannercpp">tags/Safari-606.1.7.4/Source/WebCore/html/parser/HTMLPreloadScanner.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebKitLegacymacChangeLog">tags/Safari-606.1.7.4/Source/WebKitLegacy/mac/ChangeLog</a></li>
<li><a href="#tagsSafari606174SourceWebKitLegacymacDOMDOMmm">tags/Safari-606.1.7.4/Source/WebKitLegacy/mac/DOM/DOM.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#tagsSafari606174SourceWebCorecssMediaQueryParserContextcpp">tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryParserContext.cpp</a></li>
<li><a href="#tagsSafari606174SourceWebCorecssMediaQueryParserContexth">tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryParserContext.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="tagsSafari606174SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/ChangeLog (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/ChangeLog   2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/ChangeLog      2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -1,5 +1,176 @@
</span><span class="cx"> 2018-04-02  Jason Marcell  <jmarcell@apple.com>
</span><span class="cx"> 
</span><ins>+        Cherry-pick r229654. rdar://problem/38382934
+
+    Create MediaQueryParserContext to provide additional context for the evaluation of media queries
+    https://bugs.webkit.org/show_bug.cgi?id=183677
+    
+    Reviewed by Tim Horton.
+    
+    We need additional context for parsing media queries to make sure they are parsed correctly and valid.
+    
+    Source/WebCore:
+    
+    Not currently testable, will add tests in a later patch.
+    
+    * WebCore.xcodeproj/project.pbxproj:
+    * css/MediaList.cpp:
+    (WebCore::MediaQuerySet::create):
+    (WebCore::MediaQuerySet::set):
+    (WebCore::MediaQuerySet::add):
+    (WebCore::MediaQuerySet::remove):
+    * css/MediaList.h:
+    * css/MediaQueryEvaluator.cpp:
+    (WebCore::MediaQueryEvaluator::mediaAttributeMatches):
+    * css/MediaQueryExpression.cpp:
+    (WebCore::featureWithValidIdent):
+    (WebCore::featureWithValidDensity):
+    (WebCore::featureWithValidPositiveLength):
+    (WebCore::featureWithPositiveInteger):
+    (WebCore::featureWithPositiveNumber):
+    (WebCore::featureWithZeroOrOne):
+    (WebCore::isFeatureValidWithoutValue):
+    (WebCore::MediaQueryExpression::MediaQueryExpression):
+    * css/MediaQueryExpression.h:
+    * css/MediaQueryMatcher.cpp:
+    (WebCore::MediaQueryMatcher::matchMedia):
+    * css/MediaQueryParserContext.cpp: Added.
+    (WebCore::MediaQueryParserContext::MediaQueryParserContext):
+    * css/MediaQueryParserContext.h: Added.
+    (WebCore::MediaQueryParserContext::MediaQueryParserContext):
+    * css/StyleMedia.cpp:
+    (WebCore::StyleMedia::matchMedium const):
+    * css/StyleRuleImport.cpp:
+    (WebCore::StyleRuleImport::StyleRuleImport):
+    (WebCore::StyleRuleImport::setCSSStyleSheet):
+    * css/parser/CSSParser.cpp:
+    (WebCore::CSSParserContext::CSSParserContext):
+    (WebCore::operator==):
+    * css/parser/CSSParserImpl.cpp:
+    (WebCore::CSSParserImpl::consumeImportRule):
+    (WebCore::CSSParserImpl::consumeMediaRule):
+    * css/parser/MediaQueryParser.cpp:
+    (WebCore::MediaQueryParser::parseMediaQuerySet):
+    (WebCore::MediaQueryParser::parseMediaCondition):
+    (WebCore::MediaQueryParser::MediaQueryParser):
+    (WebCore::MediaQueryData::addExpression):
+    * css/parser/MediaQueryParser.h:
+    (WebCore::MediaQueryData::setMediaQueryParserContext):
+    * css/parser/SizesAttributeParser.cpp:
+    (WebCore::SizesAttributeParser::parse):
+    * dom/DOMImplementation.cpp:
+    (WebCore::DOMImplementation::createCSSStyleSheet):
+    * dom/InlineStyleSheetOwner.cpp:
+    (WebCore::InlineStyleSheetOwner::createSheet):
+    * dom/ProcessingInstruction.cpp:
+    (WebCore::ProcessingInstruction::setCSSStyleSheet):
+    * html/HTMLImageElement.cpp:
+    (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
+    * html/HTMLLinkElement.cpp:
+    (WebCore::HTMLLinkElement::process):
+    (WebCore::HTMLLinkElement::initializeStyleSheet):
+    (WebCore::HTMLLinkElement::setCSSStyleSheet):
+    * html/HTMLLinkElement.h:
+    * html/HTMLMediaElement.cpp:
+    (WebCore::HTMLMediaElement::selectNextSourceChild):
+    * html/HTMLSourceElement.cpp:
+    (WebCore::HTMLSourceElement::parsedMediaAttribute const):
+    * html/HTMLSourceElement.h:
+    * html/HTMLStyleElement.cpp:
+    (WebCore::HTMLStyleElement::parseAttribute):
+    * html/parser/HTMLPreloadScanner.cpp:
+    (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
+    
+    Source/WebKitLegacy/mac:
+    
+    * DOM/DOM.mm:
+    (-[DOMHTMLLinkElement _mediaQueryMatches]):
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229654 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-03-15  Megan Gardner  <megan_gardner@apple.com>
+
+            Create MediaQueryParserContext to provide additional context for the evaluation of media queries
+            https://bugs.webkit.org/show_bug.cgi?id=183677
+
+            Reviewed by Tim Horton.
+
+            We need additional context for parsing media queries to make sure they are parsed correctly and valid.
+
+            Not currently testable, will add tests in a later patch.
+
+            * WebCore.xcodeproj/project.pbxproj:
+            * css/MediaList.cpp:
+            (WebCore::MediaQuerySet::create):
+            (WebCore::MediaQuerySet::set):
+            (WebCore::MediaQuerySet::add):
+            (WebCore::MediaQuerySet::remove):
+            * css/MediaList.h:
+            * css/MediaQueryEvaluator.cpp:
+            (WebCore::MediaQueryEvaluator::mediaAttributeMatches):
+            * css/MediaQueryExpression.cpp:
+            (WebCore::featureWithValidIdent):
+            (WebCore::featureWithValidDensity):
+            (WebCore::featureWithValidPositiveLength):
+            (WebCore::featureWithPositiveInteger):
+            (WebCore::featureWithPositiveNumber):
+            (WebCore::featureWithZeroOrOne):
+            (WebCore::isFeatureValidWithoutValue):
+            (WebCore::MediaQueryExpression::MediaQueryExpression):
+            * css/MediaQueryExpression.h:
+            * css/MediaQueryMatcher.cpp:
+            (WebCore::MediaQueryMatcher::matchMedia):
+            * css/MediaQueryParserContext.cpp: Added.
+            (WebCore::MediaQueryParserContext::MediaQueryParserContext):
+            * css/MediaQueryParserContext.h: Added.
+            (WebCore::MediaQueryParserContext::MediaQueryParserContext):
+            * css/StyleMedia.cpp:
+            (WebCore::StyleMedia::matchMedium const):
+            * css/StyleRuleImport.cpp:
+            (WebCore::StyleRuleImport::StyleRuleImport):
+            (WebCore::StyleRuleImport::setCSSStyleSheet):
+            * css/parser/CSSParser.cpp:
+            (WebCore::CSSParserContext::CSSParserContext):
+            (WebCore::operator==):
+            * css/parser/CSSParserImpl.cpp:
+            (WebCore::CSSParserImpl::consumeImportRule):
+            (WebCore::CSSParserImpl::consumeMediaRule):
+            * css/parser/MediaQueryParser.cpp:
+            (WebCore::MediaQueryParser::parseMediaQuerySet):
+            (WebCore::MediaQueryParser::parseMediaCondition):
+            (WebCore::MediaQueryParser::MediaQueryParser):
+            (WebCore::MediaQueryData::addExpression):
+            * css/parser/MediaQueryParser.h:
+            (WebCore::MediaQueryData::setMediaQueryParserContext):
+            * css/parser/SizesAttributeParser.cpp:
+            (WebCore::SizesAttributeParser::parse):
+            * dom/DOMImplementation.cpp:
+            (WebCore::DOMImplementation::createCSSStyleSheet):
+            * dom/InlineStyleSheetOwner.cpp:
+            (WebCore::InlineStyleSheetOwner::createSheet):
+            * dom/ProcessingInstruction.cpp:
+            (WebCore::ProcessingInstruction::setCSSStyleSheet):
+            * html/HTMLImageElement.cpp:
+            (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
+            * html/HTMLLinkElement.cpp:
+            (WebCore::HTMLLinkElement::process):
+            (WebCore::HTMLLinkElement::initializeStyleSheet):
+            (WebCore::HTMLLinkElement::setCSSStyleSheet):
+            * html/HTMLLinkElement.h:
+            * html/HTMLMediaElement.cpp:
+            (WebCore::HTMLMediaElement::selectNextSourceChild):
+            * html/HTMLSourceElement.cpp:
+            (WebCore::HTMLSourceElement::parsedMediaAttribute const):
+            * html/HTMLSourceElement.h:
+            * html/HTMLStyleElement.cpp:
+            (WebCore::HTMLStyleElement::parseAttribute):
+            * html/parser/HTMLPreloadScanner.cpp:
+            (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
+
+2018-04-02  Jason Marcell  <jmarcell@apple.com>
+
</ins><span class="cx">         Cherry-pick r229511. rdar://problem/38326388
</span><span class="cx"> 
</span><span class="cx">     Media query for default appearance
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/Sources.txt (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/Sources.txt 2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/Sources.txt    2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -627,6 +627,7 @@
</span><span class="cx"> css/MediaQueryExpression.cpp
</span><span class="cx"> css/MediaQueryList.cpp
</span><span class="cx"> css/MediaQueryMatcher.cpp
</span><ins>+css/MediaQueryParserContext.cpp
</ins><span class="cx"> css/PageRuleCollector.cpp
</span><span class="cx"> css/PropertySetCSSStyleDeclaration.cpp
</span><span class="cx"> css/RGBColor.cpp
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/WebCore.xcodeproj/project.pbxproj (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -1174,6 +1174,7 @@
</span><span class="cx">          443918001A91B2F8006E04F2 /* QuickLookSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 443917FE1A91B2F8006E04F2 /* QuickLookSoftLink.h */; };
</span><span class="cx">          445775E520472F73008DCE5D /* LocalDefaultSystemAppearance.h in Headers */ = {isa = PBXBuildFile; fileRef = 445775E420472F73008DCE5D /* LocalDefaultSystemAppearance.h */; };
</span><span class="cx">          445775EA2047303C008DCE5D /* LocalDefaultSystemAppearance.mm in Sources */ = {isa = PBXBuildFile; fileRef = 445775E92047303B008DCE5D /* LocalDefaultSystemAppearance.mm */; };
</span><ins>+               4471710E205AF945000A116E /* MediaQueryParserContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 4471710C205AF945000A116E /* MediaQueryParserContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           447958041643B49A001E0A7F /* ParsedContentType.h in Headers */ = {isa = PBXBuildFile; fileRef = 447958031643B47B001E0A7F /* ParsedContentType.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          448A29BF0A46D9CB0030759F /* JSHTMLOptionsCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 448A29BD0A46D9CB0030759F /* JSHTMLOptionsCollection.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          448B1B7A0F3A2F9B0047A9E2 /* TextSizeAdjustment.h in Headers */ = {isa = PBXBuildFile; fileRef = 448B1B780F3A2F9B0047A9E2 /* TextSizeAdjustment.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -7377,6 +7378,8 @@
</span><span class="cx">          444D4E210F708B2E003158E0 /* WebCoreURLResponseIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreURLResponseIOS.mm; sourceTree = "<group>"; };
</span><span class="cx">          445775E420472F73008DCE5D /* LocalDefaultSystemAppearance.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalDefaultSystemAppearance.h; sourceTree = "<group>"; };
</span><span class="cx">          445775E92047303B008DCE5D /* LocalDefaultSystemAppearance.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalDefaultSystemAppearance.mm; sourceTree = "<group>"; };
</span><ins>+               4471710B205AF945000A116E /* MediaQueryParserContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaQueryParserContext.cpp; sourceTree = "<group>"; };
+               4471710C205AF945000A116E /* MediaQueryParserContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaQueryParserContext.h; sourceTree = "<group>"; };
</ins><span class="cx">           4476531A133170990006B789 /* SSLKeyGeneratorIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SSLKeyGeneratorIOS.cpp; sourceTree = "<group>"; };
</span><span class="cx">          447958021643B47B001E0A7F /* ParsedContentType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParsedContentType.cpp; sourceTree = "<group>"; };
</span><span class="cx">          447958031643B47B001E0A7F /* ParsedContentType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParsedContentType.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -25332,6 +25335,8 @@
</span><span class="cx">                          D3A94A35122DABAC00A37BBC /* MediaQueryListListener.idl */,
</span><span class="cx">                          D3AA10F1123A98AA0092152B /* MediaQueryMatcher.cpp */,
</span><span class="cx">                          D3AA10F2123A98AA0092152B /* MediaQueryMatcher.h */,
</span><ins>+                               4471710B205AF945000A116E /* MediaQueryParserContext.cpp */,
+                               4471710C205AF945000A116E /* MediaQueryParserContext.h */,
</ins><span class="cx">                           FBDB619C16D6034600BB3394 /* PageRuleCollector.cpp */,
</span><span class="cx">                          FBDB61A016D6037E00BB3394 /* PageRuleCollector.h */,
</span><span class="cx">                          A80E6CD10A1989CA007FB8C5 /* Pair.h */,
</span><span class="lines">@@ -28967,6 +28972,7 @@
</span><span class="cx">                          D3A94A3B122DABAC00A37BBC /* MediaQueryListListener.h in Headers */,
</span><span class="cx">                          D3AA10F4123A98AA0092152B /* MediaQueryMatcher.h in Headers */,
</span><span class="cx">                          9493B6C11D74B4120088E780 /* MediaQueryParser.h in Headers */,
</span><ins>+                               4471710E205AF945000A116E /* MediaQueryParserContext.h in Headers */,
</ins><span class="cx">                           C90843D01B18E47D00B68564 /* MediaRemoteControls.h in Headers */,
</span><span class="cx">                          CD8ACA8F1D23971900ECC59E /* MediaRemoteSoftLink.h in Headers */,
</span><span class="cx">                          CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */,
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssMediaListcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/MediaList.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/MediaList.cpp   2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/MediaList.cpp      2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -61,12 +61,12 @@
</span><span class="cx">  * throw SyntaxError exception.
</span><span class="cx">  */
</span><span class="cx">     
</span><del>-Ref<MediaQuerySet> MediaQuerySet::create(const String& mediaString)
</del><ins>+Ref<MediaQuerySet> MediaQuerySet::create(const String& mediaString, MediaQueryParserContext context)
</ins><span class="cx"> {
</span><span class="cx">     if (mediaString.isEmpty())
</span><span class="cx">         return MediaQuerySet::create();
</span><span class="cx">     
</span><del>-    return MediaQueryParser::parseMediaQuerySet(mediaString).releaseNonNull();
</del><ins>+    return MediaQueryParser::parseMediaQuerySet(mediaString, context).releaseNonNull();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MediaQuerySet::MediaQuerySet() = default;
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssMediaListh"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/MediaList.h (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/MediaList.h     2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/MediaList.h        2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "ExceptionOr.h"
</span><ins>+#include "MediaQueryParserContext.h"
</ins><span class="cx"> #include <memory>
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="lines">@@ -43,9 +44,8 @@
</span><span class="cx">     {
</span><span class="cx">         return adoptRef(*new MediaQuerySet);
</span><span class="cx">     }
</span><ins>+    static WEBCORE_EXPORT Ref<MediaQuerySet> create(const String& mediaString, MediaQueryParserContext = MediaQueryParserContext());
</ins><span class="cx"> 
</span><del>-    static WEBCORE_EXPORT Ref<MediaQuerySet> create(const String& mediaString);
-
</del><span class="cx">     WEBCORE_EXPORT ~MediaQuerySet();
</span><span class="cx"> 
</span><span class="cx">     bool set(const String&);
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssMediaQueryEvaluatorcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryEvaluator.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryEvaluator.cpp 2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryEvaluator.cpp    2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include "MediaFeatureNames.h"
</span><span class="cx"> #include "MediaList.h"
</span><span class="cx"> #include "MediaQuery.h"
</span><ins>+#include "MediaQueryParserContext.h"
</ins><span class="cx"> #include "NodeRenderStyle.h"
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "PlatformScreen.h"
</span><span class="lines">@@ -813,8 +814,8 @@
</span><span class="cx"> bool MediaQueryEvaluator::mediaAttributeMatches(Document& document, const String& attributeValue)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(document.renderView());
</span><del>-    auto mediaQueries = MediaQuerySet::create(attributeValue);
</del><ins>+    auto mediaQueries = MediaQuerySet::create(attributeValue, MediaQueryParserContext(document));
</ins><span class="cx">     return MediaQueryEvaluator { "screen", document, &document.renderView()->style() }.evaluate(mediaQueries.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-} // namespace
</del><ins>+} // WebCore
</ins></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssMediaQueryExpressioncpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryExpression.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryExpression.cpp        2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryExpression.cpp   2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -32,12 +32,13 @@
</span><span class="cx"> #include "CSSPrimitiveValue.h"
</span><span class="cx"> #include "CSSPropertyParserHelpers.h"
</span><span class="cx"> #include "MediaFeatureNames.h"
</span><ins>+#include "MediaQueryParserContext.h"
</ins><span class="cx"> #include <wtf/text/TextStream.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static inline bool featureWithValidIdent(const AtomicString& mediaFeature, const CSSPrimitiveValue& value)
</del><ins>+static inline bool featureWithValidIdent(const AtomicString& mediaFeature, const CSSPrimitiveValue& value, const MediaQueryParserContext& context)
</ins><span class="cx"> {
</span><span class="cx">     if (value.primitiveType() != CSSPrimitiveValue::UnitType::CSS_IDENT)
</span><span class="cx">         return false;
</span><span class="lines">@@ -53,7 +54,7 @@
</span><span class="cx">     || mediaFeature == MediaFeatureNames::displayMode
</span><span class="cx"> #endif
</span><span class="cx">     || mediaFeature == MediaFeatureNames::prefersReducedMotion
</span><del>-    || mediaFeature == MediaFeatureNames::defaultAppearance;
</del><ins>+    || (mediaFeature == MediaFeatureNames::defaultAppearance && context.useSystemAppearance);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool featureWithValidDensity(const String& mediaFeature, const CSSPrimitiveValue& value)
</span><span class="lines">@@ -137,7 +138,7 @@
</span><span class="cx">         || mediaFeature == MediaFeatureNames::maxDeviceAspectRatio;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool isFeatureValidWithoutValue(const AtomicString& mediaFeature)
</del><ins>+static inline bool isFeatureValidWithoutValue(const AtomicString& mediaFeature, const MediaQueryParserContext& context)
</ins><span class="cx"> {
</span><span class="cx">     // Media features that are prefixed by min/max cannot be used without a value.
</span><span class="cx">     return mediaFeature == MediaFeatureNames::anyHover
</span><span class="lines">@@ -161,7 +162,7 @@
</span><span class="cx">         || mediaFeature == MediaFeatureNames::invertedColors
</span><span class="cx">         || mediaFeature == MediaFeatureNames::pointer
</span><span class="cx">         || mediaFeature == MediaFeatureNames::prefersReducedMotion
</span><del>-        || mediaFeature == MediaFeatureNames::defaultAppearance
</del><ins>+        || (mediaFeature == MediaFeatureNames::defaultAppearance && context.useSystemAppearance)
</ins><span class="cx">         || mediaFeature == MediaFeatureNames::devicePixelRatio
</span><span class="cx">         || mediaFeature == MediaFeatureNames::resolution
</span><span class="cx"> #if ENABLE(APPLICATION_MANIFEST)
</span><span class="lines">@@ -192,13 +193,13 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-MediaQueryExpression::MediaQueryExpression(const String& feature, CSSParserTokenRange& range)
</del><ins>+MediaQueryExpression::MediaQueryExpression(const String& feature, CSSParserTokenRange& range, MediaQueryParserContext& context)
</ins><span class="cx">     : m_mediaFeature(feature.convertToASCIILowercase())
</span><span class="cx">     , m_isValid(false)
</span><span class="cx"> {
</span><span class="cx">     RefPtr<CSSPrimitiveValue> firstValue = consumeFirstValue(m_mediaFeature, range);
</span><span class="cx">     if (!firstValue) {
</span><del>-        if (isFeatureValidWithoutValue(m_mediaFeature)) {
</del><ins>+        if (isFeatureValidWithoutValue(m_mediaFeature, context)) {
</ins><span class="cx">             // Valid, creates a MediaQueryExp with an 'invalid' MediaQueryExpValue
</span><span class="cx">             m_isValid = true;
</span><span class="cx">         }
</span><span class="lines">@@ -222,7 +223,7 @@
</span><span class="cx">     }
</span><span class="cx">     if (featureWithPositiveInteger(m_mediaFeature, *firstValue) || featureWithPositiveNumber(m_mediaFeature, *firstValue)
</span><span class="cx">         || featureWithZeroOrOne(m_mediaFeature, *firstValue) || featureWithValidDensity(m_mediaFeature, *firstValue)
</span><del>-        || featureWithValidPositiveLength(m_mediaFeature, *firstValue) || featureWithValidIdent(m_mediaFeature, *firstValue)) {
</del><ins>+        || featureWithValidPositiveLength(m_mediaFeature, *firstValue) || featureWithValidIdent(m_mediaFeature, *firstValue, context)) {
</ins><span class="cx">         m_value = firstValue;
</span><span class="cx">         m_isValid = true;
</span><span class="cx">         return;
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssMediaQueryExpressionh"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryExpression.h (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryExpression.h  2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryExpression.h     2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -36,11 +36,13 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+    
+struct MediaQueryParserContext;
</ins><span class="cx"> 
</span><span class="cx"> class MediaQueryExpression {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    explicit MediaQueryExpression(const String& mediaFeature, CSSParserTokenRange&);
</del><ins>+    explicit MediaQueryExpression(const String& mediaFeature, CSSParserTokenRange&, MediaQueryParserContext&);
</ins><span class="cx"> 
</span><span class="cx">     const AtomicString& mediaFeature() const;
</span><span class="cx">     CSSValue* value() const;
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssMediaQueryMatchercpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryMatcher.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryMatcher.cpp   2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryMatcher.cpp      2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #include "MediaQueryEvaluator.h"
</span><span class="cx"> #include "MediaQueryList.h"
</span><span class="cx"> #include "MediaQueryListListener.h"
</span><ins>+#include "MediaQueryParserContext.h"
</ins><span class="cx"> #include "NodeRenderStyle.h"
</span><span class="cx"> #include "RenderElement.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="lines">@@ -82,7 +83,7 @@
</span><span class="cx">     if (!m_document)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto media = MediaQuerySet::create(query);
</del><ins>+    auto media = MediaQuerySet::create(query, MediaQueryParserContext(*m_document));
</ins><span class="cx">     reportMediaQueryWarningIfNeeded(m_document, media.ptr());
</span><span class="cx">     bool result = evaluate(media.get());
</span><span class="cx">     return MediaQueryList::create(*this, WTFMove(media), result);
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssMediaQueryParserContextcppfromrev230183tagsSafari606174SourceWebCorecssStyleMediacpp"></a>
<div class="copfile"><h4>Copied: tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryParserContext.cpp (from rev 230183, tags/Safari-606.1.7.4/Source/WebCore/css/StyleMedia.cpp) (0 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryParserContext.cpp                             (rev 0)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryParserContext.cpp        2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+/*
+ * Copyright (C) 2018 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 "MediaQueryParserContext.h"
+
+#include "CSSParserMode.h"
+#include "Document.h"
+#include "Page.h"
+
+namespace WebCore {
+    
+MediaQueryParserContext::MediaQueryParserContext(const CSSParserContext& context)
+{
+    useSystemAppearance = context.useSystemAppearance;
+}
+
+MediaQueryParserContext::MediaQueryParserContext(const Document& document)
+{
+    useSystemAppearance = document.page() ? document.page()->useSystemAppearance() : false;
+}
+    
+} // namespace WebCore
</ins></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssMediaQueryParserContexthfromrev230183tagsSafari606174SourceWebCorecssStyleMediacpp"></a>
<div class="copfile"><h4>Copied: tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryParserContext.h (from rev 230183, tags/Safari-606.1.7.4/Source/WebCore/css/StyleMedia.cpp) (0 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryParserContext.h                               (rev 0)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/MediaQueryParserContext.h  2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2018 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
+
+namespace WebCore {
+    
+class Document;
+struct CSSParserContext;
+
+struct MediaQueryParserContext {
+public:
+    MediaQueryParserContext() { }
+    MediaQueryParserContext(const CSSParserContext&);
+    WEBCORE_EXPORT MediaQueryParserContext(const Document&);
+    
+    bool useSystemAppearance { false };
+};
+    
+} // namespace WebCore
</ins></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssStyleMediacpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/StyleMedia.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/StyleMedia.cpp  2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/StyleMedia.cpp     2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "FrameView.h"
</span><span class="cx"> #include "MediaList.h"
</span><span class="cx"> #include "MediaQueryEvaluator.h"
</span><ins>+#include "MediaQueryParser.h"
</ins><span class="cx"> #include "NodeRenderStyle.h"
</span><span class="cx"> #include "RenderElement.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="lines">@@ -65,7 +66,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto rootStyle = document->styleScope().resolver().styleForElement(*documentElement, document->renderStyle(), nullptr, MatchOnlyUserAgentRules).renderStyle;
</span><span class="cx"> 
</span><del>-    auto media = MediaQuerySet::create(query);
</del><ins>+    auto media = MediaQuerySet::create(query, MediaQueryParserContext(*document));
</ins><span class="cx"> 
</span><span class="cx">     return MediaQueryEvaluator { type(), *document, rootStyle.get() }.evaluate(media.get());
</span><span class="cx"> }
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssStyleRuleImportcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/StyleRuleImport.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/StyleRuleImport.cpp     2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/StyleRuleImport.cpp        2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include "CachedResourceRequestInitiators.h"
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "MediaList.h"
</span><ins>+#include "MediaQueryParser.h"
</ins><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="lines">@@ -50,7 +51,7 @@
</span><span class="cx">     , m_loading(false)
</span><span class="cx"> {
</span><span class="cx">     if (!m_mediaQueries)
</span><del>-        m_mediaQueries = MediaQuerySet::create(String());
</del><ins>+        m_mediaQueries = MediaQuerySet::create(String(), MediaQueryParserContext());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> StyleRuleImport::~StyleRuleImport()
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssparserCSSParsercpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/parser/CSSParser.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/parser/CSSParser.cpp    2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/parser/CSSParser.cpp       2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include "CSSVariableReferenceValue.h"
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "Element.h"
</span><ins>+#include "Page.h"
</ins><span class="cx"> #include "RenderTheme.h"
</span><span class="cx"> #include "RuntimeEnabledFeatures.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="lines">@@ -92,6 +93,7 @@
</span><span class="cx">     conicGradientsEnabled = document.settings().conicGradientsEnabled();
</span><span class="cx">     deferredCSSParserEnabled = document.settings().deferredCSSParserEnabled();
</span><span class="cx">     allowNewLinesClamp = document.settings().appleMailLinesClampEnabled();
</span><ins>+    useSystemAppearance = document.page() ? document.page()->useSystemAppearance() : false;
</ins><span class="cx">     
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     // FIXME: Force the site specific quirk below to work on iOS. Investigating other site specific quirks
</span><span class="lines">@@ -115,7 +117,8 @@
</span><span class="cx">         && a.constantPropertiesEnabled == b.constantPropertiesEnabled
</span><span class="cx">         && a.conicGradientsEnabled == b.conicGradientsEnabled
</span><span class="cx">         && a.deferredCSSParserEnabled == b.deferredCSSParserEnabled
</span><del>-        && a.hasDocumentSecurityOrigin == b.hasDocumentSecurityOrigin;
</del><ins>+        && a.hasDocumentSecurityOrigin == b.hasDocumentSecurityOrigin
+        && a.useSystemAppearance == b.useSystemAppearance;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CSSParser::CSSParser(const CSSParserContext& context)
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssparserCSSParserImplcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/parser/CSSParserImpl.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/parser/CSSParserImpl.cpp        2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/parser/CSSParserImpl.cpp   2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "MediaList.h"
</span><span class="cx"> #include "MediaQueryParser.h"
</span><ins>+#include "MediaQueryParserContext.h"
</ins><span class="cx"> #include "StyleProperties.h"
</span><span class="cx"> #include "StyleRuleImport.h"
</span><span class="cx"> #include "StyleSheetContents.h"
</span><span class="lines">@@ -517,8 +518,8 @@
</span><span class="cx">         m_observerWrapper->observer().startRuleBody(endOffset);
</span><span class="cx">         m_observerWrapper->observer().endRuleBody(endOffset);
</span><span class="cx">     }
</span><del>-
-    return StyleRuleImport::create(uri, MediaQueryParser::parseMediaQuerySet(prelude).releaseNonNull());
</del><ins>+    
+    return StyleRuleImport::create(uri, MediaQueryParser::parseMediaQuerySet(prelude, MediaQueryParserContext(m_context)).releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr<StyleRuleNamespace> CSSParserImpl::consumeNamespaceRule(CSSParserTokenRange prelude)
</span><span class="lines">@@ -537,7 +538,7 @@
</span><span class="cx"> RefPtr<StyleRuleMedia> CSSParserImpl::consumeMediaRule(CSSParserTokenRange prelude, CSSParserTokenRange block)
</span><span class="cx"> {
</span><span class="cx">     if (m_deferredParser)
</span><del>-        return StyleRuleMedia::create(MediaQueryParser::parseMediaQuerySet(prelude).releaseNonNull(),  std::make_unique<DeferredStyleGroupRuleList>(block, *m_deferredParser));
</del><ins>+        return StyleRuleMedia::create(MediaQueryParser::parseMediaQuerySet(prelude, MediaQueryParserContext(m_context)).releaseNonNull(),  std::make_unique<DeferredStyleGroupRuleList>(block, *m_deferredParser));
</ins><span class="cx"> 
</span><span class="cx">     Vector<RefPtr<StyleRuleBase>> rules;
</span><span class="cx"> 
</span><span class="lines">@@ -554,7 +555,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).releaseNonNull(), rules);
</del><ins>+    return StyleRuleMedia::create(MediaQueryParser::parseMediaQuerySet(prelude, MediaQueryParserContext(m_context)).releaseNonNull(), rules);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr<StyleRuleSupports> CSSParserImpl::consumeSupportsRule(CSSParserTokenRange prelude, CSSParserTokenRange block)
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssparserMediaQueryParsercpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/parser/MediaQueryParser.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/parser/MediaQueryParser.cpp     2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/parser/MediaQueryParser.cpp        2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -32,23 +32,24 @@
</span><span class="cx"> 
</span><span class="cx"> #include "CSSTokenizer.h"
</span><span class="cx"> #include "MediaList.h"
</span><ins>+#include "MediaQueryParserContext.h"
</ins><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-RefPtr<MediaQuerySet> MediaQueryParser::parseMediaQuerySet(const String& queryString)
</del><ins>+RefPtr<MediaQuerySet> MediaQueryParser::parseMediaQuerySet(const String& queryString, MediaQueryParserContext context)
</ins><span class="cx"> {
</span><del>-    return parseMediaQuerySet(CSSTokenizer(queryString).tokenRange());
</del><ins>+    return parseMediaQuerySet(CSSTokenizer(queryString).tokenRange(), context);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<MediaQuerySet> MediaQueryParser::parseMediaQuerySet(CSSParserTokenRange range)
</del><ins>+RefPtr<MediaQuerySet> MediaQueryParser::parseMediaQuerySet(CSSParserTokenRange range, MediaQueryParserContext context)
</ins><span class="cx"> {
</span><del>-    return MediaQueryParser(MediaQuerySetParser).parseInternal(range);
</del><ins>+    return MediaQueryParser(MediaQuerySetParser, context).parseInternal(range);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<MediaQuerySet> MediaQueryParser::parseMediaCondition(CSSParserTokenRange range)
</del><ins>+RefPtr<MediaQuerySet> MediaQueryParser::parseMediaCondition(CSSParserTokenRange range, MediaQueryParserContext context)
</ins><span class="cx"> {
</span><del>-    return MediaQueryParser(MediaConditionParser).parseInternal(range);
</del><ins>+    return MediaQueryParser(MediaConditionParser, context).parseInternal(range);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const MediaQueryParser::State MediaQueryParser::ReadRestrictor = &MediaQueryParser::readRestrictor;
</span><span class="lines">@@ -64,9 +65,11 @@
</span><span class="cx"> const MediaQueryParser::State MediaQueryParser::SkipUntilBlockEnd = &MediaQueryParser::skipUntilBlockEnd;
</span><span class="cx"> const MediaQueryParser::State MediaQueryParser::Done = &MediaQueryParser::done;
</span><span class="cx"> 
</span><del>-MediaQueryParser::MediaQueryParser(ParserType parserType)
</del><ins>+MediaQueryParser::MediaQueryParser(ParserType parserType, MediaQueryParserContext context)
</ins><span class="cx">     : m_parserType(parserType)
</span><ins>+    , m_mediaQueryData(context)
</ins><span class="cx">     , m_querySet(MediaQuerySet::create())
</span><ins>+    
</ins><span class="cx"> {
</span><span class="cx">     if (parserType == MediaQuerySetParser)
</span><span class="cx">         m_state = &MediaQueryParser::readRestrictor;
</span><span class="lines">@@ -271,10 +274,11 @@
</span><span class="cx">     return m_querySet;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-MediaQueryData::MediaQueryData()
</del><ins>+MediaQueryData::MediaQueryData(MediaQueryParserContext context)
</ins><span class="cx">     : m_restrictor(MediaQuery::None)
</span><span class="cx">     , m_mediaType("all")
</span><span class="cx">     , m_mediaTypeSet(false)
</span><ins>+    , m_context(context)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -289,7 +293,7 @@
</span><span class="cx"> 
</span><span class="cx"> void MediaQueryData::addExpression(CSSParserTokenRange& range)
</span><span class="cx"> {
</span><del>-    MediaQueryExpression expression = MediaQueryExpression(m_mediaFeature, range);
</del><ins>+    MediaQueryExpression expression = MediaQueryExpression(m_mediaFeature, range, m_context);
</ins><span class="cx">     m_expressions.append(WTFMove(expression));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -309,4 +313,4 @@
</span><span class="cx">     m_mediaTypeSet = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-} // namespace WebCsore
</del><ins>+} // namespace WebCore
</ins></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssparserMediaQueryParserh"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/parser/MediaQueryParser.h (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/parser/MediaQueryParser.h       2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/parser/MediaQueryParser.h  2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -34,16 +34,18 @@
</span><span class="cx"> #include "MediaQuery.h"
</span><span class="cx"> #include "MediaQueryBlockWatcher.h"
</span><span class="cx"> #include "MediaQueryExpression.h"
</span><ins>+#include "MediaQueryParserContext.h"
</ins><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class MediaQuerySet;
</span><ins>+struct CSSParserContext;
</ins><span class="cx"> 
</span><span class="cx"> class MediaQueryData {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(MediaQueryData);
</span><span class="cx"> public:
</span><del>-    MediaQueryData();
</del><ins>+    MediaQueryData(MediaQueryParserContext context);
</ins><span class="cx">     void clear();
</span><span class="cx">     void addExpression(CSSParserTokenRange&);
</span><span class="cx">     bool lastExpressionValid();
</span><span class="lines">@@ -63,6 +65,8 @@
</span><span class="cx">     inline void setRestrictor(MediaQuery::Restrictor restrictor) { m_restrictor = restrictor; }
</span><span class="cx"> 
</span><span class="cx">     inline void setMediaFeature(const String& str) { m_mediaFeature = str; }
</span><ins>+    
+    inline void setMediaQueryParserContext(MediaQueryParserContext context) { m_context = context; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     MediaQuery::Restrictor m_restrictor;
</span><span class="lines">@@ -70,14 +74,15 @@
</span><span class="cx">     Vector<MediaQueryExpression> m_expressions;
</span><span class="cx">     String m_mediaFeature;
</span><span class="cx">     bool m_mediaTypeSet;
</span><ins>+    MediaQueryParserContext m_context;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class MediaQueryParser {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(MediaQueryParser);
</span><span class="cx"> public:
</span><del>-    static RefPtr<MediaQuerySet> parseMediaQuerySet(const String&);
-    static RefPtr<MediaQuerySet> parseMediaQuerySet(CSSParserTokenRange);
-    static RefPtr<MediaQuerySet> parseMediaCondition(CSSParserTokenRange);
</del><ins>+    static RefPtr<MediaQuerySet> parseMediaQuerySet(const String&, MediaQueryParserContext);
+    static RefPtr<MediaQuerySet> parseMediaQuerySet(CSSParserTokenRange, MediaQueryParserContext);
+    static RefPtr<MediaQuerySet> parseMediaCondition(CSSParserTokenRange, MediaQueryParserContext);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     enum ParserType {
</span><span class="lines">@@ -85,7 +90,7 @@
</span><span class="cx">         MediaConditionParser,
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    MediaQueryParser(ParserType);
</del><ins>+    MediaQueryParser(ParserType, MediaQueryParserContext);
</ins><span class="cx">     virtual ~MediaQueryParser();
</span><span class="cx"> 
</span><span class="cx">     RefPtr<MediaQuerySet> parseInternal(CSSParserTokenRange);
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorecssparserSizesAttributeParsercpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/css/parser/SizesAttributeParser.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/css/parser/SizesAttributeParser.cpp 2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/css/parser/SizesAttributeParser.cpp    2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include "MediaList.h"
</span><span class="cx"> #include "MediaQueryEvaluator.h"
</span><span class="cx"> #include "MediaQueryParser.h"
</span><ins>+#include "MediaQueryParserContext.h"
</ins><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "SizesCalcParser.h"
</span><span class="cx"> #include "StyleScope.h"
</span><span class="lines">@@ -136,7 +137,7 @@
</span><span class="cx">         float length;
</span><span class="cx">         if (!calculateLengthInPixels(range.makeSubRange(lengthTokenStart, lengthTokenEnd), length))
</span><span class="cx">             continue;
</span><del>-        RefPtr<MediaQuerySet> mediaCondition = MediaQueryParser::parseMediaCondition(range.makeSubRange(mediaConditionStart, lengthTokenStart));
</del><ins>+        RefPtr<MediaQuerySet> mediaCondition = MediaQueryParser::parseMediaCondition(range.makeSubRange(mediaConditionStart, lengthTokenStart), MediaQueryParserContext(m_document));
</ins><span class="cx">         if (!mediaCondition || !mediaConditionMatches(*mediaCondition))
</span><span class="cx">             continue;
</span><span class="cx">         m_length = length;
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCoredomInlineStyleSheetOwnercpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/dom/InlineStyleSheetOwner.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/dom/InlineStyleSheetOwner.cpp       2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/dom/InlineStyleSheetOwner.cpp  2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "MediaList.h"
</span><span class="cx"> #include "MediaQueryEvaluator.h"
</span><ins>+#include "MediaQueryParser.h"
</ins><span class="cx"> #include "ScriptableDocumentParser.h"
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="cx"> #include "StyleScope.h"
</span><span class="lines">@@ -171,7 +172,7 @@
</span><span class="cx">     if (!contentSecurityPolicy.allowInlineStyle(document.url(), m_startTextPosition.m_line, text, hasKnownNonce))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(m_media);
</del><ins>+    RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(m_media, MediaQueryParserContext(document));
</ins><span class="cx"> 
</span><span class="cx">     MediaQueryEvaluator screenEval(ASCIILiteral("screen"), true);
</span><span class="cx">     MediaQueryEvaluator printEval(ASCIILiteral("print"), true);
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCoredomProcessingInstructioncpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/dom/ProcessingInstruction.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/dom/ProcessingInstruction.cpp       2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/dom/ProcessingInstruction.cpp  2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameLoader.h"
</span><span class="cx"> #include "MediaList.h"
</span><ins>+#include "MediaQueryParser.h"
</ins><span class="cx"> #include "StyleScope.h"
</span><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx"> #include "XMLDocumentParser.h"
</span><span class="lines">@@ -218,7 +219,7 @@
</span><span class="cx">     auto cssSheet = CSSStyleSheet::create(StyleSheetContents::create(href, parserContext), *this);
</span><span class="cx">     cssSheet.get().setDisabled(m_alternate);
</span><span class="cx">     cssSheet.get().setTitle(m_title);
</span><del>-    cssSheet.get().setMediaQueries(MediaQuerySet::create(m_media));
</del><ins>+    cssSheet.get().setMediaQueries(MediaQuerySet::create(m_media, MediaQueryParserContext(document())));
</ins><span class="cx"> 
</span><span class="cx">     m_sheet = WTFMove(cssSheet);
</span><span class="cx"> 
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorehtmlHTMLImageElementcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/html/HTMLImageElement.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/html/HTMLImageElement.cpp   2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/html/HTMLImageElement.cpp      2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx"> 
</span><span class="cx">         auto documentElement = makeRefPtr(document().documentElement());
</span><span class="cx">         MediaQueryEvaluator evaluator { document().printing() ? "print" : "screen", document(), documentElement ? documentElement->computedStyle() : nullptr };
</span><del>-        auto* queries = source.parsedMediaAttribute();
</del><ins>+        auto* queries = source.parsedMediaAttribute(document());
</ins><span class="cx">         LOG(MediaQueries, "HTMLImageElement %p bestFitSourceFromPictureElement evaluating media queries", this);
</span><span class="cx">         auto evaluation = !queries || evaluator.evaluate(*queries, picture->viewportDependentResults());
</span><span class="cx">         if (picture->hasViewportDependentResults())
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/html/HTMLLinkElement.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/html/HTMLLinkElement.cpp    2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/html/HTMLLinkElement.cpp       2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "MediaList.h"
</span><span class="cx"> #include "MediaQueryEvaluator.h"
</span><ins>+#include "MediaQueryParser.h"
</ins><span class="cx"> #include "MouseEvent.h"
</span><span class="cx"> #include "RenderStyle.h"
</span><span class="cx"> #include "RuntimeEnabledFeatures.h"
</span><span class="lines">@@ -287,7 +288,7 @@
</span><span class="cx">             std::optional<RenderStyle> documentStyle;
</span><span class="cx">             if (document().hasLivingRenderTree())
</span><span class="cx">                 documentStyle = Style::resolveForDocument(document());
</span><del>-            auto media = MediaQuerySet::create(m_media);
</del><ins>+            auto media = MediaQuerySet::create(m_media, MediaQueryParserContext(document()));
</ins><span class="cx">             LOG(MediaQueries, "HTMLLinkElement::process evaluating queries");
</span><span class="cx">             mediaQueryMatches = MediaQueryEvaluator { document().frame()->view()->mediaType(), document(), documentStyle ? &*documentStyle : nullptr }.evaluate(media.get());
</span><span class="cx">         }
</span><span class="lines">@@ -385,7 +386,7 @@
</span><span class="cx">     HTMLElement::finishParsingChildren();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLLinkElement::initializeStyleSheet(Ref<StyleSheetContents>&& styleSheet, const CachedCSSStyleSheet& cachedStyleSheet)
</del><ins>+void HTMLLinkElement::initializeStyleSheet(Ref<StyleSheetContents>&& styleSheet, const CachedCSSStyleSheet& cachedStyleSheet, MediaQueryParserContext context)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: originClean should be turned to false except if fetch mode is CORS.
</span><span class="cx">     std::optional<bool> originClean;
</span><span class="lines">@@ -393,7 +394,7 @@
</span><span class="cx">         originClean = cachedStyleSheet.isCORSSameOrigin();
</span><span class="cx"> 
</span><span class="cx">     m_sheet = CSSStyleSheet::create(WTFMove(styleSheet), *this, originClean);
</span><del>-    m_sheet->setMediaQueries(MediaQuerySet::create(m_media));
</del><ins>+    m_sheet->setMediaQueries(MediaQuerySet::create(m_media, context));
</ins><span class="cx">     m_sheet->setTitle(title());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -425,7 +426,7 @@
</span><span class="cx">     if (auto restoredSheet = const_cast<CachedCSSStyleSheet*>(cachedStyleSheet)->restoreParsedStyleSheet(parserContext, cachePolicy, frame->loader())) {
</span><span class="cx">         ASSERT(restoredSheet->isCacheable());
</span><span class="cx">         ASSERT(!restoredSheet->isLoading());
</span><del>-        initializeStyleSheet(restoredSheet.releaseNonNull(), *cachedStyleSheet);
</del><ins>+        initializeStyleSheet(restoredSheet.releaseNonNull(), *cachedStyleSheet, MediaQueryParserContext(document()));
</ins><span class="cx"> 
</span><span class="cx">         m_loading = false;
</span><span class="cx">         sheetLoaded();
</span><span class="lines">@@ -434,7 +435,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto styleSheet = StyleSheetContents::create(href, parserContext);
</span><del>-    initializeStyleSheet(styleSheet.copyRef(), *cachedStyleSheet);
</del><ins>+    initializeStyleSheet(styleSheet.copyRef(), *cachedStyleSheet, MediaQueryParserContext(document()));
</ins><span class="cx"> 
</span><span class="cx">     styleSheet.get().parseAuthorStyleSheet(cachedStyleSheet, &document().securityOrigin());
</span><span class="cx"> 
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorehtmlHTMLLinkElementh"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/html/HTMLLinkElement.h (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/html/HTMLLinkElement.h      2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/html/HTMLLinkElement.h 2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> class DOMTokenList;
</span><span class="cx"> class HTMLLinkElement;
</span><span class="cx"> class URL;
</span><ins>+struct MediaQueryParserContext;
</ins><span class="cx"> 
</span><span class="cx"> template<typename T> class EventSender;
</span><span class="cx"> typedef EventSender<HTMLLinkElement> LinkEventSender;
</span><span class="lines">@@ -89,7 +90,7 @@
</span><span class="cx">     void didFinishInsertingNode() final;
</span><span class="cx">     void removedFromAncestor(RemovalType, ContainerNode&) final;
</span><span class="cx"> 
</span><del>-    void initializeStyleSheet(Ref<StyleSheetContents>&&, const CachedCSSStyleSheet&);
</del><ins>+    void initializeStyleSheet(Ref<StyleSheetContents>&&, const CachedCSSStyleSheet&, MediaQueryParserContext);
</ins><span class="cx"> 
</span><span class="cx">     // from CachedResourceClient
</span><span class="cx">     void setCSSStyleSheet(const String& href, const URL& baseURL, const String& charset, const CachedCSSStyleSheet*) final;
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/html/HTMLMediaElement.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/html/HTMLMediaElement.cpp   2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/html/HTMLMediaElement.cpp      2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -4527,7 +4527,7 @@
</span><span class="cx">         if (mediaURL.isEmpty())
</span><span class="cx">             goto CheckAgain;
</span><span class="cx"> 
</span><del>-        if (auto* media = source->parsedMediaAttribute()) {
</del><ins>+        if (auto* media = source->parsedMediaAttribute(document())) {
</ins><span class="cx">             if (shouldLog)
</span><span class="cx">                 INFO_LOG(LOGIDENTIFIER, "'media' is ", source->attributeWithoutSynchronization(mediaAttr));
</span><span class="cx">             auto* renderer = this->renderer();
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorehtmlHTMLSourceElementcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/html/HTMLSourceElement.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/html/HTMLSourceElement.cpp  2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/html/HTMLSourceElement.cpp     2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include "HTMLPictureElement.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "MediaList.h"
</span><ins>+#include "MediaQueryParser.h"
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx"> #include "HTMLMediaElement.h"
</span><span class="lines">@@ -162,13 +163,13 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const MediaQuerySet* HTMLSourceElement::parsedMediaAttribute() const
</del><ins>+const MediaQuerySet* HTMLSourceElement::parsedMediaAttribute(Document& document) const
</ins><span class="cx"> {
</span><span class="cx">     if (!m_cachedParsedMediaAttribute) {
</span><span class="cx">         RefPtr<const MediaQuerySet> parsedAttribute;
</span><span class="cx">         auto& value = attributeWithoutSynchronization(mediaAttr);
</span><span class="cx">         if (!value.isNull())
</span><del>-            parsedAttribute = MediaQuerySet::create(value);
</del><ins>+            parsedAttribute = MediaQuerySet::create(value, MediaQueryParserContext(document));
</ins><span class="cx">         m_cachedParsedMediaAttribute = WTFMove(parsedAttribute);
</span><span class="cx">     }
</span><span class="cx">     return m_cachedParsedMediaAttribute.value().get();
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorehtmlHTMLSourceElementh"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/html/HTMLSourceElement.h (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/html/HTMLSourceElement.h    2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/html/HTMLSourceElement.h       2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">     void scheduleErrorEvent();
</span><span class="cx">     void cancelPendingErrorEvent();
</span><span class="cx"> 
</span><del>-    const MediaQuerySet* parsedMediaAttribute() const;
</del><ins>+    const MediaQuerySet* parsedMediaAttribute(Document&) const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     HTMLSourceElement(const QualifiedName&, Document&);
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorehtmlHTMLStyleElementcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/html/HTMLStyleElement.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/html/HTMLStyleElement.cpp   2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/html/HTMLStyleElement.cpp      2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "EventSender.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "MediaList.h"
</span><ins>+#include "MediaQueryParser.h"
</ins><span class="cx"> #include "RuntimeEnabledFeatures.h"
</span><span class="cx"> #include "ScriptableDocumentParser.h"
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="lines">@@ -79,7 +80,7 @@
</span><span class="cx">     else if (name == mediaAttr) {
</span><span class="cx">         m_styleSheetOwner.setMedia(value);
</span><span class="cx">         if (sheet()) {
</span><del>-            sheet()->setMediaQueries(MediaQuerySet::create(value));
</del><ins>+            sheet()->setMediaQueries(MediaQuerySet::create(value, MediaQueryParserContext(document())));
</ins><span class="cx">             if (auto* scope = m_styleSheetOwner.styleScope())
</span><span class="cx">                 scope->didChangeStyleSheetContents();
</span><span class="cx">         } else
</span></span></pre></div>
<a id="tagsSafari606174SourceWebCorehtmlparserHTMLPreloadScannercpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebCore/html/parser/HTMLPreloadScanner.cpp (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebCore/html/parser/HTMLPreloadScanner.cpp  2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebCore/html/parser/HTMLPreloadScanner.cpp     2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include "MIMETypeRegistry.h"
</span><span class="cx"> #include "MediaList.h"
</span><span class="cx"> #include "MediaQueryEvaluator.h"
</span><ins>+#include "MediaQueryParser.h"
</ins><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "SizesAttributeParser.h"
</span><span class="cx"> #include <wtf/MainThread.h>
</span><span class="lines">@@ -215,7 +216,7 @@
</span><span class="cx">             }
</span><span class="cx">             if (match(attributeName, mediaAttr) && m_mediaAttribute.isNull()) {
</span><span class="cx">                 m_mediaAttribute = attributeValue;
</span><del>-                auto mediaSet = MediaQuerySet::create(attributeValue);
</del><ins>+                auto mediaSet = MediaQuerySet::create(attributeValue, MediaQueryParserContext(document));
</ins><span class="cx">                 auto documentElement = makeRefPtr(document.documentElement());
</span><span class="cx">                 LOG(MediaQueries, "HTMLPreloadScanner %p processAttribute evaluating media queries", this);
</span><span class="cx">                 m_mediaMatched = MediaQueryEvaluator { document.printing() ? "print" : "screen", document, documentElement ? documentElement->computedStyle() : nullptr }.evaluate(mediaSet.get());
</span></span></pre></div>
<a id="tagsSafari606174SourceWebKitLegacymacChangeLog"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebKitLegacy/mac/ChangeLog (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebKitLegacy/mac/ChangeLog  2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebKitLegacy/mac/ChangeLog     2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -1,5 +1,109 @@
</span><span class="cx"> 2018-04-02  Jason Marcell  <jmarcell@apple.com>
</span><span class="cx"> 
</span><ins>+        Cherry-pick r229654. rdar://problem/38382934
+
+    Create MediaQueryParserContext to provide additional context for the evaluation of media queries
+    https://bugs.webkit.org/show_bug.cgi?id=183677
+    
+    Reviewed by Tim Horton.
+    
+    We need additional context for parsing media queries to make sure they are parsed correctly and valid.
+    
+    Source/WebCore:
+    
+    Not currently testable, will add tests in a later patch.
+    
+    * WebCore.xcodeproj/project.pbxproj:
+    * css/MediaList.cpp:
+    (WebCore::MediaQuerySet::create):
+    (WebCore::MediaQuerySet::set):
+    (WebCore::MediaQuerySet::add):
+    (WebCore::MediaQuerySet::remove):
+    * css/MediaList.h:
+    * css/MediaQueryEvaluator.cpp:
+    (WebCore::MediaQueryEvaluator::mediaAttributeMatches):
+    * css/MediaQueryExpression.cpp:
+    (WebCore::featureWithValidIdent):
+    (WebCore::featureWithValidDensity):
+    (WebCore::featureWithValidPositiveLength):
+    (WebCore::featureWithPositiveInteger):
+    (WebCore::featureWithPositiveNumber):
+    (WebCore::featureWithZeroOrOne):
+    (WebCore::isFeatureValidWithoutValue):
+    (WebCore::MediaQueryExpression::MediaQueryExpression):
+    * css/MediaQueryExpression.h:
+    * css/MediaQueryMatcher.cpp:
+    (WebCore::MediaQueryMatcher::matchMedia):
+    * css/MediaQueryParserContext.cpp: Added.
+    (WebCore::MediaQueryParserContext::MediaQueryParserContext):
+    * css/MediaQueryParserContext.h: Added.
+    (WebCore::MediaQueryParserContext::MediaQueryParserContext):
+    * css/StyleMedia.cpp:
+    (WebCore::StyleMedia::matchMedium const):
+    * css/StyleRuleImport.cpp:
+    (WebCore::StyleRuleImport::StyleRuleImport):
+    (WebCore::StyleRuleImport::setCSSStyleSheet):
+    * css/parser/CSSParser.cpp:
+    (WebCore::CSSParserContext::CSSParserContext):
+    (WebCore::operator==):
+    * css/parser/CSSParserImpl.cpp:
+    (WebCore::CSSParserImpl::consumeImportRule):
+    (WebCore::CSSParserImpl::consumeMediaRule):
+    * css/parser/MediaQueryParser.cpp:
+    (WebCore::MediaQueryParser::parseMediaQuerySet):
+    (WebCore::MediaQueryParser::parseMediaCondition):
+    (WebCore::MediaQueryParser::MediaQueryParser):
+    (WebCore::MediaQueryData::addExpression):
+    * css/parser/MediaQueryParser.h:
+    (WebCore::MediaQueryData::setMediaQueryParserContext):
+    * css/parser/SizesAttributeParser.cpp:
+    (WebCore::SizesAttributeParser::parse):
+    * dom/DOMImplementation.cpp:
+    (WebCore::DOMImplementation::createCSSStyleSheet):
+    * dom/InlineStyleSheetOwner.cpp:
+    (WebCore::InlineStyleSheetOwner::createSheet):
+    * dom/ProcessingInstruction.cpp:
+    (WebCore::ProcessingInstruction::setCSSStyleSheet):
+    * html/HTMLImageElement.cpp:
+    (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
+    * html/HTMLLinkElement.cpp:
+    (WebCore::HTMLLinkElement::process):
+    (WebCore::HTMLLinkElement::initializeStyleSheet):
+    (WebCore::HTMLLinkElement::setCSSStyleSheet):
+    * html/HTMLLinkElement.h:
+    * html/HTMLMediaElement.cpp:
+    (WebCore::HTMLMediaElement::selectNextSourceChild):
+    * html/HTMLSourceElement.cpp:
+    (WebCore::HTMLSourceElement::parsedMediaAttribute const):
+    * html/HTMLSourceElement.h:
+    * html/HTMLStyleElement.cpp:
+    (WebCore::HTMLStyleElement::parseAttribute):
+    * html/parser/HTMLPreloadScanner.cpp:
+    (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
+    
+    Source/WebKitLegacy/mac:
+    
+    * DOM/DOM.mm:
+    (-[DOMHTMLLinkElement _mediaQueryMatches]):
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229654 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-03-15  Megan Gardner  <megan_gardner@apple.com>
+
+            Create MediaQueryParserContext to provide additional context for the evaluation of media queries
+            https://bugs.webkit.org/show_bug.cgi?id=183677
+
+            Reviewed by Tim Horton.
+
+            We need additional context for parsing media queries to make sure they are parsed correctly and valid.
+
+            * DOM/DOM.mm:
+            (-[DOMHTMLLinkElement _mediaQueryMatches]):
+
+2018-04-02  Jason Marcell  <jmarcell@apple.com>
+
</ins><span class="cx">         Cherry-pick r229511. rdar://problem/38326388
</span><span class="cx"> 
</span><span class="cx">     Media query for default appearance
</span></span></pre></div>
<a id="tagsSafari606174SourceWebKitLegacymacDOMDOMmm"></a>
<div class="modfile"><h4>Modified: tags/Safari-606.1.7.4/Source/WebKitLegacy/mac/DOM/DOM.mm (230183 => 230184)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-606.1.7.4/Source/WebKitLegacy/mac/DOM/DOM.mm 2018-04-02 21:06:14 UTC (rev 230183)
+++ tags/Safari-606.1.7.4/Source/WebKitLegacy/mac/DOM/DOM.mm    2018-04-02 21:06:22 UTC (rev 230184)
</span><span class="lines">@@ -751,7 +751,7 @@
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     Document& document = link.document();
</span><del>-    auto mediaQuerySet = MediaQuerySet::create(media);
</del><ins>+    auto mediaQuerySet = MediaQuerySet::create(media, MediaQueryParserContext(document));
</ins><span class="cx">     return MediaQueryEvaluator { "screen", document, document.renderView() ? &document.renderView()->style() : nullptr }.evaluate(mediaQuerySet.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>