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

Unified Diff: third_party/WebKit/LayoutTests/fast/text-autosizing/js-change-short-text-to-long.html

Issue 2299213003: Fix the inconsistent problem while the content of textNodes is changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 1. change 'FingerPrint' to 'Fingerprint' 2. remove const from BlockSet 3. change 'textAutosizingNew… Created 4 years, 1 month 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
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>

Powered by Google App Engine
This is Rietveld 408576698