Backed out changeset ed851bbfe997 (bug 885289) for mochitest-bc orange.

This commit is contained in:
Ryan VanderMeulen 2013-07-25 11:26:21 -04:00
parent 63b81597b1
commit 63993f347c
5 changed files with 8 additions and 52 deletions

View File

@ -311,7 +311,7 @@
label="&openFrameCmd.label;"
accesskey="&openFrameCmd.accesskey;"
oncommand="gContextMenu.openFrame();"/>
<menuseparator id="open-frame-sep"/>
<menuseparator/>
<menuitem id="context-reloadframe"
label="&reloadFrameCmd.label;"
accesskey="&reloadFrameCmd.accesskey;"

View File

@ -277,18 +277,6 @@ nsContextMenu.prototype = {
this.showItem("context-keywordfield",
this.onTextInput && this.onKeywordField);
this.showItem("frame", this.inFrame);
// srcdoc cannot be opened separately due to concerns about web
// content with about:srcdoc in location bar masquerading as trusted
// chrome/addon content.
// No need to also test for this.inFrame as this is checked in the parent
// submenu.
this.showItem("context-showonlythisframe", !this.inSrcdocFrame);
this.showItem("context-openframeintab", !this.inSrcdocFrame);
this.showItem("context-openframe", !this.inSrcdocFrame);
this.showItem("context-bookmarkframe", !this.inSrcdocFrame);
this.showItem("open-frame-sep", !this.inSrcdocFrame);
this.showItem("frame-sep", this.inFrame && isTextSelected);
// Hide menu entries for images, show otherwise
@ -528,7 +516,6 @@ nsContextMenu.prototype = {
this.linkProtocol = "";
this.onMathML = false;
this.inFrame = false;
this.inSrcdocFrame = false;
this.inSyntheticDoc = false;
this.hasBGImage = false;
this.bgImageURL = "";
@ -692,11 +679,11 @@ nsContextMenu.prototype = {
// See if the user clicked in a frame.
var docDefaultView = this.target.ownerDocument.defaultView;
if (docDefaultView != docDefaultView.top) {
this.inFrame = true;
if (this.target.ownerDocument.isSrcdocDocument) {
this.inSrcdocFrame = true;
}
// srcdoc iframes are not considered frames for concerns about web
// content with about:srcdoc in location bar masqurading as trusted
// chrome/addon content.
if (!this.target.ownerDocument.isSrcdocDocument)
this.inFrame = true;
}
// if the document is editable, show context menu like in text inputs
@ -726,7 +713,6 @@ nsContextMenu.prototype = {
this.onCompletedImage = false;
this.onMathML = false;
this.inFrame = false;
this.inSrcdocFrame = false;
this.hasBGImage = false;
this.isDesignMode = true;
this.onEditableArea = true;

View File

@ -67,6 +67,5 @@ Browser context menu subtest.
<input id="test-select-input-text-type-password" type="password" value="password">
<embed id="test-plugin" style="width: 200px; height: 200px;" type="application/x-test"></embed>
<img id="test-longdesc" src="ctxmenu-image.png" longdesc="http://www.mozilla.org"></embed>
<iframe id="test-srcdoc" width="98" height="98" srcdoc="Hello World" style="border: 1px solid black"></iframe>
</body>
</html>

View File

@ -955,33 +955,6 @@ function runTest(testNum) {
"context-viewimagedesc", true
].concat(inspectItems));
closeContextMenu();
openContextMenuFor(srcdoc);
return;
case 31:
// Context menu for an iframe with srcdoc attribute set
checkContextMenu(["context-back", false,
"context-forward", false,
"context-reload", true,
"---", null,
"context-bookmarkpage", true,
"context-savepage", true,
"---", null,
"context-viewbgimage", false,
"context-selectall", true,
"frame", null,
["context-reloadframe", true,
"---", null,
"context-saveframe", true,
"---", null,
"context-printframe", true,
"---", null,
"context-viewframesource", true,
"context-viewframeinfo", true], null,
"---", null,
"context-viewsource", true,
"context-viewinfo", true
].concat(inspectItems));
// finish test
subwindow.close();
@ -1011,7 +984,7 @@ var text, link, mailto, input, img, canvas, video_ok, video_bad, video_bad2,
iframe, video_in_iframe, image_in_iframe, textarea, contenteditable,
inputspell, pagemenu, dom_full_screen, plainTextItems, audio_in_video,
selecttext, selecttextlink, imagelink, select_inputtext, select_inputtext_password,
plugin, longdesc, iframe;
plugin, longdesc;
function startTest() {
chromeWin = SpecialPowers.wrap(subwindow)
@ -1061,7 +1034,6 @@ function startTest() {
select_inputtext_password = subwindow.document.getElementById("test-select-input-text-type-password");
plugin = subwindow.document.getElementById("test-plugin");
longdesc = subwindow.document.getElementById("test-longdesc");
srcdoc = subwindow.document.getElementById("test-srcdoc");
contextMenu.addEventListener("popupshown", function() { runTest(++testNum); }, false);
runTest(1);

View File

@ -6105,8 +6105,7 @@ nsContentUtils::SetUpChannelOwner(nsIPrincipal* aLoadingPrincipal,
if (aForceOwner) {
nsAutoCString uriStr;
aURI->GetSpec(uriStr);
if(!uriStr.EqualsLiteral("about:srcdoc") &&
!uriStr.EqualsLiteral("view-source:about:srcdoc")) {
if(!uriStr.EqualsLiteral("about:srcdoc")) {
nsCOMPtr<nsIURI> ownerURI;
nsresult rv = aLoadingPrincipal->GetURI(getter_AddRefs(ownerURI));
MOZ_ASSERT(NS_SUCCEEDED(rv) && SchemeIs(ownerURI, NS_NULLPRINCIPAL_SCHEME));