astroid icon indicating copy to clipboard operation
astroid copied to clipboard

webkit_settings_set_enable_frame_flattening() deprecation

Open mcatanzaro opened this issue 2 years ago • 9 comments

Hi, this is a heads-up that the webkit_settings_set_enable_frame_flattening() and the WebKitSettings:enable-frame-flattening property will break in WebKitGTK 2.40. You'll need to figure out how to stop using them soon. If your app breaks with this setting disabled, then you'll want to ensure updated versions of your application reach environments that you care about prior to the release of WebKitGTK 2.40.

For more information: https://bugs.webkit.org/show_bug.cgi?id=242883

Sorry for the trouble. :/

mcatanzaro avatar Aug 31 '22 19:08 mcatanzaro

This seems to finally have bitten me (Fedora 37, webkit2gtk4.0-devel, astroid - v0.16-2-g7c2022f0).

In thread view the overflowing parts of expanded emails are hidden (i.e. not viewable). A workaround is to copy part.scss to ~/.config/astroid/ui/ as described here. Then comment the hiding of overflowing parts like

body {
...
  /* overflow-y: hidden; */
...
}

Restart astroid. Now overflowing emails are scrollable for viewing.

stephancb avatar Mar 23 '23 14:03 stephancb

I was also effected by this. Before seeing this report, I filled a bug report for the debian package and also found a temporary work around by downgrading libwebkit.

Thanks @stephancb for the temporary fix and to @mcatanzaro for the heads-up here.

kirschner avatar May 17 '23 07:05 kirschner

Does that fix work fine? If so, wouldn't it make sense to create a pull request with it?

bertogg avatar May 17 '23 08:05 bertogg

It actually just promotes Astroid from unusable to barely usable. The view port is still very narrow. At least on my machine.

bitmeise avatar May 17 '23 10:05 bitmeise

I see, is there anyone with knowledge on the Astroid code that can provide a better solution?

bertogg avatar May 17 '23 10:05 bertogg

@bertogg @bitmeise it works better if you also overwrite the height of the iframe containing the email body. In thread-view.css look for the iframe selector and add this rule to it: height: 70vh (Adjust the value to your liking)

Example:

iframe {
  border: none;
  width: 100%;
  height: 70vh;
  text-align: left;
  float: left;
  display: block;
}

Hoping someone will eventually find a proper fix for this :)

thomas2p avatar May 30 '23 08:05 thomas2p

AFAICT, the content of the iframe is set here.

https://github.com/astroidmail/astroid/blob/7c2022f06a4146ad62e858bcaacdb4ee817851b9/src/modes/thread_view/webextension/tvextension.cc#L1160-L1195

Based from changes in other projects - looking at Evolution specifically - the height (scrollHeight?) of the message body needs to be used to dynamically set the iframe height (plus padding).

Reading the GTK docs to get sense of how things are pieced together, it does not look good that pretty much all the C++ API has been deprecated in favour of writing everything in Javascript though. :-)

https://webkitgtk.org/reference/webkitdomgtk/2.31.91/WebKitDOMHTMLIFrameElement.html#webkit-dom-html-iframe-element-set-height

ibuclaw avatar Jun 04 '23 18:06 ibuclaw

In principle, this is not really difficult to fix, if (a) one uses the scrollHeight (maybe from some other DOM library if webkit's is deprecated?) and (b) there is one function which is always executed when the view is updated. However, I didn't find that one function, and I think there are different ones depending on whether the content is HTML or plain or some other MIME. At least, my fix worked only for html messages, not for an alternative part.

Does anybody know all places at which one has to add the relevant code?

jorsn avatar Aug 20 '23 12:08 jorsn

Rebasing onto https://github.com/ibuclaw/astroid/tree/remove_iframes fixes the breakage for me

rothn avatar Sep 08 '23 04:09 rothn