Skip to content

Commit edca616

Browse files
terrylucascommit-bot@chromium.org
authored andcommitted
Fixed a number of dart:html P1 issues.
- Fixed HTML API's with callback typedef to correctly convert Dart function to JS function. - Expose HttpStatus from dart:html - Expose DomName ondblclick and dblclickEvent for Angular analyzer. - Fixed removeAll should be Iterable<Object> to match Set's removeAll not Iterable<E>. - Fixed a number of DataTransferItem, Entry, FileEntry and DiretoryEntry returning NativeJavaScriptObject needed type registered in DDC. - Added ability to allow local file access from Chrome browser added -local in ddb. [email protected] Fixes #30278 Fixes #35484 Fixes #34318 Fixes #35510 Change-Id: Ide8c04716c54045e837781d489562f27b694b109 Reviewed-on: https://dart-review.googlesource.com/c/89340 Commit-Queue: Terry Lucas <[email protected]> Reviewed-by: Vijay Menon <[email protected]> Reviewed-by: Nate Bosch <[email protected]>
1 parent ff5e5b6 commit edca616

24 files changed

+581
-267
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@
1313

1414
[35576]: https://github.com/dart-lang/sdk/issues/35576
1515

16+
* Fixed a number of 'dart:html' P1 bugs:
17+
18+
* Fixed HTML API's with callback typedef to correctly convert Dart function to JS function.
19+
* HttpStatus constants exposed in dart:html
20+
* Expose DomName ondblclick and dblclickEvent for Angular analyzer.
21+
* Fixed removeAll on classes Set should be Iterable<Object> to match Set's removeAll not Iterable<E>.
22+
* Fixed a number of DataTransferItem, Entry, FileEntry and DiretoryEntry returning NativeJavaScriptObject needed type registered in DDC.
23+
This fixes handling drag/drop of files/directories.
24+
* Added ability to allow local file access from Chrome browser in ddb.
25+
26+
[30278]: https://github.com/dart-lang/sdk/issues/30278
27+
[34318]: https://github.com/dart-lang/sdk/issues/34318
28+
[35484]: https://github.com/dart-lang/sdk/issues/35484
29+
[35510]: https://github.com/dart-lang/sdk/issues/35510
30+
1631
### Dart VM
1732

1833
### Tool Changes

pkg/dev_compiler/tool/ddb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ void main(List<String> args) {
176176
var tmp = path.join(Directory.systemTemp.path, 'ddc');
177177

178178
result = Process.runSync(chromeBinary,
179-
['--auto-open-devtools-for-tabs', '--user-data-dir=$tmp', htmlFile]);
179+
['--auto-open-devtools-for-tabs',
180+
'--allow-file-access-from-files',
181+
'--user-data-dir=$tmp', htmlFile]);
180182
} else if (node) {
181183
var nodePath = '$sdkJsPath:$libRoot';
182184
var runjs = '''

sdk/lib/_http/http.dart

Lines changed: 1 addition & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import 'dart:collection'
1616
UnmodifiableMapView;
1717
import 'dart:convert';
1818
import 'dart:developer' hide log;
19-
import 'dart:_internal' show Since;
19+
import 'dart:_internal' show Since, HttpStatus;
2020
import 'dart:math';
2121
import 'dart:io';
2222
import 'dart:typed_data';
@@ -31,184 +31,6 @@ part 'overrides.dart';
3131
part 'websocket.dart';
3232
part 'websocket_impl.dart';
3333

34-
/**
35-
* HTTP status codes.
36-
*/
37-
abstract class HttpStatus {
38-
static const int continue_ = 100;
39-
static const int switchingProtocols = 101;
40-
@Since("2.1")
41-
static const int processing = 102;
42-
static const int ok = 200;
43-
static const int created = 201;
44-
static const int accepted = 202;
45-
static const int nonAuthoritativeInformation = 203;
46-
static const int noContent = 204;
47-
static const int resetContent = 205;
48-
static const int partialContent = 206;
49-
@Since("2.1")
50-
static const int multiStatus = 207;
51-
@Since("2.1")
52-
static const int alreadyReported = 208;
53-
@Since("2.1")
54-
static const int imUsed = 226;
55-
static const int multipleChoices = 300;
56-
static const int movedPermanently = 301;
57-
static const int found = 302;
58-
static const int movedTemporarily = 302; // Common alias for found.
59-
static const int seeOther = 303;
60-
static const int notModified = 304;
61-
static const int useProxy = 305;
62-
static const int temporaryRedirect = 307;
63-
@Since("2.1")
64-
static const int permanentRedirect = 308;
65-
static const int badRequest = 400;
66-
static const int unauthorized = 401;
67-
static const int paymentRequired = 402;
68-
static const int forbidden = 403;
69-
static const int notFound = 404;
70-
static const int methodNotAllowed = 405;
71-
static const int notAcceptable = 406;
72-
static const int proxyAuthenticationRequired = 407;
73-
static const int requestTimeout = 408;
74-
static const int conflict = 409;
75-
static const int gone = 410;
76-
static const int lengthRequired = 411;
77-
static const int preconditionFailed = 412;
78-
static const int requestEntityTooLarge = 413;
79-
static const int requestUriTooLong = 414;
80-
static const int unsupportedMediaType = 415;
81-
static const int requestedRangeNotSatisfiable = 416;
82-
static const int expectationFailed = 417;
83-
@Since("2.1")
84-
static const int misdirectedRequest = 421;
85-
@Since("2.1")
86-
static const int unprocessableEntity = 422;
87-
@Since("2.1")
88-
static const int locked = 423;
89-
@Since("2.1")
90-
static const int failedDependency = 424;
91-
static const int upgradeRequired = 426;
92-
@Since("2.1")
93-
static const int preconditionRequired = 428;
94-
@Since("2.1")
95-
static const int tooManyRequests = 429;
96-
@Since("2.1")
97-
static const int requestHeaderFieldsTooLarge = 431;
98-
@Since("2.1")
99-
static const int connectionClosedWithoutResponse = 444;
100-
@Since("2.1")
101-
static const int unavailableForLegalReasons = 451;
102-
@Since("2.1")
103-
static const int clientClosedRequest = 499;
104-
static const int internalServerError = 500;
105-
static const int notImplemented = 501;
106-
static const int badGateway = 502;
107-
static const int serviceUnavailable = 503;
108-
static const int gatewayTimeout = 504;
109-
static const int httpVersionNotSupported = 505;
110-
@Since("2.1")
111-
static const int variantAlsoNegotiates = 506;
112-
@Since("2.1")
113-
static const int insufficientStorage = 507;
114-
@Since("2.1")
115-
static const int loopDetected = 508;
116-
@Since("2.1")
117-
static const int notExtended = 510;
118-
@Since("2.1")
119-
static const int networkAuthenticationRequired = 511;
120-
// Client generated status code.
121-
static const int networkConnectTimeoutError = 599;
122-
123-
@Deprecated("Use continue_ instead")
124-
static const int CONTINUE = continue_;
125-
@Deprecated("Use switchingProtocols instead")
126-
static const int SWITCHING_PROTOCOLS = switchingProtocols;
127-
@Deprecated("Use ok instead")
128-
static const int OK = ok;
129-
@Deprecated("Use created instead")
130-
static const int CREATED = created;
131-
@Deprecated("Use accepted instead")
132-
static const int ACCEPTED = accepted;
133-
@Deprecated("Use nonAuthoritativeInformation instead")
134-
static const int NON_AUTHORITATIVE_INFORMATION = nonAuthoritativeInformation;
135-
@Deprecated("Use noContent instead")
136-
static const int NO_CONTENT = noContent;
137-
@Deprecated("Use resetContent instead")
138-
static const int RESET_CONTENT = resetContent;
139-
@Deprecated("Use partialContent instead")
140-
static const int PARTIAL_CONTENT = partialContent;
141-
@Deprecated("Use multipleChoices instead")
142-
static const int MULTIPLE_CHOICES = multipleChoices;
143-
@Deprecated("Use movedPermanently instead")
144-
static const int MOVED_PERMANENTLY = movedPermanently;
145-
@Deprecated("Use found instead")
146-
static const int FOUND = found;
147-
@Deprecated("Use movedTemporarily instead")
148-
static const int MOVED_TEMPORARILY = movedTemporarily;
149-
@Deprecated("Use seeOther instead")
150-
static const int SEE_OTHER = seeOther;
151-
@Deprecated("Use notModified instead")
152-
static const int NOT_MODIFIED = notModified;
153-
@Deprecated("Use useProxy instead")
154-
static const int USE_PROXY = useProxy;
155-
@Deprecated("Use temporaryRedirect instead")
156-
static const int TEMPORARY_REDIRECT = temporaryRedirect;
157-
@Deprecated("Use badRequest instead")
158-
static const int BAD_REQUEST = badRequest;
159-
@Deprecated("Use unauthorized instead")
160-
static const int UNAUTHORIZED = unauthorized;
161-
@Deprecated("Use paymentRequired instead")
162-
static const int PAYMENT_REQUIRED = paymentRequired;
163-
@Deprecated("Use forbidden instead")
164-
static const int FORBIDDEN = forbidden;
165-
@Deprecated("Use notFound instead")
166-
static const int NOT_FOUND = notFound;
167-
@Deprecated("Use methodNotAllowed instead")
168-
static const int METHOD_NOT_ALLOWED = methodNotAllowed;
169-
@Deprecated("Use notAcceptable instead")
170-
static const int NOT_ACCEPTABLE = notAcceptable;
171-
@Deprecated("Use proxyAuthenticationRequired instead")
172-
static const int PROXY_AUTHENTICATION_REQUIRED = proxyAuthenticationRequired;
173-
@Deprecated("Use requestTimeout instead")
174-
static const int REQUEST_TIMEOUT = requestTimeout;
175-
@Deprecated("Use conflict instead")
176-
static const int CONFLICT = conflict;
177-
@Deprecated("Use gone instead")
178-
static const int GONE = gone;
179-
@Deprecated("Use lengthRequired instead")
180-
static const int LENGTH_REQUIRED = lengthRequired;
181-
@Deprecated("Use preconditionFailed instead")
182-
static const int PRECONDITION_FAILED = preconditionFailed;
183-
@Deprecated("Use requestEntityTooLarge instead")
184-
static const int REQUEST_ENTITY_TOO_LARGE = requestEntityTooLarge;
185-
@Deprecated("Use requestUriTooLong instead")
186-
static const int REQUEST_URI_TOO_LONG = requestUriTooLong;
187-
@Deprecated("Use unsupportedMediaType instead")
188-
static const int UNSUPPORTED_MEDIA_TYPE = unsupportedMediaType;
189-
@Deprecated("Use requestedRangeNotSatisfiable instead")
190-
static const int REQUESTED_RANGE_NOT_SATISFIABLE =
191-
requestedRangeNotSatisfiable;
192-
@Deprecated("Use expectationFailed instead")
193-
static const int EXPECTATION_FAILED = expectationFailed;
194-
@Deprecated("Use upgradeRequired instead")
195-
static const int UPGRADE_REQUIRED = upgradeRequired;
196-
@Deprecated("Use internalServerError instead")
197-
static const int INTERNAL_SERVER_ERROR = internalServerError;
198-
@Deprecated("Use notImplemented instead")
199-
static const int NOT_IMPLEMENTED = notImplemented;
200-
@Deprecated("Use badGateway instead")
201-
static const int BAD_GATEWAY = badGateway;
202-
@Deprecated("Use serviceUnavailable instead")
203-
static const int SERVICE_UNAVAILABLE = serviceUnavailable;
204-
@Deprecated("Use gatewayTimeout instead")
205-
static const int GATEWAY_TIMEOUT = gatewayTimeout;
206-
@Deprecated("Use httpVersionNotSupported instead")
207-
static const int HTTP_VERSION_NOT_SUPPORTED = httpVersionNotSupported;
208-
@Deprecated("Use networkConnectTimeoutError instead")
209-
static const int NETWORK_CONNECT_TIMEOUT_ERROR = networkConnectTimeoutError;
210-
}
211-
21234
/**
21335
* A server that delivers content, such as web pages, using the HTTP protocol.
21436
*

0 commit comments

Comments
 (0)