Ticket #3804: 3804_2.patch
File 3804_2.patch, 2.4 KB (added by , 15 years ago) |
---|
-
_source/plugins/floatpanel/plugin.js
112 112 position = offsetParent.getDocumentPosition( element.getDocument() ), 113 113 rtl = this._.dir == 'rtl'; 114 114 115 if ( window.console ) console.log( 'x=', position.x, ', y=', position.y ); 116 115 117 var left = position.x + ( offsetX || 0 ), 116 118 top = position.y + ( offsetY || 0 ); 117 119 -
_source/core/dom/element.js
1099 1099 getDocumentPosition : function( refDocument ) 1100 1100 { 1101 1101 var x = 0, y = 0, 1102 body = this.getDocument().getBody(); 1102 body = this.getDocument().getBody(), 1103 quirks = this.getDocument().$.compatMode == 'BackCompat'; 1103 1104 1104 1105 if ( document.documentElement[ "getBoundingClientRect" ] ) 1105 1106 { 1106 1107 var box = this.$.getBoundingClientRect(), 1107 doc = this.getDocument().$, 1108 docElem = doc.documentElement, 1109 clientTop = docElem.clientTop || body.$.clientTop || 0, 1110 clientLeft = docElem.clientLeft || body.$.clientLeft || 0; 1108 doc = this.getDocument(), 1109 $doc = doc.$, 1110 $docElem = $doc.documentElement, 1111 inDocElem = doc.getDocumentElement().contains( this ), 1112 inBody = doc.getBody().contains( this ), 1113 clientTop = inDocElem && $docElem.clientTop || inBody && body.$.clientTop || 0, 1114 clientLeft = inDocElem && $docElem.clientLeft || inBody && body.$.clientLeft || 0; 1111 1115 1112 x = box.left + ( ! CKEDITOR.env.quirks && docElem.scrollLeft ||body.$.scrollLeft );1116 x = box.left + ( !quirks && inDocElem && $docElem.scrollLeft || inBody && body.$.scrollLeft ); 1113 1117 x -= clientLeft; 1114 y = box.top + ( ! CKEDITOR.env.quirks && docElem.scrollTop ||body.$.scrollTop );1118 y = box.top + ( !quirks && inDocElem && $docElem.scrollTop || inBody && body.$.scrollTop ); 1115 1119 y -= clientTop; 1116 1120 } 1117 1121 else … … 1161 1165 { 1162 1166 // In Firefox, we'll endup one pixel before the element positions, 1163 1167 // so we must add it here. 1164 if ( CKEDITOR.env.gecko && ! CKEDITOR.env.quirks )1168 if ( CKEDITOR.env.gecko && !quirks ) 1165 1169 { 1166 1170 x += this.$.clientLeft ? 1 : 0; 1167 1171 y += this.$.clientTop ? 1 : 0;