зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1603827 - Replace XULElement.orient with getAttribute/setAttribute r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D57665 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
4d11185e5a
Коммит
544bd79ea5
|
@ -660,8 +660,8 @@
|
|||
// if this panel has a "sliding" arrow, we may have previously set margins...
|
||||
arrowbox.style.removeProperty("transform");
|
||||
if (position.indexOf("start_") == 0 || position.indexOf("end_") == 0) {
|
||||
container.orient = "horizontal";
|
||||
arrowbox.orient = "vertical";
|
||||
container.setAttribute("orient", "horizontal");
|
||||
arrowbox.setAttribute("orient", "vertical");
|
||||
if (position.indexOf("_after") > 0) {
|
||||
arrowbox.setAttribute("pack", "end");
|
||||
} else {
|
||||
|
@ -683,8 +683,8 @@
|
|||
position.indexOf("before_") == 0 ||
|
||||
position.indexOf("after_") == 0
|
||||
) {
|
||||
container.orient = "";
|
||||
arrowbox.orient = "";
|
||||
container.removeAttribute("orient");
|
||||
arrowbox.removeAttribute("orient");
|
||||
if (position.indexOf("_end") > 0) {
|
||||
arrowbox.setAttribute("pack", "end");
|
||||
} else {
|
||||
|
|
|
@ -196,13 +196,13 @@
|
|||
}
|
||||
|
||||
get scrollClientSize() {
|
||||
return this.orient == "vertical"
|
||||
return this.getAttribute("orient") == "vertical"
|
||||
? this.scrollbox.clientHeight
|
||||
: this.scrollbox.clientWidth;
|
||||
}
|
||||
|
||||
get scrollSize() {
|
||||
return this.orient == "vertical"
|
||||
return this.getAttribute("orient") == "vertical"
|
||||
? this.scrollbox.scrollHeight
|
||||
: this.scrollbox.scrollWidth;
|
||||
}
|
||||
|
@ -217,7 +217,7 @@
|
|||
}
|
||||
|
||||
get scrollPosition() {
|
||||
return this.orient == "vertical"
|
||||
return this.getAttribute("orient") == "vertical"
|
||||
? this.scrollbox.scrollTop
|
||||
: this.scrollbox.scrollLeft;
|
||||
}
|
||||
|
@ -225,7 +225,9 @@
|
|||
get startEndProps() {
|
||||
if (!this._startEndProps) {
|
||||
this._startEndProps =
|
||||
this.orient == "vertical" ? ["top", "bottom"] : ["left", "right"];
|
||||
this.getAttribute("orient") == "vertical"
|
||||
? ["top", "bottom"]
|
||||
: ["left", "right"];
|
||||
}
|
||||
return this._startEndProps;
|
||||
}
|
||||
|
@ -233,7 +235,7 @@
|
|||
get isRTLScrollbox() {
|
||||
if (!this._isRTLScrollbox) {
|
||||
this._isRTLScrollbox =
|
||||
this.orient != "vertical" &&
|
||||
this.getAttribute("orient") != "vertical" &&
|
||||
document.defaultView.getComputedStyle(this.scrollbox).direction ==
|
||||
"rtl";
|
||||
}
|
||||
|
@ -649,7 +651,7 @@
|
|||
let doScroll = false;
|
||||
let instant;
|
||||
let scrollAmount = 0;
|
||||
if (this.orient == "vertical") {
|
||||
if (this.getAttribute("orient") == "vertical") {
|
||||
doScroll = true;
|
||||
if (event.deltaMode == event.DOM_DELTA_PIXEL) {
|
||||
scrollAmount = event.deltaY;
|
||||
|
@ -718,7 +720,7 @@
|
|||
this._touchStart = -1;
|
||||
} else {
|
||||
this._touchStart =
|
||||
this.orient == "vertical"
|
||||
this.getAttribute("orient") == "vertical"
|
||||
? event.touches[0].screenY
|
||||
: event.touches[0].screenX;
|
||||
}
|
||||
|
@ -727,7 +729,7 @@
|
|||
on_touchmove(event) {
|
||||
if (event.touches.length == 1 && this._touchStart >= 0) {
|
||||
var touchPoint =
|
||||
this.orient == "vertical"
|
||||
this.getAttribute("orient") == "vertical"
|
||||
? event.touches[0].screenY
|
||||
: event.touches[0].screenX;
|
||||
var delta = this._touchStart - touchPoint;
|
||||
|
@ -759,7 +761,7 @@
|
|||
// 0: vertical
|
||||
// 1: horizontal
|
||||
// 2: both
|
||||
if (this.orient == "vertical") {
|
||||
if (this.getAttribute("orient") == "vertical") {
|
||||
if (event.detail == 1) {
|
||||
return;
|
||||
}
|
||||
|
@ -784,7 +786,7 @@
|
|||
// 0: vertical
|
||||
// 1: horizontal
|
||||
// 2: both
|
||||
if (this.orient == "vertical") {
|
||||
if (this.getAttribute("orient") == "vertical") {
|
||||
if (event.detail == 1) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -123,8 +123,8 @@
|
|||
this.setAttribute("arrowposition", position);
|
||||
|
||||
if (position.indexOf("start_") == 0 || position.indexOf("end_") == 0) {
|
||||
container.orient = "horizontal";
|
||||
arrowbox.orient = "vertical";
|
||||
container.setAttribute("orient", "horizontal");
|
||||
arrowbox.setAttribute("orient", "vertical");
|
||||
if (position.indexOf("_after") > 0) {
|
||||
arrowbox.setAttribute("pack", "end");
|
||||
} else {
|
||||
|
@ -146,8 +146,8 @@
|
|||
position.indexOf("before_") == 0 ||
|
||||
position.indexOf("after_") == 0
|
||||
) {
|
||||
container.orient = "";
|
||||
arrowbox.orient = "";
|
||||
container.removeAttribute("orient");
|
||||
arrowbox.removeAttribute("orient");
|
||||
if (position.indexOf("_end") > 0) {
|
||||
arrowbox.setAttribute("pack", "end");
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче