Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge inbound to m-c. a=merge
  • Loading branch information
rvandermeulen committed Oct 12, 2014
2 parents 224d0c1 + dafe7cc commit 9fcdf86
Show file tree
Hide file tree
Showing 45 changed files with 619 additions and 239 deletions.
2 changes: 1 addition & 1 deletion browser/components/translation/translation-infobar.xml
Expand Up @@ -32,7 +32,7 @@
<xul:description class="translation-welcome-body" anonid="welcomeBody"/>
<xul:hbox align="center">
<xul:label anonid="learnMore" class="plain text-link"
onclick="openUILinkIn('https://support.mozilla.org/en-US/products/firefox/automatic-translation', 'tab'); this.parentNode.parentNode.parentNode.hidePopup();"/>
onclick="openUILinkIn('https://support.mozilla.org/kb/automatic-translation', 'tab'); this.parentNode.parentNode.parentNode.hidePopup();"/>
<xul:spacer flex="1"/>
<xul:button class="translate-infobar-element" anonid="thanksButton"
onclick="this.parentNode.parentNode.parentNode.hidePopup();"/>
Expand Down
6 changes: 0 additions & 6 deletions build/automation-build.mk
Expand Up @@ -32,12 +32,6 @@ else
AUTOMATION_PPARGS += -DIS_LINUX=0
endif

ifeq ($(MOZ_BUILD_APP),camino)
AUTOMATION_PPARGS += -DIS_CAMINO=1
else
AUTOMATION_PPARGS += -DIS_CAMINO=0
endif

ifeq ($(host_os), cygwin)
AUTOMATION_PPARGS += -DIS_CYGWIN=1
endif
Expand Down
9 changes: 2 additions & 7 deletions build/automation.py.in
Expand Up @@ -66,7 +66,6 @@ _APP_STATUS_CERTIFIED = 3
#else
_IS_CYGWIN = False
#endif
#expand _IS_CAMINO = __IS_CAMINO__ != 0
#expand _BIN_SUFFIX = __BIN_SUFFIX__

#expand _DEFAULT_APP = "./" + __BROWSER_PATH__
Expand Down Expand Up @@ -140,7 +139,6 @@ class Automation(object):
IS_MAC = _IS_MAC
IS_LINUX = _IS_LINUX
IS_CYGWIN = _IS_CYGWIN
IS_CAMINO = _IS_CAMINO
BIN_SUFFIX = _BIN_SUFFIX

UNIXISH = not IS_WIN32 and not IS_MAC
Expand Down Expand Up @@ -750,7 +748,7 @@ class Automation(object):
""" build the application command line """

cmd = os.path.abspath(app)
if self.IS_MAC and not self.IS_CAMINO and os.path.exists(cmd + "-bin"):
if self.IS_MAC and os.path.exists(cmd + "-bin"):
# Prefer 'app-bin' in case 'app' is a shell script.
# We can remove this hack once bug 673899 etc are fixed.
cmd += "-bin"
Expand All @@ -772,10 +770,7 @@ class Automation(object):

args.extend(("-no-remote", "-profile", profileDirectory))
if testURL is not None:
if self.IS_CAMINO:
args.extend(("-url", testURL))
else:
args.append((testURL))
args.append((testURL))
args.extend(extraArgs)
return cmd, args

Expand Down
4 changes: 0 additions & 4 deletions build/binary-location.mk
Expand Up @@ -12,12 +12,8 @@ endif

TARGET_DIST = $(TARGET_DEPTH)/dist

ifeq ($(MOZ_BUILD_APP),camino)
browser_path = $(TARGET_DIST)/Camino.app/Contents/MacOS/Camino
else
ifeq ($(OS_ARCH),Darwin)
browser_path = $(TARGET_DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(program)
else
browser_path = $(TARGET_DIST)/bin/$(program)
endif
endif
1 change: 0 additions & 1 deletion build/mach_bootstrap.py
Expand Up @@ -45,7 +45,6 @@
'testing/xpcshell',
'testing/web-platform',
'testing/web-platform/harness',
'testing/marionette/client',
'testing/marionette/client/marionette',
'testing/marionette/transport',
'testing/mozbase/mozcrash',
Expand Down
14 changes: 11 additions & 3 deletions dom/base/URLSearchParams.cpp
Expand Up @@ -257,11 +257,19 @@ void
URLSearchParams::Set(const nsAString& aName, const nsAString& aValue)
{
Param* param = nullptr;
for (uint32_t i = 0, len = mSearchParams.Length(); i < len; ++i) {
if (mSearchParams[i].mKey.Equals(aName)) {
for (uint32_t i = 0, len = mSearchParams.Length(); i < len;) {
if (!mSearchParams[i].mKey.Equals(aName)) {
++i;
continue;
}
if (!param) {
param = &mSearchParams[i];
break;
++i;
continue;
}
// Remove duplicates.
mSearchParams.RemoveElementAt(i);
--len;
}

if (!param) {
Expand Down
41 changes: 40 additions & 1 deletion dom/base/test/test_urlSearchParams.html
Expand Up @@ -288,6 +288,44 @@
runTest();
}

function testSet() {
var u = new URLSearchParams();
u.set('a','b');
u.set('e','c');
u.set('i','d');
u.set('o','f');
u.set('u','g');

is(u.get('a'), 'b', "URL.searchParams.get('a') should return b");
is(u.getAll('a').length, 1, "URLSearchParams.getAll('a').length should be 1");

u.set('a','h1');
u.set('a','h2');
u.set('a','h3');
u.set('a','h4');
is(u.get('a'), 'h4', "URL.searchParams.get('a') should return h4");
is(u.getAll('a').length, 1, "URLSearchParams.getAll('a').length should be 1");

is(u.get('e'), 'c', "URL.searchParams.get('e') should return c");
is(u.get('i'), 'd', "URL.searchParams.get('i') should return d");
is(u.get('o'), 'f', "URL.searchParams.get('o') should return f");
is(u.get('u'), 'g', "URL.searchParams.get('u') should return g");

is(u.getAll('e').length, 1, "URLSearchParams.getAll('e').length should be 1");
is(u.getAll('i').length, 1, "URLSearchParams.getAll('i').length should be 1");
is(u.getAll('o').length, 1, "URLSearchParams.getAll('o').length should be 1");
is(u.getAll('u').length, 1, "URLSearchParams.getAll('u').length should be 1");

u = new URLSearchParams("name1=value1&name1=value2&name1=value3");
is(u.get('name1'), 'value1', "URL.searchParams.get('name1') should return value1");
is(u.getAll('name1').length, 3, "URLSearchParams.getAll('name1').length should be 3");
u.set('name1','firstPair');
is(u.get('name1'), 'firstPair', "URL.searchParams.get('name1') should return firstPair");
is(u.getAll('name1').length, 1, "URLSearchParams.getAll('name1').length should be 1");

runTest();
}

var tests = [
testSimpleURLSearchParams,
testCopyURLSearchParams,
Expand All @@ -299,7 +337,8 @@
testMultiURL,
testOrdering,
testDelete,
testGetNULL
testGetNULL,
testSet
];

function runTest() {
Expand Down
10 changes: 3 additions & 7 deletions dom/canvas/WebGLContextGL.cpp
Expand Up @@ -3875,13 +3875,9 @@ WebGLContext::TexSubImage2D_base(TexImageTarget texImageTarget, GLint level,

const WebGLTexture::ImageInfo& imageInfo = tex->ImageInfoAt(texImageTarget, level);
const TexInternalFormat existingEffectiveInternalFormat = imageInfo.EffectiveInternalFormat();
TexInternalFormat existingUnsizedInternalFormat = LOCAL_GL_NONE;
TexType existingType = LOCAL_GL_NONE;
UnsizedInternalFormatAndTypeFromEffectiveInternalFormat(existingEffectiveInternalFormat,
&existingUnsizedInternalFormat,
&existingType);

if (!ValidateTexImage(2, texImageTarget, level, existingUnsizedInternalFormat.get(),
if (!ValidateTexImage(2, texImageTarget, level,
existingEffectiveInternalFormat.get(),
xoffset, yoffset, 0,
width, height, 0,
0, format, type, func))
Expand All @@ -3892,7 +3888,7 @@ WebGLContext::TexSubImage2D_base(TexImageTarget texImageTarget, GLint level,
if (!ValidateTexInputData(type, jsArrayType, func))
return;

if (type != existingType) {
if (type != TypeFromInternalFormat(existingEffectiveInternalFormat)) {
return ErrorInvalidOperation("texSubImage2D: type differs from that of the existing image");
}

Expand Down
30 changes: 26 additions & 4 deletions dom/canvas/WebGLContextValidate.cpp
Expand Up @@ -1142,22 +1142,44 @@ WebGLContext::ValidateTexImage(GLuint dims, TexImageTarget texImageTarget,
if (!ValidateTexImageFormatAndType(format, type, func))
return false;

if (!TexInternalFormat::IsValueLegal(internalFormat)) {
ErrorInvalidEnum("%s: invalid internalformat enum %s", info, EnumName(internalFormat));
return false;
}
TexInternalFormat unsizedInternalFormat =
UnsizedInternalFormatFromInternalFormat(internalFormat);

if (IsCompressedFunc(func)) {
if (!ValidateCompTexImageInternalFormat(internalFormat, func)) {
return false;
}
} else if (IsCopyFunc(func)) {
if (!ValidateCopyTexImageInternalFormat(internalFormat, func)) {
if (!ValidateCopyTexImageInternalFormat(unsizedInternalFormat.get(), func)) {
return false;
}
} else if (format != internalFormat) {
} else if (format != unsizedInternalFormat) {
if (IsWebGL2()) {
// In WebGL2, it's OK to have internalformat != format if internalformat is the sized
// internal format corresponding to the (format, type) pair according to Table 3.2
// in the OpenGL ES 3.0.3 spec.
if (internalFormat != EffectiveInternalFormatFromInternalFormatAndType(format, type)) {
ErrorInvalidOperation("%s: internalformat does not match format and type", info);
return false;
bool exceptionallyAllowed = false;
if (internalFormat == LOCAL_GL_SRGB8_ALPHA8 &&
format == LOCAL_GL_RGBA &&
type == LOCAL_GL_UNSIGNED_BYTE)
{
exceptionallyAllowed = true;
}
else if (internalFormat == LOCAL_GL_SRGB8 &&
format == LOCAL_GL_RGB &&
type == LOCAL_GL_UNSIGNED_BYTE)
{
exceptionallyAllowed = true;
}
if (!exceptionallyAllowed) {
ErrorInvalidOperation("%s: internalformat does not match format and type", info);
return false;
}
}
} else {
// in WebGL 1, format must be equal to internalformat
Expand Down
30 changes: 24 additions & 6 deletions dom/inputmethod/forms.js
Expand Up @@ -224,7 +224,8 @@ let FormAssistant = {
scrollIntoViewTimeout: null,
_focusedElement: null,
_focusCounter: 0, // up one for every time we focus a new element
_observer: null,
_focusDeleteObserver: null,
_focusContentObserver: null,
_documentEncoder: null,
_editor: null,
_editing: false,
Expand All @@ -250,9 +251,13 @@ let FormAssistant = {

if (this.focusedElement) {
this.focusedElement.removeEventListener('compositionend', this);
if (this._observer) {
this._observer.disconnect();
this._observer = null;
if (this._focusDeleteObserver) {
this._focusDeleteObserver.disconnect();
this._focusDeleteObserver = null;
}
if (this._focusContentObserver) {
this._focusContentObserver.disconnect();
this._focusContentObserver = null;
}
if (this._selectionPrivate) {
this._selectionPrivate.removeSelectionListener(this);
Expand Down Expand Up @@ -292,7 +297,7 @@ let FormAssistant = {

// If our focusedElement is removed from DOM we want to handle it properly
let MutationObserver = element.ownerDocument.defaultView.MutationObserver;
this._observer = new MutationObserver(function(mutations) {
this._focusDeleteObserver = new MutationObserver(function(mutations) {
var del = [].some.call(mutations, function(m) {
return [].some.call(m.removedNodes, function(n) {
return n.contains(element);
Expand All @@ -305,10 +310,23 @@ let FormAssistant = {
}
});

this._observer.observe(element.ownerDocument.body, {
this._focusDeleteObserver.observe(element.ownerDocument.body, {
childList: true,
subtree: true
});

// If contenteditable, also add a mutation observer on its content and
// call selectionChanged when a change occurs
if (isContentEditable(element)) {
this._focusContentObserver = new MutationObserver(function() {
this.updateSelection();
}.bind(this));

this._focusContentObserver.observe(element, {
childList: true,
subtree: true
});
}
}

this.focusedElement = element;
Expand Down
17 changes: 17 additions & 0 deletions dom/inputmethod/mochitest/file_test_contenteditable.html
@@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<html>
<body>
<div id="text" contenteditable>Jan Jongboom</div>
<script type="application/javascript;version=1.7">
var t = document.querySelector('#text');

t.focus();
var range = document.createRange();
range.selectNodeContents(t);
range.collapse(false);
var selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
</script>
</body>
</html>
2 changes: 2 additions & 0 deletions dom/inputmethod/mochitest/mochitest.ini
Expand Up @@ -6,6 +6,7 @@ support-files =
file_inputmethod.html
file_inputmethod_1043828.html
file_test_app.html
file_test_contenteditable.html
file_test_sendkey_cancel.html
file_test_sms_app.html
file_test_sms_app_1066515.html
Expand All @@ -18,6 +19,7 @@ support-files =
[test_bug978918.html]
[test_bug1026997.html]
[test_bug1043828.html]
[test_bug1059163.html]
[test_bug1066515.html]
[test_delete_focused_element.html]
[test_sendkey_cancel.html]
Expand Down

0 comments on commit 9fcdf86

Please sign in to comment.