<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[40584] trunk/tests/qunit: TinyMCE: remove the pre-4.6.0 tests.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/40584">40584</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/40584","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>azaozz</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-05-08 05:35:41 +0000 (Mon, 08 May 2017)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>TinyMCE: remove the pre-4.6.0 tests. Move regression testing for obsolete tags and attributes to the default QUnit tests.

See <a href="https://core.trac.wordpress.org/ticket/40690">#40690</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsqunitindexhtml">trunk/tests/qunit/index.html</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunktestsqunitwpincludesjstinymcetinymceobsoletejs">trunk/tests/qunit/wp-includes/js/tinymce/tinymce-obsolete.js</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li>trunk/tests/qunit/editor/</li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsqunitindexhtml"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/qunit/index.html</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/qunit/index.html      2017-05-08 05:31:08 UTC (rev 40583)
+++ trunk/tests/qunit/index.html        2017-05-08 05:35:41 UTC (rev 40584)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +43,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        <script src="fixtures/js-widgets-endpoint.js"></script>
</span><span class="cx" style="display: block; padding: 0 10px">                        <script src="fixtures/wp-api.js"></script>
</span><span class="cx" style="display: block; padding: 0 10px">                </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <p><a href="editor">TinyMCE tests</a></p>
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                <!-- Tested files -->
</span><span class="cx" style="display: block; padding: 0 10px">                <script src="../../src/wp-admin/js/password-strength-meter.js"></script>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -505,6 +504,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                <script src="../../src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js"></script>
</span><span class="cx" style="display: block; padding: 0 10px">                <script src="editor/js/utils.js"></script>
</span><span class="cx" style="display: block; padding: 0 10px">                <script src="wp-includes/js/tinymce/plugins/wptextpattern/plugin.js"></script>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                <script src="wp-includes/js/tinymce/tinymce-obsolete.js"></script>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                <!-- Updates templates and HTML fixtures -->
</span><span class="cx" style="display: block; padding: 0 10px">                <script id="tmpl-wp-updates-admin-notice" type="text/html">
</span></span></pre></div>
<a id="trunktestsqunitwpincludesjstinymcetinymceobsoletejs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/qunit/wp-includes/js/tinymce/tinymce-obsolete.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/qunit/wp-includes/js/tinymce/tinymce-obsolete.js                              (rev 0)
+++ trunk/tests/qunit/wp-includes/js/tinymce/tinymce-obsolete.js        2017-05-08 05:35:41 UTC (rev 40584)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,286 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+( function( $, QUnit, tinymce, setTimeout ) {
+       var editor,
+               count = 0;
+
+       QUnit.module( 'tinymce.obsolete', {
+               beforeEach: function( assert ) {
+                       var done;
+
+                       if ( ! editor ) {
+                               done = assert.async();
+
+                               $( document.body ).append( '<textarea id="editor">' );
+
+                               tinymce.init({
+                                       selector: '#editor',
+                                       add_unload_trigger : false,
+                                       skin: false,
+                                       indent : false,
+                                       entities : 'raw',
+                                       plugins: 'media',
+                                       convert_urls : false,
+                                       init_instance_callback : function( ed ) {
+                                               editor = ed;
+                                               done();
+                                       }
+                               });
+
+                       } else {
+                               editor.setContent( '' );
+                               editor.selection.setCursorLocation();
+                       }
+               },
+               afterEach: function( assert ) {
+                       count++;
+
+                       if ( count === assert.test.module.tests.length ) {
+                               editor.remove();
+                               $( '#editor' ).remove();
+                       }
+               }
+       } );
+
+       /**
+        * Test whether attribute exists in a HTML string
+        *
+        * @param html The HTML string
+        * @param attr string|object When string, test for the first instance of attr.
+        *                           When object, break up the HTML string into individual tags and test for attr in the specified tag.
+        *                           Format: { tagName: 'attr1 attr2', ... }
+        * @return bool
+        */
+       function hasAttr( html, attr ) {
+               var tagName, tags, tag, array, regex, i;
+
+               if ( typeof attr === 'string' ) {
+                       return new RegExp( ' \\b' + attr + '\\b' ).test( html );
+               }
+
+               for ( tagName in attr ) {
+                       if ( tags = html.match( new RegExp( '<' + tagName + ' [^>]+>', 'g' ) ) ) {
+                               for ( tag in tags ) {
+                                       array = attr[tagName].split(' ');
+
+                                       for ( i in array ) {
+                                               regex = new RegExp( '\\b' + array[i] + '\\b' );
+
+                                               if ( regex.test( tags[tag] ) ) {
+                                                       attr[tagName] = attr[tagName].replace( regex, '' );
+                                               }
+                                       }
+                               }
+
+                               if ( attr[tagName].replace( / +/g, '' ).length ) {
+                                       return false;
+                               }
+                       }
+               }
+               return true;
+       }
+
+       // Ref: http://www.w3.org/TR/html5/obsolete.html, http://developers.whatwg.org/obsolete.html
+
+       QUnit.test('HTML elements non-conforming to HTML 5.0', function() {
+               var testString;
+
+               /*
+               Not supported, deprecated in HTML 4.0 or earlier, and/or proprietary:
+                       applet
+                       bgsound
+                       dir
+                       frame
+                       frameset
+                       noframes
+                       isindex
+                       listing
+                       nextid
+                       noembed
+                       plaintext
+                       rb
+                       xmp
+                       basefont
+                       blink
+                       marquee
+                       multicol
+                       nobr
+                       spacer
+
+               The rest are still supported in TinyMCE but "...must not be used by authors".
+               */
+
+               expect(6);
+
+               text = 'acronym';
+               testString = '<p><acronym title="www">WWW</acronym></p>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+
+               text = 'strike, converted to span';
+               editor.setContent( '<strike>test</strike>' );
+               equal( editor.getContent(), '<p><span style="text-decoration: line-through;">test</span></p>', text );
+
+               text = 'big';
+               testString = '<p><big>test</big></p>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+
+               text = 'center';
+               testString = '<center>test</center>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+
+               text = 'font, converted to span';
+               editor.setContent( '<p><font size="4">test</font></p>' );
+               equal( editor.getContent(), '<p><span style="font-size: large;">test</span></p>', text );
+
+               text = 'tt';
+               testString = '<p><tt>test</tt></p>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+       });
+
+       QUnit.test('Obsolete (but still conforming) HTML attributes', function() {
+               var testString;
+
+               expect(3);
+
+               text = 'border on <img>';
+               testString = '<p><img src="../../test.gif" alt="" border="5" /></p>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+
+               text = 'Old style anchors';
+               testString = '<p><a name="test"></a></p>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+
+               text = 'maxlength, size on input type="number"';
+               testString = '<p><input maxlength="5" size="10" type="number" value="" /></p>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { input: 'maxlength size' } ), text );
+       });
+
+       QUnit.test('Obsolete attributes in HTML 5.0', function() {
+               var testString, text;
+
+               expect(22);
+
+               text = 'charset, rev, shape, coords on <a> elements';
+               testString = '<p><a href="javascript;:" charset="en" rev="made" shape="rect" coords="5,5">test</a></p>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { a: 'charset rev shape coords' } ), text );
+
+               text = 'name, align, hspace, vspace on img elements';
+               testString = '<p><img src="../../test.gif" alt="" name="test" align="left" hspace="5" vspace="5" /></p>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { img: 'name align hspace vspace' } ), text );
+
+               text = 'name, align, hspace, vspace, on embed elements';
+               testString = '<p><embed width="100" height="100" src="test.swf" vspace="5" hspace="5" align="left" name="test"></embed></p>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { embed: 'name align hspace vspace' } ), text );
+
+               text = 'archive, classid, code, codebase, codetype, declare, standby on object elements';
+               testString = '<p><object width="100" height="100" classid="clsid" codebase="clsid" standby="standby" codetype="1" code="1" archive="1" declare="declare"></object></p>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { object: 'archive classid code codebase codetype declare standby' } ), text );
+
+               text = 'type, valuetype on param elements';
+               testString = '<p><object width="100" height="100"><param type="" valuetype="" /></object></p>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { param: 'type valuetype' } ), text );
+
+               text = 'align, bgcolor, border, cellpadding, cellspacing, frame, rules, summary, width on table elements';
+               testString = '<table border="1" summary="" width="100" frame="" rules="" cellspacing="5" cellpadding="5" align="left" bgcolor="blue"><tbody><tr><td>test</td></tr></tbody></table>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { table: 'align bgcolor border cellpadding cellspacing frame rules summary width' } ), text );
+
+               text = 'align, char, charoff, valign on tbody, thead, and tfoot elements';
+               testString = '<table><thead align="left" char="" charoff="" valign="top"></thead><tfoot align="left" char="" charoff="" valign="top"></tfoot><tbody align="left" char="" charoff="" valign="top"><tr><th>test</th><td>test</td></tr></tbody></table>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), {
+                       thead: 'align char charoff valign',
+                       tfoot: 'align char charoff valign',
+                       tbody: 'align char charoff valign'
+               } ), text );
+
+               text = 'axis, align, bgcolor, char, charoff, height, nowrap, valign, width on td and th elements, scope on td elements';
+               testString = '<table><tbody><tr><th axis="" align="left" char="" charoff="" valign="top" nowrap="nowrap" bgcolor="blue" width="100" height="10">test</th><td axis="" align="left" char="" charoff="" valign="top" nowrap="nowrap" bgcolor="blue" width="100" height="10" scope="">test</td></tr></tbody></table>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), {
+                       th: 'axis align bgcolor char charoff height nowrap valign width',
+                       td: 'axis align bgcolor char charoff height nowrap valign width scope'
+               } ), text );
+
+               text = 'align, bgcolor, char, charoff, valign on tr elements';
+               testString = '<table><tbody><tr align="left" char="" charoff="" valign="top" bgcolor="blue"><td>test</td></tr></tbody></table>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { tr: 'align bgcolor char charoff valign' } ), text );
+
+               text = 'clear on br elements';
+               testString = '<p>test<br clear="all" />test</p>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+
+               text = 'align on caption elements';
+               testString = '<table><caption align="left">test</caption><tbody><tr><td>test</td></tr></tbody></table>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+
+               text = 'align, char, charoff, valign, width on col elements';
+               testString = '<table><colgroup><col width="100" align="left" char="a" charoff="1" valign="top" /><col /></colgroup><tbody><tr><td>test</td><td>test</td></tr></tbody></table>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { col: 'align char charoff valign width' } ), text );
+
+               text = 'align on div, h1—h6, input, legend, p elements';
+               testString = '<div align="left">1</div><h3 align="left">1</h3><p align="left">1</p><form><fieldset><legend align="left">test</legend><input type="text" align="left" /></fieldset></form>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+
+               text = 'compact on dl elements';
+               testString = '<dl compact="compact"><dd>1</dd></dl>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+
+               text = 'align, hspace, vspace on embed elements';
+               testString = '<p><embed width="100" height="100" vspace="5" hspace="5" align="left"></embed></p>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { embed: 'align hspace vspace' } ), text );
+
+               text = 'align, noshade, size, width on hr elements';
+               testString = '<hr align="left" noshade="noshade" size="1" width="100" />';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { hr: 'align noshade size width' } ), text );
+
+               text = 'align, frameborder, marginheight, marginwidth, scrolling on iframe elements';
+               testString = '<p><iframe width="100" height="100" frameborder="1" marginwidth="5" marginheight="5" scrolling="" align="left"></iframe></p>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { iframe: 'align frameborder marginheight marginwidth scrolling' } ), text );
+
+               text = 'type on li elements';
+               testString = '<ul><li type="disc">test</li></ul>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+
+               text = 'align, border, hspace, vspace on object elements';
+               testString = '<p><object width="100" height="100" border="1" vspace="5" hspace="5" align="left"></object></p>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { object: 'align border hspace vspace' } ), text );
+
+               text = 'compact on ol elements';
+               testString = '<ol compact="compact"><li>test</li></ol>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+
+               text = 'compact, type on ul elements';
+               testString = '<ul type="disc" compact="compact"><li>test</li></ul>';
+               editor.setContent( testString );
+               ok( hasAttr( editor.getContent(), { ul: 'compact type' } ), text );
+
+               text = 'width on pre elements';
+               testString = '<pre width="100">1</pre>';
+               editor.setContent( testString );
+               equal( editor.getContent(), testString, text );
+       });
+
+} )( window.jQuery, window.QUnit, window.tinymce, window.setTimeout );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/qunit/wp-includes/js/tinymce/tinymce-obsolete.js
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span></div>

</body>
</html>