Ticket #3034: test-element-getDocumentPosition.patch
File test-element-getDocumentPosition.patch, 1.9 KB (added by , 15 years ago) |
---|
-
_source/tests/core/dom/element.html
486 486 var element = new CKEDITOR.dom.element( document.getElementsByTagName( 'small' )[0] ); 487 487 assert.isTrue( element.hasAttributes() ); 488 488 }, 489 489 490 test_getDocumentPosition : function() 491 { 492 // Assign the page location of the element. 493 YAHOO.util.Dom.setXY('DocPositionTarget', [ 350, 450 ] ); 494 var pos = CKEDITOR.document.getById( 'DocPositionTarget' ).getDocumentPosition(); 495 assert.areEqual( 350, pos.x, 'Position coordinates:x relative to document doesn\'t match.' ); 496 assert.areEqual( 450, pos.y, 'Position coordinates:y relative to document doesn\'t match.' ); 497 }, 498 490 499 name : document.title 491 500 }; 492 501 })() ); … … 493 502 494 503 //]]> 495 504 </script> 505 <style type="text/css" media="screen"> 506 #test-computed { 507 width:50%; 508 margin:auto; 509 padding:10px; 510 z-index: 2; 511 } 512 .scroll 513 { 514 overflow:auto; 515 } 516 .block1 517 { 518 width: 100%; 519 height: 100px; 520 text-align: center; 521 } 522 .block2 523 { 524 margin: auto; 525 width: 200px; 526 height: 200px; 527 position : relative; 528 } 529 .block3 530 { 531 position: absolute; 532 float:right; 533 width: 300px; 534 height: 300px; 535 } 536 .block4 537 { 538 position: absolute; 539 left: 50px; 540 right: 50px; 541 width: 400px; 542 height: 400px; 543 } 544 </style> 496 545 </head> 497 546 <body> 498 547 <textarea id="test1" rows="10" cols="80"></textarea> … … 515 564 B</div> 516 565 <big>Test</big> 517 566 <small title="Testing">Test</small> 567 568 <div class="block1 scroll"><div class="block2 scroll"><div class="block3 scroll"><div class="block4 scroll"><div id="DocPositionTarget">target</div></div></div></div> 569 518 570 </body> 519 571 </html>