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

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

<h3>Log Message</h3>
<pre>Remove a few assorted uses of ExceptionCode
https://bugs.webkit.org/show_bug.cgi?id=164683

Reviewed by Chris Dumez.

Source/WebCore:

* Modules/applepay/PaymentContact.h: Removed include of ExceptionCode.h.
Also tidied up the constructor and destructor.

* Modules/indexeddb/IDBFactory.h: Removed typedef of ExceptionCode.
* Modules/indexeddb/IDBKeyRange.h: Ditto.

* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::getObjectParameter): Removed local ExceptionCode variable that
was always 0.
(WebCore::JSWebGLRenderingContextBase::getAttachedShaders): Ditto.
(WebCore::dataFunctionf): Ditto.
(WebCore::dataFunctioni): Ditto.
(WebCore::dataFunctionMatrix): Ditto.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::cloneChildNodes): Ditto.

* dom/Document.h: Removed typedef of ExceptionCode.
* dom/TreeWalker.h: Ditto.
* editing/markup.h: Ditto.
* html/ImageData.h: Ditto.
* html/InputType.h: Ditto.
* html/canvas/CanvasRenderingContext2D.h: Ditto.
* html/canvas/WebGLDebugShaders.h: Ditto.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::setTimeout): Fixed typo where this was using
ExceptionCode instead of Exception. The code would return an integer
instead of an exception in this case. I could not produce a test that
exercises this code path; I suspect it is an unreachable error condition.
(WebCore::DOMWindow::setInterval): Ditto.

* replay/MemoizedDOMResult.h: Changed typedef of ExceptionCode into
a using statement. Not sure what the longer term fix is.

* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::PendingCallbacks::appendStartElementNSCallback): Renamed to use
WebKit-style &quot;numXXX&quot; rather than &quot;nb_xxx&quot;.
(WebCore::PendingCallbacks::PendingStartElementNSCallback::~PendingStartElementNSCallback):
Ditto.
(WebCore::handleNamespaceAttributes): Ditto. Replaced ExceptionCode out
argument with a boolean return value.
(WebCore::handleElementAttributes): Ditto.
(WebCore::XMLDocumentParser::startElementNs): Ditto. Updated for changes
to the handle functions above.
(WebCore::startElementNsHandler): More of the same.
(WebCore::attributesStartElementNsHandler): Ditto.

Source/WebKit/mac:

* DOM/DOMDOMImplementation.mm:
(-[DOMImplementation createDocumentType:publicId:systemId:]):
Use raiseOnDOMError instead of much longer hand written equivalent.
(-[DOMImplementation createDocument:qualifiedName:doctype:]): Ditto.

* DOM/DOMDocument.mm:
(-[DOMDocument createEntityReference:]): Use raiseNotSupportedErrorException
so we are not using a specific exception code.

* DOM/DOMHTMLOptionsCollection.mm:
(-[DOMHTMLOptionsCollection add:index:]): Use raiseOnDOMError instead of
much longer hand written equivalent.
* DOM/DOMHTMLSelectElement.mm:
(-[DOMHTMLSelectElement add:before:]): Ditto. Also removed unneeded return
statement after calling a &quot;no return&quot; function.

* DOM/ExceptionHandlers.h: Removed overloads of raiseDOMException and
raiseOnDOMError functions that take ExceptionCode; keep the ones that take
Exception and ExceptionOr. Renamed the other overload of raiseDOMException
to raiseDOMErrorException; it is only used as the non-inline implementation
part of the inline raiseOnDOMError function.
* DOM/ExceptionHandlers.mm:
(raiseDOMErrorException): Renamed. Made the ExceptionCode overload be local
to this source file instead of in the header.
(raiseTypeErrorException): Updated for name change.
(raiseNotSupportedErrorException): Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepayPaymentContacth">trunk/Source/WebCore/Modules/applepay/PaymentContact.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBFactoryh">trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangeh">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWebGLRenderingContextBaseCustomcpp">trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomTreeWalkerh">trunk/Source/WebCore/dom/TreeWalker.h</a></li>
<li><a href="#trunkSourceWebCoreeditingmarkuph">trunk/Source/WebCore/editing/markup.h</a></li>
<li><a href="#trunkSourceWebCorehtmlImageDatah">trunk/Source/WebCore/html/ImageData.h</a></li>
<li><a href="#trunkSourceWebCorehtmlInputTypeh">trunk/Source/WebCore/html/InputType.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dh">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLDebugShadersh">trunk/Source/WebCore/html/canvas/WebGLDebugShaders.h</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorereplayMemoizedDOMResulth">trunk/Source/WebCore/replay/MemoizedDOMResult.h</a></li>
<li><a href="#trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp">trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMDOMImplementationmm">trunk/Source/WebKit/mac/DOM/DOMDOMImplementation.mm</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMDocumentmm">trunk/Source/WebKit/mac/DOM/DOMDocument.mm</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMHTMLOptionsCollectionmm">trunk/Source/WebKit/mac/DOM/DOMHTMLOptionsCollection.mm</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMHTMLSelectElementmm">trunk/Source/WebKit/mac/DOM/DOMHTMLSelectElement.mm</a></li>
<li><a href="#trunkSourceWebKitmacDOMExceptionHandlersh">trunk/Source/WebKit/mac/DOM/ExceptionHandlers.h</a></li>
<li><a href="#trunkSourceWebKitmacDOMExceptionHandlersmm">trunk/Source/WebKit/mac/DOM/ExceptionHandlers.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/ChangeLog        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2016-11-12  Darin Adler  &lt;darin@apple.com&gt;
+
+        Remove a few assorted uses of ExceptionCode
+        https://bugs.webkit.org/show_bug.cgi?id=164683
+
+        Reviewed by Chris Dumez.
+
+        * Modules/applepay/PaymentContact.h: Removed include of ExceptionCode.h.
+        Also tidied up the constructor and destructor.
+
+        * Modules/indexeddb/IDBFactory.h: Removed typedef of ExceptionCode.
+        * Modules/indexeddb/IDBKeyRange.h: Ditto.
+
+        * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
+        (WebCore::getObjectParameter): Removed local ExceptionCode variable that
+        was always 0.
+        (WebCore::JSWebGLRenderingContextBase::getAttachedShaders): Ditto.
+        (WebCore::dataFunctionf): Ditto.
+        (WebCore::dataFunctioni): Ditto.
+        (WebCore::dataFunctionMatrix): Ditto.
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::cloneChildNodes): Ditto.
+
+        * dom/Document.h: Removed typedef of ExceptionCode.
+        * dom/TreeWalker.h: Ditto.
+        * editing/markup.h: Ditto.
+        * html/ImageData.h: Ditto.
+        * html/InputType.h: Ditto.
+        * html/canvas/CanvasRenderingContext2D.h: Ditto.
+        * html/canvas/WebGLDebugShaders.h: Ditto.
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::setTimeout): Fixed typo where this was using
+        ExceptionCode instead of Exception. The code would return an integer
+        instead of an exception in this case. I could not produce a test that
+        exercises this code path; I suspect it is an unreachable error condition.
+        (WebCore::DOMWindow::setInterval): Ditto.
+
+        * replay/MemoizedDOMResult.h: Changed typedef of ExceptionCode into
+        a using statement. Not sure what the longer term fix is.
+
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::PendingCallbacks::appendStartElementNSCallback): Renamed to use
+        WebKit-style &quot;numXXX&quot; rather than &quot;nb_xxx&quot;.
+        (WebCore::PendingCallbacks::PendingStartElementNSCallback::~PendingStartElementNSCallback):
+        Ditto.
+        (WebCore::handleNamespaceAttributes): Ditto. Replaced ExceptionCode out
+        argument with a boolean return value.
+        (WebCore::handleElementAttributes): Ditto.
+        (WebCore::XMLDocumentParser::startElementNs): Ditto. Updated for changes
+        to the handle functions above.
+        (WebCore::startElementNsHandler): More of the same.
+        (WebCore::attributesStartElementNsHandler): Ditto.
+
</ins><span class="cx"> 2016-11-11  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove LegacyException support from bindings script
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepayPaymentContacth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/PaymentContact.h (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/PaymentContact.h        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/Modules/applepay/PaymentContact.h        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(APPLE_PAY)
</span><span class="cx"> 
</span><del>-#include &lt;WebCore/ExceptionCode.h&gt;
</del><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -43,19 +42,12 @@
</span><span class="cx"> 
</span><span class="cx"> class PaymentContact {
</span><span class="cx"> public:
</span><del>-    PaymentContact()
-    {
-    }
-
</del><ins>+    PaymentContact() = default;
</ins><span class="cx">     explicit PaymentContact(PKContact *pkContact)
</span><span class="cx">         : m_pkContact(pkContact)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ~PaymentContact()
-    {
-    }
-
</del><span class="cx">     static Optional&lt;PaymentContact&gt; fromJS(JSC::ExecState&amp;, JSC::JSValue, String&amp; errorMessage);
</span><span class="cx">     JSC::JSValue toJS(JSC::ExecState&amp;) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -49,8 +49,6 @@
</span><span class="cx"> class IDBConnectionProxy;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class IDBFactory : public ThreadSafeRefCounted&lt;IDBFactory&gt; {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;IDBFactory&gt; create(IDBClient::IDBConnectionProxy&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -42,8 +42,6 @@
</span><span class="cx"> class IDBKey;
</span><span class="cx"> class ScriptExecutionContext;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class IDBKeyRange : public ScriptWrappable, public RefCounted&lt;IDBKeyRange&gt; {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;IDBKeyRange&gt; create(RefPtr&lt;IDBKey&gt;&amp;&amp; lower, RefPtr&lt;IDBKey&gt;&amp;&amp; upper, bool isLowerOpen, bool isUpperOpen);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWebGLRenderingContextBaseCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -196,7 +196,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;
</del><span class="cx">     WebGLRenderingContextBase&amp; context = obj-&gt;wrapped();
</span><span class="cx">     unsigned target = state.uncheckedArgument(0).toInt32(&amp;state);
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="lines">@@ -221,10 +220,6 @@
</span><span class="cx">         notImplemented();
</span><span class="cx">         break;
</span><span class="cx">     }
</span><del>-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
</del><span class="cx">     return toJS(&amp;state, obj-&gt;globalObject(), info);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -304,19 +299,13 @@
</span><span class="cx"> 
</span><span class="cx">     if (state.argumentCount() &lt; 1)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><del>-    ExceptionCode ec = 0;
-    WebGLRenderingContextBase&amp; context = wrapped();
-    WebGLProgram* program = JSWebGLProgram::toWrapped(state.uncheckedArgument(0));
</del><ins>+    auto&amp; context = wrapped();
+    auto* program = JSWebGLProgram::toWrapped(state.uncheckedArgument(0));
</ins><span class="cx">     if (!program &amp;&amp; !state.uncheckedArgument(0).isUndefinedOrNull())
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><span class="cx">     Vector&lt;RefPtr&lt;WebGLShader&gt;&gt; shaders;
</span><del>-    bool succeed = context.getAttachedShaders(program, shaders);
-    if (ec) {
-        setDOMException(&amp;state, ec);
</del><ins>+    if (!context.getAttachedShaders(program, shaders))
</ins><span class="cx">         return jsNull();
</span><del>-    }
-    if (!succeed)
-        return jsNull();
</del><span class="cx">     JSC::MarkedArgumentBuffer list;
</span><span class="cx">     for (size_t ii = 0; ii &lt; shaders.size(); ++ii)
</span><span class="cx">         list.append(toJS(&amp;state, globalObject(), shaders[ii].get()));
</span><span class="lines">@@ -516,7 +505,6 @@
</span><span class="cx">     RefPtr&lt;Float32Array&gt; webGLArray = toUnsharedFloat32Array(state.uncheckedArgument(1));
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">     
</span><del>-    ExceptionCode ec = 0;
</del><span class="cx">     if (webGLArray) {
</span><span class="cx">         switch (f) {
</span><span class="cx">         case f_uniform1v:
</span><span class="lines">@@ -545,7 +533,6 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        setDOMException(&amp;state, ec);
</del><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -580,7 +567,6 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    setDOMException(&amp;state, ec);
</del><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -598,7 +584,6 @@
</span><span class="cx">     
</span><span class="cx">     RefPtr&lt;Int32Array&gt; webGLArray = toUnsharedInt32Array(state.uncheckedArgument(1));
</span><span class="cx">     
</span><del>-    ExceptionCode ec = 0;
</del><span class="cx">     if (webGLArray) {
</span><span class="cx">         switch (f) {
</span><span class="cx">         case f_uniform1v:
</span><span class="lines">@@ -617,7 +602,6 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        setDOMException(&amp;state, ec);
</del><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -643,7 +627,6 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    setDOMException(&amp;state, ec);
</del><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -677,8 +660,6 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        ExceptionCode ec = 0;
-        setDOMException(&amp;state, ec);
</del><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -698,8 +679,6 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ExceptionCode ec = 0;
-    setDOMException(&amp;state, ec);
</del><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -717,10 +717,9 @@
</span><span class="cx"> 
</span><span class="cx"> void ContainerNode::cloneChildNodes(ContainerNode&amp; clone)
</span><span class="cx"> {
</span><del>-    ExceptionCode ec = 0;
</del><span class="cx">     Document&amp; targetDocument = clone.document();
</span><del>-    for (Node* child = firstChild(); child &amp;&amp; !ec; child = child-&gt;nextSibling()) {
-        Ref&lt;Node&gt; clonedChild = child-&gt;cloneNodeInternal(targetDocument, CloningOperation::SelfWithTemplateContent);
</del><ins>+    for (Node* child = firstChild(); child; child = child-&gt;nextSibling()) {
+        auto clonedChild = child-&gt;cloneNodeInternal(targetDocument, CloningOperation::SelfWithTemplateContent);
</ins><span class="cx">         if (!clone.appendChild(clonedChild).hasException() &amp;&amp; is&lt;ContainerNode&gt;(*child))
</span><span class="cx">             downcast&lt;ContainerNode&gt;(*child).cloneChildNodes(downcast&lt;ContainerNode&gt;(clonedChild.get()));
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/dom/Document.h        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -197,8 +197,6 @@
</span><span class="cx"> 
</span><span class="cx"> class FontFaceSet;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> class DeviceMotionClient;
</span><span class="cx"> class DeviceMotionController;
</span><span class="lines">@@ -886,8 +884,7 @@
</span><span class="cx">     static bool isValidName(const String&amp;);
</span><span class="cx"> 
</span><span class="cx">     // The following breaks a qualified name into a prefix and a local name.
</span><del>-    // It also does a validity check, and returns false if the qualified name
-    // is invalid. It also sets ExceptionCode when name is invalid.
</del><ins>+    // It also does a validity check, and returns an error if the qualified name is invalid.
</ins><span class="cx">     static ExceptionOr&lt;std::pair&lt;AtomicString, AtomicString&gt;&gt; parseQualifiedName(const String&amp; qualifiedName);
</span><span class="cx">     static ExceptionOr&lt;QualifiedName&gt; parseQualifiedName(const AtomicString&amp; namespaceURI, const String&amp; qualifiedName);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomTreeWalkerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TreeWalker.h (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TreeWalker.h        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/dom/TreeWalker.h        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -31,8 +31,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-    typedef int ExceptionCode;
-
</del><span class="cx">     class TreeWalker : public ScriptWrappable, public RefCounted&lt;TreeWalker&gt;, public NodeIteratorBase {
</span><span class="cx">     public:
</span><span class="cx">         static Ref&lt;TreeWalker&gt; create(Node&amp; rootNode, unsigned long whatToShow, RefPtr&lt;NodeFilter&gt;&amp;&amp; filter)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmarkuph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/markup.h (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/markup.h        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/editing/markup.h        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -43,8 +43,6 @@
</span><span class="cx"> class QualifiedName;
</span><span class="cx"> class Range;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> enum EChildrenOnly { IncludeNode, ChildrenOnly };
</span><span class="cx"> enum EAbsoluteURLs { DoNotResolveURLs, ResolveAllURLs, ResolveNonLocalURLs };
</span><span class="cx"> enum EFragmentSerialization { HTMLFragmentSerialization, XMLFragmentSerialization };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageData.h (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageData.h        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/html/ImageData.h        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -34,8 +34,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class ImageData : public RefCounted&lt;ImageData&gt; {
</span><span class="cx"> public:
</span><span class="cx">     static ExceptionOr&lt;Ref&lt;ImageData&gt;&gt; create(unsigned sw, unsigned sh);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlInputTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/InputType.h (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/InputType.h        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/html/InputType.h        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -65,8 +65,6 @@
</span><span class="cx"> 
</span><span class="cx"> struct InputElementClickState;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> // An InputType object represents the type-specific part of an HTMLInputElement.
</span><span class="cx"> // Do not expose instances of InputType and classes derived from it to classes
</span><span class="cx"> // other than HTMLInputElement.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -55,8 +55,6 @@
</span><span class="cx"> class ImageData;
</span><span class="cx"> class TextMetrics;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class CanvasRenderingContext2D final : public CanvasRenderingContext, public CanvasPath {
</span><span class="cx"> public:
</span><span class="cx">     CanvasRenderingContext2D(HTMLCanvasElement&amp;, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLDebugShadersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLDebugShaders.h (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLDebugShaders.h        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/html/canvas/WebGLDebugShaders.h        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -31,8 +31,6 @@
</span><span class="cx"> 
</span><span class="cx"> class WebGLShader;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class WebGLDebugShaders final : public WebGLExtension {
</span><span class="cx"> public:
</span><span class="cx">     explicit WebGLDebugShaders(WebGLRenderingContextBase*);
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -1616,7 +1616,7 @@
</span><span class="cx"> {
</span><span class="cx">     auto* context = scriptExecutionContext();
</span><span class="cx">     if (!context)
</span><del>-        return ExceptionCode { INVALID_ACCESS_ERR };
</del><ins>+        return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx">     return DOMTimer::install(*context, WTFMove(action), std::chrono::milliseconds(timeout), true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1648,7 +1648,7 @@
</span><span class="cx"> {
</span><span class="cx">     auto* context = scriptExecutionContext();
</span><span class="cx">     if (!context)
</span><del>-        return ExceptionCode { INVALID_ACCESS_ERR };
</del><ins>+        return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx">     return DOMTimer::install(*context, WTFMove(action), std::chrono::milliseconds(timeout), false);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorereplayMemoizedDOMResulth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/MemoizedDOMResult.h (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/MemoizedDOMResult.h        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/replay/MemoizedDOMResult.h        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> 
</span><span class="cx"> class SerializedScriptValue;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
</del><ins>+using ExceptionCode = int;
</ins><span class="cx"> 
</span><span class="cx"> // Add new memoized ctypes here. The first argument is the enum value,
</span><span class="cx"> // which cannot conflict with built-in primitive types. The second is
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -98,11 +98,9 @@
</span><span class="cx"> class PendingCallbacks {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(PendingCallbacks); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    PendingCallbacks() { }
-    ~PendingCallbacks() { }
</del><ins>+    PendingCallbacks() = default;
</ins><span class="cx"> 
</span><del>-    void appendStartElementNSCallback(const xmlChar* xmlLocalName, const xmlChar* xmlPrefix, const xmlChar* xmlURI, int nb_namespaces,
-                                      const xmlChar** namespaces, int nb_attributes, int nb_defaulted, const xmlChar** attributes)
</del><ins>+    void appendStartElementNSCallback(const xmlChar* xmlLocalName, const xmlChar* xmlPrefix, const xmlChar* xmlURI, int numNamespaces, const xmlChar** namespaces, int numAttributes, int numDefaulted, const xmlChar** attributes)
</ins><span class="cx">     {
</span><span class="cx">         auto callback = std::make_unique&lt;PendingStartElementNSCallback&gt;();
</span><span class="cx"> 
</span><span class="lines">@@ -109,14 +107,14 @@
</span><span class="cx">         callback-&gt;xmlLocalName = xmlStrdup(xmlLocalName);
</span><span class="cx">         callback-&gt;xmlPrefix = xmlStrdup(xmlPrefix);
</span><span class="cx">         callback-&gt;xmlURI = xmlStrdup(xmlURI);
</span><del>-        callback-&gt;nb_namespaces = nb_namespaces;
-        callback-&gt;namespaces = static_cast&lt;xmlChar**&gt;(xmlMalloc(sizeof(xmlChar*) * nb_namespaces * 2));
-        for (int i = 0; i &lt; nb_namespaces * 2 ; i++)
</del><ins>+        callback-&gt;numNamespaces = numNamespaces;
+        callback-&gt;namespaces = static_cast&lt;xmlChar**&gt;(xmlMalloc(sizeof(xmlChar*) * numNamespaces * 2));
+        for (int i = 0; i &lt; numNamespaces * 2 ; i++)
</ins><span class="cx">             callback-&gt;namespaces[i] = xmlStrdup(namespaces[i]);
</span><del>-        callback-&gt;nb_attributes = nb_attributes;
-        callback-&gt;nb_defaulted = nb_defaulted;
-        callback-&gt;attributes = static_cast&lt;xmlChar**&gt;(xmlMalloc(sizeof(xmlChar*) * nb_attributes * 5));
-        for (int i = 0; i &lt; nb_attributes; i++) {
</del><ins>+        callback-&gt;numAttributes = numAttributes;
+        callback-&gt;numDefaulted = numDefaulted;
+        callback-&gt;attributes = static_cast&lt;xmlChar**&gt;(xmlMalloc(sizeof(xmlChar*) * numAttributes * 5));
+        for (int i = 0; i &lt; numAttributes; i++) {
</ins><span class="cx">             // Each attribute has 5 elements in the array:
</span><span class="cx">             // name, prefix, uri, value and an end pointer.
</span><span class="cx"> 
</span><span class="lines">@@ -219,29 +217,28 @@
</span><span class="cx">             xmlFree(xmlLocalName);
</span><span class="cx">             xmlFree(xmlPrefix);
</span><span class="cx">             xmlFree(xmlURI);
</span><del>-            for (int i = 0; i &lt; nb_namespaces * 2; i++)
</del><ins>+            for (int i = 0; i &lt; numNamespaces * 2; i++)
</ins><span class="cx">                 xmlFree(namespaces[i]);
</span><span class="cx">             xmlFree(namespaces);
</span><del>-            for (int i = 0; i &lt; nb_attributes; i++)
</del><ins>+            for (int i = 0; i &lt; numAttributes; i++) {
</ins><span class="cx">                 for (int j = 0; j &lt; 4; j++)
</span><span class="cx">                     xmlFree(attributes[i * 5 + j]);
</span><ins>+            }
</ins><span class="cx">             xmlFree(attributes);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         void call(XMLDocumentParser* parser) override
</span><span class="cx">         {
</span><del>-            parser-&gt;startElementNs(xmlLocalName, xmlPrefix, xmlURI,
-                                      nb_namespaces, const_cast&lt;const xmlChar**&gt;(namespaces),
-                                      nb_attributes, nb_defaulted, const_cast&lt;const xmlChar**&gt;(attributes));
</del><ins>+            parser-&gt;startElementNs(xmlLocalName, xmlPrefix, xmlURI, numNamespaces, const_cast&lt;const xmlChar**&gt;(namespaces), numAttributes, numDefaulted, const_cast&lt;const xmlChar**&gt;(attributes));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         xmlChar* xmlLocalName;
</span><span class="cx">         xmlChar* xmlPrefix;
</span><span class="cx">         xmlChar* xmlURI;
</span><del>-        int nb_namespaces;
</del><ins>+        int numNamespaces;
</ins><span class="cx">         xmlChar** namespaces;
</span><del>-        int nb_attributes;
-        int nb_defaulted;
</del><ins>+        int numAttributes;
+        int numDefaulted;
</ins><span class="cx">         xmlChar** attributes;
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="lines">@@ -729,10 +726,10 @@
</span><span class="cx"> };
</span><span class="cx"> typedef struct _xmlSAX2Namespace xmlSAX2Namespace;
</span><span class="cx"> 
</span><del>-static inline void handleNamespaceAttributes(Vector&lt;Attribute&gt;&amp; prefixedAttributes, const xmlChar** libxmlNamespaces, int nb_namespaces, ExceptionCode&amp; ec)
</del><ins>+static inline bool handleNamespaceAttributes(Vector&lt;Attribute&gt;&amp; prefixedAttributes, const xmlChar** libxmlNamespaces, int numNamespaces)
</ins><span class="cx"> {
</span><span class="cx">     xmlSAX2Namespace* namespaces = reinterpret_cast&lt;xmlSAX2Namespace*&gt;(libxmlNamespaces);
</span><del>-    for (int i = 0; i &lt; nb_namespaces; i++) {
</del><ins>+    for (int i = 0; i &lt; numNamespaces; i++) {
</ins><span class="cx">         AtomicString namespaceQName = xmlnsAtom;
</span><span class="cx">         AtomicString namespaceURI = toAtomicString(namespaces[i].uri);
</span><span class="cx">         if (namespaces[i].prefix)
</span><span class="lines">@@ -739,13 +736,12 @@
</span><span class="cx">             namespaceQName = &quot;xmlns:&quot; + toString(namespaces[i].prefix);
</span><span class="cx"> 
</span><span class="cx">         auto result = Element::parseAttributeName(XMLNSNames::xmlnsNamespaceURI, namespaceQName);
</span><del>-        if (result.hasException()) {
-            ec = result.releaseException().code();
-            return;
-        }
</del><ins>+        if (result.hasException())
+            return false;
</ins><span class="cx"> 
</span><span class="cx">         prefixedAttributes.append(Attribute(result.releaseReturnValue(), namespaceURI));
</span><span class="cx">     }
</span><ins>+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> struct _xmlSAX2Attributes {
</span><span class="lines">@@ -757,10 +753,10 @@
</span><span class="cx"> };
</span><span class="cx"> typedef struct _xmlSAX2Attributes xmlSAX2Attributes;
</span><span class="cx"> 
</span><del>-static inline void handleElementAttributes(Vector&lt;Attribute&gt;&amp; prefixedAttributes, const xmlChar** libxmlAttributes, int nb_attributes, ExceptionCode&amp; ec)
</del><ins>+static inline bool handleElementAttributes(Vector&lt;Attribute&gt;&amp; prefixedAttributes, const xmlChar** libxmlAttributes, int numAttributes)
</ins><span class="cx"> {
</span><span class="cx">     xmlSAX2Attributes* attributes = reinterpret_cast&lt;xmlSAX2Attributes*&gt;(libxmlAttributes);
</span><del>-    for (int i = 0; i &lt; nb_attributes; i++) {
</del><ins>+    for (int i = 0; i &lt; numAttributes; i++) {
</ins><span class="cx">         int valueLength = static_cast&lt;int&gt;(attributes[i].end - attributes[i].value);
</span><span class="cx">         AtomicString attrValue = toAtomicString(attributes[i].value, valueLength);
</span><span class="cx">         String attrPrefix = toString(attributes[i].prefix);
</span><span class="lines">@@ -768,13 +764,12 @@
</span><span class="cx">         AtomicString attrQName = attrPrefix.isEmpty() ? toAtomicString(attributes[i].localname) : attrPrefix + &quot;:&quot; + toString(attributes[i].localname);
</span><span class="cx"> 
</span><span class="cx">         auto result = Element::parseAttributeName(attrURI, attrQName);
</span><del>-        if (result.hasException()) {
-            ec = result.releaseException().code();
-            return;
-        }
</del><ins>+        if (result.hasException())
+            return false;
</ins><span class="cx"> 
</span><span class="cx">         prefixedAttributes.append(Attribute(result.releaseReturnValue(), attrValue));
</span><span class="cx">     }
</span><ins>+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // This is a hack around https://bugzilla.gnome.org/show_bug.cgi?id=502960
</span><span class="lines">@@ -790,15 +785,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void XMLDocumentParser::startElementNs(const xmlChar* xmlLocalName, const xmlChar* xmlPrefix, const xmlChar* xmlURI, int nb_namespaces,
-                                  const xmlChar** libxmlNamespaces, int nb_attributes, int nb_defaulted, const xmlChar** libxmlAttributes)
</del><ins>+void XMLDocumentParser::startElementNs(const xmlChar* xmlLocalName, const xmlChar* xmlPrefix, const xmlChar* xmlURI, int numNamespaces, const xmlChar** libxmlNamespaces, int numAttributes, int numDefaulted, const xmlChar** libxmlAttributes)
</ins><span class="cx"> {
</span><span class="cx">     if (isStopped())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (m_parserPaused) {
</span><del>-        m_pendingCallbacks-&gt;appendStartElementNSCallback(xmlLocalName, xmlPrefix, xmlURI, nb_namespaces, libxmlNamespaces,
-                                                         nb_attributes, nb_defaulted, libxmlAttributes);
</del><ins>+        m_pendingCallbacks-&gt;appendStartElementNSCallback(xmlLocalName, xmlPrefix, xmlURI, numNamespaces, libxmlNamespaces, numAttributes, numDefaulted, libxmlAttributes);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -828,17 +821,15 @@
</span><span class="cx">     auto newElement = m_currentNode-&gt;document().createElement(qName, true);
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;Attribute&gt; prefixedAttributes;
</span><del>-    ExceptionCode ec = 0;
-    handleNamespaceAttributes(prefixedAttributes, libxmlNamespaces, nb_namespaces, ec);
-    if (ec) {
</del><ins>+    if (!handleNamespaceAttributes(prefixedAttributes, libxmlNamespaces, numNamespaces)) {
</ins><span class="cx">         setAttributes(newElement.ptr(), prefixedAttributes, parserContentPolicy());
</span><span class="cx">         stopParsing();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    handleElementAttributes(prefixedAttributes, libxmlAttributes, nb_attributes, ec);
</del><ins>+    bool success = handleElementAttributes(prefixedAttributes, libxmlAttributes, numAttributes);
</ins><span class="cx">     setAttributes(newElement.ptr(), prefixedAttributes, parserContentPolicy());
</span><del>-    if (ec) {
</del><ins>+    if (!success) {
</ins><span class="cx">         stopParsing();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -1106,9 +1097,8 @@
</span><span class="cx"> static inline bool hackAroundLibXMLEntityBug(void* closure)
</span><span class="cx"> {
</span><span class="cx"> #if LIBXML_VERSION &gt;= 20627
</span><ins>+    // This bug has been fixed in libxml 2.6.27.
</ins><span class="cx">     UNUSED_PARAM(closure);
</span><del>-
-    // This bug has been fixed in libxml 2.6.27.
</del><span class="cx">     return false;
</span><span class="cx"> #else
</span><span class="cx">     return static_cast&lt;xmlParserCtxtPtr&gt;(closure)-&gt;node;
</span><span class="lines">@@ -1115,12 +1105,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void startElementNsHandler(void* closure, const xmlChar* localname, const xmlChar* prefix, const xmlChar* uri, int nb_namespaces, const xmlChar** namespaces, int nb_attributes, int nb_defaulted, const xmlChar** libxmlAttributes)
</del><ins>+static void startElementNsHandler(void* closure, const xmlChar* localname, const xmlChar* prefix, const xmlChar* uri, int numNamespaces, const xmlChar** namespaces, int numAttributes, int numDefaulted, const xmlChar** libxmlAttributes)
</ins><span class="cx"> {
</span><span class="cx">     if (hackAroundLibXMLEntityBug(closure))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    getParser(closure)-&gt;startElementNs(localname, prefix, uri, nb_namespaces, namespaces, nb_attributes, nb_defaulted, libxmlAttributes);
</del><ins>+    getParser(closure)-&gt;startElementNs(localname, prefix, uri, numNamespaces, namespaces, numAttributes, numDefaulted, libxmlAttributes);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void endElementNsHandler(void* closure, const xmlChar*, const xmlChar*, const xmlChar*)
</span><span class="lines">@@ -1517,9 +1507,7 @@
</span><span class="cx">     bool gotAttributes;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-static void attributesStartElementNsHandler(void* closure, const xmlChar* xmlLocalName, const xmlChar* /*xmlPrefix*/,
-                                            const xmlChar* /*xmlURI*/, int /*nb_namespaces*/, const xmlChar** /*namespaces*/,
-                                            int nb_attributes, int /*nb_defaulted*/, const xmlChar** libxmlAttributes)
</del><ins>+static void attributesStartElementNsHandler(void* closure, const xmlChar* xmlLocalName, const xmlChar* /*xmlPrefix*/, const xmlChar* /*xmlURI*/, int /*numNamespaces*/, const xmlChar** /*namespaces*/, int numAttributes, int /*numDefaulted*/, const xmlChar** libxmlAttributes)
</ins><span class="cx"> {
</span><span class="cx">     if (strcmp(reinterpret_cast&lt;const char*&gt;(xmlLocalName), &quot;attrs&quot;) != 0)
</span><span class="cx">         return;
</span><span class="lines">@@ -1530,7 +1518,7 @@
</span><span class="cx">     state-&gt;gotAttributes = true;
</span><span class="cx"> 
</span><span class="cx">     xmlSAX2Attributes* attributes = reinterpret_cast&lt;xmlSAX2Attributes*&gt;(libxmlAttributes);
</span><del>-    for (int i = 0; i &lt; nb_attributes; i++) {
</del><ins>+    for (int i = 0; i &lt; numAttributes; i++) {
</ins><span class="cx">         String attrLocalName = toString(attributes[i].localname);
</span><span class="cx">         int valueLength = (int) (attributes[i].end - attributes[i].value);
</span><span class="cx">         String attrValue = toString(attributes[i].value, valueLength);
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2016-11-12  Darin Adler  &lt;darin@apple.com&gt;
+
+        Remove a few assorted uses of ExceptionCode
+        https://bugs.webkit.org/show_bug.cgi?id=164683
+
+        Reviewed by Chris Dumez.
+
+        * DOM/DOMDOMImplementation.mm:
+        (-[DOMImplementation createDocumentType:publicId:systemId:]):
+        Use raiseOnDOMError instead of much longer hand written equivalent.
+        (-[DOMImplementation createDocument:qualifiedName:doctype:]): Ditto.
+
+        * DOM/DOMDocument.mm:
+        (-[DOMDocument createEntityReference:]): Use raiseNotSupportedErrorException
+        so we are not using a specific exception code.
+
+        * DOM/DOMHTMLOptionsCollection.mm:
+        (-[DOMHTMLOptionsCollection add:index:]): Use raiseOnDOMError instead of
+        much longer hand written equivalent.
+        * DOM/DOMHTMLSelectElement.mm:
+        (-[DOMHTMLSelectElement add:before:]): Ditto. Also removed unneeded return
+        statement after calling a &quot;no return&quot; function.
+
+        * DOM/ExceptionHandlers.h: Removed overloads of raiseDOMException and
+        raiseOnDOMError functions that take ExceptionCode; keep the ones that take
+        Exception and ExceptionOr. Renamed the other overload of raiseDOMException
+        to raiseDOMErrorException; it is only used as the non-inline implementation
+        part of the inline raiseOnDOMError function.
+        * DOM/ExceptionHandlers.mm:
+        (raiseDOMErrorException): Renamed. Made the ExceptionCode overload be local
+        to this source file instead of in the header.
+        (raiseTypeErrorException): Updated for name change.
+        (raiseNotSupportedErrorException): Added.
+
</ins><span class="cx"> 2016-11-11  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Hovering over a slotted Text node clears hover state
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMDOMImplementationmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMDOMImplementation.mm (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMDOMImplementation.mm        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebKit/mac/DOM/DOMDOMImplementation.mm        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -65,23 +65,13 @@
</span><span class="cx"> - (DOMDocumentType *)createDocumentType:(NSString *)qualifiedName publicId:(NSString *)publicId systemId:(NSString *)systemId
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    auto result = unwrap(*self).createDocumentType(qualifiedName, publicId, systemId);
-    if (result.hasException()) {
-        raiseDOMException(result.releaseException().code());
-        return nil;
-    }
-    return kit(result.releaseReturnValue().ptr());
</del><ins>+    return kit(raiseOnDOMError(unwrap(*self).createDocumentType(qualifiedName, publicId, systemId)).ptr());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (DOMDocument *)createDocument:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName doctype:(DOMDocumentType *)doctype
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    auto result = unwrap(*self).createDocument(namespaceURI, qualifiedName, core(doctype));
-    if (result.hasException()) {
-        raiseDOMException(result.releaseException().code());
-        return nil;
-    }
-    return kit(result.releaseReturnValue().ptr());
</del><ins>+    return kit(raiseOnDOMError(unwrap(*self).createDocument(namespaceURI, qualifiedName, core(doctype))).ptr());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (DOMCSSStyleSheet *)createCSSStyleSheet:(NSString *)title media:(NSString *)media
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMDocumentmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMDocument.mm (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMDocument.mm        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebKit/mac/DOM/DOMDocument.mm        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -487,7 +487,7 @@
</span><span class="cx"> - (DOMEntityReference *)createEntityReference:(NSString *)name
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(name);
</span><del>-    raiseDOMException(WebCore::NOT_SUPPORTED_ERR);
</del><ins>+    raiseNotSupportedErrorException();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (DOMNodeList *)getElementsByTagName:(NSString *)tagname
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMHTMLOptionsCollectionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMHTMLOptionsCollection.mm (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMHTMLOptionsCollection.mm        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebKit/mac/DOM/DOMHTMLOptionsCollection.mm        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -90,9 +90,7 @@
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="cx">     if (!option)
</span><span class="cx">         raiseTypeErrorException();
</span><del>-    auto exception = IMPL-&gt;add(core(option), Optional&lt;WebCore::HTMLOptionsCollection::HTMLElementOrInt&gt;(static_cast&lt;int&gt;(index)));
-    if (exception.hasException())
-        raiseOnDOMError(exception.releaseException().code());
</del><ins>+    raiseOnDOMError(IMPL-&gt;add(core(option), Optional&lt;WebCore::HTMLOptionsCollection::HTMLElementOrInt&gt; { static_cast&lt;int&gt;(index) }));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)remove:(unsigned)index
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMHTMLSelectElementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMHTMLSelectElement.mm (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMHTMLSelectElement.mm        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebKit/mac/DOM/DOMHTMLSelectElement.mm        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -190,13 +190,9 @@
</span><span class="cx">         variantElement = &amp;downcast&lt;WebCore::HTMLOptionElement&gt;(coreElement);
</span><span class="cx">     else if (is&lt;WebCore::HTMLOptGroupElement&gt;(coreElement))
</span><span class="cx">         variantElement = &amp;downcast&lt;WebCore::HTMLOptGroupElement&gt;(coreElement);
</span><del>-    else {
</del><ins>+    else
</ins><span class="cx">         raiseTypeErrorException();
</span><del>-        return;
-    }
-    auto exception = IMPL-&gt;add(WTFMove(variantElement), WebCore::HTMLSelectElement::HTMLElementOrInt(core(before)));
-    if (exception.hasException())
-        raiseOnDOMError(exception.releaseException().code());
</del><ins>+    raiseOnDOMError(IMPL-&gt;add(WTFMove(variantElement), WebCore::HTMLSelectElement::HTMLElementOrInt(core(before))));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)remove:(int)index
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMExceptionHandlersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/ExceptionHandlers.h (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/ExceptionHandlers.h        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebKit/mac/DOM/ExceptionHandlers.h        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -27,29 +27,22 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;WebCore/ExceptionOr.h&gt;
</span><span class="cx"> 
</span><del>-NO_RETURN void raiseDOMException(WebCore::ExceptionCode);
-NO_RETURN void raiseDOMException(WebCore::Exception&amp;&amp;);
</del><span class="cx"> NO_RETURN void raiseTypeErrorException();
</span><ins>+NO_RETURN void raiseNotSupportedErrorException();
</ins><span class="cx"> 
</span><del>-void raiseOnDOMError(WebCore::ExceptionCode);
</del><ins>+NO_RETURN void raiseDOMErrorException(WebCore::Exception&amp;&amp;);
+template&lt;typename T&gt; T raiseOnDOMError(WebCore::ExceptionOr&lt;T&gt;&amp;&amp;);
</ins><span class="cx"> void raiseOnDOMError(WebCore::ExceptionOr&lt;void&gt;&amp;&amp;);
</span><del>-template&lt;typename T&gt; T raiseOnDOMError(WebCore::ExceptionOr&lt;T&gt;&amp;&amp;);
</del><span class="cx"> 
</span><del>-inline void raiseOnDOMError(WebCore::ExceptionCode code)
-{
-    if (code)
-        raiseDOMException(code);
-}
-
</del><span class="cx"> inline void raiseOnDOMError(WebCore::ExceptionOr&lt;void&gt;&amp;&amp; possibleException)
</span><span class="cx"> {
</span><span class="cx">     if (possibleException.hasException())
</span><del>-        raiseDOMException(possibleException.releaseException());
</del><ins>+        raiseDOMErrorException(possibleException.releaseException());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt; inline T raiseOnDOMError(WebCore::ExceptionOr&lt;T&gt;&amp;&amp; exceptionOrReturnValue)
</span><span class="cx"> {
</span><span class="cx">     if (exceptionOrReturnValue.hasException())
</span><del>-        raiseDOMException(exceptionOrReturnValue.releaseException());
</del><ins>+        raiseDOMErrorException(exceptionOrReturnValue.releaseException());
</ins><span class="cx">     return exceptionOrReturnValue.releaseReturnValue();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMExceptionHandlersmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/ExceptionHandlers.mm (208658 => 208659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/ExceptionHandlers.mm        2016-11-12 22:30:22 UTC (rev 208658)
+++ trunk/Source/WebKit/mac/DOM/ExceptionHandlers.mm        2016-11-12 22:31:17 UTC (rev 208659)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> NSString * const DOMEventException = @&quot;DOMEventException&quot;;
</span><span class="cx"> NSString * const DOMXPathException = @&quot;DOMXPathException&quot;;
</span><span class="cx"> 
</span><del>-void raiseDOMException(WebCore::ExceptionCode ec)
</del><ins>+static NO_RETURN void raiseDOMErrorException(WebCore::ExceptionCode ec)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(ec);
</span><span class="cx"> 
</span><span class="lines">@@ -74,10 +74,15 @@
</span><span class="cx"> 
</span><span class="cx"> void raiseTypeErrorException()
</span><span class="cx"> {
</span><del>-    raiseDOMException(WebCore::TypeError);
</del><ins>+    raiseDOMErrorException(WebCore::TypeError);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void raiseDOMException(WebCore::Exception&amp;&amp; exception)
</del><ins>+void raiseNotSupportedErrorException()
</ins><span class="cx"> {
</span><del>-    raiseDOMException(exception.code());
</del><ins>+    raiseDOMErrorException(WebCore::NOT_SUPPORTED_ERR);
</ins><span class="cx"> }
</span><ins>+
+void raiseDOMErrorException(WebCore::Exception&amp;&amp; exception)
+{
+    raiseDOMErrorException(exception.code());
+}
</ins></span></pre>
</div>
</div>

</body>
</html>