function foreignWidthSet(textEl, foreign, textarea, textareaPaddingAndBorder, textAlign) {
	const textBbox = textEl.getBBox();
	const width = textBbox.width + 20; // +20 paddings for iPhone

	foreign.width.baseVal.value = width + 2 * textareaPaddingAndBorder + 2; // +2 magic number for FireFox
	foreign.x.baseVal.value = textBbox.x - textareaPaddingAndBorder - (
		textAlign === 'center'
			? 10
			: textAlign === 'right' ? 20 : 0);

	foreign.height.baseVal.value = textBbox.height + 2 * textareaPaddingAndBorder + 3; // +3 magic number for FireFox
	foreign.y.baseVal.value = textBbox.y - textareaPaddingAndBorder;

	textarea.style.width = `${width}px`;
	textarea.style.height = `${textBbox.height}px`;
}
@param {SVGTextElement} textEl
@param {SVGForeignObjectElement} foreign
@param {HTMLTextAreaElement} textarea
@param {number} textareaPaddingAndBorder
@param {string} textAlign