<!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>[207788] 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/207788">207788</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-10-24 17:05:24 -0700 (Mon, 24 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>IndexedDB 2.0: Support new IDBKeyRange interfaces.
&lt;rdar://problem/28806929&gt; and https://bugs.webkit.org/show_bug.cgi?id=163910

Reviewed by Andy Estes.

Source/WebCore:

No new tests (Covered by additions to existing test)

The &quot;new IDBKeyRanges interfaces&quot; really just means adding the instance method IDBKeyRange.contains.

* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::contains):
* Modules/indexeddb/IDBKeyRange.h:
* Modules/indexeddb/IDBKeyRange.idl:

LayoutTests:

* storage/indexeddb/keyrange-expected.txt:
* storage/indexeddb/keyrange-private-expected.txt:
* storage/indexeddb/resources/keyrange.js:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbkeyrangeexpectedtxt">trunk/LayoutTests/storage/indexeddb/keyrange-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbkeyrangeprivateexpectedtxt">trunk/LayoutTests/storage/indexeddb/keyrange-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourceskeyrangejs">trunk/LayoutTests/storage/indexeddb/resources/keyrange.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangecpp">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangeh">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangeidl">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (207787 => 207788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-24 23:34:32 UTC (rev 207787)
+++ trunk/LayoutTests/ChangeLog        2016-10-25 00:05:24 UTC (rev 207788)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-10-24  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IndexedDB 2.0: Support new IDBKeyRange interfaces.
+        &lt;rdar://problem/28806929&gt; and https://bugs.webkit.org/show_bug.cgi?id=163910
+
+        Reviewed by Andy Estes.
+
+        * storage/indexeddb/keyrange-expected.txt:
+        * storage/indexeddb/keyrange-private-expected.txt:
+        * storage/indexeddb/resources/keyrange.js:
+
</ins><span class="cx"> 2016-10-23  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [DOMJIT] Add a way for DOMJIT::Patchpoint to express effects
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbkeyrangeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/keyrange-expected.txt (207787 => 207788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/keyrange-expected.txt        2016-10-24 23:34:32 UTC (rev 207787)
+++ trunk/LayoutTests/storage/indexeddb/keyrange-expected.txt        2016-10-25 00:05:24 UTC (rev 207788)
</span><span class="lines">@@ -9,6 +9,7 @@
</span><span class="cx"> PASS 'upper' in IDBKeyRange is false
</span><span class="cx"> PASS 'lowerOpen' in IDBKeyRange is false
</span><span class="cx"> PASS 'upperOpen' in IDBKeyRange is false
</span><ins>+PASS 'contains' in IDBKeyRange is false
</ins><span class="cx"> PASS 'only' in IDBKeyRange is true
</span><span class="cx"> PASS 'lowerBound' in IDBKeyRange is true
</span><span class="cx"> PASS 'upperBound' in IDBKeyRange is true
</span><span class="lines">@@ -19,6 +20,7 @@
</span><span class="cx"> PASS 'upper' in instance is true
</span><span class="cx"> PASS 'lowerOpen' in instance is true
</span><span class="cx"> PASS 'upperOpen' in instance is true
</span><ins>+PASS 'contains' in instance is true
</ins><span class="cx"> PASS 'only' in instance is false
</span><span class="cx"> PASS 'lowerBound' in instance is false
</span><span class="cx"> PASS 'upperBound' in instance is false
</span><span class="lines">@@ -29,186 +31,281 @@
</span><span class="cx"> PASS keyRange.upper is 1
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(1.1) is false
+PASS keyRange.contains(0.9) is false
+PASS keyRange.contains(1) is true
</ins><span class="cx"> IDBKeyRange.only(3.14)
</span><span class="cx"> PASS keyRange.lower is 3.14
</span><span class="cx"> PASS keyRange.upper is 3.14
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(3.24) is false
+PASS keyRange.contains(3.04) is false
+PASS keyRange.contains(3.14) is true
</ins><span class="cx"> IDBKeyRange.only('a')
</span><span class="cx"> PASS keyRange.lower is 'a'
</span><span class="cx"> PASS keyRange.upper is 'a'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains('aa') is false
+PASS keyRange.contains('') is false
+PASS keyRange.contains('a') is true
</ins><span class="cx"> IDBKeyRange.lowerBound(10,true)
</span><span class="cx"> PASS keyRange.lower is 10
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(10) is false
+PASS keyRange.contains(10.1) is true
+PASS keyRange.contains(9.9) is false
</ins><span class="cx"> IDBKeyRange.lowerBound(11,false)
</span><span class="cx"> PASS keyRange.lower is 11
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(11) is true
+PASS keyRange.contains(11.1) is true
+PASS keyRange.contains(10.9) is false
</ins><span class="cx"> IDBKeyRange.lowerBound(12,undefined)
</span><span class="cx"> PASS keyRange.lower is 12
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(12) is true
+PASS keyRange.contains(12.1) is true
+PASS keyRange.contains(11.9) is false
</ins><span class="cx"> IDBKeyRange.lowerBound(10.1,true)
</span><span class="cx"> PASS keyRange.lower is 10.1
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(10.1) is false
+PASS keyRange.contains(10.2) is true
+PASS keyRange.contains(10) is false
</ins><span class="cx"> IDBKeyRange.lowerBound(11.2,false)
</span><span class="cx"> PASS keyRange.lower is 11.2
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(11.2) is true
+PASS keyRange.contains(11.299999999999999) is true
+PASS keyRange.contains(11.1) is false
</ins><span class="cx"> IDBKeyRange.lowerBound(12.3,undefined)
</span><span class="cx"> PASS keyRange.lower is 12.3
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(12.3) is true
+PASS keyRange.contains(12.4) is true
+PASS keyRange.contains(12.200000000000001) is false
</ins><span class="cx"> IDBKeyRange.lowerBound('aa',true)
</span><span class="cx"> PASS keyRange.lower is 'aa'
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains('aa') is false
+PASS keyRange.contains('aaa') is true
+PASS keyRange.contains('a') is false
</ins><span class="cx"> IDBKeyRange.lowerBound('ab',false)
</span><span class="cx"> PASS keyRange.lower is 'ab'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains('ab') is true
+PASS keyRange.contains('abb') is true
+PASS keyRange.contains('a') is false
</ins><span class="cx"> IDBKeyRange.lowerBound('ac',undefined)
</span><span class="cx"> PASS keyRange.lower is 'ac'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains('ac') is true
+PASS keyRange.contains('acc') is true
+PASS keyRange.contains('a') is false
</ins><span class="cx"> IDBKeyRange.upperBound(20,true)
</span><span class="cx"> PASS keyRange.upper is 20
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains(20) is false
+PASS keyRange.contains(20.1) is false
+PASS keyRange.contains(19.9) is true
</ins><span class="cx"> IDBKeyRange.upperBound(21,false)
</span><span class="cx"> PASS keyRange.upper is 21
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains(21) is true
+PASS keyRange.contains(21.1) is false
+PASS keyRange.contains(20.9) is true
</ins><span class="cx"> IDBKeyRange.upperBound(22,undefined)
</span><span class="cx"> PASS keyRange.upper is 22
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains(22) is true
+PASS keyRange.contains(22.1) is false
+PASS keyRange.contains(21.9) is true
</ins><span class="cx"> IDBKeyRange.upperBound(20.2,true)
</span><span class="cx"> PASS keyRange.upper is 20.2
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains(20.2) is false
+PASS keyRange.contains(20.3) is false
+PASS keyRange.contains(20.099999999999998) is true
</ins><span class="cx"> IDBKeyRange.upperBound(21.3,false)
</span><span class="cx"> PASS keyRange.upper is 21.3
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains(21.3) is true
+PASS keyRange.contains(21.400000000000002) is false
+PASS keyRange.contains(21.2) is true
</ins><span class="cx"> IDBKeyRange.upperBound(22.4,undefined)
</span><span class="cx"> PASS keyRange.upper is 22.4
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains(22.4) is true
+PASS keyRange.contains(22.5) is false
+PASS keyRange.contains(22.299999999999997) is true
</ins><span class="cx"> IDBKeyRange.upperBound('ba',true)
</span><span class="cx"> PASS keyRange.upper is 'ba'
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains('ba') is false
+PASS keyRange.contains('baa') is false
+PASS keyRange.contains('b') is true
</ins><span class="cx"> IDBKeyRange.upperBound('bb',false)
</span><span class="cx"> PASS keyRange.upper is 'bb'
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains('bb') is true
+PASS keyRange.contains('bbb') is false
+PASS keyRange.contains('b') is true
</ins><span class="cx"> IDBKeyRange.upperBound('bc',undefined)
</span><span class="cx"> PASS keyRange.upper is 'bc'
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains('bc') is true
+PASS keyRange.contains('bcc') is false
+PASS keyRange.contains('b') is true
</ins><span class="cx"> IDBKeyRange.bound(30,40, undefined, undefined)
</span><span class="cx"> PASS keyRange.lower is 30
</span><span class="cx"> PASS keyRange.upper is 40
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(30) is true
+PASS keyRange.contains(40) is true
</ins><span class="cx"> IDBKeyRange.bound(31,41, false, false)
</span><span class="cx"> PASS keyRange.lower is 31
</span><span class="cx"> PASS keyRange.upper is 41
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(31) is true
+PASS keyRange.contains(41) is true
</ins><span class="cx"> IDBKeyRange.bound(32,42, false, true)
</span><span class="cx"> PASS keyRange.lower is 32
</span><span class="cx"> PASS keyRange.upper is 42
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(32) is true
+PASS keyRange.contains(42) is false
</ins><span class="cx"> IDBKeyRange.bound(33,43, true, false)
</span><span class="cx"> PASS keyRange.lower is 33
</span><span class="cx"> PASS keyRange.upper is 43
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(33) is false
+PASS keyRange.contains(43) is true
</ins><span class="cx"> IDBKeyRange.bound(34,44, true, true)
</span><span class="cx"> PASS keyRange.lower is 34
</span><span class="cx"> PASS keyRange.upper is 44
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(34) is false
+PASS keyRange.contains(44) is false
</ins><span class="cx"> IDBKeyRange.bound(30.1,40.2, undefined, undefined)
</span><span class="cx"> PASS keyRange.lower is 30.1
</span><span class="cx"> PASS keyRange.upper is 40.2
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(30.1) is true
+PASS keyRange.contains(40.2) is true
</ins><span class="cx"> IDBKeyRange.bound(31.3,41.4, false, false)
</span><span class="cx"> PASS keyRange.lower is 31.3
</span><span class="cx"> PASS keyRange.upper is 41.4
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(31.3) is true
+PASS keyRange.contains(41.4) is true
</ins><span class="cx"> IDBKeyRange.bound(32.5,42.6, false, true)
</span><span class="cx"> PASS keyRange.lower is 32.5
</span><span class="cx"> PASS keyRange.upper is 42.6
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(32.5) is true
+PASS keyRange.contains(42.6) is false
</ins><span class="cx"> IDBKeyRange.bound(33.7,43.8, true, false)
</span><span class="cx"> PASS keyRange.lower is 33.7
</span><span class="cx"> PASS keyRange.upper is 43.8
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(33.7) is false
+PASS keyRange.contains(43.8) is true
</ins><span class="cx"> IDBKeyRange.bound(34.9,44, true, true)
</span><span class="cx"> PASS keyRange.lower is 34.9
</span><span class="cx"> PASS keyRange.upper is 44
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(34.9) is false
+PASS keyRange.contains(44) is false
</ins><span class="cx"> IDBKeyRange.bound('aaa','aba', false, false)
</span><span class="cx"> PASS keyRange.lower is 'aaa'
</span><span class="cx"> PASS keyRange.upper is 'aba'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains('aaa') is true
+PASS keyRange.contains('aba') is true
</ins><span class="cx"> IDBKeyRange.bound('aab','abb', undefined, undefined)
</span><span class="cx"> PASS keyRange.lower is 'aab'
</span><span class="cx"> PASS keyRange.upper is 'abb'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains('aab') is true
+PASS keyRange.contains('abb') is true
</ins><span class="cx"> IDBKeyRange.bound('aac','abc', false, false)
</span><span class="cx"> PASS keyRange.lower is 'aac'
</span><span class="cx"> PASS keyRange.upper is 'abc'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains('aac') is true
+PASS keyRange.contains('abc') is true
</ins><span class="cx"> IDBKeyRange.bound('aad','abd', false, true)
</span><span class="cx"> PASS keyRange.lower is 'aad'
</span><span class="cx"> PASS keyRange.upper is 'abd'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains('aad') is true
+PASS keyRange.contains('abd') is false
</ins><span class="cx"> IDBKeyRange.bound('aae','abe', true, false)
</span><span class="cx"> PASS keyRange.lower is 'aae'
</span><span class="cx"> PASS keyRange.upper is 'abe'
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains('aae') is false
+PASS keyRange.contains('abe') is true
</ins><span class="cx"> IDBKeyRange.bound('aaf','abf', true, true)
</span><span class="cx"> PASS keyRange.lower is 'aaf'
</span><span class="cx"> PASS keyRange.upper is 'abf'
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains('aaf') is false
+PASS keyRange.contains('abf') is false
</ins><span class="cx"> Passing an invalid key into only({})
</span><span class="cx"> Expecting exception from IDBKeyRange.only({})
</span><span class="cx"> PASS Exception was thrown.
</span><span class="lines">@@ -270,6 +367,12 @@
</span><span class="cx"> PASS ename is 'DataError'
</span><span class="cx"> Exception message: The data provided does not meet requirements.
</span><span class="cx"> Equal keys, none of the bounds is open, bound(4, 4, false, false)
</span><ins>+Passing an invalid key in to IDBKeyRange.contains({})
+Expecting exception from invalidKeyKeyRange.contains({})
+PASS Exception was thrown.
+PASS code is 0
+PASS ename is 'DataError'
+Exception message: Failed to execute 'contains' on 'IDBKeyRange': The passed-in value is not a valid IndexedDB key.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbkeyrangeprivateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/keyrange-private-expected.txt (207787 => 207788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/keyrange-private-expected.txt        2016-10-24 23:34:32 UTC (rev 207787)
+++ trunk/LayoutTests/storage/indexeddb/keyrange-private-expected.txt        2016-10-25 00:05:24 UTC (rev 207788)
</span><span class="lines">@@ -9,6 +9,7 @@
</span><span class="cx"> PASS 'upper' in IDBKeyRange is false
</span><span class="cx"> PASS 'lowerOpen' in IDBKeyRange is false
</span><span class="cx"> PASS 'upperOpen' in IDBKeyRange is false
</span><ins>+PASS 'contains' in IDBKeyRange is false
</ins><span class="cx"> PASS 'only' in IDBKeyRange is true
</span><span class="cx"> PASS 'lowerBound' in IDBKeyRange is true
</span><span class="cx"> PASS 'upperBound' in IDBKeyRange is true
</span><span class="lines">@@ -19,6 +20,7 @@
</span><span class="cx"> PASS 'upper' in instance is true
</span><span class="cx"> PASS 'lowerOpen' in instance is true
</span><span class="cx"> PASS 'upperOpen' in instance is true
</span><ins>+PASS 'contains' in instance is true
</ins><span class="cx"> PASS 'only' in instance is false
</span><span class="cx"> PASS 'lowerBound' in instance is false
</span><span class="cx"> PASS 'upperBound' in instance is false
</span><span class="lines">@@ -29,186 +31,281 @@
</span><span class="cx"> PASS keyRange.upper is 1
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(1.1) is false
+PASS keyRange.contains(0.9) is false
+PASS keyRange.contains(1) is true
</ins><span class="cx"> IDBKeyRange.only(3.14)
</span><span class="cx"> PASS keyRange.lower is 3.14
</span><span class="cx"> PASS keyRange.upper is 3.14
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(3.24) is false
+PASS keyRange.contains(3.04) is false
+PASS keyRange.contains(3.14) is true
</ins><span class="cx"> IDBKeyRange.only('a')
</span><span class="cx"> PASS keyRange.lower is 'a'
</span><span class="cx"> PASS keyRange.upper is 'a'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains('aa') is false
+PASS keyRange.contains('') is false
+PASS keyRange.contains('a') is true
</ins><span class="cx"> IDBKeyRange.lowerBound(10,true)
</span><span class="cx"> PASS keyRange.lower is 10
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(10) is false
+PASS keyRange.contains(10.1) is true
+PASS keyRange.contains(9.9) is false
</ins><span class="cx"> IDBKeyRange.lowerBound(11,false)
</span><span class="cx"> PASS keyRange.lower is 11
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(11) is true
+PASS keyRange.contains(11.1) is true
+PASS keyRange.contains(10.9) is false
</ins><span class="cx"> IDBKeyRange.lowerBound(12,undefined)
</span><span class="cx"> PASS keyRange.lower is 12
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(12) is true
+PASS keyRange.contains(12.1) is true
+PASS keyRange.contains(11.9) is false
</ins><span class="cx"> IDBKeyRange.lowerBound(10.1,true)
</span><span class="cx"> PASS keyRange.lower is 10.1
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(10.1) is false
+PASS keyRange.contains(10.2) is true
+PASS keyRange.contains(10) is false
</ins><span class="cx"> IDBKeyRange.lowerBound(11.2,false)
</span><span class="cx"> PASS keyRange.lower is 11.2
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(11.2) is true
+PASS keyRange.contains(11.299999999999999) is true
+PASS keyRange.contains(11.1) is false
</ins><span class="cx"> IDBKeyRange.lowerBound(12.3,undefined)
</span><span class="cx"> PASS keyRange.lower is 12.3
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(12.3) is true
+PASS keyRange.contains(12.4) is true
+PASS keyRange.contains(12.200000000000001) is false
</ins><span class="cx"> IDBKeyRange.lowerBound('aa',true)
</span><span class="cx"> PASS keyRange.lower is 'aa'
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains('aa') is false
+PASS keyRange.contains('aaa') is true
+PASS keyRange.contains('a') is false
</ins><span class="cx"> IDBKeyRange.lowerBound('ab',false)
</span><span class="cx"> PASS keyRange.lower is 'ab'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains('ab') is true
+PASS keyRange.contains('abb') is true
+PASS keyRange.contains('a') is false
</ins><span class="cx"> IDBKeyRange.lowerBound('ac',undefined)
</span><span class="cx"> PASS keyRange.lower is 'ac'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upper is undefined.
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains('ac') is true
+PASS keyRange.contains('acc') is true
+PASS keyRange.contains('a') is false
</ins><span class="cx"> IDBKeyRange.upperBound(20,true)
</span><span class="cx"> PASS keyRange.upper is 20
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains(20) is false
+PASS keyRange.contains(20.1) is false
+PASS keyRange.contains(19.9) is true
</ins><span class="cx"> IDBKeyRange.upperBound(21,false)
</span><span class="cx"> PASS keyRange.upper is 21
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains(21) is true
+PASS keyRange.contains(21.1) is false
+PASS keyRange.contains(20.9) is true
</ins><span class="cx"> IDBKeyRange.upperBound(22,undefined)
</span><span class="cx"> PASS keyRange.upper is 22
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains(22) is true
+PASS keyRange.contains(22.1) is false
+PASS keyRange.contains(21.9) is true
</ins><span class="cx"> IDBKeyRange.upperBound(20.2,true)
</span><span class="cx"> PASS keyRange.upper is 20.2
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains(20.2) is false
+PASS keyRange.contains(20.3) is false
+PASS keyRange.contains(20.099999999999998) is true
</ins><span class="cx"> IDBKeyRange.upperBound(21.3,false)
</span><span class="cx"> PASS keyRange.upper is 21.3
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains(21.3) is true
+PASS keyRange.contains(21.400000000000002) is false
+PASS keyRange.contains(21.2) is true
</ins><span class="cx"> IDBKeyRange.upperBound(22.4,undefined)
</span><span class="cx"> PASS keyRange.upper is 22.4
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains(22.4) is true
+PASS keyRange.contains(22.5) is false
+PASS keyRange.contains(22.299999999999997) is true
</ins><span class="cx"> IDBKeyRange.upperBound('ba',true)
</span><span class="cx"> PASS keyRange.upper is 'ba'
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains('ba') is false
+PASS keyRange.contains('baa') is false
+PASS keyRange.contains('b') is true
</ins><span class="cx"> IDBKeyRange.upperBound('bb',false)
</span><span class="cx"> PASS keyRange.upper is 'bb'
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains('bb') is true
+PASS keyRange.contains('bbb') is false
+PASS keyRange.contains('b') is true
</ins><span class="cx"> IDBKeyRange.upperBound('bc',undefined)
</span><span class="cx"> PASS keyRange.upper is 'bc'
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><span class="cx"> PASS keyRange.lower is undefined.
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><ins>+PASS keyRange.contains('bc') is true
+PASS keyRange.contains('bcc') is false
+PASS keyRange.contains('b') is true
</ins><span class="cx"> IDBKeyRange.bound(30,40, undefined, undefined)
</span><span class="cx"> PASS keyRange.lower is 30
</span><span class="cx"> PASS keyRange.upper is 40
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(30) is true
+PASS keyRange.contains(40) is true
</ins><span class="cx"> IDBKeyRange.bound(31,41, false, false)
</span><span class="cx"> PASS keyRange.lower is 31
</span><span class="cx"> PASS keyRange.upper is 41
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(31) is true
+PASS keyRange.contains(41) is true
</ins><span class="cx"> IDBKeyRange.bound(32,42, false, true)
</span><span class="cx"> PASS keyRange.lower is 32
</span><span class="cx"> PASS keyRange.upper is 42
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(32) is true
+PASS keyRange.contains(42) is false
</ins><span class="cx"> IDBKeyRange.bound(33,43, true, false)
</span><span class="cx"> PASS keyRange.lower is 33
</span><span class="cx"> PASS keyRange.upper is 43
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(33) is false
+PASS keyRange.contains(43) is true
</ins><span class="cx"> IDBKeyRange.bound(34,44, true, true)
</span><span class="cx"> PASS keyRange.lower is 34
</span><span class="cx"> PASS keyRange.upper is 44
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(34) is false
+PASS keyRange.contains(44) is false
</ins><span class="cx"> IDBKeyRange.bound(30.1,40.2, undefined, undefined)
</span><span class="cx"> PASS keyRange.lower is 30.1
</span><span class="cx"> PASS keyRange.upper is 40.2
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(30.1) is true
+PASS keyRange.contains(40.2) is true
</ins><span class="cx"> IDBKeyRange.bound(31.3,41.4, false, false)
</span><span class="cx"> PASS keyRange.lower is 31.3
</span><span class="cx"> PASS keyRange.upper is 41.4
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(31.3) is true
+PASS keyRange.contains(41.4) is true
</ins><span class="cx"> IDBKeyRange.bound(32.5,42.6, false, true)
</span><span class="cx"> PASS keyRange.lower is 32.5
</span><span class="cx"> PASS keyRange.upper is 42.6
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(32.5) is true
+PASS keyRange.contains(42.6) is false
</ins><span class="cx"> IDBKeyRange.bound(33.7,43.8, true, false)
</span><span class="cx"> PASS keyRange.lower is 33.7
</span><span class="cx"> PASS keyRange.upper is 43.8
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains(33.7) is false
+PASS keyRange.contains(43.8) is true
</ins><span class="cx"> IDBKeyRange.bound(34.9,44, true, true)
</span><span class="cx"> PASS keyRange.lower is 34.9
</span><span class="cx"> PASS keyRange.upper is 44
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains(34.9) is false
+PASS keyRange.contains(44) is false
</ins><span class="cx"> IDBKeyRange.bound('aaa','aba', false, false)
</span><span class="cx"> PASS keyRange.lower is 'aaa'
</span><span class="cx"> PASS keyRange.upper is 'aba'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains('aaa') is true
+PASS keyRange.contains('aba') is true
</ins><span class="cx"> IDBKeyRange.bound('aab','abb', undefined, undefined)
</span><span class="cx"> PASS keyRange.lower is 'aab'
</span><span class="cx"> PASS keyRange.upper is 'abb'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains('aab') is true
+PASS keyRange.contains('abb') is true
</ins><span class="cx"> IDBKeyRange.bound('aac','abc', false, false)
</span><span class="cx"> PASS keyRange.lower is 'aac'
</span><span class="cx"> PASS keyRange.upper is 'abc'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains('aac') is true
+PASS keyRange.contains('abc') is true
</ins><span class="cx"> IDBKeyRange.bound('aad','abd', false, true)
</span><span class="cx"> PASS keyRange.lower is 'aad'
</span><span class="cx"> PASS keyRange.upper is 'abd'
</span><span class="cx"> PASS keyRange.lowerOpen is false
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains('aad') is true
+PASS keyRange.contains('abd') is false
</ins><span class="cx"> IDBKeyRange.bound('aae','abe', true, false)
</span><span class="cx"> PASS keyRange.lower is 'aae'
</span><span class="cx"> PASS keyRange.upper is 'abe'
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upperOpen is false
</span><ins>+PASS keyRange.contains('aae') is false
+PASS keyRange.contains('abe') is true
</ins><span class="cx"> IDBKeyRange.bound('aaf','abf', true, true)
</span><span class="cx"> PASS keyRange.lower is 'aaf'
</span><span class="cx"> PASS keyRange.upper is 'abf'
</span><span class="cx"> PASS keyRange.lowerOpen is true
</span><span class="cx"> PASS keyRange.upperOpen is true
</span><ins>+PASS keyRange.contains('aaf') is false
+PASS keyRange.contains('abf') is false
</ins><span class="cx"> Passing an invalid key into only({})
</span><span class="cx"> Expecting exception from IDBKeyRange.only({})
</span><span class="cx"> PASS Exception was thrown.
</span><span class="lines">@@ -270,6 +367,12 @@
</span><span class="cx"> PASS ename is 'DataError'
</span><span class="cx"> Exception message: The data provided does not meet requirements.
</span><span class="cx"> Equal keys, none of the bounds is open, bound(4, 4, false, false)
</span><ins>+Passing an invalid key in to IDBKeyRange.contains({})
+Expecting exception from invalidKeyKeyRange.contains({})
+PASS Exception was thrown.
+PASS code is 0
+PASS ename is 'DataError'
+Exception message: Failed to execute 'contains' on 'IDBKeyRange': The passed-in value is not a valid IndexedDB key.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourceskeyrangejs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/resources/keyrange.js (207787 => 207788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/keyrange.js        2016-10-24 23:34:32 UTC (rev 207787)
+++ trunk/LayoutTests/storage/indexeddb/resources/keyrange.js        2016-10-25 00:05:24 UTC (rev 207788)
</span><span class="lines">@@ -5,6 +5,38 @@
</span><span class="cx"> 
</span><span class="cx"> description(&quot;Test IndexedDB's KeyRange.&quot;);
</span><span class="cx"> 
</span><ins>+function incrementedKey(key)
+{
+    if (typeof key == &quot;number&quot;)
+        return key + 0.1;
+    if (typeof key == &quot;string&quot;) {
+        if (key.length &lt; 2)
+            testFailed(&quot;String key is too short: &quot; + key);
+        if (key.charAt(key.length - 1) != &quot;'&quot;)
+            testFailed(&quot;Completely unexpected string key: &quot; + key);
+        
+        return key.substring(0, key.length - 1) + key.charAt(key.length - 2) + &quot;'&quot;;
+    }
+    
+    testFailed(&quot;Incrementing unexpected key type: &quot; + typeof key);
+}
+
+function decrementedKey(key)
+{
+    if (typeof key == &quot;number&quot;)
+        return key - 0.1;
+    if (typeof key == &quot;string&quot;) {
+        if (key.length &lt; 3)
+            testFailed(&quot;String key is too short: &quot; + key);
+        if (key.charAt(key.length - 1) != &quot;'&quot;)
+            testFailed(&quot;Completely unexpected string key: &quot; + key);
+        
+        return key.substring(0, key.length - 2) + &quot;'&quot;;
+    }
+    
+    testFailed(&quot;Decrementing unexpected key type: &quot; + typeof key);
+}
+
</ins><span class="cx"> function checkSingleKeyRange(value)
</span><span class="cx"> {
</span><span class="cx">     keyRange = evalAndLog(&quot;IDBKeyRange.only(&quot; + value + &quot;)&quot;);
</span><span class="lines">@@ -12,6 +44,9 @@
</span><span class="cx">     shouldBe(&quot;keyRange.upper&quot;, &quot;&quot; + value);
</span><span class="cx">     shouldBeFalse(&quot;keyRange.lowerOpen&quot;);
</span><span class="cx">     shouldBeFalse(&quot;keyRange.upperOpen&quot;);
</span><ins>+    shouldBeFalse(&quot;keyRange.contains(&quot; + incrementedKey(value) + &quot;)&quot;);
+    shouldBeFalse(&quot;keyRange.contains(&quot; + decrementedKey(value) + &quot;)&quot;);
+    shouldBeTrue(&quot;keyRange.contains(&quot; + value + &quot;)&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function checkLowerBoundKeyRange(value, open)
</span><span class="lines">@@ -23,6 +58,14 @@
</span><span class="cx">     shouldBe(&quot;keyRange.lowerOpen&quot;, &quot;&quot; + open);
</span><span class="cx">     shouldBeUndefined(&quot;keyRange.upper&quot;);
</span><span class="cx">     shouldBeTrue(&quot;keyRange.upperOpen&quot;);
</span><ins>+
+    if (open)
+        shouldBeFalse(&quot;keyRange.contains(&quot; + value + &quot;)&quot;);
+    else
+        shouldBeTrue(&quot;keyRange.contains(&quot; + value + &quot;)&quot;);
+
+    shouldBeTrue(&quot;keyRange.contains(&quot; + incrementedKey(value) + &quot;)&quot;);
+    shouldBeFalse(&quot;keyRange.contains(&quot; + decrementedKey(value) + &quot;)&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function checkUpperBoundKeyRange(value, open)
</span><span class="lines">@@ -34,6 +77,14 @@
</span><span class="cx">     shouldBe(&quot;keyRange.upperOpen&quot;, &quot;&quot; + open);
</span><span class="cx">     shouldBeUndefined(&quot;keyRange.lower&quot;);
</span><span class="cx">     shouldBeTrue(&quot;keyRange.lowerOpen&quot;);
</span><ins>+
+    if (open)
+        shouldBeFalse(&quot;keyRange.contains(&quot; + value + &quot;)&quot;);
+    else
+        shouldBeTrue(&quot;keyRange.contains(&quot; + value + &quot;)&quot;);
+
+    shouldBeFalse(&quot;keyRange.contains(&quot; + incrementedKey(value) + &quot;)&quot;);
+    shouldBeTrue(&quot;keyRange.contains(&quot; + decrementedKey(value) + &quot;)&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function checkBoundKeyRange(lower, upper, lowerOpen, upperOpen)
</span><span class="lines">@@ -47,6 +98,16 @@
</span><span class="cx">         upperOpen = false;
</span><span class="cx">     shouldBe(&quot;keyRange.lowerOpen&quot;, &quot;&quot; + lowerOpen);
</span><span class="cx">     shouldBe(&quot;keyRange.upperOpen&quot;, &quot;&quot; + upperOpen);
</span><ins>+    
+    if (lowerOpen)
+        shouldBeFalse(&quot;keyRange.contains(&quot; + lower + &quot;)&quot;);
+    else
+        shouldBeTrue(&quot;keyRange.contains(&quot; + lower + &quot;)&quot;);
+
+    if (upperOpen)
+        shouldBeFalse(&quot;keyRange.contains(&quot; + upper + &quot;)&quot;);
+    else
+        shouldBeTrue(&quot;keyRange.contains(&quot; + upper + &quot;)&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function test()
</span><span class="lines">@@ -56,6 +117,7 @@
</span><span class="cx">     shouldBeFalse(&quot;'upper' in IDBKeyRange&quot;);
</span><span class="cx">     shouldBeFalse(&quot;'lowerOpen' in IDBKeyRange&quot;);
</span><span class="cx">     shouldBeFalse(&quot;'upperOpen' in IDBKeyRange&quot;);
</span><ins>+    shouldBeFalse(&quot;'contains' in IDBKeyRange&quot;);
</ins><span class="cx">     shouldBeTrue(&quot;'only' in IDBKeyRange&quot;);
</span><span class="cx">     shouldBeTrue(&quot;'lowerBound' in IDBKeyRange&quot;);
</span><span class="cx">     shouldBeTrue(&quot;'upperBound' in IDBKeyRange&quot;);
</span><span class="lines">@@ -68,6 +130,7 @@
</span><span class="cx">     shouldBeTrue(&quot;'upper' in instance&quot;);
</span><span class="cx">     shouldBeTrue(&quot;'lowerOpen' in instance&quot;);
</span><span class="cx">     shouldBeTrue(&quot;'upperOpen' in instance&quot;);
</span><ins>+    shouldBeTrue(&quot;'contains' in instance&quot;);
</ins><span class="cx">     shouldBeFalse(&quot;'only' in instance&quot;);
</span><span class="cx">     shouldBeFalse(&quot;'lowerBound' in instance&quot;);
</span><span class="cx">     shouldBeFalse(&quot;'upperBound' in instance&quot;);
</span><span class="lines">@@ -150,6 +213,10 @@
</span><span class="cx"> 
</span><span class="cx">     debug(&quot;Equal keys, none of the bounds is open, bound(4, 4, false, false)&quot;);
</span><span class="cx">     IDBKeyRange.bound(4, 4, false, false);
</span><ins>+
+    debug(&quot;Passing an invalid key in to IDBKeyRange.contains({})&quot;);
+    eval(&quot;invalidKeyKeyRange = IDBKeyRange.only('a')&quot;);
+    evalAndExpectException(&quot;invalidKeyKeyRange.contains({})&quot;, &quot;0&quot;, &quot;'DataError'&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> test();
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207787 => 207788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-24 23:34:32 UTC (rev 207787)
+++ trunk/Source/WebCore/ChangeLog        2016-10-25 00:05:24 UTC (rev 207788)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-10-24  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IndexedDB 2.0: Support new IDBKeyRange interfaces.
+        &lt;rdar://problem/28806929&gt; and https://bugs.webkit.org/show_bug.cgi?id=163910
+
+        Reviewed by Andy Estes.
+
+        No new tests (Covered by additions to existing test)
+
+        The &quot;new IDBKeyRanges interfaces&quot; really just means adding the instance method IDBKeyRange.contains.
+
+        * Modules/indexeddb/IDBKeyRange.cpp:
+        (WebCore::IDBKeyRange::contains):
+        * Modules/indexeddb/IDBKeyRange.h:
+        * Modules/indexeddb/IDBKeyRange.idl:
+
</ins><span class="cx"> 2016-10-23  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [DOMJIT] Add a way for DOMJIT::Patchpoint to express effects
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp (207787 => 207788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp        2016-10-24 23:34:32 UTC (rev 207787)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp        2016-10-25 00:05:24 UTC (rev 207788)
</span><span class="lines">@@ -113,6 +113,33 @@
</span><span class="cx">     return m_lower &amp;&amp; m_upper &amp;&amp; !m_isLowerOpen &amp;&amp; !m_isUpperOpen &amp;&amp; m_lower-&gt;isEqual(*m_upper);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ExceptionOr&lt;bool&gt; IDBKeyRange::contains(JSC::ExecState&amp; state, JSC::JSValue keyValue)
+{
+    auto key = scriptValueToIDBKey(state, keyValue);
+    if (!key-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError, &quot;Failed to execute 'contains' on 'IDBKeyRange': The passed-in value is not a valid IndexedDB key.&quot; };
+
+    if (m_lower) {
+        int compare = m_lower-&gt;compare(key.get());
+
+        if (compare &gt; 0)
+            return false;
+        if (m_isLowerOpen &amp;&amp; !compare)
+            return false;
+    }
+
+    if (m_upper) {
+        int compare = m_upper-&gt;compare(key.get());
+
+        if (compare &lt; 0)
+            return false;
+        if (m_isUpperOpen &amp;&amp; !compare)
+            return false;
+    }
+
+    return true;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h (207787 => 207788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h        2016-10-24 23:34:32 UTC (rev 207787)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h        2016-10-25 00:05:24 UTC (rev 207788)
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx"> 
</span><span class="cx">     static ExceptionOr&lt;Ref&lt;IDBKeyRange&gt;&gt; bound(JSC::ExecState&amp;, JSC::JSValue lower, JSC::JSValue upper, bool lowerOpen, bool upperOpen);
</span><span class="cx"> 
</span><ins>+    ExceptionOr&lt;bool&gt; contains(JSC::ExecState&amp;, JSC::JSValue key);
+
</ins><span class="cx">     WEBCORE_EXPORT bool isOnlyKey() const;
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl (207787 => 207788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl        2016-10-24 23:34:32 UTC (rev 207787)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl        2016-10-25 00:05:24 UTC (rev 207788)
</span><span class="lines">@@ -37,4 +37,6 @@
</span><span class="cx">     [CallWith=ScriptState, MayThrowException] static IDBKeyRange lowerBound(any lower, optional boolean open = false);
</span><span class="cx">     [CallWith=ScriptState, MayThrowException] static IDBKeyRange upperBound(any upper, optional boolean open = false);
</span><span class="cx">     [CallWith=ScriptState, MayThrowException] static IDBKeyRange bound(any lower, any upper, optional boolean lowerOpen = false, optional boolean upperOpen = false);
</span><ins>+
+    [CallWith=ScriptState, MayThrowException] boolean contains(any key);
</ins><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>