<!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>[206243] 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/206243">206243</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-09-21 16:50:24 -0700 (Wed, 21 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type
https://bugs.webkit.org/show_bug.cgi?id=162364

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Merge meter test changes from https://github.com/w3c/web-platform-tests/pull/3791.

* web-platform-tests/html/semantics/forms/the-meter-element/meter-expected.txt:
* web-platform-tests/html/semantics/forms/the-meter-element/meter.html:

Source/WebCore:

Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type.
It should throw a TypeError because their type is 'double' but we throw a
NOT_SUPPORTED_ERR.

Specification:
- https://html.spec.whatwg.org/#htmlmeterelement

Firefox and Chrome agree with the specification.

No new tests, updated existing test.

* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::setMin):
(WebCore::HTMLMeterElement::setMax):
(WebCore::HTMLMeterElement::setValue):
(WebCore::HTMLMeterElement::setLow):
(WebCore::HTMLMeterElement::setHigh):
(WebCore::HTMLMeterElement::setOptimum):
* html/HTMLMeterElement.h:
* html/HTMLMeterElement.idl:

LayoutTests:

Update existing test to reflect behavior change.

* fast/dom/HTMLMeterElement/script-tests/set-meter-properties.js:
* fast/dom/HTMLMeterElement/set-meter-properties-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLMeterElementscripttestssetmeterpropertiesjs">trunk/LayoutTests/fast/dom/HTMLMeterElement/script-tests/set-meter-properties.js</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLMeterElementsetmeterpropertiesexpectedtxt">trunk/LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsformsthemeterelementmeterexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsformsthemeterelementmeterhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter.html</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorimportedw3cwebplatformtestshtmlsemanticsformsthemeterelementmeterexpectedtxt">trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMeterElementcpp">trunk/Source/WebCore/html/HTMLMeterElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMeterElementh">trunk/Source/WebCore/html/HTMLMeterElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMeterElementidl">trunk/Source/WebCore/html/HTMLMeterElement.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (206242 => 206243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-09-21 23:20:01 UTC (rev 206242)
+++ trunk/LayoutTests/ChangeLog        2016-09-21 23:50:24 UTC (rev 206243)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2016-09-21  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type
+        https://bugs.webkit.org/show_bug.cgi?id=162364
+
+        Reviewed by Darin Adler.
+
+        Update existing test to reflect behavior change.
+
+        * fast/dom/HTMLMeterElement/script-tests/set-meter-properties.js:
+        * fast/dom/HTMLMeterElement/set-meter-properties-expected.txt:
+
+2016-09-21  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Fix serialization of HTML Element attributes
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=162356
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLMeterElementscripttestssetmeterpropertiesjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLMeterElement/script-tests/set-meter-properties.js (206242 => 206243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLMeterElement/script-tests/set-meter-properties.js        2016-09-21 23:20:01 UTC (rev 206242)
+++ trunk/LayoutTests/fast/dom/HTMLMeterElement/script-tests/set-meter-properties.js        2016-09-21 23:50:24 UTC (rev 206243)
</span><span class="lines">@@ -77,22 +77,22 @@
</span><span class="cx"> shouldBe(&quot;m.optimum&quot;, &quot;12.5&quot;);
</span><span class="cx"> 
</span><span class="cx"> debug(&quot;Set value to invalid value&quot;);
</span><del>-shouldThrow('m.value = &quot;value&quot;;', '&quot;NotSupportedError (DOM Exception 9): The operation is not supported.&quot;');
</del><ins>+shouldThrowErrorName('m.value = &quot;value&quot;;', 'TypeError');
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;Set min to NaN&quot;);
</span><del>-shouldThrow('m.min = NaN;', '&quot;NotSupportedError (DOM Exception 9): The operation is not supported.&quot;');
</del><ins>+shouldThrowErrorName('m.min = NaN;', 'TypeError');
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;Set max to Infinity&quot;);
</span><del>-shouldThrow('m.max = Infinity;', '&quot;NotSupportedError (DOM Exception 9): The operation is not supported.&quot;');
</del><ins>+shouldThrowErrorName('m.max = Infinity;', 'TypeError');
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;Set low to invalid value&quot;);
</span><del>-shouldThrow('m.low = &quot;low&quot;;', '&quot;NotSupportedError (DOM Exception 9): The operation is not supported.&quot;');
</del><ins>+shouldThrowErrorName('m.low = &quot;low&quot;;', 'TypeError');
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;Set high to NaN&quot;);
</span><del>-shouldThrow('m.high = NaN;', '&quot;NotSupportedError (DOM Exception 9): The operation is not supported.&quot;');
</del><ins>+shouldThrowErrorName('m.high = NaN;', 'TypeError');
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;Set optimum to Infinity&quot;);
</span><del>-shouldThrow('m.optimum = Infinity;', '&quot;NotSupportedError (DOM Exception 9): The operation is not supported.&quot;');
</del><ins>+shouldThrowErrorName('m.optimum = Infinity;', 'TypeError');
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;Set attributes to valid numbers&quot;);
</span><span class="cx"> m.setAttribute(&quot;min&quot;, 0);
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLMeterElementsetmeterpropertiesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties-expected.txt (206242 => 206243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties-expected.txt        2016-09-21 23:20:01 UTC (rev 206242)
+++ trunk/LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties-expected.txt        2016-09-21 23:50:24 UTC (rev 206243)
</span><span class="lines">@@ -44,17 +44,17 @@
</span><span class="cx"> PASS m.high is 200.0
</span><span class="cx"> PASS m.optimum is 12.5
</span><span class="cx"> Set value to invalid value
</span><del>-PASS m.value = &quot;value&quot;; threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
</del><ins>+PASS m.value = &quot;value&quot;; threw exception TypeError: The provided value is non-finite.
</ins><span class="cx"> Set min to NaN
</span><del>-PASS m.min = NaN; threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
</del><ins>+PASS m.min = NaN; threw exception TypeError: The provided value is non-finite.
</ins><span class="cx"> Set max to Infinity
</span><del>-PASS m.max = Infinity; threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
</del><ins>+PASS m.max = Infinity; threw exception TypeError: The provided value is non-finite.
</ins><span class="cx"> Set low to invalid value
</span><del>-PASS m.low = &quot;low&quot;; threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
</del><ins>+PASS m.low = &quot;low&quot;; threw exception TypeError: The provided value is non-finite.
</ins><span class="cx"> Set high to NaN
</span><del>-PASS m.high = NaN; threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
</del><ins>+PASS m.high = NaN; threw exception TypeError: The provided value is non-finite.
</ins><span class="cx"> Set optimum to Infinity
</span><del>-PASS m.optimum = Infinity; threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
</del><ins>+PASS m.optimum = Infinity; threw exception TypeError: The provided value is non-finite.
</ins><span class="cx"> Set attributes to valid numbers
</span><span class="cx"> PASS m.value is 5
</span><span class="cx"> PASS m.max is 10
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (206242 => 206243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-09-21 23:20:01 UTC (rev 206242)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-09-21 23:50:24 UTC (rev 206243)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2016-09-21  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type
+        https://bugs.webkit.org/show_bug.cgi?id=162364
+
+        Reviewed by Darin Adler.
+
+        Merge meter test changes from https://github.com/w3c/web-platform-tests/pull/3791.
+
+        * web-platform-tests/html/semantics/forms/the-meter-element/meter-expected.txt:
+        * web-platform-tests/html/semantics/forms/the-meter-element/meter.html:
+
+2016-09-21  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Fix serialization of HTML Element attributes
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=162356
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsformsthemeterelementmeterexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter-expected.txt (206242 => 206243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter-expected.txt        2016-09-21 23:20:01 UTC (rev 206242)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter-expected.txt        2016-09-21 23:50:24 UTC (rev 206243)
</span><span class="lines">@@ -3,7 +3,6 @@
</span><span class="cx"> 
</span><span class="cx"> PASS Default values 
</span><span class="cx"> PASS Setting values to min, max, low, high and optimum 
</span><del>-FAIL Invalid floating-point number values The operation is not supported.
</del><span class="cx"> PASS max &lt; min 
</span><span class="cx"> PASS value &lt; min 
</span><span class="cx"> PASS value &gt; max 
</span><span class="lines">@@ -13,6 +12,7 @@
</span><span class="cx"> PASS high &gt; max 
</span><span class="cx"> PASS optimum &lt; min 
</span><span class="cx"> PASS optimum &gt; max 
</span><ins>+PASS Invalid floating-point number values 
</ins><span class="cx"> PASS value must be 0 when a string is given 
</span><span class="cx"> PASS default value of min is 0 
</span><span class="cx"> PASS If min is not specified and value is smaller than the default value of min (i.e. 0), the actual value must be 0 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsformsthemeterelementmeterhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter.html (206242 => 206243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter.html        2016-09-21 23:20:01 UTC (rev 206242)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter.html        2016-09-21 23:50:24 UTC (rev 206243)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx">       var meters = [
</span><span class="cx">         {value: 0, expectedValue: 0, expectedMin: 0, expectedMax: 1.0, expectedLow: 0, expectedHigh: 1.0, expectedOptimum: 0.5, testname: &quot;Default values&quot;},
</span><span class="cx">         {value: 3, expectedValue: 3, min: -10.1, expectedMin: -10.1, max: 10.1, expectedMax: 10.1, low: -9.1, expectedLow: -9.1, high: 9.1, expectedHigh: 9.1, optimum: 3, expectedOptimum: 3, testname: &quot;Setting values to min, max, low, high and optimum&quot;},
</span><del>-        {value: &quot;foobar&quot;, expectedValue: 0, min: &quot;foobar&quot;, expectedMin: 0, max: &quot;foobar&quot;, expectedMax: 1.0, low: &quot;foobar&quot;, expectedLow: 0, high: &quot;foobar&quot;, expectedHigh: 1.0, optimum: &quot;foobar&quot;, expectedOptimum: 0.5, testname: &quot;Invalid floating-point number values&quot;},
</del><span class="cx">         {value: 0, expectedValue: 0, min: 0, expectedMin: 0, max: -1.0, expectedMax: 0, expectedLow: 0, expectedHigh: 0, expectedOptimum: 0, testname: &quot;max &lt; min&quot;},
</span><span class="cx">         {value: 0, expectedValue: 10, min: 10, expectedMin: 10, max: 20, expectedMax: 20, expectedLow: 10, expectedHigh: 20, expectedOptimum: 15, testname: &quot;value &lt; min&quot;},
</span><span class="cx">         {value: 30, expectedValue: 20, min: 10, expectedMin: 10, max: 20, expectedMax: 20, expectedLow: 10, expectedHigh: 20, expectedOptimum: 15, testname: &quot;value &gt; max&quot;},
</span><span class="lines">@@ -71,6 +70,15 @@
</span><span class="cx">           assert_equals(meter.optimum, m.expectedOptimum, &quot;optimum value&quot;);
</span><span class="cx">         }, m.testname);
</span><span class="cx">       }
</span><ins>+      test(function() {
+          var meter = document.createElement(&quot;meter&quot;);
+          assert_throws(new TypeError(), function() { meter.value = &quot;foobar&quot;; }, &quot;value attribute&quot;);
+          assert_throws(new TypeError(), function() { meter.min = &quot;foobar&quot;; }, &quot;min attribute&quot;);
+          assert_throws(new TypeError(), function() { meter.max = &quot;foobar&quot;; }, &quot;max attribute&quot;);
+          assert_throws(new TypeError(), function() { meter.low = &quot;foobar&quot;; }, &quot;low attribute&quot;);
+          assert_throws(new TypeError(), function() { meter.high = &quot;foobar&quot;; }, &quot;high attribute&quot;);
+          assert_throws(new TypeError(), function() { meter.optimum = &quot;foobar&quot;; }, &quot;optimum attribute&quot;);
+      }, &quot;Invalid floating-point number values&quot;);
</ins><span class="cx"> 
</span><span class="cx">     &lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot;&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorimportedw3cwebplatformtestshtmlsemanticsformsthemeterelementmeterexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter-expected.txt (206242 => 206243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter-expected.txt        2016-09-21 23:20:01 UTC (rev 206242)
+++ trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter-expected.txt        2016-09-21 23:50:24 UTC (rev 206243)
</span><span class="lines">@@ -3,7 +3,6 @@
</span><span class="cx"> 
</span><span class="cx"> PASS Default values 
</span><span class="cx"> PASS Setting values to min, max, low, high and optimum 
</span><del>-FAIL Invalid floating-point number values The operation is not supported.
</del><span class="cx"> PASS max &lt; min 
</span><span class="cx"> PASS value &lt; min 
</span><span class="cx"> PASS value &gt; max 
</span><span class="lines">@@ -13,6 +12,7 @@
</span><span class="cx"> PASS high &gt; max 
</span><span class="cx"> PASS optimum &lt; min 
</span><span class="cx"> PASS optimum &gt; max 
</span><ins>+PASS Invalid floating-point number values 
</ins><span class="cx"> PASS value must be 0 when a string is given 
</span><span class="cx"> PASS default value of min is 0 
</span><span class="cx"> PASS If min is not specified and value is smaller than the default value of min (i.e. 0), the actual value must be 0 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206242 => 206243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-21 23:20:01 UTC (rev 206242)
+++ trunk/Source/WebCore/ChangeLog        2016-09-21 23:50:24 UTC (rev 206243)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2016-09-21  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type
+        https://bugs.webkit.org/show_bug.cgi?id=162364
+
+        Reviewed by Darin Adler.
+
+        Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type.
+        It should throw a TypeError because their type is 'double' but we throw a
+        NOT_SUPPORTED_ERR.
+
+        Specification:
+        - https://html.spec.whatwg.org/#htmlmeterelement
+
+        Firefox and Chrome agree with the specification.
+
+        No new tests, updated existing test.
+
+        * html/HTMLMeterElement.cpp:
+        (WebCore::HTMLMeterElement::setMin):
+        (WebCore::HTMLMeterElement::setMax):
+        (WebCore::HTMLMeterElement::setValue):
+        (WebCore::HTMLMeterElement::setLow):
+        (WebCore::HTMLMeterElement::setHigh):
+        (WebCore::HTMLMeterElement::setOptimum):
+        * html/HTMLMeterElement.h:
+        * html/HTMLMeterElement.idl:
+
</ins><span class="cx"> 2016-09-21  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix open source build.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMeterElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMeterElement.cpp (206242 => 206243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMeterElement.cpp        2016-09-21 23:20:01 UTC (rev 206242)
+++ trunk/Source/WebCore/html/HTMLMeterElement.cpp        2016-09-21 23:50:24 UTC (rev 206243)
</span><span class="lines">@@ -83,12 +83,8 @@
</span><span class="cx">     return parseToDoubleForNumberType(attributeWithoutSynchronization(minAttr), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMeterElement::setMin(double min, ExceptionCode&amp; ec)
</del><ins>+void HTMLMeterElement::setMin(double min)
</ins><span class="cx"> {
</span><del>-    if (!std::isfinite(min)) {
-        ec = NOT_SUPPORTED_ERR;
-        return;
-    }
</del><span class="cx">     setAttributeWithoutSynchronization(minAttr, AtomicString::number(min));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -97,12 +93,8 @@
</span><span class="cx">     return std::max(parseToDoubleForNumberType(attributeWithoutSynchronization(maxAttr), std::max(1.0, min())), min());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMeterElement::setMax(double max, ExceptionCode&amp; ec)
</del><ins>+void HTMLMeterElement::setMax(double max)
</ins><span class="cx"> {
</span><del>-    if (!std::isfinite(max)) {
-        ec = NOT_SUPPORTED_ERR;
-        return;
-    }
</del><span class="cx">     setAttributeWithoutSynchronization(maxAttr, AtomicString::number(max));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -112,12 +104,8 @@
</span><span class="cx">     return std::min(std::max(value, min()), max());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMeterElement::setValue(double value, ExceptionCode&amp; ec)
</del><ins>+void HTMLMeterElement::setValue(double value)
</ins><span class="cx"> {
</span><del>-    if (!std::isfinite(value)) {
-        ec = NOT_SUPPORTED_ERR;
-        return;
-    }
</del><span class="cx">     setAttributeWithoutSynchronization(valueAttr, AtomicString::number(value));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -127,12 +115,8 @@
</span><span class="cx">     return std::min(std::max(low, min()), max());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMeterElement::setLow(double low, ExceptionCode&amp; ec)
</del><ins>+void HTMLMeterElement::setLow(double low)
</ins><span class="cx"> {
</span><del>-    if (!std::isfinite(low)) {
-        ec = NOT_SUPPORTED_ERR;
-        return;
-    }
</del><span class="cx">     setAttributeWithoutSynchronization(lowAttr, AtomicString::number(low));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -142,12 +126,8 @@
</span><span class="cx">     return std::min(std::max(high, low()), max());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMeterElement::setHigh(double high, ExceptionCode&amp; ec)
</del><ins>+void HTMLMeterElement::setHigh(double high)
</ins><span class="cx"> {
</span><del>-    if (!std::isfinite(high)) {
-        ec = NOT_SUPPORTED_ERR;
-        return;
-    }
</del><span class="cx">     setAttributeWithoutSynchronization(highAttr, AtomicString::number(high));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -157,12 +137,8 @@
</span><span class="cx">     return std::min(std::max(optimum, min()), max());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMeterElement::setOptimum(double optimum, ExceptionCode&amp; ec)
</del><ins>+void HTMLMeterElement::setOptimum(double optimum)
</ins><span class="cx"> {
</span><del>-    if (!std::isfinite(optimum)) {
-        ec = NOT_SUPPORTED_ERR;
-        return;
-    }
</del><span class="cx">     setAttributeWithoutSynchronization(optimumAttr, AtomicString::number(optimum));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMeterElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMeterElement.h (206242 => 206243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMeterElement.h        2016-09-21 23:20:01 UTC (rev 206242)
+++ trunk/Source/WebCore/html/HTMLMeterElement.h        2016-09-21 23:50:24 UTC (rev 206243)
</span><span class="lines">@@ -40,22 +40,22 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     double min() const;
</span><del>-    void setMin(double, ExceptionCode&amp;);
</del><ins>+    void setMin(double);
</ins><span class="cx"> 
</span><span class="cx">     double max() const;
</span><del>-    void setMax(double, ExceptionCode&amp;);
</del><ins>+    void setMax(double);
</ins><span class="cx"> 
</span><span class="cx">     double value() const;
</span><del>-    void setValue(double, ExceptionCode&amp;);
</del><ins>+    void setValue(double);
</ins><span class="cx"> 
</span><span class="cx">     double low() const;
</span><del>-    void setLow(double, ExceptionCode&amp;);
</del><ins>+    void setLow(double);
</ins><span class="cx"> 
</span><span class="cx">     double high() const;
</span><del>-    void setHigh(double, ExceptionCode&amp;);
</del><ins>+    void setHigh(double);
</ins><span class="cx"> 
</span><span class="cx">     double optimum() const;
</span><del>-    void setOptimum(double, ExceptionCode&amp;);
</del><ins>+    void setOptimum(double);
</ins><span class="cx"> 
</span><span class="cx">     double valueRatio() const;
</span><span class="cx">     GaugeRegion gaugeRegion() const;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMeterElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMeterElement.idl (206242 => 206243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMeterElement.idl        2016-09-21 23:20:01 UTC (rev 206242)
+++ trunk/Source/WebCore/html/HTMLMeterElement.idl        2016-09-21 23:50:24 UTC (rev 206243)
</span><span class="lines">@@ -20,11 +20,11 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=METER_ELEMENT
</span><span class="cx"> ] interface HTMLMeterElement : HTMLElement {
</span><del>-    [SetterRaisesException] attribute unrestricted double value;
-    [SetterRaisesException] attribute unrestricted double min;
-    [SetterRaisesException] attribute unrestricted double max;
-    [SetterRaisesException] attribute unrestricted double low;
-    [SetterRaisesException] attribute unrestricted double high;
-    [SetterRaisesException] attribute unrestricted double optimum;
</del><ins>+    attribute double value;
+    attribute double min;
+    attribute double max;
+    attribute double low;
+    attribute double high;
+    attribute double optimum;
</ins><span class="cx">     readonly attribute NodeList labels;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>