<!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>[193565] branches/safari-601.1.46-branch</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/193565">193565</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2015-12-05 23:11:59 -0800 (Sat, 05 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/192953">r192953</a>.  rdar://problem/23221158</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsChangeLog">branches/safari-601.1.46-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601146branchLayoutTestsimportedw3cChangeLog">branches/safari-601.1.46-branch/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#branchessafari601146branchLayoutTestsplatformmacjsdomglobalconstructorsattributesexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestsplatformmacyosemitejsdomglobalconstructorsattributesexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreCMakeListstxt">branches/safari-601.1.46-branch/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreChangeLog">branches/safari-601.1.46-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreDerivedSourcesmake">branches/safari-601.1.46-branch/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreWebCorexcodeprojprojectpbxproj">branches/safari-601.1.46-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlHTMLImageElementcpp">branches/safari-601.1.46-branch/Source/WebCore/html/HTMLImageElement.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlHTMLImageElementh">branches/safari-601.1.46-branch/Source/WebCore/html/HTMLImageElement.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlHTMLSourceElementcpp">branches/safari-601.1.46-branch/Source/WebCore/html/HTMLSourceElement.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlHTMLSourceElementh">branches/safari-601.1.46-branch/Source/WebCore/html/HTMLSourceElement.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlHTMLTagNamesin">branches/safari-601.1.46-branch/Source/WebCore/html/HTMLTagNames.in</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlparserHTMLSrcsetParserh">branches/safari-601.1.46-branch/Source/WebCore/html/parser/HTMLSrcsetParser.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>branches/safari-601.1.46-branch/LayoutTests/fast/picture/</li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlHTMLPictureElementcpp">branches/safari-601.1.46-branch/Source/WebCore/html/HTMLPictureElement.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlHTMLPictureElementh">branches/safari-601.1.46-branch/Source/WebCore/html/HTMLPictureElement.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlHTMLPictureElementidl">branches/safari-601.1.46-branch/Source/WebCore/html/HTMLPictureElement.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601146branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -1,5 +1,27 @@
</span><span class="cx"> 2015-12-05  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r192953.
+
+    2015-12-01  David Hyatt  &lt;hyatt@apple.com&gt;
+
+            Implement the picture element.
+            https://bugs.webkit.org/show_bug.cgi?id=116963
+
+            Reviewed by Dean Jackson.
+
+            * fast/picture: Added.
+            * fast/picture/image-picture-1x-expected.txt: Added.
+            * fast/picture/image-picture-1x.html: Added.
+            * fast/picture/resources: Added.
+            * fast/picture/resources/blue_rect.jpg: Added.
+            * fast/picture/resources/currentSrcHelper.js: Added.
+            (fileName):
+            (currentSrcFileName):
+            (currentSrcFileNameNoParams):
+            * fast/picture/resources/image-set-4x.png: Added.
+
+2015-12-05  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
</ins><span class="cx">         Merge r191252.
</span><span class="cx"> 
</span><span class="cx">     2015-10-17  David Hyatt  &lt;hyatt@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/imported/w3c/ChangeLog (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/imported/w3c/ChangeLog        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/LayoutTests/imported/w3c/ChangeLog        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-12-05  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
+        Merge r192953.
+
+    2015-12-01  David Hyatt  &lt;hyatt@apple.com&gt;
+
+            Implement the picture element.
+            https://bugs.webkit.org/show_bug.cgi?id=116963
+
+            Reviewed by Dean Jackson.
+
+            * web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
+            * web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
+            * web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
+            * web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
+
</ins><span class="cx"> 2015-04-13  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         imported/w3c/canvas/2d.text.measure.width.empty.html is flaky
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsplatformmacjsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -623,6 +623,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'HTMLParamElement').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'HTMLParamElement').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'HTMLParamElement').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'HTMLPictureElement').value is HTMLPictureElement
+PASS Object.getOwnPropertyDescriptor(global, 'HTMLPictureElement').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'HTMLPictureElement').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'HTMLPictureElement').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'HTMLPictureElement').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'HTMLPreElement').value is HTMLPreElement
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'HTMLPreElement').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'HTMLPreElement').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsplatformmacyosemitejsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -623,6 +623,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'HTMLParamElement').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'HTMLParamElement').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'HTMLParamElement').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'HTMLPictureElement').value is HTMLPictureElement
+PASS Object.getOwnPropertyDescriptor(global, 'HTMLPictureElement').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'HTMLPictureElement').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'HTMLPictureElement').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'HTMLPictureElement').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'HTMLPreElement').value is HTMLPreElement
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'HTMLPreElement').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'HTMLPreElement').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/CMakeLists.txt (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/CMakeLists.txt        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/Source/WebCore/CMakeLists.txt        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -519,6 +519,7 @@
</span><span class="cx">     html/HTMLOutputElement.idl
</span><span class="cx">     html/HTMLParagraphElement.idl
</span><span class="cx">     html/HTMLParamElement.idl
</span><ins>+    html/HTMLPictureElement.idl
</ins><span class="cx">     html/HTMLPreElement.idl
</span><span class="cx">     html/HTMLProgressElement.idl
</span><span class="cx">     html/HTMLQuoteElement.idl
</span><span class="lines">@@ -1667,6 +1668,7 @@
</span><span class="cx">     html/HTMLOutputElement.cpp
</span><span class="cx">     html/HTMLParagraphElement.cpp
</span><span class="cx">     html/HTMLParamElement.cpp
</span><ins>+    html/HTMLPictureElement.cpp
</ins><span class="cx">     html/HTMLPlugInElement.cpp
</span><span class="cx">     html/HTMLPlugInImageElement.cpp
</span><span class="cx">     html/HTMLPreElement.cpp
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -1,5 +1,74 @@
</span><span class="cx"> 2015-12-05  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r192953.
+
+    2015-11-30  David Hyatt  &lt;hyatt@apple.com&gt;
+
+            Implement the picture element.
+            https://bugs.webkit.org/show_bug.cgi?id=116963
+
+            Reviewed by Dean Jackson.
+
+            Added fast/picture tests.
+
+            * WebCore.xcodeproj/project.pbxproj:
+            Add HTMLPictureElement.* to the project.
+
+            * html/HTMLImageElement.cpp:
+            (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
+            Remove the CURRENT_SRC ifdef.
+
+            (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
+            New helper function that checks the &lt;source&gt; elements of a &lt;picture&gt; parent
+            for the best match.
+
+            (WebCore::HTMLImageElement::selectImageSource):
+            Pull out the process of image selection into its own function so that this can
+            be called from many places (to ensure that dynamic changes are reflected as elements
+            get changed, added or removed).
+
+            (WebCore::HTMLImageElement::parseAttribute):
+            Call selectImageSource when attributes change.
+
+            (WebCore::HTMLImageElement::insertedInto):
+            If inserted into a picture element, make sure to update the source.
+
+            * html/HTMLImageElement.h:
+            (WebCore::HTMLImageElement::currentSrc):
+            Remove the CURRENT_SRC ifdef.
+
+            * html/HTMLImageElement.idl:
+            Remove the CURRENT_SRC ifdef.
+
+            * html/HTMLPictureElement.cpp: Added.
+            (WebCore::HTMLPictureElement::HTMLPictureElement):
+            (WebCore::HTMLPictureElement::create):
+            (WebCore::HTMLPictureElement::sourcesChanged):
+            * html/HTMLPictureElement.h: Added.
+            The new picture element. Has a sourcesChanged() function that is invoked whenever anything
+            about the &lt;source&gt; elements changes.
+
+            * html/HTMLSourceElement.cpp:
+            (WebCore::HTMLSourceElement::insertedInto):
+            (WebCore::HTMLSourceElement::removedFrom):
+            (WebCore::HTMLSourceElement::parseAttribute):
+            Make sure to call sourcesChanged when new sources come and go or when attributes on
+            source elements change.
+
+            * html/HTMLSourceElement.h:
+            Added parseAttribute function so we can see when attributes change that force us to
+            do a dynamic update.
+
+            * html/HTMLTagNames.in:
+            Add the picture element.
+
+            * html/parser/HTMLSrcsetParser.h:
+            (WebCore::ImageCandidate::srcOrigin):
+            (WebCore::ImageCandidate::isEmpty):
+            Some helpers for picture parsing.
+
+2015-12-05  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
</ins><span class="cx">         Merge r191252.
</span><span class="cx"> 
</span><span class="cx">     2015-10-17  David Hyatt  &lt;hyatt@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/DerivedSources.make (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/DerivedSources.make        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/Source/WebCore/DerivedSources.make        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -393,6 +393,7 @@
</span><span class="cx">     $(WebCore)/html/HTMLOutputElement.idl \
</span><span class="cx">     $(WebCore)/html/HTMLParagraphElement.idl \
</span><span class="cx">     $(WebCore)/html/HTMLParamElement.idl \
</span><ins>+        $(WebCore)/html/HTMLPictureElement.idl \
</ins><span class="cx">     $(WebCore)/html/HTMLPreElement.idl \
</span><span class="cx">     $(WebCore)/html/HTMLProgressElement.idl \
</span><span class="cx">     $(WebCore)/html/HTMLQuoteElement.idl \
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -5244,6 +5244,8 @@
</span><span class="cx">                 BC3BE9AB0E9C242000835588 /* RenderScrollbarPart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC3BE9AA0E9C242000835588 /* RenderScrollbarPart.cpp */; };
</span><span class="cx">                 BC3C39B60C0D3D8D005F4D7A /* JSMediaList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC3C39B40C0D3D8D005F4D7A /* JSMediaList.cpp */; };
</span><span class="cx">                 BC3C39B70C0D3D8D005F4D7A /* JSMediaList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */; };
</span><ins>+                BC3D85BB1C0E2E7700D3B610 /* JSHTMLPictureElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC808B121C0E2B350066FD6B /* JSHTMLPictureElement.cpp */; settings = {ASSET_TAGS = (); }; };
+                BC3D85BC1C0E2E7A00D3B610 /* JSHTMLPictureElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC808B131C0E2B350066FD6B /* JSHTMLPictureElement.h */; settings = {ASSET_TAGS = (); }; };
</ins><span class="cx">                 BC4368E80C226E32005EFB5F /* Rect.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4368E70C226E32005EFB5F /* Rect.h */; };
</span><span class="cx">                 BC46C1EE0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */; };
</span><span class="cx">                 BC46C1FA0C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC46C1F00C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp */; };
</span><span class="lines">@@ -5485,6 +5487,8 @@
</span><span class="cx">                 BCC065880F3CE2A700CD2D87 /* JSClientRect.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC065840F3CE2A700CD2D87 /* JSClientRect.h */; };
</span><span class="cx">                 BCC065890F3CE2A700CD2D87 /* JSClientRectList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC065850F3CE2A700CD2D87 /* JSClientRectList.cpp */; };
</span><span class="cx">                 BCC0658A0F3CE2A700CD2D87 /* JSClientRectList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC065860F3CE2A700CD2D87 /* JSClientRectList.h */; };
</span><ins>+                BCC0E8751BFE70E9008F7F50 /* HTMLPictureElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC0E8731BFE70E9008F7F50 /* HTMLPictureElement.cpp */; settings = {ASSET_TAGS = (); }; };
+                BCC0E8761BFE70E9008F7F50 /* HTMLPictureElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0E8741BFE70E9008F7F50 /* HTMLPictureElement.h */; settings = {ASSET_TAGS = (); }; };
</ins><span class="cx">                 BCC438780E886CC700533DD5 /* JSHTMLInputElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC438770E886CC700533DD5 /* JSHTMLInputElementCustom.cpp */; };
</span><span class="cx">                 BCC573350D695BBE006EF517 /* DOMProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC573330D695BBE006EF517 /* DOMProgressEvent.h */; };
</span><span class="cx">                 BCC573360D695BBE006EF517 /* DOMProgressEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCC573340D695BBE006EF517 /* DOMProgressEvent.mm */; };
</span><span class="lines">@@ -12957,6 +12961,9 @@
</span><span class="cx">                 BC7FA61F0D1F0CBD00DB22A9 /* LiveNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiveNodeList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC7FA62B0D1F0EFF00DB22A9 /* StaticNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticNodeList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC7FA62C0D1F0EFF00DB22A9 /* StaticNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaticNodeList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                BC808B111C0E23AC0066FD6B /* HTMLPictureElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLPictureElement.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                BC808B121C0E2B350066FD6B /* JSHTMLPictureElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLPictureElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                BC808B131C0E2B350066FD6B /* JSHTMLPictureElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLPictureElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 BC80C9850CD294EE00A0B7B3 /* CSSTimingFunctionValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSTimingFunctionValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC80C9860CD294EE00A0B7B3 /* CSSTimingFunctionValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSTimingFunctionValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC8243250D0CE8A200460C8F /* JSSQLError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLError.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13069,6 +13076,8 @@
</span><span class="cx">                 BCC065840F3CE2A700CD2D87 /* JSClientRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSClientRect.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BCC065850F3CE2A700CD2D87 /* JSClientRectList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSClientRectList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BCC065860F3CE2A700CD2D87 /* JSClientRectList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSClientRectList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                BCC0E8731BFE70E9008F7F50 /* HTMLPictureElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPictureElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                BCC0E8741BFE70E9008F7F50 /* HTMLPictureElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLPictureElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 BCC438770E886CC700533DD5 /* JSHTMLInputElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLInputElementCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BCC573330D695BBE006EF517 /* DOMProgressEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMProgressEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BCC573340D695BBE006EF517 /* DOMProgressEvent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMProgressEvent.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -18353,6 +18362,9 @@
</span><span class="cx">                                 A8EA7CA20A192B9C00A8EF5F /* HTMLPreElement.h */,
</span><span class="cx">                                 1AE2AB850A1CE85000B42B25 /* HTMLPreElement.idl */,
</span><span class="cx">                                 A43BF5961149290A00C643CA /* HTMLProgressElement.cpp */,
</span><ins>+                                BCC0E8731BFE70E9008F7F50 /* HTMLPictureElement.cpp */,
+                                BCC0E8741BFE70E9008F7F50 /* HTMLPictureElement.h */,
+                                BC808B111C0E23AC0066FD6B /* HTMLPictureElement.idl */,
</ins><span class="cx">                                 A43BF5971149290A00C643CA /* HTMLProgressElement.h */,
</span><span class="cx">                                 A4226EA51163D84D008B8397 /* HTMLProgressElement.idl */,
</span><span class="cx">                                 A8CFF79B0A156978000A4234 /* HTMLQuoteElement.cpp */,
</span><span class="lines">@@ -19299,6 +19311,8 @@
</span><span class="cx">                                 1AE2AB9F0A1CE90500B42B25 /* JSHTMLParagraphElement.h */,
</span><span class="cx">                                 1AE2ABA00A1CE90500B42B25 /* JSHTMLParamElement.cpp */,
</span><span class="cx">                                 1AE2ABA10A1CE90500B42B25 /* JSHTMLParamElement.h */,
</span><ins>+                                BC808B121C0E2B350066FD6B /* JSHTMLPictureElement.cpp */,
+                                BC808B131C0E2B350066FD6B /* JSHTMLPictureElement.h */,
</ins><span class="cx">                                 1AE2ABA20A1CE90500B42B25 /* JSHTMLPreElement.cpp */,
</span><span class="cx">                                 1AE2ABA30A1CE90500B42B25 /* JSHTMLPreElement.h */,
</span><span class="cx">                                 A4226E591163D667008B8397 /* JSHTMLProgressElement.cpp */,
</span><span class="lines">@@ -25993,6 +26007,7 @@
</span><span class="cx">                                 D3A94A3B122DABAC00A37BBC /* MediaQueryListListener.h in Headers */,
</span><span class="cx">                                 D3AA10F4123A98AA0092152B /* MediaQueryMatcher.h in Headers */,
</span><span class="cx">                                 C90843D01B18E47D00B68564 /* MediaRemoteControls.h in Headers */,
</span><ins>+                                BC3D85BC1C0E2E7A00D3B610 /* JSHTMLPictureElement.h in Headers */,
</ins><span class="cx">                                 CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */,
</span><span class="cx">                                 CDBEAEAD19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h in Headers */,
</span><span class="cx">                                 C9027F421B1D0AD200BFBFEF /* MediaSession.h in Headers */,
</span><span class="lines">@@ -26266,6 +26281,7 @@
</span><span class="cx">                                 C0F2A44113869AAB0066C534 /* preprocessor.pm in Headers */,
</span><span class="cx">                                 B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */,
</span><span class="cx">                                 A8EA7EBC0A1945D000A8EF5F /* ProcessingInstruction.h in Headers */,
</span><ins>+                                BCC0E8761BFE70E9008F7F50 /* HTMLPictureElement.h in Headers */,
</ins><span class="cx">                                 E44613EC0CD681B500FADA75 /* ProgressEvent.h in Headers */,
</span><span class="cx">                                 A715E653134BBBEC00D8E713 /* ProgressShadowElement.h in Headers */,
</span><span class="cx">                                 1A2A68240B5BEDE70002A480 /* ProgressTracker.h in Headers */,
</span><span class="lines">@@ -28247,6 +28263,7 @@
</span><span class="cx">                                 85183B450AA6926100F19FA3 /* DOMHTMLHeadingElement.mm in Sources */,
</span><span class="cx">                                 85ECBEF20AA7626900544F0B /* DOMHTMLHRElement.mm in Sources */,
</span><span class="cx">                                 85992EBD0AA5069500AC0785 /* DOMHTMLHtmlElement.mm in Sources */,
</span><ins>+                                BC3D85BB1C0E2E7700D3B610 /* JSHTMLPictureElement.cpp in Sources */,
</ins><span class="cx">                                 85DF819A0AA77E4B00486AD7 /* DOMHTMLIFrameElement.mm in Sources */,
</span><span class="cx">                                 85DF812A0AA7787200486AD7 /* DOMHTMLImageElement.mm in Sources */,
</span><span class="cx">                                 85F32AED0AA63B8700FF3184 /* DOMHTMLInputElement.mm in Sources */,
</span><span class="lines">@@ -28987,6 +29004,7 @@
</span><span class="cx">                                 1AE2AA220A1CDAB400B42B25 /* JSHTMLBodyElement.cpp in Sources */,
</span><span class="cx">                                 1AE2AA240A1CDAB400B42B25 /* JSHTMLBRElement.cpp in Sources */,
</span><span class="cx">                                 A80E7EA00A1A83E3007FB8C5 /* JSHTMLButtonElement.cpp in Sources */,
</span><ins>+                                BCC0E8751BFE70E9008F7F50 /* HTMLPictureElement.cpp in Sources */,
</ins><span class="cx">                                 938E666009F09B81008A48EC /* JSHTMLCanvasElement.cpp in Sources */,
</span><span class="cx">                                 9392262D1032107B006E7D5D /* JSHTMLCanvasElementCustom.cpp in Sources */,
</span><span class="cx">                                 BCCBAD400C18C14200CE890F /* JSHTMLCollection.cpp in Sources */,
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlHTMLImageElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/HTMLImageElement.cpp (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/HTMLImageElement.cpp        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/HTMLImageElement.cpp        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -32,7 +32,11 @@
</span><span class="cx"> #include &quot;HTMLDocument.h&quot;
</span><span class="cx"> #include &quot;HTMLFormElement.h&quot;
</span><span class="cx"> #include &quot;HTMLParserIdioms.h&quot;
</span><ins>+#include &quot;HTMLSourceElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLSrcsetParser.h&quot;
</span><ins>+#include &quot;MIMETypeRegistry.h&quot;
+#include &quot;MediaList.h&quot;
+#include &quot;MediaQueryEvaluator.h&quot;
</ins><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;RenderImage.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="lines">@@ -136,17 +140,61 @@
</span><span class="cx">         downcast&lt;RenderImage&gt;(*renderer()).setImageDevicePixelRatio(m_imageDevicePixelRatio);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ImageCandidate HTMLImageElement::bestFitSourceFromPictureElement()
+{
+    auto* parent = parentNode();
+    if (!is&lt;HTMLPictureElement&gt;(parent))
+        return { };
+    for (Node* child = parent-&gt;firstChild(); child &amp;&amp; child != this; child = child-&gt;nextSibling()) {
+        if (!is&lt;HTMLSourceElement&gt;(*child))
+            continue;
+        auto&amp; source = downcast&lt;HTMLSourceElement&gt;(*child);
+        auto&amp; srcset = source.fastGetAttribute(srcsetAttr);
+        if (srcset.isEmpty())
+            continue;
+        if (source.hasAttribute(typeAttr)) {
+            String type = source.fastGetAttribute(typeAttr).string();
+            int indexOfSemicolon = type.find(';');
+            if (indexOfSemicolon &gt;= 0)
+                type.truncate(indexOfSemicolon);
+            type = stripLeadingAndTrailingHTMLSpaces(type);
+            type = type.lower();
+            if (!type.isEmpty() &amp;&amp; !MIMETypeRegistry::isSupportedImageMIMEType(type) &amp;&amp; type != &quot;image/svg+xml&quot;)
+                continue;
+        }
+        MediaQueryEvaluator evaluator(document().printing() ? &quot;print&quot; : &quot;screen&quot;, document().frame(), computedStyle());
+        if (!evaluator.eval(MediaQuerySet::createAllowingDescriptionSyntax(source.media()).ptr()))
+            continue;
+        
+        float sourceSize = parseSizesAttribute(source.fastGetAttribute(sizesAttr).string(), document().renderView(), document().frame());
+        ImageCandidate candidate = bestFitSourceForImageAttributes(document().deviceScaleFactor(), nullAtom, source.fastGetAttribute(srcsetAttr), sourceSize);
+        if (!candidate.isEmpty())
+            return candidate;
+    }
+    return { };
+}
+
+void HTMLImageElement::selectImageSource()
+{
+    // First look for the best fit source from our &lt;picture&gt; parent if we have one.
+    ImageCandidate candidate = bestFitSourceFromPictureElement();
+    if (candidate.isEmpty()) {
+        // If we don't have a &lt;picture&gt; or didn't find a source, then we use our own attributes.
+        float sourceSize = parseSizesAttribute(fastGetAttribute(sizesAttr).string(), document().renderView(), document().frame());
+        candidate = bestFitSourceForImageAttributes(document().deviceScaleFactor(), fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr), sourceSize);
+    }
+    setBestFitURLAndDPRFromImageCandidate(candidate);
+    m_imageLoader.updateFromElementIgnoringPreviousError();
+}
+
</ins><span class="cx"> void HTMLImageElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
</span><span class="cx"> {
</span><span class="cx">     if (name == altAttr) {
</span><span class="cx">         if (is&lt;RenderImage&gt;(renderer()))
</span><span class="cx">             downcast&lt;RenderImage&gt;(*renderer()).updateAltText();
</span><del>-    } else if (name == srcAttr || name == srcsetAttr) {
-        float sourceSize = parseSizesAttribute(fastGetAttribute(sizesAttr).string(), document().renderView(), document().frame());
-        ImageCandidate candidate = bestFitSourceForImageAttributes(document().deviceScaleFactor(), fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr), sourceSize);
-        setBestFitURLAndDPRFromImageCandidate(candidate);
-        m_imageLoader.updateFromElementIgnoringPreviousError();
-    } else if (name == usemapAttr) {
</del><ins>+    } else if (name == srcAttr || name == srcsetAttr || name == sizesAttr)
+        selectImageSource();
+    else if (name == usemapAttr) {
</ins><span class="cx">         if (inDocument() &amp;&amp; !m_lowercasedUsemap.isNull())
</span><span class="cx">             document().removeImageElementByLowercasedUsemap(*m_lowercasedUsemap.impl(), *this);
</span><span class="cx"> 
</span><span class="lines">@@ -255,7 +303,10 @@
</span><span class="cx"> 
</span><span class="cx">     if (insertionPoint.inDocument() &amp;&amp; !m_lowercasedUsemap.isNull())
</span><span class="cx">         document().addImageElementByLowercasedUsemap(*m_lowercasedUsemap.impl(), *this);
</span><del>-
</del><ins>+    
+    if (is&lt;HTMLPictureElement&gt;(parentNode()))
+        selectImageSource();
+    
</ins><span class="cx">     // If we have been inserted from a renderer-less document,
</span><span class="cx">     // our loader may have not fetched the image, so do it now.
</span><span class="cx">     if (insertionPoint.inDocument() &amp;&amp; !m_imageLoader.image())
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlHTMLImageElementh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/HTMLImageElement.h (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/HTMLImageElement.h        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/HTMLImageElement.h        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -122,6 +122,10 @@
</span><span class="cx">     virtual HTMLImageElement&amp; asHTMLElement() override final { return *this; }
</span><span class="cx">     virtual const HTMLImageElement&amp; asHTMLElement() const override final { return *this; }
</span><span class="cx"> 
</span><ins>+    void selectImageSource();
+
+    ImageCandidate bestFitSourceFromPictureElement();
+
</ins><span class="cx">     HTMLImageLoader m_imageLoader;
</span><span class="cx">     HTMLFormElement* m_form;
</span><span class="cx">     CompositeOperator m_compositeOperator;
</span><span class="lines">@@ -141,6 +145,8 @@
</span><span class="cx">     bool hasImageControls() const;
</span><span class="cx">     virtual bool childShouldCreateRenderer(const Node&amp;) const override;
</span><span class="cx"> #endif
</span><ins>+
+    friend class HTMLPictureElement;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } //namespace
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlHTMLPictureElementcppfromrev193533branchessafari601branchSourceWebCorehtmlHTMLPictureElementcpp"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1.46-branch/Source/WebCore/html/HTMLPictureElement.cpp (from rev 193533, branches/safari-601-branch/Source/WebCore/html/HTMLPictureElement.cpp) (0 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/HTMLPictureElement.cpp                                (rev 0)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/HTMLPictureElement.cpp        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 &quot;config.h&quot;
+#include &quot;HTMLPictureElement.h&quot;
+
+#include &quot;ElementChildIterator.h&quot;
+#include &quot;HTMLImageElement.h&quot;
+#include &quot;HTMLNames.h&quot;
+
+namespace WebCore {
+
+HTMLPictureElement::HTMLPictureElement(const QualifiedName&amp; tagName, Document&amp; document)
+    : HTMLElement(tagName, document)
+{
+}
+
+Ref&lt;HTMLPictureElement&gt; HTMLPictureElement::create(const QualifiedName&amp; tagName, Document&amp; document)
+{
+    return adoptRef(*new HTMLPictureElement(tagName, document));
+}
+
+void HTMLPictureElement::sourcesChanged()
+{
+    for (auto&amp; imageElement : childrenOfType&lt;HTMLImageElement&gt;(*this))
+        imageElement.selectImageSource();
+}
+
+}
+
</ins></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlHTMLPictureElementhfromrev193533branchessafari601branchSourceWebCorehtmlHTMLPictureElementh"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1.46-branch/Source/WebCore/html/HTMLPictureElement.h (from rev 193533, branches/safari-601-branch/Source/WebCore/html/HTMLPictureElement.h) (0 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/HTMLPictureElement.h                                (rev 0)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/HTMLPictureElement.h        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+/*
+ * Copyright (C) 2015 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. 
+ */
+
+#ifndef HTMLPictureElement_h
+#define HTMLPictureElement_h
+
+#include &quot;HTMLElement.h&quot;
+
+namespace WebCore {
+
+class HTMLPictureElement final : public HTMLElement {
+public:
+    static Ref&lt;HTMLPictureElement&gt; create(const QualifiedName&amp;, Document&amp;);
+
+    void sourcesChanged();
+
+private:
+    HTMLPictureElement(const QualifiedName&amp;, Document&amp;);
+};
+
+} // namespace WebCore
+
+#endif // HTMLPictureElement_h
</ins></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlHTMLPictureElementidlfromrev193533branchessafari601branchSourceWebCorehtmlHTMLPictureElementidl"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1.46-branch/Source/WebCore/html/HTMLPictureElement.idl (from rev 193533, branches/safari-601-branch/Source/WebCore/html/HTMLPictureElement.idl) (0 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/HTMLPictureElement.idl                                (rev 0)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/HTMLPictureElement.idl        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2015 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. 
+ */
+
+interface HTMLPictureElement : HTMLElement {
+};
+
</ins></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlHTMLSourceElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/HTMLSourceElement.cpp (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/HTMLSourceElement.cpp        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/HTMLSourceElement.cpp        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><del>-#if ENABLE(VIDEO)
</del><span class="cx"> #include &quot;HTMLSourceElement.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Event.h&quot;
</span><span class="lines">@@ -32,6 +31,7 @@
</span><span class="cx"> #include &quot;HTMLDocument.h&quot;
</span><span class="cx"> #include &quot;HTMLMediaElement.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><ins>+#include &quot;HTMLPictureElement.h&quot;
</ins><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -58,8 +58,12 @@
</span><span class="cx"> {
</span><span class="cx">     HTMLElement::insertedInto(insertionPoint);
</span><span class="cx">     Element* parent = parentElement();
</span><del>-    if (is&lt;HTMLMediaElement&gt;(parent))
-        downcast&lt;HTMLMediaElement&gt;(*parent).sourceWasAdded(this);
</del><ins>+    if (parent) {
+        if (is&lt;HTMLMediaElement&gt;(*parent))
+            downcast&lt;HTMLMediaElement&gt;(*parent).sourceWasAdded(this);
+        else if (is&lt;HTMLPictureElement&gt;(*parent))
+            downcast&lt;HTMLPictureElement&gt;(*parent).sourcesChanged();
+    }
</ins><span class="cx">     return InsertionDone;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -68,8 +72,12 @@
</span><span class="cx">     Element* parent = parentElement();
</span><span class="cx">     if (!parent &amp;&amp; is&lt;Element&gt;(removalRoot))
</span><span class="cx">         parent = &amp;downcast&lt;Element&gt;(removalRoot);
</span><del>-    if (is&lt;HTMLMediaElement&gt;(parent))
-        downcast&lt;HTMLMediaElement&gt;(*parent).sourceWasRemoved(this);
</del><ins>+    if (parent) {
+        if (is&lt;HTMLMediaElement&gt;(*parent))
+            downcast&lt;HTMLMediaElement&gt;(*parent).sourceWasRemoved(this);
+        else if (is&lt;HTMLPictureElement&gt;(*parent))
+            downcast&lt;HTMLPictureElement&gt;(*parent).sourcesChanged();
+    }
</ins><span class="cx">     HTMLElement::removedFrom(removalRoot);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -155,6 +163,15 @@
</span><span class="cx">     cancelPendingErrorEvent();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void HTMLSourceElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
+{
+    HTMLElement::parseAttribute(name, value);
+    if (name == srcsetAttr || name == sizesAttr || name == mediaAttr || name == typeAttr) {
+        auto* parent = parentNode();
+        if (is&lt;HTMLPictureElement&gt;(parent))
+            downcast&lt;HTMLPictureElement&gt;(*parent).sourcesChanged();
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-#endif
</del><ins>+}
+
</ins></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlHTMLSourceElementh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/HTMLSourceElement.h (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/HTMLSourceElement.h        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/HTMLSourceElement.h        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #ifndef HTMLSourceElement_h
</span><span class="cx"> #define HTMLSourceElement_h
</span><span class="cx"> 
</span><del>-#if ENABLE(VIDEO)
</del><span class="cx"> #include &quot;HTMLElement.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -59,6 +58,8 @@
</span><span class="cx">     void resume() override;
</span><span class="cx">     void stop() override;
</span><span class="cx"> 
</span><ins>+    void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
+
</ins><span class="cx">     void errorEventTimerFired();
</span><span class="cx"> 
</span><span class="cx">     Timer m_errorEventTimer;
</span><span class="lines">@@ -68,4 +69,4 @@
</span><span class="cx"> } //namespace
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-#endif
</del><ins>+
</ins></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlHTMLTagNamesin"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/HTMLTagNames.in (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/HTMLTagNames.in        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/HTMLTagNames.in        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx"> output constructorNeedsFormElement
</span><span class="cx"> p interfaceName=HTMLParagraphElement
</span><span class="cx"> param
</span><ins>+picture interfaceName=HTMLPictureElement
</ins><span class="cx"> plaintext interfaceName=HTMLElement
</span><span class="cx"> pre
</span><span class="cx"> progress interfaceName=HTMLProgressElement
</span><span class="lines">@@ -112,7 +113,7 @@
</span><span class="cx"> section interfaceName=HTMLElement
</span><span class="cx"> select constructorNeedsFormElement
</span><span class="cx"> small interfaceName=HTMLElement
</span><del>-source wrapperOnlyIfMediaIsAvailable, conditional=VIDEO
</del><ins>+source
</ins><span class="cx"> span
</span><span class="cx"> strike interfaceName=HTMLElement
</span><span class="cx"> strong interfaceName=HTMLElement
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlparserHTMLSrcsetParserh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/parser/HTMLSrcsetParser.h (193564 => 193565)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/parser/HTMLSrcsetParser.h        2015-12-06 07:09:52 UTC (rev 193564)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/parser/HTMLSrcsetParser.h        2015-12-06 07:11:59 UTC (rev 193565)
</span><span class="lines">@@ -91,6 +91,11 @@
</span><span class="cx">     {
</span><span class="cx">         return (originAttribute == SrcOrigin);
</span><span class="cx">     }
</span><ins>+    
+    bool isEmpty() const
+    {
+        return string.isEmpty();
+    }
</ins><span class="cx"> 
</span><span class="cx">     StringView string;
</span><span class="cx">     float density;
</span></span></pre>
</div>
</div>

</body>
</html>