Update web-platform-tests to revision be5419e845d39089ba6dc338c1bd0fa279108317

This commit is contained in:
Josh Matthews 2018-01-04 13:44:24 -05:00
parent aa199307c8
commit 2b6f573eb5
3440 changed files with 109438 additions and 41750 deletions

View file

@ -21,6 +21,23 @@ function assert_props(iface, event, defaults) {
}
}
// Class declarations don't go on the global by default, so put it there ourselves:
self.SubclassedEvent = class SubclassedEvent extends Event {
constructor(name, props) {
super(name, props);
if (props && typeof(props) == "object" && "customProp" in props) {
this.customProp = props.customProp;
} else {
this.customProp = 5;
}
}
get fixedProp() {
return 17;
}
}
var EventModifierInit = [
["ctrlKey", false, true],
["shiftKey", false, true],
@ -32,6 +49,7 @@ var expected = {
"properties": [
["bubbles", false, true],
["cancelable", false, true],
["isTrusted", false, false],
],
},
@ -93,6 +111,14 @@ var expected = {
["data", "", "string"],
],
},
"SubclassedEvent": {
"parent": "Event",
"properties": [
["customProp", 5, 8],
["fixedProp", 17, 17],
],
},
};
Object.keys(expected).forEach(function(iface) {

View file

@ -51,22 +51,16 @@ function runLegacyEventTest(type, legacyType, ctor, setup) {
}
function setupTransition(elem) {
elem.style.transition = '';
requestAnimationFrame(function() {
elem.style.color = 'red';
elem.style.transition = 'color 30ms';
requestAnimationFrame(function() {
elem.style.color = 'green';
});
});
getComputedStyle(elem).color;
elem.style.color = 'green';
elem.style.transition = 'color 30ms';
}
function setupAnimation(elem) {
elem.style.animation = 'test 30ms 2';
elem.style.animation = 'test 30ms';
}
runLegacyEventTest('transitionend', 'webkitTransitionEnd', "TransitionEvent", setupTransition);
runLegacyEventTest('animationend', 'webkitAnimationEnd', "AnimationEvent", setupAnimation);
runLegacyEventTest('animationiteration', 'webkitAnimationIteration', "AnimationEvent", setupAnimation);
runLegacyEventTest('animationstart', 'webkitAnimationStart', "AnimationEvent", setupAnimation);
</script>

View file

@ -178,4 +178,14 @@ var EventRemoved = [
"CHANGE"
]
EventRemoved.forEach(isRemovedFromEvent)
var EventPrototypeRemoved = [
"getPreventDefault",
]
EventPrototypeRemoved.forEach(name => {
test(() => {
assert_equals(Event.prototype[name], undefined)
assert_equals((new Event("test"))[name], undefined)
}, "Event.prototype should not have this property: " + name)
})
</script>