Skip to content

Commit

Permalink
Merge inbound to central, a=merge
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: JpqY5uEi1nf
  • Loading branch information
KWierso committed Sep 21, 2017
2 parents 4c795ee + 49e0f6b commit bca140f
Show file tree
Hide file tree
Showing 189 changed files with 1,851 additions and 1,062 deletions.
2 changes: 1 addition & 1 deletion accessible/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ DocAccessible::DoInitialUpdate()
}

#if defined(XP_WIN)
IAccessibleHolder holder(CreateHolderFromAccessible(this));
IAccessibleHolder holder(CreateHolderFromAccessible(WrapNotNull(this)));
MOZ_DIAGNOSTIC_ASSERT(!holder.IsNull());
int32_t childID = AccessibleWrap::GetChildIDFor(this);
#else
Expand Down
12 changes: 5 additions & 7 deletions accessible/ipc/win/COMPtrTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "mozilla/a11y/Accessible.h"
#include "mozilla/a11y/Platform.h"
#include "mozilla/a11y/HandlerProvider.h"
#include "mozilla/Assertions.h"
#include "mozilla/Move.h"
#include "mozilla/mscom/MainThreadHandoff.h"
#include "mozilla/mscom/Utils.h"
Expand All @@ -26,16 +27,13 @@ namespace mozilla {
namespace a11y {

IAccessibleHolder
CreateHolderFromAccessible(Accessible* aAccToWrap)
CreateHolderFromAccessible(NotNull<Accessible*> aAccToWrap)
{
MOZ_ASSERT(aAccToWrap && NS_IsMainThread());
if (!aAccToWrap) {
return nullptr;
}
MOZ_ASSERT(NS_IsMainThread());

STAUniquePtr<IAccessible> iaToProxy;
aAccToWrap->GetNativeInterface(mscom::getter_AddRefs(iaToProxy));
MOZ_ASSERT(iaToProxy);
MOZ_DIAGNOSTIC_ASSERT(iaToProxy);
if (!iaToProxy) {
return nullptr;
}
Expand All @@ -53,7 +51,7 @@ CreateHolderFromAccessible(Accessible* aAccToWrap)
ProxyUniquePtr<IAccessible> intercepted;
HRESULT hr = MainThreadHandoff::WrapInterface(Move(iaToProxy), payload,
(IAccessible**) mscom::getter_AddRefs(intercepted));
MOZ_ASSERT(SUCCEEDED(hr));
MOZ_DIAGNOSTIC_ASSERT(SUCCEEDED(hr));
if (FAILED(hr)) {
return nullptr;
}
Expand Down
3 changes: 2 additions & 1 deletion accessible/ipc/win/COMPtrTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "mozilla/a11y/AccessibleHandler.h"
#include "mozilla/mscom/COMPtrHolder.h"
#include "mozilla/NotNull.h"

#include <oleacc.h>

Expand All @@ -21,7 +22,7 @@ typedef mozilla::mscom::COMPtrHolder<IDispatch, IID_IDispatch> IDispatchHolder;
class Accessible;

IAccessibleHolder
CreateHolderFromAccessible(Accessible* aAccToWrap);
CreateHolderFromAccessible(NotNull<Accessible*> aAccToWrap);

typedef mozilla::mscom::COMPtrHolder<IHandlerControl, IID_IHandlerControl> IHandlerControlHolder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
"handleOverUnderflow@chrome://global/content/bindings/autocomplete.xml",
"_onChanged@chrome://global/content/bindings/autocomplete.xml",
"_appendCurrentResult/<@chrome://global/content/bindings/autocomplete.xml",
"setTimeout handler*_appendCurrentResult@chrome://global/content/bindings/autocomplete.xml",
"_invalidate@chrome://global/content/bindings/autocomplete.xml",
"invalidate@chrome://global/content/bindings/autocomplete.xml"
],
times: 18, // This number should only ever go down - never up.
},
Expand Down Expand Up @@ -67,8 +64,6 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
stack: [
"adjustHeight@chrome://global/content/bindings/autocomplete.xml",
"_invalidate/this._adjustHeightTimeout<@chrome://global/content/bindings/autocomplete.xml",
"setTimeout handler*_invalidate@chrome://global/content/bindings/autocomplete.xml",
"invalidate@chrome://global/content/bindings/autocomplete.xml",
],
times: 51, // This number should only ever go down - never up.
},
Expand Down
11 changes: 8 additions & 3 deletions browser/branding/official/content/about-wordmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,11 @@ var MessageQueue = {
* An IdleDeadline object passed by requestIdleCallback().
*/
sendWhenIdle(deadline) {
if (!content) {
// The frameloader is being torn down. Nothing more to do.
return;
}

if (deadline) {
if (deadline.didTimeout || deadline.timeRemaining() > MessageQueue.NEEDED_IDLE_PERIOD_MS) {
MessageQueue.send();
Expand Down
2 changes: 1 addition & 1 deletion browser/themes/shared/urlbar-searchbar.inc.css
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
transition: none;
}

#navigator-toolbox:not(:hover) > #nav-bar:not([customizing="true"]) > #nav-bar-customization-target > #urlbar-container > #urlbar:not([focused]) > .urlbar-textbox-container > .urlbar-history-dropmarker {
#nav-bar:not([customizing="true"]) > #nav-bar-customization-target > #urlbar-container:not(:hover) > #urlbar:not([focused]) > .urlbar-textbox-container > .urlbar-history-dropmarker {
opacity: 0;
}

Expand Down
31 changes: 31 additions & 0 deletions build/valgrind/x86_64-redhat-linux-gnu.sup
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,37 @@
fun:_ZN7mozilla3dom*Content*
}

# False positives triggered by rust 1.20.0 (at least) builds of stylo.
# See bug 1394696. The diagnosis is an llvm optimization transforming
# `if A && B` to `if B && A` if is can be proven that A is false
# whenever B is uninitialized. Confusing, but valid.
#
# Conditional jump or move depends on uninitialised value(s)
# at 0x113ED01E: selectors::matching::matches_complex_selector_internal (option.rs:421)
# by 0x113ECF19: selectors::matching::matches_complex_selector (matching.rs:501)
# by 0x113EBAC0: <style::selector_map::SelectorMap<style::stylist::Rule>>::get_matching_rules (matching.rs:397)
{
Bug 1394696 Stylo selector, Sept 2017, part 1
Memcheck:Cond
fun:_ZN9selectors8matching33matches_complex_selector_internal*
fun:_ZN9selectors8matching24matches_complex_selector*
...
fun:_ZN69_$LT$style..selector_map..SelectorMap$LT$style..stylist..Rule$GT$$GT$18get_matching_rules*
}

# Conditional jump or move depends on uninitialised value(s)
# at 0x113EFFDE: selectors::matching::matches_complex_selector_internal (option.rs:421)
# by 0x113EFED9: selectors::matching::matches_complex_selector (matching.rs:501)
# by 0x113DFE55: style::stylist::Stylist::match_revalidation_selectors::{{closure}} (matching.rs:397)
{
Bug 1394696 Stylo selector, Sept 2017, part 2
Memcheck:Cond
fun:_ZN9selectors8matching33matches_complex_selector_internal*
fun:_ZN9selectors8matching24matches_complex_selector*
...
fun:_ZN5style9traversal13compute_style*
fun:recalc_style_at<style::gecko::wrapper::GeckoElement,style::gecko::traversal::RecalcStyleOnly,closure>
}

###################################################
# For valgrind-mochitest ("tc-M-V [tier 2]") runs on taskcluster.
Expand Down
6 changes: 4 additions & 2 deletions client.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ def update_nspr_or_nss(tag, depfile, destination, hgpath):
sys.exit(2)
warn_if_patch_exists(permanent_patch_dir)
# protect patch directory from being removed by do_hg_replace
shutil.move(permanent_patch_dir, temporary_patch_dir)
if os.path.exists(permanent_patch_dir):
shutil.move(permanent_patch_dir, temporary_patch_dir)
# now update the destination
print "reverting to HG version of %s to get its blank line state" % depfile
check_call_noisy([options.hg, 'revert', depfile])
Expand All @@ -127,7 +128,8 @@ def update_nspr_or_nss(tag, depfile, destination, hgpath):
tag_file = destination + "/TAG-INFO"
print >>file(tag_file, "w"), tag
# move patch directory back to a subdirectory
shutil.move(temporary_patch_dir, permanent_patch_dir)
if os.path.exists(temporary_patch_dir):
shutil.move(temporary_patch_dir, permanent_patch_dir)

def warn_if_patch_exists(path):
# If the given patch directory exists and contains at least one file,
Expand Down
71 changes: 36 additions & 35 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14985,55 +14985,56 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques
return NS_OK;
}

uint32_t cookieBehavior = nsContentUtils::CookiesBehavior();
if (cookieBehavior == nsICookieService::BEHAVIOR_REJECT) {
// If cookies are disabled, don't intercept.
return NS_OK;
}

RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
if (!swm) {
return NS_OK;
}

nsresult result;
nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
do_GetService(THIRDPARTYUTIL_CONTRACTID, &result);
NS_ENSURE_SUCCESS(result, result);

if (mCurrentURI &&
nsContentUtils::CookiesBehavior() == nsICookieService::BEHAVIOR_REJECT_FOREIGN) {
nsAutoCString uriSpec;
if (!(mCurrentURI->GetSpecOrDefault().EqualsLiteral("about:blank"))) {
// Reject the interception of third-party iframes if the cookie behaviour
// is set to reject all third-party cookies (1). In case that this pref
// is not set or can't be read, we default to allow all cookies (0) as
// this is the default value in all.js.
bool isThirdPartyURI = true;
result = thirdPartyUtil->IsThirdPartyURI(mCurrentURI, aURI,
&isThirdPartyURI);
if (NS_FAILED(result)) {
return result;
}
if (!aIsNonSubresourceRequest) {
nsCOMPtr<nsIDocument> doc = GetDocument();
if (!doc) {
return NS_ERROR_NOT_AVAILABLE;
}

if (isThirdPartyURI) {
return NS_OK;
}
ErrorResult rv;
*aShouldIntercept = swm->IsControlled(doc, rv);
if (NS_WARN_IF(rv.Failed())) {
return rv.StealNSResult();
}
}

if (aIsNonSubresourceRequest) {
nsCOMPtr<nsIPrincipal> principal =
BasePrincipal::CreateCodebasePrincipal(aURI, mOriginAttributes);
*aShouldIntercept = swm->IsAvailable(principal, aURI);
return NS_OK;
}

nsCOMPtr<nsIDocument> doc = GetDocument();
if (!doc) {
return NS_ERROR_NOT_AVAILABLE;
}
// If the user has set a cookie policy that restricts cookies, then
// avoid intercepting 3rd party iframes.
if (cookieBehavior != nsICookieService::BEHAVIOR_ACCEPT) {
nsCOMPtr<nsIDocShellTreeItem> parent;
GetSameTypeParent(getter_AddRefs(parent));
nsCOMPtr<nsPIDOMWindowOuter> parentWindow = parent ? parent->GetWindow()
: nullptr;
if (parentWindow) {
nsresult rv = NS_OK;
nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
do_GetService(THIRDPARTYUTIL_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);

ErrorResult rv;
*aShouldIntercept = swm->IsControlled(doc, rv);
if (NS_WARN_IF(rv.Failed())) {
return rv.StealNSResult();
bool isThirdPartyURI = true;
rv = thirdPartyUtil->IsThirdPartyWindow(parentWindow, aURI, &isThirdPartyURI);
if (NS_SUCCEEDED(rv) && isThirdPartyURI) {
return NS_OK;
}
}
}

nsCOMPtr<nsIPrincipal> principal =
BasePrincipal::CreateCodebasePrincipal(aURI, mOriginAttributes);
*aShouldIntercept = swm->IsAvailable(principal, aURI);
return NS_OK;
}

Expand Down
16 changes: 15 additions & 1 deletion dom/base/nsContentUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9060,6 +9060,20 @@ nsContentUtils::StorageAllowedForWindow(nsPIDOMWindowInner* aWindow)
return StorageAccess::eDeny;
}

// static, public
nsContentUtils::StorageAccess
nsContentUtils::StorageAllowedForDocument(nsIDocument* aDoc)
{
MOZ_ASSERT(aDoc);

if (nsPIDOMWindowInner* inner = aDoc->GetInnerWindow()) {
nsCOMPtr<nsIPrincipal> principal = aDoc->NodePrincipal();
return InternalStorageAllowedForPrincipal(principal, inner);
}

return StorageAccess::eDeny;
}

// static, public
nsContentUtils::StorageAccess
nsContentUtils::StorageAllowedForPrincipal(nsIPrincipal* aPrincipal)
Expand Down Expand Up @@ -9139,7 +9153,7 @@ nsContentUtils::InternalStorageAllowedForPrincipal(nsIPrincipal* aPrincipal,
if (aWindow) {
// If the document is sandboxed, then it is not permitted to use storage
nsIDocument* document = aWindow->GetExtantDoc();
if (document->GetSandboxFlags() & SANDBOXED_ORIGIN) {
if (document && document->GetSandboxFlags() & SANDBOXED_ORIGIN) {
return StorageAccess::eDeny;
}

Expand Down
11 changes: 11 additions & 0 deletions dom/base/nsContentUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2925,6 +2925,17 @@ class nsContentUtils
*/
static StorageAccess StorageAllowedForWindow(nsPIDOMWindowInner* aWindow);

/*
* Checks if storage for the given document is permitted by a combination of
* the user's preferences, and whether the document's window is a third-party
* iframe.
*
* Note, this may be used on documents during the loading process where
* the window's extant document has not been set yet. The code in
* StorageAllowedForWindow(), however, will not work in these cases.
*/
static StorageAccess StorageAllowedForDocument(nsIDocument* aDoc);

/*
* Checks if storage for the given principal is permitted by the user's
* preferences. The caller is assumed to not be a third-party iframe.
Expand Down
1 change: 1 addition & 0 deletions dom/cache/test/mochitest/mochitest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ scheme=https
[test_chrome_constructor.html]
[test_cache_worker_gc.html]
scheme=https
[test_cache_tons_of_fd.html]
Loading

0 comments on commit bca140f

Please sign in to comment.