Index: branches/2018Q1/www/waterfox/Makefile =================================================================== --- branches/2018Q1/www/waterfox/Makefile (revision 461026) +++ branches/2018Q1/www/waterfox/Makefile (revision 461027) @@ -1,73 +1,74 @@ # $FreeBSD$ PORTNAME= waterfox DISTVERSION= 56.0.4 +PORTREVISION= 1 CATEGORIES= www ipv6 MAINTAINER= jbeich@FreeBSD.org COMMENT= Distilled fork of Firefox DEPRECATED= Temporary experiment EXPIRATION_DATE=2018-03-20 BUILD_DEPENDS= nspr>=4.16:devel/nspr \ nss>=3.32.1:security/nss \ icu>=59.1,1:devel/icu \ libevent>=2.1.8:devel/libevent \ harfbuzz>=1.4.7:print/harfbuzz \ graphite2>=1.3.10:graphics/graphite2 \ png>=1.6.31:graphics/png \ libvorbis>=1.3.5,3:audio/libvorbis \ libvpx>=1.5.0:multimedia/libvpx \ sqlite3>=3.19.3:databases/sqlite3 \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ v4l_compat>0:multimedia/v4l_compat \ autoconf-2.13:devel/autoconf213 \ yasm:devel/yasm \ zip:archivers/zip # soundtouch>=1.9.0:audio/soundtouch \ LIB_DEPENDS= libv4l2.so:multimedia/libv4l USE_GITHUB= yes GH_ACCOUNT= MrAlex94 GH_PROJECT= Waterfox USE_GECKO= gecko MOZ_PKGCONFIG_FILES= # empty USE_MOZILLA= -soundtouch MOZILLA_NAME= Waterfox USE_GL= gl WATERFOX_ICON= ${MOZILLA}.png WATERFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default256.png WATERFOX_DESKTOP= ${MOZSRC}/taskcluster/docker/firefox-snap/firefox.desktop MOZ_OPTIONS= --enable-application=browser \ --with-app-name=${MOZILLA} \ --with-app-basename=${MOZILLA_NAME} \ --with-distribution-id=org.${MOZILLA}project OPTIONS_DEFAULT= BUNDLED_CAIRO .include "${.CURDIR}/../../www/firefox/Makefile.options" post-patch: @${REINPLACE_CMD} -e 's/%u/%U/' -e '/X-MultipleArgs/d' \ -e 's/firefox/${MOZILLA}/' \ -e 's/Firefox/${MOZILLA_NAME}/' \ ${WATERFOX_DESKTOP} @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/browser/app/nsBrowserApp.cpp pre-configure: (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${WRKSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13) post-install: ${INSTALL_DATA} ${WATERFOX_DESKTOP} \ ${STAGEDIR}${PREFIX}/share/applications/${MOZILLA}.desktop ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps ${LN} -sf ${WATERFOX_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${WATERFOX_ICON} .include Index: branches/2018Q1/www/waterfox/files/patch-bug1356854 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1356854 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1356854 (revision 461027) @@ -0,0 +1,28 @@ +commit 6435e5f65538 +Author: Thomas Nguyen +Date: Thu Sep 21 16:39:36 2017 +0800 + + Bug 1356854 - Check mFD is not null before PR_Write. r=mcmanus, a=ritu + + MozReview-Commit-ID: INoTUvPpPrs + + --HG-- + extra : source : 638f326530b719ce386bb5d1701fed4ae4604690 +--- + netwerk/base/nsFileStreams.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git netwerk/base/nsFileStreams.cpp netwerk/base/nsFileStreams.cpp +index ac259c1c7e94..6be501456656 100644 +--- netwerk/base/nsFileStreams.cpp ++++ netwerk/base/nsFileStreams.cpp +@@ -378,6 +378,9 @@ nsFileStreamBase::DoPendingOpen() + + case eOpened: + MOZ_ASSERT(mFD); ++ if (NS_WARN_IF(!mFD)) { ++ return NS_ERROR_FAILURE; ++ } + return NS_OK; + + case eClosed: Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1356854 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1357523 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1357523 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1357523 (revision 461027) @@ -0,0 +1,96 @@ +commit ad103dfd3abe +Author: Prathiksha +Date: Fri Sep 15 22:08:12 2017 +0530 + + Bug 1357523 - Make about:home and about:newtab search box search for the value in the search textbox when we use non-default search engines. r=nhnt11, a=ritu + + MozReview-Commit-ID: CdgqghkmXau + + --HG-- + extra : source : e029590936c56ac269d68610ab389ab25887b6e1 +--- + browser/base/content/contentSearchUI.js | 2 ++ + .../test/general/browser_contentSearchUI.js | 30 +++++----------------- + 2 files changed, 9 insertions(+), 23 deletions(-) + +diff --git browser/base/content/contentSearchUI.js browser/base/content/contentSearchUI.js +index bacb985fb6ee..ffada60c3571 100644 +--- browser/base/content/contentSearchUI.js ++++ browser/base/content/contentSearchUI.js +@@ -478,6 +478,8 @@ ContentSearchUIController.prototype = { + _onMousemove(event) { + let idx = this._indexOfTableItem(event.target); + if (idx >= this.numSuggestions) { ++ // Deselect any search suggestion that has been selected. ++ this.selectedIndex = -1; + this.selectedButtonIndex = idx - this.numSuggestions; + return; + } +diff --git browser/base/content/test/general/browser_contentSearchUI.js browser/base/content/test/general/browser_contentSearchUI.js +index 51538b29e27f..85b65d40bf0b 100644 +--- browser/base/content/test/general/browser_contentSearchUI.js ++++ browser/base/content/test/general/browser_contentSearchUI.js +@@ -300,13 +300,13 @@ add_task(async function mouse() { + checkState(state, "x", ["xfoo", "xbar"], 1); + + state = await msg("mousemove", 2); +- checkState(state, "x", ["xfoo", "xbar"], 1, 0); ++ checkState(state, "x", ["xfoo", "xbar"], 2, 0); + + state = await msg("mousemove", 3); +- checkState(state, "x", ["xfoo", "xbar"], 1, 1); ++ checkState(state, "x", ["xfoo", "xbar"], 3, 1); + + state = await msg("mousemove", -1); +- checkState(state, "x", ["xfoo", "xbar"], 1); ++ checkState(state, "x", ["xfoo", "xbar"], -1); + + await msg("reset"); + await setUp(); +@@ -318,10 +318,10 @@ add_task(async function mouse() { + checkState(state, "x", ["xfoo", "xbar"], 0); + + state = await msg("mousemove", 2); +- checkState(state, "x", ["xfoo", "xbar"], 0, 0); ++ checkState(state, "x", ["xfoo", "xbar"], 2, 0); + + state = await msg("mousemove", -1); +- checkState(state, "x", ["xfoo", "xbar"], 0); ++ checkState(state, "x", ["xfoo", "xbar"], -1); + + await msg("reset"); + }); +@@ -510,24 +510,7 @@ add_task(async function search() { + await setUp(); + + // Test selecting a suggestion, then clicking a one-off without deselecting the +- // suggestion. +- await msg("key", { key: "x", waitForSuggestions: true }); +- p = msg("waitForSearch"); +- await msg("mousemove", 1); +- await msg("mousemove", 3); +- await msg("click", { eltIdx: 3, modifiers }); +- mesg = await p; +- eventData.searchString = "xfoo" +- eventData.selection = { +- index: 1, +- kind: "mouse", +- }; +- SimpleTest.isDeeply(eventData, mesg, "Search event data"); +- +- await promiseTab(); +- await setUp(); +- +- // Same as above, but with the keyboard. ++ // suggestion, using the keyboard. + delete modifiers.button; + await msg("key", { key: "x", waitForSuggestions: true }); + p = msg("waitForSearch"); +@@ -536,6 +519,7 @@ add_task(async function search() { + await msg("key", "VK_TAB"); + await msg("key", { key: "VK_RETURN", modifiers }); + mesg = await p; ++ eventData.searchString = "xfoo"; + eventData.selection = { + index: 1, + kind: "key", Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1357523 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1373371 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1373371 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1373371 (revision 461027) @@ -0,0 +1,44 @@ +commit 94b1df91cc7f +Author: Eric Rahm +Date: Mon Jun 19 17:09:54 2017 -0700 + + Bug 1373371 - Properly convert index in RemoveElementsAt. r=froydnj, a=ritu + + MozReview-Commit-ID: 2CRrUmOxA9B + + --HG-- + extra : source : 337103b85c025be555c107c7710ebe25d2feb6ed +--- + xpcom/ds/nsTArray.h | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git xpcom/ds/nsTArray.h xpcom/ds/nsTArray.h +index 4e9b57126bfb..e0244846aca3 100644 +--- xpcom/ds/nsTArray.h ++++ xpcom/ds/nsTArray.h +@@ -13,6 +13,7 @@ + #include "mozilla/Assertions.h" + #include "mozilla/Attributes.h" + #include "mozilla/BinarySearch.h" ++#include "mozilla/CheckedInt.h" + #include "mozilla/fallible.h" + #include "mozilla/MathAlgorithms.h" + #include "mozilla/MemoryReporting.h" +@@ -2053,9 +2054,14 @@ void + nsTArray_Impl::RemoveElementsAt(index_type aStart, size_type aCount) + { + MOZ_ASSERT(aCount == 0 || aStart < Length(), "Invalid aStart index"); +- MOZ_ASSERT(aStart + aCount <= Length(), "Invalid length"); +- // Check that the previous assert didn't overflow +- MOZ_ASSERT(aStart <= aStart + aCount, "Start index plus length overflows"); ++ ++ mozilla::CheckedInt rangeEnd = aStart; ++ rangeEnd += aCount; ++ ++ if (MOZ_UNLIKELY(!rangeEnd.isValid() || rangeEnd.value() > Length())) { ++ InvalidArrayIndex_CRASH(aStart, Length()); ++ } ++ + DestructRange(aStart, aCount); + this->template ShiftData(aStart, aCount, 0, + sizeof(elem_type), Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1373371 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1385013 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1385013 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1385013 (revision 461027) @@ -0,0 +1,92 @@ +commit 09e1ad759b21 +Author: Hiroyuki Ikezoe +Date: Wed Oct 18 10:43:22 2017 +0900 + + Bug 1385013 - Check all vertexes for the target frame are outside of the parent frame if the target frame is empty. r=birtles, a=ritu + + We create empty rectangle (zero-height or zero-width) frame for element which + has no content inside it, e.g. '

'. And nsRect.Intersects returns false + if either of the rectangles are empty, so if we check + !transformedRect.Intersects(scrollableRect) and transformedRect is empty, we + will end up returning true from IsFrameScrolledOutOfView even though the point + represented by the empty transformedRect might be inside the + scrollableRect. + + The reftest causes timeout without this fix since the animation never updates + after the initial paint. + + MozReview-Commit-ID: FymFJfjxyGc + + --HG-- + extra : source : 69e2ab081d3d71ef131f0ce878ee7830ae881d08 +--- + layout/generic/nsFrame.cpp | 11 +++++++++- + .../animation-on-empty-height-frame.html | 25 ++++++++++++++++++++++ + layout/reftests/css-animations/reftest.list | 1 + + 3 files changed, 36 insertions(+), 1 deletion(-) + +diff --git layout/generic/nsFrame.cpp layout/generic/nsFrame.cpp +index dbfd61b7e142..991ccbceeb65 100644 +--- layout/generic/nsFrame.cpp ++++ layout/generic/nsFrame.cpp +@@ -10555,7 +10555,16 @@ IsFrameScrolledOutOfView(nsIFrame *aFrame) + scrollableParent); + + nsRect scrollableRect = scrollableParent->GetVisualOverflowRect(); +- if (!transformedRect.Intersects(scrollableRect)) { ++ if (transformedRect.IsEmpty()) { ++ // If the transformed rect is empty it represents a line or a point that we ++ // should check is outside the the scrollable rect. ++ if (transformedRect.x > scrollableRect.XMost() || ++ transformedRect.y > scrollableRect.YMost() || ++ scrollableRect.x > transformedRect.XMost() || ++ scrollableRect.y > transformedRect.YMost()) { ++ return true; ++ } ++ } else if (!transformedRect.Intersects(scrollableRect)) { + return true; + } + +diff --git layout/reftests/css-animations/animation-on-empty-height-frame.html layout/reftests/css-animations/animation-on-empty-height-frame.html +new file mode 100644 +index 000000000000..eb3f58127b16 +--- /dev/null ++++ layout/reftests/css-animations/animation-on-empty-height-frame.html +@@ -0,0 +1,25 @@ ++ ++ ++ ++ ++ ++ ++ +diff --git layout/reftests/css-animations/reftest.list layout/reftests/css-animations/reftest.list +index 61e3e9ea6101..ed615645f707 100644 +--- layout/reftests/css-animations/reftest.list ++++ layout/reftests/css-animations/reftest.list +@@ -4,6 +4,7 @@ skip-if(stylo) fails == print-no-animations.html print-no-animations-ref.html # + skip-if(stylo) fails != print-no-animations.html print-no-animations-notref.html # reftest harness doesn't actually make pres context non-dynamic for reftest-paged tests. Bug 1374154 for stylo + == animate-opacity.html animate-opacity-ref.html + == animate-preserves3d.html animate-preserves3d-ref.html ++== animation-on-empty-height-frame.html about:blank + == in-visibility-hidden-animation.html in-visibility-hidden-animation-ref.html + == in-visibility-hidden-animation-pseudo-element.html in-visibility-hidden-animation-pseudo-element-ref.html + == partially-out-of-view-animation.html partially-out-of-view-animation-ref.html Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1385013 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1387079 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1387079 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1387079 (revision 461027) @@ -0,0 +1,42 @@ +commit 8845b3243fcd +Author: Lee Salzman +Date: Tue Oct 10 15:49:13 2017 -0400 + + Bug 1387079 - Only use SkRasterPipeline when SkJumper is accelerated. r=jrmuizel, a=ritu + + MozReview-Commit-ID: 13dd2Ap4sob + + --HG-- + extra : source : 32227656b09dfb5d7c5412c799c7081dbc49346c +--- + gfx/skia/skia/src/core/SkBlitter.cpp | 2 ++ + .../mozilla/mozilla-central-reftests/masking/mask-mode-d.html.ini | 4 +++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git gfx/skia/skia/src/core/SkBlitter.cpp gfx/skia/skia/src/core/SkBlitter.cpp +index 0e8bd2db2249..3a824bb724f7 100644 +--- gfx/skia/skia/src/core/SkBlitter.cpp ++++ gfx/skia/skia/src/core/SkBlitter.cpp +@@ -847,9 +847,11 @@ SkBlitter* SkBlitter::Choose(const SkPixmap& device, + return alloc->make(device, *paint); + } + ++#if (!defined(SK_JUMPER_USE_ASSEMBLY) || SK_JUMPER_USE_ASSEMBLY) && (defined(__aarch64__) || defined(__arm__) || defined(__x86_64__) || defined(_M_X64)) + if (SkBlitter* blitter = SkCreateRasterPipelineBlitter(device, *paint, matrix, alloc)) { + return blitter; + } ++#endif + + if (nullptr == shader) { + if (mode != SkBlendMode::kSrcOver) { +diff --git testing/web-platform/meta/css/vendor-imports/mozilla/mozilla-central-reftests/masking/mask-mode-d.html.ini testing/web-platform/meta/css/vendor-imports/mozilla/mozilla-central-reftests/masking/mask-mode-d.html.ini +index c1246ddb4127..a02e049c3684 100644 +--- testing/web-platform/meta/css/vendor-imports/mozilla/mozilla-central-reftests/masking/mask-mode-d.html.ini ++++ testing/web-platform/meta/css/vendor-imports/mozilla/mozilla-central-reftests/masking/mask-mode-d.html.ini +@@ -1,3 +1,5 @@ + [mask-mode-d.html] + type: reftest +- expected: FAIL ++ expected: ++ if (processor == "x86") and (bits == 32): PASS ++ FAIL Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1387079 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1393627 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1393627 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1393627 (revision 461027) @@ -0,0 +1,30 @@ +commit 7f3f4f7f6ad3 +Author: Francois Marier +Date: Fri Nov 3 11:44:43 2017 -0700 + + Bug 1393627 - Expose the full tracking protection UI preferences. r=mossop, a=ritu + + MozReview-Commit-ID: KyDBuHyDPLP + + --HG-- + extra : source : 516690579442aecc1bea191e905f019acfad5b48 +--- + browser/app/profile/firefox.js | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git browser/app/profile/firefox.js browser/app/profile/firefox.js +index 137462dc857e..9e08a0f166f9 100644 +--- browser/app/profile/firefox.js ++++ browser/app/profile/firefox.js +@@ -1511,11 +1511,7 @@ pref("browser.ping-centre.production.endpoint", "https://tiles.services.mozilla. + // Enable GMP support in the addon manager. + pref("media.gmp-provider.enabled", true); + +-#ifdef NIGHTLY_BUILD + pref("privacy.trackingprotection.ui.enabled", true); +-#else +-pref("privacy.trackingprotection.ui.enabled", false); +-#endif + pref("privacy.trackingprotection.introCount", 0); + pref("privacy.trackingprotection.introURL", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/tracking-protection/start/"); + Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1393627 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1397989 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1397989 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1397989 (revision 461027) @@ -0,0 +1,42 @@ +commit f7c4ef799832 +Author: Mike de Boer +Date: Tue Oct 10 19:14:01 2017 +0200 + + Bug 1397989 - Make sure to only set non-empty values as the content-type of a document in the remote browser binding. r=mconley, a=ritu + + What happens is the following: + - browser-child.js sends a statechange up to RemoteWebProgress.jsm that contains + a `documentContentType` value of `null`, along with `requestURI` and `originalRequestURI` + _after_ other state changes that did send a valid content-type. + - The content-type is used by the WebProgressListener in browser.js to toggle the + disabled state of the 'isImage' broadcaster. + - The 'isImage' broadcaster is used by the 'cmd_find' and 'cmd_findAgain' commands to + determine whether they should be enabled. In this case: not. + The fix here is to _not_ set the documentContentType in the browser binding when + it's `null`. + + MozReview-Commit-ID: IELoCrnOH0j + + --HG-- + extra : source : 4c86b1f93b8482ea3097a4edb51bb8c0e8dc67fc +--- + toolkit/modules/RemoteWebProgress.jsm | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git toolkit/modules/RemoteWebProgress.jsm toolkit/modules/RemoteWebProgress.jsm +index 04eb37d580f5..05e3dabda941 100644 +--- toolkit/modules/RemoteWebProgress.jsm ++++ toolkit/modules/RemoteWebProgress.jsm +@@ -222,7 +222,11 @@ RemoteWebProgressManager.prototype = { + + if (isTopLevel) { + this._browser._contentWindow = objects.contentWindow; +- this._browser._documentContentType = json.documentContentType; ++ // Setting a content-type back to `null` is quite nonsensical for the ++ // frontend, especially since we're not expecting it. ++ if (json.documentContentType !== null) { ++ this._browser._documentContentType = json.documentContentType; ++ } + if (typeof json.inLoadURI != "undefined") { + this._browser.inLoadURI = json.inLoadURI; + } Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1397989 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1398806 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1398806 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1398806 (revision 461027) @@ -0,0 +1,438 @@ +commit 95d5501cd96b +Author: Robert Longson +Date: Tue Oct 10 07:58:34 2017 +0100 + + Bug 1398806 - GetCtx and GetNearestViewport should return the nearest svg or symbol element which is now an SVGViewportElement rather than only returning the nearest svg element because a symbol establishes a viewport too. r=dholbert, a=ritu + + --HG-- + extra : source : 813d4e250712d296eb4b11b0b89e10ed6a94e3d4 +--- + dom/svg/SVGContentUtils.cpp | 12 ++++++---- + dom/svg/SVGContentUtils.h | 5 ++-- + dom/svg/SVGLength.cpp | 2 +- + dom/svg/SVGMarkerElement.cpp | 2 +- + dom/svg/SVGMarkerElement.h | 4 ++-- + dom/svg/SVGSVGElement.h | 9 ------- + dom/svg/SVGViewportElement.h | 9 +++++++ + dom/svg/nsSVGElement.cpp | 34 +++++++++++++-------------- + dom/svg/nsSVGElement.h | 3 ++- + layout/base/nsLayoutUtils.cpp | 4 ++-- + layout/reftests/svg/reftest.list | 1 + + layout/reftests/svg/viewBox-and-symbol-01.svg | 14 +++++++++++ + layout/svg/nsCSSClipPathInstance.cpp | 1 - + layout/svg/nsSVGImageFrame.cpp | 1 - + layout/svg/nsSVGImageFrame.h | 1 - + layout/svg/nsSVGMarkerFrame.cpp | 4 ++-- + layout/svg/nsSVGMarkerFrame.h | 4 ++-- + layout/svg/nsSVGPatternFrame.cpp | 2 +- + layout/svg/nsSVGUtils.cpp | 6 ++--- + 19 files changed, 68 insertions(+), 50 deletions(-) + +diff --git dom/svg/SVGContentUtils.cpp dom/svg/SVGContentUtils.cpp +index 0f744ffd8dd1..a6bf6245e95e 100644 +--- dom/svg/SVGContentUtils.cpp ++++ dom/svg/SVGContentUtils.cpp +@@ -374,8 +374,8 @@ SVGContentUtils::EstablishesViewport(nsIContent *aContent) + nsGkAtoms::symbol); + } + +-nsSVGElement* +-SVGContentUtils::GetNearestViewportElement(nsIContent *aContent) ++SVGViewportElement* ++SVGContentUtils::GetNearestViewportElement(const nsIContent *aContent) + { + nsIContent *element = aContent->GetFlattenedTreeParent(); + +@@ -384,7 +384,11 @@ SVGContentUtils::GetNearestViewportElement(nsIContent *aContent) + if (element->IsSVGElement(nsGkAtoms::foreignObject)) { + return nullptr; + } +- return static_cast(element); ++ MOZ_ASSERT(element->IsAnyOfSVGElements(nsGkAtoms::svg, ++ nsGkAtoms::symbol), ++ "upcoming static_cast is only valid for " ++ "SVGViewportElement subclasses"); ++ return static_cast(element); + } + element = element->GetFlattenedTreeParent(); + } +@@ -828,7 +832,7 @@ SVGContentUtils::CoordToFloat(nsSVGElement *aContent, + return nsPresContext::AppUnitsToFloatCSSPixels(aCoord.GetCoordValue()); + + case eStyleUnit_Percent: { +- SVGSVGElement* ctx = aContent->GetCtx(); ++ SVGViewportElement* ctx = aContent->GetCtx(); + return ctx ? aCoord.GetPercentValue() * ctx->GetLength(SVGContentUtils::XY) : 0.0f; + } + default: +diff --git dom/svg/SVGContentUtils.h dom/svg/SVGContentUtils.h +index 36c74f47d75a..8ec309daf6f8 100644 +--- dom/svg/SVGContentUtils.h ++++ dom/svg/SVGContentUtils.h +@@ -32,6 +32,7 @@ class SVGPreserveAspectRatio; + namespace dom { + class Element; + class SVGSVGElement; ++class SVGViewportElement; + } // namespace dom + + } // namespace mozilla +@@ -238,8 +239,8 @@ public: + */ + static bool EstablishesViewport(nsIContent *aContent); + +- static nsSVGElement* +- GetNearestViewportElement(nsIContent *aContent); ++ static mozilla::dom::SVGViewportElement* ++ GetNearestViewportElement(const nsIContent *aContent); + + /* enum for specifying coordinate direction for ObjectSpace/UserSpace */ + enum ctxDirection { X, Y, XY }; +diff --git dom/svg/SVGLength.cpp dom/svg/SVGLength.cpp +index 6c13e2e8d1a0..cecbbc8f5b40 100644 +--- dom/svg/SVGLength.cpp ++++ dom/svg/SVGLength.cpp +@@ -177,7 +177,7 @@ SVGLength::GetUserUnitsPerUnit(const nsSVGElement *aElement, uint8_t aAxis) cons + SVGLength::GetUserUnitsPerPercent(const nsSVGElement *aElement, uint8_t aAxis) + { + if (aElement) { +- dom::SVGSVGElement *viewportElement = aElement->GetCtx(); ++ dom::SVGViewportElement *viewportElement = aElement->GetCtx(); + if (viewportElement) { + return std::max(viewportElement->GetLength(aAxis) / 100.0f, 0.0f); + } +diff --git dom/svg/SVGMarkerElement.cpp dom/svg/SVGMarkerElement.cpp +index 9b0b2fcfab1e..c4cf29ae274f 100644 +--- dom/svg/SVGMarkerElement.cpp ++++ dom/svg/SVGMarkerElement.cpp +@@ -250,7 +250,7 @@ SVGMarkerElement::UnsetAttr(int32_t aNamespaceID, nsIAtom* aName, + // nsSVGElement methods + + void +-SVGMarkerElement::SetParentCoordCtxProvider(SVGSVGElement *aContext) ++SVGMarkerElement::SetParentCoordCtxProvider(SVGViewportElement *aContext) + { + mCoordCtx = aContext; + mViewBoxToViewportTransform = nullptr; +diff --git dom/svg/SVGMarkerElement.h dom/svg/SVGMarkerElement.h +index 5d32de840b7a..ae08885c646e 100644 +--- dom/svg/SVGMarkerElement.h ++++ dom/svg/SVGMarkerElement.h +@@ -153,7 +153,7 @@ protected: + const nsAString& aValue, + nsAttrValue& aResult) override; + +- void SetParentCoordCtxProvider(SVGSVGElement *aContext); ++ void SetParentCoordCtxProvider(SVGViewportElement *aContext); + + virtual LengthAttributesInfo GetLengthInfo() override; + virtual AngleAttributesInfo GetAngleInfo() override; +@@ -180,7 +180,7 @@ protected: + // derived properties (from 'orient') handled separately + nsSVGOrientType mOrientType; + +- SVGSVGElement *mCoordCtx; ++ SVGViewportElement* mCoordCtx; + nsAutoPtr mViewBoxToViewportTransform; + }; + +diff --git dom/svg/SVGSVGElement.h dom/svg/SVGSVGElement.h +index fc3d7f3b55c5..431d70da2bef 100644 +--- dom/svg/SVGSVGElement.h ++++ dom/svg/SVGSVGElement.h +@@ -182,15 +182,6 @@ public: + // SVG-as-an-image documents.) + virtual void FlushImageTransformInvalidation(); + +- svgFloatSize GetViewportSize() const { +- return svgFloatSize(mViewportWidth, mViewportHeight); +- } +- +- void SetViewportSize(const svgFloatSize& aSize) { +- mViewportWidth = aSize.width; +- mViewportHeight = aSize.height; +- } +- + private: + // SVGViewportElement methods: + +diff --git dom/svg/SVGViewportElement.h dom/svg/SVGViewportElement.h +index fbc866e6a8d2..202797785131 100644 +--- dom/svg/SVGViewportElement.h ++++ dom/svg/SVGViewportElement.h +@@ -127,6 +127,15 @@ public: + + gfx::Matrix GetViewBoxTransform() const; + ++ svgFloatSize GetViewportSize() const { ++ return svgFloatSize(mViewportWidth, mViewportHeight); ++ } ++ ++ void SetViewportSize(const svgFloatSize& aSize) { ++ mViewportWidth = aSize.width; ++ mViewportHeight = aSize.height; ++ } ++ + // WebIDL + already_AddRefed ViewBox(); + already_AddRefed PreserveAspectRatio(); +diff --git dom/svg/nsSVGElement.cpp dom/svg/nsSVGElement.cpp +index 8757150c5925..a8aaa2fb5274 100644 +--- dom/svg/nsSVGElement.cpp ++++ dom/svg/nsSVGElement.cpp +@@ -1107,7 +1107,20 @@ nsSVGElement::GetOwnerSVGElement(nsIDOMSVGElement * *aOwnerSVGElement) + SVGSVGElement* + nsSVGElement::GetOwnerSVGElement() + { +- return GetCtx(); // this may return nullptr ++ nsIContent* ancestor = GetFlattenedTreeParent(); ++ ++ while (ancestor && ancestor->IsSVGElement()) { ++ if (ancestor->IsSVGElement(nsGkAtoms::foreignObject)) { ++ return nullptr; ++ } ++ if (ancestor->IsSVGElement(nsGkAtoms::svg)) { ++ return static_cast(ancestor); ++ } ++ ancestor = ancestor->GetFlattenedTreeParent(); ++ } ++ ++ // we don't have an ancestor element... ++ return nullptr; + } + + NS_IMETHODIMP +@@ -1543,23 +1556,10 @@ nsIAtom* nsSVGElement::GetEventNameForAttr(nsIAtom* aAttr) + return aAttr; + } + +-SVGSVGElement * ++SVGViewportElement * + nsSVGElement::GetCtx() const + { +- nsIContent* ancestor = GetFlattenedTreeParent(); +- +- while (ancestor && ancestor->IsSVGElement()) { +- if (ancestor->IsSVGElement(nsGkAtoms::foreignObject)) { +- return nullptr; +- } +- if (ancestor->IsSVGElement(nsGkAtoms::svg)) { +- return static_cast(ancestor); +- } +- ancestor = ancestor->GetFlattenedTreeParent(); +- } +- +- // we don't have an ancestor element... +- return nullptr; ++ return SVGContentUtils::GetNearestViewportElement(this); + } + + /* virtual */ gfxMatrix +@@ -1658,7 +1658,7 @@ nsSVGElement::GetAnimatedLengthValues(float *aFirst, ...) + NS_ASSERTION(info.mLengthCount > 0, + "GetAnimatedLengthValues on element with no length attribs"); + +- SVGSVGElement *ctx = nullptr; ++ SVGViewportElement *ctx = nullptr; + + float *f = aFirst; + uint32_t i = 0; +diff --git dom/svg/nsSVGElement.h dom/svg/nsSVGElement.h +index 28c46188d4e4..955a327561d3 100644 +--- dom/svg/nsSVGElement.h ++++ dom/svg/nsSVGElement.h +@@ -44,6 +44,7 @@ class DeclarationBlock; + + namespace dom { + class SVGSVGElement; ++class SVGViewportElement; + + static const unsigned short SVG_UNIT_TYPE_UNKNOWN = 0; + static const unsigned short SVG_UNIT_TYPE_USERSPACEONUSE = 1; +@@ -145,7 +146,7 @@ public: + // Gets the element that establishes the rectangular viewport against which + // we should resolve percentage lengths (our "coordinate context"). Returns + // nullptr for outer or SVG without an parent (invalid SVG). +- mozilla::dom::SVGSVGElement* GetCtx() const; ++ mozilla::dom::SVGViewportElement* GetCtx() const; + + /** + * Returns aMatrix pre-multiplied by (explicit or implicit) transforms that +diff --git layout/base/nsLayoutUtils.cpp layout/base/nsLayoutUtils.cpp +index f5ca2719e333..7f3f5354befc 100644 +--- layout/base/nsLayoutUtils.cpp ++++ layout/base/nsLayoutUtils.cpp +@@ -120,7 +120,7 @@ + #include "mozilla/StyleSetHandle.h" + #include "mozilla/StyleSetHandleInlines.h" + #include "RegionBuilder.h" +-#include "SVGSVGElement.h" ++#include "SVGViewportElement.h" + #include "DisplayItemClip.h" + #include "mozilla/layers/WebRenderLayerManager.h" + #include "prenv.h" +@@ -9479,7 +9479,7 @@ ComputeSVGReferenceRect(nsIFrame* aFrame, + case StyleGeometryBox::ViewBox: { + nsIContent* content = aFrame->GetContent(); + nsSVGElement* element = static_cast(content); +- SVGSVGElement* svgElement = element->GetCtx(); ++ SVGViewportElement* svgElement = element->GetCtx(); + MOZ_ASSERT(svgElement); + + if (svgElement && svgElement->HasViewBoxRect()) { +diff --git layout/reftests/svg/reftest.list layout/reftests/svg/reftest.list +index 2d3981f0b65e..0b96144724bb 100644 +--- layout/reftests/svg/reftest.list ++++ layout/reftests/svg/reftest.list +@@ -532,6 +532,7 @@ fuzzy-if(skiaContent,1,100) == tspan-xy-anchor-end-01.svg tspan-xy-anchor-end-re + == viewBox-and-pattern-02.svg pass.svg + == viewBox-and-pattern-03.svg pass.svg + == viewBox-and-pattern-04.svg pass.svg ++== viewBox-and-symbol-01.svg pass.svg + == viewBox-invalid-01.svg pass.svg + == viewBox-invalid-02.svg pass.svg + == viewBox-valid-01.svg pass.svg +diff --git layout/reftests/svg/viewBox-and-symbol-01.svg layout/reftests/svg/viewBox-and-symbol-01.svg +new file mode 100644 +index 000000000000..5c8ebf7bc3ea +--- /dev/null ++++ layout/reftests/svg/viewBox-and-symbol-01.svg +@@ -0,0 +1,14 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git layout/svg/nsCSSClipPathInstance.cpp layout/svg/nsCSSClipPathInstance.cpp +index 09d3530c4ef0..0c25f7a21bb8 100644 +--- layout/svg/nsCSSClipPathInstance.cpp ++++ layout/svg/nsCSSClipPathInstance.cpp +@@ -9,7 +9,6 @@ + #include "gfx2DGlue.h" + #include "gfxContext.h" + #include "gfxPlatform.h" +-#include "mozilla/dom/SVGSVGElement.h" + #include "mozilla/gfx/2D.h" + #include "mozilla/gfx/PathHelpers.h" + #include "mozilla/ShapeUtils.h" +diff --git layout/svg/nsSVGImageFrame.cpp layout/svg/nsSVGImageFrame.cpp +index 074415854667..21834954721d 100644 +--- layout/svg/nsSVGImageFrame.cpp ++++ layout/svg/nsSVGImageFrame.cpp +@@ -16,7 +16,6 @@ + #include "nsLayoutUtils.h" + #include "imgINotificationObserver.h" + #include "nsSVGEffects.h" +-#include "mozilla/dom/SVGSVGElement.h" + #include "nsSVGUtils.h" + #include "SVGContentUtils.h" + #include "SVGGeometryFrame.h" +diff --git layout/svg/nsSVGImageFrame.h layout/svg/nsSVGImageFrame.h +index b2c90fd6402d..fe0ac33ac02a 100644 +--- layout/svg/nsSVGImageFrame.h ++++ layout/svg/nsSVGImageFrame.h +@@ -17,7 +17,6 @@ + #include "nsLayoutUtils.h" + #include "imgINotificationObserver.h" + #include "nsSVGEffects.h" +-#include "mozilla/dom/SVGSVGElement.h" + #include "nsSVGUtils.h" + #include "SVGContentUtils.h" + #include "SVGGeometryFrame.h" +diff --git layout/svg/nsSVGMarkerFrame.cpp layout/svg/nsSVGMarkerFrame.cpp +index dbeb02ea5b2d..365a0aa70a26 100644 +--- layout/svg/nsSVGMarkerFrame.cpp ++++ layout/svg/nsSVGMarkerFrame.cpp +@@ -194,7 +194,7 @@ nsSVGMarkerFrame::GetMarkBBoxContribution(const Matrix& aToBBoxUserspace, + } + + void +-nsSVGMarkerFrame::SetParentCoordCtxProvider(SVGSVGElement *aContext) ++nsSVGMarkerFrame::SetParentCoordCtxProvider(SVGViewportElement *aContext) + { + SVGMarkerElement *marker = static_cast(mContent); + marker->SetParentCoordCtxProvider(aContext); +@@ -219,7 +219,7 @@ nsSVGMarkerFrame::AutoMarkerReferencer::AutoMarkerReferencer( + mFrame->mInUse = true; + mFrame->mMarkedFrame = aMarkedFrame; + +- SVGSVGElement *ctx = ++ SVGViewportElement *ctx = + static_cast(aMarkedFrame->GetContent())->GetCtx(); + mFrame->SetParentCoordCtxProvider(ctx); + } +diff --git layout/svg/nsSVGMarkerFrame.h layout/svg/nsSVGMarkerFrame.h +index 95415e6dcc21..03099eab9324 100644 +--- layout/svg/nsSVGMarkerFrame.h ++++ layout/svg/nsSVGMarkerFrame.h +@@ -20,7 +20,7 @@ class gfxContext; + namespace mozilla { + class SVGGeometryFrame; + namespace dom { +-class SVGSVGElement; ++class SVGViewportElement; + } // namespace dom + } // namespace mozilla + +@@ -119,7 +119,7 @@ private: + }; + + // nsSVGMarkerFrame methods: +- void SetParentCoordCtxProvider(mozilla::dom::SVGSVGElement *aContext); ++ void SetParentCoordCtxProvider(mozilla::dom::SVGViewportElement *aContext); + + // recursion prevention flag + bool mInUse; +diff --git layout/svg/nsSVGPatternFrame.cpp layout/svg/nsSVGPatternFrame.cpp +index 488ac2f5c783..5078fb1b5a31 100644 +--- layout/svg/nsSVGPatternFrame.cpp ++++ layout/svg/nsSVGPatternFrame.cpp +@@ -660,7 +660,7 @@ nsSVGPatternFrame::ConstructCTM(const nsSVGViewBox& aViewBox, + const Matrix &callerCTM, + nsIFrame *aTarget) + { +- SVGSVGElement *ctx = nullptr; ++ SVGViewportElement *ctx = nullptr; + nsIContent* targetContent = aTarget->GetContent(); + gfxFloat scaleX, scaleY; + +diff --git layout/svg/nsSVGUtils.cpp layout/svg/nsSVGUtils.cpp +index d53a3ede0be7..f21c23491285 100644 +--- layout/svg/nsSVGUtils.cpp ++++ layout/svg/nsSVGUtils.cpp +@@ -49,7 +49,7 @@ + #include "SVGGeometryElement.h" + #include "SVGGeometryFrame.h" + #include "nsSVGPaintServerFrame.h" +-#include "mozilla/dom/SVGSVGElement.h" ++#include "mozilla/dom/SVGViewportElement.h" + #include "nsTextFrame.h" + #include "SVGContentUtils.h" + #include "SVGTextFrame.h" +@@ -290,7 +290,7 @@ nsSVGUtils::GetContextSize(const nsIFrame* aFrame) + MOZ_ASSERT(aFrame->GetContent()->IsSVGElement(), "bad cast"); + const nsSVGElement* element = static_cast(aFrame->GetContent()); + +- SVGSVGElement* ctx = element->GetCtx(); ++ SVGViewportElement* ctx = element->GetCtx(); + if (ctx) { + size.width = ctx->GetLength(SVGContentUtils::X); + size.height = ctx->GetLength(SVGContentUtils::Y); +@@ -323,7 +323,7 @@ nsSVGUtils::ObjectSpace(const gfxRect &aRect, const nsSVGLength2 *aLength) + // Multiply first to avoid precision errors: + return axis * aLength->GetAnimValInSpecifiedUnits() / 100; + } +- return aLength->GetAnimValue(static_cast(nullptr)) * axis; ++ return aLength->GetAnimValue(static_cast(nullptr)) * axis; + } + + float Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1398806 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1400674 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1400674 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1400674 (revision 461027) @@ -0,0 +1,70 @@ +commit c08bea16ab67 (HEAD) +Author: JW Wang +Date: Fri Oct 13 17:24:24 2017 +0800 + + Bug 1400674 - Fix the algorithm of filling audio gaps with silence. r=jya, a=ritu + + MozReview-Commit-ID: Hjsboq6PdlN + + --HG-- + extra : source : aecaa85bb1d9d8b7d2cbd9ab84eb6dbc0ed9eee8 +--- + dom/media/mediasink/AudioSink.cpp | 37 +++++++++++++++---------------------- + 1 file changed, 15 insertions(+), 22 deletions(-) + +diff --git dom/media/mediasink/AudioSink.cpp dom/media/mediasink/AudioSink.cpp +index 0dbb53a3387a..81be7ac0bd89 100644 +--- dom/media/mediasink/AudioSink.cpp ++++ dom/media/mediasink/AudioSink.cpp +@@ -426,28 +426,21 @@ AudioSink::NotifyAudioNeeded() + missingFrames = std::min(INT32_MAX, missingFrames.value()); + mFramesParsed += missingFrames.value(); + +- // We need to calculate how many frames are missing at the output rate. +- missingFrames = +- SaferMultDiv(missingFrames.value(), mOutputRate, data->mRate); +- if (!missingFrames.isValid()) { +- NS_WARNING("Int overflow in AudioSink"); +- mErrored = true; +- return; +- } +- +- // We need to insert silence, first use drained frames if any. +- missingFrames -= DrainConverter(missingFrames.value()); +- // Insert silence if still needed. +- if (missingFrames.value()) { +- AlignedAudioBuffer silenceData(missingFrames.value() * mOutputChannels); +- if (!silenceData) { +- NS_WARNING("OOM in AudioSink"); +- mErrored = true; +- return; +- } +- RefPtr silence = CreateAudioFromBuffer(Move(silenceData), data); +- PushProcessedAudio(silence); ++ RefPtr silenceData; ++ AlignedAudioBuffer silenceBuffer(missingFrames.value() * data->mChannels); ++ if (!silenceBuffer) { ++ NS_WARNING("OOM in AudioSink"); ++ mErrored = true; ++ return; ++ } ++ if (mConverter->InputConfig() != mConverter->OutputConfig()) { ++ AlignedAudioBuffer convertedData = ++ mConverter->Process(AudioSampleBuffer(Move(silenceBuffer))).Forget(); ++ silenceData = CreateAudioFromBuffer(Move(convertedData), data); ++ } else { ++ silenceData = CreateAudioFromBuffer(Move(silenceBuffer), data); + } ++ PushProcessedAudio(silenceData); + } + + mLastEndTime = data->GetEndTime(); +@@ -488,7 +481,7 @@ AudioSink::PushProcessedAudio(AudioData* aData) + + already_AddRefed + AudioSink::CreateAudioFromBuffer(AlignedAudioBuffer&& aBuffer, +- AudioData* aReference) ++ AudioData* aReference) + { + uint32_t frames = aBuffer.Length() / mOutputChannels; + if (!frames) { Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1400674 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1401522 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1401522 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1401522 (revision 461027) @@ -0,0 +1,34 @@ +commit e9d4b51968e0 +Author: Samael Wang +Date: Thu Sep 28 11:16:53 2017 +0800 + + Bug 1401522 - Don't apply statusCode sent from parent if mCanceled or mStatus has been modified in the child. r=mayhemer, a=ritu + + When a WyciwygChannel is canceled, but WyciwygChannelParent::RecvCancel happens + after WyciwygChannelParent::SendOnStartRequest, it would send statusCode=NS_OK + to WyciwygChannelChild::OnStartRequest. So we should not apply the statusCode + if mCanceled, just like how HttpChannelChild handles it. + + MozReview-Commit-ID: 5H3PUrlArIA + + --HG-- + extra : source : 8ebfa90c4ebca44ac1c3829ef54de74d3b004dfc +--- + netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp +index d14b6f925e37..85d3ebf24439 100644 +--- netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp ++++ netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp +@@ -191,7 +191,9 @@ WyciwygChannelChild::OnStartRequest(const nsresult& statusCode, + + mState = WCC_ONSTART; + +- mStatus = statusCode; ++ if (!mCanceled && NS_SUCCEEDED(mStatus)) { ++ mStatus = statusCode; ++ } + mContentLength = contentLength; + mCharsetSource = source; + mCharset = charset; Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1401522 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1401876 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1401876 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1401876 (revision 461027) @@ -0,0 +1,48 @@ +commit 09ba71b3a5e9 +Author: Scott Wu +Date: Thu Sep 21 15:37:25 2017 +0800 + + Bug 1401876 - Part 1: Close datetime picker on popuphidden. r=mconley, a=ritu + + MozReview-Commit-ID: FUqbtAftQxh + + --HG-- + extra : source : e238860e4943cd1bb4c2c5f7175a36d494f0e91b +--- + toolkit/content/tests/browser/head.js | 1 + + toolkit/content/widgets/datetimepopup.xml | 2 +- + toolkit/modules/DateTimePickerHelper.jsm | 1 + + 3 files changed, 3 insertions(+), 1 deletion(-) + +diff --git toolkit/content/widgets/datetimepopup.xml toolkit/content/widgets/datetimepopup.xml +index 7e4e5bcfe4e8..7397e1d310d4 100644 +--- toolkit/content/widgets/datetimepopup.xml ++++ toolkit/content/widgets/datetimepopup.xml +@@ -75,7 +75,6 @@ + this.dateTimePopupFrame.removeEventListener("load", this, true); + this.dateTimePopupFrame.contentDocument.removeEventListener("message", this); + this.dateTimePopupFrame.setAttribute("src", ""); +- this.hidePopup(); + this.hidden = true; + ]]> + +@@ -320,6 +319,7 @@ + break; + } + case "ClosePopup": { ++ this.hidePopup(); + this.closePicker(); + break; + } +diff --git toolkit/modules/DateTimePickerHelper.jsm toolkit/modules/DateTimePickerHelper.jsm +index ced4e401815b..38e89bd0d160 100644 +--- toolkit/modules/DateTimePickerHelper.jsm ++++ toolkit/modules/DateTimePickerHelper.jsm +@@ -90,6 +90,7 @@ this.DateTimePickerHelper = { + if (browser) { + browser.messageManager.sendAsyncMessage("FormDateTime:PickerClosed"); + } ++ this.picker.closePicker(); + this.close(); + break; + } Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1401876 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1402871 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1402871 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1402871 (revision 461027) @@ -0,0 +1,28 @@ +commit 6f6ee3c5b2ad +Author: Kearwood Gilbert +Date: Wed Oct 11 14:25:51 2017 -0700 + + Bug 1402871 - Change VREventObserver::mWindow to a RefPtr. r=dveditz, a=ritu + + MozReview-Commit-ID: 79MlNMAvIQD + + --HG-- + extra : source : 84ff58454e222ce067ec27f8841ba684934b7666 +--- + dom/vr/VREventObserver.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git dom/vr/VREventObserver.h dom/vr/VREventObserver.h +index 24a1065a18fe..cd2cf69469b5 100644 +--- dom/vr/VREventObserver.h ++++ dom/vr/VREventObserver.h +@@ -34,8 +34,7 @@ public: + private: + ~VREventObserver(); + +- // Weak pointer, instance is owned by mWindow. +- nsGlobalWindow* MOZ_NON_OWNING_REF mWindow; ++ RefPtr mWindow; + // For WebVR telemetry for tracking users who view content + // in the 2D view. + TimeStamp mSpendTimeIn2DView; Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1402871 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1403349 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1403349 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1403349 (revision 461027) @@ -0,0 +1,1216 @@ +commit bec0ae08b1a9 +Author: Luca Greco +Date: Wed Sep 27 14:24:54 2017 +0200 + + Bug 1403349 - Fix wrong sourceTabId on webNavigation.onCreatedTarget event. r=aswan, a=ritu + + This changes fixes the regression introduced by Bug 1355120 and adds a new + test case which contains a browserAction popup which open and immediately + close a new window and ensure that the received onCreatedNavigationTarget + is the expected one. + + MozReview-Commit-ID: JIcVCpBTpxj + + --HG-- + extra : source : 435db72f9b6ab5ec9144bbf92611c5c877342410 + extra : histedit_source : 99ba482dfa4bacfbd3b96d4044fdab536c1955e5 +--- + ...gation_onCreatedNavigationTarget_window_open.js | 76 ++++++++++++++++++++-- + toolkit/modules/addons/WebNavigation.jsm | 23 ++++--- + toolkit/modules/addons/WebNavigationContent.js | 16 ++++- + 3 files changed, 99 insertions(+), 16 deletions(-) + +diff --git browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js +index 1dd79b4256f7..993d7c50ff43 100644 +--- browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js ++++ browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js +@@ -58,7 +58,7 @@ async function runTestCase({extension, openNavTarget, expectedWebNavProps}) { + is(completedNavMsg.url, url, "Got the expected webNavigation.onCompleted url property"); + } + +-add_task(async function test_on_created_navigation_target_from_window_open() { ++add_task(async function test_window_open() { + const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); + + gBrowser.selectedTab = tab1; +@@ -74,7 +74,7 @@ add_task(async function test_on_created_navigation_target_from_window_open() { + + const expectedSourceTab = await extension.awaitMessage("expectedSourceTab"); + +- info("open an url in a new tab from a window.open call"); ++ info("open a url in a new tab from a window.open call"); + + await runTestCase({ + extension, +@@ -91,7 +91,7 @@ add_task(async function test_on_created_navigation_target_from_window_open() { + }, + }); + +- info("open an url in a new window from a window.open call"); ++ info("open a url in a new window from a window.open call"); + + await runTestCase({ + extension, +@@ -113,7 +113,7 @@ add_task(async function test_on_created_navigation_target_from_window_open() { + await extension.unload(); + }); + +-add_task(async function test_on_created_navigation_target_from_window_open_subframe() { ++add_task(async function test_window_open_from_subframe() { + const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); + + gBrowser.selectedTab = tab1; +@@ -129,7 +129,7 @@ add_task(async function test_on_created_navigation_target_from_window_open_subfr + + const expectedSourceTab = await extension.awaitMessage("expectedSourceTab"); + +- info("open an url in a new tab from subframe window.open call"); ++ info("open a url in a new tab from subframe window.open call"); + + await runTestCase({ + extension, +@@ -146,7 +146,7 @@ add_task(async function test_on_created_navigation_target_from_window_open_subfr + }, + }); + +- info("open an url in a new window from subframe window.open call"); ++ info("open a url in a new window from subframe window.open call"); + + await runTestCase({ + extension, +@@ -167,3 +167,67 @@ add_task(async function test_on_created_navigation_target_from_window_open_subfr + + await extension.unload(); + }); ++ ++add_task(async function test_window_open_close_from_browserAction_popup() { ++ const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); ++ ++ gBrowser.selectedTab = tab1; ++ ++ function popup() { ++ window.open("", "_self").close(); ++ ++ browser.test.sendMessage("browserAction_popup_executed"); ++ } ++ ++ const extension = ExtensionTestUtils.loadExtension({ ++ background, ++ manifest: { ++ browser_action: { ++ default_popup: "popup.html", ++ }, ++ permissions: ["webNavigation", "tabs", ""], ++ }, ++ files: { ++ "popup.html": ` ++ ++ ++ ++ ++ ++ ++ ++ ++ `, ++ "popup.js": popup, ++ }, ++ }); ++ ++ await extension.startup(); ++ ++ const expectedSourceTab = await extension.awaitMessage("expectedSourceTab"); ++ ++ clickBrowserAction(extension); ++ ++ await extension.awaitMessage("browserAction_popup_executed"); ++ ++ info("open a url in a new tab from a window.open call"); ++ ++ await runTestCase({ ++ extension, ++ openNavTarget() { ++ extension.sendMessage({ ++ type: "execute-contentscript", ++ code: `window.open("${OPENED_PAGE}#new-tab-from-window-open"); true;`, ++ }); ++ }, ++ expectedWebNavProps: { ++ sourceTabId: expectedSourceTab.sourceTabId, ++ sourceFrameId: 0, ++ url: `${OPENED_PAGE}#new-tab-from-window-open`, ++ }, ++ }); ++ ++ await BrowserTestUtils.removeTab(tab1); ++ ++ await extension.unload(); ++}); +diff --git toolkit/modules/addons/WebNavigation.jsm toolkit/modules/addons/WebNavigation.jsm +index 1aadbd579e05..a0c774665d17 100644 +--- toolkit/modules/addons/WebNavigation.jsm ++++ toolkit/modules/addons/WebNavigation.jsm +@@ -306,19 +306,26 @@ var Manager = { + }, + + onCreatedNavigationTarget(browser, data) { +- const {isSourceTab, createdWindowId, sourceFrameId, url} = data; +- +- // We are going to potentially received two message manager messages for a single +- // onCreatedNavigationTarget event that is happening in the child process, +- // we are going to use the generate uuid to pair them together. +- const pairedMessage = this.createdNavigationTargetByOuterWindowId.get(createdWindowId); ++ const { ++ createdOuterWindowId, ++ isSourceTab, ++ sourceFrameId, ++ url, ++ } = data; ++ ++ // We are going to receive two message manager messages for a single ++ // onCreatedNavigationTarget event related to a window.open that is happening ++ // in the child process (one from the source tab and one from the created tab), ++ // the unique createdWindowId (the outerWindowID of the created docShell) ++ // to pair them together. ++ const pairedMessage = this.createdNavigationTargetByOuterWindowId.get(createdOuterWindowId); + + if (!pairedMessage) { +- this.createdNavigationTargetByOuterWindowId.set(createdWindowId, {browser, data}); ++ this.createdNavigationTargetByOuterWindowId.set(createdOuterWindowId, {browser, data}); + return; + } + +- this.createdNavigationTargetByOuterWindowId.delete(createdWindowId); ++ this.createdNavigationTargetByOuterWindowId.delete(createdOuterWindowId); + + let sourceTabBrowser; + let createdTabBrowser; +diff --git toolkit/modules/addons/WebNavigationContent.js toolkit/modules/addons/WebNavigationContent.js +index 31a8b7328fc9..ed873cc98644 100644 +--- toolkit/modules/addons/WebNavigationContent.js ++++ toolkit/modules/addons/WebNavigationContent.js +@@ -10,6 +10,17 @@ Components.utils.import("resource://gre/modules/Services.jsm"); + XPCOMUtils.defineLazyModuleGetter(this, "WebNavigationFrames", + "resource://gre/modules/WebNavigationFrames.jsm"); + ++function getDocShellOuterWindowId(docShell) { ++ if (!docShell) { ++ return undefined; ++ } ++ ++ return docShell.QueryInterface(Ci.nsIInterfaceRequestor) ++ .getInterface(Ci.nsIDOMWindow) ++ .getInterface(Ci.nsIDOMWindowUtils) ++ .outerWindowID; ++} ++ + function loadListener(event) { + let document = event.target; + let window = document.defaultView; +@@ -56,8 +67,9 @@ var CreatedNavigationTargetListener = { + } + + const isSourceTab = docShell === sourceDocShell || isSourceTabDescendant; ++ + const sourceFrameId = WebNavigationFrames.getDocShellFrameId(sourceDocShell); +- const createdWindowId = WebNavigationFrames.getDocShellFrameId(createdDocShell); ++ const createdOuterWindowId = getDocShellOuterWindowId(sourceDocShell); + + let url; + if (props.hasKey("url")) { +@@ -67,7 +79,7 @@ var CreatedNavigationTargetListener = { + sendAsyncMessage("Extension:CreatedNavigationTarget", { + url, + sourceFrameId, +- createdWindowId, ++ createdOuterWindowId, + isSourceTab, + }); + }, + +commit 27a18112bd4c +Author: Luca Greco +Date: Wed Sep 27 19:07:41 2017 +0200 + + Bug 1403349 - Prevent WebNavigation jsm to leak the sourceTab browser on unpaired CreatedNavigationTarget messages. r=aswan, a=ritu + + This applies the following changes: + + - store a weak reference to the browser element in the WebNavigation.jsm Manager's map + of pending CreatedNavigationTarget messages + + - when a CreatedNavigationTarget message is received from a sourceTab + for a created window that is not currently tracked in the map + (e.g. it has been immediately closed), the message received from the sourceTab + is not saved in the map of the pending CreatedNavigationTarget (and a message + is logged in the console to make easier to investigate issues related to discarded + CreatedNavigationTarget events). + + - adds an additional assertion to the related test case to ensure that no CreatedNavigationTarget + message is still pending in the WebNavigation/jsm's Manager. + + MozReview-Commit-ID: FijQ8IqiY8L + + --HG-- + extra : source : 6692df0c568732b5f38bc594e7e020b3ea2e0f41 + extra : histedit_source : cd9bd61c19bf32bdd24f0faed101a0da9faf5ed4 +--- + ...gation_onCreatedNavigationTarget_window_open.js | 16 +++++++ + toolkit/modules/addons/WebNavigation.jsm | 50 ++++++++++++++++++---- + 2 files changed, 57 insertions(+), 9 deletions(-) + +diff --git browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js +index 993d7c50ff43..1fbb3c07d4a9 100644 +--- browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js ++++ browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js +@@ -58,6 +58,16 @@ async function runTestCase({extension, openNavTarget, expectedWebNavProps}) { + is(completedNavMsg.url, url, "Got the expected webNavigation.onCompleted url property"); + } + ++// Test that there are no pending createdNavigationTarget messages still tracked ++// in WebNavigation.jsm (to be called before the extension is unloaded, because ++// once the last extension which have subscribed a webNavigation event is unloaded ++// all the pending created navigation target data is completely cleared). ++function assertNoPendingCreatedNavigationTargetData() { ++ const {Manager} = Cu.import("resource://gre/modules/WebNavigation.jsm", {}); ++ Assert.equal(Manager.createdNavigationTargetByOuterWindowId.size, 0, ++ "There should be no pending createdNavigationTarget messages in WebNavigation"); ++} ++ + add_task(async function test_window_open() { + const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); + +@@ -108,6 +118,8 @@ add_task(async function test_window_open() { + }, + }); + ++ assertNoPendingCreatedNavigationTargetData(); ++ + await BrowserTestUtils.removeTab(tab1); + + await extension.unload(); +@@ -163,6 +175,8 @@ add_task(async function test_window_open_from_subframe() { + }, + }); + ++ assertNoPendingCreatedNavigationTargetData(); ++ + await BrowserTestUtils.removeTab(tab1); + + await extension.unload(); +@@ -227,6 +241,8 @@ add_task(async function test_window_open_close_from_browserAction_popup() { + }, + }); + ++ assertNoPendingCreatedNavigationTargetData(); ++ + await BrowserTestUtils.removeTab(tab1); + + await extension.unload(); +diff --git toolkit/modules/addons/WebNavigation.jsm toolkit/modules/addons/WebNavigation.jsm +index a0c774665d17..db6efdb443de 100644 +--- toolkit/modules/addons/WebNavigation.jsm ++++ toolkit/modules/addons/WebNavigation.jsm +@@ -320,22 +320,54 @@ var Manager = { + // to pair them together. + const pairedMessage = this.createdNavigationTargetByOuterWindowId.get(createdOuterWindowId); + ++ if (!isSourceTab) { ++ if (pairedMessage) { ++ // This should not happen, print a warning before overwriting the unexpected pending data. ++ Services.console.logStringMessage( ++ `Discarding onCreatedNavigationTarget for ${createdOuterWindowId}: ` + ++ "unexpected pending data while receiving the created tab data" ++ ); ++ } ++ ++ // Store a weak reference to the browser XUL element, so that we don't prevent ++ // it to be garbage collected if it has been destroyed. ++ const browserWeakRef = Cu.getWeakReference(browser); ++ ++ this.createdNavigationTargetByOuterWindowId.set(createdOuterWindowId, { ++ browserWeakRef, ++ data, ++ }); ++ ++ return; ++ } ++ + if (!pairedMessage) { +- this.createdNavigationTargetByOuterWindowId.set(createdOuterWindowId, {browser, data}); ++ // The sourceTab should always be received after the message coming from the created ++ // top level frame because the "webNavigation-createdNavigationTarget-from-js" observers ++ // subscribed by WebNavigationContent.js are going to be executed in reverse order ++ // (See http://searchfox.org/mozilla-central/rev/f54c1723be/xpcom/ds/nsObserverList.cpp#76) ++ // and the observer subscribed to the created target will be the last one subscribed ++ // to the ObserverService (and the first one to be triggered). ++ Services.console.logStringMessage( ++ `Discarding onCreatedNavigationTarget for ${createdOuterWindowId}: ` + ++ "received source tab data without any created tab data available" ++ ); ++ + return; + } + + this.createdNavigationTargetByOuterWindowId.delete(createdOuterWindowId); + +- let sourceTabBrowser; +- let createdTabBrowser; ++ let sourceTabBrowser = browser; ++ let createdTabBrowser = pairedMessage.browserWeakRef.get(); + +- if (isSourceTab) { +- sourceTabBrowser = browser; +- createdTabBrowser = pairedMessage.browser; +- } else { +- sourceTabBrowser = pairedMessage.browser; +- createdTabBrowser = browser; ++ if (!createdTabBrowser) { ++ Services.console.logStringMessage( ++ `Discarding onCreatedNavigationTarget for ${createdOuterWindowId}: ` + ++ "the created tab has been already destroyed" ++ ); ++ ++ return; + } + + this.fire("onCreatedNavigationTarget", createdTabBrowser, {}, { + +commit 9f0305064bbe +Author: Luca Greco +Date: Thu Sep 28 22:04:14 2017 +0200 + + Bug 1403349 - Add a new webNavigation test for window.open called with a named window target. r=aswan, a=ritu + + MozReview-Commit-ID: Aj8uMtcGwJx + + --HG-- + extra : source : acc39e04d4f0559b796916d5f54a36673708766a + extra : histedit_source : 2366c25a25acf76333f6b9386886ca5c866dad54 +--- + ...gation_onCreatedNavigationTarget_window_open.js | 57 ++++++++++++++++++++++ + 1 file changed, 57 insertions(+) + +diff --git browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js +index 1fbb3c07d4a9..232b9321fcd3 100644 +--- browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js ++++ browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js +@@ -247,3 +247,60 @@ add_task(async function test_window_open_close_from_browserAction_popup() { + + await extension.unload(); + }); ++ ++add_task(async function test_window_open_in_named_win() { ++ const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); ++ ++ gBrowser.selectedTab = tab1; ++ ++ const extension = ExtensionTestUtils.loadExtension({ ++ background, ++ manifest: { ++ permissions: ["webNavigation", "tabs", ""], ++ }, ++ }); ++ ++ await extension.startup(); ++ ++ const expectedSourceTab = await extension.awaitMessage("expectedSourceTab"); ++ ++ info("open a url in a new named window from a window.open call"); ++ ++ await runTestCase({ ++ extension, ++ openNavTarget() { ++ extension.sendMessage({ ++ type: "execute-contentscript", ++ code: `window.open("${OPENED_PAGE}#new-named-window-open", "TestWinName"); true;`, ++ }); ++ }, ++ expectedWebNavProps: { ++ sourceTabId: expectedSourceTab.sourceTabId, ++ sourceFrameId: 0, ++ url: `${OPENED_PAGE}#new-named-window-open`, ++ }, ++ }); ++ ++ info("open a url in an existent named window from a window.open call"); ++ ++ await runTestCase({ ++ extension, ++ openNavTarget() { ++ extension.sendMessage({ ++ type: "execute-contentscript", ++ code: `window.open("${OPENED_PAGE}#existent-named-window-open", "TestWinName"); true;`, ++ }); ++ }, ++ expectedWebNavProps: { ++ sourceTabId: expectedSourceTab.sourceTabId, ++ sourceFrameId: 0, ++ url: `${OPENED_PAGE}#existent-named-window-open`, ++ }, ++ }); ++ ++ assertNoPendingCreatedNavigationTargetData(); ++ ++ await BrowserTestUtils.removeTab(tab1); ++ ++ await extension.unload(); ++}); + +commit 2a05645d21a8 +Author: Luca Greco +Date: Fri Oct 13 18:19:47 2017 +0200 + + Bug 1403349 - Split webNavigation onCreatedNavigationTarget tests to prevent timeouts on linux32 debug. r=aswan, a=ritu + + MozReview-Commit-ID: 50JLocTVvfu + + --HG-- + rename : browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js => browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_named_window.js + rename : browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js => browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_subframe_window_open.js + extra : source : e802283bbf21d14d431901dd286681cd1933bb97 + extra : histedit_source : dfedfb9746b98e9ee96e768a53aa0f6cbdc8b6ee +--- + .../extensions/test/browser/browser-common.ini | 3 + + ..._ext_webNavigation_onCreatedNavigationTarget.js | 36 +---- + ...gation_onCreatedNavigationTarget_contextmenu.js | 47 ++---- + ...ation_onCreatedNavigationTarget_named_window.js | 97 ++++++++++++ + ...CreatedNavigationTarget_subframe_window_open.js | 163 +++++++++++++++++++++ + ...gation_onCreatedNavigationTarget_window_open.js | 153 +------------------ + .../extensions/test/browser/head_webNavigation.js | 39 +++++ + 7 files changed, 329 insertions(+), 209 deletions(-) + +diff --git browser/components/extensions/test/browser/browser-common.ini browser/components/extensions/test/browser/browser-common.ini +index a03cb9147a7f..3a672f737a59 100644 +--- browser/components/extensions/test/browser/browser-common.ini ++++ browser/components/extensions/test/browser/browser-common.ini +@@ -3,6 +3,7 @@ support-files = + head.js + head_pageAction.js + head_sessions.js ++ head_webNavigation.js + profilerSymbols.sjs + context.html + context_frame.html +@@ -171,6 +172,8 @@ skip-if = true # Bug 1398514 + [browser_ext_webNavigation_getFrames.js] + [browser_ext_webNavigation_onCreatedNavigationTarget.js] + [browser_ext_webNavigation_onCreatedNavigationTarget_contextmenu.js] ++[browser_ext_webNavigation_onCreatedNavigationTarget_named_window.js] ++[browser_ext_webNavigation_onCreatedNavigationTarget_subframe_window_open.js] + [browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js] + [browser_ext_webNavigation_urlbar_transitions.js] + [browser_ext_windows.js] +diff --git browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget.js browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget.js +index 2c17f9e711f8..47d8b0a8c65a 100644 +--- browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget.js ++++ browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget.js +@@ -2,9 +2,8 @@ + /* vim: set sts=2 sw=2 et tw=80: */ + "use strict"; + +-const BASE_URL = "http://mochi.test:8888/browser/browser/components/extensions/test/browser"; +-const SOURCE_PAGE = `${BASE_URL}/webNav_createdTargetSource.html`; +-const OPENED_PAGE = `${BASE_URL}/webNav_createdTarget.html`; ++Services.scriptloader.loadSubScript(new URL("head_webNavigation.js", gTestPath).href, ++ this); + + async function background() { + const tabs = await browser.tabs.query({active: true, currentWindow: true}); +@@ -34,24 +33,6 @@ async function background() { + }); + } + +-async function runTestCase({extension, openNavTarget, expectedWebNavProps}) { +- await openNavTarget(); +- +- const webNavMsg = await extension.awaitMessage("webNavOnCreated"); +- const createdTabId = await extension.awaitMessage("tabsOnCreated"); +- const completedNavMsg = await extension.awaitMessage("webNavOnCompleted"); +- +- let {sourceTabId, sourceFrameId, url} = expectedWebNavProps; +- +- is(webNavMsg.tabId, createdTabId, "Got the expected tabId property"); +- is(webNavMsg.sourceTabId, sourceTabId, "Got the expected sourceTabId property"); +- is(webNavMsg.sourceFrameId, sourceFrameId, "Got the expected sourceFrameId property"); +- is(webNavMsg.url, url, "Got the expected url property"); +- +- is(completedNavMsg.tabId, createdTabId, "Got the expected webNavigation.onCompleted tabId property"); +- is(completedNavMsg.url, url, "Got the expected webNavigation.onCompleted url property"); +-} +- + add_task(async function test_on_created_navigation_target_from_mouse_click() { + const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); + +@@ -68,7 +49,7 @@ add_task(async function test_on_created_navigation_target_from_mouse_click() { + + info("Open link in a new tab using Ctrl-click"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + openNavTarget() { + BrowserTestUtils.synthesizeMouseAtCenter("#test-create-new-tab-from-mouse-click", +@@ -84,7 +65,7 @@ add_task(async function test_on_created_navigation_target_from_mouse_click() { + + info("Open link in a new window using Shift-click"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + openNavTarget() { + BrowserTestUtils.synthesizeMouseAtCenter("#test-create-new-window-from-mouse-click", +@@ -100,7 +81,7 @@ add_task(async function test_on_created_navigation_target_from_mouse_click() { + + info("Open link with target=\"_blank\" in a new tab using click"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + openNavTarget() { + BrowserTestUtils.synthesizeMouseAtCenter("#test-create-new-tab-from-targetblank-click", +@@ -135,7 +116,7 @@ add_task(async function test_on_created_navigation_target_from_mouse_click_subfr + + info("Open a subframe link in a new tab using Ctrl-click"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + openNavTarget() { + BrowserTestUtils.synthesizeMouseAtCenter(function() { +@@ -154,7 +135,7 @@ add_task(async function test_on_created_navigation_target_from_mouse_click_subfr + + info("Open a subframe link in a new window using Shift-click"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + openNavTarget() { + BrowserTestUtils.synthesizeMouseAtCenter(function() { +@@ -173,7 +154,7 @@ add_task(async function test_on_created_navigation_target_from_mouse_click_subfr + + info("Open a subframe link with target=\"_blank\" in a new tab using click"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + openNavTarget() { + BrowserTestUtils.synthesizeMouseAtCenter(function() { +@@ -194,4 +175,3 @@ add_task(async function test_on_created_navigation_target_from_mouse_click_subfr + + await extension.unload(); + }); +- +diff --git browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_contextmenu.js browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_contextmenu.js +index 670dad87f1e4..e29fccf57a5b 100644 +--- browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_contextmenu.js ++++ browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_contextmenu.js +@@ -2,9 +2,16 @@ + /* vim: set sts=2 sw=2 et tw=80: */ + "use strict"; + +-const BASE_URL = "http://mochi.test:8888/browser/browser/components/extensions/test/browser"; +-const SOURCE_PAGE = `${BASE_URL}/webNav_createdTargetSource.html`; +-const OPENED_PAGE = `${BASE_URL}/webNav_createdTarget.html`; ++Services.scriptloader.loadSubScript(new URL("head_webNavigation.js", gTestPath).href, ++ this); ++ ++async function clickContextMenuItem({pageElementSelector, contextMenuItemLabel}) { ++ const contentAreaContextMenu = await openContextMenu(pageElementSelector); ++ const item = contentAreaContextMenu.getElementsByAttribute("label", contextMenuItemLabel); ++ is(item.length, 1, `found contextMenu item for "${contextMenuItemLabel}"`); ++ item[0].click(); ++ await closeContextMenu(); ++} + + async function background() { + const tabs = await browser.tabs.query({active: true, currentWindow: true}); +@@ -34,32 +41,6 @@ async function background() { + }); + } + +-async function runTestCase({extension, openNavTarget, expectedWebNavProps}) { +- await openNavTarget(); +- +- const webNavMsg = await extension.awaitMessage("webNavOnCreated"); +- const createdTabId = await extension.awaitMessage("tabsOnCreated"); +- const completedNavMsg = await extension.awaitMessage("webNavOnCompleted"); +- +- let {sourceTabId, sourceFrameId, url} = expectedWebNavProps; +- +- is(webNavMsg.tabId, createdTabId, "Got the expected tabId property"); +- is(webNavMsg.sourceTabId, sourceTabId, "Got the expected sourceTabId property"); +- is(webNavMsg.sourceFrameId, sourceFrameId, "Got the expected sourceFrameId property"); +- is(webNavMsg.url, url, "Got the expected url property"); +- +- is(completedNavMsg.tabId, createdTabId, "Got the expected webNavigation.onCompleted tabId property"); +- is(completedNavMsg.url, url, "Got the expected webNavigation.onCompleted url property"); +-} +- +-async function clickContextMenuItem({pageElementSelector, contextMenuItemLabel}) { +- const contentAreaContextMenu = await openContextMenu(pageElementSelector); +- const item = contentAreaContextMenu.getElementsByAttribute("label", contextMenuItemLabel); +- is(item.length, 1, `found contextMenu item for "${contextMenuItemLabel}"`); +- item[0].click(); +- await closeContextMenu(); +-} +- + add_task(async function test_on_created_navigation_target_from_context_menu() { + const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); + +@@ -76,7 +57,7 @@ add_task(async function test_on_created_navigation_target_from_context_menu() { + + info("Open link in a new tab from the context menu"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + async openNavTarget() { + await clickContextMenuItem({ +@@ -93,7 +74,7 @@ add_task(async function test_on_created_navigation_target_from_context_menu() { + + info("Open link in a new window from the context menu"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + async openNavTarget() { + await clickContextMenuItem({ +@@ -129,7 +110,7 @@ add_task(async function test_on_created_navigation_target_from_context_menu_subf + + info("Open a subframe link in a new tab from the context menu"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + async openNavTarget() { + await clickContextMenuItem({ +@@ -151,7 +132,7 @@ add_task(async function test_on_created_navigation_target_from_context_menu_subf + + info("Open a subframe link in a new window from the context menu"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + async openNavTarget() { + await clickContextMenuItem({ +diff --git browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_named_window.js browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_named_window.js +new file mode 100644 +index 000000000000..9888bfb23da6 +--- /dev/null ++++ browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_named_window.js +@@ -0,0 +1,97 @@ ++/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ ++/* vim: set sts=2 sw=2 et tw=80: */ ++"use strict"; ++ ++Services.scriptloader.loadSubScript(new URL("head_webNavigation.js", gTestPath).href, ++ this); ++ ++async function background() { ++ const tabs = await browser.tabs.query({active: true, currentWindow: true}); ++ const sourceTabId = tabs[0].id; ++ ++ const sourceTabFrames = await browser.webNavigation.getAllFrames({tabId: sourceTabId}); ++ ++ browser.webNavigation.onCreatedNavigationTarget.addListener((msg) => { ++ browser.test.sendMessage("webNavOnCreated", msg); ++ }); ++ ++ browser.webNavigation.onCompleted.addListener(async (msg) => { ++ // NOTE: checking the url is currently necessary because of Bug 1252129 ++ // ( Filter out webNavigation events related to new window initialization phase). ++ if (msg.tabId !== sourceTabId && msg.url !== "about:blank") { ++ await browser.tabs.remove(msg.tabId); ++ browser.test.sendMessage("webNavOnCompleted", msg); ++ } ++ }); ++ ++ browser.tabs.onCreated.addListener((tab) => { ++ browser.test.sendMessage("tabsOnCreated", tab.id); ++ }); ++ ++ browser.test.onMessage.addListener(({type, code}) => { ++ if (type === "execute-contentscript") { ++ browser.tabs.executeScript(sourceTabId, {code: code}); ++ } ++ }); ++ ++ browser.test.sendMessage("expectedSourceTab", { ++ sourceTabId, sourceTabFrames, ++ }); ++} ++ ++add_task(async function test_window_open_in_named_win() { ++ const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); ++ ++ gBrowser.selectedTab = tab1; ++ ++ const extension = ExtensionTestUtils.loadExtension({ ++ background, ++ manifest: { ++ permissions: ["webNavigation", "tabs", ""], ++ }, ++ }); ++ ++ await extension.startup(); ++ ++ const expectedSourceTab = await extension.awaitMessage("expectedSourceTab"); ++ ++ info("open a url in a new named window from a window.open call"); ++ ++ await runCreatedNavigationTargetTest({ ++ extension, ++ openNavTarget() { ++ extension.sendMessage({ ++ type: "execute-contentscript", ++ code: `window.open("${OPENED_PAGE}#new-named-window-open", "TestWinName"); true;`, ++ }); ++ }, ++ expectedWebNavProps: { ++ sourceTabId: expectedSourceTab.sourceTabId, ++ sourceFrameId: 0, ++ url: `${OPENED_PAGE}#new-named-window-open`, ++ }, ++ }); ++ ++ info("open a url in an existent named window from a window.open call"); ++ ++ await runCreatedNavigationTargetTest({ ++ extension, ++ openNavTarget() { ++ extension.sendMessage({ ++ type: "execute-contentscript", ++ code: `window.open("${OPENED_PAGE}#existent-named-window-open", "TestWinName"); true;`, ++ }); ++ }, ++ expectedWebNavProps: { ++ sourceTabId: expectedSourceTab.sourceTabId, ++ sourceFrameId: 0, ++ url: `${OPENED_PAGE}#existent-named-window-open`, ++ }, ++ }); ++ ++ assertNoPendingCreatedNavigationTargetData(); ++ ++ await BrowserTestUtils.removeTab(tab1); ++ ++ await extension.unload(); ++}); +diff --git browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_subframe_window_open.js browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_subframe_window_open.js +new file mode 100644 +index 000000000000..147c943f7102 +--- /dev/null ++++ browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_subframe_window_open.js +@@ -0,0 +1,163 @@ ++/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ ++/* vim: set sts=2 sw=2 et tw=80: */ ++"use strict"; ++ ++Services.scriptloader.loadSubScript(new URL("head_webNavigation.js", gTestPath).href, ++ this); ++ ++async function background() { ++ const tabs = await browser.tabs.query({active: true, currentWindow: true}); ++ const sourceTabId = tabs[0].id; ++ ++ const sourceTabFrames = await browser.webNavigation.getAllFrames({tabId: sourceTabId}); ++ ++ browser.webNavigation.onCreatedNavigationTarget.addListener((msg) => { ++ browser.test.sendMessage("webNavOnCreated", msg); ++ }); ++ ++ browser.webNavigation.onCompleted.addListener(async (msg) => { ++ // NOTE: checking the url is currently necessary because of Bug 1252129 ++ // ( Filter out webNavigation events related to new window initialization phase). ++ if (msg.tabId !== sourceTabId && msg.url !== "about:blank") { ++ await browser.tabs.remove(msg.tabId); ++ browser.test.sendMessage("webNavOnCompleted", msg); ++ } ++ }); ++ ++ browser.tabs.onCreated.addListener((tab) => { ++ browser.test.sendMessage("tabsOnCreated", tab.id); ++ }); ++ ++ browser.test.onMessage.addListener(({type, code}) => { ++ if (type === "execute-contentscript") { ++ browser.tabs.executeScript(sourceTabId, {code: code}); ++ } ++ }); ++ ++ browser.test.sendMessage("expectedSourceTab", { ++ sourceTabId, sourceTabFrames, ++ }); ++} ++ ++add_task(async function test_window_open_from_subframe() { ++ const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); ++ ++ gBrowser.selectedTab = tab1; ++ ++ const extension = ExtensionTestUtils.loadExtension({ ++ background, ++ manifest: { ++ permissions: ["webNavigation", "tabs", ""], ++ }, ++ }); ++ ++ await extension.startup(); ++ ++ const expectedSourceTab = await extension.awaitMessage("expectedSourceTab"); ++ ++ info("open a url in a new tab from subframe window.open call"); ++ ++ await runCreatedNavigationTargetTest({ ++ extension, ++ openNavTarget() { ++ extension.sendMessage({ ++ type: "execute-contentscript", ++ code: `document.querySelector('iframe').contentWindow.open("${OPENED_PAGE}#new-tab-from-window-open-subframe"); true;`, ++ }); ++ }, ++ expectedWebNavProps: { ++ sourceTabId: expectedSourceTab.sourceTabId, ++ sourceFrameId: expectedSourceTab.sourceTabFrames[1].frameId, ++ url: `${OPENED_PAGE}#new-tab-from-window-open-subframe`, ++ }, ++ }); ++ ++ info("open a url in a new window from subframe window.open call"); ++ ++ await runCreatedNavigationTargetTest({ ++ extension, ++ openNavTarget() { ++ extension.sendMessage({ ++ type: "execute-contentscript", ++ code: `document.querySelector('iframe').contentWindow.open("${OPENED_PAGE}#new-win-from-window-open-subframe", "_blank", "toolbar=0"); true;`, ++ }); ++ }, ++ expectedWebNavProps: { ++ sourceTabId: expectedSourceTab.sourceTabId, ++ sourceFrameId: expectedSourceTab.sourceTabFrames[1].frameId, ++ url: `${OPENED_PAGE}#new-win-from-window-open-subframe`, ++ }, ++ }); ++ ++ assertNoPendingCreatedNavigationTargetData(); ++ ++ await BrowserTestUtils.removeTab(tab1); ++ ++ await extension.unload(); ++}); ++ ++add_task(async function test_window_open_close_from_browserAction_popup() { ++ const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); ++ ++ gBrowser.selectedTab = tab1; ++ ++ function popup() { ++ window.open("", "_self").close(); ++ ++ browser.test.sendMessage("browserAction_popup_executed"); ++ } ++ ++ const extension = ExtensionTestUtils.loadExtension({ ++ background, ++ manifest: { ++ browser_action: { ++ default_popup: "popup.html", ++ }, ++ permissions: ["webNavigation", "tabs", ""], ++ }, ++ files: { ++ "popup.html": ` ++ ++ ++ ++ ++ ++ ++ ++ ++ `, ++ "popup.js": popup, ++ }, ++ }); ++ ++ await extension.startup(); ++ ++ const expectedSourceTab = await extension.awaitMessage("expectedSourceTab"); ++ ++ clickBrowserAction(extension); ++ ++ await extension.awaitMessage("browserAction_popup_executed"); ++ ++ info("open a url in a new tab from a window.open call"); ++ ++ await runCreatedNavigationTargetTest({ ++ extension, ++ openNavTarget() { ++ extension.sendMessage({ ++ type: "execute-contentscript", ++ code: `window.open("${OPENED_PAGE}#new-tab-from-window-open"); true;`, ++ }); ++ }, ++ expectedWebNavProps: { ++ sourceTabId: expectedSourceTab.sourceTabId, ++ sourceFrameId: 0, ++ url: `${OPENED_PAGE}#new-tab-from-window-open`, ++ }, ++ }); ++ ++ assertNoPendingCreatedNavigationTargetData(); ++ ++ await BrowserTestUtils.removeTab(tab1); ++ ++ await extension.unload(); ++}); +diff --git browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js +index 232b9321fcd3..b56097e44484 100644 +--- browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js ++++ browser/components/extensions/test/browser/browser_ext_webNavigation_onCreatedNavigationTarget_window_open.js +@@ -2,9 +2,8 @@ + /* vim: set sts=2 sw=2 et tw=80: */ + "use strict"; + +-const BASE_URL = "http://mochi.test:8888/browser/browser/components/extensions/test/browser"; +-const SOURCE_PAGE = `${BASE_URL}/webNav_createdTargetSource.html`; +-const OPENED_PAGE = `${BASE_URL}/webNav_createdTarget.html`; ++Services.scriptloader.loadSubScript(new URL("head_webNavigation.js", gTestPath).href, ++ this); + + async function background() { + const tabs = await browser.tabs.query({active: true, currentWindow: true}); +@@ -40,34 +39,6 @@ async function background() { + }); + } + +-async function runTestCase({extension, openNavTarget, expectedWebNavProps}) { +- await openNavTarget(); +- +- const webNavMsg = await extension.awaitMessage("webNavOnCreated"); +- const createdTabId = await extension.awaitMessage("tabsOnCreated"); +- const completedNavMsg = await extension.awaitMessage("webNavOnCompleted"); +- +- let {sourceTabId, sourceFrameId, url} = expectedWebNavProps; +- +- is(webNavMsg.tabId, createdTabId, "Got the expected tabId property"); +- is(webNavMsg.sourceTabId, sourceTabId, "Got the expected sourceTabId property"); +- is(webNavMsg.sourceFrameId, sourceFrameId, "Got the expected sourceFrameId property"); +- is(webNavMsg.url, url, "Got the expected url property"); +- +- is(completedNavMsg.tabId, createdTabId, "Got the expected webNavigation.onCompleted tabId property"); +- is(completedNavMsg.url, url, "Got the expected webNavigation.onCompleted url property"); +-} +- +-// Test that there are no pending createdNavigationTarget messages still tracked +-// in WebNavigation.jsm (to be called before the extension is unloaded, because +-// once the last extension which have subscribed a webNavigation event is unloaded +-// all the pending created navigation target data is completely cleared). +-function assertNoPendingCreatedNavigationTargetData() { +- const {Manager} = Cu.import("resource://gre/modules/WebNavigation.jsm", {}); +- Assert.equal(Manager.createdNavigationTargetByOuterWindowId.size, 0, +- "There should be no pending createdNavigationTarget messages in WebNavigation"); +-} +- + add_task(async function test_window_open() { + const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); + +@@ -86,7 +57,7 @@ add_task(async function test_window_open() { + + info("open a url in a new tab from a window.open call"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + openNavTarget() { + extension.sendMessage({ +@@ -103,7 +74,7 @@ add_task(async function test_window_open() { + + info("open a url in a new window from a window.open call"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + openNavTarget() { + extension.sendMessage({ +@@ -125,63 +96,6 @@ add_task(async function test_window_open() { + await extension.unload(); + }); + +-add_task(async function test_window_open_from_subframe() { +- const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); +- +- gBrowser.selectedTab = tab1; +- +- const extension = ExtensionTestUtils.loadExtension({ +- background, +- manifest: { +- permissions: ["webNavigation", "tabs", ""], +- }, +- }); +- +- await extension.startup(); +- +- const expectedSourceTab = await extension.awaitMessage("expectedSourceTab"); +- +- info("open a url in a new tab from subframe window.open call"); +- +- await runTestCase({ +- extension, +- openNavTarget() { +- extension.sendMessage({ +- type: "execute-contentscript", +- code: `document.querySelector('iframe').contentWindow.open("${OPENED_PAGE}#new-tab-from-window-open-subframe"); true;`, +- }); +- }, +- expectedWebNavProps: { +- sourceTabId: expectedSourceTab.sourceTabId, +- sourceFrameId: expectedSourceTab.sourceTabFrames[1].frameId, +- url: `${OPENED_PAGE}#new-tab-from-window-open-subframe`, +- }, +- }); +- +- info("open a url in a new window from subframe window.open call"); +- +- await runTestCase({ +- extension, +- openNavTarget() { +- extension.sendMessage({ +- type: "execute-contentscript", +- code: `document.querySelector('iframe').contentWindow.open("${OPENED_PAGE}#new-win-from-window-open-subframe", "_blank", "toolbar=0"); true;`, +- }); +- }, +- expectedWebNavProps: { +- sourceTabId: expectedSourceTab.sourceTabId, +- sourceFrameId: expectedSourceTab.sourceTabFrames[1].frameId, +- url: `${OPENED_PAGE}#new-win-from-window-open-subframe`, +- }, +- }); +- +- assertNoPendingCreatedNavigationTargetData(); +- +- await BrowserTestUtils.removeTab(tab1); +- +- await extension.unload(); +-}); +- + add_task(async function test_window_open_close_from_browserAction_popup() { + const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); + +@@ -226,7 +140,7 @@ add_task(async function test_window_open_close_from_browserAction_popup() { + + info("open a url in a new tab from a window.open call"); + +- await runTestCase({ ++ await runCreatedNavigationTargetTest({ + extension, + openNavTarget() { + extension.sendMessage({ +@@ -247,60 +161,3 @@ add_task(async function test_window_open_close_from_browserAction_popup() { + + await extension.unload(); + }); +- +-add_task(async function test_window_open_in_named_win() { +- const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, SOURCE_PAGE); +- +- gBrowser.selectedTab = tab1; +- +- const extension = ExtensionTestUtils.loadExtension({ +- background, +- manifest: { +- permissions: ["webNavigation", "tabs", ""], +- }, +- }); +- +- await extension.startup(); +- +- const expectedSourceTab = await extension.awaitMessage("expectedSourceTab"); +- +- info("open a url in a new named window from a window.open call"); +- +- await runTestCase({ +- extension, +- openNavTarget() { +- extension.sendMessage({ +- type: "execute-contentscript", +- code: `window.open("${OPENED_PAGE}#new-named-window-open", "TestWinName"); true;`, +- }); +- }, +- expectedWebNavProps: { +- sourceTabId: expectedSourceTab.sourceTabId, +- sourceFrameId: 0, +- url: `${OPENED_PAGE}#new-named-window-open`, +- }, +- }); +- +- info("open a url in an existent named window from a window.open call"); +- +- await runTestCase({ +- extension, +- openNavTarget() { +- extension.sendMessage({ +- type: "execute-contentscript", +- code: `window.open("${OPENED_PAGE}#existent-named-window-open", "TestWinName"); true;`, +- }); +- }, +- expectedWebNavProps: { +- sourceTabId: expectedSourceTab.sourceTabId, +- sourceFrameId: 0, +- url: `${OPENED_PAGE}#existent-named-window-open`, +- }, +- }); +- +- assertNoPendingCreatedNavigationTargetData(); +- +- await BrowserTestUtils.removeTab(tab1); +- +- await extension.unload(); +-}); +diff --git browser/components/extensions/test/browser/head_webNavigation.js browser/components/extensions/test/browser/head_webNavigation.js +new file mode 100644 +index 000000000000..a98ccd9934ba +--- /dev/null ++++ browser/components/extensions/test/browser/head_webNavigation.js +@@ -0,0 +1,39 @@ ++/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ ++/* vim: set sts=2 sw=2 et tw=80: */ ++"use strict"; ++ ++/* exported BASE_URL, SOURCE_PAGE, OPENED_PAGE, ++ runCreatedNavigationTargetTest, assertNoPendingCreatedNavigationTargetData */ ++ ++const BASE_URL = "http://mochi.test:8888/browser/browser/components/extensions/test/browser"; ++const SOURCE_PAGE = `${BASE_URL}/webNav_createdTargetSource.html`; ++const OPENED_PAGE = `${BASE_URL}/webNav_createdTarget.html`; ++ ++async function runCreatedNavigationTargetTest({extension, openNavTarget, expectedWebNavProps}) { ++ await openNavTarget(); ++ ++ const webNavMsg = await extension.awaitMessage("webNavOnCreated"); ++ const createdTabId = await extension.awaitMessage("tabsOnCreated"); ++ const completedNavMsg = await extension.awaitMessage("webNavOnCompleted"); ++ ++ let {sourceTabId, sourceFrameId, url} = expectedWebNavProps; ++ ++ is(webNavMsg.tabId, createdTabId, "Got the expected tabId property"); ++ is(webNavMsg.sourceTabId, sourceTabId, "Got the expected sourceTabId property"); ++ is(webNavMsg.sourceFrameId, sourceFrameId, "Got the expected sourceFrameId property"); ++ is(webNavMsg.url, url, "Got the expected url property"); ++ ++ is(completedNavMsg.tabId, createdTabId, "Got the expected webNavigation.onCompleted tabId property"); ++ is(completedNavMsg.url, url, "Got the expected webNavigation.onCompleted url property"); ++} ++ ++ ++// Test that there are no pending createdNavigationTarget messages still tracked ++// in WebNavigation.jsm (to be called before the extension is unloaded, because ++// once the last extension which have subscribed a webNavigation event is unloaded ++// all the pending created navigation target data is completely cleared). ++function assertNoPendingCreatedNavigationTargetData() { ++ const {Manager} = Cu.import("resource://gre/modules/WebNavigation.jsm", {}); ++ Assert.equal(Manager.createdNavigationTargetByOuterWindowId.size, 0, ++ "There should be no pending createdNavigationTarget messages in WebNavigation"); ++} Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1403349 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1403466 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1403466 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1403466 (revision 461027) @@ -0,0 +1,50 @@ +commit 0d4a6317df44 +Author: Mike de Boer +Date: Tue Oct 10 12:44:04 2017 +0200 + + Bug 1403466 - Don't set a max-height on panelviews used by WebExtensions, because it causes browser contents to be cut-off. r=Gijs, a=ritu + + Setting a max-height caused the '_handleDOMChange' method in ext-browser-content.js + to consistently lie about the scrollHeight, since it was never allowed to grow + beyond the maxHeight - even when the document needs to be larger to fit its contents. + We don't need this aggressiveness in Photon panels anyway, so that makes it + doubly safe to remove this code. + + MozReview-Commit-ID: HJVMXXHS4By + + --HG-- + extra : source : cd62fb50fe61504937ff3d37db3852bae0d73d0c +--- + browser/components/extensions/ExtensionPopups.jsm | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) + +diff --git browser/components/extensions/ExtensionPopups.jsm browser/components/extensions/ExtensionPopups.jsm +index 5ac4f43943f1..cc02e48b32dd 100644 +--- browser/components/extensions/ExtensionPopups.jsm ++++ browser/components/extensions/ExtensionPopups.jsm +@@ -123,7 +123,6 @@ class BasePopup { + + if (this.viewNode) { + this.viewNode.removeEventListener(this.DESTROY_EVENT, this); +- this.viewNode.style.maxHeight = ""; + delete this.viewNode.customRectGetter; + } + +@@ -331,16 +330,9 @@ class BasePopup { + height = Math.min(height, maxHeight); + this.browser.style.height = `${height}px`; + +- // Set a maximum height on the element to our preferred +- // maximum height, so that the PanelUI resizing code can make an accurate +- // calculation. If we don't do this, the flex sizing logic will prevent us +- // from ever reporting a preferred size smaller than the height currently +- // available to us in the panel. +- height = Math.max(height, this.viewHeight); +- this.viewNode.style.maxHeight = `${height}px`; + // Used by the panelmultiview code to figure out sizing without reparenting + // (which would destroy the browser and break us). +- this.lastCalculatedInViewHeight = height; ++ this.lastCalculatedInViewHeight = Math.max(height, this.viewHeight); + } else { + this.browser.style.width = `${width}px`; + this.browser.style.minWidth = `${width}px`; Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1403466 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1404568 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1404568 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1404568 (revision 461027) @@ -0,0 +1,120 @@ +commit 7d205a638012 +Author: Ian Moody +Date: Sun Oct 8 13:23:33 2017 +0100 + + Bug 1404568 - Improve webext browser_action icon fallbacks. r=mixedpuppy, a=ritu + + Currently if there is no default icon at the specified size, the default icon + falls back to the light text icon at that size. This is wrong in two ways: + First, the default theme uses dark text, so it should fallback to the dark icon + Secondly, authors expect the unsized default_icon to be used if specified + + This patch fixes both of these issues, so that the default icon first falls back + to the unsized default_icon, and then only if that is not specified falls back + to the dark icon + + MozReview-Commit-ID: C3RRTKhYq6r + + --HG-- + extra : source : ca81275884eb6147bd1022779fcac81fa0930128 +--- + .../extensions/test/browser/browser_ext_browserAction_theme_icons.js | 4 ++-- + toolkit/components/extensions/ExtensionParent.jsm | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git browser/components/extensions/test/browser/browser_ext_browserAction_theme_icons.js browser/components/extensions/test/browser/browser_ext_browserAction_theme_icons.js +index 05d8474ab2b6..b910568e0f78 100644 +--- browser/components/extensions/test/browser/browser_ext_browserAction_theme_icons.js ++++ browser/components/extensions/test/browser/browser_ext_browserAction_theme_icons.js +@@ -46,7 +46,7 @@ async function testStaticTheme(options) { + await extension.startup(); + + // Confirm that the browser action has the correct default icon before a theme is loaded. +- let expectedDefaultIcon = withDefaultIcon ? "default.png" : "light.png"; ++ let expectedDefaultIcon = withDefaultIcon ? "default.png" : "dark.png"; + await testBrowserAction(extension, expectedDefaultIcon); + + let theme = ExtensionTestUtils.loadExtension({ +@@ -164,7 +164,7 @@ add_task(async function browseraction_theme_icons_dynamic_theme() { + "theme_icons": [{ + "light": "light.png", + "dark": "dark.png", +- "size": 19, ++ "size": 16, + }], + }, + }, +diff --git toolkit/components/extensions/ExtensionParent.jsm toolkit/components/extensions/ExtensionParent.jsm +index e608ff2d19c6..75df6a285195 100644 +--- toolkit/components/extensions/ExtensionParent.jsm ++++ toolkit/components/extensions/ExtensionParent.jsm +@@ -1306,9 +1306,9 @@ let IconDetails = { + this._checkURL(lightURL, extension); + this._checkURL(darkURL, extension); + +- let defaultURL = result[size]; ++ let defaultURL = result[size] || result[19]; // always fallback to default first + result[size] = { +- "default": defaultURL || lightURL, // Fallback to the light url if no default is specified. ++ "default": defaultURL || darkURL, // Fallback to the dark url if no default is specified. + "light": lightURL, + "dark": darkURL, + }; + +commit 1cceb370d13c +Author: Ian Moody +Date: Wed Oct 4 01:40:45 2017 +0100 + + Bug 1404568 - Use the correct browser_action theme icons when the action is in a menu-panel. r=mixedpuppy, a=ritu + + The patch adding support for specifying theme icons had a bug in the CSS: it + added styles for the action in a menu-panel depending on theme, but missed out + the theme pseudo-class selectors. Therefore the dark text icon was always used + since it was last in the CSS. + Additionally, the menu panels can't be styled, so still have light backgrounds + and dark text even in light text themes. If a light icon is used in the menu + panel in a light text theme it will be hard to see. + + Thus, this patch adds the pseudo-class for dark text themes, but removes the + selector entirely for light text themes. + + MozReview-Commit-ID: AmKVDYwGGKj + + --HG-- + extra : source : 38347dff77997359905b6efc1f6061e4103431d6 +--- + browser/base/content/browser.css | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git browser/base/content/browser.css browser/base/content/browser.css +index bbd7310f55d0..fe940cf58408 100644 +--- browser/base/content/browser.css ++++ browser/base/content/browser.css +@@ -377,12 +377,11 @@ toolbarpaletteitem > toolbaritem[sdkstylewidget="true"][cui-areatype="toolbar"] + list-style-image: var(--webextension-menupanel-image, inherit); + } + +- .webextension-browser-action[cui-areatype="menu-panel"], + toolbarpaletteitem[place="palette"] > .webextension-browser-action:-moz-lwtheme-brighttext { + list-style-image: var(--webextension-menupanel-image-light, inherit); + } + +- .webextension-browser-action[cui-areatype="menu-panel"], ++ .webextension-browser-action[cui-areatype="menu-panel"]:-moz-lwtheme-darktext, + toolbarpaletteitem[place="palette"] > .webextension-browser-action:-moz-lwtheme-darktext { + list-style-image: var(--webextension-menupanel-image-dark, inherit); + } +@@ -414,12 +413,11 @@ toolbarpaletteitem > toolbaritem[sdkstylewidget="true"][cui-areatype="toolbar"] + list-style-image: var(--webextension-menupanel-image-2x, inherit); + } + +- .webextension-browser-action[cui-areatype="menu-panel"], + toolbarpaletteitem[place="palette"] > .webextension-browser-action:-moz-lwtheme-brighttext { + list-style-image: var(--webextension-menupanel-image-2x-light, inherit); + } + +- .webextension-browser-action[cui-areatype="menu-panel"], ++ .webextension-browser-action[cui-areatype="menu-panel"]:-moz-lwtheme-darktext, + toolbarpaletteitem[place="palette"] > .webextension-browser-action:-moz-lwtheme-darktext { + list-style-image: var(--webextension-menupanel-image-2x-dark, inherit); + } Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1404568 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1404651 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1404651 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1404651 (revision 461027) @@ -0,0 +1,39 @@ +commit 698e5f304f4b +Author: Gijs Kruitbosch +Date: Wed Oct 4 13:29:53 2017 +0100 + + Bug 1404651 - Keep focus in the tabstrip when the focus has shifted with the arrow keys. r=dao, a=ritu + + MozReview-Commit-ID: Brm9jImW9bc + + --HG-- + extra : source : 0304a90aee90618165af50193ea6255c54a6b9ea +--- + browser/base/content/tabbrowser.xml | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git browser/base/content/tabbrowser.xml browser/base/content/tabbrowser.xml +index 37efdcc5bc0c..4f40e45f2446 100644 +--- browser/base/content/tabbrowser.xml ++++ browser/base/content/tabbrowser.xml +@@ -1417,13 +1417,14 @@ + findBar._findField.getAttribute("focused") == "true"); + } + +- // If focus is in the tab bar, retain it there. +- if (document.activeElement == oldTab) { +- // We need to explicitly focus the new tab, because +- // tabbox.xml does this only in some cases. ++ let activeEl = document.activeElement; ++ // If focus is on the old tab, move it to the new tab. ++ if (activeEl == oldTab) { + newTab.focus(); +- } else if (gMultiProcessBrowser && document.activeElement !== newBrowser) { +- ++ } else if (gMultiProcessBrowser && activeEl != newBrowser && activeEl != newTab) { ++ // In e10s, if focus isn't already in the tabstrip or on the new browser, ++ // and the new browser's previous focus wasn't in the url bar but focus is ++ // there now, we need to adjust focus further. + let keepFocusOnUrlBar = newBrowser && + newBrowser._urlbarFocused && + gURLBar && Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1404651 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1405199 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1405199 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1405199 (revision 461027) @@ -0,0 +1,45 @@ +commit a8e2534607cc +Author: Honza Bambas +Date: Mon Oct 9 07:50:00 2017 -0400 + + Bug 1405199 - Update result principal URI on the new channel when nsBaseChannel redirects. r=bz, a=ritu + + --HG-- + extra : source : 41697bca82fb1cb74c3617f8c7496cebacf81efc +--- + netwerk/base/nsBaseChannel.cpp | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git netwerk/base/nsBaseChannel.cpp netwerk/base/nsBaseChannel.cpp +index 07a12c8fa5b6..b839bc6e1b7e 100644 +--- netwerk/base/nsBaseChannel.cpp ++++ netwerk/base/nsBaseChannel.cpp +@@ -106,6 +106,28 @@ nsBaseChannel::Redirect(nsIChannel *newChannel, uint32_t redirectFlags, + new nsRedirectHistoryEntry(uriPrincipal, nullptr, EmptyCString()); + + newLoadInfo->AppendRedirectHistoryEntry(entry, isInternalRedirect); ++ ++ // Ensure the channel's loadInfo's result principal URI so that it's ++ // either non-null or updated to the redirect target URI. ++ // We must do this because in case the loadInfo's result principal URI ++ // is null, it would be taken from OriginalURI of the channel. But we ++ // overwrite it with the whole redirect chain first URI before opening ++ // the target channel, hence the information would be lost. ++ // If the protocol handler that created the channel wants to use ++ // the originalURI of the channel as the principal URI, it has left ++ // the result principal URI on the load info null. ++ nsCOMPtr resultPrincipalURI; ++ ++ nsCOMPtr existingLoadInfo = newChannel->GetLoadInfo(); ++ if (existingLoadInfo) { ++ existingLoadInfo->GetResultPrincipalURI(getter_AddRefs(resultPrincipalURI)); ++ } ++ if (!resultPrincipalURI) { ++ newChannel->GetOriginalURI(getter_AddRefs(resultPrincipalURI)); ++ } ++ ++ newLoadInfo->SetResultPrincipalURI(resultPrincipalURI); ++ + newChannel->SetLoadInfo(newLoadInfo); + } + else { Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1405199 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1405655 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1405655 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1405655 (revision 461027) @@ -0,0 +1,256 @@ +commit 5b5983d8528a +Author: Felipe Gomes +Date: Tue Oct 17 12:10:31 2017 -0200 + + Bug 1405655 - Only hide Flash Activation overlay UI if the entire plugin is covered. r=dthayer, a=ritu + + As opposed to right now where we hide if any of the corners or the center of the plugin is covered. + + MozReview-Commit-ID: 9mOVXYyV1Il + + --HG-- + extra : source : a6aaaf9cb7d3a4f3baa430cfa88671f0acabed6c +--- + browser/base/content/test/plugins/browser.ini | 2 + + .../test/plugins/browser_CTP_shouldShowOverlay.js | 56 ++++++++++ + .../test/plugins/plugin_shouldShowOverlay.html | 116 +++++++++++++++++++++ + browser/modules/PluginContent.jsm | 13 ++- + 4 files changed, 180 insertions(+), 7 deletions(-) + +diff --git browser/base/content/test/plugins/browser.ini browser/base/content/test/plugins/browser.ini +index 56f5fba1a9d0..9b3a518ecb7c 100644 +--- browser/base/content/test/plugins/browser.ini ++++ browser/base/content/test/plugins/browser.ini +@@ -29,6 +29,7 @@ support-files = + plugin_overlayed.html + plugin_positioned.html + plugin_simple_blank.swf ++ plugin_shouldShowOverlay.html + plugin_small.html + plugin_small_2.html + plugin_syncRemoved.html +@@ -76,6 +77,7 @@ tags = blocklist + tags = blocklist + [browser_CTP_resize.js] + tags = blocklist ++[browser_CTP_shouldShowOverlay.js] + [browser_CTP_zoom.js] + tags = blocklist + [browser_blocking.js] +diff --git browser/base/content/test/plugins/browser_CTP_shouldShowOverlay.js browser/base/content/test/plugins/browser_CTP_shouldShowOverlay.js +new file mode 100644 +index 000000000000..6af674a0e5b2 +--- /dev/null ++++ browser/base/content/test/plugins/browser_CTP_shouldShowOverlay.js +@@ -0,0 +1,56 @@ ++/* 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 test ensures that the click-to-play "Activate Plugin" overlay ++ * is shown when expected. ++ * All testcases are in the plugin_shouldShowOverlay.html file. ++ */ ++ ++var rootDir = getRootDirectory(gTestPath); ++const gTestRoot = rootDir.replace("chrome://mochitests/content/", "http://127.0.0.1:8888/"); ++ ++var gTestBrowser = null; ++ ++add_task(async function() { ++ registerCleanupFunction(function() { ++ clearAllPluginPermissions(); ++ setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); ++ gBrowser.removeCurrentTab(); ++ gTestBrowser = null; ++ }); ++}); ++ ++add_task(async function() { ++ gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); ++ gTestBrowser = gBrowser.selectedBrowser; ++ ++ setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in"); ++ ++ let popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser); ++ ok(!popupNotification, "Sanity check, should not have a click-to-play notification"); ++ ++ await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_shouldShowOverlay.html"); ++ ++ // Work around for delayed PluginBindingAttached ++ await promiseUpdatePluginBindings(gTestBrowser); ++ ++ await ContentTask.spawn(gTestBrowser, null, async function() { ++ let doc = content.document; ++ let testcases = doc.querySelectorAll(".testcase"); ++ ++ for (let testcase of testcases) { ++ let plugin = testcase.querySelector("object"); ++ Assert.ok(plugin, `plugin exists in ${testcase.id}`); ++ ++ let overlay = doc.getAnonymousElementByAttribute(plugin, "anonid", "main"); ++ Assert.ok(overlay, `overlay exists in ${testcase.id}`); ++ ++ let expectedVisibility = (testcase.getAttribute("shouldshow") == "true"); ++ Assert.ok(overlay.classList.contains("visible") == expectedVisibility, ++ `The expected visibility is correct in ${testcase.id}`); ++ } ++ }) ++}); +diff --git browser/base/content/test/plugins/plugin_shouldShowOverlay.html browser/base/content/test/plugins/plugin_shouldShowOverlay.html +new file mode 100644 +index 000000000000..24d07d164260 +--- /dev/null ++++ browser/base/content/test/plugins/plugin_shouldShowOverlay.html +@@ -0,0 +1,116 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++
++ ++ ++
++ ++
++ ++ ++
++ ++
++ ++ ++
++ ++
++ ++
++ ++
++ ++
++ ++
++ ++
++ ++
++ ++
++ ++
++ ++ ++
++ ++
++ ++
++ ++
++ ++
++ ++
++ ++
++ ++
++
++
++
++ ++
++ ++
++ ++
++
++
++
++ ++
++ ++
++ ++
++
++
++
++
++ ++
++ ++
++ ++
++ ++
++ ++ ++ +diff --git browser/modules/PluginContent.jsm browser/modules/PluginContent.jsm +index 678369d7e3ec..6aec465a2955 100644 +--- browser/modules/PluginContent.jsm ++++ browser/modules/PluginContent.jsm +@@ -330,22 +330,21 @@ PluginContent.prototype = { + [right, bottom], + [centerX, centerY]]; + +- if (right <= 0 || top <= 0) { +- return false; +- } +- + let contentWindow = plugin.ownerGlobal; + let cwu = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindowUtils); + + for (let [x, y] of points) { ++ if (x < 0 || y < 0) { ++ continue; ++ } + let el = cwu.elementFromPoint(x, y, true, true); +- if (el !== plugin) { +- return false; ++ if (el === plugin) { ++ return true; + } + } + +- return true; ++ return false; + }, + + addLinkClickCallback(linkNode, callbackName /* callbackArgs...*/) { Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1405655 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1405761 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1405761 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1405761 (revision 461027) @@ -0,0 +1,109 @@ +commit 0e2ac46fa12c +Author: Dragana Damjanovic +Date: Wed Oct 11 03:20:00 2017 -0400 + + Bug 1405761 - If the preload pref is disabled rel=preload should be shown as not supported. r=smaug, a=ritu + + --HG-- + extra : source : 1f4d35d137631cde34f318fac0c33421d5360dc3 +--- + dom/base/test/test_bug1222633.html | 4 +++- + dom/base/test/test_bug1222633_link_update.html | 4 +++- + dom/html/HTMLLinkElement.cpp | 19 ++++++++++++++++++- + modules/libpref/init/all.js | 2 +- + .../tools/wptrunner/wptrunner/browsers/firefox.py | 3 ++- + 5 files changed, 27 insertions(+), 5 deletions(-) + +diff --git dom/base/test/test_bug1222633.html dom/base/test/test_bug1222633.html +index 52fecff16e9b..099345dab0b7 100644 +--- dom/base/test/test_bug1222633.html ++++ dom/base/test/test_bug1222633.html +@@ -88,8 +88,10 @@ const CROSS_ORIGIN = "http://example.com" + SJS_PATH; + + SimpleTest.waitForExplicitFinish(); + ++SpecialPowers.pushPrefEnv({"set": [["network.preload", true]]}) ++ + // test same origin +-testPreloadEvent(SAME_ORIGIN + "?statusCode=200&cacheControl=no-cache", false, false) ++.then(() => testPreloadEvent(SAME_ORIGIN + "?statusCode=200&cacheControl=no-cache", false, false)) + .then(() => testPreloadEvent(SAME_ORIGIN + "?statusCode=404&cacheControl=no-cache", false, false)) + .then(() => testPreloadEvent(SAME_ORIGIN + "?statusCode=200&cacheControl=max-age%3D120", false, true)) + .then(() => testPreloadEvent(SAME_ORIGIN + "?statusCode=404&cacheControl=max-age%3D120", false, false)) +diff --git dom/base/test/test_bug1222633_link_update.html dom/base/test/test_bug1222633_link_update.html +index 97508d3596cf..1f18284c9470 100644 +--- dom/base/test/test_bug1222633_link_update.html ++++ dom/base/test/test_bug1222633_link_update.html +@@ -122,8 +122,10 @@ const CROSS_ORIGIN = "http://example.com" + SJS_PATH; + + SimpleTest.waitForExplicitFinish(); + ++SpecialPowers.pushPrefEnv({"set": [["network.preload", true]]}) ++ + // Test changing as parameter from a wrong to a correct one. +-testPreloadEventAsAttributeChange(SAME_ORIGIN + "?statusCode=200&cacheControl=max-age%3D120") ++.then(() => testPreloadEventAsAttributeChange(SAME_ORIGIN + "?statusCode=200&cacheControl=max-age%3D120")) + // Test changing type parameter from a wrong to a correct one for given as parameter. + .then(() => testPreloadEventAttributeChange(SAME_ORIGIN + "?statusCode=200&cacheControl=max-age%3D120", "type", "text/vtt", "image/png", false, true)) + // Test changing media parameter from a wrong to a correct one. +diff --git dom/html/HTMLLinkElement.cpp dom/html/HTMLLinkElement.cpp +index 810b47aed670..37b45ca03636 100644 +--- dom/html/HTMLLinkElement.cpp ++++ dom/html/HTMLLinkElement.cpp +@@ -408,11 +408,28 @@ static const DOMTokenListSupportedToken sSupportedRelValues[] = { + nullptr + }; + ++static const DOMTokenListSupportedToken sSupportedRelValuesNoPreload[] = { ++ // Keep this in sync with ToLinkMask in nsStyleLinkElement.cpp. ++ // "import" must come first because it's conditional. ++ "prefetch", ++ "dns-prefetch", ++ "stylesheet", ++ "next", ++ "alternate", ++ "preconnect", ++ "icon", ++ "search", ++ nullptr ++}; + nsDOMTokenList* + HTMLLinkElement::RelList() + { + if (!mRelList) { +- mRelList = new nsDOMTokenList(this, nsGkAtoms::rel, sSupportedRelValues); ++ if (Preferences::GetBool("network.preload")) { ++ mRelList = new nsDOMTokenList(this, nsGkAtoms::rel, sSupportedRelValues); ++ } else { ++ mRelList = new nsDOMTokenList(this, nsGkAtoms::rel, sSupportedRelValuesNoPreload); ++ } + } + return mRelList; + } +diff --git modules/libpref/init/all.js modules/libpref/init/all.js +index e83781623803..79a0ea89d6de 100644 +--- modules/libpref/init/all.js ++++ modules/libpref/init/all.js +@@ -2105,7 +2105,7 @@ pref("network.dir.format", 2); + // URLs). + pref("network.prefetch-next", true); + // enables the preloading (i.e., preloading of URLs). +-pref("network.preload", true); ++pref("network.preload", false); + + // enables the predictive service + pref("network.predictor.enabled", true); +diff --git testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py +index f869c82a8ed0..43da63c7ca4e 100644 +--- testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py ++++ testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py +@@ -190,7 +190,8 @@ class FirefoxBrowser(Browser): + "network.dns.localDomains": ",".join(hostnames), + "network.proxy.type": 0, + "places.history.enabled": False, +- "dom.send_after_paint_to_content": True}) ++ "dom.send_after_paint_to_content": True, ++ "network.preload": True}) + if self.e10s: + self.profile.set_preferences({"browser.tabs.remote.autostart": True}) + Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1405761 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1405878 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1405878 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1405878 (revision 461027) @@ -0,0 +1,120 @@ +commit 87f3d592d92f +Author: Boris Zbarsky +Date: Mon Oct 9 14:49:19 2017 -0400 + + Bug 1405878 - Make sure to notify for our kids, if needed, before calling DoneAddingChildren in the XML content sink. r=hsivonen, a=sledru + + Once we call DoneAddingChildren, random code of various sorts will run, which + can flush our notification state. If that happens before we've notified on our + kids, but after we've popped the element we're closing off the element stack, + we will fail to ever notify on the kids. + + MozReview-Commit-ID: Ei7v5OobX8R + + --HG-- + extra : source : f144e1434312485cf9ee16a36d6159dbcb13a07d +--- + dom/xml/crashtests/1405878.xml | 11 +++++++++++ + dom/xml/crashtests/crashtests.list | 1 + + dom/xml/nsXMLContentSink.cpp | 18 +++++++++++------- + layout/reftests/bugs/1405878-1-ref.xml | 7 +++++++ + layout/reftests/bugs/1405878-1.xml | 6 ++++++ + layout/reftests/bugs/reftest.list | 1 + + 6 files changed, 37 insertions(+), 7 deletions(-) + +diff --git dom/xml/crashtests/1405878.xml dom/xml/crashtests/1405878.xml +new file mode 100644 +index 000000000000..12677ade938d +--- /dev/null ++++ dom/xml/crashtests/1405878.xml +@@ -0,0 +1,11 @@ ++ ++ ++ ++ ++ ++ +diff --git dom/xml/crashtests/crashtests.list dom/xml/crashtests/crashtests.list +index f18767d582c2..2c06ffc545ec 100644 +--- dom/xml/crashtests/crashtests.list ++++ dom/xml/crashtests/crashtests.list +@@ -10,3 +10,4 @@ load 453278.html + load 803586.xhtml + load 994740-1.xhtml + load 1038887.xhtml ++load 1405878.xml +diff --git dom/xml/nsXMLContentSink.cpp dom/xml/nsXMLContentSink.cpp +index 2593519aa44b..b04977d62cf1 100644 +--- dom/xml/nsXMLContentSink.cpp ++++ dom/xml/nsXMLContentSink.cpp +@@ -1071,6 +1071,17 @@ nsXMLContentSink::HandleEndElement(const char16_t *aName, + isTemplateElement, "Wrong element being closed"); + #endif + ++ // Make sure to notify on our kids before we call out to any other code that ++ // might reenter us and call FlushTags, in a state in which we've already ++ // popped "content" from the stack but haven't notified on its kids yet. ++ int32_t stackLen = mContentStack.Length(); ++ if (mNotifyLevel >= stackLen) { ++ if (numFlushed < content->GetChildCount()) { ++ NotifyAppend(content, numFlushed); ++ } ++ mNotifyLevel = stackLen - 1; ++ } ++ + result = CloseElement(content); + + if (mCurrentHead == content) { +@@ -1086,13 +1097,6 @@ nsXMLContentSink::HandleEndElement(const char16_t *aName, + MaybeStartLayout(false); + } + +- int32_t stackLen = mContentStack.Length(); +- if (mNotifyLevel >= stackLen) { +- if (numFlushed < content->GetChildCount()) { +- NotifyAppend(content, numFlushed); +- } +- mNotifyLevel = stackLen - 1; +- } + DidAddContent(); + + if (content->IsSVGElement(nsGkAtoms::svg)) { +diff --git layout/reftests/bugs/1405878-1-ref.xml layout/reftests/bugs/1405878-1-ref.xml +new file mode 100644 +index 000000000000..6d1dd199b41e +--- /dev/null ++++ layout/reftests/bugs/1405878-1-ref.xml +@@ -0,0 +1,7 @@ ++ ++ ++ +diff --git layout/reftests/bugs/1405878-1.xml layout/reftests/bugs/1405878-1.xml +new file mode 100644 +index 000000000000..3915711b1103 +--- /dev/null ++++ layout/reftests/bugs/1405878-1.xml +@@ -0,0 +1,6 @@ ++ ++ ++ +diff --git layout/reftests/bugs/reftest.list layout/reftests/bugs/reftest.list +index 52f8cb915cee..47c04cdf41d6 100644 +--- layout/reftests/bugs/reftest.list ++++ layout/reftests/bugs/reftest.list +@@ -2037,3 +2037,4 @@ needs-focus != 1377447-1.html 1377447-2.html + == 1380224-1.html 1380224-1-ref.html + == 1384065.html 1384065-ref.html + == 1384275-1.html 1384275-1-ref.html ++== 1405878-1.xml 1405878-1-ref.xml Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1405878 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1406222 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1406222 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1406222 (revision 461027) @@ -0,0 +1,39 @@ +commit 04dfc1bac3e0 +Author: Boris Zbarsky +Date: Fri Oct 6 01:53:12 2017 -0500 + + Bug 1406222 - servo: Don't assume that inputs to compute_style_with_inputs have any rules. r=heycam, a=ritu + + It could be a text style, which never has any rules attached to it. + + Source-Repo: https://github.com/servo/servo + Source-Revision: 117dbfaac20d8a388cf3cf5d2bc103b9d6249ee8 + + --HG-- + extra : source : 97fcd35b0d3792e7305bcb46b303ce409b30d23e + extra : histedit_source : 72acaec12ed99fa306148b7679c682abc0abaeea +--- + servo/components/style/stylist.rs | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git servo/components/style/stylist.rs servo/components/style/stylist.rs +index b40c5825a55c..e6feb6f26d15 100644 +--- servo/components/style/stylist.rs ++++ servo/components/style/stylist.rs +@@ -896,12 +896,12 @@ impl Stylist { + // We need to compute visited values if we have visited rules or if our + // parent has visited values. + let visited_values = if inputs.visited_rules.is_some() || parent_style.get_visited_style().is_some() { +- // Slightly annoying: we know that inputs has either rules or +- // visited rules, but we can't do inputs.rules() up front because +- // maybe it just has visited rules, so can't unwrap_or. ++ // At this point inputs may have visited rules, or rules, or both, ++ // or neither (e.g. if it's a text style it may have neither). So ++ // we have to be a bit careful here. + let rule_node = match inputs.visited_rules.as_ref() { + Some(rules) => rules, +- None => inputs.rules.as_ref().unwrap(), ++ None => inputs.rules.as_ref().unwrap_or(self.rule_tree().root()), + }; + let inherited_style; + let inherited_style_ignoring_first_line; Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1406222 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1406229 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1406229 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1406229 (revision 461027) @@ -0,0 +1,32 @@ +commit 2e9ce146b6b5 +Author: Shane Caraveo +Date: Fri Oct 6 16:58:15 2017 -0700 + + Bug 1406229 - Fix autocomplete crash in panels when window is closed during event. r=mak, a=ritu + + MozReview-Commit-ID: 6TrLuwrk2nD + + --HG-- + extra : source : 118b67c940dc554a4adf6fb397db775861962c68 +--- + toolkit/components/autocomplete/nsAutoCompleteController.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git toolkit/components/autocomplete/nsAutoCompleteController.cpp toolkit/components/autocomplete/nsAutoCompleteController.cpp +index 3876380201f6..ba5287f1fabd 100644 +--- toolkit/components/autocomplete/nsAutoCompleteController.cpp ++++ toolkit/components/autocomplete/nsAutoCompleteController.cpp +@@ -367,6 +367,13 @@ nsAutoCompleteController::HandleEnter(bool aIsPopupSelection, + + // Stop the search, and handle the enter. + StopSearch(); ++ // StopSearch() can call PostSearchCleanup() which might result ++ // in a blur event, which could null out mInput, so we need to check it ++ // again. See bug #408463 for more details ++ if (!mInput) { ++ return NS_OK; ++ } ++ + EnterMatch(aIsPopupSelection, aEvent); + + return NS_OK; Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1406229 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1406254 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1406254 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1406254 (revision 461027) @@ -0,0 +1,155 @@ +commit e07fe5183b75 +Author: J. Ryan Stinnett +Date: Wed Oct 11 18:50:23 2017 -0500 + + Bug 1406254 - servo: Clear visited rules for text inheritance. r=emilio, a=ritu + + Source-Repo: https://github.com/servo/servo + Source-Revision: dbf0991f8cab54516c5b0211e1818a16cfbf9e19 + MozReview-Commit-ID: LP8VmxRopA4 +--- + servo/components/style/properties/gecko.mako.rs | 2 +- + servo/components/style/properties/properties.mako.rs | 16 ++++++++++++++-- + 2 files changed, 15 insertions(+), 3 deletions(-) + +diff --git servo/components/style/properties/gecko.mako.rs servo/components/style/properties/gecko.mako.rs +index d7e5496971e3..090a31ff9d4b 100644 +--- servo/components/style/properties/gecko.mako.rs ++++ servo/components/style/properties/gecko.mako.rs +@@ -323,7 +323,7 @@ impl ComputedValuesInner { + } + + /// Clone the visited style. Used for inheriting parent styles in +- /// StyleBuilder::for_inheritance. ++ /// StyleBuilder::for_derived_style. + pub fn clone_visited_style(&self) -> Option> { + self.visited_style.as_ref().map(|x| x.clone_arc()) + } +diff --git servo/components/style/properties/properties.mako.rs servo/components/style/properties/properties.mako.rs +index 269bf0dbbbb5..80238450a9c5 100644 +--- servo/components/style/properties/properties.mako.rs ++++ servo/components/style/properties/properties.mako.rs +@@ -2170,7 +2170,7 @@ impl ComputedValuesInner { + } + + /// Clone the visited style. Used for inheriting parent styles in +- /// StyleBuilder::for_inheritance. ++ /// StyleBuilder::for_derived_style. + pub fn clone_visited_style(&self) -> Option> { + self.visited_style.clone() + } +@@ -2830,6 +2830,18 @@ impl<'a> StyleBuilder<'a> { + parent: &'a ComputedValues, + pseudo: Option<<&'a PseudoElement>, + ) -> Self { ++ // Rebuild the visited style from the parent, ensuring that it will also ++ // not have rules. This matches the unvisited style that will be ++ // produced by this builder. This assumes that the caller doesn't need ++ // to adjust or process visited style, so we can just build visited ++ // style here for simplicity. ++ let visited_style = parent.get_visited_style().map(|style| { ++ Self::for_inheritance( ++ device, ++ style, ++ pseudo, ++ ).build() ++ }); + // FIXME(emilio): This Some(parent) here is inconsistent with what we + // usually do if `parent` is the default computed values, but that's + // fine, and we want to eventually get rid of it. +@@ -2844,7 +2856,7 @@ impl<'a> StyleBuilder<'a> { + parent.writing_mode, + parent.font_computation_data, + parent.flags, +- parent.clone_visited_style() ++ visited_style, + ) + } + +commit d8586d78bd43 +Author: J. Ryan Stinnett +Date: Wed Oct 11 15:33:14 2017 -0500 + + Bug 1406254 - Visited reftest for ::first-line inheritance. r=emilio, a=ritu + + MozReview-Commit-ID: 4ZOlVvBuSfT +--- + .../css-visited/color-on-visited-text-1-ref.html | 16 ++++++++++++++++ + .../css-visited/color-on-visited-text-1.html | 20 ++++++++++++++++++++ + layout/style/test/moz.build | 2 ++ + layout/style/test/test_visited_reftests.html | 1 + + 4 files changed, 39 insertions(+) + +diff --git layout/reftests/css-visited/color-on-visited-text-1-ref.html layout/reftests/css-visited/color-on-visited-text-1-ref.html +new file mode 100644 +index 000000000000..b144767ce76e +--- /dev/null ++++ layout/reftests/css-visited/color-on-visited-text-1-ref.html +@@ -0,0 +1,16 @@ ++ ++ ++
Visited
++
Visited with span
++
Visited with inner unvisited
++
Visited with inner visited
+diff --git layout/reftests/css-visited/color-on-visited-text-1.html layout/reftests/css-visited/color-on-visited-text-1.html +new file mode 100644 +index 000000000000..d9dab8f3b8a7 +--- /dev/null ++++ layout/reftests/css-visited/color-on-visited-text-1.html +@@ -0,0 +1,20 @@ ++ ++ ++Visited ++Visited with span ++Visited with inner unvisited ++Visited with inner visited +diff --git layout/style/test/moz.build layout/style/test/moz.build +index fa646ca16dd3..74fe23260aa7 100644 +--- layout/style/test/moz.build ++++ layout/style/test/moz.build +@@ -60,6 +60,8 @@ TEST_HARNESS_FILES.testing.mochitest.tests.layout.style.test['css-visited'] += [ + '/layout/reftests/css-visited/color-on-visited-1-ref.html', + '/layout/reftests/css-visited/color-on-visited-1.html', + '/layout/reftests/css-visited/color-on-visited-before-1.html', ++ '/layout/reftests/css-visited/color-on-visited-text-1-ref.html', ++ '/layout/reftests/css-visited/color-on-visited-text-1.html', + '/layout/reftests/css-visited/column-rule-1-notref.html', + '/layout/reftests/css-visited/column-rule-1-ref.html', + '/layout/reftests/css-visited/column-rule-1.html', +diff --git layout/style/test/test_visited_reftests.html layout/style/test/test_visited_reftests.html +index aea857f031d2..850d35bae867 100644 +--- layout/style/test/test_visited_reftests.html ++++ layout/style/test/test_visited_reftests.html +@@ -38,6 +38,7 @@ var gTests = [ + "== color-on-link-before-1.html color-on-link-1-ref.html", + "== color-on-visited-1.html color-on-visited-1-ref.html", + "== color-on-visited-before-1.html color-on-visited-1-ref.html", ++ "== color-on-visited-text-1.html color-on-visited-text-1-ref.html", + "!= content-color-on-link-before-1-ref.html content-color-on-visited-before-1-ref.html", + "== content-color-on-link-before-1.html content-color-on-link-before-1-ref.html", + "== content-color-on-visited-before-1.html content-color-on-visited-before-1-ref.html", Property changes on: branches/2018Q1/www/waterfox/files/patch-bug1406254 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2018Q1/www/waterfox/files/patch-bug1406396 =================================================================== --- branches/2018Q1/www/waterfox/files/patch-bug1406396 (nonexistent) +++ branches/2018Q1/www/waterfox/files/patch-bug1406396 (revision 461027) @@ -0,0 +1,211 @@ +commit 45ffbc50f1f2 +Author: David Keeler +Date: Fri Oct 13 11:27:30 2017 -0700 + + Bug 1406396 - Work around NSS utils potentially loading spurious root cert modules. r=mgoodwin, a=ritu, l10n=flod + + NSS command-line utilities may add a built-in root certificate module with the + name "Root Certs" if run on a profile that has a copy of the module file (which + is an unexpected configuration in general for Firefox). This can cause breakage. + To work around this, PSM now simply deletes any module named "Root Certs" at + startup. In an effort to prevent PSM from deleting unrelated modules + coincidentally named "Root Certs", we also prevent the user from using the + Firefox UI to name modules "Root Certs". + + MozReview-Commit-ID: ABja3wpShO9 + + --HG-- + extra : histedit_source : 3f8a20980a1f7fbc838b610763369af3ddf95e16 +--- + security/certverifier/NSSCertDBTrustDomain.cpp | 6 +++++ + .../locales/en-US/chrome/pippki/pippki.properties | 5 ++++ + .../manager/pki/resources/content/load_device.js | 17 ++++++++++++ + .../manager/pki/resources/content/load_device.xul | 4 ++- + security/manager/ssl/PKCS11ModuleDB.cpp | 11 ++++++++ + .../browser/browser_loadPKCS11Module_ui.js | 30 ++++++++++++++++++++++ + .../manager/ssl/tests/unit/test_pkcs11_moduleDB.js | 28 ++++++++++++++++++++ + .../manager/ssl/tests/unit/xpcshell-smartcards.ini | 1 + + 8 files changed, 101 insertions(+), 1 deletion(-) + +diff --git security/certverifier/NSSCertDBTrustDomain.cpp security/certverifier/NSSCertDBTrustDomain.cpp +index a352d928a3c9..229a0b5df28c 100644 +--- security/certverifier/NSSCertDBTrustDomain.cpp ++++ security/certverifier/NSSCertDBTrustDomain.cpp +@@ -1216,6 +1216,12 @@ LoadLoadableRoots(const nsCString& dir, const nsCString& modNameUTF8) + // the return value would be detrimental in that case. + int unusedModType; + Unused << SECMOD_DeleteModule(modNameUTF8.get(), &unusedModType); ++ // Some NSS command-line utilities will load a roots module under the name ++ // "Root Certs" if there happens to be a `DLL_PREFIX "nssckbi" DLL_SUFFIX` ++ // file in the directory being operated on. In some cases this can cause us to ++ // fail to load our roots module. In these cases, deleting the "Root Certs" ++ // module allows us to load the correct one. See bug 1406396. ++ Unused << SECMOD_DeleteModule("Root Certs", &unusedModType); + + nsAutoCString fullLibraryPath; + if (!dir.IsEmpty()) { +diff --git security/manager/locales/en-US/chrome/pippki/pippki.properties security/manager/locales/en-US/chrome/pippki/pippki.properties +index 4bf67da7bab2..163384651067 100644 +--- security/manager/locales/en-US/chrome/pippki/pippki.properties ++++ security/manager/locales/en-US/chrome/pippki/pippki.properties +@@ -185,3 +185,8 @@ addExceptionCheckingShort=Checking Information + addExceptionCheckingLong2=Attempting to identify this site… + addExceptionNoCertShort=No Information Available + addExceptionNoCertLong2=Unable to obtain identification status for this site. ++ ++# Load Module Dialog ++loadModuleHelp_emptyModuleName=The module name cannot be empty. ++# LOCALIZATION NOTE(loadModuleHelp_rootCertsModuleName): Do not translate 'Root Certs' ++loadModuleHelp_rootCertsModuleName=‘Root Certs‘ is reserved and cannot be used as the module name. +diff --git security/manager/pki/resources/content/load_device.js security/manager/pki/resources/content/load_device.js +index b3b020236b93..08831f16e27e 100644 +--- security/manager/pki/resources/content/load_device.js ++++ security/manager/pki/resources/content/load_device.js +@@ -51,3 +51,20 @@ function onDialogAccept() { + + return true; + } ++ ++function validateModuleName() { ++ let bundle = document.getElementById("pippki_bundle"); ++ let name = document.getElementById("device_name").value; ++ let helpText = document.getElementById("helpText"); ++ helpText.value = ""; ++ let dialogNode = document.querySelector("dialog"); ++ dialogNode.removeAttribute("buttondisabledaccept"); ++ if (name == "") { ++ helpText.value = bundle.getString("loadModuleHelp_emptyModuleName"); ++ dialogNode.setAttribute("buttondisabledaccept", true); ++ } ++ if (name == "Root Certs") { ++ helpText.value = bundle.getString("loadModuleHelp_rootCertsModuleName"); ++ dialogNode.setAttribute("buttondisabledaccept", true); ++ } ++} +diff --git security/manager/pki/resources/content/load_device.xul security/manager/pki/resources/content/load_device.xul +index b3a82df7ac57..f7cfca3cacf7 100644 +--- security/manager/pki/resources/content/load_device.xul ++++ security/manager/pki/resources/content/load_device.xul +@@ -29,7 +29,8 @@ + + + + ++