| Summary: | vw units doesn't get updated inside shadow trees as frame is resized | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Roman Prudnikov <rayproudnikoff> | ||||
| Component: | Layout and Rendering | Assignee: | Ryosuke Niwa <rniwa> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Major | CC: | bfulgham, hi, koivisto, rniwa, simon.fraser, vahan.hartooni, webkit-bug-importer, zalan | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | Safari 13 | ||||||
| Hardware: | Mac | ||||||
| OS: | macOS 10.14 | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 148695 | ||||||
| Attachments: |
|
||||||
|
Description
Roman Prudnikov
2020-09-07 03:49:52 PDT
This doesn't just affect positioning, but dimensions as well. Take for example this example: https://jsfiddle.net/auzekghL/ When you resize the window, the blue box doesn't update it's width or height to fit the window. Compare that to this blue box which does: https://jsfiddle.net/1jyacbzh/ Both blue boxes have these two css rules: height: calc(100vh - 50px); width: 100vw; But the first one is in a shadow dom. There is a workaround where you can apply `width: 100vw` on the `:host`: https://jsfiddle.net/3kxn0veh/ Unfortunately, you can't utilize the same technique on height: https://jsfiddle.net/3nktrqw9/ This is a bug in Document::updateViewportUnitsOnResize(). It needs to iterate over all shadow roots & invalidate styles instead of just at the document level. Created attachment 460657 [details]
WIP
Pull request: https://github.com/WebKit/WebKit/pull/2061 Pull request: https://github.com/WebKit/WebKit/pull/2062 Committed 252149@main (50df76018d84): <https://commits.webkit.org/252149@main> Reviewed commits have been landed. Closing PR #2062 and removing active labels. |