Skip to content

Commit

Permalink
Merge mozilla-central into services-central
Browse files Browse the repository at this point in the history
  • Loading branch information
indygreg committed Mar 19, 2013
2 parents 4160fa9 + a0b63dc commit 823b43a
Show file tree
Hide file tree
Showing 208 changed files with 4,118 additions and 1,783 deletions.
6 changes: 5 additions & 1 deletion b2g/chrome/content/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,8 @@ function isContentEditable(element) {
function getJSON(element) {
let type = element.type || "";
let value = element.value || "";
let max = element.max || "";
let min = element.min || "";

// Treat contenteditble element as a special text area field
if (isContentEditable(element)) {
Expand Down Expand Up @@ -550,7 +552,9 @@ function getJSON(element) {
"value": value,
"inputmode": inputmode,
"selectionStart": range[0],
"selectionEnd": range[1]
"selectionEnd": range[1],
"max": max,
"min": min
};
}

Expand Down
1 change: 1 addition & 0 deletions browser/base/content/test/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ _BROWSER_FILES = \
browser_bug749738.js \
browser_bug763468_perwindowpb.js \
browser_bug767836_perwindowpb.js \
browser_bug771331.js \
browser_bug783614.js \
browser_bug797677.js \
browser_bug816527.js \
Expand Down
82 changes: 82 additions & 0 deletions browser/base/content/test/browser_bug771331.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
const HTML_NS = "http://www.w3.org/1999/xhtml";

const INPUT_ID = "input1";
const FORM1_ID = "form1";
const FORM2_ID = "form2";
const CHANGE_INPUT_ID = "input2";

function test() {
waitForExplicitFinish();
let tab = gBrowser.selectedTab =
gBrowser.addTab("data:text/html;charset=utf-8," +
"<html><body>" +
"<form id='" + FORM1_ID + "'><input id='" + CHANGE_INPUT_ID + "'></form>" +
"<form id='" + FORM2_ID + "'></form>" +
"</body></html>");
tab.linkedBrowser.addEventListener("load", tabLoad, true);
}

function unexpectedContentEvent(evt) {
ok(false, "Received a " + evt.type + " event on content");
}

var gDoc = null;

function tabLoad() {
let tab = gBrowser.selectedTab;
tab.linkedBrowser.removeEventListener("load", tabLoad, true);
gDoc = gBrowser.selectedBrowser.contentDocument;
// These events shouldn't escape to content.
gDoc.addEventListener("DOMFormHasPassword", unexpectedContentEvent, false);
gDoc.defaultView.setTimeout(test_inputAdd, 0);
}

function test_inputAdd() {
gBrowser.addEventListener("DOMFormHasPassword", test_inputAddHandler, false);
let input = gDoc.createElementNS(HTML_NS, "input");
input.setAttribute("type", "password");
input.setAttribute("id", INPUT_ID);
input.setAttribute("data-test", "unique-attribute");
gDoc.getElementById(FORM1_ID).appendChild(input);
info("Done appending the input element");
}

function test_inputAddHandler(evt) {
gBrowser.removeEventListener(evt.type, test_inputAddHandler, false);
is(evt.target.id, FORM1_ID,
evt.type + " event targets correct form element (added password element)");
gDoc.defaultView.setTimeout(test_inputChangeForm, 0);
}

function test_inputChangeForm() {
gBrowser.addEventListener("DOMFormHasPassword", test_inputChangeFormHandler, false);
let input = gDoc.getElementById(INPUT_ID);
input.setAttribute("form", FORM2_ID);
}

function test_inputChangeFormHandler(evt) {
gBrowser.removeEventListener(evt.type, test_inputChangeFormHandler, false);
is(evt.target.id, FORM2_ID,
evt.type + " event targets correct form element (changed form)");
gDoc.defaultView.setTimeout(test_inputChangesType, 0);
}

function test_inputChangesType() {
gBrowser.addEventListener("DOMFormHasPassword", test_inputChangesTypeHandler, false);
let input = gDoc.getElementById(CHANGE_INPUT_ID);
input.setAttribute("type", "password");
}

function test_inputChangesTypeHandler(evt) {
gBrowser.removeEventListener(evt.type, test_inputChangesTypeHandler, false);
is(evt.target.id, FORM1_ID,
evt.type + " event targets correct form element (changed type)");
gDoc.defaultView.setTimeout(completeTest, 0);
}

function completeTest() {
ok(true, "Test completed");
gDoc.removeEventListener("DOMFormHasPassword", unexpectedContentEvent, false);
gBrowser.removeCurrentTab();
finish();
}
2 changes: 2 additions & 0 deletions browser/config/mozconfigs/macosx-universal/nightly
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ac_add_options --enable-codesighs
ac_add_options --disable-install-strip
ac_add_options --enable-signmar
ac_add_options --enable-profiling
ac_add_options --enable-instruments
ac_add_options --enable-dtrace

# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
Expand Down
9 changes: 2 additions & 7 deletions browser/metro/base/content/bindings/grid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,6 @@

<constructor>
<![CDATA[
// Bindings don't get bound until the item is displayed,
// so we have to reset the background color/image when we get
// created.
this.setColor();
this.setBackgroundImage();
]]>
</constructor>

Expand All @@ -537,7 +532,7 @@
<method name="setColor">
<body>
<![CDATA[
if (this.color != undefined) {
if (this._color != undefined) {
this._box.parentNode.setAttribute("customColorPresent", "true");
this._box.style.backgroundColor = this.color;
} else {
Expand All @@ -550,7 +545,7 @@
<method name="setBackgroundImage">
<body>
<![CDATA[
if (this.backgroundImage != undefined) {
if (this._backgroundImage != undefined) {
this._box.parentNode.setAttribute("customImagePresent", "true");
this._box.style.backgroundImage = this.backgroundImage;
} else {
Expand Down
3 changes: 3 additions & 0 deletions browser/metro/base/content/bookmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ BookmarksView.prototype = {
aItem.color = color;
return;
}
if (!aIconUri) {
return;
}
let url = Services.io.newURI(aIconUri.spec.replace("moz-anno:favicon:",""), "", null)
let ca = Components.classes["@mozilla.org/places/colorAnalyzer;1"]
.getService(Components.interfaces.mozIColorAnalyzer);
Expand Down
1 change: 0 additions & 1 deletion browser/metro/base/content/browser-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ let ScriptContexts = {};
["TopSitesView", "chrome://browser/content/TopSites.js"],
["TopSitesSnappedView", "chrome://browser/content/TopSites.js"],
["TopSitesStartView", "chrome://browser/content/TopSites.js"],
["InputSourceHelper", "chrome://browser/content/input.js"],
["Sanitizer", "chrome://browser/content/sanitize.js"],
["SSLExceptions", "chrome://browser/content/exceptions.js"],
#ifdef MOZ_SERVICES_SYNC
Expand Down
2 changes: 1 addition & 1 deletion browser/metro/base/content/browser-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,7 @@ var DialogUI = {

let currentNode;
let nodeIterator = xhr.responseXML.createNodeIterator(xhr.responseXML, NodeFilter.SHOW_TEXT, null, false);
while (currentNode = nodeIterator.nextNode()) {
while (!!(currentNode = nodeIterator.nextNode())) {
let trimmed = currentNode.nodeValue.replace(/^\s\s*/, "").replace(/\s\s*$/, "");
if (!trimmed.length)
currentNode.parentNode.removeChild(currentNode);
Expand Down
26 changes: 7 additions & 19 deletions browser/metro/base/content/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -1154,20 +1154,8 @@ var GestureModule = {
* versus an imprecise one (touch).
*/
var InputSourceHelper = {
_isPrecise: false,
_treatMouseAsTouch: false,

get isPrecise() {
return this._isPrecise;
},

get treatMouseAsTouch() {
return this._treatMouseAsTouch;
},

set treatMouseAsTouch(aVal) {
this._treatMouseAsTouch = aVal;
},
isPrecise: false,
treatMouseAsTouch: false,

init: function ish_init() {
// debug feature, make all input imprecise
Expand All @@ -1186,15 +1174,15 @@ var InputSourceHelper = {
case Ci.nsIDOMMouseEvent.MOZ_SOURCE_PEN:
case Ci.nsIDOMMouseEvent.MOZ_SOURCE_ERASER:
case Ci.nsIDOMMouseEvent.MOZ_SOURCE_CURSOR:
if (!this._isPrecise && !this.treatMouseAsTouch) {
this._isPrecise = true;
if (!this.isPrecise && !this.treatMouseAsTouch) {
this.isPrecise = true;
this._fire("MozPrecisePointer");
}
break;

case Ci.nsIDOMMouseEvent.MOZ_SOURCE_TOUCH:
if (this._isPrecise) {
this._isPrecise = false;
if (this.isPrecise) {
this.isPrecise = false;
this._fire("MozImprecisePointer");
}
break;
Expand All @@ -1205,7 +1193,7 @@ var InputSourceHelper = {
if (this.treatMouseAsTouch) {
this._fire("MozImprecisePointer");
} else {
if (this._isPrecise) {
if (this.isPrecise) {
this._fire("MozPrecisePointer");
} else {
this._fire("MozImprecisePointer");
Expand Down
11 changes: 10 additions & 1 deletion build/mobile/sutagent/android/DoCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -3317,7 +3317,16 @@ public String InstallApp(String sApp, OutputStream out)

try
{
pProc = Runtime.getRuntime().exec(this.getSuArgs("pm install -r " + sApp + " Cleanup;exit"));
// on android 4.2 and above, we want to pass the "-d" argument to pm so that version
// downgrades are allowed... (option unsupported in earlier versions)
String sPmCmd;

if (android.os.Build.VERSION.SDK_INT >= 17) { // JELLY_BEAN_MR1
sPmCmd = "pm install -r -d " + sApp + " Cleanup;exit";
} else {
sPmCmd = "pm install -r " + sApp + " Cleanup;exit";
}
pProc = Runtime.getRuntime().exec(this.getSuArgs(sPmCmd));
RedirOutputThread outThrd3 = new RedirOutputThread(pProc, out);
outThrd3.start();
try {
Expand Down
9 changes: 0 additions & 9 deletions build/valgrind/cross-architecture.sup
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,3 @@
fun:_ZN7mozilla3dom7workers13WorkerPrivate9DoRunLoopEP9JSContext
...
}
{
Bug 824647
Memcheck:Leak
fun:malloc
...
fun:_ZN12_GLOBAL__N_112HistogramGetEPKcjjjjPPN4base9HistogramE
fun:_ZN12_GLOBAL__N_113TelemetryImpl13HistogramFromERK19nsACString_internalS3_P9JSContextPN2JS5ValueE
...
}
13 changes: 13 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,18 @@ if test -n "$MOZ_SHARK"; then
AC_DEFINE(MOZ_SHARK)
fi

dnl ========================================================
dnl instruments
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(instruments,
[ --enable-instruments Enable instruments remote profiling. Implies --enable-profiling.],
MOZ_INSTRUMENTS=1,
MOZ_INSTRUMENTS= )
if test -n "$MOZ_INSTRUMENTS"; then
MOZ_PROFILING=1
AC_DEFINE(MOZ_INSTRUMENTS)
fi

dnl ========================================================
dnl callgrind
dnl ========================================================
Expand Down Expand Up @@ -8505,6 +8517,7 @@ AC_SUBST(MOZ_JSDEBUGGER)
AC_SUBST(MOZ_ENABLE_PROFILER_SPS)
AC_SUBST(MOZ_JPROF)
AC_SUBST(MOZ_SHARK)
AC_SUBST(MOZ_INSTRUMENTS)
AC_SUBST(MOZ_CALLGRIND)
AC_SUBST(MOZ_VTUNE)
AC_SUBST(MOZ_ETW)
Expand Down
4 changes: 2 additions & 2 deletions content/base/public/nsINode.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class nsINode : public mozilla::dom::EventTarget
// - HTMLFrameSetElement: mRowSpecs, mColSpecs
// - nsHTMLInputElement: mInputData, mFiles, mFileList, mStaticDocfileList
// - nsHTMLMapElement: mAreas
// - nsHTMLMediaElement: many!
// - HTMLMediaElement: many!
// - nsHTMLOutputElement: mDefaultValue, mTokenList
// - nsHTMLRowElement: mCells
// - nsHTMLSelectElement: mOptions, mRestoreState
Expand Down Expand Up @@ -360,7 +360,7 @@ class nsINode : public mozilla::dom::EventTarget
/** data nodes (comments, PIs, text). Nodes of this type always
returns a non-null value for nsIContent::GetText() */
eDATA_NODE = 1 << 8,
/** nsHTMLMediaElement */
/** HTMLMediaElement */
eMEDIA = 1 << 9,
/** animation elements */
eANIMATION = 1 << 10,
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsContentUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
#include "nsIBidiKeyboard.h"
#endif
#ifdef MOZ_MEDIA
#include "nsHTMLMediaElement.h"
#include "mozilla/dom/HTMLMediaElement.h"
#endif

extern "C" int MOZ_XMLTranslateEntity(const char* ptr, const char* end,
Expand Down
6 changes: 3 additions & 3 deletions content/base/src/nsDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
#include "nsHtml5TreeOpExecutor.h"
#include "nsIDOMElementReplaceEvent.h"
#ifdef MOZ_MEDIA
#include "nsHTMLMediaElement.h"
#include "mozilla/dom/HTMLMediaElement.h"
#endif // MOZ_MEDIA
#ifdef MOZ_WEBRTC
#include "IPeerConnection.h"
Expand Down Expand Up @@ -3979,7 +3979,7 @@ NotifyActivityChanged(nsIContent *aContent, void *aUnused)
#ifdef MOZ_MEDIA
nsCOMPtr<nsIDOMHTMLMediaElement> domMediaElem(do_QueryInterface(aContent));
if (domMediaElem) {
nsHTMLMediaElement* mediaElem = static_cast<nsHTMLMediaElement*>(aContent);
HTMLMediaElement* mediaElem = static_cast<HTMLMediaElement*>(aContent);
mediaElem->NotifyOwnerDocumentActivityChanged();
}
#endif
Expand Down Expand Up @@ -8955,7 +8955,7 @@ NotifyAudioAvailableListener(nsIContent *aContent, void *aUnused)
#ifdef MOZ_MEDIA
nsCOMPtr<nsIDOMHTMLMediaElement> domMediaElem(do_QueryInterface(aContent));
if (domMediaElem) {
nsHTMLMediaElement* mediaElem = static_cast<nsHTMLMediaElement*>(aContent);
HTMLMediaElement* mediaElem = static_cast<HTMLMediaElement*>(aContent);
mediaElem->NotifyAudioAvailableListener();
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions content/base/src/nsNodeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "nsBindingManager.h"
#include "nsGenericHTMLElement.h"
#ifdef MOZ_MEDIA
#include "nsHTMLMediaElement.h"
#include "mozilla/dom/HTMLMediaElement.h"
#endif // MOZ_MEDIA
#include "nsWrapperCacheInlines.h"
#include "nsObjectLoadingContent.h"
Expand Down Expand Up @@ -508,7 +508,7 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
#ifdef MOZ_MEDIA
nsCOMPtr<nsIDOMHTMLMediaElement> domMediaElem(do_QueryInterface(aNode));
if (domMediaElem) {
nsHTMLMediaElement* mediaElem = static_cast<nsHTMLMediaElement*>(aNode);
HTMLMediaElement* mediaElem = static_cast<HTMLMediaElement*>(aNode);
mediaElem->NotifyOwnerDocumentActivityChanged();
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsScriptLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

#include "nsCOMPtr.h"
#include "nsIScriptElement.h"
#include "nsIURI.h"
#include "nsCOMArray.h"
#include "nsTArray.h"
#include "nsAutoPtr.h"
#include "nsIDocument.h"
#include "nsIStreamLoader.h"

class nsScriptLoadRequest;
class nsIURI;

//////////////////////////////////////////////////////////////
// Script loader implementation
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsStyleLinkElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "nsIDOMLinkStyle.h"
#include "nsIStyleSheetLinkingElement.h"
#include "nsCSSStyleSheet.h"
#include "nsIURI.h"
#include "nsTArray.h"
#include "mozilla/CORSMode.h"

Expand All @@ -28,6 +27,7 @@
#define ALTERNATE 0x00000010

class nsIDocument;
class nsIURI;

class nsStyleLinkElement : public nsIDOMLinkStyle,
public nsIStyleSheetLinkingElement
Expand Down
Loading

0 comments on commit 823b43a

Please sign in to comment.