Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Range / range-constructor.html
blob03f9eeb87f181c65426c11dea4f3d50d22fca864
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <div id="test-div">Test</div>
4 <script>
6 description('Tests that we can create instances of Range using new');
8 shouldBe('typeof new Range', '"object"');
9 shouldBe('Object.prototype.toString.call(new Range)', '"[object Range]"');
10 shouldBeTrue('new Range instanceof Range');
11 shouldBe('Object.getPrototypeOf(new Range)', 'Range.prototype');
13 var r = new Range();
14 r.selectNodeContents(document.getElementById('test-div'));
15 shouldBe('r.toString()', '"Test"')
17 var frame = document.createElement('iframe');
18 document.body.appendChild(frame);
19 var innerWindow = frame.contentWindow;
20 var innerDocument = frame.contentDocument;
21 innerDocument.body.textContent = 'Inner';
23 shouldBeTrue('new innerWindow.Range instanceof innerWindow.Range');
24 shouldBe('Object.getPrototypeOf(new innerWindow.Range)', 'innerWindow.Range.prototype');
26 var r = new innerWindow.Range();
27 r.selectNodeContents(innerDocument.body);
28 shouldBe('r.toString()', '"Inner"');
30 </script>