mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 12:20:56 +00:00
Back out changeset 4357fe5a9d22 (bug 1206560) for M-e10s(bc4) failures.
MozReview-Commit-ID: 1J0li7PNBWN --HG-- extra : rebase_source : 448ee6888b68f1ebd2d0926b84f946a84b8b5788
This commit is contained in:
parent
ad34c237e8
commit
68e3a5952d
@ -29,8 +29,6 @@ add_task(function* test_notificationClose() {
|
||||
is(alertTitleLabel.value, "Test title", "Title text of notification should be present");
|
||||
let alertTextLabel = alertWindow.document.getElementById("alertTextLabel");
|
||||
is(alertTextLabel.textContent, "Test body", "Body text of notification should be present");
|
||||
let alertIcon = alertWindow.document.getElementById("alertIcon");
|
||||
ok(alertIcon.src, "Icon of notification should be present");
|
||||
|
||||
let alertCloseButton = alertWindow.document.querySelector(".alertCloseButton");
|
||||
is(alertCloseButton.localName, "toolbarbutton", "close button found");
|
||||
|
@ -1,7 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC">
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
|
@ -48,7 +48,7 @@ nsXULAlertObserver::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsXULAlerts, nsIAlertsService, nsIAlertsDoNotDisturb, nsIAlertsIconURI)
|
||||
NS_IMPL_ISUPPORTS(nsXULAlerts, nsIAlertsService, nsIAlertsDoNotDisturb)
|
||||
|
||||
/* static */ already_AddRefed<nsXULAlerts>
|
||||
nsXULAlerts::GetInstance()
|
||||
@ -83,14 +83,6 @@ nsXULAlerts::ShowAlertNotification(const nsAString& aImageUrl, const nsAString&
|
||||
NS_IMETHODIMP
|
||||
nsXULAlerts::ShowAlert(nsIAlertNotification* aAlert,
|
||||
nsIObserver* aAlertListener)
|
||||
{
|
||||
return ShowAlertWithIconURI(aAlert, aAlertListener, nullptr);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULAlerts::ShowAlertWithIconURI(nsIAlertNotification* aAlert,
|
||||
nsIObserver* aAlertListener,
|
||||
nsIURI* aIconURI)
|
||||
{
|
||||
bool inPrivateBrowsing;
|
||||
nsresult rv = aAlert->GetInPrivateBrowsing(&inPrivateBrowsing);
|
||||
@ -248,17 +240,6 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAlertNotification* aAlert,
|
||||
rv = argsArray->AppendElement(scriptableAlertSource);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISupportsCString> scriptableIconURL (do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID));
|
||||
NS_ENSURE_TRUE(scriptableIconURL, NS_ERROR_FAILURE);
|
||||
if (aIconURI) {
|
||||
nsAutoCString iconURL;
|
||||
rv = aIconURI->GetSpec(iconURL);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
scriptableIconURL->SetData(iconURL);
|
||||
}
|
||||
rv = argsArray->AppendElement(scriptableIconURL);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<mozIDOMWindowProxy> newWindow;
|
||||
nsAutoCString features("chrome,dialog=yes,titlebar=no,popup=yes");
|
||||
if (inPrivateBrowsing) {
|
||||
|
@ -13,12 +13,10 @@
|
||||
#include "nsIObserver.h"
|
||||
|
||||
class nsXULAlerts : public nsIAlertsService,
|
||||
public nsIAlertsDoNotDisturb,
|
||||
public nsIAlertsIconURI
|
||||
public nsIAlertsDoNotDisturb
|
||||
{
|
||||
friend class nsXULAlertObserver;
|
||||
public:
|
||||
NS_DECL_NSIALERTSICONURI
|
||||
NS_DECL_NSIALERTSDONOTDISTURB
|
||||
NS_DECL_NSIALERTSSERVICE
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -13,16 +13,10 @@
|
||||
}
|
||||
|
||||
#alertBox:not([hasOrigin]) > box > #alertTextBox > #alertFooter,
|
||||
#alertBox:not([hasIcon]) > box > #alertIcon,
|
||||
#alertImage:not([src]) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#alertTitleBox {
|
||||
-moz-box-pack: center;
|
||||
-moz-box-align: center;
|
||||
}
|
||||
|
||||
.alertText {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
@ -37,19 +37,9 @@ function prefillAlertInfo() {
|
||||
// arguments[8] --> replaced alert window (nsIDOMWindow)
|
||||
// arguments[9] --> an optional callback listener (nsIObserver)
|
||||
// arguments[10] -> the nsIURI.hostPort of the origin, optional
|
||||
// arguments[11] -> the alert icon URL, optional
|
||||
|
||||
switch (window.arguments.length) {
|
||||
default:
|
||||
case 12: {
|
||||
if (window.arguments[11]) {
|
||||
let alertBox = document.getElementById("alertBox");
|
||||
alertBox.setAttribute("hasIcon", true);
|
||||
|
||||
let icon = document.getElementById("alertIcon");
|
||||
icon.src = window.arguments[11];
|
||||
}
|
||||
}
|
||||
case 11: {
|
||||
if (window.arguments[10]) {
|
||||
let alertBox = document.getElementById("alertBox");
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
<vbox id="alertBox" class="alertBox">
|
||||
<box id="alertTitleBox">
|
||||
<image id="alertIcon"/>
|
||||
<label id="alertTitleLabel" class="alertTitle plain" crop="end"/>
|
||||
<vbox class="alertCloseBox">
|
||||
<toolbarbutton class="alertCloseButton close-icon"
|
||||
|
@ -53,22 +53,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
#alertIcon {
|
||||
margin-top: 6px;
|
||||
margin-inline-start: 8px;
|
||||
margin-inline-end: 0;
|
||||
margin-bottom: 0;
|
||||
width: 16px;
|
||||
min-height: 16px;
|
||||
max-height: 16px;
|
||||
}
|
||||
|
||||
@media (resolution: 2dppx) {
|
||||
#alertIcon {
|
||||
image-rendering: -moz-crisp-edges;
|
||||
}
|
||||
}
|
||||
|
||||
#alertImage {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
|
Loading…
x
Reference in New Issue
Block a user