RESOLVED FIXED 169288
Simple line layout: Do not use invalid m_lastNonWhitespaceFragment while removing trailing whitespace.
https://bugs.webkit.org/show_bug.cgi?id=169288
Summary Simple line layout: Do not use invalid m_lastNonWhitespaceFragment while remo...
zalan
Reported 2017-03-07 10:31:49 PST
if all the runs are whitespace on the current line, m_lastNonWhitespaceFragment is invalid. Do not use it.
Attachments
Patch (5.98 KB, patch)
2017-03-07 11:03 PST, zalan
no flags
Patch (6.03 KB, patch)
2017-03-07 11:43 PST, zalan
no flags
zalan
Comment 1 2017-03-07 10:32:07 PST
zalan
Comment 2 2017-03-07 11:03:11 PST
Antti Koivisto
Comment 3 2017-03-07 11:19:50 PST
Comment on attachment 303680 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=303680&action=review > Source/WebCore/rendering/SimpleLineLayout.cpp:507 > + } else { > + // Trailing whitespace fragment with zero length. > + ASSERT(!m_trailingWhitespaceWidth); > + } This might look nicer without else branch with just assert in it. Maybe put m_lastNonWhitespaceFragment->end() != m_lastFragment.end() to a informatively named bool and then do something like ASSERT(needsRevert || !m_trailingWhitespaceWidth)?
zalan
Comment 4 2017-03-07 11:29:33 PST
(In reply to comment #3) > Comment on attachment 303680 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=303680&action=review > > > Source/WebCore/rendering/SimpleLineLayout.cpp:507 > > + } else { > > + // Trailing whitespace fragment with zero length. > > + ASSERT(!m_trailingWhitespaceWidth); > > + } > > This might look nicer without else branch with just assert in it. Maybe put > m_lastNonWhitespaceFragment->end() != m_lastFragment.end() to a > informatively named bool and then do something like ASSERT(needsRevert || > !m_trailingWhitespaceWidth)? Good idea!
zalan
Comment 5 2017-03-07 11:43:38 PST
WebKit Commit Bot
Comment 6 2017-03-07 13:02:19 PST
Comment on attachment 303691 [details] Patch Clearing flags on attachment: 303691 Committed r213534: <http://trac.webkit.org/changeset/213534>
WebKit Commit Bot
Comment 7 2017-03-07 13:02:23 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.