mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make text-align: justify
incremental layout safe
This commit is contained in:
parent
da85439093
commit
0f983cd11f
7 changed files with 97 additions and 92 deletions
|
@ -1751,23 +1751,23 @@ impl Fragment {
|
|||
/// Restore any whitespace that was stripped from a text fragment, and recompute inline metrics
|
||||
/// if necessary.
|
||||
pub fn reset_text_range_and_inline_size(&mut self) {
|
||||
match &mut self.specific {
|
||||
&mut SpecificFragmentInfo::ScannedText(ref mut info) => {
|
||||
// FIXME (mbrubeck): Do we need to restore leading too?
|
||||
let range_end = info.range_end_including_stripped_whitespace;
|
||||
if info.range.end() == range_end {
|
||||
return
|
||||
}
|
||||
info.range.extend_to(range_end);
|
||||
info.content_size.inline = info.run.metrics_for_range(&info.range).advance_width;
|
||||
self.border_box.size.inline = info.content_size.inline +
|
||||
self.border_padding.inline_start_end();
|
||||
if let SpecificFragmentInfo::ScannedText(ref mut info) = self.specific {
|
||||
if info.run.extra_word_spacing != Au(0) {
|
||||
Arc::make_mut(&mut info.run).extra_word_spacing = Au(0);
|
||||
}
|
||||
_ => {}
|
||||
|
||||
// FIXME (mbrubeck): Do we need to restore leading too?
|
||||
let range_end = info.range_end_including_stripped_whitespace;
|
||||
if info.range.end() == range_end {
|
||||
return
|
||||
}
|
||||
info.range.extend_to(range_end);
|
||||
info.content_size.inline = info.run.metrics_for_range(&info.range).advance_width;
|
||||
self.border_box.size.inline = info.content_size.inline +
|
||||
self.border_padding.inline_start_end();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Assigns replaced inline-size, padding, and margins for this fragment only if it is replaced
|
||||
/// content per CSS 2.1 § 10.3.2.
|
||||
pub fn assign_replaced_inline_size_if_necessary(&mut self, container_inline_size: Au) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue