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

Unified Diff: trunk/LayoutTests/fast/css3-text/font-stretch.html

Issue 195823006: Revert 169264 "Add plumbing for font-stretch" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: trunk/LayoutTests/fast/css3-text/font-stretch.html
===================================================================
--- trunk/LayoutTests/fast/css3-text/font-stretch.html (revision 169272)
+++ trunk/LayoutTests/fast/css3-text/font-stretch.html (working copy)
@@ -1,80 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <style>
- #test {
- font-family: arial;
- }
- #test > div > span, #test > header > span {
- display: inline-block;
- width: 20ex;
- }
- #test > header {
- font-weight: bold;
- border-bottom: 1px solid black;
- }
- </style>
- </head>
- <body>
- <section id="test">
- <header><span>Assigned</span><span>Computed</span><span>Result</span></header>
- </section>
- <section>
- <p>
- Tests that all supported <code>font-stretch</code> values
- are correctly parsed, recognized and returned from
- <code>getComputedStyle</code>.
- </p>
- <p>
- Also tests that a few invalid <code>font-stretch</code>
- values are ignored as expected.
- </p>
- </section>
- <script>
- if (self.testRunner)
- testRunner.dumpAsText();
-
- function createElement(tagName, opt_style, opt_textContent)
- {
- var element = document.createElement(tagName);
- element.style.cssText = opt_style || '';
- if (opt_textContent)
- element.appendChild(document.createTextNode(opt_textContent));
- return element;
- }
- function testValues(containerElement, values, isValid)
- {
-
- for (var value, i = 0; value = values[i]; i++) {
- var testElement = createElement('div');
- var style = 'font-stretch: ' + value + '; font-weight: bold;';
- testElement.appendChild(createElement('span', style, value));
- containerElement.appendChild(testElement);
- var style = window.getComputedStyle(testElement.firstChild);
- testElement.appendChild(createElement('span', undefined, style.fontStretch));
- var result;
- if (style.fontStretch == value && isValid)
- result = 'PASS';
- else if (style.fontStretch == 'normal' && !isValid)
- result = 'PASS';
- else
- result = 'FAIL';
- testElement.appendChild(createElement('span', undefined, result));
- }
- }
- var stretchValues = [
- 'normal', 'ultra-condensed', 'extra-condensed',
- 'condensed', 'semi-condensed', 'semi-expanded',
- 'expanded', 'extra-expanded', 'ultra-expanded'
- ];
- var invalidValues = [
- 'bold', 'semi-normal', 'very-condensed',
- 'compact', 'foobar', '900'
- ];
- var containerElement = document.getElementById('test');
- testValues(containerElement, stretchValues, true);
- containerElement.appendChild(createElement('div', 'border-bottom: 1px solid black'));
- testValues(containerElement, invalidValues, false);
- </script>
- </body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698