Merge m-c to fx-team

This commit is contained in:
Joe Walker 2012-12-13 17:42:37 +00:00
commit 349f95edf3
374 changed files with 16068 additions and 7036 deletions

View File

@ -59,9 +59,6 @@ const uint32_t USE_ROLE_STRING = 0;
static gAccessibles = 0;
#endif
EXTERN_C GUID CDECL CLSID_Accessible =
{ 0x61044601, 0xa811, 0x4e2b, { 0xbb, 0xba, 0x17, 0xbf, 0xab, 0xd3, 0x29, 0xd7 } };
static const int32_t kIEnumVariantDisconnected = -1;
////////////////////////////////////////////////////////////////////////////////
@ -70,7 +67,7 @@ static const int32_t kIEnumVariantDisconnected = -1;
ITypeInfo* AccessibleWrap::gTypeInfo = NULL;
NS_IMPL_ISUPPORTS_INHERITED0(AccessibleWrap, Accessible);
NS_IMPL_ISUPPORTS_INHERITED0(AccessibleWrap, Accessible)
//-----------------------------------------------------
// IUnknown interface methods - see iunknown.h for documentation
@ -97,7 +94,7 @@ AccessibleWrap::QueryInterface(REFIID iid, void** ppv)
else if (IID_IAccessible2 == iid && !Compatibility::IsIA2Off())
*ppv = static_cast<IAccessible2*>(this);
else if (IID_ISimpleDOMNode == iid) {
if (IsDefunct() || !HasOwnContent() && !IsDoc())
if (IsDefunct() || (!HasOwnContent() && !IsDoc()))
return E_NOINTERFACE;
*ppv = new sdnAccessible(GetNode());
@ -145,7 +142,7 @@ AccessibleWrap::QueryService(REFGUID aGuidService, REFIID aIID,
// UIA IAccessibleEx
if (aGuidService == IID_IAccessibleEx &&
Preferences::GetBool("accessibility.uia.enable")) {
IAccessibleEx* accEx = new uiaRawElmProvider(this);
uiaRawElmProvider* accEx = new uiaRawElmProvider(this);
HRESULT hr = accEx->QueryInterface(aIID, aInstancePtr);
if (FAILED(hr))
delete accEx;
@ -175,8 +172,8 @@ AccessibleWrap::get_accParent( IDispatch __RPC_FAR *__RPC_FAR *ppdispParent)
// Return window system accessible object for root document and tab document
// accessibles.
if (!doc->ParentDocument() ||
nsWinUtils::IsWindowEmulationStarted() &&
nsCoreUtils::IsTabDocument(doc->DocumentNode())) {
(nsWinUtils::IsWindowEmulationStarted() &&
nsCoreUtils::IsTabDocument(doc->DocumentNode()))) {
HWND hwnd = static_cast<HWND>(doc->GetNativeWindow());
if (hwnd && SUCCEEDED(::AccessibleObjectFromWindow(hwnd, OBJID_WINDOW,
IID_IAccessible,
@ -585,7 +582,7 @@ AccessibleWrap::get_accFocus(
// This helper class implements IEnumVARIANT for a nsIArray containing nsIAccessible objects.
class AccessibleEnumerator : public IEnumVARIANT
class AccessibleEnumerator MOZ_FINAL : public IEnumVARIANT
{
public:
AccessibleEnumerator(nsIArray* aArray) : mArray(aArray), mCurIndex(0) { }
@ -1102,7 +1099,7 @@ AccessibleWrap::get_relation(long aRelationIndex,
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
uint32_t relIdx = 0;
long relIdx = 0;
for (uint32_t relType = nsIAccessibleRelation::RELATION_FIRST;
relType <= nsIAccessibleRelation::RELATION_LAST; relType++) {
Relation rel = RelationByType(relType);
@ -1569,8 +1566,7 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
eventType < nsIAccessibleEvent::EVENT_LAST_ENTRY,
NS_ERROR_FAILURE);
uint32_t winLastEntry = gWinEventMap[nsIAccessibleEvent::EVENT_LAST_ENTRY];
NS_ASSERTION(winLastEntry == kEVENT_LAST_ENTRY,
NS_ASSERTION(gWinEventMap[nsIAccessibleEvent::EVENT_LAST_ENTRY] == kEVENT_LAST_ENTRY,
"MSAA event map skewed");
uint32_t winEvent = gWinEventMap[eventType];
@ -1711,7 +1707,7 @@ AccessibleWrap::ConvertToIA2Attributes(nsIPersistentProperties *aAttributes,
if (NS_FAILED(propElem->GetKey(name)))
return E_FAIL;
uint32_t offset = 0;
int32_t offset = 0;
while ((offset = name.FindCharInSet(kCharsToEscape, offset)) != kNotFound) {
name.Insert('\\', offset);
offset += 2;

View File

@ -259,7 +259,7 @@ DocAccessibleWrap::DoInitialUpdate()
a11y::RootAccessible* rootDocument = RootAccessible();
mozilla::WindowsHandle nativeData = NULL;
mozilla::WindowsHandle nativeData = 0;
if (tabChild)
tabChild->SendGetWidgetNativeData(&nativeData);
else

View File

@ -18,8 +18,8 @@ namespace a11y {
class ChildrenEnumVariant MOZ_FINAL : public IEnumVARIANT
{
public:
ChildrenEnumVariant(AccessibleWrap* aAnchor) : mAnchorAcc(aAnchor),
mCurAcc(mAnchorAcc->GetChildAt(0)), mCurIndex(0), mRefCnt(0) { }
ChildrenEnumVariant(AccessibleWrap* aAnchor) : mRefCnt(0), mAnchorAcc(aAnchor),
mCurAcc(mAnchorAcc->GetChildAt(0)), mCurIndex(0) { }
// IUnknown
DECL_IUNKNOWN
@ -43,8 +43,8 @@ private:
ChildrenEnumVariant& operator =(const ChildrenEnumVariant&) MOZ_DELETE;
ChildrenEnumVariant(const ChildrenEnumVariant& aEnumVariant) :
mAnchorAcc(aEnumVariant.mAnchorAcc), mCurAcc(aEnumVariant.mCurAcc),
mCurIndex(aEnumVariant.mCurIndex), mRefCnt(0) { }
mRefCnt(0), mAnchorAcc(aEnumVariant.mAnchorAcc), mCurAcc(aEnumVariant.mCurAcc),
mCurIndex(aEnumVariant.mCurIndex) { }
virtual ~ChildrenEnumVariant() { }
protected:

View File

@ -15,5 +15,5 @@ NS_IMPL_ISUPPORTS_INHERITED0(ImageAccessibleWrap,
IMPL_IUNKNOWN_INHERITED1(ImageAccessibleWrap,
AccessibleWrap,
ia2AccessibleImage);
ia2AccessibleImage)

View File

@ -160,7 +160,7 @@ ia2AccessibleRelation::get_target(long aTargetIndex, IUnknown **aTarget)
{
A11Y_TRYBLOCK_BEGIN
if (aTargetIndex < 0 || aTargetIndex >= mTargets.Length() || !aTarget)
if (aTargetIndex < 0 || (uint32_t)aTargetIndex >= mTargets.Length() || !aTarget)
return E_INVALIDARG;
mTargets[aTargetIndex]->QueryNativeInterface(IID_IUnknown, (void**) aTarget);
@ -179,11 +179,11 @@ ia2AccessibleRelation::get_targets(long aMaxTargets, IUnknown **aTargets,
return E_INVALIDARG;
*aNTargets = 0;
uint32_t maxTargets = mTargets.Length();
long maxTargets = mTargets.Length();
if (maxTargets > aMaxTargets)
maxTargets = aMaxTargets;
for (uint32_t idx = 0; idx < maxTargets; idx++)
for (long idx = 0; idx < maxTargets; idx++)
get_target(idx, aTargets + idx);
*aNTargets = maxTargets;

View File

@ -15,7 +15,7 @@
namespace mozilla {
namespace a11y {
class sdnAccessible : public ISimpleDOMNode
class sdnAccessible MOZ_FINAL : public ISimpleDOMNode
{
public:
sdnAccessible(nsINode* aNode) : mNode(aNode) { }

View File

@ -77,7 +77,7 @@ uiaRawElmProvider::GetRuntimeId(__RPC__deref_out_opt SAFEARRAY** aRuntimeIds)
if (!*aRuntimeIds)
return E_OUTOFMEMORY;
for (LONG i = 0; i < ArrayLength(ids); i++)
for (LONG i = 0; i < (LONG)ArrayLength(ids); i++)
SafeArrayPutElement(*aRuntimeIds, &i, (void*)&(ids[i]));
return S_OK;

View File

@ -23,7 +23,7 @@ class uiaRawElmProvider MOZ_FINAL : public IAccessibleEx,
public IRawElementProviderSimple
{
public:
uiaRawElmProvider(AccessibleWrap* aAcc) : mAcc(aAcc), mRefCnt(0) { }
uiaRawElmProvider(AccessibleWrap* aAcc) : mRefCnt(0), mAcc(aAcc) { }
// IUnknown
DECL_IUNKNOWN

View File

@ -403,6 +403,7 @@ pref("dom.mozAlarms.enabled", true);
// NetworkStats
#ifdef MOZ_B2G_RIL
pref("dom.mozNetworkStats.enabled", true);
pref("ril.lastKnownMcc", 724);
#endif
// WebSettings

View File

@ -107,6 +107,9 @@ var shell = {
return;
}
// purge the queue.
this.CrashSubmit.pruneSavedDumps();
try {
// Check if we should automatically submit this crash.
if (Services.prefs.getBoolPref("app.reportCrashes")) {
@ -135,7 +138,7 @@ var shell = {
&& network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) {
shell.CrashSubmit.submit(aCrashID);
// purge the queue.
// submit the pending queue.
let pending = shell.CrashSubmit.pendingIDs();
for (let crashid of pending) {
shell.CrashSubmit.submit(crashid);

View File

@ -137,6 +137,11 @@ let SocialUI = {
}
},
nonBrowserWindowInit: function SocialUI_nonBrowserInit() {
// Disable the social menu item in non-browser windows
document.getElementById("menu_socialAmbientMenu").hidden = true;
},
// Miscellaneous helpers
showProfile: function SocialUI_showProfile() {
if (Social.haveLoggedInUser())
@ -1134,6 +1139,7 @@ var SocialSidebar = {
if (!sbrowser.hasAttribute("origin"))
return;
sbrowser.stop();
sbrowser.removeAttribute("origin");
sbrowser.setAttribute("src", "about:blank");
SocialFlyout.unload();

View File

@ -1645,6 +1645,8 @@ var gBrowserInit = {
}
}
SocialUI.nonBrowserWindowInit();
this._delayedStartupTimeoutId = setTimeout(this.nonBrowserWindowDelayedStartup.bind(this), 0);
},

View File

@ -432,8 +432,7 @@ nsContextMenu.prototype = {
setTarget: function (aNode, aRangeParent, aRangeOffset) {
const xulNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
if (aNode.namespaceURI == xulNS ||
aNode.nodeType == Node.DOCUMENT_NODE ||
this.isTargetAFormControl(aNode)) {
aNode.nodeType == Node.DOCUMENT_NODE) {
this.shouldDisplay = false;
return;
}
@ -1291,18 +1290,6 @@ nsContextMenu.prototype = {
"contextMenu.hasBGImage = " + this.hasBGImage + "\n";
},
// Returns true if aNode is a from control (except text boxes and images).
// This is used to disable the context menu for form controls.
isTargetAFormControl: function(aNode) {
if (aNode instanceof HTMLInputElement)
return (!aNode.mozIsTextField(false) && aNode.type != "image");
return (aNode instanceof HTMLButtonElement) ||
(aNode instanceof HTMLSelectElement) ||
(aNode instanceof HTMLOptionElement) ||
(aNode instanceof HTMLOptGroupElement);
},
isTargetATextBox: function(node) {
if (node instanceof HTMLInputElement)
return node.mozIsTextField(false);

View File

@ -34,15 +34,15 @@ function test() {
testInput("text", true);
testInput("password", true);
testInput("image", true);
testInput("button", false);
testInput("submit", false);
testInput("reset", false);
testInput("checkbox", false);
testInput("radio", false);
testElement("button", false);
testElement("select", false);
testElement("option", false);
testElement("optgroup", false);
testInput("button", true);
testInput("submit", true);
testInput("reset", true);
testInput("checkbox", true);
testInput("radio", true);
testElement("button", true);
testElement("select", true);
testElement("option", true);
testElement("optgroup", true);
// cleanup
document.popupNode = null;

View File

@ -98,7 +98,9 @@ function observeProviderSet(cb) {
function waitForProviderLoad(cb) {
waitForCondition(function() {
let sbrowser = document.getElementById("social-sidebar-browser");
return Social.provider.profile &&
Social.provider.profile.displayName;
Social.provider.profile.displayName &&
sbrowser.docShellIsActive;
}, cb, "waitForProviderLoad: provider profile was not set");
}

View File

@ -22,8 +22,6 @@ MOCHITEST_BROWSER_FILES = \
browser_form_restore_events_sample.html \
browser_formdata_format.js \
browser_formdata_format_sample.html \
browser_248970_a.js \
browser_248970_b.js \
browser_248970_b_sample.html \
browser_339445.js \
browser_339445_sample.html \
@ -142,6 +140,8 @@ MOCHITEST_BROWSER_FILES += \
$(NULL)
else
MOCHITEST_BROWSER_FILES += \
browser_248970_a.js \
browser_248970_b.js \
browser_354894.js \
browser_394759_privatebrowsing.js \
$(NULL)

View File

@ -99,10 +99,16 @@ endif
# Put a useful .gdbinit in the bin directory, to be picked up automatically
# by GDB when we debug executables there.
GDBINIT_FILES := .gdbinit
# NOTE: Keep .gdbinit in the topsrcdir for people who run gdb from the topsrcdir.
GDBINIT_FILES := $(topsrcdir)/.gdbinit
GDBINIT_DEST = $(FINAL_TARGET)
INSTALL_TARGETS += GDBINIT
PYTHON_UNIT_TESTS := \
tests/unit-ConfigStatus.py \
tests/test.py \
$(NULL)
include $(topsrcdir)/config/rules.mk
# we install to _leaktest/
@ -169,11 +175,6 @@ ifdef ENABLE_TESTS
libs:: $(topsrcdir)/tools/rb/fix_stack_using_bpsyms.py
$(INSTALL) $< $(DIST)/bin
# Unit tests for ManifestParser
check::
$(PYTHON) $(topsrcdir)/config/pythonpath.py -I$(srcdir) \
$(srcdir)/tests/test.py
ifeq ($(OS_ARCH),Darwin)
libs:: $(topsrcdir)/tools/rb/fix_macosx_stack.py
$(INSTALL) $< $(DIST)/bin
@ -266,7 +267,4 @@ endif
GARBAGE += $(srcdir)/automationutils.pyc
# Test for ConfigStatus.py
check::
$(PYTHON) $(srcdir)/tests/unit-ConfigStatus.py
endif # ENABLE_TESTS

View File

@ -8,11 +8,16 @@ Parses and evaluates simple statements for Preprocessor:
Expression currently supports the following grammar, whitespace is ignored:
expression :
and_cond ( '||' expression ) ? ;
and_cond:
test ( '&&' and_cond ) ? ;
test:
unary ( ( '==' | '!=' ) unary ) ? ;
unary :
'!'? value ;
value :
[0-9]+ # integer
| 'defined(' \w+ ')'
| \w+ # string identifier or value;
"""
@ -27,10 +32,52 @@ class Expression:
self.content = expression_string
self.offset = 0
self.__ignore_whitespace()
self.e = self.__get_equality()
self.e = self.__get_logical_or()
if self.content:
raise Expression.ParseError, self
def __get_logical_or(self):
"""
Production: and_cond ( '||' expression ) ?
"""
if not len(self.content):
return None
rv = Expression.__AST("logical_op")
# test
rv.append(self.__get_logical_and())
self.__ignore_whitespace()
if self.content[:2] != '||':
# no logical op needed, short cut to our prime element
return rv[0]
# append operator
rv.append(Expression.__ASTLeaf('op', self.content[:2]))
self.__strip(2)
self.__ignore_whitespace()
rv.append(self.__get_logical_or())
self.__ignore_whitespace()
return rv
def __get_logical_and(self):
"""
Production: test ( '&&' and_cond ) ?
"""
if not len(self.content):
return None
rv = Expression.__AST("logical_op")
# test
rv.append(self.__get_equality())
self.__ignore_whitespace()
if self.content[:2] != '&&':
# no logical op needed, short cut to our prime element
return rv[0]
# append operator
rv.append(Expression.__ASTLeaf('op', self.content[:2]))
self.__strip(2)
self.__ignore_whitespace()
rv.append(self.__get_logical_and())
self.__ignore_whitespace()
return rv
def __get_equality(self):
"""
Production: unary ( ( '==' | '!=' ) unary ) ?
@ -68,22 +115,27 @@ class Expression:
def __get_value(self):
"""
Production: ( [0-9]+ | \w+)
Production: ( [0-9]+ | 'defined(' \w+ ')' | \w+ )
Note that the order is important, and the expression is kind-of
ambiguous as \w includes 0-9. One could make it unambiguous by
removing 0-9 from the first char of a string literal.
"""
rv = None
word_len = re.match('[0-9]*', self.content).end()
if word_len:
value = int(self.content[:word_len])
rv = Expression.__ASTLeaf('int', value)
m = re.match('defined\s*\(\s*(\w+)\s*\)', self.content)
if m:
word_len = m.end()
rv = Expression.__ASTLeaf('defined', m.group(1))
else:
word_len = re.match('\w*', self.content).end()
word_len = re.match('[0-9]*', self.content).end()
if word_len:
rv = Expression.__ASTLeaf('string', self.content[:word_len])
value = int(self.content[:word_len])
rv = Expression.__ASTLeaf('int', value)
else:
raise Expression.ParseError, self
word_len = re.match('\w*', self.content).end()
if word_len:
rv = Expression.__ASTLeaf('string', self.content[:word_len])
else:
raise Expression.ParseError, self
self.__strip(word_len)
self.__ignore_whitespace()
return rv
@ -114,12 +166,24 @@ class Expression:
if tok[1].value == '!=':
rv = not rv
return rv
# Helper function to evaluate __get_logical_and and __get_logical_or results
def eval_logical_op(tok):
left = opmap[tok[0].type](tok[0])
right = opmap[tok[2].type](tok[2])
if tok[1].value == '&&':
return left and right
elif tok[1].value == '||':
return left or right
raise Expression.ParseError, self
# Mapping from token types to evaluator functions
# Apart from (non-)equality, all these can be simple lambda forms.
opmap = {
'logical_op': eval_logical_op,
'equality': eval_equality,
'not': lambda tok: not opmap[tok[0].type](tok[0]),
'string': lambda tok: context[tok.value],
'defined': lambda tok: tok.value in context,
'int': lambda tok: tok.value}
return opmap[self.e.type](self.e);

View File

@ -65,6 +65,8 @@ HEADERS_DEST := $(DIST)/include
HEADERS_TARGET := export
INSTALL_TARGETS += HEADERS
PYTHON_UNIT_TESTS := $(wildcard $(srcdir)/tests/unit-*.py)
include $(topsrcdir)/config/rules.mk
HOST_CFLAGS += -DUNICODE -D_UNICODE
@ -146,32 +148,13 @@ endif
FORCE:
PYUNITS := \
unit-Expression.py \
unit-Preprocessor.py \
unit-nsinstall.py \
unit-printprereleasesuffix.py \
unit-JarMaker.py \
unit-buildlist.py \
unit-expandlibs.py \
unit-writemozinfo.py \
unit-mozunit.py \
$(NULL)
check-preqs = \
check-python-modules \
check-jar-mn \
check-makefiles \
$(NULL)
check:: $(check-preqs)
check-python-modules::
@$(EXIT_ON_ERROR) \
for test in $(PYUNITS); do \
$(PYTHON) $(srcdir)/tests/$$test ; \
done
check-jar-mn::
$(MAKE) -C tests/src-simple check-jar
$(MAKE) -C tests/src-simple check-flat

View File

@ -112,6 +112,19 @@ endif # CPP_UNIT_TESTS
.PHONY: check
ifdef PYTHON_UNIT_TESTS
RUN_PYTHON_UNIT_TESTS := $(addprefix run-,$(PYTHON_UNIT_TESTS))
.PHONY: $(RUN_PYTHON_UNIT_TESTS)
check:: $(RUN_PYTHON_UNIT_TESTS)
$(RUN_PYTHON_UNIT_TESTS): run-%: %
@PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $<
endif # PYTHON_UNIT_TESTS
endif # ENABLE_TESTS

View File

@ -59,5 +59,24 @@ class TestExpression(unittest.TestCase):
""" Test for the != operator"""
self.assert_(Expression('FAIL != 1').evaluate(self.c))
def test_logical_and(self):
""" Test for the && operator"""
self.assertTrue(Expression('PASS == PASS && PASS != NOTPASS').evaluate(self.c))
def test_logical_or(self):
""" Test for the || operator"""
self.assertTrue(Expression('PASS == NOTPASS || PASS != NOTPASS').evaluate(self.c))
def test_logical_ops(self):
""" Test for the && and || operators precedence"""
# Would evaluate to false if precedence was wrong
self.assertTrue(Expression('PASS == PASS || PASS != NOTPASS && PASS == NOTPASS').evaluate(self.c))
def test_defined(self):
""" Test for the defined() value"""
self.assertTrue(Expression('defined(FAIL)').evaluate(self.c))
self.assertTrue(Expression('!defined(PASS)').evaluate(self.c))
if __name__ == '__main__':
mozunit.main()

View File

@ -5283,7 +5283,7 @@ if test -n "$MOZ_WEBRTC"; then
dnl OpenSLES is only available in Android 2.3 and later; we'll change this
dnl hard dependency to a dynamic load with graceful runtime failure before
dnl we make --enable-webrtc on by default in Android (bug 815905)
dnl
dnl
if test "$OS_TARGET" = "Android"; then
LDFLAGS="$LDFLAGS -lOpenSLES"
fi
@ -9024,6 +9024,11 @@ if test "${OS_TARGET}" = "WINNT"; then
elif test "${OS_TARGET}" = "Android"; then
EXTRA_GYP_DEFINES="-D gtest_target_type=executable -D android_toolchain=${android_toolchain} -G os=android "
if test -n "$ARM_ARCH" && test "$ARM_ARCH" -lt 7; then
EXTRA_GYP_DEFINES+=" -D armv7=0 "
else
EXTRA_GYP_DEFINES+=" -D armv7=1 "
fi
fi
if test -n "$MOZ_WEBRTC"; then

View File

@ -196,6 +196,7 @@ public:
static JSContext* GetContextFromDocument(nsIDocument *aDocument);
static bool IsCallerChrome();
static bool IsCallerXBL();
static bool IsImageSrcSetDisabled();

View File

@ -1752,6 +1752,17 @@ nsContentUtils::IsCallerChrome()
return xpc::IsUniversalXPConnectEnabled(GetCurrentJSContext());
}
bool
nsContentUtils::IsCallerXBL()
{
JSScript *script;
JSContext *cx = GetCurrentJSContext();
if (!cx || !JS_DescribeScriptedCaller(cx, &script, nullptr) || !script)
return false;
return JS_GetScriptUserBit(script);
}
bool
nsContentUtils::IsImageSrcSetDisabled()
{
@ -5972,35 +5983,10 @@ nsContentTypeParser::GetParameter(const char* aParameterName, nsAString& aResult
/* static */
// If you change this code, change also AllowedToAct() in
// XPCSystemOnlyWrapper.cpp!
bool
nsContentUtils::CanAccessNativeAnon()
{
JSContext* cx = GetCurrentJSContext();
if (!cx) {
return true;
}
if (IsCallerChrome()) {
return true;
}
// Allow any code loaded from chrome://global/ to touch us, even if it was
// cloned into a less privileged context.
JSScript *script;
if (!JS_DescribeScriptedCaller(cx, &script, nullptr) || !script) {
return false;
}
static const char prefix[] = "chrome://global/";
const char *filename;
if ((filename = JS_GetScriptFilename(cx, script)) &&
!strncmp(filename, prefix, ArrayLength(prefix) - 1))
{
return true;
}
return false;
return IsCallerChrome() || IsCallerXBL();
}
/* static */ nsresult

View File

@ -12,8 +12,8 @@ load 746813-1.html
# this test crashes in a bunch places still
#load 745818-large-source.html
load 743499-negative-size.html
load 767337-1.html
load 780392-1.html
skip-if(Android) load 767337-1.html
skip-if(Android) load 780392-1.html
load 789933-1.html
load 794463-1.html
load 802926-1.html

View File

@ -3075,6 +3075,21 @@ CanvasRenderingContext2D::SetGlobalCompositeOperation(const nsAString& op,
else CANVAS_OP_TO_GFX_OP("destination-atop", DEST_ATOP)
else CANVAS_OP_TO_GFX_OP("lighter", ADD)
else CANVAS_OP_TO_GFX_OP("xor", XOR)
else CANVAS_OP_TO_GFX_OP("multiply", MULTIPLY)
else CANVAS_OP_TO_GFX_OP("screen", SCREEN)
else CANVAS_OP_TO_GFX_OP("overlay", OVERLAY)
else CANVAS_OP_TO_GFX_OP("darken", DARKEN)
else CANVAS_OP_TO_GFX_OP("lighten", LIGHTEN)
else CANVAS_OP_TO_GFX_OP("color-dodge", COLOR_DODGE)
else CANVAS_OP_TO_GFX_OP("color-burn", COLOR_BURN)
else CANVAS_OP_TO_GFX_OP("hard-light", HARD_LIGHT)
else CANVAS_OP_TO_GFX_OP("soft-light", SOFT_LIGHT)
else CANVAS_OP_TO_GFX_OP("difference", DIFFERENCE)
else CANVAS_OP_TO_GFX_OP("exclusion", EXCLUSION)
else CANVAS_OP_TO_GFX_OP("hue", HUE)
else CANVAS_OP_TO_GFX_OP("saturation", SATURATION)
else CANVAS_OP_TO_GFX_OP("color", COLOR)
else CANVAS_OP_TO_GFX_OP("luminosity", LUMINOSITY)
// XXX ERRMSG we need to report an error to developers here! (bug 329026)
else return;
@ -3103,6 +3118,21 @@ CanvasRenderingContext2D::GetGlobalCompositeOperation(nsAString& op,
else CANVAS_OP_TO_GFX_OP("source-out", OUT)
else CANVAS_OP_TO_GFX_OP("source-over", OVER)
else CANVAS_OP_TO_GFX_OP("xor", XOR)
else CANVAS_OP_TO_GFX_OP("multiply", MULTIPLY)
else CANVAS_OP_TO_GFX_OP("screen", SCREEN)
else CANVAS_OP_TO_GFX_OP("overlay", OVERLAY)
else CANVAS_OP_TO_GFX_OP("darken", DARKEN)
else CANVAS_OP_TO_GFX_OP("lighten", LIGHTEN)
else CANVAS_OP_TO_GFX_OP("color-dodge", COLOR_DODGE)
else CANVAS_OP_TO_GFX_OP("color-burn", COLOR_BURN)
else CANVAS_OP_TO_GFX_OP("hard-light", HARD_LIGHT)
else CANVAS_OP_TO_GFX_OP("soft-light", SOFT_LIGHT)
else CANVAS_OP_TO_GFX_OP("difference", DIFFERENCE)
else CANVAS_OP_TO_GFX_OP("exclusion", EXCLUSION)
else CANVAS_OP_TO_GFX_OP("hue", HUE)
else CANVAS_OP_TO_GFX_OP("saturation", SATURATION)
else CANVAS_OP_TO_GFX_OP("color", COLOR)
else CANVAS_OP_TO_GFX_OP("luminosity", LUMINOSITY)
else {
error.Throw(NS_ERROR_FAILURE);
}

View File

@ -39,13 +39,58 @@ MOCHITEST_FILES = \
test_2d.composite.canvas.destination-in.html \
test_2d.composite.canvas.source-in.html \
test_2d.composite.canvas.source-out.html \
test_2d.composite.canvas.multiply.html \
test_2d.composite.canvas.screen.html \
test_2d.composite.canvas.overlay.html \
test_2d.composite.canvas.darken.html \
test_2d.composite.canvas.lighten.html \
test_2d.composite.canvas.color-dodge.html \
test_2d.composite.canvas.color-burn.html \
test_2d.composite.canvas.hard-light.html \
test_2d.composite.canvas.soft-light.html \
test_2d.composite.canvas.difference.html \
test_2d.composite.canvas.exclusion.html \
test_2d.composite.canvas.hue.html \
test_2d.composite.canvas.saturation.html \
test_2d.composite.canvas.color.html \
test_2d.composite.canvas.luminosity.html \
test_2d.composite.image.destination-atop.html \
test_2d.composite.image.destination-in.html \
test_2d.composite.image.source-in.html \
test_2d.composite.image.source-out.html \
test_2d.composite.solid.multiply.html \
test_2d.composite.solid.screen.html \
test_2d.composite.solid.overlay.html \
test_2d.composite.solid.darken.html \
test_2d.composite.solid.lighten.html \
test_2d.composite.solid.color-dodge.html \
test_2d.composite.solid.color-burn.html \
test_2d.composite.solid.hard-light.html \
test_2d.composite.solid.soft-light.html \
test_2d.composite.solid.difference.html \
test_2d.composite.solid.exclusion.html \
test_2d.composite.solid.hue.html \
test_2d.composite.solid.saturation.html \
test_2d.composite.solid.color.html \
test_2d.composite.solid.luminosity.html \
test_2d.composite.uncovered.image.destination-in.html \
test_2d.composite.uncovered.image.source-in.html \
test_2d.composite.uncovered.image.source-out.html \
test_2d.composite.uncovered.fill.multiply.html \
test_2d.composite.uncovered.fill.screen.html \
test_2d.composite.uncovered.fill.overlay.html \
test_2d.composite.uncovered.fill.darken.html \
test_2d.composite.uncovered.fill.lighten.html \
test_2d.composite.uncovered.fill.color-dodge.html \
test_2d.composite.uncovered.fill.color-burn.html \
test_2d.composite.uncovered.fill.hard-light.html \
test_2d.composite.uncovered.fill.soft-light.html \
test_2d.composite.uncovered.fill.difference.html \
test_2d.composite.uncovered.fill.exclusion.html \
test_2d.composite.uncovered.fill.hue.html \
test_2d.composite.uncovered.fill.saturation.html \
test_2d.composite.uncovered.fill.color.html \
test_2d.composite.uncovered.fill.luminosity.html \
test_2d.drawImage.zerocanvas.html \
test_2d.strokeRect.zero.5.html \
test_toBlob.html \

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'color-burn';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 108,255,146,223, "50,25", "108,255,146,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'color-dodge';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 108,255,146,223, "50,25", "108,255,146,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'xor';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'darken';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 108,255,36,223, "50,25", "108,255,36,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'difference';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 218,145,146,223, "50,25", "218,145,146,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'exclusion';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 218,145,146,223, "50,25", "218,145,146,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'hard-light';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 218,255,36,223, "50,25", "218,255,36,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'hue';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 194,230,36,223, "50,25", "194,230,36,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'lighten';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 218,255,146,223, "50,25", "218,255,146,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'luminosity';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 176,255,146,223, "50,25", "176,255,146,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'multiply';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 108,255,36,223, "50,25", "108,255,36,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'overlay';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 108,255,146,223, "50,25", "108,255,146,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'saturation';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 108,253,145,223, "50,25", "108,253,145,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'screen';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 218,255,146,223, "50,25", "218,255,146,223", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.canvas.xor</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var canvas2 = document.createElement('canvas');
canvas2.width = canvas.width;
canvas2.height = canvas.height;
var ctx2 = canvas2.getContext('2d');
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'xor';
ctx.drawImage(canvas2, 0, 0);
isPixel(ctx, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5);
SimpleTest.finish();
});
</script>
<img src="image_yellow75.png" id="yellow75.png" class="resource">

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'color-burn';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'color-dodge';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'color';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 200,200,0,255, "50,25", "200,200,0,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'darken';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'difference';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 255,0,255,255, "50,25", "255,0,255,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'exclusion';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 255,0,255,255, "50,25", "255,0,255,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'hard-light';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'hue';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 200,200,0,255, "50,25", "200,200,0,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'lighten';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 255,255,255,255, "50,25", "255,255,255,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'luminosity';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 158,255,255,255, "50,25", "158,255,255,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'multiply';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'overlay';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'saturation';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 0,254,254,255, "50,25", "0,254,254,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'screen';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 255,255,255,255, "50,25", "255,255,255,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.solid.lighter</title>
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'soft-light';
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'color-burn';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'color-dodge';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'color';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'darken';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'difference';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'exclusion';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'hard-light';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'hue';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'lighten';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'luminosity';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'multiply';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'overlay';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'saturation';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'screen';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
<script src="/MochiKit/MochiKit.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
ok(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1);
var pr = pixel.data[0],
pg = pixel.data[1],
pb = pixel.data[2],
pa = pixel.data[3];
todo(r-d <= pr && pr <= r+d &&
g-d <= pg && pg <= g+d &&
b-d <= pb && pb <= b+d &&
a-d <= pa && pa <= a+d,
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'soft-light';
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
ctx.translate(0, 25);
ctx.fillRect(0, 50, 100, 50);
isPixel(ctx, 50,25, 0,255,0,128, "50,25", "0,255,0,128", 5);
SimpleTest.finish();
});
</script>

View File

@ -240,6 +240,26 @@ VideoData* VideoData::Create(VideoInfo& aInfo,
return v.forget();
}
VideoData* VideoData::CreateFromImage(VideoInfo& aInfo,
ImageContainer* aContainer,
int64_t aOffset,
int64_t aTime,
int64_t aEndTime,
const nsRefPtr<Image>& aImage,
bool aKeyframe,
int64_t aTimecode,
nsIntRect aPicture)
{
nsAutoPtr<VideoData> v(new VideoData(aOffset,
aTime,
aEndTime,
aKeyframe,
aTimecode,
aInfo.mDisplay));
v->mImage = aImage;
return v.forget();
}
#ifdef MOZ_WIDGET_GONK
VideoData* VideoData::Create(VideoInfo& aInfo,
ImageContainer* aContainer,

View File

@ -158,6 +158,16 @@ public:
int64_t aTimecode,
nsIntRect aPicture);
static VideoData* CreateFromImage(VideoInfo& aInfo,
ImageContainer* aContainer,
int64_t aOffset,
int64_t aTime,
int64_t aEndTime,
const nsRefPtr<Image>& aImage,
bool aKeyframe,
int64_t aTimecode,
nsIntRect aPicture);
// Constructs a duplicate VideoData object. This intrinsically tells the
// player that it does not need to update the displayed frame when this
// frame is played; this frame is identical to the previous.

View File

@ -10,6 +10,21 @@
namespace MPAPI {
enum ColorFormat {
YCbCr,
RGB565,
};
/*
* A callback for the plugin to use to request a buffer owned by gecko. This can
* save us a copy or two down the line.
*/
class BufferCallback {
public:
virtual void *operator()(size_t aWidth, size_t aHeight,
ColorFormat aColorFormat) = 0;
};
struct VideoPlane {
void *mData;
int32_t mStride;
@ -114,7 +129,7 @@ struct Decoder {
void (*GetAudioParameters)(Decoder *aDecoder, int32_t *aNumChannels, int32_t *aSampleRate);
bool (*HasVideo)(Decoder *aDecoder);
bool (*HasAudio)(Decoder *aDecoder);
bool (*ReadVideo)(Decoder *aDecoder, VideoFrame *aFrame, int64_t aSeekTimeUs);
bool (*ReadVideo)(Decoder *aDecoder, VideoFrame *aFrame, int64_t aSeekTimeUs, BufferCallback *aBufferCallback);
bool (*ReadAudio)(Decoder *aDecoder, AudioFrame *aFrame, int64_t aSeekTimeUs);
void (*DestroyDecoder)(Decoder *);
};

View File

@ -175,6 +175,12 @@ static const char* GetOmxLibraryName()
// layout to those on 2.3.5 and below.
return "lib/libomxplugingb.so";
}
else if (version == 10 && release_version >= NS_LITERAL_STRING("2.3.4") &&
device.Find("HTC") == 0) {
// HTC devices running Gingerbread 2.3.4+ (HTC Desire HD, HTC Evo Design, etc) seem to
// use a newer version of Gingerbread libstagefright than other 2.3.4 devices.
return "lib/libomxplugingb.so";
}
else if (version == 9 || (version == 10 && release_version <= NS_LITERAL_STRING("2.3.5"))) {
// Gingerbread versions from 2.3.5 and below have a different DataSource
// than 2.3.6 and above.

View File

@ -11,10 +11,13 @@
#include "MediaPluginDecoder.h"
#include "MediaPluginHost.h"
#include "MediaDecoderStateMachine.h"
#include "ImageContainer.h"
#include "AbstractMediaDecoder.h"
namespace mozilla {
typedef mozilla::layers::Image Image;
MediaPluginReader::MediaPluginReader(AbstractMediaDecoder *aDecoder,
const nsACString& aContentType) :
MediaDecoderReader(aDecoder),
@ -126,10 +129,13 @@ bool MediaPluginReader::DecodeVideoFrame(bool &aKeyframeSkip,
mLastVideoFrame = NULL;
}
ImageBufferCallback bufferCallback(mDecoder->GetImageContainer());
nsRefPtr<Image> currentImage;
// Read next frame
while (true) {
MPAPI::VideoFrame frame;
if (!mPlugin->ReadVideo(mPlugin, &frame, mVideoSeekTimeUs)) {
if (!mPlugin->ReadVideo(mPlugin, &frame, mVideoSeekTimeUs, &bufferCallback)) {
// We reached the end of the video stream. If we have a buffered
// video frame, push it the video queue using the total duration
// of the video as the end time.
@ -163,54 +169,81 @@ bool MediaPluginReader::DecodeVideoFrame(bool &aKeyframeSkip,
if (frame.mSize == 0)
return true;
VideoData::YCbCrBuffer b;
b.mPlanes[0].mData = static_cast<uint8_t *>(frame.Y.mData);
b.mPlanes[0].mStride = frame.Y.mStride;
b.mPlanes[0].mHeight = frame.Y.mHeight;
b.mPlanes[0].mWidth = frame.Y.mWidth;
b.mPlanes[0].mOffset = frame.Y.mOffset;
b.mPlanes[0].mSkip = frame.Y.mSkip;
b.mPlanes[1].mData = static_cast<uint8_t *>(frame.Cb.mData);
b.mPlanes[1].mStride = frame.Cb.mStride;
b.mPlanes[1].mHeight = frame.Cb.mHeight;
b.mPlanes[1].mWidth = frame.Cb.mWidth;
b.mPlanes[1].mOffset = frame.Cb.mOffset;
b.mPlanes[1].mSkip = frame.Cb.mSkip;
b.mPlanes[2].mData = static_cast<uint8_t *>(frame.Cr.mData);
b.mPlanes[2].mStride = frame.Cr.mStride;
b.mPlanes[2].mHeight = frame.Cr.mHeight;
b.mPlanes[2].mWidth = frame.Cr.mWidth;
b.mPlanes[2].mOffset = frame.Cr.mOffset;
b.mPlanes[2].mSkip = frame.Cr.mSkip;
nsIntRect picture = mPicture;
if (frame.Y.mWidth != mInitialFrame.width ||
frame.Y.mHeight != mInitialFrame.height) {
// Frame size is different from what the container reports. This is legal,
// and we will preserve the ratio of the crop rectangle as it
// was reported relative to the picture size reported by the container.
picture.x = (mPicture.x * frame.Y.mWidth) / mInitialFrame.width;
picture.y = (mPicture.y * frame.Y.mHeight) / mInitialFrame.height;
picture.width = (frame.Y.mWidth * mPicture.width) / mInitialFrame.width;
picture.height = (frame.Y.mHeight * mPicture.height) / mInitialFrame.height;
}
// This is the approximate byte position in the stream.
currentImage = bufferCallback.GetImage();
int64_t pos = mDecoder->GetResource()->Tell();
nsIntRect picture = mPicture;
VideoData *v;
if (currentImage) {
gfxIntSize frameSize = currentImage->GetSize();
if (frameSize.width != mInitialFrame.width ||
frameSize.height != mInitialFrame.height) {
// Frame size is different from what the container reports. This is legal,
// and we will preserve the ratio of the crop rectangle as it
// was reported relative to the picture size reported by the container.
picture.x = (mPicture.x * frameSize.width) / mInitialFrame.width;
picture.y = (mPicture.y * frameSize.height) / mInitialFrame.height;
picture.width = (frameSize.width * mPicture.width) / mInitialFrame.width;
picture.height = (frameSize.height * mPicture.height) / mInitialFrame.height;
}
VideoData *v = VideoData::Create(mInfo,
v = VideoData::CreateFromImage(mInfo,
mDecoder->GetImageContainer(),
pos,
frame.mTimeUs,
frame.mTimeUs+1, // We don't know the end time.
b,
currentImage,
frame.mKeyFrame,
-1,
picture);
} else {
// Assume YUV
VideoData::YCbCrBuffer b;
b.mPlanes[0].mData = static_cast<uint8_t *>(frame.Y.mData);
b.mPlanes[0].mStride = frame.Y.mStride;
b.mPlanes[0].mHeight = frame.Y.mHeight;
b.mPlanes[0].mWidth = frame.Y.mWidth;
b.mPlanes[0].mOffset = frame.Y.mOffset;
b.mPlanes[0].mSkip = frame.Y.mSkip;
b.mPlanes[1].mData = static_cast<uint8_t *>(frame.Cb.mData);
b.mPlanes[1].mStride = frame.Cb.mStride;
b.mPlanes[1].mHeight = frame.Cb.mHeight;
b.mPlanes[1].mWidth = frame.Cb.mWidth;
b.mPlanes[1].mOffset = frame.Cb.mOffset;
b.mPlanes[1].mSkip = frame.Cb.mSkip;
b.mPlanes[2].mData = static_cast<uint8_t *>(frame.Cr.mData);
b.mPlanes[2].mStride = frame.Cr.mStride;
b.mPlanes[2].mHeight = frame.Cr.mHeight;
b.mPlanes[2].mWidth = frame.Cr.mWidth;
b.mPlanes[2].mOffset = frame.Cr.mOffset;
b.mPlanes[2].mSkip = frame.Cr.mSkip;
if (frame.Y.mWidth != mInitialFrame.width ||
frame.Y.mHeight != mInitialFrame.height) {
// Frame size is different from what the container reports. This is legal,
// and we will preserve the ratio of the crop rectangle as it
// was reported relative to the picture size reported by the container.
picture.x = (mPicture.x * frame.Y.mWidth) / mInitialFrame.width;
picture.y = (mPicture.y * frame.Y.mHeight) / mInitialFrame.height;
picture.width = (frame.Y.mWidth * mPicture.width) / mInitialFrame.width;
picture.height = (frame.Y.mHeight * mPicture.height) / mInitialFrame.height;
}
// This is the approximate byte position in the stream.
v = VideoData::Create(mInfo,
mDecoder->GetImageContainer(),
pos,
frame.mTimeUs,
frame.mTimeUs+1, // We don't know the end time.
b,
frame.mKeyFrame,
-1,
picture);
}
if (!v) {
return false;
}
@ -313,4 +346,39 @@ nsresult MediaPluginReader::GetBuffered(nsTimeRanges* aBuffered, int64_t aStartT
return NS_OK;
}
MediaPluginReader::ImageBufferCallback::ImageBufferCallback(mozilla::layers::ImageContainer *aImageContainer) :
mImageContainer(aImageContainer)
{
}
void *
MediaPluginReader::ImageBufferCallback::operator()(size_t aWidth, size_t aHeight,
MPAPI::ColorFormat aColorFormat)
{
if (!mImageContainer) {
NS_WARNING("No image container to construct an image");
return nullptr;
}
nsRefPtr<mozilla::layers::SharedRGBImage> rgbImage;
switch(aColorFormat) {
case MPAPI::RGB565:
rgbImage = mozilla::layers::SharedRGBImage::Create(mImageContainer,
nsIntSize(aWidth, aHeight),
gfxASurface::ImageFormatRGB16_565);
mImage = rgbImage;
return rgbImage->GetBuffer();
case MPAPI::YCbCr:
default:
NS_NOTREACHED("Color format not supported");
return nullptr;
}
}
already_AddRefed<Image>
MediaPluginReader::ImageBufferCallback::GetImage()
{
return mImage.forget();
}
} // namespace mozilla

View File

@ -8,7 +8,9 @@
#include "MediaResource.h"
#include "MediaDecoderReader.h"
#include "ImageContainer.h"
#include "mozilla/layers/SharedRGBImage.h"
#include "MPAPI.h"
class nsACString;
@ -17,6 +19,10 @@ namespace mozilla {
class AbstractMediaDecoder;
namespace layers {
class ImageContainer;
}
class MediaPluginReader : public MediaDecoderReader
{
nsCString mType;
@ -54,6 +60,17 @@ public:
MetadataTags** aTags);
virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime);
virtual nsresult GetBuffered(nsTimeRanges* aBuffered, int64_t aStartTime);
class ImageBufferCallback : public MPAPI::BufferCallback {
typedef mozilla::layers::Image Image;
public:
ImageBufferCallback(mozilla::layers::ImageContainer *aImageContainer);
void *operator()(size_t aWidth, size_t aHeight,
MPAPI::ColorFormat aColorFormat);
already_AddRefed<Image> GetImage();
private:
mozilla::layers::ImageContainer *mImageContainer;
nsRefPtr<Image> mImage;
};
};
} // namespace mozilla

View File

@ -10,5 +10,5 @@ load 492286-1.xhtml
load 576612-1.html
skip-if(Android) load 691096-1.html # Android sound API can't handle playing large number of sounds at once.
load 752784-1.html
HTTP load 795892-1.html
load 789075-1.html
skip-if(Android) HTTP load 795892-1.html
skip-if(Android) load 789075-1.html

View File

@ -43,6 +43,8 @@ public:
// nsISMILAnimationElement
virtual nsSMILAnimationFunction& AnimationFunction();
virtual bool GetTargetAttributeName(PRInt32 *aNamespaceID,
nsIAtom **aLocalName) const;
virtual nsXPCClassInfo* GetClassInfo();
@ -115,3 +117,17 @@ nsSVGAnimateTransformElement::AnimationFunction()
{
return mAnimationFunction;
}
bool
nsSVGAnimateTransformElement::GetTargetAttributeName(PRInt32 *aNamespaceID,
nsIAtom **aLocalName) const
{
if (nsSVGAnimateTransformElementBase::GetTargetAttributeName(aNamespaceID,
aLocalName)) {
return *aNamespaceID == kNameSpaceID_None &&
(*aLocalName == nsGkAtoms::transform ||
*aLocalName == nsGkAtoms::patternTransform ||
*aLocalName == nsGkAtoms::gradientTransform);
}
return false;
}

View File

@ -113,6 +113,7 @@ nsXBLProtoImplField::InstallField(nsIScriptContext* aContext,
aBoundNode,
aPrincipal, uriSpec.get(),
mLineNumber, JSVERSION_LATEST,
/* aIsXBL = */ true,
&result, &undefined);
if (NS_FAILED(rv)) {
return rv;

View File

@ -14,11 +14,9 @@ this.EXPORTED_SYMBOLS = ["ObjectWrapper"];
this.ObjectWrapper = {
getObjectKind: function objWrapper_getObjectKind(aObject) {
if (!aObject) {
return "null";
}
if (Array.isArray(aObject)) {
if (aObject === null || aObject === undefined) {
return "primitive";
} else if (Array.isArray(aObject)) {
return "array";
} else if (aObject instanceof Ci.nsIDOMFile) {
return "file";
@ -34,9 +32,7 @@ this.ObjectWrapper = {
wrap: function objWrapper_wrap(aObject, aCtxt) {
// First check wich kind of object we have.
let kind = this.getObjectKind(aObject);
if (kind == "null") {
return null;
} else if (kind == "array") {
if (kind == "array") {
let res = Cu.createArrayIn(aCtxt);
aObject.forEach(function(aObj) {
res.push(this.wrap(aObj, aCtxt));

View File

@ -9537,8 +9537,16 @@ nsHTMLPluginObjElementSH::GetPluginInstanceIfSafe(nsIXPConnectWrappedNative *wra
nsCOMPtr<nsIObjectLoadingContent> objlc(do_QueryInterface(content));
NS_ASSERTION(objlc, "Object nodes must implement nsIObjectLoadingContent");
bool callerIsContentJS = (!xpc::AccessCheck::callerIsChrome() &&
!xpc::AccessCheck::callerIsXBL(cx) &&
// The below methods pull the cx off the stack, so make sure they match.
//
// NB: Sometimes there's a null cx on the stack, in which case |cx| is the
// safe JS context. But in that case, IsCallerChrome() will return true,
// so the ensuing expression is short-circuited.
MOZ_ASSERT_IF(nsContentUtils::GetCurrentJSContext(),
cx == nsContentUtils::GetCurrentJSContext());
bool callerIsContentJS = (!nsContentUtils::IsCallerChrome() &&
!nsContentUtils::IsCallerXBL() &&
js::IsContextRunningJS(cx));
return objlc->ScriptRequestPluginInstance(callerIsContentJS,
_result);

View File

@ -98,6 +98,7 @@ public:
const char *aURL,
uint32_t aLineNo,
uint32_t aVersion,
bool aIsXBL,
JS::Value* aRetValue,
bool* aIsUndefined) = 0;

View File

@ -1250,6 +1250,7 @@ nsJSContext::EvaluateStringWithValue(const nsAString& aScript,
const char *aURL,
uint32_t aLineNo,
uint32_t aVersion,
bool aIsXBL,
JS::Value* aRetValue,
bool* aIsUndefined)
{
@ -1324,7 +1325,8 @@ nsJSContext::EvaluateStringWithValue(const nsAString& aScript,
JS::CompileOptions options(mContext);
options.setFileAndLine(aURL, aLineNo)
.setVersion(JSVersion(aVersion))
.setPrincipals(nsJSPrincipals::get(principal));
.setPrincipals(nsJSPrincipals::get(principal))
.setUserBit(aIsXBL);
js::RootedObject rootedScope(mContext, aScopeObject);
ok = JS::Evaluate(mContext, rootedScope, options, PromiseFlatString(aScript).get(),
aScript.Length(), &val);
@ -1782,7 +1784,8 @@ nsJSContext::CompileEventHandler(nsIAtom *aName,
JS::CompileOptions options(mContext);
options.setVersion(JSVersion(aVersion))
.setFileAndLine(aURL, aLineNo);
.setFileAndLine(aURL, aLineNo)
.setUserBit(aIsXBL);
js::RootedObject empty(mContext, NULL);
JSFunction* fun = JS::CompileFunction(mContext, empty, options, nsAtomCString(aName).get(),
aArgCount, aArgNames,
@ -1793,11 +1796,6 @@ nsJSContext::CompileEventHandler(nsIAtom *aName,
return NS_ERROR_ILLEGAL_VALUE;
}
// If this is an XBL function, make a note to that effect on its script.
if (aIsXBL) {
JS_SetScriptUserBit(JS_GetFunctionScript(mContext, fun), true);
}
JSObject *handler = ::JS_GetFunctionObject(fun);
return aHandler.set(handler);
}
@ -1849,7 +1847,8 @@ nsJSContext::CompileFunction(JSObject* aTarget,
JS::CompileOptions options(mContext);
options.setPrincipals(nsJSPrincipals::get(principal))
.setVersion(JSVersion(aVersion))
.setFileAndLine(aURL, aLineNo);
.setFileAndLine(aURL, aLineNo)
.setUserBit(aIsXBL);
JSFunction* fun = JS::CompileFunction(mContext, target,
options, PromiseFlatCString(aName).get(),
aArgCount, aArgArray,
@ -1858,11 +1857,6 @@ nsJSContext::CompileFunction(JSObject* aTarget,
if (!fun)
return NS_ERROR_FAILURE;
// If this is an XBL function, make a note to that effect on its script.
if (aIsXBL) {
JS_SetScriptUserBit(JS_GetFunctionScript(mContext, fun), true);
}
*aFunctionObject = JS_GetFunctionObject(fun);
return NS_OK;
}

View File

@ -59,6 +59,7 @@ public:
const char* aURL,
uint32_t aLineNo,
uint32_t aVersion,
bool aIsXBL,
JS::Value* aRetValue,
bool* aIsUndefined);

View File

@ -157,8 +157,8 @@ private:
*/
bool mWaitingForConfirmationFlag;
nsAutoPtr<uint8_t> mBodySegment;
nsAutoPtr<uint8_t> mReceivedDataBuffer;
nsAutoArrayPtr<uint8_t> mBodySegment;
nsAutoArrayPtr<uint8_t> mReceivedDataBuffer;
nsCOMPtr<nsIDOMBlob> mBlob;
nsCOMPtr<nsIThread> mReadFileThread;

View File

@ -118,6 +118,7 @@ ParseHeaders(const uint8_t* aHeaderStart,
uint8_t* content = new uint8_t[contentLength];
memcpy(content, ptr, contentLength);
aRetHandlerSet->AddHeader(new ObexHeader(headerId, contentLength, content));
delete [] content;
ptr += contentLength;
}

View File

@ -119,7 +119,7 @@ public:
ObexHeaderId mId;
int mDataLength;
nsAutoPtr<uint8_t> mData;
nsAutoArrayPtr<uint8_t> mData;
};
class ObexHeaderSet {

View File

@ -271,7 +271,8 @@ ContactDB.prototype = {
debug("InternationalNumber: " + parsedNumber.internationalNumber);
debug("NationalNumber: " + parsedNumber.nationalNumber);
debug("NationalFormat: " + parsedNumber.nationalFormat);
if (number.toString() !== parsedNumber.internationalNumber) {
if (parsedNumber.internationalNumber &&
number.toString() !== parsedNumber.internationalNumber) {
let digits = parsedNumber.internationalNumber.match(/\d/g);
if (digits) {
digits = digits.join('');

View File

@ -76,6 +76,26 @@ function testRemoveSetupMenu(cmd) {
runNextTest();
}
function testPollingOff(cmd) {
log("STK CMD " + JSON.stringify(cmd));
is(cmd.typeOfCommand, icc.STK_CMD_POLL_OFF);
is(cmd.commandNumber, 0x01);
is(cmd.commandQualifier, 0x00);
is(cmd.options, null);
runNextTest();
}
function testRefresh(cmd) {
log("STK CMD " + JSON.stringify(cmd));
is(cmd.typeOfCommand, icc.STK_CMD_REFRESH);
is(cmd.commandNumber, 0x01);
is(cmd.commandQualifier, 0x01);
is(cmd.options, null);
runNextTest();
}
let tests = [
{command: "d0288103012180820281020d1d00d3309bfc06c95c301aa8e80259c3ec34b9ac07c9602f58ed159bb940",
func: testDisplayTextGsm7BitEncoding},
@ -91,6 +111,10 @@ let tests = [
func: testRemoveSetupMenu},
{command:"D03B810301250082028182850C546F6F6C6B6974204D656E758F07014974656D20318F07024974656D20328F07034974656D20338F07044974656D2034",
func: testInitialSetupMenu},
{command: "d009810301040082028182",
func: testPollingOff},
{command: "d0108103010101820281829205013f002fe2",
func: testRefresh},
];
let pendingEmulatorCmdCount = 0;

View File

@ -305,6 +305,18 @@ ContentChild::Init(MessageLoop* aIOLoop,
void
ContentChild::SetProcessName(const nsAString& aName)
{
char* name;
if ((name = PR_GetEnv("MOZ_DEBUG_APP_PROCESS")) &&
aName.EqualsASCII(name)) {
#ifdef OS_POSIX
printf_stderr("\n\nCHILDCHILDCHILDCHILD\n [%s] debug me @%d\n\n", name, getpid());
sleep(30);
#elif defined(OS_WIN)
printf_stderr("\n\nCHILDCHILDCHILDCHILD\n [%s] debug me @%d\n\n", name, _getpid());
Sleep(30000);
#endif
}
mProcessName = aName;
mozilla::ipc::SetThisProcessName(NS_LossyConvertUTF16toASCII(aName).get());
}

View File

@ -291,6 +291,8 @@ public:
/** Return the DPI of the widget this TabChild draws to. */
void GetDPI(float* aDPI);
gfxSize GetZoom() { return mLastMetrics.mZoom; }
void SetBackgroundColor(const nscolor& aColor);
void NotifyPainted();

View File

@ -416,7 +416,7 @@ interface nsIDOMMozMobileCellInfo: nsISupports
readonly attribute unsigned long gsmCellId;
};
[scriptable, uuid(352e7f1a-c09f-44ed-8fde-a138b09a0ea9)]
[scriptable, uuid(1fb27dc0-427e-11e2-a25f-0800200c9a66)]
interface nsIDOMMozMobileICCInfo : nsISupports
{
/**
@ -429,6 +429,11 @@ interface nsIDOMMozMobileICCInfo : nsISupports
*/
readonly attribute unsigned short mcc;
/**
* Mobile Country Code (MCC) of previous subscriber's home network.
*/
readonly attribute unsigned short lastKnownMcc;
/**
* Mobile Network Code (MNC) of the subscriber's home network.
*/

View File

@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/PluginPRLibrary.h"
#include "nsPluginSafety.h"
// Some plugins on Windows, notably Quake Live, implement NP_Initialize using
// cdecl instead of the documented stdcall. In order to work around this,
// we force the caller to use a frame pointer.
@ -39,6 +40,8 @@ PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs,
if (!env)
return NS_ERROR_FAILURE;
mozilla::AutoLocalJNIFrame jniFrame(env);
if (mNP_Initialize) {
*error = mNP_Initialize(bFuncs, pFuncs, env);
} else {
@ -194,6 +197,8 @@ PluginPRLibrary::NPP_New(NPMIMEType pluginType, NPP instance,
{
if (!mNPP_New)
return NS_ERROR_FAILURE;
MAIN_THREAD_JNI_REF_GUARD;
*error = mNPP_New(pluginType, instance, mode, argc, argn, argv, saved);
return NS_OK;
}
@ -206,6 +211,7 @@ PluginPRLibrary::NPP_ClearSiteData(const char* site, uint64_t flags,
return NS_ERROR_NOT_AVAILABLE;
}
MAIN_THREAD_JNI_REF_GUARD;
NPError result = mNPP_ClearSiteData(site, flags, maxAge);
switch (result) {
@ -229,6 +235,7 @@ PluginPRLibrary::NPP_GetSitesWithData(InfallibleTArray<nsCString>& result)
result.Clear();
MAIN_THREAD_JNI_REF_GUARD;
char** sites = mNPP_GetSitesWithData();
if (!sites) {
return NS_OK;

View File

@ -1593,7 +1593,7 @@ _evaluate(NPP npp, NPObject* npobj, NPString *script, NPVariant *result)
npp, npobj, script->UTF8Characters));
nsresult rv = scx->EvaluateStringWithValue(utf16script, obj, principal,
spec, 0, 0, rval, nullptr);
spec, 0, 0, false, rval, nullptr);
return NS_SUCCEEDED(rv) &&
(!result || JSValToNPVariant(npp, cx, *rval, result));

View File

@ -519,19 +519,6 @@ nsNPAPIPluginInstance::Start()
// before returning. If the plugin returns failure, we'll clear it out below.
mRunning = RUNNING;
#if MOZ_WIDGET_ANDROID
// Flash creates some local JNI references during initialization (NPP_New). It does not
// remove these references later, so essentially they are leaked. AutoLocalJNIFrame
// prevents this by pushing a JNI frame. As a result, all local references created
// by Flash are contained in this frame. AutoLocalJNIFrame pops the frame once we
// go out of scope and the local references are deleted, preventing the leak.
JNIEnv* env = AndroidBridge::GetJNIEnv();
if (!env)
return NS_ERROR_FAILURE;
mozilla::AutoLocalJNIFrame frame(env);
#endif
nsresult newResult = library->NPP_New((char*)mimetype, &mNPP, (uint16_t)mode, count, (char**)names, (char**)values, NULL, &error);
mInPluginInitCall = oldVal;
@ -690,6 +677,7 @@ nsresult nsNPAPIPluginInstance::HandleEvent(void* event, int16_t* result)
#if defined(XP_WIN) || defined(XP_OS2)
NS_TRY_SAFE_CALL_RETURN(tmpResult, (*pluginFunctions->event)(&mNPP, event), this);
#else
MAIN_THREAD_JNI_REF_GUARD;
tmpResult = (*pluginFunctions->event)(&mNPP, event);
#endif
NPP_PLUGIN_LOG(PLUGIN_LOG_NOISY,
@ -1403,6 +1391,9 @@ PluginTimerCallback(nsITimer *aTimer, void *aClosure)
NPP npp = t->npp;
uint32_t id = t->id;
PLUGIN_LOG(PLUGIN_LOG_NOISY, ("nsNPAPIPluginInstance running plugin timer callback this=%p\n", npp->ndata));
MAIN_THREAD_JNI_REF_GUARD;
(*(t->callback))(npp, id);
// Make sure we still have an instance and the timer is still alive

View File

@ -863,6 +863,7 @@ nsNPAPIPluginStreamListener::HandleRedirectNotification(nsIChannel *oldChannel,
#if defined(XP_WIN) || defined(XP_OS2)
NS_TRY_SAFE_CALL_VOID((*pluginFunctions->urlredirectnotify)(npp, spec.get(), static_cast<int32_t>(status), mNPStreamWrapper->mNPStream.notifyData), mInst);
#else
MAIN_THREAD_JNI_REF_GUARD;
(*pluginFunctions->urlredirectnotify)(npp, spec.get(), static_cast<int32_t>(status), mNPStreamWrapper->mNPStream.notifyData);
#endif
return true;

View File

@ -10,6 +10,16 @@
#include "nsPluginHost.h"
#include <prinrval.h>
// On Android, we need to guard against plugin code leaking entries in the local
// JNI ref table. See https://bugzilla.mozilla.org/show_bug.cgi?id=780831#c21
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#define MAIN_THREAD_JNI_REF_GUARD mozilla::AutoLocalJNIFrame jniFrame
#else
#define MAIN_THREAD_JNI_REF_GUARD
#endif
#if defined(XP_WIN)
#define CALL_SAFETY_ON
#endif
@ -32,6 +42,7 @@ PR_END_MACRO
#define NS_TRY_SAFE_CALL_RETURN(ret, fun, pluginInst) \
PR_BEGIN_MACRO \
MAIN_THREAD_JNI_REF_GUARD; \
PRIntervalTime startTime = NS_NotifyBeginPluginCall(); \
if(gSkipPluginSafeCalls) \
ret = fun; \
@ -55,6 +66,7 @@ PR_END_MACRO
#define NS_TRY_SAFE_CALL_VOID(fun, pluginInst) \
PR_BEGIN_MACRO \
MAIN_THREAD_JNI_REF_GUARD; \
PRIntervalTime startTime = NS_NotifyBeginPluginCall(); \
if(gSkipPluginSafeCalls) \
fun; \
@ -79,6 +91,7 @@ PR_END_MACRO
#define NS_TRY_SAFE_CALL_RETURN(ret, fun, pluginInst) \
PR_BEGIN_MACRO \
MAIN_THREAD_JNI_REF_GUARD; \
PRIntervalTime startTime = NS_NotifyBeginPluginCall(); \
ret = fun; \
NS_NotifyPluginCall(startTime); \
@ -86,6 +99,7 @@ PR_END_MACRO
#define NS_TRY_SAFE_CALL_VOID(fun, pluginInst) \
PR_BEGIN_MACRO \
MAIN_THREAD_JNI_REF_GUARD; \
PRIntervalTime startTime = NS_NotifyBeginPluginCall(); \
fun; \
NS_NotifyPluginCall(startTime); \

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