Uncaught ReferenceError: WebKitPoint not defined

I am using Sencha Touch 1.1.1

Yesterday, when Google Chrome was upgraded to 39, it started giving this error

Uncaught ReferenceError: WebKitPoint is not defined

Because they deleted WebKitPoint. Sencha Touch has WebKitPoint code located here http://cdn.sencha.io/touch/sencha-touch-1.1.1/sencha-touch.js on line 6. Yes.

getXY: function() {
    var a = window.webkitConvertPointFromNodeToPage(this.dom, new WebKitPoint(0, 0));
    return [a.x, a.y]
}

I think that WebKitPoint is some kind of function object {x: 0, y: 0}, but I was not able to create / create JavaScript code; I wrote this WebKitPoint = {x:0, y:0}, but it again gives an error, this time saying that this is not a function.

I also found this: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/pIbpN_8Lqpg

TL; DR Google Chrome 39 no longer supports WebKitPoin. How can I emulate or replace it?

+4
3

var point = window.webkitConvertPointFromNodeToPage(this.dom, new WebKitPoint(0, 0));
return [point.x, point.y]

var rect = this.dom.getBoundingClientRect();
return [rect.left, rect.top];

: https://code.google.com/p/chromium/issues/detail?id=434976#c10

: Philip JΓ€genstedt

+13

, script ( sencha-touch.js):

WebKitPoint = function(x,y) { };
window.webkitConvertPointFromNodeToPage = function(dom, unusedWebKitPoint) {
    var rect = dom.getBoundingClientRect();
    return [rect.left, rect.top];
};
+3

Dave, that's great. But in my views, I became a scrolling issue. I think you need to return an associative array:

WebKitPoint = function(x,y) { };
window.webkitConvertPointFromNodeToPage = function(dom, unusedWebKitPoint) {
    var rect = dom.getBoundingClientRect();
    return {
      'x': rect.left,
      'y': rect.top
    }
};
Run codeHide result
+2
source

All Articles