Merge m-c to fx-team.

This commit is contained in:
Ryan VanderMeulen 2013-11-08 14:56:41 -05:00
commit 833261f0ae
109 changed files with 1792 additions and 153 deletions

View File

@ -1,4 +1,4 @@
{
"revision": "6ce2fe088a1113ac761dfa1f6a6a09fb7f38f787",
"revision": "979add320adbf777379cfd1044978392c576aaf8",
"repo_path": "/integration/gaia-central"
}

View File

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

View File

@ -780,7 +780,8 @@ class RemakeTargetParallel(object):
return
self.currunning = True
self.rlist.pop(0).runcommands(self.indent, self.commandscb)
rule = self.rlist.pop(0)
self.makefile.context.defer(rule.runcommands, self.indent, self.commandscb)
def commandscb(self, error):
assert error in (True, False)
@ -844,11 +845,15 @@ class RemakeRuleContext(object):
self._depfinishedserial(False, False)
def _startdepparallel(self, d):
dep, weak = d
if weak:
depfinished = self._weakdepfinishedparallel
else:
depfinished = self._depfinishedparallel
if self.makefile.error:
depfinished(True, False)
else:
dep, weak = d
dep.make(self.makefile, self.targetstack, weak and self._weakdepfinishedparallel or self._depfinishedparallel)
dep.make(self.makefile, self.targetstack, depfinished)
def _weakdepfinishedparallel(self, error, didanything):
if error:

View File

@ -415,6 +415,10 @@ class PythonJob(Job):
finally:
os.environ.clear()
os.environ.update(oldenv)
# multiprocessing exits via os._exit, make sure that all output
# from command gets written out before that happens.
sys.stdout.flush()
sys.stderr.flush()
return 0
def job_runner(job):

View File

@ -73,7 +73,7 @@ protected:
// The lock protects mVideoDecoderSlots and mVideoCodecRequestQueue called
// from multiple threads.
Mutex mLock;
typedef Vector<sp<IBinder> > Fifo;
typedef List<sp<IBinder> > Fifo;
// Queue of media resource requests.
// Hold IMediaResourceManagerClient that requesting a media resource as IBinder.
Fifo mVideoCodecRequestQueue;

View File

@ -98,6 +98,7 @@ extern bool gBluetoothDebugFlag;
// Bluetooth address format: xx:xx:xx:xx:xx:xx (or xx_xx_xx_xx_xx_xx)
#define BLUETOOTH_ADDRESS_LENGTH 17
#define BLUETOOTH_ADDRESS_NONE "00:00:00:00:00:00"
#define BLUETOOTH_ADDRESS_BYTES 6
BEGIN_BLUETOOTH_NAMESPACE

View File

@ -63,15 +63,19 @@ private:
*/
static bluetooth_device_t* sBtDevice;
static const bt_interface_t* sBtInterface;
static bool sIsBtEnabled = false;
static bool sAdapterDiscoverable = false;
static bool sIsBtEnabled = false;
static nsString sAdapterBdAddress;
static nsString sAdapterBdName;
static uint32_t sAdapterDiscoverableTimeout;
static InfallibleTArray<nsString> sAdapterBondedAddressArray;
static InfallibleTArray<BluetoothNamedValue> sRemoteDevicesPack;
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sBondingRunnableArray;
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sChangeDiscoveryRunnableArray;
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sGetPairedDeviceRunnableArray;
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sSetPropertyRunnableArray;
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sUnbondingRunnableArray;
static nsTArray<int> sRequestedDeviceCountArray;
/**
* Static callback functions
@ -168,7 +172,8 @@ AdapterStateChangeCallback(bt_state_t aStatus)
signalName = NS_LITERAL_STRING("Disabled");
}
BluetoothSignal signal(signalName, NS_LITERAL_STRING(KEY_MANAGER), BluetoothValue(true));
BluetoothSignal signal(signalName, NS_LITERAL_STRING(KEY_MANAGER),
BluetoothValue(true));
nsRefPtr<DistributeBluetoothSignalTask>
t = new DistributeBluetoothSignalTask(signal);
if (NS_FAILED(NS_DispatchToMainThread(t))) {
@ -251,13 +256,30 @@ AdapterPropertiesChangeCallback(bt_status_t aStatus, int aNumProperties,
BluetoothNamedValue(NS_LITERAL_STRING("DiscoverableTimeout"),
propertyValue));
} else if (p.type == BT_PROPERTY_ADAPTER_BONDED_DEVICES) {
//FIXME: This will be implemented in the later patchset
return;
// We have to cache addresses of bonded devices. Unlike BlueZ,
// bluedroid would not send an another BT_PROPERTY_ADAPTER_BONDED_DEVICES
// event after bond completed
bt_bdaddr_t* deviceBdAddressTypes = (bt_bdaddr_t*)p.val;
int numOfAddresses = p.len / BLUETOOTH_ADDRESS_BYTES;
BT_LOGD("Adapter property: BONDED_DEVICES. Count: %d", numOfAddresses);
// Whenever reloading paired devices, force refresh
sAdapterBondedAddressArray.Clear();
for (int index = 0; index < numOfAddresses; index++) {
nsAutoString deviceBdAddress;
BdAddressTypeToString(deviceBdAddressTypes + index, deviceBdAddress);
sAdapterBondedAddressArray.AppendElement(deviceBdAddress);
}
propertyValue = sAdapterBondedAddressArray;
propertiesArray.AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("Devices"), propertyValue));
} else if (p.type == BT_PROPERTY_UUIDS) {
//FIXME: This will be implemented in the later patchset
return;
} else {
BT_LOGR("Unhandled adapter property type: %d", p.type);
BT_LOGD("Unhandled adapter property type: %d", p.type);
return;
}
@ -279,6 +301,12 @@ AdapterPropertiesChangeCallback(bt_status_t aStatus, int aNumProperties,
}
}
/*
* RemoteDevicePropertiesChangeCallback will be called, as the
* following conditions:
* 1. When BT is turning on, bluedroid automatically execute this callback
* 2. When get_remote_device_properties()
*/
static void
RemoteDevicePropertiesChangeCallback(bt_status_t aStatus,
bt_bdaddr_t *aBdAddress,
@ -287,32 +315,62 @@ RemoteDevicePropertiesChangeCallback(bt_status_t aStatus,
{
MOZ_ASSERT(!NS_IsMainThread());
// First, get remote device bd_address since it will be the key of
// return name value pair.
if (sRequestedDeviceCountArray.IsEmpty()) {
MOZ_ASSERT(sGetPairedDeviceRunnableArray.IsEmpty());
return;
}
sRequestedDeviceCountArray[0]--;
InfallibleTArray<BluetoothNamedValue> props;
nsString remoteDeviceBdAddress;
BdAddressTypeToString(aBdAddress, remoteDeviceBdAddress);
InfallibleTArray<BluetoothNamedValue> deviceProperties;
props.AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("Address"), remoteDeviceBdAddress));
for (int i = 0; i < aNumProperties; ++i) {
bt_property_t p = aProperties[i];
if (p.type == BT_PROPERTY_BDNAME) {
BluetoothValue propertyValue = NS_ConvertUTF8toUTF16((char*)p.val);
deviceProperties.AppendElement(
props.AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("Name"), propertyValue));
} else if (p.type == BT_PROPERTY_CLASS_OF_DEVICE) {
uint32_t cod = *(uint32_t*)p.val;
deviceProperties.AppendElement(
props.AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("Class"), BluetoothValue(cod)));
nsString icon;
ClassToIcon(cod, icon);
deviceProperties.AppendElement(
props.AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("Icon"), BluetoothValue(icon)));
} else {
BT_LOGR("Other non-handled device properties. Type: %d", p.type);
BT_LOGD("Other non-handled device properties. Type: %d", p.type);
}
}
// Use address as the index
sRemoteDevicesPack.AppendElement(
BluetoothNamedValue(remoteDeviceBdAddress, props));
if (sRequestedDeviceCountArray[0] == 0) {
MOZ_ASSERT(!sGetPairedDeviceRunnableArray.IsEmpty());
if (sGetPairedDeviceRunnableArray.IsEmpty()) {
BT_LOGR("No runnable to return");
return;
}
DispatchBluetoothReply(sGetPairedDeviceRunnableArray[0],
sRemoteDevicesPack, EmptyString());
// After firing it, clean up cache
sRemoteDevicesPack.Clear();
sRequestedDeviceCountArray.RemoveElementAt(0);
sGetPairedDeviceRunnableArray.RemoveElementAt(0);
}
}
static void
@ -444,20 +502,38 @@ BondStateChangedCallback(bt_status_t aStatus, bt_bdaddr_t* aRemoteBdAddress,
{
MOZ_ASSERT(!NS_IsMainThread());
if (aState == BT_BOND_STATE_BONDING) {
//We don't need to handle bonding state
return;
}
bool bonded = (aState == BT_BOND_STATE_BONDED);
nsAutoString remoteAddress;
BdAddressTypeToString(aRemoteBdAddress, remoteAddress);
bool bonded;
if (aState == BT_BOND_STATE_BONDING) {
// We don't need to handle bonding state
return;
} else if (aState == BT_BOND_STATE_NONE) {
bonded = false;
sAdapterBondedAddressArray.RemoveElement(remoteAddress);
} else if (aState == BT_BOND_STATE_BONDED) {
bonded = true;
sAdapterBondedAddressArray.AppendElement(remoteAddress);
}
// Update bonded address list to BluetoothAdapter
InfallibleTArray<BluetoothNamedValue> propertiesChangeArray;
propertiesChangeArray.AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("Devices"),
sAdapterBondedAddressArray));
BluetoothValue value(propertiesChangeArray);
BluetoothSignal signal(NS_LITERAL_STRING("PropertyChanged"),
NS_LITERAL_STRING(KEY_ADAPTER),
BluetoothValue(propertiesChangeArray));
NS_DispatchToMainThread(new DistributeBluetoothSignalTask(signal));
// Update bonding status to gaia
InfallibleTArray<BluetoothNamedValue> propertiesArray;
propertiesArray.AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("address"), remoteAddress));
propertiesArray.AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("status"), bonded));
BluetoothSignal newSignal(NS_LITERAL_STRING(PAIRED_STATUS_CHANGED_ID),
NS_LITERAL_STRING(KEY_ADAPTER),
BluetoothValue(propertiesArray));
@ -634,6 +710,10 @@ BluetoothServiceBluedroid::GetDefaultAdapterPathInternal(
v.get_ArrayOfBluetoothNamedValue().AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("Name"), sAdapterBdName));
v.get_ArrayOfBluetoothNamedValue().AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("Devices"),
sAdapterBondedAddressArray));
nsAutoString replyError;
DispatchBluetoothReply(runnable.get(), v, replyError);
@ -646,8 +726,12 @@ nsresult
BluetoothServiceBluedroid::GetConnectedDevicePropertiesInternal(
uint16_t aProfileId, BluetoothReplyRunnable* aRunnable)
{
return NS_OK;
MOZ_ASSERT(NS_IsMainThread());
//FIXME: This will be implemented in later patches
DispatchBluetoothReply(aRunnable, BluetoothValue(true), EmptyString());
return NS_OK;
}
nsresult
@ -656,6 +740,34 @@ BluetoothServiceBluedroid::GetPairedDevicePropertiesInternal(
{
MOZ_ASSERT(NS_IsMainThread());
if (!IsReady()) {
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
return NS_OK;
}
int requestedDeviceCount = aDeviceAddress.Length();
if (requestedDeviceCount == 0) {
InfallibleTArray<BluetoothNamedValue> emptyArr;
DispatchBluetoothReply(aRunnable, BluetoothValue(emptyArr), EmptyString());
return NS_OK;
}
for (int i = 0; i < requestedDeviceCount; i++) {
// Retrieve all properties of devices
bt_bdaddr_t addressType;
StringToBdAddressType(aDeviceAddress[i], &addressType);
int ret = sBtInterface->get_remote_device_properties(&addressType);
if (ret != BT_STATUS_SUCCESS) {
DispatchBluetoothReply(aRunnable, BluetoothValue(true),
NS_LITERAL_STRING("GetPairedDeviceFailed"));
return NS_OK;
}
}
sRequestedDeviceCountArray.AppendElement(requestedDeviceCount);
sGetPairedDeviceRunnableArray.AppendElement(aRunnable);
return NS_OK;
}

View File

@ -1290,6 +1290,14 @@ ContentChild::RecvCycleCollect()
return true;
}
#ifdef MOZ_NUWA_PROCESS
static void
OnFinishNuwaPreparation ()
{
MakeNuwaProcess();
}
#endif
static void
PreloadSlowThings()
{
@ -1297,6 +1305,18 @@ PreloadSlowThings()
nsLayoutStylesheetCache::UserContentSheet();
TabChild::PreloadSlowThings();
#ifdef MOZ_NUWA_PROCESS
// After preload of slow things, start freezing threads.
if (IsNuwaProcess()) {
// Perform GC before freezing the Nuwa process to reduce memory usage.
ContentChild::GetSingleton()->RecvGarbageCollect();
MessageLoop::current()->
PostTask(FROM_HERE,
NewRunnableFunction(OnFinishNuwaPreparation));
}
#endif
}
bool

View File

@ -450,7 +450,7 @@ function RILContentHelper() {
this.updateDebugFlag();
this.numClients = gNumRadioInterfaces;
debug("Number of clients: " + this.numClients);
if (DEBUG) debug("Number of clients: " + this.numClients);
this.rilContexts = [];
this.voicemailInfos = [];
@ -605,7 +605,7 @@ RILContentHelper.prototype = {
let rilContext =
cpmm.sendSyncMessage("RIL:GetRilContext", {clientId: cId})[0];
if (!rilContext) {
debug("Received null rilContext from chrome process.");
if (DEBUG) debug("Received null rilContext from chrome process.");
continue;
}
this.rilContexts[cId].cardState = rilContext.cardState;
@ -910,7 +910,7 @@ RILContentHelper.prototype = {
},
sendMMI: function sendMMI(clientId, window, mmi) {
debug("Sending MMI " + mmi);
if (DEBUG) debug("Sending MMI " + mmi);
if (!window) {
throw Components.Exception("Can't get window object",
Cr.NS_ERROR_UNEXPECTED);
@ -932,7 +932,7 @@ RILContentHelper.prototype = {
},
cancelMMI: function cancelMMI(clientId, window) {
debug("Cancel MMI");
if (DEBUG) debug("Cancel MMI");
if (!window) {
throw Components.Exception("Can't get window object",
Cr.NS_ERROR_UNEXPECTED);
@ -1443,7 +1443,7 @@ RILContentHelper.prototype = {
},
registerMobileConnectionMsg: function registerMobileConnectionMsg(clientId, listener) {
debug("Registering for mobile connection related messages");
if (DEBUG) debug("Registering for mobile connection related messages");
this.registerListener("_mobileConnectionListeners", clientId, listener);
cpmm.sendAsyncMessage("RIL:RegisterMobileConnectionMsg");
},
@ -1453,7 +1453,7 @@ RILContentHelper.prototype = {
},
registerVoicemailMsg: function registerVoicemailMsg(listener) {
debug("Registering for voicemail-related messages");
if (DEBUG) debug("Registering for voicemail-related messages");
// To follow the listener registration scheme, we add a dummy clientId 0.
// All voicemail events are routed to listener for client id 0.
// See |handleVoicemailNotification|.
@ -1469,7 +1469,7 @@ RILContentHelper.prototype = {
},
registerCellBroadcastMsg: function registerCellBroadcastMsg(listener) {
debug("Registering for Cell Broadcast related messages");
if (DEBUG) debug("Registering for Cell Broadcast related messages");
//TODO: Bug 921326 - Cellbroadcast API: support multiple sim cards
this.registerListener("_cellBroadcastListeners", 0, listener);
cpmm.sendAsyncMessage("RIL:RegisterCellBroadcastMsg");
@ -1481,7 +1481,7 @@ RILContentHelper.prototype = {
},
registerIccMsg: function registerIccMsg(clientId, listener) {
debug("Registering for ICC related messages");
if (DEBUG) debug("Registering for ICC related messages");
this.registerListener("_iccListeners", clientId, listener);
cpmm.sendAsyncMessage("RIL:RegisterIccMsg");
},
@ -1574,7 +1574,9 @@ RILContentHelper.prototype = {
receiveMessage: function receiveMessage(msg) {
let request;
debug("Received message '" + msg.name + "': " + JSON.stringify(msg.json));
if (DEBUG) {
debug("Received message '" + msg.name + "': " + JSON.stringify(msg.json));
}
let data = msg.json.data;
let clientId = msg.json.clientId;
@ -1783,9 +1785,11 @@ RILContentHelper.prototype = {
},
handleGetAvailableNetworks: function handleGetAvailableNetworks(message) {
debug("handleGetAvailableNetworks: " + JSON.stringify(message));
if (DEBUG) debug("handleGetAvailableNetworks: " + JSON.stringify(message));
if (message.errorMsg) {
debug("Received error from getAvailableNetworks: " + message.errorMsg);
if (DEBUG) {
debug("Received error from getAvailableNetworks: " + message.errorMsg);
}
this.fireRequestError(message.requestId, message.errorMsg);
return;
}
@ -1946,7 +1950,7 @@ RILContentHelper.prototype = {
},
handleSendCancelMMI: function handleSendCancelMMI(message) {
debug("handleSendCancelMMI " + JSON.stringify(message));
if (DEBUG) debug("handleSendCancelMMI " + JSON.stringify(message));
let request = this.takeRequest(message.requestId);
let requestWindow = this._windowsMap[message.requestId];
delete this._windowsMap[message.requestId];
@ -2013,7 +2017,7 @@ RILContentHelper.prototype = {
try {
handler.apply(listener, args);
} catch (e) {
debug("listener for " + name + " threw an exception: " + e);
if (DEBUG) debug("listener for " + name + " threw an exception: " + e);
}
}
},

View File

@ -9905,20 +9905,19 @@ let StkCommandParamsFactory = {
processSetupCall: function processSetupCall(cmdDetails, ctlvs) {
let call = {};
let iter = Iterator(ctlvs);
for (let i = 0; i < ctlvs.length; i++) {
let ctlv = ctlvs[i];
if (ctlv.tag == COMPREHENSIONTLV_TAG_ALPHA_ID) {
if (!call.confirmMessage) {
call.confirmMessage = ctlv.value.identifier;
} else {
call.callMessage = ctlv.value.identifier;
break;
}
}
let ctlv = StkProactiveCmdHelper.searchForNextTag(COMPREHENSIONTLV_TAG_ALPHA_ID, iter);
if (ctlv) {
call.confirmMessage = ctlv.value.identifier;
}
let ctlv = StkProactiveCmdHelper.searchForTag(COMPREHENSIONTLV_TAG_ADDRESS, ctlvs);
ctlv = StkProactiveCmdHelper.searchForNextTag(COMPREHENSIONTLV_TAG_ALPHA_ID, iter);
if (ctlv) {
call.callMessage = ctlv.value.identifier;
}
ctlv = StkProactiveCmdHelper.searchForTag(COMPREHENSIONTLV_TAG_ADDRESS, ctlvs);
if (!ctlv) {
RIL.sendStkTerminalResponse({
command: cmdDetails,
@ -10430,8 +10429,12 @@ let StkProactiveCmdHelper = {
},
searchForTag: function searchForTag(tag, ctlvs) {
for (let i = 0; i < ctlvs.length; i++) {
let ctlv = ctlvs[i];
let iter = Iterator(ctlvs);
return this.searchForNextTag(tag, iter);
},
searchForNextTag: function searchForNextTag(tag, iter) {
for (let [index, ctlv] in iter) {
if ((ctlv.tag & ~COMPREHENSIONTLV_FLAG_CR) == tag) {
return ctlv;
}

View File

@ -342,6 +342,47 @@ add_test(function test_write_length() {
});
// Test Proactive commands.
/**
* Verify Proactive command helper : searchForNextTag
*/
add_test(function test_stk_proactive_command_search_next_tag() {
let worker = newUint8Worker();
let pduHelper = worker.GsmPDUHelper;
let berHelper = worker.BerTlvHelper;
let stkHelper = worker.StkProactiveCmdHelper;
let tag_test = [
0xD0,
0x3C,
0x85, 0x0A, 0x61, 0x6C, 0x70, 0x68, 0x61, 0x20, 0x69, 0x64, 0x20, 0x31,
0x85, 0x0A, 0x61, 0x6C, 0x70, 0x68, 0x61, 0x20, 0x69, 0x64, 0x20, 0x32,
0x85, 0x0A, 0x61, 0x6C, 0x70, 0x68, 0x61, 0x20, 0x69, 0x64, 0x20, 0x33,
0x85, 0x0A, 0x61, 0x6C, 0x70, 0x68, 0x61, 0x20, 0x69, 0x64, 0x20, 0x34,
0x85, 0x0A, 0x61, 0x6C, 0x70, 0x68, 0x61, 0x20, 0x69, 0x64, 0x20, 0x35];
for (let i = 0; i < tag_test.length; i++) {
pduHelper.writeHexOctet(tag_test[i]);
}
let berTlv = berHelper.decode(tag_test.length);
let iter = Iterator(berTlv.value);
let tlv = stkHelper.searchForNextTag(COMPREHENSIONTLV_TAG_ALPHA_ID, iter);
do_check_eq(tlv.value.identifier, "alpha id 1");
tlv = stkHelper.searchForNextTag(COMPREHENSIONTLV_TAG_ALPHA_ID, iter);
do_check_eq(tlv.value.identifier, "alpha id 2");
tlv = stkHelper.searchForNextTag(COMPREHENSIONTLV_TAG_ALPHA_ID, iter);
do_check_eq(tlv.value.identifier, "alpha id 3");
tlv = stkHelper.searchForNextTag(COMPREHENSIONTLV_TAG_ALPHA_ID, iter);
do_check_eq(tlv.value.identifier, "alpha id 4");
tlv = stkHelper.searchForNextTag(COMPREHENSIONTLV_TAG_ALPHA_ID, iter);
do_check_eq(tlv.value.identifier, "alpha id 5");
run_next_test();
});
/**
* Verify Proactive Command : Refresh

View File

@ -13,3 +13,5 @@
interface SVGFEComponentTransferElement : SVGElement {
readonly attribute SVGAnimatedString in1;
};
SVGFEComponentTransferElement implements SVGFilterPrimitiveStandardAttributes;

View File

@ -17,3 +17,5 @@ interface SVGFEGaussianBlurElement : SVGElement {
void setStdDeviation(float stdDeviationX, float stdDeviationY);
};
SVGFEGaussianBlurElement implements SVGFilterPrimitiveStandardAttributes;

View File

@ -18,6 +18,8 @@
#ifdef XP_WIN
#include <process.h>
#define getpid _getpid
#else
#include <unistd.h>
#endif
#include "nsXULAppAPI.h"

View File

@ -1144,12 +1144,8 @@ TryConvertFreeName(BytecodeEmitter *bce, ParseNode *pn)
// The only statements within a lazy function which can push lexical
// scopes are try/catch blocks. Use generic ops in this case.
for (StmtInfoBCE *stmt = bce->topStmt; stmt; stmt = stmt->down) {
switch (stmt->type) {
case STMT_TRY:
case STMT_FINALLY:
if (stmt->type == STMT_CATCH)
return true;
default:;
}
}
size_t hops = 0;

View File

@ -38,6 +38,7 @@ JS::Zone::Zone(JSRuntime *rt)
scheduledForDestruction(false),
maybeAlive(true),
gcMallocBytes(0),
gcMallocGCTriggered(false),
gcGrayRoots(),
data(nullptr),
types(this)
@ -112,6 +113,7 @@ void
Zone::resetGCMallocBytes()
{
gcMallocBytes = ptrdiff_t(gcMaxMallocBytes);
gcMallocGCTriggered = false;
}
void
@ -128,7 +130,8 @@ Zone::setGCMaxMallocBytes(size_t value)
void
Zone::onTooMuchMalloc()
{
TriggerZoneGC(this, gcreason::TOO_MUCH_MALLOC);
if (!gcMallocGCTriggered)
gcMallocGCTriggered = TriggerZoneGC(this, JS::gcreason::TOO_MUCH_MALLOC);
}
void

View File

@ -250,7 +250,16 @@ struct Zone : public JS::shadow::Zone,
* gcMaxMallocBytes down to zero. This counter should be used only when it's
* not possible to know the size of a free.
*/
ptrdiff_t gcMallocBytes;
mozilla::Atomic<ptrdiff_t, mozilla::ReleaseAcquire> gcMallocBytes;
/*
* Whether a GC has been triggered as a result of gcMallocBytes falling
* below zero.
*
* This should be a bool, but Atomic only supports 32-bit and pointer-sized
* types.
*/
mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire> gcMallocGCTriggered;
/* This compartment's gray roots. */
js::Vector<js::GrayRoot, 0, js::SystemAllocPolicy> gcGrayRoots;
@ -278,10 +287,8 @@ struct Zone : public JS::shadow::Zone,
* Note: this code may be run from worker threads. We
* tolerate any thread races when updating gcMallocBytes.
*/
ptrdiff_t oldCount = gcMallocBytes;
ptrdiff_t newCount = oldCount - ptrdiff_t(nbytes);
gcMallocBytes = newCount;
if (JS_UNLIKELY(newCount <= 0 && oldCount > 0))
gcMallocBytes -= ptrdiff_t(nbytes);
if (JS_UNLIKELY(isTooMuchMalloc()))
onTooMuchMalloc();
}

View File

@ -0,0 +1,30 @@
function test1() {
var BUGNUMBER = '';
var summary = '';
var actual = '';
test(BUGNUMBER);
function test() {
try {
(function () { eval("'foo'.b()", arguments) })();
} catch(ex) {
actual = ex + '';
}
}
assertEq(actual, 'TypeError: "foo".b is not a function');
}
test1();
function test2() {
var BUGNUMBER = '';
var summary = '';
function g() {
'use strict';
try {
eval('function foo() { var a, arguments, b;}');
} catch (x) {
return (x instanceof SyntaxError);
}
};
assertEq(g(), true);
}
test2();

View File

@ -419,6 +419,11 @@ ICStub::trace(JSTracer *trc)
MarkObject(trc, &stub->templateObject(), "baseline-newobject-template");
break;
}
case ICStub::Rest_Fallback: {
ICRest_Fallback *stub = toRest_Fallback();
MarkObject(trc, &stub->templateObject(), "baseline-rest-template");
break;
}
default:
break;
}

View File

@ -5873,7 +5873,7 @@ class ICRest_Fallback : public ICFallbackStub
return space->allocate<ICRest_Fallback>(code, templateObject);
}
JSObject *templateObject() {
HeapPtrObject &templateObject() {
return templateObject_;
}

View File

@ -1937,29 +1937,31 @@ TriggerOperationCallback(JSRuntime *rt, JS::gcreason::Reason reason)
rt->triggerOperationCallback(JSRuntime::TriggerCallbackMainThread);
}
void
bool
js::TriggerGC(JSRuntime *rt, JS::gcreason::Reason reason)
{
/* Wait till end of parallel section to trigger GC. */
if (InParallelSection()) {
ForkJoinSlice::Current()->requestGC(reason);
return;
return true;
}
/* Don't trigger GCs when allocating under the operation callback lock. */
if (rt->currentThreadOwnsOperationCallbackLock())
return;
return false;
JS_ASSERT(CurrentThreadCanAccessRuntime(rt));
if (rt->isHeapBusy())
return;
/* GC is already running. */
if (rt->isHeapCollecting())
return false;
JS::PrepareForFullGC(rt);
TriggerOperationCallback(rt, reason);
return true;
}
void
bool
js::TriggerZoneGC(Zone *zone, JS::gcreason::Reason reason)
{
/*
@ -1968,35 +1970,37 @@ js::TriggerZoneGC(Zone *zone, JS::gcreason::Reason reason)
*/
if (InParallelSection()) {
ForkJoinSlice::Current()->requestZoneGC(zone, reason);
return;
return true;
}
/* Zones in use by a thread with an exclusive context can't be collected. */
if (zone->usedByExclusiveThread)
return;
return false;
JSRuntime *rt = zone->runtimeFromMainThread();
/* Don't trigger GCs when allocating under the operation callback lock. */
if (rt->currentThreadOwnsOperationCallbackLock())
return;
return false;
if (rt->isHeapBusy())
return;
/* GC is already running. */
if (rt->isHeapCollecting())
return false;
if (rt->gcZeal() == ZealAllocValue) {
TriggerGC(rt, reason);
return;
return true;
}
if (rt->isAtomsZone(zone)) {
/* We can't do a zone GC of the atoms compartment. */
TriggerGC(rt, reason);
return;
return true;
}
PrepareZoneForGC(zone);
TriggerOperationCallback(rt, reason);
return true;
}
void
@ -2912,6 +2916,9 @@ BeginMarkPhase(JSRuntime *rt)
WeakMapBase::resetCompartmentWeakMapList(c);
}
if (rt->gcIsFull)
UnmarkScriptData(rt);
MarkRuntime(gcmarker);
BufferGrayRoots(gcmarker);

View File

@ -690,11 +690,11 @@ extern void
TraceRuntime(JSTracer *trc);
/* Must be called with GC lock taken. */
extern void
extern bool
TriggerGC(JSRuntime *rt, JS::gcreason::Reason reason);
/* Must be called with GC lock taken. */
extern void
extern bool
TriggerZoneGC(Zone *zone, JS::gcreason::Reason reason);
extern void

View File

@ -1519,21 +1519,31 @@ MarkScriptData(JSRuntime *rt, const jsbytecode *bytecode)
SharedScriptData::fromBytecode(bytecode)->marked = true;
}
void
js::UnmarkScriptData(JSRuntime *rt)
{
JS_ASSERT(rt->gcIsFull);
ScriptDataTable &table = rt->scriptDataTable();
for (ScriptDataTable::Enum e(table); !e.empty(); e.popFront()) {
SharedScriptData *entry = e.front();
entry->marked = false;
}
}
void
js::SweepScriptData(JSRuntime *rt)
{
JS_ASSERT(rt->gcIsFull);
ScriptDataTable &table = rt->scriptDataTable();
bool keepAtoms = false;
for (ThreadDataIter iter(rt); !iter.done(); iter.next())
keepAtoms |= iter->gcKeepAtoms;
for (ThreadDataIter iter(rt); !iter.done(); iter.next()) {
if (iter->gcKeepAtoms)
return;
}
for (ScriptDataTable::Enum e(table); !e.empty(); e.popFront()) {
SharedScriptData *entry = e.front();
if (entry->marked) {
entry->marked = false;
} else if (!keepAtoms) {
if (!entry->marked) {
js_free(entry);
e.removeFront();
}

View File

@ -1404,6 +1404,9 @@ typedef HashSet<SharedScriptData*,
ScriptBytecodeHasher,
SystemAllocPolicy> ScriptDataTable;
extern void
UnmarkScriptData(JSRuntime *rt);
extern void
SweepScriptData(JSRuntime *rt);

View File

@ -235,6 +235,7 @@ JSRuntime::JSRuntime(JSUseHelperThreads useHelperThreads)
gcSliceCallback(nullptr),
gcFinalizeCallback(nullptr),
gcMallocBytes(0),
gcMallocGCTriggered(false),
scriptAndCountsVector(nullptr),
NaNValue(DoubleNaNValue()),
negativeInfinityValue(DoubleValue(NegativeInfinity())),
@ -726,10 +727,8 @@ void
JSRuntime::updateMallocCounter(JS::Zone *zone, size_t nbytes)
{
/* We tolerate any thread races when updating gcMallocBytes. */
ptrdiff_t oldCount = gcMallocBytes;
ptrdiff_t newCount = oldCount - ptrdiff_t(nbytes);
gcMallocBytes = newCount;
if (JS_UNLIKELY(newCount <= 0 && oldCount > 0))
gcMallocBytes -= ptrdiff_t(nbytes);
if (JS_UNLIKELY(gcMallocBytes <= 0))
onTooMuchMalloc();
else if (zone)
zone->updateMallocCounter(nbytes);
@ -738,8 +737,11 @@ JSRuntime::updateMallocCounter(JS::Zone *zone, size_t nbytes)
JS_FRIEND_API(void)
JSRuntime::onTooMuchMalloc()
{
if (CurrentThreadCanAccessRuntime(this))
TriggerGC(this, JS::gcreason::TOO_MUCH_MALLOC);
if (!CurrentThreadCanAccessRuntime(this))
return;
if (!gcMallocGCTriggered)
gcMallocGCTriggered = TriggerGC(this, JS::gcreason::TOO_MUCH_MALLOC);
}
JS_FRIEND_API(void *)

View File

@ -1233,7 +1233,16 @@ struct JSRuntime : public JS::shadow::Runtime,
* Malloc counter to measure memory pressure for GC scheduling. It runs
* from gcMaxMallocBytes down to zero.
*/
volatile ptrdiff_t gcMallocBytes;
mozilla::Atomic<ptrdiff_t, mozilla::ReleaseAcquire> gcMallocBytes;
/*
* Whether a GC has been triggered as a result of gcMallocBytes falling
* below zero.
*
* This should be a bool, but Atomic only supports 32-bit and pointer-sized
* types.
*/
mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire> gcMallocGCTriggered;
public:
void setNeedsBarrier(bool needs) {
@ -1548,7 +1557,10 @@ struct JSRuntime : public JS::shadow::Runtime,
void setGCMaxMallocBytes(size_t value);
void resetGCMallocBytes() { gcMallocBytes = ptrdiff_t(gcMaxMallocBytes); }
void resetGCMallocBytes() {
gcMallocBytes = ptrdiff_t(gcMaxMallocBytes);
gcMallocGCTriggered = false;
}
/*
* Call this after allocating memory held by GC things, to update memory

View File

@ -320,6 +320,30 @@ static nscolor MakeBevelColor(mozilla::css::Side whichSide, uint8_t style,
nscolor aBackgroundColor,
nscolor aBorderColor);
static gfxContext::GraphicsOperator GetGFXBlendMode(uint8_t mBlendMode)
{
switch (mBlendMode) {
case NS_STYLE_BLEND_NORMAL: return gfxContext::OPERATOR_OVER;
case NS_STYLE_BLEND_MULTIPLY: return gfxContext::OPERATOR_MULTIPLY;
case NS_STYLE_BLEND_SCREEN: return gfxContext::OPERATOR_SCREEN;
case NS_STYLE_BLEND_OVERLAY: return gfxContext::OPERATOR_OVERLAY;
case NS_STYLE_BLEND_DARKEN: return gfxContext::OPERATOR_DARKEN;
case NS_STYLE_BLEND_LIGHTEN: return gfxContext::OPERATOR_LIGHTEN;
case NS_STYLE_BLEND_COLOR_DODGE: return gfxContext::OPERATOR_COLOR_DODGE;
case NS_STYLE_BLEND_COLOR_BURN: return gfxContext::OPERATOR_COLOR_BURN;
case NS_STYLE_BLEND_HARD_LIGHT: return gfxContext::OPERATOR_HARD_LIGHT;
case NS_STYLE_BLEND_SOFT_LIGHT: return gfxContext::OPERATOR_SOFT_LIGHT;
case NS_STYLE_BLEND_DIFFERENCE: return gfxContext::OPERATOR_DIFFERENCE;
case NS_STYLE_BLEND_EXCLUSION: return gfxContext::OPERATOR_EXCLUSION;
case NS_STYLE_BLEND_HUE: return gfxContext::OPERATOR_HUE;
case NS_STYLE_BLEND_SATURATION: return gfxContext::OPERATOR_SATURATION;
case NS_STYLE_BLEND_COLOR: return gfxContext::OPERATOR_COLOR;
case NS_STYLE_BLEND_LUMINOSITY: return gfxContext::OPERATOR_LUMINOSITY;
}
return gfxContext::OPERATOR_OVER;
}
static InlineBackgroundData* gInlineBGData = nullptr;
// Initialize any static variables used by nsCSSRendering.
@ -2561,10 +2585,18 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
nsBackgroundLayerState state = PrepareBackgroundLayer(aPresContext, aForFrame,
aFlags, aBorderArea, clipState.mBGClipArea, *bg, layer);
if (!state.mFillArea.IsEmpty()) {
if (state.mCompositingOp != gfxContext::OPERATOR_OVER) {
NS_ASSERTION(ctx->CurrentOperator() == gfxContext::OPERATOR_OVER,
"It is assumed the initial operator is OPERATOR_OVER, when it is restored later");
ctx->SetOperator(state.mCompositingOp);
}
state.mImageRenderer.DrawBackground(aPresContext, aRenderingContext,
state.mDestArea, state.mFillArea,
state.mAnchor + aBorderArea.TopLeft(),
clipState.mDirtyRect);
if (state.mCompositingOp != gfxContext::OPERATOR_OVER) {
ctx->SetOperator(gfxContext::OPERATOR_OVER);
}
}
}
}
@ -2856,6 +2888,7 @@ nsCSSRendering::PrepareBackgroundLayer(nsPresContext* aPresContext,
* background-origin
* background-size
* background-break (-moz-background-inline-policy)
* background-blend-mode
*
* (background-color applies to the entire element and not to individual
* layers, so it is irrelevant to this method.)
@ -2978,6 +3011,9 @@ nsCSSRendering::PrepareBackgroundLayer(nsPresContext* aPresContext,
state.mFillArea.height = bgClipRect.height;
}
state.mFillArea.IntersectRect(state.mFillArea, bgClipRect);
state.mCompositingOp = GetGFXBlendMode(aLayer.mBlendMode);
return state;
}

View File

@ -213,7 +213,7 @@ struct nsBackgroundLayerState {
* @param aFlags some combination of nsCSSRendering::PAINTBG_* flags
*/
nsBackgroundLayerState(nsIFrame* aForFrame, const nsStyleImage* aImage, uint32_t aFlags)
: mImageRenderer(aForFrame, aImage, aFlags) {}
: mImageRenderer(aForFrame, aImage, aFlags), mCompositingOp(gfxContext::OPERATOR_OVER) {}
/**
* The nsImageRenderer that will be used to draw the background.
@ -237,6 +237,10 @@ struct nsBackgroundLayerState {
* PrepareBackgroundLayer.
*/
nsPoint mAnchor;
/**
* The compositing operation that the image should use
*/
gfxContext::GraphicsOperator mCompositingOp;
};
struct nsCSSRendering {

View File

@ -1739,11 +1739,15 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
drawBackgroundImage, drawBackgroundColor);
}
// An auxiliary list is necessary in case we have background blending; if that
// is the case, background items need to be wrapped by a blend container to
// isolate blending to the background
nsDisplayList bgItemList;
// Even if we don't actually have a background color to paint, we may still need
// to create an item for hit testing.
if ((drawBackgroundColor && color != NS_RGBA(0,0,0,0)) ||
aBuilder->IsForEventDelivery()) {
aList->AppendNewToTop(
bgItemList.AppendNewToTop(
new (aBuilder) nsDisplayBackgroundColor(aBuilder, aFrame, bg,
drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0)));
}
@ -1751,25 +1755,40 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
if (isThemed) {
nsDisplayThemedBackground* bgItem =
new (aBuilder) nsDisplayThemedBackground(aBuilder, aFrame);
aList->AppendNewToTop(bgItem);
bgItemList.AppendNewToTop(bgItem);
aList->AppendToTop(&bgItemList);
return true;
}
if (!bg) {
aList->AppendToTop(&bgItemList);
return false;
}
bool needBlendContainer = false;
// Passing bg == nullptr in this macro will result in one iteration with
// i = 0.
NS_FOR_VISIBLE_BACKGROUND_LAYERS_BACK_TO_FRONT(i, bg) {
if (bg->mLayers[i].mImage.IsEmpty()) {
continue;
}
if (bg->mLayers[i].mBlendMode != NS_STYLE_BLEND_NORMAL) {
needBlendContainer = true;
}
nsDisplayBackgroundImage* bgItem =
new (aBuilder) nsDisplayBackgroundImage(aBuilder, aFrame, i, bg);
aList->AppendNewToTop(bgItem);
bgItemList.AppendNewToTop(bgItem);
}
if (needBlendContainer) {
bgItemList.AppendNewToTop(
new (aBuilder) nsDisplayBlendContainer(aBuilder, aFrame, &bgItemList));
}
aList->AppendToTop(&bgItemList);
return false;
}
@ -2091,7 +2110,7 @@ nsDisplayBackgroundImage::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
if (mBackgroundStyle->mBackgroundInlinePolicy == NS_STYLE_BG_INLINE_POLICY_EACH_BOX ||
(!mFrame->GetPrevContinuation() && !mFrame->GetNextContinuation())) {
const nsStyleBackground::Layer& layer = mBackgroundStyle->mLayers[mLayer];
if (layer.mImage.IsOpaque()) {
if (layer.mImage.IsOpaque() && layer.mBlendMode == NS_STYLE_BLEND_NORMAL) {
nsPresContext* presContext = mFrame->PresContext();
result = GetInsideClipRegion(this, presContext, layer.mClip, mBounds, aSnap);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100">
<svg><rect width="100%" height="100%" fill="#00FF00"/></svg>
</svg>

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,62 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
background-color: rgba(0, 255, 0, 0.5);
}
.child {
width: 100px;
height: 100px;
opacity: 0.5;
background-color: rgb(0, 127, 0);
}
.topleft {
float:left;
width: 100px;
height: 100px;
/*First blend black rect with green in place*/
/* Cs = (1 - αb) x Cs + αb x B(Cb, Cs)*/
/* B(Cb, Cs) = | Cb - Cs | = (0, 0, 0) */
/* 0.5 * (0, 255, 0) + 0.5 * (0, 0, 0) = (0, 127.5, 0)*/
/* Now, composite the resulting color with src-over; the alpha is the original alpha for the top layer
while the color is the blending result*/
/* co = αs x Fa x Cs + αb x Fb x Cb - this is premultiplied */
/* αo = αs + αb x (1 αs) */
/* Source over: Fa = 1; Fb = 1 αs */
/*co = 0.5 * 1 * (0, 127.5, 0) + 0.5 * 0.5 * (0, 255, 0) = (0, 63.5, 0) + 0.25 * (0, 255, 0) = (0, 127.5, 0)*/
/*ao = 0.5 + 0.5 * 0.5 = 0.75*/
/* Co = co/ao = (0, 127.5, 0) / 0.75*/
/* Now alpha composite on white background */
/*co = 0.75 * 1 * (0, 127.5, 0) / 0.75 + 1 * 0.25 * (255, 255, 255) = (0, 127.5, 0) + (63.75, 63.75, 63.75) = (63.75, 159, 63.75) = (64, 191, 64) */
background-color: rgb(64, 191, 64);
}
.topright {
float:left;
width: 100px;
height: 100px;
}
.bottom {
width:200px;
height: 100px;
clear:both;
}
</style>
<div class="topleft"></div>
<div class="reftest topright"></div>
<div class="reftest bottom"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-image: url(as-image/green100x100_alpha.png);
background-color: rgba(0, 255, 0, 0.5);
background-blend-mode: difference;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(127,0,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(0,127,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,16 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: color-burn;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(255,127,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(127,255,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(253,253,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: color-dodge;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(255,105,105,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(93,0,0,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(255,52,52,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(0,131,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,48,0,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(0,192,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(55,55,255,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(137,137,255,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(95,95,255,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(86,86,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(164,164,37,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(31,31,0,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: color;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(127,0,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(0,127,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(127,0,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(0,127,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: darken;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(255,255,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(255,0,255,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(128,127,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(255,255,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,255,255,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(127,128,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(255,0,255,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,255,255,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(127,127,255,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(128,127,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(127,128,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(127,127,255,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: difference;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(255,255,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(255,0,255,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(128,127,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(255,255,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,255,255,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(127,128,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(255,0,255,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,255,255,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(127,127,255,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(128,127,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(127,128,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(127,127,255,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: exclusion;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-image: linear-gradient(rgb(0,255,255), rgb(255,255,0));
background-color: rgb(0,255,0);
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-image: linear-gradient(rgb(0,0,255), rgb(255,0,0));
background-color: rgb(0,255,0);
background-blend-mode: difference;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-image: url(as-image/black100x100.png),
linear-gradient(rgb(0,0,255), rgb(255,0,0), rgb(0, 0, 255));
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-image: linear-gradient(rgb(0,0,255), rgb(255,0,0)),
linear-gradient(rgb(0,0,255), rgb(255,0,0), rgb(0,0,255));
background-blend-mode: difference;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-image: linear-gradient(rgb(0,255,255), rgb(255,255,0));
background-color: rgb(0,255,0);
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-image: linear-gradient(rgb(0,0,255), rgb(255,0,0)), url(as-image/green_square.svg);
background-blend-mode: difference;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(254,0,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(0,254,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: hard-light;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(255,105,105,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(93,0,0,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(202,75,75,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(0,131,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,48,0,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(38,165,38,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(55,55,255,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(137,137,255,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(99,99,226,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(87,87,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(169,169,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(31,31,0,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: hue;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,26 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-color: rgb(0,255,0);
background-blend-mode: difference;
}
.jpg {
background-image: url(as-image/green100x100.jpg);
}
</style>
<div class="reftest blend jpg"></div>
</html>

View File

@ -0,0 +1,25 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-color: rgb(0,255,0);
background-blend-mode: difference;
}
.png {
background-image: url(as-image/green100x100.png);
}
</style>
<div class="reftest blend png"></div>
</html>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-image: url(as-image/black100x100.png);
background-color: rgb(0,255,0);
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,25 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-color: rgb(0,255,0);
background-blend-mode: difference;
}
.svg {
background-image: url(as-image/green_square.svg);
}
</style>
<div class="reftest blend svg"></div>
</html>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 200px 200px, 100px 100px;
background-repeat: no-repeat;
}
.blend {
background-image: url(as-image/green_square.svg), linear-gradient(rgb(0,0,255), rgb(255,0,0));
background-blend-mode: difference;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-image: url(as-image/black100x100.png);
background-color: rgb(0, 255, 0);
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 200px;
height: 200px;
background-size: 100px 100px, 200px 200px;
background-repeat: no-repeat;
}
.blend {
background-image: url(as-image/green100x100.png),
url(as-image/green_square.svg);
background-blend-mode: difference;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,27 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 100px;
height: 100px;
}
.image {
background-image: url(as-image/green100x100.png);
}
.color {
background-color: rgb(0, 255, 0);
}
body {
background-color: rgb(0, 0, 255);
}
</style>
<div class="reftest image"></div>
<div class="reftest color"></div>
</html>

View File

@ -0,0 +1,31 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 100px;
height: 100px;
}
.image {
background-image: url(as-image/green100x100.png);
background-blend-mode: difference;
}
.color {
background-color: rgb(0, 255, 0);
background-blend-mode: difference;
}
body {
background-color: rgb(0, 0, 255);
}
</style>
<body>
<div class="reftest image"></div>
<div class="reftest color"></div>
</body>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(255,255,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(255,0,255,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(255,127,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(255,255,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,255,255,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(127,255,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(255,0,255,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,255,255,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(127,127,255,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(255,127,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(127,255,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(127,127,255,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: lighten;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,33 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 100px;
height: 100px;
float:left;
}
.first {
background-color: rgb(0, 0, 0);
}
.second {
background-color: rgb(0, 255, 0);
}
.third {
background-color: rgb(0, 0, 0);
}
.fourth {
background-color: rgb(0, 255, 0);
}
</style>
<div class="reftest first"></div>
<div class="reftest second"></div>
<div class="reftest third"></div>
<div class="reftest fourth"></div>
</html>

View File

@ -0,0 +1,24 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 400px;
height: 100px;
background-size: 100px 100px, 200px 100px, 300px 100px;
background-repeat: no-repeat;
}
.blend {
background-color: rgb(0, 255, 0);
background-blend-mode: multiply, screen;
background-image: url(as-image/red100x100.png),
url(as-image/green100x100.png),
url(as-image/red100x100.png);
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(0,131,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(55,55,255,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(86,86,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(255,105,105,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(137,137,255,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(164,164,37,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(93,0,0,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,48,0,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(31,31,0,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(255,52,52,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(0,192,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(95,95,255,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: luminosity;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,33 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 100px;
height: 100px;
float:left;
}
.first {
background-color: rgb(255, 0, 255);
}
.second {
background-color: rgb(0, 0, 255);
}
.third {
background-color: rgb(0, 255, 255);
}
.fourth {
background-color: rgb(0, 255, 0);
}
</style>
<div class="reftest first"></div>
<div class="reftest second"></div>
<div class="reftest third"></div>
<div class="reftest fourth"></div>
</html>

View File

@ -0,0 +1,24 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<style>
.reftest {
width: 400px;
height: 100px;
background-size: 100px 100px, 200px 100px, 300px 100px;
background-repeat: no-repeat;
}
.blend {
background-color: rgb(0, 255, 0);
background-blend-mode: difference, exclusion, screen;
background-image: url(as-image/red100x100.png),
url(as-image/green100x100.png),
url(as-image/blue100x100.png);
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(127,0,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(0,127,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(127,0,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(0,127,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(63,63,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: multiply;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: normal;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(254,0,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(0,254,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(0,0,0,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(126,126,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: overlay;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(166,39,39,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(76,203,76,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(14,14,141,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(127,127,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: saturation;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(255,255,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(255,0,255,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(255,127,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(255,255,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,255,255,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(127,255,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(255,0,255,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,255,255,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(127,127,255,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(255,127,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(127,255,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(127,127,255,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(190,190,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: screen;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400">
<rect x="0" y="0" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="0" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="0" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="0" width="40" height="40" fill="rgba(190,63,0,1)"></rect>
<rect x="0" y="40" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="40" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="40" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="40" width="40" height="40" fill="rgba(64,190,0,1)"></rect>
<rect x="0" y="80" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="80" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="80" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="80" width="40" height="40" fill="rgba(63,63,0,1)"></rect>
<rect x="0" y="120" width="40" height="40" fill="rgba(255,0,0,1)"></rect>
<rect x="40" y="120" width="40" height="40" fill="rgba(0,255,0,1)"></rect>
<rect x="80" y="120" width="40" height="40" fill="rgba(0,0,255,1)"></rect>
<rect x="120" y="120" width="40" height="40" fill="rgba(126,126,0,1)"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<link rel="stylesheet" href="blend-modes.css" type="text/css" />
<style>
.blend {
background-blend-mode: soft-light;
}
</style>
<div class="reftest blend"></div>
</html>

View File

@ -0,0 +1,26 @@
body {
margin: 0;
}
.reftest {
width: 160px;
height: 160px;
background-size:
160px 40px, 160px 40px, 160px 40px, 160px 40px,
40px 160px, 40px 160px, 40px 160px, 40px 160px;
background-position:
0px 0px, 0px 40px, 0px 80px, 0px 120px,
0px 0px, 40px 0px, 80px 0, 120px 0;
background-repeat: no-repeat;
background-image: url(as-image/red100x100.png),
url(as-image/green100x100.png),
url(as-image/blue100x100.png),
url(as-image/brown100x100.png),
url(as-image/red100x100.png),
url(as-image/green100x100.png),
url(as-image/blue100x100.png),
url(as-image/brown100x100.png);
}

View File

@ -3,3 +3,34 @@ pref(layout.css.mix-blend-mode.enabled,true) == blend-constant-background-color.
pref(layout.css.mix-blend-mode.enabled,true) == blend-gradient-background-color.html blend-gradient-background-color-ref.html
pref(layout.css.mix-blend-mode.enabled,true) == blend-image.html blend-image-ref.html
pref(layout.css.mix-blend-mode.enabled,true) == blend-difference-stacking.html blend-difference-stacking-ref.html
pref(layout.css.background-blend-mode.enabled,true) == background-blending-alpha.html background-blending-alpha-ref.html
pref(layout.css.background-blend-mode.enabled,true) == background-blending-gradient-color.html background-blending-gradient-color-ref.html
fuzzy-if(azureSkiaGL,3,7597) fuzzy-if(azureQuartz,3,7597) fuzzy-if(d2d,1,3800) pref(layout.css.background-blend-mode.enabled,true) == background-blending-gradient-gradient.html background-blending-gradient-gradient-ref.html
fuzzy-if(azureSkiaGL,2,7174) fuzzy-if(azureQuartz,2,7174) pref(layout.css.background-blend-mode.enabled,true) == background-blending-gradient-image.html background-blending-gradient-color-ref.html
fuzzy-if(azureQuartz,2,10000) fuzzy-if(azureSkia||d2d||gtk2Widget,1,10000) pref(layout.css.background-blend-mode.enabled,true) == background-blending-image-color-jpg.html background-blending-image-color-ref.html
pref(layout.css.background-blend-mode.enabled,true) == background-blending-image-color-png.html background-blending-image-color-ref.html
pref(layout.css.background-blend-mode.enabled,true) == background-blending-image-color-svg.html background-blending-image-color-ref.html
fuzzy-if(azureSkiaGL,2,7174) fuzzy-if(azureQuartz,2,7174) pref(layout.css.background-blend-mode.enabled,true) == background-blending-image-gradient.html background-blending-gradient-color-ref.html
pref(layout.css.background-blend-mode.enabled,true) == background-blending-image-image.html background-blending-image-color-ref.html
pref(layout.css.background-blend-mode.enabled,true) == background-blending-isolation.html background-blending-isolation-ref.html
pref(layout.css.background-blend-mode.enabled,true) == background-blending-list-repeat.html background-blending-list-repeat-ref.html
pref(layout.css.background-blend-mode.enabled,true) == background-blending-multiple-images.html background-blending-multiple-images-ref.html
pref(layout.css.background-blend-mode.enabled,true) == background-blending-color-burn.html background-blending-color-burn-ref.svg
pref(layout.css.background-blend-mode.enabled,true) == background-blending-color-dodge.html background-blending-color-dodge-ref.svg
# need to investigate why these tests are fuzzy - first suspect is a possible color space conversion on some platforms; same for mix-blend-mode tests
fuzzy-if(azureQuartz,2,8000) fuzzy-if(azureSkia||gtk2Widget,2,9600) fuzzy-if(d2d,1,8000) pref(layout.css.background-blend-mode.enabled,true) == background-blending-color.html background-blending-color-ref.svg
pref(layout.css.background-blend-mode.enabled,true) == background-blending-darken.html background-blending-darken-ref.svg
pref(layout.css.background-blend-mode.enabled,true) == background-blending-difference.html background-blending-difference-ref.svg
pref(layout.css.background-blend-mode.enabled,true) == background-blending-exclusion.html background-blending-exclusion-ref.svg
fuzzy-if(azureQuartz||d2d,1,1600) pref(layout.css.background-blend-mode.enabled,true) == background-blending-hard-light.html background-blending-hard-light-ref.svg
fuzzy-if(azureQuartz,2,8000) fuzzy-if(d2d,1,9600) fuzzy-if(azureSkia||gtk2Widget,2,9600) pref(layout.css.background-blend-mode.enabled,true) == background-blending-hue.html background-blending-hue-ref.svg
pref(layout.css.background-blend-mode.enabled,true) == background-blending-lighten.html background-blending-lighten-ref.svg
fuzzy-if(azureQuartz,2,8000) fuzzy-if(d2d,1,8000) fuzzy-if(azureSkia||gtk2Widget,2,9600) pref(layout.css.background-blend-mode.enabled,true) == background-blending-luminosity.html background-blending-luminosity-ref.svg
pref(layout.css.background-blend-mode.enabled,true) == background-blending-multiply.html background-blending-multiply-ref.svg
pref(layout.css.background-blend-mode.enabled,true) == background-blending-normal.html background-blending-normal-ref.svg
fuzzy-if(azureSkia||gtk2Widget,1,1600) pref(layout.css.background-blend-mode.enabled,true) == background-blending-overlay.html background-blending-overlay-ref.svg
fuzzy-if(d2d,1,1600) fuzzy-if(azureSkia||gtk2Widget,2,12800) fuzzy-if(OSX==10.6,1,1600) pref(layout.css.background-blend-mode.enabled,true) == background-blending-saturation.html background-blending-saturation-ref.svg
fuzzy-if(d2d||azureSkia||gtk2Widget,1,1600) pref(layout.css.background-blend-mode.enabled,true) == background-blending-screen.html background-blending-screen-ref.svg
fuzzy-if(azureQuartz,1,1600) fuzzy-if(d2d||azureSkia||gtk2Widget,10,4800) pref(layout.css.background-blend-mode.enabled,true) == background-blending-soft-light.html background-blending-soft-light-ref.svg

View File

@ -0,0 +1,18 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" onload="createFilter();">
<title>Reference for filter result property</title>
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=935902 -->
<defs>
<filter id="f1">
<feGaussianBlur id="gb" in="SourceGraphic" stdDeviation="4" result="blur"/>
<feColorMatrix values="1 0 0 0 0 0 0.333 0 0 0 0 0 1 0 0 0 0 0 1 0" in="blur"/>
</filter>
</defs>
<circle cx="100" cy="50" r="50" fill="yellow" filter="url('#f1')"/>
</svg>

After

Width:  |  Height:  |  Size: 611 B

View File

@ -0,0 +1,23 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" onload="createFilter();">
<title>Testcase for filter result property</title>
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=935902 -->
<defs>
<filter id="f1">
<feGaussianBlur id="gb" in="SourceGraphic" stdDeviation="4"/>
<feColorMatrix values="1 0 0 0 0 0 0.333 0 0 0 0 0 1 0 0 0 0 0 1 0" in="blur"/>
</filter>
</defs>
<circle cx="100" cy="50" r="50" fill="yellow" filter="url('#f1')"/>
<script type="text/javascript">
function createFilter() {
document.getElementById('gb').result.baseVal = 'blur';
}
</script>
</svg>

After

Width:  |  Height:  |  Size: 739 B

View File

@ -150,6 +150,7 @@ fails-if(Android||B2G) pref(security.fileuri.strict_origin_policy,true) == filte
== filter-foreignObject-01.svg pass.svg
== filter-in-mask-01.svg pass.svg
skip-if(B2G) == filter-invalidation-01.svg pass.svg
== filter-result-01.svg filter-result-01-ref.svg
skip-if(B2G) == filter-scaled-01.svg pass.svg
skip-if(B2G) == filter-scaled-02.html filter-scaled-02-ref.html
== filter-translated-01.svg filter-translated-01-ref.svg
@ -315,6 +316,7 @@ HTTP(..) == text-scale-03.svg text-scale-03-ref.svg
fails-if(OSX==10.8) == stroke-dasharray-01.svg stroke-dasharray-01-ref.svg # bug 896487
== stroke-dasharray-and-pathLength-01.svg pass.svg
== stroke-dasharray-and-text-01.svg stroke-dasharray-and-text-01-ref.svg
== stroke-dashoffset-01.svg pass.svg
== stroke-linecap-square-w-zero-length-segs-01.svg pass.svg
== stroke-linecap-square-w-zero-length-segs-02.svg pass.svg
== textPath-01.svg textPath-01-ref.svg

View File

@ -0,0 +1,30 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<title>Test that stroke-dashoffset is independent of stroke-width</title>
<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=885585 -->
<rect width="100%" height="100%" fill="lime"/>
<path d="M10,30 h300" stroke="red" stroke-width="40" stroke-dashoffset="10" stroke-dasharray="50"/>
<path d="M10,70 h300" stroke="red" stroke-width="20" stroke-dashoffset="20" stroke-dasharray="50"/>
<path d="M10,95 h300" stroke="red" stroke-width="10" stroke-dashoffset="40" stroke-dasharray="50"/>
<!-- if the stroke-dashoffset is independent of the stroke width then these should cover what's above -->
<rect x="10" y="10" width="40" height="40" fill="lime"/>
<rect x="100" y="10" width="50" height="40" fill="lime"/>
<rect x="200" y="10" width="50" height="40" fill="lime"/>
<rect x="300" y="10" width="10" height="40" fill="lime"/>
<rect x="10" y="60" width="30" height="20" fill="lime"/>
<rect x="90" y="60" width="50" height="20" fill="lime"/>
<rect x="190" y="60" width="50" height="20" fill="lime"/>
<rect x="290" y="60" width="20" height="20" fill="lime"/>
<rect x="10" y="90" width="10" height="10" fill="lime"/>
<rect x="70" y="90" width="50" height="10" fill="lime"/>
<rect x="170" y="90" width="50" height="10" fill="lime"/>
<rect x="270" y="90" width="40" height="10" fill="lime"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -544,6 +544,19 @@ CSS_PROP_BACKGROUND(
kBackgroundInlinePolicyKTable,
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_BACKGROUND(
background-blend-mode,
background_blend_mode,
BackgroundBlendMode,
CSS_PROPERTY_PARSE_VALUE_LIST |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"layout.css.background-blend-mode.enabled",
VARIANT_KEYWORD, // used by list parsing
kBlendModeKTable,
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_BACKGROUND(
background-origin,
background_origin,

View File

@ -2010,6 +2010,14 @@ nsComputedDOMStyle::DoGetBackgroundInlinePolicy()
return val;
}
CSSValue*
nsComputedDOMStyle::DoGetBackgroundBlendMode()
{
return GetBackgroundList(&nsStyleBackground::Layer::mBlendMode,
&nsStyleBackground::mBlendModeCount,
nsCSSProps::kBlendModeKTable);
}
CSSValue*
nsComputedDOMStyle::DoGetBackgroundOrigin()
{

View File

@ -260,6 +260,7 @@ private:
mozilla::dom::CSSValue* DoGetBackgroundRepeat();
mozilla::dom::CSSValue* DoGetBackgroundClip();
mozilla::dom::CSSValue* DoGetBackgroundInlinePolicy();
mozilla::dom::CSSValue* DoGetBackgroundBlendMode();
mozilla::dom::CSSValue* DoGetBackgroundOrigin();
mozilla::dom::CSSValue* DoGetBackgroundSize();

View File

@ -53,6 +53,7 @@ COMPUTED_STYLE_PROP(animation_timing_function, AnimationTimingFunction)
COMPUTED_STYLE_PROP(backface_visibility, BackfaceVisibility)
//// COMPUTED_STYLE_PROP(background, Background)
COMPUTED_STYLE_PROP(background_attachment, BackgroundAttachment)
COMPUTED_STYLE_PROP(background_blend_mode, BackgroundBlendMode)
COMPUTED_STYLE_PROP(background_clip, BackgroundClip)
COMPUTED_STYLE_PROP(background_color, BackgroundColor)
COMPUTED_STYLE_PROP(background_image, BackgroundImage)

View File

@ -6050,6 +6050,14 @@ nsRuleNode::ComputeBackgroundData(void* aStartStruct,
parentBG->mBackgroundInlinePolicy,
NS_STYLE_BG_INLINE_POLICY_CONTINUOUS, 0, 0, 0, 0);
// background-blend-mode: enum, inherit, initial [list]
SetBackgroundList(aContext, *aRuleData->ValueForBackgroundBlendMode(),
bg->mLayers,
parentBG->mLayers, &nsStyleBackground::Layer::mBlendMode,
uint8_t(NS_STYLE_BLEND_NORMAL), parentBG->mBlendModeCount,
bg->mBlendModeCount, maxItemCount, rebuild,
canStoreInRuleTree);
// background-origin: enum, inherit, initial [list]
SetBackgroundList(aContext, *aRuleData->ValueForBackgroundOrigin(),
bg->mLayers,
@ -6092,6 +6100,8 @@ nsRuleNode::ComputeBackgroundData(void* aStartStruct,
bg->mAttachmentCount, fillCount);
FillBackgroundList(bg->mLayers, &nsStyleBackground::Layer::mClip,
bg->mClipCount, fillCount);
FillBackgroundList(bg->mLayers, &nsStyleBackground::Layer::mBlendMode,
bg->mBlendModeCount, fillCount);
FillBackgroundList(bg->mLayers, &nsStyleBackground::Layer::mOrigin,
bg->mOriginCount, fillCount);
FillBackgroundList(bg->mLayers, &nsStyleBackground::Layer::mPosition,

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