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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/text/fit-content-with-element-boundaries.html

Issue 2725933002: Fix LayoutUnit snapping of widths in line breaker (Closed)
Patch Set: Add test cases for m_uncommittedWidth and !m_uncommittedWidth Created 3 years, 9 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
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <style>
5 div {
6 display: inline-block;
7 font-family: Consolas, 'Courier New', Courier, monospace;
8 line-height: 1;
9 }
10 img {
11 width: 1em;
12 height: 1em;
13 }
14 </style>
15
16 <div title="img (!m_uncommittedWidth)"><img src="../replaced/resources/1x1-blue. png"><img src="../replaced/resources/1x1-blue.png"><img src="../replaced/resourc es/1x1-blue.png"><img src="../replaced/resources/1x1-blue.png"><img src="../repl aced/resources/1x1-blue.png"><img src="../replaced/resources/1x1-blue.png"><img src="../replaced/resources/1x1-blue.png"><img src="../replaced/resources/1x1-blu e.png"><img src="../replaced/resources/1x1-blue.png"><img src="../replaced/resou rces/1x1-blue.png"></div>
17
18 <br>
19
20 <div title="text node (end with m_uncommittedWidth)"><span>a </span>a <span>a </ span>a <span>a </span>a <span>a </span>a <span>a </span>a <span>a </span>a <span >a </span>a <span>a </span>a <span>a </span>a <span>a </span>a</div>
21
22 <br>
23
24 <div title="text node (end with !m_uncommittedWidth)"><span>a </span>a <span>a </span>a <span>a </span>a <span>a </span>a <span>a </span>a <span>a </ span>a <span>a </span>a <span>a </span>a <span>a </span>a <span>a </span >a </div>
25
26 <br>
27 <div title="Real case from inspector"><span>(9) </span>[<span>1</span>, <span>2< /span>, <span>3</span>, <span>4</span>, <span>5</span>, <span>6</span>, <span>7< /span>, <span>8</span>, <span>9</span>]</div>
28
29 <script>
30 runTests();
31 function runTests() {
32 const from = 5, to = 20;
33 for (let element of document.getElementsByTagName("div")) {
34 test(() => {
35 for (let i = from; i <= to; i++) {
36 element.style.fontSize = i + "px";
37 let height = element.offsetHeight;
38 assert_approx_equals(height, i, i / 2, `Line should not wrap at font-siz e: ${i}px`);
39 }
40 }, `${element.title} from ${from}px to ${to} px`);
41 }
42 }
43 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698