13 -webkit-column-gap: 10px;
21 border: solid rgba(0, 0, 255, 0.5);
22 -webkit-box-sizing: border-box;
26 -webkit-appearance: none;
29 background-color: lightblue;
32 input[type="range"]::-webkit-slider-thumb {
33 -webkit-appearance: none;
37 The blue borders should coincide with light blue squares, like this:
38 <span style="display: inline-block; background-color: lightblue; border: solid rgba(0, 0, 255, 0.5); width: 19px; height: 19px;"></span>.
39 There should be none of this:
40 <span style="display: inline-block; background-color: lightblue; width: 25px; height: 25px;"></span>
42 <span style="display: inline-block; border: solid rgba(0, 0, 255, 0.5); width: 19px; height: 19px;"></span>.
44 <div class="columns" id="t1">
49 <br><span id="t2">x y z</span>
53 <br><div id="t3">x y z</div>
57 <br><div id="t4"><br>y z</div>
61 <br><div><br><input id="t5" type="range"></div>
65 <br><div><br><img id="t6" style="width: 25px; height: 25px; background-color: lightblue;"></div>
69 Except here, where the blue border should be around the bigger slice of the blue square, on the right.
73 <div id="t7" style=" margin-top: 40px; width: 25px; height: 25px; background-color: lightblue;"></div>
77 function placeMarker(clientRect)
79 var marker = document.body.appendChild(document.createElement("div"));
80 marker.className = "marker";
81 marker.style.left = clientRect.left + "px";
82 marker.style.top = clientRect.top + "px";
83 marker.style.width = clientRect.width + "px";
84 marker.style.height = clientRect.height + "px";
87 function placeMarkersForRange(range, startOffset)
89 if (startOffset === undefined)
92 var clientRects = range.getClientRects();
93 for (var i = startOffset; i < clientRects.length; ++i)
94 placeMarker(clientRects[i]);
97 var range = document.createRange();
99 var textNode = document.getElementById("t1").firstChild.nextSibling.nextSibling;
100 range.setStart(textNode, 0);
101 range.setEnd(textNode, 5);
102 placeMarkersForRange(range);
104 textNode = document.getElementById("t2").firstChild;
105 range.setStart(textNode, 0);
106 range.setEnd(textNode, 5);
107 placeMarkersForRange(range);
109 textNode = document.getElementById("t3").firstChild;
110 range.setStart(textNode, 0);
111 range.setEnd(textNode, 5);
112 placeMarkersForRange(range);
114 var block = document.getElementById("t4");
115 range.selectNode(block);
116 placeMarkersForRange(range, 1);
118 var slider = document.getElementById("t5");
119 range.selectNode(slider);
120 placeMarkersForRange(range);
122 var image = document.getElementById("t6");
123 range.selectNode(image);
124 placeMarkersForRange(range);
126 var div = document.getElementById("t7");
127 range.selectNode(div);
128 placeMarkersForRange(div);