Bug 630946 - Repaint does not occur when dismissing a combo box [r=mfinkle]

This commit is contained in:
Vivien Nicolas 2011-02-09 00:22:27 +01:00
parent 2a5b87937a
commit 3c2f1084ec
5 changed files with 18 additions and 8 deletions

View File

@ -490,7 +490,7 @@ var BrowserUI = {
// Listen tabs event
Elements.tabs.addEventListener("TabSelect", BrowserUI, true);
Elements.tabs.addEventListener("TabOpen", BrowserUI, true);
Elements.tabs.addEventListener("TabRemove", this, true);
Elements.tabs.addEventListener("TabRemove", BrowserUI, true);
// Init the views
ExtensionsView.init();

View File

@ -291,7 +291,6 @@ var Browser = {
setTimeout(function() { scrollInterface.ensureElementIsVisible(currentElement) }, 0);
}
getBrowser().finishFuzzyZoom();
}
window.addEventListener("resize", resizeHandler, false);
@ -2503,13 +2502,17 @@ Tab.prototype = {
restoreViewportPosition: function restoreViewportPosition(aOldWidth, aNewWidth) {
let browser = this._browser;
let view = browser.getRootView();
let pos = view.getPosition();
// zoom to keep the same portion of the document visible
let oldScale = browser.scale;
let newScale = this.clampZoomLevel(oldScale * aNewWidth / aOldWidth);
let scaleRatio = newScale / oldScale;
// Recalculate whether the visible area is actually in bounds
let view = browser.getRootView();
view.scrollBy(0,0);
let pos = view.getPosition();
browser.fuzzyZoom(newScale, pos.x * scaleRatio, pos.y * scaleRatio);
},
@ -2839,8 +2842,10 @@ var ViewableAreaObserver = {
// If the viewport width is still the same, the page layout has not
// changed, so we can keep keep the same content on-screen.
if (tab.browser.contentWindowWidth == oldWidth)
if (tab.browser.contentWindowWidth == oldWidth) {
tab.restoreViewportPosition(oldWidth, newWidth);
tab.browser.finishFuzzyZoom();
}
}
// setTimeout(callback, 0) to ensure the resize event handler dispatch is finished

View File

@ -789,8 +789,6 @@ var FormHelperUI = {
return;
this._container.hidden = !aVal;
this._container.contentHasChanged();
if (aVal) {
this._zoomStart();
this._container.show(this);

View File

@ -176,6 +176,8 @@ function getBoundingContentRect(aElement) {
document = document.defaultView.frameElement.ownerDocument;
let offset = ContentScroll.getScrollOffset(content);
offset = new Point(offset.x, offset.y);
let r = aElement.getBoundingClientRect();
// step out of iframes and frames, offsetting scroll values
@ -207,6 +209,8 @@ function getOverflowContentBoundingRect(aElement) {
function getContentClientRects(aElement) {
let offset = ContentScroll.getScrollOffset(content);
offset = new Point(offset.x, offset.y);
let nativeRects = aElement.getClientRects();
// step out of iframes and frames, offsetting scroll values
for (let frame = aElement.ownerDocument.defaultView; frame != content; frame = frame.parent) {

View File

@ -100,7 +100,10 @@ function getBoundingContentRect(aElement) {
document = document.defaultView.frameElement.ownerDocument;
let content = document.defaultView;
let offset = Util.getScrollOffset(content);
let cwu = content.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
let scrollX = {}, scrollY = {};
cwu.getScrollXY(false, scrollX, scrollY);
let offset = new Point(scrollX.value, scrollY.value);
let r = aElement.getBoundingClientRect();
// step out of iframes and frames, offsetting scroll values