Ticket #3034: 3034_4.patch
File 3034_4.patch, 1.7 KB (added by , 15 years ago) |
---|
-
_source/core/dom/element.js
1114 1114 1115 1115 if ( !CKEDITOR.env.opera ) 1116 1116 { 1117 // Opera includes clientTop|Left into offsetTop|Left. 1118 if ( !current.equals( this ) ) 1119 { 1120 x += ( current.$.clientLeft || 0 ); 1121 y += ( current.$.clientTop || 0 ); 1122 } 1123 1117 1124 var scrollElement = previous; 1118 1125 while ( scrollElement && !scrollElement.equals( current ) ) 1119 1126 { … … 1141 1148 } 1142 1149 } 1143 1150 1151 var body = this.getDocument().getBody(); 1152 1144 1153 // document.body is a special case when it comes to offsetTop and offsetLeft 1145 1154 // values. 1146 1155 // 1. It matters if document.body itself is a positioned element; 1147 1156 // 2. It matters when we're in IE and the element has no positioned ancestor. 1148 1157 // Otherwise the values should be ignored. 1149 if ( this.getComputedStyle( 'position' ) != 'static' || ( CKEDITOR.env.ie && !this.getPositionedAncestor() ) )1158 if ( body.getComputedStyle( 'position' ) != 'static' || ( CKEDITOR.env.ie && !this.getPositionedAncestor() ) ) 1150 1159 { 1151 x += this.getDocument().getBody().$.offsetLeft;1152 y += this.getDocument().getBody().$.offsetTop;1160 x += body.$.offsetLeft + ( body.$.clientLeft || 0 ); 1161 y += body.$.offsetTop + ( body.$.clientTop || 0 ); 1153 1162 } 1154 1163 1164 // In Firefox, we'll endup one pixel before the element positions, 1165 // so we must add it here. 1166 if ( CKEDITOR.env.gecko && !CKEDITOR.env.quirks ) 1167 { 1168 x += this.$.clientLeft ? 1 : 0; 1169 y += this.$.clientTop ? 1 : 0;; 1170 } 1171 1155 1172 return { x : x, y : y }; 1156 1173 }, 1157 1174