Merge mozilla-central to autoland. a=merge CLOSED TREE

This commit is contained in:
Gurzau Raul 2018-05-13 00:53:50 +03:00
Родитель fb1537aa7f a85db9e29e
Коммит 5350b616ef
174 изменённых файлов: 1906 добавлений и 581 удалений

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

@ -328,7 +328,7 @@ MARKUPMAP(
table,
[](Element* aElement, Accessible* aContext) -> Accessible* {
if (aElement->GetPrimaryFrame()->AccessibleType() != eHTMLTableType) {
return new ARIAGridAccessible(aElement, aContext->Document());
return new ARIAGridAccessibleWrap(aElement, aContext->Document());
}
return nullptr;
},
@ -350,7 +350,7 @@ MARKUPMAP(
// accessible, because there's no underlying table layout and thus native
// HTML table cell class doesn't work.
if (!aContext->IsHTMLTableRow()) {
return new ARIAGridCellAccessible(aElement, aContext->Document());
return new ARIAGridCellAccessibleWrap(aElement, aContext->Document());
}
if (aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::scope)) {
return new HTMLTableHeaderCellAccessibleWrap(aElement, aContext->Document());
@ -366,7 +366,7 @@ MARKUPMAP(
[](Element* aElement, Accessible* aContext) -> Accessible* {
if (aContext->IsTableRow() && aContext->GetContent() == aElement->GetParent()) {
if (!aContext->IsHTMLTableRow()) {
return new ARIAGridCellAccessible(aElement, aContext->Document());
return new ARIAGridCellAccessibleWrap(aElement, aContext->Document());
}
return new HTMLTableHeaderCellAccessibleWrap(aElement, aContext->Document());
}

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

@ -33,7 +33,7 @@ skip-if = !e10s
[browser_SitePermissions_expiry.js]
[browser_SitePermissions_tab_urls.js]
[browser_taskbar_preview.js]
skip-if = os != "win"
skip-if = os != win || (os == win && bits == 64) # bug 1456807
[browser_UnsubmittedCrashHandler.js]
run-if = crashreporter
[browser_urlBar_zoom.js]

Двоичные данные
config/external/icu/data/icudt61l.dat поставляемый

Двоичный файл не отображается.

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

@ -46,4 +46,3 @@ DEPRECATED_OPERATION(OrientationEvent)
DEPRECATED_OPERATION(ProximityEvent)
DEPRECATED_OPERATION(AmbientLightEvent)
DEPRECATED_OPERATION(IDBOpenDBOptions_StorageType)
DEPRECATED_OPERATION(GetPropertyCSSValue)

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

@ -358,5 +358,3 @@ ProximityEventWarning=Use of the proximity sensor is deprecated.
AmbientLightEventWarning=Use of the ambient light sensor is deprecated.
# LOCALIZATION NOTE: Do not translate "storage", "indexedDB.open" and "navigator.storage.persist()".
IDBOpenDBOptions_StorageTypeWarning=The storage attribute in options passed to indexedDB.open is deprecated and will soon be removed. To get persistent storage, please use navigator.storage.persist() instead.
# LOCALIZATION NOTE: Do not translate "getPropertyCSSValue" and "getPropertyValue".
GetPropertyCSSValueWarning=Use of getPropertyCSSValue is deprecated, use getPropertyValue instead.

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

@ -19,9 +19,6 @@ interface CSSStyleDeclaration {
[Throws]
DOMString getPropertyValue(DOMString property);
// Mozilla extension, sort of
[Throws, Pref="layout.css.getPropertyCSSValue.enabled"]
CSSValue? getPropertyCSSValue(DOMString property);
DOMString getPropertyPriority(DOMString property);
[CEReactions, NeedsSubjectPrincipal=NonSystem, Throws]
void setProperty(DOMString property, [TreatNullAs=EmptyString] DOMString value, [TreatNullAs=EmptyString] optional DOMString priority = "");

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

@ -641,10 +641,6 @@ CSSEditUtils::GetDefaultLengthUnit(nsAString& aLengthUnit)
}
}
// Unfortunately, CSSStyleDeclaration::GetPropertyCSSValue is not yet
// implemented... We need then a way to determine the number part and the unit
// from aString, aString being the result of a GetPropertyValue query...
// static
void
CSSEditUtils::ParseLength(const nsAString& aString,

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

@ -273,9 +273,7 @@ public:
bool aSuppressTransaction);
/**
* Parses a "xxxx.xxxxxuuu" string where x is a digit and u an alpha char
* we need such a parser because
* nsIDOMCSSStyleDeclaration::GetPropertyCSSValue() is not implemented.
* Parses a "xxxx.xxxxxuuu" string where x is a digit and u an alpha char.
*
* @param aString [IN] Input string to parse.
* @param aValue [OUT] Numeric part.

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

@ -183,10 +183,6 @@ ChangeStyleTransaction::DoTransaction()
nsAutoString returnString;
if (multiple) {
// Let's remove only the value we have to remove and not the others
// The two lines below are a workaround because
// nsDOMCSSDeclaration::GetPropertyCSSValue is not yet implemented (bug
// 62682)
RemoveValueFromListOfValues(values, NS_LITERAL_STRING("none"));
RemoveValueFromListOfValues(values, mValue);
if (values.IsEmpty()) {
@ -207,10 +203,6 @@ ChangeStyleTransaction::DoTransaction()
cssDecl->GetPropertyPriority(propertyNameString, priority);
if (multiple) {
// Let's add the value we have to add to the others
// The line below is a workaround because
// nsDOMCSSDeclaration::GetPropertyCSSValue is not yet implemented (bug
// 62682)
AddValueToMultivalueProperty(values, mValue);
} else {
values.Assign(mValue);

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

@ -1,10 +1,10 @@
Path: 44
URL: https://ssl.icu-project.org/repos/icu/data/trunk/tzdata/icunew/2018d/44
Relative URL: ^/data/trunk/tzdata/icunew/2018d/44
URL: https://ssl.icu-project.org/repos/icu/data/trunk/tzdata/icunew/2018e/44
Relative URL: ^/data/trunk/tzdata/icunew/2018e/44
Repository Root: https://ssl.icu-project.org/repos/icu
Repository UUID: 251d0590-4201-4cf1-90de-194747b24ca1
Node Kind: directory
Last Changed Author: yoshito
Last Changed Rev: 41166
Last Changed Date: 2018-03-28 13:41:38 +0000 (Wed, 28 Mar 2018)
Last Changed Rev: 41324
Last Changed Date: 2018-05-04 22:02:44 +0000 (Fri, 04 May 2018)

Двоичные данные
intl/tzdata/source/be/metaZones.res

Двоичный файл не отображается.

Двоичные данные
intl/tzdata/source/be/zoneinfo64.res

Двоичный файл не отображается.

Двоичные данные
intl/tzdata/source/ee/metaZones.res

Двоичный файл не отображается.

Двоичные данные
intl/tzdata/source/ee/zoneinfo64.res

Двоичный файл не отображается.

Двоичные данные
intl/tzdata/source/le/metaZones.res

Двоичный файл не отображается.

Двоичные данные
intl/tzdata/source/le/zoneinfo64.res

Двоичный файл не отображается.

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

@ -1094,11 +1094,11 @@ metaZones:table(nofallback){
{
"Africa_Western",
"1994-03-20 22:00",
"2017-09-03 01:00",
"2017-10-23 22:00",
}
{
"Africa_Central",
"2017-09-03 01:00",
"2017-10-23 22:00",
"9999-12-31 23:59",
}
}
@ -3132,6 +3132,11 @@ metaZones:table(nofallback){
{
"Pyongyang",
"2015-08-14 15:00",
"2018-05-05 08:30",
}
{
"Korea",
"2018-05-05 08:30",
"9999-12-31 23:59",
}
}

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

@ -3,9 +3,9 @@
// License & terms of use: http://www.unicode.org/copyright.html#License
//---------------------------------------------------------
// Build tool: tz2icu
// Build date: Wed Mar 28 09:18:39 2018
// Build date: Fri May 4 16:06:17 2018
// tz database: ftp://ftp.iana.org/tz/
// tz version: 2018d
// tz version: 2018e
// ICU version: 61.1
//---------------------------------------------------------
// >> !!! >> THIS IS A MACHINE-GENERATED FILE << !!! <<
@ -13,7 +13,7 @@
//---------------------------------------------------------
zoneinfo64:table(nofallback) {
TZVersion { "2018d" }
TZVersion { "2018e" }
Zones:array {
/* ACT */ :int { 354 } //Z#0
/* AET */ :int { 366 } //Z#1
@ -175,9 +175,9 @@ zoneinfo64:table(nofallback) {
} //Z#57
/* Africa/Windhoek */ :table {
transPre32:intvector { -1, 1836796792 }
trans:intvector { -2109288600, -860976000, -845254800, 764200800, 778640400, 796780800, 810090000, 828835200, 841539600, 860284800, 873594000, 891734400, 905043600, 923184000, 936493200, 954633600, 967942800, 986083200, 999392400, 1018137600, 1030842000, 1049587200, 1062896400, 1081036800, 1094346000, 1112486400, 1125795600, 1143936000, 1157245200, 1175385600, 1188694800, 1207440000, 1220749200, 1238889600, 1252198800, 1270339200, 1283648400, 1301788800, 1315098000, 1333238400, 1346547600, 1365292800, 1377997200, 1396742400, 1410051600, 1428192000, 1441501200, 1459641600, 1472950800, 1491091200, 1504400400 }
trans:intvector { -2109288600, -860976000, -845254800, 764200800, 778640400, 796780800, 810090000, 828835200, 841539600, 860284800, 873594000, 891734400, 905043600, 923184000, 936493200, 954633600, 967942800, 986083200, 999392400, 1018137600, 1030842000, 1049587200, 1062896400, 1081036800, 1094346000, 1112486400, 1125795600, 1143936000, 1157245200, 1175385600, 1188694800, 1207440000, 1220749200, 1238889600, 1252198800, 1270339200, 1283648400, 1301788800, 1315098000, 1333238400, 1346547600, 1365292800, 1377997200, 1396742400, 1410051600, 1428192000, 1441501200, 1459641600, 1472950800, 1491091200, 1504400400, 1508796000 }
typeOffsets:intvector { 4104, 0, 3600, 0, 3600, 3600, 5400, 0, 7200, 0, 7200, 3600 }
typeMap:bin { "03040504010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020104" }
typeMap:bin { "0304050401020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010204" }
} //Z#58
/* America/Adak */ :table {
transPre32:intvector { -1, 1069743569, -1, 2106022494 }
@ -1557,9 +1557,9 @@ zoneinfo64:table(nofallback) {
typeMap:bin { "02040203020301" }
} //Z#303
/* Asia/Pyongyang */ :table {
trans:intvector { -1948782180, -1830414600, 1439564400 }
trans:intvector { -1948782180, -1830414600, 1439564400, 1525447800 }
typeOffsets:intvector { 30180, 0, 30600, 0, 32400, 0 }
typeMap:bin { "010201" }
typeMap:bin { "01020102" }
} //Z#304
/* Asia/Qatar */ :table {
trans:intvector { -1577935568, 76190400 }
@ -2291,9 +2291,9 @@ zoneinfo64:table(nofallback) {
/* Europe/Podgorica */ :int { 443 } //Z#475
/* Europe/Prague */ :table {
transPre32:intvector { -1, 1825565432 }
trans:intvector { -1693706400, -1680483600, -1663455600, -1650150000, -1632006000, -1618700400, -938905200, -857257200, -844556400, -828226800, -812502000, -798073200, -780534000, -761180400, -746578800, -733359600, -716425200, -701910000, -684975600, -670460400, -654217200, -639010800, 291776400, 307501200, 323830800, 338950800, 354675600, 370400400, 386125200, 401850000, 417574800, 433299600, 449024400, 465354000, 481078800, 496803600, 512528400, 528253200, 543978000, 559702800, 575427600, 591152400, 606877200, 622602000, 638326800, 654656400, 670381200, 686106000, 701830800, 717555600, 733280400, 749005200, 764730000, 780454800, 796179600, 811904400, 828234000, 846378000 }
typeOffsets:intvector { 3464, 0, 3600, 0, 3600, 3600 }
typeMap:bin { "0102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" }
trans:intvector { -1693706400, -1680483600, -1663455600, -1650150000, -1632006000, -1618700400, -938905200, -857257200, -844556400, -828226800, -812502000, -796777200, -781052400, -765327600, -746578800, -733359600, -728517600, -721260000, -716425200, -701910000, -684975600, -670460400, -654217200, -639010800, 291776400, 307501200, 323830800, 338950800, 354675600, 370400400, 386125200, 401850000, 417574800, 433299600, 449024400, 465354000, 481078800, 496803600, 512528400, 528253200, 543978000, 559702800, 575427600, 591152400, 606877200, 622602000, 638326800, 654656400, 670381200, 686106000, 701830800, 717555600, 733280400, 749005200, 764730000, 780454800, 796179600, 811904400, 828234000, 846378000 }
typeOffsets:intvector { 3464, 0, 0, 0, 3600, 0, 3600, 3600 }
typeMap:bin { "02030203020302030203020302030203020102030203020302030203020302030203020302030203020302030203020302030203020302030203020302" }
finalRule { "EU" }
finalRaw:int { 3600 }
finalYear:int { 1997 }
@ -3111,63 +3111,66 @@ zoneinfo64:table(nofallback) {
EUAsia:intvector {
2, -31, -1, 3600, 2, 9, -31, -1, 3600, 2, 3600
} //_#11
Eire:intvector {
9, -31, -1, 3600, 2, 2, -31, -1, 3600, 2, -3600
} //_#12
Fiji:intvector {
10, 1, -1, 7200, 0, 0, 14, -1, 10800, 0, 3600
} //_#12
} //_#13
Haiti:intvector {
2, 8, -1, 7200, 0, 10, 1, -1, 7200, 0, 3600
} //_#13
} //_#14
Iran:intvector {
2, 21, 0, 0, 0, 8, 21, 0, 0, 0, 3600
} //_#14
} //_#15
Jordan:intvector {
2, -31, -5, 86400, 0, 9, -31, -6, 0, 1, 3600
} //_#15
} //_#16
LH:intvector {
9, 1, -1, 7200, 0, 3, 1, -1, 7200, 0, 1800
} //_#16
} //_#17
Lebanon:intvector {
2, -31, -1, 0, 0, 9, -31, -1, 0, 0, 3600
} //_#17
} //_#18
Mexico:intvector {
3, 1, -1, 7200, 0, 9, -31, -1, 7200, 0, 3600
} //_#18
} //_#19
Moldova:intvector {
2, -31, -1, 7200, 0, 9, -31, -1, 10800, 0, 3600
} //_#19
} //_#20
Morocco:intvector {
2, -31, -1, 7200, 0, 9, -31, -1, 10800, 0, 3600
} //_#20
} //_#21
NZ:intvector {
8, -30, -1, 7200, 1, 3, 1, -1, 7200, 1, 3600
} //_#21
} //_#22
Palestine:intvector {
2, 22, -7, 3600, 0, 9, -31, -7, 3600, 0, 3600
} //_#22
} //_#23
Para:intvector {
9, 1, -1, 0, 0, 2, 22, -1, 0, 0, 3600
} //_#23
} //_#24
Syria:intvector {
2, -31, -6, 0, 0, 9, -31, -6, 0, 0, 3600
} //_#24
} //_#25
SystemV:intvector {
3, -30, -1, 7200, 0, 9, -31, -1, 7200, 0, 3600
} //_#25
} //_#26
Thule:intvector {
2, 8, -1, 7200, 0, 10, 1, -1, 7200, 0, 3600
} //_#26
} //_#27
Troll:intvector {
2, -31, -1, 3600, 2, 9, -31, -1, 3600, 2, 7200
} //_#27
} //_#28
US:intvector {
2, 8, -1, 7200, 0, 10, 1, -1, 7200, 0, 3600
} //_#28
} //_#29
WS:intvector {
8, -30, -1, 10800, 0, 3, 1, -1, 14400, 0, 3600
} //_#29
} //_#30
Zion:intvector {
2, 23, -6, 7200, 0, 9, -31, -1, 7200, 0, 3600
} //_#30
} //_#31
}
Regions:array {
"AU", //Z#0 ACT

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

@ -517,7 +517,7 @@ DeleteArrayElement(JSContext* cx, HandleObject obj, uint64_t index, ObjectOpResu
{
if (obj->is<ArrayObject>() &&
!obj->as<NativeObject>().isIndexed() &&
!obj->as<NativeObject>().denseElementsAreFrozen())
!obj->as<NativeObject>().denseElementsAreSealed())
{
ArrayObject* aobj = &obj->as<ArrayObject>();
if (index <= UINT32_MAX) {
@ -566,7 +566,7 @@ DeletePropertiesOrThrow(JSContext* cx, HandleObject obj, uint64_t len, uint64_t
{
if (obj->is<ArrayObject>() &&
!obj->as<NativeObject>().isIndexed() &&
!obj->as<NativeObject>().denseElementsAreFrozen())
!obj->as<NativeObject>().denseElementsAreSealed())
{
if (len <= UINT32_MAX) {
// Skip forward to the initialized elements of this array.
@ -1528,7 +1528,7 @@ ArrayReverseDenseKernel(JSContext* cx, HandleNativeObject obj, uint32_t length)
if (obj->getDenseInitializedLength() == 0)
return DenseElementResult::Success;
if (obj->denseElementsAreFrozen())
if (!obj->isExtensible())
return DenseElementResult::Incomplete;
if (!IsPackedArray(obj)) {
@ -2041,7 +2041,7 @@ FillWithUndefined(JSContext* cx, HandleObject obj, uint32_t start, uint32_t coun
break;
NativeObject* nobj = &obj->as<NativeObject>();
if (nobj->denseElementsAreFrozen())
if (!nobj->isExtensible())
break;
if (obj->is<ArrayObject>() &&
@ -2379,6 +2379,7 @@ void
js::ArrayShiftMoveElements(NativeObject* obj)
{
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(obj->isExtensible());
MOZ_ASSERT_IF(obj->is<ArrayObject>(), obj->as<ArrayObject>().lengthIsWritable());
size_t initlen = obj->getDenseInitializedLength();
@ -2401,7 +2402,7 @@ static DenseElementResult
MoveDenseElements(JSContext* cx, NativeObject* obj, uint32_t dstStart, uint32_t srcStart,
uint32_t length)
{
if (obj->denseElementsAreFrozen())
if (!obj->isExtensible())
return DenseElementResult::Incomplete;
if (!obj->maybeCopyElementsForWrite(cx))
@ -2543,7 +2544,7 @@ js::array_unshift(JSContext* cx, unsigned argc, Value* vp)
if (MaybeInIteration(obj, cx))
break;
NativeObject* nobj = &obj->as<NativeObject>();
if (nobj->denseElementsAreFrozen())
if (!nobj->isExtensible())
break;
if (nobj->is<ArrayObject>() && !nobj->as<ArrayObject>().lengthIsWritable())
break;
@ -2651,8 +2652,9 @@ CanOptimizeForDenseStorage(HandleObject arr, uint64_t endIndex, JSContext* cx)
if (!arr->as<ArrayObject>().lengthIsWritable())
return false;
MOZ_ASSERT(!arr->as<ArrayObject>().denseElementsAreFrozen(),
"writable length implies elements are not frozen");
/* Also pick the slow path if the object is non-extensible. */
if (!arr->as<ArrayObject>().isExtensible())
return false;
/* Also pick the slow path if the object is being iterated over. */
if (MaybeInIteration(arr, cx))
@ -2964,7 +2966,7 @@ array_splice_impl(JSContext* cx, unsigned argc, Value* vp, bool returnValueIsUse
len <= UINT32_MAX)
{
HandleArrayObject arr = obj.as<ArrayObject>();
if (arr->lengthIsWritable()) {
if (arr->lengthIsWritable() && arr->isExtensible()) {
DenseElementResult result =
arr->ensureDenseElements(cx, uint32_t(len), itemCount - deleteCount);
if (result == DenseElementResult::Failure)

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

@ -1,5 +1,5 @@
// Generated by make_intl_data.py. DO NOT EDIT.
// tzdata version = 2018d
// tzdata version = 2018e
#ifndef builtin_intl_TimeZoneDataGenerated_h
#define builtin_intl_TimeZoneDataGenerated_h

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

@ -0,0 +1,50 @@
function testTestIntegrityLevel(a, hasElems) {
assertEq(Object.isExtensible(a), true);
assertEq(Object.isSealed(a), false);
assertEq(Object.isFrozen(a), false);
Object.preventExtensions(a);
assertEq(Object.isExtensible(a), false);
assertEq(Object.isSealed(a), !hasElems);
assertEq(Object.isFrozen(a), false);
Object.seal(a);
assertEq(Object.isExtensible(a), false);
assertEq(Object.isSealed(a), true);
assertEq(Object.isFrozen(a), false);
Object.freeze(a);
assertEq(Object.isExtensible(a), false);
assertEq(Object.isSealed(a), true);
assertEq(Object.isFrozen(a), true);
}
testTestIntegrityLevel([1, 2, 3], true);
testTestIntegrityLevel([1, , , 2], true);
testTestIntegrityLevel([1, , , ], true);
testTestIntegrityLevel([, , , ], false);
testTestIntegrityLevel([], false);
testTestIntegrityLevel({0: 0}, true);
var a = [,,,,,,, 1];
a.pop();
testTestIntegrityLevel(a, false);
function testDescriptor() {
var a = [1];
Object.preventExtensions(a);
assertEq(JSON.stringify(Object.getOwnPropertyDescriptors(a)),
`{"0":{"value":1,"writable":true,"enumerable":true,"configurable":true},` +
`"length":{"value":1,"writable":true,"enumerable":false,"configurable":false}}`);
a = [1];
Object.seal(a);
assertEq(JSON.stringify(Object.getOwnPropertyDescriptors(a)),
`{"0":{"value":1,"writable":true,"enumerable":true,"configurable":false},` +
`"length":{"value":1,"writable":true,"enumerable":false,"configurable":false}}`);
a = [1];
Object.freeze(a);
assertEq(JSON.stringify(Object.getOwnPropertyDescriptors(a)),
`{"0":{"value":1,"writable":false,"enumerable":true,"configurable":false},` +
`"length":{"value":1,"writable":false,"enumerable":false,"configurable":false}}`);
}
testDescriptor();

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

@ -0,0 +1,279 @@
load(libdir + "asserts.js");
function testPopSimple() {
var a = [4, 3, 2, 1, 0];
Object.preventExtensions(a);
for (var i = 0; i < 5; i++)
assertEq(a.pop(), i);
assertEq(a.length, 0);
a = [1, 2, 3];
Object.seal(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.pop(), TypeError);
assertEq(a.toString(), "1,2,3");
a = [1, 2, 3];
Object.freeze(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.pop(), TypeError);
assertEq(a.toString(), "1,2,3");
}
testPopSimple();
function testPopHoles() {
var a = [1, , 3];
Object.preventExtensions(a);
assertEq(a.pop(), 3);
assertEq(a.pop(), undefined);
assertEq(a.pop(), 1);
assertEq(a.length, 0);
a = [1, ,];
Object.seal(a);
assertEq(a.pop(), undefined);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.pop(), TypeError);
assertEq(a.toString(), "1");
a = [1, ,];
Object.freeze(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.pop(), TypeError);
assertEq(a.toString(), "1,");
}
testPopHoles();
function testPushSimple() {
var a = [1, 2, 3];
Object.preventExtensions(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.push(4), TypeError);
assertEq(a.length, 3);
assertEq(a.toString(), "1,2,3");
a = [1, 2, 3];
Object.seal(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.push(4), TypeError);
assertEq(a.toString(), "1,2,3");
a = [1, 2, 3];
Object.freeze(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.push(4), TypeError);
assertEq(a.toString(), "1,2,3");
}
testPushSimple();
function testPushHoles() {
var a = [,,,];
Object.preventExtensions(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.push(4), TypeError);
assertEq(a.length, 3);
assertEq(a.toString(), ",,");
a = [,,,];
Object.seal(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.push(4), TypeError);
assertEq(a.toString(), ",,");
a = [,,,];
Object.freeze(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.push(4), TypeError);
assertEq(a.toString(), ",,");
}
testPushHoles();
function testReverseSimple() {
var a = [1, 2, 3];
Object.preventExtensions(a);
a.reverse();
assertEq(a.toString(), "3,2,1");
a = [1, 2, 3];
Object.seal(a);
a.reverse();
assertEq(a.toString(), "3,2,1");
a = [1, 2, 3];
Object.freeze(a);
assertThrowsInstanceOf(() => a.reverse(), TypeError);
assertEq(a.toString(), "1,2,3");
}
testReverseSimple();
function testReverseHoles() {
var a = [1, 2, , 4];
Object.preventExtensions(a);
assertThrowsInstanceOf(() => a.reverse(), TypeError);
assertEq(a.toString(), "4,,,1");
a = [1, 2, , 4];
Object.seal(a);
assertThrowsInstanceOf(() => a.reverse(), TypeError);
assertEq(a.toString(), "4,2,,1");
a = [1, 2, , 4];
Object.freeze(a);
assertThrowsInstanceOf(() => a.reverse(), TypeError);
assertEq(a.toString(), "1,2,,4");
}
testReverseHoles();
function testShiftSimple() {
var a = [1, 2, 3];
Object.preventExtensions(a);
assertEq(a.shift(), 1);
assertEq(a.toString(), "2,3");
for (var i = 0; i < 10; i++)
a.shift();
assertEq(a.length, 0);
a = [1, 2, 3];
Object.seal(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.shift(), TypeError);
assertEq(a.toString(), "3,3,3");
a = [1, 2, 3];
Object.freeze(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.shift(), TypeError);
assertEq(a.toString(), "1,2,3");
}
testShiftSimple();
testShiftSimple();
function testShiftHoles() {
var a = [1, 2, , 4];
Object.preventExtensions(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.shift(), TypeError);
assertEq(a.toString(), ",,,4");
a = [1, 2, , 4];
Object.seal(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.shift(), TypeError);
assertEq(a.toString(), "2,2,,4");
a = [1, 2, , 4];
Object.freeze(a);
for (var i = 0; i < 10; i++)
assertThrowsInstanceOf(() => a.shift(), TypeError);
assertEq(a.toString(), "1,2,,4");
}
testShiftHoles();
testShiftHoles();
function testUnshiftSimple() {
var a = [1, 2, 3];
Object.preventExtensions(a);
assertThrowsInstanceOf(() => a.unshift(0), TypeError);
assertEq(a.toString(), "1,2,3");
a = [1, 2, 3];
Object.seal(a);
assertThrowsInstanceOf(() => a.unshift(0), TypeError);
assertEq(a.toString(), "1,2,3");
a = [1, 2, 3];
Object.freeze(a);
assertThrowsInstanceOf(() => a.unshift(0), TypeError);
assertEq(a.toString(), "1,2,3");
}
testUnshiftSimple();
function testUnshiftHoles() {
var a = [,,,];
Object.preventExtensions(a);
assertThrowsInstanceOf(() => a.unshift(0), TypeError);
assertEq(a.toString(), ",,");
a = [,,,];
Object.seal(a);
assertThrowsInstanceOf(() => a.unshift(0), TypeError);
assertEq(a.toString(), ",,");
a = [,,,];
Object.freeze(a);
assertThrowsInstanceOf(() => a.unshift(0), TypeError);
assertEq(a.toString(), ",,");
}
testUnshiftHoles();
function testSpliceDelete() {
var a = [1, 2, 3];
Object.preventExtensions(a);
a.splice(1, 2);
assertEq(a.toString(), "1");
a = [1, 2, 3];
Object.seal(a);
assertThrowsInstanceOf(() => a.splice(1, 2), TypeError);
assertEq(a.toString(), "1,2,3");
a = [1, 2, 3];
Object.freeze(a);
assertThrowsInstanceOf(() => a.splice(1, 2), TypeError);
assertEq(a.toString(), "1,2,3");
}
testSpliceDelete();
function testSpliceAdd() {
var a = [1, 2, 3];
Object.preventExtensions(a);
assertThrowsInstanceOf(() => a.splice(2, 1, 4, 5), TypeError);
assertEq(a.toString(), "1,2,4");
a = [1, 2, 3];
Object.seal(a);
assertThrowsInstanceOf(() => a.splice(2, 1, 4, 5), TypeError);
assertEq(a.toString(), "1,2,4");
a = [1, 2, 3];
Object.freeze(a);
assertThrowsInstanceOf(() => a.splice(2, 1, 4, 5), TypeError);
assertEq(a.toString(), "1,2,3");
}
testSpliceAdd();
function testSortSimple() {
var a = [3, 1, 2];
Object.preventExtensions(a);
a.sort();
assertEq(a.toString(), "1,2,3");
a = [3, 1, 2];
Object.seal(a);
a.sort();
assertEq(a.toString(), "1,2,3");
a = [3, 1, 2];
Object.freeze(a);
assertThrowsInstanceOf(() => a.sort(), TypeError);
assertEq(a.toString(), "3,1,2");
}
testSortSimple();
function testSortHoles() {
var a = [, , 3, 1, 2];
Object.preventExtensions(a);
assertThrowsInstanceOf(() => a.sort(), TypeError);
assertEq(a.toString(), ",,3,1,2");
a = [, , 3, 1, 2];
Object.seal(a);
assertThrowsInstanceOf(() => a.sort(), TypeError);
assertEq(a.toString(), ",,3,1,2");
a = [, , 3, 1, 2];
Object.freeze(a);
assertThrowsInstanceOf(() => a.sort(), TypeError);
assertEq(a.toString(), ",,3,1,2");
}
testSortHoles();

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

@ -0,0 +1,65 @@
function testAdd() {
var a = [];
Object.preventExtensions(a);
for (var i = 0; i < 20; i++)
a[i] = i;
assertEq(a.length, 0);
a = [];
Object.seal(a);
for (var i = 0; i < 20; i++)
a[i] = i;
assertEq(a.length, 0);
a = [];
Object.freeze(a);
for (var i = 0; i < 20; i++)
a[i] = i;
assertEq(a.length, 0);
}
testAdd();
testAdd();
function testSet() {
var a = [1, 2, 3];
Object.preventExtensions(a);
for (var i = 0; i < 20; i++)
a[2] = i;
assertEq(a.toString(), "1,2,19");
a = [1, 2, 3];
Object.seal(a);
for (var i = 0; i < 20; i++)
a[0] = i;
assertEq(a.toString(), "19,2,3");
a = [1, 2, 3];
Object.freeze(a);
for (var i = 0; i < 20; i++)
a[1] = i;
assertEq(a.toString(), "1,2,3");
}
testSet();
testSet();
function testSetHole() {
var a = [1, , 3];
Object.preventExtensions(a);
for (var i = 0; i < 30; i++)
a[1] = i;
assertEq(a.toString(), "1,,3");
a = [1, , 3];
Object.seal(a);
for (var i = 0; i < 30; i++)
a[1] = i;
assertEq(a.toString(), "1,,3");
a = [1, , 3];
Object.freeze(a);
for (var i = 0; i < 30; i++)
a[1] = i;
assertEq(a.toString(), "1,,3");
}
testSetHole();
testSetHole();

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

@ -0,0 +1,27 @@
// When an already-non-extensible object is frozen, its Shape doesn't change.
// Make sure SetElement ICs handle this correctly.
function doStore(a) {
for (var i = 0; i < 100; i++) {
a[1] = i;
}
}
function test() {
with(this) {} // Don't Ion-compile.
var a = {0: 0, 1: 1};
Object.preventExtensions(a);
doStore(a);
assertEq(a[1], 99);
a[1] = 0;
Object.freeze(a);
doStore(a);
assertEq(a[1], 0);
}
setJitCompilerOption("ion.forceinlineCaches", 1);
test();
setJitCompilerOption("ion.forceinlineCaches", 0);
test();

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

@ -0,0 +1,15 @@
// Make sure a non-extensible proto object that's later frozen is handled
// correctly by AddElement ICs.
function f() {
var proto = {60: "ok"};
Object.preventExtensions(proto);
var o = Object.create(proto);
for (var i = 0; i < 65; i++) {
o[i] = i;
if (i === 50)
Object.freeze(proto);
}
assertEq(o[60], "ok");
assertEq(o[61], 61);
}
f();

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

@ -1468,10 +1468,11 @@ BaselineCacheIRCompiler::emitStoreDenseElementHole()
Address initLength(scratch, ObjectElements::offsetOfInitializedLength());
Address elementsFlags(scratch, ObjectElements::offsetOfFlags());
// Check for copy-on-write or frozen elements.
// Check for copy-on-write elements. Note that this stub is not attached for
// non-extensible objects, so the shape guard ensures there are no sealed or
// frozen elements.
masm.branchTest32(Assembler::NonZero, elementsFlags,
Imm32(ObjectElements::COPY_ON_WRITE |
ObjectElements::FROZEN),
Imm32(ObjectElements::COPY_ON_WRITE),
failure->label());
// We don't have enough registers on x86 so use InvalidReg. This will emit
@ -1615,10 +1616,11 @@ BaselineCacheIRCompiler::emitArrayPush()
Address elementsLength(scratch, ObjectElements::offsetOfLength());
Address elementsFlags(scratch, ObjectElements::offsetOfFlags());
// Check for copy-on-write or frozen elements.
// Check for copy-on-write elements. Note that this stub is not attached for
// non-extensible objects, so the shape guard ensures there are no sealed or
// frozen elements.
masm.branchTest32(Assembler::NonZero, elementsFlags,
Imm32(ObjectElements::COPY_ON_WRITE |
ObjectElements::FROZEN),
Imm32(ObjectElements::COPY_ON_WRITE),
failure->label());
// Fail if length != initLength.

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

@ -3508,7 +3508,18 @@ CanAttachAddElement(JSObject* obj, bool isInit)
if (!proto->isNative())
return false;
if (proto->as<NativeObject>().denseElementsAreFrozen())
// We have to make sure the proto has no non-writable (frozen) elements
// because we're not allowed to shadow them. There are a few cases to
// consider:
//
// * If the proto is extensible, its Shape will change when it's made
// non-extensible.
//
// * If the proto is already non-extensible, no new elements will be
// added, so if there are no elements now it doesn't matter if the
// object is frozen later on.
NativeObject* nproto = &proto->as<NativeObject>();
if (!nproto->isExtensible() && nproto->getDenseInitializedLength() > 0)
return false;
obj = proto;
@ -3532,7 +3543,7 @@ SetPropIRGenerator::tryAttachSetDenseElementHole(HandleObject obj, ObjOperandId
return false;
NativeObject* nobj = &obj->as<NativeObject>();
if (!nobj->nonProxyIsExtensible())
if (!nobj->isExtensible())
return false;
MOZ_ASSERT(!nobj->getElementsHeader()->isFrozen(),
@ -4390,7 +4401,7 @@ CallIRGenerator::tryAttachArrayPush()
return false;
// Check that array is extensible.
if (!thisarray->nonProxyIsExtensible())
if (!thisarray->isExtensible())
return false;
MOZ_ASSERT(!thisarray->getElementsHeader()->isFrozen(),

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

@ -9161,6 +9161,7 @@ class OutOfLineStoreElementHole : public OutOfLineCodeBase<CodeGenerator>
{
LInstruction* ins_;
Label rejoinStore_;
Label callStub_;
bool strict_;
public:
@ -9180,6 +9181,9 @@ class OutOfLineStoreElementHole : public OutOfLineCodeBase<CodeGenerator>
Label* rejoinStore() {
return &rejoinStore_;
}
Label* callStub() {
return &callStub_;
}
bool strict() const {
return strict_;
}
@ -9285,6 +9289,18 @@ CodeGenerator::emitStoreElementHoleT(T* lir)
if (lir->mir()->needsBarrier())
emitPreBarrier(elements, lir->index(), 0);
if (std::is_same<T, LFallibleStoreElementT>::value) {
// If the object might be non-extensible, check for frozen elements and
// holes.
Address flags(elements, ObjectElements::offsetOfFlags());
masm.branchTest32(Assembler::NonZero, flags, Imm32(ObjectElements::FROZEN),
ool->callStub());
if (lir->toFallibleStoreElementT()->mir()->needsHoleCheck()) {
masm.branchTestMagic(Assembler::Equal, BaseValueIndex(elements, index),
ool->callStub());
}
}
masm.bind(ool->rejoinStore());
emitStoreElementTyped(lir->value(), lir->mir()->value()->type(), lir->mir()->elementType(),
elements, lir->index(), 0);
@ -9316,6 +9332,18 @@ CodeGenerator::emitStoreElementHoleV(T* lir)
Address initLength(elements, ObjectElements::offsetOfInitializedLength());
masm.spectreBoundsCheck32(index, initLength, spectreTemp, ool->entry());
if (std::is_same<T, LFallibleStoreElementV>::value) {
// If the object might be non-extensible, check for frozen elements and
// holes.
Address flags(elements, ObjectElements::offsetOfFlags());
masm.branchTest32(Assembler::NonZero, flags, Imm32(ObjectElements::FROZEN),
ool->callStub());
if (lir->toFallibleStoreElementV()->mir()->needsHoleCheck()) {
masm.branchTestMagic(Assembler::Equal, BaseValueIndex(elements, index),
ool->callStub());
}
}
if (lir->mir()->needsBarrier())
emitPreBarrier(elements, lir->index(), 0);
@ -9331,72 +9359,16 @@ CodeGenerator::visitStoreElementHoleV(LStoreElementHoleV* lir)
emitStoreElementHoleV(lir);
}
typedef bool (*ThrowReadOnlyFn)(JSContext*, HandleObject, int32_t);
static const VMFunction ThrowReadOnlyInfo =
FunctionInfo<ThrowReadOnlyFn>(ThrowReadOnlyError, "ThrowReadOnlyError");
void
CodeGenerator::visitFallibleStoreElementT(LFallibleStoreElementT* lir)
{
Register elements = ToRegister(lir->elements());
// Handle frozen objects
Label isFrozen;
Address flags(elements, ObjectElements::offsetOfFlags());
if (!lir->mir()->strict()) {
masm.branchTest32(Assembler::NonZero, flags, Imm32(ObjectElements::FROZEN), &isFrozen);
} else {
Register object = ToRegister(lir->object());
const LAllocation* index = lir->index();
OutOfLineCode* ool;
if (index->isConstant()) {
ool = oolCallVM(ThrowReadOnlyInfo, lir,
ArgList(object, Imm32(ToInt32(index))), StoreNothing());
} else {
ool = oolCallVM(ThrowReadOnlyInfo, lir,
ArgList(object, ToRegister(index)), StoreNothing());
}
masm.branchTest32(Assembler::NonZero, flags, Imm32(ObjectElements::FROZEN), ool->entry());
// This OOL code should have thrown an exception, so will never return.
// So, do not bind ool->rejoin() anywhere, so that it implicitly (and without the cost
// of a jump) does a masm.assumeUnreachable().
}
emitStoreElementHoleT(lir);
masm.bind(&isFrozen);
}
void
CodeGenerator::visitFallibleStoreElementV(LFallibleStoreElementV* lir)
{
Register elements = ToRegister(lir->elements());
// Handle frozen objects
Label isFrozen;
Address flags(elements, ObjectElements::offsetOfFlags());
if (!lir->mir()->strict()) {
masm.branchTest32(Assembler::NonZero, flags, Imm32(ObjectElements::FROZEN), &isFrozen);
} else {
Register object = ToRegister(lir->object());
const LAllocation* index = lir->index();
OutOfLineCode* ool;
if (index->isConstant()) {
ool = oolCallVM(ThrowReadOnlyInfo, lir,
ArgList(object, Imm32(ToInt32(index))), StoreNothing());
} else {
ool = oolCallVM(ThrowReadOnlyInfo, lir,
ArgList(object, ToRegister(index)), StoreNothing());
}
masm.branchTest32(Assembler::NonZero, flags, Imm32(ObjectElements::FROZEN), ool->entry());
// This OOL code should have thrown an exception, so will never return.
// So, do not bind ool->rejoin() anywhere, so that it implicitly (and without the cost
// of a jump) does a masm.assumeUnreachable().
}
emitStoreElementHoleV(lir);
masm.bind(&isFrozen);
}
typedef bool (*SetDenseElementFn)(JSContext*, HandleNativeObject, int32_t, HandleValue,
@ -9461,18 +9433,17 @@ CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool)
// condition flags sticking from the incoming branch.
// Also note: this branch does not need Spectre mitigations, doing that for
// the capacity check below is sufficient.
Label callStub;
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
// Had to reimplement for MIPS because there are no flags.
Address initLength(elements, ObjectElements::offsetOfInitializedLength());
masm.branch32(Assembler::NotEqual, initLength, indexReg, &callStub);
masm.branch32(Assembler::NotEqual, initLength, indexReg, ool->callStub());
#else
masm.j(Assembler::NotEqual, &callStub);
masm.j(Assembler::NotEqual, ool->callStub());
#endif
// Check array capacity.
masm.spectreBoundsCheck32(indexReg, Address(elements, ObjectElements::offsetOfCapacity()),
spectreTemp, &callStub);
spectreTemp, ool->callStub());
// Update initialized length. The capacity guard above ensures this won't overflow,
// due to MAX_DENSE_ELEMENTS_COUNT.
@ -9508,7 +9479,7 @@ CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool)
masm.jump(ool->rejoinStore());
}
masm.bind(&callStub);
masm.bind(ool->callStub());
saveLive(ins);
pushArg(Imm32(ool->strict()));
@ -9658,13 +9629,13 @@ CodeGenerator::emitArrayPopShift(LInstruction* lir, const MArrayPopShift* mir, R
masm.loadElementTypedOrValue(addr, out, mir->needsHoleCheck(), ool->entry());
}
// Handle the failure case when the array length is non-writable in the
// OOL path. (Unlike in the adding-an-element cases, we can't rely on the
// capacity <= length invariant for such arrays to avoid an explicit
// check.)
// Handle the failure cases when the array length is non-writable or the
// object is sealed in the OOL path. (Unlike in the adding-an-element cases,
// we can't rely on the capacity <= length invariant for such arrays to
// avoid an explicit check.)
Address elementFlags(elementsTemp, ObjectElements::offsetOfFlags());
Imm32 bit(ObjectElements::NONWRITABLE_ARRAY_LENGTH);
masm.branchTest32(Assembler::NonZero, elementFlags, bit, ool->entry());
Imm32 bits(ObjectElements::NONWRITABLE_ARRAY_LENGTH | ObjectElements::SEALED);
masm.branchTest32(Assembler::NonZero, elementFlags, bits, ool->entry());
if (mir->mode() == MArrayPopShift::Shift) {
// Don't save the elementsTemp register.

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

@ -9144,9 +9144,9 @@ IonBuilder::initOrSetElemDense(TemporaryTypeSet::DoubleConversion conversion,
bool hasExtraIndexedProperty;
MOZ_TRY_VAR(hasExtraIndexedProperty, ElementAccessHasExtraIndexedProperty(this, obj));
bool mayBeFrozen = ElementAccessMightBeFrozen(constraints(), obj);
bool mayBeNonExtensible = ElementAccessMightBeNonExtensible(constraints(), obj);
if (mayBeFrozen && hasExtraIndexedProperty) {
if (mayBeNonExtensible && hasExtraIndexedProperty) {
// FallibleStoreElement does not know how to deal with extra indexed
// properties on the prototype. This case should be rare so we fall back
// to an IC.
@ -9199,23 +9199,23 @@ IonBuilder::initOrSetElemDense(TemporaryTypeSet::DoubleConversion conversion,
// Use MStoreElementHole if this SETELEM has written to out-of-bounds
// indexes in the past. Otherwise, use MStoreElement so that we can hoist
// the initialized length and bounds check.
// If an object may have been frozen, no previous expectation hold and we
// fallback to MFallibleStoreElement.
// If an object may have been made non-extensible, no previous expectations
// hold and we fallback to MFallibleStoreElement.
MInstruction* store;
MStoreElementCommon* common = nullptr;
if (writeHole && !hasExtraIndexedProperty && !mayBeFrozen) {
if (writeHole && !hasExtraIndexedProperty && !mayBeNonExtensible) {
MStoreElementHole* ins = MStoreElementHole::New(alloc(), obj, elements, id, newValue);
store = ins;
common = ins;
current->add(ins);
} else if (mayBeFrozen) {
} else if (mayBeNonExtensible) {
MOZ_ASSERT(!hasExtraIndexedProperty,
"FallibleStoreElement codegen assumes no extra indexed properties");
bool strict = IsStrictSetPC(pc);
bool needsHoleCheck = !packed;
MFallibleStoreElement* ins = MFallibleStoreElement::New(alloc(), obj, elements, id,
newValue, strict);
newValue, needsHoleCheck);
store = ins;
common = ins;

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

@ -1865,6 +1865,22 @@ EmitStoreDenseElement(MacroAssembler& masm, const ConstantOrRegister& value,
masm.bind(&done);
}
static void
EmitAssertNoCopyOnWriteElements(MacroAssembler& masm, Register elementsReg)
{
#ifdef DEBUG
// IonBuilder::initOrSetElemTryCache ensures we have no copy-on-write
// elements. Assert this in debug builds.
Address elementsFlags(elementsReg, ObjectElements::offsetOfFlags());
Label ok;
masm.branchTest32(Assembler::Zero, elementsFlags,
Imm32(ObjectElements::COPY_ON_WRITE),
&ok);
masm.assumeUnreachable("Unexpected copy-on-write elements in Ion IC!");
masm.bind(&ok);
#endif
}
bool
IonCacheIRCompiler::emitStoreDenseElement()
{
@ -1881,9 +1897,11 @@ IonCacheIRCompiler::emitStoreDenseElement()
EmitCheckPropertyTypes(masm, typeCheckInfo_, obj, val, *liveRegs_, failure->label());
// Load obj->elements in scratch.
// Load obj->elements in scratch1.
masm.loadPtr(Address(obj, NativeObject::offsetOfElements()), scratch1);
EmitAssertNoCopyOnWriteElements(masm, scratch1);
// Bounds check.
Address initLength(scratch1, ObjectElements::offsetOfInitializedLength());
masm.spectreBoundsCheck32(index, initLength, scratch2, failure->label());
@ -1892,6 +1910,12 @@ IonCacheIRCompiler::emitStoreDenseElement()
BaseObjectElementIndex element(scratch1, index);
masm.branchTestMagic(Assembler::Equal, element, failure->label());
// Check for frozen elements. We have to check this here because we attach
// this stub also for non-extensible objects, and these can become frozen
// without triggering a Shape change.
Address flags(scratch1, ObjectElements::offsetOfFlags());
masm.branchTest32(Assembler::NonZero, flags, Imm32(ObjectElements::FROZEN), failure->label());
EmitPreBarrier(masm, element, MIRType::Value);
EmitStoreDenseElement(masm, val, scratch1, element);
if (needsPostBarrier())
@ -1923,6 +1947,8 @@ IonCacheIRCompiler::emitStoreDenseElementHole()
// Load obj->elements in scratch1.
masm.loadPtr(Address(obj, NativeObject::offsetOfElements()), scratch1);
EmitAssertNoCopyOnWriteElements(masm, scratch1);
Address initLength(scratch1, ObjectElements::offsetOfInitializedLength());
BaseObjectElementIndex element(scratch1, index);

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

@ -691,6 +691,14 @@ IonBuilder::inlineArrayPopShift(CallInfo& callInfo, MArrayPopShift::Mode mode)
OBJECT_FLAG_LENGTH_OVERFLOW |
OBJECT_FLAG_ITERATED;
// Don't optimize shift if the array may be non-extensible (this matters
// when there are holes). We check this here because there's no
// non-extensible ObjectElements flag so we would need an extra guard on the
// BaseShape flags. For pop this doesn't matter, guarding on the SEALED
// ObjectElements flag in JIT code is sufficient.
if (mode == MArrayPopShift::Shift)
unhandledFlags |= OBJECT_FLAG_NON_EXTENSIBLE_ELEMENTS;
MDefinition* obj = convertUnboxedObjects(callInfo.thisArg());
TemporaryTypeSet* thisTypes = obj->resultTypeSet();
if (!thisTypes)

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

@ -6231,10 +6231,10 @@ jit::ElementAccessMightBeCopyOnWrite(CompilerConstraintList* constraints, MDefin
}
bool
jit::ElementAccessMightBeFrozen(CompilerConstraintList* constraints, MDefinition* obj)
jit::ElementAccessMightBeNonExtensible(CompilerConstraintList* constraints, MDefinition* obj)
{
TemporaryTypeSet* types = obj->resultTypeSet();
return !types || types->hasObjectFlags(constraints, OBJECT_FLAG_FROZEN_ELEMENTS);
return !types || types->hasObjectFlags(constraints, OBJECT_FLAG_NON_EXTENSIBLE_ELEMENTS);
}
AbortReasonOr<bool>

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

@ -10130,20 +10130,21 @@ class MStoreElementHole
ALLOW_CLONE(MStoreElementHole)
};
// Try to store a value to a dense array slots vector. May fail due to the object being frozen.
// Cannot be used on an object that has extra indexed properties.
// Try to store a value to a dense array slots vector. May fail due to the
// object being non-extensible/sealed/frozen. Cannot be used on an object that
// has extra indexed properties.
class MFallibleStoreElement
: public MQuaternaryInstruction,
public MStoreElementCommon,
public MixPolicy<SingleObjectPolicy, NoFloatPolicy<3> >::Data
{
bool strict_;
bool needsHoleCheck_;
MFallibleStoreElement(MDefinition* object, MDefinition* elements,
MDefinition* index, MDefinition* value,
bool strict)
bool needsHoleCheck)
: MQuaternaryInstruction(classOpcode, object, elements, index, value),
strict_(strict)
needsHoleCheck_(needsHoleCheck)
{
MOZ_ASSERT(elements->type() == MIRType::Elements);
MOZ_ASSERT(index->type() == MIRType::Int32);
@ -10157,8 +10158,8 @@ class MFallibleStoreElement
AliasSet getAliasSet() const override {
return AliasSet::Store(AliasSet::ObjectFields | AliasSet::Element);
}
bool strict() const {
return strict_;
bool needsHoleCheck() const {
return needsHoleCheck_;
}
ALLOW_CLONE(MFallibleStoreElement)
@ -15235,7 +15236,7 @@ bool ElementAccessIsTypedArray(CompilerConstraintList* constraints,
Scalar::Type* arrayType);
bool ElementAccessIsPacked(CompilerConstraintList* constraints, MDefinition* obj);
bool ElementAccessMightBeCopyOnWrite(CompilerConstraintList* constraints, MDefinition* obj);
bool ElementAccessMightBeFrozen(CompilerConstraintList* constraints, MDefinition* obj);
bool ElementAccessMightBeNonExtensible(CompilerConstraintList* constraints, MDefinition* obj);
AbortReasonOr<bool>
ElementAccessHasExtraIndexedProperty(IonBuilder* builder, MDefinition* obj);
MIRType DenseNativeElementType(CompilerConstraintList* constraints, MDefinition* obj);

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

@ -1477,25 +1477,6 @@ ThrowRuntimeLexicalError(JSContext* cx, unsigned errorNumber)
return false;
}
bool
ThrowReadOnlyError(JSContext* cx, HandleObject obj, int32_t index)
{
// We have to throw different errors depending on whether |index| is past
// the array length, etc. It's simpler to just call SetProperty to ensure
// we match the interpreter.
RootedValue objVal(cx, ObjectValue(*obj));
RootedValue indexVal(cx, Int32Value(index));
RootedId id(cx);
if (!ValueToId<CanGC>(cx, indexVal, &id))
return false;
ObjectOpResult result;
MOZ_ALWAYS_FALSE(SetProperty(cx, obj, id, UndefinedHandleValue, objVal, result) &&
result.checkStrictErrorOrWarning(cx, obj, id, /* strict = */ true));
return false;
}
bool
ThrowBadDerivedReturn(JSContext* cx, HandleValue v)
{

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

@ -885,9 +885,6 @@ bool ObjectIsConstructor(JSObject* obj);
MOZ_MUST_USE bool
ThrowRuntimeLexicalError(JSContext* cx, unsigned errorNumber);
MOZ_MUST_USE bool
ThrowReadOnlyError(JSContext* cx, HandleObject obj, int32_t index);
MOZ_MUST_USE bool
BaselineThrowUninitializedThis(JSContext* cx, BaselineFrame* frame);

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

@ -1,7 +1,7 @@
// |reftest| skip-if(!this.hasOwnProperty("Intl"))
// Generated by make_intl_data.py. DO NOT EDIT.
// tzdata version = 2018d
// tzdata version = 2018e
const tzMapper = [
x => x,

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

@ -1,7 +1,7 @@
// |reftest| skip-if(!this.hasOwnProperty("Intl"))
// Generated by make_intl_data.py. DO NOT EDIT.
// tzdata version = 2018d
// tzdata version = 2018e
const tzMapper = [
x => x,

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

@ -1,7 +1,7 @@
// |reftest| skip-if(!this.hasOwnProperty("Intl"))
// Generated by make_intl_data.py. DO NOT EDIT.
// tzdata version = 2018d
// tzdata version = 2018e
const tzMapper = [
x => x,

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

@ -1,7 +1,7 @@
// |reftest| skip-if(!this.hasOwnProperty("Intl"))
// Generated by make_intl_data.py. DO NOT EDIT.
// tzdata version = 2018d
// tzdata version = 2018e
const tzMapper = [
x => x,

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

@ -32,23 +32,8 @@ class ArrayObject : public NativeObject
}
void setNonWritableLength(JSContext* cx) {
if (getElementsHeader()->numShiftedElements() > 0)
moveShiftedElements();
// When an array's length becomes non-writable, writes to indexes
// greater than or equal to the length don't change the array. We
// handle this with a check for non-writable length in most places.
// But in JIT code every check counts -- so we piggyback the check on
// the already-required range check for |index < capacity| by making
// capacity of arrays with non-writable length never exceed the length.
ObjectElements* header = getElementsHeader();
uint32_t len = header->initializedLength;
if (header->capacity > len) {
shrinkElements(cx, len);
header = getElementsHeader();
header->capacity = len;
}
header->setNonwritableArrayLength();
shrinkCapacityToInitializedLength(cx);
getElementsHeader()->setNonwritableArrayLength();
}
inline void setLength(JSContext* cx, uint32_t length);
@ -56,6 +41,7 @@ class ArrayObject : public NativeObject
// Variant of setLength for use on arrays where the length cannot overflow int32_t.
void setLengthInt32(uint32_t length) {
MOZ_ASSERT(lengthIsWritable());
MOZ_ASSERT_IF(length != getElementsHeader()->length, !denseElementsAreFrozen());
MOZ_ASSERT(length <= INT32_MAX);
getElementsHeader()->length = length;
}

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

@ -1046,7 +1046,7 @@ LexicalEnvironmentObject::recreate(JSContext* cx, Handle<LexicalEnvironmentObjec
bool
LexicalEnvironmentObject::isExtensible() const
{
return nonProxyIsExtensible();
return NativeObject::isExtensible();
}
Value
@ -3382,7 +3382,7 @@ js::CheckCanDeclareGlobalBinding(JSContext* cx, Handle<GlobalObject*> global,
if (!desc.object()) {
// 8.1.14.15 step 6.
// 8.1.14.16 step 5.
if (global->nonProxyIsExtensible())
if (global->isExtensible())
return true;
ReportCannotDeclareGlobalBinding(cx, name, "global is non-extensible");

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

@ -474,7 +474,7 @@ js::SetIntegrityLevel(JSContext* cx, HandleObject obj, IntegrityLevel level)
assertSameCompartment(cx, obj);
// Steps 3-5. (Steps 1-2 are redundant assertions.)
if (!PreventExtensions(cx, obj, level))
if (!PreventExtensions(cx, obj))
return false;
// Steps 6-9, loosely interpreted.
@ -522,8 +522,7 @@ js::SetIntegrityLevel(JSContext* cx, HandleObject obj, IntegrityLevel level)
// Ordinarily ArraySetLength handles this, but we're going behind its back
// right now, so we must do this manually.
if (level == IntegrityLevel::Frozen && obj->is<ArrayObject>()) {
if (!obj->as<ArrayObject>().maybeCopyElementsForWrite(cx))
return false;
MOZ_ASSERT(!nobj->denseElementsAreCopyOnWrite());
obj->as<ArrayObject>().setNonWritableLength(cx);
}
} else {
@ -569,11 +568,9 @@ js::SetIntegrityLevel(JSContext* cx, HandleObject obj, IntegrityLevel level)
}
}
// Finally, freeze the dense elements.
if (level == IntegrityLevel::Frozen && obj->isNative()) {
if (!ObjectElements::FreezeElements(cx, obj.as<NativeObject>()))
return false;
}
// Finally, freeze or seal the dense elements.
if (obj->isNative())
ObjectElements::FreezeOrSeal(cx, &obj->as<NativeObject>(), level);
return true;
}
@ -632,10 +629,26 @@ js::TestIntegrityLevel(JSContext* cx, HandleObject obj, IntegrityLevel level, bo
return true;
}
// Unless the frozen flag is set, dense elements are configurable.
if (nobj->getDenseInitializedLength() > 0 && !nobj->denseElementsAreFrozen()) {
*result = false;
return true;
bool hasDenseElements = false;
for (size_t i = 0; i < nobj->getDenseInitializedLength(); i++) {
if (nobj->containsDenseElement(i)) {
hasDenseElements = true;
break;
}
}
if (hasDenseElements) {
// Unless the sealed flag is set, dense elements are configurable.
if (!nobj->denseElementsAreSealed()) {
*result = false;
return true;
}
// Unless the frozen flag is set, dense elements are writable.
if (level == IntegrityLevel::Frozen && !nobj->denseElementsAreFrozen()) {
*result = false;
return true;
}
}
// Steps 7-9.
@ -2743,7 +2756,7 @@ js::SetPrototype(JSContext* cx, HandleObject obj, HandleObject proto)
}
bool
js::PreventExtensions(JSContext* cx, HandleObject obj, ObjectOpResult& result, IntegrityLevel level)
js::PreventExtensions(JSContext* cx, HandleObject obj, ObjectOpResult& result)
{
if (obj->is<ProxyObject>())
return js::Proxy::preventExtensions(cx, obj, result);
@ -2754,16 +2767,14 @@ js::PreventExtensions(JSContext* cx, HandleObject obj, ObjectOpResult& result, I
if (!MaybeConvertUnboxedObjectToNative(cx, obj))
return false;
// Force lazy properties to be resolved.
if (obj->isNative() && !ResolveLazyProperties(cx, obj.as<NativeObject>()))
return false;
if (obj->isNative()) {
// Force lazy properties to be resolved.
if (!ResolveLazyProperties(cx, obj.as<NativeObject>()))
return false;
// Sparsify dense elements, to make sure no element can be added without a
// call to isExtensible, at the cost of performance. If the object is being
// frozen, the caller is responsible for freezing the elements (and all
// other properties).
if (obj->isNative() && level != IntegrityLevel::Frozen) {
if (!NativeObject::sparsifyDenseElements(cx, obj.as<NativeObject>()))
// Prepare the elements. We have to do this before we mark the object
// non-extensible; that's fine because these changes are not observable.
if (!ObjectElements::PreventExtensions(cx, &obj->as<NativeObject>()))
return false;
}
@ -2774,10 +2785,10 @@ js::PreventExtensions(JSContext* cx, HandleObject obj, ObjectOpResult& result, I
}
bool
js::PreventExtensions(JSContext* cx, HandleObject obj, IntegrityLevel level)
js::PreventExtensions(JSContext* cx, HandleObject obj)
{
ObjectOpResult result;
return PreventExtensions(cx, obj, result, level) && result.checkStrict(cx, obj);
return PreventExtensions(cx, obj, result) && result.checkStrict(cx, obj);
}
bool

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

@ -43,7 +43,7 @@ enum class IntegrityLevel {
};
// Forward declarations, required for later friend declarations.
bool PreventExtensions(JSContext* cx, JS::HandleObject obj, JS::ObjectOpResult& result, IntegrityLevel level = IntegrityLevel::Sealed);
bool PreventExtensions(JSContext* cx, JS::HandleObject obj, JS::ObjectOpResult& result);
bool SetImmutablePrototype(JSContext* cx, JS::HandleObject obj, bool* succeeded);
} /* namespace js */
@ -98,7 +98,7 @@ class JSObject : public js::gc::Cell
friend class js::NewObjectCache;
friend class js::Nursery;
friend class js::gc::RelocationOverlay;
friend bool js::PreventExtensions(JSContext* cx, JS::HandleObject obj, JS::ObjectOpResult& result, js::IntegrityLevel level);
friend bool js::PreventExtensions(JSContext* cx, JS::HandleObject obj, JS::ObjectOpResult& result);
friend bool js::SetImmutablePrototype(JSContext* cx, JS::HandleObject obj,
bool* succeeded);
@ -686,16 +686,13 @@ IsExtensible(JSContext* cx, HandleObject obj, bool* extensible);
* ES6 [[PreventExtensions]]. Attempt to change the [[Extensible]] bit on |obj|
* to false. Indicate success or failure through the |result| outparam, or
* actual error through the return value.
*
* The `level` argument is SM-specific. `obj` should have an integrity level of
* at least `level`.
*/
extern bool
PreventExtensions(JSContext* cx, HandleObject obj, ObjectOpResult& result, IntegrityLevel level);
PreventExtensions(JSContext* cx, HandleObject obj, ObjectOpResult& result);
/* Convenience function. As above, but throw on failure. */
extern bool
PreventExtensions(JSContext* cx, HandleObject obj, IntegrityLevel level = IntegrityLevel::Sealed);
PreventExtensions(JSContext* cx, HandleObject obj);
/*
* ES6 [[GetOwnProperty]]. Get a description of one of obj's own properties.

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

@ -144,7 +144,7 @@ NativeObject::copyDenseElements(uint32_t dstStart, const Value* src, uint32_t co
{
MOZ_ASSERT(dstStart + count <= getDenseCapacity());
MOZ_ASSERT(!denseElementsAreCopyOnWrite());
MOZ_ASSERT(!denseElementsAreFrozen());
MOZ_ASSERT(isExtensible());
MOZ_ASSERT_IF(count > 0, src != nullptr);
#ifdef DEBUG
for (uint32_t i = 0; i < count; ++i)
@ -181,7 +181,7 @@ NativeObject::initDenseElements(const Value* src, uint32_t count)
MOZ_ASSERT(getDenseInitializedLength() == 0);
MOZ_ASSERT(count <= getDenseCapacity());
MOZ_ASSERT(!denseElementsAreCopyOnWrite());
MOZ_ASSERT(!denseElementsAreFrozen());
MOZ_ASSERT(isExtensible());
setDenseInitializedLength(count);
@ -201,7 +201,7 @@ NativeObject::tryShiftDenseElements(uint32_t count)
if (header->initializedLength == count ||
count > ObjectElements::MaxShiftedElements ||
header->isCopyOnWrite() ||
header->isFrozen() ||
!isExtensible() ||
header->hasNonwritableArrayLength())
{
return false;
@ -237,7 +237,7 @@ NativeObject::moveDenseElements(uint32_t dstStart, uint32_t srcStart, uint32_t c
MOZ_ASSERT(dstStart + count <= getDenseCapacity());
MOZ_ASSERT(srcStart + count <= getDenseInitializedLength());
MOZ_ASSERT(!denseElementsAreCopyOnWrite());
MOZ_ASSERT(!denseElementsAreFrozen());
MOZ_ASSERT(isExtensible());
/*
* Using memmove here would skip write barriers. Also, we need to consider
@ -278,7 +278,7 @@ NativeObject::moveDenseElementsNoPreBarrier(uint32_t dstStart, uint32_t srcStart
MOZ_ASSERT(dstStart + count <= getDenseCapacity());
MOZ_ASSERT(srcStart + count <= getDenseCapacity());
MOZ_ASSERT(!denseElementsAreCopyOnWrite());
MOZ_ASSERT(!denseElementsAreFrozen());
MOZ_ASSERT(isExtensible());
memmove(elements_ + dstStart, elements_ + srcStart, count * sizeof(HeapSlot));
elementsRangeWriteBarrierPost(dstStart, count);
@ -290,7 +290,7 @@ NativeObject::reverseDenseElementsNoPreBarrier(uint32_t length)
MOZ_ASSERT(!shadowZone()->needsIncrementalBarrier());
MOZ_ASSERT(!denseElementsAreCopyOnWrite());
MOZ_ASSERT(!denseElementsAreFrozen());
MOZ_ASSERT(isExtensible());
MOZ_ASSERT(length > 1);
MOZ_ASSERT(length <= getDenseInitializedLength());
@ -314,7 +314,7 @@ inline void
NativeObject::ensureDenseInitializedLengthNoPackedCheck(uint32_t index, uint32_t extra)
{
MOZ_ASSERT(!denseElementsAreCopyOnWrite());
MOZ_ASSERT(!denseElementsAreFrozen());
MOZ_ASSERT(isExtensible());
/*
* Ensure that the array's contents have been initialized up to index, and
@ -350,17 +350,7 @@ NativeObject::extendDenseElements(JSContext* cx,
uint32_t requiredCapacity, uint32_t extra)
{
MOZ_ASSERT(!denseElementsAreCopyOnWrite());
MOZ_ASSERT(!denseElementsAreFrozen());
/*
* Don't grow elements for non-extensible objects. Dense elements can be
* added/written with no extensible checks as long as there is capacity
* for them.
*/
if (!nonProxyIsExtensible()) {
MOZ_ASSERT(getDenseCapacity() == 0);
return DenseElementResult::Incomplete;
}
MOZ_ASSERT(isExtensible());
/*
* Don't grow elements for objects which already have sparse indexes.
@ -435,7 +425,7 @@ NativeObject::setOrExtendDenseElements(JSContext* cx, uint32_t start, const Valu
uint32_t count,
ShouldUpdateTypes updateTypes)
{
if (denseElementsAreFrozen())
if (!isExtensible())
return DenseElementResult::Incomplete;
if (is<ArrayObject>() &&

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

@ -117,7 +117,7 @@ ObjectElements::MakeElementsCopyOnWrite(JSContext* cx, NativeObject* obj)
// Note: this method doesn't update type information to indicate that the
// elements might be copy on write. Handling this is left to the caller.
MOZ_ASSERT(!header->isCopyOnWrite());
MOZ_ASSERT(!header->isFrozen());
MOZ_ASSERT(obj->isExtensible());
header->flags |= COPY_ON_WRITE;
header->ownerObject().init(obj);
@ -125,26 +125,41 @@ ObjectElements::MakeElementsCopyOnWrite(JSContext* cx, NativeObject* obj)
}
/* static */ bool
ObjectElements::FreezeElements(JSContext* cx, HandleNativeObject obj)
ObjectElements::PreventExtensions(JSContext* cx, NativeObject* obj)
{
MOZ_ASSERT_IF(obj->is<ArrayObject>(),
!obj->as<ArrayObject>().lengthIsWritable());
if (!obj->maybeCopyElementsForWrite(cx))
return false;
if (obj->hasEmptyElements() || obj->denseElementsAreFrozen())
return true;
if (!obj->hasEmptyElements()) {
obj->shrinkCapacityToInitializedLength(cx);
MarkObjectGroupFlags(cx, obj, OBJECT_FLAG_NON_EXTENSIBLE_ELEMENTS);
}
if (obj->getElementsHeader()->numShiftedElements() > 0)
obj->moveShiftedElements();
MarkObjectGroupFlags(cx, obj, OBJECT_FLAG_FROZEN_ELEMENTS);
obj->getElementsHeader()->freeze();
// shrinkCapacityToInitializedLength ensures there are no shifted elements.
MOZ_ASSERT(obj->getElementsHeader()->numShiftedElements() == 0);
return true;
}
/* static */ void
ObjectElements::FreezeOrSeal(JSContext* cx, NativeObject* obj, IntegrityLevel level)
{
MOZ_ASSERT_IF(level == IntegrityLevel::Frozen && obj->is<ArrayObject>(),
!obj->as<ArrayObject>().lengthIsWritable());
MOZ_ASSERT(!obj->denseElementsAreCopyOnWrite());
MOZ_ASSERT(!obj->isExtensible());
MOZ_ASSERT(obj->getElementsHeader()->numShiftedElements() == 0);
if (obj->hasEmptyElements() || obj->denseElementsAreFrozen())
return;
if (!obj->denseElementsAreSealed())
obj->getElementsHeader()->seal();
if (level == IntegrityLevel::Frozen)
obj->getElementsHeader()->freeze();
}
#ifdef DEBUG
static mozilla::Atomic<bool, mozilla::Relaxed> gShapeConsistencyChecksEnabled(false);
@ -440,7 +455,7 @@ NativeObject::addDenseElementDontReportOOM(JSContext* cx, NativeObject* obj)
MOZ_ASSERT(obj->getDenseInitializedLength() == obj->getDenseCapacity());
MOZ_ASSERT(!obj->denseElementsAreCopyOnWrite());
MOZ_ASSERT(!obj->denseElementsAreFrozen());
MOZ_ASSERT(obj->isExtensible());
MOZ_ASSERT(!obj->isIndexed());
MOZ_ASSERT(!obj->is<TypedArrayObject>());
MOZ_ASSERT_IF(obj->is<ArrayObject>(), obj->as<ArrayObject>().lengthIsWritable());
@ -527,41 +542,6 @@ NativeObject::sparsifyDenseElement(JSContext* cx, HandleNativeObject obj, uint32
return true;
}
/* static */ bool
NativeObject::sparsifyDenseElements(JSContext* cx, HandleNativeObject obj)
{
if (!obj->maybeCopyElementsForWrite(cx))
return false;
uint32_t initialized = obj->getDenseInitializedLength();
/* Create new properties with the value of non-hole dense elements. */
for (uint32_t i = 0; i < initialized; i++) {
if (obj->getDenseElement(i).isMagic(JS_ELEMENTS_HOLE))
continue;
if (!sparsifyDenseElement(cx, obj, i))
return false;
}
if (initialized)
obj->setDenseInitializedLengthUnchecked(0);
// Reduce storage for dense elements which are now holes. Explicitly mark
// the elements capacity as zero, so that any attempts to add dense
// elements will be caught in ensureDenseElements.
if (obj->getElementsHeader()->numShiftedElements() > 0)
obj->moveShiftedElements();
if (obj->getDenseCapacity()) {
obj->shrinkElements(cx, 0);
obj->getElementsHeader()->capacity = 0;
}
return true;
}
bool
NativeObject::willBeSparseElements(uint32_t requiredCapacity, uint32_t newElementsHint)
{
@ -611,7 +591,7 @@ NativeObject::maybeDensifySparseElements(JSContext* cx, HandleNativeObject obj)
return DenseElementResult::Incomplete;
/* Watch for conditions under which an object's elements cannot be dense. */
if (!obj->nonProxyIsExtensible())
if (!obj->isExtensible())
return DenseElementResult::Incomplete;
/*
@ -767,7 +747,7 @@ NativeObject::tryUnshiftDenseElements(uint32_t count)
// limit.
if (header->initializedLength <= 10 ||
header->isCopyOnWrite() ||
header->isFrozen() ||
!isExtensible() ||
header->hasNonwritableArrayLength() ||
MOZ_UNLIKELY(count > ObjectElements::MaxShiftedElements))
{
@ -922,9 +902,8 @@ NativeObject::goodElementsAllocationAmount(JSContext* cx, uint32_t reqCapacity,
bool
NativeObject::growElements(JSContext* cx, uint32_t reqCapacity)
{
MOZ_ASSERT(nonProxyIsExtensible());
MOZ_ASSERT(isExtensible());
MOZ_ASSERT(canHaveNonEmptyElements());
MOZ_ASSERT(!denseElementsAreFrozen());
if (denseElementsAreCopyOnWrite())
MOZ_CRASH();
@ -1063,7 +1042,7 @@ NativeObject::shrinkElements(JSContext* cx, uint32_t reqCapacity)
NativeObject::CopyElementsForWrite(JSContext* cx, NativeObject* obj)
{
MOZ_ASSERT(obj->denseElementsAreCopyOnWrite());
MOZ_ASSERT(!obj->denseElementsAreFrozen());
MOZ_ASSERT(obj->isExtensible());
// The original owner of a COW elements array should never be modified.
MOZ_ASSERT(obj->getElementsHeader()->ownerObject() != obj);
@ -1730,7 +1709,7 @@ js::NativeDefineProperty(JSContext* cx, HandleNativeObject obj, HandleId id,
// Step 2.
if (!prop) {
if (!obj->nonProxyIsExtensible())
if (!obj->isExtensible())
return result.fail(JSMSG_CANT_DEFINE_PROP_OBJECT_NOT_EXTENSIBLE);
// Fill in missing desc fields with defaults.
@ -2023,7 +2002,7 @@ DefineNonexistentProperty(JSContext* cx, HandleNativeObject obj, HandleId id,
// Step 1 is a redundant assertion, step 3 and later don't apply here.
// Step 2.
if (!obj->nonProxyIsExtensible())
if (!obj->isExtensible())
return result.fail(JSMSG_CANT_DEFINE_PROP_OBJECT_NOT_EXTENSIBLE);
if (JSID_IS_INT(id)) {
@ -2735,7 +2714,7 @@ SetExistingProperty(JSContext* cx, HandleNativeObject obj, HandleId id, HandleVa
// Step 5 for dense elements.
if (prop.isDenseOrTypedArrayElement()) {
// Step 5.a.
if (pobj->getElementsHeader()->isFrozen())
if (pobj->denseElementsAreFrozen())
return result.fail(JSMSG_READ_ONLY);
// Pure optimization for the common case:

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

@ -172,9 +172,9 @@ ArraySetLength(JSContext* cx, Handle<ArrayObject*> obj, HandleId id,
* stored where the shifted Value used to be).
*
* Shifted elements can be moved when we grow the array, when the array is
* frozen (for simplicity, shifted elements are not supported on objects that
* are frozen, have copy-on-write elements, or on arrays with non-writable
* length).
* made non-extensible (for simplicity, shifted elements are not supported on
* objects that are non-extensible, have copy-on-write elements, or on arrays
* with non-writable length).
*/
class ObjectElements
{
@ -201,8 +201,13 @@ class ObjectElements
// is created and never changed.
SHARED_MEMORY = 0x8,
// These elements are set to integrity level "frozen".
FROZEN = 0x10,
// These elements are set to integrity level "sealed". This flag should
// only be set on non-extensible objects.
SEALED = 0x10,
// These elements are set to integrity level "frozen". If this flag is
// set, the SEALED flag must be set as well.
FROZEN = 0x20,
};
// The flags word stores both the flags and the number of shifted elements.
@ -277,7 +282,7 @@ class ObjectElements
void addShiftedElements(uint32_t count) {
MOZ_ASSERT(count < capacity);
MOZ_ASSERT(count < initializedLength);
MOZ_ASSERT(!(flags & (NONWRITABLE_ARRAY_LENGTH | FROZEN | COPY_ON_WRITE)));
MOZ_ASSERT(!(flags & (NONWRITABLE_ARRAY_LENGTH | SEALED | FROZEN | COPY_ON_WRITE)));
uint32_t numShifted = numShiftedElements() + count;
MOZ_ASSERT(numShifted <= MaxShiftedElements);
flags = (numShifted << NumShiftedElementsShift) | (flags & FlagsMask);
@ -286,7 +291,7 @@ class ObjectElements
}
void unshiftShiftedElements(uint32_t count) {
MOZ_ASSERT(count > 0);
MOZ_ASSERT(!(flags & (NONWRITABLE_ARRAY_LENGTH | FROZEN | COPY_ON_WRITE)));
MOZ_ASSERT(!(flags & (NONWRITABLE_ARRAY_LENGTH | SEALED | FROZEN | COPY_ON_WRITE)));
uint32_t numShifted = numShiftedElements();
MOZ_ASSERT(count <= numShifted);
numShifted -= count;
@ -299,6 +304,19 @@ class ObjectElements
MOZ_ASSERT(numShiftedElements() == 0);
}
void seal() {
MOZ_ASSERT(!isSealed());
MOZ_ASSERT(!isFrozen());
MOZ_ASSERT(!isCopyOnWrite());
flags |= SEALED;
}
void freeze() {
MOZ_ASSERT(isSealed());
MOZ_ASSERT(!isFrozen());
MOZ_ASSERT(!isCopyOnWrite());
flags |= FROZEN;
}
public:
constexpr ObjectElements(uint32_t capacity, uint32_t length)
: flags(0), initializedLength(0), capacity(capacity), length(length)
@ -346,27 +364,29 @@ class ObjectElements
static bool ConvertElementsToDoubles(JSContext* cx, uintptr_t elements);
static bool MakeElementsCopyOnWrite(JSContext* cx, NativeObject* obj);
static bool FreezeElements(JSContext* cx, HandleNativeObject obj);
static MOZ_MUST_USE bool PreventExtensions(JSContext* cx, NativeObject* obj);
static void FreezeOrSeal(JSContext* cx, NativeObject* obj, IntegrityLevel level);
bool isSealed() const {
return flags & SEALED;
}
bool isFrozen() const {
return flags & FROZEN;
}
void freeze() {
MOZ_ASSERT(!isFrozen());
MOZ_ASSERT(!isCopyOnWrite());
flags |= FROZEN;
}
uint8_t elementAttributes() const {
if (isFrozen())
return JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY;
if (isSealed())
return JSPROP_ENUMERATE | JSPROP_PERMANENT;
return JSPROP_ENUMERATE;
}
uint32_t numShiftedElements() const {
uint32_t numShifted = flags >> NumShiftedElementsShift;
MOZ_ASSERT_IF(numShifted > 0,
!(flags & (NONWRITABLE_ARRAY_LENGTH | FROZEN | COPY_ON_WRITE)));
!(flags & (NONWRITABLE_ARRAY_LENGTH | SEALED | FROZEN | COPY_ON_WRITE)));
return numShifted;
}
@ -753,7 +773,11 @@ class NativeObject : public ShapedObject
MOZ_ASSERT(flags);
return shape()->hasAllObjectFlags(flags);
}
bool nonProxyIsExtensible() const {
// Native objects are never proxies. Call isExtensible instead.
bool nonProxyIsExtensible() const = delete;
bool isExtensible() const {
return !hasAllFlags(js::BaseShape::NOT_EXTENSIBLE);
}
@ -1148,7 +1172,7 @@ class NativeObject : public ShapedObject
/* Accessors for elements. */
bool ensureElements(JSContext* cx, uint32_t capacity) {
MOZ_ASSERT(!denseElementsAreCopyOnWrite());
MOZ_ASSERT(!denseElementsAreFrozen());
MOZ_ASSERT(isExtensible());
if (capacity > getDenseCapacity())
return growElements(cx, capacity);
return true;
@ -1211,6 +1235,26 @@ class NativeObject : public ShapedObject
}
public:
// When an array's length becomes non-writable, writes to indexes greater
// greater than or equal to the length don't change the array. We handle
// this with a check for non-writable length in most places. But in JIT code
// every check counts -- so we piggyback the check on the already-required
// range check for |index < capacity| by making capacity of arrays with
// non-writable length never exceed the length. This mechanism is also used
// when an object becomes non-extensible.
void shrinkCapacityToInitializedLength(JSContext* cx) {
if (getElementsHeader()->numShiftedElements() > 0)
moveShiftedElements();
ObjectElements* header = getElementsHeader();
uint32_t len = header->initializedLength;
if (header->capacity > len) {
shrinkElements(cx, len);
header = getElementsHeader();
header->capacity = len;
}
}
void setDenseInitializedLength(uint32_t length) {
MOZ_ASSERT(!denseElementsAreFrozen());
setDenseInitializedLengthUnchecked(length);
@ -1227,7 +1271,7 @@ class NativeObject : public ShapedObject
void initDenseElement(uint32_t index, const Value& val) {
MOZ_ASSERT(index < getDenseInitializedLength());
MOZ_ASSERT(!denseElementsAreCopyOnWrite());
MOZ_ASSERT(!denseElementsAreFrozen());
MOZ_ASSERT(isExtensible());
checkStoredValue(val);
elements_[index].init(this, HeapSlot::Element, unshiftedIndex(index), val);
}
@ -1271,7 +1315,10 @@ class NativeObject : public ShapedObject
return getElementsHeader()->isCopyOnWrite();
}
bool denseElementsAreFrozen() {
bool denseElementsAreSealed() const {
return getElementsHeader()->isSealed();
}
bool denseElementsAreFrozen() const {
return getElementsHeader()->isFrozen();
}
@ -1294,9 +1341,6 @@ class NativeObject : public ShapedObject
static bool sparsifyDenseElement(JSContext* cx,
HandleNativeObject obj, uint32_t index);
/* Convert all dense elements to sparse properties. */
static bool sparsifyDenseElements(JSContext* cx, HandleNativeObject obj);
/* Small objects are dense, no matter what. */
static const uint32_t MIN_SPARSE_INDEX = 1000;

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

@ -881,7 +881,7 @@ NativeObject::putDataProperty(JSContext* cx, HandleNativeObject obj, HandleId id
}
if (!shape) {
MOZ_ASSERT(obj->nonProxyIsExtensible(),
MOZ_ASSERT(obj->isExtensible(),
"Can't add new property to non-extensible object");
return addDataPropertyInternal(cx, obj, id, SHAPE_INVALID_SLOT, attrs, table, entry,
keep);
@ -987,7 +987,7 @@ NativeObject::putAccessorProperty(JSContext* cx, HandleNativeObject obj, HandleI
}
if (!shape) {
MOZ_ASSERT(obj->nonProxyIsExtensible(),
MOZ_ASSERT(obj->isExtensible(),
"Can't add new property to non-extensible object");
return addAccessorPropertyInternal(cx, obj, id, getter, setter, attrs, table, entry,
keep);

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

@ -145,8 +145,8 @@ enum : uint32_t {
/* Whether any objects have been iterated over. */
OBJECT_FLAG_ITERATED = 0x00080000,
/* Whether any object this represents may have frozen elements. */
OBJECT_FLAG_FROZEN_ELEMENTS = 0x00100000,
/* Whether any object this represents may have non-extensible elements. */
OBJECT_FLAG_NON_EXTENSIBLE_ELEMENTS = 0x00100000,
/*
* For the function on a run-once script, whether the function has actually

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

@ -66,15 +66,6 @@ ServoFontFaceRuleDecl::GetPropertyValue(const nsAString& aPropName,
return NS_OK;
}
already_AddRefed<dom::CSSValue>
ServoFontFaceRuleDecl::GetPropertyCSSValue(const nsAString& aPropName,
ErrorResult& aRv)
{
// ??? nsDOMCSSDeclaration returns null/NS_OK, but that seems wrong.
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
return nullptr;
}
NS_IMETHODIMP
ServoFontFaceRuleDecl::RemoveProperty(const nsAString& aPropName,
nsAString& aResult)

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

@ -21,10 +21,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER
already_AddRefed<dom::CSSValue>
GetPropertyCSSValue(const nsAString& aProp, ErrorResult& aRv) final;
using nsICSSDeclaration::GetPropertyCSSValue;
nsINode* GetParentObject() final;
void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName) final;

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

@ -1,13 +0,0 @@
<html>
<head></head>
<body></body>
<script type="text/javascript">
window.x = window.getComputedStyle(document.documentElement).getPropertyCSSValue("transition-timing-function");
window.x = window.getComputedStyle(document.documentElement).getPropertyCSSValue("color");
x.z = x.getRGBColorValue().blue;
x.getRGBColor().blue.d = x;
x= null;
SpecialPowers.forceGC();
SpecialPowers.forceCC();
</script>
</html>

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

@ -1,17 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
var styleDeclaration = window.getComputedStyle(document.createElement('div'));
var cursorValue = styleDeclaration.getPropertyCSSValue('cursor');
cursorValue.item(1000);
}
</script>
</head>
<body onload="boom();"></body>
</html>

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

@ -93,10 +93,8 @@ load 806310-1.html
load 809762.html
load 812824.html
load 822766-1.html
load 822842.html
load 827591-1.html
load 829817.html
load 840898.html
load 842134.html
load 861489-1.html
load 862113.html

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

@ -987,16 +987,6 @@ nsComputedDOMStyle::ClearCurrentStyleSources()
mPresShell = nullptr;
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetPropertyCSSValue(const nsAString& aPropertyName,
ErrorResult& aRv)
{
if (nsCOMPtr<nsIDocument> document = do_QueryReferent(mDocumentWeak)) {
document->WarnOnceAbout(nsIDocument::eGetPropertyCSSValue);
}
return GetPropertyCSSValueWithoutWarning(aPropertyName, aRv);
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetPropertyCSSValueWithoutWarning(
const nsAString& aPropertyName,

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

@ -74,11 +74,6 @@ public:
const nsAString& aValue,
nsIPrincipal* aSubjectPrincipal) override;
// Do NOT use this, it is deprecated, see bug 474655.
already_AddRefed<CSSValue>
GetPropertyCSSValue(const nsAString& aProp, mozilla::ErrorResult& aRv) final;
using nsICSSDeclaration::GetPropertyCSSValue;
void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName) final;
enum StyleType {

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

@ -144,14 +144,6 @@ nsDOMCSSDeclaration::Length()
return 0;
}
already_AddRefed<dom::CSSValue>
nsDOMCSSDeclaration::GetPropertyCSSValue(const nsAString& aPropertyName, ErrorResult& aRv)
{
// We don't support CSSValue yet so we'll just return null...
return nullptr;
}
void
nsDOMCSSDeclaration::IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName)
{

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

@ -67,10 +67,6 @@ public:
mozilla::ErrorResult& aRv) override;
NS_IMETHOD GetPropertyValue(const nsAString & propertyName,
nsAString & _retval) override;
virtual already_AddRefed<mozilla::dom::CSSValue>
GetPropertyCSSValue(const nsAString & propertyName,
mozilla::ErrorResult& aRv) override;
using nsICSSDeclaration::GetPropertyCSSValue;
NS_IMETHOD RemoveProperty(const nsAString & propertyName,
nsAString & _retval) override;
void GetPropertyPriority(const nsAString & propertyName,

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

@ -53,9 +53,6 @@ public:
NS_IMETHOD GetPropertyValue(const nsAString& aPropName,
nsAString& aValue) = 0;
virtual already_AddRefed<mozilla::dom::CSSValue>
GetPropertyCSSValue(const nsAString& aPropertyName,
mozilla::ErrorResult& aRv) = 0;
NS_IMETHOD RemoveProperty(const nsAString& aPropertyName,
nsAString& aReturn) = 0;
NS_IMETHOD SetProperty(const nsAString& aPropertyName,

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

@ -1,7 +1,6 @@
[DEFAULT]
prefs =
dom.animations-api.core.enabled=true
layout.css.getPropertyCSSValue.enabled=true
support-files =
animation_utils.js
ccd-quirks.html
@ -136,7 +135,6 @@ support-files = bug732209-css.sjs
[test_bug765590.html]
[test_bug771043.html]
[test_bug795520.html]
[test_bug798567.html]
[test_bug798843_pref.html]
[test_bug829816.html]
support-files = file_bug829816.css

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

@ -284,34 +284,12 @@ function round(num, decimals) {
return Math.round(num * Math.pow(10, decimals)) / Math.pow(10, decimals);
}
function coordValueTest(camelProp, cssProp, decl, coordVal, prettyName) {
function coordValueTest(camelProp, decl, coordVal, prettyName) {
is(decl[camelProp], coordVal + "px", prettyName);
is(decl.getPropertyCSSValue(cssProp).cssValueType,
CSSValue.CSS_PRIMITIVE_VALUE, prettyName + " is primitive value");
is(decl.getPropertyCSSValue(cssProp).primitiveType,
CSSPrimitiveValue.CSS_PX, prettyName + " is px");
is(decl.getPropertyCSSValue(cssProp).cssText, coordVal + "px",
prettyName + " cssText");
/* Since floats are only accurate to like 6 decimal places, round to 3 decimal
places here. */
is(round(decl.getPropertyCSSValue(cssProp)
.getFloatValue(CSSPrimitiveValue.CSS_PX),
3), coordVal, prettyName + " as float value");
}
function percentValueTest(camelProp, cssProp, decl, percentVal, prettyName) {
function percentValueTest(camelProp, decl, percentVal, prettyName) {
is(decl[camelProp], percentVal + "%", prettyName);
is(decl.getPropertyCSSValue(cssProp).cssValueType,
CSSValue.CSS_PRIMITIVE_VALUE, prettyName + " is primitive value");
is(decl.getPropertyCSSValue(cssProp).primitiveType,
CSSPrimitiveValue.CSS_PERCENTAGE, prettyName + " is percent");
is(decl.getPropertyCSSValue(cssProp).cssText, percentVal + "%",
prettyName + " cssText");
/* Since floats are only accurate to like 6 decimal places, round to 3 decimal
places here. */
is(round(decl.getPropertyCSSValue(cssProp)
.getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE),
3), percentVal, prettyName + " as float value");
}
function doATest(propName, idBase, coordVal, percentVal, resolveToUsedVal = false) {
@ -339,7 +317,7 @@ function doATest(propName, idBase, coordVal, percentVal, resolveToUsedVal = fals
}
/* Test $(id)-1 */
coordValueTest(cssCamelPropName, propName,
coordValueTest(cssCamelPropName,
style(idBase + "1"), coordVal,
propName + " of " + idBase + "1");
@ -350,23 +328,23 @@ function doATest(propName, idBase, coordVal, percentVal, resolveToUsedVal = fals
/* Test $(id)-2 */
if (resolveToUsedVal) {
coordValueTest(cssCamelPropName, propName,
coordValueTest(cssCamelPropName,
style(idBase + "2"), coordVal,
propName + " of " + idBase + "2");
} else {
percentValueTest(cssCamelPropName, propName,
percentValueTest(cssCamelPropName,
style(idBase + "2"), percentVal,
propName + " of " + idBase + "2");
}
if (percentVal) {
/* Test $(id)-3 */
coordValueTest(cssCamelPropName, propName,
coordValueTest(cssCamelPropName,
style(idBase + "3"), coordVal,
propName + " of " + idBase + "3");
/* Test $(id)-4 */
percentValueTest(cssCamelPropName, propName,
percentValueTest(cssCamelPropName,
style(idBase + "4"), percentVal,
propName + " of " + idBase + "4");
}

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

@ -24,11 +24,6 @@ function c() {
getPropertyValue("overflow");
}
function cval() {
return document.defaultView.getComputedStyle($('t')).
getPropertyCSSValue("overflow");
}
var vals = ["visible", "hidden", "auto", "scroll"];
var mozVals = ["-moz-scrollbars-vertical", "-moz-scrollbars-horizontal"];
var i, j;
@ -37,7 +32,6 @@ for (i = 0; i < vals.length; ++i) {
$('t').style.overflow = vals[i];
is($('t').style.overflow, vals[i], "Roundtrip");
is(c(), vals[i], "Simple property set");
isnot(cval(), null, "Simple property as CSSValue");
}
$('t').style.overflow = mozVals[0];
@ -45,14 +39,12 @@ is($('t').style.getPropertyValue("overflow-y"), "scroll", "Roundtrip");
is($('t').style.getPropertyValue("overflow-x"), "hidden", "Roundtrip");
is($('t').style.overflow, "hidden scroll", "Shorthand read directly");
is(c(), "hidden scroll", "Shorthand computed");
isnot(cval(), null, "Shorthand as CSSValue");
$('t').style.overflow = mozVals[1];
is($('t').style.getPropertyValue("overflow-x"), "scroll", "Roundtrip");
is($('t').style.getPropertyValue("overflow-y"), "hidden", "Roundtrip");
is($('t').style.overflow, "scroll hidden", "Shorthand read directly");
is(c(), "scroll hidden", "Shorthand computed");
isnot(cval(), null, "Shorthand as CSSValue");
for (i = 0; i < vals.length; ++i) {
for (j = 0; j < vals.length; ++j) {
@ -71,19 +63,15 @@ for (i = 0; i < vals.length; ++i) {
// the other direction is not also "visible".
if (i == j || (vals[i] == "visible" && vals[j] == "auto")) {
is(c(), vals[j], "Shorthand computation");
isnot(cval(), null, "Shorthand computation as CSSValue");
} else if (vals[j] == "visible" && vals[i] == "auto") {
is(c(), vals[i], "Shorthand computation");
isnot(cval(), null, "Shorthand computation as CSSValue");
} else {
let x = vals[i] == "visible" ? "auto" : vals[i];
let y = vals[j] == "visible" ? "auto" : vals[j];
is(c(), x + " " + y, "Shorthand computation");
isnot(cval(), null, "Shorthand computation as CSSValue");
}
}
}
</script>
</pre>
</body>

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

@ -32,101 +32,94 @@ var tests = [
// a longhand property.
{ decoration: "none",
line: null, color: null, style: null,
expectedValue: "none", expectedCSSValue: "none" },
expectedValue: "none" },
{ decoration: "underline",
line: null, color: null, style: null,
expectedValue: "underline", expectedCSSValue: "underline" },
expectedValue: "underline" },
{ decoration: "overline",
line: null, color: null, style: null,
expectedValue: "overline", expectedCSSValue: "overline" },
expectedValue: "overline" },
{ decoration: "line-through",
line: null, color: null, style: null,
expectedValue: "line-through", expectedCSSValue: "line-through" },
expectedValue: "line-through" },
{ decoration: "blink",
line: null, color: null, style: null,
expectedValue: "blink", expectedCSSValue: "blink" },
expectedValue: "blink" },
{ decoration: "underline overline",
line: null, color: null, style: null,
expectedValue: "underline overline",
expectedCSSValue: "underline overline" },
expectedValue: "underline overline" },
{ decoration: "underline line-through",
line: null, color: null, style: null,
expectedValue: "underline line-through",
expectedCSSValue: "underline line-through" },
expectedValue: "underline line-through" },
{ decoration: "blink underline",
line: null, color: null, style: null,
expectedValue: "underline blink",
expectedCSSValue: "underline blink" },
expectedValue: "underline blink" },
{ decoration: "underline blink",
line: null, color: null, style: null,
expectedValue: "underline blink",
expectedCSSValue: "underline blink" },
expectedValue: "underline blink" },
// When only text-decoration-line or text-blink was specified,
// text-decoration should look like a longhand property.
{ decoration: null,
line: "blink", color: null, style: null,
expectedValue: "blink", expectedCSSValue: "blink" },
expectedValue: "blink" },
{ decoration: null,
line: "underline", color: null, style: null,
expectedValue: "underline", expectedCSSValue: "underline" },
expectedValue: "underline" },
{ decoration: null,
line: "overline", color: null, style: null,
expectedValue: "overline", expectedCSSValue: "overline" },
expectedValue: "overline" },
{ decoration: null,
line: "line-through", color: null, style: null,
expectedValue: "line-through", expectedCSSValue: "line-through" },
expectedValue: "line-through" },
{ decoration: null,
line: "blink underline", color: null, style: null,
expectedValue: "underline blink", expectedCSSValue: "underline blink" },
expectedValue: "underline blink" },
// When text-decoration-color isn't its initial value,
// text-decoration should be a shorthand property.
{ decoration: "blink",
line: null, color: "rgb(0, 0, 0)", style: null,
expectedValue: "blink rgb(0, 0, 0)", expectedCSSValue: [ "blink", [0, 0, 0] ] },
expectedValue: "blink rgb(0, 0, 0)" },
{ decoration: "underline",
line: null, color: "black", style: null,
expectedValue: "underline rgb(0, 0, 0)", expectedCSSValue: [ "underline", [0, 0, 0] ] },
expectedValue: "underline rgb(0, 0, 0)" },
{ decoration: "overline",
line: null, color: "#ff0000", style: null,
expectedValue: "overline rgb(255, 0, 0)", expectedCSSValue: [ "overline", [255, 0, 0] ] },
expectedValue: "overline rgb(255, 0, 0)" },
{ decoration: "line-through",
line: null, color: "initial", style: null,
expectedValue: "line-through", expectedCSSValue: "line-through" },
expectedValue: "line-through" },
{ decoration: "blink underline",
line: null, color: "currentColor", style: null,
expectedValue: "underline blink", expectedCSSValue: "underline blink" },
expectedValue: "underline blink" },
{ decoration: "underline line-through",
line: null, color: "currentcolor", style: null,
expectedValue: "underline line-through",
expectedCSSValue: "underline line-through" },
expectedValue: "underline line-through" },
// When text-decoration-style isn't its initial value,
// text-decoration should be a shorthand property.
{ decoration: "blink",
line: null, color: null, style: "-moz-none",
expectedValue: "blink -moz-none", expectedCSSValue: [ "blink", "-moz-none" ] },
expectedValue: "blink -moz-none" },
{ decoration: "underline",
line: null, color: null, style: "dotted",
expectedValue: "underline dotted", expectedCSSValue: [ "underline", "dotted" ] },
expectedValue: "underline dotted" },
{ decoration: "overline",
line: null, color: null, style: "dashed",
expectedValue: "overline dashed", expectedCSSValue: [ "overline", "dashed" ] },
expectedValue: "overline dashed" },
{ decoration: "line-through",
line: null, color: null, style: "double",
expectedValue: "line-through double", expectedCSSValue: [ "line-through", "double" ] },
expectedValue: "line-through double" },
{ decoration: "blink underline",
line: null, color: null, style: "wavy",
expectedValue: "underline blink wavy", expectedCSSValue: [ "underline blink", "wavy" ] },
expectedValue: "underline blink wavy" },
{ decoration: "underline blink overline line-through",
line: null, color: null, style: "solid",
expectedValue: "underline overline line-through blink",
expectedCSSValue: "underline overline line-through blink" },
expectedValue: "underline overline line-through blink" },
{ decoration: "line-through overline underline",
line: null, color: null, style: "initial",
expectedValue: "underline overline line-through",
expectedCSSValue: "underline overline line-through" }
expectedValue: "underline overline line-through" }
];
function makeDeclaration(aTest)
@ -152,31 +145,6 @@ function clearStyleObject()
$('t').style.textDecoration = null;
}
function testCSSValue(testname, test, dec) {
var val = document.defaultView.getComputedStyle($('t')).
getPropertyCSSValue("text-decoration");
isnot(val, null, testname + " (CSS value): " + dec);
if (typeof test.expectedCSSValue == "string") {
is(val.getStringValue(), test.expectedCSSValue, testname + " (CSS value): " + dec);
return;
}
is(val.length, test.expectedCSSValue.length, testname + " (CSS value length): " + dec);
for (var i = 0; i < val.length; i ++) {
var actual = val[i];
var expected = test.expectedCSSValue[i];
if (typeof expected == "string") {
is(actual.getStringValue(), expected, testname + " (CSS value [" + i + "] value): " + dec);
} else if (typeof expected == "object") {
var rgb = actual.getRGBColorValue();
is(rgb.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER), expected[0], testname + " (CSS value [" + i + "] red): " + dec);
is(rgb.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER), expected[1], testname + " (CSS value [" + i + "] green): " + dec);
is(rgb.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER), expected[2], testname + " (CSS value [" + i + "] blue): " + dec);
}
}
}
for (var i = 0; i < tests.length; ++i) {
var test = tests[i];
if (test.decoration) {
@ -194,14 +162,12 @@ for (var i = 0; i < tests.length; ++i) {
var dec = makeDeclaration(test);
is(c(), test.expectedValue, "Test1 (computed value): " + dec);
testCSSValue("Test1", test, dec);
clearStyleObject();
$('t').setAttribute("style", dec);
is(c(), test.expectedValue, "Test2 (computed value): " + dec);
testCSSValue("Test2", test, dec);
$('t').removeAttribute("style");
}

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

@ -1,26 +0,0 @@
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=798567
-->
<head>
<title>Test for Bug 798567</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<div id="some_div" style="opacity: 0.5">bar</div>
<div style="cursor: crosshair" id="div_cursor">foobar</div>
<script type="application/javascript">
var elm = document.getElementById("some_div");
var cs = getComputedStyle(elm);
var cssValue = cs.getPropertyCSSValue("opacity");
is(cssValue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER), 0.5, "wrong opacity of some_div");
elm = document.getElementById("div_cursor");
cs = getComputedStyle(elm);
cssValue = cs.getPropertyCSSValue("cursor");
ok(cssValue[0], "element with set cursor should have a a computed style");
</script>
</body>
</html>

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

@ -2828,12 +2828,6 @@ pref("layout.selection.caret_style", 0);
// pref to report CSS errors to the error console
pref("layout.css.report_errors", true);
#ifdef NIGHTLY_BUILD
pref("layout.css.getPropertyCSSValue.enabled", false);
#else
pref("layout.css.getPropertyCSSValue.enabled", true);
#endif
// Override DPI. A value of -1 means use the maximum of 96 and the system DPI.
// A value of 0 means use the system DPI. A positive value is used as the DPI.
// This sets the physical size of a device pixel and thus controls the

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

@ -1,6 +1,7 @@
job-defaults:
e10s: false
mozharness:
no-read-buildbot-config: true
script:
by-test-platform:
android.*: android_emulator_unittest.py

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

@ -1,6 +1,7 @@
job-defaults:
suite: marionette
mozharness:
no-read-buildbot-config: true
script:
by-test-platform:
android.*: android_emulator_unittest.py

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

@ -8,6 +8,7 @@ geckoview:
target: geckoview_example.apk
mozharness:
script: android_emulator_unittest.py
no-read-buildbot-config: true
config:
by-test-platform:
android-4.2-x86/opt:
@ -34,6 +35,7 @@ geckoview-junit:
default: 1
mozharness:
script: android_emulator_unittest.py
no-read-buildbot-config: true
config:
by-test-platform:
android-4.2-x86/opt:
@ -58,6 +60,7 @@ robocop:
e10s: false
mozharness:
script: android_emulator_unittest.py
no-read-buildbot-config: true
config:
- android/android_common.py
- android/androidarm_4_3.py
@ -118,6 +121,7 @@ test-verify:
- unittests/mac_unittest.py
windows.*:
- unittests/win_taskcluster_unittest.py
no-read-buildbot-config: true
extra-options:
- --verify
@ -161,6 +165,7 @@ test-verify-gpu:
- unittests/mac_unittest.py
windows.*:
- unittests/win_taskcluster_unittest.py
no-read-buildbot-config: true
extra-options:
- --verify
- --gpu-required
@ -200,5 +205,6 @@ test-coverage:
- unittests/mac_unittest.py
windows.*:
- unittests/win_taskcluster_unittest.py
no-read-buildbot-config: true
extra-options:
- --per-test-coverage

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

@ -1,5 +1,6 @@
job-defaults:
mozharness:
no-read-buildbot-config: true
script:
by-test-platform:
android.*: android_emulator_unittest.py

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

@ -12,6 +12,7 @@ job-defaults:
default: hardware
mozharness:
script: raptor_script.py
no-read-buildbot-config: true
config:
by-test-platform:
macosx.*:

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

@ -1,5 +1,6 @@
job-defaults:
mozharness:
no-read-buildbot-config: true
script:
by-test-platform:
android.*: android_emulator_unittest.py

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

@ -12,6 +12,7 @@ job-defaults:
default: hardware
mozharness:
script: talos_script.py
no-read-buildbot-config: true
config:
by-test-platform:
macosx.*:

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

@ -3,6 +3,7 @@ job-defaults:
max-run-time: 5400
mozharness:
script: web_platform_tests.py
no-read-buildbot-config: true
config:
by-test-platform:
windows.*:

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

@ -1,5 +1,6 @@
job-defaults:
mozharness:
no-read-buildbot-config: true
script:
by-test-platform:
android.*: android_emulator_unittest.py

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

@ -181,6 +181,8 @@ def mozharness_test_on_docker(config, job, taskdesc):
'/builds/worker/bin/test-linux.sh',
])
if mozharness.get('no-read-buildbot-config'):
command.append("--no-read-buildbot-config")
command.extend([
{"task-reference": "--installer-url=" + installer_url},
{"task-reference": "--test-packages-url=" + test_packages_url(taskdesc)},
@ -289,6 +291,8 @@ def mozharness_test_on_generic_worker(config, job, taskdesc):
cfg_path = normpath(cfg_path)
mh_command.extend(['--cfg', cfg_path])
mh_command.extend(mozharness.get('extra-options', []))
if mozharness.get('no-read-buildbot-config'):
mh_command.append('--no-read-buildbot-config')
mh_command.extend(['--installer-url', installer_url])
mh_command.extend(['--test-packages-url', test_packages_url(taskdesc)])
if mozharness.get('download-symbols'):
@ -393,6 +397,8 @@ def mozharness_test_on_native_engine(config, job, taskdesc):
)
command = worker['command'] = ["./{}".format(script)]
if mozharness.get('no-read-buildbot-config'):
command.append("--no-read-buildbot-config")
command.extend([
{"task-reference": "--installer-url=" + installer_url},
{"task-reference": "--test-packages-url=" + test_packages_url(taskdesc)},

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

@ -283,6 +283,10 @@ test_description_schema = Schema({
# If true, tooltool downloads will be enabled via relengAPIProxy.
Required('tooltool-downloads'): bool,
# This mozharness script also runs in Buildbot and tries to read a
# buildbot config file, so tell it not to do so in TaskCluster
Required('no-read-buildbot-config'): bool,
# Add --blob-upload-branch=<project> mozharness parameter
Optional('include-blob-upload-branch'): bool,
@ -445,6 +449,7 @@ def set_defaults(config, tests):
test['mozharness'].setdefault('extra-options', [])
test['mozharness'].setdefault('requires-signed-builds', False)
test['mozharness'].setdefault('tooltool-downloads', False)
test['mozharness'].setdefault('no-read-buildbot-config', False)
test['mozharness'].setdefault('set-moz-node-path', False)
test['mozharness'].setdefault('chunked', False)
test['mozharness'].setdefault('chunking-args', 'this-chunk')

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

@ -8,6 +8,7 @@ import os
config = {
"default_actions": [
'clobber',
'read-buildbot-config',
'setup-avds',
'start-emulator',
'download-and-extract',

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

@ -11,6 +11,7 @@ config = {
'multi-l10n',
'update', # decided by query_is_nightly()
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
'max_build_output_timeout': 0,
# decides whether we want to use moz_sign_cmd in env

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

@ -15,6 +15,7 @@ config = {
'check-test',
'update', # decided by query_is_nightly()
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
# decides whether we want to use moz_sign_cmd in env
'secret_files': [

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

@ -14,6 +14,7 @@ config = {
'check-test',
'update', # decided by query_is_nightly()
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
# decides whether we want to use moz_sign_cmd in env
'secret_files': [

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

@ -10,6 +10,7 @@ config = {
'build',
'update', # decided by query_is_nightly()
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
# decides whether we want to use moz_sign_cmd in env
'secret_files': [

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

@ -8,6 +8,7 @@ config = {
# code block and also make sure this is synced with
# releng_base_linux_64_builds.py
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
# decides whether we want to use moz_sign_cmd in env
'secret_files': [

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

@ -13,10 +13,11 @@ config = {
'clobber',
'build',
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
# decides whether we want to use moz_sign_cmd in env
'vcs_share_base': '/builds/hg-shared',
# allows triggering of dependent jobs when --artifact try syntax is detected
# allows triggering of dependent jobs when --artifact try syntax is detected on buildbot
'perfherder_extra_options': ['artifact'],
#########################################################################

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

@ -13,12 +13,13 @@ config = {
'clobber',
'build',
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
# decides whether we want to use moz_sign_cmd in env
'vcs_share_base': '/builds/hg-shared',
# debug specific
'debug_build': True,
# allows triggering of test jobs when --artifact try syntax is detected
# allows triggering of test jobs when --artifact try syntax is detected on buildbot
'perfherder_extra_options': ['artifact'],
#########################################################################

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

@ -6,6 +6,7 @@ config = {
'clobber',
'build',
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
# decides whether we want to use moz_sign_cmd in env
'secret_files': [
@ -17,7 +18,7 @@ config = {
'min_scm_level': 2, 'default': 'try-build-has-no-secrets'},
],
'vcs_share_base': '/builds/hg-shared',
# allows triggering of dependent jobs when --artifact try syntax is detected
# allows triggering of dependent jobs when --artifact try syntax is detected on buildbot
'perfherder_extra_options': ['artifact'],
#########################################################################

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

@ -6,12 +6,13 @@ config = {
'clobber',
'build',
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
'vcs_share_base': '/builds/hg-shared',
# debug specific
'debug_build': True,
# decides whether we want to use moz_sign_cmd in env
# allows triggering of test jobs when --artifact try syntax is detected
# allows triggering of test jobs when --artifact try syntax is detected on buildbot
'perfherder_extra_options': ['artifact'],
#########################################################################

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

@ -20,7 +20,7 @@ config = {
'MOZ_CRASHREPORTER_NO_REPORT': '1',
'LC_ALL': 'C',
## 64 bit specific
'PATH': ':/usr/local/bin:/bin:\
'PATH': '/tools/buildbot/bin:/usr/local/bin:/bin:\
/usr/bin:/usr/local/sbin:/usr/sbin:/sbin',
},
'mozconfig_variant': 'rusttests',

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

@ -17,7 +17,7 @@ config = {
'LC_ALL': 'C',
'XPCOM_DEBUG_BREAK': 'stack-and-abort',
# 64 bit specific
'PATH': '/usr/local/bin:/bin:\
'PATH': '/tools/buildbot/bin:/usr/local/bin:/bin:\
/usr/bin:/usr/local/sbin:/usr/sbin:/sbin',
'LD_LIBRARY_PATH': '%(abs_obj_dir)s/dist/bin',
'TINDERBOX_OUTPUT': '1',

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

@ -6,6 +6,7 @@ config = {
'clobber',
'build',
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
# decides whether we want to use moz_sign_cmd in env
'vcs_share_base': '/builds/hg-shared',

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

@ -2,6 +2,7 @@ config = {
'default_actions': ['package-source'],
'objdir': 'obj-firefox',
'stage_platform': 'source', # Not used, but required by the script
'buildbot_json_path': 'buildprops.json',
'app_ini_path': 'FAKE', # Not used, but required by the script
'env': {
'HG_SHARE_BASE_DIR': '/builds/hg-shared',

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

@ -6,6 +6,7 @@ config = {
'clobber',
'build',
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
# decides whether we want to use moz_sign_cmd in env
'vcs_share_base': '/builds/hg-shared',

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

@ -6,6 +6,7 @@ config = {
'clobber',
'build',
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
# decides whether we want to use moz_sign_cmd in env
'vcs_share_base': '/builds/hg-shared',

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

@ -8,10 +8,11 @@ config = {
'clobber',
'build',
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
# decides whether we want to use moz_sign_cmd in env
'vcs_share_base': '/builds/hg-shared',
# allows triggering of dependent jobs when --artifact try syntax is detected
# allows triggering of dependent jobs when --artifact try syntax is detected on buildbot
'perfherder_extra_options': ['artifact'],
#########################################################################

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

@ -8,12 +8,13 @@ config = {
'clobber',
'build',
],
"buildbot_json_path": "buildprops.json",
'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
# decides whether we want to use moz_sign_cmd in env
'vcs_share_base': '/builds/hg-shared',
# debug specific
'debug_build': True,
# allows triggering of test jobs when --artifact try syntax is detected
# allows triggering of test jobs when --artifact try syntax is detected on buildbot
'perfherder_extra_options': ['artifact'],
#########################################################################

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

@ -15,6 +15,7 @@ config = {
'MOZ_CRASHREPORTER_NO_REPORT': '1',
'MOZ_OBJDIR': '%(abs_obj_dir)s',
'PATH': 'C:/mozilla-build/nsis-3.01;C:/mozilla-build/python27;'
'C:/mozilla-build/buildbotve/scripts;'
'%s' % (os.environ.get('path')),
'PROPERTIES_FILE': os.path.join(os.getcwd(), 'buildprops.json'),
'TINDERBOX_OUTPUT': '1',

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

@ -16,6 +16,7 @@ config = {
'MOZ_CRASHREPORTER_NO_REPORT': '1',
'MOZ_OBJDIR': '%(abs_obj_dir)s',
'PATH': 'C:/mozilla-build/nsis-3.01;C:/mozilla-build/python27;'
'C:/mozilla-build/buildbotve/scripts;'
'%s' % (os.environ.get('path')),
'PROPERTIES_FILE': os.path.join(os.getcwd(), 'buildprops.json'),
'TINDERBOX_OUTPUT': '1',

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

@ -18,6 +18,7 @@ releng.manifest",
'MOZ_CRASHREPORTER_NO_REPORT': '1',
'MOZ_OBJDIR': '%(abs_obj_dir)s',
'PATH': 'C:/mozilla-build/nsis-3.01;C:/mozilla-build/python27;'
'C:/mozilla-build/buildbotve/scripts;'
'%s' % (os.environ.get('path')),
'PROPERTIES_FILE': os.path.join(os.getcwd(), 'buildprops.json'),
'TINDERBOX_OUTPUT': '1',

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

@ -14,6 +14,7 @@ config = {
'MOZ_CRASHREPORTER_NO_REPORT': '1',
'MOZ_OBJDIR': '%(abs_obj_dir)s',
'PATH': 'C:/mozilla-build/nsis-3.01;C:/mozilla-build/python27;'
'C:/mozilla-build/buildbotve/scripts;'
'%s' % (os.environ.get('path')),
'PROPERTIES_FILE': os.path.join(os.getcwd(), 'buildprops.json'),
'TINDERBOX_OUTPUT': '1',

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

@ -15,6 +15,7 @@ config = {
'MOZ_CRASHREPORTER_NO_REPORT': '1',
'MOZ_OBJDIR': '%(abs_obj_dir)s',
'PATH': 'C:/mozilla-build/nsis-3.01;C:/mozilla-build/python27;'
'C:/mozilla-build/buildbotve/scripts;'
'%s' % (os.environ.get('path')),
'PROPERTIES_FILE': os.path.join(os.getcwd(), 'buildprops.json'),
'TINDERBOX_OUTPUT': '1',

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

@ -10,8 +10,11 @@ config = {
"vcs_share_base": HG_SHARE_BASE_DIR,
"buildbot_json_path": "buildprops.json",
"default_actions": [
'clobber',
'read-buildbot-config',
'download-and-extract',
'create-virtualenv',
'install',

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

@ -12,8 +12,11 @@ config = {
'hg': 'c:/mozilla-build/hg/hg',
},
"buildbot_json_path": "buildprops.json",
"default_actions": [
'clobber',
'read-buildbot-config',
'download-and-extract',
'create-virtualenv',
'install',

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