<!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>[207720] 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/207720">207720</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-10-22 18:05:07 -0700 (Sat, 22 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move HTML canvas and tracks from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163853

Reviewed by Chris Dumez.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj: Added CanvasPath.idl.

* bindings/js/JSWebGL2RenderingContextCustom.cpp: Tweaked a bit.

* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::JSWebGLRenderingContextBase::getExtension): Tweaked a bit.
(WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
Removed unneeded exception handling.
(WebCore::JSWebGLRenderingContextBase::getParameter): Ditto.
(WebCore::JSWebGLRenderingContextBase::getProgramParameter): Ditto.
(WebCore::JSWebGLRenderingContextBase::getShaderParameter): Ditto.
(WebCore::JSWebGLRenderingContextBase::getSupportedExtensions): Use a
modern for loop.
(WebCore::JSWebGLRenderingContextBase::getUniform): Removed unneeded
exception handling.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext): Pass a reference.
(WebCore::HTMLCanvasElement::reset): Use is&lt;CanvasRenderingContext2D&gt;.
(WebCore::HTMLCanvasElement::setUsesDisplayListDrawing): Ditto.
(WebCore::HTMLCanvasElement::setTracksDisplayListReplay) Ditto.:
(WebCore::HTMLCanvasElement::displayListAsText): Ditto.
(WebCore::HTMLCanvasElement::replayDisplayListAsText): Ditto.
(WebCore::HTMLCanvasElement::clearImageBuffer): Ditto.

* html/canvas/CanvasGradient.cpp:
(WebCore::CanvasGradient::CanvasGradient): Streamlined.
(WebCore::CanvasGradient::addColorStop): Use ExceptionOr.
* html/canvas/CanvasGradient.h: Updated for above changes.
* html/canvas/CanvasGradient.idl: Use non-legacy exception.

* html/canvas/CanvasPath.cpp:
(WebCore::CanvasPath::arcTo): Use ExceptionOr.
(WebCore::CanvasPath::arc): Ditto.
(WebCore::CanvasPath::ellipse): Ditto.
* html/canvas/CanvasPath.h: Updated for above changes.
* html/canvas/CanvasPath.idl: Use non-legacy exceptions.

* html/canvas/CanvasPattern.cpp:
(WebCore::CanvasPattern::create): Use Ref&amp;&amp;.
(WebCore::CanvasPattern::CanvasPattern): Ditto.
(WebCore::CanvasPattern::parseRepetitionType): Return a boolean
instead of using an ExceptionCode.
* html/canvas/CanvasPattern.h: Updated for above changes.

* html/canvas/CanvasRenderingContext.cpp:
(CanvasRenderingContext::wouldTaintOrigin): Reordered function so
that it's safe to call it on an image element without a cached
image, or a cached image without an underlying image.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
Take a reference.
(WebCore::CanvasRenderingContext2D::drawImage): Use ExceptionOr.
(WebCore::CanvasRenderingContext2D::drawImageFromRect): Ditto.
(WebCore::CanvasRenderingContext2D::createLinearGradient): Ditto.
(WebCore::CanvasRenderingContext2D::createRadialGradient): Ditto.
(WebCore::CanvasRenderingContext2D::createPattern): Ditto.
(WebCore::CanvasRenderingContext2D::createImageData): Ditto.
(WebCore::CanvasRenderingContext2D::getImageData): Ditto.
(WebCore::CanvasRenderingContext2D::webkitGetImageDataHD): Ditto.
(WebCore::CanvasRenderingContext2D::putImageData): Removed unneeded
ExceptionCode because this does not throw exceptions; the only one
was for non-finite numeric values but this is now handled by bindings.
(WebCore::CanvasRenderingContext2D::webkitPutImageDataHD): Ditto.
* html/canvas/CanvasRenderingContext2D.h: Updated for above.
* html/canvas/CanvasRenderingContext2D.idl: Use non-legacy exceptions
and removed exceptions entirely in other cases.

* html/canvas/OESVertexArrayObject.cpp:
(WebCore::OESVertexArrayObject::OESVertexArrayObject): Take a reference.
(WebCore::OESVertexArrayObject::~OESVertexArrayObject): Deleted.
(WebCore::OESVertexArrayObject::isVertexArrayOES): Use &amp;&amp; instead of
multiple return statements.
(WebCore::OESVertexArrayObject::bindVertexArrayOES): Removed unneeded
ExceptionCode since this does not throw an exception.
* html/canvas/OESVertexArrayObject.h: Updated for above.
* html/canvas/OESVertexArrayObject.idl: Removed unneeded exception.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
Removed unneeded ExceptionCode since this does not throw an exception.
(WebCore::WebGL2RenderingContext::texSubImage2DBase): Ditto.
(WebCore::WebGL2RenderingContext::texSubImage2DImpl): Ditto.
(WebCore::WebGL2RenderingContext::texSubImage2D): Removed unneeded
ExceptionCode for some overloads, for the others, use ExceptionOr
for the security exception. Moved security exception code here from
the validate functions.
(WebCore::WebGL2RenderingContext::validateTexFuncParameters): Removed
unneeded ExceptionCode.
(WebCore::WebGL2RenderingContext::getParameter): Ditto.
* html/canvas/WebGL2RenderingContext.h: Updated for above.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension): Pass a reference.
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
Remvoed unneeded ExceptionCode since this does not throw an exception.
(WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto.
(WebCore::WebGLRenderingContext::texSubImage2DImpl): Ditto.
(WebCore::WebGLRenderingContext::texSubImage2D): Removed unneeded
ExceptionCode for some overloads, for the others, use ExceptionOr
for the security exception. Moved security exception code here from
the validate functions.
(WebCore::WebGLRenderingContext::getParameter): Removed unneeded
ExceptionCode.
* html/canvas/WebGLRenderingContext.h: Updated for above changes.

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texImage2DBase):
Remvoed unneeded ExceptionCode since this does not throw an exception.
(WebCore::WebGLRenderingContextBase::texImage2DImpl): Ditto.
(WebCore::WebGLRenderingContextBase::texImage2D): Removed unneeded
ExceptionCode for some overloads, for the others, use ExceptionOr
for the security exception. Moved security exception code here from
the validate functions.
(WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
Moved the security exception out of here to the call sites.
(WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement): Ditto.
(WebCore::WebGLRenderingContextBase::validateHTMLVideoElement): Ditto.
* html/canvas/WebGLRenderingContextBase.h: Updated for above changes.
* html/canvas/WebGLRenderingContextBase.idl: Use non-legacy exceptions
in some cases and no exceptions at all in many others.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
Use a reference instead of a pointer.

* html/track/DataCue.h: Use pragma once.
* html/track/DataCue.idl: Use non-legacy exception for constructor
attribute, even though it is custom and so it has no effect.

* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::create): Use RefPtr&amp;&amp;.
(WebCore::InbandDataTextTrack::InbandDataTextTrack): Ditto.
(WebCore::InbandDataTextTrack::addDataCue): Stop using
ASSERT_NO_EXCEPTION.
(WebCore::InbandDataTextTrack::removeDataCue): Stop using
IGNORE_EXCEPTION.
(WebCore::InbandDataTextTrack::removeCue): Use ExceptionOr.
Also use remove instead of find/remove.
* html/track/InbandDataTextTrack.h: Updated for above changes.

* html/track/InbandGenericTextTrack.cpp:
(WebCore::GenericTextTrackCueMap::GenericTextTrackCueMap): Deleted.
(WebCore::GenericTextTrackCueMap::~GenericTextTrackCueMap): Deleted.
(WebCore::GenericTextTrackCueMap::add): Take references intead of
pointers.
(WebCore::GenericTextTrackCueMap::find): Ditto. Also use get
instead of find.
(WebCore::GenericTextTrackCueMap::remove): Ditto. Also use take
instead of double hashing to both find and remove.
(WebCore::InbandGenericTextTrack::updateCueFromCueData): Stop using
IGNORE_EXCEPTION. Also got rid of code that is converting a double
to a long and then back to a double by using lround. Instead just
use std::round, which keeps it a double. But also, why does this need
to round?!
(WebCore::InbandGenericTextTrack::addGenericCue): Updated to use
reference to work with m_cueMap.
(WebCore::InbandGenericTextTrack::updateGenericCue): Ditto.
(WebCore::InbandGenericTextTrack::removeGenericCue): Ditto.
(WebCore::InbandGenericTextTrack::removeCue): Use ExceptionOr.
(WebCore::InbandGenericTextTrack::newCuesParsed): Removed
ASSERT_NO_EXCEPTION.
* html/track/InbandGenericTextTrack.h: Updated for above changes.

* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::newCuesParsed): Removed
ASSERT_NO_EXCEPTION.

* html/track/TextTrack.cpp:
(WebCore::TextTrack::addCue): Use ExcepctionOr.
(WebCore::TextTrack::removeCue): Ditto.
(WebCore::TextTrack::addRegion): Ditto.
(WebCore::TextTrack::removeRegion): Ditto.
* html/track/TextTrack.h: Updated for above changes.
* html/track/TextTrack.idl: Ditto.

* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::cueShadowPseudoId): Moved this here
since it does not need to be inlined in the header.
(WebCore::TextTrackCue::~TextTrackCue): Deleted.
(WebCore::TextTrackCue::setStartTime): Removed ExceptionCode&amp;
since the exceptions were for non-finite values, but this is
now handled by the bindings.
(WebCore::TextTrackCue::setEndTime): Ditto.
* html/track/TextTrackCue.h: Updated for the above.
* html/track/TextTrackCue.idl: Removed SetterMayThrowLegacyException
and made startTime and endTime be double rather than unrestricted double.

* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
Use a reference instead of a pointer.
(WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Initialize
m_defaultPosition in the class definition instead of here.
(WebCore::TextTrackCueGeneric::createDisplayTree): Return a Ref.
(WebCore::TextTrackCueGeneric::setLine): Use ExceptionOr.
(WebCore::TextTrackCueGeneric::setPosition): Ditto.
(WebCore::TextTrackCueGeneric::setFontSize): Updated since
displayTreeInternal() now returns a reference.
* html/track/TextTrackCueGeneric.h: Updated for above changes.
Also fixed some arguument types and made some more things private.

* html/track/VTTCue.cpp:
(WebCore::VTTCue::createDisplayTree): Return a Ref.
(WebCore::VTTCue::displayTreeInternal): Return a reference.
(WebCore::VTTCue::setVertical): Use ExceptionOr.
(WebCore::VTTCue::setLine): Ditto.
(WebCore::VTTCue::setPosition): Ditto.
(WebCore::VTTCue::setSize): Ditto.
(WebCore::VTTCue::setAlign): Ditto.
(WebCore::VTTCue::getDisplayTree): Return a reference.
(WebCore::VTTCue::removeDisplayTree): Updated since
displayTreeInternal returns a reference.
(WebCore::VTTCue::setFontSize): Ditto.
* html/track/VTTCue.h: Updated for the above.
* html/track/VTTCue.idl: Use non-legacy exceptions and also
restricted doubles.

* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::VTTRegion): Moved default values all into
the class definition.
(WebCore::VTTRegion::setWidth): Removed the check for non-finite
since the bindings now handle that. Use ExcpetionOr.
(WebCore::VTTRegion::setHeight): Ditto.
(WebCore::VTTRegion::setRegionAnchorX): Ditto.
(WebCore::VTTRegion::setRegionAnchorY): Ditto.
(WebCore::VTTRegion::setViewportAnchorX): Ditto.
(WebCore::VTTRegion::setViewportAnchorY): Ditto.
(WebCore::upKeyword): Added. Shared by the code below.
(WebCore::VTTRegion::scroll): Rewrote to be simpler.
(WebCore::VTTRegion::setScroll): Rewrote to be simpler.
(WebCore::VTTRegion::updateParametersFromRegion): Read and
write data members directly to avoid awkward code that is otherwise
required just to copy from one object to the other. Also take a
const&amp; instead of a pointer for the thing to update from.
(WebCore::VTTRegion::parseSettingValue): Use upKeyword.
(WebCore::VTTRegion::appendTextTrackCueBox): Take a Ref&amp;&amp;.
(WebCore::VTTRegion::getDisplayTree): Do the downcast to Document
here instead of using the helper function.
(WebCore::VTTRegion::prepareRegionDisplayTree): Ditto.
* html/track/VTTRegion.h: Updated for the above.
* html/track/VTTRegion.idl: Use non-legacy exceptions and also
use restricted dobules, not unrestricted.

LayoutTests:

* media/track/regions-webvtt/vtt-region-constructor-expected.txt:
Change expectations to expect the more specific TypeError message
that the bindings generate as opposed to the generic ones that the
WebVTT DOM code was generating before.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvttvttregionconstructorexpectedtxt">trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor-expected.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="#trunkSourceWebCorebindingsjsJSWebGL2RenderingContextCustomcpp">trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWebGLRenderingContextBaseCustomcpp">trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLCanvasElementcpp">trunk/Source/WebCore/html/HTMLCanvasElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasGradientcpp">trunk/Source/WebCore/html/canvas/CanvasGradient.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasGradienth">trunk/Source/WebCore/html/canvas/CanvasGradient.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasGradientidl">trunk/Source/WebCore/html/canvas/CanvasGradient.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasPathcpp">trunk/Source/WebCore/html/canvas/CanvasPath.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasPathh">trunk/Source/WebCore/html/canvas/CanvasPath.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasPathidl">trunk/Source/WebCore/html/canvas/CanvasPath.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasPatterncpp">trunk/Source/WebCore/html/canvas/CanvasPattern.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasPatternh">trunk/Source/WebCore/html/canvas/CanvasPattern.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContextcpp">trunk/Source/WebCore/html/canvas/CanvasRenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dh">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Didl">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasOESVertexArrayObjectcpp">trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasOESVertexArrayObjecth">trunk/Source/WebCore/html/canvas/OESVertexArrayObject.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasOESVertexArrayObjectidl">trunk/Source/WebCore/html/canvas/OESVertexArrayObject.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="#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="#trunkSourceWebCorehtmlshadowMediaControlElementscpp">trunk/Source/WebCore/html/shadow/MediaControlElements.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackDataCueh">trunk/Source/WebCore/html/track/DataCue.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackDataCueidl">trunk/Source/WebCore/html/track/DataCue.idl</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandDataTextTrackcpp">trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandDataTextTrackh">trunk/Source/WebCore/html/track/InbandDataTextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandGenericTextTrackcpp">trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandGenericTextTrackh">trunk/Source/WebCore/html/track/InbandGenericTextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandWebVTTTextTrackcpp">trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackcpp">trunk/Source/WebCore/html/track/TextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackh">trunk/Source/WebCore/html/track/TextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackidl">trunk/Source/WebCore/html/track/TextTrack.idl</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCuecpp">trunk/Source/WebCore/html/track/TextTrackCue.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCueh">trunk/Source/WebCore/html/track/TextTrackCue.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCueidl">trunk/Source/WebCore/html/track/TextTrackCue.idl</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCueGenericcpp">trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCueGenerich">trunk/Source/WebCore/html/track/TextTrackCueGeneric.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTCuecpp">trunk/Source/WebCore/html/track/VTTCue.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTCueh">trunk/Source/WebCore/html/track/VTTCue.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTCueidl">trunk/Source/WebCore/html/track/VTTCue.idl</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegioncpp">trunk/Source/WebCore/html/track/VTTRegion.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegionh">trunk/Source/WebCore/html/track/VTTRegion.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegionidl">trunk/Source/WebCore/html/track/VTTRegion.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/LayoutTests/ChangeLog        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-10-22  Darin Adler  &lt;darin@apple.com&gt;
+
+        Move HTML canvas and tracks from ExceptionCode to Exception
+        https://bugs.webkit.org/show_bug.cgi?id=163853
+
+        Reviewed by Chris Dumez.
+
+        * media/track/regions-webvtt/vtt-region-constructor-expected.txt:
+        Change expectations to expect the more specific TypeError message
+        that the bindings generate as opposed to the generic ones that the
+        WebVTT DOM code was generating before.
+
</ins><span class="cx"> 2016-10-22  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed GTK test gardening
</span></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvttvttregionconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor-expected.txt (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor-expected.txt        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor-expected.txt        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -53,53 +53,53 @@
</span><span class="cx"> 
</span><span class="cx"> Invalid percentage value: -Infinity
</span><span class="cx"> RUN(region.viewportAnchorX = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.viewportAnchorX == '0') OK
</span><span class="cx"> RUN(region.viewportAnchorY = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.viewportAnchorY == '100') OK
</span><span class="cx"> RUN(region.regionAnchorX = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.regionAnchorX == '0') OK
</span><span class="cx"> RUN(region.regionAnchorY = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.regionAnchorY == '100') OK
</span><span class="cx"> RUN(region.width = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.width == '100') OK
</span><span class="cx"> 
</span><span class="cx"> Invalid percentage value: Infinity
</span><span class="cx"> RUN(region.viewportAnchorX = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.viewportAnchorX == '0') OK
</span><span class="cx"> RUN(region.viewportAnchorY = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.viewportAnchorY == '100') OK
</span><span class="cx"> RUN(region.regionAnchorX = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.regionAnchorX == '0') OK
</span><span class="cx"> RUN(region.regionAnchorY = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.regionAnchorY == '100') OK
</span><span class="cx"> RUN(region.width = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.width == '100') OK
</span><span class="cx"> 
</span><span class="cx"> Invalid percentage value: NaN
</span><span class="cx"> RUN(region.viewportAnchorX = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.viewportAnchorX == '0') OK
</span><span class="cx"> RUN(region.viewportAnchorY = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.viewportAnchorY == '100') OK
</span><span class="cx"> RUN(region.regionAnchorX = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.regionAnchorX == '0') OK
</span><span class="cx"> RUN(region.regionAnchorY = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.regionAnchorY == '100') OK
</span><span class="cx"> RUN(region.width = invalidPercentageValues[index])
</span><del>-TypeError: Type error
</del><ins>+TypeError: The provided value is non-finite
</ins><span class="cx"> EXPECTED (region.width == '100') OK
</span><span class="cx"> RUN(region.height = -1)
</span><span class="cx"> IndexSizeError (DOM Exception 1): The index is not in the allowed range.
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/ChangeLog        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -1,3 +1,254 @@
</span><ins>+2016-10-22  Darin Adler  &lt;darin@apple.com&gt;
+
+        Move HTML canvas and tracks from ExceptionCode to Exception
+        https://bugs.webkit.org/show_bug.cgi?id=163853
+
+        Reviewed by Chris Dumez.
+
+        * WebCore.xcodeproj/project.pbxproj: Added CanvasPath.idl.
+
+        * bindings/js/JSWebGL2RenderingContextCustom.cpp: Tweaked a bit.
+
+        * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
+        (WebCore::JSWebGLRenderingContextBase::getExtension): Tweaked a bit.
+        (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
+        Removed unneeded exception handling.
+        (WebCore::JSWebGLRenderingContextBase::getParameter): Ditto.
+        (WebCore::JSWebGLRenderingContextBase::getProgramParameter): Ditto.
+        (WebCore::JSWebGLRenderingContextBase::getShaderParameter): Ditto.
+        (WebCore::JSWebGLRenderingContextBase::getSupportedExtensions): Use a
+        modern for loop.
+        (WebCore::JSWebGLRenderingContextBase::getUniform): Removed unneeded
+        exception handling.
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::getContext): Pass a reference.
+        (WebCore::HTMLCanvasElement::reset): Use is&lt;CanvasRenderingContext2D&gt;.
+        (WebCore::HTMLCanvasElement::setUsesDisplayListDrawing): Ditto.
+        (WebCore::HTMLCanvasElement::setTracksDisplayListReplay) Ditto.:
+        (WebCore::HTMLCanvasElement::displayListAsText): Ditto.
+        (WebCore::HTMLCanvasElement::replayDisplayListAsText): Ditto.
+        (WebCore::HTMLCanvasElement::clearImageBuffer): Ditto.
+
+        * html/canvas/CanvasGradient.cpp:
+        (WebCore::CanvasGradient::CanvasGradient): Streamlined.
+        (WebCore::CanvasGradient::addColorStop): Use ExceptionOr.
+        * html/canvas/CanvasGradient.h: Updated for above changes.
+        * html/canvas/CanvasGradient.idl: Use non-legacy exception.
+
+        * html/canvas/CanvasPath.cpp:
+        (WebCore::CanvasPath::arcTo): Use ExceptionOr.
+        (WebCore::CanvasPath::arc): Ditto.
+        (WebCore::CanvasPath::ellipse): Ditto.
+        * html/canvas/CanvasPath.h: Updated for above changes.
+        * html/canvas/CanvasPath.idl: Use non-legacy exceptions.
+
+        * html/canvas/CanvasPattern.cpp:
+        (WebCore::CanvasPattern::create): Use Ref&amp;&amp;.
+        (WebCore::CanvasPattern::CanvasPattern): Ditto.
+        (WebCore::CanvasPattern::parseRepetitionType): Return a boolean
+        instead of using an ExceptionCode.
+        * html/canvas/CanvasPattern.h: Updated for above changes.
+
+        * html/canvas/CanvasRenderingContext.cpp:
+        (CanvasRenderingContext::wouldTaintOrigin): Reordered function so
+        that it's safe to call it on an image element without a cached
+        image, or a cached image without an underlying image.
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
+        Take a reference.
+        (WebCore::CanvasRenderingContext2D::drawImage): Use ExceptionOr.
+        (WebCore::CanvasRenderingContext2D::drawImageFromRect): Ditto.
+        (WebCore::CanvasRenderingContext2D::createLinearGradient): Ditto.
+        (WebCore::CanvasRenderingContext2D::createRadialGradient): Ditto.
+        (WebCore::CanvasRenderingContext2D::createPattern): Ditto.
+        (WebCore::CanvasRenderingContext2D::createImageData): Ditto.
+        (WebCore::CanvasRenderingContext2D::getImageData): Ditto.
+        (WebCore::CanvasRenderingContext2D::webkitGetImageDataHD): Ditto.
+        (WebCore::CanvasRenderingContext2D::putImageData): Removed unneeded
+        ExceptionCode because this does not throw exceptions; the only one
+        was for non-finite numeric values but this is now handled by bindings.
+        (WebCore::CanvasRenderingContext2D::webkitPutImageDataHD): Ditto.
+        * html/canvas/CanvasRenderingContext2D.h: Updated for above.
+        * html/canvas/CanvasRenderingContext2D.idl: Use non-legacy exceptions
+        and removed exceptions entirely in other cases.
+
+        * html/canvas/OESVertexArrayObject.cpp:
+        (WebCore::OESVertexArrayObject::OESVertexArrayObject): Take a reference.
+        (WebCore::OESVertexArrayObject::~OESVertexArrayObject): Deleted.
+        (WebCore::OESVertexArrayObject::isVertexArrayOES): Use &amp;&amp; instead of
+        multiple return statements.
+        (WebCore::OESVertexArrayObject::bindVertexArrayOES): Removed unneeded
+        ExceptionCode since this does not throw an exception.
+        * html/canvas/OESVertexArrayObject.h: Updated for above.
+        * html/canvas/OESVertexArrayObject.idl: Removed unneeded exception.
+
+        * html/canvas/WebGL2RenderingContext.cpp:
+        (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
+        Removed unneeded ExceptionCode since this does not throw an exception.
+        (WebCore::WebGL2RenderingContext::texSubImage2DBase): Ditto.
+        (WebCore::WebGL2RenderingContext::texSubImage2DImpl): Ditto.
+        (WebCore::WebGL2RenderingContext::texSubImage2D): Removed unneeded
+        ExceptionCode for some overloads, for the others, use ExceptionOr
+        for the security exception. Moved security exception code here from
+        the validate functions.
+        (WebCore::WebGL2RenderingContext::validateTexFuncParameters): Removed
+        unneeded ExceptionCode.
+        (WebCore::WebGL2RenderingContext::getParameter): Ditto.
+        * html/canvas/WebGL2RenderingContext.h: Updated for above.
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::getExtension): Pass a reference.
+        (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
+        Remvoed unneeded ExceptionCode since this does not throw an exception.
+        (WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto.
+        (WebCore::WebGLRenderingContext::texSubImage2DImpl): Ditto.
+        (WebCore::WebGLRenderingContext::texSubImage2D): Removed unneeded
+        ExceptionCode for some overloads, for the others, use ExceptionOr
+        for the security exception. Moved security exception code here from
+        the validate functions.
+        (WebCore::WebGLRenderingContext::getParameter): Removed unneeded
+        ExceptionCode.
+        * html/canvas/WebGLRenderingContext.h: Updated for above changes.
+
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::texImage2DBase):
+        Remvoed unneeded ExceptionCode since this does not throw an exception.
+        (WebCore::WebGLRenderingContextBase::texImage2DImpl): Ditto.
+        (WebCore::WebGLRenderingContextBase::texImage2D): Removed unneeded
+        ExceptionCode for some overloads, for the others, use ExceptionOr
+        for the security exception. Moved security exception code here from
+        the validate functions.
+        (WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
+        Moved the security exception out of here to the call sites.
+        (WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement): Ditto.
+        (WebCore::WebGLRenderingContextBase::validateHTMLVideoElement): Ditto.
+        * html/canvas/WebGLRenderingContextBase.h: Updated for above changes.
+        * html/canvas/WebGLRenderingContextBase.idl: Use non-legacy exceptions
+        in some cases and no exceptions at all in many others.
+
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
+        Use a reference instead of a pointer.
+
+        * html/track/DataCue.h: Use pragma once.
+        * html/track/DataCue.idl: Use non-legacy exception for constructor
+        attribute, even though it is custom and so it has no effect.
+
+        * html/track/InbandDataTextTrack.cpp:
+        (WebCore::InbandDataTextTrack::create): Use RefPtr&amp;&amp;.
+        (WebCore::InbandDataTextTrack::InbandDataTextTrack): Ditto.
+        (WebCore::InbandDataTextTrack::addDataCue): Stop using
+        ASSERT_NO_EXCEPTION.
+        (WebCore::InbandDataTextTrack::removeDataCue): Stop using
+        IGNORE_EXCEPTION.
+        (WebCore::InbandDataTextTrack::removeCue): Use ExceptionOr.
+        Also use remove instead of find/remove.
+        * html/track/InbandDataTextTrack.h: Updated for above changes.
+
+        * html/track/InbandGenericTextTrack.cpp:
+        (WebCore::GenericTextTrackCueMap::GenericTextTrackCueMap): Deleted.
+        (WebCore::GenericTextTrackCueMap::~GenericTextTrackCueMap): Deleted.
+        (WebCore::GenericTextTrackCueMap::add): Take references intead of
+        pointers.
+        (WebCore::GenericTextTrackCueMap::find): Ditto. Also use get
+        instead of find.
+        (WebCore::GenericTextTrackCueMap::remove): Ditto. Also use take
+        instead of double hashing to both find and remove.
+        (WebCore::InbandGenericTextTrack::updateCueFromCueData): Stop using
+        IGNORE_EXCEPTION. Also got rid of code that is converting a double
+        to a long and then back to a double by using lround. Instead just
+        use std::round, which keeps it a double. But also, why does this need
+        to round?!
+        (WebCore::InbandGenericTextTrack::addGenericCue): Updated to use
+        reference to work with m_cueMap.
+        (WebCore::InbandGenericTextTrack::updateGenericCue): Ditto.
+        (WebCore::InbandGenericTextTrack::removeGenericCue): Ditto.
+        (WebCore::InbandGenericTextTrack::removeCue): Use ExceptionOr.
+        (WebCore::InbandGenericTextTrack::newCuesParsed): Removed
+        ASSERT_NO_EXCEPTION.
+        * html/track/InbandGenericTextTrack.h: Updated for above changes.
+
+        * html/track/InbandWebVTTTextTrack.cpp:
+        (WebCore::InbandWebVTTTextTrack::newCuesParsed): Removed
+        ASSERT_NO_EXCEPTION.
+
+        * html/track/TextTrack.cpp:
+        (WebCore::TextTrack::addCue): Use ExcepctionOr.
+        (WebCore::TextTrack::removeCue): Ditto.
+        (WebCore::TextTrack::addRegion): Ditto.
+        (WebCore::TextTrack::removeRegion): Ditto.
+        * html/track/TextTrack.h: Updated for above changes.
+        * html/track/TextTrack.idl: Ditto.
+
+        * html/track/TextTrackCue.cpp:
+        (WebCore::TextTrackCue::cueShadowPseudoId): Moved this here
+        since it does not need to be inlined in the header.
+        (WebCore::TextTrackCue::~TextTrackCue): Deleted.
+        (WebCore::TextTrackCue::setStartTime): Removed ExceptionCode&amp;
+        since the exceptions were for non-finite values, but this is
+        now handled by the bindings.
+        (WebCore::TextTrackCue::setEndTime): Ditto.
+        * html/track/TextTrackCue.h: Updated for the above.
+        * html/track/TextTrackCue.idl: Removed SetterMayThrowLegacyException
+        and made startTime and endTime be double rather than unrestricted double.
+
+        * html/track/TextTrackCueGeneric.cpp:
+        (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
+        Use a reference instead of a pointer.
+        (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Initialize
+        m_defaultPosition in the class definition instead of here.
+        (WebCore::TextTrackCueGeneric::createDisplayTree): Return a Ref.
+        (WebCore::TextTrackCueGeneric::setLine): Use ExceptionOr.
+        (WebCore::TextTrackCueGeneric::setPosition): Ditto.
+        (WebCore::TextTrackCueGeneric::setFontSize): Updated since
+        displayTreeInternal() now returns a reference.
+        * html/track/TextTrackCueGeneric.h: Updated for above changes.
+        Also fixed some arguument types and made some more things private.
+
+        * html/track/VTTCue.cpp:
+        (WebCore::VTTCue::createDisplayTree): Return a Ref.
+        (WebCore::VTTCue::displayTreeInternal): Return a reference.
+        (WebCore::VTTCue::setVertical): Use ExceptionOr.
+        (WebCore::VTTCue::setLine): Ditto.
+        (WebCore::VTTCue::setPosition): Ditto.
+        (WebCore::VTTCue::setSize): Ditto.
+        (WebCore::VTTCue::setAlign): Ditto.
+        (WebCore::VTTCue::getDisplayTree): Return a reference.
+        (WebCore::VTTCue::removeDisplayTree): Updated since
+        displayTreeInternal returns a reference.
+        (WebCore::VTTCue::setFontSize): Ditto.
+        * html/track/VTTCue.h: Updated for the above.
+        * html/track/VTTCue.idl: Use non-legacy exceptions and also
+        restricted doubles.
+
+        * html/track/VTTRegion.cpp:
+        (WebCore::VTTRegion::VTTRegion): Moved default values all into
+        the class definition.
+        (WebCore::VTTRegion::setWidth): Removed the check for non-finite
+        since the bindings now handle that. Use ExcpetionOr.
+        (WebCore::VTTRegion::setHeight): Ditto.
+        (WebCore::VTTRegion::setRegionAnchorX): Ditto.
+        (WebCore::VTTRegion::setRegionAnchorY): Ditto.
+        (WebCore::VTTRegion::setViewportAnchorX): Ditto.
+        (WebCore::VTTRegion::setViewportAnchorY): Ditto.
+        (WebCore::upKeyword): Added. Shared by the code below.
+        (WebCore::VTTRegion::scroll): Rewrote to be simpler.
+        (WebCore::VTTRegion::setScroll): Rewrote to be simpler.
+        (WebCore::VTTRegion::updateParametersFromRegion): Read and
+        write data members directly to avoid awkward code that is otherwise
+        required just to copy from one object to the other. Also take a
+        const&amp; instead of a pointer for the thing to update from.
+        (WebCore::VTTRegion::parseSettingValue): Use upKeyword.
+        (WebCore::VTTRegion::appendTextTrackCueBox): Take a Ref&amp;&amp;.
+        (WebCore::VTTRegion::getDisplayTree): Do the downcast to Document
+        here instead of using the helper function.
+        (WebCore::VTTRegion::prepareRegionDisplayTree): Ditto.
+        * html/track/VTTRegion.h: Updated for the above.
+        * html/track/VTTRegion.idl: Use non-legacy exceptions and also
+        use restricted dobules, not unrestricted.
+
</ins><span class="cx"> 2016-10-22  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebGLRenderingContextBase.texImage2D() should use a union instead of overloading
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -10643,6 +10643,7 @@
</span><span class="cx">                 935FBC4409BA00B900E230B1 /* EventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventListener.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 935FBCF109BA143B00E230B1 /* ExceptionCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExceptionCode.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9362640A0DE1137D009D5A00 /* CSSReflectionDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSReflectionDirection.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                936B21F41DBBF8300052E117 /* CanvasPath.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CanvasPath.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 936DD03A09CEAC270056AE8C /* Range.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Range.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = &quot;textAreaResizeCorner@2x.png&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9371080D1DB754550060744E /* WindowOrWorkerGlobalScope.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WindowOrWorkerGlobalScope.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16434,6 +16435,7 @@
</span><span class="cx">                                 49484FB5102CF23C00187DD3 /* CanvasGradient.idl */,
</span><span class="cx">                                 4671E0631D67A57B00C6B497 /* CanvasPath.cpp */,
</span><span class="cx">                                 4671E0641D67A57B00C6B497 /* CanvasPath.h */,
</span><ins>+                                936B21F41DBBF8300052E117 /* CanvasPath.idl */,
</ins><span class="cx">                                 49484FB6102CF23C00187DD3 /* CanvasPattern.cpp */,
</span><span class="cx">                                 49484FB7102CF23C00187DD3 /* CanvasPattern.h */,
</span><span class="cx">                                 49484FB8102CF23C00187DD3 /* CanvasPattern.idl */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWebGL2RenderingContextCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -24,9 +24,9 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;JSWebGL2RenderingContext.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL) &amp;&amp; ENABLE(WEBGL2)
</span><del>-#include &quot;JSWebGL2RenderingContext.h&quot;
</del><span class="cx"> 
</span><span class="cx"> #include &lt;heap/HeapInlines.h&gt;
</span><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><span class="lines">@@ -37,7 +37,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, const WebGLGetInfo&amp; info)
</del><ins>+// FIXME: There is a duplicate version of this function in JSWebGLRenderingContextBaseCustom.cpp,
+// but it is not exactly the same! We should merge these.
+static JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, const WebGLGetInfo&amp; info)
</ins><span class="cx"> {
</span><span class="cx">     switch (info.getType()) {
</span><span class="cx">     case WebGLGetInfo::kTypeBool:
</span><span class="lines">@@ -44,10 +46,9 @@
</span><span class="cx">         return jsBoolean(info.getBool());
</span><span class="cx">     case WebGLGetInfo::kTypeBoolArray: {
</span><span class="cx">         MarkedArgumentBuffer list;
</span><del>-        const auto&amp; values = info.getBoolArray();
-        for (const auto&amp; value : values)
</del><ins>+        for (auto&amp; value : info.getBoolArray())
</ins><span class="cx">             list.append(jsBoolean(value));
</span><del>-        return constructArray(exec, 0, globalObject, list);
</del><ins>+        return constructArray(state, 0, globalObject, list);
</ins><span class="cx">     }
</span><span class="cx">     case WebGLGetInfo::kTypeFloat:
</span><span class="cx">         return jsNumber(info.getFloat());
</span><span class="lines">@@ -56,7 +57,7 @@
</span><span class="cx">     case WebGLGetInfo::kTypeNull:
</span><span class="cx">         return jsNull();
</span><span class="cx">     case WebGLGetInfo::kTypeString:
</span><del>-        return jsStringWithCache(exec, info.getString());
</del><ins>+        return jsStringWithCache(state, info.getString());
</ins><span class="cx">     case WebGLGetInfo::kTypeUnsignedInt:
</span><span class="cx">         return jsNumber(info.getUnsignedInt());
</span><span class="cx">     case WebGLGetInfo::kTypeInt64:
</span><span class="lines">@@ -72,60 +73,51 @@
</span><span class="cx">     visitor.addOpaqueRoot(&amp;wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSWebGL2RenderingContext::getInternalformatParameter(ExecState&amp; exec)
</del><ins>+JSValue JSWebGL2RenderingContext::getInternalformatParameter(ExecState&amp;)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(exec);
</del><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSWebGL2RenderingContext::getQueryParameter(ExecState&amp; exec)
</del><ins>+JSValue JSWebGL2RenderingContext::getQueryParameter(ExecState&amp;)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(exec);
</del><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSWebGL2RenderingContext::getSamplerParameter(ExecState&amp; exec)
</del><ins>+JSValue JSWebGL2RenderingContext::getSamplerParameter(ExecState&amp;)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(exec);
</del><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSWebGL2RenderingContext::getSyncParameter(ExecState&amp; exec)
</del><ins>+JSValue JSWebGL2RenderingContext::getSyncParameter(ExecState&amp;)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(exec);
</del><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSWebGL2RenderingContext::getIndexedParameter(ExecState&amp; exec)
</del><ins>+JSValue JSWebGL2RenderingContext::getIndexedParameter(ExecState&amp; state)
</ins><span class="cx"> {
</span><del>-    VM&amp; vm = exec.vm();
</del><ins>+    VM&amp; vm = state.vm();
</ins><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><del>-    if (exec.argumentCount() != 2)
-        return throwException(&amp;exec, scope, createNotEnoughArgumentsError(&amp;exec));
</del><ins>+    if (state.argumentCount() &lt; 2)
+        return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</ins><span class="cx"> 
</span><del>-    WebGL2RenderingContext&amp; context = wrapped();
-    unsigned pname = exec.uncheckedArgument(0).toInt32(&amp;exec);
</del><ins>+    unsigned pname = state.uncheckedArgument(0).toInt32(&amp;state);
</ins><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>-    unsigned index = exec.uncheckedArgument(1).toInt32(&amp;exec);
</del><ins>+    unsigned index = state.uncheckedArgument(1).toInt32(&amp;state);
</ins><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>-    WebGLGetInfo info = context.getIndexedParameter(pname, index);
-    return toJS(&amp;exec, globalObject(), info);
</del><ins>+    return toJS(&amp;state, globalObject(), wrapped().getIndexedParameter(pname, index));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSWebGL2RenderingContext::getActiveUniformBlockParameter(ExecState&amp; exec)
</del><ins>+JSValue JSWebGL2RenderingContext::getActiveUniformBlockParameter(ExecState&amp;)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(exec);
</del><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSWebGL2RenderingContext::getActiveUniformBlockName(ExecState&amp; exec)
</del><ins>+JSValue JSWebGL2RenderingContext::getActiveUniformBlockName(ExecState&amp;)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(exec);
</del><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WEBGL)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWebGLRenderingContextBaseCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -24,9 +24,9 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;JSWebGLRenderingContextBase.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><del>-#include &quot;JSWebGLRenderingContextBase.h&quot;
</del><span class="cx"> 
</span><span class="cx"> #include &quot;ANGLEInstancedArrays.h&quot;
</span><span class="cx"> #include &quot;EXTBlendMinMax.h&quot;
</span><span class="lines">@@ -130,6 +130,8 @@
</span><span class="cx">     return wrap(state, globalObject, object);
</span><span class="cx"> }
</span><span class="cx">     
</span><ins>+// FIXME: There is a duplicate version of this function in JSWebGL2RenderingContextCustom.cpp,
+// but it is not exactly the same! We should merge these.
</ins><span class="cx"> static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, const WebGLGetInfo&amp; info)
</span><span class="cx"> {
</span><span class="cx">     switch (info.getType()) {
</span><span class="lines">@@ -137,9 +139,8 @@
</span><span class="cx">         return jsBoolean(info.getBool());
</span><span class="cx">     case WebGLGetInfo::kTypeBoolArray: {
</span><span class="cx">         MarkedArgumentBuffer list;
</span><del>-        const Vector&lt;bool&gt;&amp; value = info.getBoolArray();
-        for (size_t ii = 0; ii &lt; value.size(); ++ii)
-            list.append(jsBoolean(value[ii]));
</del><ins>+        for (auto&amp; value : info.getBoolArray())
+            list.append(jsBoolean(value));
</ins><span class="cx">         return constructArray(exec, 0, globalObject, list);
</span><span class="cx">     }
</span><span class="cx">     case WebGLGetInfo::kTypeFloat:
</span><span class="lines">@@ -184,9 +185,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-enum ObjectType {
-    kBuffer, kRenderbuffer, kTexture, kVertexAttrib
-};
</del><ins>+enum ObjectType { kBuffer, kRenderbuffer, kTexture, kVertexAttrib };
</ins><span class="cx"> 
</span><span class="cx"> static JSValue getObjectParameter(JSWebGLRenderingContextBase* obj, ExecState&amp; state, ObjectType objectType)
</span><span class="cx"> {
</span><span class="lines">@@ -331,11 +330,9 @@
</span><span class="cx">     if (state.argumentCount() &lt; 1)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     
</span><del>-    WebGLRenderingContextBase&amp; context = wrapped();
-    const String name = state.uncheckedArgument(0).toString(&amp;state)-&gt;value(&amp;state);
</del><ins>+    String name = state.uncheckedArgument(0).toWTFString(&amp;state);
</ins><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>-    WebGLExtension* extension = context.getExtension(name);
-    return toJS(&amp;state, globalObject(), extension);
</del><ins>+    return toJS(&amp;state, globalObject(), wrapped().getExtension(name));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getBufferParameter(ExecState&amp; state)
</span><span class="lines">@@ -351,8 +348,6 @@
</span><span class="cx">     if (state.argumentCount() != 3)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     
</span><del>-    ExceptionCode ec = 0;
-    WebGLRenderingContextBase&amp; context = wrapped();
</del><span class="cx">     unsigned target = state.uncheckedArgument(0).toInt32(&amp;state);
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">     unsigned attachment = state.uncheckedArgument(1).toInt32(&amp;state);
</span><span class="lines">@@ -359,12 +354,7 @@
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">     unsigned pname = state.uncheckedArgument(2).toInt32(&amp;state);
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>-    WebGLGetInfo info = context.getFramebufferAttachmentParameter(target, attachment, pname, ec);
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-    return toJS(&amp;state, globalObject(), info);
</del><ins>+    return toJS(&amp;state, globalObject(), wrapped().getFramebufferAttachmentParameter(target, attachment, pname));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getParameter(ExecState&amp; state)
</span><span class="lines">@@ -375,16 +365,9 @@
</span><span class="cx">     if (state.argumentCount() != 1)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     
</span><del>-    ExceptionCode ec = 0;
-    WebGLRenderingContextBase&amp; context = wrapped();
</del><span class="cx">     unsigned pname = state.uncheckedArgument(0).toInt32(&amp;state);
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>-    WebGLGetInfo info = context.getParameter(pname, ec);
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-    return toJS(&amp;state, globalObject(), info);
</del><ins>+    return toJS(&amp;state, globalObject(), wrapped().getParameter(pname));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getProgramParameter(ExecState&amp; state)
</span><span class="lines">@@ -395,19 +378,12 @@
</span><span class="cx">     if (state.argumentCount() != 2)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     
</span><del>-    ExceptionCode ec = 0;
-    WebGLRenderingContextBase&amp; context = wrapped();
</del><span class="cx">     WebGLProgram* program = JSWebGLProgram::toWrapped(state.uncheckedArgument(0));
</span><span class="cx">     if (!program &amp;&amp; !state.uncheckedArgument(0).isUndefinedOrNull())
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><span class="cx">     unsigned pname = state.uncheckedArgument(1).toInt32(&amp;state);
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>-    WebGLGetInfo info = context.getProgramParameter(program, pname);
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-    return toJS(&amp;state, globalObject(), info);
</del><ins>+    return toJS(&amp;state, globalObject(), wrapped().getProgramParameter(program, pname));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getRenderbufferParameter(ExecState&amp; state)
</span><span class="lines">@@ -423,19 +399,12 @@
</span><span class="cx">     if (state.argumentCount() != 2)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     
</span><del>-    ExceptionCode ec = 0;
-    WebGLRenderingContextBase&amp; context = wrapped();
</del><span class="cx">     if (!state.uncheckedArgument(0).isUndefinedOrNull() &amp;&amp; !state.uncheckedArgument(0).inherits(JSWebGLShader::info()))
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><span class="cx">     WebGLShader* shader = JSWebGLShader::toWrapped(state.uncheckedArgument(0));
</span><span class="cx">     unsigned pname = state.uncheckedArgument(1).toInt32(&amp;state);
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>-    WebGLGetInfo info = context.getShaderParameter(shader, pname);
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-    return toJS(&amp;state, globalObject(), info);
</del><ins>+    return toJS(&amp;state, globalObject(), wrapped().getShaderParameter(shader, pname));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getSupportedExtensions(ExecState&amp; state)
</span><span class="lines">@@ -443,10 +412,9 @@
</span><span class="cx">     WebGLRenderingContextBase&amp; context = wrapped();
</span><span class="cx">     if (context.isContextLost())
</span><span class="cx">         return jsNull();
</span><del>-    Vector&lt;String&gt; value = context.getSupportedExtensions();
</del><span class="cx">     MarkedArgumentBuffer list;
</span><del>-    for (size_t ii = 0; ii &lt; value.size(); ++ii)
-        list.append(jsStringWithCache(&amp;state, value[ii]));
</del><ins>+    for (auto&amp; extension : context.getSupportedExtensions())
+        list.append(jsStringWithCache(&amp;state, extension));
</ins><span class="cx">     return constructArray(&amp;state, 0, globalObject(), list);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -463,8 +431,6 @@
</span><span class="cx">     if (state.argumentCount() != 2)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     
</span><del>-    ExceptionCode ec = 0;
-    WebGLRenderingContextBase&amp; context = wrapped();
</del><span class="cx">     WebGLProgram* program = JSWebGLProgram::toWrapped(state.uncheckedArgument(0));
</span><span class="cx">     if (!program &amp;&amp; !state.uncheckedArgument(0).isUndefinedOrNull())
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><span class="lines">@@ -471,12 +437,7 @@
</span><span class="cx">     WebGLUniformLocation* location = JSWebGLUniformLocation::toWrapped(state.uncheckedArgument(1));
</span><span class="cx">     if (!location &amp;&amp; !state.uncheckedArgument(1).isUndefinedOrNull())
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><del>-    WebGLGetInfo info = context.getUniform(program, location);
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-    return toJS(&amp;state, globalObject(), info);
</del><ins>+    return toJS(&amp;state, globalObject(), wrapped().getUniform(program, location));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getVertexAttrib(ExecState&amp; state)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLCanvasElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLCanvasElement.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLCanvasElement.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -228,7 +228,7 @@
</span><span class="cx">                 return nullptr;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            m_context = std::make_unique&lt;CanvasRenderingContext2D&gt;(this, document().inQuirksMode(), usesDashboardCompatibilityMode);
</del><ins>+            m_context = std::make_unique&lt;CanvasRenderingContext2D&gt;(*this, document().inQuirksMode(), usesDashboardCompatibilityMode);
</ins><span class="cx"> 
</span><span class="cx">             downcast&lt;CanvasRenderingContext2D&gt;(*m_context).setUsesDisplayListDrawing(m_usesDisplayListDrawing);
</span><span class="cx">             downcast&lt;CanvasRenderingContext2D&gt;(*m_context).setTracksDisplayListReplay(m_tracksDisplayListReplay);
</span><span class="lines">@@ -322,10 +322,8 @@
</span><span class="cx">         m_contextStateSaver-&gt;save();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_context &amp;&amp; m_context-&gt;is2d()) {
-        CanvasRenderingContext2D* context2D = static_cast&lt;CanvasRenderingContext2D*&gt;(m_context.get());
-        context2D-&gt;reset();
-    }
</del><ins>+    if (is&lt;CanvasRenderingContext2D&gt;(m_context.get()))
+        downcast&lt;CanvasRenderingContext2D&gt;(*m_context).reset();
</ins><span class="cx"> 
</span><span class="cx">     IntSize oldSize = size();
</span><span class="cx">     IntSize newSize(w, h);
</span><span class="lines">@@ -577,7 +575,7 @@
</span><span class="cx">     
</span><span class="cx">     m_usesDisplayListDrawing = usesDisplayListDrawing;
</span><span class="cx"> 
</span><del>-    if (m_context &amp;&amp; is&lt;CanvasRenderingContext2D&gt;(*m_context))
</del><ins>+    if (is&lt;CanvasRenderingContext2D&gt;(m_context.get()))
</ins><span class="cx">         downcast&lt;CanvasRenderingContext2D&gt;(*m_context).setUsesDisplayListDrawing(m_usesDisplayListDrawing);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -588,13 +586,13 @@
</span><span class="cx"> 
</span><span class="cx">     m_tracksDisplayListReplay = tracksDisplayListReplay;
</span><span class="cx"> 
</span><del>-    if (m_context &amp;&amp; is&lt;CanvasRenderingContext2D&gt;(*m_context))
</del><ins>+    if (is&lt;CanvasRenderingContext2D&gt;(m_context.get()))
</ins><span class="cx">         downcast&lt;CanvasRenderingContext2D&gt;(*m_context).setTracksDisplayListReplay(m_tracksDisplayListReplay);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String HTMLCanvasElement::displayListAsText(DisplayList::AsTextFlags flags) const
</span><span class="cx"> {
</span><del>-    if (m_context &amp;&amp; is&lt;CanvasRenderingContext2D&gt;(*m_context))
</del><ins>+    if (is&lt;CanvasRenderingContext2D&gt;(m_context.get()))
</ins><span class="cx">         return downcast&lt;CanvasRenderingContext2D&gt;(*m_context).displayListAsText(flags);
</span><span class="cx"> 
</span><span class="cx">     return String();
</span><span class="lines">@@ -602,7 +600,7 @@
</span><span class="cx"> 
</span><span class="cx"> String HTMLCanvasElement::replayDisplayListAsText(DisplayList::AsTextFlags flags) const
</span><span class="cx"> {
</span><del>-    if (m_context &amp;&amp; is&lt;CanvasRenderingContext2D&gt;(*m_context))
</del><ins>+    if (is&lt;CanvasRenderingContext2D&gt;(m_context.get()))
</ins><span class="cx">         return downcast&lt;CanvasRenderingContext2D&gt;(*m_context).replayDisplayListAsText(flags);
</span><span class="cx"> 
</span><span class="cx">     return String();
</span><span class="lines">@@ -713,10 +711,9 @@
</span><span class="cx"> 
</span><span class="cx">     m_didClearImageBuffer = true;
</span><span class="cx"> 
</span><del>-    if (m_context-&gt;is2d()) {
-        CanvasRenderingContext2D* context2D = static_cast&lt;CanvasRenderingContext2D*&gt;(m_context.get());
</del><ins>+    if (is&lt;CanvasRenderingContext2D&gt;(*m_context)) {
</ins><span class="cx">         // No need to undo transforms/clip/etc. because we are called right after the context is reset.
</span><del>-        context2D-&gt;clearRect(0, 0, width(), height());
</del><ins>+        downcast&lt;CanvasRenderingContext2D&gt;(*m_context).clearRect(0, 0, width(), height());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasGradientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasGradient.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasGradient.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/CanvasGradient.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -27,9 +27,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;CanvasGradient.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;CanvasPattern.h&quot;
</del><span class="cx"> #include &quot;CanvasStyle.h&quot;
</span><del>-#include &quot;CSSParser.h&quot;
</del><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -36,39 +34,31 @@
</span><span class="cx"> 
</span><span class="cx"> CanvasGradient::CanvasGradient(const FloatPoint&amp; p0, const FloatPoint&amp; p1)
</span><span class="cx">     : m_gradient(Gradient::create(p0, p1))
</span><del>-#if ENABLE(DASHBOARD_SUPPORT)
-    , m_dashboardCompatibilityMode(false)
-#endif
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CanvasGradient::CanvasGradient(const FloatPoint&amp; p0, float r0, const FloatPoint&amp; p1, float r1)
</span><span class="cx">     : m_gradient(Gradient::create(p0, r0, p1, r1))
</span><del>-#if ENABLE(DASHBOARD_SUPPORT)
-    , m_dashboardCompatibilityMode(false)
-#endif
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasGradient::addColorStop(float value, const String&amp; colorString, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasGradient::addColorStop(float value, const String&amp; colorString)
</ins><span class="cx"> {
</span><del>-    if (!(value &gt;= 0 &amp;&amp; value &lt;= 1.0f)) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
</del><ins>+    if (!(value &gt;= 0 &amp;&amp; value &lt;= 1))
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><ins>+    // FIXME: Passing null for canvas means this won't work for current color. Is that OK?
</ins><span class="cx">     Color color = parseColorOrCurrentColor(colorString, nullptr /*canvas*/);
</span><span class="cx">     if (!color.isValid()) {
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><del>-        if (!m_dashboardCompatibilityMode)
-            ec = SYNTAX_ERR;
-#else
-        ec = SYNTAX_ERR;
</del><ins>+        if (m_dashboardCompatibilityMode)
+            return { };
</ins><span class="cx"> #endif
</span><del>-        return;
</del><ins>+        return Exception { SYNTAX_ERR };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_gradient-&gt;addColorStop(value, color);
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-} // namespace
</del><ins>+}
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasGradienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasGradient.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasGradient.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/CanvasGradient.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2008 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2007 Alp Toker &lt;alp@atoker.com&gt;
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -24,47 +24,41 @@
</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 CanvasGradient_h
-#define CanvasGradient_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;Gradient.h&quot;
</span><del>-#include &lt;wtf/Forward.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-    typedef int ExceptionCode;
</del><ins>+class CanvasGradient : public RefCounted&lt;CanvasGradient&gt; {
+public:
+    static Ref&lt;CanvasGradient&gt; create(const FloatPoint&amp; p0, const FloatPoint&amp; p1)
+    {
+        return adoptRef(*new CanvasGradient(p0, p1));
+    }
+    static Ref&lt;CanvasGradient&gt; create(const FloatPoint&amp; p0, float r0, const FloatPoint&amp; p1, float r1)
+    {
+        return adoptRef(*new CanvasGradient(p0, r0, p1, r1));
+    }
</ins><span class="cx"> 
</span><del>-    class CanvasGradient : public RefCounted&lt;CanvasGradient&gt; {
-    public:
-        static Ref&lt;CanvasGradient&gt; create(const FloatPoint&amp; p0, const FloatPoint&amp; p1)
-        {
-            return adoptRef(*new CanvasGradient(p0, p1));
-        }
-        static Ref&lt;CanvasGradient&gt; create(const FloatPoint&amp; p0, float r0, const FloatPoint&amp; p1, float r1)
-        {
-            return adoptRef(*new CanvasGradient(p0, r0, p1, r1));
-        }
-        
-        Gradient&amp; gradient() { return m_gradient; }
-        const Gradient&amp; gradient() const { return m_gradient; }
</del><ins>+    Gradient&amp; gradient() { return m_gradient; }
+    const Gradient&amp; gradient() const { return m_gradient; }
</ins><span class="cx"> 
</span><del>-        void addColorStop(float value, const String&amp; color, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; addColorStop(float value, const String&amp; color);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><del>-        void setDashboardCompatibilityMode() { m_dashboardCompatibilityMode = true; }
</del><ins>+    void setDashboardCompatibilityMode() { m_dashboardCompatibilityMode = true; }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    private:
-        CanvasGradient(const FloatPoint&amp; p0, const FloatPoint&amp; p1);
-        CanvasGradient(const FloatPoint&amp; p0, float r0, const FloatPoint&amp; p1, float r1);
-        
-        Ref&lt;Gradient&gt; m_gradient;
</del><ins>+private:
+    CanvasGradient(const FloatPoint&amp; p0, const FloatPoint&amp; p1);
+    CanvasGradient(const FloatPoint&amp; p0, float r0, const FloatPoint&amp; p1, float r1);
+
+    Ref&lt;Gradient&gt; m_gradient;
</ins><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><del>-        bool m_dashboardCompatibilityMode;
</del><ins>+    bool m_dashboardCompatibilityMode { false };
</ins><span class="cx"> #endif
</span><del>-    };
</del><ins>+};
</ins><span class="cx"> 
</span><del>-} //namespace
-
-#endif
</del><ins>+}
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasGradientidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasGradient.idl (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasGradient.idl        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/CanvasGradient.idl        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2006 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
</span><span class="lines">@@ -22,9 +22,9 @@
</span><span class="cx">  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx">  */
</span><ins>+
</ins><span class="cx"> [
</span><span class="cx">     ImplementationLacksVTable,
</span><span class="cx"> ] interface CanvasGradient {
</span><del>-    [MayThrowLegacyException] void addColorStop(float offset, DOMString color);
</del><ins>+    [MayThrowException] void addColorStop(float offset, DOMString color);
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasPathcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasPath.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasPath.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/CanvasPath.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -111,19 +111,16 @@
</span><span class="cx">         m_path.addBezierCurveTo(cp1, cp2, p1);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasPath::arcTo(float x1, float y1, float x2, float y2, float r, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasPath::arcTo(float x1, float y1, float x2, float y2, float r)
</ins><span class="cx"> {
</span><del>-    ec = 0;
</del><span class="cx">     if (!std::isfinite(x1) || !std::isfinite(y1) || !std::isfinite(x2) || !std::isfinite(y2) || !std::isfinite(r))
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><del>-    if (r &lt; 0) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
</del><ins>+    if (r &lt; 0)
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (!hasInvertibleTransform())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     FloatPoint p1 = FloatPoint(x1, y1);
</span><span class="cx">     FloatPoint p2 = FloatPoint(x2, y2);
</span><span class="lines">@@ -134,6 +131,8 @@
</span><span class="cx">         lineTo(x1, y1);
</span><span class="cx">     else
</span><span class="cx">         m_path.addArcTo(p1, p2, r);
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void normalizeAngles(float&amp; startAngle, float&amp; endAngle, bool anticlockwise)
</span><span class="lines">@@ -155,18 +154,16 @@
</span><span class="cx">         endAngle = startAngle + 2 * piFloat;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasPath::arc(float x, float y, float radius, float startAngle, float endAngle, bool anticlockwise, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasPath::arc(float x, float y, float radius, float startAngle, float endAngle, bool anticlockwise)
</ins><span class="cx"> {
</span><span class="cx">     if (!std::isfinite(x) || !std::isfinite(y) || !std::isfinite(radius) || !std::isfinite(startAngle) || !std::isfinite(endAngle))
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><del>-    if (radius &lt; 0) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
</del><ins>+    if (radius &lt; 0)
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (!hasInvertibleTransform())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     normalizeAngles(startAngle, endAngle, anticlockwise);
</span><span class="cx"> 
</span><span class="lines">@@ -173,24 +170,23 @@
</span><span class="cx">     if (!radius || startAngle == endAngle) {
</span><span class="cx">         // The arc is empty but we still need to draw the connecting line.
</span><span class="cx">         lineTo(x + radius * cosf(startAngle), y + radius * sinf(startAngle));
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_path.addArc(FloatPoint(x, y), radius, startAngle, endAngle, anticlockwise);
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx">     
</span><del>-void CanvasPath::ellipse(float x, float y, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasPath::ellipse(float x, float y, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise)
</ins><span class="cx"> {
</span><span class="cx">     if (!std::isfinite(x) || !std::isfinite(y) || !std::isfinite(radiusX) || !std::isfinite(radiusY) || !std::isfinite(rotation) || !std::isfinite(startAngle) || !std::isfinite(endAngle))
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><del>-    if (radiusX &lt; 0 || radiusY &lt; 0) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
</del><ins>+    if (radiusX &lt; 0 || radiusY &lt; 0)
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (!hasInvertibleTransform())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     normalizeAngles(startAngle, endAngle, anticlockwise);
</span><span class="cx"> 
</span><span class="lines">@@ -199,7 +195,7 @@
</span><span class="cx">         transform.translate(x, y).rotate(rad2deg(rotation));
</span><span class="cx"> 
</span><span class="cx">         lineTo(transform.mapPoint(FloatPoint(radiusX * cosf(startAngle), radiusY * sinf(startAngle))));
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!radiusX || !radiusY) {
</span><span class="lines">@@ -217,10 +213,11 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         lineTo(transform.mapPoint(FloatPoint(radiusX * cosf(endAngle), radiusY * sinf(endAngle))));
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_path.addEllipse(FloatPoint(x, y), radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CanvasPath::rect(float x, float y, float width, float height)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasPathh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasPath.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasPath.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/CanvasPath.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -28,14 +28,11 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;Path.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class FloatRect;
-
-typedef int ExceptionCode;
-
</del><span class="cx"> class CanvasPath {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~CanvasPath() { }
</span><span class="lines">@@ -45,9 +42,9 @@
</span><span class="cx">     void lineTo(float x, float y);
</span><span class="cx">     void quadraticCurveTo(float cpx, float cpy, float x, float y);
</span><span class="cx">     void bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y);
</span><del>-    void arcTo(float x0, float y0, float x1, float y1, float radius, ExceptionCode&amp;);
-    void arc(float x, float y, float r, float sa, float ea, bool anticlockwise, ExceptionCode&amp;);
-    void ellipse(float x, float y, float radiusX, float radiusY, float rotation, float startAngle, float endAngled, bool anticlockwise, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; arcTo(float x0, float y0, float x1, float y1, float radius);
+    ExceptionOr&lt;void&gt; arc(float x, float y, float r, float sa, float ea, bool anticlockwise);
+    ExceptionOr&lt;void&gt; ellipse(float x, float y, float radiusX, float radiusY, float rotation, float startAngle, float endAngled, bool anticlockwise);
</ins><span class="cx">     void rect(float x, float y, float width, float height);
</span><span class="cx"> 
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasPathidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasPath.idl (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasPath.idl        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/CanvasPath.idl        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -33,9 +33,9 @@
</span><span class="cx">     void lineTo(unrestricted double x, unrestricted double y);
</span><span class="cx">     void quadraticCurveTo(unrestricted double cpx, unrestricted double cpy, unrestricted double x, unrestricted double y);
</span><span class="cx">     void bezierCurveTo(unrestricted double cp1x, unrestricted double cp1y, unrestricted double cp2x, unrestricted double cp2y, unrestricted double x, unrestricted double y);
</span><del>-    [MayThrowLegacyException] void arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radius);
-    // [MayThrowLegacyException] void arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radiusX, unrestricted double radiusY, unrestricted double rotation);
</del><ins>+    [MayThrowException] void arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radius);
+    // [MayThrowException] void arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radiusX, unrestricted double radiusY, unrestricted double rotation);
</ins><span class="cx">     void rect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);
</span><del>-    [MayThrowLegacyException] void arc(unrestricted double x, unrestricted double y, unrestricted double radius, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false);
-    [MayThrowLegacyException] void ellipse(unrestricted double x, unrestricted double y, unrestricted double radiusX, unrestricted double radiusY, unrestricted double rotation, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false);
</del><ins>+    [MayThrowException] void arc(unrestricted double x, unrestricted double y, unrestricted double radius, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false);
+    [MayThrowException] void ellipse(unrestricted double x, unrestricted double y, unrestricted double radiusX, unrestricted double radiusY, unrestricted double rotation, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasPatterncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasPattern.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasPattern.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/CanvasPattern.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -33,13 +33,13 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-Ref&lt;CanvasPattern&gt; CanvasPattern::create(PassRefPtr&lt;Image&gt; image, bool repeatX, bool repeatY, bool originClean)
</del><ins>+Ref&lt;CanvasPattern&gt; CanvasPattern::create(Ref&lt;Image&gt;&amp;&amp; image, bool repeatX, bool repeatY, bool originClean)
</ins><span class="cx"> {
</span><del>-    return adoptRef(*new CanvasPattern(image, repeatX, repeatY, originClean));
</del><ins>+    return adoptRef(*new CanvasPattern(WTFMove(image), repeatX, repeatY, originClean));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-CanvasPattern::CanvasPattern(PassRefPtr&lt;Image&gt; image, bool repeatX, bool repeatY, bool originClean)
-    : m_pattern(Pattern::create(image, repeatX, repeatY))
</del><ins>+CanvasPattern::CanvasPattern(Ref&lt;Image&gt;&amp;&amp; image, bool repeatX, bool repeatY, bool originClean)
+    : m_pattern(Pattern::create(WTFMove(image), repeatX, repeatY))
</ins><span class="cx">     , m_originClean(originClean)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -48,30 +48,29 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasPattern::parseRepetitionType(const String&amp; type, bool&amp; repeatX, bool&amp; repeatY, ExceptionCode&amp; ec)
</del><ins>+bool CanvasPattern::parseRepetitionType(const String&amp; type, bool&amp; repeatX, bool&amp; repeatY)
</ins><span class="cx"> {
</span><del>-    ec = 0;
</del><span class="cx">     if (type.isEmpty() || type == &quot;repeat&quot;) {
</span><span class="cx">         repeatX = true;
</span><span class="cx">         repeatY = true;
</span><del>-        return;
</del><ins>+        return true;
</ins><span class="cx">     }
</span><span class="cx">     if (type == &quot;no-repeat&quot;) {
</span><span class="cx">         repeatX = false;
</span><span class="cx">         repeatY = false;
</span><del>-        return;
</del><ins>+        return true;
</ins><span class="cx">     }
</span><span class="cx">     if (type == &quot;repeat-x&quot;) {
</span><span class="cx">         repeatX = true;
</span><span class="cx">         repeatY = false;
</span><del>-        return;
</del><ins>+        return true;
</ins><span class="cx">     }
</span><span class="cx">     if (type == &quot;repeat-y&quot;) {
</span><span class="cx">         repeatX = false;
</span><span class="cx">         repeatY = true;
</span><del>-        return;
</del><ins>+        return true;
</ins><span class="cx">     }
</span><del>-    ec = SYNTAX_ERR;
</del><ins>+    return false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasPatternh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasPattern.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasPattern.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/CanvasPattern.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -23,11 +23,9 @@
</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 CanvasPattern_h
-#define CanvasPattern_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><del>-#include &lt;wtf/PassRefPtr.h&gt;
</del><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -36,14 +34,12 @@
</span><span class="cx"> class Image;
</span><span class="cx"> class Pattern;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class CanvasPattern : public RefCounted&lt;CanvasPattern&gt; {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;CanvasPattern&gt; create(PassRefPtr&lt;Image&gt;, bool repeatX, bool repeatY, bool originClean);
</del><ins>+    static Ref&lt;CanvasPattern&gt; create(Ref&lt;Image&gt;&amp;&amp;, bool repeatX, bool repeatY, bool originClean);
</ins><span class="cx">     ~CanvasPattern();
</span><span class="cx"> 
</span><del>-    static void parseRepetitionType(const String&amp;, bool&amp; repeatX, bool&amp; repeatY, ExceptionCode&amp;);
</del><ins>+    static bool parseRepetitionType(const String&amp;, bool&amp; repeatX, bool&amp; repeatY);
</ins><span class="cx"> 
</span><span class="cx">     Pattern&amp; pattern() { return m_pattern; }
</span><span class="cx">     const Pattern&amp; pattern() const { return m_pattern; }
</span><span class="lines">@@ -51,7 +47,7 @@
</span><span class="cx">     bool originClean() const { return m_originClean; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    CanvasPattern(PassRefPtr&lt;Image&gt;, bool repeatX, bool repeatY, bool originClean);
</del><ins>+    CanvasPattern(Ref&lt;Image&gt;&amp;&amp;, bool repeatX, bool repeatY, bool originClean);
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;Pattern&gt; m_pattern;
</span><span class="cx">     bool m_originClean;
</span><span class="lines">@@ -58,5 +54,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -55,22 +55,29 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CanvasRenderingContext::wouldTaintOrigin(const HTMLImageElement* image)
</del><ins>+bool CanvasRenderingContext::wouldTaintOrigin(const HTMLImageElement* element)
</ins><span class="cx"> {
</span><del>-    if (!image || !canvas()-&gt;originClean())
</del><ins>+    if (!element || !canvas()-&gt;originClean())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    ASSERT(image-&gt;cachedImage());
-    CachedImage&amp; cachedImage = *image-&gt;cachedImage();
</del><ins>+    auto* cachedImage = element-&gt;cachedImage();
+    if (!cachedImage)
+        return false;
</ins><span class="cx"> 
</span><del>-    ASSERT(cachedImage.image());
-    if (!cachedImage.image()-&gt;hasSingleSecurityOrigin())
</del><ins>+    auto* image = cachedImage-&gt;image();
+    if (!image)
+        return false;
+
+    if (!image-&gt;hasSingleSecurityOrigin())
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><ins>+    if (!cachedImage-&gt;isCORSSameOrigin())
+        return true;
+
</ins><span class="cx">     ASSERT(canvas()-&gt;securityOrigin());
</span><del>-    ASSERT(cachedImage.origin());
-    ASSERT(canvas()-&gt;securityOrigin()-&gt;toString() == cachedImage.origin()-&gt;toString());
-    return !cachedImage.isCORSSameOrigin();
</del><ins>+    ASSERT(cachedImage-&gt;origin());
+    ASSERT(canvas()-&gt;securityOrigin()-&gt;toString() == cachedImage-&gt;origin()-&gt;toString());
+    return false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CanvasRenderingContext::wouldTaintOrigin(const HTMLVideoElement* video)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -132,8 +132,8 @@
</span><span class="cx">     CanvasRenderingContext2D* m_canvasContext;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode)
-    : CanvasRenderingContext(canvas)
</del><ins>+CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement&amp; canvas, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode)
+    : CanvasRenderingContext(&amp;canvas)
</ins><span class="cx">     , m_stateStack(1)
</span><span class="cx">     , m_usesCSSCompatibilityParseMode(usesCSSCompatibilityParseMode)
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><span class="lines">@@ -1348,53 +1348,46 @@
</span><span class="cx">         std::max(rect.height(), -rect.height()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLImageElement&amp; imageElement, float x, float y, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLImageElement&amp; imageElement, float x, float y)
</ins><span class="cx"> {
</span><span class="cx">     LayoutSize destRectSize = size(imageElement, ImageSizeAfterDevicePixelRatio);
</span><del>-    drawImage(imageElement, x, y, destRectSize.width(), destRectSize.height(), ec);
</del><ins>+    return drawImage(imageElement, x, y, destRectSize.width(), destRectSize.height());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLImageElement&amp; imageElement,
-    float x, float y, float width, float height, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLImageElement&amp; imageElement, float x, float y, float width, float height)
</ins><span class="cx"> {
</span><span class="cx">     LayoutSize sourceRectSize = size(imageElement, ImageSizeBeforeDevicePixelRatio);
</span><del>-    drawImage(imageElement, FloatRect(0, 0, sourceRectSize.width(), sourceRectSize.height()), FloatRect(x, y, width, height), ec);
</del><ins>+    return drawImage(imageElement, FloatRect { 0, 0, sourceRectSize.width(), sourceRectSize.height() }, FloatRect { x, y, width, height });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLImageElement&amp; imageElement,
-    float sx, float sy, float sw, float sh,
-    float dx, float dy, float dw, float dh, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLImageElement&amp; imageElement, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh)
</ins><span class="cx"> {
</span><del>-    drawImage(imageElement, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
</del><ins>+    return drawImage(imageElement, FloatRect { sx, sy, sw, sh }, FloatRect { dx, dy, dw, dh });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLImageElement&amp; imageElement, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLImageElement&amp; imageElement, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect)
</ins><span class="cx"> {
</span><del>-    drawImage(imageElement, srcRect, dstRect, state().globalComposite, state().globalBlend, ec);
</del><ins>+    return drawImage(imageElement, srcRect, dstRect, state().globalComposite, state().globalBlend);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLImageElement&amp; imageElement, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect, const CompositeOperator&amp; op, const BlendMode&amp; blendMode, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLImageElement&amp; imageElement, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect, const CompositeOperator&amp; op, const BlendMode&amp; blendMode)
</ins><span class="cx"> {
</span><del>-    ec = 0;
-
</del><span class="cx">     if (!std::isfinite(dstRect.x()) || !std::isfinite(dstRect.y()) || !std::isfinite(dstRect.width()) || !std::isfinite(dstRect.height())
</span><span class="cx">         || !std::isfinite(srcRect.x()) || !std::isfinite(srcRect.y()) || !std::isfinite(srcRect.width()) || !std::isfinite(srcRect.height()))
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     if (!dstRect.width() || !dstRect.height())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     if (!imageElement.complete())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     FloatRect normalizedSrcRect = normalizeRect(srcRect);
</span><span class="cx">     FloatRect normalizedDstRect = normalizeRect(dstRect);
</span><span class="cx"> 
</span><span class="cx">     FloatRect imageRect = FloatRect(FloatPoint(), size(imageElement, ImageSizeBeforeDevicePixelRatio));
</span><del>-    if (!srcRect.width() || !srcRect.height()) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
</del><ins>+    if (!srcRect.width() || !srcRect.height())
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     // When the source rectangle is outside the source image, the source rectangle must be clipped
</span><span class="cx">     // to the source image and the destination rectangle must be clipped in the same proportion.
</span><span class="lines">@@ -1401,29 +1394,29 @@
</span><span class="cx">     FloatRect originalNormalizedSrcRect = normalizedSrcRect;
</span><span class="cx">     normalizedSrcRect.intersect(imageRect);
</span><span class="cx">     if (normalizedSrcRect.isEmpty())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     if (normalizedSrcRect != originalNormalizedSrcRect) {
</span><span class="cx">         normalizedDstRect.setWidth(normalizedDstRect.width() * normalizedSrcRect.width() / originalNormalizedSrcRect.width());
</span><span class="cx">         normalizedDstRect.setHeight(normalizedDstRect.height() * normalizedSrcRect.height() / originalNormalizedSrcRect.height());
</span><span class="cx">         if (normalizedDstRect.isEmpty())
</span><del>-            return;
</del><ins>+            return { };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     GraphicsContext* c = drawingContext();
</span><span class="cx">     if (!c)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     if (!state().hasInvertibleTransform)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     CachedImage* cachedImage = imageElement.cachedImage();
</span><span class="cx">     if (!cachedImage)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     Image* image = cachedImage-&gt;imageForRenderer(imageElement.renderer());
</span><span class="cx">     if (!image)
</span><del>-        return;
-    
</del><ins>+        return { };
+
</ins><span class="cx">     ImageObserver* observer = image-&gt;imageObserver();
</span><span class="cx"> 
</span><span class="cx">     if (image-&gt;isSVGImage()) {
</span><span class="lines">@@ -1450,56 +1443,48 @@
</span><span class="cx">         image-&gt;setImageObserver(observer);
</span><span class="cx"> 
</span><span class="cx">     checkOrigin(&amp;imageElement);
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLCanvasElement&amp; sourceCanvas, float x, float y, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLCanvasElement&amp; sourceCanvas, float x, float y)
</ins><span class="cx"> {
</span><del>-    drawImage(sourceCanvas, 0, 0, sourceCanvas.width(), sourceCanvas.height(), x, y, sourceCanvas.width(), sourceCanvas.height(), ec);
</del><ins>+    return drawImage(sourceCanvas, 0, 0, sourceCanvas.width(), sourceCanvas.height(), x, y, sourceCanvas.width(), sourceCanvas.height());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLCanvasElement&amp; sourceCanvas,
-    float x, float y, float width, float height, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLCanvasElement&amp; sourceCanvas, float x, float y, float width, float height)
</ins><span class="cx"> {
</span><del>-    drawImage(sourceCanvas, FloatRect(0, 0, sourceCanvas.width(), sourceCanvas.height()), FloatRect(x, y, width, height), ec);
</del><ins>+    return drawImage(sourceCanvas, FloatRect(0, 0, sourceCanvas.width(), sourceCanvas.height()), FloatRect { x, y, width, height });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLCanvasElement&amp; sourceCanvas,
-    float sx, float sy, float sw, float sh,
-    float dx, float dy, float dw, float dh, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLCanvasElement&amp; sourceCanvas, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh)
</ins><span class="cx"> {
</span><del>-    drawImage(sourceCanvas, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
</del><ins>+    return drawImage(sourceCanvas, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLCanvasElement&amp; sourceCanvas, const FloatRect&amp; srcRect,
-    const FloatRect&amp; dstRect, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLCanvasElement&amp; sourceCanvas, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect)
</ins><span class="cx"> {
</span><span class="cx">     FloatRect srcCanvasRect = FloatRect(FloatPoint(), sourceCanvas.size());
</span><span class="cx"> 
</span><del>-    if (!srcCanvasRect.width() || !srcCanvasRect.height()) {
-        ec = INVALID_STATE_ERR;
-        return;
-    }
</del><ins>+    if (!srcCanvasRect.width() || !srcCanvasRect.height())
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><del>-    if (!srcRect.width() || !srcRect.height()) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
</del><ins>+    if (!srcRect.width() || !srcRect.height())
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><del>-    ec = 0;
-
</del><span class="cx">     if (!srcCanvasRect.contains(normalizeRect(srcRect)) || !dstRect.width() || !dstRect.height())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     GraphicsContext* c = drawingContext();
</span><span class="cx">     if (!c)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     if (!state().hasInvertibleTransform)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: Do this through platform-independent GraphicsContext API.
</span><span class="cx">     ImageBuffer* buffer = sourceCanvas.buffer();
</span><span class="cx">     if (!buffer)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     checkOrigin(&amp;sourceCanvas);
</span><span class="cx"> 
</span><span class="lines">@@ -1528,51 +1513,46 @@
</span><span class="cx">         c-&gt;drawImageBuffer(*buffer, dstRect, srcRect, ImagePaintingOptions(state().globalComposite, state().globalBlend));
</span><span class="cx">         didDraw(dstRect);
</span><span class="cx">     }
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLVideoElement&amp; video, float x, float y, ExceptionCode&amp; ec)
</del><ins>+
+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLVideoElement&amp; video, float x, float y)
</ins><span class="cx"> {
</span><span class="cx">     FloatSize videoSize = size(video);
</span><del>-    drawImage(video, x, y, videoSize.width(), videoSize.height(), ec);
</del><ins>+    return drawImage(video, x, y, videoSize.width(), videoSize.height());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLVideoElement&amp; video,
-                                         float x, float y, float width, float height, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLVideoElement&amp; video, float x, float y, float width, float height)
</ins><span class="cx"> {
</span><span class="cx">     FloatSize videoSize = size(video);
</span><del>-    drawImage(video, FloatRect(0, 0, videoSize.width(), videoSize.height()), FloatRect(x, y, width, height), ec);
</del><ins>+    return drawImage(video, FloatRect { 0, 0, videoSize.width(), videoSize.height() }, FloatRect { x, y, width, height });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLVideoElement&amp; video,
-    float sx, float sy, float sw, float sh,
-    float dx, float dy, float dw, float dh, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLVideoElement&amp; video, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh)
</ins><span class="cx"> {
</span><del>-    drawImage(video, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
</del><ins>+    return drawImage(video, FloatRect { sx, sy, sw, sh }, FloatRect { dx, dy, dw, dh });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLVideoElement&amp; video, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect,
-                                         ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CanvasRenderingContext2D::drawImage(HTMLVideoElement&amp; video, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect)
</ins><span class="cx"> {
</span><del>-    ec = 0;
-
</del><span class="cx">     if (video.readyState() == HTMLMediaElement::HAVE_NOTHING || video.readyState() == HTMLMediaElement::HAVE_METADATA)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     FloatRect videoRect = FloatRect(FloatPoint(), size(video));
</span><del>-    if (!srcRect.width() || !srcRect.height()) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
</del><ins>+    if (!srcRect.width() || !srcRect.height())
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (!videoRect.contains(normalizeRect(srcRect)) || !dstRect.width() || !dstRect.height())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     GraphicsContext* c = drawingContext();
</span><span class="cx">     if (!c)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     if (!state().hasInvertibleTransform)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     checkOrigin(&amp;video);
</span><span class="cx"> 
</span><span class="lines">@@ -1584,7 +1564,7 @@
</span><span class="cx">         else
</span><span class="cx">             didDraw(dstRect);
</span><span class="cx"> 
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -1596,20 +1576,19 @@
</span><span class="cx">     video.paintCurrentFrameInContext(*c, FloatRect(FloatPoint(), size(video)));
</span><span class="cx">     stateSaver.restore();
</span><span class="cx">     didDraw(dstRect);
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImageFromRect(HTMLImageElement&amp; imageElement,
-    float sx, float sy, float sw, float sh,
-    float dx, float dy, float dw, float dh,
-    const String&amp; compositeOperation)
</del><ins>+void CanvasRenderingContext2D::drawImageFromRect(HTMLImageElement&amp; imageElement, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, const String&amp; compositeOperation)
</ins><span class="cx"> {
</span><span class="cx">     CompositeOperator op;
</span><span class="cx">     BlendMode blendOp = BlendModeNormal;
</span><span class="cx">     if (!parseCompositeAndBlendOperator(compositeOperation, op, blendOp) || blendOp != BlendModeNormal)
</span><span class="cx">         op = CompositeSourceOver;
</span><del>-
-    drawImage(imageElement, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), op, BlendModeNormal, IGNORE_EXCEPTION);
</del><ins>+    drawImage(imageElement, FloatRect { sx, sy, sw, sh }, FloatRect { dx, dy, dw, dh }, op, BlendModeNormal);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::setAlpha(float alpha)
</span><span class="lines">@@ -1747,12 +1726,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CanvasGradient&gt; CanvasRenderingContext2D::createLinearGradient(float x0, float y0, float x1, float y1, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;CanvasGradient&gt;&gt; CanvasRenderingContext2D::createLinearGradient(float x0, float y0, float x1, float y1)
</ins><span class="cx"> {
</span><del>-    if (!std::isfinite(x0) || !std::isfinite(y0) || !std::isfinite(x1) || !std::isfinite(y1)) {
-        ec = NOT_SUPPORTED_ERR;
-        return nullptr;
-    }
</del><ins>+    if (!std::isfinite(x0) || !std::isfinite(y0) || !std::isfinite(x1) || !std::isfinite(y1))
+        return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;CanvasGradient&gt; gradient = CanvasGradient::create(FloatPoint(x0, y0), FloatPoint(x1, y1));
</span><span class="cx">     prepareGradientForDashboard(gradient.get());
</span><span class="lines">@@ -1759,17 +1736,13 @@
</span><span class="cx">     return WTFMove(gradient);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CanvasGradient&gt; CanvasRenderingContext2D::createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;CanvasGradient&gt;&gt; CanvasRenderingContext2D::createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1)
</ins><span class="cx"> {
</span><del>-    if (!std::isfinite(x0) || !std::isfinite(y0) || !std::isfinite(r0) || !std::isfinite(x1) || !std::isfinite(y1) || !std::isfinite(r1)) {
-        ec = NOT_SUPPORTED_ERR;
-        return nullptr;
-    }
</del><ins>+    if (!std::isfinite(x0) || !std::isfinite(y0) || !std::isfinite(r0) || !std::isfinite(x1) || !std::isfinite(y1) || !std::isfinite(r1))
+        return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx"> 
</span><del>-    if (r0 &lt; 0 || r1 &lt; 0) {
-        ec = INDEX_SIZE_ERR;
-        return nullptr;
-    }
</del><ins>+    if (r0 &lt; 0 || r1 &lt; 0)
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;CanvasGradient&gt; gradient = CanvasGradient::create(FloatPoint(x0, y0), r0, FloatPoint(x1, y1), r1);
</span><span class="cx">     prepareGradientForDashboard(gradient.get());
</span><span class="lines">@@ -1776,28 +1749,21 @@
</span><span class="cx">     return WTFMove(gradient);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CanvasPattern&gt; CanvasRenderingContext2D::createPattern(HTMLImageElement&amp; imageElement,
-    const String&amp; repetitionType, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;RefPtr&lt;CanvasPattern&gt;&gt; CanvasRenderingContext2D::createPattern(HTMLImageElement&amp; imageElement, const String&amp; repetitionType)
</ins><span class="cx"> {
</span><span class="cx">     bool repeatX, repeatY;
</span><del>-    ec = 0;
-    CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec);
-    if (ec)
-        return nullptr;
</del><ins>+    if (!CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY))
+        return Exception { SYNTAX_ERR };
</ins><span class="cx"> 
</span><del>-    CachedImage* cachedImage = imageElement.cachedImage();
</del><ins>+    auto* cachedImage = imageElement.cachedImage();
+
</ins><span class="cx">     // If the image loading hasn't started or the image is not complete, it is not fully decodable.
</span><span class="cx">     if (!cachedImage || !imageElement.complete())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if (cachedImage-&gt;status() == CachedResource::LoadError) {
-        ec = INVALID_STATE_ERR;
-        return nullptr;
-    }
</del><ins>+    if (cachedImage-&gt;status() == CachedResource::LoadError)
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><del>-    if (!imageElement.cachedImage()-&gt;imageForRenderer(imageElement.renderer()))
-        return CanvasPattern::create(Image::nullImage(), repeatX, repeatY, true);
-
</del><span class="cx">     bool originClean = cachedImage-&gt;isOriginClean(canvas()-&gt;securityOrigin());
</span><span class="cx"> 
</span><span class="cx">     // FIXME: SVG images with animations can switch between clean and dirty (leaking cross-origin
</span><span class="lines">@@ -1809,50 +1775,46 @@
</span><span class="cx">     if (cachedImage-&gt;image()-&gt;isSVGImage())
</span><span class="cx">         originClean = false;
</span><span class="cx"> 
</span><del>-    return CanvasPattern::create(cachedImage-&gt;imageForRenderer(imageElement.renderer()), repeatX, repeatY, originClean);
</del><ins>+    return RefPtr&lt;CanvasPattern&gt; { CanvasPattern::create(*cachedImage-&gt;imageForRenderer(imageElement.renderer()), repeatX, repeatY, originClean) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CanvasPattern&gt; CanvasRenderingContext2D::createPattern(HTMLCanvasElement&amp; canvas,
-    const String&amp; repetitionType, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;CanvasPattern&gt;&gt; CanvasRenderingContext2D::createPattern(HTMLCanvasElement&amp; canvas, const String&amp; repetitionType)
</ins><span class="cx"> {
</span><del>-    if (!canvas.width() || !canvas.height() || !canvas.buffer()) {
-        ec = INVALID_STATE_ERR;
-        return nullptr;
-    }
</del><ins>+    if (!canvas.width() || !canvas.height() || !canvas.buffer())
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     bool repeatX, repeatY;
</span><del>-    ec = 0;
-    CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec);
-    if (ec)
-        return nullptr;
-    return CanvasPattern::create(canvas.copiedImage(), repeatX, repeatY, canvas.originClean());
</del><ins>+    if (!CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY))
+        return Exception { SYNTAX_ERR };
+
+    return CanvasPattern::create(*canvas.copiedImage(), repeatX, repeatY, canvas.originClean());
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-RefPtr&lt;CanvasPattern&gt; CanvasRenderingContext2D::createPattern(HTMLVideoElement&amp; videoElement, const String&amp; repetitionType, ExceptionCode&amp; ec)
</del><ins>+
+ExceptionOr&lt;RefPtr&lt;CanvasPattern&gt;&gt; CanvasRenderingContext2D::createPattern(HTMLVideoElement&amp; videoElement, const String&amp; repetitionType)
</ins><span class="cx"> {
</span><span class="cx">     if (videoElement.readyState() &lt; HTMLMediaElement::HAVE_CURRENT_DATA)
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><span class="cx">     bool repeatX, repeatY;
</span><del>-    ec = 0;
-    CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec);
-    if (ec)
-        return nullptr;
-    
</del><ins>+    if (!CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY))
+        return Exception { SYNTAX_ERR };
+
</ins><span class="cx">     checkOrigin(&amp;videoElement);
</span><span class="cx">     bool originClean = canvas()-&gt;originClean();
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG) || (ENABLE(ACCELERATED_2D_CANVAS) &amp;&amp; USE(GSTREAMER_GL) &amp;&amp; USE(CAIRO))
</span><span class="cx">     if (auto nativeImage = videoElement.nativeImageForCurrentTime())
</span><del>-        return CanvasPattern::create(BitmapImage::create(WTFMove(nativeImage)), repeatX, repeatY, originClean);
</del><ins>+        return RefPtr&lt;CanvasPattern&gt; { CanvasPattern::create(BitmapImage::create(WTFMove(nativeImage)), repeatX, repeatY, originClean) };
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     auto imageBuffer = ImageBuffer::create(size(videoElement), drawingContext() ? drawingContext()-&gt;renderingMode() : Accelerated);
</span><span class="cx">     videoElement.paintCurrentFrameInContext(imageBuffer-&gt;context(), FloatRect(FloatPoint(), size(videoElement)));
</span><span class="cx">     
</span><del>-    return CanvasPattern::create(ImageBuffer::sinkIntoImage(WTFMove(imageBuffer), Unscaled), repeatX, repeatY, originClean);
</del><ins>+    return RefPtr&lt;CanvasPattern&gt; { CanvasPattern::create(ImageBuffer::sinkIntoImage(WTFMove(imageBuffer), Unscaled).releaseNonNull(), repeatX, repeatY, originClean) };
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::didDrawEntireCanvas()
</span><span class="lines">@@ -1975,29 +1937,20 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;ImageData&gt; CanvasRenderingContext2D::createImageData(RefPtr&lt;ImageData&gt;&amp;&amp; imageData, ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;RefPtr&lt;ImageData&gt;&gt; CanvasRenderingContext2D::createImageData(ImageData* imageData) const
</ins><span class="cx"> {
</span><del>-    if (!imageData) {
-        ec = NOT_SUPPORTED_ERR;
-        return nullptr;
-    }
</del><ins>+    if (!imageData)
+        return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx"> 
</span><span class="cx">     return createEmptyImageData(imageData-&gt;size());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;ImageData&gt; CanvasRenderingContext2D::createImageData(float sw, float sh, ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;RefPtr&lt;ImageData&gt;&gt; CanvasRenderingContext2D::createImageData(float sw, float sh) const
</ins><span class="cx"> {
</span><del>-    ec = 0;
-    if (!sw || !sh) {
-        ec = INDEX_SIZE_ERR;
-        return nullptr;
-    }
-    if (!std::isfinite(sw) || !std::isfinite(sh)) {
-        ec = TypeError;
-        return nullptr;
-    }
</del><ins>+    if (!sw || !sh)
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><del>-    FloatSize logicalSize(fabs(sw), fabs(sh));
</del><ins>+    FloatSize logicalSize(std::abs(sw), std::abs(sh));
</ins><span class="cx">     if (!logicalSize.isExpressibleAsIntSize())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -2010,33 +1963,26 @@
</span><span class="cx">     return createEmptyImageData(size);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;ImageData&gt; CanvasRenderingContext2D::getImageData(float sx, float sy, float sw, float sh, ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;RefPtr&lt;ImageData&gt;&gt; CanvasRenderingContext2D::getImageData(float sx, float sy, float sw, float sh) const
</ins><span class="cx"> {
</span><del>-    return getImageData(ImageBuffer::LogicalCoordinateSystem, sx, sy, sw, sh, ec);
</del><ins>+    return getImageData(ImageBuffer::LogicalCoordinateSystem, sx, sy, sw, sh);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;ImageData&gt; CanvasRenderingContext2D::webkitGetImageDataHD(float sx, float sy, float sw, float sh, ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;RefPtr&lt;ImageData&gt;&gt; CanvasRenderingContext2D::webkitGetImageDataHD(float sx, float sy, float sw, float sh) const
</ins><span class="cx"> {
</span><del>-    return getImageData(ImageBuffer::BackingStoreCoordinateSystem, sx, sy, sw, sh, ec);
</del><ins>+    return getImageData(ImageBuffer::BackingStoreCoordinateSystem, sx, sy, sw, sh);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;ImageData&gt; CanvasRenderingContext2D::getImageData(ImageBuffer::CoordinateSystem coordinateSystem, float sx, float sy, float sw, float sh, ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;RefPtr&lt;ImageData&gt;&gt; CanvasRenderingContext2D::getImageData(ImageBuffer::CoordinateSystem coordinateSystem, float sx, float sy, float sw, float sh) const
</ins><span class="cx"> {
</span><span class="cx">     if (!canvas()-&gt;originClean()) {
</span><span class="cx">         static NeverDestroyed&lt;String&gt; consoleMessage(ASCIILiteral(&quot;Unable to get image data from canvas because the canvas has been tainted by cross-origin data.&quot;));
</span><span class="cx">         canvas()-&gt;document().addConsoleMessage(MessageSource::Security, MessageLevel::Error, consoleMessage);
</span><del>-        ec = SECURITY_ERR;
-        return nullptr;
</del><ins>+        return Exception { SECURITY_ERR };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!sw || !sh) {
-        ec = INDEX_SIZE_ERR;
-        return nullptr;
-    }
-    if (!std::isfinite(sx) || !std::isfinite(sy) || !std::isfinite(sw) || !std::isfinite(sh)) {
-        ec = NOT_SUPPORTED_ERR;
-        return nullptr;
-    }
</del><ins>+    if (!sw || !sh)
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (sw &lt; 0) {
</span><span class="cx">         sx += sw;
</span><span class="lines">@@ -2060,7 +2006,7 @@
</span><span class="cx">     if (!buffer)
</span><span class="cx">         return createEmptyImageData(imageDataRect.size());
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Uint8ClampedArray&gt; byteArray = buffer-&gt;getUnmultipliedImageData(imageDataRect, coordinateSystem);
</del><ins>+    auto byteArray = buffer-&gt;getUnmultipliedImageData(imageDataRect, coordinateSystem);
</ins><span class="cx">     if (!byteArray) {
</span><span class="cx">         StringBuilder consoleMessage;
</span><span class="cx">         consoleMessage.appendLiteral(&quot;Unable to get image data from canvas. Requested size was &quot;);
</span><span class="lines">@@ -2069,32 +2015,30 @@
</span><span class="cx">         consoleMessage.appendNumber(imageDataRect.height());
</span><span class="cx"> 
</span><span class="cx">         canvas()-&gt;document().addConsoleMessage(MessageSource::Rendering, MessageLevel::Error, consoleMessage.toString());
</span><del>-        ec = INVALID_STATE_ERR;
-        return nullptr;
</del><ins>+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return ImageData::create(imageDataRect.size(), byteArray.releaseNonNull());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::putImageData(ImageData&amp; data, float dx, float dy, ExceptionCode&amp; ec)
</del><ins>+void CanvasRenderingContext2D::putImageData(ImageData&amp; data, float dx, float dy)
</ins><span class="cx"> {
</span><del>-    putImageData(data, dx, dy, 0, 0, data.width(), data.height(), ec);
</del><ins>+    putImageData(data, dx, dy, 0, 0, data.width(), data.height());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData&amp; data, float dx, float dy, ExceptionCode&amp; ec)
</del><ins>+void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData&amp; data, float dx, float dy)
</ins><span class="cx"> {
</span><del>-    webkitPutImageDataHD(data, dx, dy, 0, 0, data.width(), data.height(), ec);
</del><ins>+    webkitPutImageDataHD(data, dx, dy, 0, 0, data.width(), data.height());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::putImageData(ImageData&amp; data, float dx, float dy, float dirtyX, float dirtyY,
-                                            float dirtyWidth, float dirtyHeight, ExceptionCode&amp; ec)
</del><ins>+void CanvasRenderingContext2D::putImageData(ImageData&amp; data, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight)
</ins><span class="cx"> {
</span><del>-    putImageData(data, ImageBuffer::LogicalCoordinateSystem, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight, ec);
</del><ins>+    putImageData(data, ImageBuffer::LogicalCoordinateSystem, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData&amp; data, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&amp; ec)
</del><ins>+void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData&amp; data, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight)
</ins><span class="cx"> {
</span><del>-    putImageData(data, ImageBuffer::BackingStoreCoordinateSystem, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight, ec);
</del><ins>+    putImageData(data, ImageBuffer::BackingStoreCoordinateSystem, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::drawFocusIfNeeded(Element* element)
</span><span class="lines">@@ -2111,21 +2055,14 @@
</span><span class="cx"> {
</span><span class="cx">     GraphicsContext* context = drawingContext();
</span><span class="cx"> 
</span><del>-    if (!element || !element-&gt;focused() || !state().hasInvertibleTransform || path.isEmpty()
-        || !element-&gt;isDescendantOf(canvas()) || !context)
</del><ins>+    if (!element || !element-&gt;focused() || !state().hasInvertibleTransform || path.isEmpty() || !element-&gt;isDescendantOf(canvas()) || !context)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     context-&gt;drawFocusRing(path, 1, 1, RenderTheme::focusRingColor());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::putImageData(ImageData&amp; data, ImageBuffer::CoordinateSystem coordinateSystem, float dx, float dy, float dirtyX, float dirtyY,
-                                            float dirtyWidth, float dirtyHeight, ExceptionCode&amp; ec)
</del><ins>+void CanvasRenderingContext2D::putImageData(ImageData&amp; data, ImageBuffer::CoordinateSystem coordinateSystem, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight)
</ins><span class="cx"> {
</span><del>-    if (!std::isfinite(dx) || !std::isfinite(dy) || !std::isfinite(dirtyX) || !std::isfinite(dirtyY) || !std::isfinite(dirtyWidth) || !std::isfinite(dirtyHeight)) {
-        ec = NOT_SUPPORTED_ERR;
-        return;
-    }
-
</del><span class="cx">     ImageBuffer* buffer = canvas()-&gt;buffer();
</span><span class="cx">     if (!buffer)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> 
</span><span class="cx"> class CanvasRenderingContext2D final : public CanvasRenderingContext, public CanvasPath {
</span><span class="cx"> public:
</span><del>-    CanvasRenderingContext2D(HTMLCanvasElement*, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode);
</del><ins>+    CanvasRenderingContext2D(HTMLCanvasElement&amp;, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode);
</ins><span class="cx">     virtual ~CanvasRenderingContext2D();
</span><span class="cx"> 
</span><span class="cx">     const CanvasStyle&amp; strokeStyle() const { return state().strokeStyle; }
</span><span class="lines">@@ -158,45 +158,44 @@
</span><span class="cx"> 
</span><span class="cx">     void clearShadow();
</span><span class="cx"> 
</span><del>-    void drawImage(HTMLImageElement&amp;, float x, float y, ExceptionCode&amp;);
-    void drawImage(HTMLImageElement&amp;, float x, float y, float width, float height, ExceptionCode&amp;);
-    void drawImage(HTMLImageElement&amp;, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&amp;);
-    void drawImage(HTMLImageElement&amp;, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect, ExceptionCode&amp;);
-    void drawImage(HTMLCanvasElement&amp;, float x, float y, ExceptionCode&amp;);
-    void drawImage(HTMLCanvasElement&amp;, float x, float y, float width, float height, ExceptionCode&amp;);
-    void drawImage(HTMLCanvasElement&amp;, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&amp;);
-    void drawImage(HTMLCanvasElement&amp;, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect, ExceptionCode&amp;);
-    void drawImage(HTMLImageElement&amp;, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect, const CompositeOperator&amp;, const BlendMode&amp;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; drawImage(HTMLImageElement&amp;, float x, float y);
+    ExceptionOr&lt;void&gt; drawImage(HTMLImageElement&amp;, float x, float y, float width, float height);
+    ExceptionOr&lt;void&gt; drawImage(HTMLImageElement&amp;, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh);
+    ExceptionOr&lt;void&gt; drawImage(HTMLImageElement&amp;, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect);
+    ExceptionOr&lt;void&gt; drawImage(HTMLCanvasElement&amp;, float x, float y);
+    ExceptionOr&lt;void&gt; drawImage(HTMLCanvasElement&amp;, float x, float y, float width, float height);
+    ExceptionOr&lt;void&gt; drawImage(HTMLCanvasElement&amp;, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh);
+    ExceptionOr&lt;void&gt; drawImage(HTMLCanvasElement&amp;, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect);
+    ExceptionOr&lt;void&gt; drawImage(HTMLImageElement&amp;, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect, const CompositeOperator&amp;, const BlendMode&amp;);
</ins><span class="cx"> #if ENABLE(VIDEO)
</span><del>-    void drawImage(HTMLVideoElement&amp;, float x, float y, ExceptionCode&amp;);
-    void drawImage(HTMLVideoElement&amp;, float x, float y, float width, float height, ExceptionCode&amp;);
-    void drawImage(HTMLVideoElement&amp;, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&amp;);
-    void drawImage(HTMLVideoElement&amp;, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; drawImage(HTMLVideoElement&amp;, float x, float y);
+    ExceptionOr&lt;void&gt; drawImage(HTMLVideoElement&amp;, float x, float y, float width, float height);
+    ExceptionOr&lt;void&gt; drawImage(HTMLVideoElement&amp;, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh);
+    ExceptionOr&lt;void&gt; drawImage(HTMLVideoElement&amp;, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void drawImageFromRect(HTMLImageElement&amp;, float sx = 0, float sy = 0, float sw = 0, float sh = 0,
-                           float dx = 0, float dy = 0, float dw = 0, float dh = 0, const String&amp; compositeOperation = emptyString());
</del><ins>+    void drawImageFromRect(HTMLImageElement&amp;, float sx = 0, float sy = 0, float sw = 0, float sh = 0, float dx = 0, float dy = 0, float dw = 0, float dh = 0, const String&amp; compositeOperation = emptyString());
</ins><span class="cx"> 
</span><span class="cx">     void setAlpha(float);
</span><span class="cx"> 
</span><span class="cx">     void setCompositeOperation(const String&amp;);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;CanvasGradient&gt; createLinearGradient(float x0, float y0, float x1, float y1, ExceptionCode&amp;);
-    RefPtr&lt;CanvasGradient&gt; createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionCode&amp;);
-    RefPtr&lt;CanvasPattern&gt; createPattern(HTMLImageElement&amp;, const String&amp; repetitionType, ExceptionCode&amp;);
-    RefPtr&lt;CanvasPattern&gt; createPattern(HTMLCanvasElement&amp;, const String&amp; repetitionType, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;CanvasGradient&gt;&gt; createLinearGradient(float x0, float y0, float x1, float y1);
+    ExceptionOr&lt;Ref&lt;CanvasGradient&gt;&gt; createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1);
+    ExceptionOr&lt;RefPtr&lt;CanvasPattern&gt;&gt; createPattern(HTMLImageElement&amp;, const String&amp; repetitionType);
+    ExceptionOr&lt;Ref&lt;CanvasPattern&gt;&gt; createPattern(HTMLCanvasElement&amp;, const String&amp; repetitionType);
</ins><span class="cx"> #if ENABLE(VIDEO)
</span><del>-    RefPtr&lt;CanvasPattern&gt; createPattern(HTMLVideoElement&amp;, const String&amp; repetitionType, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;RefPtr&lt;CanvasPattern&gt;&gt; createPattern(HTMLVideoElement&amp;, const String&amp; repetitionType);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    RefPtr&lt;ImageData&gt; createImageData(RefPtr&lt;ImageData&gt;&amp;&amp;, ExceptionCode&amp;) const;
-    RefPtr&lt;ImageData&gt; createImageData(float width, float height, ExceptionCode&amp;) const;
-    RefPtr&lt;ImageData&gt; getImageData(float sx, float sy, float sw, float sh, ExceptionCode&amp;) const;
-    RefPtr&lt;ImageData&gt; webkitGetImageDataHD(float sx, float sy, float sw, float sh, ExceptionCode&amp;) const;
-    void putImageData(ImageData&amp;, float dx, float dy, ExceptionCode&amp;);
-    void putImageData(ImageData&amp;, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&amp;);
-    void webkitPutImageDataHD(ImageData&amp;, float dx, float dy, ExceptionCode&amp;);
-    void webkitPutImageDataHD(ImageData&amp;, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;RefPtr&lt;ImageData&gt;&gt; createImageData(ImageData*) const;
+    ExceptionOr&lt;RefPtr&lt;ImageData&gt;&gt; createImageData(float width, float height) const;
+    ExceptionOr&lt;RefPtr&lt;ImageData&gt;&gt; getImageData(float sx, float sy, float sw, float sh) const;
+    ExceptionOr&lt;RefPtr&lt;ImageData&gt;&gt; webkitGetImageDataHD(float sx, float sy, float sw, float sh) const;
+    void putImageData(ImageData&amp;, float dx, float dy);
+    void putImageData(ImageData&amp;, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
+    void webkitPutImageDataHD(ImageData&amp;, float dx, float dy);
+    void webkitPutImageDataHD(ImageData&amp;, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
</ins><span class="cx"> 
</span><span class="cx">     void drawFocusIfNeeded(Element*);
</span><span class="cx">     void drawFocusIfNeeded(DOMPath&amp;, Element*);
</span><span class="lines">@@ -371,8 +370,8 @@
</span><span class="cx"> 
</span><span class="cx">     void prepareGradientForDashboard(CanvasGradient&amp; gradient) const;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;ImageData&gt; getImageData(ImageBuffer::CoordinateSystem, float sx, float sy, float sw, float sh, ExceptionCode&amp;) const;
-    void putImageData(ImageData&amp;, ImageBuffer::CoordinateSystem, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;RefPtr&lt;ImageData&gt;&gt; getImageData(ImageBuffer::CoordinateSystem, float sx, float sy, float sw, float sh) const;
+    void putImageData(ImageData&amp;, ImageBuffer::CoordinateSystem, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
</ins><span class="cx"> 
</span><span class="cx">     bool is2d() const override { return true; }
</span><span class="cx">     bool isAccelerated() const override;
</span><span class="lines">@@ -391,7 +390,6 @@
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><span class="cx">     bool m_usesDashboardCompatibilityMode;
</span><span class="cx"> #endif
</span><del>-
</del><span class="cx">     bool m_usesDisplayListDrawing { false };
</span><span class="cx">     bool m_tracksDisplayListReplay { false };
</span><span class="cx">     mutable std::unique_ptr&lt;struct DisplayListDrawingContext&gt; m_recordingContext;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Didl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -53,8 +53,8 @@
</span><span class="cx"> 
</span><span class="cx">     attribute DOMString globalCompositeOperation;
</span><span class="cx"> 
</span><del>-    [MayThrowLegacyException] CanvasGradient createLinearGradient(float x0, float y0, float x1, float y1);
-    [MayThrowLegacyException] CanvasGradient createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1);
</del><ins>+    [MayThrowException] CanvasGradient createLinearGradient(float x0, float y0, float x1, float y1);
+    [MayThrowException] CanvasGradient createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1);
</ins><span class="cx"> 
</span><span class="cx">     attribute unrestricted float lineWidth;
</span><span class="cx">     attribute DOMString lineCap;
</span><span class="lines">@@ -132,21 +132,15 @@
</span><span class="cx"> 
</span><span class="cx">     void strokeRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
</span><span class="cx"> 
</span><del>-    [MayThrowLegacyException] void drawImage(HTMLImageElement image, unrestricted float x, unrestricted float y);
-    [MayThrowLegacyException] void drawImage(HTMLImageElement image, unrestricted float x, unrestricted float y,
-        unrestricted float width, unrestricted float height);
-    [MayThrowLegacyException] void drawImage(HTMLImageElement image, unrestricted float sx, unrestricted float sy, unrestricted float sw,
-        unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
-    [MayThrowLegacyException] void drawImage(HTMLCanvasElement canvas, unrestricted float x, unrestricted float y);
-    [MayThrowLegacyException] void drawImage(HTMLCanvasElement canvas, unrestricted float x, unrestricted float y,
-        unrestricted float width, unrestricted float height);
-    [MayThrowLegacyException] void drawImage(HTMLCanvasElement canvas, unrestricted float sx, unrestricted float sy, unrestricted float sw,
-        unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
-    [Conditional=VIDEO, MayThrowLegacyException] void drawImage(HTMLVideoElement video, unrestricted float x, unrestricted float y);
-    [Conditional=VIDEO, MayThrowLegacyException] void drawImage(HTMLVideoElement video, unrestricted float x, unrestricted float y,
-        unrestricted float width, unrestricted float height);
-    [Conditional=VIDEO, MayThrowLegacyException] void drawImage(HTMLVideoElement video, unrestricted float sx, unrestricted float sy, unrestricted float sw,
-        unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
</del><ins>+    [MayThrowException] void drawImage(HTMLImageElement image, unrestricted float x, unrestricted float y);
+    [MayThrowException] void drawImage(HTMLImageElement image, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+    [MayThrowException] void drawImage(HTMLImageElement image, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
+    [MayThrowException] void drawImage(HTMLCanvasElement canvas, unrestricted float x, unrestricted float y);
+    [MayThrowException] void drawImage(HTMLCanvasElement canvas, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+    [MayThrowException] void drawImage(HTMLCanvasElement canvas, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
+    [Conditional=VIDEO, MayThrowException] void drawImage(HTMLVideoElement video, unrestricted float x, unrestricted float y);
+    [Conditional=VIDEO, MayThrowException] void drawImage(HTMLVideoElement video, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+    [Conditional=VIDEO, MayThrowException] void drawImage(HTMLVideoElement video, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
</ins><span class="cx"> 
</span><span class="cx">     void drawImageFromRect(HTMLImageElement image,
</span><span class="cx">         optional unrestricted float sx = 0, optional unrestricted float sy = 0, optional unrestricted float sw = 0, optional unrestricted float sh = 0,
</span><span class="lines">@@ -162,25 +156,24 @@
</span><span class="cx">     void setShadow(float width, unrestricted float height, unrestricted float blur, unrestricted float c, unrestricted float m, 
</span><span class="cx">         unrestricted float y, unrestricted float k, unrestricted float a);
</span><span class="cx"> 
</span><del>-    [MayThrowLegacyException] void putImageData(ImageData imagedata, float dx, float dy);
-    [MayThrowLegacyException] void putImageData(ImageData imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
</del><ins>+    void putImageData(ImageData imagedata, float dx, float dy);
+    void putImageData(ImageData imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
</ins><span class="cx"> 
</span><del>-    [MayThrowLegacyException] void webkitPutImageDataHD(ImageData imagedata, float dx, float dy);
-    [MayThrowLegacyException] void webkitPutImageDataHD(ImageData imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
</del><ins>+    void webkitPutImageDataHD(ImageData imagedata, float dx, float dy);
+    void webkitPutImageDataHD(ImageData imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
</ins><span class="cx"> 
</span><del>-    [MayThrowLegacyException] CanvasPattern createPattern(HTMLCanvasElement canvas, [TreatNullAs=EmptyString] DOMString repetitionType);
-    [MayThrowLegacyException] CanvasPattern createPattern(HTMLImageElement image, [TreatNullAs=EmptyString] DOMString repetitionType);
-    [Conditional=VIDEO, MayThrowLegacyException] CanvasPattern? createPattern(HTMLVideoElement video, [TreatNullAs=EmptyString] DOMString repetitionType);
-    [MayThrowLegacyException] ImageData createImageData(ImageData? imagedata);
-    [MayThrowLegacyException] ImageData createImageData(float sw, float sh);
</del><ins>+    [MayThrowException] CanvasPattern createPattern(HTMLCanvasElement canvas, [TreatNullAs=EmptyString] DOMString repetitionType);
+    [MayThrowException] CanvasPattern createPattern(HTMLImageElement image, [TreatNullAs=EmptyString] DOMString repetitionType);
+    [Conditional=VIDEO, MayThrowException] CanvasPattern? createPattern(HTMLVideoElement video, [TreatNullAs=EmptyString] DOMString repetitionType);
+    [MayThrowException] ImageData createImageData(ImageData? imagedata);
+    [MayThrowException] ImageData createImageData(float sw, float sh);
</ins><span class="cx"> 
</span><span class="cx">     [Custom] attribute custom strokeStyle;
</span><span class="cx">     [Custom] attribute custom fillStyle;
</span><span class="cx"> 
</span><span class="cx">     // pixel manipulation
</span><del>-    [MayThrowLegacyException] ImageData getImageData(float sx, float sy, float sw, float sh);
-
-    [MayThrowLegacyException] ImageData webkitGetImageDataHD(float sx, float sy, float sw, float sh);
</del><ins>+    [MayThrowException] ImageData getImageData(float sx, float sy, float sw, float sh);
+    [MayThrowException] ImageData webkitGetImageDataHD(float sx, float sy, float sw, float sh);
</ins><span class="cx">     
</span><span class="cx">     // Focus rings
</span><span class="cx">     void drawFocusIfNeeded(Element? element); // FIXME: The element parameter should not be nullable.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasOESVertexArrayObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -24,25 +24,20 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;OESVertexArrayObject.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> 
</span><del>-#include &quot;OESVertexArrayObject.h&quot;
-
</del><span class="cx"> #include &quot;Extensions3D.h&quot;
</span><span class="cx"> #include &quot;WebGLRenderingContext.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-OESVertexArrayObject::OESVertexArrayObject(WebGLRenderingContextBase* context)
-    : WebGLExtension(context)
</del><ins>+OESVertexArrayObject::OESVertexArrayObject(WebGLRenderingContextBase&amp; context)
+    : WebGLExtension(&amp;context)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-OESVertexArrayObject::~OESVertexArrayObject()
-{
-}
-
</del><span class="cx"> WebGLExtension::ExtensionName OESVertexArrayObject::getName() const
</span><span class="cx"> {
</span><span class="cx">     return OESVertexArrayObjectName;
</span><span class="lines">@@ -52,7 +47,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (m_context-&gt;isContextLost())
</span><span class="cx">         return nullptr;
</span><del>-    
</del><ins>+
</ins><span class="cx">     auto object = WebGLVertexArrayObjectOES::create(m_context, WebGLVertexArrayObjectOES::VAOTypeUser);
</span><span class="cx">     m_context-&gt;addContextObject(object.ptr());
</span><span class="cx">     return WTFMove(object);
</span><span class="lines">@@ -71,36 +66,29 @@
</span><span class="cx"> 
</span><span class="cx"> GC3Dboolean OESVertexArrayObject::isVertexArrayOES(WebGLVertexArrayObjectOES* arrayObject)
</span><span class="cx"> {
</span><del>-    if (!arrayObject || m_context-&gt;isContextLost())
-        return 0;
-    
-    if (!arrayObject-&gt;hasEverBeenBound())
-        return 0;
-    
-    Extensions3D* extensions = m_context-&gt;graphicsContext3D()-&gt;getExtensions();
-    return extensions-&gt;isVertexArrayOES(arrayObject-&gt;object());
</del><ins>+    return arrayObject &amp;&amp; !m_context-&gt;isContextLost() &amp;&amp; arrayObject-&gt;hasEverBeenBound()
+        &amp;&amp; m_context-&gt;graphicsContext3D()-&gt;getExtensions()-&gt;isVertexArrayOES(arrayObject-&gt;object());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void OESVertexArrayObject::bindVertexArrayOES(WebGLVertexArrayObjectOES* arrayObject, ExceptionCode&amp; ec)
</del><ins>+void OESVertexArrayObject::bindVertexArrayOES(WebGLVertexArrayObjectOES* arrayObject)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(ec);
</del><span class="cx">     if (m_context-&gt;isContextLost())
</span><span class="cx">         return;
</span><del>-    
</del><ins>+
</ins><span class="cx">     if (arrayObject &amp;&amp; (arrayObject-&gt;isDeleted() || !arrayObject-&gt;validate(0, context()))) {
</span><span class="cx">         m_context-&gt;graphicsContext3D()-&gt;synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    
-    Extensions3D* extensions = m_context-&gt;graphicsContext3D()-&gt;getExtensions();
</del><ins>+
+    auto&amp; extensions = *m_context-&gt;graphicsContext3D()-&gt;getExtensions();
+    auto&amp; context = downcast&lt;WebGLRenderingContext&gt;(*m_context);
</ins><span class="cx">     if (arrayObject &amp;&amp; !arrayObject-&gt;isDefaultObject() &amp;&amp; arrayObject-&gt;object()) {
</span><del>-        extensions-&gt;bindVertexArrayOES(arrayObject-&gt;object());
-        
</del><ins>+        extensions.bindVertexArrayOES(arrayObject-&gt;object());
</ins><span class="cx">         arrayObject-&gt;setHasEverBeenBound();
</span><del>-        static_cast&lt;WebGLRenderingContext*&gt;(m_context)-&gt;setBoundVertexArrayObject(arrayObject);
</del><ins>+        context.setBoundVertexArrayObject(arrayObject);
</ins><span class="cx">     } else {
</span><del>-        extensions-&gt;bindVertexArrayOES(0);
-        static_cast&lt;WebGLRenderingContext*&gt;(m_context)-&gt;setBoundVertexArrayObject(0);
</del><ins>+        extensions.bindVertexArrayOES(0);
+        context.setBoundVertexArrayObject(0);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasOESVertexArrayObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/OESVertexArrayObject.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/OESVertexArrayObject.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/OESVertexArrayObject.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -23,8 +23,7 @@
</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 OESVertexArrayObject_h
-#define OESVertexArrayObject_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;GraphicsTypes3D.h&quot;
</span><span class="cx"> #include &quot;WebGLExtension.h&quot;
</span><span class="lines">@@ -34,21 +33,17 @@
</span><span class="cx"> class WebGLRenderingContextBase;
</span><span class="cx"> class WebGLVertexArrayObjectOES;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class OESVertexArrayObject final : public WebGLExtension {
</span><span class="cx"> public:
</span><del>-    OESVertexArrayObject(WebGLRenderingContextBase*);
-    virtual ~OESVertexArrayObject();
</del><ins>+    explicit OESVertexArrayObject(WebGLRenderingContextBase&amp;);
</ins><span class="cx"> 
</span><del>-    ExtensionName getName() const override;
-    
</del><span class="cx">     RefPtr&lt;WebGLVertexArrayObjectOES&gt; createVertexArrayOES();
</span><span class="cx">     void deleteVertexArrayOES(WebGLVertexArrayObjectOES*);
</span><span class="cx">     GC3Dboolean isVertexArrayOES(WebGLVertexArrayObjectOES*);
</span><del>-    void bindVertexArrayOES(WebGLVertexArrayObjectOES*, ExceptionCode&amp;);
</del><ins>+    void bindVertexArrayOES(WebGLVertexArrayObjectOES*);
+
+private:
+    ExtensionName getName() const final;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // OESVertexArrayObject_h
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasOESVertexArrayObjectidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/OESVertexArrayObject.idl (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/OESVertexArrayObject.idl        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/OESVertexArrayObject.idl        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -34,5 +34,5 @@
</span><span class="cx">     WebGLVertexArrayObjectOES createVertexArrayOES();
</span><span class="cx">     void deleteVertexArrayOES(optional WebGLVertexArrayObjectOES? arrayObject = null);
</span><span class="cx">     boolean isVertexArrayOES(optional WebGLVertexArrayObjectOES? arrayObject = null);
</span><del>-    [MayThrowLegacyException] void bindVertexArrayOES(optional WebGLVertexArrayObjectOES? arrayObject = null);
</del><ins>+    void bindVertexArrayOES(optional WebGLVertexArrayObjectOES? arrayObject = null);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGL2RenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -64,8 +64,8 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGL2RenderingContext::WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp; context,
-    GraphicsContext3D::Attributes attributes) : WebGLRenderingContextBase(passedCanvas, WTFMove(context), attributes)
</del><ins>+WebGL2RenderingContext::WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp; context, GraphicsContext3D::Attributes attributes)
+    : WebGLRenderingContextBase(passedCanvas, WTFMove(context), attributes)
</ins><span class="cx"> {
</span><span class="cx">     initializeShaderExtensions();
</span><span class="cx">     initializeVertexArrayObjects();
</span><span class="lines">@@ -807,7 +807,7 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGL2RenderingContext::getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname, ExceptionCode&amp;)
</del><ins>+WebGLGetInfo WebGL2RenderingContext::getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending() || !validateFramebufferFuncParameters(&quot;getFramebufferAttachmentParameter&quot;, target, attachment))
</span><span class="cx">         return WebGLGetInfo();
</span><span class="lines">@@ -1039,9 +1039,8 @@
</span><span class="cx">     tex-&gt;setLevelInfo(target, level, internalformat, width, height, GraphicsContext3D::UNSIGNED_BYTE);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGL2RenderingContext::texSubImage2DBase(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum internalformat, GC3Denum format, GC3Denum type, const void* pixels, ExceptionCode&amp; ec)
</del><ins>+void WebGL2RenderingContext::texSubImage2DBase(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum internalformat, GC3Denum format, GC3Denum type, const void* pixels)
</ins><span class="cx"> {
</span><del>-    ec = 0;
</del><span class="cx">     ASSERT(!isContextLost());
</span><span class="cx">     if (!validateTexFuncParameters(&quot;texSubImage2D&quot;, TexSubImage, target, level, internalformat, width, height, 0, format, type))
</span><span class="cx">         return;
</span><span class="lines">@@ -1061,9 +1060,8 @@
</span><span class="cx">     m_context-&gt;texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGL2RenderingContext::texSubImage2DImpl(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Image* image, GraphicsContext3D::ImageHtmlDomSource domSource, bool flipY, bool premultiplyAlpha, ExceptionCode&amp; ec)
</del><ins>+void WebGL2RenderingContext::texSubImage2DImpl(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Image* image, GraphicsContext3D::ImageHtmlDomSource domSource, bool flipY, bool premultiplyAlpha)
</ins><span class="cx"> {
</span><del>-    ec = 0;
</del><span class="cx">     Vector&lt;uint8_t&gt; data;
</span><span class="cx">     GraphicsContext3D::ImageExtractor imageExtractor(image, domSource, premultiplyAlpha, m_unpackColorspaceConversion == GraphicsContext3D::NONE);
</span><span class="cx">     if (!imageExtractor.extractSucceeded()) {
</span><span class="lines">@@ -1089,12 +1087,12 @@
</span><span class="cx">     
</span><span class="cx">     WebGLTexture* tex = validateTextureBinding(&quot;texSubImage2D&quot;, target, true);
</span><span class="cx">     GC3Denum internalformat = tex-&gt;getInternalFormat(target, level);
</span><del>-    texSubImage2DBase(target, level, xoffset, yoffset, image-&gt;width(), image-&gt;height(), internalformat, format, type,  needConversion ? data.data() : imagePixelData, ec);
</del><ins>+    texSubImage2DBase(target, level, xoffset, yoffset, image-&gt;width(), image-&gt;height(), internalformat, format, type,  needConversion ? data.data() : imagePixelData);
</ins><span class="cx">     if (m_unpackAlignment != 1)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGL2RenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp; pixels, ExceptionCode&amp; ec)
</del><ins>+void WebGL2RenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp; pixels)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending() || !validateTexFuncData(&quot;texSubImage2D&quot;, level, width, height, GraphicsContext3D::NONE, format, type, pixels.get(), NullNotAllowed) || !validateTexFunc(&quot;texSubImage2D&quot;, TexSubImage, SourceArrayBufferView, target, level, GraphicsContext3D::NONE, width, height, 0, format, type, xoffset, yoffset))
</span><span class="cx">         return;
</span><span class="lines">@@ -1116,14 +1114,13 @@
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1);
</span><span class="cx">     WebGLTexture* tex = validateTextureBinding(&quot;texSubImage2D&quot;, target, true);
</span><span class="cx">     GC3Denum internalformat = tex-&gt;getInternalFormat(target, level);
</span><del>-    texSubImage2DBase(target, level, xoffset, yoffset, width, height, internalformat, format, type, data, ec);
</del><ins>+    texSubImage2DBase(target, level, xoffset, yoffset, width, height, internalformat, format, type, data);
</ins><span class="cx">     if (changeUnpackAlignment)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGL2RenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, ImageData* pixels, ExceptionCode&amp; ec)
</del><ins>+void WebGL2RenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, ImageData* pixels)
</ins><span class="cx"> {
</span><del>-    ec = 0;
</del><span class="cx">     if (isContextLostOrPending() || !pixels || !validateTexFunc(&quot;texSubImage2D&quot;, TexSubImage, SourceImageData, target, level, GraphicsContext3D::NONE,  pixels-&gt;width(), pixels-&gt;height(), 0, format, type, xoffset, yoffset))
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="lines">@@ -1144,58 +1141,65 @@
</span><span class="cx">     
</span><span class="cx">     WebGLTexture* tex = validateTextureBinding(&quot;texSubImage2D&quot;, target, true);
</span><span class="cx">     GC3Denum internalformat = tex-&gt;getInternalFormat(target, level);
</span><del>-    texSubImage2DBase(target, level, xoffset, yoffset, pixels-&gt;width(), pixels-&gt;height(), internalformat, format, type, needConversion ? data.data() : pixels-&gt;data()-&gt;data(), ec);
</del><ins>+    texSubImage2DBase(target, level, xoffset, yoffset, pixels-&gt;width(), pixels-&gt;height(), internalformat, format, type, needConversion ? data.data() : pixels-&gt;data()-&gt;data());
</ins><span class="cx">     if (m_unpackAlignment != 1)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGL2RenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLImageElement* image, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; WebGL2RenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLImageElement* image)
</ins><span class="cx"> {
</span><del>-    ec = 0;
-    if (isContextLostOrPending() || !validateHTMLImageElement(&quot;texSubImage2D&quot;, image, ec))
-        return;
-    
</del><ins>+    if (wouldTaintOrigin(image))
+        return Exception { SECURITY_ERR };
+    if (isContextLostOrPending() || !validateHTMLImageElement(&quot;texSubImage2D&quot;, image))
+        return { };
+
</ins><span class="cx">     RefPtr&lt;Image&gt; imageForRender = image-&gt;cachedImage()-&gt;imageForRenderer(image-&gt;renderer());
</span><span class="cx">     if (!imageForRender)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     if (imageForRender-&gt;isSVGImage())
</span><span class="cx">         imageForRender = drawImageIntoBuffer(*imageForRender, image-&gt;width(), image-&gt;height(), 1);
</span><span class="cx">     
</span><span class="cx">     if (!imageForRender || !validateTexFunc(&quot;texSubImage2D&quot;, TexSubImage, SourceHTMLImageElement, target, level, GraphicsContext3D::NONE, imageForRender-&gt;width(), imageForRender-&gt;height(), 0, format, type, xoffset, yoffset))
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     
</span><del>-    texSubImage2DImpl(target, level, xoffset, yoffset, format, type, imageForRender.get(), GraphicsContext3D::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
</del><ins>+    texSubImage2DImpl(target, level, xoffset, yoffset, format, type, imageForRender.get(), GraphicsContext3D::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlpha);
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGL2RenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-    GC3Denum format, GC3Denum type, HTMLCanvasElement* canvas, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; WebGL2RenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLCanvasElement* canvas)
</ins><span class="cx"> {
</span><del>-    ec = 0;
-    if (isContextLostOrPending() || !validateHTMLCanvasElement(&quot;texSubImage2D&quot;, canvas, ec)
</del><ins>+    if (wouldTaintOrigin(canvas))
+        return Exception { SECURITY_ERR };
+    if (isContextLostOrPending() || !validateHTMLCanvasElement(&quot;texSubImage2D&quot;, canvas)
</ins><span class="cx">         || !validateTexFunc(&quot;texSubImage2D&quot;, TexSubImage, SourceHTMLCanvasElement, target, level, GraphicsContext3D::NONE, canvas-&gt;width(), canvas-&gt;height(), 0, format, type, xoffset, yoffset))
</span><del>-        return;
-    
</del><ins>+        return { };
+
</ins><span class="cx">     RefPtr&lt;ImageData&gt; imageData = canvas-&gt;getImageData();
</span><span class="cx">     if (imageData)
</span><del>-        texSubImage2D(target, level, xoffset, yoffset, format, type, imageData.get(), ec);
</del><ins>+        texSubImage2D(target, level, xoffset, yoffset, format, type, imageData.get());
</ins><span class="cx">     else
</span><del>-        texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas-&gt;copiedImage(), GraphicsContext3D::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
</del><ins>+        texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas-&gt;copiedImage(), GraphicsContext3D::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha);
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-void WebGL2RenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLVideoElement* video, ExceptionCode&amp; ec)
</del><ins>+
+ExceptionOr&lt;void&gt; WebGL2RenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLVideoElement* video)
</ins><span class="cx"> {
</span><del>-    ec = 0;
-    if (isContextLostOrPending() || !validateHTMLVideoElement(&quot;texSubImage2D&quot;, video, ec)
</del><ins>+    if (wouldTaintOrigin(video))
+        return Exception { SECURITY_ERR };
+    if (isContextLostOrPending() || !validateHTMLVideoElement(&quot;texSubImage2D&quot;, video)
</ins><span class="cx">         || !validateTexFunc(&quot;texSubImage2D&quot;, TexSubImage, SourceHTMLVideoElement, target, level, GraphicsContext3D::NONE, video-&gt;videoWidth(), video-&gt;videoHeight(), 0, format, type, xoffset, yoffset))
</span><del>-        return;
-    
</del><ins>+        return { };
+
</ins><span class="cx">     RefPtr&lt;Image&gt; image = videoFrameToImage(video, ImageBuffer::fastCopyImageMode());
</span><span class="cx">     if (!image)
</span><del>-        return;
-    texSubImage2DImpl(target, level, xoffset, yoffset, format, type, image.get(), GraphicsContext3D::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
</del><ins>+        return { };
+    texSubImage2DImpl(target, level, xoffset, yoffset, format, type, image.get(), GraphicsContext3D::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha);
+    return { };
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> bool WebGL2RenderingContext::validateTexFuncParameters(const char* functionName, TexFuncValidationFunctionType functionType, GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type)
</span><span class="lines">@@ -1243,8 +1247,7 @@
</span><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        ExceptionCode ec;
-        bool isSRGB = (getFramebufferAttachmentParameter(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, ec).getInt() == GraphicsContext3D::SRGB);
</del><ins>+        bool isSRGB = (getFramebufferAttachmentParameter(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING).getInt() == GraphicsContext3D::SRGB);
</ins><span class="cx">         if (isSRGB != (framebufferInternalFormat == GraphicsContext3D::SRGB8 || framebufferInternalFormat == GraphicsContext3D::SRGB8_ALPHA8)) {
</span><span class="cx">             synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, &quot;framebuffer attachment color encoding and internal format do not match&quot;);
</span><span class="cx">         return false;
</span><span class="lines">@@ -1813,7 +1816,7 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGL2RenderingContext::getParameter(GC3Denum pname, ExceptionCode&amp;)
</del><ins>+WebGLGetInfo WebGL2RenderingContext::getParameter(GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending())
</span><span class="cx">         return WebGLGetInfo();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGL2RenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -23,8 +23,7 @@
</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 WebGL2RenderingContext_h
-#define WebGL2RenderingContext_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL2)
</span><span class="cx"> 
</span><span class="lines">@@ -43,7 +42,6 @@
</span><span class="cx"> public:
</span><span class="cx">     WebGL2RenderingContext(HTMLCanvasElement*, GraphicsContext3D::Attributes);
</span><span class="cx">     WebGL2RenderingContext(HTMLCanvasElement*, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp;, GraphicsContext3D::Attributes);
</span><del>-    bool isWebGL2() const override { return true; }
</del><span class="cx"> 
</span><span class="cx">     /* Buffer objects */
</span><span class="cx">     void bufferData(GC3Denum target, ArrayBufferView&amp; data, GC3Denum usage, GC3Duint srcOffset, GC3Duint length);
</span><span class="lines">@@ -53,7 +51,7 @@
</span><span class="cx">     void getBufferSubData(GC3Denum target, GC3Dint64 offset, ArrayBuffer* returnedData);
</span><span class="cx">     
</span><span class="cx">     /* Framebuffer objects */
</span><del>-    WebGLGetInfo getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname, ExceptionCode&amp;) override;
</del><ins>+    WebGLGetInfo getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname) final;
</ins><span class="cx">     void blitFramebuffer(GC3Dint srcX0, GC3Dint srcY0, GC3Dint srcX1, GC3Dint srcY1, GC3Dint dstX0, GC3Dint dstY0, GC3Dint dstX1, GC3Dint dstY1, GC3Dbitfield mask, GC3Denum filter);
</span><span class="cx">     void framebufferTextureLayer(GC3Denum target, GC3Denum attachment, GC3Duint texture, GC3Dint level, GC3Dint layer);
</span><span class="cx">     WebGLGetInfo getInternalformatParameter(GC3Denum target, GC3Denum internalformat, GC3Denum pname);
</span><span class="lines">@@ -102,7 +100,7 @@
</span><span class="cx">     void vertexAttribIPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dsizei stride, GC3Dint64 offset);
</span><span class="cx">     
</span><span class="cx">     /* Writing to the drawing buffer */
</span><del>-    void clear(GC3Dbitfield mask) override;
</del><ins>+    void clear(GC3Dbitfield mask) final;
</ins><span class="cx">     void vertexAttribDivisor(GC3Duint index, GC3Duint divisor);
</span><span class="cx">     void drawArraysInstanced(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei instanceCount);
</span><span class="cx">     void drawElementsInstanced(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dint64 offset, GC3Dsizei instanceCount);
</span><span class="lines">@@ -170,52 +168,47 @@
</span><span class="cx">     GC3Dboolean isVertexArray(WebGLVertexArrayObject* vertexArray);
</span><span class="cx">     void bindVertexArray(WebGLVertexArrayObject* vertexArray);
</span><span class="cx">     
</span><ins>+private:
+    bool isWebGL2() const final { return true; }
+
</ins><span class="cx">     /* Extensions */
</span><del>-    WebGLExtension* getExtension(const String&amp;) override;
-    Vector&lt;String&gt; getSupportedExtensions() override;
-    WebGLGetInfo getParameter(GC3Denum pname, ExceptionCode&amp;) override;
</del><ins>+    WebGLExtension* getExtension(const String&amp;) final;
+    Vector&lt;String&gt; getSupportedExtensions() final;
+    WebGLGetInfo getParameter(GC3Denum pname) final;
</ins><span class="cx"> 
</span><del>-    void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height) override;
-    void hint(GC3Denum target, GC3Denum mode) override;
-    void copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border) override;
-    void texSubImage2DBase(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum internalformat, GC3Denum format, GC3Denum type, const void* pixels, ExceptionCode&amp;) override;
-    void texSubImage2DImpl(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Image*, GraphicsContext3D::ImageHtmlDomSource, bool flipY, bool premultiplyAlpha, ExceptionCode&amp;) override;
-    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Dsizei width, GC3Dsizei height,
-        GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp;, ExceptionCode&amp;) override;
-    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Denum format, GC3Denum type, ImageData*, ExceptionCode&amp;) override;
-    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Denum format, GC3Denum type, HTMLImageElement*, ExceptionCode&amp;) override;
-    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Denum format, GC3Denum type, HTMLCanvasElement*, ExceptionCode&amp;) override;
</del><ins>+    void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height) final;
+    void hint(GC3Denum target, GC3Denum mode) final;
+    void copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border) final;
+    void texSubImage2DBase(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum internalformat, GC3Denum format, GC3Denum type, const void* pixels) final;
+    void texSubImage2DImpl(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Image*, GraphicsContext3D::ImageHtmlDomSource, bool flipY, bool premultiplyAlpha) final;
+    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp;) final;
+    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, ImageData*) final;
+    ExceptionOr&lt;void&gt; texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLImageElement*) final;
+    ExceptionOr&lt;void&gt; texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLCanvasElement*) final;
</ins><span class="cx"> #if ENABLE(VIDEO)
</span><del>-    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Denum format, GC3Denum type, HTMLVideoElement*, ExceptionCode&amp;) override;
</del><ins>+    ExceptionOr&lt;void&gt; texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLVideoElement*) final;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-protected:
-    void initializeVertexArrayObjects() override;
-    GC3Dint getMaxDrawBuffers() override;
-    GC3Dint getMaxColorAttachments() override;
-    bool validateIndexArrayConservative(GC3Denum type, unsigned&amp; numElementsRequired) override;
-    bool validateBlendEquation(const char* functionName, GC3Denum mode) override;
-    bool validateTexFuncFormatAndType(const char* functionName, GC3Denum internalformat, GC3Denum format, GC3Denum type, GC3Dint level) override;
</del><ins>+    void initializeVertexArrayObjects() final;
+    GC3Dint getMaxDrawBuffers() final;
+    GC3Dint getMaxColorAttachments() final;
+    bool validateIndexArrayConservative(GC3Denum type, unsigned&amp; numElementsRequired) final;
+    bool validateBlendEquation(const char* functionName, GC3Denum mode) final;
+    bool validateTexFuncFormatAndType(const char* functionName, GC3Denum internalformat, GC3Denum format, GC3Denum type, GC3Dint level) final;
</ins><span class="cx">     bool validateTexFuncParameters(const char* functionName,
</span><span class="cx">         TexFuncValidationFunctionType,
</span><span class="cx">         GC3Denum target, GC3Dint level,
</span><span class="cx">         GC3Denum internalformat,
</span><span class="cx">         GC3Dsizei width, GC3Dsizei height, GC3Dint border,
</span><del>-        GC3Denum format, GC3Denum type) override;
</del><ins>+        GC3Denum format, GC3Denum type) final;
</ins><span class="cx">     bool validateTexFuncData(const char* functionName, GC3Dint level,
</span><span class="cx">         GC3Dsizei width, GC3Dsizei height,
</span><span class="cx">         GC3Denum internalformat, GC3Denum format, GC3Denum type,
</span><span class="cx">         ArrayBufferView* pixels,
</span><del>-        NullDisposition) override;
-    bool validateCapability(const char* functionName, GC3Denum cap) override;
-    bool validateFramebufferFuncParameters(const char* functionName, GC3Denum target, GC3Denum attachment) override;
</del><ins>+        NullDisposition) final;
+    bool validateCapability(const char* functionName, GC3Denum cap) final;
+    bool validateFramebufferFuncParameters(const char* functionName, GC3Denum target, GC3Denum attachment) final;
</ins><span class="cx">     
</span><del>-private:
</del><span class="cx">     GC3Denum baseInternalFormatFromInternalFormat(GC3Denum internalformat);
</span><span class="cx">     bool isIntegerFormat(GC3Denum internalformat);
</span><span class="cx">     void initializeShaderExtensions();
</span><span class="lines">@@ -226,5 +219,3 @@
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_CANVASRENDERINGCONTEXT(WebCore::WebGL2RenderingContext, isWebGL2())
</span><span class="cx"> 
</span><span class="cx"> #endif // WEBGL2
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -173,7 +173,7 @@
</span><span class="cx">         &amp;&amp; m_context-&gt;getExtensions()-&gt;supports(&quot;GL_OES_vertex_array_object&quot;)) {
</span><span class="cx">         if (!m_oesVertexArrayObject) {
</span><span class="cx">             m_context-&gt;getExtensions()-&gt;ensureEnabled(&quot;GL_OES_vertex_array_object&quot;);
</span><del>-            m_oesVertexArrayObject = std::make_unique&lt;OESVertexArrayObject&gt;(this);
</del><ins>+            m_oesVertexArrayObject = std::make_unique&lt;OESVertexArrayObject&gt;(*this);
</ins><span class="cx">         }
</span><span class="cx">         return m_oesVertexArrayObject.get();
</span><span class="cx">     }
</span><span class="lines">@@ -296,9 +296,8 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContext::getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname, ExceptionCode&amp; ec)
</del><ins>+WebGLGetInfo WebGLRenderingContext::getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(ec);
</del><span class="cx">     if (isContextLostOrPending() || !validateFramebufferFuncParameters(&quot;getFramebufferAttachmentParameter&quot;, target, attachment))
</span><span class="cx">         return WebGLGetInfo();
</span><span class="cx">     
</span><span class="lines">@@ -510,11 +509,9 @@
</span><span class="cx">     tex-&gt;setLevelInfo(target, level, internalformat, width, height, GraphicsContext3D::UNSIGNED_BYTE);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContext::texSubImage2DBase(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum internalformat, GC3Denum format, GC3Denum type, const void* pixels, ExceptionCode&amp; ec)
</del><ins>+void WebGLRenderingContext::texSubImage2DBase(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum internalformat, GC3Denum format, GC3Denum type, const void* pixels)
</ins><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(internalformat);
</span><del>-    // FIXME: For now we ignore any errors returned
-    ec = 0;
</del><span class="cx">     ASSERT(!isContextLost());
</span><span class="cx">     ASSERT(validateTexFuncParameters(&quot;texSubImage2D&quot;, TexSubImage, target, level, format, width, height, 0, format, type));
</span><span class="cx">     ASSERT(validateSize(&quot;texSubImage2D&quot;, xoffset, yoffset));
</span><span class="lines">@@ -533,9 +530,8 @@
</span><span class="cx">     m_context-&gt;texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContext::texSubImage2DImpl(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Image* image, GraphicsContext3D::ImageHtmlDomSource domSource, bool flipY, bool premultiplyAlpha, ExceptionCode&amp; ec)
</del><ins>+void WebGLRenderingContext::texSubImage2DImpl(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Image* image, GraphicsContext3D::ImageHtmlDomSource domSource, bool flipY, bool premultiplyAlpha)
</ins><span class="cx"> {
</span><del>-    ec = 0;
</del><span class="cx">     Vector&lt;uint8_t&gt; data;
</span><span class="cx">     GraphicsContext3D::ImageExtractor imageExtractor(image, domSource, premultiplyAlpha, m_unpackColorspaceConversion == GraphicsContext3D::NONE);
</span><span class="cx">     if (!imageExtractor.extractSucceeded()) {
</span><span class="lines">@@ -559,12 +555,12 @@
</span><span class="cx">     if (m_unpackAlignment != 1)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1);
</span><span class="cx"> 
</span><del>-    texSubImage2DBase(target, level, xoffset, yoffset, image-&gt;width(), image-&gt;height(), format, format, type, needConversion ? data.data() : imagePixelData, ec);
</del><ins>+    texSubImage2DBase(target, level, xoffset, yoffset, image-&gt;width(), image-&gt;height(), format, format, type, needConversion ? data.data() : imagePixelData);
</ins><span class="cx">     if (m_unpackAlignment != 1)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp; pixels, ExceptionCode&amp; ec)
</del><ins>+void WebGLRenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp; pixels)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending() || !validateTexFuncData(&quot;texSubImage2D&quot;, level, width, height, format, format, type, pixels.get(), NullNotAllowed) || !validateTexFunc(&quot;texSubImage2D&quot;, TexSubImage, SourceArrayBufferView, target, level, format, width, height, 0, format, type, xoffset, yoffset))
</span><span class="cx">         return;
</span><span class="lines">@@ -585,14 +581,13 @@
</span><span class="cx">     if (changeUnpackAlignment)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1);
</span><span class="cx"> 
</span><del>-    texSubImage2DBase(target, level, xoffset, yoffset, width, height, format, format, type, data, ec);
</del><ins>+    texSubImage2DBase(target, level, xoffset, yoffset, width, height, format, format, type, data);
</ins><span class="cx">     if (changeUnpackAlignment)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, ImageData* pixels, ExceptionCode&amp; ec)
</del><ins>+void WebGLRenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, ImageData* pixels)
</ins><span class="cx"> {
</span><del>-    ec = 0;
</del><span class="cx">     if (isContextLostOrPending() || !pixels || !validateTexFunc(&quot;texSubImage2D&quot;, TexSubImage, SourceImageData, target, level, format,  pixels-&gt;width(), pixels-&gt;height(), 0, format, type, xoffset, yoffset))
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="lines">@@ -611,57 +606,65 @@
</span><span class="cx">     if (m_unpackAlignment != 1)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1);
</span><span class="cx">     
</span><del>-    texSubImage2DBase(target, level, xoffset, yoffset, pixels-&gt;width(), pixels-&gt;height(), format, format, type, needConversion ? data.data() : pixels-&gt;data()-&gt;data(), ec);
</del><ins>+    texSubImage2DBase(target, level, xoffset, yoffset, pixels-&gt;width(), pixels-&gt;height(), format, format, type, needConversion ? data.data() : pixels-&gt;data()-&gt;data());
</ins><span class="cx">     if (m_unpackAlignment != 1)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLImageElement* image, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; WebGLRenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLImageElement* image)
</ins><span class="cx"> {
</span><del>-    ec = 0;
-    if (isContextLostOrPending() || !validateHTMLImageElement(&quot;texSubImage2D&quot;, image, ec))
-        return;
-    
</del><ins>+    if (wouldTaintOrigin(image))
+        return Exception { SECURITY_ERR };
+    if (isContextLostOrPending() || !validateHTMLImageElement(&quot;texSubImage2D&quot;, image))
+        return { };
+
</ins><span class="cx">     RefPtr&lt;Image&gt; imageForRender = image-&gt;cachedImage()-&gt;imageForRenderer(image-&gt;renderer());
</span><span class="cx">     if (!imageForRender)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     if (imageForRender-&gt;isSVGImage())
</span><span class="cx">         imageForRender = drawImageIntoBuffer(*imageForRender, image-&gt;width(), image-&gt;height(), 1);
</span><span class="cx">     
</span><span class="cx">     if (!imageForRender || !validateTexFunc(&quot;texSubImage2D&quot;, TexSubImage, SourceHTMLImageElement, target, level, format, imageForRender-&gt;width(), imageForRender-&gt;height(), 0, format, type, xoffset, yoffset))
</span><del>-        return;
-    
-    texSubImage2DImpl(target, level, xoffset, yoffset, format, type, imageForRender.get(), GraphicsContext3D::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
</del><ins>+        return { };
+
+    texSubImage2DImpl(target, level, xoffset, yoffset, format, type, imageForRender.get(), GraphicsContext3D::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlpha);
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLCanvasElement* canvas, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; WebGLRenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLCanvasElement* canvas)
</ins><span class="cx"> {
</span><del>-    ec = 0;
-    if (isContextLostOrPending() || !validateHTMLCanvasElement(&quot;texSubImage2D&quot;, canvas, ec)
</del><ins>+    if (wouldTaintOrigin(canvas))
+        return Exception { SECURITY_ERR };
+    if (isContextLostOrPending() || !validateHTMLCanvasElement(&quot;texSubImage2D&quot;, canvas)
</ins><span class="cx">         || !validateTexFunc(&quot;texSubImage2D&quot;, TexSubImage, SourceHTMLCanvasElement, target, level, format, canvas-&gt;width(), canvas-&gt;height(), 0, format, type, xoffset, yoffset))
</span><del>-        return;
-    
</del><ins>+        return { };
+
</ins><span class="cx">     RefPtr&lt;ImageData&gt; imageData = canvas-&gt;getImageData();
</span><span class="cx">     if (imageData)
</span><del>-        texSubImage2D(target, level, xoffset, yoffset, format, type, imageData.get(), ec);
</del><ins>+        texSubImage2D(target, level, xoffset, yoffset, format, type, imageData.get());
</ins><span class="cx">     else
</span><del>-        texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas-&gt;copiedImage(), GraphicsContext3D::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
</del><ins>+        texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas-&gt;copiedImage(), GraphicsContext3D::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha);
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-void WebGLRenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLVideoElement* video, ExceptionCode&amp; ec)
</del><ins>+
+ExceptionOr&lt;void&gt; WebGLRenderingContext::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLVideoElement* video)
</ins><span class="cx"> {
</span><del>-    ec = 0;
-    if (isContextLostOrPending() || !validateHTMLVideoElement(&quot;texSubImage2D&quot;, video, ec)
</del><ins>+    if (wouldTaintOrigin(video))
+        return Exception { SECURITY_ERR };
+    if (isContextLostOrPending() || !validateHTMLVideoElement(&quot;texSubImage2D&quot;, video)
</ins><span class="cx">         || !validateTexFunc(&quot;texSubImage2D&quot;, TexSubImage, SourceHTMLVideoElement, target, level, format, video-&gt;videoWidth(), video-&gt;videoHeight(), 0, format, type, xoffset, yoffset))
</span><del>-        return;
-    
</del><ins>+        return { };
+
</ins><span class="cx">     RefPtr&lt;Image&gt; image = videoFrameToImage(video, ImageBuffer::fastCopyImageMode());
</span><span class="cx">     if (!image)
</span><del>-        return;
-    texSubImage2DImpl(target, level, xoffset, yoffset, format, type, image.get(), GraphicsContext3D::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
</del><ins>+        return { };
+    texSubImage2DImpl(target, level, xoffset, yoffset, format, type, image.get(), GraphicsContext3D::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha);
+    return { };
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> bool WebGLRenderingContext::validateTexFuncParameters(const char* functionName,
</span><span class="lines">@@ -915,9 +918,8 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContext::getParameter(GC3Denum pname, ExceptionCode&amp; ec)
</del><ins>+WebGLGetInfo WebGLRenderingContext::getParameter(GC3Denum pname)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(ec);
</del><span class="cx">     if (isContextLostOrPending())
</span><span class="cx">         return WebGLGetInfo();
</span><span class="cx">     const int intZero = 0;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -23,8 +23,7 @@
</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 WebGLRenderingContext_h
-#define WebGLRenderingContext_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;WebGLRenderingContextBase.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -34,57 +33,41 @@
</span><span class="cx"> public:
</span><span class="cx">     WebGLRenderingContext(HTMLCanvasElement*, GraphicsContext3D::Attributes);
</span><span class="cx">     WebGLRenderingContext(HTMLCanvasElement*, PassRefPtr&lt;GraphicsContext3D&gt;, GraphicsContext3D::Attributes);
</span><del>-    bool isWebGL1() const override { return true; }
-    
-    WebGLExtension* getExtension(const String&amp;) override;
-    WebGLGetInfo getParameter(GC3Denum pname, ExceptionCode&amp;) override;
-    Vector&lt;String&gt; getSupportedExtensions() override;
</del><span class="cx"> 
</span><del>-    WebGLGetInfo getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname, ExceptionCode&amp;) override;
-    void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height) override;
-    bool validateFramebufferFuncParameters(const char* functionName, GC3Denum target, GC3Denum attachment) override;
-    void hint(GC3Denum target, GC3Denum mode) override;
-    void clear(GC3Dbitfield mask) override;
-    void copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border) override;
-    void texSubImage2DBase(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum internalformat, GC3Denum format, GC3Denum type, const void* pixels, ExceptionCode&amp;) override;
-    void texSubImage2DImpl(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Image*, GraphicsContext3D::ImageHtmlDomSource, bool flipY, bool premultiplyAlpha, ExceptionCode&amp;) override;
-    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Dsizei width, GC3Dsizei height,
-        GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp;, ExceptionCode&amp;) override;
-    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Denum format, GC3Denum type, ImageData*, ExceptionCode&amp;) override;
-    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Denum format, GC3Denum type, HTMLImageElement*, ExceptionCode&amp;) override;
-    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Denum format, GC3Denum type, HTMLCanvasElement*, ExceptionCode&amp;) override;
</del><ins>+private:
+    bool isWebGL1() const final { return true; }
+
+    WebGLExtension* getExtension(const String&amp;) final;
+    WebGLGetInfo getParameter(GC3Denum pname) final;
+    Vector&lt;String&gt; getSupportedExtensions() final;
+
+    WebGLGetInfo getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname) final;
+    void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height) final;
+    bool validateFramebufferFuncParameters(const char* functionName, GC3Denum target, GC3Denum attachment) final;
+    void hint(GC3Denum target, GC3Denum mode) final;
+    void clear(GC3Dbitfield mask) final;
+    void copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border) final;
+    void texSubImage2DBase(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum internalformat, GC3Denum format, GC3Denum type, const void* pixels) final;
+    void texSubImage2DImpl(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Image*, GraphicsContext3D::ImageHtmlDomSource, bool flipY, bool premultiplyAlpha) final;
+    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp;) final;
+    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, ImageData*) final;
+    ExceptionOr&lt;void&gt; texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLImageElement*) final;
+    ExceptionOr&lt;void&gt; texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLCanvasElement*) final;
</ins><span class="cx"> #if ENABLE(VIDEO)
</span><del>-    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Denum format, GC3Denum type, HTMLVideoElement*, ExceptionCode&amp;) override;
</del><ins>+    ExceptionOr&lt;void&gt; texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLVideoElement*) final;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-protected:
-    GC3Dint getMaxDrawBuffers() override;
-    GC3Dint getMaxColorAttachments() override;
-    void initializeVertexArrayObjects() override;
-    bool validateIndexArrayConservative(GC3Denum type, unsigned&amp; numElementsRequired) override;
-    bool validateBlendEquation(const char* functionName, GC3Denum mode) override;
-    bool validateTexFuncParameters(const char* functionName,
-        TexFuncValidationFunctionType,
-        GC3Denum target, GC3Dint level,
-        GC3Denum internalformat,
-        GC3Dsizei width, GC3Dsizei height, GC3Dint border,
-        GC3Denum format, GC3Denum type) override;
-    bool validateTexFuncFormatAndType(const char* functionName, GC3Denum internalformat, GC3Denum format, GC3Denum type, GC3Dint level) override;
-    bool validateTexFuncData(const char* functionName, GC3Dint level,
-        GC3Dsizei width, GC3Dsizei height,
-        GC3Denum internalformat, GC3Denum format, GC3Denum type,
-        ArrayBufferView* pixels,
-        NullDisposition) override;
-    bool validateCapability(const char* functionName, GC3Denum cap) override;
</del><ins>+    GC3Dint getMaxDrawBuffers() final;
+    GC3Dint getMaxColorAttachments() final;
+    void initializeVertexArrayObjects() final;
+    bool validateIndexArrayConservative(GC3Denum type, unsigned&amp; numElementsRequired) final;
+    bool validateBlendEquation(const char* functionName, GC3Denum mode) final;
+    bool validateTexFuncParameters(const char* functionName, TexFuncValidationFunctionType, GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type) final;
+    bool validateTexFuncFormatAndType(const char* functionName, GC3Denum internalformat, GC3Denum format, GC3Denum type, GC3Dint level) final;
+    bool validateTexFuncData(const char* functionName, GC3Dint level, GC3Dsizei width, GC3Dsizei height, GC3Denum internalformat, GC3Denum format, GC3Denum type, ArrayBufferView* pixels, NullDisposition) final;
+    bool validateCapability(const char* functionName, GC3Denum cap) final;
</ins><span class="cx"> };
</span><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_CANVASRENDERINGCONTEXT(WebCore::WebGLRenderingContext, isWebGL1())
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -2976,10 +2976,9 @@
</span><span class="cx">     m_context-&gt;stencilOpSeparate(face, fail, zfail, zpass);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContextBase::texImage2DBase(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels, ExceptionCode&amp; ec)
</del><ins>+void WebGLRenderingContextBase::texImage2DBase(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: For now we ignore any errors returned.
</span><del>-    ec = 0;
</del><span class="cx">     WebGLTexture* tex = validateTextureBinding(&quot;texImage2D&quot;, target, true);
</span><span class="cx">     ASSERT(validateTexFuncParameters(&quot;texImage2D&quot;, TexImage, target, level, internalformat, width, height, border, format, type));
</span><span class="cx">     ASSERT(tex);
</span><span class="lines">@@ -3011,9 +3010,8 @@
</span><span class="cx">     tex-&gt;setLevelInfo(target, level, internalformat, width, height, type);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContextBase::texImage2DImpl(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, Image* image, GraphicsContext3D::ImageHtmlDomSource domSource, bool flipY, bool premultiplyAlpha, ExceptionCode&amp; ec)
</del><ins>+void WebGLRenderingContextBase::texImage2DImpl(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, Image* image, GraphicsContext3D::ImageHtmlDomSource domSource, bool flipY, bool premultiplyAlpha)
</ins><span class="cx"> {
</span><del>-    ec = 0;
</del><span class="cx">     Vector&lt;uint8_t&gt; data;
</span><span class="cx">     GraphicsContext3D::ImageExtractor imageExtractor(image, domSource, premultiplyAlpha, m_unpackColorspaceConversion == GraphicsContext3D::NONE);
</span><span class="cx">     if (!imageExtractor.extractSucceeded()) {
</span><span class="lines">@@ -3036,7 +3034,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_unpackAlignment != 1)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1);
</span><del>-    texImage2DBase(target, level, internalformat, image-&gt;width(), image-&gt;height(), 0, format, type, needConversion ? data.data() : imagePixelData, ec);
</del><ins>+    texImage2DBase(target, level, internalformat, image-&gt;width(), image-&gt;height(), 0, format, type, needConversion ? data.data() : imagePixelData);
</ins><span class="cx">     if (m_unpackAlignment != 1)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
</span><span class="cx"> }
</span><span class="lines">@@ -3082,7 +3080,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContextBase::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp; pixels, ExceptionCode&amp; ec)
</del><ins>+void WebGLRenderingContextBase::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp; pixels)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending() || !validateTexFuncData(&quot;texImage2D&quot;, level, width, height, internalformat, format, type, pixels.get(), NullAllowed)
</span><span class="cx">         || !validateTexFunc(&quot;texImage2D&quot;, TexImage, SourceArrayBufferView, target, level, internalformat, width, height, border, format, type, 0, 0))
</span><span class="lines">@@ -3102,23 +3100,21 @@
</span><span class="cx">     }
</span><span class="cx">     if (changeUnpackAlignment)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1);
</span><del>-    texImage2DBase(target, level, internalformat, width, height, border,
-                   format, type, data, ec);
</del><ins>+    texImage2DBase(target, level, internalformat, width, height, border, format, type, data);
</ins><span class="cx">     if (changeUnpackAlignment)
</span><span class="cx">         m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContextBase::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, Optional&lt;TexImageSource&gt; source, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; WebGLRenderingContextBase::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, Optional&lt;TexImageSource&gt; source)
</ins><span class="cx"> {
</span><span class="cx">     if (!source) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_VALUE, &quot;texImage2D&quot;, &quot;source is null&quot;);
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto visitor = WTF::makeVisitor([&amp;](const RefPtr&lt;ImageData&gt;&amp; pixels) {
-        ec = 0;
</del><ins>+    auto visitor = WTF::makeVisitor([&amp;](const RefPtr&lt;ImageData&gt;&amp; pixels) -&gt; ExceptionOr&lt;void&gt; {
</ins><span class="cx">         if (isContextLostOrPending() || !validateTexFunc(&quot;texImage2D&quot;, TexImage, SourceImageData, target, level, internalformat, pixels-&gt;width(), pixels-&gt;height(), 0, format, type, 0, 0))
</span><del>-            return;
</del><ins>+            return { };
</ins><span class="cx">         Vector&lt;uint8_t&gt; data;
</span><span class="cx">         bool needConversion = true;
</span><span class="cx">         // The data from ImageData is always of format RGBA8.
</span><span class="lines">@@ -3128,36 +3124,39 @@
</span><span class="cx">         else {
</span><span class="cx">             if (!m_context-&gt;extractImageData(pixels.get(), format, type, m_unpackFlipY, m_unpackPremultiplyAlpha, data)) {
</span><span class="cx">                 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, &quot;texImage2D&quot;, &quot;bad image data&quot;);
</span><del>-                return;
</del><ins>+                return { };
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         if (m_unpackAlignment != 1)
</span><span class="cx">             m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1);
</span><del>-        texImage2DBase(target, level, internalformat, pixels-&gt;width(), pixels-&gt;height(), 0, format, type, needConversion ? data.data() : pixels-&gt;data()-&gt;data(), ec);
</del><ins>+        texImage2DBase(target, level, internalformat, pixels-&gt;width(), pixels-&gt;height(), 0, format, type, needConversion ? data.data() : pixels-&gt;data()-&gt;data());
</ins><span class="cx">         if (m_unpackAlignment != 1)
</span><span class="cx">             m_context-&gt;pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
</span><del>-    }, [&amp;](const RefPtr&lt;HTMLImageElement&gt;&amp; image) {
-        ec = 0;
-        if (isContextLostOrPending() || !validateHTMLImageElement(&quot;texImage2D&quot;, image.get(), ec))
-            return;
</del><ins>+        return { };
+    }, [&amp;](const RefPtr&lt;HTMLImageElement&gt;&amp; image) -&gt; ExceptionOr&lt;void&gt; {
+        if (wouldTaintOrigin(image.get()))
+            return Exception { SECURITY_ERR };
+        if (isContextLostOrPending() || !validateHTMLImageElement(&quot;texImage2D&quot;, image.get()))
+            return { };
</ins><span class="cx"> 
</span><span class="cx">         RefPtr&lt;Image&gt; imageForRender = image-&gt;cachedImage()-&gt;imageForRenderer(image-&gt;renderer());
</span><span class="cx">         if (!imageForRender)
</span><del>-            return;
</del><ins>+            return { };
</ins><span class="cx"> 
</span><span class="cx">         if (imageForRender-&gt;isSVGImage())
</span><span class="cx">             imageForRender = drawImageIntoBuffer(*imageForRender, image-&gt;width(), image-&gt;height(), 1);
</span><span class="cx"> 
</span><span class="cx">         if (!imageForRender || !validateTexFunc(&quot;texImage2D&quot;, TexImage, SourceHTMLImageElement, target, level, internalformat, imageForRender-&gt;width(), imageForRender-&gt;height(), 0, format, type, 0, 0))
</span><del>-            return;
</del><ins>+            return { };
</ins><span class="cx"> 
</span><del>-        texImage2DImpl(target, level, internalformat, format, type, imageForRender.get(), GraphicsContext3D::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
</del><ins>+        texImage2DImpl(target, level, internalformat, format, type, imageForRender.get(), GraphicsContext3D::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlpha);
+        return { };
+    }, [&amp;](const RefPtr&lt;HTMLCanvasElement&gt;&amp; canvas) -&gt; ExceptionOr&lt;void&gt; {
+        if (wouldTaintOrigin(canvas.get()))
+            return Exception { SECURITY_ERR };
+        if (isContextLostOrPending() || !validateHTMLCanvasElement(&quot;texImage2D&quot;, canvas.get()) || !validateTexFunc(&quot;texImage2D&quot;, TexImage, SourceHTMLCanvasElement, target, level, internalformat, canvas-&gt;width(), canvas-&gt;height(), 0, format, type, 0, 0))
+            return { };
</ins><span class="cx"> 
</span><del>-    }, [&amp;](const RefPtr&lt;HTMLCanvasElement&gt;&amp; canvas) {
-        ec = 0;
-        if (isContextLostOrPending() || !validateHTMLCanvasElement(&quot;texImage2D&quot;, canvas.get(), ec) || !validateTexFunc(&quot;texImage2D&quot;, TexImage, SourceHTMLCanvasElement, target, level, internalformat, canvas-&gt;width(), canvas-&gt;height(), 0, format, type, 0, 0))
-            return;
-
</del><span class="cx">         WebGLTexture* texture = validateTextureBinding(&quot;texImage2D&quot;, target, true);
</span><span class="cx">         // If possible, copy from the canvas element directly to the texture
</span><span class="cx">         // via the GPU, without a read-back to system memory.
</span><span class="lines">@@ -3171,20 +3170,22 @@
</span><span class="cx">             ImageBuffer* buffer = canvas-&gt;buffer();
</span><span class="cx">             if (buffer &amp;&amp; buffer-&gt;copyToPlatformTexture(*m_context.get(), target, texture-&gt;object(), internalformat, m_unpackPremultiplyAlpha, m_unpackFlipY)) {
</span><span class="cx">                 texture-&gt;setLevelInfo(target, level, internalformat, canvas-&gt;width(), canvas-&gt;height(), type);
</span><del>-                return;
</del><ins>+                return { };
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         RefPtr&lt;ImageData&gt; imageData = canvas-&gt;getImageData();
</span><span class="cx">         if (imageData)
</span><del>-            texImage2D(target, level, internalformat, format, type, TexImageSource(imageData.get()), ec);
</del><ins>+            texImage2D(target, level, internalformat, format, type, TexImageSource(imageData.get()));
</ins><span class="cx">         else
</span><del>-            texImage2DImpl(target, level, internalformat, format, type, canvas-&gt;copiedImage(), GraphicsContext3D::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
-    }, [&amp;](const RefPtr&lt;HTMLVideoElement&gt;&amp; video) {
-        ec = 0;
-        if (isContextLostOrPending() || !validateHTMLVideoElement(&quot;texImage2D&quot;, video.get(), ec)
</del><ins>+            texImage2DImpl(target, level, internalformat, format, type, canvas-&gt;copiedImage(), GraphicsContext3D::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha);
+        return { };
+    }, [&amp;](const RefPtr&lt;HTMLVideoElement&gt;&amp; video) -&gt; ExceptionOr&lt;void&gt; {
+        if (wouldTaintOrigin(video.get()))
+            return Exception { SECURITY_ERR };
+        if (isContextLostOrPending() || !validateHTMLVideoElement(&quot;texImage2D&quot;, video.get())
</ins><span class="cx">             || !validateTexFunc(&quot;texImage2D&quot;, TexImage, SourceHTMLVideoElement, target, level, internalformat, video-&gt;videoWidth(), video-&gt;videoHeight(), 0, format, type, 0, 0))
</span><del>-            return;
</del><ins>+            return { };
</ins><span class="cx"> 
</span><span class="cx">         // Go through the fast path doing a GPU-GPU textures copy without a readback to system memory if possible.
</span><span class="cx">         // Otherwise, it will fall back to the normal SW path.
</span><span class="lines">@@ -3198,7 +3199,7 @@
</span><span class="cx">             &amp;&amp; !level) {
</span><span class="cx">             if (video-&gt;copyVideoTextureToPlatformTexture(m_context.get(), texture-&gt;object(), target, level, internalformat, format, type, m_unpackPremultiplyAlpha, m_unpackFlipY)) {
</span><span class="cx">                 texture-&gt;setLevelInfo(target, level, internalformat, video-&gt;videoWidth(), video-&gt;videoHeight(), type);
</span><del>-                return;
</del><ins>+                return { };
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -3205,11 +3206,12 @@
</span><span class="cx">         // Normal pure SW path.
</span><span class="cx">         RefPtr&lt;Image&gt; image = videoFrameToImage(video.get(), ImageBuffer::fastCopyImageMode());
</span><span class="cx">         if (!image)
</span><del>-            return;
-        texImage2DImpl(target, level, internalformat, format, type, image.get(), GraphicsContext3D::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
</del><ins>+            return { };
+        texImage2DImpl(target, level, internalformat, format, type, image.get(), GraphicsContext3D::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha);
+        return { };
</ins><span class="cx">     });
</span><span class="cx"> 
</span><del>-    WTF::visit(visitor, source.value());
</del><ins>+    return WTF::visit(visitor, source.value());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;Image&gt; WebGLRenderingContextBase::drawImageIntoBuffer(Image&amp; image, int width, int height, int deviceScaleFactor)
</span><span class="lines">@@ -4472,7 +4474,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WebGLRenderingContextBase::validateHTMLImageElement(const char* functionName, HTMLImageElement* image, ExceptionCode&amp; ec)
</del><ins>+bool WebGLRenderingContextBase::validateHTMLImageElement(const char* functionName, HTMLImageElement* image)
</ins><span class="cx"> {
</span><span class="cx">     if (!image || !image-&gt;cachedImage()) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, &quot;no image&quot;);
</span><span class="lines">@@ -4483,39 +4485,29 @@
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, &quot;invalid image&quot;);
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><del>-    if (wouldTaintOrigin(image)) {
-        ec = SECURITY_ERR;
-        return false;
-    }
</del><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WebGLRenderingContextBase::validateHTMLCanvasElement(const char* functionName, HTMLCanvasElement* canvas, ExceptionCode&amp; ec)
</del><ins>+bool WebGLRenderingContextBase::validateHTMLCanvasElement(const char* functionName, HTMLCanvasElement* canvas)
</ins><span class="cx"> {
</span><span class="cx">     if (!canvas || !canvas-&gt;buffer()) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, &quot;no canvas&quot;);
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><del>-    if (wouldTaintOrigin(canvas)) {
-        ec = SECURITY_ERR;
-        return false;
-    }
</del><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-bool WebGLRenderingContextBase::validateHTMLVideoElement(const char* functionName, HTMLVideoElement* video, ExceptionCode&amp; ec)
</del><ins>+
+bool WebGLRenderingContextBase::validateHTMLVideoElement(const char* functionName, HTMLVideoElement* video)
</ins><span class="cx"> {
</span><span class="cx">     if (!video || !video-&gt;videoWidth() || !video-&gt;videoHeight()) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, &quot;no video&quot;);
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><del>-    if (wouldTaintOrigin(video)) {
-        ec = SECURITY_ERR;
-        return false;
-    }
</del><span class="cx">     return true;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void WebGLRenderingContextBase::vertexAttribfImpl(const char* functionName, GC3Duint index, GC3Dsizei expectedSize, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2, GC3Dfloat v3)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -23,8 +23,7 @@
</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 WebGLRenderingContextBase_h
-#define WebGLRenderingContextBase_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;ActiveDOMObject.h&quot;
</span><span class="cx"> #include &quot;CanvasRenderingContext.h&quot;
</span><span class="lines">@@ -37,8 +36,6 @@
</span><span class="cx"> #include &lt;memory&gt;
</span><span class="cx"> #include &lt;runtime/Float32Array.h&gt;
</span><span class="cx"> #include &lt;runtime/Int32Array.h&gt;
</span><del>-#include &lt;wtf/Variant.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -84,8 +81,6 @@
</span><span class="cx"> class WebGLUniformLocation;
</span><span class="cx"> class WebGLVertexArrayObjectOES;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> inline void clip1D(GC3Dint start, GC3Dsizei range, GC3Dsizei sourceRange, GC3Dint* clippedStart, GC3Dsizei* clippedRange)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(clippedStart &amp;&amp; clippedRange);
</span><span class="lines">@@ -200,8 +195,8 @@
</span><span class="cx">     RefPtr&lt;WebGLContextAttributes&gt; getContextAttributes();
</span><span class="cx">     GC3Denum getError();
</span><span class="cx">     virtual WebGLExtension* getExtension(const String&amp; name) = 0;
</span><del>-    virtual WebGLGetInfo getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname, ExceptionCode&amp;) = 0;
-    virtual WebGLGetInfo getParameter(GC3Denum pname, ExceptionCode&amp;) = 0;
</del><ins>+    virtual WebGLGetInfo getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname) = 0;
+    virtual WebGLGetInfo getParameter(GC3Denum pname) = 0;
</ins><span class="cx">     WebGLGetInfo getProgramParameter(WebGLProgram*, GC3Denum pname);
</span><span class="cx">     String getProgramInfoLog(WebGLProgram*);
</span><span class="cx">     WebGLGetInfo getRenderbufferParameter(GC3Denum target, GC3Denum pname);
</span><span class="lines">@@ -243,26 +238,20 @@
</span><span class="cx">     void stencilOp(GC3Denum fail, GC3Denum zfail, GC3Denum zpass);
</span><span class="cx">     void stencilOpSeparate(GC3Denum face, GC3Denum fail, GC3Denum zfail, GC3Denum zpass);
</span><span class="cx"> 
</span><del>-    void texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp;, ExceptionCode&amp;);
</del><ins>+    void texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     using TexImageSource = WTF::Variant&lt;RefPtr&lt;ImageData&gt;, RefPtr&lt;HTMLImageElement&gt;, RefPtr&lt;HTMLCanvasElement&gt;, RefPtr&lt;HTMLVideoElement&gt;&gt;;
</span><del>-    void texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, Optional&lt;TexImageSource&gt;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, Optional&lt;TexImageSource&gt;);
</ins><span class="cx"> 
</span><span class="cx">     void texParameterf(GC3Denum target, GC3Denum pname, GC3Dfloat param);
</span><span class="cx">     void texParameteri(GC3Denum target, GC3Denum pname, GC3Dint param);
</span><span class="cx"> 
</span><del>-    virtual void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Dsizei width, GC3Dsizei height,
-        GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp;, ExceptionCode&amp;) = 0;
-    virtual void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Denum format, GC3Denum type, ImageData*, ExceptionCode&amp;) = 0;
-    virtual void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Denum format, GC3Denum type, HTMLImageElement*, ExceptionCode&amp;) = 0;
-    virtual void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Denum format, GC3Denum type, HTMLCanvasElement*, ExceptionCode&amp;) = 0;
</del><ins>+    virtual void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp;) = 0;
+    virtual void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, ImageData*) = 0;
+    virtual ExceptionOr&lt;void&gt; texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLImageElement*) = 0;
+    virtual ExceptionOr&lt;void&gt; texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLCanvasElement*) = 0;
</ins><span class="cx"> #if ENABLE(VIDEO)
</span><del>-    virtual void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset,
-        GC3Denum format, GC3Denum type, HTMLVideoElement*, ExceptionCode&amp;) = 0;
</del><ins>+    virtual ExceptionOr&lt;void&gt; texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, HTMLVideoElement*) = 0;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void uniform1f(const WebGLUniformLocation*, GC3Dfloat x);
</span><span class="lines">@@ -602,10 +591,10 @@
</span><span class="cx">     // Helper to restore state that clearing the framebuffer may destroy.
</span><span class="cx">     void restoreStateAfterClear();
</span><span class="cx"> 
</span><del>-    void texImage2DBase(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels, ExceptionCode&amp;);
-    void texImage2DImpl(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, Image*, GraphicsContext3D::ImageHtmlDomSource, bool flipY, bool premultiplyAlpha, ExceptionCode&amp;);
-    virtual void texSubImage2DBase(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum internalformat, GC3Denum format, GC3Denum type, const void* pixels, ExceptionCode&amp;) = 0;
-    virtual void texSubImage2DImpl(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Image*, GraphicsContext3D::ImageHtmlDomSource, bool flipY, bool premultiplyAlpha, ExceptionCode&amp;) = 0;
</del><ins>+    void texImage2DBase(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels);
+    void texImage2DImpl(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, Image*, GraphicsContext3D::ImageHtmlDomSource, bool flipY, bool premultiplyAlpha);
+    virtual void texSubImage2DBase(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum internalformat, GC3Denum format, GC3Denum type, const void* pixels) = 0;
+    virtual void texSubImage2DImpl(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Image*, GraphicsContext3D::ImageHtmlDomSource, bool flipY, bool premultiplyAlpha) = 0;
</ins><span class="cx"> 
</span><span class="cx">     bool checkTextureCompleteness(const char*, bool);
</span><span class="cx"> 
</span><span class="lines">@@ -758,15 +747,11 @@
</span><span class="cx">     // Return the current bound buffer to target, or 0 if parameters are invalid.
</span><span class="cx">     WebGLBuffer* validateBufferDataParameters(const char* functionName, GC3Denum target, GC3Denum usage);
</span><span class="cx"> 
</span><del>-    // Helper function for tex{Sub}Image2D to make sure image is ready and wouldn't taint Origin.
-    bool validateHTMLImageElement(const char* functionName, HTMLImageElement*, ExceptionCode&amp;);
-
-    // Helper function for tex{Sub}Image2D to make sure canvas is ready and wouldn't taint Origin.
-    bool validateHTMLCanvasElement(const char* functionName, HTMLCanvasElement*, ExceptionCode&amp;);
-
</del><ins>+    // Helper function for tex{Sub}Image2D to make sure image is ready.
+    bool validateHTMLImageElement(const char* functionName, HTMLImageElement*);
+    bool validateHTMLCanvasElement(const char* functionName, HTMLCanvasElement*);
</ins><span class="cx"> #if ENABLE(VIDEO)
</span><del>-    // Helper function for tex{Sub}Image2D to make sure video is ready wouldn't taint Origin.
-    bool validateHTMLVideoElement(const char* functionName, HTMLVideoElement*, ExceptionCode&amp;);
</del><ins>+    bool validateHTMLVideoElement(const char* functionName, HTMLVideoElement*);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // Helper functions for vertexAttribNf{v}.
</span><span class="lines">@@ -793,19 +778,13 @@
</span><span class="cx">     // Helper for restoration after context lost.
</span><span class="cx">     void maybeRestoreContext();
</span><span class="cx"> 
</span><del>-    enum ConsoleDisplayPreference {
-        DisplayInConsole,
-        DontDisplayInConsole
-    };
-
-    // Wrapper for GraphicsContext3D::synthesizeGLError that sends a message
-    // to the JavaScript console.
</del><ins>+    // Wrapper for GraphicsContext3D::synthesizeGLError that sends a message to the JavaScript console.
+    enum ConsoleDisplayPreference { DisplayInConsole, DontDisplayInConsole };
</ins><span class="cx">     void synthesizeGLError(GC3Denum, const char* functionName, const char* description, ConsoleDisplayPreference = DisplayInConsole);
</span><span class="cx"> 
</span><span class="cx">     String ensureNotNull(const String&amp;) const;
</span><span class="cx"> 
</span><del>-    // Enable or disable stencil test based on user setting and
-    // whether the current FBO has a stencil buffer.
</del><ins>+    // Enable or disable stencil test based on user setting and whether the current FBO has a stencil buffer.
</ins><span class="cx">     void applyStencilTest();
</span><span class="cx"> 
</span><span class="cx">     // Helper for enabling or disabling a capability.
</span><span class="lines">@@ -829,5 +808,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_CANVASRENDERINGCONTEXT(WebCore::WebGLRenderingContextBase, is3d())
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -23,18 +23,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><del>-typedef unsigned long  GLenum;
</del><ins>+typedef unsigned long GLenum;
</ins><span class="cx"> typedef boolean GLboolean;
</span><del>-typedef unsigned long  GLbitfield;
-typedef byte   GLbyte; /* 'byte' should be a signed 8 bit type. */
-typedef short  GLshort;
-typedef long   GLint;
-typedef long   GLsizei;
-typedef long long  GLintptr;
-typedef long long  GLsizeiptr;
-typedef octet  GLubyte; /* 'octet' should be an unsigned 8 bit type. */
</del><ins>+typedef unsigned long GLbitfield;
+typedef byte GLbyte; /* 'byte' should be a signed 8 bit type. */
+typedef short GLshort;
+typedef long GLint;
+typedef long GLsizei;
+typedef long long GLintptr;
+typedef long long GLsizeiptr;
+typedef octet GLubyte; /* 'octet' should be an unsigned 8 bit type. */
</ins><span class="cx"> typedef unsigned short GLushort;
</span><del>-typedef unsigned long  GLuint;
</del><ins>+typedef unsigned long GLuint;
</ins><span class="cx"> typedef unrestricted float GLfloat;
</span><span class="cx"> typedef unrestricted float GLclampf;
</span><span class="cx"> typedef (ArrayBuffer or ArrayBufferView) BufferDataSource;
</span><span class="lines">@@ -545,7 +545,7 @@
</span><span class="cx">     WebGLActiveInfo getActiveAttrib(WebGLProgram? program, GLuint index);
</span><span class="cx">     WebGLActiveInfo getActiveUniform(WebGLProgram? program, GLuint index);
</span><span class="cx"> 
</span><del>-    [Custom, MayThrowLegacyException] void getAttachedShaders(WebGLProgram? program);
</del><ins>+    [Custom] void getAttachedShaders(WebGLProgram? program);
</ins><span class="cx"> 
</span><span class="cx">     GLint getAttribLocation(WebGLProgram? program, DOMString name);
</span><span class="cx"> 
</span><span class="lines">@@ -558,12 +558,12 @@
</span><span class="cx">     // object getExtension(DOMString name);
</span><span class="cx">     [Custom] any getExtension(DOMString name);
</span><span class="cx"> 
</span><del>-    [Custom, MayThrowLegacyException] any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname);
-    [Custom, MayThrowLegacyException] any getParameter(GLenum pname);
-    [Custom, MayThrowLegacyException] any getProgramParameter(WebGLProgram? program, GLenum pname);
</del><ins>+    [Custom] any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname);
+    [Custom] any getParameter(GLenum pname);
+    [Custom] any getProgramParameter(WebGLProgram? program, GLenum pname);
</ins><span class="cx">     DOMString? getProgramInfoLog(WebGLProgram? program);
</span><del>-    [Custom, MayThrowLegacyException] any getRenderbufferParameter(GLenum target, GLenum pname);
-    [Custom, MayThrowLegacyException] any getShaderParameter(WebGLShader? shader, GLenum pname);
</del><ins>+    [Custom] any getRenderbufferParameter(GLenum target, GLenum pname);
+    [Custom] any getShaderParameter(WebGLShader? shader, GLenum pname);
</ins><span class="cx"> 
</span><span class="cx">     DOMString? getShaderInfoLog(WebGLShader? shader);
</span><span class="cx"> 
</span><span class="lines">@@ -573,13 +573,13 @@
</span><span class="cx"> 
</span><span class="cx">     [Custom] sequence&lt;DOMString&gt; getSupportedExtensions();
</span><span class="cx"> 
</span><del>-    [Custom, MayThrowLegacyException] any getTexParameter(GLenum target, GLenum pname);
</del><ins>+    [Custom] any getTexParameter(GLenum target, GLenum pname);
</ins><span class="cx"> 
</span><del>-    [Custom, MayThrowLegacyException] any getUniform(WebGLProgram? program, WebGLUniformLocation? location);
</del><ins>+    [Custom] any getUniform(WebGLProgram? program, WebGLUniformLocation? location);
</ins><span class="cx"> 
</span><span class="cx">     WebGLUniformLocation getUniformLocation(WebGLProgram? program, DOMString name);
</span><span class="cx"> 
</span><del>-    [Custom, MayThrowLegacyException] any getVertexAttrib(GLuint index, GLenum pname);
</del><ins>+    [Custom] any getVertexAttrib(GLuint index, GLenum pname);
</ins><span class="cx"> 
</span><span class="cx">     GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname);
</span><span class="cx"> 
</span><span class="lines">@@ -615,43 +615,35 @@
</span><span class="cx">     void texParameteri(GLenum target, GLenum pname, GLint param);
</span><span class="cx"> 
</span><span class="cx">     // Supported forms:
</span><del>-    [MayThrowLegacyException] void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels);
-    [MayThrowLegacyException] void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, TexImageSource? source);
</del><ins>+    void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels);
+    [MayThrowException] void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, TexImageSource? source);
</ins><span class="cx"> 
</span><del>-    [MayThrowLegacyException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type, ArrayBufferView? pixels);
-    [MayThrowLegacyException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLenum format, GLenum type, ImageData? pixels);
-    [MayThrowLegacyException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLenum format, GLenum type, HTMLImageElement? image);
-    [MayThrowLegacyException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLenum format, GLenum type, HTMLCanvasElement? canvas);
-#if defined(ENABLE_VIDEO) &amp;&amp; ENABLE_VIDEO
-    [MayThrowLegacyException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLenum format, GLenum type, HTMLVideoElement? video);
-#endif
</del><ins>+    void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView? pixels);
+    void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, ImageData? pixels);
+    [MayThrowException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLImageElement? image);
+    [MayThrowException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLCanvasElement? canvas);
+    [Conditional=VIDEO, MayThrowException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLVideoElement? video);
</ins><span class="cx"> 
</span><span class="cx">     void uniform1f(WebGLUniformLocation? location, GLfloat x);
</span><del>-    [Custom, MayThrowLegacyException] void uniform1fv(WebGLUniformLocation? location, Float32Array v);
</del><ins>+    [Custom] void uniform1fv(WebGLUniformLocation? location, Float32Array v);
</ins><span class="cx">     void uniform1i(WebGLUniformLocation? location, GLint x);
</span><del>-    [Custom, MayThrowLegacyException] void uniform1iv(WebGLUniformLocation? location, Int32Array v);
</del><ins>+    [Custom] void uniform1iv(WebGLUniformLocation? location, Int32Array v);
</ins><span class="cx">     void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
</span><del>-    [Custom, MayThrowLegacyException] void uniform2fv(WebGLUniformLocation? location, Float32Array v);
</del><ins>+    [Custom] void uniform2fv(WebGLUniformLocation? location, Float32Array v);
</ins><span class="cx">     void uniform2i(WebGLUniformLocation? location, GLint x, GLint y);
</span><del>-    [Custom, MayThrowLegacyException] void uniform2iv(WebGLUniformLocation? location, Int32Array v);
</del><ins>+    [Custom] void uniform2iv(WebGLUniformLocation? location, Int32Array v);
</ins><span class="cx">     void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z);
</span><del>-    [Custom, MayThrowLegacyException] void uniform3fv(WebGLUniformLocation? location, Float32Array v);
</del><ins>+    [Custom] void uniform3fv(WebGLUniformLocation? location, Float32Array v);
</ins><span class="cx">     void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
</span><del>-    [Custom, MayThrowLegacyException] void uniform3iv(WebGLUniformLocation? location, Int32Array v);
</del><ins>+    [Custom] void uniform3iv(WebGLUniformLocation? location, Int32Array v);
</ins><span class="cx">     void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
</span><del>-    [Custom, MayThrowLegacyException] void uniform4fv(WebGLUniformLocation? location, Float32Array v);
</del><ins>+    [Custom] void uniform4fv(WebGLUniformLocation? location, Float32Array v);
</ins><span class="cx">     void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
</span><del>-    [Custom, MayThrowLegacyException] void uniform4iv(WebGLUniformLocation? location, Int32Array v);
</del><ins>+    [Custom] void uniform4iv(WebGLUniformLocation? location, Int32Array v);
</ins><span class="cx"> 
</span><del>-    [Custom, MayThrowLegacyException] void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
-    [Custom, MayThrowLegacyException] void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
-    [Custom, MayThrowLegacyException] void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
</del><ins>+    [Custom] void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
+    [Custom] void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
+    [Custom] void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
</ins><span class="cx"> 
</span><span class="cx">     void useProgram(WebGLProgram? program);
</span><span class="cx">     void validateProgram(WebGLProgram? program);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowMediaControlElementscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -1172,7 +1172,7 @@
</span><span class="cx"> 
</span><span class="cx">         LOG(Media, &quot;MediaControlTextTrackContainerElement::updateDisplay(%p) - adding and positioning cue #%zu: \&quot;%s\&quot;, start=%.2f, end=%.2f, line=%.2f&quot;, this, i, cue-&gt;text().utf8().data(), cue-&gt;startTime(), cue-&gt;endTime(), cue-&gt;line());
</span><span class="cx"> 
</span><del>-        RefPtr&lt;VTTCueBox&gt; displayBox = cue-&gt;getDisplayTree(m_videoDisplaySize.size(), m_fontSize);
</del><ins>+        Ref&lt;VTTCueBox&gt; displayBox = cue-&gt;getDisplayTree(m_videoDisplaySize.size(), m_fontSize);
</ins><span class="cx">         if (cue-&gt;track()-&gt;mode() == TextTrack::Mode::Disabled)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="lines">@@ -1181,9 +1181,9 @@
</span><span class="cx">             // If cue has an empty text track cue region identifier or there is no
</span><span class="cx">             // WebVTT region whose region identifier is identical to cue's text
</span><span class="cx">             // track cue region identifier, run the following substeps:
</span><del>-            if (displayBox-&gt;hasChildNodes() &amp;&amp; !contains(displayBox.get())) {
</del><ins>+            if (displayBox-&gt;hasChildNodes() &amp;&amp; !contains(displayBox.ptr())) {
</ins><span class="cx">                 // Note: the display tree of a cue is removed when the active flag of the cue is unset.
</span><del>-                appendChild(*displayBox, ASSERT_NO_EXCEPTION);
</del><ins>+                appendChild(displayBox, ASSERT_NO_EXCEPTION);
</ins><span class="cx">                 cue-&gt;setFontSize(m_fontSize, m_videoDisplaySize.size(), m_fontSizeIsImportant);
</span><span class="cx">             }
</span><span class="cx">         } else {
</span><span class="lines">@@ -1195,7 +1195,7 @@
</span><span class="cx">             if (!contains(regionNode.ptr()))
</span><span class="cx">                 appendChild(region-&gt;getDisplayTree());
</span><span class="cx"> 
</span><del>-            region-&gt;appendTextTrackCueBox(displayBox);
</del><ins>+            region-&gt;appendTextTrackCueBox(WTFMove(displayBox));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackDataCueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/DataCue.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/DataCue.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/DataCue.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -24,8 +24,7 @@
</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 DataCue_h
-#define DataCue_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="lines">@@ -114,4 +113,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackDataCueidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/DataCue.idl (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/DataCue.idl        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/DataCue.idl        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> #else
</span><span class="cx">     CustomConstructor(unrestricted double startTime, unrestricted double endTime, ArrayBuffer data),
</span><span class="cx"> #endif
</span><del>-    ConstructorMayThrowLegacyException,
</del><ins>+    ConstructorMayThrowException,
</ins><span class="cx"> ] interface DataCue : TextTrackCue {
</span><span class="cx">     attribute ArrayBuffer data;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandDataTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -25,9 +25,9 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;InbandDataTextTrack.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><del>-#include &quot;InbandDataTextTrack.h&quot;
</del><span class="cx"> 
</span><span class="cx"> #include &quot;DataCue.h&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><span class="lines">@@ -38,12 +38,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-Ref&lt;InbandDataTextTrack&gt; InbandDataTextTrack::create(ScriptExecutionContext* context, TextTrackClient* client, PassRefPtr&lt;InbandTextTrackPrivate&gt; playerPrivate)
</del><ins>+Ref&lt;InbandDataTextTrack&gt; InbandDataTextTrack::create(ScriptExecutionContext* context, TextTrackClient* client, RefPtr&lt;InbandTextTrackPrivate&gt;&amp;&amp; trackPrivate)
</ins><span class="cx"> {
</span><del>-    return adoptRef(*new InbandDataTextTrack(context, client, playerPrivate));
</del><ins>+    return adoptRef(*new InbandDataTextTrack(context, client, WTFMove(trackPrivate)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-InbandDataTextTrack::InbandDataTextTrack(ScriptExecutionContext* context, TextTrackClient* client, PassRefPtr&lt;InbandTextTrackPrivate&gt; trackPrivate)
</del><ins>+InbandDataTextTrack::InbandDataTextTrack(ScriptExecutionContext* context, TextTrackClient* client, RefPtr&lt;InbandTextTrackPrivate&gt;&amp;&amp; trackPrivate)
</ins><span class="cx">     : InbandTextTrack(context, client, trackPrivate)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -54,11 +54,11 @@
</span><span class="cx"> 
</span><span class="cx"> void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, const void* data, unsigned length)
</span><span class="cx"> {
</span><del>-    auto cue = DataCue::create(*scriptExecutionContext(), start, end, data, length);
-    addCue(WTFMove(cue), ASSERT_NO_EXCEPTION);
</del><ins>+    addCue(DataCue::create(*scriptExecutionContext(), start, end, data, length));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><ins>+
</ins><span class="cx"> void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt; prpPlatformValue, const String&amp; type)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;SerializedPlatformRepresentation&gt; platformValue = prpPlatformValue;
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">         m_incompleteCueMap.add(WTFMove(platformValue), cue.copyRef());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    addCue(WTFMove(cue), ASSERT_NO_EXCEPTION);
</del><ins>+    addCue(WTFMove(cue));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InbandDataTextTrack::updateDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; inEnd, PassRefPtr&lt;SerializedPlatformRepresentation&gt; prpPlatformValue)
</span><span class="lines">@@ -117,20 +117,17 @@
</span><span class="cx">     RefPtr&lt;DataCue&gt; cue = iter-&gt;value;
</span><span class="cx">     if (cue) {
</span><span class="cx">         LOG(Media, &quot;InbandDataTextTrack::removeDataCue removing cue: start=%s, end=%s\n&quot;, toString(cue-&gt;startTime()).utf8().data(), toString(cue-&gt;endTime()).utf8().data());
</span><del>-        removeCue(cue.get(), IGNORE_EXCEPTION);
</del><ins>+        removeCue(cue.get());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandDataTextTrack::removeCue(TextTrackCue* cue, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; InbandDataTextTrack::removeCue(TextTrackCue* cue)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(cue-&gt;cueType() == TextTrackCue::Data);
</span><span class="cx"> 
</span><del>-    SerializedPlatformRepresentation* platformValue = const_cast&lt;SerializedPlatformRepresentation*&gt;(toDataCue(cue)-&gt;platformValue());
-    auto iter = m_incompleteCueMap.find(platformValue);
-    if (iter != m_incompleteCueMap.end())
-        m_incompleteCueMap.remove(platformValue);
</del><ins>+    m_incompleteCueMap.remove(const_cast&lt;SerializedPlatformRepresentation*&gt;(toDataCue(cue)-&gt;platformValue()));
</ins><span class="cx"> 
</span><del>-    InbandTextTrack::removeCue(cue, ec);
</del><ins>+    return InbandTextTrack::removeCue(cue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandDataTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandDataTextTrack.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandDataTextTrack.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/InbandDataTextTrack.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -24,39 +24,33 @@
</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 InbandDataTextTrack_h
-#define InbandDataTextTrack_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;InbandTextTrack.h&quot;
</span><del>-#include &lt;wtf/RefPtr.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class DataCue;
</span><del>-class Document;
</del><span class="cx"> class InbandTextTrackPrivate;
</span><del>-
-#if ENABLE(DATACUE_VALUE)
</del><span class="cx"> class SerializedPlatformRepresentation;
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> class InbandDataTextTrack final : public InbandTextTrack {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;InbandDataTextTrack&gt; create(ScriptExecutionContext*, TextTrackClient*, PassRefPtr&lt;InbandTextTrackPrivate&gt;);
</del><ins>+    static Ref&lt;InbandDataTextTrack&gt; create(ScriptExecutionContext*, TextTrackClient*, RefPtr&lt;InbandTextTrackPrivate&gt;&amp;&amp;);
</ins><span class="cx">     virtual ~InbandDataTextTrack();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    InbandDataTextTrack(ScriptExecutionContext*, TextTrackClient*, PassRefPtr&lt;InbandTextTrackPrivate&gt;);
</del><ins>+    InbandDataTextTrack(ScriptExecutionContext*, TextTrackClient*, RefPtr&lt;InbandTextTrackPrivate&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><del>-    void addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, const void*, unsigned) override;
</del><ins>+    void addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, const void*, unsigned) final;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>-    void addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;, const String&amp;) override;
-    void updateDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;) override;
-    void removeDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;) override;
-    void removeCue(TextTrackCue*, ExceptionCode&amp;) override;
</del><ins>+    void addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;, const String&amp;) final;
+    void updateDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;) final;
+    void removeDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;) final;
+    ExceptionOr&lt;void&gt; removeCue(TextTrackCue*) final;
</ins><span class="cx"> 
</span><span class="cx">     HashMap&lt;RefPtr&lt;SerializedPlatformRepresentation&gt;, RefPtr&lt;DataCue&gt;&gt; m_incompleteCueMap;
</span><span class="cx"> #endif
</span><span class="lines">@@ -65,4 +59,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandGenericTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -24,11 +24,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;InbandGenericTextTrack.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><del>-#include &quot;InbandGenericTextTrack.h&quot;
-
</del><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><span class="cx"> #include &quot;HTMLMediaElement.h&quot;
</span><span class="cx"> #include &quot;InbandTextTrackPrivate.h&quot;
</span><span class="lines">@@ -37,57 +36,34 @@
</span><span class="cx"> #include &lt;math.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-GenericTextTrackCueMap::GenericTextTrackCueMap()
</del><ins>+void GenericTextTrackCueMap::add(GenericCueData&amp; cueData, TextTrackCueGeneric&amp; cue)
</ins><span class="cx"> {
</span><ins>+    m_dataToCueMap.add(&amp;cueData, &amp;cue);
+    m_cueToDataMap.add(&amp;cue, &amp;cueData);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-GenericTextTrackCueMap::~GenericTextTrackCueMap()
</del><ins>+TextTrackCueGeneric* GenericTextTrackCueMap::find(GenericCueData&amp; cueData)
</ins><span class="cx"> {
</span><ins>+    return m_dataToCueMap.get(&amp;cueData);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void GenericTextTrackCueMap::add(GenericCueData* cueData, TextTrackCueGeneric* cue)
</del><ins>+GenericCueData* GenericTextTrackCueMap::find(TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><del>-    m_dataToCueMap.add(cueData, cue);
-    m_cueToDataMap.add(cue, cueData);
</del><ins>+    return m_cueToDataMap.get(&amp;cue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;TextTrackCueGeneric&gt; GenericTextTrackCueMap::find(GenericCueData* cueData)
</del><ins>+void GenericTextTrackCueMap::remove(GenericCueData&amp; cueData)
</ins><span class="cx"> {
</span><del>-    CueDataToCueMap::iterator iter = m_dataToCueMap.find(cueData);
-    if (iter == m_dataToCueMap.end())
-        return 0;
-
-    return iter-&gt;value;
-}
-
-PassRefPtr&lt;GenericCueData&gt; GenericTextTrackCueMap::find(TextTrackCue* cue)
-{
-    CueToDataMap::iterator iter = m_cueToDataMap.find(cue);
-    if (iter == m_cueToDataMap.end())
-        return 0;
-
-    return iter-&gt;value;
-}
-
-void GenericTextTrackCueMap::remove(GenericCueData* cueData)
-{
-    RefPtr&lt;TextTrackCueGeneric&gt; cue = find(cueData);
-
-    if (cue)
</del><ins>+    if (auto cue = m_dataToCueMap.take(&amp;cueData))
</ins><span class="cx">         m_cueToDataMap.remove(cue);
</span><del>-    m_dataToCueMap.remove(cueData);
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void GenericTextTrackCueMap::remove(TextTrackCue* cue)
</del><ins>+void GenericTextTrackCueMap::remove(TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;GenericCueData&gt; genericData = find(cue);
-    if (genericData) {
-        m_dataToCueMap.remove(genericData);
-        m_cueToDataMap.remove(cue);
-    }
</del><ins>+    if (auto data = m_cueToDataMap.take(&amp;cue))
+        m_dataToCueMap.remove(data);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;InbandGenericTextTrack&gt; InbandGenericTextTrack::create(ScriptExecutionContext* context, TextTrackClient* client, PassRefPtr&lt;InbandTextTrackPrivate&gt; playerPrivate)
</span><span class="lines">@@ -120,11 +96,11 @@
</span><span class="cx">     cue-&gt;setFontName(cueData-&gt;fontName());
</span><span class="cx"> 
</span><span class="cx">     if (cueData-&gt;position() &gt; 0)
</span><del>-        cue-&gt;setPosition(lround(cueData-&gt;position()), IGNORE_EXCEPTION);
</del><ins>+        cue-&gt;setPosition(std::round(cueData-&gt;position()));
</ins><span class="cx">     if (cueData-&gt;line() &gt; 0)
</span><del>-        cue-&gt;setLine(lround(cueData-&gt;line()), IGNORE_EXCEPTION);
</del><ins>+        cue-&gt;setLine(std::round(cueData-&gt;line()));
</ins><span class="cx">     if (cueData-&gt;size() &gt; 0)
</span><del>-        cue-&gt;setSize(lround(cueData-&gt;size()), IGNORE_EXCEPTION);
</del><ins>+        cue-&gt;setSize(std::round(cueData-&gt;size()));
</ins><span class="cx">     if (cueData-&gt;backgroundColor().isValid())
</span><span class="cx">         cue-&gt;setBackgroundColor(cueData-&gt;backgroundColor().rgb());
</span><span class="cx">     if (cueData-&gt;foregroundColor().isValid())
</span><span class="lines">@@ -133,11 +109,11 @@
</span><span class="cx">         cue-&gt;setHighlightColor(cueData-&gt;highlightColor().rgb());
</span><span class="cx"> 
</span><span class="cx">     if (cueData-&gt;align() == GenericCueData::Start)
</span><del>-        cue-&gt;setAlign(ASCIILiteral(&quot;start&quot;), IGNORE_EXCEPTION);
</del><ins>+        cue-&gt;setAlign(ASCIILiteral(&quot;start&quot;));
</ins><span class="cx">     else if (cueData-&gt;align() == GenericCueData::Middle)
</span><del>-        cue-&gt;setAlign(ASCIILiteral(&quot;middle&quot;), IGNORE_EXCEPTION);
</del><ins>+        cue-&gt;setAlign(ASCIILiteral(&quot;middle&quot;));
</ins><span class="cx">     else if (cueData-&gt;align() == GenericCueData::End)
</span><del>-        cue-&gt;setAlign(ASCIILiteral(&quot;end&quot;), IGNORE_EXCEPTION);
</del><ins>+        cue-&gt;setAlign(ASCIILiteral(&quot;end&quot;));
</ins><span class="cx">     cue-&gt;setSnapToLines(false);
</span><span class="cx"> 
</span><span class="cx">     cue-&gt;didChange();
</span><span class="lines">@@ -148,7 +124,7 @@
</span><span class="cx">     ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;GenericCueData&gt; cueData = prpCueData;
</span><del>-    if (m_cueMap.find(cueData.get()))
</del><ins>+    if (m_cueMap.find(*cueData))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;TextTrackCueGeneric&gt; cue = TextTrackCueGeneric::create(*scriptExecutionContext(), cueData-&gt;startTime(), cueData-&gt;endTime(), cueData-&gt;content());
</span><span class="lines">@@ -161,39 +137,40 @@
</span><span class="cx">     LOG(Media, &quot;InbandGenericTextTrack::addGenericCue added cue: start=%.2f, end=%.2f, content=\&quot;%s\&quot;\n&quot;, cueData-&gt;startTime().toDouble(), cueData-&gt;endTime().toDouble(), cueData-&gt;content().utf8().data());
</span><span class="cx"> 
</span><span class="cx">     if (cueData-&gt;status() != GenericCueData::Complete)
</span><del>-        m_cueMap.add(cueData.get(), cue.get());
</del><ins>+        m_cueMap.add(*cueData, *cue);
</ins><span class="cx"> 
</span><del>-    addCue(cue, ASSERT_NO_EXCEPTION);
</del><ins>+    addCue(WTFMove(cue));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InbandGenericTextTrack::updateGenericCue(InbandTextTrackPrivate*, GenericCueData* cueData)
</span><span class="cx"> {
</span><del>-    RefPtr&lt;TextTrackCueGeneric&gt; cue = m_cueMap.find(cueData);
</del><ins>+    auto* cue = m_cueMap.find(*cueData);
</ins><span class="cx">     if (!cue)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    updateCueFromCueData(cue.get(), cueData);
</del><ins>+    updateCueFromCueData(cue, cueData);
</ins><span class="cx"> 
</span><span class="cx">     if (cueData-&gt;status() == GenericCueData::Complete)
</span><del>-        m_cueMap.remove(cueData);
</del><ins>+        m_cueMap.remove(*cueData);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InbandGenericTextTrack::removeGenericCue(InbandTextTrackPrivate*, GenericCueData* cueData)
</span><span class="cx"> {
</span><del>-    RefPtr&lt;TextTrackCueGeneric&gt; cue = m_cueMap.find(cueData);
</del><ins>+    auto* cue = m_cueMap.find(*cueData);
</ins><span class="cx">     if (cue) {
</span><span class="cx">         LOG(Media, &quot;InbandGenericTextTrack::removeGenericCue removing cue: start=%s, end=%s, content=\&quot;%s\&quot;\n&quot;,  toString(cueData-&gt;startTime()).utf8().data(), toString(cueData-&gt;endTime()).utf8().data(), cueData-&gt;content().utf8().data());
</span><del>-        removeCue(cue.get(), IGNORE_EXCEPTION);
</del><ins>+        removeCue(cue);
</ins><span class="cx">     } else {
</span><span class="cx">         LOG(Media, &quot;InbandGenericTextTrack::removeGenericCue UNABLE to find cue: start=%.2f, end=%.2f, content=\&quot;%s\&quot;\n&quot;, cueData-&gt;startTime().toDouble(), cueData-&gt;endTime().toDouble(), cueData-&gt;content().utf8().data());
</span><del>-        m_cueMap.remove(cueData);
</del><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandGenericTextTrack::removeCue(TextTrackCue* cue, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; InbandGenericTextTrack::removeCue(TextTrackCue* cue)
</ins><span class="cx"> {
</span><del>-    m_cueMap.remove(cue);
-    TextTrack::removeCue(cue, ec);
</del><ins>+    auto result = TextTrack::removeCue(cue);
+    if (!result.hasException() &amp;&amp; cue)
+        m_cueMap.remove(*cue);
+    return result;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebVTTParser&amp; InbandGenericTextTrack::parser()
</span><span class="lines">@@ -227,7 +204,7 @@
</span><span class="cx">             LOG(Media, &quot;InbandGenericTextTrack::newCuesParsed ignoring already added cue: start=%.2f, end=%.2f, content=\&quot;%s\&quot;\n&quot;, vttCue-&gt;startTime(), vttCue-&gt;endTime(), vttCue-&gt;text().utf8().data());
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        addCue(WTFMove(vttCue), ASSERT_NO_EXCEPTION);
</del><ins>+        addCue(WTFMove(vttCue));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandGenericTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandGenericTextTrack.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandGenericTextTrack.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/InbandGenericTextTrack.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -23,8 +23,7 @@
</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 InbandGenericTextTrack_h
-#define InbandGenericTextTrack_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="lines">@@ -31,30 +30,25 @@
</span><span class="cx"> #include &quot;InbandTextTrack.h&quot;
</span><span class="cx"> #include &quot;TextTrackCueGeneric.h&quot;
</span><span class="cx"> #include &quot;WebVTTParser.h&quot;
</span><del>-#include &lt;wtf/RefPtr.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Document;
</span><span class="cx"> class InbandTextTrackPrivate;
</span><del>-class TextTrackCue;
</del><span class="cx"> 
</span><del>-class GenericTextTrackCueMap final {
</del><ins>+class GenericTextTrackCueMap {
</ins><span class="cx"> public:
</span><del>-    GenericTextTrackCueMap();
-    ~GenericTextTrackCueMap();
</del><ins>+    void add(GenericCueData&amp;, TextTrackCueGeneric&amp;);
</ins><span class="cx"> 
</span><del>-    void add(GenericCueData*, TextTrackCueGeneric*);
</del><ins>+    void remove(TextTrackCue&amp;);
+    void remove(GenericCueData&amp;);
</ins><span class="cx"> 
</span><del>-    void remove(TextTrackCue*);
-    void remove(GenericCueData*);
</del><ins>+    GenericCueData* find(TextTrackCue&amp;);
+    TextTrackCueGeneric* find(GenericCueData&amp;);
</ins><span class="cx"> 
</span><del>-    PassRefPtr&lt;GenericCueData&gt; find(TextTrackCue*);
-    PassRefPtr&lt;TextTrackCueGeneric&gt; find(GenericCueData*);
-
</del><span class="cx"> private:
</span><del>-    typedef HashMap&lt;RefPtr&lt;TextTrackCue&gt;, RefPtr&lt;GenericCueData&gt;&gt; CueToDataMap;
-    typedef HashMap&lt;RefPtr&lt;GenericCueData&gt;, RefPtr&lt;TextTrackCueGeneric&gt;&gt; CueDataToCueMap;
</del><ins>+    using CueToDataMap = HashMap&lt;RefPtr&lt;TextTrackCue&gt;, RefPtr&lt;GenericCueData&gt;&gt;;
+    using CueDataToCueMap = HashMap&lt;RefPtr&lt;GenericCueData&gt;, RefPtr&lt;TextTrackCueGeneric&gt;&gt;;
</ins><span class="cx"> 
</span><span class="cx">     CueToDataMap m_cueToDataMap;
</span><span class="cx">     CueDataToCueMap m_dataToCueMap;
</span><span class="lines">@@ -68,21 +62,21 @@
</span><span class="cx"> private:
</span><span class="cx">     InbandGenericTextTrack(ScriptExecutionContext*, TextTrackClient*, PassRefPtr&lt;InbandTextTrackPrivate&gt;);
</span><span class="cx"> 
</span><del>-    void addGenericCue(InbandTextTrackPrivate*, PassRefPtr&lt;GenericCueData&gt;) override;
-    void updateGenericCue(InbandTextTrackPrivate*, GenericCueData*) override;
-    void removeGenericCue(InbandTextTrackPrivate*, GenericCueData*) override;
-    void removeCue(TextTrackCue*, ExceptionCode&amp;) override;
</del><ins>+    void addGenericCue(InbandTextTrackPrivate*, PassRefPtr&lt;GenericCueData&gt;) final;
+    void updateGenericCue(InbandTextTrackPrivate*, GenericCueData*) final;
+    void removeGenericCue(InbandTextTrackPrivate*, GenericCueData*) final;
+    ExceptionOr&lt;void&gt; removeCue(TextTrackCue*) final;
</ins><span class="cx"> 
</span><span class="cx">     PassRefPtr&lt;TextTrackCueGeneric&gt; createCue(PassRefPtr&lt;GenericCueData&gt;);
</span><span class="cx">     void updateCueFromCueData(TextTrackCueGeneric*, GenericCueData*);
</span><span class="cx"> 
</span><span class="cx">     WebVTTParser&amp; parser();
</span><del>-    void parseWebVTTCueData(InbandTextTrackPrivate*, const ISOWebVTTCue&amp;) override;
-    void parseWebVTTFileHeader(InbandTextTrackPrivate*, String) override;
</del><ins>+    void parseWebVTTCueData(InbandTextTrackPrivate*, const ISOWebVTTCue&amp;) final;
+    void parseWebVTTFileHeader(InbandTextTrackPrivate*, String) final;
</ins><span class="cx"> 
</span><del>-    void newCuesParsed() override;
-    void newRegionsParsed() override;
-    void fileFailedToParse() override;
</del><ins>+    void newCuesParsed() final;
+    void newRegionsParsed() final;
+    void fileFailedToParse() final;
</ins><span class="cx"> 
</span><span class="cx">     GenericTextTrackCueMap m_cueMap;
</span><span class="cx">     std::unique_ptr&lt;WebVTTParser&gt; m_webVTTParser;
</span><span class="lines">@@ -91,4 +85,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandWebVTTTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">             LOG(Media, &quot;InbandWebVTTTextTrack::newCuesParsed ignoring already added cue: start=%.2f, end=%.2f, content=\&quot;%s\&quot;\n&quot;, vttCue-&gt;startTime(), vttCue-&gt;endTime(), vttCue-&gt;text().utf8().data());
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        addCue(WTFMove(vttCue), ASSERT_NO_EXCEPTION);
</del><ins>+        addCue(WTFMove(vttCue));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/TextTrack.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011, 2013 Google Inc.  All rights reserved.
- * Copyright (C) 2011-2014 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011, 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2011-2014 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">@@ -85,13 +85,13 @@
</span><span class="cx"> 
</span><span class="cx"> TextTrack* TextTrack::captionMenuOffItem()
</span><span class="cx"> {
</span><del>-    static TextTrack&amp; off = TextTrack::create(0, 0, &quot;off menu item&quot;, emptyAtom, emptyAtom, emptyAtom).leakRef();
</del><ins>+    static TextTrack&amp; off = TextTrack::create(nullptr, nullptr, &quot;off menu item&quot;, emptyAtom, emptyAtom, emptyAtom).leakRef();
</ins><span class="cx">     return &amp;off;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TextTrack* TextTrack::captionMenuAutomaticItem()
</span><span class="cx"> {
</span><del>-    static TextTrack&amp; automatic = TextTrack::create(0, 0, &quot;automatic menu item&quot;, emptyAtom, emptyAtom, emptyAtom).leakRef();
</del><ins>+    static TextTrack&amp; automatic = TextTrack::create(nullptr, nullptr, &quot;automatic menu item&quot;, emptyAtom, emptyAtom, emptyAtom).leakRef();
</ins><span class="cx">     return &amp;automatic;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -290,13 +290,11 @@
</span><span class="cx">     return m_cues-&gt;activeCues();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextTrack::addCue(PassRefPtr&lt;TextTrackCue&gt; prpCue, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; TextTrack::addCue(RefPtr&lt;TextTrackCue&gt;&amp;&amp; cue)
</ins><span class="cx"> {
</span><del>-    if (!prpCue)
-        return;
</del><ins>+    if (!cue)
+        return { };
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;TextTrackCue&gt; cue = prpCue;
-
</del><span class="cx">     // 4.7.10.12.6 Text tracks exposing in-band metadata
</span><span class="cx">     // The UA will use DataCue to expose only text track cue objects that belong to a text track that has a text
</span><span class="cx">     // track kind of metadata.
</span><span class="lines">@@ -303,14 +301,12 @@
</span><span class="cx">     // If a DataCue is added to a TextTrack via the addCue() method but the text track does not have its text
</span><span class="cx">     // track kind set to metadata, throw a InvalidNodeTypeError exception and don't add the cue to the TextTrackList
</span><span class="cx">     // of the TextTrack.
</span><del>-    if (cue-&gt;cueType() == TextTrackCue::Data &amp;&amp; m_kind != Kind::Metadata) {
-        ec = INVALID_NODE_TYPE_ERR;
-        return;
-    }
</del><ins>+    if (cue-&gt;cueType() == TextTrackCue::Data &amp;&amp; m_kind != Kind::Metadata)
+        return Exception { INVALID_NODE_TYPE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     // TODO(93143): Add spec-compliant behavior for negative time values.
</span><span class="cx">     if (!cue-&gt;startMediaTime().isValid() || !cue-&gt;endMediaTime().isValid() || cue-&gt;startMediaTime() &lt; MediaTime::zeroTime() || cue-&gt;endMediaTime() &lt; MediaTime::zeroTime())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     // 4.8.10.12.5 Text track API
</span><span class="cx"> 
</span><span class="lines">@@ -320,7 +316,7 @@
</span><span class="cx">     // list of cues.
</span><span class="cx">     TextTrack* cueTrack = cue-&gt;track();
</span><span class="cx">     if (cueTrack &amp;&amp; cueTrack != this)
</span><del>-        cueTrack-&gt;removeCue(cue.get(), ASSERT_NO_EXCEPTION);
</del><ins>+        cueTrack-&gt;removeCue(cue.get());
</ins><span class="cx"> 
</span><span class="cx">     // 2. Add cue to the method's TextTrack object's text track's text track list of cues.
</span><span class="cx">     cue-&gt;setTrack(this);
</span><span class="lines">@@ -328,12 +324,14 @@
</span><span class="cx">     
</span><span class="cx">     if (m_client)
</span><span class="cx">         m_client-&gt;textTrackAddCue(this, *cue);
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextTrack::removeCue(TextTrackCue* cue, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; TextTrack::removeCue(TextTrackCue* cue)
</ins><span class="cx"> {
</span><span class="cx">     if (!cue)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     // 4.8.10.12.5 Text track API
</span><span class="cx"> 
</span><span class="lines">@@ -341,20 +339,18 @@
</span><span class="cx"> 
</span><span class="cx">     // 1. If the given cue is not currently listed in the method's TextTrack 
</span><span class="cx">     // object's text track's text track list of cues, then throw a NotFoundError exception.
</span><del>-    if (cue-&gt;track() != this) {
-        ec = NOT_FOUND_ERR;
-        return;
-    }
</del><ins>+    if (cue-&gt;track() != this)
+        return Exception { NOT_FOUND_ERR };
</ins><span class="cx"> 
</span><span class="cx">     // 2. Remove cue from the method's TextTrack object's text track's text track list of cues.
</span><del>-    if (!m_cues || !m_cues-&gt;remove(cue)) {
-        ec = INVALID_STATE_ERR;
-        return;
-    }
</del><ins>+    if (!m_cues || !m_cues-&gt;remove(cue))
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><del>-    cue-&gt;setTrack(0);
</del><ins>+    cue-&gt;setTrack(nullptr);
</ins><span class="cx">     if (m_client)
</span><span class="cx">         m_client-&gt;textTrackRemoveCue(this, *cue);
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> VTTRegionList&amp; TextTrack::ensureVTTRegionList()
</span><span class="lines">@@ -378,27 +374,26 @@
</span><span class="cx">     return &amp;ensureVTTRegionList();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextTrack::addRegion(PassRefPtr&lt;VTTRegion&gt; prpRegion)
</del><ins>+void TextTrack::addRegion(RefPtr&lt;VTTRegion&gt;&amp;&amp; region)
</ins><span class="cx"> {
</span><del>-    if (!prpRegion)
</del><ins>+    if (!region)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;VTTRegion&gt; region = prpRegion;
-    VTTRegionList&amp; regionList = ensureVTTRegionList();
</del><ins>+    auto&amp; regionList = ensureVTTRegionList();
</ins><span class="cx"> 
</span><span class="cx">     // 1. If the given region is in a text track list of regions, then remove
</span><span class="cx">     // region from that text track list of regions.
</span><del>-    TextTrack* regionTrack = region-&gt;track();
</del><ins>+    auto* regionTrack = region-&gt;track();
</ins><span class="cx">     if (regionTrack &amp;&amp; regionTrack != this)
</span><del>-        regionTrack-&gt;removeRegion(region.get(), ASSERT_NO_EXCEPTION);
</del><ins>+        regionTrack-&gt;removeRegion(region.get());
</ins><span class="cx"> 
</span><span class="cx">     // 2. If the method's TextTrack object's text track list of regions contains
</span><span class="cx">     // a region with the same identifier as region replace the values of that
</span><span class="cx">     // region's width, height, anchor point, viewport anchor point and scroll
</span><span class="cx">     // attributes with those of region.
</span><del>-    VTTRegion* existingRegion = regionList.getRegionById(region-&gt;id());
</del><ins>+    auto* existingRegion = regionList.getRegionById(region-&gt;id());
</ins><span class="cx">     if (existingRegion) {
</span><del>-        existingRegion-&gt;updateParametersFromRegion(region.get());
</del><ins>+        existingRegion-&gt;updateParametersFromRegion(*region);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -405,27 +400,24 @@
</span><span class="cx">     // Otherwise: add region to the method's TextTrack object's text track
</span><span class="cx">     // list of regions.
</span><span class="cx">     region-&gt;setTrack(this);
</span><del>-    regionList.add(region);
</del><ins>+    regionList.add(WTFMove(region));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextTrack::removeRegion(VTTRegion* region, ExceptionCode &amp;ec)
</del><ins>+ExceptionOr&lt;void&gt; TextTrack::removeRegion(VTTRegion* region)
</ins><span class="cx"> {
</span><span class="cx">     if (!region)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     // 1. If the given region is not currently listed in the method's TextTrack
</span><span class="cx">     // object's text track list of regions, then throw a NotFoundError exception.
</span><del>-    if (region-&gt;track() != this) {
-        ec = NOT_FOUND_ERR;
-        return;
-    }
</del><ins>+    if (region-&gt;track() != this)
+        return Exception { NOT_FOUND_ERR };
</ins><span class="cx"> 
</span><del>-    if (!m_regions || !m_regions-&gt;remove(region)) {
-        ec = INVALID_STATE_ERR;
-        return;
-    }
</del><ins>+    if (!m_regions || !m_regions-&gt;remove(region))
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><del>-    region-&gt;setTrack(0);
</del><ins>+    region-&gt;setTrack(nullptr);
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TextTrack::cueWillChange(TextTrackCue* cue)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/TextTrack.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -100,14 +100,14 @@
</span><span class="cx">     void clearClient() override { m_client = nullptr; }
</span><span class="cx">     TextTrackClient* client() { return m_client; }
</span><span class="cx"> 
</span><del>-    void addCue(PassRefPtr&lt;TextTrackCue&gt;, ExceptionCode&amp;);
-    virtual void removeCue(TextTrackCue*, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; addCue(RefPtr&lt;TextTrackCue&gt;&amp;&amp;);
+    virtual ExceptionOr&lt;void&gt; removeCue(TextTrackCue*);
</ins><span class="cx"> 
</span><span class="cx">     bool hasCue(TextTrackCue*, TextTrackCue::CueMatchRules = TextTrackCue::MatchAllFields);
</span><span class="cx"> 
</span><span class="cx">     VTTRegionList* regions();
</span><del>-    void addRegion(PassRefPtr&lt;VTTRegion&gt;);
-    void removeRegion(VTTRegion*, ExceptionCode&amp;);
</del><ins>+    void addRegion(RefPtr&lt;VTTRegion&gt;&amp;&amp;);
+    ExceptionOr&lt;void&gt; removeRegion(VTTRegion*);
</ins><span class="cx"> 
</span><span class="cx">     void cueWillChange(TextTrackCue*);
</span><span class="cx">     void cueDidChange(TextTrackCue*);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.idl (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.idl        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/TextTrack.idl        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -44,8 +44,8 @@
</span><span class="cx">     readonly attribute TextTrackCueList? activeCues;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: cue parameter should not be nullable in addCue and removeCue.
</span><del>-    [MayThrowLegacyException] void addCue(TextTrackCue? cue);
-    [MayThrowLegacyException] void removeCue(TextTrackCue? cue);
</del><ins>+    [MayThrowException] void addCue(TextTrackCue? cue);
+    [MayThrowException] void removeCue(TextTrackCue? cue);
</ins><span class="cx"> 
</span><span class="cx">     attribute EventHandler oncuechange;
</span><span class="cx"> 
</span><span class="lines">@@ -52,5 +52,5 @@
</span><span class="cx">     readonly attribute VTTRegionList regions;
</span><span class="cx">     // FIXME: region parameter should not be nullable in addRegion and removeRegion.
</span><span class="cx">     void addRegion(VTTRegion? region);
</span><del>-    [MayThrowLegacyException] void removeRegion(VTTRegion? region);
</del><ins>+    [MayThrowException] void removeRegion(VTTRegion? region);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCue.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCue.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/TextTrackCue.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -54,6 +54,12 @@
</span><span class="cx"> 
</span><span class="cx"> static const int invalidCueIndex = -1;
</span><span class="cx"> 
</span><ins>+const AtomicString&amp; TextTrackCue::cueShadowPseudoId()
+{
+    static NeverDestroyed&lt;const AtomicString&gt; cue(&quot;cue&quot;, AtomicString::ConstructFromLiteral);
+    return cue;
+}
+
</ins><span class="cx"> TextTrackCue::TextTrackCue(ScriptExecutionContext&amp; context, const MediaTime&amp; start, const MediaTime&amp; end)
</span><span class="cx">     : m_startTime(start)
</span><span class="cx">     , m_endTime(end)
</span><span class="lines">@@ -67,10 +73,6 @@
</span><span class="cx">     ASSERT(m_scriptExecutionContext.isDocument());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-TextTrackCue::~TextTrackCue()
-{
-}
-
</del><span class="cx"> void TextTrackCue::willChange()
</span><span class="cx"> {
</span><span class="cx">     if (++m_processingCueChanges &gt; 1)
</span><span class="lines">@@ -110,14 +112,8 @@
</span><span class="cx">     didChange();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextTrackCue::setStartTime(double value, ExceptionCode&amp; ec)
</del><ins>+void TextTrackCue::setStartTime(double value)
</ins><span class="cx"> {
</span><del>-    // NaN, Infinity and -Infinity values should trigger a TypeError.
-    if (std::isinf(value) || std::isnan(value)) {
-        ec = TypeError;
-        return;
-    }
-    
</del><span class="cx">     // TODO(93143): Add spec-compliant behavior for negative time values.
</span><span class="cx">     if (m_startTime.toDouble() == value || value &lt; 0)
</span><span class="cx">         return;
</span><span class="lines">@@ -132,14 +128,8 @@
</span><span class="cx">     didChange();
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-void TextTrackCue::setEndTime(double value, ExceptionCode&amp; ec)
</del><ins>+void TextTrackCue::setEndTime(double value)
</ins><span class="cx"> {
</span><del>-    // NaN, Infinity and -Infinity values should trigger a TypeError.
-    if (std::isinf(value) || std::isnan(value)) {
-        ec = TypeError;
-        return;
-    }
-
</del><span class="cx">     // TODO(93143): Add spec-compliant behavior for negative time values.
</span><span class="cx">     if (m_endTime.toDouble() == value || value &lt; 0)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCue.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCue.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/TextTrackCue.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Google Inc.  All rights reserved.
- * Copyright (C) 2012, 2013, 2014 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2012, 2013, 2014 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">@@ -29,16 +29,12 @@
</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 TextTrackCue_h
-#define TextTrackCue_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><del>-#include &quot;EventTarget.h&quot;
-#include &quot;HTMLElement.h&quot;
</del><ins>+#include &quot;Document.h&quot;
</ins><span class="cx"> #include &lt;wtf/MediaTime.h&gt;
</span><del>-#include &lt;wtf/NeverDestroyed.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -46,14 +42,8 @@
</span><span class="cx"> 
</span><span class="cx"> class TextTrackCue : public RefCounted&lt;TextTrackCue&gt;, public EventTargetWithInlineData {
</span><span class="cx"> public:
</span><del>-    static const AtomicString&amp; cueShadowPseudoId()
-    {
-        static NeverDestroyed&lt;const AtomicString&gt; cue(&quot;cue&quot;, AtomicString::ConstructFromLiteral);
-        return cue;
-    }
</del><ins>+    static const AtomicString&amp; cueShadowPseudoId();
</ins><span class="cx"> 
</span><del>-    virtual ~TextTrackCue();
-
</del><span class="cx">     TextTrack* track() const;
</span><span class="cx">     void setTrack(TextTrack*);
</span><span class="cx"> 
</span><span class="lines">@@ -60,57 +50,48 @@
</span><span class="cx">     const String&amp; id() const { return m_id; }
</span><span class="cx">     void setId(const String&amp;);
</span><span class="cx"> 
</span><del>-    MediaTime startMediaTime() const { return m_startTime; }
</del><span class="cx">     double startTime() const { return startMediaTime().toDouble(); }
</span><del>-    void setStartTime(const MediaTime&amp;);
-    void setStartTime(double, ExceptionCode&amp;);
</del><ins>+    void setStartTime(double);
</ins><span class="cx"> 
</span><del>-    MediaTime endMediaTime() const { return m_endTime; }
</del><span class="cx">     double endTime() const { return endMediaTime().toDouble(); }
</span><del>-    void setEndTime(const MediaTime&amp;);
-    void setEndTime(double, ExceptionCode&amp;);
</del><ins>+    void setEndTime(double);
</ins><span class="cx"> 
</span><span class="cx">     bool pauseOnExit() const { return m_pauseOnExit; }
</span><span class="cx">     void setPauseOnExit(bool);
</span><span class="cx"> 
</span><ins>+    MediaTime startMediaTime() const { return m_startTime; }
+    void setStartTime(const MediaTime&amp;);
+
+    MediaTime endMediaTime() const { return m_endTime; }
+    void setEndTime(const MediaTime&amp;);
+
</ins><span class="cx">     int cueIndex();
</span><span class="cx">     void invalidateCueIndex();
</span><span class="cx"> 
</span><del>-    using EventTarget::dispatchEvent;
-    bool dispatchEvent(Event&amp;) override;
-
</del><span class="cx">     bool isActive();
</span><span class="cx">     virtual void setIsActive(bool);
</span><span class="cx"> 
</span><del>-    EventTargetInterface eventTargetInterface() const final { return TextTrackCueEventTargetInterfaceType; }
-    ScriptExecutionContext* scriptExecutionContext() const final { return &amp;m_scriptExecutionContext; }
-
</del><span class="cx">     virtual bool isOrderedBefore(const TextTrackCue*) const;
</span><span class="cx">     virtual bool isPositionedAbove(const TextTrackCue* cue) const { return isOrderedBefore(cue); }
</span><span class="cx"> 
</span><span class="cx">     bool hasEquivalentStartTime(const TextTrackCue&amp;) const;
</span><span class="cx"> 
</span><del>-    enum CueType {
-        Data,
-        Generic,
-        WebVTT
-    };
</del><ins>+    enum CueType { Data, Generic, WebVTT };
</ins><span class="cx">     virtual CueType cueType() const = 0;
</span><span class="cx">     virtual bool isRenderable() const { return false; }
</span><span class="cx"> 
</span><del>-    enum CueMatchRules {
-        MatchAllFields,
-        IgnoreDuration,
-    };
</del><ins>+    enum CueMatchRules { MatchAllFields, IgnoreDuration };
</ins><span class="cx">     virtual bool isEqual(const TextTrackCue&amp;, CueMatchRules) const;
</span><ins>+private:
</ins><span class="cx">     virtual bool cueContentsMatch(const TextTrackCue&amp;) const;
</span><ins>+public:
</ins><span class="cx">     virtual bool doesExtendCue(const TextTrackCue&amp;) const;
</span><span class="cx"> 
</span><span class="cx">     void willChange();
</span><span class="cx">     virtual void didChange();
</span><span class="cx"> 
</span><del>-    using RefCounted&lt;TextTrackCue&gt;::ref;
-    using RefCounted&lt;TextTrackCue&gt;::deref;
</del><ins>+    using RefCounted::ref;
+    using RefCounted::deref;
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     TextTrackCue(ScriptExecutionContext&amp;, const MediaTime&amp; start, const MediaTime&amp; end);
</span><span class="lines">@@ -118,10 +99,15 @@
</span><span class="cx">     Document&amp; ownerDocument() { return downcast&lt;Document&gt;(m_scriptExecutionContext); }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-
</del><span class="cx">     void refEventTarget() final { ref(); }
</span><span class="cx">     void derefEventTarget() final { deref(); }
</span><span class="cx"> 
</span><ins>+    using EventTarget::dispatchEvent;
+    bool dispatchEvent(Event&amp;) final;
+
+    EventTargetInterface eventTargetInterface() const final { return TextTrackCueEventTargetInterfaceType; }
+    ScriptExecutionContext* scriptExecutionContext() const final { return &amp;m_scriptExecutionContext; }
+
</ins><span class="cx">     String m_id;
</span><span class="cx">     MediaTime m_startTime;
</span><span class="cx">     MediaTime m_endTime;
</span><span class="lines">@@ -139,4 +125,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCueidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCue.idl (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCue.idl        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/TextTrackCue.idl        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Google Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011 Google 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
</span><span class="lines">@@ -25,19 +25,18 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=VIDEO_TRACK,
</span><del>-    JSCustomMarkFunction,
</del><span class="cx">     CustomIsReachable,
</span><span class="cx">     CustomToJSObject,
</span><ins>+    JSCustomMarkFunction,
</ins><span class="cx">     SkipVTableValidation,
</span><span class="cx"> ] interface TextTrackCue : EventTarget {
</span><span class="cx">     readonly attribute TextTrack track;
</span><span class="cx"> 
</span><span class="cx">     attribute DOMString id;
</span><del>-    [SetterMayThrowLegacyException] attribute unrestricted double startTime;
-    [SetterMayThrowLegacyException] attribute unrestricted double endTime;
</del><ins>+    attribute double startTime;
+    attribute double endTime;
</ins><span class="cx">     attribute boolean pauseOnExit;
</span><span class="cx"> 
</span><span class="cx">     attribute EventHandler onenter;
</span><span class="cx">     attribute EventHandler onexit;
</span><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCueGenericcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx">     setInlineStyleProperty(CSSPropertyUnicodeBidi, CSSValueWebkitPlaintext);
</span><span class="cx">     
</span><span class="cx">     TextTrackCueGeneric* cue = static_cast&lt;TextTrackCueGeneric*&gt;(getCue());
</span><del>-    RefPtr&lt;HTMLSpanElement&gt; cueElement = cue-&gt;element();
</del><ins>+    Ref&lt;HTMLSpanElement&gt; cueElement = cue-&gt;element();
</ins><span class="cx"> 
</span><span class="cx">     CSSValueID alignment = cue-&gt;getCSSAlignment();
</span><span class="cx">     float size = static_cast&lt;float&gt;(cue-&gt;getCSSSize());
</span><span class="lines">@@ -148,25 +148,28 @@
</span><span class="cx">     : VTTCue(context, start, end, content)
</span><span class="cx">     , m_baseFontSizeRelativeToVideoHeight(0)
</span><span class="cx">     , m_fontSizeMultiplier(0)
</span><del>-    , m_defaultPosition(true)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;VTTCueBox&gt; TextTrackCueGeneric::createDisplayTree()
</del><ins>+Ref&lt;VTTCueBox&gt; TextTrackCueGeneric::createDisplayTree()
</ins><span class="cx"> {
</span><span class="cx">     return TextTrackCueGenericBoxElement::create(ownerDocument(), *this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextTrackCueGeneric::setLine(double line, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; TextTrackCueGeneric::setLine(double line)
</ins><span class="cx"> {
</span><del>-    m_defaultPosition = false;
-    VTTCue::setLine(line, ec);
</del><ins>+    auto result = VTTCue::setLine(line);
+    if (!result.hasException())
+        m_useDefaultPosition = false;
+    return result;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextTrackCueGeneric::setPosition(double position, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; TextTrackCueGeneric::setPosition(double position)
</ins><span class="cx"> {
</span><del>-    m_defaultPosition = false;
-    VTTCue::setPosition(position, ec);
</del><ins>+    auto result = VTTCue::setPosition(position);
+    if (!result.hasException())
+        m_useDefaultPosition = false;
+    return result;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TextTrackCueGeneric::setFontSize(int fontSize, const IntSize&amp; videoSize, bool important)
</span><span class="lines">@@ -182,7 +185,7 @@
</span><span class="cx">     double size = videoSize.height() * baseFontSizeRelativeToVideoHeight() / 100;
</span><span class="cx">     if (fontSizeMultiplier())
</span><span class="cx">         size *= fontSizeMultiplier() / 100;
</span><del>-    displayTreeInternal()-&gt;setInlineStyleProperty(CSSPropertyFontSize, lround(size), CSSPrimitiveValue::CSS_PX);
</del><ins>+    displayTreeInternal().setInlineStyleProperty(CSSPropertyFontSize, lround(size), CSSPrimitiveValue::CSS_PX);
</ins><span class="cx"> 
</span><span class="cx">     LOG(Media, &quot;TextTrackCueGeneric::setFontSize - setting cue font size to %li&quot;, lround(size));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCueGenerich"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCueGeneric.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCueGeneric.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/TextTrackCueGeneric.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -23,8 +23,7 @@
</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 TextTrackCueGeneric_h
-#define TextTrackCueGeneric_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="lines">@@ -42,16 +41,12 @@
</span><span class="cx">     {
</span><span class="cx">         return adoptRef(*new TextTrackCueGeneric(context, start, end, content));
</span><span class="cx">     }
</span><del>-    
-    virtual ~TextTrackCueGeneric() { }
</del><span class="cx"> 
</span><del>-    PassRefPtr&lt;VTTCueBox&gt; createDisplayTree() override;
</del><ins>+    ExceptionOr&lt;void&gt; setLine(double) final;
+    ExceptionOr&lt;void&gt; setPosition(double) final;
</ins><span class="cx"> 
</span><del>-    void setLine(double, ExceptionCode&amp;) override;
-    void setPosition(double, ExceptionCode&amp;) override;
</del><ins>+    bool useDefaultPosition() const { return m_useDefaultPosition; }
</ins><span class="cx"> 
</span><del>-    bool useDefaultPosition() const { return m_defaultPosition; }
-    
</del><span class="cx">     double baseFontSizeRelativeToVideoHeight() const { return m_baseFontSizeRelativeToVideoHeight; }
</span><span class="cx">     void setBaseFontSizeRelativeToVideoHeight(double size) { m_baseFontSizeRelativeToVideoHeight = size; }
</span><span class="cx"> 
</span><span class="lines">@@ -58,42 +53,43 @@
</span><span class="cx">     double fontSizeMultiplier() const { return m_fontSizeMultiplier; }
</span><span class="cx">     void setFontSizeMultiplier(double size) { m_fontSizeMultiplier = size; }
</span><span class="cx"> 
</span><del>-    String fontName() const { return m_fontName; }
-    void setFontName(String name) { m_fontName = name; }
</del><ins>+    const String&amp; fontName() const { return m_fontName; }
+    void setFontName(const String&amp; name) { m_fontName = name; }
</ins><span class="cx"> 
</span><span class="cx">     const Color&amp; foregroundColor() const { return m_foregroundColor; }
</span><del>-    void setForegroundColor(Color color) { m_foregroundColor = color; }
</del><ins>+    void setForegroundColor(const Color&amp; color) { m_foregroundColor = color; }
</ins><span class="cx">     
</span><span class="cx">     const Color&amp; backgroundColor() const { return m_backgroundColor; }
</span><del>-    void setBackgroundColor(Color color) { m_backgroundColor = color; }
</del><ins>+    void setBackgroundColor(const Color&amp; color) { m_backgroundColor = color; }
</ins><span class="cx">     
</span><span class="cx">     const Color&amp; highlightColor() const { return m_highlightColor; }
</span><del>-    void setHighlightColor(Color color) { m_highlightColor = color; }
</del><ins>+    void setHighlightColor(const Color&amp; color) { m_highlightColor = color; }
+
+    void setFontSize(int, const IntSize&amp;, bool important) final;
+
+private:
+    TextTrackCueGeneric(ScriptExecutionContext&amp;, const MediaTime&amp; start, const MediaTime&amp; end, const String&amp;);
</ins><span class="cx">     
</span><del>-    void setFontSize(int, const IntSize&amp;, bool important) override;
</del><ins>+    bool isOrderedBefore(const TextTrackCue*) const final;
+    bool isPositionedAbove(const TextTrackCue*) const final;
</ins><span class="cx"> 
</span><del>-    bool isEqual(const TextTrackCue&amp;, CueMatchRules) const override;
-    bool cueContentsMatch(const TextTrackCue&amp;) const override;
-    bool doesExtendCue(const TextTrackCue&amp;) const override;
</del><ins>+    Ref&lt;VTTCueBox&gt; createDisplayTree() final;
</ins><span class="cx"> 
</span><del>-    TextTrackCue::CueType cueType() const override { return TextTrackCue::Generic; }
</del><ins>+    bool isEqual(const TextTrackCue&amp;, CueMatchRules) const final;
+    bool cueContentsMatch(const TextTrackCue&amp;) const final;
+    bool doesExtendCue(const TextTrackCue&amp;) const final;
</ins><span class="cx"> 
</span><del>-private:
-    bool isOrderedBefore(const TextTrackCue*) const override;
-    bool isPositionedAbove(const TextTrackCue*) const override;
</del><ins>+    CueType cueType() const final { return Generic; }
</ins><span class="cx"> 
</span><del>-    TextTrackCueGeneric(ScriptExecutionContext&amp;, const MediaTime&amp; start, const MediaTime&amp; end, const String&amp;);
-    
</del><span class="cx">     Color m_foregroundColor;
</span><span class="cx">     Color m_backgroundColor;
</span><span class="cx">     Color m_highlightColor;
</span><del>-    double m_baseFontSizeRelativeToVideoHeight;
-    double m_fontSizeMultiplier;
</del><ins>+    double m_baseFontSizeRelativeToVideoHeight { 0 };
+    double m_fontSizeMultiplier { 0 };
</ins><span class="cx">     String m_fontName;
</span><del>-    bool m_defaultPosition;
</del><ins>+    bool m_useDefaultPosition { true };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTCuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTCue.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTCue.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/VTTCue.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -292,16 +292,16 @@
</span><span class="cx">     m_originalStartTime = MediaTime::zeroTime();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;VTTCueBox&gt; VTTCue::createDisplayTree()
</del><ins>+Ref&lt;VTTCueBox&gt; VTTCue::createDisplayTree()
</ins><span class="cx"> {
</span><span class="cx">     return VTTCueBox::create(ownerDocument(), *this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-VTTCueBox* VTTCue::displayTreeInternal()
</del><ins>+VTTCueBox&amp; VTTCue::displayTreeInternal()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_displayTree)
</span><span class="cx">         m_displayTree = createDisplayTree();
</span><del>-    return m_displayTree.get();
</del><ins>+    return *m_displayTree;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void VTTCue::didChange()
</span><span class="lines">@@ -325,7 +325,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTCue::setVertical(const String&amp; value, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; VTTCue::setVertical(const String&amp; value)
</ins><span class="cx"> {
</span><span class="cx">     // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-vertical
</span><span class="cx">     // On setting, the text track cue writing direction must be set to the value given 
</span><span class="lines">@@ -341,14 +341,16 @@
</span><span class="cx">     else if (value == verticalGrowingRightKeyword())
</span><span class="cx">         direction = VerticalGrowingRight;
</span><span class="cx">     else
</span><del>-        ec = SYNTAX_ERR;
</del><ins>+        return Exception { SYNTAX_ERR };
</ins><span class="cx">     
</span><span class="cx">     if (direction == m_writingDirection)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     willChange();
</span><span class="cx">     m_writingDirection = direction;
</span><span class="cx">     didChange();
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void VTTCue::setSnapToLines(bool value)
</span><span class="lines">@@ -361,62 +363,62 @@
</span><span class="cx">     didChange();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTCue::setLine(double position, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; VTTCue::setLine(double position)
</ins><span class="cx"> {
</span><span class="cx">     // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-line
</span><span class="cx">     // On setting, if the text track cue snap-to-lines flag is not set, and the new
</span><span class="cx">     // value is negative or greater than 100, then throw an IndexSizeError exception.
</span><del>-    if (!m_snapToLines &amp;&amp; (position &lt; 0 || position &gt; 100)) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
</del><ins>+    if (!m_snapToLines &amp;&amp; !(position &gt;= 0 &amp;&amp; position &lt;= 100))
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     // Otherwise, set the text track cue line position to the new value.
</span><span class="cx">     if (m_linePosition == position)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     willChange();
</span><span class="cx">     m_linePosition = position;
</span><span class="cx">     m_computedLinePosition = calculateComputedLinePosition();
</span><span class="cx">     didChange();
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTCue::setPosition(double position, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; VTTCue::setPosition(double position)
</ins><span class="cx"> {
</span><span class="cx">     // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-position
</span><span class="cx">     // On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception.
</span><span class="cx">     // Otherwise, set the text track cue text position to the new value.
</span><del>-    if (position &lt; 0 || position &gt; 100) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-    
</del><ins>+    if (!(position &gt;= 0 &amp;&amp; position &lt;= 100))
+        return Exception { INDEX_SIZE_ERR };
+
</ins><span class="cx">     // Otherwise, set the text track cue line position to the new value.
</span><span class="cx">     if (m_textPosition == position)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     
</span><span class="cx">     willChange();
</span><span class="cx">     m_textPosition = position;
</span><span class="cx">     didChange();
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTCue::setSize(int size, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; VTTCue::setSize(int size)
</ins><span class="cx"> {
</span><span class="cx">     // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-size
</span><span class="cx">     // On setting, if the new value is negative or greater than 100, then throw an IndexSizeError
</span><span class="cx">     // exception. Otherwise, set the text track cue size to the new value.
</span><del>-    if (size &lt; 0 || size &gt; 100) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-    
</del><ins>+    if (!(size &gt;= 0 &amp;&amp; size &lt;= 100))
+        return Exception { INDEX_SIZE_ERR };
+
</ins><span class="cx">     // Otherwise, set the text track cue line position to the new value.
</span><span class="cx">     if (m_cueSize == size)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     
</span><span class="cx">     willChange();
</span><span class="cx">     m_cueSize = size;
</span><span class="cx">     didChange();
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const String&amp; VTTCue::align() const
</span><span class="lines">@@ -438,7 +440,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTCue::setAlign(const String&amp; value, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; VTTCue::setAlign(const String&amp; value)
</ins><span class="cx"> {
</span><span class="cx">     // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-align
</span><span class="cx">     // On setting, the text track cue alignment must be set to the value given in the 
</span><span class="lines">@@ -446,7 +448,7 @@
</span><span class="cx">     // match for the new value, if any. If none of the values match, then the user
</span><span class="cx">     // agent must instead throw a SyntaxError exception.
</span><span class="cx">     
</span><del>-    CueAlignment alignment = m_cueAlignment;
</del><ins>+    CueAlignment alignment;
</ins><span class="cx">     if (value == startKeyword())
</span><span class="cx">         alignment = Start;
</span><span class="cx">     else if (value == middleKeyword())
</span><span class="lines">@@ -458,14 +460,16 @@
</span><span class="cx">     else if (value == rightKeyword())
</span><span class="cx">         alignment = Right;
</span><span class="cx">     else
</span><del>-        ec = SYNTAX_ERR;
</del><ins>+        return Exception { SYNTAX_ERR };
</ins><span class="cx">     
</span><span class="cx">     if (alignment == m_cueAlignment)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     willChange();
</span><span class="cx">     m_cueAlignment = alignment;
</span><span class="cx">     didChange();
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void VTTCue::setText(const String&amp; text)
</span><span class="lines">@@ -786,9 +790,9 @@
</span><span class="cx">     m_cueHighlightBox-&gt;appendChild(*referenceTree);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-VTTCueBox* VTTCue::getDisplayTree(const IntSize&amp; videoSize, int fontSize)
</del><ins>+VTTCueBox&amp; VTTCue::getDisplayTree(const IntSize&amp; videoSize, int fontSize)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;VTTCueBox&gt; displayTree = displayTreeInternal();
</del><ins>+    Ref&lt;VTTCueBox&gt; displayTree = displayTreeInternal();
</ins><span class="cx">     if (!m_displayTreeShouldChange || !track()-&gt;isRendered())
</span><span class="cx">         return displayTree.get();
</span><span class="cx"> 
</span><span class="lines">@@ -839,7 +843,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (!hasDisplayTree())
</span><span class="cx">         return;
</span><del>-    displayTreeInternal()-&gt;remove(ASSERT_NO_EXCEPTION);
</del><ins>+    displayTreeInternal().remove(ASSERT_NO_EXCEPTION);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::pair&lt;double, double&gt; VTTCue::getPositionCoordinates() const
</span><span class="lines">@@ -1141,7 +1145,7 @@
</span><span class="cx">     LOG(Media, &quot;TextTrackCue::setFontSize - setting cue font size to %i&quot;, fontSize);
</span><span class="cx"> 
</span><span class="cx">     m_displayTreeShouldChange = true;
</span><del>-    displayTreeInternal()-&gt;setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue::CSS_PX, important);
</del><ins>+    displayTreeInternal().setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue::CSS_PX, important);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> VTTCue* toVTTCue(TextTrackCue* cue)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTCueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTCue.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTCue.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/VTTCue.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011, 2013 Google Inc.  All rights reserved.
- * Copyright (C) 2012-2014 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011, 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2012-2014 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">@@ -29,8 +29,7 @@
</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 VTTCue_h
-#define VTTCue_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="lines">@@ -90,22 +89,22 @@
</span><span class="cx">     virtual ~VTTCue();
</span><span class="cx"> 
</span><span class="cx">     const String&amp; vertical() const;
</span><del>-    void setVertical(const String&amp;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; setVertical(const String&amp;);
</ins><span class="cx"> 
</span><span class="cx">     bool snapToLines() const { return m_snapToLines; }
</span><span class="cx">     void setSnapToLines(bool);
</span><span class="cx"> 
</span><span class="cx">     double line() const { return m_linePosition; }
</span><del>-    virtual void setLine(double, ExceptionCode&amp;);
</del><ins>+    virtual ExceptionOr&lt;void&gt; setLine(double);
</ins><span class="cx"> 
</span><span class="cx">     double position() const { return m_textPosition; }
</span><del>-    virtual void setPosition(double, ExceptionCode&amp;);
</del><ins>+    virtual ExceptionOr&lt;void&gt; setPosition(double);
</ins><span class="cx"> 
</span><span class="cx">     int size() const { return m_cueSize; }
</span><del>-    virtual void setSize(int, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; setSize(int);
</ins><span class="cx"> 
</span><span class="cx">     const String&amp; align() const;
</span><del>-    void setAlign(const String&amp;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; setAlign(const String&amp;);
</ins><span class="cx"> 
</span><span class="cx">     const String&amp; text() const { return m_content; }
</span><span class="cx">     void setText(const String&amp;);
</span><span class="lines">@@ -123,8 +122,8 @@
</span><span class="cx">     void setIsActive(bool) override;
</span><span class="cx"> 
</span><span class="cx">     bool hasDisplayTree() const { return m_displayTree; }
</span><del>-    VTTCueBox* getDisplayTree(const IntSize&amp; videoSize, int fontSize);
-    HTMLSpanElement* element() const { return m_cueHighlightBox.get(); }
</del><ins>+    VTTCueBox&amp; getDisplayTree(const IntSize&amp; videoSize, int fontSize);
+    HTMLSpanElement&amp; element() const { return *m_cueHighlightBox; }
</ins><span class="cx"> 
</span><span class="cx">     void updateDisplayTree(const MediaTime&amp;);
</span><span class="cx">     void removeDisplayTree();
</span><span class="lines">@@ -173,8 +172,8 @@
</span><span class="cx">     VTTCue(ScriptExecutionContext&amp;, const MediaTime&amp; start, const MediaTime&amp; end, const String&amp; content);
</span><span class="cx">     VTTCue(ScriptExecutionContext&amp;, const WebVTTCueData&amp;);
</span><span class="cx"> 
</span><del>-    virtual PassRefPtr&lt;VTTCueBox&gt; createDisplayTree();
-    VTTCueBox* displayTreeInternal();
</del><ins>+    virtual Ref&lt;VTTCueBox&gt; createDisplayTree();
+    VTTCueBox&amp; displayTreeInternal();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     void initialize(ScriptExecutionContext&amp;);
</span><span class="lines">@@ -230,4 +229,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTCueidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTCue.idl (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTCue.idl        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/VTTCue.idl        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Google Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011 Google 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
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx">  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx">  */
</span><ins>+
</ins><span class="cx"> [
</span><span class="cx">     Conditional=VIDEO_TRACK,
</span><span class="cx">     Constructor(unrestricted double startTime, unrestricted double endTime, DOMString text),
</span><span class="lines">@@ -29,12 +30,12 @@
</span><span class="cx">     JSGenerateToJSObject,
</span><span class="cx">     JSGenerateToNativeObject,
</span><span class="cx"> ] interface VTTCue : TextTrackCue {
</span><del>-    [SetterMayThrowLegacyException] attribute DOMString vertical;
</del><ins>+    [SetterMayThrowException] attribute DOMString vertical;
</ins><span class="cx">     attribute boolean snapToLines;
</span><del>-    [SetterMayThrowLegacyException] attribute unrestricted double line;
-    [SetterMayThrowLegacyException] attribute unrestricted double position;
-    [SetterMayThrowLegacyException] attribute unrestricted double size;
-    [SetterMayThrowLegacyException] attribute DOMString align;
</del><ins>+    [SetterMayThrowException] attribute double line;
+    [SetterMayThrowException] attribute double position;
+    [SetterMayThrowException] attribute double size;
+    [SetterMayThrowException] attribute DOMString align;
</ins><span class="cx">     attribute DOMString text;
</span><span class="cx">     DocumentFragment getCueAsHTML();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTRegion.cpp (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegion.cpp        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/VTTRegion.cpp        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -49,22 +49,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-// The following values default values are defined within the WebVTT Regions Spec.
</del><ins>+// The default values are defined within the WebVTT Regions Spec.
</ins><span class="cx"> // https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/region.html
</span><span class="cx"> 
</span><del>-// The region occupies by default 100% of the width of the video viewport.
-static const float defaultWidth = 100;
-
-// The region has, by default, 3 lines of text.
-static const long defaultHeightInLines = 3;
-
-// The region and viewport are anchored in the bottom left corner.
-static const float defaultAnchorPointX = 0;
-static const float defaultAnchorPointY = 100;
-
-// The region doesn't have scrolling text, by default.
-static const bool defaultScroll = false;
-
</del><span class="cx"> // Default region line-height (vh units)
</span><span class="cx"> static const float lineHeight = 5.33;
</span><span class="cx"> 
</span><span class="lines">@@ -74,15 +61,6 @@
</span><span class="cx"> VTTRegion::VTTRegion(ScriptExecutionContext&amp; context)
</span><span class="cx">     : ContextDestructionObserver(&amp;context)
</span><span class="cx">     , m_id(emptyString())
</span><del>-    , m_width(defaultWidth)
-    , m_heightInLines(defaultHeightInLines)
-    , m_regionAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY))
-    , m_viewportAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY))
-    , m_scroll(defaultScroll)
-    , m_cueContainer(nullptr)
-    , m_regionDisplayTree(nullptr)
-    , m_track(nullptr)
-    , m_currentTop(0)
</del><span class="cx">     , m_scrollTimer(*this, &amp;VTTRegion::scrollTimerFired)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -101,122 +79,85 @@
</span><span class="cx">     m_id = id;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTRegion::setWidth(double value, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; VTTRegion::setWidth(double value)
</ins><span class="cx"> {
</span><del>-    if (std::isinf(value) || std::isnan(value)) {
-        ec = TypeError;
-        return;
-    }
-
-    if (value &lt; 0 || value &gt; 100) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-
</del><ins>+    if (!(value &gt;= 0 &amp;&amp; value &lt;= 100))
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">     m_width = value;
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTRegion::setHeight(long value, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; VTTRegion::setHeight(int value)
</ins><span class="cx"> {
</span><del>-    if (value &lt; 0) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-
</del><ins>+    if (value &lt; 0)
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">     m_heightInLines = value;
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTRegion::setRegionAnchorX(double value, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; VTTRegion::setRegionAnchorX(double value)
</ins><span class="cx"> {
</span><del>-    if (std::isinf(value) || std::isnan(value)) {
-        ec = TypeError;
-        return;
-    }
-
-    if (value &lt; 0 || value &gt; 100) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-
</del><ins>+    if (!(value &gt;= 0 &amp;&amp; value &lt;= 100))
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">     m_regionAnchor.setX(value);
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTRegion::setRegionAnchorY(double value, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; VTTRegion::setRegionAnchorY(double value)
</ins><span class="cx"> {
</span><del>-    if (std::isinf(value) || std::isnan(value)) {
-        ec = TypeError;
-        return;
-    }
-
-    if (value &lt; 0 || value &gt; 100) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-
</del><ins>+    if (!(value &gt;= 0 &amp;&amp; value &lt;= 100))
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">     m_regionAnchor.setY(value);
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTRegion::setViewportAnchorX(double value, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; VTTRegion::setViewportAnchorX(double value)
</ins><span class="cx"> {
</span><del>-    if (std::isinf(value) || std::isnan(value)) {
-        ec = TypeError;
-        return;
-    }
-
-    if (value &lt; 0 || value &gt; 100) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-
</del><ins>+    if (!(value &gt;= 0 &amp;&amp; value &lt;= 100))
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">     m_viewportAnchor.setX(value);
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTRegion::setViewportAnchorY(double value, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; VTTRegion::setViewportAnchorY(double value)
</ins><span class="cx"> {
</span><del>-    if (std::isinf(value) || std::isnan(value)) {
-        ec = TypeError;
-        return;
-    }
-
-    if (value &lt; 0 || value &gt; 100) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-
</del><ins>+    if (!(value &gt;= 0 &amp;&amp; value &lt;= 100))
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">     m_viewportAnchor.setY(value);
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static const AtomicString&amp; upKeyword()
+{
+    static NeverDestroyed&lt;const AtomicString&gt; upKeyword(&quot;up&quot;, AtomicString::ConstructFromLiteral);
+    return upKeyword;
+}
+
</ins><span class="cx"> const AtomicString&amp; VTTRegion::scroll() const
</span><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;const AtomicString&gt; upScrollValueKeyword(&quot;up&quot;, AtomicString::ConstructFromLiteral);
-
-    if (m_scroll)
-        return upScrollValueKeyword;
-
-    return emptyAtom;
</del><ins>+    return m_scroll ? upKeyword() : emptyAtom;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTRegion::setScroll(const AtomicString&amp; value, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; VTTRegion::setScroll(const AtomicString&amp; value)
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;const AtomicString&gt; upScrollValueKeyword(&quot;up&quot;, AtomicString::ConstructFromLiteral);
-
-    if (value != emptyString() &amp;&amp; value != upScrollValueKeyword) {
-        ec = SYNTAX_ERR;
-        return;
</del><ins>+    if (value.isEmpty()) {
+        m_scroll = false;
+        return { };
</ins><span class="cx">     }
</span><del>-
-    m_scroll = value == upScrollValueKeyword;
</del><ins>+    if (value == upKeyword()) {
+        m_scroll = true;
+        return { };
+    }
+    return Exception { SYNTAX_ERR };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTRegion::updateParametersFromRegion(VTTRegion* region)
</del><ins>+void VTTRegion::updateParametersFromRegion(const VTTRegion&amp; other)
</ins><span class="cx"> {
</span><del>-    m_heightInLines = region-&gt;height();
-    m_width = region-&gt;width();
-
-    m_regionAnchor = FloatPoint(region-&gt;regionAnchorX(), region-&gt;regionAnchorY());
-    m_viewportAnchor = FloatPoint(region-&gt;viewportAnchorX(), region-&gt;viewportAnchorY());
-
-    setScroll(region-&gt;scroll(), ASSERT_NO_EXCEPTION);
</del><ins>+    m_heightInLines = other.m_heightInLines;
+    m_width = other.m_width;
+    m_regionAnchor = other.m_regionAnchor;
+    m_viewportAnchor = other.m_viewportAnchor;
+    m_scroll = other.m_scroll;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void VTTRegion::setRegionSettings(const String&amp; inputString)
</span><span class="lines">@@ -268,8 +209,6 @@
</span><span class="cx"> 
</span><span class="cx"> void VTTRegion::parseSettingValue(RegionSetting setting, VTTScanner&amp; input)
</span><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;const AtomicString&gt; scrollUpValueKeyword(&quot;up&quot;, AtomicString::ConstructFromLiteral);
-
</del><span class="cx">     VTTScanner::Run valueRun = input.collectUntil&lt;isHTMLSpace&lt;UChar&gt;&gt;();
</span><span class="cx"> 
</span><span class="cx">     switch (setting) {
</span><span class="lines">@@ -312,7 +251,7 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     case Scroll:
</span><del>-        if (input.scanRun(valueRun, scrollUpValueKeyword.get()))
</del><ins>+        if (input.scanRun(valueRun, upKeyword()))
</ins><span class="cx">             m_scroll = true;
</span><span class="cx">         else
</span><span class="cx">             LOG(Media, &quot;VTTRegion::parseSettingValue, invalid Scroll&quot;);
</span><span class="lines">@@ -345,14 +284,14 @@
</span><span class="cx">     return trackRegionShadowPseudoId;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTRegion::appendTextTrackCueBox(PassRefPtr&lt;VTTCueBox&gt; displayBox)
</del><ins>+void VTTRegion::appendTextTrackCueBox(Ref&lt;VTTCueBox&gt;&amp;&amp; displayBox)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_cueContainer);
</span><span class="cx"> 
</span><del>-    if (m_cueContainer-&gt;contains(displayBox.get()))
</del><ins>+    if (m_cueContainer-&gt;contains(displayBox.ptr()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_cueContainer-&gt;appendChild(*displayBox, ASSERT_NO_EXCEPTION);
</del><ins>+    m_cueContainer-&gt;appendChild(displayBox, ASSERT_NO_EXCEPTION);
</ins><span class="cx">     displayLastTextTrackCueBox();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -405,7 +344,7 @@
</span><span class="cx"> HTMLDivElement&amp; VTTRegion::getDisplayTree()
</span><span class="cx"> {
</span><span class="cx">     if (!m_regionDisplayTree) {
</span><del>-        m_regionDisplayTree = HTMLDivElement::create(*ownerDocument());
</del><ins>+        m_regionDisplayTree = HTMLDivElement::create(downcast&lt;Document&gt;(*m_scriptExecutionContext));
</ins><span class="cx">         prepareRegionDisplayTree();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -447,7 +386,7 @@
</span><span class="cx"> 
</span><span class="cx">     // The cue container is used to wrap the cues and it is the object which is
</span><span class="cx">     // gradually scrolled out as multiple cues are appended to the region.
</span><del>-    m_cueContainer = HTMLDivElement::create(*ownerDocument());
</del><ins>+    m_cueContainer = HTMLDivElement::create(downcast&lt;Document&gt;(*m_scriptExecutionContext));
</ins><span class="cx">     m_cueContainer-&gt;setInlineStyleProperty(CSSPropertyTop, 0.0f, CSSPrimitiveValue::CSS_PX);
</span><span class="cx"> 
</span><span class="cx">     m_cueContainer-&gt;setPseudo(textTrackCueContainerShadowPseudoId());
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTRegion.h (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegion.h        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/VTTRegion.h        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Google Inc.  All rights reserved.
- * Copyright (C) 2014 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2014 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">@@ -29,16 +29,13 @@
</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 VTTRegion_h
-#define VTTRegion_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ContextDestructionObserver.h&quot;
</span><del>-#include &quot;Document.h&quot;
</del><span class="cx"> #include &quot;FloatPoint.h&quot;
</span><span class="cx"> #include &quot;TextTrack.h&quot;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -62,27 +59,27 @@
</span><span class="cx">     void setId(const String&amp;);
</span><span class="cx"> 
</span><span class="cx">     double width() const { return m_width; }
</span><del>-    void setWidth(double, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; setWidth(double);
</ins><span class="cx"> 
</span><del>-    long height() const { return m_heightInLines; }
-    void setHeight(long, ExceptionCode&amp;);
</del><ins>+    int height() const { return m_heightInLines; }
+    ExceptionOr&lt;void&gt; setHeight(int);
</ins><span class="cx"> 
</span><span class="cx">     double regionAnchorX() const { return m_regionAnchor.x(); }
</span><del>-    void setRegionAnchorX(double, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; setRegionAnchorX(double);
</ins><span class="cx"> 
</span><span class="cx">     double regionAnchorY() const { return m_regionAnchor.y(); }
</span><del>-    void setRegionAnchorY(double, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; setRegionAnchorY(double);
</ins><span class="cx"> 
</span><span class="cx">     double viewportAnchorX() const { return m_viewportAnchor.x(); }
</span><del>-    void setViewportAnchorX(double, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; setViewportAnchorX(double);
</ins><span class="cx"> 
</span><span class="cx">     double viewportAnchorY() const { return m_viewportAnchor.y(); }
</span><del>-    void setViewportAnchorY(double, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; setViewportAnchorY(double);
</ins><span class="cx"> 
</span><span class="cx">     const AtomicString&amp; scroll() const;
</span><del>-    void setScroll(const AtomicString&amp;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; setScroll(const AtomicString&amp;);
</ins><span class="cx"> 
</span><del>-    void updateParametersFromRegion(VTTRegion*);
</del><ins>+    void updateParametersFromRegion(const VTTRegion&amp;);
</ins><span class="cx"> 
</span><span class="cx">     const String&amp; regionSettings() const { return m_settings; }
</span><span class="cx">     void setRegionSettings(const String&amp;);
</span><span class="lines">@@ -91,7 +88,7 @@
</span><span class="cx"> 
</span><span class="cx">     HTMLDivElement&amp; getDisplayTree();
</span><span class="cx">     
</span><del>-    void appendTextTrackCueBox(PassRefPtr&lt;VTTCueBox&gt;);
</del><ins>+    void appendTextTrackCueBox(Ref&lt;VTTCueBox&gt;&amp;&amp;);
</ins><span class="cx">     void displayLastTextTrackCueBox();
</span><span class="cx">     void willRemoveTextTrackCueBox(VTTCueBox*);
</span><span class="cx"> 
</span><span class="lines">@@ -98,8 +95,6 @@
</span><span class="cx"> private:
</span><span class="cx">     VTTRegion(ScriptExecutionContext&amp;);
</span><span class="cx"> 
</span><del>-    Document* ownerDocument() { return downcast&lt;Document&gt;(m_scriptExecutionContext); }
-
</del><span class="cx">     void prepareRegionDisplayTree();
</span><span class="cx"> 
</span><span class="cx">     // The timer is needed to continue processing when cue scrolling ended.
</span><span class="lines">@@ -128,13 +123,13 @@
</span><span class="cx">     String m_id;
</span><span class="cx">     String m_settings;
</span><span class="cx"> 
</span><del>-    double m_width;
-    unsigned m_heightInLines;
</del><ins>+    double m_width { 100 };
+    unsigned m_heightInLines { 3 };
</ins><span class="cx"> 
</span><del>-    FloatPoint m_regionAnchor;
-    FloatPoint m_viewportAnchor;
</del><ins>+    FloatPoint m_regionAnchor { 0, 100 };
+    FloatPoint m_viewportAnchor { 0, 100 };
</ins><span class="cx"> 
</span><del>-    bool m_scroll;
</del><ins>+    bool m_scroll { false };
</ins><span class="cx"> 
</span><span class="cx">     // The cue container is the container that is scrolled up to obtain the
</span><span class="cx">     // effect of scrolling cues when this is enabled for the regions.
</span><span class="lines">@@ -145,10 +140,10 @@
</span><span class="cx">     // reference a destroyed TextTrack, as this member variable
</span><span class="cx">     // is cleared in the TextTrack destructor and it is generally
</span><span class="cx">     // set/reset within the addRegion and removeRegion methods.
</span><del>-    TextTrack* m_track;
</del><ins>+    TextTrack* m_track { nullptr };
</ins><span class="cx"> 
</span><span class="cx">     // Keep track of the current numeric value of the css &quot;top&quot; property.
</span><del>-    double m_currentTop;
</del><ins>+    double m_currentTop { 0 };
</ins><span class="cx"> 
</span><span class="cx">     // The timer is used to display the next cue line after the current one has
</span><span class="cx">     // been displayed. It's main use is for scrolling regions and it triggers as
</span><span class="lines">@@ -161,4 +156,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTRegion.idl (207719 => 207720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegion.idl        2016-10-22 23:28:39 UTC (rev 207719)
+++ trunk/Source/WebCore/html/track/VTTRegion.idl        2016-10-23 01:05:07 UTC (rev 207720)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Google Inc.  All rights reserved.
- * Copyright (C) 2014 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2014 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
</span><span class="lines">@@ -26,19 +26,18 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=VIDEO_TRACK,
</span><ins>+    Constructor(),
+    ConstructorCallWith=ScriptExecutionContext,
</ins><span class="cx">     JSGenerateToNativeObject,
</span><del>-    Constructor(),
-    ConstructorCallWith=ScriptExecutionContext
</del><span class="cx"> ] interface VTTRegion {
</span><span class="cx">     readonly attribute TextTrack track;
</span><span class="cx"> 
</span><span class="cx">     attribute DOMString id;
</span><del>-    [SetterMayThrowLegacyException] attribute unrestricted double width;
-    [SetterMayThrowLegacyException] attribute long height;
-    [SetterMayThrowLegacyException] attribute unrestricted double regionAnchorX;
-    [SetterMayThrowLegacyException] attribute unrestricted double regionAnchorY;
-    [SetterMayThrowLegacyException] attribute unrestricted double viewportAnchorX;
-    [SetterMayThrowLegacyException] attribute unrestricted double viewportAnchorY;
-    [SetterMayThrowLegacyException] attribute DOMString scroll;
</del><ins>+    [SetterMayThrowException] attribute double width;
+    [SetterMayThrowException] attribute long height;
+    [SetterMayThrowException] attribute double regionAnchorX;
+    [SetterMayThrowException] attribute double regionAnchorY;
+    [SetterMayThrowException] attribute double viewportAnchorX;
+    [SetterMayThrowException] attribute double viewportAnchorY;
+    [SetterMayThrowException] attribute DOMString scroll;
</ins><span class="cx"> };
</span><del>-
</del></span></pre>
</div>
</div>

</body>
</html>