| Summary: | [GTK] MiniBrowser: stop using GtkToolbar | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||
| Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | aperez, bugs-noreply | ||||
| Priority: | P2 | Keywords: | Gtk | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Bug Depends on: | 212817 | ||||||
| Bug Blocks: | 210100, 210276 | ||||||
| Attachments: |
|
||||||
|
Description
Carlos Garcia Campos
2020-06-08 07:20:44 PDT
Created attachment 401332 [details]
Patch
Comment on attachment 401332 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401332&action=review > Tools/MiniBrowser/gtk/BrowserWindow.c:473 > + return webkit_web_view_get_zoom_level(webView) != 1.0; Comparing floating point numbers is usually a bad idea, due to rounding errors and whatnot. Probably not much of an issue here, but the safest would be rounding to the nearest integer and comparing that: return lrint(webkit_web_view_get_zoom_level(webView)) == 1; No strong opinion, though. Feel free to leave the code as-is if you prefer. (In reply to Adrian Perez from comment #2) > Comment on attachment 401332 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=401332&action=review > > > Tools/MiniBrowser/gtk/BrowserWindow.c:473 > > + return webkit_web_view_get_zoom_level(webView) != 1.0; > > Comparing floating point numbers is usually a bad idea, due to rounding > errors > and whatnot. Probably not much of an issue here, but the safest would be > rounding > to the nearest integer and comparing that: > > return lrint(webkit_web_view_get_zoom_level(webView)) == 1; > > No strong opinion, though. Feel free to leave the code as-is if you prefer. I don't think it's a problem in this case because 1.0 is set when the load completes, which is what we want to check here. Committed r262938: <https://trac.webkit.org/changeset/262938> |