<!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>[209549] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/209549">209549</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-12-08 11:09:35 -0800 (Thu, 08 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebIDL] WebGLContextAttributes should be a dictionary
https://bugs.webkit.org/show_bug.cgi?id=165572

Reviewed by Dean Jackson.

Source/WebCore:

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Remove unused files.

* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::getContext):
(WebCore::attributesFor3DContext): Deleted.
Re-work getContext to use JSDOMConvert and use the WebGLContextAttributes dictionary.

* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
Add missing inclusion of dictionaries.

* html/HTMLCanvasElement.cpp:
(WebCore::maxActivePixelMemory):
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::is2dType):
(WebCore::HTMLCanvasElement::getContext2d):
(WebCore::shouldEnableWebGL):
(WebCore::HTMLCanvasElement::is3dType):
(WebCore::HTMLCanvasElement::getContextWebGL):
* html/HTMLCanvasElement.h:
Refactor context creation of 2d and WebGL contexts into their own functions. Make the 
WebGL one take a WebGLContextAttributes struct.

* html/HTMLCanvasElement.idl:
No functionality change. Make IDL match the latest spec.

* html/canvas/CanvasContextAttributes.cpp: Removed.
* html/canvas/CanvasContextAttributes.h: Removed.
Remove unneeded base class.

* html/canvas/WebGLContextAttributes.cpp: Removed.
* html/canvas/WebGLContextAttributes.h:
Instead of a class, we can use a type alias of GraphicsContext3D::Attributes for
WebGLContextAttributes.

* html/canvas/WebGLContextAttributes.idl:
Convert to a dictionary.

* html/canvas/WebGL2RenderingContext.cpp:
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::clearIfComposited):
(WebCore::WebGLRenderingContextBase::getContextAttributes):
(WebCore::WebGLRenderingContextBase::applyStencilTest):
* html/canvas/WebGLRenderingContextBase.h:
Update to WebGLContextAttributes by value, since it is a simple struct now. Update getContextAttributes
to return a std::optional&lt;WebGLContextAttributes&gt;.

* html/canvas/WebGLRenderingContextBase.idl:
Make getContextAttributes return a nullable WebGLContextAttributes, as per spec.
        
* platform/graphics/GraphicsContext3D.h:
Sort attributes into categories, one that match WebGLContextAttributes, and the remainder.

LayoutTests:

* fast/canvas/webgl/context-creation-attributes-expected.txt:
Update test results.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebglcontextcreationattributesexpectedtxt">trunk/LayoutTests/fast/canvas/webgl/context-creation-attributes-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHTMLCanvasElementCustomcpp">trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLCanvasElementcpp">trunk/Source/WebCore/html/HTMLCanvasElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLCanvasElementh">trunk/Source/WebCore/html/HTMLCanvasElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLCanvasElementidl">trunk/Source/WebCore/html/HTMLCanvasElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGL2RenderingContextcpp">trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGL2RenderingContexth">trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLContextAttributesh">trunk/Source/WebCore/html/canvas/WebGLContextAttributes.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLContextAttributesidl">trunk/Source/WebCore/html/canvas/WebGLContextAttributes.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContexth">trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseh">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseidl">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContext3Dh">trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoGraphicsContext3DCairocpp">trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicseflGraphicsContext3DEflcpp">trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerBasecpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacGraphicsContext3DMacmm">trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLCommoncpp">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinGraphicsContext3DWincpp">trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContext3DAttributesh">trunk/Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasContextAttributescpp">trunk/Source/WebCore/html/canvas/CanvasContextAttributes.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasContextAttributesh">trunk/Source/WebCore/html/canvas/CanvasContextAttributes.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLContextAttributescpp">trunk/Source/WebCore/html/canvas/WebGLContextAttributes.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/LayoutTests/ChangeLog        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2016-12-08  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        [WebIDL] WebGLContextAttributes should be a dictionary
+        https://bugs.webkit.org/show_bug.cgi?id=165572
+
+        Reviewed by Dean Jackson.
+
+        * fast/canvas/webgl/context-creation-attributes-expected.txt:
+        Update test results.
+
+2016-12-05  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        [WebIDL] Add support for converting dictionaries to JS
+        https://bugs.webkit.org/show_bug.cgi?id=165367
+
+        Reviewed by Darin Adler and Alex Christensen.
+
+        * crypto/subtle/rsa-oaep-generate-key-expected.txt:
+        * crypto/subtle/rsa-oaep-generate-key.html:
+        * crypto/subtle/rsaes-pkcs1-v1_5-generate-key-expected.txt:
+        * crypto/subtle/rsaes-pkcs1-v1_5-generate-key-extractable-expected.txt:
+        * crypto/subtle/rsaes-pkcs1-v1_5-generate-key-extractable.html:
+        * crypto/subtle/rsaes-pkcs1-v1_5-generate-key.html:
+        * crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt:
+        * crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html:
+        * crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt:
+        * crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html:
+        * crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt:
+        * crypto/webkitSubtle/rsa-oaep-key-manipulation.html:
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt:
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt:
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html:
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html:
+        * crypto/workers/subtle/resources/rsa-generate-key.js:
+        * crypto/workers/subtle/rsa-generate-key-expected.txt:
+        Update tests and expected results to show that CryptoKeyPair is now a vanilla object, not a platform object.
+
</ins><span class="cx"> 2016-12-08  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Parser] Unskip/remove more tests
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebglcontextcreationattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/webgl/context-creation-attributes-expected.txt (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/context-creation-attributes-expected.txt        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/LayoutTests/fast/canvas/webgl/context-creation-attributes-expected.txt        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> Note that some of the values tested here might not be supported, and thus should return the default values.
</span><span class="cx"> 
</span><del>-{&quot;alpha&quot;:true,&quot;depth&quot;:true,&quot;stencil&quot;:false,&quot;antialias&quot;:true,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;preferLowPowerToHighPerformance&quot;:false,&quot;failIfMajorPerformanceCaveat&quot;:false}
-{&quot;alpha&quot;:true,&quot;depth&quot;:true,&quot;stencil&quot;:true,&quot;antialias&quot;:true,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;preferLowPowerToHighPerformance&quot;:false,&quot;failIfMajorPerformanceCaveat&quot;:false}
-{&quot;alpha&quot;:true,&quot;depth&quot;:true,&quot;stencil&quot;:false,&quot;antialias&quot;:true,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;preferLowPowerToHighPerformance&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:false}
-{&quot;alpha&quot;:true,&quot;depth&quot;:true,&quot;stencil&quot;:false,&quot;antialias&quot;:true,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;preferLowPowerToHighPerformance&quot;:false,&quot;failIfMajorPerformanceCaveat&quot;:false}
</del><ins>+{&quot;alpha&quot;:true,&quot;antialias&quot;:true,&quot;depth&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:false,&quot;preferLowPowerToHighPerformance&quot;:false,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;stencil&quot;:false}
+{&quot;alpha&quot;:true,&quot;antialias&quot;:true,&quot;depth&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:false,&quot;preferLowPowerToHighPerformance&quot;:false,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;stencil&quot;:true}
+{&quot;alpha&quot;:true,&quot;antialias&quot;:true,&quot;depth&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:false,&quot;preferLowPowerToHighPerformance&quot;:true,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;stencil&quot;:false}
+{&quot;alpha&quot;:true,&quot;antialias&quot;:true,&quot;depth&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:true,&quot;preferLowPowerToHighPerformance&quot;:false,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;stencil&quot;:false}
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -1783,7 +1783,6 @@
</span><span class="cx">     html/WeekInputType.cpp
</span><span class="cx"> 
</span><span class="cx">     html/canvas/ANGLEInstancedArrays.cpp
</span><del>-    html/canvas/CanvasContextAttributes.cpp
</del><span class="cx">     html/canvas/CanvasGradient.cpp
</span><span class="cx">     html/canvas/CanvasPath.cpp
</span><span class="cx">     html/canvas/CanvasPattern.cpp
</span><span class="lines">@@ -1809,7 +1808,6 @@
</span><span class="cx">     html/canvas/WebGLCompressedTextureATC.cpp
</span><span class="cx">     html/canvas/WebGLCompressedTexturePVRTC.cpp
</span><span class="cx">     html/canvas/WebGLCompressedTextureS3TC.cpp
</span><del>-    html/canvas/WebGLContextAttributes.cpp
</del><span class="cx">     html/canvas/WebGLContextEvent.cpp
</span><span class="cx">     html/canvas/WebGLContextGroup.cpp
</span><span class="cx">     html/canvas/WebGLContextObject.cpp
</span><span class="lines">@@ -3104,7 +3102,6 @@
</span><span class="cx">         html/canvas/WebGLCompressedTextureATC.cpp
</span><span class="cx">         html/canvas/WebGLCompressedTexturePVRTC.cpp
</span><span class="cx">         html/canvas/WebGLCompressedTextureS3TC.cpp
</span><del>-        html/canvas/WebGLContextAttributes.cpp
</del><span class="cx">         html/canvas/WebGLContextEvent.cpp
</span><span class="cx">         html/canvas/WebGLContextGroup.cpp
</span><span class="cx">         html/canvas/WebGLContextObject.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/ChangeLog        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -1,3 +1,69 @@
</span><ins>+2016-12-07  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        [WebIDL] WebGLContextAttributes should be a dictionary
+        https://bugs.webkit.org/show_bug.cgi?id=165572
+
+        Reviewed by Dean Jackson.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        Remove unused files.
+
+        * bindings/js/JSHTMLCanvasElementCustom.cpp:
+        (WebCore::JSHTMLCanvasElement::getContext):
+        (WebCore::attributesFor3DContext): Deleted.
+        Re-work getContext to use JSDOMConvert and use the WebGLContextAttributes dictionary.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (NativeToJSValueDOMConvertNeedsState):
+        (NativeToJSValueDOMConvertNeedsGlobalObject):
+        Add missing inclusion of dictionaries.
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::maxActivePixelMemory):
+        (WebCore::HTMLCanvasElement::getContext):
+        (WebCore::HTMLCanvasElement::is2dType):
+        (WebCore::HTMLCanvasElement::getContext2d):
+        (WebCore::shouldEnableWebGL):
+        (WebCore::HTMLCanvasElement::is3dType):
+        (WebCore::HTMLCanvasElement::getContextWebGL):
+        * html/HTMLCanvasElement.h:
+        Refactor context creation of 2d and WebGL contexts into their own functions. Make the 
+        WebGL one take a WebGLContextAttributes struct.
+
+        * html/HTMLCanvasElement.idl:
+        No functionality change. Make IDL match the latest spec.
+
+        * html/canvas/CanvasContextAttributes.cpp: Removed.
+        * html/canvas/CanvasContextAttributes.h: Removed.
+        Remove unneeded base class.
+
+        * html/canvas/WebGLContextAttributes.cpp: Removed.
+        * html/canvas/WebGLContextAttributes.h:
+        Instead of a class, we can use a type alias of GraphicsContext3D::Attributes for
+        WebGLContextAttributes.
+
+        * html/canvas/WebGLContextAttributes.idl:
+        Convert to a dictionary.
+
+        * html/canvas/WebGL2RenderingContext.cpp:
+        * html/canvas/WebGL2RenderingContext.h:
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::create):
+        (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
+        (WebCore::WebGLRenderingContextBase::clearIfComposited):
+        (WebCore::WebGLRenderingContextBase::getContextAttributes):
+        (WebCore::WebGLRenderingContextBase::applyStencilTest):
+        * html/canvas/WebGLRenderingContextBase.h:
+        Update to WebGLContextAttributes by value, since it is a simple struct now. Update getContextAttributes
+        to return a std::optional&lt;WebGLContextAttributes&gt;.
+
+        * html/canvas/WebGLRenderingContextBase.idl:
+        Make getContextAttributes return a nullable WebGLContextAttributes, as per spec.
+        
+        * platform/graphics/GraphicsContext3D.h:
+        Sort attributes into categories, one that match WebGLContextAttributes, and the remainder.
+
</ins><span class="cx"> 2016-12-08  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Do not create multicolumn context for certain type of renderers.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -2655,10 +2655,7 @@
</span><span class="cx">                 6E47E66110B7944B00B186C8 /* WebGLGetInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E47E65F10B7944B00B186C8 /* WebGLGetInfo.h */; };
</span><span class="cx">                 6E4ABCD4138EA0B70071D291 /* JSHTMLUnknownElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E4ABCD2138EA0B70071D291 /* JSHTMLUnknownElement.cpp */; };
</span><span class="cx">                 6E4ABCD5138EA0B70071D291 /* JSHTMLUnknownElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4ABCD3138EA0B70071D291 /* JSHTMLUnknownElement.h */; };
</span><del>-                6E4E91AC10F7FB3100A2779C /* CanvasContextAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E4E91A710F7FB3100A2779C /* CanvasContextAttributes.cpp */; };
-                6E4E91AD10F7FB3100A2779C /* CanvasContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4E91A810F7FB3100A2779C /* CanvasContextAttributes.h */; };
-                6E4E91AE10F7FB3100A2779C /* WebGLContextAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E4E91A910F7FB3100A2779C /* WebGLContextAttributes.cpp */; };
-                6E4E91AF10F7FB3100A2779C /* WebGLContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4E91AA10F7FB3100A2779C /* WebGLContextAttributes.h */; };
</del><ins>+                6E4E91AF10F7FB3100A2779C /* WebGLContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4E91AA10F7FB3100A2779C /* WebGLContextAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 6E67D2A61280E8A4008758F7 /* Extensions3DOpenGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E67D2A41280E8A4008758F7 /* Extensions3DOpenGL.cpp */; };
</span><span class="cx">                 6E67D2A71280E8A4008758F7 /* Extensions3DOpenGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E67D2A51280E8A4008758F7 /* Extensions3DOpenGL.h */; };
</span><span class="cx">                 6E67D2A91280E8BD008758F7 /* Extensions3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E67D2A81280E8BD008758F7 /* Extensions3D.h */; };
</span><span class="lines">@@ -2843,6 +2840,7 @@
</span><span class="cx">                 7C1E97281A9F9834007BF0FB /* AutoFillButtonElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C1E97261A9F9834007BF0FB /* AutoFillButtonElement.h */; };
</span><span class="cx">                 7C2BDD3D17C7F98C0038FF15 /* JSDOMGlobalObjectTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */; };
</span><span class="cx">                 7C2BDD3E17C7F98C0038FF15 /* JSDOMGlobalObjectTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */; };
</span><ins>+                7C330A021DF8FAC600D3395C /* GraphicsContext3DAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C330A011DF8FAC600D3395C /* GraphicsContext3DAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 7C33F3621B4A050400502CAF /* JSDocumentFragmentCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */; };
</span><span class="cx">                 7C39C3641DDA864C00FEFB29 /* SVGLengthListValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C39C3621DDA864900FEFB29 /* SVGLengthListValues.cpp */; };
</span><span class="cx">                 7C39C3651DDA865200FEFB29 /* SVGLengthListValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C39C3631DDA864900FEFB29 /* SVGLengthListValues.h */; };
</span><span class="lines">@@ -9952,9 +9950,6 @@
</span><span class="cx">                 6E47E65F10B7944B00B186C8 /* WebGLGetInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLGetInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6E4ABCD2138EA0B70071D291 /* JSHTMLUnknownElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLUnknownElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6E4ABCD3138EA0B70071D291 /* JSHTMLUnknownElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLUnknownElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                6E4E91A710F7FB3100A2779C /* CanvasContextAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasContextAttributes.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                6E4E91A810F7FB3100A2779C /* CanvasContextAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasContextAttributes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                6E4E91A910F7FB3100A2779C /* WebGLContextAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLContextAttributes.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 6E4E91AA10F7FB3100A2779C /* WebGLContextAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLContextAttributes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6E4E91AB10F7FB3100A2779C /* WebGLContextAttributes.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLContextAttributes.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6E67D2A41280E8A4008758F7 /* Extensions3DOpenGL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Extensions3DOpenGL.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -10318,6 +10313,7 @@
</span><span class="cx">                 7C1E97261A9F9834007BF0FB /* AutoFillButtonElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoFillButtonElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMGlobalObjectTask.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMGlobalObjectTask.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7C330A011DF8FAC600D3395C /* GraphicsContext3DAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContext3DAttributes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentFragmentCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C39C3621DDA864900FEFB29 /* SVGLengthListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLengthListValues.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C39C3631DDA864900FEFB29 /* SVGLengthListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLengthListValues.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16769,8 +16765,6 @@
</span><span class="cx">                                 31A795C11888B72400382F90 /* ANGLEInstancedArrays.cpp */,
</span><span class="cx">                                 31A795C21888B72400382F90 /* ANGLEInstancedArrays.h */,
</span><span class="cx">                                 31A795C31888B72400382F90 /* ANGLEInstancedArrays.idl */,
</span><del>-                                6E4E91A710F7FB3100A2779C /* CanvasContextAttributes.cpp */,
-                                6E4E91A810F7FB3100A2779C /* CanvasContextAttributes.h */,
</del><span class="cx">                                 49484FB3102CF23C00187DD3 /* CanvasGradient.cpp */,
</span><span class="cx">                                 49484FB4102CF23C00187DD3 /* CanvasGradient.h */,
</span><span class="cx">                                 49484FB5102CF23C00187DD3 /* CanvasGradient.idl */,
</span><span class="lines">@@ -16845,7 +16839,6 @@
</span><span class="cx">                                 6E3FAE8C14733FDB00E42306 /* WebGLCompressedTextureS3TC.cpp */,
</span><span class="cx">                                 6E3FAE8D14733FDB00E42306 /* WebGLCompressedTextureS3TC.h */,
</span><span class="cx">                                 6E3FAE9014733FEA00E42306 /* WebGLCompressedTextureS3TC.idl */,
</span><del>-                                6E4E91A910F7FB3100A2779C /* WebGLContextAttributes.cpp */,
</del><span class="cx">                                 6E4E91AA10F7FB3100A2779C /* WebGLContextAttributes.h */,
</span><span class="cx">                                 6E4E91AB10F7FB3100A2779C /* WebGLContextAttributes.idl */,
</span><span class="cx">                                 93F6F1EA127F70B10055CB06 /* WebGLContextEvent.cpp */,
</span><span class="lines">@@ -21614,6 +21607,7 @@
</span><span class="cx">                                 B2A015930AF6CD53006BCE0E /* GraphicsContext.h */,
</span><span class="cx">                                 6E21C6BF1126338500A7BE02 /* GraphicsContext3D.cpp */,
</span><span class="cx">                                 49C7B9FB1042D3650009D447 /* GraphicsContext3D.h */,
</span><ins>+                                7C330A011DF8FAC600D3395C /* GraphicsContext3DAttributes.h */,
</ins><span class="cx">                                 0F580B090F12A2690051D689 /* GraphicsLayer.cpp */,
</span><span class="cx">                                 0F580B0A0F12A2690051D689 /* GraphicsLayer.h */,
</span><span class="cx">                                 0F580B0B0F12A2690051D689 /* GraphicsLayerClient.h */,
</span><span class="lines">@@ -25012,7 +25006,6 @@
</span><span class="cx">                                 E43AF8E71AC5B7EC00CA717E /* CacheValidation.h in Headers */,
</span><span class="cx">                                 49AE2D97134EE5F90072920A /* CalculationValue.h in Headers */,
</span><span class="cx">                                 B1D5ECB5134B58DA0087C78F /* CallbackFunction.h in Headers */,
</span><del>-                                6E4E91AD10F7FB3100A2779C /* CanvasContextAttributes.h in Headers */,
</del><span class="cx">                                 49484FC2102CF23C00187DD3 /* CanvasGradient.h in Headers */,
</span><span class="cx">                                 4671E0661D67A59600C6B497 /* CanvasPath.h in Headers */,
</span><span class="cx">                                 49484FC5102CF23C00187DD3 /* CanvasPattern.h in Headers */,
</span><span class="lines">@@ -27876,6 +27869,7 @@
</span><span class="cx">                                 BC22747B0E8366E200E7F975 /* SVGRenderStyleDefs.h in Headers */,
</span><span class="cx">                                 436708F212D9CA4B00044234 /* SVGRenderSupport.h in Headers */,
</span><span class="cx">                                 436708F412D9CA4B00044234 /* SVGRenderTreeAsText.h in Headers */,
</span><ins>+                                7C330A021DF8FAC600D3395C /* GraphicsContext3DAttributes.h in Headers */,
</ins><span class="cx">                                 436708F612D9CA4B00044234 /* SVGResources.h in Headers */,
</span><span class="cx">                                 436708F812D9CA4B00044234 /* SVGResourcesCache.h in Headers */,
</span><span class="cx">                                 436708FA12D9CA4B00044234 /* SVGResourcesCycleSolver.h in Headers */,
</span><span class="lines">@@ -28409,7 +28403,7 @@
</span><span class="cx">                                 37A1EAA3142699BC0087F425 /* Check For Inappropriate Objective-C Class Names */,
</span><span class="cx">                                 5DF50887116F3077005202AB /* Check For Inappropriate Files In Framework */,
</span><span class="cx">                                 71D6AA381DA4E69400B23969 /* Copy modern media controls code and assets */,
</span><del>-                                51D394771DF2486700ABE875 /* Copy internal scripts */,
</del><ins>+                                51D394771DF2486700ABE875 /* Copy Internal Scripts */,
</ins><span class="cx">                         );
</span><span class="cx">                         buildRules = (
</span><span class="cx">                         );
</span><span class="lines">@@ -28866,7 +28860,6 @@
</span><span class="cx">                                 E43AF8E61AC5B7E800CA717E /* CacheValidation.cpp in Sources */,
</span><span class="cx">                                 49AE2D96134EE5F90072920A /* CalculationValue.cpp in Sources */,
</span><span class="cx">                                 B1827493134CA4C100B98C2D /* CallbackFunction.cpp in Sources */,
</span><del>-                                6E4E91AC10F7FB3100A2779C /* CanvasContextAttributes.cpp in Sources */,
</del><span class="cx">                                 49484FC1102CF23C00187DD3 /* CanvasGradient.cpp in Sources */,
</span><span class="cx">                                 4671E0651D67A59600C6B497 /* CanvasPath.cpp in Sources */,
</span><span class="cx">                                 49484FC4102CF23C00187DD3 /* CanvasPattern.cpp in Sources */,
</span><span class="lines">@@ -31682,7 +31675,6 @@
</span><span class="cx">                                 7E66E23316D6EB6C00F7E7FF /* WebGLCompressedTextureATC.cpp in Sources */,
</span><span class="cx">                                 7E66E23317E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.cpp in Sources */,
</span><span class="cx">                                 6E3FAE8E14733FDB00E42306 /* WebGLCompressedTextureS3TC.cpp in Sources */,
</span><del>-                                6E4E91AE10F7FB3100A2779C /* WebGLContextAttributes.cpp in Sources */,
</del><span class="cx">                                 93F6F1ED127F70B10055CB06 /* WebGLContextEvent.cpp in Sources */,
</span><span class="cx">                                 01D3CF8214BD0A3000FE9970 /* WebGLContextGroup.cpp in Sources */,
</span><span class="cx">                                 01D3CF8414BD0A3000FE9970 /* WebGLContextObject.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHTMLCanvasElementCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;JSHTMLCanvasElement.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;CanvasContextAttributes.h&quot;
</del><span class="cx"> #include &quot;HTMLCanvasElement.h&quot;
</span><span class="cx"> #include &quot;JSCanvasRenderingContext2D.h&quot;
</span><span class="cx"> #include &lt;bindings/ScriptObject.h&gt;
</span><span class="lines">@@ -34,9 +33,8 @@
</span><span class="cx"> #include &lt;wtf/GetPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><del>-#include &quot;JSDictionary.h&quot;
</del><ins>+#include &quot;JSWebGLContextAttributes.h&quot;
</ins><span class="cx"> #include &quot;JSWebGLRenderingContextBase.h&quot;
</span><del>-#include &quot;WebGLContextAttributes.h&quot;
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="lines">@@ -43,63 +41,30 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-#if ENABLE(WEBGL)
-
-static RefPtr&lt;CanvasContextAttributes&gt; attributesFor3DContext(ExecState&amp; state, ThrowScope&amp; scope)
-{
-    JSValue initializerValue = state.argument(1);
-    if (initializerValue.isUndefinedOrNull())
-        return nullptr;
-    
-    JSObject* initializerObject = initializerValue.toObject(&amp;state);
-    ASSERT_UNUSED(scope, !scope.exception());
-    JSDictionary dictionary(&amp;state, initializerObject);
-    
-    GraphicsContext3D::Attributes graphicsAttrs;
-    
-    dictionary.tryGetProperty(&quot;alpha&quot;, graphicsAttrs.alpha);
-    dictionary.tryGetProperty(&quot;depth&quot;, graphicsAttrs.depth);
-    dictionary.tryGetProperty(&quot;stencil&quot;, graphicsAttrs.stencil);
-    dictionary.tryGetProperty(&quot;antialias&quot;, graphicsAttrs.antialias);
-    dictionary.tryGetProperty(&quot;premultipliedAlpha&quot;, graphicsAttrs.premultipliedAlpha);
-    dictionary.tryGetProperty(&quot;preserveDrawingBuffer&quot;, graphicsAttrs.preserveDrawingBuffer);
-    dictionary.tryGetProperty(&quot;preferLowPowerToHighPerformance&quot;, graphicsAttrs.preferLowPowerToHighPerformance);
-
-    return WebGLContextAttributes::create(graphicsAttrs);
-}
-
-#endif
-
</del><span class="cx"> JSValue JSHTMLCanvasElement::getContext(ExecState&amp; state)
</span><span class="cx"> {
</span><del>-    VM&amp; vm = state.vm();
</del><ins>+    auto&amp; vm = state.vm();
</ins><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     if (UNLIKELY(state.argumentCount() &lt; 1))
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><del>-    HTMLCanvasElement&amp; canvas = wrapped();
-    const String&amp; contextId = state.uncheckedArgument(0).toWTFString(&amp;state);
-    
-    RefPtr&lt;CanvasContextAttributes&gt; attributes;
</del><ins>+    auto contextId = convert&lt;IDLDOMString&gt;(state, state.uncheckedArgument(0), StringConversionConfiguration::Normal);
+    RETURN_IF_EXCEPTION(scope, JSValue());
</ins><span class="cx"> 
</span><ins>+    if (HTMLCanvasElement::is2dType(contextId))
+        return toJS&lt;IDLNullable&lt;IDLInterface&lt;CanvasRenderingContext2D&gt;&gt;&gt;(state, *globalObject(), static_cast&lt;CanvasRenderingContext2D*&gt;(wrapped().getContext2d(contextId)));
+
</ins><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx">     if (HTMLCanvasElement::is3dType(contextId)) {
</span><del>-        attributes = attributesFor3DContext(state, scope);
</del><ins>+        auto attributes = convert&lt;IDLDictionary&lt;WebGLContextAttributes&gt;&gt;(state, state.argument(1));
</ins><span class="cx">         RETURN_IF_EXCEPTION(scope, JSValue());
</span><ins>+
+        return toJS&lt;IDLNullable&lt;IDLInterface&lt;WebGLRenderingContextBase&gt;&gt;&gt;(state, *globalObject(), static_cast&lt;WebGLRenderingContextBase*&gt;(wrapped().getContextWebGL(contextId, WTFMove(attributes))));
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><del>-    
-    auto* context = canvas.getContext(contextId, attributes.get());
-    if (!context)
-        return jsNull();
</del><span class="cx"> 
</span><del>-#if ENABLE(WEBGL)
-    if (is&lt;WebGLRenderingContextBase&gt;(*context))
-        return toJS(&amp;state, globalObject(), downcast&lt;WebGLRenderingContextBase&gt;(*context));
-#endif
-
-    return toJS(&amp;state, globalObject(), downcast&lt;CanvasRenderingContext2D&gt;(*context));
</del><ins>+    return jsNull();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSHTMLCanvasElement::toDataURL(ExecState&amp; state)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -5335,6 +5335,7 @@
</span><span class="cx">     return 1 if $codeGenerator-&gt;IsRecordType($type);
</span><span class="cx">     return 1 if $codeGenerator-&gt;IsStringType($type);
</span><span class="cx">     return 1 if $codeGenerator-&gt;IsEnumType($type);
</span><ins>+    return 1 if $codeGenerator-&gt;IsDictionaryType($type);
</ins><span class="cx">     return 1 if $codeGenerator-&gt;IsInterfaceType($type);
</span><span class="cx">     return 1 if $codeGenerator-&gt;IsTypedArrayType($type);
</span><span class="cx">     return 1 if $type-&gt;name eq &quot;Date&quot;;
</span><span class="lines">@@ -5352,6 +5353,7 @@
</span><span class="cx">     return 1 if $type-&gt;isUnion;
</span><span class="cx">     return 1 if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($type);
</span><span class="cx">     return 1 if $codeGenerator-&gt;IsRecordType($type);
</span><ins>+    return 1 if $codeGenerator-&gt;IsDictionaryType($type);
</ins><span class="cx">     return 1 if $codeGenerator-&gt;IsInterfaceType($type);
</span><span class="cx">     return 1 if $codeGenerator-&gt;IsTypedArrayType($type);
</span><span class="cx">     return 1 if $type-&gt;name eq &quot;SerializedScriptValue&quot;;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -1268,6 +1268,10 @@
</span><span class="cx"> bool setJSTestObjStringObjRecordAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><span class="cx"> JSC::EncodedJSValue jsTestObjStringNullableObjRecordAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> bool setJSTestObjStringNullableObjRecordAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><ins>+JSC::EncodedJSValue jsTestObjDictionaryAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestObjDictionaryAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestObjNullableDictionaryAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestObjNullableDictionaryAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</ins><span class="cx"> JSC::EncodedJSValue jsTestObjImplementationEnumAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> bool setJSTestObjImplementationEnumAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><span class="cx"> JSC::EncodedJSValue jsTestObjXMLObjAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="lines">@@ -1600,6 +1604,8 @@
</span><span class="cx">     { &quot;usvstringLongRecordAttr&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjUsvstringLongRecordAttr), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjUsvstringLongRecordAttr) } },
</span><span class="cx">     { &quot;stringObjRecordAttr&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjStringObjRecordAttr), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjStringObjRecordAttr) } },
</span><span class="cx">     { &quot;stringNullableObjRecordAttr&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjStringNullableObjRecordAttr), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjStringNullableObjRecordAttr) } },
</span><ins>+    { &quot;dictionaryAttr&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjDictionaryAttr), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjDictionaryAttr) } },
+    { &quot;nullableDictionaryAttr&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjNullableDictionaryAttr), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjNullableDictionaryAttr) } },
</ins><span class="cx">     { &quot;implementationEnumAttr&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjImplementationEnumAttr), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjImplementationEnumAttr) } },
</span><span class="cx">     { &quot;XMLObjAttr&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjXMLObjAttr), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjXMLObjAttr) } },
</span><span class="cx">     { &quot;create&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjCreate), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjCreate) } },
</span><span class="lines">@@ -2465,6 +2471,38 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline JSValue jsTestObjDictionaryAttrGetter(ExecState&amp;, JSTestObj&amp;, ThrowScope&amp; throwScope);
+
+EncodedJSValue jsTestObjDictionaryAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    return BindingCaller&lt;JSTestObj&gt;::attribute&lt;jsTestObjDictionaryAttrGetter&gt;(state, thisValue, &quot;dictionaryAttr&quot;);
+}
+
+static inline JSValue jsTestObjDictionaryAttrGetter(ExecState&amp; state, JSTestObj&amp; thisObject, ThrowScope&amp; throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    auto&amp; impl = thisObject.wrapped();
+    JSValue result = toJS&lt;IDLDictionary&lt;TestObj::Dictionary&gt;&gt;(state, *thisObject.globalObject(), impl.dictionaryAttr());
+    return result;
+}
+
+static inline JSValue jsTestObjNullableDictionaryAttrGetter(ExecState&amp;, JSTestObj&amp;, ThrowScope&amp; throwScope);
+
+EncodedJSValue jsTestObjNullableDictionaryAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    return BindingCaller&lt;JSTestObj&gt;::attribute&lt;jsTestObjNullableDictionaryAttrGetter&gt;(state, thisValue, &quot;nullableDictionaryAttr&quot;);
+}
+
+static inline JSValue jsTestObjNullableDictionaryAttrGetter(ExecState&amp; state, JSTestObj&amp; thisObject, ThrowScope&amp; throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    auto&amp; impl = thisObject.wrapped();
+    JSValue result = toJS&lt;IDLNullable&lt;IDLDictionary&lt;TestObj::Dictionary&gt;&gt;&gt;(state, *thisObject.globalObject(), impl.nullableDictionaryAttr());
+    return result;
+}
+
</ins><span class="cx"> static inline JSValue jsTestObjImplementationEnumAttrGetter(ExecState&amp;, JSTestObj&amp;, ThrowScope&amp; throwScope);
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue jsTestObjImplementationEnumAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
</span><span class="lines">@@ -4011,6 +4049,44 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+static inline bool setJSTestObjDictionaryAttrFunction(ExecState&amp;, JSTestObj&amp;, JSValue, ThrowScope&amp;);
+
+bool setJSTestObjDictionaryAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    return BindingCaller&lt;JSTestObj&gt;::setAttribute&lt;setJSTestObjDictionaryAttrFunction&gt;(state, thisValue, encodedValue, &quot;dictionaryAttr&quot;);
+}
+
+static inline bool setJSTestObjDictionaryAttrFunction(ExecState&amp; state, JSTestObj&amp; thisObject, JSValue value, ThrowScope&amp; throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto&amp; impl = thisObject.wrapped();
+    auto nativeValue = convert&lt;IDLDictionary&lt;TestObj::Dictionary&gt;&gt;(state, value);
+    RETURN_IF_EXCEPTION(throwScope, false);
+    impl.setDictionaryAttr(WTFMove(nativeValue));
+    return true;
+}
+
+
+static inline bool setJSTestObjNullableDictionaryAttrFunction(ExecState&amp;, JSTestObj&amp;, JSValue, ThrowScope&amp;);
+
+bool setJSTestObjNullableDictionaryAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+    return BindingCaller&lt;JSTestObj&gt;::setAttribute&lt;setJSTestObjNullableDictionaryAttrFunction&gt;(state, thisValue, encodedValue, &quot;nullableDictionaryAttr&quot;);
+}
+
+static inline bool setJSTestObjNullableDictionaryAttrFunction(ExecState&amp; state, JSTestObj&amp; thisObject, JSValue value, ThrowScope&amp; throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto&amp; impl = thisObject.wrapped();
+    auto nativeValue = convert&lt;IDLNullable&lt;IDLDictionary&lt;TestObj::Dictionary&gt;&gt;&gt;(state, value);
+    RETURN_IF_EXCEPTION(throwScope, false);
+    impl.setNullableDictionaryAttr(WTFMove(nativeValue));
+    return true;
+}
+
+
</ins><span class="cx"> static inline bool setJSTestObjImplementationEnumAttrFunction(ExecState&amp;, JSTestObj&amp;, JSValue, ThrowScope&amp;);
</span><span class="cx"> 
</span><span class="cx"> bool setJSTestObjImplementationEnumAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -82,6 +82,8 @@
</span><span class="cx">     attribute record&lt;ByteString, long&gt; usvstringLongRecordAttr;
</span><span class="cx">     attribute record&lt;DOMString, TestObj&gt; stringObjRecordAttr;
</span><span class="cx">     attribute record&lt;DOMString, TestObj?&gt; stringNullableObjRecordAttr;
</span><ins>+    attribute TestDictionary dictionaryAttr;
+    attribute TestDictionary? nullableDictionaryAttr;
</ins><span class="cx"> 
</span><span class="cx">     attribute TestEnumTypeWithAlternateImplementationName implementationEnumAttr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLCanvasElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLCanvasElement.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLCanvasElement.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -170,7 +170,73 @@
</span><span class="cx">     setAttributeWithoutSynchronization(widthAttr, AtomicString::number(limitToOnlyHTMLNonNegative(value, defaultWidth)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline size_t maxActivePixelMemory()
+{
+    static size_t maxPixelMemory;
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        maxPixelMemory = std::max(ramSize() / 4, 2151 * MB);
+    });
+    return maxPixelMemory;
+}
+
+CanvasRenderingContext* HTMLCanvasElement::getContext(const String&amp; type)
+{
+    if (HTMLCanvasElement::is2dType(type))
+        return getContext2d(type);
+
</ins><span class="cx"> #if ENABLE(WEBGL)
</span><ins>+    if (HTMLCanvasElement::is3dType(type))
+        return getContextWebGL(type);
+#endif
+
+    return nullptr;
+}
+
+bool HTMLCanvasElement::is2dType(const String&amp; type)
+{
+    return type == &quot;2d&quot;;
+}
+
+CanvasRenderingContext* HTMLCanvasElement::getContext2d(const String&amp; type)
+{
+    ASSERT_UNUSED(HTMLCanvasElement::is2dType(type), type);
+
+    if (m_context &amp;&amp; !m_context-&gt;is2d())
+        return nullptr;
+    if (!m_context) {
+        bool usesDashboardCompatibilityMode = false;
+#if ENABLE(DASHBOARD_SUPPORT)
+        if (Settings* settings = document().settings())
+            usesDashboardCompatibilityMode = settings-&gt;usesDashboardBackwardCompatibilityMode();
+#endif
+
+        // Make sure we don't use more pixel memory than the system can support.
+        size_t requestedPixelMemory = 4 * width() * height();
+        if (activePixelMemory + requestedPixelMemory &gt; maxActivePixelMemory()) {
+            StringBuilder stringBuilder;
+            stringBuilder.appendLiteral(&quot;Total canvas memory use exceeds the maximum limit (&quot;);
+            stringBuilder.appendNumber(maxActivePixelMemory() / 1024 / 1024);
+            stringBuilder.appendLiteral(&quot; MB).&quot;);
+            document().addConsoleMessage(MessageSource::JS, MessageLevel::Warning, stringBuilder.toString());
+            return nullptr;
+        }
+
+        m_context = std::make_unique&lt;CanvasRenderingContext2D&gt;(*this, document().inQuirksMode(), usesDashboardCompatibilityMode);
+
+        downcast&lt;CanvasRenderingContext2D&gt;(*m_context).setUsesDisplayListDrawing(m_usesDisplayListDrawing);
+        downcast&lt;CanvasRenderingContext2D&gt;(*m_context).setTracksDisplayListReplay(m_tracksDisplayListReplay);
+
+#if USE(IOSURFACE_CANVAS_BACKING_STORE) || ENABLE(ACCELERATED_2D_CANVAS)
+        // Need to make sure a RenderLayer and compositing layer get created for the Canvas
+        invalidateStyleAndLayerComposition();
+#endif
+    }
+
+    return m_context.get();
+}
+
+#if ENABLE(WEBGL)
</ins><span class="cx"> static bool requiresAcceleratedCompositingForWebGL()
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(GTK) || PLATFORM(EFL)
</span><span class="lines">@@ -193,91 +259,38 @@
</span><span class="cx"> 
</span><span class="cx">     return settings-&gt;acceleratedCompositingEnabled();
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><del>-static inline size_t maxActivePixelMemory()
</del><ins>+bool HTMLCanvasElement::is3dType(const String&amp; type)
</ins><span class="cx"> {
</span><del>-    static size_t maxPixelMemory;
-    static std::once_flag onceFlag;
-    std::call_once(onceFlag, [] {
-        maxPixelMemory = std::max(ramSize() / 4, 2151 * MB);
-    });
-    return maxPixelMemory;
</del><ins>+    // Retain support for the legacy &quot;webkit-3d&quot; name.
+    return type == &quot;webgl&quot; || type == &quot;experimental-webgl&quot;
+#if ENABLE(WEBGL2)
+        || type == &quot;webgl2&quot;
+#endif
+        || type == &quot;webkit-3d&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-CanvasRenderingContext* HTMLCanvasElement::getContext(const String&amp; type, CanvasContextAttributes* attrs)
</del><ins>+CanvasRenderingContext* HTMLCanvasElement::getContextWebGL(const String&amp; type, WebGLContextAttributes&amp;&amp; attrs)
</ins><span class="cx"> {
</span><del>-    if (is2dType(type)) {
-        if (m_context &amp;&amp; !m_context-&gt;is2d())
-            return nullptr;
-        if (!m_context) {
-            bool usesDashboardCompatibilityMode = false;
-#if ENABLE(DASHBOARD_SUPPORT)
-            if (Settings* settings = document().settings())
-                usesDashboardCompatibilityMode = settings-&gt;usesDashboardBackwardCompatibilityMode();
-#endif
</del><ins>+    ASSERT(HTMLCanvasElement::is3dType(type));
</ins><span class="cx"> 
</span><del>-            // Make sure we don't use more pixel memory than the system can support.
-            size_t requestedPixelMemory = 4 * width() * height();
-            if (activePixelMemory + requestedPixelMemory &gt; maxActivePixelMemory()) {
-                StringBuilder stringBuilder;
-                stringBuilder.appendLiteral(&quot;Total canvas memory use exceeds the maximum limit (&quot;);
-                stringBuilder.appendNumber(maxActivePixelMemory() / 1024 / 1024);
-                stringBuilder.appendLiteral(&quot; MB).&quot;);
-                document().addConsoleMessage(MessageSource::JS, MessageLevel::Warning, stringBuilder.toString());
-                return nullptr;
-            }
</del><ins>+    if (!shouldEnableWebGL(document().settings()))
+        return nullptr;
</ins><span class="cx"> 
</span><del>-            m_context = std::make_unique&lt;CanvasRenderingContext2D&gt;(*this, document().inQuirksMode(), usesDashboardCompatibilityMode);
</del><ins>+    if (m_context &amp;&amp; !m_context-&gt;is3d())
+        return nullptr;
</ins><span class="cx"> 
</span><del>-            downcast&lt;CanvasRenderingContext2D&gt;(*m_context).setUsesDisplayListDrawing(m_usesDisplayListDrawing);
-            downcast&lt;CanvasRenderingContext2D&gt;(*m_context).setTracksDisplayListReplay(m_tracksDisplayListReplay);
-
-#if USE(IOSURFACE_CANVAS_BACKING_STORE) || ENABLE(ACCELERATED_2D_CANVAS)
</del><ins>+    if (!m_context) {
+        m_context = WebGLRenderingContextBase::create(*this, attrs, type);
+        if (m_context) {
</ins><span class="cx">             // Need to make sure a RenderLayer and compositing layer get created for the Canvas
</span><span class="cx">             invalidateStyleAndLayerComposition();
</span><del>-#endif
</del><span class="cx">         }
</span><del>-        return m_context.get();
</del><span class="cx">     }
</span><del>-#if ENABLE(WEBGL)
-    if (shouldEnableWebGL(document().settings())) {
</del><span class="cx"> 
</span><del>-        if (is3dType(type)) {
-            if (m_context &amp;&amp; !m_context-&gt;is3d())
-                return nullptr;
-            if (!m_context) {
-                m_context = WebGLRenderingContextBase::create(*this, static_cast&lt;WebGLContextAttributes*&gt;(attrs), type);
-                if (m_context) {
-                    // Need to make sure a RenderLayer and compositing layer get created for the Canvas
-                    invalidateStyleAndLayerComposition();
-                }
-            }
-            return m_context.get();
-        }
-    }
-#else
-    UNUSED_PARAM(attrs);
-#endif
-    return nullptr;
</del><ins>+    return m_context.get();
</ins><span class="cx"> }
</span><del>-
-bool HTMLCanvasElement::is2dType(const String&amp; type)
-{
-    return type == &quot;2d&quot;;
-}
-
-#if ENABLE(WEBGL)
-bool HTMLCanvasElement::is3dType(const String&amp; type)
-{
-    // Retain support for the legacy &quot;webkit-3d&quot; name.
-    return type == &quot;webgl&quot; || type == &quot;experimental-webgl&quot;
-#if ENABLE(WEBGL2)
-        || type == &quot;webgl2&quot;
</del><span class="cx"> #endif
</span><del>-        || type == &quot;webkit-3d&quot;;
-}
-#endif
</del><span class="cx"> 
</span><span class="cx"> void HTMLCanvasElement::didDraw(const FloatRect&amp; rect)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLCanvasElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLCanvasElement.h (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLCanvasElement.h        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.h        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -33,9 +33,12 @@
</span><span class="cx"> #include &lt;memory&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBGL)
+#include &quot;WebGLContextAttributes.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class CanvasContextAttributes;
</del><span class="cx"> class CanvasRenderingContext;
</span><span class="cx"> class GraphicsContext;
</span><span class="cx"> class GraphicsContextStateSaver;
</span><span class="lines">@@ -85,10 +88,14 @@
</span><span class="cx">         reset();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CanvasRenderingContext* getContext(const String&amp;, CanvasContextAttributes* = nullptr);
</del><ins>+    CanvasRenderingContext* getContext(const String&amp;);
+
</ins><span class="cx">     static bool is2dType(const String&amp;);
</span><ins>+    CanvasRenderingContext* getContext2d(const String&amp;);
+
</ins><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx">     static bool is3dType(const String&amp;);
</span><ins>+    CanvasRenderingContext* getContextWebGL(const String&amp;, WebGLContextAttributes&amp;&amp; = { });
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     static String toEncodingMimeType(const String&amp; mimeType);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLCanvasElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLCanvasElement.idl (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLCanvasElement.idl        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.idl        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -24,6 +24,8 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+typedef (CanvasRenderingContext2D or WebGLRenderingContextBase) RenderingContext;
+
</ins><span class="cx"> [
</span><span class="cx">     JSGenerateToNativeObject,
</span><span class="cx">     ReportExtraMemoryCost,
</span><span class="lines">@@ -32,8 +34,7 @@
</span><span class="cx">     attribute unsigned long width;
</span><span class="cx">     attribute unsigned long height;
</span><span class="cx"> 
</span><ins>+    [Custom] RenderingContext? getContext(DOMString contextId, any... arguments);
+
</ins><span class="cx">     [Custom, MayThrowException] DOMString toDataURL(optional DOMString? type);
</span><del>-
-    // The custom binding is needed to handle context creation attributes.
-    [Custom] any getContext(DOMString contextId, any... arguments);
</del><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasContextAttributescpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/canvas/CanvasContextAttributes.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasContextAttributes.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/canvas/CanvasContextAttributes.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-/*
- * Copyright (c) 2010, Google 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:
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * &quot;AS IS&quot; 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 THE COPYRIGHT
- * OWNER 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;CanvasContextAttributes.h&quot;
-
-namespace WebCore {
-
-CanvasContextAttributes::CanvasContextAttributes()
-{
-}
-
-CanvasContextAttributes::~CanvasContextAttributes()
-{
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasContextAttributesh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/canvas/CanvasContextAttributes.h (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasContextAttributes.h        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/canvas/CanvasContextAttributes.h        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -1,45 +0,0 @@
</span><del>-/*
- * Copyright (c) 2010, Google 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:
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * &quot;AS IS&quot; 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 THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include &lt;wtf/RefCounted.h&gt;
-
-namespace WebCore {
-
-// A base class for any attributes that are needed which would affect
-// the creation of the Canvas's rendering context. Currently only the
-// WebGLRenderingContext uses this mechanism.
-
-class CanvasContextAttributes : public RefCounted&lt;CanvasContextAttributes&gt; {
-public:
-    virtual ~CanvasContextAttributes();
-
-protected:
-    CanvasContextAttributes();
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGL2RenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -44,7 +44,6 @@
</span><span class="cx"> #include &quot;WebGLCompressedTextureATC.h&quot;
</span><span class="cx"> #include &quot;WebGLCompressedTexturePVRTC.h&quot;
</span><span class="cx"> #include &quot;WebGLCompressedTextureS3TC.h&quot;
</span><del>-#include &quot;WebGLContextAttributes.h&quot;
</del><span class="cx"> #include &quot;WebGLDebugRendererInfo.h&quot;
</span><span class="cx"> #include &quot;WebGLDebugShaders.h&quot;
</span><span class="cx"> #include &quot;WebGLDepthTexture.h&quot;
</span><span class="lines">@@ -59,12 +58,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-WebGL2RenderingContext::WebGL2RenderingContext(HTMLCanvasElement&amp; passedCanvas, GraphicsContext3D::Attributes attributes)
</del><ins>+WebGL2RenderingContext::WebGL2RenderingContext(HTMLCanvasElement&amp; passedCanvas, GraphicsContext3DAttributes attributes)
</ins><span class="cx">     : WebGLRenderingContextBase(passedCanvas, attributes)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGL2RenderingContext::WebGL2RenderingContext(HTMLCanvasElement&amp; passedCanvas, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp; context, GraphicsContext3D::Attributes attributes)
</del><ins>+WebGL2RenderingContext::WebGL2RenderingContext(HTMLCanvasElement&amp; passedCanvas, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp; context, GraphicsContext3DAttributes attributes)
</ins><span class="cx">     : WebGLRenderingContextBase(passedCanvas, WTFMove(context), attributes)
</span><span class="cx"> {
</span><span class="cx">     initializeShaderExtensions();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGL2RenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -40,8 +40,8 @@
</span><span class="cx"> 
</span><span class="cx"> class WebGL2RenderingContext final : public WebGLRenderingContextBase {
</span><span class="cx"> public:
</span><del>-    WebGL2RenderingContext(HTMLCanvasElement&amp;, GraphicsContext3D::Attributes);
-    WebGL2RenderingContext(HTMLCanvasElement&amp;, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp;, GraphicsContext3D::Attributes);
</del><ins>+    WebGL2RenderingContext(HTMLCanvasElement&amp;, WebGLContextAttributes);
+    WebGL2RenderingContext(HTMLCanvasElement&amp;, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp;, WebGLContextAttributes);
</ins><span class="cx"> 
</span><span class="cx">     /* Buffer objects */
</span><span class="cx">     using WebGLRenderingContextBase::bufferData;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLContextAttributescpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/canvas/WebGLContextAttributes.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLContextAttributes.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/canvas/WebGLContextAttributes.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -1,147 +0,0 @@
</span><del>-/*
- * Copyright (c) 2010, Google 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:
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * &quot;AS IS&quot; 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 THE COPYRIGHT
- * OWNER 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;
-
-#if ENABLE(WEBGL)
-
-#include &quot;WebGLContextAttributes.h&quot;
-
-namespace WebCore {
-
-Ref&lt;WebGLContextAttributes&gt; WebGLContextAttributes::create()
-{
-    return adoptRef(*new WebGLContextAttributes());
-}
-
-Ref&lt;WebGLContextAttributes&gt; WebGLContextAttributes::create(GraphicsContext3D::Attributes attributes)
-{
-    return adoptRef(*new WebGLContextAttributes(attributes));
-}
-
-WebGLContextAttributes::WebGLContextAttributes()
-    : CanvasContextAttributes()
-{
-}
-
-WebGLContextAttributes::WebGLContextAttributes(GraphicsContext3D::Attributes attributes)
-    : CanvasContextAttributes()
-    , m_attrs(attributes)
-{
-}
-
-WebGLContextAttributes::~WebGLContextAttributes()
-{
-}
-
-bool WebGLContextAttributes::alpha() const
-{
-    return m_attrs.alpha;
-}
-
-void WebGLContextAttributes::setAlpha(bool alpha)
-{
-    m_attrs.alpha = alpha;
-}
-
-bool WebGLContextAttributes::depth() const
-{
-    return m_attrs.depth;
-}
-
-void WebGLContextAttributes::setDepth(bool depth)
-{
-    m_attrs.depth = depth;
-}
-
-bool WebGLContextAttributes::stencil() const
-{
-    return m_attrs.stencil;
-}
-
-void WebGLContextAttributes::setStencil(bool stencil)
-{
-    m_attrs.stencil = stencil;
-}
-
-bool WebGLContextAttributes::antialias() const
-{
-    return m_attrs.antialias;
-}
-
-void WebGLContextAttributes::setAntialias(bool antialias)
-{
-    m_attrs.antialias = antialias;
-}
-
-bool WebGLContextAttributes::premultipliedAlpha() const
-{
-    return m_attrs.premultipliedAlpha;
-}
-
-void WebGLContextAttributes::setPremultipliedAlpha(bool premultipliedAlpha)
-{
-    m_attrs.premultipliedAlpha = premultipliedAlpha;
-}
-
-bool WebGLContextAttributes::preserveDrawingBuffer() const
-{
-    return m_attrs.preserveDrawingBuffer;
-}
-
-void WebGLContextAttributes::setPreserveDrawingBuffer(bool preserveDrawingBuffer)
-{
-    m_attrs.preserveDrawingBuffer = preserveDrawingBuffer;
-}
-
-bool WebGLContextAttributes::preferLowPowerToHighPerformance() const
-{
-    return m_attrs.preferLowPowerToHighPerformance;
-}
-
-void WebGLContextAttributes::setPreferLowPowerToHighPerformance(bool preferLowPower)
-{
-    m_attrs.preferLowPowerToHighPerformance = preferLowPower;
-}
-
-bool WebGLContextAttributes::failIfMajorPerformanceCaveat() const
-{
-    return m_attrs.failIfMajorPerformanceCaveat;
-}
-
-void WebGLContextAttributes::setFailIfMajorPerformanceCaveat(bool fail)
-{
-    m_attrs.failIfMajorPerformanceCaveat = fail;
-}
-
-GraphicsContext3D::Attributes WebGLContextAttributes::attributes() const
-{
-    return m_attrs;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEBGL)
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLContextAttributesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLContextAttributes.h (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLContextAttributes.h        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/canvas/WebGLContextAttributes.h        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (c) 2010, Google Inc. All rights reserved.
</span><ins>+ * Copyright (c) 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -26,68 +27,10 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include &quot;CanvasContextAttributes.h&quot;
-#include &quot;GraphicsContext3D.h&quot;
</del><ins>+#include &quot;GraphicsContext3DAttributes.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class WebGLContextAttributes final : public CanvasContextAttributes {
-  public:
-    virtual ~WebGLContextAttributes();
</del><ins>+using WebGLContextAttributes = GraphicsContext3DAttributes;
</ins><span class="cx"> 
</span><del>-    // Create a new attributes object
-    static Ref&lt;WebGLContextAttributes&gt; create();
-
-    // Create a new attributes object initialized with preexisting attributes
-    static Ref&lt;WebGLContextAttributes&gt; create(GraphicsContext3D::Attributes);
-
-    // Whether or not the drawing buffer has an alpha channel. Default is true.
-    bool alpha() const;
-    void setAlpha(bool alpha);
-
-    // Whether or not the drawing buffer has a depth buffer. Default is true.
-    bool depth() const;
-    void setDepth(bool depth);
-
-    // Whether or not the drawing buffer has a stencil buffer. Default is true.
-    bool stencil() const;
-    void setStencil(bool stencil);
-
-    // Whether or not the drawing buffer is antialiased. Default is true.
-    bool antialias() const;
-    void setAntialias(bool antialias);
-
-    // Whether or not to treat the values in the drawing buffer as
-    // though their alpha channel has already been multiplied into the
-    // color channels. Default is true.
-    bool premultipliedAlpha() const;
-    void setPremultipliedAlpha(bool premultipliedAlpha);
-
-    // Whether or not to preserve the drawing buffer after presentation to the
-    // screen. Default is false.
-    bool preserveDrawingBuffer() const;
-    void setPreserveDrawingBuffer(bool);
-
-    // Whether or not to attempt to use a lower-power GPU if it is available.
-    // Default is false.
-    bool preferLowPowerToHighPerformance() const;
-    void setPreferLowPowerToHighPerformance(bool);
-
-    // Whether or not to immediately fail if a performant GPU is not available.
-    // Default is false.
-    bool failIfMajorPerformanceCaveat() const;
-    void setFailIfMajorPerformanceCaveat(bool);
-
-    // Fetches a copy of the attributes stored in this object in a
-    // form that can be used to initialize a GraphicsContext3D.
-    GraphicsContext3D::Attributes attributes() const;
-
-  protected:
-    WebGLContextAttributes();
-    WebGLContextAttributes(GraphicsContext3D::Attributes attributes);
-
-  private:
-    GraphicsContext3D::Attributes m_attrs;
-};
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLContextAttributesidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLContextAttributes.idl (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLContextAttributes.idl        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/canvas/WebGLContextAttributes.idl        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -24,16 +24,18 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+typedef boolean GLboolean;
+
</ins><span class="cx"> [
</span><del>-    NoInterfaceObject,
</del><span class="cx">     Conditional=WEBGL,
</span><del>-] interface WebGLContextAttributes {
-    attribute boolean alpha;
-    attribute boolean depth;
-    attribute boolean stencil;
-    attribute boolean antialias;
-    attribute boolean premultipliedAlpha;
-    attribute boolean preserveDrawingBuffer;
-    attribute boolean preferLowPowerToHighPerformance;
-    attribute boolean failIfMajorPerformanceCaveat;
</del><ins>+    JSGenerateToJSObject
+] dictionary WebGLContextAttributes {
+    GLboolean alpha = true;
+    GLboolean depth = true;
+    GLboolean stencil = false;
+    GLboolean antialias = true;
+    GLboolean premultipliedAlpha = true;
+    GLboolean preserveDrawingBuffer = false;
+    GLboolean preferLowPowerToHighPerformance = false;
+    GLboolean failIfMajorPerformanceCaveat = false;
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -65,13 +65,13 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement&amp; passedCanvas, GraphicsContext3D::Attributes attributes)
</del><ins>+WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement&amp; passedCanvas, GraphicsContext3DAttributes attributes)
</ins><span class="cx">     : WebGLRenderingContextBase(passedCanvas, attributes)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement&amp; passedCanvas, PassRefPtr&lt;GraphicsContext3D&gt; context,
</span><del>-    GraphicsContext3D::Attributes attributes) : WebGLRenderingContextBase(passedCanvas, context, attributes)
</del><ins>+    GraphicsContext3DAttributes attributes) : WebGLRenderingContextBase(passedCanvas, context, attributes)
</ins><span class="cx"> {
</span><span class="cx">     initializeVertexArrayObjects();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -31,8 +31,8 @@
</span><span class="cx"> 
</span><span class="cx"> class WebGLRenderingContext final : public WebGLRenderingContextBase {
</span><span class="cx"> public:
</span><del>-    WebGLRenderingContext(HTMLCanvasElement&amp;, GraphicsContext3D::Attributes);
-    WebGLRenderingContext(HTMLCanvasElement&amp;, PassRefPtr&lt;GraphicsContext3D&gt;, GraphicsContext3D::Attributes);
</del><ins>+    WebGLRenderingContext(HTMLCanvasElement&amp;, GraphicsContext3DAttributes);
+    WebGLRenderingContext(HTMLCanvasElement&amp;, PassRefPtr&lt;GraphicsContext3D&gt;, GraphicsContext3DAttributes);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     bool isWebGL1() const final { return true; }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -348,7 +348,7 @@
</span><span class="cx">     WebGLRenderingContextBase* m_context;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-std::unique_ptr&lt;WebGLRenderingContextBase&gt; WebGLRenderingContextBase::create(HTMLCanvasElement&amp; canvas, WebGLContextAttributes* attrs, const String&amp; type)
</del><ins>+std::unique_ptr&lt;WebGLRenderingContextBase&gt; WebGLRenderingContextBase::create(HTMLCanvasElement&amp; canvas, WebGLContextAttributes&amp; attributes, const String&amp; type)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(WEBGL2)
</span><span class="cx">     if (type == &quot;webgl2&quot; &amp;&amp; !RuntimeEnabledFeatures::sharedFeatures().webGL2Enabled())
</span><span class="lines">@@ -388,8 +388,6 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    GraphicsContext3D::Attributes attributes = attrs ? attrs-&gt;attributes() : GraphicsContext3D::Attributes();
-
</del><span class="cx">     if (attributes.antialias) {
</span><span class="cx">         if (!frame-&gt;settings().openGLMultisamplingEnabled())
</span><span class="cx">             attributes.antialias = false;
</span><span class="lines">@@ -453,7 +451,7 @@
</span><span class="cx">     return renderingContext;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLRenderingContextBase::WebGLRenderingContextBase(HTMLCanvasElement&amp; passedCanvas, GraphicsContext3D::Attributes attributes)
</del><ins>+WebGLRenderingContextBase::WebGLRenderingContextBase(HTMLCanvasElement&amp; passedCanvas, WebGLContextAttributes attributes)
</ins><span class="cx">     : CanvasRenderingContext(passedCanvas)
</span><span class="cx">     , ActiveDOMObject(&amp;passedCanvas.document())
</span><span class="cx">     , m_context(nullptr)
</span><span class="lines">@@ -471,7 +469,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLRenderingContextBase::WebGLRenderingContextBase(HTMLCanvasElement&amp; passedCanvas, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp; context, GraphicsContext3D::Attributes attributes)
</del><ins>+WebGLRenderingContextBase::WebGLRenderingContextBase(HTMLCanvasElement&amp; passedCanvas, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp; context, WebGLContextAttributes attributes)
</ins><span class="cx">     : CanvasRenderingContext(passedCanvas)
</span><span class="cx">     , ActiveDOMObject(&amp;passedCanvas.document())
</span><span class="cx">     , m_context(WTFMove(context))
</span><span class="lines">@@ -667,7 +665,8 @@
</span><span class="cx">         || m_attributes.preserveDrawingBuffer || (mask &amp;&amp; m_framebufferBinding))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;WebGLContextAttributes&gt; contextAttributes = getContextAttributes();
</del><ins>+    auto contextAttributes = getContextAttributes();
+    ASSERT(contextAttributes);
</ins><span class="cx"> 
</span><span class="cx">     // Determine if it's possible to combine the clear the user asked for and this clear.
</span><span class="cx">     bool combinedClear = mask &amp;&amp; !m_scissorEnabled;
</span><span class="lines">@@ -682,13 +681,13 @@
</span><span class="cx">         m_context-&gt;clearColor(0, 0, 0, 0);
</span><span class="cx">     m_context-&gt;colorMask(true, true, true, true);
</span><span class="cx">     GC3Dbitfield clearMask = GraphicsContext3D::COLOR_BUFFER_BIT;
</span><del>-    if (contextAttributes-&gt;depth()) {
</del><ins>+    if (contextAttributes-&gt;depth) {
</ins><span class="cx">         if (!combinedClear || !m_depthMask || !(mask &amp; GraphicsContext3D::DEPTH_BUFFER_BIT))
</span><span class="cx">             m_context-&gt;clearDepth(1.0f);
</span><span class="cx">         clearMask |= GraphicsContext3D::DEPTH_BUFFER_BIT;
</span><span class="cx">         m_context-&gt;depthMask(true);
</span><span class="cx">     }
</span><del>-    if (contextAttributes-&gt;stencil()) {
</del><ins>+    if (contextAttributes-&gt;stencil) {
</ins><span class="cx">         if (combinedClear &amp;&amp; (mask &amp; GraphicsContext3D::STENCIL_BUFFER_BIT))
</span><span class="cx">             m_context-&gt;clearStencil(m_clearStencil &amp; m_stencilMask);
</span><span class="cx">         else
</span><span class="lines">@@ -2223,21 +2222,20 @@
</span><span class="cx">     return WebGLGetInfo(static_cast&lt;unsigned int&gt;(value));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebGLContextAttributes&gt; WebGLRenderingContextBase::getContextAttributes()
</del><ins>+std::optional&lt;WebGLContextAttributes&gt; WebGLRenderingContextBase::getContextAttributes()
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending())
</span><del>-        return nullptr;
-    // We always need to return a new WebGLContextAttributes object to
-    // prevent the user from mutating any cached version.
</del><ins>+        return std::nullopt;
</ins><span class="cx"> 
</span><span class="cx">     // Also, we need to enforce requested values of &quot;false&quot; for depth
</span><span class="cx">     // and stencil, regardless of the properties of the underlying
</span><span class="cx">     // GraphicsContext3D.
</span><del>-    auto attributes = WebGLContextAttributes::create(m_context-&gt;getContextAttributes());
</del><ins>+
+    auto attributes = m_context-&gt;getContextAttributes();
</ins><span class="cx">     if (!m_attributes.depth)
</span><del>-        attributes-&gt;setDepth(false);
</del><ins>+        attributes.depth = false;
</ins><span class="cx">     if (!m_attributes.stencil)
</span><del>-        attributes-&gt;setStencil(false);
</del><ins>+        attributes.stencil = false;
</ins><span class="cx">     return WTFMove(attributes);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -5787,11 +5785,11 @@
</span><span class="cx">     if (m_framebufferBinding)
</span><span class="cx">         haveStencilBuffer = m_framebufferBinding-&gt;hasStencilBuffer();
</span><span class="cx">     else {
</span><del>-        RefPtr&lt;WebGLContextAttributes&gt; attributes = getContextAttributes();
-        haveStencilBuffer = attributes-&gt;stencil();
</del><ins>+        auto attributes = getContextAttributes();
+        ASSERT(attributes);
+        haveStencilBuffer = attributes-&gt;stencil;
</ins><span class="cx">     }
</span><del>-    enableOrDisable(GraphicsContext3D::STENCIL_TEST,
-                    m_stencilEnabled &amp;&amp; haveStencilBuffer);
</del><ins>+    enableOrDisable(GraphicsContext3D::STENCIL_TEST, m_stencilEnabled &amp;&amp; haveStencilBuffer);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebGLRenderingContextBase::enableOrDisable(GC3Denum capability, bool enable)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;GraphicsContext3D.h&quot;
</span><span class="cx"> #include &quot;ImageBuffer.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><ins>+#include &quot;WebGLContextAttributes.h&quot;
</ins><span class="cx"> #include &quot;WebGLGetInfo.h&quot;
</span><span class="cx"> #include &quot;WebGLObject.h&quot;
</span><span class="cx"> #include &quot;WebGLTexture.h&quot;
</span><span class="lines">@@ -64,7 +65,6 @@
</span><span class="cx"> class WebGLCompressedTextureATC;
</span><span class="cx"> class WebGLCompressedTexturePVRTC;
</span><span class="cx"> class WebGLCompressedTextureS3TC;
</span><del>-class WebGLContextAttributes;
</del><span class="cx"> class WebGLDebugRendererInfo;
</span><span class="cx"> class WebGLDebugShaders;
</span><span class="cx"> class WebGLDepthTexture;
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx"> 
</span><span class="cx"> class WebGLRenderingContextBase : public CanvasRenderingContext, public ActiveDOMObject {
</span><span class="cx"> public:
</span><del>-    static std::unique_ptr&lt;WebGLRenderingContextBase&gt; create(HTMLCanvasElement&amp;, WebGLContextAttributes*, const String&amp;);
</del><ins>+    static std::unique_ptr&lt;WebGLRenderingContextBase&gt; create(HTMLCanvasElement&amp;, WebGLContextAttributes&amp;, const String&amp;);
</ins><span class="cx">     virtual ~WebGLRenderingContextBase();
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx">     bool getAttachedShaders(WebGLProgram*, Vector&lt;RefPtr&lt;WebGLShader&gt;&gt;&amp;);
</span><span class="cx">     GC3Dint getAttribLocation(WebGLProgram*, const String&amp; name);
</span><span class="cx">     WebGLGetInfo getBufferParameter(GC3Denum target, GC3Denum pname);
</span><del>-    RefPtr&lt;WebGLContextAttributes&gt; getContextAttributes();
</del><ins>+    std::optional&lt;WebGLContextAttributes&gt; getContextAttributes();
</ins><span class="cx">     GC3Denum getError();
</span><span class="cx">     virtual WebGLExtension* getExtension(const String&amp; name) = 0;
</span><span class="cx">     virtual WebGLGetInfo getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname) = 0;
</span><span class="lines">@@ -334,8 +334,8 @@
</span><span class="cx">     void vertexAttribDivisor(GC3Duint index, GC3Duint divisor);
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    WebGLRenderingContextBase(HTMLCanvasElement&amp;, GraphicsContext3D::Attributes);
-    WebGLRenderingContextBase(HTMLCanvasElement&amp;, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp;, GraphicsContext3D::Attributes);
</del><ins>+    WebGLRenderingContextBase(HTMLCanvasElement&amp;, WebGLContextAttributes);
+    WebGLRenderingContextBase(HTMLCanvasElement&amp;, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp;, WebGLContextAttributes);
</ins><span class="cx"> 
</span><span class="cx">     friend class WebGLDrawBuffers;
</span><span class="cx">     friend class WebGLFramebuffer;
</span><span class="lines">@@ -515,7 +515,7 @@
</span><span class="cx">     GC3Denum m_unpackColorspaceConversion;
</span><span class="cx">     bool m_contextLost;
</span><span class="cx">     LostContextMode m_contextLostMode;
</span><del>-    GraphicsContext3D::Attributes m_attributes;
</del><ins>+    WebGLContextAttributes m_attributes;
</ins><span class="cx"> 
</span><span class="cx">     bool m_layerCleared;
</span><span class="cx">     GC3Dfloat m_clearColor[4];
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -551,7 +551,7 @@
</span><span class="cx"> 
</span><span class="cx">     [Custom] any getBufferParameter(GLenum target, GLenum pname);
</span><span class="cx"> 
</span><del>-    WebGLContextAttributes getContextAttributes();
</del><ins>+    WebGLContextAttributes? getContextAttributes();
</ins><span class="cx"> 
</span><span class="cx">     GLenum getError();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContext3Dh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -23,10 +23,10 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef GraphicsContext3D_h
-#define GraphicsContext3D_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;ANGLEWebKitBridge.h&quot;
</span><ins>+#include &quot;GraphicsContext3DAttributes.h&quot;
</ins><span class="cx"> #include &quot;GraphicsTypes3D.h&quot;
</span><span class="cx"> #include &quot;Image.h&quot;
</span><span class="cx"> #include &quot;IntRect.h&quot;
</span><span class="lines">@@ -718,23 +718,6 @@
</span><span class="cx">         MAP_READ_BIT = 0x0001
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    // Context creation attributes.
-    struct Attributes {
-        bool alpha { true };
-        bool depth { true };
-        bool stencil { false };
-        bool antialias { true };
-        bool premultipliedAlpha { true };
-        bool preserveDrawingBuffer { false };
-        bool noExtensions { false };
-        bool shareResources { true };
-        bool preferLowPowerToHighPerformance { false };
-        bool forceSoftwareRenderer { false };
-        bool failIfMajorPerformanceCaveat { false };
-        bool useGLES3 { false };
-        float devicePixelRatio { 1 };
-    };
-
</del><span class="cx">     enum RenderStyle {
</span><span class="cx">         RenderOffscreen,
</span><span class="cx">         RenderDirectlyToHostWindow,
</span><span class="lines">@@ -756,7 +739,7 @@
</span><span class="cx">     void setContextLostCallback(std::unique_ptr&lt;ContextLostCallback&gt;);
</span><span class="cx">     void setErrorMessageCallback(std::unique_ptr&lt;ErrorMessageCallback&gt;);
</span><span class="cx"> 
</span><del>-    static RefPtr&lt;GraphicsContext3D&gt; create(Attributes, HostWindow*, RenderStyle = RenderOffscreen);
</del><ins>+    static RefPtr&lt;GraphicsContext3D&gt; create(GraphicsContext3DAttributes, HostWindow*, RenderStyle = RenderOffscreen);
</ins><span class="cx">     static PassRefPtr&lt;GraphicsContext3D&gt; createForCurrentGLContext();
</span><span class="cx">     ~GraphicsContext3D();
</span><span class="cx"> 
</span><span class="lines">@@ -1026,7 +1009,7 @@
</span><span class="cx">     GC3Dint getAttribLocation(Platform3DObject, const String&amp; name);
</span><span class="cx">     void getBooleanv(GC3Denum pname, GC3Dboolean* value);
</span><span class="cx">     void getBufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
</span><del>-    Attributes getContextAttributes();
</del><ins>+    GraphicsContext3DAttributes getContextAttributes();
</ins><span class="cx">     GC3Denum getError();
</span><span class="cx">     void getFloatv(GC3Denum pname, GC3Dfloat* value);
</span><span class="cx">     void getFramebufferAttachmentParameteriv(GC3Denum target, GC3Denum attachment, GC3Denum pname, GC3Dint* value);
</span><span class="lines">@@ -1272,7 +1255,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    GraphicsContext3D(Attributes, HostWindow*, RenderStyle = RenderOffscreen);
</del><ins>+    GraphicsContext3D(GraphicsContext3DAttributes, HostWindow*, RenderStyle = RenderOffscreen);
</ins><span class="cx">     static int GPUCheckCounter;
</span><span class="cx"> 
</span><span class="cx">     // Helper for packImageData/extractImageData/extractTextureData which implement packing of pixel
</span><span class="lines">@@ -1390,7 +1373,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     friend class Extensions3DOpenGLCommon;
</span><span class="cx"> 
</span><del>-    Attributes m_attrs;
</del><ins>+    GraphicsContext3DAttributes m_attrs;
</ins><span class="cx">     RenderStyle m_renderStyle;
</span><span class="cx">     Vector&lt;Vector&lt;float&gt;&gt; m_vertexArray;
</span><span class="cx"> 
</span><span class="lines">@@ -1444,5 +1427,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // GraphicsContext3D_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContext3DAttributesh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h (0 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``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 ITS 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 {
+
+struct GraphicsContext3DAttributes {
+    // WebGLContextAttributes
+    bool alpha { true };
+    bool depth { true };
+    bool stencil { false };
+    bool antialias { true };
+    bool premultipliedAlpha { true };
+    bool preserveDrawingBuffer { false };
+    bool preferLowPowerToHighPerformance { false };
+    bool failIfMajorPerformanceCaveat { false };
+
+    // Additional attributes.
+    bool forceSoftwareRenderer { false };
+    bool shareResources { true };
+    bool useGLES3 { false };
+    bool noExtensions { false };
+    float devicePixelRatio { 1 };
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoGraphicsContext3DCairocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-RefPtr&lt;GraphicsContext3D&gt; GraphicsContext3D::create(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
</del><ins>+RefPtr&lt;GraphicsContext3D&gt; GraphicsContext3D::create(GraphicsContext3DAttributes attributes, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
</ins><span class="cx"> {
</span><span class="cx">     // This implementation doesn't currently support rendering directly to the HostWindow.
</span><span class="cx">     if (renderStyle == RenderDirectlyToHostWindow)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">     return adoptRef(new GraphicsContext3D(attributes, hostWindow, renderStyle));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow*, GraphicsContext3D::RenderStyle renderStyle)
</del><ins>+GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attributes, HostWindow*, GraphicsContext3D::RenderStyle renderStyle)
</ins><span class="cx">     : m_currentWidth(0)
</span><span class="cx">     , m_currentHeight(0)
</span><span class="cx">     , m_attrs(attributes)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicseflGraphicsContext3DEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -30,13 +30,13 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-RefPtr&lt;GraphicsContext3D&gt; GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, RenderStyle renderStyle)
</del><ins>+RefPtr&lt;GraphicsContext3D&gt; GraphicsContext3D::create(GraphicsContext3DAttributes attrs, HostWindow* hostWindow, RenderStyle renderStyle)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;GraphicsContext3D&gt; context = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderStyle));
</span><span class="cx">     return context-&gt;m_private ? context : nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
</del><ins>+GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
</ins><span class="cx">     : m_currentWidth(0)
</span><span class="cx">     , m_currentHeight(0)
</span><span class="cx">     , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_COMPATIBILITY_OUTPUT)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -601,7 +601,7 @@
</span><span class="cx">     std::unique_ptr&lt;TextureMapperPlatformLayerBuffer&gt; buffer = m_platformLayerProxy-&gt;getAvailableBuffer(size, GraphicsContext3D::DONT_CARE);
</span><span class="cx">     if (UNLIKELY(!buffer)) {
</span><span class="cx">         if (UNLIKELY(!m_context3D))
</span><del>-            m_context3D = GraphicsContext3D::create(GraphicsContext3D::Attributes(), nullptr, GraphicsContext3D::RenderToCurrentGLContext);
</del><ins>+            m_context3D = GraphicsContext3D::create(GraphicsContext3DAttributes(), nullptr, GraphicsContext3D::RenderToCurrentGLContext);
</ins><span class="cx"> 
</span><span class="cx">         RefPtr&lt;BitmapTexture&gt; texture = adoptRef(new BitmapTextureGL(m_context3D));
</span><span class="cx">         texture-&gt;reset(size, GST_VIDEO_INFO_HAS_ALPHA(&amp;videoInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacGraphicsContext3DMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // !PLATFORM(IOS)
</span><span class="cx"> 
</span><del>-RefPtr&lt;GraphicsContext3D&gt; GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
</del><ins>+RefPtr&lt;GraphicsContext3D&gt; GraphicsContext3D::create(GraphicsContext3DAttributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
</ins><span class="cx"> {
</span><span class="cx">     // This implementation doesn't currently support rendering directly to the HostWindow.
</span><span class="cx">     if (renderStyle == RenderDirectlyToHostWindow)
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx">     return context;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
</del><ins>+GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
</ins><span class="cx">     : m_currentWidth(0)
</span><span class="cx">     , m_currentHeight(0)
</span><span class="cx">     , m_contextObj(0)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLCommoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;GraphicsContext3D&gt; GraphicsContext3D::createForCurrentGLContext()
</span><span class="cx"> {
</span><del>-    auto context = adoptRef(*new GraphicsContext3D(Attributes(), 0, GraphicsContext3D::RenderToCurrentGLContext));
</del><ins>+    auto context = adoptRef(*new GraphicsContext3D({ }, 0, GraphicsContext3D::RenderToCurrentGLContext));
</ins><span class="cx">     if (!context-&gt;m_private)
</span><span class="cx">         return nullptr;
</span><span class="cx">     return WTFMove(context);
</span><span class="lines">@@ -1007,7 +1007,7 @@
</span><span class="cx">     return ::glGetAttribLocation(program, mappedName.utf8().data());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes()
</del><ins>+GraphicsContext3DAttributes GraphicsContext3D::getContextAttributes()
</ins><span class="cx"> {
</span><span class="cx">     return m_attrs;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinGraphicsContext3DWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp (209548 => 209549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp        2016-12-08 18:57:34 UTC (rev 209548)
+++ trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp        2016-12-08 19:09:35 UTC (rev 209549)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-RefPtr&lt;GraphicsContext3D&gt; GraphicsContext3D::create(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
</del><ins>+RefPtr&lt;GraphicsContext3D&gt; GraphicsContext3D::create(GraphicsContext3DAttributes attributes, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
</ins><span class="cx"> {
</span><span class="cx">     // This implementation doesn't currently support rendering directly to the HostWindow.
</span><span class="cx">     if (renderStyle == RenderDirectlyToHostWindow)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">     return adoptRef(new GraphicsContext3D(attributes, hostWindow, renderStyle));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow*, GraphicsContext3D::RenderStyle renderStyle)
</del><ins>+GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attributes, HostWindow*, GraphicsContext3D::RenderStyle renderStyle)
</ins><span class="cx">     : m_currentWidth(0)
</span><span class="cx">     , m_currentHeight(0)
</span><span class="cx">     , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_COMPATIBILITY_OUTPUT)
</span></span></pre>
</div>
</div>

</body>
</html>