12 -webkit-column-gap: 10px;
20 border: solid rgba(0, 0, 255, 0.5);
21 -webkit-box-sizing: border-box;
25 -webkit-appearance: none;
28 background-color: lightblue;
31 input[type="range"]::-webkit-slider-thumb {
32 -webkit-appearance: none;
36 The blue borders should coincide with light blue squares, like this:
37 <span style="display: inline-block; background-color: lightblue; border: solid rgba(0, 0, 255, 0.5); width: 19px; height: 19px;"></span>.
38 There should be none of this:
39 <span style="display: inline-block; background-color: lightblue; width: 25px; height: 25px;"></span>
41 <span style="display: inline-block; border: solid rgba(0, 0, 255, 0.5); width: 19px; height: 19px;"></span>.
43 <div class="columns" id="t1">
48 <br><span id="t2">x y z</span>
52 <br><div id="t3">x y z</div>
56 <br><div id="t4"><br>y z</div>
60 <br><div><br><input id="t5" type="range"></div>
64 <br><div><br><img id="t6" style="width: 25px; height: 25px; background-color: lightblue;"></div>
68 Except here, where the blue border should be around the bigger slice of the blue square, on the right.
72 <div id="t7" style=" margin-top: 40px; width: 25px; height: 25px; background-color: lightblue;"></div>
76 function placeMarker(clientRect)
78 var marker = document.body.appendChild(document.createElement("div"));
79 marker.className = "marker";
80 marker.style.left = clientRect.left + "px";
81 marker.style.top = clientRect.top + "px";
82 marker.style.width = clientRect.width + "px";
83 marker.style.height = clientRect.height + "px";
86 function placeMarkersForRange(range, startOffset)
88 if (startOffset === undefined)
91 var clientRects = range.getClientRects();
92 for (var i = startOffset; i < clientRects.length; ++i)
93 placeMarker(clientRects[i]);
96 var range = document.createRange();
98 var textNode = document.getElementById("t1").firstChild.nextSibling.nextSibling;
99 range.setStart(textNode, 0);
100 range.setEnd(textNode, 5);
101 placeMarkersForRange(range);
103 textNode = document.getElementById("t2").firstChild;
104 range.setStart(textNode, 0);
105 range.setEnd(textNode, 5);
106 placeMarkersForRange(range);
108 textNode = document.getElementById("t3").firstChild;
109 range.setStart(textNode, 0);
110 range.setEnd(textNode, 5);
111 placeMarkersForRange(range);
113 var block = document.getElementById("t4");
114 range.selectNode(block);
115 placeMarkersForRange(range, 1);
117 var slider = document.getElementById("t5");
118 range.selectNode(slider);
119 placeMarkersForRange(range);
121 var image = document.getElementById("t6");
122 range.selectNode(image);
123 placeMarkersForRange(range);
125 var div = document.getElementById("t7");
126 range.selectNode(div);
127 placeMarkersForRange(div);