Backed out changeset 849aa9b1b90c (bug 1491699) for merge conflicts with backout of rev f6d8ba2898f9. a=backout

This commit is contained in:
Jorg K 2018-10-09 20:39:24 +02:00
Родитель 0029da3eb3
Коммит a75af1cddf
9 изменённых файлов: 128 добавлений и 61 удалений

Просмотреть файл

@ -196,51 +196,7 @@ class MozMailEmailaddress extends MozXULElement {
}
}
class MozMailNewsgroup extends MozXULElement {
connectedCallback() {
this.classList.add("emailDisplayButton");
this.setAttribute("context", "newsgroupPopup");
this.setAttribute("popup", "newsgroupPopup");
}
}
class MozMailNewsgroupsHeaderfield extends MozXULElement {
connectedCallback() {
this.classList.add("headerValueBox");
this.mNewsgroups = [];
}
addNewsgroupView(aNewsgroup) {
this.mNewsgroups.push(aNewsgroup);
}
buildViews() {
for (let i = 0; i < this.mNewsgroups.length; i++) {
const newNode = document.createElement("mail-newsgroup");
if (i > 0) {
const textNode = document.createElement("text");
textNode.setAttribute("value", ",");
textNode.setAttribute("class", "newsgroupSeparator");
this.appendChild(textNode);
}
newNode.textContent = this.mNewsgroups[i];
newNode.setAttribute("newsgroup", this.mNewsgroups[i]);
this.appendChild(newNode);
}
}
clearHeaderValues() {
this.mNewsgroups = [];
while (this.hasChildNodes()) {
this.lastChild.remove();
}
}
}
customElements.define("mail-headerfield", MozMailHeaderfield);
customElements.define("mail-urlfield", MozMailUrlfield);
customElements.define("mail-tagfield", MozMailHeaderfieldTags);
customElements.define("mail-newsgroup", MozMailNewsgroup);
customElements.define("mail-newsgroups-headerfield", MozMailNewsgroupsHeaderfield);
customElements.define("mail-emailaddress", MozMailEmailaddress);

Просмотреть файл

@ -883,6 +883,100 @@
</implementation>
</binding>
<!-- a single newsgroup as displayed in the message header with a drop-down
menu for various actions -->
<binding id="mail-newsgroup">
<content>
<xul:hbox anonid="newsgroupValue" class="emailDisplayButton"
context="newsgroupPopup" popup="newsgroupPopup"
flex="1" align="center">
<xul:label class="newsgrouplabel" anonid="newsgrouplabel"
role="textbox" aria-readonly="true"
xbl:inherits="value=label,crop"/>
</xul:hbox>
</content>
<implementation>
<property name="label" onset="this.getPart('newsgroupValue').setAttribute('label',val); return val;"
onget="return this.getPart('newsgroupValue').getAttribute('label');"/>
</implementation>
</binding>
<!-- The value of the Newsgroups: headers, as displayed in the message,
header, composed of <mail-newsgroup> nodes. -->
<binding id="mail-newsgroups-headerfield">
<content>
<xul:hbox class="headerValueBox" flex="1">
<xul:description class="headerValue" anonid="newsgroups" containsEmail="true"
flex="1"/>
</xul:hbox>
</content>
<implementation>
<constructor><![CDATA[
this.mNewsgroups = new Array;
]]></constructor>
<property name="newsgroups" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'newsgroups');"
readonly="true"/>
<!-- add a newsgroup to the internal list of newsgroups -->
<method name="addNewsgroupView">
<parameter name="aNewsgroup"/>
<body><![CDATA[
this.mNewsgroups.push(aNewsgroup);
]]></body>
</method>
<!-- build the view for the current list of newsgroups -->
<method name="buildViews">
<body><![CDATA[
for (let i=0; i<this.mNewsgroups.length; i++)
{
let newNode = document.createElement("mail-newsgroup");
if (i)
{
let textNode = document.createElement("text");
textNode.setAttribute("value", ",");
textNode.setAttribute("class", "newsgroupSeparator");
this.newsgroups.appendChild(textNode);
}
let itemInDocument = this.newsgroups.appendChild(newNode);
itemInDocument.setAttribute("label", this.mNewsgroups[i]);
itemInDocument.setAttribute("newsgroup", this.mNewsgroups[i]);
// Since the control attribute points to the <newsgroups>
// element rather than the XUL <label>, screen
// readers don't know to automagically prepend the label when
// reading the tag, so we force this. Furthermore, at least on
// Mac, there is no JS labelElement property at all, so we
// skip in that case. We get away with it because there's no
// screen reader support on the Mac.
if ("labelElement" in this) {
let ariaLabel = this.labelElement.value + ": " +
this.mNewsgroups[i];
let contentElement =
document.getAnonymousElementByAttribute(itemInDocument,
"anonid",
"newsgrouplabel");
contentElement.setAttribute("aria-label", ariaLabel);
}
}
]]></body>
</method>
<!-- clear the current view and internal list of newsgroups -->
<method name="clearHeaderValues">
<body><![CDATA[
this.mNewsgroups = new Array;
while(this.newsgroups.hasChildNodes())
this.newsgroups.lastChild.remove();
]]></body>
</method>
</implementation>
</binding>
<binding id="mail-messageids-headerfield">
<content>
<xul:hbox class="headerNameBox" align="start" pack="end">

Просмотреть файл

@ -44,6 +44,14 @@ mail-multi-emailHeaderField {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#mail-multi-emailHeaderField");
}
mail-newsgroup {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#mail-newsgroup");
}
mail-newsgroups-headerfield {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#mail-newsgroups-headerfield");
}
mail-tagfield[collapsed="true"] {
display: none;
}

Просмотреть файл

@ -235,24 +235,24 @@
<tooltip id="attachmentListTooltip"/>
<menupopup id="newsgroupPopup" position="after_start" class="newsgroupPopup"
onpopupshowing="setupNewsgroupPopup(document.popupNode); goUpdateCommand('cmd_createFilterFromPopup')"
onpopuphiding="hideEmailNewsPopup(document.popupNode);">
onpopupshowing="setupNewsgroupPopup(findEmailNodeFromPopupNode(document.popupNode, 'newsgroupPopup')); goUpdateCommand('cmd_createFilterFromPopup')"
onpopuphiding="hideEmailNewsPopup(findEmailNodeFromPopupNode(document.popupNode, 'newsgroupPopup'));">
<menuitem id="newsgroupPlaceHolder"
disabled="true"/>
<menuseparator/>
<menuitem id="sendMessageToNewsgroupItem" label="&SendMessageTo.label;"
accesskey="&SendMessageTo.accesskey;"
oncommand="SendMailToNode(document.popupNode, event)"/>
oncommand="SendMailToNode(findEmailNodeFromPopupNode(document.popupNode, 'newsgroupPopup'), event)"/>
<menuitem id="copyNewsgroupNameItem" label="&CopyNewsgroupName.label;"
accesskey="&CopyNewsgroupName.accesskey;"
oncommand="CopyEmailNewsAddress(document.popupNode)"/>
oncommand="CopyEmailNewsAddress(findEmailNodeFromPopupNode(document.popupNode, 'newsgroupPopup'))"/>
<menuitem id="copyNewsgroupURLItem" label="&CopyNewsgroupURL.label;"
accesskey="&CopyNewsgroupURL.accesskey;"
oncommand="CopyNewsgroupURL(document.popupNode)"/>
oncommand="CopyNewsgroupURL(findEmailNodeFromPopupNode(document.popupNode, 'newsgroupPopup'))"/>
<menuseparator id="subscribeToNewsgroupSeparator"/>
<menuitem id="subscribeToNewsgroupItem" label="&SubscribeToNewsgroup.label;"
accesskey="&SubscribeToNewsgroup.accesskey;"
oncommand="SubscribeToNewsgroup(document.popupNode)"/>
oncommand="SubscribeToNewsgroup(findEmailNodeFromPopupNode(document.popupNode, 'newsgroupPopup'))"/>
</menupopup>
<menupopup id="pageContextMenu"

Просмотреть файл

@ -345,13 +345,13 @@
<label id="expandednewsgroupsLabel" class="headerName"
value="&newsgroupsField4.label;"
control="expandednewsgroupsBox"/>
<mail-newsgroups-headerfield id="expandednewsgroupsBox" flex="1"/>
<mail-newsgroups-headerfield id="expandednewsgroupsBox"/>
</row>
<row id="expandedfollowup-toRow" collapsed="true">
<label id="expandedfollowup-toLabel" class="headerName"
value="&followupToField4.label;"
control="expandedfollowup-toBox"/>
<mail-newsgroups-headerfield id="expandedfollowup-toBox" flex="1"/>
<mail-newsgroups-headerfield id="expandedfollowup-toBox"/>
</row>
<row id="expandeddateRow" collapsed="true">
<label id="expandeddateLabel" class="headerName"

Просмотреть файл

@ -237,6 +237,12 @@ toolbar[mode="icons"] > #otherActionsButton > .toolbarbutton-menu-dropmarker {
margin-inline-end: 3px;
}
.headerValueBox {
overflow:visible;
margin-bottom: 0 !important;
padding-bottom: 0 !important;
}
.headerValue {
min-width: 50px;
white-space: normal;

Просмотреть файл

@ -301,6 +301,12 @@ toolbar[mode="icons"] > #otherActionsButton > .toolbarbutton-menu-dropmarker >
margin-inline-end: 3px;
}
.headerValueBox {
overflow: visible;
margin-bottom: 0 !important;
padding-bottom: 0 !important;
}
.headerValue {
min-width: 50px;
white-space: normal;

Просмотреть файл

@ -105,15 +105,6 @@ toolbarpaletteitem #hdrDummyReplyButton {
margin-inline-start: 8px;
}
.headerValueBox {
overflow: visible;
}
mail-newsgroups-headerfield.headerValueBox {
padding: .1em 0;
margin-bottom: 4px;
}
.headerValueBox[singleline="true"] > .headerValue[containsEmail="true"] {
white-space: nowrap;
}

Просмотреть файл

@ -138,6 +138,12 @@ window[inlinetoolbox] #newtoolbar {
margin-inline-end: 3px;
}
.headerValueBox {
overflow:visible;
margin-bottom: 0 !important;
padding-bottom: 0 !important;
}
.headerValue {
min-width: 50px;
white-space: normal;