Skip to content

Commit

Permalink
Merge autoland to mozilla-central. a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dgluca committed Mar 1, 2018
2 parents 9887ae8 + 12c9356 commit 059564f
Show file tree
Hide file tree
Showing 73 changed files with 1,190 additions and 1,076 deletions.
5 changes: 1 addition & 4 deletions accessible/base/nsAccessibilityService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
{
nsAutoString role;
nsCoreUtils::XBLBindingRole(aContent, role);
if (role.IsEmpty() || role.EqualsLiteral("none"))
if (role.IsEmpty())
return nullptr;

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

} else if(role.EqualsLiteral("xul:pane")) {
accessible = new EnumRoleAccessible<roles::PANE>(aContent, aDoc);

} else if (role.EqualsLiteral("xul:panel")) {
if (aContent->IsElement() &&
aContent->AsElement()->AttrValueIs(kNameSpaceID_None,
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/browser-feeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ var FeedHandler = {
// http://foo.com/index.rdf -> feed://foo.com/index.rdf
// other urls: prepend feed: scheme, e.g.
// https://foo.com/index.rdf -> feed:https://foo.com/index.rdf
let feedURI = NetUtil.newURI(aSpec);
let feedURI = Services.io.newURI(aSpec);
if (feedURI.schemeIs("http")) {
feedURI = feedURI.mutate()
.setScheme("feed")
Expand Down
8 changes: 4 additions & 4 deletions browser/base/content/browser-places.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ var PlacesCommandHook = {
let parentGuid = parentId == PlacesUtils.bookmarksMenuFolderId ?
PlacesUtils.bookmarks.menuGuid :
await PlacesUtils.promiseItemGuid(parentId);
let defaultInsertionPoint = new InsertionPoint({ parentId, parentGuid });
let defaultInsertionPoint = new PlacesInsertionPoint({ parentId, parentGuid });
PlacesUIUtils.showBookmarkDialog({ action: "add",
type: "bookmark",
uri: makeURI(url),
Expand Down Expand Up @@ -557,7 +557,7 @@ var PlacesCommandHook = {
* A short description of the feed. Optional.
*/
async addLiveBookmark(url, feedTitle, feedSubtitle) {
let toolbarIP = new InsertionPoint({
let toolbarIP = new PlacesInsertionPoint({
parentId: PlacesUtils.toolbarFolderId,
parentGuid: PlacesUtils.bookmarks.toolbarGuid
});
Expand Down Expand Up @@ -993,7 +993,7 @@ var PlacesMenuDNDHandler = {
* The DragOver event.
*/
onDragOver: function PMDH_onDragOver(event) {
let ip = new InsertionPoint({
let ip = new PlacesInsertionPoint({
parentId: PlacesUtils.bookmarksMenuFolderId,
parentGuid: PlacesUtils.bookmarks.menuGuid
});
Expand All @@ -1010,7 +1010,7 @@ var PlacesMenuDNDHandler = {
*/
onDrop: function PMDH_onDrop(event) {
// Put the item at the end of bookmark menu.
let ip = new InsertionPoint({
let ip = new PlacesInsertionPoint({
parentId: PlacesUtils.bookmarksMenuFolderId,
parentGuid: PlacesUtils.bookmarks.menuGuid
});
Expand Down
1 change: 1 addition & 0 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
Log: "resource://gre/modules/Log.jsm",
LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
NetUtil: "resource://gre/modules/NetUtil.jsm",
NewTabUtils: "resource://gre/modules/NewTabUtils.jsm",
OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm",
PageActions: "resource:///modules/PageActions.jsm",
Expand Down
1 change: 1 addition & 0 deletions browser/base/content/nsContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.jsm",
ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
DevToolsShim: "chrome://devtools-shim/content/DevToolsShim.jsm",
NetUtil: "resource://gre/modules/NetUtil.jsm",
});

var gContextMenuContentData = null;
Expand Down
109 changes: 106 additions & 3 deletions browser/base/content/test/static/browser_parsable_css.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,72 @@ let whitelist = [
intermittent: true,
errorMessage: /Property contained reference to invalid variable.*color/i,
isFromDevTools: true},

// These are CSS custom properties that we found a definition of but
// no reference to.
// Bug 1441837
{propName: "--in-content-category-text-active",
isFromDevTools: false},
// Bug 1441844
{propName: "--chrome-nav-bar-separator-color",
isFromDevTools: false},
// Bug 1441855
{propName: "--chrome-nav-buttons-background",
isFromDevTools: false},
// Bug 1441855
{propName: "--chrome-nav-buttons-hover-background",
isFromDevTools: false},
// Bug 1441857
{propName: "--muteButton-width",
isFromDevTools: false},
// Bug 1441857
{propName: "--closedCaptionButton-width",
isFromDevTools: false},
// Bug 1441857
{propName: "--fullscreenButton-width",
isFromDevTools: false},
// Bug 1441857
{propName: "--durationSpan-width",
isFromDevTools: false},
// Bug 1441857
{propName: "--durationSpan-width-long",
isFromDevTools: false},
// Bug 1441857
{propName: "--positionDurationBox-width",
isFromDevTools: false},
// Bug 1441857
{propName: "--positionDurationBox-width-long",
isFromDevTools: false},
// Bug 1441860
{propName: "--rule-flex-toggle-color",
isFromDevTools: true},
// Bug 1441929
{propName: "--theme-search-overlays-semitransparent",
isFromDevTools: true},
// Bug 1441878
{propName: "--theme-codemirror-gutter-background",
isFromDevTools: true},
// Bug 1441879
{propName: "--arrow-width",
isFromDevTools: true},
// Bug 1442300
{propName: "--in-content-category-background",
isFromDevTools: false},
// Bug 1442314
{propName: "--separator-border-image",
isFromDevTools: true},

// Used on Linux
{propName: "--in-content-box-background-odd",
platforms: ["win", "macosx"],
isFromDevTools: false},

// These properties *are* actually referenced. Need to find why
// their reference isn't getting counted.
{propName: "--bezier-diagonal-color",
isFromDevTools: true},
{propName: "--bezier-grid-color",
isFromDevTools: true},
];

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

let imageURIsToReferencesMap = new Map();
let customPropsToReferencesMap = new Map();

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

for (let url of urls) {
for (let url of (urls || [])) {
// Remove the url(" prefix and the ") suffix.
url = url.replace(/url\("(.*)"\)/, "$1");
if (url.startsWith("data:"))
Expand All @@ -229,6 +297,16 @@ function processCSSRules(sheet) {
imageURIsToReferencesMap.get(url).add(baseUrl);
}
}

for (let prop of (props || [])) {
if (prop.startsWith("var(")) {
prop = prop.substring(4);
let prevValue = customPropsToReferencesMap.get(prop) || 0;
customPropsToReferencesMap.set(prop, prevValue + 1);
} else if (!customPropsToReferencesMap.has(prop)) {
customPropsToReferencesMap.set(prop, undefined);
}
}
}
}

Expand Down Expand Up @@ -354,6 +432,26 @@ add_task(async function checkAllTheCSS() {
}
}

// Check if all the properties that are defined are referenced.
for (let [prop, refCount] of customPropsToReferencesMap) {
if (!refCount) {
let ignored = false;
for (let item of whitelist) {
if (item.propName == prop &&
isDevtools == item.isFromDevTools) {
item.used = true;
if (!item.platforms || item.platforms.includes(AppConstants.platform)) {
ignored = true;
}
break;
}
}
if (!ignored) {
ok(false, "custom property `" + prop + "` is not referenced");
}
}
}

let messages = Services.console.getMessageArray();
// Count errors (the test output will list actual issues for us, as well
// as the ok(false) in messageIsCSSError.
Expand All @@ -362,8 +460,12 @@ add_task(async function checkAllTheCSS() {

// Confirm that all whitelist rules have been used.
for (let item of whitelist) {
if (!item.used && isDevtools == item.isFromDevTools && !item.intermittent) {
if (!item.used &&
(!item.platforms || item.platforms.includes(AppConstants.platform)) &&
isDevtools == item.isFromDevTools &&
!item.intermittent) {
ok(false, "Unused whitelist item. " +
(item.propName ? " propName: " + item.propName : "") +
(item.sourceName ? " sourceName: " + item.sourceName : "") +
(item.errorMessage ? " errorMessage: " + item.errorMessage : ""));
}
Expand All @@ -388,4 +490,5 @@ add_task(async function checkAllTheCSS() {
hiddenFrame.destroy();
hiddenFrame = null;
imageURIsToReferencesMap = null;
customPropsToReferencesMap = null;
});
Loading

0 comments on commit 059564f

Please sign in to comment.