From dabcbe1d6d14c67044b68b34bd209f8c5565b840 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 10 Aug 2019 12:24:13 +0200 Subject: [PATCH 01/23] Remove some leftover snippets code. follow-up to 3a17b713ef27abb8c9d7c116815d3af7e0f366d9 --- application/palemoon/base/content/browser.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index a5d77a90de..7615bc92a9 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -2445,16 +2445,12 @@ function BrowserOnAboutPageLoad(doc) { // Inject search engine and snippets URL. let docElt = doc.documentElement; - // set the following attributes BEFORE searchEngineURL, which triggers to - // show the snippets when it's set. - docElt.setAttribute("snippetsURL", AboutHomeUtils.snippetsURL); if (AboutHomeUtils.showKnowYourRights) { docElt.setAttribute("showKnowYourRights", "true"); // Set pref to indicate we've shown the notification. let currentVersion = Services.prefs.getIntPref("browser.rights.version"); Services.prefs.setBoolPref("browser.rights." + currentVersion + ".shown", true); } - docElt.setAttribute("snippetsVersion", AboutHomeUtils.snippetsVersion); function updateSearchEngine() { let engine = AboutHomeUtils.defaultSearchEngine; From 06634f6495938835003cb27c2a5d3302f1f726db Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 10 Aug 2019 12:25:57 +0200 Subject: [PATCH 02/23] Issue #1134: Reinstate postDataString for about:home searches. --- netwerk/base/nsIBrowserSearchService.idl | 8 +++++++- toolkit/components/search/nsSearchService.js | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/netwerk/base/nsIBrowserSearchService.idl b/netwerk/base/nsIBrowserSearchService.idl index 045973e0c0..4ca052e916 100644 --- a/netwerk/base/nsIBrowserSearchService.idl +++ b/netwerk/base/nsIBrowserSearchService.idl @@ -7,7 +7,7 @@ interface nsIURI; interface nsIInputStream; -[scriptable, uuid(5799251f-5b55-4df7-a9e7-0c27812c469a)] +[scriptable, uuid(72599f7a-3712-4b93-90e9-86127006cd68)] interface nsISearchSubmission : nsISupports { /** @@ -20,6 +20,12 @@ interface nsISearchSubmission : nsISupports * The URI to submit a search to. */ readonly attribute nsIURI uri; + + /** + * The POST data associated with a search submission as an + * application/x-www-form-urlencoded string. May be null. + */ + readonly attribute AString postDataString; }; [scriptable, uuid(620bd920-0491-48c8-99a8-d6047e64802d)] diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js index 19f4048b48..f6303bca11 100644 --- a/toolkit/components/search/nsSearchService.js +++ b/toolkit/components/search/nsSearchService.js @@ -780,6 +780,7 @@ EngineURL.prototype = { } var postData = null; + let postDataString = null; if (this.method == "GET") { // GET method requests have no post data, and append the encoded // query string to the url... @@ -787,6 +788,7 @@ EngineURL.prototype = { url += "?"; url += dataString; } else if (this.method == "POST") { + postDataString = dataString; // POST method requests must wrap the encoded text in a MIME // stream and supply that as POSTDATA. var stringStream = Cc["@mozilla.org/io/string-input-stream;1"]. @@ -800,7 +802,7 @@ EngineURL.prototype = { postData.setData(stringStream); } - return new Submission(makeURI(url), postData); + return new Submission(makeURI(url), postData, postDataString); }, _getTermsParameterName: function SRCH_EURL__getTermsParameterName() { @@ -2409,9 +2411,10 @@ Engine.prototype = { }; // nsISearchSubmission -function Submission(aURI, aPostData = null) { +function Submission(aURI, aPostData = null, aPostDataString = null) { this._uri = aURI; this._postData = aPostData; + this._postDataString = aPostDataString; } Submission.prototype = { get uri() { @@ -2420,6 +2423,9 @@ Submission.prototype = { get postData() { return this._postData; }, + get postDataString() { + return this._postDataString; + }, QueryInterface: function SRCH_SUBM_QI(aIID) { if (aIID.equals(Ci.nsISearchSubmission) || aIID.equals(Ci.nsISupports)) From 0eab1834edb2b6fe485d1f20fbcd5f16c7a97d28 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Fri, 2 Aug 2019 16:31:54 +0300 Subject: [PATCH 03/23] Outdated comment removal (no code changes) No code changes. --- layout/base/FrameProperties.h | 1 - 1 file changed, 1 deletion(-) diff --git a/layout/base/FrameProperties.h b/layout/base/FrameProperties.h index 74513abacb..3884b07bd7 100644 --- a/layout/base/FrameProperties.h +++ b/layout/base/FrameProperties.h @@ -202,7 +202,6 @@ public: /** * Get a property value. This requires a linear search through - * lookup (using the frame as the key) and a linear search through * the properties of the frame. If the frame has no such property, * returns zero-filled result, which means null for pointers and * zero for integers and floating point types. From fe68fd519cf0b3b16eaa263c76fd49d32d10d08c Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Mon, 12 Aug 2019 23:41:30 +0200 Subject: [PATCH 04/23] Remove "Delete this page" and "Forget about this site" from livemarks. These context menu entries should not be present on live bookmarks because they make no sense for feed entries. This resolves #663. --- .../basilisk/components/places/content/controller.js | 6 +++++- .../basilisk/components/places/content/placesOverlay.xul | 4 ++-- .../palemoon/components/places/content/controller.js | 6 +++++- .../palemoon/components/places/content/placesOverlay.xul | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/application/basilisk/components/places/content/controller.js b/application/basilisk/components/places/content/controller.js index ebdab60f4c..931c8fac14 100644 --- a/application/basilisk/components/places/content/controller.js +++ b/application/basilisk/components/places/content/controller.js @@ -461,7 +461,11 @@ PlacesController.prototype = { if (parentNode) { if (PlacesUtils.nodeIsTagQuery(parentNode)) nodeData["tagChild"] = true; - else if (this.hasCachedLivemarkInfo(parentNode)) + } + } else { + var parentNode = node.parent; + if (parentNode) { + if (this.hasCachedLivemarkInfo(parentNode)) nodeData["livemarkChild"] = true; } } diff --git a/application/basilisk/components/places/content/placesOverlay.xul b/application/basilisk/components/places/content/placesOverlay.xul index 512eb923e3..2dbef0f049 100644 --- a/application/basilisk/components/places/content/placesOverlay.xul +++ b/application/basilisk/components/places/content/placesOverlay.xul @@ -198,7 +198,7 @@ accesskey="&cmd.delete.accesskey;" closemenu="single" selection="link" - forcehideselection="bookmark"/> + forcehideselection="bookmark|livemarkChild"/> + forcehideselection="bookmark|livemarkChild"/> + forcehideselection="bookmark|livemarkChild"/> + forcehideselection="bookmark|livemarkChild"/> Date: Tue, 13 Aug 2019 13:45:39 +0200 Subject: [PATCH 05/23] Enable the JSON View tool by default. Follow-up to issue #1138. --- devtools/client/preferences/devtools.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/devtools/client/preferences/devtools.js b/devtools/client/preferences/devtools.js index dea61e37f7..f893b9fb55 100644 --- a/devtools/client/preferences/devtools.js +++ b/devtools/client/preferences/devtools.js @@ -353,13 +353,8 @@ pref("devtools.editor.autocomplete", true); // version for each user. pref("devtools.telemetry.tools.opened.version", "{}"); -// Enable the JSON View tool (an inspector for application/json documents) on -// Nightly and Dev. Edition. -#ifdef RELEASE_OR_BETA -pref("devtools.jsonview.enabled", false); -#else +// Enable the JSON View tool (an inspector for application/json documents) pref("devtools.jsonview.enabled", true); -#endif // Enable the HTML responsive design mode for all channels. pref("devtools.responsive.html.enabled", true); From acefb96117ba25c68e8c2dd01cab54e4b7a21ea4 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 00:29:44 +0200 Subject: [PATCH 06/23] Issue #1211: Allow the loading of TYPE_FONT from file: URLs. This bypasses the CORS restriction of unique file: URLs in the case of fonts loaded through CSS. Resolves #1211. --- layout/style/FontFaceSet.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/layout/style/FontFaceSet.cpp b/layout/style/FontFaceSet.cpp index 1645adfefe..81c5ede0ec 100644 --- a/layout/style/FontFaceSet.cpp +++ b/layout/style/FontFaceSet.cpp @@ -583,6 +583,19 @@ FontFaceSet::StartLoad(gfxUserFontEntry* aUserFontEntry, nsCOMPtr streamLoader; nsCOMPtr loadGroup(mDocument->GetDocumentLoadGroup()); + // We're determining the security flags for font loading here based on + // scheme, because we want to allow fonts to be loaded using file: + // even if unique origins for file: access is enforced (allow CORS + // bypass in this case). + uint32_t securityFlags = 0; + bool isFile = false; + if (NS_SUCCEEDED(aFontFaceSrc->mURI->SchemeIs("file", &isFile)) && + isFile) { + securityFlags = nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS; + } else { + securityFlags = nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS; + } + nsCOMPtr channel; // Note we are calling NS_NewChannelWithTriggeringPrincipal() with both a // node and a principal. This is because the document where the font is @@ -592,7 +605,7 @@ FontFaceSet::StartLoad(gfxUserFontEntry* aUserFontEntry, aFontFaceSrc->mURI, mDocument, aUserFontEntry->GetPrincipal(), - nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS, + securityFlags, nsIContentPolicy::TYPE_FONT, loadGroup); NS_ENSURE_SUCCESS(rv, rv); From 8a29ec9a3f3e6a7307db0e84e78e8ee8c9402dd5 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 13:35:08 +0200 Subject: [PATCH 07/23] Issue #438: Do not round the translation of an SVG frame. This doesn't solve the blurriness yet, but is part of the problem. --- layout/base/nsDisplayList.cpp | 10 ++++++++-- layout/reftests/svg/css-transform-svg-ref.html | 10 ++++++++++ layout/reftests/svg/css-transform-svg.html | 13 +++++++++++++ layout/reftests/svg/reftest.list | 1 + .../reftests/w3c-css/submitted/images3/reftest.list | 8 ++++---- 5 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 layout/reftests/svg/css-transform-svg-ref.html create mode 100644 layout/reftests/svg/css-transform-svg.html diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index e35e027e30..cd0c623df9 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -5917,6 +5917,12 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp frame && frame->IsSVGTransformed(&svgTransform, &transformFromSVGParent); bool hasTransformFromSVGParent = hasSVGTransforms && !transformFromSVGParent.IsIdentity(); + + // An SVG frame should not have its translation rounded. + // Note it's possible that the SVG frame doesn't have an SVG + // transform but only has a CSS transform. + bool shouldRound = !(frame && frame->IsFrameOfType(nsIFrame::eSVG)); + /* Transformed frames always have a transform, or are preserving 3d (and might still have perspective!) */ if (aProperties.mTransformList) { result = nsStyleTransformMatrix::ReadTransforms(aProperties.mTransformList->mHead, @@ -5994,7 +6000,7 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp // Otherwise we need to manually translate into our parent's coordinate // space. if (frame->IsTransformed()) { - nsLayoutUtils::PostTranslate(result, frame->GetPosition(), aAppUnitsPerPixel, !hasSVGTransforms); + nsLayoutUtils::PostTranslate(result, frame->GetPosition(), aAppUnitsPerPixel, shouldRound); } Matrix4x4 parent = GetResultingTransformMatrixInternal(props, @@ -6005,7 +6011,7 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp } if (aFlags & OFFSET_BY_ORIGIN) { - nsLayoutUtils::PostTranslate(result, aOrigin, aAppUnitsPerPixel, !hasSVGTransforms); + nsLayoutUtils::PostTranslate(result, aOrigin, aAppUnitsPerPixel, shouldRound); } return result; diff --git a/layout/reftests/svg/css-transform-svg-ref.html b/layout/reftests/svg/css-transform-svg-ref.html new file mode 100644 index 0000000000..6167442e74 --- /dev/null +++ b/layout/reftests/svg/css-transform-svg-ref.html @@ -0,0 +1,10 @@ + + + + + + diff --git a/layout/reftests/svg/css-transform-svg.html b/layout/reftests/svg/css-transform-svg.html new file mode 100644 index 0000000000..c1c63a8397 --- /dev/null +++ b/layout/reftests/svg/css-transform-svg.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list index 0966286816..a23ab420f3 100644 --- a/layout/reftests/svg/reftest.list +++ b/layout/reftests/svg/reftest.list @@ -371,6 +371,7 @@ fuzzy-if(skiaContent,1,610) == textPath-03.svg pass.svg == text-white-space-01.svg text-white-space-01-ref.svg == thin-stroke-01.svg pass.svg == zero-stroke-01.svg pass.svg +== css-transform-svg.html css-transform-svg-ref.html == tspan-dxdy-01.svg tspan-dxdy-ref.svg == tspan-dxdy-02.svg tspan-dxdy-ref.svg == tspan-dxdy-03.svg tspan-dxdy-ref.svg diff --git a/layout/reftests/w3c-css/submitted/images3/reftest.list b/layout/reftests/w3c-css/submitted/images3/reftest.list index 3834b0713f..4cf42177c0 100644 --- a/layout/reftests/w3c-css/submitted/images3/reftest.list +++ b/layout/reftests/w3c-css/submitted/images3/reftest.list @@ -182,11 +182,11 @@ fails == object-position-png-002c.html object-position-png-002-ref.html # bug 11 == object-position-png-002i.html object-position-png-002-ref.html == object-position-png-002o.html object-position-png-002-ref.html == object-position-png-002p.html object-position-png-002-ref.html -fails == object-position-svg-001e.html object-position-svg-001-ref.html # bug 1103286 +== object-position-svg-001e.html object-position-svg-001-ref.html # bug 1103286 == object-position-svg-001i.html object-position-svg-001-ref.html -fails == object-position-svg-001o.html object-position-svg-001-ref.html # bug 1103286 +== object-position-svg-001o.html object-position-svg-001-ref.html # bug 1103286 == object-position-svg-001p.html object-position-svg-001-ref.html -fails == object-position-svg-002e.html object-position-svg-002-ref.html # bug 1103286 +== object-position-svg-002e.html object-position-svg-002-ref.html # bug 1103286 == object-position-svg-002i.html object-position-svg-002-ref.html -fails == object-position-svg-002o.html object-position-svg-002-ref.html # bug 1103286 +== object-position-svg-002o.html object-position-svg-002-ref.html # bug 1103286 == object-position-svg-002p.html object-position-svg-002-ref.html From bc4594b40ec0a29f01d9c35f74f698c75d7363a4 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 13:38:25 +0200 Subject: [PATCH 08/23] Issue #438: Pixel-snap subpixel value for outer SVG and anon child. This doesn't solve the blurriness yet, but is part of the problem. --- layout/base/nsDisplayList.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index cd0c623df9..44fc95debe 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -5918,11 +5918,16 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp bool hasTransformFromSVGParent = hasSVGTransforms && !transformFromSVGParent.IsIdentity(); + bool shouldRound = true; + // An SVG frame should not have its translation rounded. // Note it's possible that the SVG frame doesn't have an SVG // transform but only has a CSS transform. - bool shouldRound = !(frame && frame->IsFrameOfType(nsIFrame::eSVG)); - + if (frame && frame->HasAnyStateBits(NS_FRAME_SVG_LAYOUT) && + !(frame->GetType() == nsGkAtoms::svgOuterSVGAnonChildFrame)) { + shouldRound = false; + } + /* Transformed frames always have a transform, or are preserving 3d (and might still have perspective!) */ if (aProperties.mTransformList) { result = nsStyleTransformMatrix::ReadTransforms(aProperties.mTransformList->mHead, From 0c8d8938e2bbb90d89a4fbb5e6aeb36811218b42 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 13:46:25 +0200 Subject: [PATCH 09/23] Issue #438: Rename coord/coords to originValue/transformOrigin. For clarity and to prevent typoes. --- layout/base/nsDisplayList.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 44fc95debe..e22230b410 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -5708,7 +5708,7 @@ nsDisplayTransform::GetDeltaToTransformOrigin(const nsIFrame* aFrame, } /* Allows us to access dimension getters by index. */ - float coords[2]; + float transformOrigin[2]; TransformReferenceBox::DimensionGetter dimensionGetter[] = { &TransformReferenceBox::Width, &TransformReferenceBox::Height }; TransformReferenceBox::DimensionGetter offsetGetter[] = @@ -5718,33 +5718,33 @@ nsDisplayTransform::GetDeltaToTransformOrigin(const nsIFrame* aFrame, /* If the transform-origin specifies a percentage, take the percentage * of the size of the box. */ - const nsStyleCoord &coord = display->mTransformOrigin[index]; - if (coord.GetUnit() == eStyleUnit_Calc) { - const nsStyleCoord::Calc *calc = coord.GetCalcValue(); - coords[index] = + const nsStyleCoord &originValue = display->mTransformOrigin[index]; + if (originValue.GetUnit() == eStyleUnit_Calc) { + const nsStyleCoord::Calc *calc = originValue.GetCalcValue(); + transformOrigin[index] = NSAppUnitsToFloatPixels((refBox.*dimensionGetter[index])(), aAppUnitsPerPixel) * calc->mPercent + NSAppUnitsToFloatPixels(calc->mLength, aAppUnitsPerPixel); - } else if (coord.GetUnit() == eStyleUnit_Percent) { - coords[index] = + } else if (originValue.GetUnit() == eStyleUnit_Percent) { + transformOrigin[index] = NSAppUnitsToFloatPixels((refBox.*dimensionGetter[index])(), aAppUnitsPerPixel) * - coord.GetPercentValue(); + originValue.GetPercentValue(); } else { - MOZ_ASSERT(coord.GetUnit() == eStyleUnit_Coord, "unexpected unit"); - coords[index] = - NSAppUnitsToFloatPixels(coord.GetCoordValue(), aAppUnitsPerPixel); + MOZ_ASSERT(originValue.GetUnit() == eStyleUnit_Coord, "unexpected unit"); + transformOrigin[index] = + NSAppUnitsToFloatPixels(originValue.GetCoordValue(), aAppUnitsPerPixel); } if (aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) { // SVG frames (unlike other frames) have a reference box that can be (and // typically is) offset from the TopLeft() of the frame. We need to // account for that here. - coords[index] += + transformOrigin[index] += NSAppUnitsToFloatPixels((refBox.*offsetGetter[index])(), aAppUnitsPerPixel); } } - return Point3D(coords[0], coords[1], + return Point3D(transformOrigin[0], transformOrigin[1], NSAppUnitsToFloatPixels(display->mTransformOrigin[2].GetCoordValue(), aAppUnitsPerPixel)); } From 0343460b3a9a28ffd9226c3bffbf267a04dae54f Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 14:22:13 +0200 Subject: [PATCH 10/23] Issue #438: Add an IsRectilinear helper method to gfxMatrix. --- gfx/thebes/gfxMatrix.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gfx/thebes/gfxMatrix.h b/gfx/thebes/gfxMatrix.h index 9282a22dbb..4f92262cc1 100644 --- a/gfx/thebes/gfxMatrix.h +++ b/gfx/thebes/gfxMatrix.h @@ -112,6 +112,18 @@ public: _31 == 0.0 && _32 == 0.0; } + /* Returns true if the matrix is a rectilinear transformation (i.e. + * grid-aligned rectangles are transformed to grid-aligned rectangles) + */ + bool IsRectilinear() const { + if (FuzzyEqual(_12, 0) && FuzzyEqual(_21, 0)) { + return true; + } else if (FuzzyEqual(_22, 0) && FuzzyEqual(_11, 0)) { + return true; + } + return false; + } + /** * Inverts this matrix, if possible. Otherwise, the matrix is left * unchanged. From c2b844077e719355214dcf7f1ab90f811cfac99c Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 15:09:34 +0200 Subject: [PATCH 11/23] Issue #438: Check for non-rectilinear transforms --- layout/svg/nsSVGOuterSVGFrame.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp index e1b97bb40b..434676010d 100644 --- a/layout/svg/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/nsSVGOuterSVGFrame.cpp @@ -1006,6 +1006,9 @@ nsSVGOuterSVGAnonChildFrame::IsSVGTransformed(Matrix* aOwnTransform, if (ownMatrix.HasNonTranslation()) { // Note: viewBox, currentScale and currentTranslate should only // produce a rectilinear transform. + MOZ_ASSERT(ownMatrix.IsRectilinear(), + "Non-rectilinear transform will break the following logic"); + // The nsDisplayTransform code will apply this transform to our frame, // including to our frame position. We don't want our frame position to // be scaled though, so we need to correct for that in the transform. From c01fb23b1b74106846b60330d8bb856b71e81d9e Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 15:20:20 +0200 Subject: [PATCH 12/23] Issue #438: Make the nsSVGOuterSVGAnonChildFrame a reference frame. This causes transforms of the contents to be unaffected by scrolling / offset changes of the element. --- layout/svg/nsSVGOuterSVGFrame.cpp | 56 ++++++++++++++++++------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp index 434676010d..b1ee54eb95 100644 --- a/layout/svg/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/nsSVGOuterSVGFrame.cpp @@ -979,46 +979,56 @@ nsSVGOuterSVGAnonChildFrame::GetType() const return nsGkAtoms::svgOuterSVGAnonChildFrame; } -bool -nsSVGOuterSVGAnonChildFrame::IsSVGTransformed(Matrix* aOwnTransform, - Matrix* aFromParentTransform) const +static Matrix +ComputeOuterSVGAnonChildFrameTransform(const nsSVGOuterSVGAnonChildFrame* aFrame) { // Our elements 'transform' attribute is applied to our nsSVGOuterSVGFrame // parent, and the element's children-only transforms are applied to us, the // anonymous child frame. Since we are the child frame, we apply the // children-only transforms as if they are our own transform. - SVGSVGElement* content = static_cast(mContent); + SVGSVGElement* content = static_cast(aFrame->GetContent()); if (!content->HasChildrenOnlyTransform()) { - return false; + return Matrix(); } // Outer- doesn't use x/y, so we can pass eChildToUserSpace here. gfxMatrix ownMatrix = content->PrependLocalTransformsTo(gfxMatrix(), eChildToUserSpace); - if (ownMatrix.IsIdentity()) { - return false; + if (ownMatrix.HasNonTranslation()) { + // viewBox, currentScale and currentTranslate should only produce a + // rectilinear transform. + MOZ_ASSERT(ownMatrix.IsRectilinear(), + "Non-rectilinear transform will break the following logic"); + + // The nsDisplayTransform code will apply this transform to our frame, + // including to our frame position. We don't want our frame position to + // be scaled though, so we need to correct for that in the transform. + CSSPoint pos = CSSPixel::FromAppUnits(aFrame->GetPosition()); + CSSPoint scaledPos = CSSPoint(ownMatrix._11 * pos.x, ownMatrix._22 * pos.y); + CSSPoint deltaPos = scaledPos - pos; + ownMatrix *= gfxMatrix::Translation(-deltaPos.x, -deltaPos.y); } - if (aOwnTransform) { - if (ownMatrix.HasNonTranslation()) { - // Note: viewBox, currentScale and currentTranslate should only - // produce a rectilinear transform. - MOZ_ASSERT(ownMatrix.IsRectilinear(), - "Non-rectilinear transform will break the following logic"); - - // The nsDisplayTransform code will apply this transform to our frame, - // including to our frame position. We don't want our frame position to - // be scaled though, so we need to correct for that in the transform. - CSSPoint pos = CSSPixel::FromAppUnits(GetPosition()); - CSSPoint scaledPos = CSSPoint(ownMatrix._11 * pos.x, ownMatrix._22 * pos.y); - CSSPoint deltaPos = scaledPos - pos; - ownMatrix *= gfxMatrix::Translation(-deltaPos.x, -deltaPos.y); - } + return gfx::ToMatrix(ownMatrix); +} - *aOwnTransform = gfx::ToMatrix(ownMatrix); +// We want this frame to be a reference frame. An easy way to achieve that is +// to always return true from this method, even for identity transforms. +// This frame being a reference frame ensures that the offset between this +// element and the parent reference frame is completely absorbed by the +// nsDisplayTransform that's created for this frame, and that this offset does +// not affect our descendants' transforms. Consequently, if the element +// moves, e.g. during scrolling, the transform matrices of our contents are +// unaffected. This simplifies invalidation. +bool +nsSVGOuterSVGAnonChildFrame::IsSVGTransformed(Matrix* aOwnTransform, + Matrix* aFromParentTransform) const +{ + if (aOwnTransform) { + *aOwnTransform = ComputeOuterSVGAnonChildFrameTransform(this); } return true; From a2a90ce32ba23971398aae9b98e153e0f31831d7 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 15:24:39 +0200 Subject: [PATCH 13/23] Issue #438: Add reftests. --- layout/reftests/svg/reftest.list | 1 + .../svg/svg-blurry-with-subpixel-position-ref.html | 13 +++++++++++++ .../svg/svg-blurry-with-subpixel-position.html | 13 +++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 layout/reftests/svg/svg-blurry-with-subpixel-position-ref.html create mode 100644 layout/reftests/svg/svg-blurry-with-subpixel-position.html diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list index a23ab420f3..21e1c68a16 100644 --- a/layout/reftests/svg/reftest.list +++ b/layout/reftests/svg/reftest.list @@ -140,6 +140,7 @@ random == dynamic-use-nested-01b.svg dynamic-use-nested-01-ref.svg == fragmentIdentifier-01.xhtml pass.svg == linked-filter-01.svg pass.svg == linked-pattern-01.svg pass.svg +pref(layout.css.devPixelsPerPx,"1.0") == svg-blurry-with-subpixel-position.html svg-blurry-with-subpixel-position-ref.html == use-01.svg pass.svg == use-01-extref.svg pass.svg == use-02-extref.svg use-02-extref-ref.svg diff --git a/layout/reftests/svg/svg-blurry-with-subpixel-position-ref.html b/layout/reftests/svg/svg-blurry-with-subpixel-position-ref.html new file mode 100644 index 0000000000..c315509d72 --- /dev/null +++ b/layout/reftests/svg/svg-blurry-with-subpixel-position-ref.html @@ -0,0 +1,13 @@ + + + + + + + diff --git a/layout/reftests/svg/svg-blurry-with-subpixel-position.html b/layout/reftests/svg/svg-blurry-with-subpixel-position.html new file mode 100644 index 0000000000..20bca71741 --- /dev/null +++ b/layout/reftests/svg/svg-blurry-with-subpixel-position.html @@ -0,0 +1,13 @@ + + + + + + + From 92f516c643dcda663143efa248fc39f91ddd05a2 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 15:34:02 +0200 Subject: [PATCH 14/23] Issue #438: Revert incorrect changes to w3c-css reftests --- layout/reftests/w3c-css/submitted/images3/reftest.list | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/layout/reftests/w3c-css/submitted/images3/reftest.list b/layout/reftests/w3c-css/submitted/images3/reftest.list index 4cf42177c0..3834b0713f 100644 --- a/layout/reftests/w3c-css/submitted/images3/reftest.list +++ b/layout/reftests/w3c-css/submitted/images3/reftest.list @@ -182,11 +182,11 @@ fails == object-position-png-002c.html object-position-png-002-ref.html # bug 11 == object-position-png-002i.html object-position-png-002-ref.html == object-position-png-002o.html object-position-png-002-ref.html == object-position-png-002p.html object-position-png-002-ref.html -== object-position-svg-001e.html object-position-svg-001-ref.html # bug 1103286 +fails == object-position-svg-001e.html object-position-svg-001-ref.html # bug 1103286 == object-position-svg-001i.html object-position-svg-001-ref.html -== object-position-svg-001o.html object-position-svg-001-ref.html # bug 1103286 +fails == object-position-svg-001o.html object-position-svg-001-ref.html # bug 1103286 == object-position-svg-001p.html object-position-svg-001-ref.html -== object-position-svg-002e.html object-position-svg-002-ref.html # bug 1103286 +fails == object-position-svg-002e.html object-position-svg-002-ref.html # bug 1103286 == object-position-svg-002i.html object-position-svg-002-ref.html -== object-position-svg-002o.html object-position-svg-002-ref.html # bug 1103286 +fails == object-position-svg-002o.html object-position-svg-002-ref.html # bug 1103286 == object-position-svg-002p.html object-position-svg-002-ref.html From b7c0f39806fba64b0df429d92ebe612a4316839c Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 15:55:42 +0200 Subject: [PATCH 15/23] Update platform version. --- config/milestone.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/milestone.txt b/config/milestone.txt index 3c80f8bb5b..67b4fdd4e1 100644 --- a/config/milestone.txt +++ b/config/milestone.txt @@ -10,4 +10,4 @@ # hardcoded milestones in the tree from these two files. #-------------------------------------------------------- -4.4.0 \ No newline at end of file +4.4.1 \ No newline at end of file From 1f68992bee0930985b22ec78105d6c3779909bb6 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 17:19:40 +0200 Subject: [PATCH 16/23] Issue #1124: Remove Firefox Developer Edition code. Removes all occurrences of MOZ_DEV_EDITION code and some helpers. --- application/basilisk/app/profile/basilisk.js | 5 -- .../customizableui/CustomizableUI.jsm | 8 +- .../basilisk/components/nsBrowserGlue.js | 38 --------- .../components/preferences/in-content/main.js | 77 ------------------- .../preferences/in-content/main.xul | 11 --- .../basilisk/modules/ProcessHangMonitor.jsm | 10 --- devtools/client/framework/devtools-browser.js | 4 +- devtools/client/preferences/devtools.js | 4 - old-configure.in | 4 - toolkit/modules/AppConstants.jsm | 7 -- toolkit/profile/nsToolkitProfileService.cpp | 43 ----------- toolkit/xre/nsAppRunner.cpp | 17 +--- 12 files changed, 5 insertions(+), 223 deletions(-) diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js index aa2df6d402..a773bc60ef 100644 --- a/application/basilisk/app/profile/basilisk.js +++ b/application/basilisk/app/profile/basilisk.js @@ -1009,12 +1009,7 @@ pref("services.sync.syncedTabs.showRemoteIcons", true); pref("services.sync.sendTabToDevice.enabled", true); -// Developer edition preferences -#ifdef MOZ_DEV_EDITION -sticky_pref("lightweightThemes.selectedThemeID", "firefox-devedition@mozilla.org"); -#else sticky_pref("lightweightThemes.selectedThemeID", ""); -#endif // Whether the character encoding menu is under the main Firefox button. This // preference is a string so that localizers can alter it. diff --git a/application/basilisk/components/customizableui/CustomizableUI.jsm b/application/basilisk/components/customizableui/CustomizableUI.jsm index 8302dec1ae..cb92639619 100644 --- a/application/basilisk/components/customizableui/CustomizableUI.jsm +++ b/application/basilisk/components/customizableui/CustomizableUI.jsm @@ -198,9 +198,7 @@ var CustomizableUIInternal = { "add-ons-button", ]; - if (!AppConstants.MOZ_DEV_EDITION) { - panelPlacements.splice(-1, 0, "developer-button"); - } + panelPlacements.splice(-1, 0, "developer-button"); let showCharacterEncoding = Services.prefs.getComplexValue( "browser.menu.showCharacterEncoding", @@ -225,10 +223,6 @@ var CustomizableUIInternal = { "home-button", ]; - if (AppConstants.MOZ_DEV_EDITION) { - navbarPlacements.splice(2, 0, "developer-button"); - } - // Place this last, when createWidget is called for pocket, it will // append to the toolbar. if (Services.prefs.getPrefType("extensions.pocket.enabled") != Services.prefs.PREF_INVALID && diff --git a/application/basilisk/components/nsBrowserGlue.js b/application/basilisk/components/nsBrowserGlue.js index ad0b7ed7fb..7c48473ae0 100644 --- a/application/basilisk/components/nsBrowserGlue.js +++ b/application/basilisk/components/nsBrowserGlue.js @@ -1054,10 +1054,6 @@ BrowserGlue.prototype = { // All initial windows have opened. _onWindowsRestored: function BG__onWindowsRestored() { - if (AppConstants.MOZ_DEV_EDITION) { - this._createExtraDefaultProfile(); - } - this._initServiceDiscovery(); // Show update notification, if needed. @@ -1193,40 +1189,6 @@ BrowserGlue.prototype = { E10SAccessibilityCheck.onWindowsRestored(); }, - _createExtraDefaultProfile: function () { - if (!AppConstants.MOZ_DEV_EDITION) { - return; - } - // If Developer Edition is the only installed Firefox version and no other - // profiles are present, create a second one for use by other versions. - // This helps Firefox versions earlier than 35 avoid accidentally using the - // unsuitable Developer Edition profile. - let profileService = Cc["@mozilla.org/toolkit/profile-service;1"] - .getService(Ci.nsIToolkitProfileService); - let profileCount = profileService.profileCount; - if (profileCount == 1 && profileService.selectedProfile.name != "default") { - let newProfile; - try { - newProfile = profileService.createProfile(null, "default"); - profileService.defaultProfile = newProfile; - profileService.flush(); - } catch (e) { - Cu.reportError("Could not create profile 'default': " + e); - } - if (newProfile) { - // We don't want a default profile with Developer Edition settings, an - // empty profile directory will do. The profile service of the other - // Firefox will populate it with its own stuff. - let newProfilePath = newProfile.rootDir.path; - OS.File.removeDir(newProfilePath).then(() => { - return OS.File.makeDir(newProfilePath); - }).then(null, e => { - Cu.reportError("Could not empty profile 'default': " + e); - }); - } - } - }, - _onQuitRequest: function BG__onQuitRequest(aCancelQuit, aQuitType) { // If user has already dismissed quit request, then do nothing if ((aCancelQuit instanceof Ci.nsISupportsPRBool) && aCancelQuit.data) diff --git a/application/basilisk/components/preferences/in-content/main.js b/application/basilisk/components/preferences/in-content/main.js index bac771bece..8f3dffa57b 100644 --- a/application/basilisk/components/preferences/in-content/main.js +++ b/application/basilisk/components/preferences/in-content/main.js @@ -78,18 +78,6 @@ var gMainPane = { setEventListener("chooseFolder", "command", gMainPane.chooseFolder); - if (AppConstants.MOZ_DEV_EDITION) { - let uAppData = OS.Constants.Path.userApplicationDataDir; - let ignoreSeparateProfile = OS.Path.join(uAppData, "ignore-dev-edition-profile"); - - setEventListener("separateProfileMode", "command", gMainPane.separateProfileModeChange); - let separateProfileModeCheckbox = document.getElementById("separateProfileMode"); - setEventListener("getStarted", "click", gMainPane.onGetStarted); - - OS.File.stat(ignoreSeparateProfile).then(() => separateProfileModeCheckbox.checked = false, - () => separateProfileModeCheckbox.checked = true); - } - // Notify observers that the UI is now ready Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService) @@ -101,71 +89,6 @@ var gMainPane = { // **STUB** }, - separateProfileModeChange: function () - { - if (AppConstants.MOZ_DEV_EDITION) { - function quitApp() { - Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestartNotSameProfile); - } - function revertCheckbox(error) { - separateProfileModeCheckbox.checked = !separateProfileModeCheckbox.checked; - if (error) { - Cu.reportError("Failed to toggle separate profile mode: " + error); - } - } - function createOrRemoveSpecialDevEditionFile(onSuccess) { - let uAppData = OS.Constants.Path.userApplicationDataDir; - let ignoreSeparateProfile = OS.Path.join(uAppData, "ignore-dev-edition-profile"); - - if (separateProfileModeCheckbox.checked) { - OS.File.remove(ignoreSeparateProfile).then(onSuccess, revertCheckbox); - } else { - OS.File.writeAtomic(ignoreSeparateProfile, new Uint8Array()).then(onSuccess, revertCheckbox); - } - } - - let separateProfileModeCheckbox = document.getElementById("separateProfileMode"); - let button_index = confirmRestartPrompt(separateProfileModeCheckbox.checked, - 0, false, true); - switch (button_index) { - case CONFIRM_RESTART_PROMPT_CANCEL: - revertCheckbox(); - return; - case CONFIRM_RESTART_PROMPT_RESTART_NOW: - const Cc = Components.classes, Ci = Components.interfaces; - let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"] - .createInstance(Ci.nsISupportsPRBool); - Services.obs.notifyObservers(cancelQuit, "quit-application-requested", - "restart"); - if (!cancelQuit.data) { - createOrRemoveSpecialDevEditionFile(quitApp); - return; - } - - // Revert the checkbox in case we didn't quit - revertCheckbox(); - return; - case CONFIRM_RESTART_PROMPT_RESTART_LATER: - createOrRemoveSpecialDevEditionFile(); - return; - } - } - }, - - onGetStarted: function (aEvent) { - if (AppConstants.MOZ_DEV_EDITION) { - const Cc = Components.classes, Ci = Components.interfaces; - let wm = Cc["@mozilla.org/appshell/window-mediator;1"] - .getService(Ci.nsIWindowMediator); - let win = wm.getMostRecentWindow("navigator:browser"); - - if (win) { - let accountsTab = win.gBrowser.addTab("about:accounts?action=signin&entrypoint=dev-edition-setup"); - win.gBrowser.selectedTab = accountsTab; - } - } - }, - // HOME PAGE /* diff --git a/application/basilisk/components/preferences/in-content/main.xul b/application/basilisk/components/preferences/in-content/main.xul index 8eca118772..f695b308bd 100644 --- a/application/basilisk/components/preferences/in-content/main.xul +++ b/application/basilisk/components/preferences/in-content/main.xul @@ -112,17 +112,6 @@ hidden="true"> -#ifdef MOZ_DEV_EDITION - - - - - - - -#endif - #ifdef HAVE_SHELL_SERVICE diff --git a/application/basilisk/modules/ProcessHangMonitor.jsm b/application/basilisk/modules/ProcessHangMonitor.jsm index b1f6f2a97e..80c506ac75 100644 --- a/application/basilisk/modules/ProcessHangMonitor.jsm +++ b/application/basilisk/modules/ProcessHangMonitor.jsm @@ -304,16 +304,6 @@ var ProcessHangMonitor = { } }]; - if (AppConstants.MOZ_DEV_EDITION && report.hangType == report.SLOW_SCRIPT) { - buttons.push({ - label: bundle.getString("processHang.button_debug.label"), - accessKey: bundle.getString("processHang.button_debug.accessKey"), - callback: function() { - ProcessHangMonitor.debugScript(win); - } - }); - } - nb.appendNotification(bundle.getString("processHang.label"), "process-hang", "chrome://browser/skin/slowStartup-16.png", diff --git a/devtools/client/framework/devtools-browser.js b/devtools/client/framework/devtools-browser.js index 1b34e44e01..83a888ab99 100644 --- a/devtools/client/framework/devtools-browser.js +++ b/devtools/client/framework/devtools-browser.js @@ -330,9 +330,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { viewId: "PanelUI-developer", shortcutId: "key_devToolboxMenuItem", tooltiptext: "developer-button.tooltiptext2", - defaultArea: AppConstants.MOZ_DEV_EDITION ? - CustomizableUI.AREA_NAVBAR : - CustomizableUI.AREA_PANEL, + defaultArea: CustomizableUI.AREA_PANEL, onViewShowing: function (aEvent) { // Populate the subview with whatever menuitems are in the developer // menu. We skip menu elements, because the menu panel has no way diff --git a/devtools/client/preferences/devtools.js b/devtools/client/preferences/devtools.js index f893b9fb55..e817b3a18b 100644 --- a/devtools/client/preferences/devtools.js +++ b/devtools/client/preferences/devtools.js @@ -231,11 +231,7 @@ pref("devtools.dom.enabled", false); pref("devtools.webaudioeditor.inspectorWidth", 300); // Default theme ("dark" or "light") -#ifdef MOZ_DEV_EDITION -sticky_pref("devtools.theme", "dark"); -#else sticky_pref("devtools.theme", "light"); -#endif // Web console filters pref("devtools.webconsole.filter.error", true); diff --git a/old-configure.in b/old-configure.in index 11c7d3be67..49fb835299 100644 --- a/old-configure.in +++ b/old-configure.in @@ -5569,10 +5569,6 @@ if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK" ; then AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION) fi -if test -n "$MOZ_DEV_EDITION"; then - AC_DEFINE(MOZ_DEV_EDITION) -fi - if test "$MOZ_DEBUG"; then A11Y_LOG=1 fi diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm index ae0eea1c48..40ceb15ba3 100644 --- a/toolkit/modules/AppConstants.jsm +++ b/toolkit/modules/AppConstants.jsm @@ -60,13 +60,6 @@ this.AppConstants = Object.freeze({ false, #endif - MOZ_DEV_EDITION: -#ifdef MOZ_DEV_EDITION - true, -#else - false, -#endif - MOZ_SERVICES_HEALTHREPORT: #ifdef MOZ_SERVICES_HEALTHREPORT true, diff --git a/toolkit/profile/nsToolkitProfileService.cpp b/toolkit/profile/nsToolkitProfileService.cpp index 38b3a37f14..e818d27e60 100644 --- a/toolkit/profile/nsToolkitProfileService.cpp +++ b/toolkit/profile/nsToolkitProfileService.cpp @@ -425,22 +425,6 @@ nsToolkitProfileService::Init() nsToolkitProfile* currentProfile = nullptr; -#ifdef MOZ_DEV_EDITION - nsCOMPtr ignoreSeparateProfile; - rv = mAppData->Clone(getter_AddRefs(ignoreSeparateProfile)); - if (NS_FAILED(rv)) - return rv; - - rv = ignoreSeparateProfile->AppendNative(NS_LITERAL_CSTRING("ignore-dev-edition-profile")); - if (NS_FAILED(rv)) - return rv; - - bool shouldIgnoreSeparateProfile; - rv = ignoreSeparateProfile->Exists(&shouldIgnoreSeparateProfile); - if (NS_FAILED(rv)) - return rv; -#endif - unsigned int c = 0; bool foundAuroraDefault = false; for (c = 0; true; ++c) { @@ -501,35 +485,8 @@ nsToolkitProfileService::Init() mChosen = currentProfile; this->SetDefaultProfile(currentProfile); } -#ifdef MOZ_DEV_EDITION - // Use the dev-edition-default profile if this is an Aurora build and - // ignore-dev-edition-profile is not present. - if (name.EqualsLiteral("dev-edition-default") && !shouldIgnoreSeparateProfile) { - mChosen = currentProfile; - foundAuroraDefault = true; - } -#endif } -#ifdef MOZ_DEV_EDITION - if (!foundAuroraDefault && !shouldIgnoreSeparateProfile) { - // If a single profile exists, it may not be already marked as default. - // Do it now to avoid problems when we create the dev-edition-default profile. - if (!mChosen && mFirst && !mFirst->mNext) - this->SetDefaultProfile(mFirst); - - // Create a default profile for aurora, if none was found. - nsCOMPtr profile; - rv = CreateProfile(nullptr, - NS_LITERAL_CSTRING("dev-edition-default"), - getter_AddRefs(profile)); - if (NS_FAILED(rv)) return rv; - mChosen = profile; - rv = Flush(); - if (NS_FAILED(rv)) return rv; - } -#endif - if (!mChosen && mFirst && !mFirst->mNext) // only one profile mChosen = mFirst; return NS_OK; diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index a36cf4e6c4..2b341eee02 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -2174,9 +2174,9 @@ SelectProfile(nsIProfileLock* *aResult, nsIToolkitProfileService* aProfileSvc, n return ShowProfileManager(aProfileSvc, aNative); } -#ifndef MOZ_DEV_EDITION - // If the only existing profile is the dev-edition-profile and this is not - // Developer Edition, then no valid profiles were found. + // Dev edition leftovers: + // If the only existing profile is the dev-edition-profile, + // then no valid profiles were found. if (count == 1) { nsCOMPtr deProfile; // GetSelectedProfile will auto-select the only profile if there's just one @@ -2187,7 +2187,6 @@ SelectProfile(nsIProfileLock* *aResult, nsIToolkitProfileService* aProfileSvc, n count = 0; } } -#endif if (!count) { gDoMigration = true; @@ -2196,25 +2195,15 @@ SelectProfile(nsIProfileLock* *aResult, nsIToolkitProfileService* aProfileSvc, n // create a default profile nsCOMPtr profile; nsresult rv = aProfileSvc->CreateProfile(nullptr, // choose a default dir for us -#ifdef MOZ_DEV_EDITION - NS_LITERAL_CSTRING("dev-edition-default"), -#else NS_LITERAL_CSTRING("default"), -#endif getter_AddRefs(profile)); if (NS_SUCCEEDED(rv)) { -#ifndef MOZ_DEV_EDITION aProfileSvc->SetDefaultProfile(profile); -#endif aProfileSvc->Flush(); rv = profile->Lock(nullptr, aResult); if (NS_SUCCEEDED(rv)) { if (aProfileName) -#ifdef MOZ_DEV_EDITION - aProfileName->AssignLiteral("dev-edition-default"); -#else aProfileName->AssignLiteral("default"); -#endif return NS_OK; } } From 188fdce00f9e03fd925f752f7681fa87159ad74d Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 20:08:49 +0200 Subject: [PATCH 17/23] Issue #1124: [Basilisk] Remove Dev Edition front-end tie-ins. --- .../base/content/browser-devedition.js | 142 ------------------ application/basilisk/base/content/browser.js | 3 - .../basilisk/base/content/global-scripts.inc | 1 - application/basilisk/base/jar.mn | 1 - .../basilisk/components/nsBrowserGlue.js | 23 +-- .../extension/configurations/DevEdition.jsm | 42 ------ .../lib/rules/import-browserjs-globals.js | 1 - 7 files changed, 2 insertions(+), 211 deletions(-) delete mode 100644 application/basilisk/base/content/browser-devedition.js delete mode 100644 application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/DevEdition.jsm diff --git a/application/basilisk/base/content/browser-devedition.js b/application/basilisk/base/content/browser-devedition.js deleted file mode 100644 index 0dc1e94da5..0000000000 --- a/application/basilisk/base/content/browser-devedition.js +++ /dev/null @@ -1,142 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/** - * Listeners for the DevEdition theme. This adds an extra stylesheet - * to browser.xul if a pref is set and no other themes are applied. - */ -var DevEdition = { - _devtoolsThemePrefName: "devtools.theme", - styleSheetLocation: "chrome://browser/skin/devedition.css", - styleSheet: null, - initialized: false, - - get isStyleSheetEnabled() { - return this.styleSheet && !this.styleSheet.sheet.disabled; - }, - - get isThemeCurrentlyApplied() { - let theme = LightweightThemeManager.currentTheme; - return theme && theme.id == "firefox-devedition@mozilla.org"; - }, - - init: function () { - this.initialized = true; - Services.prefs.addObserver(this._devtoolsThemePrefName, this, false); - Services.obs.addObserver(this, "lightweight-theme-styling-update", false); - Services.obs.addObserver(this, "lightweight-theme-window-updated", false); - this._updateDevtoolsThemeAttribute(); - - if (this.isThemeCurrentlyApplied) { - this._toggleStyleSheet(true); - } - }, - - createStyleSheet: function() { - let styleSheetAttr = `href="${this.styleSheetLocation}" type="text/css"`; - this.styleSheet = document.createProcessingInstruction( - "xml-stylesheet", styleSheetAttr); - this.styleSheet.addEventListener("load", this); - document.insertBefore(this.styleSheet, document.documentElement); - this.styleSheet.sheet.disabled = true; - }, - - observe: function (subject, topic, data) { - if (topic == "lightweight-theme-styling-update") { - let newTheme = JSON.parse(data); - if (newTheme && newTheme.id == "firefox-devedition@mozilla.org") { - this._toggleStyleSheet(true); - } else { - this._toggleStyleSheet(false); - } - } else if (topic == "lightweight-theme-window-updated" && subject == window) { - this._updateLWTBrightness(); - } - - if (topic == "nsPref:changed" && data == this._devtoolsThemePrefName) { - this._updateDevtoolsThemeAttribute(); - } - }, - - _inferBrightness: function() { - ToolbarIconColor.inferFromText(); - // Get an inverted full screen button if the dark theme is applied. - if (this.isStyleSheetEnabled && - document.documentElement.getAttribute("devtoolstheme") == "dark") { - document.documentElement.setAttribute("brighttitlebarforeground", "true"); - } else { - document.documentElement.removeAttribute("brighttitlebarforeground"); - } - }, - - _updateLWTBrightness() { - if (this.isThemeCurrentlyApplied) { - let devtoolsTheme = Services.prefs.getCharPref(this._devtoolsThemePrefName); - let textColor = devtoolsTheme == "dark" ? "bright" : "dark"; - document.documentElement.setAttribute("lwthemetextcolor", textColor); - } - }, - - _updateDevtoolsThemeAttribute: function() { - // Set an attribute on root element to make it possible - // to change colors based on the selected devtools theme. - let devtoolsTheme = Services.prefs.getCharPref(this._devtoolsThemePrefName); - if (devtoolsTheme != "dark") { - devtoolsTheme = "light"; - } - document.documentElement.setAttribute("devtoolstheme", devtoolsTheme); - this._updateLWTBrightness(); - this._inferBrightness(); - }, - - handleEvent: function(e) { - if (e.type === "load") { - this.styleSheet.removeEventListener("load", this); - this.refreshBrowserDisplay(); - } - }, - - refreshBrowserDisplay: function() { - // Don't touch things on the browser if gBrowserInit.onLoad hasn't - // yet fired. - if (this.initialized) { - gBrowser.tabContainer._positionPinnedTabs(); - this._inferBrightness(); - } - }, - - _toggleStyleSheet: function(deveditionThemeEnabled) { - let wasEnabled = this.isStyleSheetEnabled; - if (deveditionThemeEnabled && !wasEnabled) { - // The stylesheet may not have been created yet if it wasn't - // needed on initial load. Make it now. - if (!this.styleSheet) { - this.createStyleSheet(); - } - this.styleSheet.sheet.disabled = false; - this.refreshBrowserDisplay(); - } else if (!deveditionThemeEnabled && wasEnabled) { - this.styleSheet.sheet.disabled = true; - this.refreshBrowserDisplay(); - } - }, - - uninit: function () { - Services.prefs.removeObserver(this._devtoolsThemePrefName, this); - Services.obs.removeObserver(this, "lightweight-theme-styling-update", false); - Services.obs.removeObserver(this, "lightweight-theme-window-updated", false); - if (this.styleSheet) { - this.styleSheet.removeEventListener("load", this); - } - this.styleSheet = null; - } -}; - -// If the DevEdition theme is going to be applied in gBrowserInit.onLoad, -// then preload it now. This prevents a flash of unstyled content where the -// normal theme is applied while the DevEdition stylesheet is loading. -if (!AppConstants.RELEASE_OR_BETA && - this != Services.appShell.hiddenDOMWindow && DevEdition.isThemeCurrentlyApplied) { - DevEdition.createStyleSheet(); -} diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js index 17dd1eecb1..f3cc8d1359 100644 --- a/application/basilisk/base/content/browser.js +++ b/application/basilisk/base/content/browser.js @@ -961,7 +961,6 @@ var gBrowserInit = { gPageStyleMenu.init(); BrowserOnClick.init(); FeedHandler.init(); - DevEdition.init(); AboutPrivateBrowsingListener.init(); TrackingProtection.init(); RefreshBlocker.init(); @@ -1484,8 +1483,6 @@ var gBrowserInit = { FeedHandler.uninit(); - DevEdition.uninit(); - TrackingProtection.uninit(); RefreshBlocker.uninit(); diff --git a/application/basilisk/base/content/global-scripts.inc b/application/basilisk/base/content/global-scripts.inc index db8496cfce..6edb112140 100644 --- a/application/basilisk/base/content/global-scripts.inc +++ b/application/basilisk/base/content/global-scripts.inc @@ -14,7 +14,6 @@ - diff --git a/application/basilisk/base/jar.mn b/application/basilisk/base/jar.mn index a4b90f90ce..f2b82ba1ee 100644 --- a/application/basilisk/base/jar.mn +++ b/application/basilisk/base/jar.mn @@ -66,7 +66,6 @@ browser.jar: content/browser/browser-ctrlTab.js (content/browser-ctrlTab.js) content/browser/browser-customization.js (content/browser-customization.js) content/browser/browser-data-submission-info-bar.js (content/browser-data-submission-info-bar.js) - content/browser/browser-devedition.js (content/browser-devedition.js) content/browser/browser-feeds.js (content/browser-feeds.js) content/browser/browser-fullScreenAndPointerLock.js (content/browser-fullScreenAndPointerLock.js) content/browser/browser-fullZoom.js (content/browser-fullZoom.js) diff --git a/application/basilisk/components/nsBrowserGlue.js b/application/basilisk/components/nsBrowserGlue.js index 7c48473ae0..5d3e4689bb 100644 --- a/application/basilisk/components/nsBrowserGlue.js +++ b/application/basilisk/components/nsBrowserGlue.js @@ -676,19 +676,6 @@ BrowserGlue.prototype = { // Ensure we keep track of places/pw-mananager undo by init'ing this early. Cu.import("resource:///modules/AutoMigrate.jsm"); - if (!AppConstants.RELEASE_OR_BETA) { - let themeName = gBrowserBundle.GetStringFromName("deveditionTheme.name"); - let vendorShortName = gBrandBundle.GetStringFromName("vendorShortName"); - - LightweightThemeManager.addBuiltInTheme({ - id: "firefox-devedition@mozilla.org", - name: themeName, - headerURL: "resource:///chrome/browser/content/browser/defaultthemes/devedition.header.png", - iconURL: "resource:///chrome/browser/content/browser/defaultthemes/devedition.icon.png", - author: vendorShortName, - }); - } - TabCrashHandler.init(); Services.obs.notifyObservers(null, "browser-ui-startup-complete", ""); @@ -1943,14 +1930,8 @@ BrowserGlue.prototype = { defaultThemeSelected = Services.prefs.getCharPref("general.skins.selectedSkin") == "classic/1.0"; } catch (e) {} - // If we are on the devedition channel, the devedition theme is on by - // default. But we need to handle the case where they didn't want it - // applied, and unapply the theme. - let userChoseToNotUseDeveditionTheme = - !defaultThemeSelected || - (lightweightThemeSelected && selectedThemeID != "firefox-devedition@mozilla.org"); - - if (userChoseToNotUseDeveditionTheme && selectedThemeID == "firefox-devedition@mozilla.org") { + // If we have the dev edition theme selected, reset it. + if (selectedThemeID == "firefox-devedition@mozilla.org") { Services.prefs.setCharPref("lightweightThemes.selectedThemeID", ""); } diff --git a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/DevEdition.jsm b/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/DevEdition.jsm deleted file mode 100644 index fd981bca3c..0000000000 --- a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/DevEdition.jsm +++ /dev/null @@ -1,42 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; - -this.EXPORTED_SYMBOLS = ["DevEdition"]; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; -const THEME_ID = "firefox-devedition@mozilla.org"; - -Cu.import("resource://gre/modules/LightweightThemeManager.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/Task.jsm"); - -this.DevEdition = { - init(libDir) {}, - - configurations: { - devEditionLight: { - applyConfig: Task.async(() => { - Services.prefs.setCharPref("devtools.theme", "light"); - LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme(THEME_ID); - Services.prefs.setBoolPref("browser.devedition.theme.showCustomizeButton", true); - }), - }, - devEditionDark: { - applyConfig: Task.async(() => { - Services.prefs.setCharPref("devtools.theme", "dark"); - LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme(THEME_ID); - Services.prefs.setBoolPref("browser.devedition.theme.showCustomizeButton", true); - }), - }, - devEditionOff: { - applyConfig: Task.async(() => { - Services.prefs.clearUserPref("devtools.theme"); - LightweightThemeManager.currentTheme = null; - Services.prefs.clearUserPref("browser.devedition.theme.showCustomizeButton"); - }), - }, - }, -}; diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-browserjs-globals.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-browserjs-globals.js index 00a48f3591..e449931bd8 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-browserjs-globals.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-browserjs-globals.js @@ -32,7 +32,6 @@ const SCRIPTS = [ "browser/base/content/browser-addons.js", "browser/base/content/browser-ctrlTab.js", "browser/base/content/browser-customization.js", - "browser/base/content/browser-devedition.js", "browser/base/content/browser-feeds.js", "browser/base/content/browser-fullScreenAndPointerLock.js", "browser/base/content/browser-fullZoom.js", From bd9bb12027adf43e4320da6201bea64cde49cf8c Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 21:31:00 +0200 Subject: [PATCH 18/23] Issue #1124: [Basilisk] Remove Dev Edition theme. --- .../basilisk/themes/linux/devedition.css | 106 ------ application/basilisk/themes/linux/jar.mn | 1 - .../basilisk/themes/osx/devedition.css | 121 ------- application/basilisk/themes/osx/jar.mn | 1 - .../basilisk/themes/shared/devedition.inc.css | 311 ----------------- .../devedition/urlbar-history-dropmarker.svg | 22 -- application/basilisk/themes/shared/jar.inc.mn | 1 - .../basilisk/themes/windows/browser.css | 3 - .../basilisk/themes/windows/devedition.css | 319 ------------------ application/basilisk/themes/windows/jar.mn | 1 - 10 files changed, 886 deletions(-) delete mode 100644 application/basilisk/themes/linux/devedition.css delete mode 100644 application/basilisk/themes/osx/devedition.css delete mode 100644 application/basilisk/themes/shared/devedition.inc.css delete mode 100644 application/basilisk/themes/shared/devedition/urlbar-history-dropmarker.svg delete mode 100644 application/basilisk/themes/windows/devedition.css diff --git a/application/basilisk/themes/linux/devedition.css b/application/basilisk/themes/linux/devedition.css deleted file mode 100644 index 1f16d5d63b..0000000000 --- a/application/basilisk/themes/linux/devedition.css +++ /dev/null @@ -1,106 +0,0 @@ -% This Source Code Form is subject to the terms of the Mozilla Public -% License, v. 2.0. If a copy of the MPL was not distributed with this -% file, You can obtain one at http://mozilla.org/MPL/2.0/. - -%include ../shared/devedition.inc.css - -:root { - --forwardbutton-width: 29px; -} - -:root[devtoolstheme="light"] { - --urlbar-dropmarker-url: url("chrome://browser/skin/devedition/urlbar-history-dropmarker.svg"); - --urlbar-dropmarker-region: rect(0px, 11px, 14px, 0px); - --urlbar-dropmarker-hover-region: rect(0, 22px, 14px, 11px); - --urlbar-dropmarker-active-region: rect(0px, 33px, 14px, 22px); - --urlbar-dropmarker-2x-url: url("chrome://browser/skin/devedition/urlbar-history-dropmarker.svg"); - --urlbar-dropmarker-2x-region: rect(0px, 11px, 14px, 0px); - --urlbar-dropmarker-hover-2x-region: rect(0, 22px, 14px, 11px); - --urlbar-dropmarker-active-2x-region: rect(0px, 33px, 14px, 22px); -} - -:root[devtoolstheme="dark"] .findbar-closebutton:not(:hover), -:root[devtoolstheme="dark"] #sidebar-header > .close-icon:not(:hover), -.tab-close-button[selected]:not(:hover) { - background-image: -moz-image-rect(url("chrome://global/skin/icons/close.svg"), 0, 80, 16, 64); -} - -/* The menubar and tabs toolbar should match the devedition theme */ -#TabsToolbar, -#toolbar-menubar { - -moz-appearance: none !important; -} -#main-menubar { - color: var(--chrome-color); -} -#main-menubar > menu:not([open]) { - color: inherit; -} - -/* Allow buttons with -moz-appearance set to look normal on hover and open states */ -#navigator-toolbox .toolbarbutton-1:-moz-any(:hover, [open="true"]), -#PlacesToolbar toolbarbutton.bookmark-item:-moz-any(:hover, [open="true"]) { - color: initial; -} - -/* Square back and forward buttons */ -#back-button > .toolbarbutton-icon, -#forward-button > .toolbarbutton-icon { - margin: 0; - border: 1px solid var(--chrome-nav-bar-controls-border-color); - padding: 2px 5px; - background: var(--chrome-nav-buttons-background); - box-shadow: none !important; -} - -#forward-button > .toolbarbutton-icon { - border-inline-start: none; -} - -/* Override a box shadow for disabled back button */ -#main-window:not([customizing]) #back-button[disabled] > .toolbarbutton-icon { - box-shadow: none !important; -} - -#back-button:hover:not([disabled="true"]) > .toolbarbutton-icon, -#forward-button:hover:not([disabled="true"]) > .toolbarbutton-icon { - background: var(--chrome-nav-buttons-hover-background) !important; -} - -#back-button > .toolbarbutton-icon { - border-radius: 2px 0 0 2px !important; -} - -.urlbar-history-dropmarker { - -moz-appearance: none; - padding: 0 3px; - list-style-image: var(--urlbar-dropmarker-url); - -moz-image-region: var(--urlbar-dropmarker-region); -} - -/* Add the proper background for tab overflow */ -#alltabs-button, -#new-tab-button { - background: var(--chrome-background-color); -} - -#new-tab-button:hover > .toolbarbutton-icon { - border-color: transparent !important; -} - -/* Prevent double border below tabs toolbar */ -#TabsToolbar:not([collapsed="true"]) + #nav-bar { - border-top-width: 0 !important; -} - -/* Fix the bad-looking text-shadow in the sidebar header: */ -.sidebar-header, -#sidebar-header { - text-shadow: none; -} - -.ac-type-icon { - /* Left-align the type icon in awesomebar popup results with the icon in the - urlbar. */ - margin-inline-start: 11px; -} diff --git a/application/basilisk/themes/linux/jar.mn b/application/basilisk/themes/linux/jar.mn index e9f666418b..81581dfaa9 100644 --- a/application/basilisk/themes/linux/jar.mn +++ b/application/basilisk/themes/linux/jar.mn @@ -13,7 +13,6 @@ browser.jar: #endif skin/classic/browser/actionicon-tab.png * skin/classic/browser/browser.css -* skin/classic/browser/devedition.css * skin/classic/browser/browser-lightweightTheme.css skin/classic/browser/click-to-play-warning-stripes.png skin/classic/browser/Info.png diff --git a/application/basilisk/themes/osx/devedition.css b/application/basilisk/themes/osx/devedition.css deleted file mode 100644 index c7a2bdd714..0000000000 --- a/application/basilisk/themes/osx/devedition.css +++ /dev/null @@ -1,121 +0,0 @@ -% This Source Code Form is subject to the terms of the Mozilla Public -% License, v. 2.0. If a copy of the MPL was not distributed with this -% file, You can obtain one at http://mozilla.org/MPL/2.0/. - -%include ../shared/devedition.inc.css - -:root { - --forwardbutton-width: 32px; -} - -/* Use only 1px separator between nav toolbox and page content */ -#navigator-toolbox::after { - border-top-style: none; - margin-top: -1px; -} - -/* Include extra space on left/right for dragging since there is no space above - the tabs */ -#main-window[tabsintitlebar] #TabsToolbar { - padding-left: 50px; - padding-right: 50px; - margin-bottom: 0; /* Don't overlap the inner highlight at the top of the nav-bar */ -} - -/* Get rid of 1px bright strip at the top of window */ -#main-window[tabsintitlebar] #titlebar-content { - background: var(--chrome-background-color); -} - -/* Resize things so that the native titlebar is in line with the tabs */ -#main-window[tabsintitlebar] > #titlebar > #titlebar-content > #titlebar-buttonbox-container, -#main-window[tabsintitlebar] > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > #titlebar-fullscreen-button { - margin-top: 6px; -} - -/* Square back and forward buttons. Need !important on these because there - are a lot of more specific selectors sprinkled around elsewhere for changing - background / shadows for different states */ -#back-button, -#forward-button { - height: 24px !important; - box-shadow: none !important; - border: 1px solid var(--chrome-nav-bar-controls-border-color) !important; - background: var(--chrome-nav-buttons-background) !important; -} - -#forward-button { - border-inline-start: none !important; - /* browser.css and friends set up the width of the button to be 32px. - * They then set margin-left to -2px to ensure the button is not too wide - * compared to the back button, and set padding-left to center the icon - * correctly. - * In our theme, the back and forward buttons are the same width, with the - * back button being 32px with 1px border on both sides. To ensure the - * forward button's content box looks like it is the same size with width - * set to 32px and a 1px border on only 1 side, we overlap by 1px, so both - * buttons end up with a content box that looks like it's 30px. - */ - margin-left: -1px; - padding-left: 1px; -} - -#forward-button > .toolbarbutton-icon { - margin-left: 0; - margin-right: 0; -} - -#back-button:hover:not([disabled="true"]), -#forward-button:hover:not([disabled="true"]) { - background: var(--chrome-nav-buttons-hover-background) !important; -} - -#back-button { - border-radius: 3px 0 0 3px !important; - padding: 0 !important; - margin: 0 !important; -} - -#back-button:hover:active:not([disabled="true"]) { - -moz-image-region: rect(18px, 54px, 36px, 36px); -} - -/* Use smaller back button icon */ -@media (min-resolution: 2dppx) { - #back-button:hover:active:not([disabled="true"]) { - -moz-image-region: rect(36px, 108px, 72px, 72px); - } -} - -/* Don't use the default background for tabs toolbar */ -#TabsToolbar { - -moz-appearance: none !important; -} - -/* Prevent the hover styling from on the identity icon from overlapping the - urlbar border. */ -#identity-box { - margin-top: -1px !important; - margin-bottom: -1px !important; - padding-top: 3px !important; - padding-bottom: 3px !important; -} - -:root[devtoolstheme="dark"] .findbar-closebutton:not(:hover), -/* Tab styling - make sure to use an inverted icon for the selected tab - (brighttext only covers the unselected tabs) */ -.tab-close-button[selected=true]:not(:hover) { - -moz-image-region: rect(0, 64px, 16px, 48px); -} -@media (min-resolution: 2dppx) { - :root[devtoolstheme="dark"] .findbar-closebutton:not(:hover), - .tab-close-button[selected=true]:not(:hover) { - -moz-image-region: rect(0, 128px, 32px, 96px); - } -} - -.ac-type-icon { - /* Left-align the type icon in awesomebar popup results with the icon in the - urlbar. */ - margin-inline-start: 14px; -} diff --git a/application/basilisk/themes/osx/jar.mn b/application/basilisk/themes/osx/jar.mn index 92d2ceedf5..5dec6559ad 100644 --- a/application/basilisk/themes/osx/jar.mn +++ b/application/basilisk/themes/osx/jar.mn @@ -13,7 +13,6 @@ browser.jar: skin/classic/browser/actionicon-tab.png skin/classic/browser/actionicon-tab@2x.png * skin/classic/browser/browser.css -* skin/classic/browser/devedition.css * skin/classic/browser/browser-lightweightTheme.css skin/classic/browser/click-to-play-warning-stripes.png skin/classic/browser/Info.png diff --git a/application/basilisk/themes/shared/devedition.inc.css b/application/basilisk/themes/shared/devedition.inc.css deleted file mode 100644 index a5c0db9489..0000000000 --- a/application/basilisk/themes/shared/devedition.inc.css +++ /dev/null @@ -1,311 +0,0 @@ -% This Source Code Form is subject to the terms of the Mozilla Public -% License, v. 2.0. If a copy of the MPL was not distributed with this -% file, You can obtain one at http://mozilla.org/MPL/2.0/. - -/* devedition.css is loaded in browser.xul after browser.css when it is - preffed on. The bulk of the styling is here in the shared file, but - there are overrides for each platform in their devedition.css files. */ - -:root { - --tab-toolbar-navbar-overlap: 0px; - --navbar-tab-toolbar-highlight-overlap: 0px; - --space-above-tabbar: 0px; - --toolbarbutton-text-shadow: none; - --backbutton-urlbar-overlap: 0px; -} - -:root[devtoolstheme="dark"] { - /* Chrome */ - --chrome-background-color: #272b35; - --chrome-color: #F5F7FA; - --chrome-secondary-background-color: #393F4C; - --chrome-navigator-toolbox-separator-color: rgba(0,0,0,.2); - --chrome-nav-bar-separator-color: rgba(0,0,0,.2); - --chrome-nav-buttons-background: #252C33; - --chrome-nav-buttons-hover-background: #1B2127; - --chrome-nav-bar-controls-border-color: #1D2328; - --chrome-selection-color: #fff; - --chrome-selection-background-color: #5675B9; - - /* Tabs */ - --tabs-toolbar-color: #F5F7FA; - --tab-background-color: #272b35; - --tab-hover-background-color: #07090a; - --tab-selection-color: #f5f7fa; - --tab-selection-background-color: #5675B9; - --tab-selection-box-shadow: none; - --pinned-tab-glow: radial-gradient(22px at center calc(100% - 2px), rgba(76,158,217,0.9) 13%, rgba(0,0,0,0.4) 16%, transparent 70%); - - /* Url and search bars */ - --url-and-searchbar-background-color: #171B1F; - --urlbar-separator-color: #5F6670; - --urlbar-dropmarker-url: url("chrome://browser/skin/devedition/urlbar-history-dropmarker.svg"); - --urlbar-dropmarker-region: rect(0px, 11px, 14px, 0px); - --urlbar-dropmarker-hover-region: rect(0, 22px, 14px, 11px); - --urlbar-dropmarker-active-region: rect(0px, 33px, 14px, 22px); - --urlbar-dropmarker-2x-url: url("chrome://browser/skin/devedition/urlbar-history-dropmarker.svg"); - --urlbar-dropmarker-2x-region: rect(0px, 11px, 14px, 0px); - --urlbar-dropmarker-hover-2x-region: rect(0, 22px, 14px, 11px); - --urlbar-dropmarker-active-2x-region: rect(0px, 33px, 14px, 22px); -} - -/* Override the lwtheme-specific styling for toolbar buttons */ -:root[devtoolstheme="dark"], -:root[devtoolstheme="dark"] toolbar:-moz-lwtheme { - --toolbarbutton-hover-background: rgba(25,33, 38,.6) linear-gradient(rgba(25,33,38,.6), rgba(25,33,38,.6)) padding-box; - --toolbarbutton-hover-boxshadow: none; - --toolbarbutton-hover-bordercolor: rgba(25,33,38,.6); - --toolbarbutton-active-background: rgba(25,33,38,1) linear-gradient(rgba(25,33,38,1), rgba(25,33,38,1)) border-box; - --toolbarbutton-active-boxshadow: none; - --toolbarbutton-active-bordercolor: rgba(25,33,38,.8); - --toolbarbutton-checkedhover-backgroundcolor: #3C5283; - -} - -:root[devtoolstheme="light"] { - --url-and-searchbar-background-color: #fff; - - --chrome-background-color: #E3E4E6; - --chrome-color: #18191a; - --chrome-secondary-background-color: #f5f6f7; - --chrome-navigator-toolbox-separator-color: #cccccc; - --chrome-nav-bar-separator-color: #B6B6B8; - --chrome-nav-buttons-background: #ffffff; /* --theme-body-background */ - --chrome-nav-buttons-hover-background: #DADBDB; - --chrome-nav-bar-controls-border-color: #ccc; - --chrome-selection-color: #f5f7fa; - --chrome-selection-background-color: #4c9ed9; - - --tab-background-color: #E3E4E6; - --tab-hover-background-color: #D7D8DA; - --tab-selection-color: #f5f7fa; - --tab-selection-background-color: #4c9ed9; - --tab-selection-box-shadow: none; - --pinned-tab-glow: radial-gradient(22px at center calc(100% - 2px), rgba(76,158,217,0.9) 13%, transparent 16%); -} - -/* Override the lwtheme-specific styling for toolbar buttons */ -:root[devtoolstheme="light"], -:root[devtoolstheme="light"] toolbar:-moz-lwtheme { - --toolbarbutton-hover-background: #eaeaea; - --toolbarbutton-hover-boxshadow: none; - --toolbarbutton-hover-bordercolor: rgba(0,0,0,0.1); - --toolbarbutton-active-background: #d7d7d8 border-box; - --toolbarbutton-active-boxshadow: none; - --toolbarbutton-active-bordercolor: rgba(0,0,0,0.15); - --toolbarbutton-checkedhover-backgroundcolor: #d7d7d8; -} - -/* Give some space to drag the window around while customizing - (normal space to left and right of tabs doesn't work in this case) */ -#main-window[tabsintitlebar][customizing] { - --space-above-tabbar: 9px; -} - -/* Override @tabCurveHalfWidth@ and @tabCurveWidth@. XXX: Switch to a CSS variable once the perf is sorted out - bug 1088771 */ -.tab-background-middle { - border-left-width: 0; - border-right-width: 0; - margin: 0; -} - -.tab-background, -.tabs-newtab-button { - margin-inline-end: 0; - margin-inline-start: 0; -} - -.tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox { - padding-inline-end: 0; - padding-inline-start: 0; -} - -.tab-background-start[selected=true]::after, -.tab-background-start[selected=true]::before, -.tab-background-start, -.tab-background-end, -.tab-background-end[selected=true]::after, -.tab-background-end[selected=true]::before { - width: 0; -} - -.tab-background-start[selected=true]::after, -.tab-background-end[selected=true]::after { - margin-inline-start: 0; -} -/* End override @tabCurveHalfWidth@ and @tabCurveWidth@ */ - -#urlbar ::-moz-selection, -#navigator-toolbox .searchbar-textbox ::-moz-selection, -.browserContainer > findbar ::-moz-selection { - background-color: var(--chrome-selection-background-color); - color: var(--chrome-selection-color); -} - -/* Change the base colors for the browser chrome */ - -#tabbrowser-tabs, -#TabsToolbar, -#browser-panel { - background: var(--chrome-background-color); - color: var(--chrome-color); -} - -#navigator-toolbox:-moz-lwtheme::after { - border-bottom-color: var(--chrome-navigator-toolbox-separator-color); -} - -#navigator-toolbox > toolbar:not(#TabsToolbar):not(#toolbar-menubar), -.browserContainer > findbar, -#browser-bottombox { - background-color: var(--chrome-secondary-background-color) !important; - background-image: none !important; - color: var(--chrome-color); -} - -/* Default findbar text color doesn't look good - Bug 1125677 */ -.browserContainer > findbar .findbar-find-status, -.browserContainer > findbar .found-matches { - color: inherit; -} - -#navigator-toolbox .toolbarbutton-1, -.browserContainer > findbar .findbar-button, -#PlacesToolbar toolbarbutton.bookmark-item { - color: var(--chrome-color); - text-shadow: var(--toolbarbutton-text-shadow); -} - -/* Using toolbar[brighttext] instead of important to override linux */ -toolbar[brighttext] #downloads-indicator-counter { - text-shadow: var(--toolbarbutton-text-shadow); - color: var(--chrome-color); -} - -#TabsToolbar { - text-shadow: none !important; -} - -/* URL bar and search bar*/ -#urlbar, -#navigator-toolbox .searchbar-textbox { - background-color: var(--url-and-searchbar-background-color) !important; - background-image: none !important; - color: inherit !important; - border: 1px solid var(--chrome-nav-bar-controls-border-color) !important; - box-shadow: none !important; -} - -%filter substitution -%define selectorPrefix :root[devtoolstheme="dark"] -%define selectorSuffix :-moz-lwtheme -%define iconVariant -white -%include identity-block/icons.inc.css - -#urlbar { - border-inline-start: none !important; - opacity: 1 !important; -} - -window:not([chromehidden~="toolbar"]) #urlbar-wrapper { - overflow: -moz-hidden-unscrollable; - clip-path: none; - margin-inline-start: 0; -} - -:root[devtoolstheme="dark"] #urlbar-zoom-button:hover { - background-color: rgba(255,255,255,.2); -} - -:root[devtoolstheme="dark"] #urlbar-zoom-button:hover:active { - background-color: rgba(255,255,255,.3); -} - -/* Nav bar specific stuff */ -#nav-bar { - margin-top: 0 !important; - border-top: none !important; - border-bottom: none !important; - border-radius: 0 !important; - box-shadow: 0 -1px var(--chrome-nav-bar-separator-color) !important; -} - -/* No extra vertical padding for nav bar */ -#nav-bar-customization-target, -#nav-bar { - padding-top: 0; - padding-bottom: 0; -} - -/* Use smaller back button icon */ -#back-button { - -moz-image-region: rect(0, 54px, 18px, 36px); -} - -@media (min-resolution: 1.1dppx) { - #back-button { - -moz-image-region: rect(0, 108px, 36px, 72px); - } -} - -.tab-background { - visibility: hidden; -} - -/* Tab separators */ -.tabbrowser-tab::after, -.tabbrowser-tab::before { - background: currentColor; - opacity: 0.2 !important; -} - -.tabbrowser-arrowscrollbox > .scrollbutton-down, -.tabbrowser-arrowscrollbox > .scrollbutton-up { - background-color: var(--tab-background-color); - border-color: transparent; -} - -.tabbrowser-tab { - /* We normally rely on other tab elements for pointer events, but this - theme hides those so we need it set here instead */ - pointer-events: auto; -} - -.tabbrowser-tab:-moz-any([image], [pinned]) > .tab-stack > .tab-content[attention]:not([selected="true"]), -.tabbrowser-tab > .tab-stack > .tab-content[pinned][titlechanged]:not([selected="true"]) { - background-image: var(--pinned-tab-glow); - background-position: center; - background-size: 100%; -} - -.tabbrowser-tab[image] > .tab-stack > .tab-content[attention]:not([pinned]):not([selected="true"]) { - background-position: left bottom var(--tab-toolbar-navbar-overlap); - background-size: 34px 100%; -} - -.tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled]):hover, -.tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled]):hover, -.tabbrowser-tab:hover { - background-color: var(--tab-hover-background-color); -} - -.tabbrowser-tab[visuallyselected] { - color: var(--tab-selection-color) !important; /* Override color: inherit */ - background-color: var(--tab-selection-background-color); -} - -.tab-icon-sound[soundplaying], -.tab-icon-sound[muted] { - filter: url(chrome://browser/skin/filters.svg#fill) !important; /* removes drop-shadow filter */ -} - -/* Don't need space for the tab curves (66px - 30px) */ -.tabs-newtab-button { - width: 36px; -} - -.tabs-newtab-button:hover { - /* Important needed because !important is used in browser.css */ - background-color: var(--tab-hover-background-color) !important; - background-image: none; -} diff --git a/application/basilisk/themes/shared/devedition/urlbar-history-dropmarker.svg b/application/basilisk/themes/shared/devedition/urlbar-history-dropmarker.svg deleted file mode 100644 index 115fbf127e..0000000000 --- a/application/basilisk/themes/shared/devedition/urlbar-history-dropmarker.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - diff --git a/application/basilisk/themes/shared/jar.inc.mn b/application/basilisk/themes/shared/jar.inc.mn index 5750d2dc5a..d12971a4b4 100644 --- a/application/basilisk/themes/shared/jar.inc.mn +++ b/application/basilisk/themes/shared/jar.inc.mn @@ -137,6 +137,5 @@ skin/classic/browser/privatebrowsing/private-browsing.svg (../shared/privatebrowsing/private-browsing.svg) skin/classic/browser/privatebrowsing/tracking-protection-off.svg (../shared/privatebrowsing/tracking-protection-off.svg) skin/classic/browser/privatebrowsing/tracking-protection.svg (../shared/privatebrowsing/tracking-protection.svg) - skin/classic/browser/devedition/urlbar-history-dropmarker.svg (../shared/devedition/urlbar-history-dropmarker.svg) skin/classic/browser/urlbar-star.svg (../shared/urlbar-star.svg) skin/classic/browser/urlbar-tab.svg (../shared/urlbar-tab.svg) diff --git a/application/basilisk/themes/windows/browser.css b/application/basilisk/themes/windows/browser.css index d87b8eeafa..ee537a4b66 100644 --- a/application/basilisk/themes/windows/browser.css +++ b/application/basilisk/themes/windows/browser.css @@ -196,9 +196,6 @@ toolbar:-moz-lwtheme { @media not all and (-moz-windows-compositor), not all and (-moz-windows-default-theme) { - /* Please keep the menu text colors in this media block in sync with - * devedition.css, minus the :not(:-moz-lwtheme) condition - see Bug 1165718. - */ :root[tabsintitlebar]:not([inFullscreen]):not(:-moz-lwtheme) { --titlebar-text-color: CaptionText; } diff --git a/application/basilisk/themes/windows/devedition.css b/application/basilisk/themes/windows/devedition.css deleted file mode 100644 index 2dc72eeeb3..0000000000 --- a/application/basilisk/themes/windows/devedition.css +++ /dev/null @@ -1,319 +0,0 @@ -% This Source Code Form is subject to the terms of the Mozilla Public -% License, v. 2.0. If a copy of the MPL was not distributed with this -% file, You can obtain one at http://mozilla.org/MPL/2.0/. - -%include ../shared/devedition.inc.css - -:root { - --forwardbutton-width: 29px; -} - -:root[devtoolstheme="dark"], -:root[devtoolstheme="light"] { - /* Matches the #browser-border-start, #browser-border-end color */ - --chrome-nav-bar-separator-color: rgba(10, 31, 51, 0.35); -} - -/* The window background is white due to no accentcolor in the lightweight - theme. It can't be changed to transparent when there is no compositor - (Win XP or 7 in classic / basic theme), or else dragging and focus become - broken. So instead just show the normal titlebar in that case, and override - the window color as transparent when the compositor is available. */ -@media not all and (-moz-windows-compositor) { - #main-window[tabsintitlebar] #titlebar:-moz-lwtheme { - visibility: visible; - } - - #main-window { - background: var(--chrome-background-color) !important; - } -} - -@media (-moz-windows-compositor) { - #main-window { - background: transparent !important; - } -} - -#TabsToolbar::after { - display: none; -} - -#back-button > .toolbarbutton-icon, -#forward-button > .toolbarbutton-icon { - background: var(--chrome-nav-buttons-background) !important; - border-radius: 0 !important; - height: auto !important; - padding: var(--toolbarbutton-vertical-inner-padding) 5px !important; - margin: 0 !important; - border: 1px solid var(--chrome-nav-bar-controls-border-color) !important; - box-shadow: none !important; -} - -#back-button > .toolbarbutton-icon { - /* 18px icon + 2 * 5px padding + 2 * 1px border */ - width: 30px !important; -} - -#forward-button > .toolbarbutton-icon { - /* 18px icon + 2 * 5px padding + 1 * 1px border */ - width: 29px !important; -} - -/* the normal theme adds box-shadow: !important when the back-button is [open]. Fix: */ -#back-button[open="true"] > .toolbarbutton-icon { - box-shadow: none !important; -} - -#forward-button > .toolbarbutton-icon { - border-inline-start: none !important; -} - -/* Override a box shadow for disabled back button */ -#main-window:not([customizing]) #back-button[disabled] > .toolbarbutton-icon { - box-shadow: none !important; -} - -/* Override !important properties for hovered back button */ -#main-window #back-button:hover:not([disabled="true"]) > .toolbarbutton-icon, -#main-window #forward-button:hover:not([disabled="true"]) > .toolbarbutton-icon { - background: var(--chrome-nav-buttons-hover-background) !important; - box-shadow: none !important; -} - -#back-button > .toolbarbutton-icon { - border-radius: 2px 0 0 2px !important; -} - -#nav-bar .toolbarbutton-1:not([type=menu-button]), -#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button, -#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker { - padding-top: 2px; - padding-bottom: 2px; -} - -.tabbrowser-tab { - background-color: var(--tab-background-color); -} - -#toolbar-menubar { - text-shadow: none !important; -} - -:root[devtoolstheme="dark"] .findbar-closebutton, -:root[devtoolstheme="dark"] #sidebar-header > .close-icon, -/* Tab styling - make sure to use an inverted icon for the selected tab - (brighttext only covers the unselected tabs) */ -.tab-close-button[selected=true] { - list-style-image: url("chrome://global/skin/icons/close-inverted.png"); -} - -@media (min-resolution: 1.1dppx) { - :root[devtoolstheme="dark"] .findbar-closebutton, - :root[devtoolstheme="dark"] #sidebar-header > .close-icon, - .tab-close-button[selected=true] { - list-style-image: url("chrome://global/skin/icons/close-inverted@2x.png"); - } -} - -@media (-moz-os-version: windows-xp), - (-moz-os-version: windows-vista), - (-moz-os-version: windows-win7), - (-moz-os-version: windows-win8) { - :root { - --space-above-tabbar: 15px; - } - - /* It'd be nice if there was an element in the scrollbox's inner content - that collapsed to the current width of the tabs. Since there isn't we - need to handle overflowing and non-overflowing tabs separately. - - In the case of overflowing tabs, set a border-top on the entire container, - otherwise we need to set it on each element individually */ - #main-window[sizemode=normal] .tabbrowser-tabs[overflow="true"] { - background-clip: padding-box; - border-top: 1px solid var(--chrome-nav-bar-separator-color); - border-inline-end: 1px solid var(--chrome-nav-bar-separator-color); - background-color: var(--tab-background-color); /* Make sure there is no transparent gap during tab close animation */ - } - - /* Add a border to the left of the first tab (or scroll arrow). Using .tabbrowser-tabs - instead of #TabsToolbar because it will work even in customize mode. */ - #main-window[sizemode=normal] .tabbrowser-tabs { - background-clip: padding-box; - border-inline-start: 1px solid var(--chrome-nav-bar-separator-color); - border-inline-end: 1px solid transparent; - } - - #main-window[sizemode=normal] .tabbrowser-tabs:not([overflow="true"]) .tabbrowser-tab, - #main-window[sizemode=normal] .tabbrowser-tabs:not([overflow="true"]) .tabbrowser-arrowscrollbox > .scrollbutton-down, - #main-window[sizemode=normal] .tabbrowser-tabs:not([overflow="true"]) .tabbrowser-arrowscrollbox > .scrollbutton-up, - #main-window[sizemode=normal] .tabbrowser-tabs:not([overflow="true"]) .tabs-newtab-button { - background-clip: padding-box; - border-top: 1px solid var(--chrome-nav-bar-separator-color); - } - - /* Allow the border-top rule to take effect */ - #main-window[sizemode=normal] .tabbrowser-tabs:not([overflow="true"]) .tabbrowser-tab { - -moz-border-top-colors: none; - } - - #main-window[sizemode=normal] .tabbrowser-tabs:not([overflow="true"]) .closing-tabs-spacer { - background-clip: padding-box; - border-inline-start: 1px solid var(--chrome-nav-bar-separator-color); - } - - .tabs-newtab-button { - background: var(--tab-background-color); - } - - /* Use default window colors when in non-maximized mode */ - #tabbrowser-tabs, - #TabsToolbar, - #browser-panel, - #titlebar-content { - background: transparent; - } - - /* Ensure that the entire background is styled when maximized/fullscreen */ - #main-window:not([sizemode="normal"]):not([customizing]) #browser-panel { - background: var(--chrome-background-color) !important; - } - - /* The menu items need to be visible when the entire background is styled */ - #main-window:not([sizemode="normal"]) #main-menubar { - color: var(--chrome-color); - background-color: transparent; - } - - #main-window[sizemode="maximized"] #main-menubar > menu:not(:-moz-window-inactive) { - color: inherit; - } - - /* Use proper menu text styling in Win7 classic mode (copied from browser.css) */ - @media not all and (-moz-windows-compositor), - not all and (-moz-windows-default-theme) { - :root[tabsintitlebar]:not([inFullscreen]) { - --titlebar-text-color: CaptionText; - } - - :root[tabsintitlebar]:not([inFullscreen]):-moz-window-inactive { - --titlebar-text-color: InactiveCaptionText; - } - - #main-window[tabsintitlebar] #main-menubar > menu { - color: inherit; - } - } - - /* Use less opacity than normal since this is very dark, and on top of the default toolbar color */ - .tabbrowser-arrowscrollbox > .scrollbutton-up[disabled], - .tabbrowser-arrowscrollbox > .scrollbutton-down[disabled] { - opacity: .6; - } - - /* Override scrollbutton gradients in normal and hover state */ - .tabbrowser-arrowscrollbox > .scrollbutton-down, - .tabbrowser-arrowscrollbox > .scrollbutton-up { - background-image: none !important; - transition: none; /* scrollbutton-down has an unwanted transition on background color */ - } - - /* Restore draggable space on the sides of tabs when maximized */ - #main-window[sizemode="maximized"] .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox { - padding-left: 15px; - padding-right: 15px; - } - - /* Override the padding that's intended to compensate for tabs that can overlap border-radius on nav-bar in default theme. */ - #main-window[sizemode=normal]:not([customizing]) #TabsToolbar { - padding-left: 0; - padding-right: 0; - } -} - -/* Restored windows get an artificial border on windows, because the lwtheme background - * overlaps the regular window border. That isn't the case for us, so we avoid painting - * over the native border with our custom borders: */ -#browser-panel { - /* These are !important to avoid specificity-wars with the selectors that add borders here. */ - background-image: none !important; - border-top: none !important; -} - -#navigator-toolbox { - /* The side borders on the toolbox also look out-of-place because we don't paint over - * the native background color at all, and these are !important for the same reason as above. */ - border-left: none !important; - border-right: none !important; -} - -/* Disable dragging like in the default theme: */ -#main-window[tabsintitlebar] #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):-moz-lwtheme { - -moz-window-dragging: no-drag; -} - -/* The sidebar header has no background now that the background of the #browser-panel - * has no image and is transparent. Fix: */ -.sidebar-header:-moz-lwtheme, -#sidebar-header { - background-color: var(--chrome-background-color); - color: var(--chrome-color); -} - -@media (-moz-os-version: windows-vista), - (-moz-os-version: windows-win7), - (-moz-os-version: windows-win8) { - /* And then we add them back on toolbars so that they don't look borderless: */ - #main-window:not([customizing])[sizemode=normal] #navigator-toolbox::after, - #main-window:not([customizing])[sizemode=normal] #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar) { - border-left: 1px solid hsla(209,67%,12%,0.35); - border-right: 1px solid hsla(209,67%,12%,0.35); - } -} - -@media (-moz-os-version: windows-win10) { - /* Always keep draggable space on the sides of tabs since there is no top margin on Win10 */ - #main-window .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox { - padding-left: 15px; - padding-right: 15px; - } - - /* Force white caption buttons for the dark theme on Windows 10 */ - :root[devtoolstheme="dark"] #titlebar-min { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#minimize-white); - } - :root[devtoolstheme="dark"] #titlebar-max { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#maximize-white); - } - #main-window[devtoolstheme="dark"][sizemode="maximized"] #titlebar-max { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#restore-white); - } - :root[devtoolstheme="dark"] #titlebar-close { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#close-white); - } - - /* ... and normal ones for the light theme on Windows 10 */ - :root[devtoolstheme="light"] #titlebar-min { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#minimize); - } - :root[devtoolstheme="light"] #titlebar-max { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#maximize); - } - #main-window[devtoolstheme="light"][sizemode="maximized"] #titlebar-max { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#restore); - } - :root[devtoolstheme="light"] #titlebar-close { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#close); - } - - :root[devtoolstheme="light"] #titlebar-close:hover { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#close-white); - } -} - -.ac-type-icon { - /* Left-align the type icon in awesomebar popup results with the icon in the - urlbar. */ - margin-inline-start: 13px; -} diff --git a/application/basilisk/themes/windows/jar.mn b/application/basilisk/themes/windows/jar.mn index 6aeaadb89b..c25d0c9930 100644 --- a/application/basilisk/themes/windows/jar.mn +++ b/application/basilisk/themes/windows/jar.mn @@ -14,7 +14,6 @@ browser.jar: skin/classic/browser/actionicon-tab@2x.png skin/classic/browser/actionicon-tab-XPVista7.png * skin/classic/browser/browser.css -* skin/classic/browser/devedition.css * skin/classic/browser/browser-lightweightTheme.css skin/classic/browser/caption-buttons.svg skin/classic/browser/click-to-play-warning-stripes.png From c0204d7955103fcfbdb23df5dd90cc978b0bc6a6 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 15 Aug 2019 09:52:38 +0200 Subject: [PATCH 19/23] Issue #1208: Fix jsonLoad in Sync's `util.js` to handle errors. - `OS.Path.join` can throw, so we always need to try/catch it. - Also do a sanity check to make sure `callback` is defined before use --- services/sync/modules/util.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/services/sync/modules/util.js b/services/sync/modules/util.js index 7fd5a79716..73f4d8a801 100644 --- a/services/sync/modules/util.js +++ b/services/sync/modules/util.js @@ -321,10 +321,17 @@ this.Utils = { * could not be loaded, the first argument will be undefined. */ jsonLoad: Task.async(function*(filePath, that, callback) { - let path = OS.Path.join(OS.Constants.Path.profileDir, "weave", filePath + ".json"); + let path; + try { + path = OS.Path.normalize(OS.Path.join(OS.Constants.Path.profileDir, "weave", filePath + ".json")); + } catch (e) { + if (that._log) { + that._log.debug("Path join error: " + e); + } + } if (that._log) { - that._log.trace("Loading json from disk: " + filePath); + that._log.trace("Loading json from disk: " + path); } let json; @@ -341,8 +348,9 @@ this.Utils = { } } } - - callback.call(that, json); + if (callback) { + callback.call(that, json); + } }), /** From efd576e045038242d4fb9640ce644ebfc13e6afe Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 15 Aug 2019 09:58:13 +0200 Subject: [PATCH 20/23] Issue #1208: Remove `services.sync.enabled` pref. Sync will not do anything unless specifically set up to do so and at least one engine is enabled, so there's no need for this "master switch" to force it disabled based on engines being disabled (which was its previous function to shortcut syncing in that situation). --- services/sync/modules/service.js | 21 ++----------------- services/sync/services-sync.js | 4 ---- .../sync/tests/unit/test_service_login.js | 2 +- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/services/sync/modules/service.js b/services/sync/modules/service.js index 15884aca00..804eb20cdd 100644 --- a/services/sync/modules/service.js +++ b/services/sync/modules/service.js @@ -296,21 +296,6 @@ Sync11Service.prototype = { return false; }, - // The global "enabled" state comes from prefs, and will be set to false - // whenever the UI that exposes what to sync finds all Sync engines disabled. - get enabled() { - return Svc.Prefs.get("enabled"); - }, - set enabled(val) { - // There's no real reason to impose this other than to catch someone doing - // something we don't expect with bad consequences - all setting of this - // pref are in the UI code and external to this module. - if (val) { - throw new Error("Only disabling via this setter is supported"); - } - Svc.Prefs.set("enabled", val); - }, - /** * Prepare to initialize the rest of Weave after waiting a little bit */ @@ -340,6 +325,8 @@ Sync11Service.prototype = { this._clusterManager = this.identity.createClusterManager(this); this.recordManager = new RecordManager(this); + this.enabled = true; + this._registerEngines(); let ua = Cc["@mozilla.org/network/protocol;1?name=http"]. @@ -1236,10 +1223,6 @@ Sync11Service.prototype = { }, sync: function sync() { - if (!this.enabled) { - this._log.debug("Not syncing as Sync is disabled."); - return; - } let dateStr = new Date().toLocaleFormat(LOG_DATE_FORMAT); this._log.debug("User-Agent: " + SyncStorageRequest.prototype.userAgent); this._log.info("Starting sync at " + dateStr); diff --git a/services/sync/services-sync.js b/services/sync/services-sync.js index 640fb4abc5..dfce84767f 100644 --- a/services/sync/services-sync.js +++ b/services/sync/services-sync.js @@ -24,10 +24,6 @@ pref("services.sync.scheduler.sync11.singleDeviceInterval", 86400); // 1 day pref("services.sync.errorhandler.networkFailureReportTimeout", 1209600); // 2 weeks -// A "master" pref for Sync being enabled. Will be set to false if the sync -// customization UI finds all our builtin engines disabled (and addons are -// free to force this to true if they have their own engine) -pref("services.sync.enabled", true); // Our engines. pref("services.sync.engine.addons", false); pref("services.sync.engine.bookmarks", true); diff --git a/services/sync/tests/unit/test_service_login.js b/services/sync/tests/unit/test_service_login.js index 52ee5e63ab..2ecb0a377b 100644 --- a/services/sync/tests/unit/test_service_login.js +++ b/services/sync/tests/unit/test_service_login.js @@ -183,7 +183,7 @@ add_test(function test_login_on_sync() { // This test exercises these two branches. _("We're ready to sync if locked."); - Svc.Prefs.set("enabled", true); + Service.enabled = true; Services.io.offline = false; Service.scheduler.checkSyncStatus(); do_check_true(scheduleCalled); From f8432bc275edd0e6e5728867bc560bdbf6a3045d Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 15 Aug 2019 10:40:06 +0200 Subject: [PATCH 21/23] Issue #1208: Update Sync policies.js getters/setters to prevent race. --- services/sync/modules/policies.js | 70 ++++++++++++++++++++++++------- 1 file changed, 55 insertions(+), 15 deletions(-) diff --git a/services/sync/modules/policies.js b/services/sync/modules/policies.js index 2d85b1428c..48acbe2e64 100644 --- a/services/sync/modules/policies.js +++ b/services/sync/modules/policies.js @@ -60,20 +60,60 @@ SyncScheduler.prototype = { }, // nextSync is in milliseconds, but prefs can't hold that much - get nextSync() Svc.Prefs.get("nextSync", 0) * 1000, - set nextSync(value) Svc.Prefs.set("nextSync", Math.floor(value / 1000)), + get nextSync() { + if (Svc.Prefs) { + return Svc.Prefs.get("nextSync", 0) * 1000 + } + }, + set nextSync(value) { + if (Svc.Prefs) { + Svc.Prefs.set("nextSync", Math.floor(value / 1000)) + } + }, - get syncInterval() Svc.Prefs.get("syncInterval", this.singleDeviceInterval), - set syncInterval(value) Svc.Prefs.set("syncInterval", value), + get syncInterval() { + if (Svc.Prefs) { + return Svc.Prefs.get("syncInterval", this.singleDeviceInterval) + } + }, + set syncInterval(value) { + if (Svc.Prefs) { + Svc.Prefs.set("syncInterval", value) + } + }, - get syncThreshold() Svc.Prefs.get("syncThreshold", SINGLE_USER_THRESHOLD), - set syncThreshold(value) Svc.Prefs.set("syncThreshold", value), + get syncThreshold() { + if (Svc.Prefs) { + return Svc.Prefs.get("syncThreshold", SINGLE_USER_THRESHOLD) + } + }, + set syncThreshold(value) { + if (Svc.Prefs) { + Svc.Prefs.set("syncThreshold", value) + } + }, - get globalScore() Svc.Prefs.get("globalScore", 0), - set globalScore(value) Svc.Prefs.set("globalScore", value), + get globalScore() { + if (Svc.Prefs) { + return Svc.Prefs.get("globalScore", 0) + } + }, + set globalScore(value) { + if (Svc.Prefs) { + Svc.Prefs.set("globalScore", value) + } + }, - get numClients() Svc.Prefs.get("numClients", 0), - set numClients(value) Svc.Prefs.set("numClients", value), + get numClients() { + if (Svc.Prefs) { + return Svc.Prefs.get("numClients", 0) + } + }, + set numClients(value) { + if (Svc.Prefs) { + Svc.Prefs.set("numClients", value) + } + }, init: function init() { this._log.level = Log.Level[Svc.Prefs.get("log.logger.service.main")]; @@ -523,7 +563,7 @@ SyncScheduler.prototype = { }, get isBlocked() { - let until = Svc.Prefs.get("scheduler.blocked-until"); + let until = Svc.Prefs ? Svc.Prefs.get("scheduler.blocked-until") : undefined; if (until === undefined) { return false; } @@ -770,19 +810,19 @@ ErrorHandler.prototype = { }, get currentAlertMode() { - return Svc.Prefs.get("errorhandler.alert.mode"); + return Svc.Prefs ? Svc.Prefs.get("errorhandler.alert.mode") : undefined; }, set currentAlertMode(str) { - return Svc.Prefs.set("errorhandler.alert.mode", str); + return Svc.Prefs ? Svc.Prefs.set("errorhandler.alert.mode", str) : undefined; }, get earliestNextAlert() { - return Svc.Prefs.get("errorhandler.alert.earliestNext", 0) * 1000; + return Svc.Prefs ? Svc.Prefs.get("errorhandler.alert.earliestNext", 0) * 1000 : undefined; }, set earliestNextAlert(msec) { - return Svc.Prefs.set("errorhandler.alert.earliestNext", msec / 1000); + return Svc.Prefs ? Svc.Prefs.set("errorhandler.alert.earliestNext", msec / 1000) : undefined; }, clearServerAlerts: function () { From 4d854945cd26763b5386c595eccf4524bc3a1ec4 Mon Sep 17 00:00:00 2001 From: Ascrod <32915892+Ascrod@users.noreply.github.com> Date: Sat, 10 Aug 2019 17:26:31 -0400 Subject: [PATCH 22/23] Issue #999 - Use xdg-desktop-portal for file selection dialogs on Linux. --- widget/gtk/nsFilePicker.cpp | 129 ++++++++++++++++++++++++++---------- widget/gtk/nsFilePicker.h | 17 +++-- 2 files changed, 108 insertions(+), 38 deletions(-) diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp index 172cb44448..a2d2e1cff4 100644 --- a/widget/gtk/nsFilePicker.cpp +++ b/widget/gtk/nsFilePicker.cpp @@ -197,7 +197,7 @@ ReadMultipleFiles(gpointer filename, gpointer array) } void -nsFilePicker::ReadValuesFromFileChooser(GtkWidget *file_chooser) +nsFilePicker::ReadValuesFromFileChooser(void *file_chooser) { mFiles.Clear(); @@ -389,19 +389,10 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) if (!mOkButtonLabel.IsEmpty()) { accept_button = buttonLabel.get(); } else { - accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE) ? - GTK_STOCK_SAVE : GTK_STOCK_OPEN; + accept_button = nullptr; } - GtkWidget *file_chooser = - gtk_file_chooser_dialog_new(title, parent_widget, action, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - accept_button, GTK_RESPONSE_ACCEPT, - nullptr); - gtk_dialog_set_alternative_button_order(GTK_DIALOG(file_chooser), - GTK_RESPONSE_ACCEPT, - GTK_RESPONSE_CANCEL, - -1); + void *file_chooser = GtkFileChooserNew(title.get(), parent_widget, action, accept_button); if (mAllowURLs) { gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), FALSE); } @@ -412,11 +403,7 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) g_signal_connect(file_chooser, "update-preview", G_CALLBACK(UpdateFilePreviewWidget), img_preview); } - GtkWindow *window = GTK_WINDOW(file_chooser); - gtk_window_set_modal(window, TRUE); - if (parent_widget) { - gtk_window_set_destroy_with_parent(window, TRUE); - } + GtkFileChooserSetModal(file_chooser, parent_widget, TRUE); NS_ConvertUTF16toUTF8 defaultName(mDefault); switch (mMode) { @@ -454,18 +441,21 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) // Otherwise, if our dialog gets destroyed, we'll lose the dialog's // delegate by the time this gets processed in the event loop. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1166741 - GtkDialog *dialog = GTK_DIALOG(file_chooser); - GtkContainer *area = GTK_CONTAINER(gtk_dialog_get_content_area(dialog)); - gtk_container_forall(area, [](GtkWidget *widget, - gpointer data) { - if (GTK_IS_FILE_CHOOSER_WIDGET(widget)) { - auto result = static_cast(data); - *result = GTK_FILE_CHOOSER_WIDGET(widget); - } - }, &mFileChooserDelegate); + if (GTK_IS_DIALOG(file_chooser)) { + GtkDialog *dialog = GTK_DIALOG(file_chooser); + GtkContainer *area = GTK_CONTAINER(gtk_dialog_get_content_area(dialog)); + gtk_container_forall(area, [](GtkWidget *widget, + gpointer data) { + if (GTK_IS_FILE_CHOOSER_WIDGET(widget)) { + auto result = static_cast(data); + *result = GTK_FILE_CHOOSER_WIDGET(widget); + } + }, &mFileChooserDelegate); - if (mFileChooserDelegate) - g_object_ref(mFileChooserDelegate); + if (mFileChooserDelegate) { + g_object_ref(mFileChooserDelegate); + } + } #endif gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(file_chooser), @@ -473,7 +463,9 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) } } - gtk_dialog_set_default_response(GTK_DIALOG(file_chooser), GTK_RESPONSE_ACCEPT); + if (GTK_IS_DIALOG(file_chooser)) { + gtk_dialog_set_default_response(GTK_DIALOG(file_chooser), GTK_RESPONSE_ACCEPT); + } int32_t count = mFilters.Length(); for (int32_t i = 0; i < count; ++i) { @@ -517,14 +509,13 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) mCallback = aCallback; NS_ADDREF_THIS(); g_signal_connect(file_chooser, "response", G_CALLBACK(OnResponse), this); - g_signal_connect(file_chooser, "destroy", G_CALLBACK(OnDestroy), this); - gtk_widget_show(file_chooser); + GtkFileChooserShow(file_chooser); return NS_OK; } /* static */ void -nsFilePicker::OnResponse(GtkWidget* file_chooser, gint response_id, +nsFilePicker::OnResponse(void* file_chooser, gint response_id, gpointer user_data) { static_cast(user_data)-> @@ -539,7 +530,7 @@ nsFilePicker::OnDestroy(GtkWidget* file_chooser, gpointer user_data) } void -nsFilePicker::Done(GtkWidget* file_chooser, gint response) +nsFilePicker::Done(void* file_chooser, gint response) { mRunning = false; @@ -583,7 +574,7 @@ nsFilePicker::Done(GtkWidget* file_chooser, gint response) // requests that any remaining references be released, but the reference // count will not be decremented again if GtkWindow's reference has already // been released. - gtk_widget_destroy(file_chooser); + GtkFileChooserDestroy(file_chooser); #if (MOZ_WIDGET_GTK == 3) if (mFileChooserDelegate) { @@ -608,3 +599,73 @@ nsFilePicker::Done(GtkWidget* file_chooser, gint response) } NS_RELEASE_THIS(); } + +// All below functions available as of GTK 3.20+ + +void * +nsFilePicker::GtkFileChooserNew( + const gchar *title, GtkWindow *parent, + GtkFileChooserAction action, + const gchar *accept_label) +{ + static auto sGtkFileChooserNativeNewPtr = (void * (*)( + const gchar *, GtkWindow *, + GtkFileChooserAction, + const gchar *, const gchar *)) + dlsym(RTLD_DEFAULT, "gtk_file_chooser_native_new"); + if (sGtkFileChooserNativeNewPtr != nullptr) { + return (*sGtkFileChooserNativeNewPtr)(title, parent, action, accept_label, nullptr); + } + if (accept_label == nullptr) { + accept_label = (action == GTK_FILE_CHOOSER_ACTION_SAVE) + ? GTK_STOCK_SAVE : GTK_STOCK_OPEN; + } + GtkWidget *file_chooser = gtk_file_chooser_dialog_new(title, parent, action, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + accept_label, GTK_RESPONSE_ACCEPT, nullptr); + gtk_dialog_set_alternative_button_order(GTK_DIALOG(file_chooser), + GTK_RESPONSE_ACCEPT, GTK_RESPONSE_CANCEL, -1); + return file_chooser; +} + +void +nsFilePicker::GtkFileChooserShow(void *file_chooser) +{ + static auto sGtkNativeDialogShowPtr = (void (*)(void *)) + dlsym(RTLD_DEFAULT, "gtk_native_dialog_show"); + if (sGtkNativeDialogShowPtr != nullptr) { + (*sGtkNativeDialogShowPtr)(file_chooser); + } else { + g_signal_connect(file_chooser, "destroy", G_CALLBACK(OnDestroy), this); + gtk_widget_show(GTK_WIDGET(file_chooser)); + } +} + +void +nsFilePicker::GtkFileChooserDestroy(void *file_chooser) +{ + static auto sGtkNativeDialogDestroyPtr = (void (*)(void *)) + dlsym(RTLD_DEFAULT, "gtk_native_dialog_destroy"); + if (sGtkNativeDialogDestroyPtr != nullptr) { + (*sGtkNativeDialogDestroyPtr)(file_chooser); + } else { + gtk_widget_destroy(GTK_WIDGET(file_chooser)); + } +} + +void +nsFilePicker::GtkFileChooserSetModal(void *file_chooser, + GtkWindow *parent_widget, gboolean modal) +{ + static auto sGtkNativeDialogSetModalPtr = (void (*)(void *, gboolean)) + dlsym(RTLD_DEFAULT, "gtk_native_dialog_set_modal"); + if (sGtkNativeDialogSetModalPtr != nullptr) { + (*sGtkNativeDialogSetModalPtr)(file_chooser, modal); + } else { + GtkWindow *window = GTK_WINDOW(file_chooser); + gtk_window_set_modal(window, modal); + if (parent_widget != nullptr) { + gtk_window_set_destroy_with_parent(window, modal); + } + } +} diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h index 2b5042098c..f462ca3245 100644 --- a/widget/gtk/nsFilePicker.h +++ b/widget/gtk/nsFilePicker.h @@ -48,12 +48,12 @@ public: protected: virtual ~nsFilePicker(); - void ReadValuesFromFileChooser(GtkWidget *file_chooser); + void ReadValuesFromFileChooser(void *file_chooser); - static void OnResponse(GtkWidget* dialog, gint response_id, + static void OnResponse(void* dialog, gint response_id, gpointer user_data); - static void OnDestroy(GtkWidget* dialog, gpointer user_data); - void Done(GtkWidget* dialog, gint response_id); + static void OnDestroy(GtkWidget* file_chooser, gpointer user_data); + void Done(void* file_chooser, gint response_id); nsCOMPtr mParentWidget; nsCOMPtr mCallback; @@ -74,6 +74,15 @@ protected: private: static nsIFile *mPrevDisplayDirectory; + void *GtkFileChooserNew( + const gchar *title, GtkWindow *parent, + GtkFileChooserAction action, + const gchar *accept_label); + void GtkFileChooserShow(void *file_chooser); + void GtkFileChooserDestroy(void *file_chooser); + void GtkFileChooserSetModal(void *file_chooser, GtkWindow* parent_widget, + gboolean modal); + #if (MOZ_WIDGET_GTK == 3) GtkFileChooserWidget *mFileChooserDelegate; #endif From 53bfc43dbe11df66db0aeec541dc79e7f1f3350f Mon Sep 17 00:00:00 2001 From: Ascrod <32915892+Ascrod@users.noreply.github.com> Date: Thu, 15 Aug 2019 06:03:42 -0400 Subject: [PATCH 23/23] Issue #999 - Disable native file picker by default. --- modules/libpref/init/all.js | 6 ++++++ widget/gtk/nsFilePicker.cpp | 10 ++++++---- widget/gtk/nsFilePicker.h | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index a55b3e5569..bd7df5d051 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -4020,6 +4020,12 @@ pref("autocomplete.ungrab_during_mode_switch", true); // toggling to use the XUL filepicker pref("ui.allow_platform_file_picker", true); +// Allow for using the native GTK file picker. If the application is not run +// with GTK_USE_PORTAL=1 this pref has no effect. +#ifdef MOZ_WIDGET_GTK +pref("widget.allow-gtk-native-file-chooser", false); +#endif + pref("helpers.global_mime_types_file", "/etc/mime.types"); pref("helpers.global_mailcap_file", "/etc/mailcap"); pref("helpers.private_mime_types_file", "~/.mime.types"); diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp index a2d2e1cff4..05d8bb0f0b 100644 --- a/widget/gtk/nsFilePicker.cpp +++ b/widget/gtk/nsFilePicker.cpp @@ -23,6 +23,7 @@ #include "nsNetUtil.h" #include "nsReadableUtils.h" #include "mozcontainer.h" +#include "mozilla/Preferences.h" #include "nsFilePicker.h" @@ -175,6 +176,7 @@ nsFilePicker::nsFilePicker() , mFileChooserDelegate(nullptr) #endif { + mUseNativeFileChooser = Preferences::GetBool("widget.allow-gtk-native-file-chooser", false); } nsFilePicker::~nsFilePicker() @@ -613,7 +615,7 @@ nsFilePicker::GtkFileChooserNew( GtkFileChooserAction, const gchar *, const gchar *)) dlsym(RTLD_DEFAULT, "gtk_file_chooser_native_new"); - if (sGtkFileChooserNativeNewPtr != nullptr) { + if (mUseNativeFileChooser && sGtkFileChooserNativeNewPtr != nullptr) { return (*sGtkFileChooserNativeNewPtr)(title, parent, action, accept_label, nullptr); } if (accept_label == nullptr) { @@ -633,7 +635,7 @@ nsFilePicker::GtkFileChooserShow(void *file_chooser) { static auto sGtkNativeDialogShowPtr = (void (*)(void *)) dlsym(RTLD_DEFAULT, "gtk_native_dialog_show"); - if (sGtkNativeDialogShowPtr != nullptr) { + if (mUseNativeFileChooser && sGtkNativeDialogShowPtr != nullptr) { (*sGtkNativeDialogShowPtr)(file_chooser); } else { g_signal_connect(file_chooser, "destroy", G_CALLBACK(OnDestroy), this); @@ -646,7 +648,7 @@ nsFilePicker::GtkFileChooserDestroy(void *file_chooser) { static auto sGtkNativeDialogDestroyPtr = (void (*)(void *)) dlsym(RTLD_DEFAULT, "gtk_native_dialog_destroy"); - if (sGtkNativeDialogDestroyPtr != nullptr) { + if (mUseNativeFileChooser && sGtkNativeDialogDestroyPtr != nullptr) { (*sGtkNativeDialogDestroyPtr)(file_chooser); } else { gtk_widget_destroy(GTK_WIDGET(file_chooser)); @@ -659,7 +661,7 @@ nsFilePicker::GtkFileChooserSetModal(void *file_chooser, { static auto sGtkNativeDialogSetModalPtr = (void (*)(void *, gboolean)) dlsym(RTLD_DEFAULT, "gtk_native_dialog_set_modal"); - if (sGtkNativeDialogSetModalPtr != nullptr) { + if (mUseNativeFileChooser && sGtkNativeDialogSetModalPtr != nullptr) { (*sGtkNativeDialogSetModalPtr)(file_chooser, modal); } else { GtkWindow *window = GTK_WINDOW(file_chooser); diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h index f462ca3245..e0a1d541dd 100644 --- a/widget/gtk/nsFilePicker.h +++ b/widget/gtk/nsFilePicker.h @@ -86,6 +86,7 @@ private: #if (MOZ_WIDGET_GTK == 3) GtkFileChooserWidget *mFileChooserDelegate; #endif + bool mUseNativeFileChooser; }; #endif