Skip to content

Commit 757cf79

Browse files
committed
Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE
2 parents 48d1450 + e327525 commit 757cf79

File tree

19 files changed

+274
-206
lines changed

19 files changed

+274
-206
lines changed

browser/extensions/formautofill/FormAutofillHeuristics.jsm

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,18 +182,15 @@ class FieldScanner {
182182
}
183183
let element = this._elements[elementIndex];
184184
let info = FormAutofillHeuristics.getInfo(element);
185-
if (!info) {
186-
info = {};
187-
}
188185
let fieldInfo = {
189-
section: info.section,
190-
addressType: info.addressType,
191-
contactType: info.contactType,
192-
fieldName: info.fieldName,
186+
section: info ? info.section : "",
187+
addressType: info ? info.addressType : "",
188+
contactType: info ? info.contactType : "",
189+
fieldName: info ? info.fieldName : "",
193190
elementWeakRef: Cu.getWeakReference(element),
194191
};
195192

196-
if (info._reason) {
193+
if (info && info._reason) {
197194
fieldInfo._reason = info._reason;
198195
}
199196

@@ -539,9 +536,19 @@ this.FormAutofillHeuristics = {
539536
}
540537

541538
let nextField = fieldScanner.getFieldDetailByIndex(fieldScanner.parsingIndex);
542-
if (nextField && nextField.fieldName == "tel-extension") {
543-
fieldScanner.parsingIndex++;
544-
parsedField = true;
539+
if (nextField && nextField._reason != "autocomplete" && fieldScanner.parsingIndex > 0) {
540+
const regExpTelExtension = new RegExp(
541+
"\\bext|ext\\b|extension" +
542+
"|ramal", // pt-BR, pt-PT
543+
"iu");
544+
const previousField = fieldScanner.getFieldDetailByIndex(fieldScanner.parsingIndex - 1);
545+
const previousFieldType = FormAutofillUtils.getCategoryFromFieldName(previousField.fieldName);
546+
if (previousField && previousFieldType == "tel" &&
547+
this._matchRegexp(nextField.elementWeakRef.get(), regExpTelExtension)) {
548+
fieldScanner.updateFieldName(fieldScanner.parsingIndex, "tel-extension");
549+
fieldScanner.parsingIndex++;
550+
parsedField = true;
551+
}
545552
}
546553

547554
return parsedField;

browser/extensions/formautofill/content/heuristicsRegexp.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ var HeuristicsRegExp = {
2929
),
3030

3131
// ==== Telephone ====
32-
"tel-extension": new RegExp(
33-
"\\bext|ext\\b|extension" +
34-
"|ramal", // pt-BR, pt-PT
35-
"iu"
36-
),
3732
"tel": new RegExp(
3833
"phone|mobile|contact.?number" +
3934
"|telefonnummer" + // de-DE

browser/extensions/formautofill/test/unit/heuristics/third_party/test_CDW.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,8 @@ runHeuristicsTest([
1515
{"section": "", "addressType": "", "contactType": "", "fieldName": "address-level2"}, // city
1616
{"section": "", "addressType": "", "contactType": "", "fieldName": "address-level1"}, // state
1717
{"section": "", "addressType": "", "contactType": "", "fieldName": "postal-code"},
18-
19-
// FIXME: bug 1392932 - misdetect ZIP ext string
20-
{"section": "", "addressType": "", "contactType": "", "fieldName": "tel-extension"},
2118
{"section": "", "addressType": "", "contactType": "", "fieldName": "email"},
2219
{"section": "", "addressType": "", "contactType": "", "fieldName": "tel"},
23-
], [
24-
// The below "tel-extension" is correct and removed due to the
25-
// duplicated field above.
2620
{"section": "", "addressType": "", "contactType": "", "fieldName": "tel-extension"},
2721
]],
2822
[],
@@ -39,18 +33,12 @@ runHeuristicsTest([
3933
{"section": "", "addressType": "", "contactType": "", "fieldName": "address-level2"}, // city
4034
{"section": "", "addressType": "", "contactType": "", "fieldName": "address-level1"}, // state
4135
{"section": "", "addressType": "", "contactType": "", "fieldName": "postal-code"},
42-
43-
// FIXME: bug 1392932 - misdetect ZIP ext string
44-
{"section": "", "addressType": "", "contactType": "", "fieldName": "tel-extension"},
4536
], [
4637
// {"section": "", "addressType": "", "contactType": "", "fieldName": "cc-type"},
4738
{"section": "", "addressType": "", "contactType": "", "fieldName": "cc-number"}, // ac-off
4839
{"section": "", "addressType": "", "contactType": "", "fieldName": "cc-exp-month"},
4940
{"section": "", "addressType": "", "contactType": "", "fieldName": "cc-exp-year"},
50-
5141
// {"section": "", "addressType": "", "contactType": "", "fieldName": "cc-csc"},
52-
], [
53-
{"section": "", "addressType": "", "contactType": "", "fieldName": "tel-extension"},
5442
]],
5543
[],
5644
],

browser/extensions/formautofill/test/unit/heuristics/third_party/test_Walmart.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ runHeuristicsTest([
3636
{"section": "section-payment", "addressType": "", "contactType": "", "fieldName": "cc-exp-month"},
3737
{"section": "section-payment", "addressType": "", "contactType": "", "fieldName": "cc-exp-year"},
3838
// {"section": "section-payment", "addressType": "", "contactType": "", "fieldName": "cc-csc"},
39-
], [
40-
// FIXME bug 1392932 - the following field shouldn't be recognized as
41-
// "tel-extension".
42-
// The wrong prediction is caused by the name attr "brwsrAutofillText"
43-
// which matches the regexp "ext\\b".
44-
{"section": "", "addressType": "", "contactType": "", "fieldName": "tel-extension"},
4539
],
4640
],
4741
],

dom/xbl/nsBindingManager.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,11 +722,18 @@ nsBindingManager::EnumerateBoundContentBindings(
722722
return true;
723723
}
724724

725+
nsTHashtable<nsPtrHashKey<nsXBLBinding>> bindings;
725726
for (auto iter = mBoundContentSet->Iter(); !iter.Done(); iter.Next()) {
726727
nsIContent* boundContent = iter.Get()->GetKey();
727728
for (nsXBLBinding* binding = boundContent->GetXBLBinding();
728729
binding;
729730
binding = binding->GetBaseBinding()) {
731+
// If we have already invoked the callback with a binding, we
732+
// should have also invoked it for all its base bindings, so we
733+
// don't need to continue this loop anymore.
734+
if (!bindings.EnsureInserted(binding)) {
735+
break;
736+
}
730737
if (!aCallback(binding)) {
731738
return false;
732739
}

layout/generic/nsImageFrame.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ using namespace mozilla::layers;
102102
#define ALIGN_UNSET uint8_t(-1)
103103

104104
// static icon information
105-
nsImageFrame::IconLoad* nsImageFrame::gIconLoad = nullptr;
105+
StaticRefPtr<nsImageFrame::IconLoad> nsImageFrame::gIconLoad;
106106

107107
// cached IO service for loading icons
108108
nsIIOService* nsImageFrame::sIOService;
@@ -2358,7 +2358,6 @@ nsresult nsImageFrame::LoadIcons(nsPresContext *aPresContext)
23582358
NS_NAMED_LITERAL_STRING(brokenSrc,"resource://gre-resources/broken-image.png");
23592359

23602360
gIconLoad = new IconLoad();
2361-
NS_ADDREF(gIconLoad);
23622361

23632362
nsresult rv;
23642363
// create a loader and load the images

layout/generic/nsImageFrame.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "imgIContainer.h"
2020
#include "mozilla/Attributes.h"
2121
#include "mozilla/DebugOnly.h"
22+
#include "mozilla/StaticPtr.h"
2223
#include "nsIReflowCallback.h"
2324
#include "nsTObserverArray.h"
2425

@@ -132,7 +133,7 @@ class nsImageFrame : public nsAtomicContainerFrame
132133
static void ReleaseGlobals() {
133134
if (gIconLoad) {
134135
gIconLoad->Shutdown();
135-
NS_RELEASE(gIconLoad);
136+
gIconLoad = nullptr;
136137
}
137138
NS_IF_RELEASE(sIOService);
138139
}
@@ -395,7 +396,8 @@ class nsImageFrame : public nsAtomicContainerFrame
395396
};
396397

397398
public:
398-
static IconLoad* gIconLoad; // singleton pattern: one LoadIcons instance is used
399+
// singleton pattern: one LoadIcons instance is used
400+
static mozilla::StaticRefPtr<IconLoad> gIconLoad;
399401

400402
friend class nsDisplayImage;
401403
};

media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,7 @@ PeerConnectionImpl::CreateOffer(const JsepOfferOptions& aOptions)
15071507

15081508
CSFLogDebug(LOGTAG, "CreateOffer()");
15091509

1510+
bool iceRestartPrimed = false;
15101511
nsresult nrv;
15111512
if (restartIce &&
15121513
!mJsepSession->GetLocalDescription(kJsepDescriptionCurrent).empty()) {
@@ -1525,13 +1526,14 @@ PeerConnectionImpl::CreateOffer(const JsepOfferOptions& aOptions)
15251526
}
15261527

15271528
CSFLogInfo(LOGTAG, "Offerer restarting ice");
1528-
nrv = SetupIceRestart();
1529+
nrv = SetupIceRestartCredentials();
15291530
if (NS_FAILED(nrv)) {
15301531
CSFLogError(LOGTAG, "%s: SetupIceRestart failed, res=%u",
15311532
__FUNCTION__,
15321533
static_cast<unsigned>(nrv));
15331534
return nrv;
15341535
}
1536+
iceRestartPrimed = true;
15351537
}
15361538

15371539
nrv = ConfigureJsepSessionCodecs();
@@ -1559,8 +1561,20 @@ PeerConnectionImpl::CreateOffer(const JsepOfferOptions& aOptions)
15591561

15601562
CSFLogError(LOGTAG, "%s: pc = %s, error = %s",
15611563
__FUNCTION__, mHandle.c_str(), errorString.c_str());
1564+
1565+
if (iceRestartPrimed) {
1566+
// reset the ice credentials because CreateOffer failed
1567+
ResetIceCredentials();
1568+
}
1569+
15621570
pco->OnCreateOfferError(error, ObString(errorString.c_str()), rv);
15631571
} else {
1572+
// wait until we know CreateOffer succeeds before we actually start
1573+
// the ice restart gears turning.
1574+
if (iceRestartPrimed) {
1575+
BeginIceRestart();
1576+
}
1577+
15641578
UpdateSignalingState();
15651579
pco->OnCreateOfferSuccess(ObString(offer.c_str()), rv);
15661580
}
@@ -1580,20 +1594,22 @@ PeerConnectionImpl::CreateAnswer()
15801594

15811595
CSFLogDebug(LOGTAG, "CreateAnswer()");
15821596

1597+
bool iceRestartPrimed = false;
15831598
nsresult nrv;
15841599
if (mJsepSession->RemoteIceIsRestarting()) {
15851600
if (mMedia->GetIceRestartState() ==
15861601
PeerConnectionMedia::ICE_RESTART_COMMITTED) {
15871602
FinalizeIceRestart();
15881603
} else if (!mMedia->IsIceRestarting()) {
15891604
CSFLogInfo(LOGTAG, "Answerer restarting ice");
1590-
nrv = SetupIceRestart();
1605+
nrv = SetupIceRestartCredentials();
15911606
if (NS_FAILED(nrv)) {
15921607
CSFLogError(LOGTAG, "%s: SetupIceRestart failed, res=%u",
15931608
__FUNCTION__,
15941609
static_cast<unsigned>(nrv));
15951610
return nrv;
15961611
}
1612+
iceRestartPrimed = true;
15971613
}
15981614
}
15991615

@@ -1618,8 +1634,20 @@ PeerConnectionImpl::CreateAnswer()
16181634

16191635
CSFLogError(LOGTAG, "%s: pc = %s, error = %s",
16201636
__FUNCTION__, mHandle.c_str(), errorString.c_str());
1637+
1638+
if (iceRestartPrimed) {
1639+
// reset the ice credentials because CreateAnswer failed
1640+
ResetIceCredentials();
1641+
}
1642+
16211643
pco->OnCreateAnswerError(error, ObString(errorString.c_str()), rv);
16221644
} else {
1645+
// wait until we know CreateAnswer succeeds before we actually start
1646+
// the ice restart gears turning.
1647+
if (iceRestartPrimed) {
1648+
BeginIceRestart();
1649+
}
1650+
16231651
UpdateSignalingState();
16241652
pco->OnCreateAnswerSuccess(ObString(answer.c_str()), rv);
16251653
}
@@ -1628,7 +1656,7 @@ PeerConnectionImpl::CreateAnswer()
16281656
}
16291657

16301658
nsresult
1631-
PeerConnectionImpl::SetupIceRestart()
1659+
PeerConnectionImpl::SetupIceRestartCredentials()
16321660
{
16331661
if (mMedia->IsIceRestarting()) {
16341662
CSFLogError(LOGTAG, "%s: ICE already restarting",
@@ -1648,7 +1676,6 @@ PeerConnectionImpl::SetupIceRestart()
16481676
// hold on to the current ice creds in case of rollback
16491677
mPreviousIceUfrag = mJsepSession->GetUfrag();
16501678
mPreviousIcePwd = mJsepSession->GetPwd();
1651-
mMedia->BeginIceRestart(ufrag, pwd);
16521679

16531680
nsresult nrv = mJsepSession->SetIceCredentials(ufrag, pwd);
16541681
if (NS_FAILED(nrv)) {
@@ -1661,26 +1688,39 @@ PeerConnectionImpl::SetupIceRestart()
16611688
return NS_OK;
16621689
}
16631690

1691+
void
1692+
PeerConnectionImpl::BeginIceRestart()
1693+
{
1694+
mMedia->BeginIceRestart(mJsepSession->GetUfrag(), mJsepSession->GetPwd());
1695+
}
1696+
16641697
nsresult
1665-
PeerConnectionImpl::RollbackIceRestart()
1698+
PeerConnectionImpl::ResetIceCredentials()
16661699
{
1667-
mMedia->RollbackIceRestart();
1668-
// put back the previous ice creds
1669-
nsresult nrv = mJsepSession->SetIceCredentials(mPreviousIceUfrag,
1670-
mPreviousIcePwd);
1700+
nsresult nrv = mJsepSession->SetIceCredentials(mPreviousIceUfrag, mPreviousIcePwd);
1701+
mPreviousIceUfrag = "";
1702+
mPreviousIcePwd = "";
1703+
16711704
if (NS_FAILED(nrv)) {
1672-
CSFLogError(LOGTAG, "%s: Couldn't set ICE credentials, res=%u",
1705+
CSFLogError(LOGTAG, "%s: Couldn't reset ICE credentials, res=%u",
16731706
__FUNCTION__,
16741707
static_cast<unsigned>(nrv));
16751708
return nrv;
16761709
}
1677-
mPreviousIceUfrag = "";
1678-
mPreviousIcePwd = "";
1679-
++mIceRollbackCount;
16801710

16811711
return NS_OK;
16821712
}
16831713

1714+
nsresult
1715+
PeerConnectionImpl::RollbackIceRestart()
1716+
{
1717+
mMedia->RollbackIceRestart();
1718+
++mIceRollbackCount;
1719+
1720+
// put back the previous ice creds
1721+
return ResetIceCredentials();
1722+
}
1723+
16841724
void
16851725
PeerConnectionImpl::FinalizeIceRestart()
16861726
{

media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,9 @@ class PeerConnectionImpl final : public nsISupports,
713713
dom::MediaStreamTrack* aSendTrack,
714714
ErrorResult& aRv);
715715

716-
nsresult SetupIceRestart();
716+
nsresult SetupIceRestartCredentials();
717+
void BeginIceRestart();
718+
nsresult ResetIceCredentials();
717719
nsresult RollbackIceRestart();
718720
void FinalizeIceRestart();
719721

security/manager/ssl/StaticHPKPins.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,4 +1161,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
11611161

11621162
static const int32_t kUnknownId = -1;
11631163

1164-
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1524250496679000);
1164+
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1524337267138000);

0 commit comments

Comments
 (0)