зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 716295d23677 (bug 1671000) for causing mochitest failures on test_menulist_paging.xhtml. CLOSED TREE
test_menulist_paging.xhtml
This commit is contained in:
Родитель
b4938944be
Коммит
682c27c399
|
@ -31,7 +31,7 @@
|
|||
"dragend",
|
||||
];
|
||||
for (let event_name of event_names) {
|
||||
this.addEventListener(event_name, this);
|
||||
this.addEventListener(event_name, ev => this[`on_${event_name}`](ev));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -364,10 +364,6 @@
|
|||
}
|
||||
|
||||
on_DOMMenuItemActive(event) {
|
||||
if (super.on_DOMMenuItemActive) {
|
||||
super.on_DOMMenuItemActive(event);
|
||||
}
|
||||
|
||||
let elt = event.target;
|
||||
if (elt.parentNode != this) {
|
||||
return;
|
||||
|
@ -599,7 +595,7 @@
|
|||
"popuphidden",
|
||||
];
|
||||
for (let event_name of event_names) {
|
||||
this.addEventListener(event_name, this);
|
||||
this.addEventListener(event_name, ev => this[`on_${event_name}`](ev));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,8 +57,6 @@
|
|||
});
|
||||
|
||||
this.attachShadow({ mode: "open" });
|
||||
|
||||
this.addEventListener("DOMMenuItemActive", this);
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
|
@ -260,28 +258,6 @@
|
|||
this._scrollTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
on_DOMMenuItemActive(event) {
|
||||
// Scroll buttons may overlap the active item. In that case, scroll
|
||||
// further to stay clear of the buttons.
|
||||
if (!this.scrollBox.hasAttribute("overflowing")) {
|
||||
return;
|
||||
}
|
||||
let item = event.target;
|
||||
if (item.parentNode != this) {
|
||||
return;
|
||||
}
|
||||
let itemRect = item.getBoundingClientRect();
|
||||
let buttonRect = this.scrollBox._scrollButtonUp.getBoundingClientRect();
|
||||
if (buttonRect.bottom > itemRect.top) {
|
||||
this.scrollBox.scrollByPixels(itemRect.top - buttonRect.bottom, true);
|
||||
} else {
|
||||
buttonRect = this.scrollBox._scrollButtonDown.getBoundingClientRect();
|
||||
if (buttonRect.top < itemRect.bottom) {
|
||||
this.scrollBox.scrollByPixels(itemRect.bottom - buttonRect.top, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("menupopup", MozMenuPopup);
|
||||
|
|
Загрузка…
Ссылка в новой задаче