77// Former goog.module ID: Blockly.utils.style
88
99import { Coordinate } from './coordinate.js' ;
10+ import * as deprecation from './deprecation.js' ;
1011import { Rect } from './rect.js' ;
1112import { Size } from './size.js' ;
1213
@@ -58,6 +59,7 @@ function getSizeInternal(element: Element): Size {
5859 * @returns Object with width/height properties.
5960 */
6061function getSizeWithDisplay ( element : Element ) : Size {
62+ deprecation . warn ( `Blockly.utils.style.getSizeWithDisplay()` , 'v11.2' , 'v13' ) ;
6163 const offsetWidth = ( element as HTMLElement ) . offsetWidth ;
6264 const offsetHeight = ( element as HTMLElement ) . offsetHeight ;
6365 return new Size ( offsetWidth , offsetHeight ) ;
@@ -130,6 +132,7 @@ export function getViewportPageOffset(): Coordinate {
130132 * @returns The computed border widths.
131133 */
132134export function getBorderBox ( element : Element ) : Rect {
135+ deprecation . warn ( `Blockly.utils.style.getBorderBox()` , 'v11.2' , 'v13' ) ;
133136 const left = parseFloat ( getComputedStyle ( element , 'borderLeftWidth' ) ) ;
134137 const right = parseFloat ( getComputedStyle ( element , 'borderRightWidth' ) ) ;
135138 const top = parseFloat ( getComputedStyle ( element , 'borderTopWidth' ) ) ;
@@ -156,6 +159,12 @@ export function scrollIntoContainerView(
156159 container : Element ,
157160 opt_center ?: boolean ,
158161) {
162+ deprecation . warn (
163+ `Blockly.utils.style.scrollIntoContainerView()` ,
164+ 'v11.2' ,
165+ 'v13' ,
166+ 'the native Element.scrollIntoView()' ,
167+ ) ;
159168 const offset = getContainerOffsetToScrollInto ( element , container , opt_center ) ;
160169 container . scrollLeft = offset . x ;
161170 container . scrollTop = offset . y ;
@@ -180,6 +189,11 @@ export function getContainerOffsetToScrollInto(
180189 container : Element ,
181190 opt_center ?: boolean ,
182191) : Coordinate {
192+ deprecation . warn (
193+ `Blockly.utils.style.getContainerOffsetToScrollInto()` ,
194+ 'v11.2' ,
195+ 'v13' ,
196+ ) ;
183197 // Absolute position of the element's border's top left corner.
184198 const elementPos = getPageOffset ( element ) ;
185199 // Absolute position of the container's border's top left corner.
0 commit comments