Skip to content

Commit

Permalink
Merge m-c to autoland, a=merge
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: BlE0HFQUP9c
  • Loading branch information
KWierso committed Aug 31, 2017
2 parents c5c0b41 + da8b50d commit 5556705
Show file tree
Hide file tree
Showing 89 changed files with 4,045 additions and 1,292 deletions.
1 change: 1 addition & 0 deletions config/system-headers
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,7 @@ PMApplication.h
pmddim.h
poll.h
Polygon.h
port.h
portable.h
Power.h
PP_ClassHeaders.cp
Expand Down
21 changes: 13 additions & 8 deletions devtools/client/jsonview/test/browser_jsonview_valid_json.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,25 @@ add_task(function* () {

ok(tab.linkedBrowser.contentPrincipal.isNullPrincipal, "Should have null principal");

let countBefore = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
ok(countBefore == 3, "There must be three rows");
is(yield countRows(), 3, "There must be three rows");

let objectCellCount = yield getElementCount(
".jsonPanelBox .treeTable .objectCell");
ok(objectCellCount == 1, "There must be one object cell");
is(objectCellCount, 1, "There must be one object cell");

let objectCellText = yield getElementText(
".jsonPanelBox .treeTable .objectCell");
ok(objectCellText == "", "The summary is hidden when object is expanded");
is(objectCellText, "", "The summary is hidden when object is expanded");

// Collapsed auto-expanded node.
yield clickJsonNode(".jsonPanelBox .treeTable .treeLabel");
// Clicking the value does not collapse it (so that it can be selected and copied).
yield clickJsonNode(".jsonPanelBox .treeTable .treeValueCell");
is(yield countRows(), 3, "There must still be three rows");

let countAfter = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
ok(countAfter == 1, "There must be one row");
// Clicking the label collapses the auto-expanded node.
yield clickJsonNode(".jsonPanelBox .treeTable .treeLabel");
is(yield countRows(), 1, "There must be one row");
});

function countRows() {
return getElementCount(".jsonPanelBox .treeTable .treeRow");
}
27 changes: 27 additions & 0 deletions devtools/client/locales/en-US/netmonitor.properties
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,33 @@ netmonitor.security.protocolVersion=Protocol version:
# in the security tab describing the cipher suite used to secure this connection.
netmonitor.security.cipherSuite=Cipher suite:

# LOCALIZATION NOTE (netmonitor.security.keaGroup): This is the label displayed
# in the security tab describing the key exchange group suite used to secure
# this connection.
netmonitor.security.keaGroup=Key Exchange Group:

# LOCALIZATION NOTE (netmonitor.security.keaGroup.none): This is the label
# displayed in the security tab describing the case when no group was used.
netmonitor.security.keaGroup.none=none

# LOCALIZATION NOTE (netmonitor.security.keaGroup.unknown): This is the value
# displayed in the security tab describing an unknown group.
netmonitor.security.keaGroup.unknown=unknown group

# LOCALIZATION NOTE (netmonitor.security.signatureScheme): This is the label
# displayed in the security tab describing the signature scheme used by for
# the server certificate in this connection.
netmonitor.security.signatureScheme=Signature Scheme:

# LOCALIZATION NOTE (netmonitor.security.signatureScheme.none): This is the
# label displayed in the security tab describing the case when no signature
# was used.
netmonitor.security.signatureScheme.none=none

# LOCALIZATION NOTE (netmonitor.security.signatureScheme.unknown): This is the
# value displayed in the security tab describing an unknown signature scheme.
netmonitor.security.signatureScheme.unknown=unknown signature scheme

# LOCALIZATION NOTE (netmonitor.security.hsts): This is the label displayed
# in the security tab describing the usage of HTTP Strict Transport Security.
netmonitor.security.hsts=HTTP Strict Transport Security:
Expand Down
4 changes: 4 additions & 0 deletions devtools/client/netmonitor/src/components/security-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ function SecurityPanel({ request }) {
securityInfo.protocolVersion || notAvailable,
[L10N.getStr("netmonitor.security.cipherSuite")]:
securityInfo.cipherSuite || notAvailable,
[L10N.getStr("netmonitor.security.keaGroup")]:
securityInfo.keaGroupName || notAvailable,
[L10N.getStr("netmonitor.security.signatureScheme")]:
securityInfo.signatureSchemeName || notAvailable,
},
[L10N.getFormatStr("netmonitor.security.hostHeader", getUrlHost(url))]: {
[L10N.getStr("netmonitor.security.hsts")]:
Expand Down
27 changes: 15 additions & 12 deletions devtools/client/netmonitor/test/browser_net_security-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,34 @@ add_task(function* () {
is(tabpanel.querySelectorAll(".treeLabel.objectLabel")[1].textContent,
"Host example.com:",
"Label has the expected value.");
is(textboxes[2].value, "Disabled", "Label has the expected value.");
is(textboxes[3].value, "Disabled", "Label has the expected value.");
// These two values can change. So only check they're not empty.
ok(textboxes[2].value !== "", "Label value is not empty.");
ok(textboxes[3].value !== "", "Label value is not empty.");
is(textboxes[4].value, "Disabled", "Label has the expected value.");
is(textboxes[5].value, "Disabled", "Label has the expected value.");

// Cert
is(textboxes[4].value, "example.com", "Label has the expected value.");
is(textboxes[5].value, "<Not Available>", "Label has the expected value.");
is(textboxes[6].value, "<Not Available>", "Label has the expected value.");
is(textboxes[6].value, "example.com", "Label has the expected value.");
is(textboxes[7].value, "<Not Available>", "Label has the expected value.");
is(textboxes[8].value, "<Not Available>", "Label has the expected value.");

is(textboxes[7].value, "Temporary Certificate Authority",
is(textboxes[9].value, "Temporary Certificate Authority",
"Label has the expected value.");
is(textboxes[8].value, "Mozilla Testing", "Label has the expected value.");
is(textboxes[9].value, "Profile Guided Optimization", "Label has the expected value.");
is(textboxes[10].value, "Mozilla Testing", "Label has the expected value.");
is(textboxes[11].value, "Profile Guided Optimization", "Label has the expected value.");

// Locale sensitive and varies between timezones. Cant't compare equality or
// the test fails depending on which part of the world the test is executed.

// cert validity begins
isnot(textboxes[10].value, "", "Label was not empty.");
isnot(textboxes[12].value, "", "Label was not empty.");
// cert validity expires
isnot(textboxes[11].value, "", "Label was not empty.");
isnot(textboxes[13].value, "", "Label was not empty.");

// cert sha1 fingerprint
isnot(textboxes[12].value, "", "Label was not empty.");
isnot(textboxes[14].value, "", "Label was not empty.");
// cert sha256 fingerprint
isnot(textboxes[13].value, "", "Label was not empty.");
isnot(textboxes[15].value, "", "Label was not empty.");

yield teardown(monitor);
});
5 changes: 4 additions & 1 deletion devtools/client/shared/components/tree/tree-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ define(function (require, exports, module) {

onClickRow: function (nodePath, event) {
event.stopPropagation();
this.toggle(nodePath);
let cell = event.target.closest("td");
if (cell && cell.classList.contains("treeLabelCell")) {
this.toggle(nodePath);
}
this.selectRow(nodePath);
},

Expand Down
24 changes: 24 additions & 0 deletions devtools/shared/webconsole/network-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const {components, Cc, Ci} = require("chrome");
loader.lazyImporter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
const Services = require("Services");
const { LocalizationHelper } = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/client/locales/netmonitor.properties");

// The cache used in the `nsIURL` function.
const gNSURLStore = new Map();
Expand Down Expand Up @@ -620,6 +622,28 @@ var NetworkHelper = {
// Cipher suite.
info.cipherSuite = SSLStatus.cipherName;

// Key exchange group name.
info.keaGroupName = SSLStatus.keaGroupName;
// Localise two special values.
if (info.keaGroupName == "none") {
info.keaGroupName = L10N.getStr("netmonitor.security.keaGroup.none");
}
if (info.keaGroupName == "unknown group") {
info.keaGroupName = L10N.getStr("netmonitor.security.keaGroup.unknown");
}

// Certificate signature scheme.
info.signatureSchemeName = SSLStatus.signatureSchemeName;
// Localise two special values.
if (info.signatureSchemeName == "none") {
info.signatureSchemeName =
L10N.getStr("netmonitor.security.signatureScheme.none");
}
if (info.signatureSchemeName == "unknown signature") {
info.signatureSchemeName =
L10N.getStr("netmonitor.security.signatureScheme.unknown");
}

// Protocol version.
info.protocolVersion =
this.formatSecurityProtocol(SSLStatus.protocolVersion);
Expand Down
19 changes: 0 additions & 19 deletions dom/base/DOMException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "mozilla/dom/Exceptions.h"
#include "nsContentUtils.h"
#include "nsCOMPtr.h"
#include "nsIClassInfoImpl.h"
#include "nsIDocument.h"
#include "nsIDOMDOMException.h"
#include "nsIException.h"
Expand Down Expand Up @@ -140,17 +139,12 @@ NS_GetNameAndMessageForDOMNSResult(nsresult aNSResult, nsACString& aName,
namespace mozilla {
namespace dom {

bool Exception::sEverMadeOneFromFactory = false;

NS_IMPL_CLASSINFO(Exception, nullptr, nsIClassInfo::DOM_OBJECT,
NS_XPCEXCEPTION_CID)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Exception)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(Exception)
NS_INTERFACE_MAP_ENTRY(nsIException)
NS_INTERFACE_MAP_ENTRY(nsIXPCException)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIException)
NS_IMPL_QUERY_CLASSINFO(Exception)
NS_INTERFACE_MAP_END

NS_IMPL_CYCLE_COLLECTING_ADDREF(Exception)
Expand Down Expand Up @@ -186,19 +180,6 @@ Exception::Exception(const nsACString& aMessage,
mInitialized(false),
mHoldingJSVal(false)
{
// A little hack... The nsIGenericModule nsIClassInfo scheme relies on there
// having been at least one instance made via the factory. Otherwise, the
// shared factory/classinsance object never gets created and our QI getter
// for our instance's pointer to our nsIClassInfo will always return null.
// This is bad because it means that wrapped exceptions will never have a
// shared prototype. So... We force one to be created via the factory
// *once* and then go about our business.
if (!sEverMadeOneFromFactory) {
nsCOMPtr<nsIXPCException> e =
do_CreateInstance(XPC_EXCEPTION_CONTRACTID);
sEverMadeOneFromFactory = true;
}

Initialize(aMessage, aResult, aName, aLocation, aData);
}

Expand Down
3 changes: 0 additions & 3 deletions dom/base/DOMException.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ class Exception : public nsIXPCException,

bool mHoldingJSVal;
JS::Heap<JS::Value> mThrownJSVal;

private:
static bool sEverMadeOneFromFactory;
};

NS_DEFINE_STATIC_IID_ACCESSOR(Exception, MOZILLA_EXCEPTION_IID)
Expand Down
30 changes: 19 additions & 11 deletions dom/base/nsGenericDOMDataNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "nsCCUncollectableMarker.h"
#include "mozAutoDocUpdate.h"
#include "nsTextNode.h"

#include "nsBidiUtils.h"
#include "PLDHashTable.h"
#include "mozilla/Sprintf.h"
#include "nsWrapperCacheInlines.h"
Expand Down Expand Up @@ -163,7 +163,8 @@ nsresult
nsGenericDOMDataNode::GetData(nsAString& aData) const
{
if (mText.Is2b()) {
aData.Assign(mText.Get2b(), mText.GetLength());
aData.Truncate();
mText.AppendTo(aData);
} else {
// Must use Substring() since nsDependentCString() requires null
// terminated strings.
Expand Down Expand Up @@ -336,28 +337,35 @@ nsGenericDOMDataNode::SetTextInternal(uint32_t aOffset, uint32_t aCount,
else {
// Merging old and new

bool bidi = mText.IsBidi();

// Allocate new buffer
int32_t newLength = textLength - aCount + aLength;
char16_t* to = new char16_t[newLength];
// Use nsString and not nsAutoString so that we get a nsStringBuffer which
// can be just AddRefed in nsTextFragment.
nsString to;
to.SetCapacity(newLength);

// Copy over appropriate data
if (aOffset) {
mText.CopyTo(to, 0, aOffset);
mText.AppendTo(to, 0, aOffset);
}
if (aLength) {
memcpy(to + aOffset, aBuffer, aLength * sizeof(char16_t));
to.Append(aBuffer, aLength);
if (!bidi && (!document || !document->GetBidiEnabled())) {
bidi = HasRTLChars(aBuffer, aLength);
}
}
if (endOffset != textLength) {
mText.CopyTo(to + aOffset + aLength, endOffset, textLength - endOffset);
mText.AppendTo(to, endOffset, textLength - endOffset);
}

// If this is marked as "maybe modified frequently", the text should be
// stored as char16_t since converting char* to char16_t* is expensive.
bool ok =
mText.SetTo(to, newLength, !document || !document->GetBidiEnabled(),
HasFlag(NS_MAYBE_MODIFIED_FREQUENTLY));

delete [] to;
// Use char16_t also when we have bidi characters.
bool use2b = HasFlag(NS_MAYBE_MODIFIED_FREQUENTLY) || bidi;
bool ok = mText.SetTo(to, false, use2b);
mText.SetBidi(bidi);

NS_ENSURE_TRUE(ok, NS_ERROR_OUT_OF_MEMORY);
}
Expand Down
Loading

0 comments on commit 5556705

Please sign in to comment.