Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' 7b878fa into embedlite
Browse files Browse the repository at this point in the history
Followup fix for bug 972555
  • Loading branch information
tmeshkova committed Feb 26, 2014
2 parents 59be9f0 + 7b878fa commit 54ef028
Show file tree
Hide file tree
Showing 207 changed files with 4,838 additions and 1,847 deletions.
8 changes: 0 additions & 8 deletions accessible/tests/mochitest/Makefile.in

This file was deleted.

1 change: 1 addition & 0 deletions accessible/tests/mochitest/a11y.ini
@@ -1,5 +1,6 @@
[DEFAULT]
support-files =
../../../content/media/test/bug461281.ogg
dumbfile.xpi
formimage.png
letters.gif
Expand Down
7 changes: 5 additions & 2 deletions b2g/chrome/content/content.css
Expand Up @@ -10,13 +10,16 @@ xul|window xul|scrollbar {
display: none;
}

html xul|scrollbar[root="true"] {
position: relative;
z-index: 2147483647;
}

html xul|scrollbar {
-moz-appearance: none !important;
position: relative;
background-color: transparent !important;
background-image: none !important;
border: 0px solid transparent !important;
z-index: 2147483647;
pointer-events: none;
opacity: 1;
}
Expand Down
24 changes: 11 additions & 13 deletions browser/base/content/browser-plugins.js
Expand Up @@ -33,14 +33,9 @@ var gPluginHandler = {
let fallbackType = null;
let blocklistState = null;

if (pluginElement instanceof HTMLAppletElement) {
tagMimetype = "application/x-java-vm";
} else {
tagMimetype = pluginElement.actualType;

if (tagMimetype == "") {
tagMimetype = pluginElement.type;
}
tagMimetype = pluginElement.actualType;
if (tagMimetype == "") {
tagMimetype = pluginElement.type;
}

if (gPluginHandler.isKnownPlugin(pluginElement)) {
Expand Down Expand Up @@ -389,6 +384,14 @@ var gPluginHandler = {
}
}

let closeIcon = this.getPluginUI(plugin, "closeIcon");
if (closeIcon) {
closeIcon.addEventListener("click", function(aEvent) {
if (aEvent.button == 0 && aEvent.isTrusted)
gPluginHandler.hideClickToPlayOverlay(plugin);
}, true);
}

if (shouldShowNotification) {
this._showClickToPlayNotification(browser, plugin, false);
}
Expand Down Expand Up @@ -595,11 +598,6 @@ var gPluginHandler = {

if (overlay) {
overlay.addEventListener("click", gPluginHandler._overlayClickListener, true);
let closeIcon = this.getPluginUI(aPlugin, "closeIcon");
closeIcon.addEventListener("click", function(aEvent) {
if (aEvent.button == 0 && aEvent.isTrusted)
gPluginHandler.hideClickToPlayOverlay(aPlugin);
}, true);
}
},

Expand Down
1 change: 1 addition & 0 deletions browser/base/content/test/general/browser.ini
Expand Up @@ -116,6 +116,7 @@ skip-if = toolkit == "gtk2" || toolkit == "gtk3" # browser_CTP_context_menu.js
run-if = crashreporter
[browser_CTP_data_urls.js]
[browser_CTP_drag_drop.js]
[browser_CTP_hide_overlay.js]
[browser_CTP_multi_allow.js]
[browser_CTP_nonplugins.js]
[browser_CTP_notificationBar.js]
Expand Down
76 changes: 76 additions & 0 deletions browser/base/content/test/general/browser_CTP_hide_overlay.js
@@ -0,0 +1,76 @@
var rootDir = getRootDirectory(gTestPath);
const gTestRoot = rootDir;
const gHttpTestRoot = rootDir.replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");

var gTestBrowser = null;
var gNextTest = null;
var gPluginHost = Components.classes["@mozilla.org/plugin/host;1"].getService(Components.interfaces.nsIPluginHost);

Components.utils.import("resource://gre/modules/Services.jsm");

function test() {
waitForExplicitFinish();
registerCleanupFunction(function() {
clearAllPluginPermissions();
Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
});
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);

let newTab = gBrowser.addTab();
gBrowser.selectedTab = newTab;
gTestBrowser = gBrowser.selectedBrowser;
gTestBrowser.addEventListener("load", pageLoad, true);

Services.prefs.setBoolPref("plugins.click_to_play", true);
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_DISABLED);

prepareTest(runAfterPluginBindingAttached(test1), gHttpTestRoot + "plugin_test.html");
}

function finishTest() {
clearAllPluginPermissions();
gTestBrowser.removeEventListener("load", pageLoad, true);
gBrowser.removeCurrentTab();
window.focus();
finish();
}

function pageLoad() {
// The plugin events are async dispatched and can come after the load event
// This just allows the events to fire before we then go on to test the states
executeSoon(gNextTest);
}

function prepareTest(nextTest, url) {
gNextTest = nextTest;
gTestBrowser.contentWindow.location = url;
}

// Due to layout being async, "PluginBindAttached" may trigger later.
// This wraps a function to force a layout flush, thus triggering it,
// and schedules the function execution so they're definitely executed
// afterwards.
function runAfterPluginBindingAttached(func) {
return function() {
let doc = gTestBrowser.contentDocument;
let elems = doc.getElementsByTagName('embed');
if (elems.length < 1) {
elems = doc.getElementsByTagName('object');
}
elems[0].clientTop;
executeSoon(func);
};
}

// Tests that the overlay can be hidded for disabled plugins using the close icon.
function test1() {
var doc = gTestBrowser.contentDocument;
var plugin = doc.getElementById("test");
ok(plugin, "Test 1, Found plugin in page");
var overlay = doc.getAnonymousElementByAttribute(plugin, "anonid", "main");
ok(overlay.classList.contains("visible"), "Test 1, Plugin overlay should exist, not be hidden");
var closeIcon = doc.getAnonymousElementByAttribute(plugin, "anonid", "closeIcon")
EventUtils.synthesizeMouseAtCenter(closeIcon, {}, gTestBrowser.contentWindow);
var condition = function() !overlay.classList.contains("visible");
waitForCondition(condition, finishTest, "Test 1, Waited too long for the overlay to become invisible.");
}
Expand Up @@ -8,7 +8,7 @@ support-files =
[browser_bug731866.js]
[browser_connection.js]
[browser_healthreport.js]
skip-if = (!healthreport) || (os == 'linux' && debug)
skip-if = !healthreport || (os == 'linux' && debug)
[browser_privacypane_1.js]
[browser_privacypane_3.js]
[browser_privacypane_5.js]
Expand Down
2 changes: 1 addition & 1 deletion browser/components/preferences/tests/browser.ini
Expand Up @@ -8,7 +8,7 @@ support-files =
[browser_bug705422.js]
[browser_chunk_permissions.js]
[browser_healthreport.js]
skip-if = (!healthreport) || (os == 'linux' && debug)
skip-if = !healthreport || (os == 'linux' && debug)
[browser_permissions.js]
[browser_privacypane_1.js]
[browser_privacypane_3.js]
Expand Down
12 changes: 3 additions & 9 deletions browser/metro/base/content/contenthandlers/PluginHelper.js
Expand Up @@ -27,16 +27,10 @@ var PluginHelper = {
},

getPluginMimeType: function (plugin) {
var tagMimetype;
if (plugin instanceof plugin.ownerDocument.defaultView.HTMLAppletElement) {
tagMimetype = "application/x-java-vm";
} else {
tagMimetype = plugin.QueryInterface(Components.interfaces.nsIObjectLoadingContent)
.actualType;
var tagMimetype = plugin.actualType;

if (tagMimetype == "") {
tagMimetype = plugin.type;
}
if (tagMimetype == "") {
tagMimetype = plugin.type;
}
return tagMimetype;
},
Expand Down
6 changes: 3 additions & 3 deletions caps/src/nsScriptSecurityManager.cpp
Expand Up @@ -395,9 +395,9 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
unsigned lineNum = 0;
NS_NAMED_LITERAL_STRING(scriptSample, "call to eval() or related function blocked by CSP");

JS::RootedScript script(cx);
if (JS_DescribeScriptedCaller(cx, &script, &lineNum)) {
if (const char *file = JS_GetScriptFilename(cx, script)) {
JS::AutoFilename scriptFilename;
if (JS::DescribeScriptedCaller(cx, &scriptFilename, &lineNum)) {
if (const char *file = scriptFilename.get()) {
CopyUTF8toUTF16(nsDependentCString(file), fileName);
}
}
Expand Down
5 changes: 2 additions & 3 deletions config/external/moz.build
Expand Up @@ -33,15 +33,14 @@ if CONFIG['MOZ_WEBM_ENCODER']:
if CONFIG['MOZ_VPX'] and not CONFIG['MOZ_NATIVE_LIBVPX']:
external_dirs += ['media/libvpx']

if CONFIG['MOZ_OGG']:
external_dirs += ['media/libogg', 'media/libtheora']

if not CONFIG['MOZ_NATIVE_PNG']:
external_dirs += ['media/libpng']

external_dirs += [
'media/kiss_fft',
'media/libcubeb',
'media/libogg',
'media/libtheora',
'media/libspeex_resampler',
'media/libsoundtouch',
]
Expand Down
1 change: 1 addition & 0 deletions config/system-headers
Expand Up @@ -230,6 +230,7 @@ cairo-xlib.h
cairo-xlib-xrender.h
cairo-directfb.h
cairo-qpainter.h
cairo-qt.h
#endif
dfiff.h
exception
Expand Down
63 changes: 20 additions & 43 deletions configure.in
Expand Up @@ -3867,7 +3867,6 @@ MOZ_FEEDS=1
MOZ_WEBAPP_RUNTIME=
MOZ_JSDEBUGGER=1
MOZ_AUTH_EXTENSION=1
MOZ_OGG=1
MOZ_RAW=
MOZ_VORBIS=
MOZ_TREMOR=
Expand Down Expand Up @@ -5109,37 +5108,25 @@ fi

AC_SUBST(MOZ_RAW)

dnl ========================================================
dnl = Disable Ogg Codecs
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(ogg,
[ --disable-ogg Disable support for OGG media (Theora video and Vorbis audio)],
MOZ_OGG=,
MOZ_OGG=1)

if test -n "$MOZ_OGG"; then
AC_DEFINE(MOZ_OGG)

dnl Checks for __attribute__(aligned()) directive
AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
[ac_cv_c_attribute_aligned],
[ac_cv_c_attribute_aligned=0
CFLAGS_save="${CFLAGS}"
CFLAGS="${CFLAGS} -Werror"
for ac_cv_c_attr_align_try in 64 32 16 8; do
echo "trying $ac_cv_c_attr_align_try"
AC_TRY_COMPILE([],
[static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
[ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
if test "$ac_cv_c_attribute_aligned" != 0; then
break;
fi
done
CFLAGS="${CFLAGS_save}"])
if test "${ac_cv_c_attribute_aligned}" != "0"; then
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
[${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
fi
dnl Checks for __attribute__(aligned()) directive need by libogg
AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
[ac_cv_c_attribute_aligned],
[ac_cv_c_attribute_aligned=0
CFLAGS_save="${CFLAGS}"
CFLAGS="${CFLAGS} -Werror"
for ac_cv_c_attr_align_try in 64 32 16 8; do
echo "trying $ac_cv_c_attr_align_try"
AC_TRY_COMPILE([],
[static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
[ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
if test "$ac_cv_c_attribute_aligned" != 0; then
break;
fi
done
CFLAGS="${CFLAGS_save}"])
if test "${ac_cv_c_attribute_aligned}" != "0"; then
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
[${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
fi

dnl ========================================================
Expand Down Expand Up @@ -5323,7 +5310,7 @@ AC_SUBST(MOZ_NATIVE_LIBVPX)
AC_SUBST(MOZ_LIBVPX_CFLAGS)
AC_SUBST(MOZ_LIBVPX_LIBS)

if test "$MOZ_WEBM" -o "$MOZ_OGG"; then
if test "$MOZ_WEBM"; then
if test "$MOZ_SAMPLE_TYPE_FLOAT32"; then
MOZ_VORBIS=1
else
Expand Down Expand Up @@ -5430,15 +5417,6 @@ dnl ========================================================
dnl = Handle dependent MEDIA defines
dnl ========================================================

if test -n "$MOZ_OPUS" -a -z "$MOZ_OGG"; then
AC_MSG_ERROR([MOZ_OPUS requires MOZ_OGG which is disabled.])
fi

if test -n "$MOZ_VORBIS" -a -z "$MOZ_OGG"; then
AC_MSG_ERROR([MOZ_VORBIS requires MOZ_OGG which is disabled.
Note that you need vorbis support for WebM playback.])
fi

if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then
AC_MSG_ERROR([MOZ_VORBIS and MOZ_TREMOR are mutually exclusive! The build system should not allow them both to be set, but they are. Please file a bug at https://bugzilla.mozilla.org/])
fi
Expand Down Expand Up @@ -8632,7 +8610,6 @@ AC_SUBST(MOZ_APPLEMEDIA)
AC_SUBST(MOZ_OMX_PLUGIN)
AC_SUBST(MOZ_VPX_ERROR_CONCEALMENT)
AC_SUBST(MOZ_VPX)
AC_SUBST(MOZ_OGG)
AC_SUBST(VPX_AS)
AC_SUBST(VPX_ASFLAGS)
AC_SUBST(VPX_DASH_C_FLAG)
Expand Down
6 changes: 3 additions & 3 deletions content/base/src/WebSocket.cpp
Expand Up @@ -667,9 +667,9 @@ WebSocket::Init(JSContext* aCx,
NS_ENSURE_SUCCESS(rv, rv);

unsigned lineno;
JS::Rooted<JSScript*> script(aCx);
if (JS_DescribeScriptedCaller(aCx, &script, &lineno)) {
mScriptFile = JS_GetScriptFilename(aCx, script);
JS::AutoFilename file;
if (JS::DescribeScriptedCaller(aCx, &file, &lineno)) {
mScriptFile = file.get();
mScriptLine = lineno;
}

Expand Down
17 changes: 14 additions & 3 deletions content/base/src/nsObjectLoadingContent.cpp
Expand Up @@ -92,6 +92,8 @@

static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);

static const char *kPrefJavaMIME = "plugin.java.mime";

using namespace mozilla;
using namespace mozilla::dom;

Expand Down Expand Up @@ -902,6 +904,8 @@ nsObjectLoadingContent::InstantiatePluginInstance(bool aIsLoading)
void
nsObjectLoadingContent::NotifyOwnerDocumentActivityChanged()
{
// XXX(johns): We cannot touch plugins or run arbitrary script from this call,
// as nsDocument is in a non-reentrant state.

// If we have a plugin we want to queue an event to stop it unless we are
// moved into an active document before returning to the event loop.
Expand Down Expand Up @@ -1410,8 +1414,12 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
///
/// Initial MIME Type
///

if (aJavaURI || thisContent->NodeInfo()->Equals(nsGkAtoms::applet)) {
newMime.AssignLiteral("application/x-java-vm");
nsAdoptingCString javaMIME = Preferences::GetCString(kPrefJavaMIME);
newMime = javaMIME;
NS_ASSERTION(nsPluginHost::IsJavaMIMEType(newMime.get()),
"plugin.mime.java should be recognized by IsJavaMIMEType");
isJava = true;
} else {
nsAutoString rawTypeAttr;
Expand All @@ -1432,9 +1440,12 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
thisContent->GetAttr(kNameSpaceID_None, nsGkAtoms::classid, classIDAttr);
if (!classIDAttr.IsEmpty()) {
// Our classid support is limited to 'java:' ids
nsAdoptingCString javaMIME = Preferences::GetCString(kPrefJavaMIME);
NS_ASSERTION(nsPluginHost::IsJavaMIMEType(javaMIME.get()),
"plugin.mime.java should be recognized by IsJavaMIMEType");
if (StringBeginsWith(classIDAttr, NS_LITERAL_STRING("java:")) &&
PluginExistsForType("application/x-java-vm")) {
newMime.Assign("application/x-java-vm");
PluginExistsForType(javaMIME)) {
newMime = javaMIME;
isJava = true;
} else {
// XXX(johns): Our de-facto behavior since forever was to refuse to load
Expand Down

0 comments on commit 54ef028

Please sign in to comment.