Skip to content

Commit

Permalink
Merge inbound to mozilla-central. a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
CosminSabou committed Jun 13, 2018
2 parents d0e5083 + 3e0b344 commit 4057707
Show file tree
Hide file tree
Showing 25 changed files with 137 additions and 178 deletions.
2 changes: 1 addition & 1 deletion accessible/tests/mochitest/hittest/a11y.ini
Expand Up @@ -5,7 +5,7 @@ support-files = zoom_tree.xul

[test_browser.html]
[test_canvas_hitregion.html]
skip-if = (os == "android" || appname == "b2g")
skip-if = (os == "android")
[test_general.html]
[test_menu.xul]
[test_shadowroot.html]
Expand Down
9 changes: 9 additions & 0 deletions browser/installer/Makefile.in
Expand Up @@ -105,6 +105,15 @@ MOZ_PKG_MAC_ICON=$(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/disk.icns
MOZ_PKG_MAC_EXTRA=--symlink '/Applications:/ '
endif

# The packager minifies two different types of files: non-JS (mostly property
# files for l10n), and JS. Setting MOZ_PACKAGER_MINIFY only minifies the
# former. We don't yet minify JS, due to concerns about debuggability.
#
# Also, the JS minification setup really only works correctly on Android:
# we need extra setup to use the newly-built shell for Linux and Windows,
# and Mac requires some extra care due to cross-compilation.
MOZ_PACKAGER_MINIFY=1

include $(topsrcdir)/toolkit/mozapps/installer/signing.mk
include $(topsrcdir)/toolkit/mozapps/installer/packager.mk

Expand Down
22 changes: 6 additions & 16 deletions dom/base/DirectionalityUtils.cpp
Expand Up @@ -241,7 +241,7 @@ DoesNotParticipateInAutoDirection(const Element* aElement)
nodeInfo->Equals(nsGkAtoms::script) ||
nodeInfo->Equals(nsGkAtoms::style) ||
nodeInfo->Equals(nsGkAtoms::textarea) ||
(aElement->IsInAnonymousSubtree() && !aElement->HasDirAuto()));
aElement->IsInAnonymousSubtree());
}

/**
Expand All @@ -254,8 +254,7 @@ DoesNotAffectDirectionOfAncestors(const Element* aElement)
{
return (DoesNotParticipateInAutoDirection(aElement) ||
aElement->IsHTMLElement(nsGkAtoms::bdi) ||
aElement->HasFixedDir() ||
aElement->IsInAnonymousSubtree());
aElement->HasFixedDir());
}

/**
Expand All @@ -281,14 +280,10 @@ inline static bool
NodeAffectsDirAutoAncestor(nsINode* aTextNode)
{
Element* parent = aTextNode->GetParentElement();
// In the anonymous content, we limit our implementation to only
// allow the children text node of the direct dir=auto parent in
// the same anonymous subtree to affact the direction.
return (parent &&
!DoesNotParticipateInAutoDirection(parent) &&
parent->NodeOrAncestorHasDirAuto() &&
(!aTextNode->IsInAnonymousSubtree() ||
parent->HasDirAuto()));
!aTextNode->IsInAnonymousSubtree());
}

Directionality
Expand Down Expand Up @@ -923,19 +918,14 @@ SetDirectionFromNewTextNode(nsTextNode* aTextNode)
void
ResetDirectionSetByTextNode(nsTextNode* aTextNode)
{
// We used to check NodeAffectsDirAutoAncestor() in this function, but
// stopped doing that since calling IsInAnonymousSubtree()
// too late (during nsTextNode::UnbindFromTree) is impossible and this
// function was no-op when there's no directionality map.
if (!aTextNode->HasTextNodeDirectionalityMap()) {
if (!NodeAffectsDirAutoAncestor(aTextNode)) {
nsTextNodeDirectionalityMap::EnsureMapIsClearFor(aTextNode);
return;
}

Directionality dir = GetDirectionFromText(aTextNode->GetText());
if (dir != eDir_NotSet) {
if (dir != eDir_NotSet && aTextNode->HasTextNodeDirectionalityMap()) {
nsTextNodeDirectionalityMap::ResetTextNodeDirection(aTextNode, aTextNode);
} else {
nsTextNodeDirectionalityMap::EnsureMapIsClearFor(aTextNode);
}
}

Expand Down
35 changes: 34 additions & 1 deletion dom/html/nsHTMLDocument.cpp
Expand Up @@ -1355,13 +1355,46 @@ nsHTMLDocument::Open(JSContext* cx,

// The open occurred after the document finished loading.
// So we reset the document and then reinitialize it.
nsCOMPtr<nsIDocShell> curDocShell = GetDocShell();
nsCOMPtr<nsIDocShellTreeItem> parent;
if (curDocShell) {
curDocShell->GetSameTypeParent(getter_AddRefs(parent));
}

// We are using the same technique as in nsDocShell to figure
// out the content policy type. If there is no same type parent,
// we know we are loading a new top level document.
nsContentPolicyType policyType;
if (!parent) {
policyType = nsIContentPolicy::TYPE_DOCUMENT;
} else {
Element* requestingElement = nullptr;
nsPIDOMWindowInner* window = GetInnerWindow();
if (window) {
nsPIDOMWindowOuter* outer =
nsPIDOMWindowOuter::GetFromCurrentInner(window);
if (outer) {
nsGlobalWindowOuter* win = nsGlobalWindowOuter::Cast(outer);
requestingElement = win->AsOuter()->GetFrameElementInternal();
}
}
if (requestingElement) {
policyType = requestingElement->IsHTMLElement(nsGkAtoms::iframe) ?
nsIContentPolicy::TYPE_INTERNAL_IFRAME : nsIContentPolicy::TYPE_INTERNAL_FRAME;
} else {
// If we have lost our frame element by now, just assume we're
// an iframe since that's more common.
policyType = nsIContentPolicy::TYPE_INTERNAL_IFRAME;
}
}

nsCOMPtr<nsIChannel> channel;
nsCOMPtr<nsILoadGroup> group = do_QueryReferent(mDocumentLoadGroup);
aError = NS_NewChannel(getter_AddRefs(channel),
uri,
callerDoc,
nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL,
nsIContentPolicy::TYPE_OTHER,
policyType,
nullptr, // PerformanceStorage
group);

Expand Down
8 changes: 1 addition & 7 deletions dom/xhr/tests/mochitest.ini
Expand Up @@ -70,21 +70,18 @@ support-files =
[test_bug1300552.html]
[test_html_in_xhr.html]
[test_relativeLoad.html]
skip-if = buildapp == 'b2g' # b2g(Failed to load script: relativeLoad_import.js) b2g-debug(Failed to load script: relativeLoad_import.js) b2g-desktop(Failed to load script: relativeLoad_import.js)
[test_sync_xhr_timer.xhtml]
skip-if = toolkit == 'android'
[test_sync_xhr_unload.html]
[test_temporaryFileBlob.html]
[test_worker_terminateSyncXHR.html]
skip-if = buildapp == 'b2g'
[test_worker_xhr.html]
[test_worker_xhr2.html]
[test_worker_xhr_3rdparty.html]
[test_worker_xhr_cors_redirect.html]
[test_worker_xhr_headers.html]
[test_worker_xhr_implicit_cancel.html]
[test_worker_xhr_parameters.html]
skip-if = buildapp == 'b2g'
[test_worker_xhr_responseURL.html]
[test_worker_xhr_system.html]
[test_worker_xhr_timeout.html]
Expand All @@ -98,17 +95,14 @@ skip-if = toolkit == 'android'
[test_XHR_header.html]
[test_XHR_onuploadprogress.html]
[test_xhr_overridemimetype_throws_on_invalid_state.html]
skip-if = buildapp == 'b2g' # Requires webgl support
[test_XHR_parameters.html]
skip-if = buildapp == 'b2g' # b2g(86 total, 4 failing - testing mozAnon - got false, expected true) b2g-debug(86 total, 4 failing - testing mozAnon - got false, expected true) b2g-desktop(86 total, 4 failing - testing mozAnon - got false, expected true)
[test_xhr_progressevents.html]
skip-if = toolkit == 'android'
[test_xhr_send.html]
[test_xhr_send_readystate.html]
[test_XHR_system.html]
skip-if = (buildapp == 'b2g') # b2g-debug(12 total, 2 failing - .mozSystem == true - got false, expected true + ) b2g-desktop(12 total, 2 failing - .mozSystem == true - got false, expected true + )
[test_XHR_timeout.html]
skip-if = buildapp == 'b2g' || (android_version == '18' && debug) # b2g(flaky on B2G, bug 960743) b2g-debug(flaky on B2G, bug 960743) b2g-desktop(flaky on B2G, bug 960743)
skip-if = (android_version == '18' && debug)
support-files = test_XHR_timeout.js
[test_xhr_withCredentials.html]
[test_XHRDocURI.html]
Expand Down
5 changes: 3 additions & 2 deletions extensions/spellcheck/locales/en-US/hunspell/en-US.dic
@@ -1,4 +1,4 @@
52803
52804
0/nm
0th/pt
1/n1
Expand Down Expand Up @@ -29095,7 +29095,8 @@ happenstance/SM
happily/U
happiness/UM
happy/URTP
haptic
haptic/S
haptical/Y
harangue/MGDS
harass/LZGDRS
harasser/M
Expand Down
39 changes: 38 additions & 1 deletion js/src/jsnum.cpp
Expand Up @@ -29,6 +29,9 @@
#include "js/Conversions.h"
#include "util/DoubleToString.h"
#include "util/StringBuffer.h"
#ifdef ENABLE_BIGINT
#include "vm/BigIntType.h"
#endif
#include "vm/GlobalObject.h"
#include "vm/JSAtom.h"
#include "vm/JSContext.h"
Expand Down Expand Up @@ -487,8 +490,14 @@ Number(JSContext* cx, unsigned argc, Value* vp)
CallArgs args = CallArgsFromVp(argc, vp);

if (args.length() > 0) {
if (!ToNumber(cx, args[0]))
// BigInt proposal section 6.2, steps 2a-c.
if (!ToNumeric(cx, args[0]))
return false;
#ifdef ENABLE_BIGINT
if (args[0].isBigInt())
args[0].setNumber(BigInt::numberValue(args[0].toBigInt()));
#endif
MOZ_ASSERT(args[0].isNumber());
}

if (!args.isConstructing()) {
Expand Down Expand Up @@ -1607,6 +1616,34 @@ js::ToNumberSlow(JSContext* cx, HandleValue v_, double* out)
return false;
}

// BigInt proposal section 3.1.6
bool
js::ToNumericSlow(JSContext* cx, MutableHandleValue vp)
{
MOZ_ASSERT(!vp.isNumber());
#ifdef ENABLE_BIGINT
MOZ_ASSERT(!vp.isBigInt());
#endif

// Step 1.
if (!vp.isPrimitive()) {
if (cx->helperThread())
return false;
if (!ToPrimitive(cx, JSTYPE_NUMBER, vp))
return false;
}

// Step 2.
#ifdef ENABLE_BIGINT
if (vp.isBigInt()) {
return true;
}
#endif

// Step 3.
return ToNumber(cx, vp);
}

/*
* Convert a value to an int8_t, according to the WebIDL rules for byte
* conversion. Return converted value in *out on success, false on failure.
Expand Down
16 changes: 16 additions & 0 deletions js/src/jsnum.h
Expand Up @@ -171,6 +171,22 @@ ToNumber(JSContext* cx, JS::MutableHandleValue vp)
return true;
}

bool
ToNumericSlow(JSContext* cx, JS::MutableHandleValue vp);

// BigInt proposal section 3.1.6
MOZ_ALWAYS_INLINE MOZ_MUST_USE bool
ToNumeric(JSContext* cx, JS::MutableHandleValue vp)
{
if (vp.isNumber())
return true;
#ifdef ENABLE_BIGINT
if (vp.isBigInt())
return true;
#endif
return ToNumericSlow(cx, vp);
}

MOZ_MUST_USE bool
num_parseInt(JSContext* cx, unsigned argc, Value* vp);

Expand Down
12 changes: 12 additions & 0 deletions js/src/vm/BigIntType.cpp
Expand Up @@ -175,6 +175,18 @@ js::ToBigInt(JSContext* cx, HandleValue val)
return nullptr;
}

// ES 2019 draft 6.1.6
double
BigInt::numberValue(BigInt* x)
{
// mpz_get_d may cause a hardware overflow trap, so use
// mpz_get_d_2exp to get the fractional part and exponent
// separately.
signed long int exp;
double d = mpz_get_d_2exp(&exp, x->num_);
return ldexp(d, exp);
}

JSLinearString*
BigInt::toString(JSContext* cx, BigInt* x, uint8_t radix)
{
Expand Down
1 change: 1 addition & 0 deletions js/src/vm/BigIntType.h
Expand Up @@ -69,6 +69,7 @@ class BigInt final : public js::gc::TenuredCell

static BigInt* copy(JSContext* cx, Handle<BigInt*> x);

static double numberValue(BigInt* x);
static JSLinearString* toString(JSContext* cx, BigInt* x, uint8_t radix);
};

Expand Down
2 changes: 2 additions & 0 deletions layout/base/crashtests/1467964.html
@@ -0,0 +1,2 @@
<select dir='auto'>
<option dir='auto'>&#x0866;
1 change: 1 addition & 0 deletions layout/base/crashtests/crashtests.list
Expand Up @@ -541,3 +541,4 @@ load 1462412.html
load 1463940.html
pref(dom.webcomponents.shadowdom.enabled,true) HTTP load 1464641.html
load 1464737.html
load 1467964.html
2 changes: 0 additions & 2 deletions layout/forms/nsFileControlFrame.cpp
Expand Up @@ -87,8 +87,6 @@ MakeAnonButton(nsIDocument* aDoc, const char* labelKey,
button->SetIsNativeAnonymousRoot();
button->SetAttr(kNameSpaceID_None, nsGkAtoms::type,
NS_LITERAL_STRING("button"), false);
button->SetAttr(kNameSpaceID_None, nsGkAtoms::dir,
NS_LITERAL_STRING("auto"), false);

// Set the file picking button text depending on the current locale.
nsAutoString buttonTxt;
Expand Down
2 changes: 1 addition & 1 deletion layout/reftests/forms/input/file/rtl-ref.xul
Expand Up @@ -10,7 +10,7 @@
</html:style>
<html:div dir='rtl'>
<html:div class='file' dir='rtl'>
<html:button dir='ltr'>Browse&#8230;</html:button><label value="No file selected."/>
<html:button>Browse&#8230;</html:button><label value="No file selected."/>
</html:div>
</html:div>
</vbox>
Expand Down
1 change: 1 addition & 0 deletions netwerk/ipc/NeckoChannelParams.ipdlh
Expand Up @@ -230,6 +230,7 @@ struct HttpChannelOpenArgs
uint32_t corsMode;
uint32_t redirectMode;
uint64_t channelId;
nsString integrityMetadata;
uint64_t contentWindowId;
nsCString preferredAlternativeType;
uint64_t topLevelOuterContentWindowId;
Expand Down
2 changes: 2 additions & 0 deletions netwerk/protocol/http/HttpChannelChild.cpp
Expand Up @@ -2764,6 +2764,8 @@ HttpChannelChild::ContinueAsyncOpen()

openArgs.channelId() = mChannelId;

openArgs.integrityMetadata() = mIntegrityMetadata;

openArgs.contentWindowId() = contentWindowId;
openArgs.topLevelOuterContentWindowId() = mTopLevelOuterContentWindowId;

Expand Down
6 changes: 5 additions & 1 deletion netwerk/protocol/http/HttpChannelParent.cpp
Expand Up @@ -145,7 +145,8 @@ HttpChannelParent::Init(const HttpChannelCreationArgs& aArgs)
a.suspendAfterSynthesizeResponse(),
a.allowStaleCacheContent(), a.contentTypeHint(),
a.corsMode(), a.redirectMode(),
a.channelId(), a.contentWindowId(), a.preferredAlternativeType(),
a.channelId(), a.integrityMetadata(),
a.contentWindowId(), a.preferredAlternativeType(),
a.topLevelOuterContentWindowId(),
a.launchServiceWorkerStart(),
a.launchServiceWorkerEnd(),
Expand Down Expand Up @@ -443,6 +444,7 @@ HttpChannelParent::DoAsyncOpen( const URIParams& aURI,
const uint32_t& aCorsMode,
const uint32_t& aRedirectMode,
const uint64_t& aChannelId,
const nsString& aIntegrityMetadata,
const uint64_t& aContentWindowId,
const nsCString& aPreferredAlternativeType,
const uint64_t& aTopLevelOuterContentWindowId,
Expand Down Expand Up @@ -507,6 +509,8 @@ HttpChannelParent::DoAsyncOpen( const URIParams& aURI,
httpChannel->SetTopLevelContentWindowId(aContentWindowId);
httpChannel->SetTopLevelOuterContentWindowId(aTopLevelOuterContentWindowId);

httpChannel->SetIntegrityMetadata(aIntegrityMetadata);

RefPtr<nsHttpChannel> httpChannelImpl = do_QueryObject(httpChannel);
if (httpChannelImpl) {
httpChannelImpl->SetWarningReporter(this);
Expand Down
1 change: 1 addition & 0 deletions netwerk/protocol/http/HttpChannelParent.h
Expand Up @@ -170,6 +170,7 @@ class HttpChannelParent final : public nsIInterfaceRequestor
const uint32_t& aCorsMode,
const uint32_t& aRedirectMode,
const uint64_t& aChannelId,
const nsString& aIntegrityMetadata,
const uint64_t& aContentWindowId,
const nsCString& aPreferredAlternativeType,
const uint64_t& aTopLevelOuterContentWindowId,
Expand Down
2 changes: 0 additions & 2 deletions testing/cppunittest.ini
Expand Up @@ -30,7 +30,6 @@ skip-if = os != 'win'
[TestMaybe]
[TestParseFTPList]
[TestPLDHash]
skip-if = os == 'b2g' #Bug 1038197
[TestPair]
[TestPoisonArea]
skip-if = os == 'android' # Bug 1147630
Expand Down Expand Up @@ -58,7 +57,6 @@ skip-if = os == 'android' # Bug 1147630
[ice_unittest]
[test_nr_socket_unittest]
[jsapi-tests]
skip-if = os == 'b2g' #Bug 1068946
[multi_tcp_socket_unittest]
[nrappkit_unittest]
[rlogringbuffer_unittest]
Expand Down
Expand Up @@ -10,6 +10,5 @@
if debug and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
if not debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
if not debug and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
if not debug and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
if not debug and not e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
if debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL

0 comments on commit 4057707

Please sign in to comment.