Backed out changeset 39f39360ae48 (bug 1796199) for causing failures at test_panel.xhtml. CLOSED TREE

This commit is contained in:
Butkovits Atila 2022-10-20 00:39:56 +03:00
Родитель 6e541df4b3
Коммит 7f001fb596
10 изменённых файлов: 69 добавлений и 28 удалений

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

@ -95,7 +95,7 @@
this.invoke = function setCrop_invoke() this.invoke = function setCrop_invoke()
{ {
if (!this.labelNode.hasAttribute("crop")) if (!this.labelNode.hasAttribute("crop"))
this.labelNode.style.width = Math.floor(this.width - 2 * this.charWidth) + "px"; this.labelNode.width = Math.floor(this.width - 2 * this.charWidth);
this.labelNode.setAttribute("crop", aCropValue); this.labelNode.setAttribute("crop", aCropValue);
} }

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

@ -407,14 +407,13 @@ var ctrlTab = {
_openPanel: function ctrlTab_openPanel() { _openPanel: function ctrlTab_openPanel() {
tabPreviewPanelHelper.opening(this); tabPreviewPanelHelper.opening(this);
let width = Math.min( this.panel.width = Math.min(
screen.availWidth * 0.99, screen.availWidth * 0.99,
this.canvasWidth * 1.25 * this.tabPreviewCount this.canvasWidth * 1.25 * this.tabPreviewCount
); );
this.panel.style.width = width + "px";
var estimateHeight = this.canvasHeight * 1.25 + 75; var estimateHeight = this.canvasHeight * 1.25 + 75;
this.panel.openPopupAtScreen( this.panel.openPopupAtScreen(
screen.availLeft + (screen.availWidth - width) / 2, screen.availLeft + (screen.availWidth - this.panel.width) / 2,
screen.availTop + (screen.availHeight - estimateHeight) / 2, screen.availTop + (screen.availHeight - estimateHeight) / 2,
false false
); );

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

@ -88,7 +88,9 @@ function createPanel(attrs)
var button = document.createXULElement("button"); var button = document.createXULElement("button");
panel.appendChild(button); panel.appendChild(button);
button.label = "OK"; button.label = "OK";
button.setAttribute("style", "-moz-appearance: none; border: 0; margin: 0; height: 40px; width: 120px;"); button.width = 120;
button.height = 40;
button.setAttribute("style", "-moz-appearance: none; border: 0; margin: 0;");
panel.setAttribute("style", "-moz-appearance: none; border: 0; margin: 0;"); panel.setAttribute("style", "-moz-appearance: none; border: 0; margin: 0;");
return document.documentElement.appendChild(panel); return document.documentElement.appendChild(panel);
} }

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

@ -14,13 +14,13 @@ add_task(async function() {
let specificPanel = document.createXULElement("panel"); let specificPanel = document.createXULElement("panel");
specificPanel.setAttribute("locationspecific", "true"); specificPanel.setAttribute("locationspecific", "true");
specificPanel.setAttribute("noautohide", "true"); specificPanel.setAttribute("noautohide", "true");
specificPanel.style.height = "100px"; specificPanel.height = "100px";
specificPanel.style.width = "100px"; specificPanel.width = "100px";
let generalPanel = document.createXULElement("panel"); let generalPanel = document.createXULElement("panel");
generalPanel.setAttribute("noautohide", "true"); generalPanel.setAttribute("noautohide", "true");
generalPanel.style.height = "100px"; generalPanel.height = "100px";
generalPanel.style.width = "100px"; generalPanel.width = "100px";
let anchor = document.getElementById(CustomizableUI.AREA_NAVBAR); let anchor = document.getElementById(CustomizableUI.AREA_NAVBAR);

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

@ -25,12 +25,12 @@ add_UITour_task(async function test_highlight_size_attributes() {
await new Promise(resolve => { await new Promise(resolve => {
SimpleTest.executeSoon(() => { SimpleTest.executeSoon(() => {
is( is(
highlight.style.height, highlight.height,
"", "",
"Highlight panel should have no explicit height set" "Highlight panel should have no explicit height set"
); );
is( is(
highlight.style.width, highlight.width,
"", "",
"Highlight panel should have no explicit width set" "Highlight panel should have no explicit width set"
); );
@ -49,16 +49,8 @@ add_UITour_task(async function test_info_size_attributes() {
await elementVisiblePromise(tooltip, "Tooltip should be moved to the urlbar"); await elementVisiblePromise(tooltip, "Tooltip should be moved to the urlbar");
await new Promise(resolve => { await new Promise(resolve => {
SimpleTest.executeSoon(() => { SimpleTest.executeSoon(() => {
is( is(tooltip.height, "", "Info panel should have no explicit height set");
tooltip.style.height, is(tooltip.width, "", "Info panel should have no explicit width set");
"",
"Info panel should have no explicit height set"
);
is(
tooltip.style.width,
"",
"Info panel should have no explicit width set"
);
resolve(); resolve();
}); });
}); });

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

@ -27,6 +27,20 @@ interface XULElement : Element {
[SetterThrows] [SetterThrows]
attribute DOMString tooltip; attribute DOMString tooltip;
// Width/height properties
[SetterThrows]
attribute DOMString width;
[SetterThrows]
attribute DOMString height;
[SetterThrows]
attribute DOMString minWidth;
[SetterThrows]
attribute DOMString minHeight;
[SetterThrows]
attribute DOMString maxWidth;
[SetterThrows]
attribute DOMString maxHeight;
// Tooltip // Tooltip
[SetterThrows] [SetterThrows]
attribute DOMString tooltipText; attribute DOMString tooltipText;

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

@ -426,6 +426,40 @@ class nsXULElement : public nsStyledElement {
void SetTooltip(const nsAString& aValue, mozilla::ErrorResult& rv) { void SetTooltip(const nsAString& aValue, mozilla::ErrorResult& rv) {
SetXULAttr(nsGkAtoms::tooltip, aValue, rv); SetXULAttr(nsGkAtoms::tooltip, aValue, rv);
} }
void GetWidth(DOMString& aValue) const {
GetXULAttr(nsGkAtoms::width, aValue);
}
void SetWidth(const nsAString& aValue, mozilla::ErrorResult& rv) {
SetXULAttr(nsGkAtoms::width, aValue, rv);
}
void GetHeight(DOMString& aValue) { GetXULAttr(nsGkAtoms::height, aValue); }
void SetHeight(const nsAString& aValue, mozilla::ErrorResult& rv) {
SetXULAttr(nsGkAtoms::height, aValue, rv);
}
void GetMinWidth(DOMString& aValue) const {
GetXULAttr(nsGkAtoms::minwidth, aValue);
}
void SetMinWidth(const nsAString& aValue, mozilla::ErrorResult& rv) {
SetXULAttr(nsGkAtoms::minwidth, aValue, rv);
}
void GetMinHeight(DOMString& aValue) const {
GetXULAttr(nsGkAtoms::minheight, aValue);
}
void SetMinHeight(const nsAString& aValue, mozilla::ErrorResult& rv) {
SetXULAttr(nsGkAtoms::minheight, aValue, rv);
}
void GetMaxWidth(DOMString& aValue) const {
GetXULAttr(nsGkAtoms::maxwidth, aValue);
}
void SetMaxWidth(const nsAString& aValue, mozilla::ErrorResult& rv) {
SetXULAttr(nsGkAtoms::maxwidth, aValue, rv);
}
void GetMaxHeight(DOMString& aValue) const {
GetXULAttr(nsGkAtoms::maxheight, aValue);
}
void SetMaxHeight(const nsAString& aValue, mozilla::ErrorResult& rv) {
SetXULAttr(nsGkAtoms::maxheight, aValue, rv);
}
void GetTooltipText(DOMString& aValue) const { void GetTooltipText(DOMString& aValue) const {
GetXULAttr(nsGkAtoms::tooltiptext, aValue); GetXULAttr(nsGkAtoms::tooltiptext, aValue);
} }

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

@ -178,7 +178,7 @@ function tabAndScroll()
"menuitem width accounts for scrollbar"); "menuitem width accounts for scrollbar");
list.open = false; list.open = false;
list.menupopup.style.maxHeight = "100px"; list.menupopup.maxHeight = 100;
list.open = true; list.open = true;
var rowdiff = list.getItemAtIndex(1).getBoundingClientRect().top - var rowdiff = list.getItemAtIndex(1).getBoundingClientRect().top -

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

@ -111,10 +111,10 @@ function startTest()
// any padding / border / margin on the menupopup. // any padding / border / margin on the menupopup.
let height = menuitemHeight * 4 + bpmTop + bpmBottom; let height = menuitemHeight * 4 + bpmTop + bpmBottom;
popup.style.height = height + "px"; popup.height = height;
document.getElementById("menulist-popup2").style.height = height + "px"; document.getElementById("menulist-popup2").height = height;
document.getElementById("menulist-popup3").style.height = height + "px"; document.getElementById("menulist-popup3").height = height;
document.getElementById("menulist-popup4").style.height = height + "px"; document.getElementById("menulist-popup4").height = height;
runTest(); runTest();
} }

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

@ -10,7 +10,7 @@
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<richlistbox seltype="multiple" id="richlistbox" flex="1" style="min-height: 80px; max-height: 80px; height: 80px"/> <richlistbox seltype="multiple" id="richlistbox" flex="1" minheight="80" maxheight="80" height="80" />
<!-- test results are displayed in the html:body --> <!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/> <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
@ -32,7 +32,7 @@ function test_richlistbox()
var item; var item;
do { do {
item = richListBox.appendItem("Test", ""); item = richListBox.appendItem("Test", "");
item.style.height = item.style.minHeight = item.style.maxHeight = Math.floor(height / 4) + "px"; item.height = item.minHeight = item.maxHeight = Math.floor(height / 4);
} while (item.getBoundingClientRect().bottom < (height * 2)) } while (item.getBoundingClientRect().bottom < (height * 2))
richListBox.appendItem("Test", ""); richListBox.appendItem("Test", "");
richListBox.firstChild.nextSibling.id = "list-box-first"; richListBox.firstChild.nextSibling.id = "list-box-first";