WebKit Bugzilla
Attachment 370724 Details for
Bug 198291
: Zoom affects maximum element size
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Repro case (ResizeObserver support required to view)
zoom-element-resize.html (text/html), 1.04 KB, created by
Andy E
on 2019-05-28 03:49:29 PDT
(
hide
)
Description:
Repro case (ResizeObserver support required to view)
Filename:
MIME Type:
Creator:
Andy E
Created:
2019-05-28 03:49:29 PDT
Size:
1.04 KB
patch
obsolete
><!DOCTYPE html> ><html> ><body> > <div id="test"></div> > <script> > const MAX_ELEMENT_SIZE = (() => { > const div = document.createElement('div'); > let min = 0; > let max = 100000000; > > div.style.position = 'absolute'; > div.style.width = '1px'; > document.body.appendChild(div); > > while (min < max) { > const middle = Math.floor((min + max) / 2); > div.style.height = `${middle}px`; > > if (div.offsetHeight !== 0 && div.offsetHeight < middle) { > min = div.offsetHeight; > break; > } > if (div.offsetHeight === 0) { > max = middle - 1; > } else { > min = middle; > } > } > > document.body.removeChild(div); > return min; > })(); > > function update() { > test.textContent = `This div is ${test.offsetHeight}px in height`; > } > const resize = new ResizeObserver(update); > resize.observe(test); > > test.style.height = `${MAX_ELEMENT_SIZE}px`; > </script> ></body> ></html>
<!DOCTYPE html> <html> <body> <div id="test"></div> <script> const MAX_ELEMENT_SIZE = (() => { const div = document.createElement('div'); let min = 0; let max = 100000000; div.style.position = 'absolute'; div.style.width = '1px'; document.body.appendChild(div); while (min < max) { const middle = Math.floor((min + max) / 2); div.style.height = `${middle}px`; if (div.offsetHeight !== 0 && div.offsetHeight < middle) { min = div.offsetHeight; break; } if (div.offsetHeight === 0) { max = middle - 1; } else { min = middle; } } document.body.removeChild(div); return min; })(); function update() { test.textContent = `This div is ${test.offsetHeight}px in height`; } const resize = new ResizeObserver(update); resize.observe(test); test.style.height = `${MAX_ELEMENT_SIZE}px`; </script> </body> </html>
View Attachment As Raw
Actions:
View
Attachments on
bug 198291
: 370724