Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/float-truncation.html

Issue 1987983002: Remove Range.expand() method Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html style="-webkit-writing-mode:horizontal-tb;"> 1 <html style="-webkit-writing-mode:horizontal-tb;">
2 <head> 2 <head>
3 <style> 3 <style>
4 div.columns { 4 div.columns {
5 height: 200px; 5 height: 200px;
6 -webkit-columns: 2; 6 -webkit-columns: 2;
7 -webkit-column-gap: 0; 7 -webkit-column-gap: 0;
8 columns: 2; 8 columns: 2;
9 column-gap: 0; 9 column-gap: 0;
10 column-fill: auto; 10 column-fill: auto;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 <div class="float" id="f5"> 65 <div class="float" id="f5">
66 and one five line float 66 and one five line float
67 </div> 67 </div>
68 text runs here next to the float 68 text runs here next to the float
69 </div> 69 </div>
70 </div> 70 </div>
71 <pre id="result"></pre> 71 <pre id="result"></pre>
72 <script> 72 <script>
73 function floatOffset(float) 73 function floatOffset(float)
74 { 74 {
75 var range = document.createRange(); 75 var selection = getSelection();
76 range.setStart(float, 0); 76 selection.collapse(float, 0);
77 range.setEnd(float, 0); 77 selection.modify("extend", "forward", "word");
78 range.expand("word"); 78 var rect = selection.getRangeAt(0).getBoundingClientRect();
79 var rect = range.getBoundingClientRect();
80 var parentRect = float.parentNode.getBoundingClientRect(); 79 var parentRect = float.parentNode.getBoundingClientRect();
81 return { width: rect.left - parentRect.left, height: rect.top - parentRe ct.top }; 80 return { width: rect.left - parentRect.left, height: rect.top - parentRe ct.top };
82 } 81 }
83 82
84 var tests = [ 83 var tests = [
85 ["f1", 25, 0], 84 ["f1", 25, 0],
86 ["f2", 20, 0], 85 ["f2", 20, 0],
87 ["f3", 15, 0], 86 ["f3", 15, 0],
88 ["f4", 5, 0], 87 ["f4", 5, 0],
89 ["f5", 20, 0] 88 ["f5", 20, 0]
(...skipping 12 matching lines...) Expand all
102 } 101 }
103 } 102 }
104 103
105 if (window.testRunner) { 104 if (window.testRunner) {
106 testRunner.dumpAsText(); 105 testRunner.dumpAsText();
107 document.getElementById("tests").style.display = "none"; 106 document.getElementById("tests").style.display = "none";
108 } 107 }
109 108
110 document.getElementById("result").innerText = failures ? "FAIL: " + failures + " cases failed" : "PASS"; 109 document.getElementById("result").innerText = failures ? "FAIL: " + failures + " cases failed" : "PASS";
111 </script> 110 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698