This commit is contained in:
Ryan VanderMeulen 2013-05-21 13:28:21 -04:00
Родитель 90a4a690e6 b09f53151c
Коммит 38db4edda7
241 изменённых файлов: 2254 добавлений и 2158 удалений

Просмотреть файл

@ -17,7 +17,7 @@
# #
# Modifying this file will now automatically clobber the buildbot machines \o/ # Modifying this file will now automatically clobber the buildbot machines \o/
# #
Landing bug 865806 Refactored build system core dependencies in bug 874078.
Alternative to clobber is to run ./config.status from the objdir and to Alternative to clobber is to run ./config.status from the objdir and to
touch the CLOBBER file in the objdir. touch the CLOBBER file in the objdir.

Просмотреть файл

@ -38,6 +38,8 @@ DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
$(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
ifndef MOZ_PROFILE_USE ifndef MOZ_PROFILE_USE
# We need to explicitly put backend.RecursiveMakeBackend.built here
# otherwise the rule in rules.mk doesn't run early enough.
default alldep all:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend.built default alldep all:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend.built
$(RM) -r $(DIST)/sdk $(RM) -r $(DIST)/sdk
$(RM) -r $(DIST)/include $(RM) -r $(DIST)/include
@ -73,14 +75,6 @@ export::
$(MAKE) -C config export $(MAKE) -C config export
$(MAKE) tier_nspr $(MAKE) tier_nspr
backend.RecursiveMakeBackend.built:
@echo "Updating build backend because of moz.build changes."
@$(PYTHON) ./config.status
include backend.RecursiveMakeBackend.built.pp
export MOZBUILD_BACKEND_CHECKED=1
ifdef ENABLE_TESTS ifdef ENABLE_TESTS
# Additional makefile targets to call automated test suites # Additional makefile targets to call automated test suites
include $(topsrcdir)/testing/testsuite-targets.mk include $(topsrcdir)/testing/testsuite-targets.mk

Просмотреть файл

@ -11,45 +11,51 @@ const BOUNDARY_ATTRIBUTE_RANGE = nsIAccessibleText.BOUNDARY_ATTRIBUTE_RANGE;
const kTextEndOffset = nsIAccessibleText.TEXT_OFFSET_END_OF_TEXT; const kTextEndOffset = nsIAccessibleText.TEXT_OFFSET_END_OF_TEXT;
const kCaretOffset = nsIAccessibleText.TEXT_OFFSET_CARET; const kCaretOffset = nsIAccessibleText.TEXT_OFFSET_CARET;
const kTodo = 1; const kTodo = 1; // a test is expected to fail
const kOk = 2; const kOk = 2; // a test doesn't fail
/** /**
* Test characterCount for the given array of accessibles. * Test characterCount for the given array of accessibles.
* *
* @param aCount [in] the expected character count * @param aCount [in] the expected character count
* @param aIDs [in] array of accessible identifiers to test * @param aIDs [in] array of accessible identifiers to test
* @param aTodoFlag [in, optional] either kOk or kTodo
*/ */
function testCharacterCount(aIDs, aCount) function testCharacterCount(aIDs, aCount, aTodoFlag)
{ {
for (var i = 0; i < aIDs.length; i++) { var ids = (aIDs instanceof Array) ? aIDs : [ aIDs ];
var textacc = getAccessible(aIDs[i], [nsIAccessibleText]); var isFunc = (aTodoFlag == kTodo) ? todo_is : is;
is(textacc.characterCount, aCount, for (var i = 0; i < ids.length; i++) {
"Wrong character count for " + prettyName(aIDs[i])); var textacc = getAccessible(ids[i], [nsIAccessibleText]);
isFunc(textacc.characterCount, aCount,
"Wrong character count for " + prettyName(ids[i]));
} }
} }
/** /**
* Test text between two given offsets * Test text between two given offsets.
* *
* @param aIDs [in] an array of accessible IDs to test * @param aIDs [in] an array of accessible IDs to test
* @param aStartOffset [in] the start offset within the text to test * @param aStartOffset [in] the start offset within the text to test
* @param aEndOffset [in] the end offset up to which the text is tested * @param aEndOffset [in] the end offset up to which the text is tested
* @param aText [in] the expected result from the test * @param aText [in] the expected result from the test
* @param aTodoFlag [in, optional] either kOk or kTodo
*/ */
function testText(aIDs, aStartOffset, aEndOffset, aText) function testText(aIDs, aStartOffset, aEndOffset, aText, aTodoFlag)
{ {
for (var i = 0; i < aIDs.length; i++) var ids = (aIDs instanceof Array) ? aIDs : [ aIDs ];
{ var isFunc = (aTodoFlag == kTodo) ? todo_is : is;
var acc = getAccessible(aIDs[i], nsIAccessibleText); for (var i = 0; i < ids.length; i++) {
var acc = getAccessible(ids[i], nsIAccessibleText);
try { try {
is(acc.getText(aStartOffset, aEndOffset), aText, isFunc(acc.getText(aStartOffset, aEndOffset), aText,
"getText: wrong text between start and end offsets '" + aStartOffset + "getText: wrong text between start and end offsets '" +
"', '" + aEndOffset + " for '" + prettyName(aIDs[i]) + "'"); aStartOffset + "', '" + aEndOffset + " for '" +
prettyName(ids[i]) + "'");
} catch (e) { } catch (e) {
ok(false, ok(false,
"getText fails between start and end offsets '" + aStartOffset + "getText fails between start and end offsets '" + aStartOffset +
"', '" + aEndOffset + " for '" + prettyName(aIDs[i]) + "'"); "', '" + aEndOffset + " for '" + prettyName(ids[i]) + "'");
} }
} }
} }

Просмотреть файл

@ -14,7 +14,9 @@ include $(DEPTH)/config/autoconf.mk
MOCHITEST_A11Y_FILES = \ MOCHITEST_A11Y_FILES = \
doc.html \ doc.html \
test_atcaretoffset.html \ test_atcaretoffset.html \
test_charboundary.html \
test_doc.html \ test_doc.html \
test_gettext.html \
test_hypertext.html \ test_hypertext.html \
test_label.xul \ test_label.xul \
test_multiline.html \ test_multiline.html \

Просмотреть файл

@ -0,0 +1,153 @@
<!DOCTYPE html>
<html>
<head>
<title>Char boundary text tests</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../text.js"></script>
<script type="application/javascript">
function doTest()
{
//////////////////////////////////////////////////////////////////////////
//
// __h__e__l__l__o__ __m__y__ __f__r__i__e__n__d__
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
var IDs = [ "i1", "d1", "e1", "t1" ];
testCharBeforeOffset(IDs, 0, "", 0, 0);
testCharBeforeOffset(IDs, 1, "h", 0, 1);
testCharBeforeOffset(IDs, 14, "n", 13, 14);
testCharBeforeOffset(IDs, 15, "d", 14, 15);
testCharAtOffset(IDs, 0, "h", 0, 1);
testCharAtOffset(IDs, 1, "e", 1, 2);
testCharAtOffset(IDs, 14, "d", 14, 15);
testCharAtOffset([ "i1", "d1", "e1" ], 15, "", 15, 15);
testTextAfterOffset(15, BOUNDARY_CHAR, "", 15, 15,
"t1", kOk, kTodo, kTodo);
testCharAfterOffset(IDs, 0, "e", 1, 2);
testCharAfterOffset(IDs, 1, "l", 2, 3);
testCharAfterOffset([ "i1", "d1", "e1" ], 14, "", 15, 15);
testTextAfterOffset(14, BOUNDARY_CHAR, "", 15, 15,
"t1", kTodo, kOk, kTodo);
// 15 is out of range offset for get text after, keep todos until we
// decide how to handle out of range values (ATK and IA2 seems to have
// different expectations.
testTextAfterOffset(15, BOUNDARY_CHAR, "", 15, 15,
"i1", kOk, kTodo, kTodo,
"d1", kOk, kTodo, kTodo,
"e1", kOk, kTodo, kTodo);
testTextAfterOffset(15, BOUNDARY_CHAR, "", 15, 15,
"t1", kOk, kTodo, kTodo);
//////////////////////////////////////////////////////////////////////////
//
// __B__r__a__v__e__ __S__i__r__ __ __R__o__b__i__n__ __ __ __r__a__n
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
IDs = [ "i2", "d2", "e2", "t2" ];
testCharBeforeOffset(IDs, 0, "", 0, 0);
testCharBeforeOffset(IDs, 1, "B", 0, 1);
testCharBeforeOffset(IDs, 6, " ", 5, 6);
testCharBeforeOffset(IDs, 10, " ", 9, 10);
testCharBeforeOffset(IDs, 11, " ", 10, 11);
testCharBeforeOffset(IDs, 17, " ", 16, 17);
testCharBeforeOffset(IDs, 19, " ", 18, 19);
testCharAtOffset(IDs, 0, "B", 0, 1);
testCharAtOffset(IDs, 1, "r", 1, 2);
testCharAtOffset(IDs, 5, " ", 5, 6);
testCharAtOffset(IDs, 9, " ", 9, 10);
testCharAtOffset(IDs, 10, " ", 10, 11);
testCharAtOffset(IDs, 17, " ", 17, 18);
testCharAfterOffset(IDs, 0, "r", 1, 2);
testCharAfterOffset(IDs, 1, "a", 2, 3);
testCharAfterOffset(IDs, 4, " ", 5, 6);
testCharAfterOffset(IDs, 5, "S", 6, 7);
testCharAfterOffset(IDs, 8, " ", 9, 10);
testCharAfterOffset(IDs, 9, " ", 10, 11);
testCharAfterOffset(IDs, 10, "R", 11, 12);
testCharAfterOffset(IDs, 15, " ", 16, 17);
testCharAfterOffset(IDs, 16, " ", 17, 18);
testCharAfterOffset(IDs, 17, " ", 18, 19);
testCharAfterOffset(IDs, 18, "r", 19, 20);
//////////////////////////////////////////////////////////////////////////
//
// __o__n__e__w__o__r__d__\n
// 0 1 2 3 4 5 6 7
// __\n
// 8
// __t__w__o__ __w__o__r__d__s__\n
// 9 10 11 12 13 14 15 16 17 18
IDs = ["d3", "dbr3", "e3", "ebr3", "t3"];
testCharBeforeOffset(IDs, 8, "\n", 7, 8);
testCharBeforeOffset(IDs, 9, "\n", 8, 9);
testCharBeforeOffset(IDs, 10, "t", 9, 10);
testCharAtOffset(IDs, 7, "\n", 7, 8);
testCharAtOffset(IDs, 8, "\n", 8, 9);
testCharAtOffset(IDs, 9, "t", 9, 10);
testCharAfterOffset(IDs, 6, "\n", 7, 8);
testCharAfterOffset(IDs, 7, "\n", 8, 9);
testCharAfterOffset(IDs, 8, "t", 9, 10);
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<input id="i1" value="hello my friend"/>
<div id="d1">hello my friend</div>
<div id="e1" contenteditable="true">hello my friend</div>
<textarea id="t1" contenteditable="true">hello my friend</textarea>
<input id="i2" value="Brave Sir Robin ran"/>
<pre>
<div id="d2">Brave Sir Robin ran</div>
<div id="e2" contenteditable="true">Brave Sir Robin ran</div>
</pre>
<textarea id="t2" cols="300">Brave Sir Robin ran</textarea>
<pre>
<div id="d3">oneword
two words
</div>
<div id="dbr3">oneword<br/><br/>two words<br/></div>
<div id="e3" contenteditable="true">oneword
two words
</div>
<div id="ebr3" contenteditable="true">oneword<br/><br/>two words<br/></div>
<textarea id="t3" cols="300">oneword
two words</textarea>
</pre>
</body>
</html>

Просмотреть файл

@ -0,0 +1,115 @@
<!DOCTYPE html>
<html>
<head>
<title>Get text between offsets tests</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../text.js"></script>
<script type="application/javascript">
function doTest()
{
//////////////////////////////////////////////////////////////////////////
//
// __h__e__l__l__o__ __m__y__ __f__r__i__e__n__d__
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
var IDs = [ "i1", "d1", "e1", "t1" ];
testCharacterCount([ "i1", "d1", "e1" ], 15);
testCharacterCount("t1", 15, kTodo);
testText(IDs, 0, 1, "h");
testText(IDs, 1, 3, "el");
testText(IDs, 14, 15, "d");
testText(IDs, 0, 15, "hello my friend");
testText([ "i1", "d1", "e1"], 0, -1, "hello my friend");
testText("t1", 0, -1, "hello my friend", kTodo);
//////////////////////////////////////////////////////////////////////////
//
// __B__r__a__v__e__ __S__i__r__ __ __R__o__b__i__n__ __ __ __r__a__n
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
IDs = [ "i2", "dpre2", "epre2", "t2" ];
testCharacterCount([ "i2", "dpre2", "epre2"], 22);
testCharacterCount("t2", 22, kTodo);
testText(IDs, 0, 1, "B");
testText(IDs, 5, 6, " ");
testText(IDs, 9, 11, " ");
testText(IDs, 16, 19, " ");
testText(IDs, 0, 22, "Brave Sir Robin ran");
testText([ "i2", "dpre2", "epre2" ], 0, -1, "Brave Sir Robin ran");
testText("t2", 0, -1, "Brave Sir Robin ran", kTodo);
testCharacterCount(["d2", "e2"], 19);
testText(["d2", "e2"], 0, 19, "Brave Sir Robin ran");
//////////////////////////////////////////////////////////////////////////
//
// __o__n__e__w__o__r__d__\n
// 0 1 2 3 4 5 6 7
// __\n
// 8
// __t__w__o__ __w__o__r__d__s__\n
// 9 10 11 12 13 14 15 16 17 18
var IDs = ["d3", "dbr3", "e3", "ebr3", "t3"];
testCharacterCount(IDs, 19);
testText(IDs, 0, 19, "oneword\n\ntwo words\n");
testText(IDs, 0, -1, "oneword\n\ntwo words\n");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<input id="i1" value="hello my friend"/>
<div id="d1">hello my friend</div>
<div id="e1" contenteditable="true">hello my friend</div>
<textarea id="t1">hello my friend</textarea>
<input id="i2" value="Brave Sir Robin ran"/>
<pre><div id="dpre2">Brave Sir Robin ran</div></pre>
<pre><div id="epre2" contenteditable="true">Brave Sir Robin ran</div></pre>
<textarea id="t2" cols="300">Brave Sir Robin ran</textarea>
<div id="d2">Brave Sir Robin ran</div>
<div id="e2" contenteditable="true">Brave Sir Robin ran</div>
<pre>
<div id="d3">oneword
two words
</div>
<div id="dbr3">oneword<br/><br/>two words<br/></div>
<div id="e3" contenteditable="true">oneword
two words
</div>
<div id="ebr3" contenteditable="true">oneword<br/><br/>two words<br/></div>
<textarea id="t3" cols="300">oneword
two words</textarea>
</pre>
</body>
</html>

Просмотреть файл

@ -32,31 +32,10 @@
// getText // getText
var IDs = ["div", "divbr", "editable", "editablebr", "textarea"]; var IDs = ["div", "divbr", "editable", "editablebr", "textarea"];
testText(IDs, 0, 19, "oneword\n\ntwo words\n");
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// getTextAfterOffset // getTextAfterOffset
// BOUNDARY_CHAR
testTextAfterOffset(6, BOUNDARY_CHAR, "\n", 7, 8,
"div", kOk, kOk, kOk,
"divbr", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"editablebr", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
testTextAfterOffset(7, BOUNDARY_CHAR, "\n", 8, 9,
"div", kOk, kOk, kOk,
"divbr", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"editablebr", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
testTextAfterOffset(8, BOUNDARY_CHAR, "t", 9, 10,
"div", kOk, kOk, kOk,
"divbr", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"editablebr", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
// BOUNDARY_WORD_START // BOUNDARY_WORD_START
testTextAfterOffset(0, BOUNDARY_WORD_START, "two ", 9, 13, IDs); testTextAfterOffset(0, BOUNDARY_WORD_START, "two ", 9, 13, IDs);
testTextAfterOffset(8, BOUNDARY_WORD_START, "two ", 9, 13, testTextAfterOffset(8, BOUNDARY_WORD_START, "two ", 9, 13,
@ -146,26 +125,6 @@
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// getTextBeforeOffset // getTextBeforeOffset
// BOUNDARY_CHAR
testTextBeforeOffset(8, BOUNDARY_CHAR, "\n", 7, 8,
"div", kOk, kOk, kOk,
"divbr", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"editablebr", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
testTextBeforeOffset(9, BOUNDARY_CHAR, "\n", 8, 9,
"div", kOk, kOk, kOk,
"divbr", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"editablebr", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
testTextBeforeOffset(10, BOUNDARY_CHAR, "t", 9, 10,
"div", kOk, kOk, kOk,
"divbr", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"editablebr", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
// BOUNDARY_WORD_START // BOUNDARY_WORD_START
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0, IDs); testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0, IDs);
testTextBeforeOffset(7, BOUNDARY_WORD_START, "", 0, 0, IDs); testTextBeforeOffset(7, BOUNDARY_WORD_START, "", 0, 0, IDs);
@ -273,26 +232,6 @@
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// getTextAtOffset // getTextAtOffset
// BOUNDARY_CHAR
testTextAtOffset(7, BOUNDARY_CHAR, "\n", 7, 8,
"div", kOk, kOk, kOk,
"divbr", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"editablebr", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
testTextAtOffset(8, BOUNDARY_CHAR, "\n", 8, 9,
"div", kOk, kOk, kOk,
"divbr", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"editablebr", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
testTextAtOffset(9, BOUNDARY_CHAR, "t", 9, 10,
"div", kOk, kOk, kOk,
"divbr", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"editablebr", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
// BOUNDARY_WORD_START // BOUNDARY_WORD_START
testTextAtOffset(0, BOUNDARY_WORD_START, "oneword\n\n", 0, 9, IDs); testTextAtOffset(0, BOUNDARY_WORD_START, "oneword\n\n", 0, 9, IDs);
testTextAtOffset(8, BOUNDARY_WORD_START, "oneword\n\n", 0, 9, testTextAtOffset(8, BOUNDARY_WORD_START, "oneword\n\n", 0, 9,

Просмотреть файл

@ -22,42 +22,12 @@
// __h__e__l__l__o__ __m__y__ __f__r__i__e__n__d__ // __h__e__l__l__o__ __m__y__ __f__r__i__e__n__d__
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
////////////////////////////////////////////////////////////////////////
// characterCount
testCharacterCount(["input", "div"], 15);
testCharacterCount(["textarea"], 16);
////////////////////////////////////////////////////////////////////////
// getText
var IDs = ["input", "div", "textarea"];
testText(IDs, 0, 1, "h");
testText(IDs, 1, 3, "el");
testText(IDs, 14, 15, "d");
testText(IDs, 0, 15, "hello my friend");
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// getTextAfterOffset // getTextAfterOffset
var IDs = [ "input", "div", "editable", "textarea" ]; var IDs = [ "input", "div", "editable", "textarea" ];
var regularIDs = [ "input", "div", "editable" ]; var regularIDs = [ "input", "div", "editable" ];
// BOUNDARY_CHAR
testCharAfterOffset(IDs, 0, "e", 1, 2);
testCharAfterOffset(IDs, 1, "l", 2, 3);
testCharAfterOffset(regularIDs, 14, "", 15, 15);
testCharAfterOffset("textarea", 14, "\n", 15, 16);
// XXX: why are 15/15 expected? there's no 16 offset we are trying to
// get an offset for?
testTextAfterOffset(15, BOUNDARY_CHAR, "", 15, 15,
"input", kOk, kTodo, kTodo,
"div", kOk, kTodo, kTodo,
"editable", kOk, kTodo, kTodo);
testCharAfterOffset("textarea", 15, "", 16, 16);
// BOUNDARY_WORD_START // BOUNDARY_WORD_START
testTextAfterOffset(0, BOUNDARY_WORD_START, "my ", 6, 9, IDs); testTextAfterOffset(0, BOUNDARY_WORD_START, "my ", 6, 9, IDs);
testTextAfterOffset(1, BOUNDARY_WORD_START, "my ", 6, 9, IDs); testTextAfterOffset(1, BOUNDARY_WORD_START, "my ", 6, 9, IDs);
@ -131,12 +101,6 @@
var IDs = [ "input", "div", "editable", "textarea" ]; var IDs = [ "input", "div", "editable", "textarea" ];
// BOUNDARY_CHAR
testCharBeforeOffset(IDs, 0, "", 0, 0);
testCharBeforeOffset(IDs, 1, "h", 0, 1);
testCharBeforeOffset(IDs, 14, "n", 13, 14);
testCharBeforeOffset(IDs, 15, "d", 14, 15);
// BOUNDARY_WORD_START // BOUNDARY_WORD_START
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0, IDs); testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0, IDs);
testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0, IDs); testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0, IDs);
@ -215,15 +179,6 @@
IDs = [ "input", "div", "editable", "textarea" ]; IDs = [ "input", "div", "editable", "textarea" ];
regularIDs = [ "input", "div", "editable" ]; regularIDs = [ "input", "div", "editable" ];
// BOUNDARY_CHAR
testCharAtOffset(IDs, 0, "h", 0, 1);
testCharAtOffset(IDs, 1, "e", 1, 2);
testCharAtOffset(IDs, 14, "d", 14, 15);
testCharAtOffset(regularIDs, 15, "", 15, 15);
testCharAtOffset("textarea", 15, "\n", 15, 16);
testCharAtOffset("textarea", 16, "", 16, 16);
// BOUNDARY_WORD_START // BOUNDARY_WORD_START
testTextAtOffset(0, BOUNDARY_WORD_START, "hello ", 0, 6, IDs); testTextAtOffset(0, BOUNDARY_WORD_START, "hello ", 0, 6, IDs);
testTextAtOffset(1, BOUNDARY_WORD_START, "hello ", 0, 6, IDs); testTextAtOffset(1, BOUNDARY_WORD_START, "hello ", 0, 6, IDs);

Просмотреть файл

@ -18,41 +18,11 @@
// __B__r__a__v__e__ __S__i__r__ __ __R__o__b__i__n__ __ __ __r__a__n // __B__r__a__v__e__ __S__i__r__ __ __R__o__b__i__n__ __ __ __r__a__n
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
////////////////////////////////////////////////////////////////////////
// characterCount
testCharacterCount(["input", "div", "editable"], 22);
testCharacterCount(["textarea"], 23);
////////////////////////////////////////////////////////////////////////
// getText
var IDs = ["input", "div", "editable", "textarea"];
testText(IDs, 0, 1, "B");
testText(IDs, 5, 6, " ");
testText(IDs, 9, 11, " ");
testText(IDs, 16, 19, " ");
testText(IDs, 0, 22, "Brave Sir Robin ran");
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// getTextAfterOffset // getTextAfterOffset
var IDs = [ "input", "div", "editable", "textarea" ]; var IDs = [ "input", "div", "editable", "textarea" ];
// BOUNDARY_CHAR
testCharAfterOffset(IDs, 0, "r", 1, 2);
testCharAfterOffset(IDs, 1, "a", 2, 3);
testCharAfterOffset(IDs, 4, " ", 5, 6);
testCharAfterOffset(IDs, 5, "S", 6, 7);
testCharAfterOffset(IDs, 8, " ", 9, 10);
testCharAfterOffset(IDs, 9, " ", 10, 11);
testCharAfterOffset(IDs, 10, "R", 11, 12);
testCharAfterOffset(IDs, 15, " ", 16, 17);
testCharAfterOffset(IDs, 16, " ", 17, 18);
testCharAfterOffset(IDs, 17, " ", 18, 19);
testCharAfterOffset(IDs, 18, "r", 19, 20);
// BOUNDARY_WORD_START // BOUNDARY_WORD_START
testTextAfterOffset(0, BOUNDARY_WORD_START, "Sir ", 6, 11, IDs); testTextAfterOffset(0, BOUNDARY_WORD_START, "Sir ", 6, 11, IDs);
testTextAfterOffset(5, BOUNDARY_WORD_START, "Sir ", 6, 11, IDs); testTextAfterOffset(5, BOUNDARY_WORD_START, "Sir ", 6, 11, IDs);
@ -122,15 +92,6 @@
var IDs = [ "input", "div", "editable", "textarea" ]; var IDs = [ "input", "div", "editable", "textarea" ];
// BOUNDARY_CHAR
testCharBeforeOffset(IDs, 0, "", 0, 0);
testCharBeforeOffset(IDs, 1, "B", 0, 1);
testCharBeforeOffset(IDs, 6, " ", 5, 6);
testCharBeforeOffset(IDs, 10, " ", 9, 10);
testCharBeforeOffset(IDs, 11, " ", 10, 11);
testCharBeforeOffset(IDs, 17, " ", 16, 17);
testCharBeforeOffset(IDs, 19, " ", 18, 19);
// BOUNDARY_WORD_START // BOUNDARY_WORD_START
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0, IDs); testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0, IDs);
testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0, IDs); testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0, IDs);
@ -169,38 +130,6 @@
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// getTextAtOffset // getTextAtOffset
// BOUNDARY_CHAR
testTextAtOffset(0, BOUNDARY_CHAR, "B", 0, 1,
"input", kOk, kOk, kOk,
"div", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
testTextAtOffset(1, BOUNDARY_CHAR, "r", 1, 2,
"input", kOk, kOk, kOk,
"div", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
testTextAtOffset(5, BOUNDARY_CHAR, " ", 5, 6,
"input", kOk, kOk, kOk,
"div", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
testTextAtOffset(9, BOUNDARY_CHAR, " ", 9, 10,
"input", kOk, kOk, kOk,
"div", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
testTextAtOffset(10, BOUNDARY_CHAR, " ", 10, 11,
"input", kOk, kOk, kOk,
"div", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
testTextAtOffset(17, BOUNDARY_CHAR, " ", 17, 18,
"input", kOk, kOk, kOk,
"div", kOk, kOk, kOk,
"editable", kOk, kOk, kOk,
"textarea", kOk, kOk, kOk);
// BOUNDARY_WORD_START // BOUNDARY_WORD_START
testTextAtOffset(0, BOUNDARY_WORD_START, "Brave ", 0, 6, testTextAtOffset(0, BOUNDARY_WORD_START, "Brave ", 0, 6,
"input", kOk, kOk, kOk, "input", kOk, kOk, kOk,

Просмотреть файл

@ -16,9 +16,6 @@ ac_add_options --enable-stdcxx-compat
# by 2 MBs. # by 2 MBs.
STRIP_FLAGS="--strip-debug" STRIP_FLAGS="--strip-debug"
# PGO
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) @MOZ_OBJDIR@/_profile/pgo/profileserver.py 10'
# Needed to enable breakpad in application.ini # Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1 export MOZILLA_OFFICIAL=1

Просмотреть файл

@ -16,9 +16,6 @@ ac_add_options --enable-stdcxx-compat
# by 2 MBs. # by 2 MBs.
STRIP_FLAGS="--strip-debug" STRIP_FLAGS="--strip-debug"
# PGO
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) @MOZ_OBJDIR@/_profile/pgo/profileserver.py 10'
# Needed to enable breakpad in application.ini # Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1 export MOZILLA_OFFICIAL=1

Просмотреть файл

@ -1,8 +1,5 @@
. "$topsrcdir/b2g/config/mozconfigs/common" . "$topsrcdir/b2g/config/mozconfigs/common"
# for pgo
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL} ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging ac_add_options --enable-update-packaging
ac_add_options --enable-jemalloc ac_add_options --enable-jemalloc

Просмотреть файл

@ -2,22 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
################################################
# Parallel build on Windows with GNU make check
default::
ifeq (,$(findstring pymake,$(MAKE)))
ifeq ($(HOST_OS_ARCH),WINNT)
ifneq (1,$(NUMBER_OF_PROCESSORS))
@echo $(if $(findstring -j,$(value MAKEFLAGS)), \
$(error You are using GNU make to build Firefox with -jN on Windows. \
This will randomly deadlock. To compile a parallel build on Windows \
run "python -OO build/pymake/make.py -f client.mk build". \
See https://developer.mozilla.org/en/pymake for more details.))
endif
endif
endif
installer: installer:
@$(MAKE) -C browser/installer installer @$(MAKE) -C browser/installer installer

Просмотреть файл

@ -77,11 +77,11 @@
preference="privacy.donottrackheader.value" preference="privacy.donottrackheader.value"
onsynctopreference="return gPrivacyPane.setTrackingPrefs()" onsynctopreference="return gPrivacyPane.setTrackingPrefs()"
onsyncfrompreference="return gPrivacyPane.getTrackingPrefs()"> onsyncfrompreference="return gPrivacyPane.getTrackingPrefs()">
<radio id="dntnotrack" value="1" label="&dntTrackingNotOkay.label;" <radio id="dntnotrack" value="1" label="&dntTrackingNotOkay.label2;"
accesskey="&dntTrackingNotOkay.accesskey;" /> accesskey="&dntTrackingNotOkay.accesskey;" />
<radio id="dntdotrack" value="0" label="&dntTrackingOkay.label;" <radio id="dntdotrack" value="0" label="&dntTrackingOkay.label2;"
accesskey="&dntTrackingOkay.accesskey;" /> accesskey="&dntTrackingOkay.accesskey;" />
<radio id="dntnopref" value="-1" label="&dntTrackingNopref.label;" <radio id="dntnopref" value="-1" label="&dntTrackingNopref.label2;"
accesskey="&dntTrackingNopref.accesskey;" /> accesskey="&dntTrackingNopref.accesskey;" />
</radiogroup> </radiogroup>
<label class="text-link" id="doNotTrackInfo" <label class="text-link" id="doNotTrackInfo"

Просмотреть файл

@ -88,11 +88,11 @@
preference="privacy.donottrackheader.value" preference="privacy.donottrackheader.value"
onsynctopreference="return gPrivacyPane.setTrackingPrefs()" onsynctopreference="return gPrivacyPane.setTrackingPrefs()"
onsyncfrompreference="return gPrivacyPane.getTrackingPrefs()"> onsyncfrompreference="return gPrivacyPane.getTrackingPrefs()">
<radio id="dntnotrack" value="1" label="&dntTrackingNotOkay.label;" <radio id="dntnotrack" value="1" label="&dntTrackingNotOkay.label2;"
accesskey="&dntTrackingNotOkay.accesskey;" /> accesskey="&dntTrackingNotOkay.accesskey;" />
<radio id="dntdotrack" value="0" label="&dntTrackingOkay.label;" <radio id="dntdotrack" value="0" label="&dntTrackingOkay.label2;"
accesskey="&dntTrackingOkay.accesskey;" /> accesskey="&dntTrackingOkay.accesskey;" />
<radio id="dntnopref" value="-1" label="&dntTrackingNopref.label;" <radio id="dntnopref" value="-1" label="&dntTrackingNopref.label2;"
accesskey="&dntTrackingNopref.accesskey;" /> accesskey="&dntTrackingNopref.accesskey;" />
</radiogroup> </radiogroup>
<label class="text-link" id="doNotTrackInfo" <label class="text-link" id="doNotTrackInfo"

Просмотреть файл

@ -7,9 +7,7 @@ ac_add_options --enable-official-branding
# Avoid dependency on libstdc++ 4.5 # Avoid dependency on libstdc++ 4.5
ac_add_options --enable-stdcxx-compat ac_add_options --enable-stdcxx-compat
# PGO
mk_add_options MOZ_PGO=1 mk_add_options MOZ_PGO=1
mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 $(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
# Needed to enable breakpad in application.ini # Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1 export MOZILLA_OFFICIAL=1

Просмотреть файл

@ -17,9 +17,6 @@ ac_add_options --enable-stdcxx-compat
# by 2 MBs. # by 2 MBs.
STRIP_FLAGS="--strip-debug" STRIP_FLAGS="--strip-debug"
# PGO
mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 $(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
# Needed to enable breakpad in application.ini # Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1 export MOZILLA_OFFICIAL=1

Просмотреть файл

@ -9,9 +9,6 @@ ac_add_options --enable-stdcxx-compat
# Needed to enable breakpad in application.ini # Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1 export MOZILLA_OFFICIAL=1
# PGO
mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 $(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
#Use ccache #Use ccache
ac_add_options --with-ccache=/usr/bin/ccache ac_add_options --with-ccache=/usr/bin/ccache

Просмотреть файл

@ -19,8 +19,6 @@ export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1 export MOZ_TELEMETRY_REPORTING=1
mk_add_options PROFILE_GEN_SCRIPT='$(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
#Use ccache #Use ccache
ac_add_options --with-ccache=/usr/bin/ccache ac_add_options --with-ccache=/usr/bin/ccache

Просмотреть файл

@ -7,9 +7,7 @@ ac_add_options --enable-official-branding
# Avoid dependency on libstdc++ 4.5 # Avoid dependency on libstdc++ 4.5
ac_add_options --enable-stdcxx-compat ac_add_options --enable-stdcxx-compat
# PGO
mk_add_options MOZ_PGO=1 mk_add_options MOZ_PGO=1
mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 $(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
# Needed to enable breakpad in application.ini # Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1 export MOZILLA_OFFICIAL=1

Просмотреть файл

@ -17,9 +17,6 @@ ac_add_options --enable-stdcxx-compat
# by 2 MBs. # by 2 MBs.
STRIP_FLAGS="--strip-debug" STRIP_FLAGS="--strip-debug"
# PGO
mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 $(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
# Needed to enable breakpad in application.ini # Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1 export MOZILLA_OFFICIAL=1

Просмотреть файл

@ -19,8 +19,6 @@ export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1 export MOZ_TELEMETRY_REPORTING=1
mk_add_options PROFILE_GEN_SCRIPT='$(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
#Use ccache #Use ccache
ac_add_options --with-ccache=/usr/bin/ccache ac_add_options --with-ccache=/usr/bin/ccache

Просмотреть файл

@ -1,8 +1,6 @@
. "$topsrcdir/browser/config/mozconfigs/common" . "$topsrcdir/browser/config/mozconfigs/common"
# for pgo
mk_add_options MOZ_PGO=1 mk_add_options MOZ_PGO=1
mk_add_options PROFILE_GEN_SCRIPT='$(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL} ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging ac_add_options --enable-update-packaging

Просмотреть файл

@ -1,8 +1,5 @@
. "$topsrcdir/browser/config/mozconfigs/common" . "$topsrcdir/browser/config/mozconfigs/common"
# for pgo
mk_add_options PROFILE_GEN_SCRIPT='$(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL} ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging ac_add_options --enable-update-packaging
ac_add_options --enable-jemalloc ac_add_options --enable-jemalloc

Просмотреть файл

@ -3,9 +3,6 @@
ac_add_options --target=x86_64-pc-mingw32 ac_add_options --target=x86_64-pc-mingw32
ac_add_options --host=x86_64-pc-mingw32 ac_add_options --host=x86_64-pc-mingw32
# for pgo
mk_add_options PROFILE_GEN_SCRIPT='$(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL} ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging ac_add_options --enable-update-packaging
ac_add_options --enable-jemalloc ac_add_options --enable-jemalloc

Просмотреть файл

@ -164,7 +164,6 @@ MOCHITEST_BROWSER_FILES += \
test-bug-593003-iframe-wrong-hud-iframe.html \ test-bug-593003-iframe-wrong-hud-iframe.html \
test-console-replaced-api.html \ test-console-replaced-api.html \
test-own-console.html \ test-own-console.html \
test-bug-595934-dom-events.html \
test-bug-595934-css-loader.html \ test-bug-595934-css-loader.html \
test-bug-595934-css-loader.css \ test-bug-595934-css-loader.css \
test-bug-595934-css-loader.css^headers^ \ test-bug-595934-css-loader.css^headers^ \
@ -177,8 +176,6 @@ MOCHITEST_BROWSER_FILES += \
test-bug-595934-workers.js \ test-bug-595934-workers.js \
test-bug-595934-dom-html-external.html \ test-bug-595934-dom-html-external.html \
test-bug-595934-dom-html-external.js \ test-bug-595934-dom-html-external.js \
test-bug-595934-dom-events-external2.html \
test-bug-595934-dom-events-external2.js \
test-bug-595934-canvas.html \ test-bug-595934-canvas.html \
test-bug-595934-canvas.js \ test-bug-595934-canvas.js \
test-bug-595934-css-parser.html \ test-bug-595934-css-parser.html \

Просмотреть файл

@ -16,21 +16,16 @@ const TESTS = [
matchString: "text/css", matchString: "text/css",
}, },
{ // #1 { // #1
file: "test-bug-595934-dom-events.html",
category: "DOM Events",
matchString: "preventBubble()",
},
{ // #2
file: "test-bug-595934-dom-html.html", file: "test-bug-595934-dom-html.html",
category: "DOM:HTML", category: "DOM:HTML",
matchString: "getElementById", matchString: "getElementById",
}, },
{ // #3 { // #2
file: "test-bug-595934-imagemap.html", file: "test-bug-595934-imagemap.html",
category: "ImageMap", category: "ImageMap",
matchString: "shape=\"rect\"", matchString: "shape=\"rect\"",
}, },
{ // #4 { // #3
file: "test-bug-595934-html.html", file: "test-bug-595934-html.html",
category: "HTML", category: "HTML",
matchString: "multipart/form-data", matchString: "multipart/form-data",
@ -39,58 +34,53 @@ const TESTS = [
form.submit(); form.submit();
}, },
}, },
{ // #5 { // #4
file: "test-bug-595934-workers.html", file: "test-bug-595934-workers.html",
category: "Web Worker", category: "Web Worker",
matchString: "fooBarWorker", matchString: "fooBarWorker",
expectError: true, expectError: true,
}, },
{ // #6 { // #5
file: "test-bug-595934-malformedxml.xhtml", file: "test-bug-595934-malformedxml.xhtml",
category: "malformed-xml", category: "malformed-xml",
matchString: "no element found", matchString: "no element found",
}, },
{ // #7 { // #6
file: "test-bug-595934-svg.xhtml", file: "test-bug-595934-svg.xhtml",
category: "SVG", category: "SVG",
matchString: "fooBarSVG", matchString: "fooBarSVG",
}, },
{ // #8 { // #7
file: "test-bug-595934-dom-html-external.html", file: "test-bug-595934-dom-html-external.html",
category: "DOM:HTML", category: "DOM:HTML",
matchString: "document.all", matchString: "document.all",
}, },
{ // #9 { // #8
file: "test-bug-595934-dom-events-external2.html",
category: "DOM Events",
matchString: "preventBubble()",
},
{ // #10
file: "test-bug-595934-canvas.html", file: "test-bug-595934-canvas.html",
category: "Canvas", category: "Canvas",
matchString: "strokeStyle", matchString: "strokeStyle",
}, },
{ // #11 { // #9
file: "test-bug-595934-css-parser.html", file: "test-bug-595934-css-parser.html",
category: "CSS Parser", category: "CSS Parser",
matchString: "foobarCssParser", matchString: "foobarCssParser",
}, },
{ // #12 { // #10
file: "test-bug-595934-malformedxml-external.html", file: "test-bug-595934-malformedxml-external.html",
category: "malformed-xml", category: "malformed-xml",
matchString: "</html>", matchString: "</html>",
}, },
{ // #13 { // #11
file: "test-bug-595934-empty-getelementbyid.html", file: "test-bug-595934-empty-getelementbyid.html",
category: "DOM", category: "DOM",
matchString: "getElementById", matchString: "getElementById",
}, },
{ // #14 { // #12
file: "test-bug-595934-canvas-css.html", file: "test-bug-595934-canvas-css.html",
category: "CSS Parser", category: "CSS Parser",
matchString: "foobarCanvasCssParser", matchString: "foobarCanvasCssParser",
}, },
{ // #15 { // #13
file: "test-bug-595934-image.html", file: "test-bug-595934-image.html",
category: "Image", category: "Image",
matchString: "corrupt", matchString: "corrupt",

Просмотреть файл

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Web Console test for bug 595934 - category: DOM Events.
(external script 2)</title>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<script type="text/javascript"
src="test-bug-595934-dom-events-external2.js"></script>
</head>
<body>
<p>Web Console test for bug 595934 - category "DOM Events" (external
script 2).</p>
</body>
</html>

Просмотреть файл

@ -1,10 +0,0 @@
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
window.addEventListener("DOMContentLoaded", function(aEvent) {
aEvent.preventBubble();
}, false);

Просмотреть файл

@ -1,17 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Web Console test for bug 595934 - category: DOM Events</title>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<script type="text/javascript"><!--
window.addEventListener("DOMContentLoaded", function(aEvent) {
aEvent.preventBubble();
}, false);
// --></script>
</head>
<body>
<p>Web Console test for bug 595934 - category "DOM Events".</p>
</body>
</html>

Просмотреть файл

@ -2,122 +2,122 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
# LOCALIZATION NOTE These strings are used inside the Inspector # LOCALIZATION NOTE These strings are used inside the Web Console
# which is available from the Web Developer sub-menu -> 'Inspect'. # command line which is available from the Web Developer sub-menu
# # -> 'Web Console'.
# These messages are displayed when an attempt is made to validate a
# page or a cache manifest using AppCacheUtils.jsm
# The correct localization of this file might be to keep it in # The correct localization of this file might be to keep it in
# English, or another language commonly spoken among web developers. # English, or another language commonly spoken among web developers.
# You want to make that choice consistent across the developer tools. # You want to make that choice consistent across the developer tools.
# A good criteria is the language in which you'd find the best # A good criteria is the language in which you'd find the best
# documentation on web development on the web. # documentation on web development on the web.
# LOCALIZATION NOTE (noManifest): Used when an attempt is made to validate a # LOCALIZATION NOTE (noManifest): the specified page has no cache manifest.
# page using AppCacheUtils.jsm that has no cache manifest.
noManifest=The specified page has no manifest. noManifest=The specified page has no manifest.
# LOCALIZATION NOTE (notUTF8): Used when an attempt is made to validate a # LOCALIZATION NOTE (notUTF8): the associated cache manifest has a character
# cache manifest using AppCacheUtils.jsm having a character encoding that is not # encoding that is not UTF-8. Parameters: %S is the current encoding.
# UTF-8.
notUTF8=Manifest has a character encoding of %S. Manifests must have the utf-8 character encoding. notUTF8=Manifest has a character encoding of %S. Manifests must have the utf-8 character encoding.
# LOCALIZATION NOTE (badMimeType): Used when an attempt is made to validate a # LOCALIZATION NOTE (badMimeType): the associated cache manifest has a
# cache manifest using AppCacheUtils.jsm having a mimetype that is not # mimetype that is not text/cache-manifest. Parameters: %S is the current
# text/cache-manifest. # mimetype.
badMimeType=Manifest has a mimetype of %S. Manifests must have a mimetype of text/cache-manifest. badMimeType=Manifest has a mimetype of %S. Manifests must have a mimetype of text/cache-manifest.
# LOCALIZATION NOTE (duplicateURI): Used when an attempt is made to validate a # LOCALIZATION NOTE (duplicateURI): the associated cache manifest references
# page using AppCacheUtils.jsm that has a cache manifest which references the # the same URI from multiple locations. Parameters: %1$S is the URI, %2$S is a
# same URI from multiple locations. # list of references to this URI.
duplicateURI=URI %S is referenced in multiple locations. This is not allowed: %S. duplicateURI=URI %1$S is referenced in multiple locations. This is not allowed: %2$S.
# LOCALIZATION NOTE (networkBlocksURI): Used when an attempt is made to validate # LOCALIZATION NOTE (networkBlocksURI, fallbackBlocksURI): the associated
# a page using AppCacheUtils.jsm that has a cache manifest which references the # cache manifest references the same URI in the NETWORK (or FALLBACK) section
# same URI in the NETWORK section as it does in other sections. # as it does in other sections. Parameters: %1$S is the line number, %2$S is
networkBlocksURI=NETWORK section line %S (%S) prevents caching of line %S (%S) in the %S section. # the resource name, %3$S is the line number, %4$S is the resource name, %5$S
# is the section name.
networkBlocksURI=NETWORK section line %1$S (%2$S) prevents caching of line %3$S (%4$S) in the %5$S section.
fallbackBlocksURI=FALLBACK section line %1$S (%2$S) prevents caching of line %3$S (%4$S) in the %5$S section.
# LOCALIZATION NOTE (fallbackBlocksURI): Used when an attempt is made to # LOCALIZATION NOTE (fileChangedButNotManifest): the associated cache manifest
# validate a page using AppCacheUtils.jsm that has a cache manifest which
# references the same URI in the FALLBACK section as it does in other sections.
fallbackBlocksURI=FALLBACK section line %S (%S) prevents caching of line %S (%S) in the %S section.
# LOCALIZATION NOTE (fileChangedButNotManifest): Used when an attempt is made to
# validate a page using AppCacheUtils.jsm that has a cache manifest which
# references a URI that has a file modified after the cache manifest. # references a URI that has a file modified after the cache manifest.
fileChangedButNotManifest=The file %S was modified after %S. Unless the text in the manifest file is changed the cached version will be used instead at line %S. # Parameters: %1$S is the resource name, %2$S is the cache manifest, %3$S is
# the line number.
fileChangedButNotManifest=The file %1$S was modified after %2$S. Unless the text in the manifest file is changed the cached version will be used instead at line %3$S.
# LOCALIZATION NOTE (cacheControlNoStore): Used when an attempt is made to # LOCALIZATION NOTE (cacheControlNoStore): the specified page has a header
# validate a page using AppCacheUtils.jsm that has a header preventing caching # preventing caching or storing information. Parameters: %1$S is the resource
# or storing information. # name, %2$S is the line number.
cacheControlNoStore=%S has cache-control set to no-store. This will prevent the application cache from storing the file at line %S. cacheControlNoStore=%1$S has cache-control set to no-store. This will prevent the application cache from storing the file at line %2$S.
# LOCALIZATION NOTE (notAvailable): Used when an attempt is made to validate a # LOCALIZATION NOTE (notAvailable): the specified resource is not available.
# page using AppCacheUtils.jsm that is not available. # Parameters: %1$S is the resource name, %2$S is the line number.
notAvailable=%S points to a resource that is not available at line %S. notAvailable=%1$S points to a resource that is not available at line %2$S.
# LOCALIZATION NOTE (invalidURI): Used when an invalid URI is passed to the # LOCALIZATION NOTE (invalidURI): it's used when an invalid URI is passed to
# appcache. # the appcache.
invalidURI=The URI passed to AppCacheUtils is invalid. invalidURI=The URI passed to AppCacheUtils is invalid.
# LOCALIZATION NOTE (noResults) Used when a search returns no results. # LOCALIZATION NOTE (noResults): it's used when a search returns no results.
noResults=Your search returned no results. noResults=Your search returned no results.
# LOCALIZATION NOTE (cacheDisabled) Used when the cache is disabled and an # LOCALIZATION NOTE (cacheDisabled): it's used when the cache is disabled and
# attempt is made to view offline data. # an attempt is made to view offline data.
cacheDisabled=Your disk cache is disabled. Please set browser.cache.disk.enable to true in about:config and try again. cacheDisabled=Your disk cache is disabled. Please set browser.cache.disk.enable to true in about:config and try again.
# LOCALIZATION NOTE (firstLineMustBeCacheManifest): Used when an attempt is made # LOCALIZATION NOTE (firstLineMustBeCacheManifest): the associated cache
# to validate a cache manifest using AppCacheUtils.jsm having a first line that # manifest has a first line that is not "CACHE MANIFEST". Parameters: %S is
# is not "CACHE MANIFEST." # the line number.
firstLineMustBeCacheManifest=The first line of the manifest must be "CACHE MANIFEST" at line %S. firstLineMustBeCacheManifest=The first line of the manifest must be "CACHE MANIFEST" at line %S.
# LOCALIZATION NOTE (cacheManifestOnlyFirstLine): Used when an attempt is made # LOCALIZATION NOTE (cacheManifestOnlyFirstLine): the associated cache
# to validate a cache manifest using AppCacheUtils.jsm having "CACHE MANIFEST" # manifest has "CACHE MANIFEST" on a line other than the first line.
# on a line other than the first line. # Parameters: %S is the line number where "CACHE MANIFEST" appears.
cacheManifestOnlyFirstLine="CACHE MANIFEST" is only valid on the first line at line %S. cacheManifestOnlyFirstLine="CACHE MANIFEST" is only valid on the first line at line %S.
# LOCALIZATION NOTE (asteriskInWrongSection): Used when an attempt is made # LOCALIZATION NOTE (asteriskInWrongSection): the associated cache manifest
# to validate a cache manifest using AppCacheUtils.jsm having an asterisk (*) in # has an asterisk (*) in a section other than the NETWORK section. Parameters:
# a section other than the network section. # %1$S is the section name, %2$S is the line number.
asteriskInWrongSection=Asterisk used as a wildcard in the %S section at line %S. A single line containing an asterisk is called the online whitelist wildcard flag and is only valid in the NETWORK section. Other uses of the * character are prohibited. The presence of this flag indicates that any URI not listed as cached is to be implicitly treated as being in the online whitelist namespaces. If the flag is not present then the blocking state indicates that URIs not listed explicitly in the manifest are to be treated as unavailable. asteriskInWrongSection=Asterisk used as a wildcard in the %1$S section at line %2$S. A single line containing an asterisk is called the online whitelist wildcard flag and is only valid in the NETWORK section. Other uses of the * character are prohibited. The presence of this flag indicates that any URI not listed as cached is to be implicitly treated as being in the online whitelist namespaces. If the flag is not present then the blocking state indicates that URIs not listed explicitly in the manifest are to be treated as unavailable.
# LOCALIZATION NOTE (escapeSpaces): Used when an attempt is made to validate a # LOCALIZATION NOTE (escapeSpaces): the associated cache manifest has a space
# cache manifest using AppCacheUtils.jsm having a space in a URI. Spaces are to # in a URI. Spaces must be replaced with %20. Parameters: %S is the line
# be replaced with %20. # number where this error occurs.
escapeSpaces=Spaces in URIs need to be replaced with %20 at line %S. escapeSpaces=Spaces in URIs need to be replaced with %20 at line %S.
# LOCALIZATION NOTE (slashDotDotSlashBad): Used when an attempt is made to # LOCALIZATION NOTE (slashDotDotSlashBad): the associated cache manifest has a
# validate a cache manifest using AppCacheUtils.jsm having a URI containing # URI containing /../, which is invalid. Parameters: %S is the line number
# /../, which is invalid. # where this error occurs.
slashDotDotSlashBad=/../ is not a valid URI prefix at line %S. slashDotDotSlashBad=/../ is not a valid URI prefix at line %S.
# LOCALIZATION NOTE (tooManyDotDotSlashes): Used when an attempt is made to # LOCALIZATION NOTE (tooManyDotDotSlashes): the associated cache manifest has
# validate a cache manifest using AppCacheUtils.jsm having a URI containing # a URI containing too many ../ operators. Too many of these operators mean
# too many ../ operators. Too many of these operaters mean that the file would # that the file would be below the root of the site, which is not possible.
# be below the root of the site, which is not possible. # Parameters: %S is the line number where this error occurs.
tooManyDotDotSlashes=Too many dot dot slash operators (../) at line %S. tooManyDotDotSlashes=Too many dot dot slash operators (../) at line %S.
# LOCALIZATION NOTE (fallbackUseSpaces): Used when an attempt is made to # LOCALIZATION NOTE (fallbackUseSpaces): the associated cache manifest has a
# validate a cache manifest using AppCacheUtils.jsm having a FALLBACK section # FALLBACK section containing more or less than the standard two URIs
# containing more or less than the standard two URIs seperated by a single # separated by a single space. Parameters: %S is the line number where this
# space. # error occurs.
fallbackUseSpaces=Only two URIs separated by spaces are allowed in the FALLBACK section at line %S. fallbackUseSpaces=Only two URIs separated by spaces are allowed in the FALLBACK section at line %S.
# LOCALIZATION NOTE (fallbackAsterisk): Used when an attempt is made to validate # LOCALIZATION NOTE (fallbackAsterisk): the associated cache manifest has a
# a cache manifest using AppCacheUtils.jsm having a FALLBACK section that # FALLBACK section that attempts to use an asterisk (*) as a wildcard. In this
# attempts to use an asterisk (*) as a wildcard. In this section the URI is # section the URI is simply a path prefix. Parameters: %S is the line number
# simply a path prefix. # where this error occurs.
fallbackAsterisk=Asterisk (*) incorrectly used as a wildcard in a fallback namespace at line %S. Namespaces simply need to match a path prefix. fallbackAsterisk=Asterisk (*) incorrectly used as a wildcard in a fallback namespace at line %S. Namespaces simply need to match a path prefix.
# LOCALIZATION NOTE (settingsBadValue): Used when an attempt is made to validate # LOCALIZATION NOTE (settingsBadValue): the associated cache manifest has a
# a cache manifest using AppCacheUtils.jsm having a SETTINGS section containing # SETTINGS section containing something other than the valid "prefer-online"
# something other than the valid "prefer-online" or "fast." # or "fast". Parameters: %S is the line number where this error occurs.
settingsBadValue=The SETTINGS section may only contain a single value, "prefer-online" or "fast" at line %S. settingsBadValue=The SETTINGS section may only contain a single value, "prefer-online" or "fast" at line %S.
# LOCALIZATION NOTE (invalidSectionName): Used when an attempt is made to # LOCALIZATION NOTE (invalidSectionName): the associated cache manifest
# validate a cache manifest using AppCacheUtils.jsm containing an invalid # contains an invalid section name. Parameters: %1$S is the section name, %2$S
# section name. # is the line number.
invalidSectionName=Invalid section name (%S) at line %S. invalidSectionName=Invalid section name (%1$S) at line %2$S.
# LOCALIZATION NOTE (entryNotFound): Used when an attempt is made to view a # LOCALIZATION NOTE (entryNotFound): the requested cache entry that does not
# cache entry that does not exist. # exist.
entryNotFound=Entry not found. entryNotFound=Entry not found.

Просмотреть файл

@ -4,11 +4,11 @@
<!ENTITY tracking.label "Tracking"> <!ENTITY tracking.label "Tracking">
<!ENTITY dntTrackingNopref.label "Do not tell sites anything about my tracking preferences."> <!ENTITY dntTrackingNopref.label2 "Do not tell sites anything about my tracking preferences">
<!ENTITY dntTrackingNopref.accesskey "o"> <!ENTITY dntTrackingNopref.accesskey "o">
<!ENTITY dntTrackingNotOkay.label "Tell sites that I do not want to be tracked."> <!ENTITY dntTrackingNotOkay.label2 "Tell sites that I do not want to be tracked">
<!ENTITY dntTrackingNotOkay.accesskey "n"> <!ENTITY dntTrackingNotOkay.accesskey "n">
<!ENTITY dntTrackingOkay.label "Tell sites that I want to be tracked."> <!ENTITY dntTrackingOkay.label2 "Tell sites that I want to be tracked">
<!ENTITY dntTrackingOkay.accesskey "t"> <!ENTITY dntTrackingOkay.accesskey "t">
<!ENTITY doNotTrackInfo.label "Learn More"> <!ENTITY doNotTrackInfo.label "Learn More">

Просмотреть файл

@ -70,14 +70,6 @@ Sidebar.prototype = {
}, },
// =========================== nsISidebar =========================== // =========================== nsISidebar ===========================
addPanel: function addPanel(aTitle, aContentURL, aCustomizeURL) {
// not supported
},
addPersistentPanel: function addPersistentPanel(aTitle, aContentURL, aCustomizeURL) {
// not supported
},
// The suggestedTitle and suggestedCategory parameters are ignored, but remain // The suggestedTitle and suggestedCategory parameters are ignored, but remain
// for backward compatibility. // for backward compatibility.
addSearchEngine: function addSearchEngine(engineURL, iconURL, suggestedTitle, addSearchEngine: function addSearchEngine(engineURL, iconURL, suggestedTitle,

Просмотреть файл

@ -82,7 +82,7 @@ def config_status(topobjdir = '.', topsrcdir = '.',
# Without -n, the current directory is meant to be the top object directory # Without -n, the current directory is meant to be the top object directory
if not options.not_topobjdir: if not options.not_topobjdir:
topobjdir = '.' topobjdir = os.path.abspath('.')
env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines, env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines,
non_global_defines=non_global_defines, substs=substs) non_global_defines=non_global_defines, substs=substs)

Просмотреть файл

@ -88,7 +88,7 @@ if not os.path.isabs(topsrcdir):
rel = os.path.join(os.path.dirname(<<<__file__>>>), topsrcdir) rel = os.path.join(os.path.dirname(<<<__file__>>>), topsrcdir)
topsrcdir = os.path.normpath(os.path.abspath(rel)) topsrcdir = os.path.normpath(os.path.abspath(rel))
topobjdir = os.path.dirname(<<<__file__>>>) topobjdir = os.path.abspath(os.path.dirname(<<<__file__>>>))
dnl All defines and substs are stored with an additional space at the beginning dnl All defines and substs are stored with an additional space at the beginning
dnl and at the end of the string, to avoid any problem with values starting or dnl and at the end of the string, to avoid any problem with values starting or

Просмотреть файл

@ -7,6 +7,21 @@ from __future__ import print_function, unicode_literals
import os import os
import platform import platform
import sys import sys
import time
STATE_DIR_FIRST_RUN = '''
mach and the build system store shared state in a common directory on the
filesystem. The following directory will be created:
{userdir}
If you would like to use a different directory, hit CTRL+c and set the
MOZBUILD_STATE_PATH environment variable to the directory you would like to
use and re-run mach. For this change to take effect forever, you'll likely
want to export this environment variable from your shell's init scripts.
'''.lstrip()
# TODO Bug 794506 Integrate with the in-tree virtualenv configuration. # TODO Bug 794506 Integrate with the in-tree virtualenv configuration.
SEARCH_PATHS = [ SEARCH_PATHS = [
@ -98,6 +113,39 @@ def bootstrap(topsrcdir, mozilla_dir=None):
print('You are running Python', platform.python_version()) print('You are running Python', platform.python_version())
sys.exit(1) sys.exit(1)
# Global build system and mach state is stored in a central directory. By
# default, this is ~/.mozbuild. However, it can be defined via an
# environment variable. We detect first run (by lack of this directory
# existing) and notify the user that it will be created. The logic for
# creation is much simpler for the "advanced" environment variable use
# case. For default behavior, we educate users and give them an opportunity
# to react. We always exit after creating the directory because users don't
# like surprises.
state_user_dir = os.path.expanduser('~/.mozbuild')
state_env_dir = os.environ.get('MOZBUILD_STATE_PATH', None)
if state_env_dir:
if not os.path.exists(state_env_dir):
print('Creating global state directory from environment variable: %s'
% state_env_dir)
os.makedirs(state_env_dir, mode=0777)
print('Please re-run mach.')
sys.exit(1)
else:
if not os.path.exists(state_user_dir):
print(STATE_DIR_FIRST_RUN.format(userdir=state_user_dir))
try:
for i in range(20, -1, -1):
time.sleep(1)
sys.stdout.write('%d ' % i)
sys.stdout.flush()
except KeyboardInterrupt:
sys.exit(1)
print('\nCreating default state directory: %s' % state_user_dir)
os.mkdir(state_user_dir)
print('Please re-run mach.')
sys.exit(1)
try: try:
import mach.main import mach.main
except ImportError: except ImportError:

Просмотреть файл

@ -64,7 +64,6 @@ robocop_DEST := $(CURDIR)
robocop_FILES := \ robocop_FILES := \
$(TESTPATH)/robocop.ini \ $(TESTPATH)/robocop.ini \
$(TESTPATH)/robocop_autophone.ini \ $(TESTPATH)/robocop_autophone.ini \
$(srcdir)/parse_ids.py \
$(NULL) $(NULL)
robocop-deps := $(notdir $(robocop_FILES)) robocop-deps := $(notdir $(robocop_FILES))
@ -81,10 +80,9 @@ GARBAGE += \
$(java-tests-dep) \ $(java-tests-dep) \
$(_JAVA_HARNESS) \ $(_JAVA_HARNESS) \
classes.dex \ classes.dex \
robocop.apk \
robocop.ap_ \ robocop.ap_ \
robocop-unsigned-unaligned.apk \ robocop-debug-signed.apk \
robocop-unaligned.apk \ robocop-debug-signed-unaligned.apk \
$(robocop-deps) \ $(robocop-deps) \
$(NULL) $(NULL)
@ -101,7 +99,7 @@ include $(topsrcdir)/config/android-common.mk
GENERATED_DIRS_tools = classes $(dir-tests) GENERATED_DIRS_tools = classes $(dir-tests)
tools:: $(robocop-deps) robocop.apk libs:: robocop-debug-signed.apk
classes.dex: robocop.ap_ classes.dex: robocop.ap_
classes.dex: $(robocop-deps) classes.dex: $(robocop-deps)
@ -110,10 +108,15 @@ classes.dex: $(java-tests-dep)
$(JAVAC) $(JAVAC_FLAGS) -d classes $(JAVAFILES) $(_JAVA_HARNESS) $(java-tests-dep) $(JAVAC) $(JAVAC_FLAGS) -d classes $(JAVAFILES) $(_JAVA_HARNESS) $(java-tests-dep)
$(DX) --dex --output=$@ classes $(ROBOTIUM_PATH) $(ANDROID_COMPT_LIB) $(DX) --dex --output=$@ classes $(ROBOTIUM_PATH) $(ANDROID_COMPT_LIB)
robocop.apk: $(robocop-deps) robocop.ap_ classes.dex
robocop.ap_: AndroidManifest.xml $(TESTPATH)/assets/* robocop.ap_: AndroidManifest.xml $(TESTPATH)/assets/*
$(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar -I . -S res -A $(TESTPATH)/assets -F $@ -J ./ $(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar -I . -S res -A $(TESTPATH)/assets -F $@ -J ./
robocop-debug-signed-unaligned.apk: robocop.ap_ classes.dex
$(APKBUILDER) $@ -v $(APKBUILDER_FLAGS) -z robocop.ap_ -f classes.dex
robocop-debug-signed.apk: robocop-debug-signed-unaligned.apk
$(ZIPALIGN) -f -v 4 $^ $@
# PP_java-tests not fully usable here # PP_java-tests not fully usable here
# Intermediate step toward a library rule. # Intermediate step toward a library rule.
$(dir-tests)/%.java: $(TESTPATH)/%.java.in $(call mkdir_deps,$(dir-tests)) $(dir-tests)/%.java: $(TESTPATH)/%.java.in $(call mkdir_deps,$(dir-tests))

Просмотреть файл

@ -7,3 +7,6 @@ http://code.google.com/p/robotium/
We are including robotium-solo-3.6.jar as a binary and are not modifying it in any way We are including robotium-solo-3.6.jar as a binary and are not modifying it in any way
from the original download found at: from the original download found at:
http://code.google.com/p/robotium/ http://code.google.com/p/robotium/
Firefox for Android developers should read the documentation in
mobile/android/base/tests/README.rst.

Просмотреть файл

@ -1,11 +0,0 @@
<!-- 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/. -->
<html>
<script>
setTimeout("window.close();", 1000);
</script>
<body>
</body>
</html>

Просмотреть файл

@ -1,177 +0,0 @@
#!/usr/bin/perl
# 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/.
use Cwd;
use File::Find ();
use POSIX qw(sys_wait_h);
sub kill_process {
my ($target_pid) = @_;
my $start_time = time;
# Try to kill and wait 10 seconds, then try a kill -9
my $sig;
for $sig ('TERM', 'KILL') {
print "kill $sig $target_pid\n";
kill $sig => $target_pid;
my $interval_start = time;
while (time - $interval_start < 10) {
# the following will work with 'cygwin' perl on win32, but not
# with 'MSWin32' (ActiveState) perl
my $pid = waitpid($target_pid, POSIX::WNOHANG());
if (($pid == $target_pid and POSIX::WIFEXITED($?)) or $pid == -1) {
my $secs = time - $start_time;
$secs = $secs == 1 ? '1 second' : "$secs seconds";
print "Process killed. Took $secs to die.\n";
return;
}
sleep 1;
}
}
die "Unable to kill process: $target_pid";
}
# Stripped down version of fork_and_log().
sub system_fork_and_log {
# Fork a sub process and log the output.
my ($cmd) = @_;
my $pid = fork; # Fork off a child process.
unless ($pid) { # child
exec { $cmd->[0] } @$cmd;
die "Could not exec()";
}
return $pid;
}
sub wait_for_pid {
# Wait for a process to exit or kill it if it takes too long.
my ($pid, $timeout_secs) = @_;
my ($exit_value, $signal_num, $dumped_core, $timed_out) = (0,0,0,0);
my $sig_name;
my $loop_count;
die ("Invalid timeout value passed to wait_for_pid()\n")
if ($timeout_secs <= 0);
eval {
$loop_count = 0;
while (++$loop_count < $timeout_secs) {
my $wait_pid = waitpid($pid, POSIX::WNOHANG());
# the following will work with 'cygwin' perl on win32, but not
# with 'MSWin32' (ActiveState) perl
last if ($wait_pid == $pid and POSIX::WIFEXITED($?)) or $wait_pid == -1;
sleep 1;
}
$exit_value = $? >> 8;
$signal_num = $? >> 127;
$dumped_core = $? & 128;
if ($loop_count >= $timeout_secs) {
die "timeout";
}
return "done";
};
if ($@) {
if ($@ =~ /timeout/) {
kill_process($pid);
$timed_out = 1;
} else { # Died for some other reason.
die; # Propagate the error up.
}
}
# $sig_name = $signal_num ? signal_name($signal_num) : '';
#
# return { timed_out=>$timed_out,
# exit_value=>$exit_value,
# sig_name=>$sig_name,
# dumped_core=>$dumped_core };
}
# System version of run_cmd().
sub run_system_cmd {
my ($cmd, $timeout_secs) = @_;
# print_log "cmd = $cmd\n";
my $pid = system_fork_and_log($cmd);
my $result = wait_for_pid($pid, $timeout_secs);
return $result;
}
#
# Given profile directory, find pref file hidden in salt directory.
# profile $Settings::MozProfileName must exist before calling this sub.
#
sub find_pref_file {
my $profile_dir = shift;
# default to *nix
my $pref_file = "prefs.js";
unless (-e $profile_dir) {
return; # empty list
}
my $found = undef;
my $sub = sub {$pref_file = $File::Find::name, $found++ if $pref_file eq $_};
File::Find::find($sub, $profile_dir);
unless ($found) {
return; # empty list
}
return $pref_file;
}
my $topdir = cwd();
chdir $ENV{OBJDIR};
my $app_name = `grep "MOZ_APP_NAME " config/autoconf.mk | sed "s/.*= //"`;
chomp($app_name);
# On mac, the app directory is the product name with the first
# letter capitalized
my $toolkit = `grep "MOZ_WIDGET_TOOLKIT " config/autoconf.mk |sed "s/.*= //"`;
chomp($toolkit);
if ($toolkit =~ /(mac|cocoa)/) {
my $app_dir = uc(substr($app_name, 0, 1)).substr($app_name, 1);
chdir "dist/$app_dir.app/Contents/MacOS";
} else {
chdir "dist/bin";
}
my $bin_suffix = "";
if ($toolkit =~ /(windows|os2)/) {
$bin_suffix = ".exe";
}
my $old_home = $ENV{HOME};
$ENV{HOME} = cwd();
# Create a profile to test with.
run_system_cmd(["./".$app_name.$bin_suffix, "-createProfile", "testprofile"], 45);
my $pref_file = find_pref_file(".mozilla/".$app_name);
open PREFS, ">>$pref_file";
# Add allow_scripts_to_close_windows; this lets us cleanly exit.
print PREFS "user_pref(\"dom.allow_scripts_to_close_windows\", true);\n";
# Suppress the default browser dialog since it keeps the test from starting.
print PREFS "user_pref(\"browser.shell.checkDefaultBrowser\", false);\n";
close PREFS;
# Run the pageload test.
run_system_cmd(["./".$app_name.$bin_suffix, $ENV{PAGELOAD_URL}."/loader.pl?maxcyc=2&delay=500&nocache=0&timeout=30000&auto=1"], 240);
# Start up again; this will gather data for reading global history and
# reading the fastload file.
run_system_cmd(["./".$app_name.$bin_suffix, "file://$topdir/build/profile_pageloader.html"], 45);
chdir $topdir;

Просмотреть файл

@ -17,6 +17,13 @@ if __name__ == '__main__':
gc.disable() gc.disable()
# This is meant as a temporary workaround until issues with many targets
# and prerequisites is addressed. Bug 874210 tracks.
try:
sys.setrecursionlimit(2 * sys.getrecursionlimit())
except Exception:
print >>sys.stderr, 'Unable to increase Python recursion limit.'
pymake.command.main(sys.argv[1:], os.environ, os.getcwd(), cb=sys.exit) pymake.command.main(sys.argv[1:], os.environ, os.getcwd(), cb=sys.exit)
pymake.process.ParallelContext.spin() pymake.process.ParallelContext.spin()
assert False, "Not reached" assert False, "Not reached"

Просмотреть файл

@ -82,7 +82,16 @@ endif
#################################### ####################################
# Sanity checks # Sanity checks
# Windows checks.
ifneq (,$(findstring mingw,$(CONFIG_GUESS))) ifneq (,$(findstring mingw,$(CONFIG_GUESS)))
# Require pymake (as opposed to GNU make).
ifndef .PYMAKE
$(error Pymake is required to build on Windows. Run |./mach build| to \
automatically use pymake. Or, invoke pymake directly via \
|python build/pymake/make.py|.)
endif
# check for CRLF line endings # check for CRLF line endings
ifneq (0,$(shell $(PERL) -e 'binmode(STDIN); while (<STDIN>) { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR)/client.mk)) ifneq (0,$(shell $(PERL) -e 'binmode(STDIN); while (<STDIN>) { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR)/client.mk))
$(error This source tree appears to have Windows-style line endings. To \ $(error This source tree appears to have Windows-style line endings. To \
@ -188,12 +197,6 @@ everything: clean build
#################################### ####################################
# Profile-Guided Optimization # Profile-Guided Optimization
# To use this, you should set the following variables in your mozconfig
# mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
#
# The profile script should exercise the functionality to be included
# in the profile feedback.
#
# This is up here, outside of the MOZ_CURRENT_PROJECT logic so that this # This is up here, outside of the MOZ_CURRENT_PROJECT logic so that this
# is usable in multi-pass builds, where you might not have a runnable # is usable in multi-pass builds, where you might not have a runnable
# application until all the build passes and postflight scripts have run. # application until all the build passes and postflight scripts have run.
@ -207,7 +210,7 @@ profiledbuild::
$(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_GENERATE=1 MOZ_PGO_INSTRUMENTED=1 $(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_GENERATE=1 MOZ_PGO_INSTRUMENTED=1
$(MAKE) -C $(PGO_OBJDIR) package MOZ_PGO_INSTRUMENTED=1 MOZ_INTERNAL_SIGNING_FORMAT= MOZ_EXTERNAL_SIGNING_FORMAT= $(MAKE) -C $(PGO_OBJDIR) package MOZ_PGO_INSTRUMENTED=1 MOZ_INTERNAL_SIGNING_FORMAT= MOZ_EXTERNAL_SIGNING_FORMAT=
rm -f ${PGO_OBJDIR}/jarlog/en-US.log rm -f ${PGO_OBJDIR}/jarlog/en-US.log
MOZ_PGO_INSTRUMENTED=1 OBJDIR=${PGO_OBJDIR} JARLOG_FILE=${PGO_OBJDIR}/jarlog/en-US.log $(PROFILE_GEN_SCRIPT) MOZ_PGO_INSTRUMENTED=1 JARLOG_FILE=jarlog/en-US.log EXTRA_TEST_ARGS=10 $(MAKE) -C $(PGO_OBJDIR) pgo-profile-run
$(MAKE) -f $(TOPSRCDIR)/client.mk maybe_clobber_profiledbuild $(MAKE) -f $(TOPSRCDIR)/client.mk maybe_clobber_profiledbuild
$(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_USE=1 $(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_USE=1

Просмотреть файл

@ -66,6 +66,17 @@ endif
USE_AUTOTARGETS_MK = 1 USE_AUTOTARGETS_MK = 1
include $(topsrcdir)/config/makefiles/makeutils.mk include $(topsrcdir)/config/makefiles/makeutils.mk
# Only build with Pymake (not GNU make) on Windows.
ifeq ($(HOST_OS_ARCH),WINNT)
ifndef L10NBASEDIR
ifndef .PYMAKE
$(error Pymake is required to build on Windows. Run |./mach build| to \
automatically use pymake or invoke pymake directly via \
|python build/pymake/make.py|.)
endif
endif
endif
ifdef SDK_HEADERS ifdef SDK_HEADERS
_EXTRA_EXPORTS := $(filter-out $(EXPORTS),$(SDK_HEADERS)) _EXTRA_EXPORTS := $(filter-out $(EXPORTS),$(SDK_HEADERS))
EXPORTS += $(_EXTRA_EXPORTS) EXPORTS += $(_EXTRA_EXPORTS)
@ -615,8 +626,14 @@ endif
# per traversal, hence the ifdef and the export. This rule needs to come before # per traversal, hence the ifdef and the export. This rule needs to come before
# other rules for the default target or else it may not run in time. # other rules for the default target or else it may not run in time.
ifndef MOZBUILD_BACKEND_CHECKED ifndef MOZBUILD_BACKEND_CHECKED
default::
$(MAKE) -C $(DEPTH) backend.RecursiveMakeBackend.built $(DEPTH)/backend.RecursiveMakeBackend.built:
@echo "Build configuration changed. Regenerating backend."
@cd $(DEPTH) && $(PYTHON) ./config.status
include $(DEPTH)/backend.RecursiveMakeBackend.built.pp
default:: $(DEPTH)/backend.RecursiveMakeBackend.built
export MOZBUILD_BACKEND_CHECKED=1 export MOZBUILD_BACKEND_CHECKED=1
endif endif
@ -1610,6 +1627,21 @@ endif
endif endif
endif endif
ifneq (,$(filter export,$(MAKECMDGOALS)))
MDDEPEND_FILES := $(strip $(wildcard $(addprefix $(MDDEPDIR)/,$(EXTRA_EXPORT_MDDEPEND_FILES))))
ifneq (,$(MDDEPEND_FILES))
ifdef .PYMAKE
includedeps $(MDDEPEND_FILES)
else
include $(MDDEPEND_FILES)
endif
endif
endif
############################################################################# #############################################################################
-include $(topsrcdir)/$(MOZ_BUILD_APP)/app-rules.mk -include $(topsrcdir)/$(MOZ_BUILD_APP)/app-rules.mk

Просмотреть файл

@ -61,6 +61,7 @@ EventSource::EventSource() :
mGoingToDispatchAllMessages(false), mGoingToDispatchAllMessages(false),
mWithCredentials(false), mWithCredentials(false),
mWaitingForOnStopRequest(false), mWaitingForOnStopRequest(false),
mInterrupted(false),
mLastConvertionResult(NS_OK), mLastConvertionResult(NS_OK),
mReadyState(CONNECTING), mReadyState(CONNECTING),
mScriptLine(0), mScriptLine(0),
@ -341,6 +342,16 @@ EventSource::OnStartRequest(nsIRequest *aRequest,
rv = httpChannel->GetRequestSucceeded(&requestSucceeded); rv = httpChannel->GetRequestSucceeded(&requestSucceeded);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
uint32_t status;
rv = httpChannel->GetResponseStatus(&status);
NS_ENSURE_SUCCESS(rv, rv);
if (status == 204) {
mInterrupted = true;
DispatchFailConnection();
return NS_ERROR_ABORT;
}
nsAutoCString contentType; nsAutoCString contentType;
rv = httpChannel->GetContentType(contentType); rv = httpChannel->GetContentType(contentType);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
@ -970,7 +981,7 @@ EventSource::ConsoleError()
NS_ConvertUTF8toUTF16 specUTF16(targetSpec); NS_ConvertUTF8toUTF16 specUTF16(targetSpec);
const PRUnichar *formatStrings[] = { specUTF16.get() }; const PRUnichar *formatStrings[] = { specUTF16.get() };
if (mReadyState == CONNECTING) { if (mReadyState == CONNECTING && !mInterrupted) {
rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties", rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
NS_LITERAL_STRING("connectionFailure").get(), NS_LITERAL_STRING("connectionFailure").get(),
formatStrings, ArrayLength(formatStrings)); formatStrings, ArrayLength(formatStrings));

Просмотреть файл

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

Просмотреть файл

@ -7,7 +7,6 @@
#define nsCCUncollectableMarker_h_ #define nsCCUncollectableMarker_h_
#include "nsIObserver.h" #include "nsIObserver.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
struct JSTracer; struct JSTracer;
@ -30,8 +29,8 @@ class nsCCUncollectableMarker MOZ_FINAL : public nsIObserver
return aGeneration && aGeneration == sGeneration; return aGeneration && aGeneration == sGeneration;
} }
static bool InGeneration(nsCycleCollectionTraversalCallback& aCb, template <class CCCallback>
uint32_t aGeneration) static bool InGeneration(CCCallback& aCb, uint32_t aGeneration)
{ {
return InGeneration(aGeneration) && !aCb.WantAllTraces(); return InGeneration(aGeneration) && !aCb.WantAllTraces();
} }

Просмотреть файл

@ -1725,20 +1725,20 @@ nsContentUtils::IsCallerChrome()
bool bool
nsContentUtils::IsCallerXBL() nsContentUtils::IsCallerXBL()
{ {
JSScript *script;
JSContext *cx = GetCurrentJSContext(); JSContext *cx = GetCurrentJSContext();
if (!cx) if (!cx)
return false; return false;
// New Hotness.
JSCompartment *c = js::GetContextCompartment(cx); JSCompartment *c = js::GetContextCompartment(cx);
if (xpc::AllowXBLScope(c))
return xpc::IsXBLScope(c);
// XBL scopes are behind a pref, so check the XBL bit as well. // For remote XUL, we run XBL in the XUL scope. Given that we care about
if (!JS_DescribeScriptedCaller(cx, &script, nullptr) || !script) // compat and not security for remote XUL, just always claim to be XBL.
return false; if (!xpc::AllowXBLScope(c)) {
return JS_GetScriptUserBit(script); MOZ_ASSERT(nsContentUtils::AllowXULXBLForPrincipal(xpc::GetCompartmentPrincipal(c)));
return true;
}
return xpc::IsXBLScope(c);
} }
@ -6027,17 +6027,6 @@ public:
{ {
} }
NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root)
{
}
NS_IMETHOD_(void) NoteJSRoot(void* root)
{
}
NS_IMETHOD_(void) NoteNativeRoot(void* root,
nsCycleCollectionParticipant* helper)
{
}
NS_IMETHOD_(void) NoteJSChild(void* child) NS_IMETHOD_(void) NoteJSChild(void* child)
{ {
if (child == mWrapper) { if (child == mWrapper) {
@ -6056,10 +6045,6 @@ public:
{ {
} }
NS_IMETHOD_(void) NoteWeakMapping(void* map, void* key, void* kdelegate, void* val)
{
}
bool mFound; bool mFound;
private: private:

Просмотреть файл

@ -493,6 +493,8 @@ MOCHITEST_FILES_B = \
accesscontrol.resource^headers^ \ accesscontrol.resource^headers^ \
invalid_accesscontrol.resource \ invalid_accesscontrol.resource \
invalid_accesscontrol.resource^headers^ \ invalid_accesscontrol.resource^headers^ \
file_bug869432.eventsource \
file_bug869432.eventsource^headers^ \
$(NULL) $(NULL)
MOCHITEST_FILES_C= \ MOCHITEST_FILES_C= \

Просмотреть файл

@ -0,0 +1,4 @@
retry:500
data: data

Просмотреть файл

@ -0,0 +1,3 @@
HTTP 304 NO CONTENT (CLOSE)
Content-Type: text/event-stream
Cache-Control: no-cache, must-revalidate

Просмотреть файл

@ -53,7 +53,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
function runAllTests() { function runAllTests() {
// these tests run asynchronously, and they will take 8000 ms // these tests run asynchronously, and they will take 8000 ms
var all_tests = [ var all_tests = [
doTest1, doTest1_e, doTest2, doTest3, doTest3_b, doTest3_c, doTest3_d, doTest1, doTest1_e, doTest1_f, doTest2, doTest3, doTest3_b, doTest3_c, doTest3_d,
doTest3_e, doTest3_f, doTest3_g, doTest3_h, doTest4, doTest4_b, doTest3_e, doTest3_f, doTest3_g, doTest3_h, doTest4, doTest4_b,
doTest5, doTest5_b, doTest5_c, doTest5_e, doTest6, doTest7 doTest5, doTest5_b, doTest5_c, doTest5_e, doTest6, doTest7
]; ];
@ -92,7 +92,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
var domBranch; var domBranch;
var oldPrefVal; var oldPrefVal;
var gEventSourceObj1 = null, gEventSourceObj1_e; var gEventSourceObj1 = null, gEventSourceObj1_e, gEventSourceObj1_f;
var gEventSourceObj2 = null; var gEventSourceObj2 = null;
var gEventSourceObj3_a = null, gEventSourceObj3_b = null, var gEventSourceObj3_a = null, gEventSourceObj3_b = null,
gEventSourceObj3_c = null, gEventSourceObj3_d = null, gEventSourceObj3_c = null, gEventSourceObj3_d = null,
@ -121,6 +121,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
// c) the close method (we expect readyState == CLOSED) // c) the close method (we expect readyState == CLOSED)
// d) the close method (we expect no message events anymore) // d) the close method (we expect no message events anymore)
// e) use the default for withCredentials when passing dictionary arguments that don't explicitly set it // e) use the default for withCredentials when passing dictionary arguments that don't explicitly set it
// f) if a 204 HTTP response closes (interrupts) connections. See bug 869432.
function doTest1(test_id) { function doTest1(test_id) {
gEventSourceObj1 = new EventSource("eventsource.resource"); gEventSourceObj1 = new EventSource("eventsource.resource");
@ -181,6 +182,30 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
setTestHasFinished(test_id); setTestHasFinished(test_id);
} }
function doTest1_f(test_id) {
var called_on_error = false;
gEventSourceObj1_f = new EventSource("file_bug869432.eventsource");
gEventSourceObj1_f.onopen = function(e) {
ok(false, "Test 1.f failed: onopen was called");
};
gEventSourceObj1_f.onmessage = function(e) {
ok(false, "Test 1.f failed: onmessage was called");
};
gEventSourceObj1_f.onerror = function(e) {
if (called_on_error) {
ok(false, "Test 1.f failed: onerror was called twice");
}
called_on_error = true;
ok(gEventSourceObj1_f.readyState == 2, "Test 1.f failed: onerror was called with readyState = " + gEventSourceObj1_f.readyState);
};
setTimeout(function() { // just to clean...
ok(called_on_error, "Test 1.f failed: onerror was not called");
setTestHasFinished(test_id);
}, parseInt(5000*stress_factor));
}
// in order to test (2) // in order to test (2)
// a) set a eventsource that give the dom events messages // a) set a eventsource that give the dom events messages
// b) expect trusted events // b) expect trusted events

Просмотреть файл

@ -8,10 +8,6 @@
#include "nsGUIEvent.h" #include "nsGUIEvent.h"
#include "nsIContent.h" #include "nsIContent.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "DictionaryHelpers.h"
#include "nsDOMClassInfoID.h"
DOMCI_DATA(WheelEvent, mozilla::dom::DOMWheelEvent)
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
@ -50,7 +46,6 @@ NS_IMPL_RELEASE_INHERITED(DOMWheelEvent, nsDOMMouseEvent)
NS_INTERFACE_MAP_BEGIN(DOMWheelEvent) NS_INTERFACE_MAP_BEGIN(DOMWheelEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMWheelEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMWheelEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WheelEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
NS_IMETHODIMP NS_IMETHODIMP
@ -150,28 +145,6 @@ GetModifierList(bool aCtrl, bool aShift, bool aAlt, bool aMeta,
} }
} }
nsresult
DOMWheelEvent::InitFromCtor(const nsAString& aType,
JSContext* aCx, JS::Value* aVal)
{
mozilla::idl::WheelEventInit d;
nsresult rv = d.Init(aCx, aVal);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString modifierList;
GetModifierList(d.ctrlKey, d.shiftKey, d.altKey, d.metaKey, modifierList);
rv = InitWheelEvent(aType, d.bubbles, d.cancelable,
d.view, d.detail, d.screenX, d.screenY,
d.clientX, d.clientY, d.button, d.relatedTarget,
modifierList, d.deltaX, d.deltaY, d.deltaZ, d.deltaMode);
NS_ENSURE_SUCCESS(rv, rv);
static_cast<widget::WheelEvent*>(mEvent)->buttons = d.buttons;
return NS_OK;
}
already_AddRefed<DOMWheelEvent> already_AddRefed<DOMWheelEvent>
DOMWheelEvent::Constructor(const GlobalObject& aGlobal, DOMWheelEvent::Constructor(const GlobalObject& aGlobal,
const nsAString& aType, const nsAString& aType,

Просмотреть файл

@ -31,9 +31,6 @@ public:
// Forward to base class // Forward to base class
NS_FORWARD_TO_NSDOMMOUSEEVENT NS_FORWARD_TO_NSDOMMOUSEEVENT
virtual nsresult InitFromCtor(const nsAString& aType,
JSContext* aCx, JS::Value* aVal);
static static
already_AddRefed<DOMWheelEvent> Constructor(const GlobalObject& aGlobal, already_AddRefed<DOMWheelEvent> Constructor(const GlobalObject& aGlobal,
const nsAString& aType, const nsAString& aType,

Просмотреть файл

@ -5,9 +5,6 @@
#include "nsDOMAnimationEvent.h" #include "nsDOMAnimationEvent.h"
#include "nsGUIEvent.h" #include "nsGUIEvent.h"
#include "nsDOMClassInfoID.h"
#include "nsIClassInfo.h"
#include "nsIXPCScriptable.h"
nsDOMAnimationEvent::nsDOMAnimationEvent(mozilla::dom::EventTarget* aOwner, nsDOMAnimationEvent::nsDOMAnimationEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext *aPresContext, nsPresContext *aPresContext,
@ -36,11 +33,8 @@ nsDOMAnimationEvent::~nsDOMAnimationEvent()
} }
} }
DOMCI_DATA(AnimationEvent, nsDOMAnimationEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMAnimationEvent) NS_INTERFACE_MAP_BEGIN(nsDOMAnimationEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMAnimationEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMAnimationEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(AnimationEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMAnimationEvent, nsDOMEvent) NS_IMPL_ADDREF_INHERITED(nsDOMAnimationEvent, nsDOMEvent)

Просмотреть файл

@ -3,17 +3,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMClassInfoID.h"
#include "nsDOMBeforeUnloadEvent.h" #include "nsDOMBeforeUnloadEvent.h"
NS_IMPL_ADDREF_INHERITED(nsDOMBeforeUnloadEvent, nsDOMEvent) NS_IMPL_ADDREF_INHERITED(nsDOMBeforeUnloadEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMBeforeUnloadEvent, nsDOMEvent) NS_IMPL_RELEASE_INHERITED(nsDOMBeforeUnloadEvent, nsDOMEvent)
DOMCI_DATA(BeforeUnloadEvent, nsDOMBeforeUnloadEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMBeforeUnloadEvent) NS_INTERFACE_MAP_BEGIN(nsDOMBeforeUnloadEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMBeforeUnloadEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMBeforeUnloadEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(BeforeUnloadEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP NS_IMETHODIMP

Просмотреть файл

@ -7,8 +7,6 @@
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsClientRect.h" #include "nsClientRect.h"
#include "nsDOMDataTransfer.h" #include "nsDOMDataTransfer.h"
#include "DictionaryHelpers.h"
#include "nsDOMClassInfoID.h"
nsDOMClipboardEvent::nsDOMClipboardEvent(mozilla::dom::EventTarget* aOwner, nsDOMClipboardEvent::nsDOMClipboardEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsPresContext* aPresContext,
@ -33,11 +31,8 @@ nsDOMClipboardEvent::~nsDOMClipboardEvent()
} }
} }
DOMCI_DATA(ClipboardEvent, nsDOMClipboardEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMClipboardEvent) NS_INTERFACE_MAP_BEGIN(nsDOMClipboardEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMClipboardEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMClipboardEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(ClipboardEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMClipboardEvent, nsDOMEvent) NS_IMPL_ADDREF_INHERITED(nsDOMClipboardEvent, nsDOMEvent)
@ -56,33 +51,6 @@ nsDOMClipboardEvent::InitClipboardEvent(const nsAString & aType, bool aCanBubble
return NS_OK; return NS_OK;
} }
nsresult
nsDOMClipboardEvent::InitFromCtor(const nsAString& aType,
JSContext* aCx, jsval* aVal)
{
mozilla::idl::ClipboardEventInit d;
nsresult rv = d.Init(aCx, aVal);
NS_ENSURE_SUCCESS(rv, rv);
nsRefPtr<nsDOMDataTransfer> clipboardData;
if (mEventIsInternal) {
nsClipboardEvent* event = static_cast<nsClipboardEvent*>(mEvent);
if (event) {
// Always create a clipboardData for the copy event. If this is changed to
// support other types of events, make sure that read/write privileges are
// checked properly within nsDOMDataTransfer.
// If you change this, change then also Constructor!
clipboardData = new nsDOMDataTransfer(NS_COPY, false);
clipboardData->SetData(d.dataType, d.data);
}
}
rv = InitClipboardEvent(aType, d.bubbles, d.cancelable, clipboardData);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
already_AddRefed<nsDOMClipboardEvent> already_AddRefed<nsDOMClipboardEvent>
nsDOMClipboardEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal, nsDOMClipboardEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
const nsAString& aType, const nsAString& aType,
@ -101,7 +69,6 @@ nsDOMClipboardEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
// Always create a clipboardData for the copy event. If this is changed to // Always create a clipboardData for the copy event. If this is changed to
// support other types of events, make sure that read/write privileges are // support other types of events, make sure that read/write privileges are
// checked properly within nsDOMDataTransfer. // checked properly within nsDOMDataTransfer.
// If you change this, change then also InitFromCtor!
clipboardData = new nsDOMDataTransfer(NS_COPY, false); clipboardData = new nsDOMDataTransfer(NS_COPY, false);
clipboardData->SetData(aParam.mDataType, aParam.mData); clipboardData->SetData(aParam.mDataType, aParam.mData);
} }

Просмотреть файл

@ -26,9 +26,6 @@ public:
// Forward to base class // Forward to base class
NS_FORWARD_TO_NSDOMEVENT NS_FORWARD_TO_NSDOMEVENT
nsresult InitFromCtor(const nsAString& aType,
JSContext* aCx, jsval* aVal);
virtual JSObject* WrapObject(JSContext* aCx, virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
{ {

Просмотреть файл

@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMClassInfoID.h"
#include "nsDOMCommandEvent.h" #include "nsDOMCommandEvent.h"
nsDOMCommandEvent::nsDOMCommandEvent(mozilla::dom::EventTarget* aOwner, nsDOMCommandEvent::nsDOMCommandEvent(mozilla::dom::EventTarget* aOwner,
@ -29,11 +28,8 @@ nsDOMCommandEvent::~nsDOMCommandEvent()
} }
} }
DOMCI_DATA(CommandEvent, nsDOMCommandEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMCommandEvent) NS_INTERFACE_MAP_BEGIN(nsDOMCommandEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMCommandEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMCommandEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CommandEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMCommandEvent, nsDOMEvent) NS_IMPL_ADDREF_INHERITED(nsDOMCommandEvent, nsDOMEvent)

Просмотреть файл

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMCompositionEvent.h" #include "nsDOMCompositionEvent.h"
#include "nsDOMClassInfoID.h"
nsDOMCompositionEvent::nsDOMCompositionEvent(mozilla::dom::EventTarget* aOwner, nsDOMCompositionEvent::nsDOMCompositionEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsPresContext* aPresContext,
@ -45,11 +44,8 @@ nsDOMCompositionEvent::~nsDOMCompositionEvent()
NS_IMPL_ADDREF_INHERITED(nsDOMCompositionEvent, nsDOMUIEvent) NS_IMPL_ADDREF_INHERITED(nsDOMCompositionEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMCompositionEvent, nsDOMUIEvent) NS_IMPL_RELEASE_INHERITED(nsDOMCompositionEvent, nsDOMUIEvent)
DOMCI_DATA(CompositionEvent, nsDOMCompositionEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMCompositionEvent) NS_INTERFACE_MAP_BEGIN(nsDOMCompositionEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMCompositionEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMCompositionEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CompositionEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
NS_IMETHODIMP NS_IMETHODIMP

Просмотреть файл

@ -4,8 +4,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMDataContainerEvent.h" #include "nsDOMDataContainerEvent.h"
#include "nsDOMClassInfoID.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsIXPConnect.h"
nsDOMDataContainerEvent::nsDOMDataContainerEvent( nsDOMDataContainerEvent::nsDOMDataContainerEvent(
mozilla::dom::EventTarget* aOwner, mozilla::dom::EventTarget* aOwner,
@ -31,11 +31,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(nsDOMDataContainerEvent, nsDOMEvent) NS_IMPL_ADDREF_INHERITED(nsDOMDataContainerEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMDataContainerEvent, nsDOMEvent) NS_IMPL_RELEASE_INHERITED(nsDOMDataContainerEvent, nsDOMEvent)
DOMCI_DATA(DataContainerEvent, nsDOMDataContainerEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMDataContainerEvent) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMDataContainerEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMDataContainerEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMDataContainerEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(DataContainerEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP NS_IMETHODIMP

Просмотреть файл

@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMClassInfoID.h"
#include "nsDOMDeviceMotionEvent.h" #include "nsDOMDeviceMotionEvent.h"
#include "nsDOMClassInfoID.h"
using namespace mozilla; using namespace mozilla;
using namespace mozilla::dom; using namespace mozilla::dom;
@ -23,11 +23,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(nsDOMDeviceMotionEvent, nsDOMEvent) NS_IMPL_ADDREF_INHERITED(nsDOMDeviceMotionEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMDeviceMotionEvent, nsDOMEvent) NS_IMPL_RELEASE_INHERITED(nsDOMDeviceMotionEvent, nsDOMEvent)
DOMCI_DATA(DeviceMotionEvent, nsDOMDeviceMotionEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMDeviceMotionEvent) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMDeviceMotionEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMDeviceMotionEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMDeviceMotionEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(DeviceMotionEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP NS_IMETHODIMP

Просмотреть файл

@ -9,7 +9,6 @@
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsDOMDataTransfer.h" #include "nsDOMDataTransfer.h"
#include "nsIDragService.h" #include "nsIDragService.h"
#include "nsDOMClassInfoID.h"
nsDOMDragEvent::nsDOMDragEvent(mozilla::dom::EventTarget* aOwner, nsDOMDragEvent::nsDOMDragEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsPresContext* aPresContext,
@ -41,11 +40,8 @@ nsDOMDragEvent::~nsDOMDragEvent()
NS_IMPL_ADDREF_INHERITED(nsDOMDragEvent, nsDOMMouseEvent) NS_IMPL_ADDREF_INHERITED(nsDOMDragEvent, nsDOMMouseEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMDragEvent, nsDOMMouseEvent) NS_IMPL_RELEASE_INHERITED(nsDOMDragEvent, nsDOMMouseEvent)
DOMCI_DATA(DragEvent, nsDOMDragEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMDragEvent) NS_INTERFACE_MAP_BEGIN(nsDOMDragEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMDragEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMDragEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(DragEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
NS_IMETHODIMP NS_IMETHODIMP

Просмотреть файл

@ -128,7 +128,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMEvent)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEvent) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMEvent)
NS_INTERFACE_MAP_ENTRY(nsIJSNativeInitializer) NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIJSNativeInitializer, !IsDOMBinding())
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Event) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Event)
NS_INTERFACE_MAP_END NS_INTERFACE_MAP_END
@ -329,6 +329,7 @@ NS_IMETHODIMP
nsDOMEvent::Initialize(nsISupports* aOwner, JSContext* aCx, JSObject* aObj, nsDOMEvent::Initialize(nsISupports* aOwner, JSContext* aCx, JSObject* aObj,
const JS::CallArgs& aArgs) const JS::CallArgs& aArgs)
{ {
MOZ_ASSERT(!IsDOMBinding());
NS_ENSURE_TRUE(aArgs.length() >= 1, NS_ERROR_XPC_NOT_ENOUGH_ARGS); NS_ENSURE_TRUE(aArgs.length() >= 1, NS_ERROR_XPC_NOT_ENOUGH_ARGS);
bool trusted = false; bool trusted = false;
@ -471,50 +472,6 @@ nsDOMEvent::StopImmediatePropagation()
return NS_OK; return NS_OK;
} }
static nsIDocument* GetDocumentForReport(nsEvent* aEvent)
{
EventTarget* target = aEvent->currentTarget;
if (nsCOMPtr<nsINode> node = do_QueryInterface(target)) {
return node->OwnerDoc();
}
if (nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(target)) {
return window->GetExtantDoc();
}
return nullptr;
}
static void
ReportUseOfDeprecatedMethod(nsEvent* aEvent, nsIDOMEvent* aDOMEvent,
const char* aWarning)
{
nsCOMPtr<nsIDocument> doc(GetDocumentForReport(aEvent));
nsAutoString type;
aDOMEvent->GetType(type);
const PRUnichar *strings[] = { type.get() };
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
"DOM Events", doc,
nsContentUtils::eDOM_PROPERTIES,
aWarning,
strings, ArrayLength(strings));
}
NS_IMETHODIMP
nsDOMEvent::PreventBubble()
{
ReportUseOfDeprecatedMethod(mEvent, this, "UseOfPreventBubbleWarning");
return NS_OK;
}
NS_IMETHODIMP
nsDOMEvent::PreventCapture()
{
ReportUseOfDeprecatedMethod(mEvent, this, "UseOfPreventCaptureWarning");
return NS_OK;
}
NS_IMETHODIMP NS_IMETHODIMP
nsDOMEvent::GetIsTrusted(bool *aIsTrusted) nsDOMEvent::GetIsTrusted(bool *aIsTrusted)
{ {

Просмотреть файл

@ -227,8 +227,6 @@ protected:
NS_IMETHOD StopImmediatePropagation(void) { return _to StopImmediatePropagation(); } \ NS_IMETHOD StopImmediatePropagation(void) { return _to StopImmediatePropagation(); } \
NS_IMETHOD GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget) { return _to GetOriginalTarget(aOriginalTarget); } \ NS_IMETHOD GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget) { return _to GetOriginalTarget(aOriginalTarget); } \
NS_IMETHOD GetExplicitOriginalTarget(nsIDOMEventTarget** aExplicitOriginalTarget) { return _to GetExplicitOriginalTarget(aExplicitOriginalTarget); } \ NS_IMETHOD GetExplicitOriginalTarget(nsIDOMEventTarget** aExplicitOriginalTarget) { return _to GetExplicitOriginalTarget(aExplicitOriginalTarget); } \
NS_IMETHOD PreventBubble() { return _to PreventBubble(); } \
NS_IMETHOD PreventCapture() { return _to PreventCapture(); } \
NS_IMETHOD GetPreventDefault(bool* aRetval) { return _to GetPreventDefault(aRetval); } \ NS_IMETHOD GetPreventDefault(bool* aRetval) { return _to GetPreventDefault(aRetval); } \
NS_IMETHOD GetIsTrusted(bool* aIsTrusted) { return _to GetIsTrusted(aIsTrusted); } \ NS_IMETHOD GetIsTrusted(bool* aIsTrusted) { return _to GetIsTrusted(aIsTrusted); } \
NS_IMETHOD SetTarget(nsIDOMEventTarget *aTarget) { return _to SetTarget(aTarget); } \ NS_IMETHOD SetTarget(nsIDOMEventTarget *aTarget) { return _to SetTarget(aTarget); } \

Просмотреть файл

@ -6,7 +6,6 @@
#include "nsDOMMessageEvent.h" #include "nsDOMMessageEvent.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "jsapi.h" #include "jsapi.h"
#include "nsDOMClassInfoID.h"
using namespace mozilla; using namespace mozilla;
using namespace mozilla::dom; using namespace mozilla::dom;
@ -24,11 +23,8 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(nsDOMMessageEvent, nsDOMEvent)
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mData) NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mData)
NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTION_TRACE_END
DOMCI_DATA(MessageEvent, nsDOMMessageEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMMessageEvent) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMMessageEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMMessageEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMMessageEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MessageEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMMessageEvent, nsDOMEvent) NS_IMPL_ADDREF_INHERITED(nsDOMMessageEvent, nsDOMEvent)

Просмотреть файл

@ -7,8 +7,6 @@
#include "nsGUIEvent.h" #include "nsGUIEvent.h"
#include "nsIContent.h" #include "nsIContent.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "DictionaryHelpers.h"
#include "nsDOMClassInfoID.h"
using namespace mozilla; using namespace mozilla;
@ -65,11 +63,8 @@ nsDOMMouseEvent::~nsDOMMouseEvent()
NS_IMPL_ADDREF_INHERITED(nsDOMMouseEvent, nsDOMUIEvent) NS_IMPL_ADDREF_INHERITED(nsDOMMouseEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMMouseEvent, nsDOMUIEvent) NS_IMPL_RELEASE_INHERITED(nsDOMMouseEvent, nsDOMUIEvent)
DOMCI_DATA(MouseEvent, nsDOMMouseEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMMouseEvent) NS_INTERFACE_MAP_BEGIN(nsDOMMouseEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMMouseEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMMouseEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MouseEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
NS_IMETHODIMP NS_IMETHODIMP
@ -151,35 +146,6 @@ nsDOMMouseEvent::InitMouseEvent(const nsAString& aType,
} }
} }
nsresult
nsDOMMouseEvent::InitFromCtor(const nsAString& aType,
JSContext* aCx, JS::Value* aVal)
{
mozilla::idl::MouseEventInit d;
nsresult rv = d.Init(aCx, aVal);
NS_ENSURE_SUCCESS(rv, rv);
rv = InitMouseEvent(aType, d.bubbles, d.cancelable,
d.view, d.detail, d.screenX, d.screenY,
d.clientX, d.clientY,
d.ctrlKey, d.altKey, d.shiftKey, d.metaKey,
d.button, d.relatedTarget);
NS_ENSURE_SUCCESS(rv, rv);
switch(mEvent->eventStructType) {
case NS_MOUSE_EVENT:
case NS_MOUSE_SCROLL_EVENT:
case NS_WHEEL_EVENT:
case NS_DRAG_EVENT:
case NS_SIMPLE_GESTURE_EVENT:
static_cast<nsMouseEvent_base*>(mEvent)->buttons = d.buttons;
break;
default:
break;
}
return NS_OK;
}
already_AddRefed<nsDOMMouseEvent> already_AddRefed<nsDOMMouseEvent>
nsDOMMouseEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal, nsDOMMouseEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
const nsAString& aType, const nsAString& aType,

Просмотреть файл

@ -34,9 +34,6 @@ public:
return mozilla::dom::MouseEventBinding::Wrap(aCx, aScope, this); return mozilla::dom::MouseEventBinding::Wrap(aCx, aScope, this);
} }
virtual nsresult InitFromCtor(const nsAString& aType,
JSContext* aCx, JS::Value* aVal);
// Web IDL binding methods // Web IDL binding methods
virtual uint32_t Which() MOZ_OVERRIDE virtual uint32_t Which() MOZ_OVERRIDE
{ {

Просмотреть файл

@ -4,7 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMMouseScrollEvent.h" #include "nsDOMMouseScrollEvent.h"
#include "nsDOMClassInfoID.h"
nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(mozilla::dom::EventTarget* aOwner, nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsPresContext* aPresContext,
@ -46,11 +45,8 @@ nsDOMMouseScrollEvent::~nsDOMMouseScrollEvent()
NS_IMPL_ADDREF_INHERITED(nsDOMMouseScrollEvent, nsDOMMouseEvent) NS_IMPL_ADDREF_INHERITED(nsDOMMouseScrollEvent, nsDOMMouseEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMMouseScrollEvent, nsDOMMouseEvent) NS_IMPL_RELEASE_INHERITED(nsDOMMouseScrollEvent, nsDOMMouseEvent)
DOMCI_DATA(MouseScrollEvent, nsDOMMouseScrollEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMMouseScrollEvent) NS_INTERFACE_MAP_BEGIN(nsDOMMouseScrollEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMMouseScrollEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMMouseScrollEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MouseScrollEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
NS_IMETHODIMP NS_IMETHODIMP

Просмотреть файл

@ -4,7 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsDOMClassInfoID.h"
#include "nsDOMMutationEvent.h" #include "nsDOMMutationEvent.h"
class nsPresContext; class nsPresContext;
@ -28,11 +27,8 @@ nsDOMMutationEvent::~nsDOMMutationEvent()
} }
} }
DOMCI_DATA(MutationEvent, nsDOMMutationEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMMutationEvent) NS_INTERFACE_MAP_BEGIN(nsDOMMutationEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMMutationEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMMutationEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MutationEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMMutationEvent, nsDOMEvent) NS_IMPL_ADDREF_INHERITED(nsDOMMutationEvent, nsDOMEvent)

Просмотреть файл

@ -6,7 +6,6 @@
#include "nsError.h" #include "nsError.h"
#include "nsDOMNotifyAudioAvailableEvent.h" #include "nsDOMNotifyAudioAvailableEvent.h"
#include "nsDOMClassInfoID.h" // DOMCI_DATA, NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO
#include "nsContentUtils.h" // NS_DROP_JS_OBJECTS #include "nsContentUtils.h" // NS_DROP_JS_OBJECTS
#include "jsfriendapi.h" #include "jsfriendapi.h"
@ -34,8 +33,6 @@ nsDOMNotifyAudioAvailableEvent::nsDOMNotifyAudioAvailableEvent(EventTarget* aOwn
SetIsDOMBinding(); SetIsDOMBinding();
} }
DOMCI_DATA(NotifyAudioAvailableEvent, nsDOMNotifyAudioAvailableEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMNotifyAudioAvailableEvent, nsDOMEvent) NS_IMPL_ADDREF_INHERITED(nsDOMNotifyAudioAvailableEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMNotifyAudioAvailableEvent, nsDOMEvent) NS_IMPL_RELEASE_INHERITED(nsDOMNotifyAudioAvailableEvent, nsDOMEvent)
@ -55,7 +52,6 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMNotifyAudioAvailableEvent) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMNotifyAudioAvailableEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMNotifyAudioAvailableEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMNotifyAudioAvailableEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(NotifyAudioAvailableEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
nsDOMNotifyAudioAvailableEvent::~nsDOMNotifyAudioAvailableEvent() nsDOMNotifyAudioAvailableEvent::~nsDOMNotifyAudioAvailableEvent()

Просмотреть файл

@ -10,7 +10,6 @@
#include "nsClientRect.h" #include "nsClientRect.h"
#include "nsPaintRequest.h" #include "nsPaintRequest.h"
#include "nsIFrame.h" #include "nsIFrame.h"
#include "nsDOMClassInfoID.h"
nsDOMNotifyPaintEvent::nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner, nsDOMNotifyPaintEvent::nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsPresContext* aPresContext,
@ -28,11 +27,8 @@ nsDOMNotifyPaintEvent::nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
SetIsDOMBinding(); SetIsDOMBinding();
} }
DOMCI_DATA(NotifyPaintEvent, nsDOMNotifyPaintEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMNotifyPaintEvent) NS_INTERFACE_MAP_BEGIN(nsDOMNotifyPaintEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMNotifyPaintEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMNotifyPaintEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(NotifyPaintEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMNotifyPaintEvent, nsDOMEvent) NS_IMPL_ADDREF_INHERITED(nsDOMNotifyPaintEvent, nsDOMEvent)

Просмотреть файл

@ -9,9 +9,6 @@
#include "nsDOMScrollAreaEvent.h" #include "nsDOMScrollAreaEvent.h"
#include "nsGUIEvent.h" #include "nsGUIEvent.h"
#include "nsClientRect.h" #include "nsClientRect.h"
#include "nsDOMClassInfoID.h"
#include "nsIClassInfo.h"
#include "nsIXPCScriptable.h"
nsDOMScrollAreaEvent::nsDOMScrollAreaEvent(mozilla::dom::EventTarget* aOwner, nsDOMScrollAreaEvent::nsDOMScrollAreaEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext *aPresContext, nsPresContext *aPresContext,
@ -36,11 +33,8 @@ nsDOMScrollAreaEvent::~nsDOMScrollAreaEvent()
NS_IMPL_ADDREF_INHERITED(nsDOMScrollAreaEvent, nsDOMUIEvent) NS_IMPL_ADDREF_INHERITED(nsDOMScrollAreaEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMScrollAreaEvent, nsDOMUIEvent) NS_IMPL_RELEASE_INHERITED(nsDOMScrollAreaEvent, nsDOMUIEvent)
DOMCI_DATA(ScrollAreaEvent, nsDOMScrollAreaEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMScrollAreaEvent) NS_INTERFACE_MAP_BEGIN(nsDOMScrollAreaEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMScrollAreaEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMScrollAreaEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(ScrollAreaEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)

Просмотреть файл

@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMClassInfoID.h"
#include "nsDOMSimpleGestureEvent.h" #include "nsDOMSimpleGestureEvent.h"
nsDOMSimpleGestureEvent::nsDOMSimpleGestureEvent(mozilla::dom::EventTarget* aOwner, nsDOMSimpleGestureEvent::nsDOMSimpleGestureEvent(mozilla::dom::EventTarget* aOwner,
@ -36,11 +35,8 @@ nsDOMSimpleGestureEvent::~nsDOMSimpleGestureEvent()
NS_IMPL_ADDREF_INHERITED(nsDOMSimpleGestureEvent, nsDOMUIEvent) NS_IMPL_ADDREF_INHERITED(nsDOMSimpleGestureEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMSimpleGestureEvent, nsDOMUIEvent) NS_IMPL_RELEASE_INHERITED(nsDOMSimpleGestureEvent, nsDOMUIEvent)
DOMCI_DATA(SimpleGestureEvent, nsDOMSimpleGestureEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMSimpleGestureEvent) NS_INTERFACE_MAP_BEGIN(nsDOMSimpleGestureEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMSimpleGestureEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMSimpleGestureEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SimpleGestureEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
/* attribute unsigned long allowedDirections; */ /* attribute unsigned long allowedDirections; */

Просмотреть файл

@ -5,9 +5,6 @@
#include "nsDOMTouchEvent.h" #include "nsDOMTouchEvent.h"
#include "nsGUIEvent.h" #include "nsGUIEvent.h"
#include "nsDOMClassInfoID.h"
#include "nsIClassInfo.h"
#include "nsIXPCScriptable.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "nsPresContext.h" #include "nsPresContext.h"
@ -109,11 +106,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMTouchEvent, nsDOMUIEvent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChangedTouches) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChangedTouches)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
DOMCI_DATA(TouchEvent, nsDOMTouchEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMTouchEvent) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMTouchEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMTouchEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMTouchEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(TouchEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMTouchEvent, nsDOMUIEvent) NS_IMPL_ADDREF_INHERITED(nsDOMTouchEvent, nsDOMUIEvent)

Просмотреть файл

@ -5,9 +5,6 @@
#include "nsDOMTransitionEvent.h" #include "nsDOMTransitionEvent.h"
#include "nsGUIEvent.h" #include "nsGUIEvent.h"
#include "nsDOMClassInfoID.h"
#include "nsIClassInfo.h"
#include "nsIXPCScriptable.h"
nsDOMTransitionEvent::nsDOMTransitionEvent(mozilla::dom::EventTarget* aOwner, nsDOMTransitionEvent::nsDOMTransitionEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext *aPresContext, nsPresContext *aPresContext,
@ -36,11 +33,8 @@ nsDOMTransitionEvent::~nsDOMTransitionEvent()
} }
} }
DOMCI_DATA(TransitionEvent, nsDOMTransitionEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMTransitionEvent) NS_INTERFACE_MAP_BEGIN(nsDOMTransitionEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMTransitionEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMTransitionEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(TransitionEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMTransitionEvent, nsDOMEvent) NS_IMPL_ADDREF_INHERITED(nsDOMTransitionEvent, nsDOMEvent)

Просмотреть файл

@ -16,10 +16,8 @@
#include "nsEventStateManager.h" #include "nsEventStateManager.h"
#include "nsIFrame.h" #include "nsIFrame.h"
#include "nsIScrollableFrame.h" #include "nsIScrollableFrame.h"
#include "DictionaryHelpers.h"
#include "mozilla/Util.h" #include "mozilla/Util.h"
#include "mozilla/Assertions.h" #include "mozilla/Assertions.h"
#include "nsDOMClassInfoID.h"
using namespace mozilla; using namespace mozilla;
@ -104,11 +102,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(nsDOMUIEvent, nsDOMEvent) NS_IMPL_ADDREF_INHERITED(nsDOMUIEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMUIEvent, nsDOMEvent) NS_IMPL_RELEASE_INHERITED(nsDOMUIEvent, nsDOMEvent)
DOMCI_DATA(UIEvent, nsDOMUIEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMUIEvent) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMUIEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMUIEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMUIEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(UIEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
static nsIntPoint static nsIntPoint
@ -186,16 +181,6 @@ nsDOMUIEvent::InitUIEvent(const nsAString& typeArg,
return NS_OK; return NS_OK;
} }
nsresult
nsDOMUIEvent::InitFromCtor(const nsAString& aType,
JSContext* aCx, JS::Value* aVal)
{
mozilla::idl::UIEventInit d;
nsresult rv = d.Init(aCx, aVal);
NS_ENSURE_SUCCESS(rv, rv);
return InitUIEvent(aType, d.bubbles, d.cancelable, d.view, d.detail);
}
// ---- nsDOMNSUIEvent implementation ------------------- // ---- nsDOMNSUIEvent implementation -------------------
nsIntPoint nsIntPoint
nsDOMUIEvent::GetPagePoint() nsDOMUIEvent::GetPagePoint()

Просмотреть файл

@ -31,9 +31,6 @@ public:
NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType); NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType);
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter); NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter);
virtual nsresult InitFromCtor(const nsAString& aType,
JSContext* aCx, JS::Value* aVal);
static nsIntPoint CalculateScreenPoint(nsPresContext* aPresContext, static nsIntPoint CalculateScreenPoint(nsPresContext* aPresContext,
nsEvent* aEvent) nsEvent* aEvent)
{ {

Просмотреть файл

@ -4,7 +4,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMClassInfoID.h"
#include "nsDOMXULCommandEvent.h" #include "nsDOMXULCommandEvent.h"
nsDOMXULCommandEvent::nsDOMXULCommandEvent(mozilla::dom::EventTarget* aOwner, nsDOMXULCommandEvent::nsDOMXULCommandEvent(mozilla::dom::EventTarget* aOwner,
@ -36,11 +35,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMXULCommandEvent,
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourceEvent) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourceEvent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
DOMCI_DATA(XULCommandEvent, nsDOMXULCommandEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMXULCommandEvent) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMXULCommandEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMXULCommandEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMXULCommandEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(XULCommandEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
NS_IMETHODIMP NS_IMETHODIMP

Просмотреть файл

@ -18,7 +18,6 @@
#include "AudioChannelCommon.h" #include "AudioChannelCommon.h"
#include <algorithm> #include <algorithm>
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/dom/EnableWebAudioCheck.h"
static bool static bool
IsAudioAPIEnabled() IsAudioAPIEnabled()
@ -95,9 +94,7 @@ HTMLAudioElement::MozSetup(uint32_t aChannels, uint32_t aRate, ErrorResult& aRv)
return; return;
} }
if (dom::EnableWebAudioCheck::PrefEnabled()) { OwnerDoc()->WarnOnceAbout(nsIDocument::eMozAudioData);
OwnerDoc()->WarnOnceAbout(nsIDocument::eMozAudioData);
}
// If there is already a src provided, don't setup another stream // If there is already a src provided, don't setup another stream
if (mDecoder) { if (mDecoder) {

Просмотреть файл

@ -66,7 +66,6 @@
#include "nsIScriptError.h" #include "nsIScriptError.h"
#include "nsHostObjectProtocolHandler.h" #include "nsHostObjectProtocolHandler.h"
#include "MediaMetadataManager.h" #include "MediaMetadataManager.h"
#include "mozilla/dom/EnableWebAudioCheck.h"
#include "AudioChannelService.h" #include "AudioChannelService.h"
@ -3597,9 +3596,7 @@ NS_IMETHODIMP HTMLMediaElement::GetMozFragmentEnd(double* aTime)
void HTMLMediaElement::NotifyAudioAvailableListener() void HTMLMediaElement::NotifyAudioAvailableListener()
{ {
if (dom::EnableWebAudioCheck::PrefEnabled()) { OwnerDoc()->WarnOnceAbout(nsIDocument::eMozAudioData);
OwnerDoc()->WarnOnceAbout(nsIDocument::eMozAudioData);
}
if (mDecoder) { if (mDecoder) {
mDecoder->NotifyAudioAvailableListener(); mDecoder->NotifyAudioAvailableListener();
} }

Просмотреть файл

@ -10,8 +10,6 @@
#include "nsIDocument.h" #include "nsIDocument.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
DOMCI_DATA(SVGZoomEvent, mozilla::dom::SVGZoomEvent)
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {

Просмотреть файл

@ -425,8 +425,7 @@ nsXBLProtoImplField::InstallField(nsIScriptContext* aContext,
JS::Rooted<JS::Value> result(cx); JS::Rooted<JS::Value> result(cx);
JS::CompileOptions options(cx); JS::CompileOptions options(cx);
options.setFileAndLine(uriSpec.get(), mLineNumber) options.setFileAndLine(uriSpec.get(), mLineNumber)
.setVersion(JSVERSION_LATEST) .setVersion(JSVERSION_LATEST);
.setUserBit(true); // Flag us as XBL
rv = context->EvaluateString(nsDependentString(mFieldText, rv = context->EvaluateString(nsDependentString(mFieldText,
mFieldTextLength), mFieldTextLength),
wrappedNode, options, wrappedNode, options,

Просмотреть файл

@ -203,8 +203,7 @@ nsXBLProtoImplMethod::CompileMember(nsIScriptContext* aContext, const nsCString&
JS::CompileOptions options(cx); JS::CompileOptions options(cx);
options.setFileAndLine(functionUri.get(), options.setFileAndLine(functionUri.get(),
uncompiledMethod->mBodyText.GetLineNumber()) uncompiledMethod->mBodyText.GetLineNumber())
.setVersion(JSVERSION_LATEST) .setVersion(JSVERSION_LATEST);
.setUserBit(true); // Flag us as XBL
JS::RootedObject rootedNull(cx, nullptr); // See bug 781070. JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
JS::RootedObject methodObject(cx); JS::RootedObject methodObject(cx);
nsresult rv = nsJSUtils::CompileFunction(cx, rootedNull, options, cname, nsresult rv = nsJSUtils::CompileFunction(cx, rootedNull, options, cname,

Просмотреть файл

@ -216,8 +216,7 @@ nsXBLProtoImplProperty::CompileMember(nsIScriptContext* aContext, const nsCStrin
JSAutoCompartment ac(cx, aClassObject); JSAutoCompartment ac(cx, aClassObject);
JS::CompileOptions options(cx); JS::CompileOptions options(cx);
options.setFileAndLine(functionUri.get(), mGetterText->GetLineNumber()) options.setFileAndLine(functionUri.get(), mGetterText->GetLineNumber())
.setVersion(JSVERSION_LATEST) .setVersion(JSVERSION_LATEST);
.setUserBit(true); // Flag us as XBL
nsCString name = NS_LITERAL_CSTRING("get_") + NS_ConvertUTF16toUTF8(mName); nsCString name = NS_LITERAL_CSTRING("get_") + NS_ConvertUTF16toUTF8(mName);
JS::RootedObject rootedNull(cx, nullptr); // See bug 781070. JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
JS::RootedObject getterObject(cx); JS::RootedObject getterObject(cx);
@ -265,8 +264,7 @@ nsXBLProtoImplProperty::CompileMember(nsIScriptContext* aContext, const nsCStrin
JSAutoCompartment ac(cx, aClassObject); JSAutoCompartment ac(cx, aClassObject);
JS::CompileOptions options(cx); JS::CompileOptions options(cx);
options.setFileAndLine(functionUri.get(), mSetterText->GetLineNumber()) options.setFileAndLine(functionUri.get(), mSetterText->GetLineNumber())
.setVersion(JSVERSION_LATEST) .setVersion(JSVERSION_LATEST);
.setUserBit(true); // Flag us as XBL
nsCString name = NS_LITERAL_CSTRING("set_") + NS_ConvertUTF16toUTF8(mName); nsCString name = NS_LITERAL_CSTRING("set_") + NS_ConvertUTF16toUTF8(mName);
JS::RootedObject rootedNull(cx, nullptr); // See bug 781070. JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
JS::RootedObject setterObject(cx); JS::RootedObject setterObject(cx);

Просмотреть файл

@ -384,8 +384,7 @@ nsXBLPrototypeHandler::EnsureEventHandler(nsIScriptGlobalObject* aGlobal,
JSAutoCompartment ac(cx, scopeObject); JSAutoCompartment ac(cx, scopeObject);
JS::CompileOptions options(cx); JS::CompileOptions options(cx);
options.setFileAndLine(bindingURI.get(), mLineNumber) options.setFileAndLine(bindingURI.get(), mLineNumber)
.setVersion(JSVERSION_LATEST) .setVersion(JSVERSION_LATEST);
.setUserBit(true); // Flag us as XBL
JS::Rooted<JSObject*> rootedNull(cx); // See bug 781070. JS::Rooted<JSObject*> rootedNull(cx); // See bug 781070.
JS::Rooted<JSObject*> handlerFun(cx); JS::Rooted<JSObject*> handlerFun(cx);

Просмотреть файл

@ -25,18 +25,6 @@ XBL_DeserializeFunction(nsIScriptContext* aContext,
JS::MutableHandle<JSObject*> aFunctionObjectp) JS::MutableHandle<JSObject*> aFunctionObjectp)
{ {
AutoPushJSContext cx(aContext->GetNativeContext()); AutoPushJSContext cx(aContext->GetNativeContext());
nsresult rv = nsContentUtils::XPConnect()->ReadFunction(aStream, cx, return nsContentUtils::XPConnect()->ReadFunction(aStream, cx,
aFunctionObjectp.address()); aFunctionObjectp.address());
NS_ENSURE_SUCCESS(rv, rv);
// Mark the script as XBL.
//
// This might be more elegantly handled as a flag via the XPConnect serialization
// code, but that would involve profile compat issues between different builds.
// Given that we know this code is XBL, just flag it as such.
JSAutoRequest ar(cx);
JSFunction* fun = JS_ValueToFunction(cx, JS::ObjectValue(*aFunctionObjectp));
NS_ENSURE_TRUE(fun, NS_ERROR_UNEXPECTED);
JS_SetScriptUserBit(JS_GetFunctionScript(cx, fun), true);
return NS_OK;
} }

Просмотреть файл

@ -27,7 +27,6 @@ const DENY_ACTION = Ci.nsIPermissionManager.DENY_ACTION;
const PROMPT_ACTION = Ci.nsIPermissionManager.PROMPT_ACTION; const PROMPT_ACTION = Ci.nsIPermissionManager.PROMPT_ACTION;
// Permissions Matrix: https://docs.google.com/spreadsheet/ccc?key=0Akyz_Bqjgf5pdENVekxYRjBTX0dCXzItMnRyUU1RQ0E#gid=0 // Permissions Matrix: https://docs.google.com/spreadsheet/ccc?key=0Akyz_Bqjgf5pdENVekxYRjBTX0dCXzItMnRyUU1RQ0E#gid=0
// Also, keep in sync with https://mxr.mozilla.org/mozilla-central/source/extensions/cookie/Permission.txt
// Permissions that are implicit: // Permissions that are implicit:
// battery-status, network-information, vibration, // battery-status, network-information, vibration,

Просмотреть файл

@ -60,7 +60,6 @@
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsIDOMEvent.h" #include "nsIDOMEvent.h"
#include "nsIDOMKeyEvent.h"
#include "nsIDOMEventListener.h" #include "nsIDOMEventListener.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsDOMWindowUtils.h" #include "nsDOMWindowUtils.h"
@ -144,31 +143,9 @@
#include "nsIDOMPermissionSettings.h" #include "nsIDOMPermissionSettings.h"
#include "nsIDOMApplicationRegistry.h" #include "nsIDOMApplicationRegistry.h"
#ifdef MOZ_B2G_RIL
#include "nsIWifi.h"
#endif
// includes needed for the prototype chain interfaces // includes needed for the prototype chain interfaces
#include "nsIDOMNavigator.h" #include "nsIDOMNavigator.h"
#include "nsIDOMBarProp.h" #include "nsIDOMBarProp.h"
#include "nsIDOMDataContainerEvent.h"
#include "nsIDOMKeyEvent.h"
#include "nsIDOMCompositionEvent.h"
#include "nsIDOMMouseEvent.h"
#include "nsIDOMMouseScrollEvent.h"
#include "nsIDOMWheelEvent.h"
#include "nsIDOMDragEvent.h"
#include "nsIDOMClipboardEvent.h"
#include "nsIDOMCommandEvent.h"
#include "nsIDOMBeforeUnloadEvent.h"
#include "nsIDOMMutationEvent.h"
#include "nsIDOMXULCommandEvent.h"
#include "nsIDOMMessageEvent.h"
#include "nsIDOMNotifyPaintEvent.h"
#include "nsIDOMNotifyAudioAvailableEvent.h"
#include "nsIDOMScrollAreaEvent.h"
#include "nsIDOMTransitionEvent.h"
#include "nsIDOMAnimationEvent.h"
#include "nsIDOMDocumentXBL.h" #include "nsIDOMDocumentXBL.h"
#include "nsIDOMElementCSSInlineStyle.h" #include "nsIDOMElementCSSInlineStyle.h"
#include "nsIDOMLinkStyle.h" #include "nsIDOMLinkStyle.h"
@ -187,7 +164,7 @@
#define MOZ_GENERATED_EVENTS_INCLUDES #define MOZ_GENERATED_EVENTS_INCLUDES
#include "GeneratedEvents.h" #include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENTS_INCLUDES #undef MOZ_GENERATED_EVENTS_INCLUDES
#include "nsIDOMDeviceMotionEvent.h" #include "nsIDOMDeviceMotionEvent.h" //nsIDOMDeviceAcceleration
#include "nsIDOMXULCommandDispatcher.h" #include "nsIDOMXULCommandDispatcher.h"
#ifndef MOZ_DISABLE_CRYPTOLEGACY #ifndef MOZ_DISABLE_CRYPTOLEGACY
#include "nsIDOMCRMFObject.h" #include "nsIDOMCRMFObject.h"
@ -249,9 +226,6 @@
#include "nsPluginArray.h" #include "nsPluginArray.h"
#include "nsMimeTypeArray.h" #include "nsMimeTypeArray.h"
// Simple gestures include
#include "nsIDOMSimpleGestureEvent.h"
#include "nsIEventListenerService.h" #include "nsIEventListenerService.h"
#include "nsIMessageManager.h" #include "nsIMessageManager.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
@ -298,7 +272,6 @@ using mozilla::dom::workers::ResolveWorkerClasses;
#include "TelephonyCall.h" #include "TelephonyCall.h"
#include "nsIDOMMozVoicemail.h" #include "nsIDOMMozVoicemail.h"
#include "nsIDOMIccManager.h" #include "nsIDOMIccManager.h"
#include "StkCommandEvent.h"
#include "nsIDOMMozCellBroadcast.h" #include "nsIDOMMozCellBroadcast.h"
#include "nsIDOMMozCellBroadcastEvent.h" #include "nsIDOMMozCellBroadcastEvent.h"
#include "nsIDOMMobileConnection.h" #include "nsIDOMMobileConnection.h"
@ -547,22 +520,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
// Event // Event
NS_DEFINE_CLASSINFO_DATA(Event, nsEventSH, NS_DEFINE_CLASSINFO_DATA(Event, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MutationEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(UIEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MouseEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MouseScrollEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(WheelEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(DragEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(ClipboardEvent, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CompositionEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
#define MOZ_GENERATED_EVENT_LIST #define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) \ #define MOZ_GENERATED_EVENT(_event_interface) \
@ -571,8 +528,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
#include "GeneratedEvents.h" #include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENT_LIST #undef MOZ_GENERATED_EVENT_LIST
NS_DEFINE_CLASSINFO_DATA(DeviceMotionEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(DeviceAcceleration, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(DeviceAcceleration, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(DeviceRotationRate, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(DeviceRotationRate, nsDOMGenericSH,
@ -663,9 +618,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(CSSSupportsRule, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(CSSSupportsRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(BeforeUnloadEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(TimeEvent, nsEventSH, NS_DEFINE_CLASSINFO_DATA(TimeEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
@ -714,11 +666,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
nsIXPCScriptable::DONT_ENUM_STATIC_PROPS | nsIXPCScriptable::DONT_ENUM_STATIC_PROPS |
nsIXPCScriptable::WANT_NEWENUMERATE) nsIXPCScriptable::WANT_NEWENUMERATE)
NS_DEFINE_CLASSINFO_DATA(XULCommandEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CommandEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(OfflineResourceList, nsOfflineResourceListSH, NS_DEFINE_CLASSINFO_DATA(OfflineResourceList, nsOfflineResourceListSH,
ARRAY_SCRIPTABLE_FLAGS) ARRAY_SCRIPTABLE_FLAGS)
@ -731,12 +678,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
DEFAULT_SCRIPTABLE_FLAGS | DEFAULT_SCRIPTABLE_FLAGS |
WINDOW_SCRIPTABLE_FLAGS) WINDOW_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(DataContainerEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MessageEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(DeviceStorage, nsEventTargetSH, NS_DEFINE_CLASSINFO_DATA(DeviceStorage, nsEventTargetSH,
EVENTTARGET_SCRIPTABLE_FLAGS) EVENTTARGET_SCRIPTABLE_FLAGS)
@ -788,23 +729,8 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(DataTransfer, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(DataTransfer, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(NotifyPaintEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(NotifyAudioAvailableEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(SimpleGestureEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(ScrollAreaEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(EventListenerInfo, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(EventListenerInfo, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(TransitionEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(AnimationEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ContentFrameMessageManager, nsEventTargetSH, NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ContentFrameMessageManager, nsEventTargetSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS | DOM_DEFAULT_SCRIPTABLE_FLAGS |
nsIXPCScriptable::IS_GLOBAL_OBJECT) nsIXPCScriptable::IS_GLOBAL_OBJECT)
@ -831,15 +757,11 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(IDBIndex, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(IDBIndex, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(IDBVersionChangeEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(IDBOpenDBRequest, IDBEventTargetSH, NS_DEFINE_CLASSINFO_DATA(IDBOpenDBRequest, IDBEventTargetSH,
IDBEVENTTARGET_SCRIPTABLE_FLAGS) IDBEVENTTARGET_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(TouchList, nsDOMTouchListSH, NS_DEFINE_CLASSINFO_DATA(TouchList, nsDOMTouchListSH,
ARRAY_SCRIPTABLE_FLAGS) ARRAY_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(TouchEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozCSSKeyframeRule, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(MozCSSKeyframeRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
@ -861,8 +783,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
EVENTTARGET_SCRIPTABLE_FLAGS) EVENTTARGET_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozIccManager, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(MozIccManager, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozStkCommandEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
#endif #endif
#ifdef MOZ_B2G_FM #ifdef MOZ_B2G_FM
@ -927,11 +847,6 @@ NS_DEFINE_CONTRACT_CTOR(XSLTProcessor,
return rv; \ return rv; \
} }
NS_DEFINE_EVENT_CTOR(UIEvent)
NS_DEFINE_EVENT_CTOR(MouseEvent)
NS_DEFINE_EVENT_CTOR(WheelEvent)
NS_DEFINE_EVENT_CTOR(ClipboardEvent)
#define MOZ_GENERATED_EVENT_LIST #define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) \ #define MOZ_GENERATED_EVENT(_event_interface) \
NS_DEFINE_EVENT_CTOR(_event_interface) NS_DEFINE_EVENT_CTOR(_event_interface)
@ -954,14 +869,6 @@ static const nsConstructorFuncMapData kConstructorFuncMap[] =
{ {
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(Blob, nsDOMMultipartFile::NewBlob) NS_DEFINE_CONSTRUCTOR_FUNC_DATA(Blob, nsDOMMultipartFile::NewBlob)
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(File, nsDOMMultipartFile::NewFile) NS_DEFINE_CONSTRUCTOR_FUNC_DATA(File, nsDOMMultipartFile::NewFile)
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(UIEvent)
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MouseEvent)
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(WheelEvent)
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(ClipboardEvent)
#ifdef MOZ_B2G_RIL
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MozWifiStatusChangeEvent)
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MozWifiConnectionInfoEvent)
#endif
#define MOZ_GENERATED_EVENT_LIST #define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) \ #define MOZ_GENERATED_EVENT(_event_interface) \
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(_event_interface) NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(_event_interface)
@ -1506,10 +1413,6 @@ nsDOMClassInfo::RegisterExternalClasses()
#define DOM_CLASSINFO_EVENT_MAP_ENTRIES \ #define DOM_CLASSINFO_EVENT_MAP_ENTRIES \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent) \ DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent) \
#define DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMUIEvent) \
DOM_CLASSINFO_EVENT_MAP_ENTRIES
#ifdef MOZ_B2G #ifdef MOZ_B2G
#define DOM_CLASSINFO_WINDOW_MAP_ENTRIES(_support_indexed_db) \ #define DOM_CLASSINFO_WINDOW_MAP_ENTRIES(_support_indexed_db) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow) \ DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow) \
@ -1679,11 +1582,6 @@ nsDOMClassInfo::Init()
#include "GeneratedEvents.h" #include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENT_LIST #undef MOZ_GENERATED_EVENT_LIST
DOM_CLASSINFO_MAP_BEGIN(DeviceMotionEvent, nsIDOMDeviceMotionEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDeviceMotionEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(DeviceAcceleration, nsIDOMDeviceAcceleration) DOM_CLASSINFO_MAP_BEGIN(DeviceAcceleration, nsIDOMDeviceAcceleration)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDeviceAcceleration) DOM_CLASSINFO_MAP_ENTRY(nsIDOMDeviceAcceleration)
DOM_CLASSINFO_EVENT_MAP_ENTRIES DOM_CLASSINFO_EVENT_MAP_ENTRIES
@ -1694,48 +1592,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_EVENT_MAP_ENTRIES DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MutationEvent, nsIDOMMutationEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMutationEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(UIEvent, nsIDOMUIEvent)
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CompositionEvent, nsIDOMCompositionEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCompositionEvent)
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MouseEvent, nsIDOMMouseEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MouseScrollEvent, nsIDOMMouseScrollEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseScrollEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(WheelEvent, nsIDOMWheelEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWheelEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(DragEvent, nsIDOMDragEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDragEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(ClipboardEvent, nsIDOMClipboardEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMClipboardEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(HTMLFormElement, nsIDOMHTMLFormElement) DOM_CLASSINFO_MAP_BEGIN(HTMLFormElement, nsIDOMHTMLFormElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLFormElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLFormElement)
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
@ -1862,11 +1718,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSSupportsRule) DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSSupportsRule)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(BeforeUnloadEvent, nsIDOMBeforeUnloadEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMBeforeUnloadEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
// The SVG document // The SVG document
DOM_CLASSINFO_MAP_BEGIN(TimeEvent, nsIDOMTimeEvent) DOM_CLASSINFO_MAP_BEGIN(TimeEvent, nsIDOMTimeEvent)
@ -1925,16 +1776,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorage) DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorage)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(XULCommandEvent, nsIDOMXULCommandEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULCommandEvent)
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CommandEvent, nsIDOMCommandEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCommandEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(OfflineResourceList, nsIDOMOfflineResourceList) DOM_CLASSINFO_MAP_BEGIN(OfflineResourceList, nsIDOMOfflineResourceList)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMOfflineResourceList) DOM_CLASSINFO_MAP_ENTRY(nsIDOMOfflineResourceList)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
@ -1957,16 +1798,6 @@ nsDOMClassInfo::Init()
#endif #endif
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(DataContainerEvent, nsIDOMDataContainerEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDataContainerEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MessageEvent, nsIDOMMessageEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMessageEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(DeviceStorage, nsIDOMDeviceStorage) DOM_CLASSINFO_MAP_BEGIN(DeviceStorage, nsIDOMDeviceStorage)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDeviceStorage) DOM_CLASSINFO_MAP_ENTRY(nsIDOMDeviceStorage)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
@ -2042,41 +1873,10 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDataTransfer) DOM_CLASSINFO_MAP_ENTRY(nsIDOMDataTransfer)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(NotifyPaintEvent, nsIDOMNotifyPaintEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNotifyPaintEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(NotifyAudioAvailableEvent, nsIDOMNotifyAudioAvailableEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNotifyAudioAvailableEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(SimpleGestureEvent, nsIDOMSimpleGestureEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSimpleGestureEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(ScrollAreaEvent, nsIDOMScrollAreaEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMScrollAreaEvent)
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(EventListenerInfo, nsIEventListenerInfo) DOM_CLASSINFO_MAP_BEGIN(EventListenerInfo, nsIEventListenerInfo)
DOM_CLASSINFO_MAP_ENTRY(nsIEventListenerInfo) DOM_CLASSINFO_MAP_ENTRY(nsIEventListenerInfo)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(TransitionEvent, nsIDOMTransitionEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMTransitionEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(AnimationEvent, nsIDOMAnimationEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAnimationEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ContentFrameMessageManager, nsISupports) DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ContentFrameMessageManager, nsISupports)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIMessageListenerManager) DOM_CLASSINFO_MAP_ENTRY(nsIMessageListenerManager)
@ -2139,11 +1939,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIIDBIndex) DOM_CLASSINFO_MAP_ENTRY(nsIIDBIndex)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(IDBVersionChangeEvent, nsIIDBVersionChangeEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIIDBVersionChangeEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(IDBOpenDBRequest, nsIIDBOpenDBRequest) DOM_CLASSINFO_MAP_BEGIN(IDBOpenDBRequest, nsIIDBOpenDBRequest)
DOM_CLASSINFO_MAP_ENTRY(nsIIDBOpenDBRequest) DOM_CLASSINFO_MAP_ENTRY(nsIIDBOpenDBRequest)
DOM_CLASSINFO_MAP_ENTRY(nsIIDBRequest) DOM_CLASSINFO_MAP_ENTRY(nsIIDBRequest)
@ -2155,12 +1950,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMTouchList) DOM_CLASSINFO_MAP_ENTRY(nsIDOMTouchList)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN_MAYBE_DISABLE(TouchEvent, nsIDOMTouchEvent,
!nsDOMTouchEvent::PrefEnabled())
DOM_CLASSINFO_MAP_ENTRY(nsIDOMTouchEvent)
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MozCSSKeyframeRule, nsIDOMMozCSSKeyframeRule) DOM_CLASSINFO_MAP_BEGIN(MozCSSKeyframeRule, nsIDOMMozCSSKeyframeRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozCSSKeyframeRule) DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozCSSKeyframeRule)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
@ -2178,16 +1967,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
#ifdef MOZ_B2G_RIL #ifdef MOZ_B2G_RIL
DOM_CLASSINFO_MAP_BEGIN(MozWifiStatusChangeEvent, nsIDOMMozWifiStatusChangeEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozWifiStatusChangeEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MozWifiConnectionInfoEvent, nsIDOMMozWifiConnectionInfoEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozWifiConnectionInfoEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(Telephony, nsIDOMTelephony) DOM_CLASSINFO_MAP_BEGIN(Telephony, nsIDOMTelephony)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMTelephony) DOM_CLASSINFO_MAP_ENTRY(nsIDOMTelephony)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
@ -2208,11 +1987,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MozStkCommandEvent, nsIDOMMozStkCommandEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozStkCommandEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
#endif #endif
#ifdef MOZ_B2G_FM #ifdef MOZ_B2G_FM

Просмотреть файл

@ -21,19 +21,10 @@ DOMCI_CLASS(Element)
// Event classes // Event classes
DOMCI_CLASS(Event) DOMCI_CLASS(Event)
DOMCI_CLASS(MutationEvent)
DOMCI_CLASS(UIEvent)
DOMCI_CLASS(MouseEvent)
DOMCI_CLASS(MouseScrollEvent)
DOMCI_CLASS(WheelEvent)
DOMCI_CLASS(DragEvent)
DOMCI_CLASS(ClipboardEvent)
DOMCI_CLASS(CompositionEvent)
#define MOZ_GENERATED_EVENT_LIST #define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) DOMCI_CLASS(_event_interface) #define MOZ_GENERATED_EVENT(_event_interface) DOMCI_CLASS(_event_interface)
#include "GeneratedEvents.h" #include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENT_LIST #undef MOZ_GENERATED_EVENT_LIST
DOMCI_CLASS(DeviceMotionEvent)
DOMCI_CLASS(DeviceAcceleration) DOMCI_CLASS(DeviceAcceleration)
DOMCI_CLASS(DeviceRotationRate) DOMCI_CLASS(DeviceRotationRate)
@ -93,8 +84,6 @@ DOMCI_CLASS(TreeColumn)
DOMCI_CLASS(CSSMozDocumentRule) DOMCI_CLASS(CSSMozDocumentRule)
DOMCI_CLASS(CSSSupportsRule) DOMCI_CLASS(CSSSupportsRule)
DOMCI_CLASS(BeforeUnloadEvent)
DOMCI_CLASS(TimeEvent) DOMCI_CLASS(TimeEvent)
// other SVG classes // other SVG classes
@ -122,8 +111,6 @@ DOMCI_CLASS(XPathResult)
// WhatWG WebApps Objects // WhatWG WebApps Objects
DOMCI_CLASS(Storage) DOMCI_CLASS(Storage)
DOMCI_CLASS(XULCommandEvent)
DOMCI_CLASS(CommandEvent)
DOMCI_CLASS(OfflineResourceList) DOMCI_CLASS(OfflineResourceList)
DOMCI_CLASS(Blob) DOMCI_CLASS(Blob)
@ -132,13 +119,6 @@ DOMCI_CLASS(File)
// DOM modal content window class, almost identical to Window // DOM modal content window class, almost identical to Window
DOMCI_CLASS(ModalContentWindow) DOMCI_CLASS(ModalContentWindow)
// Data Events
DOMCI_CLASS(DataContainerEvent)
// event used for cross-domain message-passing and for server-sent events in
// HTML5
DOMCI_CLASS(MessageEvent)
DOMCI_CLASS(DeviceStorage) DOMCI_CLASS(DeviceStorage)
// Geolocation // Geolocation
@ -166,19 +146,8 @@ DOMCI_CLASS(CSSFontFaceRule)
DOMCI_CLASS(DataTransfer) DOMCI_CLASS(DataTransfer)
DOMCI_CLASS(NotifyPaintEvent)
DOMCI_CLASS(NotifyAudioAvailableEvent)
DOMCI_CLASS(SimpleGestureEvent)
DOMCI_CLASS(ScrollAreaEvent)
DOMCI_CLASS(EventListenerInfo) DOMCI_CLASS(EventListenerInfo)
DOMCI_CLASS(TransitionEvent)
DOMCI_CLASS(AnimationEvent)
DOMCI_CLASS(ContentFrameMessageManager) DOMCI_CLASS(ContentFrameMessageManager)
DOMCI_CLASS(ChromeMessageBroadcaster) DOMCI_CLASS(ChromeMessageBroadcaster)
DOMCI_CLASS(ChromeMessageSender) DOMCI_CLASS(ChromeMessageSender)
@ -192,11 +161,9 @@ DOMCI_CLASS(IDBCursor)
DOMCI_CLASS(IDBCursorWithValue) DOMCI_CLASS(IDBCursorWithValue)
DOMCI_CLASS(IDBKeyRange) DOMCI_CLASS(IDBKeyRange)
DOMCI_CLASS(IDBIndex) DOMCI_CLASS(IDBIndex)
DOMCI_CLASS(IDBVersionChangeEvent)
DOMCI_CLASS(IDBOpenDBRequest) DOMCI_CLASS(IDBOpenDBRequest)
DOMCI_CLASS(TouchList) DOMCI_CLASS(TouchList)
DOMCI_CLASS(TouchEvent)
DOMCI_CLASS(MozCSSKeyframeRule) DOMCI_CLASS(MozCSSKeyframeRule)
DOMCI_CLASS(MozCSSKeyframesRule) DOMCI_CLASS(MozCSSKeyframesRule)
@ -210,7 +177,6 @@ DOMCI_CLASS(Telephony)
DOMCI_CLASS(TelephonyCall) DOMCI_CLASS(TelephonyCall)
DOMCI_CLASS(MozVoicemail) DOMCI_CLASS(MozVoicemail)
DOMCI_CLASS(MozIccManager) DOMCI_CLASS(MozIccManager)
DOMCI_CLASS(MozStkCommandEvent)
#endif #endif
#ifdef MOZ_B2G_FM #ifdef MOZ_B2G_FM

Просмотреть файл

@ -5,41 +5,25 @@
import os import os
import cPickle import cPickle
from Configuration import Configuration from Configuration import Configuration
from Codegen import CGBindingRoot from Codegen import CGBindingRoot, replaceFileIfChanged
def generate_binding_header(config, outputprefix, srcprefix, webidlfile): def generate_binding_files(config, outputprefix, srcprefix, webidlfile):
""" """
|config| Is the configuration object. |config| Is the configuration object.
|outputprefix| is a prefix to use for the header guards and filename. |outputprefix| is a prefix to use for the header guards and filename.
""" """
filename = outputprefix + ".h" depsname = ".deps/" + outputprefix + ".pp"
depsname = ".deps/" + filename + ".pp"
root = CGBindingRoot(config, outputprefix, webidlfile) root = CGBindingRoot(config, outputprefix, webidlfile)
with open(filename, 'wb') as f: replaceFileIfChanged(outputprefix + ".h", root.declare())
f.write(root.declare()) replaceFileIfChanged(outputprefix + ".cpp", root.define())
with open(depsname, 'wb') as f: with open(depsname, 'wb') as f:
# Sort so that our output is stable # Sort so that our output is stable
f.write("\n".join(filename + ": " + os.path.join(srcprefix, x) for f.write("\n".join(outputprefix + ": " + os.path.join(srcprefix, x) for
x in sorted(root.deps())))
def generate_binding_cpp(config, outputprefix, srcprefix, webidlfile):
"""
|config| Is the configuration object.
|outputprefix| is a prefix to use for the header guards and filename.
"""
filename = outputprefix + ".cpp"
depsname = ".deps/" + filename + ".pp"
root = CGBindingRoot(config, outputprefix, webidlfile)
with open(filename, 'wb') as f:
f.write(root.define())
with open(depsname, 'wb') as f:
f.write("\n".join(filename + ": " + os.path.join(srcprefix, x) for
x in sorted(root.deps()))) x in sorted(root.deps())))
def main(): def main():
# Parse arguments. # Parse arguments.
from optparse import OptionParser from optparse import OptionParser
usagestring = "usage: %prog [header|cpp] configFile outputPrefix srcPrefix webIDLFile" usagestring = "usage: %prog [header|cpp] configFile outputPrefix srcPrefix webIDLFile"
@ -48,29 +32,34 @@ def main():
help="When an error happens, display the Python traceback.") help="When an error happens, display the Python traceback.")
(options, args) = o.parse_args() (options, args) = o.parse_args()
if len(args) != 5 or (args[0] != "header" and args[0] != "cpp"): configFile = os.path.normpath(args[0])
o.error(usagestring) srcPrefix = os.path.normpath(args[1])
buildTarget = args[0]
configFile = os.path.normpath(args[1])
outputPrefix = args[2]
srcPrefix = os.path.normpath(args[3])
webIDLFile = os.path.normpath(args[4])
# Load the parsing results # Load the configuration
f = open('ParserResults.pkl', 'rb') f = open('ParserResults.pkl', 'rb')
parserData = cPickle.load(f) config = cPickle.load(f)
f.close() f.close()
# Create the configuration data. def readFile(f):
config = Configuration(configFile, parserData) file = open(f, 'rb')
try:
contents = file.read()
finally:
file.close()
return contents
allWebIDLFiles = readFile(args[2]).split()
changedDeps = readFile(args[3]).split()
# Generate the prototype classes. if all(f.endswith("Binding") or f == "ParserResults.pkl" for f in changedDeps):
if buildTarget == "header": toRegenerate = filter(lambda f: f.endswith("Binding"), changedDeps)
generate_binding_header(config, outputPrefix, srcPrefix, webIDLFile); toRegenerate = map(lambda f: f[:-len("Binding")] + ".webidl", toRegenerate)
elif buildTarget == "cpp":
generate_binding_cpp(config, outputPrefix, srcPrefix, webIDLFile);
else: else:
assert False # not reached toRegenerate = allWebIDLFiles
for webIDLFile in toRegenerate:
assert webIDLFile.endswith(".webidl")
outputPrefix = webIDLFile[:-len(".webidl")] + "Binding"
generate_binding_files(config, outputPrefix, srcPrefix, webIDLFile);
if __name__ == '__main__': if __name__ == '__main__':
main() main()

Просмотреть файл

@ -1770,5 +1770,40 @@ Date::ToDateObject(JSContext* cx, JS::Value* vp) const
return true; return true;
} }
bool
GetWindowForJSImplementedObject(JSContext* cx, JS::Handle<JSObject*> obj,
nsPIDOMWindow** window)
{
// Be very careful to not get tricked here.
MOZ_ASSERT(NS_IsMainThread());
if (!xpc::AccessCheck::isChrome(js::GetObjectCompartment(obj))) {
NS_RUNTIMEABORT("Should have a chrome object here");
}
// Look up the content-side object.
JS::Rooted<JS::Value> domImplVal(cx);
if (!JS_GetProperty(cx, obj, "__DOM_IMPL__", domImplVal.address())) {
return false;
}
if (!domImplVal.isObject()) {
ThrowErrorMessage(cx, MSG_NOT_OBJECT);
return false;
}
// Go ahead and get the global from it. GlobalObject will handle
// doing unwrapping as needed.
GlobalObject global(cx, &domImplVal.toObject());
if (global.Failed()) {
return false;
}
// It's OK if we have null here: that just means the content-side
// object really wasn't associated with any window.
nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(global.Get()));
win.forget(window);
return true;
}
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla

Просмотреть файл

@ -25,6 +25,8 @@
#include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/CallbackObject.h" #include "mozilla/dom/CallbackObject.h"
class nsPIDOMWindow;
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
@ -1991,6 +1993,13 @@ GetUnforgeableHolder(JSObject* aGlobal, prototypes::ID aId)
DOM_INTERFACE_PROTO_SLOTS_BASE).toObject(); DOM_INTERFACE_PROTO_SLOTS_BASE).toObject();
} }
// Given a JSObject* that represents the chrome side of a JS-implemented WebIDL
// interface, get the nsPIDOMWindow corresponding to the content side, if any.
// A false return means an exception was thrown.
bool
GetWindowForJSImplementedObject(JSContext* cx, JS::Handle<JSObject*> obj,
nsPIDOMWindow** window);
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla

Просмотреть файл

@ -613,7 +613,6 @@ DOMInterfaces = {
'MouseEvent': { 'MouseEvent': {
'nativeType': 'nsDOMMouseEvent', 'nativeType': 'nsDOMMouseEvent',
'hasXPConnectImpls': True,
}, },
'MouseScrollEvent': { 'MouseScrollEvent': {
@ -1071,7 +1070,6 @@ DOMInterfaces = {
'UIEvent': { 'UIEvent': {
'nativeType': 'nsDOMUIEvent', 'nativeType': 'nsDOMUIEvent',
'hasXPConnectImpls': True
}, },
'UndoManager': { 'UndoManager': {

Просмотреть файл

@ -357,7 +357,10 @@ class CGList(CGThing):
""" """
def __init__(self, children, joiner=""): def __init__(self, children, joiner=""):
CGThing.__init__(self) CGThing.__init__(self)
self.children = children # Make a copy of the kids into a list, because if someone passes in a
# generator we won't be able to both declare and define ourselves, or
# define ourselves more than once!
self.children = list(children)
self.joiner = joiner self.joiner = joiner
def append(self, child): def append(self, child):
self.children.append(child) self.children.append(child)
@ -2287,13 +2290,21 @@ class CastableObjectUnwrapper():
called by the name in the "target" argument. called by the name in the "target" argument.
codeOnFailure is the code to run if unwrapping fails. codeOnFailure is the code to run if unwrapping fails.
If isCallbackReturnValue is "JSImpl" and our descriptor is also
JS-implemented, fall back to just creating the right object if what we
have isn't one already.
""" """
def __init__(self, descriptor, source, target, codeOnFailure): def __init__(self, descriptor, source, target, codeOnFailure,
exceptionCode=None, isCallbackReturnValue=False):
if not exceptionCode:
exceptionCode = codeOnFailure
self.substitution = { "type" : descriptor.nativeType, self.substitution = { "type" : descriptor.nativeType,
"protoID" : "prototypes::id::" + descriptor.name, "protoID" : "prototypes::id::" + descriptor.name,
"source" : source, "source" : source,
"target" : target, "target" : target,
"codeOnFailure" : CGIndenter(CGGeneric(codeOnFailure), 4).define() } "codeOnFailure" : CGIndenter(CGGeneric(codeOnFailure)).define(),
"exceptionCode" : CGIndenter(CGGeneric(exceptionCode), 4).define() }
if descriptor.hasXPConnectImpls: if descriptor.hasXPConnectImpls:
# We don't use xpc_qsUnwrapThis because it will always throw on # We don't use xpc_qsUnwrapThis because it will always throw on
# unwrap failure, whereas we want to control whether we throw or # unwrap failure, whereas we want to control whether we throw or
@ -2311,6 +2322,26 @@ class CastableObjectUnwrapper():
"// We should have an object, too!\n" "// We should have an object, too!\n"
"MOZ_ASSERT(objPtr);\n" "MOZ_ASSERT(objPtr);\n"
"${target} = objPtr;").substitute(self.substitution)), 4).define() "${target} = objPtr;").substitute(self.substitution)), 4).define()
elif (isCallbackReturnValue == "JSImpl" and
descriptor.interface.isJSImplemented()):
self.substitution["codeOnFailure"] = CGIndenter(CGGeneric(string.Template(
"// Be careful to not wrap random DOM objects here, even if\n"
"// they're wrapped in opaque security wrappers for some reason.\n"
"// XXXbz Wish we could check for a JS-implemented object\n"
"// that already has a content reflection...\n"
"if (!IsDOMObject(js::UncheckedUnwrap(${source}))) {\n"
" nsCOMPtr<nsPIDOMWindow> ourWindow;\n"
" if (!GetWindowForJSImplementedObject(cx, Callback(), getter_AddRefs(ourWindow))) {\n"
"${exceptionCode}\n"
" }\n"
" JS::Rooted<JSObject*> jsImplSourceObj(cx, ${source});\n"
" ${target} = new ${type}(jsImplSourceObj, ourWindow);\n"
"} else {\n"
"${codeOnFailure}\n"
"}").substitute(self.substitution)), 4).define()
else:
self.substitution["codeOnFailure"] = CGIndenter(
CGGeneric(self.substitution["codeOnFailure"])).define()
def __str__(self): def __str__(self):
return string.Template( return string.Template(
@ -2325,11 +2356,14 @@ class FailureFatalCastableObjectUnwrapper(CastableObjectUnwrapper):
""" """
As CastableObjectUnwrapper, but defaulting to throwing if unwrapping fails As CastableObjectUnwrapper, but defaulting to throwing if unwrapping fails
""" """
def __init__(self, descriptor, source, target, exceptionCode): def __init__(self, descriptor, source, target, exceptionCode,
isCallbackReturnValue):
CastableObjectUnwrapper.__init__( CastableObjectUnwrapper.__init__(
self, descriptor, source, target, self, descriptor, source, target,
'ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "%s");\n' 'ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "%s");\n'
'%s' % (descriptor.name, exceptionCode)) '%s' % (descriptor.name, exceptionCode),
exceptionCode,
isCallbackReturnValue)
class CallbackObjectUnwrapper: class CallbackObjectUnwrapper:
""" """
@ -2519,9 +2553,13 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
If allowTreatNonCallableAsNull is true, then [TreatNonCallableAsNull] If allowTreatNonCallableAsNull is true, then [TreatNonCallableAsNull]
extended attributes on nullable callback functions will be honored. extended attributes on nullable callback functions will be honored.
If isCallbackReturnValue is true, then the declType may be adjusted to make If isCallbackReturnValue is "JSImpl" or "Callback", then the declType may be
it easier to return from a callback. Since that type is never directly adjusted to make it easier to return from a callback. Since that type is
observable by any consumers of the callback code, this is OK. never directly observable by any consumers of the callback code, this is OK.
Furthermore, if isCallbackReturnValue is "JSImpl", that affects the behavior
of the FailureFatalCastableObjectUnwrapper conversion; this is used for
implementing auto-wrapping of JS-implemented return values from a
JS-implemented interface.
The return value from this function is a JSToNativeConversionInfo. The return value from this function is a JSToNativeConversionInfo.
""" """
@ -2998,9 +3036,14 @@ for (uint32_t i = 0; i < length; ++i) {
isCallbackReturnValue) isCallbackReturnValue)
# Sequences and non-worker callbacks have to hold a strong ref to the # Sequences and non-worker callbacks have to hold a strong ref to the
# thing being passed down. # thing being passed down. Also, callback return values always end up
forceOwningType = (descriptor.interface.isCallback() and # addrefing anyway, so there is no point trying to avoid it here and it
not descriptor.workers) or isMember # makes other things simpler since we can assume the return value is a
# strong ref.
forceOwningType = ((descriptor.interface.isCallback() and
not descriptor.workers) or
isMember or
isCallbackReturnValue)
typeName = descriptor.nativeType typeName = descriptor.nativeType
typePtr = typeName + "*" typePtr = typeName + "*"
@ -3050,7 +3093,8 @@ for (uint32_t i = 0; i < length; ++i) {
descriptor, descriptor,
"&${val}.toObject()", "&${val}.toObject()",
"${declName}", "${declName}",
exceptionCode)) exceptionCode,
isCallbackReturnValue))
elif descriptor.workers: elif descriptor.workers:
return handleJSObjectType(type, isMember, failureCode) return handleJSObjectType(type, isMember, failureCode)
else: else:
@ -8275,7 +8319,7 @@ class CGBindingRoot(CGThing):
return self.root.deps() return self.root.deps()
class CGNativeMember(ClassMethod): class CGNativeMember(ClassMethod):
def __init__(self, descriptor, member, name, signature, extendedAttrs, def __init__(self, descriptorProvider, member, name, signature, extendedAttrs,
breakAfter=True, passCxAsNeeded=True, visibility="public", breakAfter=True, passCxAsNeeded=True, visibility="public",
jsObjectsArePtr=False, variadicIsSequence=False): jsObjectsArePtr=False, variadicIsSequence=False):
""" """
@ -8286,10 +8330,10 @@ class CGNativeMember(ClassMethod):
JSContext* based on the return and argument types. We can JSContext* based on the return and argument types. We can
still pass it based on 'implicitJSContext' annotations. still pass it based on 'implicitJSContext' annotations.
""" """
self.descriptor = descriptor self.descriptorProvider = descriptorProvider
self.member = member self.member = member
self.extendedAttrs = extendedAttrs self.extendedAttrs = extendedAttrs
self.resultAlreadyAddRefed = isResultAlreadyAddRefed(self.descriptor, self.resultAlreadyAddRefed = isResultAlreadyAddRefed(self.descriptorProvider,
self.extendedAttrs) self.extendedAttrs)
self.passCxAsNeeded = passCxAsNeeded self.passCxAsNeeded = passCxAsNeeded
self.jsObjectsArePtr = jsObjectsArePtr self.jsObjectsArePtr = jsObjectsArePtr
@ -8354,7 +8398,7 @@ class CGNativeMember(ClassMethod):
return enumName, defaultValue, "return ${declName};" return enumName, defaultValue, "return ${declName};"
if type.isGeckoInterface(): if type.isGeckoInterface():
iface = type.unroll().inner; iface = type.unroll().inner;
nativeType = self.descriptor.getDescriptor( nativeType = self.descriptorProvider.getDescriptor(
iface.identifier.name).nativeType iface.identifier.name).nativeType
# Now trim off unnecessary namespaces # Now trim off unnecessary namespaces
nativeType = nativeType.split("::") nativeType = nativeType.split("::")
@ -8377,25 +8421,10 @@ class CGNativeMember(ClassMethod):
post=">") post=">")
else: else:
result = CGWrapper(result, post="*") result = CGWrapper(result, post="*")
if iface.isExternal(): # Since we always force an owning type for callback return values,
# The holder is an nsRefPtr. If we're nullable and end up null, # our ${declName} is an OwningNonNull or nsRefPtr. So we can just
# the holder will be null anyway, so it's safe to just always # .forget() to get our already_AddRefed.
# return it here. return result.define(), "nullptr", "return ${declName}.forget();"
returnCode = ("(void)${declName}; // avoid warning. May end up not being read\n"
"return ${holderName}.forget();")
elif iface.isCallback():
# The decl is an OwningNonNull or nsRefPtr, depending
# on whether we're nullable.
returnCode = "return ${declName}.forget();"
elif type.nullable():
# Decl is a raw pointer
returnCode = ("NS_IF_ADDREF(${declName});\n"
"return dont_AddRef(${declName});")
else:
# Decl is a non-null raw pointer.
returnCode = ("NS_ADDREF(${declName});\n"
"return dont_AddRef(${declName});")
return result.define(), "nullptr", returnCode
if type.isCallback(): if type.isCallback():
return ("already_AddRefed<%s>" % type.unroll().identifier.name, return ("already_AddRefed<%s>" % type.unroll().identifier.name,
"nullptr", "return ${declName}.forget();") "nullptr", "return ${declName}.forget();")
@ -8459,12 +8488,12 @@ class CGNativeMember(ClassMethod):
args.insert(0, Argument("JS::Value", "aThisVal")) args.insert(0, Argument("JS::Value", "aThisVal"))
# And jscontext bits. # And jscontext bits.
if needCx(returnType, argList, self.extendedAttrs, if needCx(returnType, argList, self.extendedAttrs,
self.descriptor, self.passCxAsNeeded): self.descriptorProvider, self.passCxAsNeeded):
args.insert(0, Argument("JSContext*", "cx")) args.insert(0, Argument("JSContext*", "cx"))
# And if we're static, a global # And if we're static, a global
if self.member.isStatic(): if self.member.isStatic():
globalObjectType = "GlobalObject" globalObjectType = "GlobalObject"
if self.descriptor.workers: if self.descriptorProvider.workers:
globalObjectType = "Worker" + globalObjectType globalObjectType = "Worker" + globalObjectType
args.insert(0, Argument("const %s&" % globalObjectType, "global")) args.insert(0, Argument("const %s&" % globalObjectType, "global"))
return args return args
@ -8514,7 +8543,7 @@ class CGNativeMember(ClassMethod):
else: else:
typeDecl = "%s&" typeDecl = "%s&"
return ((typeDecl % return ((typeDecl %
self.descriptor.getDescriptor(iface.identifier.name).nativeType), self.descriptorProvider.getDescriptor(iface.identifier.name).nativeType),
False, False) False, False)
if type.isSpiderMonkeyInterface(): if type.isSpiderMonkeyInterface():
@ -8575,8 +8604,8 @@ class CGNativeMember(ClassMethod):
return declType, False, False return declType, False, False
if type.isDictionary(): if type.isDictionary():
typeName = CGDictionary.makeDictionaryName(type.inner, typeName = CGDictionary.makeDictionaryName(
self.descriptor.workers) type.inner, self.descriptorProvider.workers)
return typeName, True, True return typeName, True, True
if type.isDate(): if type.isDate():
@ -8914,6 +8943,7 @@ class CGJSImplMethod(CGNativeMember):
variadicIsSequence=True, variadicIsSequence=True,
passCxAsNeeded=False) passCxAsNeeded=False)
self.signature = signature self.signature = signature
self.descriptor = descriptor
if isConstructor: if isConstructor:
self.body = self.getConstructorImpl() self.body = self.getConstructorImpl()
else: else:
@ -9159,6 +9189,10 @@ class CGJSImplClass(CGBindingImplClass):
def getGetParentObjectBody(self): def getGetParentObjectBody(self):
return "return mParent;" return "return mParent;"
def isJSImplementedDescriptor(descriptorProvider):
return (isinstance(descriptorProvider, Descriptor) and
descriptorProvider.interface.isJSImplemented())
class CGCallback(CGClass): class CGCallback(CGClass):
def __init__(self, idlObject, descriptorProvider, baseName, methods, def __init__(self, idlObject, descriptorProvider, baseName, methods,
getters=[], setters=[]): getters=[], setters=[]):
@ -9167,7 +9201,7 @@ class CGCallback(CGClass):
name = idlObject.identifier.name name = idlObject.identifier.name
if descriptorProvider.workers: if descriptorProvider.workers:
name += "Workers" name += "Workers"
if isinstance(descriptorProvider, Descriptor) and descriptorProvider.interface.isJSImplemented(): if isJSImplementedDescriptor(descriptorProvider):
name = jsImplName(name) name = jsImplName(name)
# For our public methods that needThisHandling we want most of the # For our public methods that needThisHandling we want most of the
# same args and the same return type as what CallbackMember # same args and the same return type as what CallbackMember
@ -9391,11 +9425,15 @@ class CallbackMember(CGNativeMember):
"obj": "nullptr" "obj": "nullptr"
} }
if isJSImplementedDescriptor(self.descriptorProvider):
isCallbackReturnValue = "JSImpl"
else:
isCallbackReturnValue = "Callback"
convertType = instantiateJSToNativeConversion( convertType = instantiateJSToNativeConversion(
getJSToNativeConversionInfo(self.retvalType, getJSToNativeConversionInfo(self.retvalType,
self.descriptor, self.descriptorProvider,
exceptionCode=self.exceptionCode, exceptionCode=self.exceptionCode,
isCallbackReturnValue=True), isCallbackReturnValue=isCallbackReturnValue),
replacements) replacements)
assignRetval = string.Template( assignRetval = string.Template(
self.getRetvalInfo(self.retvalType, self.getRetvalInfo(self.retvalType,
@ -9443,7 +9481,7 @@ class CallbackMember(CGNativeMember):
prepend = "" prepend = ""
conversion = prepend + wrapForType( conversion = prepend + wrapForType(
arg.type, self.descriptor, arg.type, self.descriptorProvider,
{ {
'result' : result, 'result' : result,
'successCode' : "continue;" if arg.variadic else "break;", 'successCode' : "continue;" if arg.variadic else "break;",

Просмотреть файл

@ -60,6 +60,19 @@ class Configuration:
d.nativeType != descriptor.nativeType or d == descriptor d.nativeType != descriptor.nativeType or d == descriptor
for d in self.descriptors) for d in self.descriptors)
# Keep the descriptor list sorted for determinism.
self.descriptors.sort(lambda x,y: cmp(x.name, y.name))
self.descriptorsByName = {}
for d in self.descriptors:
self.descriptorsByName.setdefault(d.interface.identifier.name,
[]).append(d)
self.descriptorsByFile = {}
for d in self.descriptors:
self.descriptorsByFile.setdefault(d.interface.filename(),
[]).append(d)
self.enums = [e for e in parseData if e.isEnum()] self.enums = [e for e in parseData if e.isEnum()]
# Figure out what our main-thread and worker dictionaries and callbacks # Figure out what our main-thread and worker dictionaries and callbacks
@ -90,17 +103,22 @@ class Configuration:
workerDictionaries); workerDictionaries);
flagWorkerOrMainThread(self.callbacks, mainCallbacks, workerCallbacks) flagWorkerOrMainThread(self.callbacks, mainCallbacks, workerCallbacks)
# Keep the descriptor list sorted for determinism.
self.descriptors.sort(lambda x,y: cmp(x.name, y.name))
def getInterface(self, ifname): def getInterface(self, ifname):
return self.interfaces[ifname] return self.interfaces[ifname]
def getDescriptors(self, **filters): def getDescriptors(self, **filters):
"""Gets the descriptors that match the given filters.""" """Gets the descriptors that match the given filters."""
curr = self.descriptors curr = self.descriptors
# Collect up our filters, because we may have a webIDLFile filter that
# we always want to apply first.
tofilter = []
for key, val in filters.iteritems(): for key, val in filters.iteritems():
if key == 'webIDLFile': if key == 'webIDLFile':
getter = lambda x: x.interface.filename() # Special-case this part to make it fast, since most of our
# getDescriptors calls are conditioned on a webIDLFile. We may
# not have this key, in which case we have no descriptors
# either.
curr = self.descriptorsByFile.get(val, [])
continue
elif key == 'hasInterfaceObject': elif key == 'hasInterfaceObject':
getter = lambda x: (not x.interface.isExternal() and getter = lambda x: (not x.interface.isExternal() and
x.interface.hasInterfaceObject()) x.interface.hasInterfaceObject())
@ -118,8 +136,12 @@ class Configuration:
elif key == 'isNavigatorProperty': elif key == 'isNavigatorProperty':
getter = lambda x: x.interface.getNavigatorProperty() != None getter = lambda x: x.interface.getNavigatorProperty() != None
else: else:
getter = lambda x: getattr(x, key) # Have to watch out: just closing over "key" is not enough,
curr = filter(lambda x: getter(x) == val, curr) # since we're about to mutate its value
getter = (lambda attrName: lambda x: getattr(x, attrName))(key)
tofilter.append((getter, val))
for f in tofilter:
curr = filter(lambda x: f[0](x) == f[1], curr)
return curr return curr
def getEnums(self, webIDLFile): def getEnums(self, webIDLFile):
return filter(lambda e: e.filename() == webIDLFile, self.enums) return filter(lambda e: e.filename() == webIDLFile, self.enums)
@ -148,17 +170,11 @@ class Configuration:
Gets the appropriate descriptor for the given interface name Gets the appropriate descriptor for the given interface name
and the given workers boolean. and the given workers boolean.
""" """
iface = self.getInterface(interfaceName) for d in self.descriptorsByName[interfaceName]:
descriptors = self.getDescriptors(interface=iface) if d.workers == workers:
return d
# The only filter we currently have is workers vs non-workers. raise NoSuchDescriptorError("For " + interfaceName + " found no matches");
matches = filter(lambda x: x.workers is workers, descriptors)
# After filtering, we should have exactly one result.
if len(matches) is not 1:
raise NoSuchDescriptorError("For " + interfaceName + " found " +
str(len(matches)) + " matches");
return matches[0]
def getDescriptorProvider(self, workers): def getDescriptorProvider(self, workers):
""" """
Gets a descriptor provider that can provide descriptors as needed, Gets a descriptor provider that can provide descriptors as needed,

Просмотреть файл

@ -34,14 +34,11 @@ def main():
configFile = os.path.normpath(args[0]) configFile = os.path.normpath(args[0])
interfaceName = args[1] interfaceName = args[1]
# Load the parsing results # Load the configuration
f = open('ParserResults.pkl', 'rb') f = open('ParserResults.pkl', 'rb')
parserData = cPickle.load(f) config = cPickle.load(f)
f.close() f.close()
# Create the configuration data.
config = Configuration(configFile, parserData)
# Generate the example class. # Generate the example class.
generate_interface_example(config, interfaceName) generate_interface_example(config, interfaceName)

Просмотреть файл

@ -55,14 +55,14 @@ def main():
parser.parse(''.join(lines), fullPath) parser.parse(''.join(lines), fullPath)
parserResults = parser.finish() parserResults = parser.finish()
# Write the parser results out to a pickle.
resultsFile = open('ParserResults.pkl', 'wb')
cPickle.dump(parserResults, resultsFile, -1)
resultsFile.close()
# Load the configuration. # Load the configuration.
config = Configuration(configFile, parserResults) config = Configuration(configFile, parserResults)
# Write the configuration out to a pickle.
resultsFile = open('ParserResults.pkl', 'wb')
cPickle.dump(config, resultsFile, -1)
resultsFile.close()
# Generate the prototype list. # Generate the prototype list.
generate_file(config, 'PrototypeList', 'declare') generate_file(config, 'PrototypeList', 'declare')

Просмотреть файл

@ -34,6 +34,15 @@ all_webidl_files += $(test_webidl_files)
binding_header_files := $(subst .webidl,Binding.h,$(all_webidl_files)) binding_header_files := $(subst .webidl,Binding.h,$(all_webidl_files))
binding_cpp_files := $(subst .webidl,Binding.cpp,$(all_webidl_files)) binding_cpp_files := $(subst .webidl,Binding.cpp,$(all_webidl_files))
# We want to be able to only regenerate the .cpp and .h files that really need
# to change when a .webidl file changes. We do this by making the
# binding_dependency_trackers targets have dependencies on the right .webidl
# files via generated .pp files, having a .BindingGen target that depends on the
# binding_dependency_trackers and which has all the generated binding .h/.cpp
# depending on it, and then in the make commands for that target being able to
# check which exact binding_dependency_trackers changed.
binding_dependency_trackers := $(subst .webidl,Binding,$(all_webidl_files))
globalgen_targets := \ globalgen_targets := \
PrototypeList.h \ PrototypeList.h \
RegisterBindings.h \ RegisterBindings.h \
@ -43,6 +52,18 @@ globalgen_targets := \
UnionConversions.h \ UnionConversions.h \
$(NULL) $(NULL)
# Nasty hack: when the test/Makefile.in invokes us to do codegen, it
# uses a target of
# "export TestExampleInterface-example TestExampleProxyInterface-example".
# We don't actually need to load our .o.pp files in that case, so just
# pretend like we have no CPPSRCS if that's the target. It makes the
# test cycle much faster, which is why we're doing it.
#
# XXXbz We could try to cheat even more and only include our CPPSRCS
# when $(MAKECMDGOALS) contains libs, so that we can skip loading all
# those .o.pp when trying to make a single .cpp file too, but that
# would break |make FooBinding.o(bj)|. Ah, well.
ifneq (export TestExampleInterface-example TestExampleProxyInterface-example,$(MAKECMDGOALS))
CPPSRCS = \ CPPSRCS = \
$(linked_binding_cpp_files) \ $(linked_binding_cpp_files) \
$(filter %.cpp, $(globalgen_targets)) \ $(filter %.cpp, $(globalgen_targets)) \
@ -51,6 +72,7 @@ CPPSRCS = \
CallbackObject.cpp \ CallbackObject.cpp \
DOMJSProxyHandler.cpp \ DOMJSProxyHandler.cpp \
$(NULL) $(NULL)
endif
LOCAL_INCLUDES += -I$(topsrcdir)/js/xpconnect/src \ LOCAL_INCLUDES += -I$(topsrcdir)/js/xpconnect/src \
-I$(topsrcdir)/js/xpconnect/wrappers \ -I$(topsrcdir)/js/xpconnect/wrappers \
@ -80,11 +102,11 @@ LOCAL_INCLUDES += \
$(NULL) $(NULL)
endif endif
EXTRA_MDDEPEND_FILES := $(addsuffix .pp,$(binding_cpp_files) $(binding_header_files)) EXTRA_EXPORT_MDDEPEND_FILES := $(addsuffix .pp,$(binding_dependency_trackers))
EXPORTS_GENERATED_FILES := $(exported_binding_headers) EXPORTS_GENERATED_FILES := $(exported_binding_headers)
EXPORTS_GENERATED_DEST := $(DIST)/include/$(binding_include_path) EXPORTS_GENERATED_DEST := $(DIST)/include/$(binding_include_path)
EXPORTS_GENERATED_TARGET := webidl-export EXPORTS_GENERATED_TARGET := export
INSTALL_TARGETS += EXPORTS_GENERATED INSTALL_TARGETS += EXPORTS_GENERATED
ifdef GNU_CC ifdef GNU_CC
@ -93,14 +115,6 @@ endif
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk
# edmorley is sick of clobbering everytime someone adds an interface
$(CPPOBJS): PrototypeList.h
# We need to create a separate target so we can ensure that the pickle is
# done before generating headers.
export:: ParserResults.pkl
$(MAKE) webidl-export
# If you change bindinggen_dependencies here, change it in # If you change bindinggen_dependencies here, change it in
# dom/bindings/test/Makefile.in too. # dom/bindings/test/Makefile.in too.
bindinggen_dependencies := \ bindinggen_dependencies := \
@ -108,6 +122,7 @@ bindinggen_dependencies := \
Bindings.conf \ Bindings.conf \
Configuration.py \ Configuration.py \
Codegen.py \ Codegen.py \
ParserResults.pkl \
parser/WebIDL.py \ parser/WebIDL.py \
$(GLOBAL_DEPS) \ $(GLOBAL_DEPS) \
$(NULL) $(NULL)
@ -128,35 +143,20 @@ $(webidl_files): %: $(webidl_base)/%
$(test_webidl_files): %: $(srcdir)/test/% $(test_webidl_files): %: $(srcdir)/test/%
$(INSTALL) $(IFLAGS1) $(srcdir)/test/$* . $(INSTALL) $(IFLAGS1) $(srcdir)/test/$* .
$(binding_header_files): %Binding.h: $(bindinggen_dependencies) \ $(binding_header_files): .BindingGen
%.webidl \
$(call mkdir_deps,$(MDDEPDIR)) \
$(NULL)
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
$(PLY_INCLUDE) -I$(srcdir)/parser \
$(srcdir)/BindingGen.py header \
$(srcdir)/Bindings.conf \
$*Binding \
$(CURDIR)/ \
$*.webidl
$(binding_cpp_files): %Binding.cpp: $(bindinggen_dependencies) \ $(binding_cpp_files): .BindingGen
$(CURDIR)/%.webidl \
$(call mkdir_deps,$(MDDEPDIR)) \ # $(binding_dependency_trackers) pick up additional dependencies via .pp files
$(NULL) $(binding_dependency_trackers):
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \ # Just bring it up to date, if it's out of date, so that we'll know that
$(PLY_INCLUDE) -I$(srcdir)/parser \ # we have to redo binding generation and flag this prerequisite there as
$(srcdir)/BindingGen.py cpp \ # being newer than the bindinggen target.
$(srcdir)/Bindings.conf \ @$(TOUCH) $@
$*Binding \
$(CURDIR) \
$*.webidl
$(globalgen_targets): ParserResults.pkl $(globalgen_targets): ParserResults.pkl
%-example: $(bindinggen_dependencies) \ %-example: .BindingGen
ParserResults.pkl \
$(NULL)
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \ PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
$(PLY_INCLUDE) -I$(srcdir)/parser \ $(PLY_INCLUDE) -I$(srcdir)/parser \
$(srcdir)/ExampleGen.py \ $(srcdir)/ExampleGen.py \
@ -181,24 +181,52 @@ $(CACHE_DIR)/.done:
@$(TOUCH) $@ @$(TOUCH) $@
ParserResults.pkl: $(globalgen_dependencies) ParserResults.pkl: $(globalgen_dependencies)
# Running GlobalGen.py updates ParserResults.pkl as a side-effect
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \ PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
$(PLY_INCLUDE) -I$(srcdir)/parser \ $(PLY_INCLUDE) -I$(srcdir)/parser \
$(srcdir)/GlobalGen.py $(srcdir)/Bindings.conf . \ $(srcdir)/GlobalGen.py $(srcdir)/Bindings.conf . \
--cachedir=$(CACHE_DIR) \ --cachedir=$(CACHE_DIR) \
$(all_webidl_files) $(all_webidl_files)
.BindingGen: $(bindinggen_dependencies) $(binding_dependency_trackers)
# Make sure .deps actually exists, since we'll try to write to it from
# BindingGen.py but we're typically running in the export phase, which
# is before anyone has bothered creating .deps.
$(MKDIR) -p .deps
# Pass our long lists through files to try to avoid blowing
# out the command line
echo $(all_webidl_files) > .all-webidl-file-list
echo $? > .changed-dependency-list
# BindingGen.py will examine the changed dependency list to figure out
# what it really needs to regenerate.
$PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
$(PLY_INCLUDE) -I$(srcdir)/parser \
$(srcdir)/BindingGen.py \
$(srcdir)/Bindings.conf \
$(CURDIR) \
.all-webidl-file-list \
.changed-dependency-list
# Now touch the .BindingGen file so that we don't have to keep redoing
# all that until something else actually changes.
@$(TOUCH) $@
GARBAGE += \ GARBAGE += \
webidlyacc.py \ webidlyacc.py \
parser.out \ parser.out \
$(wildcard *-example.h) \ $(wildcard *-example.h) \
$(wildcard *-example.cpp) \ $(wildcard *-example.cpp) \
.BindingGen \
.all-webidl-file-list \
.changed-dependency-list \
$(binding_dependency_trackers) \
$(NULL) $(NULL)
# Make sure all binding header files are created during the export stage, so we # Make sure all binding header files are created during the export stage, so we
# don't have issues with .cpp files being compiled before we've generated the # don't have issues with .cpp files being compiled before we've generated the
# headers they depend on. This is really only needed for the test files, since # headers they depend on. This is really only needed for the test files, since
# the non-test headers are all exported above anyway. # the non-test headers are all exported above anyway. Note that this means that
webidl-export:: $(binding_header_files) # we do all of our codegen during export.
export:: $(binding_header_files)
distclean:: distclean::
-$(RM) \ -$(RM) \
@ -206,6 +234,5 @@ distclean::
$(binding_cpp_files) \ $(binding_cpp_files) \
$(all_webidl_files) \ $(all_webidl_files) \
$(globalgen_targets) \ $(globalgen_targets) \
ParserResults.pkl ParserResults.pkl \
$(NULL)
.PHONY: webidl-export

Просмотреть файл

@ -47,6 +47,7 @@ bindinggen_dependencies := \
../Bindings.conf \ ../Bindings.conf \
../Configuration.py \ ../Configuration.py \
../Codegen.py \ ../Codegen.py \
../ParserResults.pkl \
../parser/WebIDL.py \ ../parser/WebIDL.py \
../Makefile \ ../Makefile \
$(GLOBAL_DEPS) \ $(GLOBAL_DEPS) \
@ -89,19 +90,18 @@ endif
# rules.mk and running make with no target in this dir does the right thing. # rules.mk and running make with no target in this dir does the right thing.
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk
$(CPPSRCS): ../%Binding.cpp: $(bindinggen_dependencies) \ $(CPPSRCS): .BindingGen
../%.webidl \
TestExampleInterface-example \
TestExampleProxyInterface-example \
$(NULL)
$(MAKE) -C .. $*Binding.h
$(MAKE) -C .. $*Binding.cpp
TestExampleInterface-example: .BindingGen: $(bindinggen_dependencies) \
$(MAKE) -C .. TestExampleInterface-example $(test_webidl_files) \
$(NULL)
TestExampleProxyInterface-example: # The export phase in dom/bindings is what actually looks at
$(MAKE) -C .. TestExampleProxyInterface-example # dependencies and regenerates things as needed, so just go ahead and
# make that phase here. Also make our example interface files. If the
# target used here ever changes, change the conditional around
# $(CPPSRCS) in dom/bindings/Makefile.in.
$(MAKE) -C .. export TestExampleInterface-example TestExampleProxyInterface-example
@$(TOUCH) $@
check:: check::
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \ PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
@ -110,3 +110,27 @@ check::
check-interactive: check-interactive:
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \ PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
$(PLY_INCLUDE) $(srcdir)/../parser/runtests.py -q $(PLY_INCLUDE) $(srcdir)/../parser/runtests.py -q
# Since we define MOCHITEST_FILES, config/makefiles/mochitest.mk goes ahead and
# sets up a rule with libs:: in itm which makes our .DEFAULT_TARGET be "libs".
# Then ruls.mk does |.DEFAULT_TARGET ?= default| which leaves it as "libs". So
# if we make without an explicit target in this directory, we try to make
# "libs", but with a $(MAKECMDGOALS) of empty string. And then rules.mk
# helpfully does not include our *.o.pp files, since it includes them only if
# filtering some stuff out from $(MAKECMDGOALS) leaves it nonempty. The upshot
# is that if some headers change and we run make in this dir without an explicit
# target things don't get rebuilt.
#
# On the other hand, if we set .DEFAULT_TARGET to "default" explicitly here,
# then rules.mk will reinvoke make with "export" and "libs" but this time hey
# will be passed as explicit targets, show up in $(MAKECMDGOALS), and things
# will work. Do this at the end of our Makefile so the rest of the build system
# does not get a chance to muck with it after we set it.
.DEFAULT_GOAL := default
# Make sure to add .BindingGen to GARBAGE so we'll rebuild our example
# files if someone goes through and deletes GARBAGE all over, which
# will delete example files from our parent dir.
GARBAGE += \
.BindingGen \
$(NULL)

Просмотреть файл

@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * 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/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMClassInfo.h"
#include "nsDOMClassInfoID.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "SimToolKit.h" #include "SimToolKit.h"
#include "StkCommandEvent.h" #include "StkCommandEvent.h"
@ -12,8 +10,6 @@
#include "jsapi.h" #include "jsapi.h"
#include "jsfriendapi.h" #include "jsfriendapi.h"
DOMCI_DATA(MozStkCommandEvent, mozilla::dom::icc::StkCommandEvent)
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
namespace icc { namespace icc {
@ -32,7 +28,6 @@ NS_IMPL_RELEASE_INHERITED(StkCommandEvent, nsDOMEvent)
NS_INTERFACE_MAP_BEGIN(StkCommandEvent) NS_INTERFACE_MAP_BEGIN(StkCommandEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMMozStkCommandEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMMozStkCommandEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozStkCommandEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP NS_IMETHODIMP

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше