module( 'plugins.lineheight' ); //test( '', function() { // equal('','',''); //} ); /* * *利用pict工具生成的用例设计结果,有微调。3to1表示先设置行距为3再设置为1,选区“singlePara”表示选中一个段落, * “multiPara”表示选中多个段落,“字号统一”表示所有的字号都是一样大,“16to36To16”表示先设置大小为16px,再设置为36,再设置为16 设置行距顺序 选区 选区内字号顺序
hello
' ); range.setStart(body.firstChild, 1).collapse(1).select(); editor.execCommand('lineheight', 3); setTimeout( function () { var p = body.firstChild; equal( editor.queryCommandValue('lineheight'), "3", '行间距为3'); editor.execCommand('lineheight', 1); p = body.firstChild; equal( editor.queryCommandValue('lineheight'), "1", '行间距为1'); equal( p.style['lineHeight'], 'normal', '检查行高' ); equal( $( p ).css('font-size'), '36px', '检查字体'); start(); }, 20 ); stop(); } ); /*hello
hello
hello
' ); // range.setStart( body.firstChild, 0 ).setEnd( body.lastChild, 1 ).select(); // editor.execCommand( 'lineheight', 1 ); // setTimeout( function () { // var ps = body.childNodes; // equal( $( ps[0] ).css( 'line-height' ), '36px', '第1个p行高为36px' ); // equal( $( ps[1] ).css( 'line-height' ), '16px', '第2个p行高为36px' ); // equal( $( ps[2] ).css( 'line-height' ), '36px', '第3个p行高为36px' ); // range.selectNode( ps[0] ).select(); // equal( editor.queryCommandValue( 'lineheight' ), "1", '第1个p行间距为1' ); // range.selectNode( ps[0] ).select(); // equal( editor.queryCommandValue( 'lineheight' ), "1", '第2个p行间距为1' ); // range.selectNode( ps[0] ).select(); // equal( editor.queryCommandValue( 'lineheight' ), "1", '第3个p行间距为1' ); // start(); // }, 20 ); // stop(); //} ); // ///*hello
hello
hello
' ); // range.setStart( body.firstChild, 0 ).setEnd( body.lastChild, 1 ).select(); // editor.execCommand( 'lineheight', 1 ); // setTimeout( function () { // var ps = body.childNodes; // compareLineHeight( ps[0], $( ps[0] ).css( 'line-height' ), '行距为1,第1个p行高' ); // compareLineHeight( ps[1], $( ps[1] ).css( 'line-height' ), '行距为1,第2个p行高' ); // compareLineHeight( ps[2], $( ps[2] ).css( 'line-height' ), '行距为1,第3个p行高' ); // range.selectNode( ps[0] ).select(); // equal( editor.queryCommandValue( 'lineheight' ), "1", '第1个p行间距为1' ); // range.selectNode( ps[0] ).select(); // equal( editor.queryCommandValue( 'lineheight' ), "1", '第2个p行间距为1' ); // range.selectNode( ps[0] ).select(); // equal( editor.queryCommandValue( 'lineheight' ), "1", '第3个p行间距为1' ); // start(); // }, 20 ); // stop(); //} ); // ///*hello
' ); // range.selectNode( body.firstChild ).select(); // editor.execCommand( 'lineheight', 1 ); // setTimeout( function () { // var p = body.firstChild; // equal( $( p ).css( 'line-height' ), '36px', '第1个p行高为36px' ); // editor.execCommand( 'lineheight', 3 ); // p = body.firstChild; // compareLineHeight( p, $( p ).css( 'line-height' ), '行距为1,第1个p行高' ); // editor.execCommand( 'lineheight', 1 ); // var p = body.firstChild; // equal( $( p ).css( 'line-height' ), '36px', '第1个p行高为36px' ); // start(); // }, 20 ); // stop(); //} ); // ///*hello
hello
hello
' ); // range.setStart( body.firstChild.firstChild, 1 ).setEnd( body.lastChild.firstChild, 2 ).select(); // editor.execCommand( 'lineheight', 1 ); // setTimeout( function () { // var ps = body.childNodes; // compareLineHeight( ps[0], $( ps[0] ).css( 'line-height' ), '行距为1,第1个p行高' ); // compareLineHeight( ps[1], $( ps[1] ).css( 'line-height' ), '行距为1,第2个p行高' ); // compareLineHeight( ps[2], $( ps[2] ).css( 'line-height' ), '行距为1,第3个p行高' ); // range.selectNode( ps[0] ).select(); // equal( editor.queryCommandValue( 'lineheight' ), "1", '第3个p行间距为1' ); // // range.setStart( body.firstChild.firstChild, 1 ).setEnd( body.lastChild.firstChild, 2 ).select(); // editor.execCommand( 'lineheight', 3 ); // ps = body.childNodes; // compareLineHeight( ps[0], $( ps[0] ).css( 'line-height' ), '行距为3,第1个p行高' ); // compareLineHeight( ps[1], $( ps[1] ).css( 'line-height' ), '行距为3,第2个p行高' ); // compareLineHeight( ps[2], $( ps[2] ).css( 'line-height' ), '行距为3,第3个p行高' ); // range.selectNode( ps[0] ).select(); // equal( editor.queryCommandValue( 'lineheight' ), "3", '第1个p行间距为1' ); // // range.setStart( body.firstChild.firstChild, 1 ).setEnd( body.lastChild.firstChild, 2 ).select(); // editor.execCommand( 'lineheight', 1 ); // ps = body.childNodes; // compareLineHeight( ps[0], $( ps[0] ).css( 'line-height' ), '行距为1,第1个p行高' ); // compareLineHeight( ps[1], $( ps[1] ).css( 'line-height' ), '行距为1,第2个p行高' ); // compareLineHeight( ps[2], $( ps[2] ).css( 'line-height' ), '行距为1,第3个p行高' ); // range.selectNode( ps[0] ).select(); // equal( editor.queryCommandValue( 'lineheight' ), "1", '第1个p行间距为1' ); // start(); // }, 20 ); // stop(); // //} );