Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / mixed-editability-inline-height.html
blob7f46806af2337fb66aca722a65f5bf4a158736f1
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <body contenteditable="true">
4 <p id="p"><span id="span" contenteditable="false" style="display: inline-block; height: 10mm; width:10mm; background-color:yellow;"></span></p>
5 <div id="console"></div><!-- to keep the test target at the top of the document -->
6 <script>
7 description('This confirms that settin the caret before an empty non-editable inline-block element with height.');
9 var sel = getSelection();
10 var range = document.createRange();
11 var p = document.getElementById('p');
12 range.setStart(p, 0);
13 range.setEnd(p, 0); // not needed, but to ensure the same code path as bug 428986
14 sel.removeAllRanges();
15 sel.addRange(range);
16 shouldBe('getSelection().rangeCount', '1');
17 shouldBe('getSelection().anchorNode', 'p');
18 shouldBe('getSelection().anchorOffset', '0');
19 shouldBe('getSelection().anchorNode', 'getSelection().focusNode');
20 shouldBe('getSelection().anchorOffset', 'getSelection().focusOffset');
21 caretShouldBe('span.getBoundingClientRect().left');
23 sel.modify('move', 'forward', 'character');
24 shouldBe('getSelection().rangeCount', '1');
25 shouldBe('getSelection().anchorNode', 'p');
26 shouldBe('getSelection().anchorOffset', '1');
27 shouldBe('getSelection().anchorNode', 'getSelection().focusNode');
28 shouldBe('getSelection().anchorOffset', 'getSelection().focusOffset');
29 caretShouldBe('span.getBoundingClientRect().right', 2);
31 function caretShouldBe(expected, tolerance) {
32 if (!window.internals) {
33 debug("TEST SKIPPED, cannot test the caret position without window.internals");
34 return;
36 shouldBe('internals.absoluteCaretBounds().left', expected, false, tolerance);
38 </script>
39 </body>