Chrome returns 0 for offsetWidth of custom HTML element
You need to style my-tag element with display: block
Here's fiddle https://jsfiddle.net/Lvntyrjy/1/
You can also get the width of the content of the custom element like this:
document.querySelector('custom-element').shadowRoot.querySelector('#content').offsetWidth