Bug 781320 - Part 1: Sync iframe name down from parent to child in <iframe mozbrowser>. r=smaug

This commit is contained in:
Justin Lebar 2012-08-13 15:19:09 -04:00
parent 0c3ea3ef65
commit 37bc18bddb
2 changed files with 9 additions and 0 deletions

View File

@ -70,6 +70,10 @@ BrowserElementChild.prototype = {
debug("Starting up.");
sendAsyncMsg("hello");
// Set the docshell's name according to our <iframe>'s name attribute.
docShell.QueryInterface(Ci.nsIDocShellTreeItem).name =
sendSyncMsg('get-name')[0];
BrowserElementPromptService.mapWindowToBrowserElementChild(content, this);
docShell.QueryInterface(Ci.nsIWebProgress)

View File

@ -157,6 +157,7 @@ function BrowserElementParent(frameLoader, hasRemoteFrame) {
}
addMessageListener("hello", this._recvHello);
addMessageListener("get-name", this._recvGetName);
addMessageListener("contextmenu", this._fireCtxMenuEvent);
addMessageListener("locationchange", this._fireEventFromMsg);
addMessageListener("loadstart", this._fireEventFromMsg);
@ -261,6 +262,10 @@ BrowserElementParent.prototype = {
}
},
_recvGetName: function(data) {
return this._frameElement.getAttribute('name');
},
_fireCtxMenuEvent: function(data) {
let evtName = data.name.substring('browser-element-api:'.length);
let detail = data.json;