mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Auto merge of #10469 - mbrubeck:layout-misc, r=pcwalton
Some minor layout cleanups * Prevent unnecessary copying in `strip_leading_whitespace_if_necessary` * Remove unused argument to `adjust_clipping_region_for_children` (silences a compiler warning) r? @pcwalton <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10469) <!-- Reviewable:end -->
This commit is contained in:
commit
bd2051d06a
4 changed files with 8 additions and 9 deletions
|
@ -1921,8 +1921,7 @@ impl Flow for BlockFlow {
|
||||||
CoordinateSystem::Own);
|
CoordinateSystem::Own);
|
||||||
self.fragment.adjust_clipping_region_for_children(
|
self.fragment.adjust_clipping_region_for_children(
|
||||||
&mut clip,
|
&mut clip,
|
||||||
&stacking_relative_border_box,
|
&stacking_relative_border_box);
|
||||||
self.base.flags.contains(IS_ABSOLUTELY_POSITIONED));
|
|
||||||
|
|
||||||
// Process children.
|
// Process children.
|
||||||
for kid in self.base.child_iter() {
|
for kid in self.base.child_iter() {
|
||||||
|
|
|
@ -229,8 +229,7 @@ pub trait FragmentDisplayListBuilding {
|
||||||
/// Adjusts the clipping region for descendants of this fragment as appropriate.
|
/// Adjusts the clipping region for descendants of this fragment as appropriate.
|
||||||
fn adjust_clipping_region_for_children(&self,
|
fn adjust_clipping_region_for_children(&self,
|
||||||
current_clip: &mut ClippingRegion,
|
current_clip: &mut ClippingRegion,
|
||||||
stacking_relative_border_box: &Rect<Au>,
|
stacking_relative_border_box: &Rect<Au>);
|
||||||
is_absolutely_positioned: bool);
|
|
||||||
|
|
||||||
/// Adjusts the clipping rectangle for a fragment to take the `clip` property into account
|
/// Adjusts the clipping rectangle for a fragment to take the `clip` property into account
|
||||||
/// per CSS 2.1 § 11.1.2.
|
/// per CSS 2.1 § 11.1.2.
|
||||||
|
@ -1444,8 +1443,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
|
|
||||||
fn adjust_clipping_region_for_children(&self,
|
fn adjust_clipping_region_for_children(&self,
|
||||||
current_clip: &mut ClippingRegion,
|
current_clip: &mut ClippingRegion,
|
||||||
stacking_relative_border_box: &Rect<Au>,
|
stacking_relative_border_box: &Rect<Au>) {
|
||||||
is_absolutely_positioned: bool) {
|
|
||||||
// Don't clip if we're text.
|
// Don't clip if we're text.
|
||||||
if self.is_scanned_text_fragment() {
|
if self.is_scanned_text_fragment() {
|
||||||
return
|
return
|
||||||
|
|
|
@ -2347,7 +2347,10 @@ impl Fragment {
|
||||||
modified = true;
|
modified = true;
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
new_text_string.push_str(&unscanned_text_fragment_info.text[i..]);
|
// Finished processing leading control chars and whitespace.
|
||||||
|
if modified {
|
||||||
|
new_text_string.push_str(&unscanned_text_fragment_info.text[i..]);
|
||||||
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if modified {
|
if modified {
|
||||||
|
|
|
@ -1682,8 +1682,7 @@ impl Flow for InlineFlow {
|
||||||
fragment.stacking_relative_content_box(&stacking_relative_border_box);
|
fragment.stacking_relative_content_box(&stacking_relative_border_box);
|
||||||
let mut clip = self.base.clip.clone();
|
let mut clip = self.base.clip.clone();
|
||||||
fragment.adjust_clipping_region_for_children(&mut clip,
|
fragment.adjust_clipping_region_for_children(&mut clip,
|
||||||
&stacking_relative_border_box,
|
&stacking_relative_border_box);
|
||||||
false);
|
|
||||||
let is_positioned = fragment.is_positioned();
|
let is_positioned = fragment.is_positioned();
|
||||||
match fragment.specific {
|
match fragment.specific {
|
||||||
SpecificFragmentInfo::InlineBlock(ref mut info) => {
|
SpecificFragmentInfo::InlineBlock(ref mut info) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue