E53B doc: Add doc for compositor/webview/embedder related to window/rect/inner_size/rendering_context by yezhizhen · Pull Request #38110 · servo/servo · GitHub
[go: up one dir, main page]

Skip to content

Conversation

yezhizhen
Copy link
Member
@yezhizhen yezhizhen commented Jul 16, 2025

Add docs before actually fixing #38089, #38090, #37978, #38093.

Testing: Just adding docs.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
fn winit_window(&self) -> Option<&winit::window::Window>;
fn toolbar_height(&self) -> Length<f32, DeviceIndependentPixel>;
fn set_toolbar_height(&self, height: Length<f32, DeviceIndependentPixel>);
/// Viewport.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended? The description doesn't match the method either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for that. Just made it more concrete!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm a rendering context is more that just a viewport I think. It should linkt to this trait.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. But everytime we call

fn size2d(&self) -> Size2D<u32, DevicePixel> {

people seem to use it as viewport size.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example

let size = rendering_context.size2d().to_i32();
let viewport_rect = DeviceIntRect::from_origin_and_size(Point2D::origin(), size);

Copy link
Member Author
@yezhizhen yezhizhen Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can we add better doc for fn rendering_context? I think I understand your concern.
Right now I'm going with
/// This returns [RenderingContext] matching the viewport.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
@yezhizhen yezhizhen requested review from wusyong and jdm July 16, 2025 05:26
@yezhizhen
Copy link
Member Author

Can someone check this? It is very important for next step fix. I want to ensure correctness.

@wusyong wusyong added this pull request to the merge queue Jul 17, 2025
Merged via the queue into servo:main with commit fe2c13c Jul 17, 2025
22 checks passed
arihant2math pushed a commit to arihant2math/servo that referenced this pull request Jul 21, 2025
…nner_size/rendering_context (servo#38110)

Add docs before actually fixing servo#38089, servo#38090, servo#37978, servo#38093.

Testing: Just adding docs.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
@yezhizhen yezhizhen deleted the fix-cursor-move branch August 8, 2025 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0