diff options
author | Jan Beich <jbeich@FreeBSD.org> | 2018-05-15 16:41:16 +0800 |
---|---|---|
committer | Jan Beich <jbeich@FreeBSD.org> | 2018-05-15 16:41:16 +0800 |
commit | 75dd8df3ae88a2ebfe9b497d6eec519afe3c8db5 (patch) | |
tree | 4e33680e8edf1dde8af3fdcec45595eb8ccaf79c | |
parent | b542ff14b526d112d13d8339d05838b5c6b8bfbc (diff) | |
download | freebsd-ports-75dd8df3ae88a2ebfe9b497d6eec519afe3c8db5.tar.gz freebsd-ports-75dd8df3ae88a2ebfe9b497d6eec519afe3c8db5.tar.zst freebsd-ports-75dd8df3ae88a2ebfe9b497d6eec519afe3c8db5.zip |
MFH: r469998
www/waterfox: update to 56.2.0.7
Changes: https://github.com/MrAlex94/Waterfox/compare/56.2.0...436898372f858
Approved by: ports-secteam blanket
Notes
Notes:
svn path=/branches/2018Q2/; revision=470003
-rw-r--r-- | www/waterfox/Makefile | 3 | ||||
-rw-r--r-- | www/waterfox/distinfo | 6 | ||||
-rw-r--r-- | www/waterfox/files/patch-bug1381815 | 278 | ||||
-rw-r--r-- | www/waterfox/files/patch-bug1426129 | 83 | ||||
-rw-r--r-- | www/waterfox/files/patch-bug1439444 | 53 | ||||
-rw-r--r-- | www/waterfox/files/patch-bug1443110 | 25 |
6 files changed, 283 insertions, 165 deletions
diff --git a/www/waterfox/Makefile b/www/waterfox/Makefile index e39a378d17ac..d303ca5bbe7b 100644 --- a/www/waterfox/Makefile +++ b/www/waterfox/Makefile @@ -1,7 +1,8 @@ # $FreeBSD$ PORTNAME= waterfox -DISTVERSION= 56.2.0 +DISTVERSION= 56.2.0-7 +DISTVERSIONSUFFIX= -g436898372f858 CATEGORIES= www ipv6 MAINTAINER= jbeich@FreeBSD.org diff --git a/www/waterfox/distinfo b/www/waterfox/distinfo index 8a24d0a39a81..1595d71b3329 100644 --- a/www/waterfox/distinfo +++ b/www/waterfox/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1526323182 -SHA256 (MrAlex94-Waterfox-56.2.0_GH0.tar.gz) = b4f8ee4ef6544bacb6b0575e99e05d399cf83f983d3b0193cd9df39bd509f0d2 -SIZE (MrAlex94-Waterfox-56.2.0_GH0.tar.gz) = 395158434 +TIMESTAMP = 1526343922 +SHA256 (MrAlex94-Waterfox-56.2.0-7-g436898372f858_GH0.tar.gz) = ed9b870b81e3263afaf92efa9830b2a8e84cd71d78e300feaa5de70395974aae +SIZE (MrAlex94-Waterfox-56.2.0-7-g436898372f858_GH0.tar.gz) = 395153667 diff --git a/www/waterfox/files/patch-bug1381815 b/www/waterfox/files/patch-bug1381815 new file mode 100644 index 000000000000..5681303ce451 --- /dev/null +++ b/www/waterfox/files/patch-bug1381815 @@ -0,0 +1,278 @@ +commit 165fab2f8596 +Author: Jan Horak <jhorak@redhat.com> +Date: Tue Oct 10 13:35:56 2017 +0200 + + Bug 1381815 - fixing dimensions of radio and checkbox for GTK 3.20+; r=karlt + + In the GTK < 3.20 the size of radio and checkbox toggle is determined by indicator + spacing and indicator size. By GTK 3.20+ it is replaced by standard box model + (padding, margin, border). The patch fixes that while keeping the functionality + for older GTK. The values are also cached by similar way as scrollbar metrics + are cached now. + + The focus is no longer rendered by GTK but by Mozilla code, so the extra + size for toggles has been removed from GetExtraSizeForWidget and toggles + no longer render focus indicator. + + MozReview-Commit-ID: 1Wg5AgHy1Vz + + --HG-- + extra : rebase_source : 81437f45b7d32555942d21fccc9de4a561d85111 +--- + widget/gtk/gtk3drawing.cpp | 121 ++++++++++++++++++++++++++++++---------- + widget/gtk/gtkdrawing.h | 14 +++++ + widget/gtk/nsNativeThemeGTK.cpp | 32 +---------- + 3 files changed, 107 insertions(+), 60 deletions(-) + +diff --git widget/gtk/gtk3drawing.cpp widget/gtk/gtk3drawing.cpp +index 4c562b380095..7968aef920f6 100644 +--- widget/gtk/gtk3drawing.cpp ++++ widget/gtk/gtk3drawing.cpp +@@ -22,6 +22,8 @@ static gboolean checkbox_check_state; + static gboolean notebook_has_tab_gap; + + static ScrollbarGTKMetrics sScrollbarMetrics[2]; ++static ToggleGTKMetrics sCheckboxMetrics; ++static ToggleGTKMetrics sRadioMetrics; + + #define ARROW_UP 0 + #define ARROW_DOWN G_PI +@@ -110,6 +112,8 @@ moz_gtk_refresh() + + sScrollbarMetrics[GTK_ORIENTATION_HORIZONTAL].initialized = false; + sScrollbarMetrics[GTK_ORIENTATION_VERTICAL].initialized = false; ++ sCheckboxMetrics.initialized = false; ++ sRadioMetrics.initialized = false; + } + + gint +@@ -308,33 +312,21 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRectangle* rect, + gboolean isradio, GtkTextDirection direction) + { + GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); +- gint indicator_size, indicator_spacing; + gint x, y, width, height; +- gint focus_x, focus_y, focus_width, focus_height; + GtkStyleContext *style; + +- GtkWidget *widget = GetWidget(isradio ? MOZ_GTK_RADIOBUTTON_CONTAINER : +- MOZ_GTK_CHECKBUTTON_CONTAINER); +- gtk_widget_style_get(widget, +- "indicator_size", &indicator_size, +- "indicator_spacing", &indicator_spacing, +- nullptr); ++ const ToggleGTKMetrics* metrics = GetToggleMetrics(isradio); + + // XXX we should assert rect->height >= indicator_size too + // after bug 369581 is fixed. +- MOZ_ASSERT(rect->width >= indicator_size, ++ MOZ_ASSERT(rect->width >= metrics->minSizeWithBorder.width, + "GetMinimumWidgetSize was ignored"); + + // Paint it center aligned in the rect. +- x = rect->x + (rect->width - indicator_size) / 2; +- y = rect->y + (rect->height - indicator_size) / 2; +- width = indicator_size; +- height = indicator_size; +- +- focus_x = x - indicator_spacing; +- focus_y = y - indicator_spacing; +- focus_width = width + 2 * indicator_spacing; +- focus_height = height + 2 * indicator_spacing; ++ width = metrics->minSizeWithBorder.width; ++ height = metrics->minSizeWithBorder.height; ++ x = rect->x + (rect->width - width) / 2; ++ y = rect->y + (rect->height - height) / 2; + + if (selected) + state_flags = static_cast<GtkStateFlags>(state_flags|checkbox_check_state); +@@ -348,20 +340,25 @@ moz_gtk_toggle_paint(cairo_t *cr, GdkRectangle* rect, + if (gtk_check_version(3, 20, 0) == nullptr) { + gtk_render_background(style, cr, x, y, width, height); + gtk_render_frame(style, cr, x, y, width, height); +- } +- +- if (isradio) { +- gtk_render_option(style, cr, x, y, width, height); +- if (state->focused) { +- gtk_render_focus(style, cr, focus_x, focus_y, +- focus_width, focus_height); ++ // Indicator is inset by the toggle's padding and border. ++ gint indicator_x = x + metrics->borderAndPadding.left; ++ gint indicator_y = y + metrics->borderAndPadding.top; ++ gint indicator_width = metrics->minSizeWithBorder.width - ++ metrics->borderAndPadding.left - metrics->borderAndPadding.right; ++ gint indicator_height = metrics->minSizeWithBorder.height - ++ metrics->borderAndPadding.top - metrics->borderAndPadding.bottom; ++ if (isradio) { ++ gtk_render_option(style, cr, indicator_x, indicator_y, ++ indicator_width, indicator_height); ++ } else { ++ gtk_render_check(style, cr, indicator_x, indicator_y, ++ indicator_width, indicator_height); + } +- } +- else { +- gtk_render_check(style, cr, x, y, width, height); +- if (state->focused) { +- gtk_render_focus(style, cr, +- focus_x, focus_y, focus_width, focus_height); ++ } else { ++ if (isradio) { ++ gtk_render_option(style, cr, x, y, width, height); ++ } else { ++ gtk_render_check(style, cr, x, y, width, height); + } + } + +@@ -2514,6 +2511,68 @@ SizeFromLengthAndBreadth(GtkOrientation aOrientation, + MozGtkSize({aLength, aBreadth}) : MozGtkSize({aBreadth, aLength}); + } + ++const ToggleGTKMetrics* ++GetToggleMetrics(bool isRadio) ++{ ++ ToggleGTKMetrics* metrics; ++ if (isRadio) { ++ metrics = &sRadioMetrics; ++ } else { ++ metrics = &sCheckboxMetrics; ++ } ++ if (metrics->initialized) ++ return metrics; ++ ++ metrics->initialized = true; ++ if (gtk_check_version(3,20,0) == nullptr) { ++ GtkStyleContext* style; ++ if (isRadio) { ++ style = GetStyleContext(MOZ_GTK_RADIOBUTTON); ++ } else { ++ style = GetStyleContext(MOZ_GTK_CHECKBUTTON); ++ } ++ GtkStateFlags state_flags = gtk_style_context_get_state(style); ++ gtk_style_context_get(style, state_flags, ++ "min-height",&(metrics->minSizeWithBorder.height), ++ "min-width", &(metrics->minSizeWithBorder.width), ++ nullptr); ++ // Fallback to indicator size if min dimensions are zero ++ if (metrics->minSizeWithBorder.height == 0 || ++ metrics->minSizeWithBorder.width == 0) { ++ gint indicator_size; ++ gtk_widget_style_get(GetWidget(MOZ_GTK_CHECKBUTTON_CONTAINER), ++ "indicator_size", &indicator_size, nullptr); ++ if (metrics->minSizeWithBorder.height == 0) { ++ metrics->minSizeWithBorder.height = indicator_size; ++ } ++ if (metrics->minSizeWithBorder.width == 0) { ++ metrics->minSizeWithBorder.width = indicator_size; ++ } ++ } ++ ++ GtkBorder border, padding; ++ gtk_style_context_get_border(style, state_flags, &border); ++ gtk_style_context_get_padding(style, state_flags, &padding); ++ metrics->borderAndPadding.left = border.left + padding.left; ++ metrics->borderAndPadding.right = border.right + padding.right; ++ metrics->borderAndPadding.top = border.top + padding.top; ++ metrics->borderAndPadding.bottom = border.bottom + padding.bottom; ++ metrics->minSizeWithBorder.width += metrics->borderAndPadding.left + ++ metrics->borderAndPadding.right; ++ metrics->minSizeWithBorder.height += metrics->borderAndPadding.top + ++ metrics->borderAndPadding.bottom; ++ } else { ++ gint indicator_size, indicator_spacing; ++ gtk_widget_style_get(GetWidget(MOZ_GTK_CHECKBUTTON_CONTAINER), ++ "indicator_size", &indicator_size, ++ "indicator_spacing", &indicator_spacing, ++ nullptr); ++ metrics->minSizeWithBorder.width = ++ metrics->minSizeWithBorder.height = indicator_size; ++ } ++ return metrics; ++} ++ + const ScrollbarGTKMetrics* + GetScrollbarMetrics(GtkOrientation aOrientation) + { +diff --git widget/gtk/gtkdrawing.h widget/gtk/gtkdrawing.h +index 42dbf8287499..909c18f7f525 100644 +--- widget/gtk/gtkdrawing.h ++++ widget/gtk/gtkdrawing.h +@@ -83,6 +83,12 @@ typedef struct { + } border; + } ScrollbarGTKMetrics; + ++typedef struct { ++ bool initialized; ++ MozGtkSize minSizeWithBorder; ++ GtkBorder borderAndPadding; ++} ToggleGTKMetrics; ++ + typedef enum { + MOZ_GTK_STEPPER_DOWN = 1 << 0, + MOZ_GTK_STEPPER_BOTTOM = 1 << 1, +@@ -391,6 +397,14 @@ moz_gtk_get_tab_border(gint* left, gint* top, gint* right, gint* bottom, + gint + moz_gtk_checkbox_get_metrics(gint* indicator_size, gint* indicator_spacing); + ++/** ++ * Get metrics of the toggle (radio or checkbox) ++ * isRadio: [IN] true when requesting metrics for the radio button ++ * returns: pointer to ToggleGTKMetrics struct ++ */ ++const ToggleGTKMetrics* ++GetToggleMetrics(bool isRadio); ++ + /** + * Get the desired size of a GtkRadioButton + * indicator_size: [OUT] the indicator size +diff --git widget/gtk/nsNativeThemeGTK.cpp widget/gtk/nsNativeThemeGTK.cpp +index 06e62efbcda8..da3eaa71a6b4 100644 +--- widget/gtk/nsNativeThemeGTK.cpp ++++ widget/gtk/nsNativeThemeGTK.cpp +@@ -1020,24 +1020,6 @@ nsNativeThemeGTK::GetExtraSizeForWidget(nsIFrame* aFrame, uint8_t aWidgetType, + aExtra->left = aExtra->right = 1; + break; + +- // Include the indicator spacing (the padding around the control). +- case NS_THEME_CHECKBOX: +- case NS_THEME_RADIO: +- { +- gint indicator_size, indicator_spacing; +- +- if (aWidgetType == NS_THEME_CHECKBOX) { +- moz_gtk_checkbox_get_metrics(&indicator_size, &indicator_spacing); +- } else { +- moz_gtk_radio_get_metrics(&indicator_size, &indicator_spacing); +- } +- +- aExtra->top = indicator_spacing; +- aExtra->right = indicator_spacing; +- aExtra->bottom = indicator_spacing; +- aExtra->left = indicator_spacing; +- break; +- } + case NS_THEME_BUTTON : + { + if (IsDefaultButton(aFrame)) { +@@ -1595,17 +1577,9 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext, + case NS_THEME_CHECKBOX: + case NS_THEME_RADIO: + { +- gint indicator_size, indicator_spacing; +- +- if (aWidgetType == NS_THEME_CHECKBOX) { +- moz_gtk_checkbox_get_metrics(&indicator_size, &indicator_spacing); +- } else { +- moz_gtk_radio_get_metrics(&indicator_size, &indicator_spacing); +- } +- +- // Include space for the indicator and the padding around it. +- aResult->width = indicator_size; +- aResult->height = indicator_size; ++ const ToggleGTKMetrics* metrics = GetToggleMetrics(aWidgetType == NS_THEME_RADIO); ++ aResult->width = metrics->minSizeWithBorder.width; ++ aResult->height = metrics->minSizeWithBorder.height; + } + break; + case NS_THEME_TOOLBARBUTTON_DROPDOWN: diff --git a/www/waterfox/files/patch-bug1426129 b/www/waterfox/files/patch-bug1426129 deleted file mode 100644 index 393793b9a291..000000000000 --- a/www/waterfox/files/patch-bug1426129 +++ /dev/null @@ -1,83 +0,0 @@ -commit 2ad185b12fe3 -Author: Paul Adenot <paul@paul.cx> -Date: Mon Mar 5 20:24:16 2018 +0200 - - Bug 1426129 - Take a reference to `this` when calling methods asynchronously in CameraChild.cpp. r=pehrsons a=lizzard - - --HG-- - extra : amend_source : bb0df026ffa8198485415c8c44fdb7df372f07ee ---- - dom/media/systemservices/CamerasChild.cpp | 33 ++++++++++++++++++------------- - dom/media/systemservices/CamerasChild.h | 9 +++++++++ - 2 files changed, 28 insertions(+), 14 deletions(-) - -diff --git dom/media/systemservices/CamerasChild.cpp dom/media/systemservices/CamerasChild.cpp -index 594b90f808e4..79224b73cefa 100644 ---- dom/media/systemservices/CamerasChild.cpp -+++ dom/media/systemservices/CamerasChild.cpp -@@ -34,7 +34,9 @@ CamerasSingleton::CamerasSingleton() - : mCamerasMutex("CamerasSingleton::mCamerasMutex"), - mCameras(nullptr), - mCamerasChildThread(nullptr), -- mFakeDeviceChangeEventThread(nullptr) { -+ mFakeDeviceChangeEventThread(nullptr), -+ mInShutdown(false) -+{ - LOG(("CamerasSingleton: %p", this)); - } - -@@ -559,6 +561,9 @@ void - Shutdown(void) - { - OffTheBooksMutexAutoLock lock(CamerasSingleton::Mutex()); -+ -+ CamerasSingleton::StartShutdown(); -+ - CamerasChild* child = CamerasSingleton::Child(); - if (!child) { - // We don't want to cause everything to get fired up if we're -@@ -733,7 +738,7 @@ CamerasChild::~CamerasChild() - { - LOG(("~CamerasChild: %p", this)); - -- { -+ if (!CamerasSingleton::InShutdown()) { - OffTheBooksMutexAutoLock lock(CamerasSingleton::Mutex()); - // In normal circumstances we've already shut down and the - // following does nothing. But on fatal IPC errors we will -diff --git dom/media/systemservices/CamerasChild.h dom/media/systemservices/CamerasChild.h -index b2029dbd6b9d..620c409b656f 100644 ---- dom/media/systemservices/CamerasChild.h -+++ dom/media/systemservices/CamerasChild.h -@@ -93,6 +93,14 @@ public: - return gTheInstance.get()->mFakeDeviceChangeEventThread; - } - -+ static bool InShutdown() { -+ return gTheInstance.get()->mInShutdown; -+ } -+ -+ static void StartShutdown() { -+ gTheInstance.get()->mInShutdown = true; -+ } -+ - private: - static Singleton<CamerasSingleton> gTheInstance; - -@@ -110,6 +118,7 @@ private: - CamerasChild* mCameras; - nsCOMPtr<nsIThread> mCamerasChildThread; - nsCOMPtr<nsIThread> mFakeDeviceChangeEventThread; -+ Atomic<bool> mInShutdown; - }; - - // Get a pointer to a CamerasChild object we can use to do IPC with. -@@ -149,7 +158,7 @@ class CamerasChild final : public PCamerasChild - public: - // We are owned by the PBackground thread only. CamerasSingleton - // takes a non-owning reference. -- NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CamerasChild) -+ NS_INLINE_DECL_REFCOUNTING(CamerasChild) - - // IPC messages recevied, received on the PBackground thread - // these are the actual callbacks with data diff --git a/www/waterfox/files/patch-bug1439444 b/www/waterfox/files/patch-bug1439444 deleted file mode 100644 index 0589f1b331e1..000000000000 --- a/www/waterfox/files/patch-bug1439444 +++ /dev/null @@ -1,53 +0,0 @@ -commit e8f515046724 -Author: Christoph Kerschbaumer <ckerschb@christophkerschbaumer.com> -Date: Thu Mar 1 13:45:04 2018 +0100 - - Bug 1439444: resource and chrome images and styles should not be subject to CSP. r=gijs ---- - dom/security/nsCSPService.cpp | 18 +++++++++++++----- - 1 file changed, 13 insertions(+), 5 deletions(-) - -diff --git dom/security/nsCSPService.cpp dom/security/nsCSPService.cpp -index 6e6f02c585fb7..f0d733454fc2a 100644 ---- dom/security/nsCSPService.cpp -+++ dom/security/nsCSPService.cpp -@@ -43,13 +43,17 @@ NS_IMPL_ISUPPORTS(CSPService, nsIContentPolicy, nsIChannelEventSink) - // Helper function to identify protocols and content types not subject to CSP. - bool - subjectToCSP(nsIURI* aURI, nsContentPolicyType aContentType) { -+ -+ nsContentPolicyType contentType = -+ nsContentUtils::InternalContentPolicyTypeToExternal(aContentType); -+ - // These content types are not subject to CSP content policy checks: - // TYPE_CSP_REPORT -- csp can't block csp reports - // TYPE_REFRESH -- never passed to ShouldLoad (see nsIContentPolicy.idl) - // TYPE_DOCUMENT -- used for frame-ancestors -- if (aContentType == nsIContentPolicy::TYPE_CSP_REPORT || -- aContentType == nsIContentPolicy::TYPE_REFRESH || -- aContentType == nsIContentPolicy::TYPE_DOCUMENT) { -+ if (contentType == nsIContentPolicy::TYPE_CSP_REPORT || -+ contentType == nsIContentPolicy::TYPE_REFRESH || -+ contentType == nsIContentPolicy::TYPE_DOCUMENT) { - return false; - } - -@@ -90,12 +94,16 @@ subjectToCSP(nsIURI* aURI, nsContentPolicyType aContentType) { - // hence we use protocol flags to accomplish that, but we also - // want resource:, chrome: and moz-icon to be subject to CSP - // (which also use URI_IS_LOCAL_RESOURCE). -+ // Exception to the rule are images and styles using a scheme -+ // of resource: or chrome: -+ bool isImgOrStyle = contentType == nsIContentPolicy::TYPE_IMAGE || -+ contentType == nsIContentPolicy::TYPE_STYLESHEET; - rv = aURI->SchemeIs("resource", &match); -- if (NS_SUCCEEDED(rv) && match) { -+ if (NS_SUCCEEDED(rv) && match && !isImgOrStyle) { - return true; - } - rv = aURI->SchemeIs("chrome", &match); -- if (NS_SUCCEEDED(rv) && match) { -+ if (NS_SUCCEEDED(rv) && match && !isImgOrStyle) { - return true; - } - rv = aURI->SchemeIs("moz-icon", &match); diff --git a/www/waterfox/files/patch-bug1443110 b/www/waterfox/files/patch-bug1443110 deleted file mode 100644 index 949221521f6a..000000000000 --- a/www/waterfox/files/patch-bug1443110 +++ /dev/null @@ -1,25 +0,0 @@ -commit 425c5a6ff8fc -Author: Christoph Kerschbaumer <ckerschb@christophkerschbaumer.com> -Date: Fri Mar 9 15:54:02 2018 +0100 - - Bug 1443110: Add NullCheck for loadinfo within InitCSP. r=smaug a=jcristau - - --HG-- - extra : source : 25ade148226d93650b653c62e2f4b15cbc51caef ---- - dom/base/nsDocument.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git dom/base/nsDocument.cpp dom/base/nsDocument.cpp -index 88f3aea3b6255..5519dd662df31 100644 ---- dom/base/nsDocument.cpp -+++ dom/base/nsDocument.cpp -@@ -2939,7 +2939,7 @@ nsDocument::InitCSP(nsIChannel* aChannel) - // In case this channel was instrument to discard the CSP, then - // there is nothing for us to do here. - nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo(); -- if (loadInfo->GetAllowDocumentToBeAgnosticToCSP()) { -+ if (loadInfo && loadInfo->GetAllowDocumentToBeAgnosticToCSP()) { - return NS_OK; - } - |