Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit346ea98

Browse files
authored
Update web-platform tests (#3203)
Normative changes:* Implement AbortSignal.abort()* Normalize newlines in <textarea> form value according to the updated HTML spec:https://blog.whatwg.org/newline-normalizations-in-form-submission* Implement <textarea> line wrappingOther changes:* Consistently terminate WPT server process with SIGINT
1 parent364c77d commit346ea98

File tree

9 files changed

+23640
-5937
lines changed

9 files changed

+23640
-5937
lines changed

‎lib/jsdom/living/aborting/AbortSignal-impl.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const{ setupForSimpleEventAccessors}=require("../helpers/create-event-accessor");
44
const{ fireAnEvent}=require("../helpers/events");
55
constEventTargetImpl=require("../events/EventTarget-impl").implementation;
6+
constAbortSignal=require("../generated/AbortSignal");
67

78
classAbortSignalImplextendsEventTargetImpl{
89
constructor(globalObject,args,privateData){
@@ -15,6 +16,12 @@ class AbortSignalImpl extends EventTargetImpl {
1516
this.abortAlgorithms=newSet();
1617
}
1718

19+
staticabort(globalObject){
20+
constabortSignal=AbortSignal.createImpl(globalObject,[]);
21+
abortSignal.aborted=true;
22+
returnabortSignal;
23+
}
24+
1825
_signalAbort(){
1926
if(this.aborted){
2027
return;

‎lib/jsdom/living/aborting/AbortSignal.webidl‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[Exposed=(Window,Worker)]
22
interfaceAbortSignal : EventTarget {
3+
[WebIDL2JSCallWithGlobal,NewObject]static AbortSignalabort();
4+
35
readonly attribute boolean aborted;
46

57
attribute EventHandler onabort;

‎lib/jsdom/living/helpers/form-controls.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,6 @@ exports.isButton = formControl => {
7373
formControl.namespaceURI===HTML_NS;
7474
};
7575

76-
exports.normalizeToCRLF=string=>{
77-
returnstring.replace(/\r([^\n])/g,"\r\n$1")
78-
.replace(/\r$/,"\r\n")
79-
.replace(/([^\r])\n/g,"$1\r\n")
80-
.replace(/^\n/,"\r\n");
81-
};
82-
8376
// https://html.spec.whatwg.org/multipage/dom.html#interactive-content-2
8477
exports.isInteractiveContent=node=>{
8578
if(node.nodeType!==NODE_TYPE.ELEMENT_NODE){

‎lib/jsdom/living/nodes/HTMLTextAreaElement-impl.js‎

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { mixin } = require("../../utils");
99

1010
constDOMException=require("domexception/webidl2js-wrapper");
1111
const{ cloningSteps}=require("../helpers/internal-constants");
12-
const{ isDisabled,normalizeToCRLF,getLabelsForLabelable, formOwner}=require("../helpers/form-controls");
12+
const{ isDisabled, getLabelsForLabelable, formOwner}=require("../helpers/form-controls");
1313
const{ childTextContent}=require("../helpers/text");
1414
const{ fireAnEvent}=require("../helpers/events");
1515

@@ -38,8 +38,11 @@ class HTMLTextAreaElementImpl extends HTMLElementImpl {
3838

3939
// https://html.spec.whatwg.org/multipage/form-elements.html#textarea-wrapping-transformation
4040
_getValue(){
41-
// Hard-wrapping omitted, for now.
42-
returnnormalizeToCRLF(this._rawValue);
41+
constapiValue=this._getAPIValue();
42+
constwrap=this.getAttributeNS(null,"wrap");
43+
returnwrap==="hard" ?
44+
textareaWrappingTransformation(apiValue,this.cols) :
45+
apiValue;
4346
}
4447

4548
_childTextContentChangeSteps(){
@@ -242,3 +245,28 @@ mixin(HTMLTextAreaElementImpl.prototype, DefaultConstraintValidationImpl.prototy
242245
module.exports={
243246
implementation:HTMLTextAreaElementImpl
244247
};
248+
249+
functiontextareaWrappingTransformation(text,cols){
250+
letlineStart=0;
251+
letlineEnd=text.indexOf("\n");
252+
if(lineEnd===-1){
253+
lineEnd=text.length;
254+
}
255+
256+
while(lineStart<text.length){
257+
constlineLength=lineEnd-lineStart;
258+
if(lineLength>cols){
259+
// split the line
260+
lineEnd=lineStart+cols;
261+
text=text.slice(0,lineEnd)+"\n"+text.slice(lineEnd);
262+
}
263+
// move to next line
264+
lineStart=lineEnd+1;// step over the newline
265+
lineEnd=text.indexOf("\n",lineStart);
266+
if(lineEnd===-1){
267+
lineEnd=text.length;
268+
}
269+
}
270+
271+
returntext;
272+
}

‎lib/jsdom/living/xhr/FormData-impl.js‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22
constidlUtils=require("../generated/utils");
33
const{ closest}=require("../helpers/traversal");
4-
const{ isDisabled, isSubmittable, isButton, normalizeToCRLF}=require("../helpers/form-controls");
4+
const{ isDisabled, isSubmittable, isButton}=require("../helpers/form-controls");
55
constBlob=require("../generated/Blob.js");
66
constFile=require("../generated/File.js");
77
constconversions=require("webidl-conversions");
@@ -145,8 +145,6 @@ function constructTheEntryList(form, submitter) {
145145
appendAnEntry(entryList,name,field.files.item(i));
146146
}
147147
}
148-
}/* skip plugins. TODO: _charset_ */elseif(field.localName==="textarea"){
149-
appendAnEntry(entryList,name,field._getValue(),true);
150148
}else{
151149
appendAnEntry(entryList,name,field._getValue());
152150
}
@@ -163,12 +161,9 @@ function constructTheEntryList(form, submitter) {
163161
returnentryList;
164162
}
165163

166-
functionappendAnEntry(entryList,name,value,preventLineBreakNormalization=false){
167-
name=conversions.USVString(normalizeToCRLF(name));
164+
functionappendAnEntry(entryList,name,value){
165+
name=conversions.USVString(name);
168166
if(!File.isImpl(value)){
169-
if(!preventLineBreakNormalization){
170-
value=normalizeToCRLF(value);
171-
}
172167
value=conversions.USVString(value);
173168
}
174169
constentry=createAnEntry(name,value);

‎test/web-platform-tests/run-wpts.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ before({ timeout: 30 * 1000 }, async () => {
4949
});
5050

5151
after(()=>{
52-
serverProcess.kill();
52+
serverProcess.kill("SIGINT");
5353
});
5454

5555
describe("web-platform-tests",()=>{

‎test/web-platform-tests/tests‎

Submoduletests updated3354 files

‎test/web-platform-tests/to-run.yaml‎

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ blob/Blob-constructor.any.html:
77
"Passing a FrozenArray as the blobParts array should work (FrozenArray<MessagePort>).":[fail, Depends on MessagePort]
88
blob/Blob-stream.any.html:[fail, Unknown]
99
blob/Blob-text.any.html:[fail, Depends on TextEncoder]
10+
file/File-constructor.any.html:[needs-node12, Requires globalThis]
1011
file/send-file-form*:[fail, DataTransfer not implemented]
12+
fileReader.any.html:[needs-node12, Requires globalThis]
1113
filelist-section/filelist.html:
1214
"Check if item is a instanceof Function":[fail, function is not instanceof Function]
1315
historical.https.html:
1416
"Service worker test setup":[fail, Needs Service Worker implementation]
1517
idlharness.html:[fail, URL.createObjectURL not implemented]
16-
reading-data-section/FileReader-multiple-reads.html:[timeout, Unknown; spews tons of zeros on the screen when failing]
18+
reading-data-section/FileReader-multiple-reads.any.html:[timeout, Unknown; spews tons of zeros on the screen when failing]
1719
reading-data-section/filereader_events.any.html:[fail, Unknown]
18-
reading-data-section/filereader_result.html:
20+
reading-data-section/filereader_result.any.html:
1921
'result is null during "loadstart" event for readAsText':[fail, Unknown]
2022
'result is null during "loadstart" event for readAsDataURL':[fail, Unknown]
2123
'result is null during "loadstart" event for readAsArrayBuffer':[fail, Unknown]
@@ -84,6 +86,7 @@ elementFromPosition.html: [fail, Unknown]
8486
elementScroll.html:[fail, Unknown]
8587
elementsFromPoint**:[fail, Not implemented]
8688
getBoundingClientRect-empty-inline.html:[fail, document.fonts is not implemented]
89+
getBoundingClientRect-shy.html:[fail, Not implemented]
8790
getClientRects-br-*:[fail, Not implemented]
8891
getClientRects-inline-atomic-child.html:[fail, Not implemented]
8992
idlharness.html:[fail, Depends on Fetch]
@@ -171,8 +174,6 @@ throw-on-dynamic-markup-insertion-counter-reactions.html: [timeout, document.ope
171174

172175
DIR:dom/abort
173176

174-
event.any.html:[fail, AbortSignal.abort() not implemented]
175-
176177
---
177178

178179
DIR:dom/collections
@@ -185,6 +186,7 @@ AddEventListenerOptions-signal.any.html: [fail, Not implemented]
185186
Event-dispatch-click.tentative.html:[fail, Test is wrong, https://github.com/web-platform-tests/wpt/issues/27819]
186187
Event-isTrusted.any.html:[fail, Unknown]
187188
Event-timestamp-high-resolution.html:[fail, Not implemented]
189+
Event-timestamp-high-resolution.https.html:[fail, Not implemented]
188190
EventListener-incumbent-global-1.sub.html:[timeout, Multi-globals]
189191
EventListener-incumbent-global-2.sub.html:[timeout, Multi-globals]
190192
EventListener-invoke-legacy.html:[timeout, Animation stuff not implemented]
@@ -270,6 +272,8 @@ headers-record.any.html: [needs-node12, V8 bug fixed in Node 12 onward]
270272

271273
DIR:hr-time
272274

275+
clamped-time-origin-isolated.https.html:[fail, Needs crossOriginIsolated]
276+
clamped-time-origin.html:[fail, Needs crossOriginIsolated]
273277
cross-origin-isolated-timing-attack.https.html:[fail, Not implemented]
274278
idlharness.any.html:[fail, Depends on fetch]
275279
performance-tojson.html:[fail, PerformanceTiming and PerformanceNavigation are not implemented]
@@ -317,6 +321,7 @@ DIR: html/browsers/browsing-the-web/navigating-across-documents
317321
014.html:[fail, Unknown]
318322
015.html:[fail, Unknown]
319323
abort-document-load.html:[fail, Unknown]
324+
about-srcdoc-navigation-blocked.html:[timeout, Unknown]
320325
anchor-fragment-**.html:[timeout, Unknown]
321326
anchor-jsurl-form-submit.html:[timeout, Unknown]
322327
child-navigates-parent-same-origin.window.html:[fail-slow, Unknown]
@@ -369,6 +374,8 @@ history_properties_only_fully_active.html: [fail, Unknown]
369374
iframe_history_go_0.html:[timeout, Unknown]
370375
joint_session_history/001.html:[timeout, Unknown]
371376
joint_session_history/002.html:[timeout, Unknown]
377+
traverse-during-beforeunload.html:[timeout, Unknown]
378+
traverse-during-unload.html:[timeout, Unknown]
372379
traverse_the_history_1.html:[timeout, Unknown]
373380
traverse_the_history_2.html:[timeout, Unknown]
374381
traverse_the_history_3.html:[timeout, Unknown]
@@ -451,6 +458,7 @@ proxy-getOwnPropertyDescriptor.html:
451458
'Window target, no trap, "name" attribute':[fail, Incorrectly implemented as a data property]
452459
security-window/window-security.https.html:[fail, Exoticness of Window not implemented]
453460
self-et-al.window.html:[fail, Depends on window.open() and window.closed]
461+
window-indexed-properties-delete-no-cache.html:[fail-slow, deleting window indexed properties should fail to remove iframes]
454462
window-indexed-properties-strict.html:[flaky, "
455463
Errors in `process.nextTick` callback:
456464
Uncaught TypeError:this[i].close is not a function
@@ -551,7 +559,6 @@ auxiliary-browsing-contexts/opener.html: [timeout, Unknown]
551559
browsing-context-names/**:[timeout, Not implemented]
552560
browsing-context.html:[fail, Unknown]
553561
clear-window-name.https.html:[fail, Unknown]
554-
document-access/**:[fail, Not implemented]
555562
document-domain-nested-navigate.window.html:[fail, Unknown]
556563
embedded-opener-a-form.html:[timeout, Opener not implemented]
557564
embedded-opener-remove-frame.html:[timeout, Opener not implemented]
@@ -752,6 +759,7 @@ historical-progress-event.window.html: [needs-canvas]
752759
image-base-url.html:[timeout, <base> not implemented]
753760
image-loading-eager.html:[needs-canvas, Unimplemented and pass with canvas]
754761
image-loading-lazy**:[fail-slow, loading attr not implemented]
762+
img-picture-ancestor.html:[fail, Unknown; possibly needs media queries?]
755763
img.complete.html:[timeout, Unknown]
756764
invalid-src.html:[timeout, Resource loader doesn't catch bad URLs at the right point in the process]
757765
invisible-image.html:[fail, images block the window load event not implemented (images not in _queue)]
@@ -767,6 +775,7 @@ picture-loading-lazy.html: [fail, scrollIntoView not implemented, loading attr n
767775
relevant-mutations.html:[timeout, Unknown]
768776
remove-element-and-scroll.html:[timeout, scrollIntoView not implemented]
769777
sizes/**:[timeout, Unimplemented]
778+
source-media-outside-doc.html:[fail, Unknown; possibly needs media queries?]
770779
srcset/**:[timeout, Unimplemented]
771780
update-media.html:[timeout, Unimplemented]
772781
update-src-complete.html:[needs-canvas]
@@ -971,7 +980,6 @@ execution-timing/043.html: [fail, Unknown]
971980
execution-timing/044.html:[fail, Unknown]
972981
execution-timing/045.html:[fail, Unknown]
973982
execution-timing/048.html:[fail, Unknown]
974-
execution-timing/050.html:[fail, Unknown]
975983
execution-timing/052.html:[fail, Unknown]
976984
execution-timing/054.html:[fail, Unknown]
977985
execution-timing/055.html:[fail, Unknown]
@@ -1116,6 +1124,9 @@ parsing/html_content_in_foreign_context.html: [fail, Parser issues with foreign
11161124
parsing/unclosed-svg-script.html:[fail, Unknown]
11171125
serializing-html-fragments/escaping.html:[fail, https://github.com/inikulin/parse5/issues/332]
11181126
serializing-html-fragments/serializing.html:[fail, https://github.com/inikulin/parse5/issues/289]
1127+
xmldecl/xmldecl-1.html:[fail, Unknown; possibly iframes are inheriting encoding from their parent?]
1128+
xmldecl/xmldecl-2.html:[fail, several encodings misdetected?]
1129+
xmldecl/xmldecl-3.html:[fail, Unknown]
11191130

11201131
---
11211132

@@ -1166,7 +1177,6 @@ messageevent-constructor.https.html: [fail, uses MessageChannel]
11661177
DIR:html/webappapis/system-state-and-capabilities/the-navigator-object
11671178

11681179
historical.https.window.html:[fail, Not implemented]
1169-
navigator-pluginarray.html:[fail, https://github.com/jsdom/jsdom/issues/2727#issuecomment-787559889]
11701180
navigator-window-controls-overlay.html:[fail, Not implemented]
11711181
navigator_user_agent.https.html:[fail, Not implemented]
11721182
protocol.https.html:[fail, registerProtocolHandler() is not implemented]
@@ -1200,16 +1210,25 @@ Document-prototype-currentScript.html: [timeout, Test not up to date next with u
12001210
DocumentOrShadowRoot-prototype-elementFromPoint.html:[fail, offsetTop not implemented]
12011211
MouseEvent-prototype-offsetX-offsetY.html:[fail, offsetTop not implemented]
12021212
ShadowRoot-interface.html:[fail, shadowRoot.styleSheet is not yet implemented]
1203-
declarative/**:[fail, Not implemented]
1213+
declarative/declarative-after-attachshadow.tentative.html:[fail, Not implemented]
1214+
declarative/declarative-shadow-dom-attachment.tentative.html:[fail, Not implemented]
1215+
declarative/declarative-shadow-dom-basic.tentative.html:[fail, Not implemented]
1216+
declarative/declarative-shadow-dom-opt-in.tentative.html:[fail, Not implemented]
1217+
declarative/getinnerhtml.tentative.html:[fail, Not implemented]
1218+
declarative/innerhtml-before-closing-tag.tentative.html:[fail, Not implemented]
1219+
declarative/innerhtml-on-ordinary-template.tentative.html:[fail, Not implemented]
1220+
declarative/move-template-before-closing-tag.tentative.html:[fail, Not implemented]
1221+
declarative/script-access.tentative.html:[fail, Not implemented]
1222+
focus/ShadowRoot-delegatesFocus.html:[fail, DelegatesFocus is not implemented]
12041223
focus/focus-pseudo-matches-on-shadow-host.html:[timeout, Seems to depend on autofocus]
12051224
focus/focus-selector-delegatesFocus.html:[fail, Not implemented]
12061225
form-control-form-attribute.html:[fail, Form association doesn't respect the spec]
1226+
imperative-slot-api-slotchange.html:[fail, Imperative slot API is not implemented]
1227+
imperative-slot-api.html:[fail, Imperative slot API is not implemented]
12071228
leaktests/html-collection.html:[fail, Document.all is not implemented]
12081229
leaktests/window-frames.html:[fail, Window.name is not implemeneted]
12091230
offsetParent-across-shadow-boundaries.html:[fail, offsetParent not implemented]
12101231
scroll-to-the-fragment-in-shadow-tree.html:[fail, Requires a layout engine]
1211-
slots-imperative-api-slotchange.tentative.html:[fail, Unknown]
1212-
slots-imperative-slot-api.tentative.html:[fail, Unknown (browsers also fail now)]
12131232
untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-011.html:[fail, ShadowRoot.stylesheets is not implemented]
12141233
untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-004.html:[fail, https://github.com/w3c/selection-api/issues/114]
12151234
untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-006.html:[fail, DocumentOrShadowRoot.elementFromPoint() is not implemented. Needs layout engine]
@@ -1248,20 +1267,25 @@ percent-encoding.window.html: [fail, Depends on fetch]
12481267
toascii.window.html:[fail, Depends on fetch]
12491268
url-constructor.any.html:[fail, Depends on fetch]
12501269
url-origin.any.html:[fail, Depends on fetch]
1251-
url-setters.html:[fail, Depends on fetch]
1270+
url-setters-a-area.window.html:[fail, Depends on fetch]
1271+
url-setters.any.html:[fail, Depends on fetch]
12521272
urlencoded-parser.any.html:[fail, Depends on fetch]
12531273

12541274
---
12551275

12561276
DIR:websockets
12571277

12581278
"**/**?wpt_flags=h2":[fail-slow, HTTP/2 web sockets not implemented]
1259-
Create-Secure-extensions-empty.any.html:[timeout, Buggy test as the test does not take into account the mandatory permessage-deflate extension]
1279+
"*.any.sharedworker.html?wss":[fail-slow, Needs SharedWorker implementation]
1280+
"*.any.worker.html?wss":[fail-slow, Needs Worker implementation]
12601281
Create-blocked-port.any.html:[fail-slow, Not implemented]
12611282
Create-on-worker-shutdown.any.html:[fail, Needs Worker implementation]
1283+
Send-data.worker.html?wss:[fail-slow, Needs Worker implementation]
1284+
basic-auth.any.serviceworker.html?wss:[fail-slow, Unknown]
12621285
cookies/third-party-cookie-accepted.https.html:[fail, 'https://github.com/salesforce/tough-cookie/issues/80']
12631286
interfaces/WebSocket/close/close-connecting.html*:[fail, Potentially buggy test as Chrome fails it too]
12641287
remove-own-iframe-during-onerror.window.html:[timeout, iframe.srcdoc not implemented]
1288+
remove-own-iframe-during-onerror.window.html?wss:[timeout, iframe.srcdoc not implemented]
12651289
stream/tentative/*:[fail, This is not yet standardised and browsers should not be expected to pass these tests.]
12661290
unload-a-document/*:[timeout, Requires window.open]
12671291

@@ -1301,7 +1325,9 @@ data-uri.htm: [fail, Unknown]
13011325
event-error-order.sub.html:[fail, Unknown]
13021326
event-timeout-order.any.html:[fail, Unknown]
13031327
event-upload-progress.any.html:[fail, Unknown]
1304-
formdata.htm:[fail, FormDataEvent is not implemented]
1328+
formdata.html:
1329+
"Newly created FormData contains entries added to\"formData\" IDL attribute of FormDataEvent.": [fail, FormDataEvent not implemented]
1330+
"|new FormData()| in formdata event handler should throw":[fail, FormDataEvent not implemented]
13051331
getallresponseheaders.htm:[fail, Unknown]
13061332
getresponseheader.any.html:[fail, Unknown]
13071333
headers-normalize-response.htm:[timeout, Unknown]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp