After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 739955 - Wrap on mail Preview's width, not its content width
Wrap on mail Preview's width, not its content width
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: general
3.20.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
: 686012 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-11-11 10:58 UTC by Emre Erenoglu
Modified: 2017-10-23 17:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (15.46 KB, patch)
2015-07-23 06:53 UTC, Tomas Popela
none Details | Review
Wrapping bug when first message is plain text with long sentence. (2.70 KB, application/mbox)
2015-07-30 11:10 UTC, Emre Erenoglu
  Details
backtrace command output (2.38 KB, text/plain)
2015-07-30 12:41 UTC, Emre Erenoglu
  Details
Patch for WebKit2 (15.19 KB, patch)
2016-09-20 11:23 UTC, Tomas Popela
none Details | Review
Patch for WebKit2 (14.01 KB, patch)
2016-09-23 17:04 UTC, Tomas Popela
accepted-commit_now Details | Review

Description Emre Erenoglu 2014-11-11 10:58:56 UTC
Hi,

At work, I frequently receive messages with some tables inside. Sometimes, the tables are horizontally long and do not fit into the preview panel. Evo is in "show message preview, vertical" mode as  I have a wide screen monitor (22", 1920x1080).

When such message arrives, due to the tables, a horizontal scroll bar appears in the preview panel. This if fine and useful to look at the table.

However, the text inside the email is no longer wrapper at the end of panel boundary, it goes on and on without wrapping to next line until the end of the table.

As a result, if there's a horizontally long table in a long email chain, I end up scrolling the horizontal scroll bar just to read normal sentences.

as a comparison, Thunderbird successfully adjusts it wrapping for such messages and once the characters in a sentence/line reaches the end of the preview panel, it wraps and continues from the next line.

Hope I could explain. I can't attach an example message due to privacy, but i think it's easily reproducible.
Comment 1 Milan Crha 2014-11-11 17:02:23 UTC
Thanks for a bug report. The description is clear to me.

Tomas, I think there is some attribute which can limit the width to the current allocated widget's width, even without using JavaScript, isn't it? If not, then involve JavaScript here, which will update the expected width on demand (widget's allocated width change).
Comment 2 Emre Erenoglu 2015-03-18 12:19:57 UTC
Hi, would there be any news on this bug? It's making really difficult to read emails at work. 

Note that now this problem is not limited to messages with Tables, but it applies to all messages. I have to scroll right & left to be able to read those. Very annoying :(

PS. I upgraded, now version 1.15.91.
Comment 3 Tomas Popela 2015-07-23 06:53:29 UTC
Created attachment 307968 [details] [review]
Proposed patch

I'm attaching a proposed patch that I used for some time and it's working for me, but for Milan it caused Evolution to crash on some messages in WebKit code with following backtrace:

Thread 1 (Thread 0x7f10f503ca40 (LWP 17902))

  • #0 waitpid
  • #1 do_system
  • #2 bugbuddy_segv_handle
    at gnome-segvhanlder.c line 180
  • #3 <signal handler called>
  • #4 WebCore::ScrollView::frameRectsChanged()
  • #5 WebCore::ScrollView::updateScrollbars(WebCore::IntSize const&)
  • #6 WebCore::ScrollView::setScrollbarModes(WebCore::ScrollbarMode, WebCore::ScrollbarMode, bool, bool)
  • #7 WebCore::FrameView::layout(bool)
  • #8 WebCore::Document::implicitClose()
  • #9 WebCore::FrameLoader::checkCompleted()
  • #10 WebCore::FrameLoader::completed()
  • #11 WebCore::FrameLoader::checkCompleted()
  • #12 WebCore::FrameLoader::finishedParsing()
  • #13 WebCore::Document::finishedParsing()
  • #14 WebCore::HTMLDocumentParser::prepareToStopParsing()
  • #15 WebCore::HTMLDocumentParser::finish()
  • #16 WebCore::DocumentWriter::end()
  • #17 WebCore::DocumentLoader::finishedLoading(double)
  • #18 WebCore::CachedResource::checkNotify()
  • #19 WebCore::CachedRawResource::finishLoading(WebCore::ResourceBuffer*)
  • #20 WebCore::SubresourceLoader::didFinishLoading(double)
  • #21 WebCore::readCallback(_GObject*, _GAsyncResult*, void*)
  • #22 async_ready_callback_wrapper
  • #23 g_task_return_now
  • #24 complete_in_idle_cb
  • #25 g_main_context_dispatch
  • #26 g_main_context_iterate.isra
  • #27 g_main_loop_run
  • #28 gtk_main
    at gtkmain.c line 1219
  • #29 main
    at main.c line 638

Comment 4 Emre Erenoglu 2015-07-30 11:09:53 UTC
Hi Tomas, Milan,

I compiled EVO today from git master and applied the patch to evolution. This seems to solve the bug on most of the messages with all html content. So I'm happy with it. I did not get any crash since an hour with it.


However, I recognized the bug persists on messages where 
1) the original long line message is a plain text message from a mobile phone 
2) There are no tables
3) consequent replies are in html and text

I'm attaching the related mbox file to help in debugging. However, I had to replace all message content with bogus characters and remove all email addresses and server names as this is a work related email which I can't disclose.

This behaviour can be replicated in each message thread which starts 

Hope it still helps to understand what's going on.
Comment 5 Emre Erenoglu 2015-07-30 11:10:55 UTC
Created attachment 308448 [details]
Wrapping bug when first message is plain text with long sentence.
Comment 6 Tomas Popela 2015-07-30 11:51:59 UTC
(In reply to Emre Erenoglu from comment #4)
> I compiled EVO today from git master and applied the patch to evolution.
> This seems to solve the bug on most of the messages with all html content.
> So I'm happy with it. I did not get any crash since an hour with it.

Thanks for testing! I'm running it for more than a week and I didn't saw the crash either.
 
> However, I recognized the bug persists on messages where 
> 1) the original long line message is a plain text message from a mobile
> phone 
> 2) There are no tables
> 3) consequent replies are in html and text
> 
> I'm attaching the related mbox file to help in debugging. However, I had to
> replace all message content with bogus characters and remove all email
> addresses and server names as this is a work related email which I can't
> disclose.

The problem is that the long line is in preformatted element and it should stay as is. We are sticking with Thunderbird behavior and they are not wrapping the preformatted content as well.
Comment 7 Emre Erenoglu 2015-07-30 12:36:43 UTC
Bad news! Got the crash today systematically on a message.

I get this in gdb output, how can I further debug? 

(evolution:24230): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed
[New Thread 0x7fff7a623700 (LWP 24808)]
[New Thread 0x7fff493e4700 (LWP 24802)]
[New Thread 0x7fff7ae24700 (LWP 24743)]
[New Thread 0x7fff78c1a700 (LWP 24716)]
[New Thread 0x7fff79c1c700 (LWP 24277)]
[New Thread 0x7fff417fa700 (LWP 24268)]
[New Thread 0x7fff41ffb700 (LWP 24267)]
[New Thread 0x7fff427fc700 (LWP 24266)]
[New Thread 0x7fff42ffd700 (LWP 24265)]
[New Thread 0x7fff69ffb700 (LWP 24258)]
[New Thread 0x7fff808a3700 (LWP 24239)]
[New Thread 0x7fff8f5b6700 (LWP 24238)]
[New Thread 0x7fffcfdb9700 (LWP 24237)]
[New Thread 0x7fffdf532700 (LWP 24235)]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5ec5346 in ?? () from /usr/lib/x86_64-linux-gnu/libwebkitgtk-3.0.so.0
Comment 8 Emre Erenoglu 2015-07-30 12:41:52 UTC
Created attachment 308451 [details]
backtrace command output

I got this output when i issued backtrace command in gdb after the crash.
Comment 9 Milan Crha 2015-07-30 14:55:44 UTC
Without debuginfo for your webkitgtk3 hard to tell for sure, but seeing all the frames coming from webkit, like with the backtrace from the comment #3, I believe it's the same issue.
Comment 10 Emre Erenoglu 2015-07-30 15:54:00 UTC
Probably. Anyway I can test again when that crash is fixed.
Comment 11 Milan Crha 2015-08-10 04:43:29 UTC
Comment on attachment 307968 [details] [review]
Proposed patch

Just marking this to needs-work, to get it out of unreviewed patches list. The reason for needs-work is the crash with certain messages, which might not be neccesary an issue with the patch, but as long as it'll crash it cannot be used, because not wrapped content is not that big issue as the crash.
Comment 12 Milan Crha 2015-08-13 15:27:02 UTC
*** Bug 686012 has been marked as a duplicate of this bug. ***
Comment 13 Emre Erenoglu 2016-06-16 21:27:26 UTC
Coming back on this for 3.20.3, I can still reproduce this with emails I receive from our exchange server.
Comment 14 Milan Crha 2016-06-24 10:17:08 UTC
Just for a reference, and possibly totally useless, but for example this [1] page has text wrapped on the window width, but the below table can be left wider (just make the window as small as possible and notice that the paragraphs are still within the window width, but the table defines the overall canvas width). I do not know how they do it, maybe it's something in javascript, which is a no-go for evo. I tested the page in WebKit2's 2.12.2 MiniBrowser and it seems to handle it fine.

[1] https://hsprod.investis.com/shared/v2/irwizard/sec_item_new.jsp?page=sec_item_new&cik=&epic=redhat&ipage=11007963&DSEQ=1&SEQ=33&SQDESC=SECTION_PAGE&exp=&subsid=41
Comment 15 Paul Smith 2016-09-06 15:08:41 UTC
Has anyone obtained a stacktrace with debug symbols enabled, and/or forwarded this issue to the WebKit folks?
Comment 16 Milan Crha 2016-09-07 10:11:56 UTC
(In reply to Paul Smith from comment #15)
> Has anyone obtained a stacktrace with debug symbols enabled, and/or
> forwarded this issue to the WebKit folks?

There was no need for this, because the patch is based on WebKit1, which is basically unmaintained (in the maintenance mode) by the upstream. Once the patch will be updated to work with the latest development evolution, which uses WebKit2, which is actively worked on by the upstream, then the issue can be shared with them, if any.
Comment 17 Tomas Popela 2016-09-20 11:23:05 UTC
Created attachment 335924 [details] [review]
Patch for WebKit2

Here is the updated patch for WebKit2 port of Evolution. Feel free to test it.
Comment 18 Tomas Popela 2016-09-23 17:04:23 UTC
Created attachment 336168 [details] [review]
Patch for WebKit2

Add the missing call to e_dom_resize_document_content_to_preview_width() when the document was loaded. Otherwise the resize was triggered only when the preview was resized.
Comment 19 Milan Crha 2016-10-20 13:26:12 UTC
Comment on attachment 336168 [details] [review]
Patch for WebKit2

I'm setting the patch as 'reviewed', to get it out of the unreviewed patches list.
Comment 20 Milan Crha 2016-11-10 09:19:49 UTC
I did a quick testing of the updated patch and it worked as expected, and even didn't crash, on a set of messages I tried it with. Let's commit it and deal with any (if any) issues when (if) they arise. Thanks.
Comment 21 Tomas Popela 2016-11-10 10:13:48 UTC
Fixed with the following commits:

    Bug 739955 - Wrap on mail Preview's width, not its content width

    Force the width of the elements based on the preview width, but not for
    messages that were formatted with text-highlight module (there is one
    exception and it is the plain text formatting).

    Also include additional fixes to our CSS:
     * don't break the text in the middle of contact
     * add missing border around some iframes
     * remove some of the margins and paddings

commit 8f32c35 in the master branch for Evolution 3.23.2+
Comment 22 Milan Crha 2017-06-08 17:19:34 UTC
(In reply to Milan Crha from comment #20)
> I did a quick testing of the updated patch and it worked as expected, and
> even didn't crash, on a set of messages I tried it with. Let's commit it and
> deal with any (if any) issues when (if) they arise. Thanks.

I just got a crash, with the below backtrace. It was when Ctrl+Shift+F in a message source (Ctrl+U) after having several messages viewed in a dedicated window (double-click in message list).

It looks like the signal handler had been registered twice, due to dynamic loading (as written elsewhere in the code), one with an already freed 'document' pointer. Removing the previous handler works, thus:

Created commit feed865 in evo master (3.25.3+)
Created commit cf80358 in evo gnome-3-24 (3.24.3+)

Thread 1 (Thread 0x7f6fc4078f40 (LWP 28913))

  • #0 waitpid
  • #1 do_system
  • #2 bugbuddy_segv_handle
    at gnome-segvhanlder.c line 180
  • #3 <signal handler called>
  • #4 webkit_dom_document_get_document_element
  • #5 e_dom_resize_document_content_to_preview_width
    at ..../src/web-extensions/e-dom-utils.c line 989
  • #6 dom_window_resize_cb
    at ..../src/web-extensions/e-dom-utils.c line 1005
  • #7 ffi_call_unix64
  • #8 ffi_call
  • #9 g_cclosure_marshal_generic
    at gclosure.c line 1490
  • #10 g_closure_invoke
    at gclosure.c line 804
  • #11 WebKit::GObjectEventListener::handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*)
  • #12 WebCore::EventTarget::fireEventListeners(WebCore::Event&, WTF::Vector<WTF::RefPtr<WebCore::RegisteredEventListener>, 1ul, WTF::CrashOnOverflow, 16ul>)
  • #13 WebCore::EventTarget::fireEventListeners(WebCore::Event&)
  • #14 WebCore::DOMWindow::dispatchEvent(WebCore::Event&, WebCore::EventTarget*)
  • #15 WebCore::FrameView::sendResizeEventIfNeeded()
  • #16 WebCore::FrameView::performPostLayoutTasks()
  • #17 WebCore::FrameView::layout(bool)
  • #18 WebCore::FrameView::updateContentsSize()
  • #19 WebCore::ScrollView::updateScrollbars(WebCore::IntPoint const&)
  • #20 WebCore::ScrollView::availableContentSizeChanged(WebCore::ScrollableArea::AvailableSizeChangeReason)
  • #21 WebCore::ScrollView::setFrameRect(WebCore::IntRect const&)
  • #22 WebCore::FrameView::setFrameRect(WebCore::IntRect const&)
  • #23 WebKit::WebPage::setSize(WebCore::IntSize const&)
  • #24 WebKit::AcceleratedDrawingArea::updateBackingStoreState(unsigned long, bool, float, WebCore::IntSize const&, WebCore::IntSize const&)
  • #25 WebKit::DrawingAreaImpl::updateBackingStoreState(unsigned long, bool, float, WebCore::IntSize const&, WebCore::IntSize const&)
  • #26 void IPC::handleMessage<Messages::DrawingArea::UpdateBackingStoreState, WebKit::DrawingArea, void
  • #27 WebKit::DrawingArea::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
  • #28 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&)
  • #29 WebKit::WebProcess::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
  • #30 IPC::Connection::dispatchMessage(std::unique_ptr<IPC::Decoder, std::default_delete<IPC::Decoder> >)
  • #31 IPC::Connection::dispatchOneMessage()
  • #32 WTF::RunLoop::performWork()
  • #33 WTF::RunLoop::RunLoop()::{lambda(void*)#1}::_FUN(void*)
  • #34 g_main_dispatch
    at gmain.c line 3203
  • #35 g_main_context_dispatch
    at gmain.c line 3856
  • #36 g_main_context_iterate
    at gmain.c line 3929
  • #37 g_main_loop_run
    at gmain.c line 4125
  • #38 WTF::RunLoop::run()
  • #39 int WebKit::ChildProcessMain<WebKit::WebProcess, WebKit::WebProcessMain>(int, char**)
  • #40 __libc_start_main
  • #41 _start

Comment 23 Milan Crha 2017-10-23 17:11:40 UTC
Another follow up change due to a similar crash reported downstream [1], which shows that the above change was not good enough.

Created commit 929dbca69c in evo master (3.27.2+)
Created commit 6fd3d59c28 in evo gnome-3-26 (3.26.2+)

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1504503