@@ -23,6 +23,8 @@ let mTabXOffset = 0;
2323let mTabYOffset = 0 ;
2424let mFavIconSize = 0 ;
2525let mFavIconizedTabSize = 0 ;
26+ let mFavIconizedTabWidth = 0 ;
27+ let mFavIconizedTabHeight = 0 ;
2628let mFavIconizedTabXOffset = 0 ;
2729let mFavIconizedTabYOffset = 0 ;
2830
@@ -59,11 +61,11 @@ export function getFavIconizedTabYOffset() {
5961}
6062
6163export function getRenderedFavIconizedTabWidth ( ) {
62- return mFavIconizedTabSize + mFavIconizedTabXOffset ;
64+ return mFavIconizedTabWidth + mFavIconizedTabXOffset ;
6365}
6466
6567export function getRenderedFavIconizedTabHeight ( ) {
66- return mFavIconizedTabSize + mFavIconizedTabYOffset ;
68+ return mFavIconizedTabHeight + mFavIconizedTabYOffset ;
6769}
6870
6971export function init ( ) {
@@ -81,7 +83,10 @@ export function update() {
8183 --favicon-size: ${ mFavIconSize } px;
8284 --faviconized-tab-size: ${ mFavIconizedTabSize } px;
8385 }` ;
84- const faviconizedTabStyle = window . getComputedStyle ( document . querySelector ( '#dummy-faviconized-tab' ) ) ;
86+ const dummyFaviconizedTab = document . querySelector ( '#dummy-faviconized-tab' ) ;
87+ const faviconizedTabStyle = window . getComputedStyle ( dummyFaviconizedTab ) ;
88+ mFavIconizedTabWidth = dummyFaviconizedTab . offsetWidth ;
89+ mFavIconizedTabHeight = dummyFaviconizedTab . offsetHeight ;
8590 mFavIconizedTabXOffset = parseFloat ( faviconizedTabStyle . marginLeft . replace ( / p x $ / , '' ) ) + parseFloat ( faviconizedTabStyle . marginRight . replace ( / p x $ / , '' ) ) ;
8691 mFavIconizedTabYOffset = parseFloat ( faviconizedTabStyle . marginTop . replace ( / p x $ / , '' ) ) + parseFloat ( faviconizedTabStyle . marginBottom . replace ( / p x $ / , '' ) ) ;
8792
0 commit comments