Interestingly enough, SetWidth/SetHeight, as well as GetWidth/GetHeight do work in the sandboxed (as you very well put it) restricted environment; SetSize/GetSize however do not.
There's a nice listing of what's available in a restricted environment here:
https://wow.gamepedia.com/RestrictedEnvironment
Secure handler templates will give you a few more methods:
https://wow.gamepedia.com/SecureHandlers (see bottom of page for more info on specific templates).
And... you have the "source" (if I'm not mistaken: the source is actualy in C, I believe, and unavailable; these are the Lua equivalents of the proper source). There is a Blizzard-provided tool for the purpose of extracting the data but I forgot what it is. I do remember it is a lengthy process (lots of data) and some people have kindly posted it on the Internet anyway. For example:
https://www.townlong-yak.com/framexml/ptr - RestrictedEnvironment.lua and other Restricted*.lua files should be of interest.