mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
Bug 911152 - Don't reprocess the same metadata over and over. r=wesj
This commit is contained in:
parent
31a6a8ad74
commit
b9ca06189a
@ -3822,6 +3822,10 @@ Tab.prototype = {
|
||||
|
||||
aMetadata.isRTL = this.browser.contentDocument.documentElement.dir == "rtl";
|
||||
|
||||
// if the metadata hasn't actually changed, no need to do anything
|
||||
if (aMetadata.equals(this.metadata))
|
||||
return;
|
||||
|
||||
ViewportHandler.setMetadataForDocument(this.browser.contentDocument, aMetadata);
|
||||
this.updateViewportSize(gScreenWidth, aInitialLoad);
|
||||
this.sendViewportMetadata();
|
||||
@ -5808,6 +5812,18 @@ ViewportMetadata.prototype = {
|
||||
allowZoom: null,
|
||||
isSpecified: null,
|
||||
isRTL: null,
|
||||
|
||||
equals: function(aOther) {
|
||||
return this.width === aOther.width
|
||||
&& this.height === aOther.height
|
||||
&& this.defaultZoom === aOther.defaultZoom
|
||||
&& (this.minZoom === aOther.minZoom || (isNaN(minZoom) && isNaN(aOther.minZoom)))
|
||||
&& (this.maxZoom === aOther.maxZoom || (isNaN(maxZoom) && isNaN(aOther.maxZoom)))
|
||||
&& this.autoSize === aOther.autoSize
|
||||
&& this.allowZoom === aOther.allowZoom
|
||||
&& this.isSpecified === aOther.isSpecified
|
||||
&& this.isRTL === aOther.isRTL;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user