Primary eng (and PM) emails
Link to “Intent to Deprecate” thread
https://groups.google.com/a/chromium.org/d/msg/blink-dev/JlAEmQpWMWA/63acYbmdDwAJ
Summary
Remove the attributes offsetParent, offsetTop, offsetLeft, offsetWidth and offsetHeight on SVGElement. These have been deprecated in M48-49, with the deprecation message saying that it will be gone in M50.
Motivation
In Gecko and Edge, these attributes are only supported on HTMLElement. AFAIK, they were never spec'd for Element generally or SVGElement specifically.
Compatibility Risk
There was some pushback on the Intent to Deprecate, based on https://github.com/jquery/jquery/issues/2895. jQuery does not try to support SVG, and the issue was eventually closed.
AFAICT, people have triggered the deprecation messages by using jQuery's custom :visible/:hidden selectors and position().
For :visible/:hidden, the issue has been fixed in jQuery 2.2.0, and if upgrading isn't feasible then simply overwriting with the new definitions after loading jQuery should work:
jQuery.expr.filters.hidden = function( elem ) {
return !jQuery.expr.filters.visible( elem );
};
jQuery.expr.filters.visible = function( elem ) {
return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0;
};
The position() method uses a custom offsetParent() internally, which in turn depends on offsetParent. https://jsfiddle.net/3ktj99m4/4/ illustrates the difference:
Blink/WebKit:
offsetParent(): div
position(): {"top":20,"left":20}
Edge:
offsetParent(): html
position(): {"top":29.5,"left":29.5}
Gecko:
offsetParent(): html
position(): {"top":30,"left":30}
After the change Blink will match Gecko. The "simple" advice here is to do whatever currently works in Edge/Gecko. These jQuery APIs are essentially wrappers for the removed APIs, so trying to polyfill the old behavior does not sound like a good idea.
Nevertheless, one can get the position of an element relative to another by calling getBoundingClientRect() on both and calculating the difference. offsetParent can also be faked to some degree. https://jsfiddle.net/3ktj99m4/6/ sketches these ideas, but this kind of approach ought to be a last resort.
Usage information from UseCounter
OWP launch tracking bug
Entry on the feature dashboard
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Enabled by default in desktop Chrome 52 (launch bug)
Available in Chrome for Android release 52.
Available in Android WebView release 52.
Last updated on 2016-05-31
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.