merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2014-11-18 17:25:29 +01:00
commit 6a293a24ca
439 changed files with 9611 additions and 10520 deletions

View File

@ -451,6 +451,18 @@ AndroidPresenter.prototype.liveRegion =
UtteranceGenerator.genForLiveRegion(aContext, aIsHide, aModifiedText));
};
AndroidPresenter.prototype.noMove =
function AndroidPresenter_noMove(aMoveMethod) {
return {
type: this.type,
details: [
{ eventType: this.ANDROID_VIEW_ACCESSIBILITY_FOCUSED,
exitView: aMoveMethod,
text: ['']
}]
};
};
/**
* A B2G presenter for Gaia.
*/

View File

@ -709,12 +709,12 @@
</p>
<p id="area17">
<span style="-moz-text-decoration-line: underline;">underline
</span><span style="text-decoration: underline; -moz-text-decoration-color: blue;">blue
</span><span style="text-decoration: underline; -moz-text-decoration-style: dotted;">dotted
</span><span style="-moz-text-decoration-line: line-through;">linethrough
</span><span style="text-decoration: line-through; -moz-text-decoration-color: blue;">blue
</span><span style="text-decoration: line-through; -moz-text-decoration-style: wavy;">wavy
<span style="text-decoration-line: underline;">underline
</span><span style="text-decoration: underline; text-decoration-color: blue;">blue
</span><span style="text-decoration: underline; text-decoration-style: dotted;">dotted
</span><span style="text-decoration-line: line-through;">linethrough
</span><span style="text-decoration: line-through; text-decoration-color: blue;">blue
</span><span style="text-decoration: line-through; text-decoration-style: wavy;">wavy
</span>
</p>

View File

@ -10,7 +10,6 @@ ac_add_options --with-gonk="$topsrcdir/gonk-toolchain"
export TOOLCHAIN_HOST=linux-x86
export GONK_PRODUCT=generic
ac_add_options --with-gonk-toolchain-prefix="$topsrcdir/gonk-toolchain/prebuilt/$TOOLCHAIN_HOST/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-"
ac_add_options --disable-elf-hack
ac_add_options --enable-debug-symbols
ac_add_options --enable-debug
#. "$topsrcdir/build/mozconfig.cache"

View File

@ -11,7 +11,6 @@ ac_add_options --with-gonk="$topsrcdir/gonk-toolchain"
export TOOLCHAIN_HOST=linux-x86
export GONK_PRODUCT=generic
ac_add_options --with-gonk-toolchain-prefix="$topsrcdir/gonk-toolchain/prebuilt/$TOOLCHAIN_HOST/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-"
ac_add_options --disable-elf-hack
ac_add_options --enable-debug-symbols
# ac_add_options --enable-profiling
#. "$topsrcdir/build/mozconfig.cache"

View File

@ -29,7 +29,6 @@ no_sccache=
#B2G options
ac_add_options --enable-application=b2g
ENABLE_MARIONETTE=1
ac_add_options --disable-elf-hack
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
GAIADIR=$topsrcdir/gaia

View File

@ -27,7 +27,6 @@ no_sccache=
#B2G options
ac_add_options --enable-application=b2g
ac_add_options --disable-elf-hack
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
GAIADIR=$topsrcdir/gaia

View File

@ -29,7 +29,6 @@ no_sccache=
#B2G options
ac_add_options --enable-application=b2g
ENABLE_MARIONETTE=1
ac_add_options --disable-elf-hack
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
GAIADIR=$topsrcdir/gaia

View File

@ -27,7 +27,6 @@ no_sccache=
#B2G options
ac_add_options --enable-application=b2g
ac_add_options --disable-elf-hack
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
GAIADIR=$topsrcdir/gaia

View File

@ -83,9 +83,6 @@ ifdef GKMEDIAS_SHARED_LIBRARY
DEFINES += -DGKMEDIAS_SHARED_LIBRARY
endif
ifdef MOZ_REPLACE_MALLOC
DEFINES += -DMOZ_REPLACE_MALLOC
endif
ifdef MOZ_JEMALLOC3
DEFINES += -DMOZ_JEMALLOC3
endif

View File

@ -21,6 +21,7 @@ skip-if = os == "mac" # Intermittent failures, bug 898317
[browser_newtab_bug998387.js]
[browser_newtab_disable.js]
[browser_newtab_drag_drop.js]
skip-if = os == "win" && debug # bug 1097056; test fails in --run-by-dir mode on win8 x64 debug
[browser_newtab_drag_drop_ext.js]
[browser_newtab_drop_preview.js]
[browser_newtab_enhanced.js]

View File

@ -36,4 +36,4 @@ skip-if = e10s # Bug ?????? - Test uses load event and checks event.target.
[browser_yahoo_behavior.js]
skip-if = e10s # Bug ?????? - some issue with progress listeners [JavaScript Error: "req.originalURI is null" {file: "chrome://mochitests/content/browser/browser/components/search/test/browser_bing_behavior.js" line: 127}]
[browser_abouthome_behavior.js]
skip-if = e10s # Bug ???????
skip-if = e10s || true # Bug ??????, Bug 1100301 - leaks windows until shutdown when --run-by-dir

View File

@ -19,7 +19,7 @@ support-files =
[browser_tabview_bug587231.js]
skip-if = buildapp == 'mulet'
[browser_tabview_bug587276.js]
skip-if = e10s # Bug 1091200
skip-if = e10s || true # Bug 1091200, bug 1096285
[browser_tabview_bug587351.js]
[browser_tabview_bug587503.js]
[browser_tabview_bug587990.js]

View File

@ -2,7 +2,6 @@
ac_add_options --enable-signmar
ac_add_options --enable-profiling
ac_add_options --disable-elf-hack # --enable-elf-hack conflicts with --enable-profiling
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics

View File

@ -5,7 +5,6 @@ no_sccache=1
ac_add_options --enable-valgrind
ac_add_options --disable-jemalloc
ac_add_options --disable-elf-hack
ac_add_options --enable-optimize="-g -O -freorder-blocks"
ac_add_options --disable-install-strip

View File

@ -2,7 +2,6 @@
ac_add_options --enable-signmar
ac_add_options --enable-profiling
ac_add_options --disable-elf-hack # --enable-elf-hack conflicts with --enable-profiling
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics

View File

@ -5,7 +5,6 @@ no_sccache=1
ac_add_options --enable-valgrind
ac_add_options --disable-jemalloc
ac_add_options --disable-elf-hack
ac_add_options --enable-optimize="-g -O -freorder-blocks"
ac_add_options --disable-install-strip

View File

@ -34,7 +34,6 @@ whitelist['nightly']['linux32'] += [
'export MOZ_TELEMETRY_REPORTING=1',
"mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) @MOZ_OBJDIR@/_profile/pgo/profileserver.py 10'",
'STRIP_FLAGS="--strip-debug"',
'ac_add_options --disable-elf-hack # --enable-elf-hack conflicts with --enable-profiling',
]
whitelist['nightly']['linux64'] += [
@ -44,7 +43,6 @@ whitelist['nightly']['linux64'] += [
'STRIP_FLAGS="--strip-debug"',
'ac_add_options --with-ccache=/usr/bin/ccache',
'. "$topsrcdir/build/mozconfig.cache"',
'ac_add_options --disable-elf-hack # --enable-elf-hack conflicts with --enable-profiling',
]
whitelist['nightly']['macosx-universal'] += [

View File

@ -354,43 +354,43 @@ skip-if = e10s
[browser_dbg_scripts-switching-03.js]
skip-if = e10s
[browser_dbg_search-autofill-identifier.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-basic-01.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-basic-02.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-basic-03.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-basic-04.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-global-01.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-global-02.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-global-03.js]
skip-if = e10s
skip-if = e10s # Bug 1093535
[browser_dbg_search-global-04.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-global-05.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-global-06.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-popup-jank.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-sources-01.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-sources-02.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-sources-03.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_search-symbols.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_searchbox-help-popup-01.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_searchbox-help-popup-02.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_searchbox-parse.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_source-maps-01.js]
skip-if = e10s && debug
[browser_dbg_source-maps-02.js]

View File

@ -10,7 +10,7 @@
function test() {
const TAB_URL = EXAMPLE_URL + "doc_function-search.html";
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
let Source = 'code_function-search-01.js';
let Debugger = aPanel.panelWin;
let Editor = Debugger.DebuggerView.editor;

View File

@ -7,13 +7,12 @@
const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources, gFiltering, gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -309,7 +308,6 @@ function performTest() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -7,13 +7,12 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gSources, gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gSources = gDebugger.DebuggerView.Sources;
@ -33,7 +32,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.firstCall();
callInTab(gTab, "firstCall");
});
}
@ -116,7 +115,6 @@ function verifySourceAndCaret(aUrl, aLine, aColumn, aSelection) {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gSources = null;

View File

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gSources, gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gSources = gDebugger.DebuggerView.Sources;
@ -37,7 +36,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.firstCall();
callInTab(gTab, "firstCall");
});
}
@ -112,7 +111,6 @@ function verifySourceAndCaret(aUrl, aLine, aColumn) {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gSources = null;

View File

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources, gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -123,7 +122,6 @@ function testTokenSearch() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources, gSearchView, gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -31,7 +30,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.firstCall();
callInTab(gTab, "firstCall");
});
}
@ -264,7 +263,6 @@ function clearSearch() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources, gSearchView, gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -34,7 +33,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.firstCall();
callInTab(gTab, "firstCall");
});
}
@ -208,7 +207,6 @@ function testSearchTokenEmpty() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources, gSearchView, gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -30,7 +29,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.firstCall();
callInTab(gTab, "firstCall");
});
}
@ -96,7 +95,6 @@ function performTest() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources, gSearchView, gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -30,7 +29,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.firstCall();
callInTab(gTab, "firstCall");
});
}
@ -84,7 +83,6 @@ function secondSearch() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -9,13 +9,12 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources, gSearchView, gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -33,7 +32,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.firstCall();
callInTab(gTab, "firstCall");
});
}
@ -146,7 +145,6 @@ function testClickMatchToJump() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources, gSearchView, gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -32,7 +31,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.firstCall();
callInTab(gTab, "firstCall");
});
}
@ -111,7 +110,6 @@ function testEscape() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -7,13 +7,12 @@
const TAB_URL = EXAMPLE_URL + "doc_editor-mode.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gSearchBox = gDebugger.DebuggerView.Filtering._searchbox;
@ -111,7 +110,6 @@ function pressKeyToHide(aKey) {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gSearchBox = null;

View File

@ -7,16 +7,15 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gSources, gSearchView, gSearchBox;
function test() {
// Debug test slaves are a bit slow at this test.
requestLongerTimeout(3);
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gSources = gDebugger.DebuggerView.Sources;
@ -226,7 +225,6 @@ function verifyContents(aArgs) {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gSources = null;

View File

@ -7,16 +7,15 @@
const TAB_URL = EXAMPLE_URL + "doc_editor-mode.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gSources, gSourceUtils, gSearchView, gSearchBox;
function test() {
// Debug test slaves are a bit slow at this test.
requestLongerTimeout(3);
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gSources = gDebugger.DebuggerView.Sources;
@ -268,7 +267,6 @@ function verifyContents(aMatches) {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gSources = null;

View File

@ -7,13 +7,12 @@
const TAB_URL = EXAMPLE_URL + "doc_editor-mode.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gSources, gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gSources = gDebugger.DebuggerView.Sources;
@ -92,7 +91,6 @@ function verifySourcesPane() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gSources = null;

View File

@ -7,13 +7,12 @@
const TAB_URL = EXAMPLE_URL + "doc_function-search.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources, gSearchBox, gFilteredFunctions;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -459,7 +458,6 @@ function writeInfo() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gSearchBox, gSearchBoxPanel;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gSearchBox = gDebugger.DebuggerView.Filtering._searchbox;
@ -28,7 +27,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.firstCall();
callInTab(gTab, "firstCall");
});
}
@ -52,7 +51,6 @@ function hidePopup() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gSearchBox = null;

View File

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSearchBox, gSearchBoxPanel;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -34,7 +33,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.firstCall();
callInTab(gTab, "firstCall");
});
}
@ -77,7 +76,6 @@ function testFocusLost() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -6,7 +6,7 @@
*/
function test() {
initDebugger("about:blank").then(([aTab, aDebuggee, aPanel]) => {
initDebugger("about:blank").then(([aTab,, aPanel]) => {
let filterView = aPanel.panelWin.DebuggerView.Filtering;
let searchbox = aPanel.panelWin.DebuggerView.Filtering._searchbox;

View File

@ -130,9 +130,6 @@ endif
ifdef MOZ_SHARED_ICU
DEFINES += -DMOZ_SHARED_ICU
endif
ifdef MOZ_REPLACE_MALLOC
DEFINES += -DMOZ_REPLACE_MALLOC
endif
ifdef MOZ_JEMALLOC3
DEFINES += -DMOZ_JEMALLOC3
endif

View File

@ -103,7 +103,7 @@
.cm-s-mozilla .cm-unused-line {
text-decoration: line-through;
-moz-text-decoration-color: #5f88b0;
text-decoration-color: #5f88b0;
}
.cm-s-mozilla .cm-executed-line {

View File

@ -76,7 +76,7 @@
.cm-s-mozilla .cm-unused-line {
text-decoration: line-through;
-moz-text-decoration-color: #5f88b0;
text-decoration-color: #5f88b0;
}
.cm-s-mozilla .cm-executed-line {

View File

@ -198,7 +198,7 @@
}
.theme-light .ruleview-overridden {
-moz-text-decoration-color: #667380; /* Content (Text) - Dark Grey */
text-decoration-color: #667380; /* Content (Text) - Dark Grey */
}
.styleinspector-propertyeditor {

View File

@ -7161,6 +7161,7 @@ if test -n "$MOZ_REPLACE_MALLOC" -a -z "$MOZ_MEMORY"; then
dnl deliberate choice not to enable it (bug 702250, for instance)
AC_MSG_ERROR([--enable-replace-malloc requires --enable-jemalloc])
elif test -n "$MOZ_REPLACE_MALLOC"; then
AC_DEFINE(MOZ_REPLACE_MALLOC)
MOZ_NATIVE_JEMALLOC=
dnl Replace-malloc Mac linkage quirks
@ -7383,17 +7384,7 @@ USE_ELF_HACK=1
MOZ_ARG_DISABLE_BOOL(elf-hack,
[ --disable-elf-hack Disable elf hacks],
[USE_ELF_HACK=],
[USE_ELF_HACK=F # Force enable elf-hack])
# Disable elf hack for profiling because the built in profiler
# doesn't read the segments properly with elf hack. This is
# temporary and should be fixed soon in the profiler.
if test "$MOZ_PROFILING" = 1; then
if test "$USE_ELF_HACK" = F; then
AC_ERROR([--enable-elf-hack is not compatible with --enable-profiling])
fi
USE_ELF_HACK=
fi
[USE_ELF_HACK=1])
# Only enable elfhack where supported
if test "$USE_ELF_HACK" = 1; then

View File

@ -62,7 +62,6 @@ EventSource::EventSource(nsPIDOMWindow* aOwnerWindow) :
mGoingToDispatchAllMessages(false),
mWithCredentials(false),
mWaitingForOnStopRequest(false),
mInterrupted(false),
mLastConvertionResult(NS_OK),
mReadyState(CONNECTING),
mScriptLine(0),
@ -341,21 +340,14 @@ EventSource::OnStartRequest(nsIRequest *aRequest,
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aRequest, &rv);
NS_ENSURE_SUCCESS(rv, rv);
bool requestSucceeded;
rv = httpChannel->GetRequestSucceeded(&requestSucceeded);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoCString contentType;
rv = httpChannel->GetContentType(contentType);
NS_ENSURE_SUCCESS(rv, rv);
nsresult status;
aRequest->GetStatus(&status);
rv = aRequest->GetStatus(&status);
NS_ENSURE_SUCCESS(rv, rv);
if (NS_FAILED(status) || !requestSucceeded ||
!contentType.EqualsLiteral(TEXT_EVENT_STREAM)) {
DispatchFailConnection();
return NS_ERROR_NOT_AVAILABLE;
if (NS_FAILED(status)) {
// EventSource::OnStopRequest will evaluate if it shall either reestablish
// or fail the connection
return NS_ERROR_ABORT;
}
uint32_t httpStatus;
@ -363,7 +355,15 @@ EventSource::OnStartRequest(nsIRequest *aRequest,
NS_ENSURE_SUCCESS(rv, rv);
if (httpStatus != 200) {
mInterrupted = true;
DispatchFailConnection();
return NS_ERROR_ABORT;
}
nsAutoCString contentType;
rv = httpChannel->GetContentType(contentType);
NS_ENSURE_SUCCESS(rv, rv);
if (!contentType.EqualsLiteral(TEXT_EVENT_STREAM)) {
DispatchFailConnection();
return NS_ERROR_ABORT;
}
@ -454,19 +454,27 @@ EventSource::OnStopRequest(nsIRequest *aRequest,
return NS_ERROR_ABORT;
}
if (NS_FAILED(aStatusCode)) {
// "Network errors that prevents the connection from being established in the
// first place (e.g. DNS errors), must cause the user agent to asynchronously
// reestablish the connection.
//
// (...) the cancelation of the fetch algorithm by the user agent (e.g. in
// response to window.stop() or the user canceling the network connection
// manually) must cause the user agent to fail the connection.
if (NS_FAILED(aStatusCode) &&
aStatusCode != NS_ERROR_CONNECTION_REFUSED &&
aStatusCode != NS_ERROR_NET_TIMEOUT &&
aStatusCode != NS_ERROR_NET_RESET &&
aStatusCode != NS_ERROR_NET_INTERRUPT &&
aStatusCode != NS_ERROR_PROXY_CONNECTION_REFUSED &&
aStatusCode != NS_ERROR_DNS_LOOKUP_QUEUE_FULL) {
DispatchFailConnection();
return aStatusCode;
return NS_ERROR_ABORT;
}
nsresult rv;
nsresult healthOfRequestResult = CheckHealthOfRequestCallback(aRequest);
if (NS_SUCCEEDED(healthOfRequestResult) &&
mLastConvertionResult == NS_PARTIAL_MORE_INPUT) {
// we had an incomplete UTF8 char at the end of the stream
rv = ParseCharacter(REPLACEMENT_CHAR);
NS_ENSURE_SUCCESS(rv, rv);
}
nsresult rv = CheckHealthOfRequestCallback(aRequest);
NS_ENSURE_SUCCESS(rv, rv);
ClearFields();
@ -477,7 +485,7 @@ EventSource::OnStopRequest(nsIRequest *aRequest,
rv = NS_DispatchToMainThread(event);
NS_ENSURE_SUCCESS(rv, rv);
return healthOfRequestResult;
return NS_OK;
}
/**
@ -869,11 +877,6 @@ EventSource::ReestablishConnection()
return;
}
if (mReadyState != OPEN) {
NS_WARNING("Unexpected mReadyState!!!");
return;
}
nsresult rv = ResetConnection();
if (NS_FAILED(rv)) {
NS_WARNING("Failed to reset the connection!!!");
@ -994,7 +997,7 @@ EventSource::ConsoleError()
NS_ConvertUTF8toUTF16 specUTF16(targetSpec);
const char16_t *formatStrings[] = { specUTF16.get() };
if (mReadyState == CONNECTING && !mInterrupted) {
if (mReadyState == CONNECTING) {
rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
MOZ_UTF16("connectionFailure"),
formatStrings, ArrayLength(formatStrings));

View File

@ -221,7 +221,6 @@ protected:
bool mGoingToDispatchAllMessages;
bool mWithCredentials;
bool mWaitingForOnStopRequest;
bool mInterrupted;
// used while reading the input streams
nsCOMPtr<nsIUnicodeDecoder> mUnicodeDecoder;

View File

@ -14094,8 +14094,12 @@ void
nsGlobalWindow::ClearDocumentDependentSlots(JSContext* aCx)
{
MOZ_ASSERT(IsInnerWindow());
WindowBinding::ClearCachedDocumentValue(aCx, this);
WindowBinding::ClearCachedPerformanceValue(aCx, this);
// If JSAPI OOMs here, there is basically nothing we can do to recover safely.
if (!WindowBinding::ClearCachedDocumentValue(aCx, this) ||
!WindowBinding::ClearCachedPerformanceValue(aCx, this)) {
MOZ_CRASH("Unhandlable OOM while clearing document dependent slots.");
}
}
/* static */

View File

@ -182,7 +182,7 @@ nsImageLoadingContent::Notify(imgIRequest* aRequest,
}
nsresult status =
reqStatus & imgIRequest::STATUS_ERROR ? NS_ERROR_FAILURE : NS_OK;
return OnStopRequest(aRequest, status);
return OnLoadComplete(aRequest, status);
}
if (aType == imgINotificationObserver::DECODE_COMPLETE) {
@ -205,8 +205,7 @@ nsImageLoadingContent::Notify(imgIRequest* aRequest,
}
nsresult
nsImageLoadingContent::OnStopRequest(imgIRequest* aRequest,
nsresult aStatus)
nsImageLoadingContent::OnLoadComplete(imgIRequest* aRequest, nsresult aStatus)
{
uint32_t oldStatus;
aRequest->GetImageStatus(&oldStatus);

View File

@ -209,7 +209,7 @@ protected:
nsIContent* aBindingParent, bool aCompileEventHandlers);
void UnbindFromTree(bool aDeep, bool aNullParent);
nsresult OnStopRequest(imgIRequest* aRequest, nsresult aStatus);
nsresult OnLoadComplete(imgIRequest* aRequest, nsresult aStatus);
void OnUnlockedDraw();
nsresult OnImageIsAnimated(imgIRequest *aRequest);

View File

@ -2411,14 +2411,6 @@ DOMGCSliceCallback(JSRuntime *aRt, JS::GCProgress aProgress, const JS::GCDescrip
(*sPrevGCSliceCallback)(aRt, aProgress, aDesc);
}
void
nsJSContext::ReportPendingException()
{
if (mIsInitialized) {
nsJSUtils::ReportPendingException(mContext);
}
}
void
nsJSContext::SetWindowProxy(JS::Handle<JSObject*> aWindowProxy)
{

View File

@ -146,11 +146,6 @@ protected:
nsresult AddSupportsPrimitiveTojsvals(nsISupports *aArg, JS::Value *aArgv);
// Report the pending exception on our mContext, if any. This
// function will set aside the frame chain on mContext before
// reporting.
void ReportPendingException();
private:
void DestroyJSContext();

View File

@ -28,6 +28,7 @@
#include "nsHashKeys.h"
#include "nsCCUncollectableMarker.h"
#include "nsNameSpaceManager.h"
#include "nsDocument.h"
using namespace mozilla;
using mozilla::dom::NodeInfo;
@ -153,11 +154,6 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(nsNodeInfoManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK_0(nsNodeInfoManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsNodeInfoManager)
if (tmp->mDocument &&
nsCCUncollectableMarker::InGeneration(cb,
tmp->mDocument->GetMarkedCCGeneration())) {
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
}
if (tmp->mNonDocumentNodeInfos) {
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mDocument)
}
@ -167,6 +163,24 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsNodeInfoManager, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsNodeInfoManager, Release)
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsNodeInfoManager)
if (tmp->mDocument) {
return NS_CYCLE_COLLECTION_PARTICIPANT(nsDocument)->CanSkip(tmp->mDocument, aRemovingAllowed);
}
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsNodeInfoManager)
if (tmp->mDocument) {
return NS_CYCLE_COLLECTION_PARTICIPANT(nsDocument)->CanSkipInCC(tmp->mDocument);
}
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsNodeInfoManager)
if (tmp->mDocument) {
return NS_CYCLE_COLLECTION_PARTICIPANT(nsDocument)->CanSkipThis(tmp->mDocument);
}
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
nsresult
nsNodeInfoManager::Init(nsIDocument *aDocument)
{

View File

@ -40,7 +40,7 @@ private:
public:
nsNodeInfoManager();
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsNodeInfoManager)
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_NATIVE_CLASS(nsNodeInfoManager)
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsNodeInfoManager)

View File

@ -353,13 +353,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
function fnMessageListenerTest3h(e) {
fnMessageListenerTest3h.msg_ok = (fnMessageListenerTest3h.msg_ok && e.data == "ok");
fnMessageListenerTest3h.id_ok = (fnMessageListenerTest3h.msg_ok && e.lastEventId == "");
fnMessageListenerTest3h.id_ok = (fnMessageListenerTest3h.id_ok && e.lastEventId == "");
}
function doTest3_h(test_id) {
gEventSourceObj3_h = new EventSource("badMessageEvent2.eventsource");
gEventSourceObj3_h.addEventListener('message event', fnMessageListenerTest3h, true);
gEventSourceObj3_h.addEventListener('message', fnMessageListenerTest3h, true);
fnMessageListenerTest3h.msg_ok = true;
fnMessageListenerTest3h.id_ok = true;
@ -375,7 +375,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
}
gEventSourceObj3_h.close();
setTestHasFinished(test_id);
}, parseInt(3000*stress_factor));
}, parseInt(6000*stress_factor));
}
// in order to test (4)

View File

@ -3474,7 +3474,6 @@ class CGClearCachedValueMethod(CGAbstractMethod):
JSAutoCompartment ac(aCx, obj);
if (!get_${name}(aCx, obj, aObject, args)) {
js::SetReservedSlot(obj, ${slotIndex}, oldValue);
nsJSUtils::ReportPendingException(aCx);
return false;
}
return true;

View File

@ -4,47 +4,48 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "WebGL1Context.h"
#include "mozilla/dom/WebGLRenderingContextBinding.h"
#include "mozilla/dom/WebGLRenderingContextBinding.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
namespace mozilla {
// -----------------------------------------------------------------------------
// CONSTRUCTOR & DESTRUCTOR
/*static*/ WebGL1Context*
WebGL1Context::Create()
{
return new WebGL1Context();
}
WebGL1Context::WebGL1Context()
: WebGLContext()
{
}
WebGL1Context::~WebGL1Context()
{
}
// -----------------------------------------------------------------------------
// IMPLEMENT nsWrapperCache
////////////////////////////////////////
// nsWrapperCache
JSObject*
WebGL1Context::WrapObject(JSContext *cx)
WebGL1Context::WrapObject(JSContext* cx)
{
return dom::WebGLRenderingContextBinding::Wrap(cx, this);
}
} // namespace mozilla
// -----------------------------------------------------------------------------
// INSTANCING nsIDOMWebGLRenderingContext
////////////////////////////////////////
// nsIDOMWebGLRenderingContext
nsresult
NS_NewCanvasRenderingContextWebGL(nsIDOMWebGLRenderingContext** aResult)
NS_NewCanvasRenderingContextWebGL(nsIDOMWebGLRenderingContext** out_result)
{
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_USED, 1);
nsIDOMWebGLRenderingContext* ctx = new WebGL1Context();
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CANVAS_WEBGL_USED, 1);
NS_ADDREF(*aResult = ctx);
nsIDOMWebGLRenderingContext* ctx = mozilla::WebGL1Context::Create();
NS_ADDREF(*out_result = ctx);
return NS_OK;
}

View File

@ -3,8 +3,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef WEBGL1CONTEXT_H_
#define WEBGL1CONTEXT_H_
#ifndef WEBGL_1_CONTEXT_H_
#define WEBGL_1_CONTEXT_H_
#include "WebGLContext.h"
@ -13,34 +13,23 @@ namespace mozilla {
class WebGL1Context
: public WebGLContext
{
// -----------------------------------------------------------------------------
// PUBLIC
public:
static WebGL1Context* Create();
// -------------------------------------------------------------------------
// CONSTRUCTOR & DESTRUCTOR
private:
WebGL1Context();
public:
virtual ~WebGL1Context();
// -------------------------------------------------------------------------
// IMPLEMENT WebGLContext
virtual bool IsWebGL2() const MOZ_OVERRIDE
{
virtual bool IsWebGL2() const MOZ_OVERRIDE {
return false;
}
// -------------------------------------------------------------------------
// IMPLEMENT nsWrapperCache
virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
// nsWrapperCache
virtual JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE;
};
} // namespace mozilla
#endif
#endif // WEBGL_1_CONTEXT_H_

View File

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "WebGL2Context.h"
#include "WebGLSampler.h"
#include "GLContext.h"
using namespace mozilla;
@ -12,67 +13,206 @@ using namespace mozilla::dom;
already_AddRefed<WebGLSampler>
WebGL2Context::CreateSampler()
{
MOZ_CRASH("Not Implemented.");
return nullptr;
if (IsContextLost())
return nullptr;
GLuint sampler;
MakeContextCurrent();
gl->fGenSamplers(1, &sampler);
nsRefPtr<WebGLSampler> globj = new WebGLSampler(this, sampler);
return globj.forget();
}
void
WebGL2Context::DeleteSampler(WebGLSampler* sampler)
{
MOZ_CRASH("Not Implemented.");
if (IsContextLost())
return;
if (!ValidateObjectAllowDeletedOrNull("deleteSampler", sampler))
return;
if (!sampler || sampler->IsDeleted())
return;
sampler->RequestDelete();
}
bool
WebGL2Context::IsSampler(WebGLSampler* sampler)
{
MOZ_CRASH("Not Implemented.");
return false;
if (IsContextLost())
return false;
if (!sampler)
return false;
if (!ValidateObjectAllowDeleted("isSampler", sampler))
return false;
if (sampler->IsDeleted())
return false;
return !sampler->HasEverBeenBound();
}
void
WebGL2Context::BindSampler(GLuint unit, WebGLSampler* sampler)
{
MOZ_CRASH("Not Implemented.");
if (IsContextLost())
return;
if (!ValidateObjectAllowDeletedOrNull("bindSampler", sampler))
return;
if (GLint(unit) >= mGLMaxTextureUnits)
return ErrorInvalidValue("bindSampler: unit must be < %d", mGLMaxTextureUnits);
if (sampler && sampler->IsDeleted())
return ErrorInvalidOperation("bindSampler: binding deleted sampler");
WebGLContextUnchecked::BindSampler(unit, sampler);
}
void
WebGL2Context::SamplerParameteri(WebGLSampler* sampler, GLenum pname, GLint param)
{
MOZ_CRASH("Not Implemented.");
if (IsContextLost())
return;
if (!sampler || sampler->IsDeleted())
return ErrorInvalidOperation("samplerParameteri: invalid sampler");
if (!ValidateSamplerParameterParams(pname, WebGLIntOrFloat(param), "samplerParameteri"))
return;
WebGLContextUnchecked::SamplerParameteri(sampler, pname, param);
}
void
WebGL2Context::SamplerParameteriv(WebGLSampler* sampler, GLenum pname, const dom::Int32Array& param)
{
MOZ_CRASH("Not Implemented.");
if (IsContextLost())
return;
if (!sampler || sampler->IsDeleted())
return ErrorInvalidOperation("samplerParameteriv: invalid sampler");
param.ComputeLengthAndData();
if (param.Length() < 1)
return /* TODO(djg): Error message */;
/* TODO(djg): All of these calls in ES3 only take 1 param */
if (!ValidateSamplerParameterParams(pname, WebGLIntOrFloat(param.Data()[0]), "samplerParameteriv"))
return;
WebGLContextUnchecked::SamplerParameteriv(sampler, pname, param.Data());
}
void
WebGL2Context::SamplerParameteriv(WebGLSampler* sampler, GLenum pname, const dom::Sequence<GLint>& param)
{
MOZ_CRASH("Not Implemented.");
if (IsContextLost())
return;
if (!sampler || sampler->IsDeleted())
return ErrorInvalidOperation("samplerParameteriv: invalid sampler");
if (param.Length() < 1)
return /* TODO(djg): Error message */;
/* TODO(djg): All of these calls in ES3 only take 1 param */
if (!ValidateSamplerParameterParams(pname, WebGLIntOrFloat(param[0]), "samplerParameteriv"))
return;
WebGLContextUnchecked::SamplerParameteriv(sampler, pname, param.Elements());
}
void
WebGL2Context::SamplerParameterf(WebGLSampler* sampler, GLenum pname, GLfloat param)
{
MOZ_CRASH("Not Implemented.");
if (IsContextLost())
return;
if (!sampler || sampler->IsDeleted())
return ErrorInvalidOperation("samplerParameterf: invalid sampler");
if (!ValidateSamplerParameterParams(pname, WebGLIntOrFloat(param), "samplerParameterf"))
return;
WebGLContextUnchecked::SamplerParameterf(sampler, pname, param);
}
void
WebGL2Context::SamplerParameterfv(WebGLSampler* sampler, GLenum pname, const dom::Float32Array& param)
{
MOZ_CRASH("Not Implemented.");
if (IsContextLost())
return;
if (!sampler || sampler->IsDeleted())
return ErrorInvalidOperation("samplerParameterfv: invalid sampler");
param.ComputeLengthAndData();
if (param.Length() < 1)
return /* TODO(djg): Error message */;
/* TODO(djg): All of these calls in ES3 only take 1 param */
if (!ValidateSamplerParameterParams(pname, WebGLIntOrFloat(param.Data()[0]), "samplerParameterfv"))
return;
WebGLContextUnchecked::SamplerParameterfv(sampler, pname, param.Data());
}
void
WebGL2Context::SamplerParameterfv(WebGLSampler* sampler, GLenum pname, const dom::Sequence<GLfloat>& param)
{
MOZ_CRASH("Not Implemented.");
if (IsContextLost())
return;
if (!sampler || sampler->IsDeleted())
return ErrorInvalidOperation("samplerParameterfv: invalid sampler");
if (param.Length() < 1)
return /* TODO(djg): Error message */;
/* TODO(djg): All of these calls in ES3 only take 1 param */
if (!ValidateSamplerParameterParams(pname, WebGLIntOrFloat(param[0]), "samplerParameterfv"))
return;
WebGLContextUnchecked::SamplerParameterfv(sampler, pname, param.Elements());
}
void
WebGL2Context::GetSamplerParameter(JSContext*, WebGLSampler* sampler, GLenum pname, JS::MutableHandleValue retval)
{
MOZ_CRASH("Not Implemented.");
if (IsContextLost())
return;
if (!sampler || sampler->IsDeleted())
return ErrorInvalidOperation("getSamplerParameter: invalid sampler");
if (!ValidateSamplerParameterName(pname, "getSamplerParameter"))
return;
retval.set(JS::NullValue());
switch (pname) {
case LOCAL_GL_TEXTURE_MIN_FILTER:
case LOCAL_GL_TEXTURE_MAG_FILTER:
case LOCAL_GL_TEXTURE_WRAP_S:
case LOCAL_GL_TEXTURE_WRAP_T:
case LOCAL_GL_TEXTURE_WRAP_R:
case LOCAL_GL_TEXTURE_COMPARE_MODE:
case LOCAL_GL_TEXTURE_COMPARE_FUNC:
retval.set(JS::Int32Value(
WebGLContextUnchecked::GetSamplerParameteriv(sampler, pname)));
return;
case LOCAL_GL_TEXTURE_MIN_LOD:
case LOCAL_GL_TEXTURE_MAX_LOD:
retval.set(JS::Float32Value(
WebGLContextUnchecked::GetSamplerParameterfv(sampler, pname)));
return;
}
}

View File

@ -7,15 +7,16 @@
#include "WebGLContextLossHandler.h"
#include "WebGL1Context.h"
#include "WebGLObjectModel.h"
#include "WebGLExtensions.h"
#include "WebGLContextUtils.h"
#include "WebGLBuffer.h"
#include "WebGLVertexAttribData.h"
#include "WebGLMemoryTracker.h"
#include "WebGLContextUtils.h"
#include "WebGLExtensions.h"
#include "WebGLFramebuffer.h"
#include "WebGLVertexArray.h"
#include "WebGLMemoryTracker.h"
#include "WebGLObjectModel.h"
#include "WebGLQuery.h"
#include "WebGLSampler.h"
#include "WebGLVertexArray.h"
#include "WebGLVertexAttribData.h"
#include "GLBlitHelper.h"
#include "AccessCheck.h"
@ -226,7 +227,7 @@ WebGLContextOptions::WebGLContextOptions()
}
WebGLContext::WebGLContext()
: gl(nullptr)
: WebGLContextUnchecked(nullptr)
, mNeedsFakeNoAlpha(false)
{
mGeneration = 0;
@ -371,6 +372,8 @@ WebGLContext::DestroyResourcesAndContext()
mPrograms.getLast()->DeleteOnce();
while (!mQueries.isEmpty())
mQueries.getLast()->DeleteOnce();
while (!mSamplers.isEmpty())
mSamplers.getLast()->DeleteOnce();
mBlackOpaqueTexture2D = nullptr;
mBlackOpaqueTextureCubeMap = nullptr;

View File

@ -15,6 +15,7 @@
#include "GLDefs.h"
#include "WebGLActiveInfo.h"
#include "WebGLContextUnchecked.h"
#include "WebGLObjectModel.h"
#include "WebGLRenderbuffer.h"
#include "WebGLTexture.h"
@ -78,10 +79,12 @@ class WebGLQuery;
class WebGLUniformLocation;
class WebGLFramebuffer;
class WebGLRenderbuffer;
class WebGLSampler;
class WebGLShaderPrecisionFormat;
class WebGLTexture;
class WebGLVertexArray;
namespace dom {
class ImageData;
class Element;
@ -127,10 +130,29 @@ struct WebGLContextOptions {
// From WebGLContextUtils
TexTarget TexImageTargetToTexTarget(TexImageTarget texImageTarget);
class WebGLIntOrFloat {
enum {
Int,
Float
} mType;
union {
GLint i;
GLfloat f;
} mValue;
public:
explicit WebGLIntOrFloat(GLint i) : mType(Int) { mValue.i = i; }
explicit WebGLIntOrFloat(GLfloat f) : mType(Float) { mValue.f = f; }
GLint AsInt() const { return (mType == Int) ? mValue.i : NS_lroundf(mValue.f); }
GLfloat AsFloat() const { return (mType == Float) ? mValue.f : GLfloat(mValue.i); }
};
class WebGLContext :
public nsIDOMWebGLRenderingContext,
public nsICanvasRenderingContextInternal,
public nsSupportsWeakReference,
public WebGLContextUnchecked,
public WebGLRectangleObject,
public nsWrapperCache,
public SupportsWeakPtr<WebGLContext>
@ -1005,8 +1027,6 @@ protected:
return ((x + y - 1) / y) * y;
}
nsRefPtr<gl::GLContext> gl;
CheckedUint32 mGeneration;
WebGLContextOptions mOptions;
@ -1138,6 +1158,10 @@ protected:
bool ValidateCopyTexImage(GLenum internalformat,
WebGLTexImageFunc func,
WebGLTexDimensions dims);
bool ValidateSamplerParameterName(GLenum pname, const char* info);
bool ValidateSamplerParameterParams(GLenum pname, const WebGLIntOrFloat& param, const char* info);
bool ValidateTexImage(TexImageTarget texImageTarget,
GLint level, GLenum internalFormat,
GLint xoffset, GLint yoffset, GLint zoffset,
@ -1325,6 +1349,9 @@ protected:
LinkedList<WebGLFramebuffer> mFramebuffers;
LinkedList<WebGLVertexArray> mVertexArrays;
// TODO(djg): Does this need a rethink? Should it be WebGL2Context?
LinkedList<WebGLSampler> mSamplers;
WebGLRefPtr<WebGLVertexArray> mDefaultVertexArray;
// PixelStore parameters
@ -1440,6 +1467,7 @@ public:
friend class WebGLProgram;
friend class WebGLQuery;
friend class WebGLBuffer;
friend class WebGLSampler;
friend class WebGLShader;
friend class WebGLUniformLocation;
friend class WebGLVertexArray;

View File

@ -0,0 +1,96 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "WebGLContextUnchecked.h"
#include "GLContext.h"
#include "WebGLSampler.h"
namespace mozilla {
WebGLContextUnchecked::WebGLContextUnchecked(gl::GLContext* gl)
: gl(gl)
{ }
// -----------------------------------------------------------------------------
// Sampler Objects
void
WebGLContextUnchecked::BindSampler(GLuint unit, WebGLSampler* sampler)
{
gl->MakeCurrent();
gl->fBindSampler(unit, sampler ? sampler->GLName() : 0);
if (sampler)
sampler->BindTo(LOCAL_GL_SAMPLER_BINDING);
}
GLint
WebGLContextUnchecked::GetSamplerParameteriv(WebGLSampler* sampler,
GLenum pname)
{
MOZ_ASSERT(sampler, "Did you validate?");
GLint param = 0;
gl->MakeCurrent();
gl->fGetSamplerParameteriv(sampler->GLName(), pname, &param);
return param;
}
GLfloat
WebGLContextUnchecked::GetSamplerParameterfv(WebGLSampler* sampler,
GLenum pname)
{
MOZ_ASSERT(sampler, "Did you validate?");
GLfloat param = 0.0f;
gl->MakeCurrent();
gl->fGetSamplerParameterfv(sampler->GLName(), pname, &param);
return param;
}
void
WebGLContextUnchecked::SamplerParameteri(WebGLSampler* sampler,
GLenum pname,
GLint param)
{
MOZ_ASSERT(sampler, "Did you validate?");
gl->MakeCurrent();
gl->fSamplerParameteri(sampler->GLName(), pname, param);
}
void
WebGLContextUnchecked::SamplerParameteriv(WebGLSampler* sampler,
GLenum pname,
const GLint* param)
{
MOZ_ASSERT(sampler, "Did you validate?");
gl->MakeCurrent();
gl->fSamplerParameteriv(sampler->GLName(), pname, param);
}
void
WebGLContextUnchecked::SamplerParameterf(WebGLSampler* sampler,
GLenum pname,
GLfloat param)
{
MOZ_ASSERT(sampler, "Did you validate?");
gl->MakeCurrent();
gl->fSamplerParameterf(sampler->GLName(), pname, param);
}
void
WebGLContextUnchecked::SamplerParameterfv(WebGLSampler* sampler,
GLenum pname,
const GLfloat* param)
{
MOZ_ASSERT(sampler, "Did you validate?");
gl->MakeCurrent();
gl->fSamplerParameterfv(sampler->GLName(), pname, param);
}
} // namespace mozilla

View File

@ -0,0 +1,45 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef WEBGLCONTEXTUNCHECKED_H
#define WEBGLCONTEXTUNCHECKED_H
#include "GLDefs.h"
#include "WebGLTypes.h"
#include "nsAutoPtr.h"
#include "nsTArray.h"
namespace mozilla {
class WebGLSampler;
namespace gl {
class GLContext;
}
class WebGLContextUnchecked
{
public:
explicit WebGLContextUnchecked(gl::GLContext* gl);
// -------------------------------------------------------------------------
// Sampler Objects
void BindSampler(GLuint unit, WebGLSampler* sampler);
GLint GetSamplerParameteriv(WebGLSampler* sampler, GLenum pname);
GLfloat GetSamplerParameterfv(WebGLSampler* sampler, GLenum pname);
void SamplerParameteri(WebGLSampler* sampler, GLenum pname, GLint param);
void SamplerParameteriv(WebGLSampler* sampler, GLenum pname, const GLint* param);
void SamplerParameterf(WebGLSampler* sampler, GLenum pname, GLfloat param);
void SamplerParameterfv(WebGLSampler* sampler, GLenum pname, const GLfloat* param);
protected: // data
nsRefPtr<gl::GLContext> gl;
};
} // namespace mozilla
#endif // !WEBGLCONTEXTUNCHECKED_H

View File

@ -378,6 +378,118 @@ WebGLContext::ValidateFramebufferAttachment(GLenum attachment, const char* funcN
return false;
}
/**
* Return true if pname is valid for GetSamplerParameter calls.
*/
bool
WebGLContext::ValidateSamplerParameterName(GLenum pname, const char* info)
{
switch (pname) {
case LOCAL_GL_TEXTURE_MIN_FILTER:
case LOCAL_GL_TEXTURE_MAG_FILTER:
case LOCAL_GL_TEXTURE_WRAP_S:
case LOCAL_GL_TEXTURE_WRAP_T:
case LOCAL_GL_TEXTURE_WRAP_R:
case LOCAL_GL_TEXTURE_MIN_LOD:
case LOCAL_GL_TEXTURE_MAX_LOD:
case LOCAL_GL_TEXTURE_COMPARE_MODE:
case LOCAL_GL_TEXTURE_COMPARE_FUNC:
return true;
default:
ErrorInvalidEnum("%s: invalid pname: %s", info, EnumName(pname));
return false;
}
}
/**
* Return true if pname and param are valid combination for SamplerParameter calls.
*/
bool
WebGLContext::ValidateSamplerParameterParams(GLenum pname, const WebGLIntOrFloat& param, const char* info)
{
const GLenum p = param.AsInt();
switch (pname) {
case LOCAL_GL_TEXTURE_MIN_FILTER:
switch (p) {
case LOCAL_GL_NEAREST:
case LOCAL_GL_LINEAR:
case LOCAL_GL_NEAREST_MIPMAP_NEAREST:
case LOCAL_GL_NEAREST_MIPMAP_LINEAR:
case LOCAL_GL_LINEAR_MIPMAP_NEAREST:
case LOCAL_GL_LINEAR_MIPMAP_LINEAR:
return true;
default:
ErrorInvalidEnum("%s: invalid param: %s", info, EnumName(p));
return false;
}
case LOCAL_GL_TEXTURE_MAG_FILTER:
switch (p) {
case LOCAL_GL_NEAREST:
case LOCAL_GL_LINEAR:
return true;
default:
ErrorInvalidEnum("%s: invalid param: %s", info, EnumName(p));
return false;
}
case LOCAL_GL_TEXTURE_WRAP_S:
case LOCAL_GL_TEXTURE_WRAP_T:
case LOCAL_GL_TEXTURE_WRAP_R:
switch (p) {
case LOCAL_GL_CLAMP_TO_EDGE:
case LOCAL_GL_REPEAT:
case LOCAL_GL_MIRRORED_REPEAT:
return true;
default:
ErrorInvalidEnum("%s: invalid param: %s", info, EnumName(p));
return false;
}
case LOCAL_GL_TEXTURE_MIN_LOD:
case LOCAL_GL_TEXTURE_MAX_LOD:
return true;
case LOCAL_GL_TEXTURE_COMPARE_MODE:
switch (param.AsInt()) {
case LOCAL_GL_NONE:
case LOCAL_GL_COMPARE_REF_TO_TEXTURE:
return true;
default:
ErrorInvalidEnum("%s: invalid param: %s", info, EnumName(p));
return false;
}
case LOCAL_GL_TEXTURE_COMPARE_FUNC:
switch (p) {
case LOCAL_GL_LEQUAL:
case LOCAL_GL_GEQUAL:
case LOCAL_GL_LESS:
case LOCAL_GL_GREATER:
case LOCAL_GL_EQUAL:
case LOCAL_GL_NOTEQUAL:
case LOCAL_GL_ALWAYS:
case LOCAL_GL_NEVER:
return true;
default:
ErrorInvalidEnum("%s: invalid param: %s", info, EnumName(p));
return false;
}
default:
ErrorInvalidEnum("%s: invalid pname: %s", info, EnumName(pname));
return false;
}
}
/**
* Return true if format is a valid texture image format for source,
* taking into account enabled WebGL extensions.
@ -1718,8 +1830,7 @@ WebGLContext::InitAndValidateGL()
#ifdef XP_MACOSX
if (gl->WorkAroundDriverBugs() &&
gl->Vendor() == gl::GLVendor::ATI &&
nsCocoaFeatures::OSXVersionMajor() == 10 &&
nsCocoaFeatures::OSXVersionMinor() < 9)
!nsCocoaFeatures::IsAtLeastVersion(10,9))
{
// The Mac ATI driver, in all known OSX version up to and including 10.8,
// renders points sprites upside-down. Apple bug 11778921

View File

@ -373,7 +373,7 @@ WebGLFramebuffer::Attachment::FinalizeAttachment(GLContext* gl, FBAttachment att
MOZ_ASSERT(HasImage());
if (Texture()) {
MOZ_ASSERT(gl == Texture()->Context()->gl);
MOZ_ASSERT(gl == Texture()->Context()->GL());
const GLenum imageTarget = ImageTarget().get();
const GLint mipLevel = MipLevel();

View File

@ -12,33 +12,36 @@
using namespace mozilla;
WebGLSampler::WebGLSampler(WebGLContext* context)
: WebGLBindableName<GLenum>(0),
WebGLSampler::WebGLSampler(WebGLContext* context, GLuint sampler)
: WebGLBindableName<GLenum>(sampler),
WebGLContextBoundObject(context)
{
MOZ_CRASH("Not Implemented.");
mContext->mSamplers.insertBack(this);
}
WebGLSampler::~WebGLSampler()
{}
{
DeleteOnce();
}
void
WebGLSampler::Delete()
{
MOZ_CRASH("Not Implemented.");
mContext->MakeContextCurrent();
mContext->gl->fDeleteSamplers(1, &mGLName);
removeFrom(mContext->mSamplers);
}
WebGLContext*
WebGLSampler::GetParentObject() const
{
MOZ_CRASH("Not Implemented.");
return nullptr;
return Context();
}
JSObject*
WebGLSampler::WrapObject(JSContext* cx)
{
MOZ_CRASH("Not Implemented.");
return dom::WebGLSamplerBinding::Wrap(cx, this);
}

View File

@ -3,8 +3,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef WEBGL2SAMPLER_H_
#define WEBGL2SAMPLER_H_
#ifndef WEBGLSAMPLER_H_
#define WEBGLSAMPLER_H_
#include "WebGLBindableName.h"
#include "WebGLObjectModel.h"
@ -26,13 +26,15 @@ class WebGLSampler MOZ_FINAL
public:
explicit WebGLSampler(WebGLContext* aContext);
explicit WebGLSampler(WebGLContext* aContext, GLuint sampler);
void Delete();
WebGLContext* GetParentObject() const;
virtual JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE;
private:
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLSampler)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLSampler)
@ -43,4 +45,4 @@ private:
} // namespace mozilla
#endif // !WEBGL2SAMPLER_H_
#endif // !WEBGLSAMPLER_H_

View File

@ -64,6 +64,7 @@ UNIFIED_SOURCES += [
'WebGLContextLossHandler.cpp',
'WebGLContextReporter.cpp',
'WebGLContextState.cpp',
'WebGLContextUnchecked.cpp',
'WebGLContextUtils.cpp',
'WebGLContextValidate.cpp',
'WebGLContextVertexArray.cpp',

View File

@ -1,35 +1,90 @@
<!DOCTYPE HTML>
<title>WebGL test: Mismatched 'webgl' and 'experimental-webgl' context requests</title>
<html>
<head>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
</head>
<body>
<canvas id="c1"></canvas>
<canvas id="c2"></canvas>
<canvas id="c3"></canvas>
<canvas id="c4"></canvas>
<script>
function testContextRetrieval(canvasId, creationId, requestId) {
var canvas = document.getElementById(canvasId);
ok(canvas, 'Invalid `canvasId`: ' + canvasId);
WEBGL_TYPES = {};
WEBGL_TYPES['experimental-webgl'] = true;
WEBGL_TYPES['webgl'] = true;
var createdGL = canvas.getContext(creationId);
if (!createdGL)
return; // No WebGL on this machine?
var requestedGL = canvas.getContext(requestId);
if (creationId == requestId) {
ok(requestedGL, 'Request for \'' + requestId + '\' on from \'' + creationId + '\' should succeed.');
ok(requestedGL == createdGL, 'Request for \'' + requestId + '\' on from \'' + creationId + '\' should match.');
} else {
ok(!requestedGL, 'Request for \'' + requestId + '\' on from \'' + creationId + '\' should fail.');
}
function AreBothIn(a, b, set) {
return (a in set) && (b in set);
}
testContextRetrieval('c1', 'experimental-webgl', 'webgl');
testContextRetrieval('c2', 'webgl', 'experimental-webgl');
testContextRetrieval('c3', 'experimental-webgl', 'experimental-webgl');
testContextRetrieval('c4', 'webgl', 'webgl');
function IsAlias(typeA, typeB) {
if (typeA == typeB)
return true;
if (AreBothIn(typeA, typeB, WEBGL_TYPES))
return true;
return false;
}
function TestContextRetrieval(creationType, requestType, functionalTypeSet) {
var canvas = document.createElement('canvas');
var createdGL = canvas.getContext(creationType);
var didCreationSucceed = (createdGL != null);
if (creationType in functionalTypeSet) {
ok(createdGL, 'Context creation should succeed for type \'' +
creationType + '\'');
} else {
ok(!createdGL, 'Context creation should fail for type \'' +
creationType + '\'');
return;
}
var requestedGL = canvas.getContext(requestType);
if (requestType in functionalTypeSet &&
IsAlias(creationType, requestType))
{
ok(requestedGL, 'Request for \'' + requestType + '\' from \'' +
creationType + '\' should succeed.');
ok(requestedGL == createdGL, 'Request for \'' + requestType +
'\' from \'' + creationType +
'\' should match.');
} else {
ok(!requestedGL, 'Request for \'' + requestType + '\' from \'' +
creationType + '\' should fail.');
}
}
function IsWebGLFunctional() {
var canvas = document.createElement('canvas');
return canvas.getContext('experimental-webgl') != null;
}
function IsWebGLConformant() {
var canvas = document.createElement('canvas');
return canvas.getContext('webgl') != null;
}
var typeList = ['2d', 'experimental-webgl', 'webgl'];
var functionalTypeSet = {};
functionalTypeSet['2d'] = true;
if (IsWebGLFunctional())
functionalTypeSet['experimental-webgl'] = true;
if (IsWebGLConformant())
functionalTypeSet['webgl'] = true;
for (var i in typeList) {
var creationType = typeList[i];
for (var j in typeList) {
var requestType = typeList[j];
TestContextRetrieval(creationType, requestType, functionalTypeSet);
}
}
</script>
</body>
</html>

View File

@ -34,6 +34,7 @@
#include "nsNetUtil.h"
#include "nsStreamUtils.h"
#include "ActiveLayerTracker.h"
#include "WebGL1Context.h"
#include "WebGL2Context.h"
using namespace mozilla::layers;
@ -648,71 +649,71 @@ HTMLCanvasElement::MozGetAsFileImpl(const nsAString& aName,
return NS_OK;
}
nsresult
HTMLCanvasElement::GetContextHelper(const nsAString& aContextId,
nsICanvasRenderingContextInternal **aContext)
static bool
GetCanvasContextType(const nsAString& str, CanvasContextType* const out_type)
{
NS_ENSURE_ARG(aContext);
if (str.EqualsLiteral("2d")) {
*out_type = CanvasContextType::Canvas2D;
return true;
}
if (aContextId.EqualsLiteral("2d")) {
if (str.EqualsLiteral("experimental-webgl")) {
*out_type = CanvasContextType::WebGL1;
return true;
}
#ifdef MOZ_WEBGL_CONFORMANT
if (str.EqualsLiteral("webgl")) {
/* WebGL 1.0, $2.1 "Context Creation":
* If the user agent supports both the webgl and experimental-webgl
* canvas context types, they shall be treated as aliases.
*/
*out_type = CanvasContextType::WebGL1;
return true;
}
#endif
if (WebGL2Context::IsSupported()) {
if (str.EqualsLiteral("experimental-webgl2")) {
*out_type = CanvasContextType::WebGL2;
return true;
}
}
return false;
}
static already_AddRefed<nsICanvasRenderingContextInternal>
CreateContextForCanvas(CanvasContextType contextType, HTMLCanvasElement* canvas)
{
nsRefPtr<nsICanvasRenderingContextInternal> ret;
switch (contextType) {
case CanvasContextType::Canvas2D:
Telemetry::Accumulate(Telemetry::CANVAS_2D_USED, 1);
nsRefPtr<CanvasRenderingContext2D> ctx =
new CanvasRenderingContext2D();
ret = new CanvasRenderingContext2D();
break;
ctx->SetCanvasElement(this);
ctx.forget(aContext);
return NS_OK;
}
if (WebGL2Context::IsSupported() &&
aContextId.EqualsLiteral("experimental-webgl2"))
{
case CanvasContextType::WebGL1:
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_USED, 1);
nsRefPtr<WebGL2Context> ctx = WebGL2Context::Create();
if (ctx == nullptr) {
return NS_ERROR_NOT_IMPLEMENTED;
}
ret = WebGL1Context::Create();
if (!ret)
return nullptr;
break;
ctx->SetCanvasElement(this);
ctx.forget(aContext);
return NS_OK;
case CanvasContextType::WebGL2:
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_USED, 1);
ret = WebGL2Context::Create();
if (!ret)
return nullptr;
break;
}
MOZ_ASSERT(ret);
NS_ConvertUTF16toUTF8 ctxId(aContextId);
// check that ctxId is clamped to A-Za-z0-9_-
for (uint32_t i = 0; i < ctxId.Length(); i++) {
if ((ctxId[i] < 'A' || ctxId[i] > 'Z') &&
(ctxId[i] < 'a' || ctxId[i] > 'z') &&
(ctxId[i] < '0' || ctxId[i] > '9') &&
(ctxId[i] != '-') &&
(ctxId[i] != '_'))
{
// XXX ERRMSG we need to report an error to developers here! (bug 329026)
return NS_OK;
}
}
nsCString ctxString("@mozilla.org/content/canvas-rendering-context;1?id=");
ctxString.Append(ctxId);
nsresult rv;
nsCOMPtr<nsICanvasRenderingContextInternal> ctx =
do_CreateInstance(ctxString.get(), &rv);
if (rv == NS_ERROR_OUT_OF_MEMORY) {
*aContext = nullptr;
return NS_ERROR_OUT_OF_MEMORY;
}
if (NS_FAILED(rv)) {
*aContext = nullptr;
// XXX ERRMSG we need to report an error to developers here! (bug 329026)
return NS_OK;
}
ctx->SetCanvasElement(this);
ctx.forget(aContext);
return NS_OK;
ret->SetCanvasElement(canvas);
return ret.forget();
}
nsresult
@ -720,65 +721,49 @@ HTMLCanvasElement::GetContext(const nsAString& aContextId,
nsISupports** aContext)
{
ErrorResult rv;
*aContext =
GetContext(nullptr, aContextId, JS::NullHandleValue, rv).take();
*aContext = GetContext(nullptr, aContextId, JS::NullHandleValue, rv).take();
return rv.ErrorCode();
}
static bool
IsContextIdWebGL(const nsAString& str)
{
return str.EqualsLiteral("webgl") ||
str.EqualsLiteral("experimental-webgl");
}
already_AddRefed<nsISupports>
HTMLCanvasElement::GetContext(JSContext* aCx,
const nsAString& aContextId,
JS::Handle<JS::Value> aContextOptions,
ErrorResult& rv)
{
if (mCurrentContextId.IsEmpty()) {
rv = GetContextHelper(aContextId, getter_AddRefs(mCurrentContext));
if (rv.Failed() || !mCurrentContext) {
CanvasContextType contextType;
if (!GetCanvasContextType(aContextId, &contextType))
return nullptr;
if (!mCurrentContext) {
// This canvas doesn't have a context yet.
nsRefPtr<nsICanvasRenderingContextInternal> context;
context = CreateContextForCanvas(contextType, this);
if (!context)
return nullptr;
}
// Ensure that the context participates in CC. Note that returning a
// CC participant from QI doesn't addref.
nsXPCOMCycleCollectionParticipant *cp = nullptr;
CallQueryInterface(mCurrentContext, &cp);
nsXPCOMCycleCollectionParticipant* cp = nullptr;
CallQueryInterface(context, &cp);
if (!cp) {
mCurrentContext = nullptr;
rv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
mCurrentContext = context.forget();
mCurrentContextType = contextType;
rv = UpdateContext(aCx, aContextOptions);
if (rv.Failed()) {
rv = NS_OK; // See bug 645792
return nullptr;
}
mCurrentContextId.Assign(aContextId);
}
if (!mCurrentContextId.Equals(aContextId)) {
if (IsContextIdWebGL(aContextId) &&
IsContextIdWebGL(mCurrentContextId))
{
// Warn when we get a request for a webgl context with an id that differs
// from the id it was created with.
nsCString creationId = NS_LossyConvertUTF16toASCII(mCurrentContextId);
nsCString requestId = NS_LossyConvertUTF16toASCII(aContextId);
JS_ReportWarning(aCx, "WebGL: Retrieving a WebGL context from a canvas "
"via a request id ('%s') different from the id used "
"to create the context ('%s') is not allowed.",
requestId.get(),
creationId.get());
}
//XXX eventually allow for more than one active context on a given canvas
return nullptr;
} else {
// We already have a context of some type.
if (contextType != mCurrentContextType)
return nullptr;
}
nsCOMPtr<nsICanvasRenderingContextInternal> context = mCurrentContext;
@ -798,22 +783,28 @@ HTMLCanvasElement::MozGetIPCContext(const nsAString& aContextId,
if (!aContextId.EqualsLiteral("2d"))
return NS_ERROR_INVALID_ARG;
if (mCurrentContextId.IsEmpty()) {
nsresult rv = GetContextHelper(aContextId, getter_AddRefs(mCurrentContext));
NS_ENSURE_SUCCESS(rv, rv);
if (!mCurrentContext) {
CanvasContextType contextType = CanvasContextType::Canvas2D;
if (!mCurrentContext) {
// This canvas doesn't have a context yet.
nsRefPtr<nsICanvasRenderingContextInternal> context;
context = CreateContextForCanvas(contextType, this);
if (!context) {
*aContext = nullptr;
return NS_OK;
}
mCurrentContext = context;
mCurrentContext->SetIsIPC(true);
mCurrentContextType = contextType;
rv = UpdateContext(nullptr, JS::NullHandleValue);
nsresult rv = UpdateContext(nullptr, JS::NullHandleValue);
NS_ENSURE_SUCCESS(rv, rv);
mCurrentContextId.Assign(aContextId);
} else if (!mCurrentContextId.Equals(aContextId)) {
//XXX eventually allow for more than one active context on a given canvas
return NS_ERROR_INVALID_ARG;
} else {
// We already have a context of some type.
if (contextType != mCurrentContextType)
return NS_ERROR_INVALID_ARG;
}
NS_ADDREF (*aContext = mCurrentContext);
@ -831,21 +822,18 @@ HTMLCanvasElement::UpdateContext(JSContext* aCx, JS::Handle<JS::Value> aNewConte
nsresult rv = mCurrentContext->SetIsOpaque(HasAttr(kNameSpaceID_None, nsGkAtoms::moz_opaque));
if (NS_FAILED(rv)) {
mCurrentContext = nullptr;
mCurrentContextId.Truncate();
return rv;
}
rv = mCurrentContext->SetContextOptions(aCx, aNewContextOptions);
if (NS_FAILED(rv)) {
mCurrentContext = nullptr;
mCurrentContextId.Truncate();
return rv;
}
rv = mCurrentContext->SetDimensions(sz.width, sz.height);
if (NS_FAILED(rv)) {
mCurrentContext = nullptr;
mCurrentContextId.Truncate();
return rv;
}

View File

@ -7,6 +7,7 @@
#define mozilla_dom_HTMLCanvasElement_h
#include "mozilla/Attributes.h"
#include "mozilla/TypedEnum.h"
#include "nsIDOMHTMLCanvasElement.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
@ -35,6 +36,12 @@ class FileCallback;
class HTMLCanvasPrintState;
class PrintCallback;
MOZ_BEGIN_ENUM_CLASS(CanvasContextType, uint8_t)
Canvas2D,
WebGL1,
WebGL2
MOZ_END_ENUM_CLASS(CanvasContextType)
class HTMLCanvasElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLCanvasElement
{
@ -229,11 +236,9 @@ protected:
nsresult MozGetAsFileImpl(const nsAString& aName,
const nsAString& aType,
nsIDOMFile** aResult);
nsresult GetContextHelper(const nsAString& aContextId,
nsICanvasRenderingContextInternal **aContext);
void CallPrintCallback();
nsString mCurrentContextId;
CanvasContextType mCurrentContextType;
nsRefPtr<HTMLCanvasElement> mOriginalCanvas;
nsRefPtr<PrintCallback> mPrintCallback;
nsCOMPtr<nsICanvasRenderingContextInternal> mCurrentContext;

View File

@ -459,20 +459,14 @@ ImageDocument::Notify(imgIRequest* aRequest, int32_t aType, const nsIntRect* aDa
if (aType == imgINotificationObserver::SIZE_AVAILABLE) {
nsCOMPtr<imgIContainer> image;
aRequest->GetImage(getter_AddRefs(image));
return OnStartContainer(aRequest, image);
return OnSizeAvailable(aRequest, image);
}
// Do these two off a script runner because decode complete notifications often
// come during painting and these will trigger invalidation.
if (aType == imgINotificationObserver::DECODE_COMPLETE) {
// Run this using a script runner because HAS_TRANSPARENCY notifications can
// come during painting and this will trigger invalidation.
if (aType == imgINotificationObserver::HAS_TRANSPARENCY) {
nsCOMPtr<nsIRunnable> runnable =
NS_NewRunnableMethod(this, &ImageDocument::AddDecodedClass);
nsContentUtils::AddScriptRunner(runnable);
}
if (aType == imgINotificationObserver::DISCARD) {
nsCOMPtr<nsIRunnable> runnable =
NS_NewRunnableMethod(this, &ImageDocument::RemoveDecodedClass);
NS_NewRunnableMethod(this, &ImageDocument::OnHasTransparency);
nsContentUtils::AddScriptRunner(runnable);
}
@ -481,14 +475,14 @@ ImageDocument::Notify(imgIRequest* aRequest, int32_t aType, const nsIntRect* aDa
aRequest->GetImageStatus(&reqStatus);
nsresult status =
reqStatus & imgIRequest::STATUS_ERROR ? NS_ERROR_FAILURE : NS_OK;
return OnStopRequest(aRequest, status);
return OnLoadComplete(aRequest, status);
}
return NS_OK;
}
void
ImageDocument::AddDecodedClass()
ImageDocument::OnHasTransparency()
{
if (!mImageContent || nsContentUtils::IsChildOfSameType(this)) {
return;
@ -496,23 +490,7 @@ ImageDocument::AddDecodedClass()
nsDOMTokenList* classList = mImageContent->AsElement()->ClassList();
mozilla::ErrorResult rv;
// Update the background-color of the image only after the
// image has been decoded to prevent flashes of just the
// background-color.
classList->Add(NS_LITERAL_STRING("decoded"), rv);
}
void
ImageDocument::RemoveDecodedClass()
{
if (!mImageContent || nsContentUtils::IsChildOfSameType(this)) {
return;
}
nsDOMTokenList* classList = mImageContent->AsElement()->ClassList();
mozilla::ErrorResult rv;
// Remove any decoded-related styling when the image is unloaded.
classList->Remove(NS_LITERAL_STRING("decoded"), rv);
classList->Add(NS_LITERAL_STRING("transparent"), rv);
}
void
@ -535,7 +513,7 @@ ImageDocument::SetModeClass(eModeClasses mode)
}
nsresult
ImageDocument::OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage)
ImageDocument::OnSizeAvailable(imgIRequest* aRequest, imgIContainer* aImage)
{
// Styles have not yet been applied, so we don't know the final size. For now,
// default to the image's intrinsic size.
@ -551,8 +529,7 @@ ImageDocument::OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage)
}
nsresult
ImageDocument::OnStopRequest(imgIRequest *aRequest,
nsresult aStatus)
ImageDocument::OnLoadComplete(imgIRequest* aRequest, nsresult aStatus)
{
UpdateTitleAndCharset();

View File

@ -51,9 +51,6 @@ public:
void DefaultCheckOverflowing() { CheckOverflowing(mResizeImageByDefault); }
void AddDecodedClass();
void RemoveDecodedClass();
// WebIDL API
virtual JSObject* WrapNode(JSContext* aCx)
MOZ_OVERRIDE;
@ -107,8 +104,9 @@ protected:
};
void SetModeClass(eModeClasses mode);
nsresult OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage);
nsresult OnStopRequest(imgIRequest *aRequest, nsresult aStatus);
nsresult OnSizeAvailable(imgIRequest* aRequest, imgIContainer* aImage);
nsresult OnLoadComplete(imgIRequest* aRequest, nsresult aStatus);
void OnHasTransparency();
nsCOMPtr<nsIContent> mImageContent;

View File

@ -1973,9 +1973,9 @@ function isSimpleModifiableElement(node) {
&& (node.style.length == 1
|| (node.style.length == 4
&& "MozTextBlink" in node.style
&& "MozTextDecorationColor" in node.style
&& "MozTextDecorationLine" in node.style
&& "MozTextDecorationStyle" in node.style)
&& "textDecorationColor" in node.style
&& "textDecorationLine" in node.style
&& "textDecorationStyle" in node.style)
)
&& (node.style.textDecoration == "line-through"
|| node.style.textDecoration == "underline"

View File

@ -121,6 +121,11 @@ ScreenManagerParent::RecvScreenForBrowser(PBrowserParent* aBrowser,
bool* aSuccess)
{
*aSuccess = false;
#ifdef MOZ_VALGRIND
// Zero this so that Valgrind doesn't complain when we send it to another
// process.
memset(aRetVal, 0, sizeof(ScreenDetails));
#endif
// Find the mWidget associated with the tabparent, and then return
// the nsIScreen it's on.

View File

@ -179,9 +179,6 @@ class MediaRecorder::Session: public nsIObserver
return NS_OK;
}
if (mSession->IsEncoderError()) {
recorder->NotifyError(NS_ERROR_UNEXPECTED);
}
nsresult rv = recorder->CreateAndDispatchBlobEvent(mSession->GetEncodedData());
if (NS_FAILED(rv)) {
recorder->NotifyError(rv);
@ -194,6 +191,34 @@ class MediaRecorder::Session: public nsIObserver
nsRefPtr<Session> mSession;
};
// Notify encoder error, run in main thread task. (Bug 1095381)
class EncoderErrorNotifierRunnable : public nsRunnable
{
public:
explicit EncoderErrorNotifierRunnable(Session* aSession)
: mSession(aSession)
{ }
NS_IMETHODIMP Run()
{
LOG(PR_LOG_DEBUG, ("Session.ErrorNotifyRunnable s=(%p)", mSession.get()));
MOZ_ASSERT(NS_IsMainThread());
nsRefPtr<MediaRecorder> recorder = mSession->mRecorder;
if (!recorder) {
return NS_OK;
}
if (mSession->IsEncoderError()) {
recorder->NotifyError(NS_ERROR_UNEXPECTED);
}
return NS_OK;
}
private:
nsRefPtr<Session> mSession;
};
// Fire start event and set mimeType, run in main thread task.
class DispatchStartEventRunnable : public nsRunnable
{
@ -336,6 +361,7 @@ class MediaRecorder::Session: public nsIObserver
nsRefPtr<Session> mSession;
};
friend class EncoderErrorNotifierRunnable;
friend class PushBlobRunnable;
friend class ExtractRunnable;
friend class DestroyRunnable;
@ -399,7 +425,8 @@ public:
LOG(PR_LOG_DEBUG, ("Session.RequestData"));
MOZ_ASSERT(NS_IsMainThread());
if (NS_FAILED(NS_DispatchToMainThread(new PushBlobRunnable(this)))) {
if (NS_FAILED(NS_DispatchToMainThread(new EncoderErrorNotifierRunnable(this))) ||
NS_FAILED(NS_DispatchToMainThread(new PushBlobRunnable(this)))) {
MOZ_ASSERT(false, "RequestData NS_DispatchToMainThread failed");
return NS_ERROR_FAILURE;
}
@ -480,6 +507,9 @@ private:
pushBlob = true;
}
if (pushBlob || aForceFlush) {
if (NS_FAILED(NS_DispatchToMainThread(new EncoderErrorNotifierRunnable(this)))) {
MOZ_ASSERT(false, "NS_DispatchToMainThread EncoderErrorNotifierRunnable failed");
}
if (NS_FAILED(NS_DispatchToMainThread(new PushBlobRunnable(this)))) {
MOZ_ASSERT(false, "NS_DispatchToMainThread PushBlobRunnable failed");
} else {
@ -576,6 +606,9 @@ private:
}
CleanupStreams();
if (NS_FAILED(NS_DispatchToMainThread(new EncoderErrorNotifierRunnable(this)))) {
MOZ_ASSERT(false, "NS_DispatchToMainThread EncoderErrorNotifierRunnable failed");
}
if (NS_FAILED(NS_DispatchToMainThread(new PushBlobRunnable(this)))) {
MOZ_ASSERT(false, "NS_DispatchToMainThread PushBlobRunnable failed");
}

View File

@ -65,7 +65,7 @@ PRLogModuleInfo* gMediaStreamGraphLog;
/**
* The singleton graph instance.
*/
static MediaStreamGraphImpl* gGraph;
static nsDataHashtable<nsUint32HashKey, MediaStreamGraphImpl*> gGraphs;
MediaStreamGraphImpl::~MediaStreamGraphImpl()
{
@ -1636,9 +1636,10 @@ MediaStreamGraphImpl::RunInStableState(bool aSourceIsMSG)
NS_DispatchToMainThread(event);
LIFECYCLE_LOG("Disconnecting MediaStreamGraph %p", this);
if (this == gGraph) {
MediaStreamGraphImpl* graph;
if (gGraphs.Get(mAudioChannel, &graph) && graph == this) {
// null out gGraph if that's the graph being shut down
gGraph = nullptr;
gGraphs.Remove(mAudioChannel);
}
}
} else {
@ -1789,9 +1790,12 @@ MediaStreamGraphImpl::AppendMessage(ControlMessage* aMessage)
delete aMessage;
if (IsEmpty() &&
mLifecycleState >= LIFECYCLE_WAITING_FOR_STREAM_DESTRUCTION) {
if (gGraph == this) {
gGraph = nullptr;
MediaStreamGraphImpl* graph;
if (gGraphs.Get(mAudioChannel, &graph) && graph == this) {
gGraphs.Remove(mAudioChannel);
}
Destroy();
}
return;
@ -2741,6 +2745,7 @@ MediaStreamGraphImpl::MediaStreamGraphImpl(bool aRealtime,
#ifdef DEBUG
, mCanRunMessagesSynchronously(false)
#endif
, mAudioChannel(static_cast<uint32_t>(aChannel))
{
#ifdef PR_LOGGING
if (!gMediaStreamGraphLog) {
@ -2779,15 +2784,26 @@ NS_IMPL_ISUPPORTS(MediaStreamGraphShutdownObserver, nsIObserver)
static bool gShutdownObserverRegistered = false;
namespace {
PLDHashOperator
ForceShutdownEnumerator(const uint32_t& /* aAudioChannel */,
MediaStreamGraphImpl* aGraph,
void* /* aUnused */)
{
aGraph->ForceShutDown();
return PL_DHASH_NEXT;
}
} // anonymous namespace
NS_IMETHODIMP
MediaStreamGraphShutdownObserver::Observe(nsISupports *aSubject,
const char *aTopic,
const char16_t *aData)
{
if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
if (gGraph) {
gGraph->ForceShutDown();
}
gGraphs.EnumerateRead(ForceShutdownEnumerator, nullptr);
nsContentUtils::UnregisterShutdownObserver(this);
gShutdownObserverRegistered = false;
}
@ -2799,7 +2815,10 @@ MediaStreamGraph::GetInstance(DOMMediaStream::TrackTypeHints aHint, dom::AudioCh
{
NS_ASSERTION(NS_IsMainThread(), "Main thread only");
if (!gGraph) {
uint32_t channel = static_cast<uint32_t>(aChannel);
MediaStreamGraphImpl* graph = nullptr;
if (!gGraphs.Get(channel, &graph)) {
if (!gShutdownObserverRegistered) {
gShutdownObserverRegistered = true;
nsContentUtils::RegisterShutdownObserver(new MediaStreamGraphShutdownObserver());
@ -2807,12 +2826,13 @@ MediaStreamGraph::GetInstance(DOMMediaStream::TrackTypeHints aHint, dom::AudioCh
CubebUtils::InitPreferredSampleRate();
gGraph = new MediaStreamGraphImpl(true, CubebUtils::PreferredSampleRate(), aHint, aChannel);
graph = new MediaStreamGraphImpl(true, CubebUtils::PreferredSampleRate(), aHint, aChannel);
gGraphs.Put(channel, graph);
STREAM_LOG(PR_LOG_DEBUG, ("Starting up MediaStreamGraph %p", gGraph));
STREAM_LOG(PR_LOG_DEBUG, ("Starting up MediaStreamGraph %p", graph));
}
return gGraph;
return graph;
}
MediaStreamGraph*
@ -2995,7 +3015,10 @@ MediaStreamGraph::CreateAudioNodeStream(AudioNodeEngine* aEngine,
bool
MediaStreamGraph::IsNonRealtime() const
{
return this != gGraph;
const MediaStreamGraphImpl* impl = static_cast<const MediaStreamGraphImpl*>(this);
MediaStreamGraphImpl* graph;
return !gGraphs.Get(impl->AudioChannel(), &graph) || graph != impl;
}
void

View File

@ -661,6 +661,8 @@ public:
nsRefPtr<AudioOutputObserver> mFarendObserverRef;
#endif
uint32_t AudioChannel() const { return mAudioChannel; }
private:
virtual ~MediaStreamGraphImpl();
@ -694,6 +696,9 @@ private:
bool mCanRunMessagesSynchronously;
#endif
// We use uint32_t instead AudioChannel because this is just used as key for
// the hashtable gGraphs.
uint32_t mAudioChannel;
};
}

View File

@ -58,7 +58,7 @@ public:
}
virtual nsresult Input(mp4_demuxer::MP4Sample* aSample) MOZ_OVERRIDE {
mp4_demuxer::AnnexB::ConvertSample(aSample, mConfig.annex_b);
mp4_demuxer::AnnexB::ConvertSample(aSample);
return MediaCodecDataDecoder::Input(aSample);
}

View File

@ -53,7 +53,6 @@ GonkVideoDecoderManager::GonkVideoDecoderManager(
mozilla::layers::ImageContainer* aImageContainer,
const mp4_demuxer::VideoDecoderConfig& aConfig)
: mImageContainer(aImageContainer)
, mConfig(aConfig)
, mReaderCallback(nullptr)
, mColorConverterBufferSize(0)
, mNativeWindow(nullptr)
@ -396,7 +395,7 @@ GonkVideoDecoderManager::Input(mp4_demuxer::MP4Sample* aSample)
status_t rv;
if (aSample != nullptr) {
// We must prepare samples in AVC Annex B.
mp4_demuxer::AnnexB::ConvertSample(aSample, mConfig.annex_b);
mp4_demuxer::AnnexB::ConvertSample(aSample);
// Forward sample data to the decoder.
const uint8_t* data = reinterpret_cast<const uint8_t*>(aSample->data);

View File

@ -115,7 +115,6 @@ private:
void ReleaseAllPendingVideoBuffersLocked();
void PostReleaseVideoBuffer(android::MediaBuffer *aBuffer);
const mp4_demuxer::VideoDecoderConfig& mConfig;
uint32_t mVideoWidth;
uint32_t mVideoHeight;
uint32_t mDisplayWidth;

View File

@ -40,7 +40,6 @@ WMFVideoMFTManager::WMFVideoMFTManager(
: mVideoStride(0)
, mVideoWidth(0)
, mVideoHeight(0)
, mConfig(aConfig)
, mImageContainer(aImageContainer)
, mDXVAEnabled(aDXVAEnabled)
, mLayersBackend(aLayersBackend)
@ -147,7 +146,7 @@ HRESULT
WMFVideoMFTManager::Input(mp4_demuxer::MP4Sample* aSample)
{
// We must prepare samples in AVC Annex B.
mp4_demuxer::AnnexB::ConvertSample(aSample, mConfig.annex_b);
mp4_demuxer::AnnexB::ConvertSample(aSample);
// Forward sample data to the decoder.
const uint8_t* data = reinterpret_cast<const uint8_t*>(aSample->data);
uint32_t length = aSample->size;

View File

@ -56,8 +56,6 @@ private:
uint32_t mVideoHeight;
nsIntRect mPictureRegion;
const mp4_demuxer::VideoDecoderConfig& mConfig;
RefPtr<MFTDecoder> mDecoder;
RefPtr<layers::ImageContainer> mImageContainer;
nsAutoPtr<DXVA2Manager> mDXVA2Manager;

View File

@ -282,10 +282,6 @@ void
MediaCodecReader::ProcessCachedDataTask::Run()
{
mReader->ProcessCachedData(mOffset, nullptr);
nsRefPtr<ReferenceKeeperRunnable<MediaCodecReader>> runnable(
new ReferenceKeeperRunnable<MediaCodecReader>(mReader));
mReader = nullptr;
NS_DispatchToMainThread(runnable.get());
}
MediaCodecReader::MediaCodecReader(AbstractMediaDecoder* aDecoder)
@ -305,7 +301,6 @@ MediaCodecReader::MediaCodecReader(AbstractMediaDecoder* aDecoder)
MediaCodecReader::~MediaCodecReader()
{
MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
}
nsresult

View File

@ -338,37 +338,6 @@ private:
};
friend class ProcessCachedDataTask;
// This class is used to keep one reference count of T in it. And this class
// can make sure the stored reference count will be released on the dispatched
// thread. By using this class properly (ex. passing the pointer into this
// runnable first, then releasing the original pointer held by ourselves, and
// then dispatching this runnable onto the desired thread), we can avoid
// running the destructor of the referenced object on any other threads
// unexpectedly before this runnable has been executed.
template<class T>
class ReferenceKeeperRunnable : public nsRunnable
{
public:
ReferenceKeeperRunnable(nsRefPtr<T> aPointer)
: mPointer(aPointer)
{
}
NS_IMETHOD Run() MOZ_OVERRIDE
{
mPointer = nullptr;
return NS_OK;
}
private:
// Forbidden
ReferenceKeeperRunnable() MOZ_DELETE;
ReferenceKeeperRunnable(const ReferenceKeeperRunnable &rhs) MOZ_DELETE;
const ReferenceKeeperRunnable &operator=(const ReferenceKeeperRunnable &rhs) MOZ_DELETE;
nsRefPtr<T> mPointer;
};
// Forbidden
MediaCodecReader() MOZ_DELETE;
const MediaCodecReader& operator=(const MediaCodecReader& rhs) MOZ_DELETE;

View File

@ -2582,6 +2582,48 @@ PeerConnectionWrapper.prototype = {
}
},
/**
* Compares the Ice server configured for this PeerConnectionWrapper
* with the ICE candidates received in the RTCP stats.
*
* @param {object} stats
* The stats to be verified for relayed vs. direct connection.
*/
checkStatsIceConnectionType : function PCW_checkStatsIceConnectionType(stats)
{
var lId;
var rId;
Object.keys(stats).forEach(function(name) {
if ((stats[name].type === "candidatepair") &&
(stats[name].selected)) {
lId = stats[name].localCandidateId;
rId = stats[name].remoteCandidateId;
}
});
info("checkStatsIceConnectionType verifying: local=" +
JSON.stringify(stats[lId]) + " remote=" + JSON.stringify(stats[rId]));
if ((typeof stats[lId] === 'undefined') ||
(typeof stats[rId] === 'undefined')) {
info("checkStatsIceConnectionType failed to find candidatepair IDs");
return;
}
var lType = stats[lId].candidateType;
var rType = stats[rId].candidateType;
var lIp = stats[lId].ipAddress;
var rIp = stats[rId].ipAddress;
if ((this.configuration) && (typeof this.configuration.iceServers !== 'undefined')) {
info("Ice Server configured");
// Note: the IP comparising is a workaround for bug 1097333
// And this will fail if a TURN server address is a DNS name!
var serverIp = this.configuration.iceServers[0].url.split(':')[1];
ok((lType === "relayed" || rType === "relayed") ||
(lIp === serverIp || rIp === serverIp), "One peer uses a relay");
} else {
info("P2P configured");
ok(((lType !== "relayed") && (rType !== "relayed")), "Pure peer to peer call without a relay");
}
},
/**
* Property-matching function for finding a certain stat in passed-in stats
*

View File

@ -24,6 +24,17 @@ function dumpSdp(test) {
dump("ERROR: SDP answer: " + test._remote_answer.sdp.replace(/[\r]/g, ''));
}
if ((test.pcLocal) && (typeof test.pcLocal._local_ice_candidates !== 'undefined')) {
dump("pcLocal._local_ice_candidates: " + JSON.stringify(test.pcLocal._local_ice_candidates) + "\n");
dump("pcLocal._remote_ice_candidates: " + JSON.stringify(test.pcLocal._remote_ice_candidates) + "\n");
dump("pcLocal._ice_candidates_to_add: " + JSON.stringify(test.pcLocal._ice_candidates_to_add) + "\n");
}
if ((test.pcRemote) && (typeof test.pcRemote._local_ice_candidates !== 'undefined')) {
dump("pcRemote._local_ice_candidates: " + JSON.stringify(test.pcRemote._local_ice_candidates) + "\n");
dump("pcRemote._remote_ice_candidates: " + JSON.stringify(test.pcRemote._remote_ice_candidates) + "\n");
dump("pcRemote._ice_candidates_to_add: " + JSON.stringify(test.pcRemote._ice_candidates_to_add) + "\n");
}
if ((test.pcLocal) && (typeof test.pcLocal.iceConnectionLog !== 'undefined')) {
dump("pcLocal ICE connection state log: " + test.pcLocal.iceConnectionLog + "\n");
}
@ -492,6 +503,24 @@ var commandsPeerConnection = [
});
}
],
[
'PC_LOCAL_CHECK_ICE_CONNECTION_TYPE',
function (test) {
test.pcLocal.getStats(null, function(stats) {
test.pcLocal.checkStatsIceConnectionType(stats);
test.next();
});
}
],
[
'PC_REMOTE_CHECK_ICE_CONNECTION_TYPE',
function (test) {
test.pcRemote.getStats(null, function(stats) {
test.pcRemote.checkStatsIceConnectionType(stats);
test.next();
});
}
],
[
'PC_LOCAL_CHECK_GETSTATS_AUDIOTRACK_OUTBOUND',
function (test) {

View File

@ -3,6 +3,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* An example of how to specify two TURN server configs:
*
* Note: If turn URL uses FQDN rather then an IP address the TURN relay
* verification step in checkStatsIceConnectionType might fail.
*
* var turnServers = {
* local: { iceServers: [{"username":"mozilla","credential":"mozilla","url":"turn:10.0.0.1"}] },
* remote: { iceServers: [{"username":"firefox","credential":"firefox","url":"turn:10.0.0.2"}] }

View File

@ -669,12 +669,6 @@ AudioContext::MozAudioChannelType() const
return mDestination->MozAudioChannelType();
}
void
AudioContext::SetMozAudioChannelType(AudioChannel aValue, ErrorResult& aRv)
{
mDestination->SetMozAudioChannelType(aValue, aRv);
}
AudioChannel
AudioContext::TestAudioChannelInAudioNodeStream()
{

View File

@ -224,7 +224,6 @@ public:
JSObject* GetGlobalJSObject() const;
AudioChannel MozAudioChannelType() const;
void SetMozAudioChannelType(AudioChannel aValue, ErrorResult& aRv);
AudioChannel TestAudioChannelInAudioNodeStream();

View File

@ -18,27 +18,23 @@ function test_basic() {
// Default
is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
// random wrong channel
ac.mozAudioChannelType = "foo";
is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
// Unpermitted channels
ac.mozAudioChannelType = "content";
ac = new AudioContext("content");
is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
ac.mozAudioChannelType = "notification";
ac = new AudioContext("notification");
is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
ac.mozAudioChannelType = "alarm";
ac = new AudioContext("alarm");
is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
ac.mozAudioChannelType = "telephony";
ac = new AudioContext("telephony");
is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
ac.mozAudioChannelType = "ringer";
ac = new AudioContext("ringer");
is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
ac.mozAudioChannelType = "publicnotification";
ac = new AudioContext("publicnotification");
is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
runTest();
@ -56,7 +52,7 @@ function test_permission(aChannel) {
SpecialPowers.pushPermissions(
[{ "type": "audio-channel-" + aChannel, "allow": true, "context": document }],
function() {
ac.mozAudioChannelType = aChannel;
var ac = new AudioContext(aChannel);
is(ac.mozAudioChannelType, aChannel, "Default ac channel == '" + aChannel + "'");
var channel = SpecialPowers.wrap(ac).testAudioChannelInAudioNodeStream();
@ -147,6 +143,7 @@ function runTest() {
SpecialPowers.pushPrefEnv({"set": [["media.useAudioChannelService", true ]]}, runTest);
SimpleTest.waitForExplicitFinish();
SimpleTest.requestLongerTimeout(5);
</script>
</pre>

View File

@ -7,6 +7,7 @@
#include "mozilla/dom/Promise.h"
#include "jsfriendapi.h"
#include "js/Debug.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/DOMError.h"
#include "mozilla/dom/OwningNonNull.h"
@ -324,8 +325,8 @@ Promise::CreateWrapper(ErrorResult& aRv)
}
JSContext* cx = jsapi.cx();
JS::Rooted<JS::Value> ignored(cx);
if (!WrapNewBindingObject(cx, this, &ignored)) {
JS::Rooted<JS::Value> wrapper(cx);
if (!WrapNewBindingObject(cx, this, &wrapper)) {
JS_ClearPendingException(cx);
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
@ -339,6 +340,9 @@ Promise::CreateWrapper(ErrorResult& aRv)
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
JS::RootedObject obj(cx, &wrapper.toObject());
JS::dbg::onNewPromise(cx, obj);
}
void
@ -1113,19 +1117,19 @@ Promise::RejectInternal(JSContext* aCx,
}
void
Promise::MaybeSettle(JS::Handle<JS::Value> aValue,
PromiseState aState)
Promise::Settle(JS::Handle<JS::Value> aValue, PromiseState aState)
{
// Promise.all() or Promise.race() implementations will repeatedly call
// Resolve/RejectInternal rather than using the Maybe... forms. Stop SetState
// from asserting.
if (mState != Pending) {
return;
}
mSettlementTimestamp = TimeStamp::Now();
SetResult(aValue);
SetState(aState);
mSettlementTimestamp = TimeStamp::Now();
AutoJSAPI jsapi;
jsapi.Init();
JSContext* cx = jsapi.cx();
JS::RootedObject wrapper(cx, GetWrapper());
MOZ_ASSERT(wrapper); // We preserved it
JSAutoCompartment ac(cx, wrapper);
JS::dbg::onPromiseSettled(cx, wrapper);
// If the Promise was rejected, and there is no reject handler already setup,
// watch for thread shutdown.
@ -1149,6 +1153,20 @@ Promise::MaybeSettle(JS::Handle<JS::Value> aValue,
EnqueueCallbackTasks();
}
void
Promise::MaybeSettle(JS::Handle<JS::Value> aValue,
PromiseState aState)
{
// Promise.all() or Promise.race() implementations will repeatedly call
// Resolve/RejectInternal rather than using the Maybe... forms. Stop SetState
// from asserting.
if (mState != Pending) {
return;
}
Settle(aValue, aState);
}
void
Promise::EnqueueCallbackTasks()
{

View File

@ -225,8 +225,8 @@ private:
// appended by then(), catch() or done().
void EnqueueCallbackTasks();
void MaybeSettle(JS::Handle<JS::Value> aValue,
Promise::PromiseState aState);
void Settle(JS::Handle<JS::Value> aValue, Promise::PromiseState aState);
void MaybeSettle(JS::Handle<JS::Value> aValue, Promise::PromiseState aState);
void AppendCallbacks(PromiseCallback* aResolveCallback,
PromiseCallback* aRejectCallback);

View File

@ -1,3 +1,6 @@
[DEFAULT]
[test_dependentPromises.html]
[test_on_new_promise.html]
[test_on_promise_settled.html]
[test_on_promise_settled_duplicates.html]

View File

@ -0,0 +1,45 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!--
Bug 1083210 - Sanity test for interaction between DOM promises and
Debugger.prototype.onNewPromise.
-->
<html>
<head>
<title>Test for interaction with SpiderMonkey's Debugger.prototype.onNewPromise</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
is(Object.prototype.toString.call(new Promise(function () {})),
"[object Promise]",
"We should have the native DOM promise implementation.");
var Cu = Components.utils;
Cu.import("resource://gre/modules/jsdebugger.jsm");
var dbgGlobal = new Cu.Sandbox(document.nodePrincipal);
addDebuggerToGlobal(dbgGlobal);
var dbg = new dbgGlobal.Debugger(this);
var wrappedPromise;
dbg.onNewPromise = function (wp) { wrappedPromise = wp; };
var promise = new Promise(function () {});
debugger;
ok(wrappedPromise);
is(wrappedPromise.unsafeDereference(), promise);
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,54 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!--
Bug 1084065 - Sanity test for interaction between DOM promises and
Debugger.prototype.onPromiseResolved.
-->
<html>
<head>
<title>Test for interaction with SpiderMonkey's Debugger.prototype.onNewPromise</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
is(Object.prototype.toString.call(new Promise(function () {})),
"[object Promise]",
"We should have the native DOM promise implementation.");
var Cu = Components.utils;
Cu.import("resource://gre/modules/jsdebugger.jsm");
var dbgGlobal = new Cu.Sandbox(document.nodePrincipal);
addDebuggerToGlobal(dbgGlobal);
var dbg = new dbgGlobal.Debugger(this);
var wrappedPromise;
dbg.onPromiseSettled = function (wp) { wrappedPromise = wp; };
var promise = Promise.resolve();
promise
.then(function () {
ok(wrappedPromise);
is(wrappedPromise.unsafeDereference(), promise);
dbg.onPromiseSettled = undefined;
})
.then(null, function (e) {
ok(false, "Got an unexpected error: " + e);
})
.then(SimpleTest.finish);
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,59 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!--
Bug 1084065 - Test that Debugger.prototype.onPromiseResolved doesn't get dupes.
-->
<html>
<head>
<title>Test for interaction with SpiderMonkey's Debugger.prototype.onNewPromise</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
is(Object.prototype.toString.call(new Promise(function () {})),
"[object Promise]",
"We should have the native DOM promise implementation.");
var Cu = Components.utils;
Cu.import("resource://gre/modules/jsdebugger.jsm");
var dbgGlobal = new Cu.Sandbox(document.nodePrincipal);
addDebuggerToGlobal(dbgGlobal);
var dbg = new dbgGlobal.Debugger(this);
var seen = new Set();
dbg.onPromiseSettled = function (wp) {
is(seen.has(wp), false);
seen.add(wp);
};
var promise = new Promise(function (fulfill, reject) {
fulfill(1);
fulfill(2);
fulfill(3);
});
promise
.then(function () {
dbg.onPromiseSettled = undefined;
})
.then(null, function (e) {
ok(false, "Got an unexpected error: " + e);
})
.then(SimpleTest.finish);
</script>
</pre>
</body>
</html>

View File

@ -78,8 +78,8 @@ interface AudioContext : EventTarget {
// Mozilla extensions
partial interface AudioContext {
// Read AudioChannel.webidl for more information about this attribute.
[Pref="media.useAudioChannelService", SetterThrows]
attribute AudioChannel mozAudioChannelType;
[Pref="media.useAudioChannelService"]
readonly attribute AudioChannel mozAudioChannelType;
// These 2 events are dispatched when the AudioContext object is muted by
// the AudioChannelService. It's call 'interrupt' because when this event is

View File

@ -98,12 +98,12 @@ skip-if(Android||B2G) needs-focus == 462758-grabbers-resizers.html 462758-grabbe
== 388980-1.html 388980-1-ref.html
needs-focus == spellcheck-superscript-1.html spellcheck-superscript-1-ref.html
skip-if(B2G) fails-if(Android) needs-focus != spellcheck-superscript-2.html spellcheck-superscript-2-ref.html # bug 783658
needs-focus == 824080-1.html 824080-1-ref.html
needs-focus pref(selectioncaret.enabled,false) == 824080-1.html 824080-1-ref.html
needs-focus == 824080-2.html 824080-2-ref.html
needs-focus test-pref(selectioncaret.enabled,false) == 824080-3.html 824080-3-ref.html
needs-focus pref(selectioncaret.enabled,false) == 824080-3.html 824080-3-ref.html
needs-focus != 824080-2.html 824080-3.html
needs-focus == 824080-4.html 824080-4-ref.html
needs-focus test-pref(selectioncaret.enabled,false) == 824080-5.html 824080-5-ref.html
needs-focus pref(selectioncaret.enabled,false) == 824080-4.html 824080-4-ref.html
needs-focus pref(selectioncaret.enabled,false) == 824080-5.html 824080-5-ref.html
needs-focus != 824080-4.html 824080-5.html
needs-focus == 824080-6.html 824080-6-ref.html
needs-focus pref(selectioncaret.enabled,false) == 824080-7.html 824080-7-ref.html

View File

@ -683,11 +683,12 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
}
#ifdef XP_MACOSX
// The Mac Nvidia driver, for versions up to and including 10.8, don't seem
// to properly support this. See 814839
// The Mac Nvidia driver, for versions up to and including 10.8,
// don't seem to properly support this. See 814839
// this has been fixed in Mac OS X 10.9. See 907946
// and it also works in 10.8.3 and higher. See 1094338.
if (Vendor() == gl::GLVendor::NVIDIA &&
!nsCocoaFeatures::OnMavericksOrLater())
!nsCocoaFeatures::IsAtLeastVersion(10,8,3))
{
MarkUnsupported(GLFeature::depth_texture);
}

View File

@ -394,10 +394,10 @@ struct ParamTraits<nsIntPoint>
}
};
template<>
struct ParamTraits<mozilla::gfx::IntSize>
template<typename T>
struct ParamTraits<mozilla::gfx::IntSizeTyped<T> >
{
typedef mozilla::gfx::IntSize paramType;
typedef mozilla::gfx::IntSizeTyped<T> paramType;
static void Write(Message* msg, const paramType& param)
{
@ -756,6 +756,7 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
WriteParam(aMsg, aParam.mBackgroundColor);
WriteParam(aMsg, aParam.mDoSmoothScroll);
WriteParam(aMsg, aParam.mSmoothScrollOffset);
WriteParam(aMsg, aParam.GetLineScrollAmount());
WriteParam(aMsg, aParam.GetContentDescription());
}
@ -797,6 +798,7 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
ReadParam(aMsg, aIter, &aResult->mBackgroundColor) &&
ReadParam(aMsg, aIter, &aResult->mDoSmoothScroll) &&
ReadParam(aMsg, aIter, &aResult->mSmoothScrollOffset) &&
ReadParam(aMsg, aIter, &aResult->mLineScrollAmount) &&
ReadContentDescription(aMsg, aIter, aResult));
}
};

View File

@ -65,6 +65,7 @@ public:
, mViewport(0, 0, 0, 0)
, mExtraResolution(1)
, mBackgroundColor(0, 0, 0, 0)
, mLineScrollAmount(0, 0)
{
}
@ -95,7 +96,8 @@ public:
mUpdateScrollOffset == aOther.mUpdateScrollOffset &&
mExtraResolution == aOther.mExtraResolution &&
mBackgroundColor == aOther.mBackgroundColor &&
mDoSmoothScroll == aOther.mDoSmoothScroll;
mDoSmoothScroll == aOther.mDoSmoothScroll &&
mLineScrollAmount == aOther.mLineScrollAmount;
}
bool operator!=(const FrameMetrics& aOther) const
{
@ -514,6 +516,16 @@ public:
mMayHaveTouchListeners = aMayHaveTouchListeners;
}
const LayoutDeviceIntSize& GetLineScrollAmount() const
{
return mLineScrollAmount;
}
void SetLineScrollAmount(const LayoutDeviceIntSize& size)
{
mLineScrollAmount = size;
}
private:
// New fields from now on should be made private and old fields should
// be refactored to be private.
@ -605,6 +617,9 @@ private:
// This is empty unless this is a scrollable layer and the
// apz.printtree pref is turned on.
nsCString mContentDescription;
// The value of GetLineScrollAmount(), for scroll frames.
LayoutDeviceIntSize mLineScrollAmount;
};
/**

View File

@ -611,6 +611,29 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
MultiTouchInput& touchInput = aEvent.AsMultiTouchInput();
result = ProcessTouchInput(touchInput, aOutTargetGuid, aOutInputBlockId);
break;
} case SCROLLWHEEL_INPUT: {
ScrollWheelInput& wheelInput = aEvent.AsScrollWheelInput();
nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(wheelInput.mOrigin,
&hitResult);
if (apzc) {
MOZ_ASSERT(hitResult == ApzcHitRegion || hitResult == ApzcContentRegion);
transformToApzc = GetScreenToApzcTransform(apzc);
wheelInput.mLocalOrigin =
TransformTo<ParentLayerPixel>(transformToApzc, wheelInput.mOrigin);
result = mInputQueue->ReceiveInputEvent(
apzc,
/* aTargetConfirmed = */ hitResult,
wheelInput, aOutInputBlockId);
// Update the out-parameters so they are what the caller expects.
apzc->GetGuid(aOutTargetGuid);
Matrix4x4 transformToGecko = transformToApzc * GetApzcToGeckoTransform(apzc);
wheelInput.mOrigin =
TransformTo<ScreenPixel>(transformToGecko, wheelInput.mLocalOrigin);
}
break;
} case PANGESTURE_INPUT: {
PanGestureInput& panInput = aEvent.AsPanGestureInput();
nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(panInput.mPanStartPoint,

Some files were not shown because too many files have changed in this diff Show More