Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: sdk/lib/html/html_common/conversions.dart

Issue 1727003002: Replace the now missing ContextAttributes with our previously Firefox-only _TypedContextAttributes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/dom/scripts/dartmetadata.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 5
6 // Conversions for IDBKey. 6 // Conversions for IDBKey.
7 // 7 //
8 // Per http://www.w3.org/TR/IndexedDB/#key-construct 8 // Per http://www.w3.org/TR/IndexedDB/#key-construct
9 // 9 //
10 // "A value is said to be a valid key if it is one of the following types: Array 10 // "A value is said to be a valid key if it is one of the following types: Array
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) { 259 convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) {
260 this.mustCopy = mustCopy; 260 this.mustCopy = mustCopy;
261 var copy = walk(object); 261 var copy = walk(object);
262 return copy; 262 return copy;
263 } 263 }
264 } 264 }
265 265
266 // Conversions for ContextAttributes. 266 // Conversions for ContextAttributes.
267 // 267 //
268 // On Firefox, the returned ContextAttributes is a plain object. 268 // On Firefox, the returned ContextAttributes is a plain object.
269 class _TypedContextAttributes { 269 class ContextAttributes {
270 bool alpha; 270 bool alpha;
271 bool antialias; 271 bool antialias;
272 bool depth; 272 bool depth;
273 bool premultipliedAlpha; 273 bool premultipliedAlpha;
274 bool preserveDrawingBuffer; 274 bool preserveDrawingBuffer;
275 bool stencil; 275 bool stencil;
276 bool failIfMajorPerformanceCaveat; 276 bool failIfMajorPerformanceCaveat;
277 277
278 _TypedContextAttributes(this.alpha, this.antialias, this.depth, 278 ContextAttributes(this.alpha, this.antialias, this.depth,
279 this.failIfMajorPerformanceCaveat, this.premultipliedAlpha, 279 this.failIfMajorPerformanceCaveat, this.premultipliedAlpha,
280 this.preserveDrawingBuffer, this.stencil); 280 this.preserveDrawingBuffer, this.stencil);
281 } 281 }
282 282
283 convertNativeToDart_ContextAttributes(nativeContextAttributes) { 283 convertNativeToDart_ContextAttributes(nativeContextAttributes) {
284 // On Firefox the above test fails because ContextAttributes is a plain 284 // On Firefox the above test fails because ContextAttributes is a plain
285 // object so we create a _TypedContextAttributes. 285 // object so we create a _TypedContextAttributes.
286 286
287 return new _TypedContextAttributes( 287 return new ContextAttributes(
288 JS('var', '#.alpha', nativeContextAttributes), 288 JS('var', '#.alpha', nativeContextAttributes),
289 JS('var', '#.antialias', nativeContextAttributes), 289 JS('var', '#.antialias', nativeContextAttributes),
290 JS('var', '#.depth', nativeContextAttributes), 290 JS('var', '#.depth', nativeContextAttributes),
291 JS('var', '#.failIfMajorPerformanceCaveat', nativeContextAttributes), 291 JS('var', '#.failIfMajorPerformanceCaveat', nativeContextAttributes),
292 JS('var', '#.premultipliedAlpha', nativeContextAttributes), 292 JS('var', '#.premultipliedAlpha', nativeContextAttributes),
293 JS('var', '#.preserveDrawingBuffer', nativeContextAttributes), 293 JS('var', '#.preserveDrawingBuffer', nativeContextAttributes),
294 JS('var', '#.stencil', nativeContextAttributes)); 294 JS('var', '#.stencil', nativeContextAttributes));
295 } 295 }
296 296
297 // Conversions for ImageData 297 // Conversions for ImageData
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 const String _serializedScriptValue = 355 const String _serializedScriptValue =
356 'num|String|bool|' 356 'num|String|bool|'
357 'JSExtendableArray|=Object|' 357 'JSExtendableArray|=Object|'
358 'Blob|File|NativeByteBuffer|NativeTypedData' 358 'Blob|File|NativeByteBuffer|NativeTypedData'
359 // TODO(sra): Add Date, RegExp. 359 // TODO(sra): Add Date, RegExp.
360 ; 360 ;
361 const annotation_Creates_SerializedScriptValue = 361 const annotation_Creates_SerializedScriptValue =
362 const Creates(_serializedScriptValue); 362 const Creates(_serializedScriptValue);
363 const annotation_Returns_SerializedScriptValue = 363 const annotation_Returns_SerializedScriptValue =
364 const Returns(_serializedScriptValue); 364 const Returns(_serializedScriptValue);
OLDNEW
« no previous file with comments | « no previous file | tools/dom/scripts/dartmetadata.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698