libservo: Added set_rect method and called it in resize#41148
libservo: Added set_rect method and called it in resize#41148helvete003 wants to merge 1 commit intoservo:mainfrom
Conversation
|
🔨 Triggering try run (#20049307842) for Linux (WPT) |
| self.inner().rect | ||
| } | ||
|
|
||
| pub fn set_rect(&self, new_size: Size2D<f32, DevicePixel>) { |
There was a problem hiding this comment.
What is the benefit to making this a public API? When would an embedder be expected to call it?
| .servo | ||
| .compositor() | ||
| .resize_rendering_context(self.id(), new_size); | ||
| self.set_rect( |
There was a problem hiding this comment.
My instinct here is that if we're only calling this new method in one place, we should just inline the method body instead and remove the method.
|
Test results for linux-wpt from try job (#20049307842): Flaky unexpected result (44)
Stable unexpected results that are known to be intermittent (14)
|
|
✨ Try run (#20049307842) succeeded. |
|
I think it should be possible to write a unit test for this (eg. servo/components/servo/tests/webview.rs Line 263 in 7781b38 |
|
I think the real fix here might be to do away with the |
With the removal of the MDI support, a `WebView` is now always as big as the `RenderingContext` onto which it renders. This change removes the remnant of the MDI support which is the `rect` property. This was problematic because it could get out of sync with the size of the `RenderingContext`. This change also adds a test for the case where these could get out of sync. Testing: There is a unit test for this change. Closes: #41148. Fixes: #41116. Signed-off-by: Martin Robinson <[email protected]>
When resizing the
Servoshellwindow, therectof thewebviewwas not updated. This had the effect thatMouseEventslikemovewould not work outside of the old rect size.Testing: Open a website like wikipedia and resize the window. Hover over the text and check if the
Cursor::Texticon stays visible in the newly visible areas.Fixes: #41116 (comment)