Ticket #3034: 3034_3.patch
File 3034_3.patch, 4.6 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 if ( !CKEDITOR.env.ie ) 496 { 497 assert.areEqual( 350, pos.x, 'Position coordinates:x relative to document doesn\'t match.' ); 498 assert.areEqual( 450, pos.y, 'Position coordinates:y relative to document doesn\'t match.' ); 499 } 500 else 501 { 502 assert.isTrue( pos.x == 348 || pos.x == 349, 'Position coordinates:x relative to document doesn\'t match.' ); 503 assert.areEqual( 448, pos.y, 'Position coordinates:y relative to document doesn\'t match.' ); 504 } 505 }, 506 490 507 name : document.title 491 508 }; 492 509 })() ); 493 510 494 511 //]]> 495 512 </script> 513 <style type="text/css" media="screen"> 514 #test-computed { 515 width:50%; 516 margin:auto; 517 padding:10px; 518 z-index: 2; 519 } 520 .scroll 521 { 522 overflow: visible; 523 } 524 .block1 525 { 526 width: 100%; 527 height: 100px; 528 background-color: blue; 529 text-align: center; 530 } 531 .block2 532 { 533 margin: auto; 534 width: 200px; 535 height: 200px; 536 background-color: green; 537 position : relative; 538 } 539 .block3 540 { 541 position: absolute; 542 float:right; 543 width: 300px; 544 height: 300px; 545 background-color: black; 546 } 547 .block4 548 { 549 position: absolute; 550 left: 50px; 551 right: 50px; 552 width: 400px; 553 height: 400px; 554 background-color: pink; 555 } 556 #DocPositionTarget 557 { 558 background-color: red; 559 } 560 </style> 496 561 </head> 497 562 <body> 498 563 <textarea id="test1" rows="10" cols="80"></textarea> … … 515 580 B</div> 516 581 <big>Test</big> 517 582 <small title="Testing">Test</small> 583 584 <div class="block1 scroll" id="block1"><div class="block2 scroll" id="block2"><div class="block3 scroll" id="block3"><div class="block4 scroll" id="block4"><div id="DocPositionTarget">target</div></div></div></div></div> 585 518 586 </body> 519 587 </html> -
_source/skins/office2003/richcombo.css
57 57 text-overflow: ellipsis; 58 58 overflow: hidden; 59 59 display: inline-block; 60 position: relative; 60 61 } 61 62 62 63 .cke_skin_office2003 .cke_ltr .cke_rcombo .cke_text -
_source/skins/v2/richcombo.css
52 52 text-overflow: ellipsis; 53 53 overflow: hidden; 54 54 display: inline-block; 55 position: relative; 55 56 } 56 57 57 58 .cke_skin_v2 .cke_ltr .cke_rcombo .cke_text -
_source/core/dom/element.js
1112 1112 x += current.$.offsetLeft - current.$.scrollLeft; 1113 1113 y += current.$.offsetTop - current.$.scrollTop; 1114 1114 1115 /* 1116 * IE doesn't really include the element borders into offsetLeft and 1117 * offsetTop, despite their claims on their MSDN documentations. 1118 * (#3034) 1119 */ 1120 if ( CKEDITOR.env.ie && !this.equals( current ) ) 1121 { 1122 x += current.$.clientLeft; 1123 y += current.$.clientTop; 1124 } 1125 1115 1126 if ( !CKEDITOR.env.opera ) 1116 1127 { 1117 1128 var scrollElement = previous; … … 1146 1157 // 1. It matters if document.body itself is a positioned element; 1147 1158 // 2. It matters when we're in IE and the element has no positioned ancestor. 1148 1159 // Otherwise the values should be ignored. 1149 if ( this.getComputedStyle( 'position' ) != 'static' || ( CKEDITOR.env.ie && !this.getPositionedAncestor() ) ) 1160 var body = this.getDocument().getBody(); 1161 if ( body.getComputedStyle( 'position' ) != 'static' || ( CKEDITOR.env.ie && this.getPositionedAncestor() == null ) ) 1150 1162 { 1151 x += this.getDocument().getBody().$.offsetLeft;1152 y += this.getDocument().getBody().$.offsetTop;1163 x += body.$.offsetLeft; 1164 y += body.$.offsetTop; 1153 1165 } 1154 1166 1155 1167 return { x : x, y : y };