mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Let textarea wrap lines
This commit is contained in:
parent
8ded106186
commit
0a86543e6d
4 changed files with 16 additions and 13 deletions
|
@ -882,16 +882,23 @@ impl Fragment {
|
|||
let size = LogicalSize::new(self.style.writing_mode,
|
||||
split.inline_size,
|
||||
self.border_box.size.block);
|
||||
let flags = match self.specific {
|
||||
SpecificFragmentInfo::ScannedText(ref info) => info.flags,
|
||||
_ => ScannedTextFlags::empty()
|
||||
// Preserve the insertion point if it is in this fragment's range or it is at line end.
|
||||
let (flags, insertion_point) = match self.specific {
|
||||
SpecificFragmentInfo::ScannedText(ref info) => {
|
||||
match info.insertion_point {
|
||||
Some(index) if split.range.contains(index) => (info.flags, info.insertion_point),
|
||||
Some(index) if index == ByteIndex(text_run.text.chars().count() as isize - 1) &&
|
||||
index == split.range.end() => (info.flags, info.insertion_point),
|
||||
_ => (info.flags, None)
|
||||
}
|
||||
},
|
||||
_ => (ScannedTextFlags::empty(), None)
|
||||
};
|
||||
// FIXME(pcwalton): This should modify the insertion point as necessary.
|
||||
let info = box ScannedTextFragmentInfo::new(
|
||||
text_run,
|
||||
split.range,
|
||||
size,
|
||||
None,
|
||||
insertion_point,
|
||||
flags);
|
||||
self.transform(size, SpecificFragmentInfo::ScannedText(info))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue