diff --git a/AppKit/CPTextView/CPLayoutManager.j b/AppKit/CPTextView/CPLayoutManager.j index 8d3572a35..dbcc6e294 100644 --- a/AppKit/CPTextView/CPLayoutManager.j +++ b/AppKit/CPTextView/CPLayoutManager.j @@ -1541,11 +1541,19 @@ var _objectsInRange = function(aList, aRange) if (verticalOffset) { + // An attachment view is moved through setFrameOrigin:, which also moves it on the + // screen. Changing its frame directly would leave it in place, because the next draw's + // setFrameOrigin: would then find it already at the new origin and do nothing. if (_runs[i].view) - _runs[i].view._frame.origin.y += verticalOffset; + { + var viewOrigin = [_runs[i].view frameOrigin]; - if (_runs[i].elem) - _runs[i].elem.top = (_runs[i].elem.top + verticalOffset) + 'px'; + [_runs[i].view setFrameOrigin:CGPointMake(viewOrigin.x, viewOrigin.y + verticalOffset)]; + } + + // A span that has been placed moves with its line. One that has not is placed when drawn. + if (_runs[i].elem && _runs[i].elem.style.top) + _runs[i].elem.style.top = (parseFloat(_runs[i].elem.style.top) + verticalOffset) + 'px'; _runs[i].DOMpatched = YES; } diff --git a/Tests/Manual/TextEditor/WORKLIST.md b/Tests/Manual/TextEditor/WORKLIST.md index 71b258ce6..d9e2ac21d 100644 --- a/Tests/Manual/TextEditor/WORKLIST.md +++ b/Tests/Manual/TextEditor/WORKLIST.md @@ -90,4 +90,5 @@ How the text system works, for the entries below: `CPTextView` does not use CSS - Edit > Insert Table Example: the sample table appears between the surrounding sentences, with its header row and its bold and italic cells. - Copy and paste within TextEditor with Command-C and Command-V, in one document and between documents: images, tables, including text edited in their cells, and lists are kept. - Table cells can be edited, as a first pass. +- Pasting text with several images and a table: the table appears in place at once, and tables, images and text below a change move with their lines. - Builds with both the legacy toolchain and capp-build.