mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out 971f1bf573fc8 due to test failures
This commit is contained in:
parent
348206d92f
commit
3ae900471a
@ -167,10 +167,6 @@
|
|||||||
label="&saveAudioCmd.label;"
|
label="&saveAudioCmd.label;"
|
||||||
accesskey="&saveAudioCmd.accesskey;"
|
accesskey="&saveAudioCmd.accesskey;"
|
||||||
oncommand="gContextMenu.saveMedia();"/>
|
oncommand="gContextMenu.saveMedia();"/>
|
||||||
<menuitem id="context-video-saveimage"
|
|
||||||
accesskey="&videoSaveImage.accesskey;"
|
|
||||||
label="&videoSaveImage.label;"
|
|
||||||
oncommand="gContextMenu.saveVideoFrameAsImage();"/>
|
|
||||||
<menuitem id="context-sendvideo"
|
<menuitem id="context-sendvideo"
|
||||||
label="&sendVideoCmd.label;"
|
label="&sendVideoCmd.label;"
|
||||||
accesskey="&sendVideoCmd.accesskey;"
|
accesskey="&sendVideoCmd.accesskey;"
|
||||||
|
@ -224,7 +224,6 @@ nsContextMenu.prototype = {
|
|||||||
this.showItem("context-saveimage", this.onLoadedImage || this.onCanvas);
|
this.showItem("context-saveimage", this.onLoadedImage || this.onCanvas);
|
||||||
this.showItem("context-savevideo", this.onVideo);
|
this.showItem("context-savevideo", this.onVideo);
|
||||||
this.showItem("context-saveaudio", this.onAudio);
|
this.showItem("context-saveaudio", this.onAudio);
|
||||||
this.showItem("context-video-saveimage", this.onVideo);
|
|
||||||
this.setItemAttr("context-savevideo", "disabled", !this.mediaURL);
|
this.setItemAttr("context-savevideo", "disabled", !this.mediaURL);
|
||||||
this.setItemAttr("context-saveaudio", "disabled", !this.mediaURL);
|
this.setItemAttr("context-saveaudio", "disabled", !this.mediaURL);
|
||||||
// Send media URL (but not for canvas, since it's a big data: URL)
|
// Send media URL (but not for canvas, since it's a big data: URL)
|
||||||
@ -428,11 +427,8 @@ nsContextMenu.prototype = {
|
|||||||
this.setItemAttr("context-media-unmute", "disabled", hasError);
|
this.setItemAttr("context-media-unmute", "disabled", hasError);
|
||||||
this.setItemAttr("context-media-showcontrols", "disabled", hasError);
|
this.setItemAttr("context-media-showcontrols", "disabled", hasError);
|
||||||
this.setItemAttr("context-media-hidecontrols", "disabled", hasError);
|
this.setItemAttr("context-media-hidecontrols", "disabled", hasError);
|
||||||
if (this.onVideo) {
|
if (this.onVideo)
|
||||||
let canSaveSnapshot = this.target.readyState >= this.target.HAVE_CURRENT_DATA;
|
this.setItemAttr("context-video-fullscreen", "disabled", hasError);
|
||||||
this.setItemAttr("context-video-saveimage", "disabled", !canSaveSnapshot);
|
|
||||||
this.setItemAttr("context-video-fullscreen", "disabled", hasError);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.showItem("context-media-sep-commands", onMedia);
|
this.showItem("context-media-sep-commands", onMedia);
|
||||||
},
|
},
|
||||||
@ -830,27 +826,6 @@ nsContextMenu.prototype = {
|
|||||||
openUILink(viewURL, e, null, null, null, null, doc.documentURIObject );
|
openUILink(viewURL, e, null, null, null, null, doc.documentURIObject );
|
||||||
},
|
},
|
||||||
|
|
||||||
saveVideoFrameAsImage: function () {
|
|
||||||
urlSecurityCheck(this.mediaURL, this.browser.contentPrincipal,
|
|
||||||
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
|
||||||
let name = "";
|
|
||||||
try {
|
|
||||||
let uri = makeURI(this.mediaURL);
|
|
||||||
let url = uri.QueryInterface(Ci.nsIURL);
|
|
||||||
if (url.fileBaseName)
|
|
||||||
name = url.fileBaseName + ".jpg";
|
|
||||||
} catch (e) { }
|
|
||||||
if (!name)
|
|
||||||
name = "snapshot.jpg";
|
|
||||||
var video = this.target;
|
|
||||||
var canvas = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
|
|
||||||
canvas.width = video.videoWidth;
|
|
||||||
canvas.height = video.videoHeight;
|
|
||||||
var ctxDraw = canvas.getContext("2d");
|
|
||||||
ctxDraw.drawImage(video, 0, 0);
|
|
||||||
saveImageURL(canvas.toDataURL("image/jpg", ""), name, "SaveImageTitle", true, false, document.documentURIObject);
|
|
||||||
},
|
|
||||||
|
|
||||||
fullScreenVideo: function () {
|
fullScreenVideo: function () {
|
||||||
this.target.pause();
|
this.target.pause();
|
||||||
|
|
||||||
|
@ -339,7 +339,6 @@ function runTest(testNum) {
|
|||||||
"context-copyvideourl", true,
|
"context-copyvideourl", true,
|
||||||
"---", null,
|
"---", null,
|
||||||
"context-savevideo", true,
|
"context-savevideo", true,
|
||||||
"context-video-saveimage" true,
|
|
||||||
"context-sendvideo", true,
|
"context-sendvideo", true,
|
||||||
"---", null,
|
"---", null,
|
||||||
"context-inspect", true]);
|
"context-inspect", true]);
|
||||||
@ -358,7 +357,6 @@ function runTest(testNum) {
|
|||||||
"context-copyvideourl", true,
|
"context-copyvideourl", true,
|
||||||
"---", null,
|
"---", null,
|
||||||
"context-savevideo", true,
|
"context-savevideo", true,
|
||||||
"context-video-saveimage", false,
|
|
||||||
"context-sendvideo", true,
|
"context-sendvideo", true,
|
||||||
"---", null,
|
"---", null,
|
||||||
"context-inspect", true]);
|
"context-inspect", true]);
|
||||||
@ -377,7 +375,6 @@ function runTest(testNum) {
|
|||||||
"context-copyvideourl", false,
|
"context-copyvideourl", false,
|
||||||
"---", null,
|
"---", null,
|
||||||
"context-savevideo", false,
|
"context-savevideo", false,
|
||||||
"context-video-saveimage", false,
|
|
||||||
"context-sendvideo", false,
|
"context-sendvideo", false,
|
||||||
"---", null,
|
"---", null,
|
||||||
"context-inspect", true]);
|
"context-inspect", true]);
|
||||||
|
@ -432,8 +432,6 @@ can reach it easily. -->
|
|||||||
<!ENTITY mediaHideControls.accesskey "C">
|
<!ENTITY mediaHideControls.accesskey "C">
|
||||||
<!ENTITY videoFullScreen.label "Full Screen">
|
<!ENTITY videoFullScreen.label "Full Screen">
|
||||||
<!ENTITY videoFullScreen.accesskey "F">
|
<!ENTITY videoFullScreen.accesskey "F">
|
||||||
<!ENTITY videoSaveImage.label "Save Snapshot As…">
|
|
||||||
<!ENTITY videoSaveImage.accesskey "S">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- LOCALIZATION NOTE :
|
<!-- LOCALIZATION NOTE :
|
||||||
|
Loading…
Reference in New Issue
Block a user