mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
layout: Merge BoxFragment::used_overflow
into ComputedValuesExt::effective_overflow
(#35670) (#35670)
* Update wpt-test * Merge used_overflow to effective_overflow; remove duplicate call * Remove more duplicate calls; update effective_overflow logic * Update reference link&style * Apply final review suggestions Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
parent
b56a3caea0
commit
28cea920ec
7 changed files with 54 additions and 47 deletions
|
@ -154,7 +154,7 @@ impl BoxFragment {
|
|||
//
|
||||
// This applies even if there is no baseline set, so we unconditionally set the value here
|
||||
// and ignore anything that is set via [`Self::with_baselines`].
|
||||
if self.style.establishes_scroll_container() {
|
||||
if self.style.establishes_scroll_container(self.base.flags) {
|
||||
let content_rect_size = self.content_rect.size.to_logical(writing_mode);
|
||||
let padding = self.padding.to_logical(writing_mode);
|
||||
let border = self.border.to_logical(writing_mode);
|
||||
|
@ -228,7 +228,7 @@ impl BoxFragment {
|
|||
self.clearance,
|
||||
self.scrollable_overflow(),
|
||||
self.baselines,
|
||||
self.style.effective_overflow(),
|
||||
self.style.effective_overflow(self.base.flags),
|
||||
));
|
||||
|
||||
for child in &self.children {
|
||||
|
@ -239,7 +239,7 @@ impl BoxFragment {
|
|||
|
||||
pub fn scrollable_overflow_for_parent(&self) -> PhysicalRect<Au> {
|
||||
let mut overflow = self.border_rect();
|
||||
if self.style.establishes_scroll_container() {
|
||||
if self.style.establishes_scroll_container(self.base.flags) {
|
||||
return overflow;
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ impl BoxFragment {
|
|||
overflow.max_y().max(scrollable_overflow.max_y()),
|
||||
);
|
||||
|
||||
let overflow_style = self.style.effective_overflow();
|
||||
let overflow_style = self.style.effective_overflow(self.base.flags);
|
||||
if overflow_style.y == ComputedOverflow::Visible {
|
||||
overflow.origin.y = overflow.origin.y.min(scrollable_overflow.origin.y);
|
||||
overflow.size.height = bottom_right.y - overflow.origin.y;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue