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

Unified Diff: third_party/WebKit/LayoutTests/fast/text/line-break-ascii.html

Issue 1370203005: Fix line break opportunities between HYPHEN-MINUS and closing punctuation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/text/line-break-ascii-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/text/line-break-ascii.html
diff --git a/third_party/WebKit/LayoutTests/fast/text/line-break-ascii.html b/third_party/WebKit/LayoutTests/fast/text/line-break-ascii.html
new file mode 100644
index 0000000000000000000000000000000000000000..e649935addfb68375afe64157ec588e66826a8cc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/text/line-break-ascii.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<style>
+#break-test {
+ font:50px/1 Ahem;
+ width:3em;
+}
+#result {
+ font:15px/1 monospace;
+ white-space:pre;
+}
+</style>
+<div id="result"></div>
+<div id="break-test"></div>
+<script>
+var beginChar = 33;
+var endChar = 127;
+var breakTest = document.getElementById("break-test");
+var breakTestFontsize = parseFloat(getComputedStyle(breakTest).fontSize);
+var nbsp = String.fromCharCode(0xA0);
+nbsp = nbsp + nbsp;
+
+var matrix = getLineBreakMatrix();
+
+var header = [];
+for (var i = 0; i < matrix.length; i++)
+ header.push(String.fromCharCode(beginChar + i));
+var rows = [" " + header.join("")];
+for (var i = 0; i < matrix.length; i++) {
+ rows.push(String.fromCharCode(beginChar + i) + " " + matrix[i].map(function (canBreak) {
+ return canBreak ? "/" : "X";
+ }).join(""));
+}
+result.textContent = rows.join("\n");
+
+function getLineBreakMatrix() {
+ var matrix = [];
+ for (var last = beginChar; last < endChar; last++) {
+ var canBreakBefore = [];
+ for (var current = beginChar; current < endChar; current++)
+ canBreakBefore.push(canBreakBetween(last, current));
+ matrix.push(canBreakBefore);
+ }
+ return matrix;
+}
+
+function canBreakBetween(last, current) {
+ breakTest.textContent = nbsp + String.fromCharCode(last) + String.fromCharCode(current);
+ return breakTest.offsetHeight / breakTestFontsize > 1.9;
+}
+
+breakTest.textContent = "";
+if (window.testRunner)
+ testRunner.dumpAsText();
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/text/line-break-ascii-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698