Skip to content

Commit

Permalink
Merge mozilla-inbound to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Razvan Maries committed Jan 8, 2019
2 parents 7f6bbcf + f5a1a0f commit f4c5025
Show file tree
Hide file tree
Showing 76 changed files with 2,616 additions and 1,318 deletions.
78 changes: 39 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions browser/base/content/tabbrowser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// - for vertical orientation
// - corresponding to an overflow event that we ignored
let tabs = document.getBindingParent(this);
if (event.originalTarget != this._scrollbox ||
if (event.originalTarget != this.scrollbox ||
event.detail == 0 ||
!tabs.hasAttribute("overflow")) {
return;
Expand All @@ -56,7 +56,7 @@
// Ignore overflow events:
// - from nested scrollable elements
// - for vertical orientation
if (event.originalTarget != this._scrollbox ||
if (event.originalTarget != this.scrollbox ||
event.detail == 0) {
return;
}
Expand Down Expand Up @@ -634,7 +634,7 @@
let leftMovingTabScreenX = movingTabs[0].boxObject.screenX;
let translateX = screenX - draggedTab._dragData.screenX;
if (!pinned) {
translateX += this.arrowScrollbox._scrollbox.scrollLeft - draggedTab._dragData.scrollX;
translateX += this.arrowScrollbox.scrollbox.scrollLeft - draggedTab._dragData.scrollX;
}
let leftBound = leftTab.boxObject.screenX - leftMovingTabScreenX;
let rightBound = (rightTab.boxObject.screenX + rightTab.boxObject.width) -
Expand Down Expand Up @@ -1555,7 +1555,7 @@
tab._dragData = {
offsetX: event.screenX - window.screenX - tabOffsetX,
offsetY: event.screenY - window.screenY,
scrollX: this.arrowScrollbox._scrollbox.scrollLeft,
scrollX: this.arrowScrollbox.scrollbox.scrollLeft,
screenX: event.screenX,
movingTabs: (tab.multiselected ? gBrowser.selectedTabs : [tab])
.filter(t => t.pinned == tab.pinned),
Expand Down
39 changes: 26 additions & 13 deletions browser/base/content/test/forms/browser_selectpopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,51 +462,64 @@ async function performLargePopupTests(win) {
// Check if a drag-select works and scrolls the list.
await openSelectPopup(selectPopup, "mousedown", "select", win);

let scrollPos = selectPopup.scrollBox.scrollTop;
let getScrollPos = () => selectPopup.scrollBox.scrollbox.scrollTop;
let scrollPos = getScrollPos();
let popupRect = selectPopup.getBoundingClientRect();

// First, check that scrolling does not occur when the mouse is moved over the
// anchor button but not the popup yet.
EventUtils.synthesizeMouseAtPoint(popupRect.left + 5, popupRect.top - 10, { type: "mousemove" }, win);
is(selectPopup.scrollBox.scrollTop, scrollPos, "scroll position after mousemove over button should not change");
is(getScrollPos(), scrollPos, "scroll position after mousemove over button should not change");

EventUtils.synthesizeMouseAtPoint(popupRect.left + 20, popupRect.top + 10, { type: "mousemove" }, win);

// Dragging above the popup scrolls it up.
let scrolledPromise = BrowserTestUtils.waitForEvent(selectPopup, "scroll", false,
() => getScrollPos() < scrollPos - 5);
EventUtils.synthesizeMouseAtPoint(popupRect.left + 20, popupRect.top - 20, { type: "mousemove" }, win);
ok(selectPopup.scrollBox.scrollTop < scrollPos - 5, "scroll position at drag up");
await scrolledPromise;
ok(true, "scroll position at drag up");

// Dragging below the popup scrolls it down.
scrollPos = selectPopup.scrollBox.scrollTop;
scrollPos = getScrollPos();
scrolledPromise = BrowserTestUtils.waitForEvent(selectPopup, "scroll", false,
() => getScrollPos() > scrollPos + 5);
EventUtils.synthesizeMouseAtPoint(popupRect.left + 20, popupRect.bottom + 20, { type: "mousemove" }, win);
ok(selectPopup.scrollBox.scrollTop > scrollPos + 5, "scroll position at drag down");
await scrolledPromise;
ok(true, "scroll position at drag down");

// Releasing the mouse button and moving the mouse does not change the scroll position.
scrollPos = selectPopup.scrollBox.scrollTop;
scrollPos = getScrollPos();
EventUtils.synthesizeMouseAtPoint(popupRect.left + 20, popupRect.bottom + 25, { type: "mouseup" }, win);
is(selectPopup.scrollBox.scrollTop, scrollPos, "scroll position at mouseup should not change");
is(getScrollPos(), scrollPos, "scroll position at mouseup should not change");

EventUtils.synthesizeMouseAtPoint(popupRect.left + 20, popupRect.bottom + 20, { type: "mousemove" }, win);
is(selectPopup.scrollBox.scrollTop, scrollPos, "scroll position at mousemove after mouseup should not change");
is(getScrollPos(), scrollPos, "scroll position at mousemove after mouseup should not change");

// Now check dragging with a mousedown on an item
let menuRect = selectPopup.children[51].getBoundingClientRect();
EventUtils.synthesizeMouseAtPoint(menuRect.left + 5, menuRect.top + 5, { type: "mousedown" }, win);

// Dragging below the popup scrolls it down.
scrolledPromise = BrowserTestUtils.waitForEvent(selectPopup, "scroll", false,
() => getScrollPos() > scrollPos + 5);
EventUtils.synthesizeMouseAtPoint(popupRect.left + 20, popupRect.bottom + 20, { type: "mousemove" }, win);
ok(selectPopup.scrollBox.scrollTop > scrollPos + 5, "scroll position at drag down from option");
await scrolledPromise;
ok(true, "scroll position at drag down from option");

// Dragging above the popup scrolls it up.
scrolledPromise = BrowserTestUtils.waitForEvent(selectPopup, "scroll", false,
() => getScrollPos() < scrollPos - 5);
EventUtils.synthesizeMouseAtPoint(popupRect.left + 20, popupRect.top - 20, { type: "mousemove" }, win);
is(selectPopup.scrollBox.scrollTop, scrollPos, "scroll position at drag up from option");
await scrolledPromise;
ok(true, "scroll position at drag up from option");

scrollPos = selectPopup.scrollBox.scrollTop;
scrollPos = getScrollPos();
EventUtils.synthesizeMouseAtPoint(popupRect.left + 20, popupRect.bottom + 25, { type: "mouseup" }, win);
is(selectPopup.scrollBox.scrollTop, scrollPos, "scroll position at mouseup from option should not change");
is(getScrollPos(), scrollPos, "scroll position at mouseup from option should not change");

EventUtils.synthesizeMouseAtPoint(popupRect.left + 20, popupRect.bottom + 20, { type: "mousemove" }, win);
is(selectPopup.scrollBox.scrollTop, scrollPos, "scroll position at mousemove after mouseup should not change");
is(getScrollPos(), scrollPos, "scroll position at mousemove after mouseup should not change");

await hideSelectPopup(selectPopup, "escape", win);

Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/test/tabs/browser_overflowScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ requestLongerTimeout(2);
*/
add_task(async function() {
let arrowScrollbox = gBrowser.tabContainer.arrowScrollbox;
let scrollbox = arrowScrollbox._scrollbox;
let scrollbox = arrowScrollbox.scrollbox;
let originalSmoothScroll = arrowScrollbox.smoothScroll;
let tabs = gBrowser.tabs;
let tabMinWidth = parseInt(getComputedStyle(gBrowser.selectedTab, null).minWidth);
Expand Down
2 changes: 0 additions & 2 deletions dom/base/nsImageLoadingContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ class nsImageLoadingContent : public nsIImageLoadingContent {
*/
void DestroyImageLoadingContent();

void ClearBrokenState() { mBroken = false; }

/**
* Returns the CORS mode that will be used for all future image loads. The
* default implementation returns CORS_NONE unconditionally.
Expand Down
5 changes: 0 additions & 5 deletions dom/html/HTMLImageElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,6 @@ nsresult HTMLImageElement::BindToTree(Document* aDocument, nsIContent* aParent,
// initaiated by a user interaction.
mUseUrgentStartForChannel = EventStateManager::IsHandlingUserInput();

// FIXME: Bug 660963 it would be nice if we could just have
// ClearBrokenState update our state and do it fast...
ClearBrokenState();
RemoveStatesSilently(NS_EVENT_STATE_BROKEN);

// We still act synchronously for the non-responsive case (Bug
// 1076583), but still need to delay if it is unsafe to run
// script.
Expand Down
4 changes: 0 additions & 4 deletions dom/html/HTMLInputElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4339,10 +4339,6 @@ nsresult HTMLInputElement::BindToTree(Document* aDocument, nsIContent* aParent,
// initaiated by a user interaction.
mUseUrgentStartForChannel = EventStateManager::IsHandlingUserInput();

// FIXME: Bug 660963 it would be nice if we could just have
// ClearBrokenState update our state and do it fast...
ClearBrokenState();
RemoveStatesSilently(NS_EVENT_STATE_BROKEN);
nsContentUtils::AddScriptRunner(
NewRunnableMethod("dom::HTMLInputElement::MaybeLoadImage", this,
&HTMLInputElement::MaybeLoadImage));
Expand Down
Loading

0 comments on commit f4c5025

Please sign in to comment.