mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
layout: Parameterize content box query (#38935)
Parameterize and rename both `Layout::content_box_query` and `Layout::content_boxes_query` to support the query of rendered padding area and content area that accounts for transform and scroll. Both of these query have been misleading for a time since they are using border box, instead of content box of a Node. This PR adds a new type `layout_api::BoxAreaType` to be passed from `ScriptThread` to `LayoutThread` to query the respective area. It is then used for the query within `IntersectionObserver` to pass several WPTs. Testing: Existing WPT Coverage. --------- Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
This commit is contained in:
parent
32aba08be7
commit
10ca3b6fde
21 changed files with 125 additions and 125 deletions
|
@ -302,6 +302,14 @@ impl BoxFragment {
|
|||
rect.translate(self.cumulative_containing_block_rect.origin.to_vector())
|
||||
}
|
||||
|
||||
pub(crate) fn cumulative_content_box_rect(&self) -> PhysicalRect<Au> {
|
||||
self.offset_by_containing_block(&self.margin_rect())
|
||||
}
|
||||
|
||||
pub(crate) fn cumulative_padding_box_rect(&self) -> PhysicalRect<Au> {
|
||||
self.offset_by_containing_block(&self.padding_rect())
|
||||
}
|
||||
|
||||
pub(crate) fn cumulative_border_box_rect(&self) -> PhysicalRect<Au> {
|
||||
self.offset_by_containing_block(&self.border_rect())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue