Index: third_party/WebKit/LayoutTests/fast/text-autosizing/js-change-short-text-to-long.html |
diff --git a/third_party/WebKit/LayoutTests/fast/text-autosizing/js-change-short-text-to-long.html b/third_party/WebKit/LayoutTests/fast/text-autosizing/js-change-short-text-to-long.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..454c78cf83f8110f1f5dfe2e2f5c122495d9287a |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/text-autosizing/js-change-short-text-to-long.html |
@@ -0,0 +1,62 @@ |
+<html> |
+ <head> |
+ <meta name="viewport" content="width=800"> |
+ <style> |
+ html { font-size: 16px; } |
+ body { width: 800px; margin: 0; overflow-y: hidden; } |
+ </style> |
+ <script src="resources/autosizingTest.js"></script> |
+ </head> |
+ <body> |
+ <table width="760"> |
+ <tr> |
+ <td colspan="2"> |
+ <table width="760" style="table-layout:fixed;word-wrap:break-word;"> |
+ <tr> |
+ <td class="read"> |
+ <div id="longText">short blah blah</div> |
+ </td> |
+ </tr> |
+ </table> |
+ </td> |
+ </tr> |
+ |
+ <tr> |
+ <td colspan="2"> |
+ <table width="760" style="table-layout:fixed;word-wrap:break-word;"> |
+ <tr> |
+ <td class="read"> |
+ <div id="shortText">short blah blah</div> |
+ </td> |
+ </tr> |
+ </table> |
+ </td> |
+ </tr> |
+ </table> |
+ |
+ <script> |
+ function changeText() { |
+ document.getElementById("longText").innerHTML="long blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah"; |
+ } |
+ |
+ function testConsistent() { |
+ var longText = document.getElementById('longText'); |
+ var longTextComputedFontSize = parseInt(window.getComputedStyle(longText).fontSize); |
+ |
+ var shortText = document.getElementById('shortText'); |
+ var shortTextComputedFontSize = parseInt(window.getComputedStyle(shortText).fontSize); |
+ |
+ if (longTextComputedFontSize == shortTextComputedFontSize) |
+ document.write('PASS'); |
+ else |
+ document.write('FAIL. Expected longTextComputedFontSize == shortTextComputedFontSize.\n ' + longTextComputedFontSize + ': ' + shortTextComputedFontSize); |
+ |
+ if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ } |
+ |
+ setTimeout("changeText()", 100); |
pdr.
2016/11/10 06:04:09
When the text autosizer was first written, we only
cathiechentx
2016/11/11 09:34:12
Good to know! Will do...
|
+ setTimeout("testConsistent()", 200); |
+ </script> |
+ </body> |
+</html> |