Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 6735016

Browse files
committed
Merge mozilla-cental to mozilla-inbound. r=merge
--HG-- extra : rebase_source : f7e0a6b0f2925bd159de4d665c02493dab9b6282
2 parents a985338 + 3ccafa2 commit 6735016

76 files changed

Lines changed: 1442 additions & 1391 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

accessible/base/nsAccessibilityService.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
14721472
{
14731473
nsAutoString role;
14741474
nsCoreUtils::XBLBindingRole(aContent, role);
1475-
if (role.IsEmpty() || role.EqualsLiteral("none"))
1475+
if (role.IsEmpty())
14761476
return nullptr;
14771477

14781478
RefPtr<Accessible> accessible;
@@ -1487,9 +1487,6 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
14871487
} else if (role.EqualsLiteral("xul:link")) {
14881488
accessible = new XULLinkAccessible(aContent, aDoc);
14891489

1490-
} else if(role.EqualsLiteral("xul:pane")) {
1491-
accessible = new EnumRoleAccessible<roles::PANE>(aContent, aDoc);
1492-
14931490
} else if (role.EqualsLiteral("xul:panel")) {
14941491
if (aContent->IsElement() &&
14951492
aContent->AsElement()->AttrValueIs(kNameSpaceID_None,

browser/base/content/browser-feeds.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ var FeedHandler = {
381381
// http://foo.com/index.rdf -> feed://foo.com/index.rdf
382382
// other urls: prepend feed: scheme, e.g.
383383
// https://foo.com/index.rdf -> feed:https://foo.com/index.rdf
384-
let feedURI = NetUtil.newURI(aSpec);
384+
let feedURI = Services.io.newURI(aSpec);
385385
if (feedURI.schemeIs("http")) {
386386
feedURI = feedURI.mutate()
387387
.setScheme("feed")

browser/base/content/browser-places.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ var PlacesCommandHook = {
481481
let parentGuid = parentId == PlacesUtils.bookmarksMenuFolderId ?
482482
PlacesUtils.bookmarks.menuGuid :
483483
await PlacesUtils.promiseItemGuid(parentId);
484-
let defaultInsertionPoint = new InsertionPoint({ parentId, parentGuid });
484+
let defaultInsertionPoint = new PlacesInsertionPoint({ parentId, parentGuid });
485485
PlacesUIUtils.showBookmarkDialog({ action: "add",
486486
type: "bookmark",
487487
uri: makeURI(url),
@@ -557,7 +557,7 @@ var PlacesCommandHook = {
557557
* A short description of the feed. Optional.
558558
*/
559559
async addLiveBookmark(url, feedTitle, feedSubtitle) {
560-
let toolbarIP = new InsertionPoint({
560+
let toolbarIP = new PlacesInsertionPoint({
561561
parentId: PlacesUtils.toolbarFolderId,
562562
parentGuid: PlacesUtils.bookmarks.toolbarGuid
563563
});
@@ -993,7 +993,7 @@ var PlacesMenuDNDHandler = {
993993
* The DragOver event.
994994
*/
995995
onDragOver: function PMDH_onDragOver(event) {
996-
let ip = new InsertionPoint({
996+
let ip = new PlacesInsertionPoint({
997997
parentId: PlacesUtils.bookmarksMenuFolderId,
998998
parentGuid: PlacesUtils.bookmarks.menuGuid
999999
});
@@ -1010,7 +1010,7 @@ var PlacesMenuDNDHandler = {
10101010
*/
10111011
onDrop: function PMDH_onDrop(event) {
10121012
// Put the item at the end of bookmark menu.
1013-
let ip = new InsertionPoint({
1013+
let ip = new PlacesInsertionPoint({
10141014
parentId: PlacesUtils.bookmarksMenuFolderId,
10151015
parentGuid: PlacesUtils.bookmarks.menuGuid
10161016
});

browser/base/content/browser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
3434
LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
3535
Log: "resource://gre/modules/Log.jsm",
3636
LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
37+
NetUtil: "resource://gre/modules/NetUtil.jsm",
3738
NewTabUtils: "resource://gre/modules/NewTabUtils.jsm",
3839
OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm",
3940
PageActions: "resource:///modules/PageActions.jsm",

browser/base/content/nsContextMenu.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
1616
WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.jsm",
1717
ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
1818
DevToolsShim: "chrome://devtools-shim/content/DevToolsShim.jsm",
19+
NetUtil: "resource://gre/modules/NetUtil.jsm",
1920
});
2021

2122
var gContextMenuContentData = null;

browser/base/content/test/static/browser_parsable_css.js

Lines changed: 106 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,72 @@ let whitelist = [
6969
intermittent: true,
7070
errorMessage: /Property contained reference to invalid variable.*color/i,
7171
isFromDevTools: true},
72+
73+
// These are CSS custom properties that we found a definition of but
74+
// no reference to.
75+
// Bug 1441837
76+
{propName: "--in-content-category-text-active",
77+
isFromDevTools: false},
78+
// Bug 1441844
79+
{propName: "--chrome-nav-bar-separator-color",
80+
isFromDevTools: false},
81+
// Bug 1441855
82+
{propName: "--chrome-nav-buttons-background",
83+
isFromDevTools: false},
84+
// Bug 1441855
85+
{propName: "--chrome-nav-buttons-hover-background",
86+
isFromDevTools: false},
87+
// Bug 1441857
88+
{propName: "--muteButton-width",
89+
isFromDevTools: false},
90+
// Bug 1441857
91+
{propName: "--closedCaptionButton-width",
92+
isFromDevTools: false},
93+
// Bug 1441857
94+
{propName: "--fullscreenButton-width",
95+
isFromDevTools: false},
96+
// Bug 1441857
97+
{propName: "--durationSpan-width",
98+
isFromDevTools: false},
99+
// Bug 1441857
100+
{propName: "--durationSpan-width-long",
101+
isFromDevTools: false},
102+
// Bug 1441857
103+
{propName: "--positionDurationBox-width",
104+
isFromDevTools: false},
105+
// Bug 1441857
106+
{propName: "--positionDurationBox-width-long",
107+
isFromDevTools: false},
108+
// Bug 1441860
109+
{propName: "--rule-flex-toggle-color",
110+
isFromDevTools: true},
111+
// Bug 1441929
112+
{propName: "--theme-search-overlays-semitransparent",
113+
isFromDevTools: true},
114+
// Bug 1441878
115+
{propName: "--theme-codemirror-gutter-background",
116+
isFromDevTools: true},
117+
// Bug 1441879
118+
{propName: "--arrow-width",
119+
isFromDevTools: true},
120+
// Bug 1442300
121+
{propName: "--in-content-category-background",
122+
isFromDevTools: false},
123+
// Bug 1442314
124+
{propName: "--separator-border-image",
125+
isFromDevTools: true},
126+
127+
// Used on Linux
128+
{propName: "--in-content-box-background-odd",
129+
platforms: ["win", "macosx"],
130+
isFromDevTools: false},
131+
132+
// These properties *are* actually referenced. Need to find why
133+
// their reference isn't getting counted.
134+
{propName: "--bezier-diagonal-color",
135+
isFromDevTools: true},
136+
{propName: "--bezier-grid-color",
137+
isFromDevTools: true},
72138
];
73139

74140
if (!Services.prefs.getBoolPref("full-screen-api.unprefix.enabled")) {
@@ -194,6 +260,7 @@ function messageIsCSSError(msg) {
194260
}
195261

196262
let imageURIsToReferencesMap = new Map();
263+
let customPropsToReferencesMap = new Map();
197264

198265
function processCSSRules(sheet) {
199266
for (let rule of sheet.cssRules) {
@@ -208,10 +275,11 @@ function processCSSRules(sheet) {
208275
// Note: CSSStyleRule.cssText always has double quotes around URLs even
209276
// when the original CSS file didn't.
210277
let urls = rule.cssText.match(/url\("[^"]*"\)/g);
211-
if (!urls)
278+
let props = rule.cssText.match(/(var\()?(--[\w\-]+)/g);
279+
if (!urls && !props)
212280
continue;
213281

214-
for (let url of urls) {
282+
for (let url of (urls || [])) {
215283
// Remove the url(" prefix and the ") suffix.
216284
url = url.replace(/url\("(.*)"\)/, "$1");
217285
if (url.startsWith("data:"))
@@ -229,6 +297,16 @@ function processCSSRules(sheet) {
229297
imageURIsToReferencesMap.get(url).add(baseUrl);
230298
}
231299
}
300+
301+
for (let prop of (props || [])) {
302+
if (prop.startsWith("var(")) {
303+
prop = prop.substring(4);
304+
let prevValue = customPropsToReferencesMap.get(prop) || 0;
305+
customPropsToReferencesMap.set(prop, prevValue + 1);
306+
} else if (!customPropsToReferencesMap.has(prop)) {
307+
customPropsToReferencesMap.set(prop, undefined);
308+
}
309+
}
232310
}
233311
}
234312

@@ -354,6 +432,26 @@ add_task(async function checkAllTheCSS() {
354432
}
355433
}
356434

435+
// Check if all the properties that are defined are referenced.
436+
for (let [prop, refCount] of customPropsToReferencesMap) {
437+
if (!refCount) {
438+
let ignored = false;
439+
for (let item of whitelist) {
440+
if (item.propName == prop &&
441+
isDevtools == item.isFromDevTools) {
442+
item.used = true;
443+
if (!item.platforms || item.platforms.includes(AppConstants.platform)) {
444+
ignored = true;
445+
}
446+
break;
447+
}
448+
}
449+
if (!ignored) {
450+
ok(false, "custom property `" + prop + "` is not referenced");
451+
}
452+
}
453+
}
454+
357455
let messages = Services.console.getMessageArray();
358456
// Count errors (the test output will list actual issues for us, as well
359457
// as the ok(false) in messageIsCSSError.
@@ -362,8 +460,12 @@ add_task(async function checkAllTheCSS() {
362460

363461
// Confirm that all whitelist rules have been used.
364462
for (let item of whitelist) {
365-
if (!item.used && isDevtools == item.isFromDevTools && !item.intermittent) {
463+
if (!item.used &&
464+
(!item.platforms || item.platforms.includes(AppConstants.platform)) &&
465+
isDevtools == item.isFromDevTools &&
466+
!item.intermittent) {
366467
ok(false, "Unused whitelist item. " +
468+
(item.propName ? " propName: " + item.propName : "") +
367469
(item.sourceName ? " sourceName: " + item.sourceName : "") +
368470
(item.errorMessage ? " errorMessage: " + item.errorMessage : ""));
369471
}
@@ -388,4 +490,5 @@ add_task(async function checkAllTheCSS() {
388490
hiddenFrame.destroy();
389491
hiddenFrame = null;
390492
imageURIsToReferencesMap = null;
493+
customPropsToReferencesMap = null;
391494
});

0 commit comments

Comments
 (0)