Closed vebersol closed 8 years ago
+1
There is 4 offsetWidth
, offsetHeight
access codes in raphaeljs 2.1.4
o._.fillsize = [this.offsetWidth, this.offsetHeight];
This function is supplied for callback for img.onload event handler. so this
is IMG element. also VML is not under consideration in deprecation issue.
R._preload(isURL[1], function () {
var w = this.offsetWidth,
h = this.offsetHeight;
$(el, {width: w, height: h});
$(ig, {width: w, height: h});
});
This function is supplied for callback for img.onload event handler. so this
is IMG element. (see R._preload methods)
Mysterious thing is, loading image in R._preload always fail. i have no idea for that.
return {
container: container,
width: container.style.pixelWidth || container.offsetWidth,
height: container.style.pixelHeight || container.offsetHeight
};
inside of R._getContainer()
. this method seems to use for normalize Raphael()
initializer.
The API reference of Raphael()
has no arguments type SVGElement
. no problem.
paperproto.getSize = function () {
var container = this.canvas.parentNode;
return {
width: container.offsetWidth,
height: container.offsetHeight
};
};
As you can see the container
is parent node of canvas. so it is HTML element.
@minhyeong-kim, thanks :+1:
Guys could you take a look at that PR and try it in your envs? I will merge it if you give the ok. Thanks
Ok, after the @minhyeong-kim comments (thanks!) and re-reading the analysis better I guess there are no needed changes for this right? Though I'm curious if the chrome error appears because the offsetHeight/Width attrs are being requested on an SVGElement or if it's just in case. @vebersol do you see in your app a case where raphael is calling SVGElement.offsetWidth/Height?
Hi @tomasAlabes,
We don't use this property as far as I could see here. I think it's just in case.
Yeah, I agree. Closing this issue. Thanks everybody for the feedback.
I've got this message from Chrome Devtools:
Does it has negative impact on Raphael code?