Bug 832920. Add a way for chrome iframes to opt into having a separate refresh driver (e.g. if they plan to be moved between windows) and make devtools use that opt-in. r=tnikkel,paul

This commit is contained in:
Boris Zbarsky 2013-02-22 09:56:28 -05:00
parent ff2a0fa581
commit d044749cdb
4 changed files with 11 additions and 2 deletions

View File

@ -474,6 +474,7 @@ Toolbox.prototype = {
iframe.className = "toolbox-panel-iframe";
iframe.id = "toolbox-panel-iframe-" + id;
iframe.setAttribute("flex", 1);
iframe.setAttribute("forceOwnRefreshDriver", "");
let vbox = this.doc.getElementById("toolbox-panel-" + id);
vbox.appendChild(iframe);

View File

@ -28,5 +28,5 @@
modifiers="accel"/>
</keyset>
<iframe id="toolbox-iframe" flex="1"></iframe>
<iframe id="toolbox-iframe" flex="1" forceOwnRefreshDriver=""></iframe>
</window>

View File

@ -372,6 +372,7 @@ GK_ATOM(fontpicker, "fontpicker")
GK_ATOM(footer, "footer")
GK_ATOM(_for, "for")
GK_ATOM(forEach, "for-each")
GK_ATOM(forceOwnRefreshDriver, "forceOwnRefreshDriver")
GK_ATOM(form, "form")
GK_ATOM(formaction, "formaction")
GK_ATOM(format, "format")

View File

@ -948,7 +948,14 @@ nsPresContext::Init(nsDeviceContext* aDeviceContext)
nsCOMPtr<nsIDocShellTreeItem> parentItem;
ourItem->GetSameTypeParent(getter_AddRefs(parentItem));
if (parentItem) {
mRefreshDriver = parent->GetShell()->GetPresContext()->RefreshDriver();
Element* containingElement =
parent->FindContentForSubDocument(mDocument);
if (!containingElement->IsXUL() ||
!containingElement->
HasAttr(kNameSpaceID_None,
nsGkAtoms::forceOwnRefreshDriver)) {
mRefreshDriver = parent->GetShell()->GetPresContext()->RefreshDriver();
}
}
}
}