From 4bc64b8c2b5b593f8b1210dc67ef7d6d412ccde5 Mon Sep 17 00:00:00 2001 From: "dgrove@google.com" Date: Wed, 5 Oct 2011 04:52:33 +0000 Subject: [PATCH] Initial checkin. git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7 260f80e4-7a28-3924-810f-c04153c831b5 --- client/README | 3 + client/base/AnimationScheduler.dart | 166 + client/base/Css.dart | 6154 ++++ client/base/Device.dart | 76 + client/base/DomWrapper.dart | 26 + client/base/Env.dart | 40 + client/base/base.dart | 14 + client/base/scripts/css_code_generator.py | 139 + client/codereview.settings | 4 + client/dart.gyp | 68 + client/dom/LICENSE | 609 + client/dom/README.google | 10 + client/dom/benchmarks/common/BenchUtil.dart | 82 + client/dom/benchmarks/common/Interval.dart | 30 + client/dom/benchmarks/common/JSON.dart | 584 + client/dom/benchmarks/common/Math2.dart | 49 + client/dom/benchmarks/common/common.dart | 9 + client/dom/benchmarks/dromaeo/Dromaeo.dart | 208 + client/dom/benchmarks/dromaeo/Suites.dart | 44 + client/dom/benchmarks/dromaeo/application.css | 115 + client/dom/benchmarks/dromaeo/favicon.ico | Bin 0 -> 1406 bytes client/dom/benchmarks/dromaeo/favicon.png | Bin 0 -> 448 bytes client/dom/benchmarks/dromaeo/images/bg.png | Bin 0 -> 711 bytes .../dom/benchmarks/dromaeo/images/clouds.png | Bin 0 -> 1130 bytes .../dom/benchmarks/dromaeo/images/clouds2.png | Bin 0 -> 1341 bytes .../dom/benchmarks/dromaeo/images/comets.png | Bin 0 -> 4047 bytes .../dom/benchmarks/dromaeo/images/dino1.png | Bin 0 -> 1276 bytes .../dom/benchmarks/dromaeo/images/dino2.png | Bin 0 -> 1354 bytes .../dom/benchmarks/dromaeo/images/dino3.png | Bin 0 -> 3345 bytes .../dom/benchmarks/dromaeo/images/dino4.png | Bin 0 -> 1331 bytes .../dom/benchmarks/dromaeo/images/dino5.png | Bin 0 -> 2360 bytes .../dom/benchmarks/dromaeo/images/dino6.png | Bin 0 -> 1374 bytes .../dom/benchmarks/dromaeo/images/dino7.png | Bin 0 -> 2445 bytes .../dom/benchmarks/dromaeo/images/dino8.png | Bin 0 -> 2090 bytes client/dom/benchmarks/dromaeo/images/left.png | Bin 0 -> 8908 bytes client/dom/benchmarks/dromaeo/images/logo.png | Bin 0 -> 24809 bytes .../dom/benchmarks/dromaeo/images/logo2.png | Bin 0 -> 19809 bytes .../dom/benchmarks/dromaeo/images/logo3.png | Bin 0 -> 9172 bytes .../dom/benchmarks/dromaeo/images/right.png | Bin 0 -> 1821 bytes client/dom/benchmarks/dromaeo/images/top.png | Bin 0 -> 890 bytes .../dom/benchmarks/dromaeo/images/water.png | Bin 0 -> 1371 bytes client/dom/benchmarks/dromaeo/index.html | 42 + client/dom/benchmarks/dromaeo/reset.css | 38 + client/dom/benchmarks/dromaeo/test-head.html | 4 + client/dom/benchmarks/dromaeo/test-tail.html | 4 + .../dom/benchmarks/dromaeo/tests/Common.dart | 51 + .../benchmarks/dromaeo/tests/RunnerSuite.dart | 135 + .../dromaeo/tests/dom-attr-dartc.html | 2899 ++ .../benchmarks/dromaeo/tests/dom-attr.dart | 32 + .../benchmarks/dromaeo/tests/dom-attr.html | 2899 ++ .../benchmarks/dromaeo/tests/dom-modify.dart | 66 + .../benchmarks/dromaeo/tests/dom-modify.html | 2899 ++ .../benchmarks/dromaeo/tests/dom-query.dart | 102 + .../benchmarks/dromaeo/tests/dom-query.html | 2899 ++ .../dromaeo/tests/dom-traverse.dart | 87 + .../dromaeo/tests/dom-traverse.html | 2899 ++ .../dom/benchmarks/dromaeo/tests/runner.dart | 5 + client/dom/benchmarks/dromaeo/web-style.css | 24 + client/dom/codereview.settings | 4 + client/dom/dom.dart | 696 + client/dom/generated/monkey_dom.js | 7144 ++++ client/dom/generated/monkey_dom_externs.js | 2170 ++ .../src/interface/AbstractWorker.dart | 18 + .../generated/src/interface/ArrayBuffer.dart | 10 + .../src/interface/ArrayBufferView.dart | 14 + client/dom/generated/src/interface/Attr.dart | 20 + .../dom/generated/src/interface/BarInfo.dart | 13 + .../src/interface/BeforeLoadEvent.dart | 12 + client/dom/generated/src/interface/Blob.dart | 12 + .../generated/src/interface/CDATASection.dart | 8 + .../src/interface/CSSCharsetRule.dart | 12 + .../src/interface/CSSFontFaceRule.dart | 10 + .../src/interface/CSSImportRule.dart | 14 + .../generated/src/interface/CSSMediaRule.dart | 16 + .../generated/src/interface/CSSPageRule.dart | 14 + .../src/interface/CSSPrimitiveValue.dart | 76 + .../dom/generated/src/interface/CSSRule.dart | 36 + .../generated/src/interface/CSSRuleList.dart | 12 + .../src/interface/CSSStyleDeclaration.dart | 32 + .../generated/src/interface/CSSStyleRule.dart | 14 + .../src/interface/CSSStyleSheet.dart | 22 + .../src/interface/CSSUnknownRule.dart | 8 + .../dom/generated/src/interface/CSSValue.dart | 22 + .../generated/src/interface/CSSValueList.dart | 12 + .../src/interface/CanvasGradient.dart | 10 + .../src/interface/CanvasPattern.dart | 8 + .../src/interface/CanvasPixelArray.dart | 12 + .../src/interface/CanvasRenderingContext.dart | 10 + .../interface/CanvasRenderingContext2D.dart | 152 + .../src/interface/CharacterData.dart | 24 + .../generated/src/interface/ClientRect.dart | 20 + .../src/interface/ClientRectList.dart | 12 + .../generated/src/interface/Clipboard.dart | 28 + .../generated/src/interface/CloseEvent.dart | 16 + .../dom/generated/src/interface/Comment.dart | 8 + .../src/interface/CompositionEvent.dart | 12 + .../dom/generated/src/interface/Console.dart | 44 + .../generated/src/interface/Coordinates.dart | 22 + .../dom/generated/src/interface/Counter.dart | 14 + .../dom/generated/src/interface/Crypto.dart | 10 + .../generated/src/interface/CustomEvent.dart | 12 + .../src/interface/DOMApplicationCache.dart | 67 + .../generated/src/interface/DOMException.dart | 64 + .../src/interface/DOMFileSystem.dart | 12 + .../src/interface/DOMFileSystemSync.dart | 12 + .../generated/src/interface/DOMFormData.dart | 13 + .../src/interface/DOMImplementation.dart | 18 + .../generated/src/interface/DOMMimeType.dart | 16 + .../src/interface/DOMMimeTypeArray.dart | 14 + .../generated/src/interface/DOMParser.dart | 10 + .../generated/src/interface/DOMPlugin.dart | 20 + .../src/interface/DOMPluginArray.dart | 16 + .../generated/src/interface/DOMSelection.dart | 61 + .../src/interface/DOMSettableTokenList.dart | 12 + .../generated/src/interface/DOMTokenList.dart | 20 + .../dom/generated/src/interface/DOMURL.dart | 12 + .../generated/src/interface/DOMWindow.dart | 549 + .../src/interface/DataTransferItem.dart | 16 + .../src/interface/DataTransferItems.dart | 16 + .../dom/generated/src/interface/DataView.dart | 40 + .../dom/generated/src/interface/Database.dart | 16 + .../src/interface/DatabaseCallback.dart | 10 + .../generated/src/interface/DatabaseSync.dart | 16 + .../src/interface/DedicatedWorkerContext.dart | 19 + .../src/interface/DeviceMotionEvent.dart | 12 + .../src/interface/DeviceOrientationEvent.dart | 16 + .../src/interface/DirectoryEntry.dart | 16 + .../src/interface/DirectoryEntrySync.dart | 16 + .../src/interface/DirectoryReader.dart | 10 + .../src/interface/DirectoryReaderSync.dart | 10 + .../dom/generated/src/interface/Document.dart | 340 + .../src/interface/DocumentFragment.dart | 12 + .../generated/src/interface/DocumentType.dart | 20 + .../dom/generated/src/interface/Element.dart | 282 + .../src/interface/ElementTraversal.dart | 18 + .../dom/generated/src/interface/Entity.dart | 14 + .../src/interface/EntityReference.dart | 8 + .../src/interface/EntriesCallback.dart | 10 + client/dom/generated/src/interface/Entry.dart | 30 + .../generated/src/interface/EntryArray.dart | 12 + .../src/interface/EntryArraySync.dart | 12 + .../src/interface/EntryCallback.dart | 10 + .../generated/src/interface/EntrySync.dart | 30 + .../src/interface/ErrorCallback.dart | 10 + .../generated/src/interface/ErrorEvent.dart | 16 + client/dom/generated/src/interface/Event.dart | 80 + .../src/interface/EventException.dart | 18 + .../generated/src/interface/EventSource.dart | 38 + .../generated/src/interface/EventTarget.dart | 16 + client/dom/generated/src/interface/File.dart | 16 + .../generated/src/interface/FileCallback.dart | 10 + .../generated/src/interface/FileEntry.dart | 12 + .../src/interface/FileEntrySync.dart | 12 + .../generated/src/interface/FileError.dart | 34 + .../src/interface/FileException.dart | 38 + .../dom/generated/src/interface/FileList.dart | 12 + .../generated/src/interface/FileReader.dart | 56 + .../src/interface/FileReaderSync.dart | 16 + .../src/interface/FileSystemCallback.dart | 10 + .../generated/src/interface/FileWriter.dart | 54 + .../src/interface/FileWriterCallback.dart | 10 + .../src/interface/FileWriterSync.dart | 18 + .../generated/src/interface/Float32Array.dart | 14 + .../generated/src/interface/Float64Array.dart | 14 + .../generated/src/interface/Geolocation.dart | 14 + .../generated/src/interface/Geoposition.dart | 12 + .../src/interface/HTMLAllCollection.dart | 16 + .../src/interface/HTMLAnchorElement.dart | 94 + .../src/interface/HTMLAppletElement.dart | 52 + .../src/interface/HTMLAreaElement.dart | 54 + .../src/interface/HTMLAudioElement.dart | 8 + .../src/interface/HTMLBRElement.dart | 12 + .../src/interface/HTMLBaseElement.dart | 16 + .../src/interface/HTMLBaseFontElement.dart | 20 + .../src/interface/HTMLBodyElement.dart | 88 + .../src/interface/HTMLButtonElement.dart | 66 + .../src/interface/HTMLCanvasElement.dart | 20 + .../src/interface/HTMLCollection.dart | 14 + .../src/interface/HTMLDListElement.dart | 12 + .../src/interface/HTMLDataListElement.dart | 10 + .../src/interface/HTMLDetailsElement.dart | 12 + .../src/interface/HTMLDirectoryElement.dart | 12 + .../src/interface/HTMLDivElement.dart | 12 + .../generated/src/interface/HTMLDocument.dart | 91 + .../generated/src/interface/HTMLElement.dart | 80 + .../src/interface/HTMLEmbedElement.dart | 32 + .../src/interface/HTMLFieldSetElement.dart | 20 + .../src/interface/HTMLFontElement.dart | 20 + .../src/interface/HTMLFormElement.dart | 54 + .../src/interface/HTMLFrameElement.dart | 52 + .../src/interface/HTMLFrameSetElement.dart | 72 + .../src/interface/HTMLHRElement.dart | 24 + .../src/interface/HTMLHeadElement.dart | 12 + .../src/interface/HTMLHeadingElement.dart | 12 + .../src/interface/HTMLHtmlElement.dart | 16 + .../src/interface/HTMLIFrameElement.dart | 56 + .../src/interface/HTMLImageElement.dart | 74 + .../src/interface/HTMLInputElement.dart | 204 + .../src/interface/HTMLIsIndexElement.dart | 14 + .../src/interface/HTMLKeygenElement.dart | 44 + .../src/interface/HTMLLIElement.dart | 16 + .../src/interface/HTMLLabelElement.dart | 20 + .../src/interface/HTMLLegendElement.dart | 18 + .../src/interface/HTMLLinkElement.dart | 46 + .../src/interface/HTMLMapElement.dart | 14 + .../src/interface/HTMLMarqueeElement.dart | 56 + .../src/interface/HTMLMediaElement.dart | 118 + .../src/interface/HTMLMenuElement.dart | 12 + .../src/interface/HTMLMetaElement.dart | 24 + .../src/interface/HTMLMeterElement.dart | 36 + .../src/interface/HTMLModElement.dart | 16 + .../src/interface/HTMLOListElement.dart | 20 + .../src/interface/HTMLObjectElement.dart | 86 + .../src/interface/HTMLOptGroupElement.dart | 16 + .../src/interface/HTMLOptionElement.dart | 34 + .../src/interface/HTMLOptionsCollection.dart | 18 + .../src/interface/HTMLOutputElement.dart | 40 + .../src/interface/HTMLParagraphElement.dart | 12 + .../src/interface/HTMLParamElement.dart | 24 + .../src/interface/HTMLPreElement.dart | 16 + .../src/interface/HTMLProgressElement.dart | 22 + .../src/interface/HTMLQuoteElement.dart | 12 + .../src/interface/HTMLScriptElement.dart | 40 + .../src/interface/HTMLSelectElement.dart | 70 + .../src/interface/HTMLSourceElement.dart | 20 + .../src/interface/HTMLSpanElement.dart | 8 + .../src/interface/HTMLStyleElement.dart | 22 + .../interface/HTMLTableCaptionElement.dart | 12 + .../src/interface/HTMLTableCellElement.dart | 66 + .../src/interface/HTMLTableColElement.dart | 32 + .../src/interface/HTMLTableElement.dart | 76 + .../src/interface/HTMLTableRowElement.dart | 38 + .../interface/HTMLTableSectionElement.dart | 30 + .../src/interface/HTMLTextAreaElement.dart | 94 + .../src/interface/HTMLTitleElement.dart | 12 + .../src/interface/HTMLTrackElement.dart | 28 + .../src/interface/HTMLUListElement.dart | 16 + .../src/interface/HTMLUnknownElement.dart | 8 + .../src/interface/HTMLVideoElement.dart | 40 + .../src/interface/HashChangeEvent.dart | 14 + .../dom/generated/src/interface/History.dart | 20 + .../dom/generated/src/interface/IDBAny.dart | 8 + .../generated/src/interface/IDBCursor.dart | 30 + .../src/interface/IDBCursorWithValue.dart | 10 + .../generated/src/interface/IDBDatabase.dart | 38 + .../src/interface/IDBDatabaseError.dart | 16 + .../src/interface/IDBDatabaseException.dart | 42 + .../generated/src/interface/IDBFactory.dart | 12 + .../dom/generated/src/interface/IDBIndex.dart | 24 + .../dom/generated/src/interface/IDBKey.dart | 8 + .../generated/src/interface/IDBKeyRange.dart | 24 + .../src/interface/IDBObjectStore.dart | 30 + .../generated/src/interface/IDBRequest.dart | 38 + .../src/interface/IDBTransaction.dart | 40 + .../src/interface/IDBVersionChangeEvent.dart | 10 + .../interface/IDBVersionChangeRequest.dart | 12 + .../generated/src/interface/ImageData.dart | 14 + .../src/interface/InjectedScriptHost.dart | 28 + .../src/interface/InspectorFrontendHost.dart | 50 + .../generated/src/interface/Int16Array.dart | 14 + .../generated/src/interface/Int32Array.dart | 14 + .../generated/src/interface/Int8Array.dart | 14 + .../src/interface/JavaScriptCallFrame.dart | 34 + .../src/interface/KeyboardEvent.dart | 570 + .../src/interface/LocalMediaStream.dart | 10 + .../dom/generated/src/interface/Location.dart | 50 + .../generated/src/interface/MediaError.dart | 18 + .../generated/src/interface/MediaList.dart | 20 + .../src/interface/MediaQueryList.dart | 16 + .../src/interface/MediaQueryListListener.dart | 10 + .../generated/src/interface/MediaStream.dart | 28 + .../src/interface/MediaStreamList.dart | 12 + .../src/interface/MediaStreamTrack.dart | 16 + .../src/interface/MediaStreamTrackList.dart | 12 + .../generated/src/interface/MemoryInfo.dart | 14 + .../src/interface/MessageChannel.dart | 12 + .../generated/src/interface/MessageEvent.dart | 20 + .../generated/src/interface/MessagePort.dart | 8 + .../dom/generated/src/interface/Metadata.dart | 10 + .../src/interface/MetadataCallback.dart | 10 + .../generated/src/interface/MouseEvent.dart | 42 + .../src/interface/MutationEvent.dart | 26 + .../src/interface/MutationRecord.dart | 26 + .../generated/src/interface/NamedNodeMap.dart | 24 + .../generated/src/interface/Navigator.dart | 40 + .../interface/NavigatorUserMediaError.dart | 12 + .../NavigatorUserMediaErrorCallback.dart | 10 + .../NavigatorUserMediaSuccessCallback.dart | 10 + client/dom/generated/src/interface/Node.dart | 122 + .../generated/src/interface/NodeFilter.dart | 42 + .../generated/src/interface/NodeIterator.dart | 26 + .../dom/generated/src/interface/NodeList.dart | 12 + .../generated/src/interface/NodeSelector.dart | 12 + .../dom/generated/src/interface/Notation.dart | 12 + .../generated/src/interface/Notification.dart | 42 + .../src/interface/NotificationCenter.dart | 16 + .../src/interface/OESStandardDerivatives.dart | 10 + .../src/interface/OESTextureFloat.dart | 8 + .../src/interface/OESVertexArrayObject.dart | 18 + .../OperationNotAllowedException.dart | 16 + .../src/interface/OverflowEvent.dart | 22 + .../src/interface/PageTransitionEvent.dart | 12 + .../generated/src/interface/Performance.dart | 14 + .../src/interface/PerformanceNavigation.dart | 20 + .../src/interface/PerformanceTiming.dart | 50 + .../src/interface/PopStateEvent.dart | 12 + .../src/interface/PositionCallback.dart | 10 + .../src/interface/PositionError.dart | 18 + .../src/interface/PositionErrorCallback.dart | 10 + .../src/interface/ProcessingInstruction.dart | 16 + .../src/interface/ProgressEvent.dart | 16 + .../dom/generated/src/interface/RGBColor.dart | 16 + client/dom/generated/src/interface/Range.dart | 86 + .../src/interface/RangeException.dart | 18 + client/dom/generated/src/interface/Rect.dart | 16 + .../dom/generated/src/interface/SQLError.dart | 28 + .../generated/src/interface/SQLException.dart | 28 + .../generated/src/interface/SQLResultSet.dart | 14 + .../src/interface/SQLResultSetRowList.dart | 12 + .../src/interface/SQLStatementCallback.dart | 10 + .../interface/SQLStatementErrorCallback.dart | 10 + .../src/interface/SQLTransaction.dart | 8 + .../src/interface/SQLTransactionCallback.dart | 10 + .../SQLTransactionErrorCallback.dart | 10 + .../src/interface/SQLTransactionSync.dart | 8 + .../interface/SQLTransactionSyncCallback.dart | 10 + .../dom/generated/src/interface/Screen.dart | 24 + .../src/interface/ScriptProfile.dart | 14 + .../src/interface/ScriptProfileNode.dart | 24 + .../generated/src/interface/SharedWorker.dart | 10 + .../src/interface/SharedWorkercontext.dart | 17 + .../src/interface/SpeechInputEvent.dart | 10 + .../src/interface/SpeechInputResult.dart | 12 + .../src/interface/SpeechInputResultList.dart | 12 + .../dom/generated/src/interface/Storage.dart | 20 + .../generated/src/interface/StorageEvent.dart | 20 + .../generated/src/interface/StorageInfo.dart | 16 + .../interface/StorageInfoErrorCallback.dart | 10 + .../interface/StorageInfoQuotaCallback.dart | 10 + .../interface/StorageInfoUsageCallback.dart | 10 + .../src/interface/StringCallback.dart | 10 + .../generated/src/interface/StyleMedia.dart | 12 + .../generated/src/interface/StyleSheet.dart | 24 + .../src/interface/StyleSheetList.dart | 12 + client/dom/generated/src/interface/Text.dart | 14 + .../generated/src/interface/TextEvent.dart | 12 + .../generated/src/interface/TextMetrics.dart | 10 + .../generated/src/interface/TimeRanges.dart | 14 + client/dom/generated/src/interface/Touch.dart | 32 + .../generated/src/interface/TouchEvent.dart | 24 + .../generated/src/interface/TouchList.dart | 12 + .../generated/src/interface/TreeWalker.dart | 34 + .../dom/generated/src/interface/UIEvent.dart | 28 + .../generated/src/interface/Uint16Array.dart | 14 + .../generated/src/interface/Uint32Array.dart | 14 + .../generated/src/interface/Uint8Array.dart | 14 + .../src/interface/ValidityState.dart | 26 + .../generated/src/interface/VoidCallback.dart | 10 + .../src/interface/WebGLActiveInfo.dart | 14 + .../generated/src/interface/WebGLBuffer.dart | 8 + .../src/interface/WebGLContextAttributes.dart | 32 + .../src/interface/WebGLContextEvent.dart | 10 + .../src/interface/WebGLFramebuffer.dart | 8 + .../generated/src/interface/WebGLProgram.dart | 8 + .../src/interface/WebGLRenderbuffer.dart | 8 + .../src/interface/WebGLRenderingContext.dart | 874 + .../generated/src/interface/WebGLShader.dart | 8 + .../generated/src/interface/WebGLTexture.dart | 8 + .../src/interface/WebGLUniformLocation.dart | 8 + .../interface/WebGLVertexArrayObjectOES.dart | 8 + .../src/interface/WebKitAnimation.dart | 44 + .../src/interface/WebKitAnimationEvent.dart | 14 + .../src/interface/WebKitAnimationList.dart | 12 + .../src/interface/WebKitBlobBuilder.dart | 12 + .../src/interface/WebKitCSSKeyframeRule.dart | 14 + .../src/interface/WebKitCSSKeyframesRule.dart | 20 + .../src/interface/WebKitCSSMatrix.dart | 118 + .../interface/WebKitCSSTransformValue.dart | 52 + .../generated/src/interface/WebKitFlags.dart | 16 + .../src/interface/WebKitLoseContext.dart | 12 + .../generated/src/interface/WebKitPoint.dart | 18 + .../src/interface/WebKitTransitionEvent.dart | 14 + .../generated/src/interface/WebSocket.dart | 54 + .../generated/src/interface/WheelEvent.dart | 40 + .../dom/generated/src/interface/Worker.dart | 16 + .../src/interface/WorkerContext.dart | 45 + .../src/interface/WorkerLocation.dart | 26 + .../src/interface/WorkerNavigator.dart | 18 + .../src/interface/XMLHttpRequest.dart | 91 + .../interface/XMLHttpRequestException.dart | 18 + .../XMLHttpRequestProgressEvent.dart | 12 + .../src/interface/XMLHttpRequestUpload.dart | 34 + .../src/interface/XMLSerializer.dart | 10 + .../src/interface/XPathEvaluator.dart | 14 + .../src/interface/XPathException.dart | 18 + .../src/interface/XPathExpression.dart | 10 + .../src/interface/XPathNSResolver.dart | 10 + .../generated/src/interface/XPathResult.dart | 46 + .../src/interface/XSLTProcessor.dart | 24 + ..._AbstractWorkerWrappingImplementation.dart | 50 + ...ArrayBufferViewWrappingImplementation.dart | 24 + .../_ArrayBufferWrappingImplementation.dart | 18 + .../wrapping/_AttrWrappingImplementation.dart | 33 + .../_BarInfoWrappingImplementation.dart | 18 + ...BeforeLoadEventWrappingImplementation.dart | 61 + .../wrapping/_BlobWrappingImplementation.dart | 21 + .../_CDATASectionWrappingImplementation.dart | 15 + ..._CSSCharsetRuleWrappingImplementation.dart | 21 + ...CSSFontFaceRuleWrappingImplementation.dart | 18 + .../_CSSImportRuleWrappingImplementation.dart | 24 + .../_CSSMediaRuleWrappingImplementation.dart | 51 + .../_CSSPageRuleWrappingImplementation.dart | 24 + ...SPrimitiveValueWrappingImplementation.dart | 90 + .../_CSSRuleListWrappingImplementation.dart | 28 + .../_CSSRuleWrappingImplementation.dart | 30 + ...tyleDeclarationWrappingImplementation.dart | 128 + .../_CSSStyleRuleWrappingImplementation.dart | 24 + .../_CSSStyleSheetWrappingImplementation.dart | 93 + ..._CSSUnknownRuleWrappingImplementation.dart | 15 + .../_CSSValueListWrappingImplementation.dart | 28 + .../_CSSValueWrappingImplementation.dart | 24 + ..._CanvasGradientWrappingImplementation.dart | 36 + .../_CanvasPatternWrappingImplementation.dart | 15 + ...anvasPixelArrayWrappingImplementation.dart | 95 + ...deringContext2DWrappingImplementation.dart | 812 + ...enderingContextWrappingImplementation.dart | 18 + .../_CharacterDataWrappingImplementation.dart | 127 + ..._ClientRectListWrappingImplementation.dart | 28 + .../_ClientRectWrappingImplementation.dart | 33 + .../_ClipboardWrappingImplementation.dart | 62 + .../_CloseEventWrappingImplementation.dart | 97 + .../_CommentWrappingImplementation.dart | 15 + ...ompositionEventWrappingImplementation.dart | 75 + .../_ConsoleWrappingImplementation.dart | 126 + .../_CoordinatesWrappingImplementation.dart | 36 + .../_CounterWrappingImplementation.dart | 24 + .../_CryptoWrappingImplementation.dart | 21 + .../_CustomEventWrappingImplementation.dart | 61 + ...pplicationCacheWrappingImplementation.dart | 107 + .../_DOMExceptionWrappingImplementation.dart | 24 + ...MFileSystemSyncWrappingImplementation.dart | 21 + .../_DOMFileSystemWrappingImplementation.dart | 21 + .../_DOMFormDataWrappingImplementation.dart | 36 + ...MImplementationWrappingImplementation.dart | 115 + ...OMMimeTypeArrayWrappingImplementation.dart | 38 + .../_DOMMimeTypeWrappingImplementation.dart | 27 + .../_DOMParserWrappingImplementation.dart | 33 + ..._DOMPluginArrayWrappingImplementation.dart | 50 + .../_DOMPluginWrappingImplementation.dart | 47 + .../_DOMSelectionWrappingImplementation.dart | 267 + ...ttableTokenListWrappingImplementation.dart | 21 + .../_DOMTokenListWrappingImplementation.dart | 45 + .../_DOMURLWrappingImplementation.dart | 26 + .../_DOMWindowWrappingImplementation.dart | 1152 + ...ataTransferItemWrappingImplementation.dart | 38 + ...taTransferItemsWrappingImplementation.dart | 50 + .../_DataViewWrappingImplementation.dart | 169 + ...atabaseCallbackWrappingImplementation.dart | 28 + .../_DatabaseSyncWrappingImplementation.dart | 42 + .../_DatabaseWrappingImplementation.dart | 91 + ...edWorkerContextWrappingImplementation.dart | 33 + ...viceMotionEventWrappingImplementation.dart | 49 + ...rientationEventWrappingImplementation.dart | 97 + ...ectoryEntrySyncWrappingImplementation.dart | 36 + ..._DirectoryEntryWrappingImplementation.dart | 103 + ...ctoryReaderSyncWrappingImplementation.dart | 20 + ...DirectoryReaderWrappingImplementation.dart | 27 + ...ocumentFragmentWrappingImplementation.dart | 25 + .../_DocumentTypeWrappingImplementation.dart | 33 + .../_DocumentWrappingImplementation.dart | 858 + ...lementTraversalWrappingImplementation.dart | 30 + .../_ElementWrappingImplementation.dart | 652 + ...EntityReferenceWrappingImplementation.dart | 15 + .../_EntityWrappingImplementation.dart | 24 + ...EntriesCallbackWrappingImplementation.dart | 20 + ..._EntryArraySyncWrappingImplementation.dart | 23 + .../_EntryArrayWrappingImplementation.dart | 23 + .../_EntryCallbackWrappingImplementation.dart | 20 + .../_EntrySyncWrappingImplementation.dart | 61 + .../_EntryWrappingImplementation.dart | 160 + .../_ErrorCallbackWrappingImplementation.dart | 20 + .../_ErrorEventWrappingImplementation.dart | 97 + ..._EventExceptionWrappingImplementation.dart | 24 + .../_EventSourceWrappingImplementation.dart | 74 + .../_EventTargetWrappingImplementation.dart | 44 + .../_EventWrappingImplementation.dart | 103 + .../_FileCallbackWrappingImplementation.dart | 20 + .../_FileEntrySyncWrappingImplementation.dart | 25 + .../_FileEntryWrappingImplementation.dart | 39 + .../_FileErrorWrappingImplementation.dart | 18 + .../_FileExceptionWrappingImplementation.dart | 24 + .../_FileListWrappingImplementation.dart | 23 + ..._FileReaderSyncWrappingImplementation.dart | 40 + .../_FileReaderWrappingImplementation.dart | 96 + ...eSystemCallbackWrappingImplementation.dart | 20 + .../wrapping/_FileWrappingImplementation.dart | 27 + ...eWriterCallbackWrappingImplementation.dart | 20 + ..._FileWriterSyncWrappingImplementation.dart | 39 + .../_FileWriterWrappingImplementation.dart | 87 + .../_Float32ArrayWrappingImplementation.dart | 36 + .../_Float64ArrayWrappingImplementation.dart | 36 + .../_GeolocationWrappingImplementation.dart | 43 + .../_GeopositionWrappingImplementation.dart | 21 + ...MLAllCollectionWrappingImplementation.dart | 38 + ...MLAnchorElementWrappingImplementation.dart | 146 + ...MLAppletElementWrappingImplementation.dart | 81 + ...HTMLAreaElementWrappingImplementation.dart | 84 + ...TMLAudioElementWrappingImplementation.dart | 15 + .../_HTMLBRElementWrappingImplementation.dart | 21 + ...HTMLBaseElementWrappingImplementation.dart | 27 + ...BaseFontElementWrappingImplementation.dart | 33 + ...HTMLBodyElementWrappingImplementation.dart | 135 + ...MLButtonElementWrappingImplementation.dart | 110 + ...MLCanvasElementWrappingImplementation.dart | 47 + ..._HTMLCollectionWrappingImplementation.dart | 105 + ...TMLDListElementWrappingImplementation.dart | 21 + ...DataListElementWrappingImplementation.dart | 18 + ...LDetailsElementWrappingImplementation.dart | 21 + ...irectoryElementWrappingImplementation.dart | 21 + ..._HTMLDivElementWrappingImplementation.dart | 21 + .../_HTMLDocumentWrappingImplementation.dart | 137 + .../_HTMLElementWrappingImplementation.dart | 174 + ...TMLEmbedElementWrappingImplementation.dart | 51 + ...FieldSetElementWrappingImplementation.dart | 38 + ...HTMLFontElementWrappingImplementation.dart | 33 + ...HTMLFormElementWrappingImplementation.dart | 92 + ...TMLFrameElementWrappingImplementation.dart | 81 + ...FrameSetElementWrappingImplementation.dart | 111 + .../_HTMLHRElementWrappingImplementation.dart | 39 + ...HTMLHeadElementWrappingImplementation.dart | 21 + ...LHeadingElementWrappingImplementation.dart | 21 + ...HTMLHtmlElementWrappingImplementation.dart | 27 + ...MLIFrameElementWrappingImplementation.dart | 87 + ...TMLImageElementWrappingImplementation.dart | 114 + ...TMLInputElementWrappingImplementation.dart | 369 + ...LIsIndexElementWrappingImplementation.dart | 24 + ...MLKeygenElementWrappingImplementation.dart | 74 + .../_HTMLLIElementWrappingImplementation.dart | 27 + ...TMLLabelElementWrappingImplementation.dart | 33 + ...MLLegendElementWrappingImplementation.dart | 30 + ...HTMLLinkElementWrappingImplementation.dart | 72 + ..._HTMLMapElementWrappingImplementation.dart | 24 + ...LMarqueeElementWrappingImplementation.dart | 93 + ...TMLMediaElementWrappingImplementation.dart | 169 + ...HTMLMenuElementWrappingImplementation.dart | 21 + ...HTMLMetaElementWrappingImplementation.dart | 39 + ...TMLMeterElementWrappingImplementation.dart | 57 + ..._HTMLModElementWrappingImplementation.dart | 27 + ...TMLOListElementWrappingImplementation.dart | 33 + ...MLObjectElementWrappingImplementation.dart | 137 + ...OptGroupElementWrappingImplementation.dart | 27 + ...MLOptionElementWrappingImplementation.dart | 54 + ...tionsCollectionWrappingImplementation.dart | 39 + ...MLOutputElementWrappingImplementation.dart | 68 + ...aragraphElementWrappingImplementation.dart | 21 + ...TMLParamElementWrappingImplementation.dart | 39 + ..._HTMLPreElementWrappingImplementation.dart | 27 + ...ProgressElementWrappingImplementation.dart | 36 + ...TMLQuoteElementWrappingImplementation.dart | 21 + ...MLScriptElementWrappingImplementation.dart | 63 + ...MLSelectElementWrappingImplementation.dart | 148 + ...MLSourceElementWrappingImplementation.dart | 33 + ...HTMLSpanElementWrappingImplementation.dart | 15 + ...TMLStyleElementWrappingImplementation.dart | 36 + ...eCaptionElementWrappingImplementation.dart | 21 + ...ableCellElementWrappingImplementation.dart | 102 + ...TableColElementWrappingImplementation.dart | 51 + ...TMLTableElementWrappingImplementation.dart | 148 + ...TableRowElementWrappingImplementation.dart | 76 + ...eSectionElementWrappingImplementation.dart | 64 + ...TextAreaElementWrappingImplementation.dart | 180 + ...TMLTitleElementWrappingImplementation.dart | 21 + ...TMLTrackElementWrappingImplementation.dart | 45 + ...TMLUListElementWrappingImplementation.dart | 27 + ...LUnknownElementWrappingImplementation.dart | 15 + ...TMLVideoElementWrappingImplementation.dart | 75 + ...HashChangeEventWrappingImplementation.dart | 78 + .../_HistoryWrappingImplementation.dart | 66 + .../_IDBAnyWrappingImplementation.dart | 15 + ...CursorWithValueWrappingImplementation.dart | 18 + .../_IDBCursorWrappingImplementation.dart | 49 + ...DBDatabaseErrorWrappingImplementation.dart | 27 + ...tabaseExceptionWrappingImplementation.dart | 24 + .../_IDBDatabaseWrappingImplementation.dart | 90 + .../_IDBFactoryWrappingImplementation.dart | 25 + .../_IDBIndexWrappingImplementation.dart | 73 + .../_IDBKeyRangeWrappingImplementation.dart | 70 + .../_IDBKeyWrappingImplementation.dart | 15 + ..._IDBObjectStoreWrappingImplementation.dart | 90 + .../_IDBRequestWrappingImplementation.dart | 74 + ..._IDBTransactionWrappingImplementation.dart | 79 + ...sionChangeEventWrappingImplementation.dart | 18 + ...onChangeRequestWrappingImplementation.dart | 21 + .../_ImageDataWrappingImplementation.dart | 24 + ...ectedScriptHostWrappingImplementation.dart | 68 + ...torFrontendHostWrappingImplementation.dart | 137 + .../_Int16ArrayWrappingImplementation.dart | 36 + .../_Int32ArrayWrappingImplementation.dart | 36 + .../_Int8ArrayWrappingImplementation.dart | 36 + ...ScriptCallFrameWrappingImplementation.dart | 44 + .../_KeyboardEventWrappingImplementation.dart | 229 + ...ocalMediaStreamWrappingImplementation.dart | 21 + .../_LocationWrappingImplementation.dart | 101 + .../_MediaErrorWrappingImplementation.dart | 18 + .../_MediaListWrappingImplementation.dart | 130 + ...eryListListenerWrappingImplementation.dart | 27 + ..._MediaQueryListWrappingImplementation.dart | 45 + ...MediaStreamListWrappingImplementation.dart | 23 + ...StreamTrackListWrappingImplementation.dart | 23 + ...ediaStreamTrackWrappingImplementation.dart | 27 + .../_MediaStreamWrappingImplementation.dart | 59 + .../_MemoryInfoWrappingImplementation.dart | 24 + ..._MessageChannelWrappingImplementation.dart | 21 + .../_MessageEventWrappingImplementation.dart | 141 + .../_MessagePortWrappingImplementation.dart | 15 + ...etadataCallbackWrappingImplementation.dart | 20 + .../_MetadataWrappingImplementation.dart | 18 + .../_MouseEventWrappingImplementation.dart | 370 + .../_MutationEventWrappingImplementation.dart | 141 + ..._MutationRecordWrappingImplementation.dart | 42 + .../_NamedNodeMapWrappingImplementation.dart | 176 + ...iaErrorCallbackWrappingImplementation.dart | 20 + ...rUserMediaErrorWrappingImplementation.dart | 18 + ...SuccessCallbackWrappingImplementation.dart | 20 + .../_NavigatorWrappingImplementation.dart | 68 + .../_NodeFilterWrappingImplementation.dart | 25 + .../_NodeIteratorWrappingImplementation.dart | 49 + .../_NodeListWrappingImplementation.dart | 100 + .../_NodeSelectorWrappingImplementation.dart | 25 + .../wrapping/_NodeWrappingImplementation.dart | 238 + .../_NotationWrappingImplementation.dart | 21 + ...ificationCenterWrappingImplementation.dart | 36 + .../_NotificationWrappingImplementation.dart | 92 + ...dardDerivativesWrappingImplementation.dart | 15 + ...OESTextureFloatWrappingImplementation.dart | 15 + ...rtexArrayObjectWrappingImplementation.dart | 54 + ...llowedExceptionWrappingImplementation.dart | 24 + .../_OverflowEventWrappingImplementation.dart | 55 + ...TransitionEventWrappingImplementation.dart | 61 + ...manceNavigationWrappingImplementation.dart | 21 + ...rformanceTimingWrappingImplementation.dart | 78 + .../_PerformanceWrappingImplementation.dart | 24 + .../_PopStateEventWrappingImplementation.dart | 61 + ...ositionCallbackWrappingImplementation.dart | 20 + ...onErrorCallbackWrappingImplementation.dart | 20 + .../_PositionErrorWrappingImplementation.dart | 21 + ...singInstructionWrappingImplementation.dart | 27 + .../_ProgressEventWrappingImplementation.dart | 97 + .../_RGBColorWrappingImplementation.dart | 27 + ..._RangeExceptionWrappingImplementation.dart | 24 + .../_RangeWrappingImplementation.dart | 301 + .../wrapping/_RectWrappingImplementation.dart | 27 + .../_SQLErrorWrappingImplementation.dart | 21 + .../_SQLExceptionWrappingImplementation.dart | 21 + ...esultSetRowListWrappingImplementation.dart | 23 + .../_SQLResultSetWrappingImplementation.dart | 24 + ...atementCallbackWrappingImplementation.dart | 20 + ...ntErrorCallbackWrappingImplementation.dart | 20 + ...sactionCallbackWrappingImplementation.dart | 20 + ...onErrorCallbackWrappingImplementation.dart | 20 + ...ionSyncCallbackWrappingImplementation.dart | 20 + ...TransactionSyncWrappingImplementation.dart | 15 + ..._SQLTransactionWrappingImplementation.dart | 15 + .../_ScreenWrappingImplementation.dart | 39 + ...riptProfileNodeWrappingImplementation.dart | 39 + .../_ScriptProfileWrappingImplementation.dart | 24 + .../_SharedWorkerWrappingImplementation.dart | 18 + ...edWorkercontextWrappingImplementation.dart | 24 + ...peechInputEventWrappingImplementation.dart | 18 + ...InputResultListWrappingImplementation.dart | 23 + ...eechInputResultWrappingImplementation.dart | 21 + .../_StorageEventWrappingImplementation.dart | 141 + ...foErrorCallbackWrappingImplementation.dart | 20 + ...foQuotaCallbackWrappingImplementation.dart | 20 + ...foUsageCallbackWrappingImplementation.dart | 20 + .../_StorageInfoWrappingImplementation.dart | 57 + .../_StorageWrappingImplementation.dart | 46 + ..._StringCallbackWrappingImplementation.dart | 20 + .../_StyleMediaWrappingImplementation.dart | 28 + ..._StyleSheetListWrappingImplementation.dart | 100 + .../_StyleSheetWrappingImplementation.dart | 39 + .../_TextEventWrappingImplementation.dart | 75 + .../_TextMetricsWrappingImplementation.dart | 18 + .../wrapping/_TextWrappingImplementation.dart | 38 + .../_TimeRangesWrappingImplementation.dart | 28 + .../_TouchEventWrappingImplementation.dart | 277 + .../_TouchListWrappingImplementation.dart | 95 + .../_TouchWrappingImplementation.dart | 51 + .../_TreeWalkerWrappingImplementation.dart | 68 + .../_UIEventWrappingImplementation.dart | 99 + .../_Uint16ArrayWrappingImplementation.dart | 36 + .../_Uint32ArrayWrappingImplementation.dart | 36 + .../_Uint8ArrayWrappingImplementation.dart | 36 + .../_ValidityStateWrappingImplementation.dart | 42 + .../_VoidCallbackWrappingImplementation.dart | 21 + ...WebGLActiveInfoWrappingImplementation.dart | 24 + .../_WebGLBufferWrappingImplementation.dart | 15 + ...ntextAttributesWrappingImplementation.dart | 51 + ...bGLContextEventWrappingImplementation.dart | 18 + ...ebGLFramebufferWrappingImplementation.dart | 15 + .../_WebGLProgramWrappingImplementation.dart | 15 + ...bGLRenderbufferWrappingImplementation.dart | 15 + ...enderingContextWrappingImplementation.dart | 896 + .../_WebGLShaderWrappingImplementation.dart | 15 + .../_WebGLTextureWrappingImplementation.dart | 15 + ...UniformLocationWrappingImplementation.dart | 15 + ...xArrayObjectOESWrappingImplementation.dart | 15 + ...tAnimationEventWrappingImplementation.dart | 78 + ...itAnimationListWrappingImplementation.dart | 23 + ...WebKitAnimationWrappingImplementation.dart | 57 + ...bKitBlobBuilderWrappingImplementation.dart | 48 + ...CSSKeyframeRuleWrappingImplementation.dart | 24 + ...SSKeyframesRuleWrappingImplementation.dart | 58 + ...WebKitCSSMatrixWrappingImplementation.dart | 318 + ...STransformValueWrappingImplementation.dart | 18 + .../_WebKitFlagsWrappingImplementation.dart | 27 + ...bKitLoseContextWrappingImplementation.dart | 27 + .../_WebKitPointWrappingImplementation.dart | 27 + ...TransitionEventWrappingImplementation.dart | 78 + .../_WebSocketWrappingImplementation.dart | 112 + .../_WheelEventWrappingImplementation.dart | 243 + .../_WorkerContextWrappingImplementation.dart | 114 + ..._WorkerLocationWrappingImplementation.dart | 44 + ...WorkerNavigatorWrappingImplementation.dart | 30 + .../_WorkerWrappingImplementation.dart | 39 + ...equestExceptionWrappingImplementation.dart | 24 + ...stProgressEventWrappingImplementation.dart | 21 + ...tpRequestUploadWrappingImplementation.dart | 74 + ..._XMLHttpRequestWrappingImplementation.dart | 189 + .../_XMLSerializerWrappingImplementation.dart | 25 + ..._XPathEvaluatorWrappingImplementation.dart | 94 + ..._XPathExceptionWrappingImplementation.dart | 24 + ...XPathExpressionWrappingImplementation.dart | 42 + ...XPathNSResolverWrappingImplementation.dart | 25 + .../_XPathResultWrappingImplementation.dart | 51 + .../_XSLTProcessorWrappingImplementation.dart | 60 + client/dom/generated/wrapping_dom.js | 30430 ++++++++++++++++ client/dom/generated/wrapping_dom_externs.js | 1429 + client/dom/idl/dart/dart.idl | 146 + client/dom/idl/dart/webkit-supplemental.idl | 20 + client/dom/monkey_dom.dart.broken | 355 + client/dom/scripts/all_tests.py | 24 + client/dom/scripts/dartdomgenerator.py | 96 + client/dom/scripts/dartgenerator.py | 1714 + client/dom/scripts/dartgenerator_test.py | 236 + client/dom/scripts/dartrenderer.py | 208 + client/dom/scripts/dartrenderer_test.py | 69 + client/dom/scripts/database.py | 206 + client/dom/scripts/database_test.py | 93 + client/dom/scripts/databasebuilder.py | 535 + client/dom/scripts/databasebuilder_test.py | 395 + client/dom/scripts/emitter.py | 217 + client/dom/scripts/emitter_test.py | 100 + client/dom/scripts/fremontcutbuilder.py | 122 + client/dom/scripts/idlnode.py | 468 + client/dom/scripts/idlnode_test.py | 155 + client/dom/scripts/idlparser.py | 438 + client/dom/scripts/idlparser_test.py | 167 + client/dom/scripts/idlrenderer.py | 152 + client/dom/scripts/idlrenderer_test.py | 74 + client/dom/scripts/logging.conf | 58 + client/dom/scripts/multiemitter.py | 85 + client/dom/scripts/multiemitter_test.py | 47 + client/dom/scripts/pegparser.py | 527 + client/dom/scripts/pegparser_test.py | 200 + client/dom/scripts/snippet_manager.py | 77 + client/dom/scripts/template_html.darttemplate | 62 + .../scripts/template_interface.darttemplate | 8 + ...template_interface_FileReader.darttemplate | 10 + ...ate_interface_WebKitCSSMatrix.darttemplate | 10 + ...emplate_interface_WebKitPoint.darttemplate | 10 + ...late_interface_XMLHttpRequest.darttemplate | 11 + .../scripts/template_monkey_dom.darttemplate | 18 + client/dom/scripts/template_monkey_dom.js | 175 + .../scripts/template_monkey_dom_externs.js | 26 + .../template_wrapping_dom.darttemplate | 22 + client/dom/scripts/template_wrapping_dom.js | 289 + .../scripts/template_wrapping_dom_externs.js | 42 + .../template_wrapping_impl.darttemplate | 5 + .../events/EventTargetImpl.dart.snippet | 9 + .../events/KeyboardEvent.dart.snippet | 535 + .../snippets/html/HTMLDocument.dart.snippet | 24 + .../dom/snippets/html/WindowImpl.dart.snippet | 9 + client/dom/src/DOMType.dart | 10 + client/dom/src/DOMWrapperBase.dart | 13 + client/dom/src/EventListener.dart | 5 + client/dom/src/GlobalProperties.dart | 21 + .../src/RequestAnimationFrameCallback.dart | 5 + client/dom/src/TimeoutHandler.dart | 5 + client/dom/src/_Collections.dart | 43 + client/dom/src/_FactoryProviders.dart | 35 + client/dom/src/_ListIterators.dart | 33 + client/dom/src/_Lists.dart | 49 + client/dom/wrapping_dom.dart | 696 + client/fling/README.txt | 12 + client/fling/build.xml | 63 + client/fling/dist/fling | 47 + .../dist/runtime/apps/adminz/adminz.dart | 142 + client/fling/dist/runtime/logback.xml | 19 + client/fling/eclipse/classpath | 19 + client/fling/eclipse/project | 17 + .../settings/org.eclipse.jdt.core.prefs | 16 + client/fling/fling.dart | 7 + client/fling/fling.gypi | 24 + client/fling/samples/lil_server.dart | 28 + client/fling/samples/static/index.html | 11 + client/fling/samples/static/lil_client.dart | 10 + client/fling/samples/static/lil_client.js | 6 + client/fling/samples/two_servers.dart | 27 + client/fling/src/dart/fling.dart | 67 + client/fling/src/dart/fling.js | 95 + .../core/com/google/dart/CompileError.java | 72 + .../core/com/google/dart/CompileResult.java | 79 + .../core/com/google/dart/CompileService.java | 270 + .../com/google/dart/LibraryFromSources.java | 107 + .../com/google/dart/SourceFromString.java | 60 + .../com/google/dart/fling/Environment.java | 147 + .../core/com/google/dart/fling/Fling.java | 70 + .../java/core/com/google/dart/fling/Http.java | 558 + .../com/google/dart/fling/MessageLoop.java | 178 + .../com/google/dart/fling/PrefixTree.java | 115 + .../core/com/google/dart/fling/RhinoUtil.java | 17 + .../google/dart/fling/MessageLoopTest.java | 49 + client/html/benchmarks/common/BenchUtil.dart | 82 + client/html/benchmarks/common/Interval.dart | 30 + client/html/benchmarks/common/JSON.dart | 584 + client/html/benchmarks/common/Math2.dart | 49 + client/html/benchmarks/common/common.lib | 12 + client/html/benchmarks/dromaeo/Dromaeo.dart | 197 + client/html/benchmarks/dromaeo/Suites.dart | 42 + .../html/benchmarks/dromaeo/application.css | 115 + client/html/benchmarks/dromaeo/dromaeo.app | 11 + client/html/benchmarks/dromaeo/favicon.ico | Bin 0 -> 1406 bytes client/html/benchmarks/dromaeo/favicon.png | Bin 0 -> 448 bytes client/html/benchmarks/dromaeo/images/bg.png | Bin 0 -> 711 bytes .../html/benchmarks/dromaeo/images/clouds.png | Bin 0 -> 1130 bytes .../benchmarks/dromaeo/images/clouds2.png | Bin 0 -> 1341 bytes .../html/benchmarks/dromaeo/images/comets.png | Bin 0 -> 4047 bytes .../html/benchmarks/dromaeo/images/dino1.png | Bin 0 -> 1276 bytes .../html/benchmarks/dromaeo/images/dino2.png | Bin 0 -> 1354 bytes .../html/benchmarks/dromaeo/images/dino3.png | Bin 0 -> 3345 bytes .../html/benchmarks/dromaeo/images/dino4.png | Bin 0 -> 1331 bytes .../html/benchmarks/dromaeo/images/dino5.png | Bin 0 -> 2360 bytes .../html/benchmarks/dromaeo/images/dino6.png | Bin 0 -> 1374 bytes .../html/benchmarks/dromaeo/images/dino7.png | Bin 0 -> 2445 bytes .../html/benchmarks/dromaeo/images/dino8.png | Bin 0 -> 2090 bytes .../html/benchmarks/dromaeo/images/left.png | Bin 0 -> 8908 bytes .../html/benchmarks/dromaeo/images/logo.png | Bin 0 -> 24809 bytes .../html/benchmarks/dromaeo/images/logo2.png | Bin 0 -> 19809 bytes .../html/benchmarks/dromaeo/images/logo3.png | Bin 0 -> 9172 bytes .../html/benchmarks/dromaeo/images/right.png | Bin 0 -> 1821 bytes client/html/benchmarks/dromaeo/images/top.png | Bin 0 -> 890 bytes .../html/benchmarks/dromaeo/images/water.png | Bin 0 -> 1371 bytes client/html/benchmarks/dromaeo/index.html | 42 + client/html/benchmarks/dromaeo/reset.css | 38 + client/html/benchmarks/dromaeo/test-head.html | 4 + client/html/benchmarks/dromaeo/test-tail.html | 4 + .../html/benchmarks/dromaeo/tests/Common.dart | 51 + .../benchmarks/dromaeo/tests/DomAttr.dart | 31 + .../benchmarks/dromaeo/tests/DomModify.dart | 67 + .../benchmarks/dromaeo/tests/DomQuery.dart | 101 + .../benchmarks/dromaeo/tests/DomTraverse.dart | 84 + .../html/benchmarks/dromaeo/tests/Runner.dart | 130 + .../dromaeo/tests/dom-attr-dartc.html | 2899 ++ .../benchmarks/dromaeo/tests/dom-attr.app | 10 + .../benchmarks/dromaeo/tests/dom-attr.html | 2899 ++ .../benchmarks/dromaeo/tests/dom-modify.app | 10 + .../benchmarks/dromaeo/tests/dom-modify.html | 2899 ++ .../benchmarks/dromaeo/tests/dom-query.app | 12 + .../benchmarks/dromaeo/tests/dom-query.html | 2899 ++ .../benchmarks/dromaeo/tests/dom-traverse.app | 11 + .../dromaeo/tests/dom-traverse.html | 2899 ++ .../html/benchmarks/dromaeo/tests/runner.lib | 10 + client/html/benchmarks/dromaeo/web-style.css | 24 + client/html/bootstrap_hacks.dart | 8 + .../src/interface/AnchorElement.dart | 94 + .../generated/src/interface/Animation.dart | 44 + .../src/interface/AnimationEvent.dart | 14 + .../src/interface/AnimationList.dart | 12 + .../generated/src/interface/AreaElement.dart | 54 + .../generated/src/interface/ArrayBuffer.dart | 10 + .../src/interface/ArrayBufferView.dart | 14 + .../generated/src/interface/AudioElement.dart | 8 + .../generated/src/interface/BRElement.dart | 12 + .../html/generated/src/interface/BarInfo.dart | 10 + .../generated/src/interface/BaseElement.dart | 16 + .../src/interface/BeforeLoadEvent.dart | 12 + .../src/interface/BeforeProcessEvent.dart | 14 + client/html/generated/src/interface/Blob.dart | 12 + .../generated/src/interface/BlobBuilder.dart | 12 + .../src/interface/BlockquoteElement.dart | 12 + .../src/interface/ButtonElement.dart | 66 + .../generated/src/interface/CDATASection.dart | 8 + .../src/interface/CSSCharsetRule.dart | 12 + .../src/interface/CSSFontFaceRule.dart | 10 + .../src/interface/CSSImportRule.dart | 14 + .../src/interface/CSSKeyframeRule.dart | 14 + .../src/interface/CSSKeyframesRule.dart | 20 + .../generated/src/interface/CSSMatrix.dart | 117 + .../generated/src/interface/CSSMediaRule.dart | 16 + .../generated/src/interface/CSSPageRule.dart | 14 + .../src/interface/CSSPrimitiveValue.dart | 76 + .../html/generated/src/interface/CSSRule.dart | 36 + .../generated/src/interface/CSSRuleList.dart | 12 + .../generated/src/interface/CSSStyleRule.dart | 14 + .../src/interface/CSSStyleSheet.dart | 22 + .../src/interface/CSSTransformValue.dart | 52 + .../src/interface/CSSUnknownRule.dart | 8 + .../generated/src/interface/CSSValue.dart | 22 + .../generated/src/interface/CSSValueList.dart | 12 + .../src/interface/CanvasElement.dart | 20 + .../src/interface/CanvasGradient.dart | 10 + .../src/interface/CanvasPattern.dart | 8 + .../src/interface/CanvasPixelArray.dart | 12 + .../src/interface/CanvasRenderingContext.dart | 10 + .../interface/CanvasRenderingContext2D.dart | 152 + .../src/interface/CharacterData.dart | 24 + .../generated/src/interface/ClientRect.dart | 20 + .../src/interface/ClientRectList.dart | 12 + .../generated/src/interface/Clipboard.dart | 28 + .../generated/src/interface/CloseEvent.dart | 16 + .../html/generated/src/interface/Comment.dart | 8 + .../src/interface/CompositionEvent.dart | 12 + .../html/generated/src/interface/Console.dart | 40 + .../generated/src/interface/Coordinates.dart | 22 + .../html/generated/src/interface/Counter.dart | 14 + .../html/generated/src/interface/Crypto.dart | 10 + .../generated/src/interface/CustomEvent.dart | 12 + .../generated/src/interface/DListElement.dart | 12 + .../generated/src/interface/DOMException.dart | 64 + .../src/interface/DOMFileSystem.dart | 12 + .../src/interface/DOMFileSystemSync.dart | 12 + .../generated/src/interface/DOMFormData.dart | 10 + .../generated/src/interface/DOMMimeType.dart | 16 + .../src/interface/DOMMimeTypeArray.dart | 14 + .../generated/src/interface/DOMParser.dart | 10 + .../generated/src/interface/DOMPlugin.dart | 20 + .../src/interface/DOMPluginArray.dart | 16 + .../generated/src/interface/DOMSelection.dart | 58 + .../src/interface/DOMSettableTokenList.dart | 12 + .../generated/src/interface/DOMTokenList.dart | 20 + .../html/generated/src/interface/DOMURL.dart | 12 + .../src/interface/DataListElement.dart | 10 + .../src/interface/DataTransferItem.dart | 16 + .../src/interface/DataTransferItems.dart | 16 + .../generated/src/interface/DataView.dart | 40 + .../src/interface/DetailsElement.dart | 12 + .../src/interface/DeviceMotionEvent.dart | 12 + .../src/interface/DeviceOrientationEvent.dart | 16 + .../src/interface/DirectoryEntry.dart | 16 + .../src/interface/DirectoryEntrySync.dart | 16 + .../src/interface/DirectoryReader.dart | 10 + .../src/interface/DirectoryReaderSync.dart | 10 + .../generated/src/interface/DivElement.dart | 12 + .../generated/src/interface/EmbedElement.dart | 32 + .../html/generated/src/interface/Entity.dart | 14 + .../src/interface/EntityReference.dart | 8 + .../src/interface/EntriesCallback.dart | 10 + .../html/generated/src/interface/Entry.dart | 30 + .../generated/src/interface/EntryArray.dart | 12 + .../src/interface/EntryArraySync.dart | 12 + .../src/interface/EntryCallback.dart | 10 + .../generated/src/interface/EntrySync.dart | 30 + .../src/interface/ErrorCallback.dart | 10 + .../generated/src/interface/ErrorEvent.dart | 16 + .../html/generated/src/interface/Event.dart | 80 + .../src/interface/EventException.dart | 18 + .../src/interface/FieldSetElement.dart | 20 + client/html/generated/src/interface/File.dart | 16 + .../generated/src/interface/FileCallback.dart | 10 + .../generated/src/interface/FileEntry.dart | 12 + .../src/interface/FileEntrySync.dart | 12 + .../generated/src/interface/FileError.dart | 34 + .../src/interface/FileException.dart | 38 + .../generated/src/interface/FileList.dart | 12 + .../generated/src/interface/FileReader.dart | 54 + .../src/interface/FileReaderSync.dart | 16 + .../src/interface/FileSystemCallback.dart | 10 + .../generated/src/interface/FileWriter.dart | 54 + .../src/interface/FileWriterCallback.dart | 10 + .../src/interface/FileWriterSync.dart | 18 + .../html/generated/src/interface/Flags.dart | 16 + .../generated/src/interface/Float32Array.dart | 14 + .../generated/src/interface/Float64Array.dart | 14 + .../generated/src/interface/FontElement.dart | 20 + .../generated/src/interface/FormElement.dart | 52 + .../generated/src/interface/Geolocation.dart | 14 + .../generated/src/interface/Geoposition.dart | 12 + .../generated/src/interface/HRElement.dart | 24 + .../src/interface/HTMLAllCollection.dart | 16 + .../src/interface/HashChangeEvent.dart | 14 + .../generated/src/interface/HeadElement.dart | 12 + .../src/interface/HeadingElement.dart | 12 + .../html/generated/src/interface/History.dart | 20 + .../generated/src/interface/HtmlElement.dart | 16 + .../html/generated/src/interface/IDBAny.dart | 8 + .../generated/src/interface/IDBCursor.dart | 28 + .../src/interface/IDBCursorWithValue.dart | 10 + .../generated/src/interface/IDBDatabase.dart | 38 + .../src/interface/IDBDatabaseError.dart | 16 + .../src/interface/IDBDatabaseException.dart | 42 + .../generated/src/interface/IDBFactory.dart | 10 + .../generated/src/interface/IDBIndex.dart | 22 + .../html/generated/src/interface/IDBKey.dart | 8 + .../generated/src/interface/IDBKeyRange.dart | 24 + .../src/interface/IDBObjectStore.dart | 28 + .../generated/src/interface/IDBRequest.dart | 38 + .../src/interface/IDBTransaction.dart | 40 + .../src/interface/IDBVersionChangeEvent.dart | 10 + .../interface/IDBVersionChangeRequest.dart | 12 + .../src/interface/IFrameElement.dart | 56 + .../generated/src/interface/ImageData.dart | 14 + .../generated/src/interface/ImageElement.dart | 74 + .../generated/src/interface/InputElement.dart | 204 + .../generated/src/interface/Int16Array.dart | 14 + .../generated/src/interface/Int32Array.dart | 14 + .../generated/src/interface/Int8Array.dart | 14 + .../src/interface/KeyboardEvent.dart | 570 + .../src/interface/KeygenElement.dart | 44 + .../generated/src/interface/LIElement.dart | 16 + .../generated/src/interface/LabelElement.dart | 20 + .../src/interface/LegendElement.dart | 18 + .../generated/src/interface/LinkElement.dart | 46 + .../src/interface/LocalMediaStream.dart | 10 + .../generated/src/interface/Location.dart | 50 + .../generated/src/interface/LoseContext.dart | 12 + .../generated/src/interface/MapElement.dart | 14 + .../src/interface/MarqueeElement.dart | 56 + .../generated/src/interface/MediaElement.dart | 112 + .../generated/src/interface/MediaError.dart | 18 + .../generated/src/interface/MediaList.dart | 20 + .../src/interface/MediaQueryList.dart | 16 + .../src/interface/MediaQueryListListener.dart | 10 + .../generated/src/interface/MediaStream.dart | 28 + .../src/interface/MediaStreamList.dart | 12 + .../src/interface/MediaStreamTrack.dart | 16 + .../src/interface/MediaStreamTrackList.dart | 12 + .../generated/src/interface/MenuElement.dart | 12 + .../src/interface/MessageChannel.dart | 12 + .../generated/src/interface/MessageEvent.dart | 20 + .../generated/src/interface/MetaElement.dart | 24 + .../generated/src/interface/Metadata.dart | 10 + .../src/interface/MetadataCallback.dart | 10 + .../generated/src/interface/MeterElement.dart | 36 + .../generated/src/interface/ModElement.dart | 16 + .../generated/src/interface/MouseEvent.dart | 42 + .../src/interface/MutationEvent.dart | 26 + .../generated/src/interface/Navigator.dart | 40 + .../interface/NavigatorUserMediaError.dart | 12 + .../NavigatorUserMediaErrorCallback.dart | 10 + .../NavigatorUserMediaSuccessCallback.dart | 10 + .../generated/src/interface/Notation.dart | 12 + .../src/interface/NotificationCenter.dart | 16 + .../src/interface/OESStandardDerivatives.dart | 10 + .../src/interface/OESTextureFloat.dart | 8 + .../src/interface/OESVertexArrayObject.dart | 18 + .../generated/src/interface/OListElement.dart | 20 + .../src/interface/ObjectElement.dart | 86 + .../OperationNotAllowedException.dart | 16 + .../src/interface/OptGroupElement.dart | 16 + .../src/interface/OptionElement.dart | 34 + .../src/interface/OutputElement.dart | 40 + .../src/interface/OverflowEvent.dart | 22 + .../src/interface/PageTransitionEvent.dart | 12 + .../src/interface/ParagraphElement.dart | 12 + .../generated/src/interface/ParamElement.dart | 24 + .../html/generated/src/interface/Point.dart | 17 + .../src/interface/PopStateEvent.dart | 12 + .../src/interface/PositionCallback.dart | 10 + .../src/interface/PositionError.dart | 18 + .../src/interface/PositionErrorCallback.dart | 10 + .../generated/src/interface/PreElement.dart | 16 + .../src/interface/ProcessingInstruction.dart | 16 + .../src/interface/ProgressElement.dart | 22 + .../src/interface/ProgressEvent.dart | 16 + .../generated/src/interface/QuoteElement.dart | 12 + .../generated/src/interface/RGBColor.dart | 16 + .../html/generated/src/interface/Range.dart | 86 + .../src/interface/RangeException.dart | 18 + client/html/generated/src/interface/Rect.dart | 16 + .../html/generated/src/interface/Screen.dart | 24 + .../src/interface/ScriptElement.dart | 40 + .../src/interface/SelectElement.dart | 68 + .../src/interface/SourceElement.dart | 20 + .../src/interface/SpeechInputEvent.dart | 10 + .../src/interface/SpeechInputResult.dart | 12 + .../src/interface/SpeechInputResultList.dart | 12 + .../html/generated/src/interface/Storage.dart | 20 + .../generated/src/interface/StorageEvent.dart | 20 + .../generated/src/interface/StorageInfo.dart | 16 + .../interface/StorageInfoErrorCallback.dart | 10 + .../interface/StorageInfoQuotaCallback.dart | 10 + .../interface/StorageInfoUsageCallback.dart | 10 + .../src/interface/StringCallback.dart | 10 + .../generated/src/interface/StyleElement.dart | 22 + .../generated/src/interface/StyleMedia.dart | 12 + .../generated/src/interface/StyleSheet.dart | 24 + .../src/interface/StyleSheetList.dart | 12 + .../src/interface/TableCaptionElement.dart | 12 + .../src/interface/TableCellElement.dart | 66 + .../src/interface/TableColElement.dart | 32 + .../generated/src/interface/TableElement.dart | 76 + .../src/interface/TableRowElement.dart | 38 + .../src/interface/TableSectionElement.dart | 30 + .../src/interface/TextAreaElement.dart | 90 + .../generated/src/interface/TextEvent.dart | 12 + .../generated/src/interface/TextMetrics.dart | 10 + .../generated/src/interface/TimeRanges.dart | 14 + .../generated/src/interface/TitleElement.dart | 12 + .../html/generated/src/interface/Touch.dart | 32 + .../generated/src/interface/TouchEvent.dart | 24 + .../generated/src/interface/TouchList.dart | 12 + .../generated/src/interface/TrackElement.dart | 28 + .../src/interface/TransitionEvent.dart | 14 + .../html/generated/src/interface/UIEvent.dart | 28 + .../generated/src/interface/UListElement.dart | 16 + .../generated/src/interface/Uint16Array.dart | 14 + .../generated/src/interface/Uint32Array.dart | 14 + .../generated/src/interface/Uint8Array.dart | 14 + .../src/interface/UnknownElement.dart | 8 + .../src/interface/ValidityState.dart | 26 + .../generated/src/interface/VideoElement.dart | 40 + .../generated/src/interface/VoidCallback.dart | 10 + .../src/interface/WebGLActiveInfo.dart | 14 + .../generated/src/interface/WebGLBuffer.dart | 8 + .../src/interface/WebGLContextAttributes.dart | 32 + .../src/interface/WebGLContextEvent.dart | 10 + .../src/interface/WebGLFramebuffer.dart | 8 + .../generated/src/interface/WebGLProgram.dart | 8 + .../src/interface/WebGLRenderbuffer.dart | 8 + .../src/interface/WebGLRenderingContext.dart | 874 + .../generated/src/interface/WebGLShader.dart | 8 + .../generated/src/interface/WebGLTexture.dart | 8 + .../src/interface/WebGLUniformLocation.dart | 8 + .../interface/WebGLVertexArrayObjectOES.dart | 8 + .../generated/src/interface/WheelEvent.dart | 40 + .../interface/XMLHttpRequestException.dart | 18 + .../XMLHttpRequestProgressEvent.dart | 12 + .../_AnchorElementWrappingImplementation.dart | 99 + ..._AnimationEventWrappingImplementation.dart | 20 + .../_AnimationListWrappingImplementation.dart | 17 + .../_AnimationWrappingImplementation.dart | 41 + .../_AreaElementWrappingImplementation.dart | 57 + ...ArrayBufferViewWrappingImplementation.dart | 17 + .../_ArrayBufferWrappingImplementation.dart | 13 + .../_AudioElementWrappingImplementation.dart | 11 + .../_BRElementWrappingImplementation.dart | 15 + .../_BarInfoWrappingImplementation.dart | 13 + .../_BaseElementWrappingImplementation.dart | 19 + ...BeforeLoadEventWrappingImplementation.dart | 18 + ...oreProcessEventWrappingImplementation.dart | 20 + .../_BlobBuilderWrappingImplementation.dart | 23 + .../wrapping/_BlobWrappingImplementation.dart | 15 + ...ockquoteElementWrappingImplementation.dart | 15 + .../_ButtonElementWrappingImplementation.dart | 77 + .../_CDATASectionWrappingImplementation.dart | 11 + ..._CSSCharsetRuleWrappingImplementation.dart | 15 + ...CSSFontFaceRuleWrappingImplementation.dart | 13 + .../_CSSImportRuleWrappingImplementation.dart | 17 + ...CSSKeyframeRuleWrappingImplementation.dart | 17 + ...SSKeyframesRuleWrappingImplementation.dart | 31 + .../_CSSMatrixWrappingImplementation.dart | 148 + .../_CSSMediaRuleWrappingImplementation.dart | 24 + .../_CSSPageRuleWrappingImplementation.dart | 17 + ...SPrimitiveValueWrappingImplementation.dart | 43 + .../_CSSRuleListWrappingImplementation.dart | 17 + .../_CSSRuleWrappingImplementation.dart | 21 + .../_CSSStyleRuleWrappingImplementation.dart | 17 + .../_CSSStyleSheetWrappingImplementation.dart | 35 + ...STransformValueWrappingImplementation.dart | 13 + ..._CSSUnknownRuleWrappingImplementation.dart | 11 + .../_CSSValueListWrappingImplementation.dart | 17 + .../_CSSValueWrappingImplementation.dart | 17 + .../_CanvasElementWrappingImplementation.dart | 27 + ..._CanvasGradientWrappingImplementation.dart | 16 + .../_CanvasPatternWrappingImplementation.dart | 11 + ...anvasPixelArrayWrappingImplementation.dart | 89 + ...deringContext2DWrappingImplementation.dart | 310 + ...enderingContextWrappingImplementation.dart | 13 + .../_CharacterDataWrappingImplementation.dart | 41 + ..._ClientRectListWrappingImplementation.dart | 17 + .../_ClientRectWrappingImplementation.dart | 23 + .../_ClipboardWrappingImplementation.dart | 42 + .../_CloseEventWrappingImplementation.dart | 22 + .../_CommentWrappingImplementation.dart | 11 + ...ompositionEventWrappingImplementation.dart | 18 + .../_ConsoleWrappingImplementation.dart | 91 + .../_CoordinatesWrappingImplementation.dart | 25 + .../_CounterWrappingImplementation.dart | 17 + .../_CryptoWrappingImplementation.dart | 16 + .../_CustomEventWrappingImplementation.dart | 18 + .../_DListElementWrappingImplementation.dart | 15 + .../_DOMExceptionWrappingImplementation.dart | 17 + ...MFileSystemSyncWrappingImplementation.dart | 15 + .../_DOMFileSystemWrappingImplementation.dart | 15 + .../_DOMFormDataWrappingImplementation.dart | 16 + ...OMMimeTypeArrayWrappingImplementation.dart | 21 + .../_DOMMimeTypeWrappingImplementation.dart | 19 + .../_DOMParserWrappingImplementation.dart | 15 + ..._DOMPluginArrayWrappingImplementation.dart | 26 + .../_DOMPluginWrappingImplementation.dart | 27 + .../_DOMSelectionWrappingImplementation.dart | 101 + ...ttableTokenListWrappingImplementation.dart | 15 + .../_DOMTokenListWrappingImplementation.dart | 35 + .../_DOMURLWrappingImplementation.dart | 20 + ...DataListElementWrappingImplementation.dart | 13 + ...ataTransferItemWrappingImplementation.dart | 24 + ...taTransferItemsWrappingImplementation.dart | 27 + .../_DataViewWrappingImplementation.dart | 83 + ..._DetailsElementWrappingImplementation.dart | 15 + ...viceMotionEventWrappingImplementation.dart | 18 + ...rientationEventWrappingImplementation.dart | 22 + ...ectoryEntrySyncWrappingImplementation.dart | 28 + ..._DirectoryEntryWrappingImplementation.dart | 30 + ...ctoryReaderSyncWrappingImplementation.dart | 15 + ...DirectoryReaderWrappingImplementation.dart | 16 + .../_DivElementWrappingImplementation.dart | 15 + .../_EmbedElementWrappingImplementation.dart | 35 + ...EntityReferenceWrappingImplementation.dart | 11 + .../_EntityWrappingImplementation.dart | 17 + ...EntriesCallbackWrappingImplementation.dart | 15 + ..._EntryArraySyncWrappingImplementation.dart | 17 + .../_EntryArrayWrappingImplementation.dart | 17 + .../_EntryCallbackWrappingImplementation.dart | 15 + .../_EntrySyncWrappingImplementation.dart | 46 + .../_EntryWrappingImplementation.dart | 50 + .../_ErrorCallbackWrappingImplementation.dart | 15 + .../_ErrorEventWrappingImplementation.dart | 22 + ..._EventExceptionWrappingImplementation.dart | 17 + .../_EventWrappingImplementation.dart | 57 + ...FieldSetElementWrappingImplementation.dart | 28 + .../_FileCallbackWrappingImplementation.dart | 15 + .../_FileEntrySyncWrappingImplementation.dart | 19 + .../_FileEntryWrappingImplementation.dart | 21 + .../_FileErrorWrappingImplementation.dart | 13 + .../_FileExceptionWrappingImplementation.dart | 17 + .../_FileListWrappingImplementation.dart | 17 + ..._FileReaderSyncWrappingImplementation.dart | 27 + .../_FileReaderWrappingImplementation.dart | 66 + ...eSystemCallbackWrappingImplementation.dart | 15 + .../wrapping/_FileWrappingImplementation.dart | 19 + ...eWriterCallbackWrappingImplementation.dart | 15 + ..._FileWriterSyncWrappingImplementation.dart | 30 + .../_FileWriterWrappingImplementation.dart | 63 + .../_FlagsWrappingImplementation.dart | 19 + .../_Float32ArrayWrappingImplementation.dart | 17 + .../_Float64ArrayWrappingImplementation.dart | 17 + .../_FontElementWrappingImplementation.dart | 23 + .../_FormElementWrappingImplementation.dart | 63 + .../_GeolocationWrappingImplementation.dart | 25 + .../_GeopositionWrappingImplementation.dart | 15 + .../_HRElementWrappingImplementation.dart | 27 + ...MLAllCollectionWrappingImplementation.dart | 25 + ...HashChangeEventWrappingImplementation.dart | 20 + .../_HeadElementWrappingImplementation.dart | 15 + ..._HeadingElementWrappingImplementation.dart | 15 + .../_HistoryWrappingImplementation.dart | 38 + .../_HtmlElementWrappingImplementation.dart | 19 + .../wrapping/_HtmlWrappingImplementation.dart | 1969 + .../_IDBAnyWrappingImplementation.dart | 11 + ...CursorWithValueWrappingImplementation.dart | 13 + .../_IDBCursorWrappingImplementation.dart | 27 + ...DBDatabaseErrorWrappingImplementation.dart | 19 + ...tabaseExceptionWrappingImplementation.dart | 17 + .../_IDBDatabaseWrappingImplementation.dart | 59 + .../_IDBFactoryWrappingImplementation.dart | 15 + .../_IDBIndexWrappingImplementation.dart | 31 + .../_IDBKeyRangeWrappingImplementation.dart | 35 + .../_IDBKeyWrappingImplementation.dart | 11 + ..._IDBObjectStoreWrappingImplementation.dart | 48 + .../_IDBRequestWrappingImplementation.dart | 45 + ..._IDBTransactionWrappingImplementation.dart | 50 + ...sionChangeEventWrappingImplementation.dart | 13 + ...onChangeRequestWrappingImplementation.dart | 15 + .../_IFrameElementWrappingImplementation.dart | 59 + .../_ImageDataWrappingImplementation.dart | 17 + .../_ImageElementWrappingImplementation.dart | 77 + .../_InputElementWrappingImplementation.dart | 230 + .../_Int16ArrayWrappingImplementation.dart | 17 + .../_Int32ArrayWrappingImplementation.dart | 17 + .../_Int8ArrayWrappingImplementation.dart | 17 + .../_KeyboardEventWrappingImplementation.dart | 34 + .../_KeygenElementWrappingImplementation.dart | 52 + .../_LIElementWrappingImplementation.dart | 19 + .../_LabelElementWrappingImplementation.dart | 23 + .../_LegendElementWrappingImplementation.dart | 21 + .../_LinkElementWrappingImplementation.dart | 49 + ...ocalMediaStreamWrappingImplementation.dart | 16 + .../_LocationWrappingImplementation.dart | 64 + .../_LoseContextWrappingImplementation.dart | 21 + .../_MapElementWrappingImplementation.dart | 17 + ..._MarqueeElementWrappingImplementation.dart | 65 + .../_MediaElementWrappingImplementation.dart | 108 + .../_MediaErrorWrappingImplementation.dart | 13 + .../_MediaListWrappingImplementation.dart | 103 + ...eryListListenerWrappingImplementation.dart | 16 + ..._MediaQueryListWrappingImplementation.dart | 25 + ...MediaStreamListWrappingImplementation.dart | 17 + ...StreamTrackListWrappingImplementation.dart | 17 + ...ediaStreamTrackWrappingImplementation.dart | 19 + .../_MediaStreamWrappingImplementation.dart | 35 + .../_MenuElementWrappingImplementation.dart | 15 + ..._MessageChannelWrappingImplementation.dart | 15 + .../_MessageEventWrappingImplementation.dart | 26 + .../_MetaElementWrappingImplementation.dart | 27 + ...etadataCallbackWrappingImplementation.dart | 15 + .../_MetadataWrappingImplementation.dart | 13 + .../_MeterElementWrappingImplementation.dart | 39 + .../_ModElementWrappingImplementation.dart | 19 + .../_MouseEventWrappingImplementation.dart | 48 + .../_MutationEventWrappingImplementation.dart | 26 + ...iaErrorCallbackWrappingImplementation.dart | 15 + ...rUserMediaErrorWrappingImplementation.dart | 13 + ...SuccessCallbackWrappingImplementation.dart | 15 + .../_NavigatorWrappingImplementation.dart | 48 + .../_NotationWrappingImplementation.dart | 15 + ...ificationCenterWrappingImplementation.dart | 28 + ...dardDerivativesWrappingImplementation.dart | 11 + ...OESTextureFloatWrappingImplementation.dart | 11 + ...rtexArrayObjectWrappingImplementation.dart | 29 + .../_OListElementWrappingImplementation.dart | 23 + .../_ObjectElementWrappingImplementation.dart | 94 + ...llowedExceptionWrappingImplementation.dart | 17 + ...OptGroupElementWrappingImplementation.dart | 19 + .../_OptionElementWrappingImplementation.dart | 37 + .../_OutputElementWrappingImplementation.dart | 48 + .../_OverflowEventWrappingImplementation.dart | 22 + ...TransitionEventWrappingImplementation.dart | 18 + ...aragraphElementWrappingImplementation.dart | 15 + .../_ParamElementWrappingImplementation.dart | 27 + .../_PointWrappingImplementation.dart | 22 + .../_PopStateEventWrappingImplementation.dart | 18 + ...ositionCallbackWrappingImplementation.dart | 15 + ...onErrorCallbackWrappingImplementation.dart | 15 + .../_PositionErrorWrappingImplementation.dart | 15 + .../_PreElementWrappingImplementation.dart | 19 + ...singInstructionWrappingImplementation.dart | 19 + ...ProgressElementWrappingImplementation.dart | 25 + .../_ProgressEventWrappingImplementation.dart | 22 + .../_QuoteElementWrappingImplementation.dart | 15 + .../_RGBColorWrappingImplementation.dart | 19 + ..._RangeExceptionWrappingImplementation.dart | 17 + .../_RangeWrappingImplementation.dart | 135 + .../wrapping/_RectWrappingImplementation.dart | 19 + .../_ScreenWrappingImplementation.dart | 27 + .../_ScriptElementWrappingImplementation.dart | 43 + .../_SelectElementWrappingImplementation.dart | 83 + .../_SourceElementWrappingImplementation.dart | 23 + ...peechInputEventWrappingImplementation.dart | 13 + ...InputResultListWrappingImplementation.dart | 17 + ...eechInputResultWrappingImplementation.dart | 15 + .../_StorageEventWrappingImplementation.dart | 26 + ...foErrorCallbackWrappingImplementation.dart | 15 + ...foQuotaCallbackWrappingImplementation.dart | 15 + ...foUsageCallbackWrappingImplementation.dart | 15 + .../_StorageInfoWrappingImplementation.dart | 21 + .../_StorageWrappingImplementation.dart | 36 + ..._StringCallbackWrappingImplementation.dart | 15 + .../_StyleElementWrappingImplementation.dart | 25 + .../_StyleMediaWrappingImplementation.dart | 17 + ..._StyleSheetListWrappingImplementation.dart | 89 + .../_StyleSheetWrappingImplementation.dart | 27 + ...eCaptionElementWrappingImplementation.dart | 15 + ...ableCellElementWrappingImplementation.dart | 69 + ...TableColElementWrappingImplementation.dart | 35 + .../_TableElementWrappingImplementation.dart | 99 + ...TableRowElementWrappingImplementation.dart | 46 + ...eSectionElementWrappingImplementation.dart | 38 + ...TextAreaElementWrappingImplementation.dart | 104 + .../_TextEventWrappingImplementation.dart | 18 + .../_TextMetricsWrappingImplementation.dart | 13 + .../_TimeRangesWrappingImplementation.dart | 21 + .../_TitleElementWrappingImplementation.dart | 15 + .../_TouchEventWrappingImplementation.dart | 30 + .../_TouchListWrappingImplementation.dart | 89 + .../_TouchWrappingImplementation.dart | 35 + .../_TrackElementWrappingImplementation.dart | 31 + ...TransitionEventWrappingImplementation.dart | 20 + .../_UIEventWrappingImplementation.dart | 34 + .../_UListElementWrappingImplementation.dart | 19 + .../_Uint16ArrayWrappingImplementation.dart | 17 + .../_Uint32ArrayWrappingImplementation.dart | 17 + .../_Uint8ArrayWrappingImplementation.dart | 17 + ..._UnknownElementWrappingImplementation.dart | 11 + .../_ValidityStateWrappingImplementation.dart | 29 + .../_VideoElementWrappingImplementation.dart | 55 + .../_VoidCallbackWrappingImplementation.dart | 16 + ...WebGLActiveInfoWrappingImplementation.dart | 17 + .../_WebGLBufferWrappingImplementation.dart | 11 + ...ntextAttributesWrappingImplementation.dart | 35 + ...bGLContextEventWrappingImplementation.dart | 13 + ...ebGLFramebufferWrappingImplementation.dart | 11 + .../_WebGLProgramWrappingImplementation.dart | 11 + ...bGLRenderbufferWrappingImplementation.dart | 11 + ...enderingContextWrappingImplementation.dart | 672 + .../_WebGLShaderWrappingImplementation.dart | 11 + .../_WebGLTextureWrappingImplementation.dart | 11 + ...UniformLocationWrappingImplementation.dart | 11 + ...xArrayObjectOESWrappingImplementation.dart | 11 + .../_WheelEventWrappingImplementation.dart | 46 + ...equestExceptionWrappingImplementation.dart | 17 + ...stProgressEventWrappingImplementation.dart | 15 + client/html/html.dart | 588 + client/html/src/AbstractWorker.dart | 11 + .../AbstractWorkerWrappingImplementation.dart | 20 + client/html/src/BodyElement.dart | 20 + .../BodyElementWrappingImplementation.dart | 33 + client/html/src/BootstrapHacks.dart | 9 + client/html/src/CSSStyleDeclaration.dart | 30 + ...tyleDeclarationWrappingImplementation.dart | 49 + client/html/src/CssClassSet.dart | 140 + client/html/src/DOMApplicationCache.dart | 37 + ...pplicationCacheWrappingImplementation.dart | 38 + client/html/src/DOMWrapperBase.dart | 13 + client/html/src/Document.dart | 90 + client/html/src/DocumentFragment.dart | 12 + ...ocumentFragmentWrappingImplementation.dart | 20 + .../src/DocumentWrappingImplementation.dart | 121 + client/html/src/Element.dart | 204 + .../src/ElementWrappingImplementation.dart | 579 + client/html/src/EventListener.dart | 5 + client/html/src/EventSource.dart | 26 + .../EventSourceWrappingImplementation.dart | 30 + client/html/src/EventTarget.dart | 20 + .../EventTargetWrappingImplementation.dart | 127 + client/html/src/GlobalProperties.dart | 28 + client/html/src/MessagePort.dart | 6 + .../MessagePortWrappingImplementation.dart | 7 + client/html/src/Node.dart | 38 + client/html/src/NodeList.dart | 7 + .../html/src/NodeWrappingImplementation.dart | 212 + client/html/src/Notification.dart | 34 + .../NotificationWrappingImplementation.dart | 44 + .../src/RequestAnimationFrameCallback.dart | 5 + client/html/src/SharedWorker.dart | 8 + .../SharedWorkerWrappingImplementation.dart | 9 + client/html/src/Text.dart | 14 + .../html/src/TextWrappingImplementation.dart | 29 + client/html/src/TimeoutHandler.dart | 5 + client/html/src/WebSocket.dart | 46 + .../src/WebSocketWrappingImplementation.dart | 47 + client/html/src/Window.dart | 315 + .../src/WindowWrappingImplementation.dart | 878 + client/html/src/Worker.dart | 16 + .../src/WorkerWrappingImplementation.dart | 36 + client/html/src/XMLHttpRequest.dart | 66 + client/html/src/XMLHttpRequestUpload.dart | 15 + ...tpRequestUploadWrappingImplementation.dart | 25 + .../XMLHttpRequestWrappingImplementation.dart | 129 + client/html/src/_ArrayIterators.dart | 33 + client/html/src/_Arrays.dart | 51 + client/html/src/_Collections.dart | 43 + client/json/dart_json.dart | 592 + client/json/json.dart | 38 + client/json/json.js | 186 + client/layout/GridLayout.dart | 510 + client/layout/GridLayoutParams.dart | 107 + client/layout/GridLayoutParser.dart | 486 + client/layout/GridTracks.dart | 187 + client/layout/SizingFunctions.dart | 149 + client/layout/ViewLayout.dart | 225 + client/layout/layout.dart | 16 + client/observable/ChangeEvent.dart | 84 + client/observable/EventBatch.dart | 104 + client/observable/observable.dart | 281 + .../testing/unittest/coverage_controller.js | 31 + client/testing/unittest/dom_for_unittest.dart | 35 + client/testing/unittest/dom_for_unittest.js | 11 + client/testing/unittest/test_controller.js | 41 + client/testing/unittest/unittest.dart | 16 + client/testing/unittest/unittest_dom.dart | 16 + client/testing/unittest/unittestsuite.dart | 469 + client/tests/client/client.status | 32 + client/tests/client/json/cmd_json_test.dart | 31 + client/tests/client/json/json_test.dart | 179 + client/tests/client/json/json_test.html | 9 + client/tests/client/json/json_tests.dart | 16 + client/tests/client/json/web_json_test.dart | 24 + client/tests/client/layout/GridExamples.dart | 188 + .../tests/client/layout/GridLayoutDemo.dart | 148 + .../tests/client/layout/GridLayoutTests.dart | 196 + .../tests/client/layout/grid_layout_demo.dart | 19 + .../tests/client/layout/grid_layout_demo.html | 11 + client/tests/client/layout/layout_tests.dart | 20 + .../observable/AbstractObservableTests.dart | 83 + .../client/observable/ChangeEventTests.dart | 32 + .../client/observable/EventBatchTests.dart | 56 + .../observable/ObservableListTests.dart | 125 + .../observable/ObservableTestSetBase.dart | 21 + .../observable/ObservableValueTests.dart | 51 + .../client/observable/observable_tests.dart | 30 + .../samples/dartcombat/dartcombat_tests.dart | 159 + .../client/samples/swarm/swarm_tests.dart | 145 + .../client/samples/total/TotalTests.dart | 463 + .../client/samples/total/total_tests.dart | 17 + client/tests/client/testcfg.py | 14 + client/tests/client/touch/TouchTests.dart | 49 + client/tests/client/util/util_tests.dart | 52 + client/tests/client/view/ViewTests.dart | 202 + client/tests/client/view/view_tests.dart | 16 + client/tests/dartc/dartc.status | 21 + client/tests/dartc/testcfg.py | 31 + client/tools/buildbot_annotated_steps.py | 199 + client/tools/copy_dart.py | 126 + client/tools/coverage.css | 105 + client/tools/coverage.py | 450 + client/tools/dartserver/bin/dartserver | 65 + client/tools/dartserver/build.xml | 62 + client/tools/dartserver/dartserver.mf | 2 + .../tools/AppEngineThumbnailServlet.java | 93 + .../appstack/tools/AwtThumbnailServlet.java | 101 + .../google/appstack/tools/OAuthServlet.java | 99 + .../appstack/tools/ProxyingServlet.java | 68 + .../appstack/tools/ThumbnailServlet.java | 59 + .../appstack/tools/dartserver/AppMaker.java | 70 + .../appstack/tools/dartserver/DartApp.java | 189 + .../appstack/tools/dartserver/DartServer.java | 114 + .../tools/dartserver/ErrorFormatter.java | 269 + client/tools/generate_build.py | 25 + client/tools/htmlconverter.py | 442 + client/tools/htmlconverter_test.py | 314 + client/tools/jscoverage_wrapper.py | 48 + client/tools/scss.sh | 8 + client/tools/show_coverage.js | 259 + client/tools/sourcemap.py | 368 + client/touch/BezierPhysics.dart | 114 + client/touch/ClickBuster.dart | 215 + client/touch/EventUtil.dart | 46 + client/touch/FxUtil.dart | 143 + client/touch/Geometry.dart | 234 + client/touch/InfiniteScroller.dart | 145 + client/touch/Math.dart | 28 + client/touch/Momentum.dart | 554 + client/touch/ScrollWatcher.dart | 101 + client/touch/Scrollbar.dart | 340 + client/touch/Scroller.dart | 807 + client/touch/TimeUtil.dart | 14 + client/touch/TouchHandler.dart | 393 + client/touch/TouchUtil.dart | 263 + client/touch/resources/touch.css | 27 + client/touch/touch.dart | 24 + client/util/CollectionUtils.dart | 139 + client/util/DateTimeUtils.dart | 171 + client/util/StringUtils.dart | 32 + client/util/Uri.dart | 145 + client/util/utilslib.dart | 12 + client/view/CompositeView.dart | 83 + client/view/ConveyorView.dart | 98 + client/view/MeasureText.dart | 160 + client/view/PagedViews.dart | 268 + client/view/SliderMenu.dart | 170 + client/view/resources/view.css | 174 + client/view/view.dart | 353 + 1553 files changed, 163374 insertions(+) create mode 100644 client/README create mode 100644 client/base/AnimationScheduler.dart create mode 100644 client/base/Css.dart create mode 100644 client/base/Device.dart create mode 100644 client/base/DomWrapper.dart create mode 100644 client/base/Env.dart create mode 100644 client/base/base.dart create mode 100644 client/base/scripts/css_code_generator.py create mode 100644 client/codereview.settings create mode 100644 client/dart.gyp create mode 100644 client/dom/LICENSE create mode 100644 client/dom/README.google create mode 100644 client/dom/benchmarks/common/BenchUtil.dart create mode 100644 client/dom/benchmarks/common/Interval.dart create mode 100644 client/dom/benchmarks/common/JSON.dart create mode 100644 client/dom/benchmarks/common/Math2.dart create mode 100644 client/dom/benchmarks/common/common.dart create mode 100644 client/dom/benchmarks/dromaeo/Dromaeo.dart create mode 100644 client/dom/benchmarks/dromaeo/Suites.dart create mode 100644 client/dom/benchmarks/dromaeo/application.css create mode 100644 client/dom/benchmarks/dromaeo/favicon.ico create mode 100644 client/dom/benchmarks/dromaeo/favicon.png create mode 100644 client/dom/benchmarks/dromaeo/images/bg.png create mode 100644 client/dom/benchmarks/dromaeo/images/clouds.png create mode 100644 client/dom/benchmarks/dromaeo/images/clouds2.png create mode 100644 client/dom/benchmarks/dromaeo/images/comets.png create mode 100644 client/dom/benchmarks/dromaeo/images/dino1.png create mode 100644 client/dom/benchmarks/dromaeo/images/dino2.png create mode 100644 client/dom/benchmarks/dromaeo/images/dino3.png create mode 100644 client/dom/benchmarks/dromaeo/images/dino4.png create mode 100644 client/dom/benchmarks/dromaeo/images/dino5.png create mode 100644 client/dom/benchmarks/dromaeo/images/dino6.png create mode 100644 client/dom/benchmarks/dromaeo/images/dino7.png create mode 100644 client/dom/benchmarks/dromaeo/images/dino8.png create mode 100644 client/dom/benchmarks/dromaeo/images/left.png create mode 100644 client/dom/benchmarks/dromaeo/images/logo.png create mode 100644 client/dom/benchmarks/dromaeo/images/logo2.png create mode 100644 client/dom/benchmarks/dromaeo/images/logo3.png create mode 100644 client/dom/benchmarks/dromaeo/images/right.png create mode 100644 client/dom/benchmarks/dromaeo/images/top.png create mode 100644 client/dom/benchmarks/dromaeo/images/water.png create mode 100644 client/dom/benchmarks/dromaeo/index.html create mode 100644 client/dom/benchmarks/dromaeo/reset.css create mode 100644 client/dom/benchmarks/dromaeo/test-head.html create mode 100644 client/dom/benchmarks/dromaeo/test-tail.html create mode 100644 client/dom/benchmarks/dromaeo/tests/Common.dart create mode 100644 client/dom/benchmarks/dromaeo/tests/RunnerSuite.dart create mode 100644 client/dom/benchmarks/dromaeo/tests/dom-attr-dartc.html create mode 100644 client/dom/benchmarks/dromaeo/tests/dom-attr.dart create mode 100644 client/dom/benchmarks/dromaeo/tests/dom-attr.html create mode 100644 client/dom/benchmarks/dromaeo/tests/dom-modify.dart create mode 100644 client/dom/benchmarks/dromaeo/tests/dom-modify.html create mode 100644 client/dom/benchmarks/dromaeo/tests/dom-query.dart create mode 100644 client/dom/benchmarks/dromaeo/tests/dom-query.html create mode 100644 client/dom/benchmarks/dromaeo/tests/dom-traverse.dart create mode 100644 client/dom/benchmarks/dromaeo/tests/dom-traverse.html create mode 100644 client/dom/benchmarks/dromaeo/tests/runner.dart create mode 100644 client/dom/benchmarks/dromaeo/web-style.css create mode 100644 client/dom/codereview.settings create mode 100644 client/dom/dom.dart create mode 100644 client/dom/generated/monkey_dom.js create mode 100644 client/dom/generated/monkey_dom_externs.js create mode 100644 client/dom/generated/src/interface/AbstractWorker.dart create mode 100644 client/dom/generated/src/interface/ArrayBuffer.dart create mode 100644 client/dom/generated/src/interface/ArrayBufferView.dart create mode 100644 client/dom/generated/src/interface/Attr.dart create mode 100644 client/dom/generated/src/interface/BarInfo.dart create mode 100644 client/dom/generated/src/interface/BeforeLoadEvent.dart create mode 100644 client/dom/generated/src/interface/Blob.dart create mode 100644 client/dom/generated/src/interface/CDATASection.dart create mode 100644 client/dom/generated/src/interface/CSSCharsetRule.dart create mode 100644 client/dom/generated/src/interface/CSSFontFaceRule.dart create mode 100644 client/dom/generated/src/interface/CSSImportRule.dart create mode 100644 client/dom/generated/src/interface/CSSMediaRule.dart create mode 100644 client/dom/generated/src/interface/CSSPageRule.dart create mode 100644 client/dom/generated/src/interface/CSSPrimitiveValue.dart create mode 100644 client/dom/generated/src/interface/CSSRule.dart create mode 100644 client/dom/generated/src/interface/CSSRuleList.dart create mode 100644 client/dom/generated/src/interface/CSSStyleDeclaration.dart create mode 100644 client/dom/generated/src/interface/CSSStyleRule.dart create mode 100644 client/dom/generated/src/interface/CSSStyleSheet.dart create mode 100644 client/dom/generated/src/interface/CSSUnknownRule.dart create mode 100644 client/dom/generated/src/interface/CSSValue.dart create mode 100644 client/dom/generated/src/interface/CSSValueList.dart create mode 100644 client/dom/generated/src/interface/CanvasGradient.dart create mode 100644 client/dom/generated/src/interface/CanvasPattern.dart create mode 100644 client/dom/generated/src/interface/CanvasPixelArray.dart create mode 100644 client/dom/generated/src/interface/CanvasRenderingContext.dart create mode 100644 client/dom/generated/src/interface/CanvasRenderingContext2D.dart create mode 100644 client/dom/generated/src/interface/CharacterData.dart create mode 100644 client/dom/generated/src/interface/ClientRect.dart create mode 100644 client/dom/generated/src/interface/ClientRectList.dart create mode 100644 client/dom/generated/src/interface/Clipboard.dart create mode 100644 client/dom/generated/src/interface/CloseEvent.dart create mode 100644 client/dom/generated/src/interface/Comment.dart create mode 100644 client/dom/generated/src/interface/CompositionEvent.dart create mode 100644 client/dom/generated/src/interface/Console.dart create mode 100644 client/dom/generated/src/interface/Coordinates.dart create mode 100644 client/dom/generated/src/interface/Counter.dart create mode 100644 client/dom/generated/src/interface/Crypto.dart create mode 100644 client/dom/generated/src/interface/CustomEvent.dart create mode 100644 client/dom/generated/src/interface/DOMApplicationCache.dart create mode 100644 client/dom/generated/src/interface/DOMException.dart create mode 100644 client/dom/generated/src/interface/DOMFileSystem.dart create mode 100644 client/dom/generated/src/interface/DOMFileSystemSync.dart create mode 100644 client/dom/generated/src/interface/DOMFormData.dart create mode 100644 client/dom/generated/src/interface/DOMImplementation.dart create mode 100644 client/dom/generated/src/interface/DOMMimeType.dart create mode 100644 client/dom/generated/src/interface/DOMMimeTypeArray.dart create mode 100644 client/dom/generated/src/interface/DOMParser.dart create mode 100644 client/dom/generated/src/interface/DOMPlugin.dart create mode 100644 client/dom/generated/src/interface/DOMPluginArray.dart create mode 100644 client/dom/generated/src/interface/DOMSelection.dart create mode 100644 client/dom/generated/src/interface/DOMSettableTokenList.dart create mode 100644 client/dom/generated/src/interface/DOMTokenList.dart create mode 100644 client/dom/generated/src/interface/DOMURL.dart create mode 100644 client/dom/generated/src/interface/DOMWindow.dart create mode 100644 client/dom/generated/src/interface/DataTransferItem.dart create mode 100644 client/dom/generated/src/interface/DataTransferItems.dart create mode 100644 client/dom/generated/src/interface/DataView.dart create mode 100644 client/dom/generated/src/interface/Database.dart create mode 100644 client/dom/generated/src/interface/DatabaseCallback.dart create mode 100644 client/dom/generated/src/interface/DatabaseSync.dart create mode 100644 client/dom/generated/src/interface/DedicatedWorkerContext.dart create mode 100644 client/dom/generated/src/interface/DeviceMotionEvent.dart create mode 100644 client/dom/generated/src/interface/DeviceOrientationEvent.dart create mode 100644 client/dom/generated/src/interface/DirectoryEntry.dart create mode 100644 client/dom/generated/src/interface/DirectoryEntrySync.dart create mode 100644 client/dom/generated/src/interface/DirectoryReader.dart create mode 100644 client/dom/generated/src/interface/DirectoryReaderSync.dart create mode 100644 client/dom/generated/src/interface/Document.dart create mode 100644 client/dom/generated/src/interface/DocumentFragment.dart create mode 100644 client/dom/generated/src/interface/DocumentType.dart create mode 100644 client/dom/generated/src/interface/Element.dart create mode 100644 client/dom/generated/src/interface/ElementTraversal.dart create mode 100644 client/dom/generated/src/interface/Entity.dart create mode 100644 client/dom/generated/src/interface/EntityReference.dart create mode 100644 client/dom/generated/src/interface/EntriesCallback.dart create mode 100644 client/dom/generated/src/interface/Entry.dart create mode 100644 client/dom/generated/src/interface/EntryArray.dart create mode 100644 client/dom/generated/src/interface/EntryArraySync.dart create mode 100644 client/dom/generated/src/interface/EntryCallback.dart create mode 100644 client/dom/generated/src/interface/EntrySync.dart create mode 100644 client/dom/generated/src/interface/ErrorCallback.dart create mode 100644 client/dom/generated/src/interface/ErrorEvent.dart create mode 100644 client/dom/generated/src/interface/Event.dart create mode 100644 client/dom/generated/src/interface/EventException.dart create mode 100644 client/dom/generated/src/interface/EventSource.dart create mode 100644 client/dom/generated/src/interface/EventTarget.dart create mode 100644 client/dom/generated/src/interface/File.dart create mode 100644 client/dom/generated/src/interface/FileCallback.dart create mode 100644 client/dom/generated/src/interface/FileEntry.dart create mode 100644 client/dom/generated/src/interface/FileEntrySync.dart create mode 100644 client/dom/generated/src/interface/FileError.dart create mode 100644 client/dom/generated/src/interface/FileException.dart create mode 100644 client/dom/generated/src/interface/FileList.dart create mode 100644 client/dom/generated/src/interface/FileReader.dart create mode 100644 client/dom/generated/src/interface/FileReaderSync.dart create mode 100644 client/dom/generated/src/interface/FileSystemCallback.dart create mode 100644 client/dom/generated/src/interface/FileWriter.dart create mode 100644 client/dom/generated/src/interface/FileWriterCallback.dart create mode 100644 client/dom/generated/src/interface/FileWriterSync.dart create mode 100644 client/dom/generated/src/interface/Float32Array.dart create mode 100644 client/dom/generated/src/interface/Float64Array.dart create mode 100644 client/dom/generated/src/interface/Geolocation.dart create mode 100644 client/dom/generated/src/interface/Geoposition.dart create mode 100644 client/dom/generated/src/interface/HTMLAllCollection.dart create mode 100644 client/dom/generated/src/interface/HTMLAnchorElement.dart create mode 100644 client/dom/generated/src/interface/HTMLAppletElement.dart create mode 100644 client/dom/generated/src/interface/HTMLAreaElement.dart create mode 100644 client/dom/generated/src/interface/HTMLAudioElement.dart create mode 100644 client/dom/generated/src/interface/HTMLBRElement.dart create mode 100644 client/dom/generated/src/interface/HTMLBaseElement.dart create mode 100644 client/dom/generated/src/interface/HTMLBaseFontElement.dart create mode 100644 client/dom/generated/src/interface/HTMLBodyElement.dart create mode 100644 client/dom/generated/src/interface/HTMLButtonElement.dart create mode 100644 client/dom/generated/src/interface/HTMLCanvasElement.dart create mode 100644 client/dom/generated/src/interface/HTMLCollection.dart create mode 100644 client/dom/generated/src/interface/HTMLDListElement.dart create mode 100644 client/dom/generated/src/interface/HTMLDataListElement.dart create mode 100644 client/dom/generated/src/interface/HTMLDetailsElement.dart create mode 100644 client/dom/generated/src/interface/HTMLDirectoryElement.dart create mode 100644 client/dom/generated/src/interface/HTMLDivElement.dart create mode 100644 client/dom/generated/src/interface/HTMLDocument.dart create mode 100644 client/dom/generated/src/interface/HTMLElement.dart create mode 100644 client/dom/generated/src/interface/HTMLEmbedElement.dart create mode 100644 client/dom/generated/src/interface/HTMLFieldSetElement.dart create mode 100644 client/dom/generated/src/interface/HTMLFontElement.dart create mode 100644 client/dom/generated/src/interface/HTMLFormElement.dart create mode 100644 client/dom/generated/src/interface/HTMLFrameElement.dart create mode 100644 client/dom/generated/src/interface/HTMLFrameSetElement.dart create mode 100644 client/dom/generated/src/interface/HTMLHRElement.dart create mode 100644 client/dom/generated/src/interface/HTMLHeadElement.dart create mode 100644 client/dom/generated/src/interface/HTMLHeadingElement.dart create mode 100644 client/dom/generated/src/interface/HTMLHtmlElement.dart create mode 100644 client/dom/generated/src/interface/HTMLIFrameElement.dart create mode 100644 client/dom/generated/src/interface/HTMLImageElement.dart create mode 100644 client/dom/generated/src/interface/HTMLInputElement.dart create mode 100644 client/dom/generated/src/interface/HTMLIsIndexElement.dart create mode 100644 client/dom/generated/src/interface/HTMLKeygenElement.dart create mode 100644 client/dom/generated/src/interface/HTMLLIElement.dart create mode 100644 client/dom/generated/src/interface/HTMLLabelElement.dart create mode 100644 client/dom/generated/src/interface/HTMLLegendElement.dart create mode 100644 client/dom/generated/src/interface/HTMLLinkElement.dart create mode 100644 client/dom/generated/src/interface/HTMLMapElement.dart create mode 100644 client/dom/generated/src/interface/HTMLMarqueeElement.dart create mode 100644 client/dom/generated/src/interface/HTMLMediaElement.dart create mode 100644 client/dom/generated/src/interface/HTMLMenuElement.dart create mode 100644 client/dom/generated/src/interface/HTMLMetaElement.dart create mode 100644 client/dom/generated/src/interface/HTMLMeterElement.dart create mode 100644 client/dom/generated/src/interface/HTMLModElement.dart create mode 100644 client/dom/generated/src/interface/HTMLOListElement.dart create mode 100644 client/dom/generated/src/interface/HTMLObjectElement.dart create mode 100644 client/dom/generated/src/interface/HTMLOptGroupElement.dart create mode 100644 client/dom/generated/src/interface/HTMLOptionElement.dart create mode 100644 client/dom/generated/src/interface/HTMLOptionsCollection.dart create mode 100644 client/dom/generated/src/interface/HTMLOutputElement.dart create mode 100644 client/dom/generated/src/interface/HTMLParagraphElement.dart create mode 100644 client/dom/generated/src/interface/HTMLParamElement.dart create mode 100644 client/dom/generated/src/interface/HTMLPreElement.dart create mode 100644 client/dom/generated/src/interface/HTMLProgressElement.dart create mode 100644 client/dom/generated/src/interface/HTMLQuoteElement.dart create mode 100644 client/dom/generated/src/interface/HTMLScriptElement.dart create mode 100644 client/dom/generated/src/interface/HTMLSelectElement.dart create mode 100644 client/dom/generated/src/interface/HTMLSourceElement.dart create mode 100644 client/dom/generated/src/interface/HTMLSpanElement.dart create mode 100644 client/dom/generated/src/interface/HTMLStyleElement.dart create mode 100644 client/dom/generated/src/interface/HTMLTableCaptionElement.dart create mode 100644 client/dom/generated/src/interface/HTMLTableCellElement.dart create mode 100644 client/dom/generated/src/interface/HTMLTableColElement.dart create mode 100644 client/dom/generated/src/interface/HTMLTableElement.dart create mode 100644 client/dom/generated/src/interface/HTMLTableRowElement.dart create mode 100644 client/dom/generated/src/interface/HTMLTableSectionElement.dart create mode 100644 client/dom/generated/src/interface/HTMLTextAreaElement.dart create mode 100644 client/dom/generated/src/interface/HTMLTitleElement.dart create mode 100644 client/dom/generated/src/interface/HTMLTrackElement.dart create mode 100644 client/dom/generated/src/interface/HTMLUListElement.dart create mode 100644 client/dom/generated/src/interface/HTMLUnknownElement.dart create mode 100644 client/dom/generated/src/interface/HTMLVideoElement.dart create mode 100644 client/dom/generated/src/interface/HashChangeEvent.dart create mode 100644 client/dom/generated/src/interface/History.dart create mode 100644 client/dom/generated/src/interface/IDBAny.dart create mode 100644 client/dom/generated/src/interface/IDBCursor.dart create mode 100644 client/dom/generated/src/interface/IDBCursorWithValue.dart create mode 100644 client/dom/generated/src/interface/IDBDatabase.dart create mode 100644 client/dom/generated/src/interface/IDBDatabaseError.dart create mode 100644 client/dom/generated/src/interface/IDBDatabaseException.dart create mode 100644 client/dom/generated/src/interface/IDBFactory.dart create mode 100644 client/dom/generated/src/interface/IDBIndex.dart create mode 100644 client/dom/generated/src/interface/IDBKey.dart create mode 100644 client/dom/generated/src/interface/IDBKeyRange.dart create mode 100644 client/dom/generated/src/interface/IDBObjectStore.dart create mode 100644 client/dom/generated/src/interface/IDBRequest.dart create mode 100644 client/dom/generated/src/interface/IDBTransaction.dart create mode 100644 client/dom/generated/src/interface/IDBVersionChangeEvent.dart create mode 100644 client/dom/generated/src/interface/IDBVersionChangeRequest.dart create mode 100644 client/dom/generated/src/interface/ImageData.dart create mode 100644 client/dom/generated/src/interface/InjectedScriptHost.dart create mode 100644 client/dom/generated/src/interface/InspectorFrontendHost.dart create mode 100644 client/dom/generated/src/interface/Int16Array.dart create mode 100644 client/dom/generated/src/interface/Int32Array.dart create mode 100644 client/dom/generated/src/interface/Int8Array.dart create mode 100644 client/dom/generated/src/interface/JavaScriptCallFrame.dart create mode 100644 client/dom/generated/src/interface/KeyboardEvent.dart create mode 100644 client/dom/generated/src/interface/LocalMediaStream.dart create mode 100644 client/dom/generated/src/interface/Location.dart create mode 100644 client/dom/generated/src/interface/MediaError.dart create mode 100644 client/dom/generated/src/interface/MediaList.dart create mode 100644 client/dom/generated/src/interface/MediaQueryList.dart create mode 100644 client/dom/generated/src/interface/MediaQueryListListener.dart create mode 100644 client/dom/generated/src/interface/MediaStream.dart create mode 100644 client/dom/generated/src/interface/MediaStreamList.dart create mode 100644 client/dom/generated/src/interface/MediaStreamTrack.dart create mode 100644 client/dom/generated/src/interface/MediaStreamTrackList.dart create mode 100644 client/dom/generated/src/interface/MemoryInfo.dart create mode 100644 client/dom/generated/src/interface/MessageChannel.dart create mode 100644 client/dom/generated/src/interface/MessageEvent.dart create mode 100644 client/dom/generated/src/interface/MessagePort.dart create mode 100644 client/dom/generated/src/interface/Metadata.dart create mode 100644 client/dom/generated/src/interface/MetadataCallback.dart create mode 100644 client/dom/generated/src/interface/MouseEvent.dart create mode 100644 client/dom/generated/src/interface/MutationEvent.dart create mode 100644 client/dom/generated/src/interface/MutationRecord.dart create mode 100644 client/dom/generated/src/interface/NamedNodeMap.dart create mode 100644 client/dom/generated/src/interface/Navigator.dart create mode 100644 client/dom/generated/src/interface/NavigatorUserMediaError.dart create mode 100644 client/dom/generated/src/interface/NavigatorUserMediaErrorCallback.dart create mode 100644 client/dom/generated/src/interface/NavigatorUserMediaSuccessCallback.dart create mode 100644 client/dom/generated/src/interface/Node.dart create mode 100644 client/dom/generated/src/interface/NodeFilter.dart create mode 100644 client/dom/generated/src/interface/NodeIterator.dart create mode 100644 client/dom/generated/src/interface/NodeList.dart create mode 100644 client/dom/generated/src/interface/NodeSelector.dart create mode 100644 client/dom/generated/src/interface/Notation.dart create mode 100644 client/dom/generated/src/interface/Notification.dart create mode 100644 client/dom/generated/src/interface/NotificationCenter.dart create mode 100644 client/dom/generated/src/interface/OESStandardDerivatives.dart create mode 100644 client/dom/generated/src/interface/OESTextureFloat.dart create mode 100644 client/dom/generated/src/interface/OESVertexArrayObject.dart create mode 100644 client/dom/generated/src/interface/OperationNotAllowedException.dart create mode 100644 client/dom/generated/src/interface/OverflowEvent.dart create mode 100644 client/dom/generated/src/interface/PageTransitionEvent.dart create mode 100644 client/dom/generated/src/interface/Performance.dart create mode 100644 client/dom/generated/src/interface/PerformanceNavigation.dart create mode 100644 client/dom/generated/src/interface/PerformanceTiming.dart create mode 100644 client/dom/generated/src/interface/PopStateEvent.dart create mode 100644 client/dom/generated/src/interface/PositionCallback.dart create mode 100644 client/dom/generated/src/interface/PositionError.dart create mode 100644 client/dom/generated/src/interface/PositionErrorCallback.dart create mode 100644 client/dom/generated/src/interface/ProcessingInstruction.dart create mode 100644 client/dom/generated/src/interface/ProgressEvent.dart create mode 100644 client/dom/generated/src/interface/RGBColor.dart create mode 100644 client/dom/generated/src/interface/Range.dart create mode 100644 client/dom/generated/src/interface/RangeException.dart create mode 100644 client/dom/generated/src/interface/Rect.dart create mode 100644 client/dom/generated/src/interface/SQLError.dart create mode 100644 client/dom/generated/src/interface/SQLException.dart create mode 100644 client/dom/generated/src/interface/SQLResultSet.dart create mode 100644 client/dom/generated/src/interface/SQLResultSetRowList.dart create mode 100644 client/dom/generated/src/interface/SQLStatementCallback.dart create mode 100644 client/dom/generated/src/interface/SQLStatementErrorCallback.dart create mode 100644 client/dom/generated/src/interface/SQLTransaction.dart create mode 100644 client/dom/generated/src/interface/SQLTransactionCallback.dart create mode 100644 client/dom/generated/src/interface/SQLTransactionErrorCallback.dart create mode 100644 client/dom/generated/src/interface/SQLTransactionSync.dart create mode 100644 client/dom/generated/src/interface/SQLTransactionSyncCallback.dart create mode 100644 client/dom/generated/src/interface/Screen.dart create mode 100644 client/dom/generated/src/interface/ScriptProfile.dart create mode 100644 client/dom/generated/src/interface/ScriptProfileNode.dart create mode 100644 client/dom/generated/src/interface/SharedWorker.dart create mode 100644 client/dom/generated/src/interface/SharedWorkercontext.dart create mode 100644 client/dom/generated/src/interface/SpeechInputEvent.dart create mode 100644 client/dom/generated/src/interface/SpeechInputResult.dart create mode 100644 client/dom/generated/src/interface/SpeechInputResultList.dart create mode 100644 client/dom/generated/src/interface/Storage.dart create mode 100644 client/dom/generated/src/interface/StorageEvent.dart create mode 100644 client/dom/generated/src/interface/StorageInfo.dart create mode 100644 client/dom/generated/src/interface/StorageInfoErrorCallback.dart create mode 100644 client/dom/generated/src/interface/StorageInfoQuotaCallback.dart create mode 100644 client/dom/generated/src/interface/StorageInfoUsageCallback.dart create mode 100644 client/dom/generated/src/interface/StringCallback.dart create mode 100644 client/dom/generated/src/interface/StyleMedia.dart create mode 100644 client/dom/generated/src/interface/StyleSheet.dart create mode 100644 client/dom/generated/src/interface/StyleSheetList.dart create mode 100644 client/dom/generated/src/interface/Text.dart create mode 100644 client/dom/generated/src/interface/TextEvent.dart create mode 100644 client/dom/generated/src/interface/TextMetrics.dart create mode 100644 client/dom/generated/src/interface/TimeRanges.dart create mode 100644 client/dom/generated/src/interface/Touch.dart create mode 100644 client/dom/generated/src/interface/TouchEvent.dart create mode 100644 client/dom/generated/src/interface/TouchList.dart create mode 100644 client/dom/generated/src/interface/TreeWalker.dart create mode 100644 client/dom/generated/src/interface/UIEvent.dart create mode 100644 client/dom/generated/src/interface/Uint16Array.dart create mode 100644 client/dom/generated/src/interface/Uint32Array.dart create mode 100644 client/dom/generated/src/interface/Uint8Array.dart create mode 100644 client/dom/generated/src/interface/ValidityState.dart create mode 100644 client/dom/generated/src/interface/VoidCallback.dart create mode 100644 client/dom/generated/src/interface/WebGLActiveInfo.dart create mode 100644 client/dom/generated/src/interface/WebGLBuffer.dart create mode 100644 client/dom/generated/src/interface/WebGLContextAttributes.dart create mode 100644 client/dom/generated/src/interface/WebGLContextEvent.dart create mode 100644 client/dom/generated/src/interface/WebGLFramebuffer.dart create mode 100644 client/dom/generated/src/interface/WebGLProgram.dart create mode 100644 client/dom/generated/src/interface/WebGLRenderbuffer.dart create mode 100644 client/dom/generated/src/interface/WebGLRenderingContext.dart create mode 100644 client/dom/generated/src/interface/WebGLShader.dart create mode 100644 client/dom/generated/src/interface/WebGLTexture.dart create mode 100644 client/dom/generated/src/interface/WebGLUniformLocation.dart create mode 100644 client/dom/generated/src/interface/WebGLVertexArrayObjectOES.dart create mode 100644 client/dom/generated/src/interface/WebKitAnimation.dart create mode 100644 client/dom/generated/src/interface/WebKitAnimationEvent.dart create mode 100644 client/dom/generated/src/interface/WebKitAnimationList.dart create mode 100644 client/dom/generated/src/interface/WebKitBlobBuilder.dart create mode 100644 client/dom/generated/src/interface/WebKitCSSKeyframeRule.dart create mode 100644 client/dom/generated/src/interface/WebKitCSSKeyframesRule.dart create mode 100644 client/dom/generated/src/interface/WebKitCSSMatrix.dart create mode 100644 client/dom/generated/src/interface/WebKitCSSTransformValue.dart create mode 100644 client/dom/generated/src/interface/WebKitFlags.dart create mode 100644 client/dom/generated/src/interface/WebKitLoseContext.dart create mode 100644 client/dom/generated/src/interface/WebKitPoint.dart create mode 100644 client/dom/generated/src/interface/WebKitTransitionEvent.dart create mode 100644 client/dom/generated/src/interface/WebSocket.dart create mode 100644 client/dom/generated/src/interface/WheelEvent.dart create mode 100644 client/dom/generated/src/interface/Worker.dart create mode 100644 client/dom/generated/src/interface/WorkerContext.dart create mode 100644 client/dom/generated/src/interface/WorkerLocation.dart create mode 100644 client/dom/generated/src/interface/WorkerNavigator.dart create mode 100644 client/dom/generated/src/interface/XMLHttpRequest.dart create mode 100644 client/dom/generated/src/interface/XMLHttpRequestException.dart create mode 100644 client/dom/generated/src/interface/XMLHttpRequestProgressEvent.dart create mode 100644 client/dom/generated/src/interface/XMLHttpRequestUpload.dart create mode 100644 client/dom/generated/src/interface/XMLSerializer.dart create mode 100644 client/dom/generated/src/interface/XPathEvaluator.dart create mode 100644 client/dom/generated/src/interface/XPathException.dart create mode 100644 client/dom/generated/src/interface/XPathExpression.dart create mode 100644 client/dom/generated/src/interface/XPathNSResolver.dart create mode 100644 client/dom/generated/src/interface/XPathResult.dart create mode 100644 client/dom/generated/src/interface/XSLTProcessor.dart create mode 100644 client/dom/generated/src/wrapping/_AbstractWorkerWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ArrayBufferViewWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ArrayBufferWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_AttrWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_BarInfoWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_BeforeLoadEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_BlobWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CDATASectionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSCharsetRuleWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSFontFaceRuleWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSImportRuleWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSMediaRuleWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSPageRuleWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSPrimitiveValueWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSRuleListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSRuleWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSStyleDeclarationWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSStyleRuleWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSStyleSheetWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSUnknownRuleWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSValueListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CSSValueWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CanvasGradientWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CanvasPatternWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CanvasPixelArrayWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CanvasRenderingContext2DWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CanvasRenderingContextWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CharacterDataWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ClientRectListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ClientRectWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ClipboardWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CloseEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CommentWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CompositionEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ConsoleWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CoordinatesWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CounterWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CryptoWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_CustomEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMApplicationCacheWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMExceptionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMFileSystemSyncWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMFileSystemWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMFormDataWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMImplementationWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMMimeTypeArrayWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMMimeTypeWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMParserWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMPluginArrayWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMPluginWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMSelectionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMSettableTokenListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMTokenListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMURLWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DOMWindowWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DataTransferItemWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DataTransferItemsWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DataViewWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DatabaseCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DatabaseSyncWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DatabaseWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DedicatedWorkerContextWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DeviceMotionEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DeviceOrientationEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DirectoryEntrySyncWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DirectoryEntryWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DirectoryReaderSyncWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DirectoryReaderWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DocumentFragmentWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DocumentTypeWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_DocumentWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ElementTraversalWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_EntityReferenceWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_EntityWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_EntriesCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_EntryArraySyncWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_EntryArrayWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_EntryCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_EntrySyncWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_EntryWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ErrorCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ErrorEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_EventExceptionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_EventSourceWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_EventTargetWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_EventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileEntrySyncWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileEntryWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileErrorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileExceptionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileReaderSyncWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileReaderWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileSystemCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileWriterCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileWriterSyncWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_FileWriterWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_Float32ArrayWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_Float64ArrayWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_GeolocationWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_GeopositionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLAllCollectionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLAnchorElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLAppletElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLAreaElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLAudioElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLBRElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLBaseElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLBaseFontElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLBodyElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLButtonElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLCanvasElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLCollectionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLDListElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLDataListElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLDetailsElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLDirectoryElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLDivElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLDocumentWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLEmbedElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLFieldSetElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLFontElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLFormElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLFrameElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLFrameSetElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLHRElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLHeadElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLHeadingElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLHtmlElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLIFrameElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLImageElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLInputElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLIsIndexElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLKeygenElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLLIElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLLabelElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLLegendElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLLinkElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLMapElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLMarqueeElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLMediaElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLMenuElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLMetaElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLMeterElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLModElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLOListElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLObjectElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLOptGroupElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLOptionElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLOptionsCollectionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLOutputElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLParagraphElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLParamElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLPreElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLProgressElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLQuoteElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLScriptElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLSelectElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLSourceElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLSpanElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLStyleElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLTableCaptionElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLTableCellElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLTableColElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLTableElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLTableRowElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLTableSectionElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLTextAreaElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLTitleElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLTrackElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLUListElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLUnknownElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HTMLVideoElementWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HashChangeEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_HistoryWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBAnyWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBCursorWithValueWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBCursorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBDatabaseErrorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBDatabaseExceptionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBDatabaseWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBFactoryWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBIndexWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBKeyRangeWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBKeyWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBObjectStoreWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBRequestWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBTransactionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBVersionChangeEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_IDBVersionChangeRequestWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ImageDataWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_InjectedScriptHostWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_InspectorFrontendHostWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_Int16ArrayWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_Int32ArrayWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_Int8ArrayWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_JavaScriptCallFrameWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_KeyboardEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_LocalMediaStreamWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_LocationWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MediaErrorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MediaListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MediaQueryListListenerWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MediaQueryListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MediaStreamListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MediaStreamTrackListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MediaStreamTrackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MediaStreamWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MemoryInfoWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MessageChannelWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MessageEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MessagePortWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MetadataCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MetadataWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MouseEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MutationEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_MutationRecordWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NamedNodeMapWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NavigatorUserMediaErrorCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NavigatorUserMediaErrorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NavigatorUserMediaSuccessCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NavigatorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NodeFilterWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NodeIteratorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NodeListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NodeSelectorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NodeWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NotationWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NotificationCenterWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_NotificationWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_OESStandardDerivativesWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_OESTextureFloatWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_OESVertexArrayObjectWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_OperationNotAllowedExceptionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_OverflowEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_PageTransitionEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_PerformanceNavigationWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_PerformanceTimingWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_PerformanceWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_PopStateEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_PositionCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_PositionErrorCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_PositionErrorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ProcessingInstructionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ProgressEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_RGBColorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_RangeExceptionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_RangeWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_RectWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SQLErrorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SQLExceptionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SQLResultSetRowListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SQLResultSetWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SQLStatementCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SQLStatementErrorCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SQLTransactionCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SQLTransactionErrorCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SQLTransactionSyncCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SQLTransactionSyncWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SQLTransactionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ScreenWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ScriptProfileNodeWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ScriptProfileWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SharedWorkerWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SharedWorkercontextWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SpeechInputEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SpeechInputResultListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_SpeechInputResultWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_StorageEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_StorageInfoErrorCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_StorageInfoQuotaCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_StorageInfoUsageCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_StorageInfoWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_StorageWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_StringCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_StyleMediaWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_StyleSheetListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_StyleSheetWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_TextEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_TextMetricsWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_TextWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_TimeRangesWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_TouchEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_TouchListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_TouchWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_TreeWalkerWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_UIEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_Uint16ArrayWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_Uint32ArrayWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_Uint8ArrayWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_ValidityStateWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_VoidCallbackWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebGLActiveInfoWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebGLBufferWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebGLContextAttributesWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebGLContextEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebGLFramebufferWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebGLProgramWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebGLRenderbufferWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebGLRenderingContextWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebGLShaderWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebGLTextureWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebGLUniformLocationWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebGLVertexArrayObjectOESWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebKitAnimationEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebKitAnimationListWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebKitAnimationWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebKitBlobBuilderWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebKitCSSKeyframeRuleWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebKitCSSKeyframesRuleWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebKitCSSMatrixWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebKitCSSTransformValueWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebKitFlagsWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebKitLoseContextWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebKitPointWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebKitTransitionEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WebSocketWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WheelEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WorkerContextWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WorkerLocationWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WorkerNavigatorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_WorkerWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_XMLHttpRequestExceptionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_XMLHttpRequestProgressEventWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_XMLHttpRequestUploadWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_XMLHttpRequestWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_XMLSerializerWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_XPathEvaluatorWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_XPathExceptionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_XPathExpressionWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_XPathNSResolverWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_XPathResultWrappingImplementation.dart create mode 100644 client/dom/generated/src/wrapping/_XSLTProcessorWrappingImplementation.dart create mode 100644 client/dom/generated/wrapping_dom.js create mode 100644 client/dom/generated/wrapping_dom_externs.js create mode 100644 client/dom/idl/dart/dart.idl create mode 100644 client/dom/idl/dart/webkit-supplemental.idl create mode 100644 client/dom/monkey_dom.dart.broken create mode 100755 client/dom/scripts/all_tests.py create mode 100755 client/dom/scripts/dartdomgenerator.py create mode 100755 client/dom/scripts/dartgenerator.py create mode 100755 client/dom/scripts/dartgenerator_test.py create mode 100755 client/dom/scripts/dartrenderer.py create mode 100755 client/dom/scripts/dartrenderer_test.py create mode 100755 client/dom/scripts/database.py create mode 100755 client/dom/scripts/database_test.py create mode 100755 client/dom/scripts/databasebuilder.py create mode 100755 client/dom/scripts/databasebuilder_test.py create mode 100755 client/dom/scripts/emitter.py create mode 100755 client/dom/scripts/emitter_test.py create mode 100755 client/dom/scripts/fremontcutbuilder.py create mode 100755 client/dom/scripts/idlnode.py create mode 100755 client/dom/scripts/idlnode_test.py create mode 100755 client/dom/scripts/idlparser.py create mode 100755 client/dom/scripts/idlparser_test.py create mode 100755 client/dom/scripts/idlrenderer.py create mode 100755 client/dom/scripts/idlrenderer_test.py create mode 100644 client/dom/scripts/logging.conf create mode 100644 client/dom/scripts/multiemitter.py create mode 100644 client/dom/scripts/multiemitter_test.py create mode 100755 client/dom/scripts/pegparser.py create mode 100755 client/dom/scripts/pegparser_test.py create mode 100755 client/dom/scripts/snippet_manager.py create mode 100644 client/dom/scripts/template_html.darttemplate create mode 100644 client/dom/scripts/template_interface.darttemplate create mode 100644 client/dom/scripts/template_interface_FileReader.darttemplate create mode 100644 client/dom/scripts/template_interface_WebKitCSSMatrix.darttemplate create mode 100644 client/dom/scripts/template_interface_WebKitPoint.darttemplate create mode 100644 client/dom/scripts/template_interface_XMLHttpRequest.darttemplate create mode 100644 client/dom/scripts/template_monkey_dom.darttemplate create mode 100644 client/dom/scripts/template_monkey_dom.js create mode 100644 client/dom/scripts/template_monkey_dom_externs.js create mode 100644 client/dom/scripts/template_wrapping_dom.darttemplate create mode 100644 client/dom/scripts/template_wrapping_dom.js create mode 100644 client/dom/scripts/template_wrapping_dom_externs.js create mode 100644 client/dom/scripts/template_wrapping_impl.darttemplate create mode 100644 client/dom/snippets/events/EventTargetImpl.dart.snippet create mode 100644 client/dom/snippets/events/KeyboardEvent.dart.snippet create mode 100644 client/dom/snippets/html/HTMLDocument.dart.snippet create mode 100644 client/dom/snippets/html/WindowImpl.dart.snippet create mode 100644 client/dom/src/DOMType.dart create mode 100644 client/dom/src/DOMWrapperBase.dart create mode 100644 client/dom/src/EventListener.dart create mode 100644 client/dom/src/GlobalProperties.dart create mode 100644 client/dom/src/RequestAnimationFrameCallback.dart create mode 100644 client/dom/src/TimeoutHandler.dart create mode 100644 client/dom/src/_Collections.dart create mode 100644 client/dom/src/_FactoryProviders.dart create mode 100644 client/dom/src/_ListIterators.dart create mode 100644 client/dom/src/_Lists.dart create mode 100644 client/dom/wrapping_dom.dart create mode 100644 client/fling/README.txt create mode 100644 client/fling/build.xml create mode 100755 client/fling/dist/fling create mode 100644 client/fling/dist/runtime/apps/adminz/adminz.dart create mode 100644 client/fling/dist/runtime/logback.xml create mode 100644 client/fling/eclipse/classpath create mode 100644 client/fling/eclipse/project create mode 100644 client/fling/eclipse/settings/org.eclipse.jdt.core.prefs create mode 100644 client/fling/fling.dart create mode 100644 client/fling/fling.gypi create mode 100644 client/fling/samples/lil_server.dart create mode 100644 client/fling/samples/static/index.html create mode 100644 client/fling/samples/static/lil_client.dart create mode 100644 client/fling/samples/static/lil_client.js create mode 100644 client/fling/samples/two_servers.dart create mode 100644 client/fling/src/dart/fling.dart create mode 100644 client/fling/src/dart/fling.js create mode 100644 client/fling/src/java/core/com/google/dart/CompileError.java create mode 100644 client/fling/src/java/core/com/google/dart/CompileResult.java create mode 100644 client/fling/src/java/core/com/google/dart/CompileService.java create mode 100644 client/fling/src/java/core/com/google/dart/LibraryFromSources.java create mode 100644 client/fling/src/java/core/com/google/dart/SourceFromString.java create mode 100644 client/fling/src/java/core/com/google/dart/fling/Environment.java create mode 100644 client/fling/src/java/core/com/google/dart/fling/Fling.java create mode 100644 client/fling/src/java/core/com/google/dart/fling/Http.java create mode 100644 client/fling/src/java/core/com/google/dart/fling/MessageLoop.java create mode 100644 client/fling/src/java/core/com/google/dart/fling/PrefixTree.java create mode 100644 client/fling/src/java/core/com/google/dart/fling/RhinoUtil.java create mode 100644 client/fling/src/java/test/com/google/dart/fling/MessageLoopTest.java create mode 100644 client/html/benchmarks/common/BenchUtil.dart create mode 100644 client/html/benchmarks/common/Interval.dart create mode 100644 client/html/benchmarks/common/JSON.dart create mode 100644 client/html/benchmarks/common/Math2.dart create mode 100644 client/html/benchmarks/common/common.lib create mode 100644 client/html/benchmarks/dromaeo/Dromaeo.dart create mode 100644 client/html/benchmarks/dromaeo/Suites.dart create mode 100644 client/html/benchmarks/dromaeo/application.css create mode 100644 client/html/benchmarks/dromaeo/dromaeo.app create mode 100644 client/html/benchmarks/dromaeo/favicon.ico create mode 100644 client/html/benchmarks/dromaeo/favicon.png create mode 100644 client/html/benchmarks/dromaeo/images/bg.png create mode 100644 client/html/benchmarks/dromaeo/images/clouds.png create mode 100644 client/html/benchmarks/dromaeo/images/clouds2.png create mode 100644 client/html/benchmarks/dromaeo/images/comets.png create mode 100644 client/html/benchmarks/dromaeo/images/dino1.png create mode 100644 client/html/benchmarks/dromaeo/images/dino2.png create mode 100644 client/html/benchmarks/dromaeo/images/dino3.png create mode 100644 client/html/benchmarks/dromaeo/images/dino4.png create mode 100644 client/html/benchmarks/dromaeo/images/dino5.png create mode 100644 client/html/benchmarks/dromaeo/images/dino6.png create mode 100644 client/html/benchmarks/dromaeo/images/dino7.png create mode 100644 client/html/benchmarks/dromaeo/images/dino8.png create mode 100644 client/html/benchmarks/dromaeo/images/left.png create mode 100644 client/html/benchmarks/dromaeo/images/logo.png create mode 100644 client/html/benchmarks/dromaeo/images/logo2.png create mode 100644 client/html/benchmarks/dromaeo/images/logo3.png create mode 100644 client/html/benchmarks/dromaeo/images/right.png create mode 100644 client/html/benchmarks/dromaeo/images/top.png create mode 100644 client/html/benchmarks/dromaeo/images/water.png create mode 100644 client/html/benchmarks/dromaeo/index.html create mode 100644 client/html/benchmarks/dromaeo/reset.css create mode 100644 client/html/benchmarks/dromaeo/test-head.html create mode 100644 client/html/benchmarks/dromaeo/test-tail.html create mode 100644 client/html/benchmarks/dromaeo/tests/Common.dart create mode 100644 client/html/benchmarks/dromaeo/tests/DomAttr.dart create mode 100644 client/html/benchmarks/dromaeo/tests/DomModify.dart create mode 100644 client/html/benchmarks/dromaeo/tests/DomQuery.dart create mode 100644 client/html/benchmarks/dromaeo/tests/DomTraverse.dart create mode 100644 client/html/benchmarks/dromaeo/tests/Runner.dart create mode 100644 client/html/benchmarks/dromaeo/tests/dom-attr-dartc.html create mode 100644 client/html/benchmarks/dromaeo/tests/dom-attr.app create mode 100644 client/html/benchmarks/dromaeo/tests/dom-attr.html create mode 100644 client/html/benchmarks/dromaeo/tests/dom-modify.app create mode 100644 client/html/benchmarks/dromaeo/tests/dom-modify.html create mode 100644 client/html/benchmarks/dromaeo/tests/dom-query.app create mode 100644 client/html/benchmarks/dromaeo/tests/dom-query.html create mode 100644 client/html/benchmarks/dromaeo/tests/dom-traverse.app create mode 100644 client/html/benchmarks/dromaeo/tests/dom-traverse.html create mode 100644 client/html/benchmarks/dromaeo/tests/runner.lib create mode 100644 client/html/benchmarks/dromaeo/web-style.css create mode 100644 client/html/bootstrap_hacks.dart create mode 100644 client/html/generated/src/interface/AnchorElement.dart create mode 100644 client/html/generated/src/interface/Animation.dart create mode 100644 client/html/generated/src/interface/AnimationEvent.dart create mode 100644 client/html/generated/src/interface/AnimationList.dart create mode 100644 client/html/generated/src/interface/AreaElement.dart create mode 100644 client/html/generated/src/interface/ArrayBuffer.dart create mode 100644 client/html/generated/src/interface/ArrayBufferView.dart create mode 100644 client/html/generated/src/interface/AudioElement.dart create mode 100644 client/html/generated/src/interface/BRElement.dart create mode 100644 client/html/generated/src/interface/BarInfo.dart create mode 100644 client/html/generated/src/interface/BaseElement.dart create mode 100644 client/html/generated/src/interface/BeforeLoadEvent.dart create mode 100644 client/html/generated/src/interface/BeforeProcessEvent.dart create mode 100644 client/html/generated/src/interface/Blob.dart create mode 100644 client/html/generated/src/interface/BlobBuilder.dart create mode 100644 client/html/generated/src/interface/BlockquoteElement.dart create mode 100644 client/html/generated/src/interface/ButtonElement.dart create mode 100644 client/html/generated/src/interface/CDATASection.dart create mode 100644 client/html/generated/src/interface/CSSCharsetRule.dart create mode 100644 client/html/generated/src/interface/CSSFontFaceRule.dart create mode 100644 client/html/generated/src/interface/CSSImportRule.dart create mode 100644 client/html/generated/src/interface/CSSKeyframeRule.dart create mode 100644 client/html/generated/src/interface/CSSKeyframesRule.dart create mode 100644 client/html/generated/src/interface/CSSMatrix.dart create mode 100644 client/html/generated/src/interface/CSSMediaRule.dart create mode 100644 client/html/generated/src/interface/CSSPageRule.dart create mode 100644 client/html/generated/src/interface/CSSPrimitiveValue.dart create mode 100644 client/html/generated/src/interface/CSSRule.dart create mode 100644 client/html/generated/src/interface/CSSRuleList.dart create mode 100644 client/html/generated/src/interface/CSSStyleRule.dart create mode 100644 client/html/generated/src/interface/CSSStyleSheet.dart create mode 100644 client/html/generated/src/interface/CSSTransformValue.dart create mode 100644 client/html/generated/src/interface/CSSUnknownRule.dart create mode 100644 client/html/generated/src/interface/CSSValue.dart create mode 100644 client/html/generated/src/interface/CSSValueList.dart create mode 100644 client/html/generated/src/interface/CanvasElement.dart create mode 100644 client/html/generated/src/interface/CanvasGradient.dart create mode 100644 client/html/generated/src/interface/CanvasPattern.dart create mode 100644 client/html/generated/src/interface/CanvasPixelArray.dart create mode 100644 client/html/generated/src/interface/CanvasRenderingContext.dart create mode 100644 client/html/generated/src/interface/CanvasRenderingContext2D.dart create mode 100644 client/html/generated/src/interface/CharacterData.dart create mode 100644 client/html/generated/src/interface/ClientRect.dart create mode 100644 client/html/generated/src/interface/ClientRectList.dart create mode 100644 client/html/generated/src/interface/Clipboard.dart create mode 100644 client/html/generated/src/interface/CloseEvent.dart create mode 100644 client/html/generated/src/interface/Comment.dart create mode 100644 client/html/generated/src/interface/CompositionEvent.dart create mode 100644 client/html/generated/src/interface/Console.dart create mode 100644 client/html/generated/src/interface/Coordinates.dart create mode 100644 client/html/generated/src/interface/Counter.dart create mode 100644 client/html/generated/src/interface/Crypto.dart create mode 100644 client/html/generated/src/interface/CustomEvent.dart create mode 100644 client/html/generated/src/interface/DListElement.dart create mode 100644 client/html/generated/src/interface/DOMException.dart create mode 100644 client/html/generated/src/interface/DOMFileSystem.dart create mode 100644 client/html/generated/src/interface/DOMFileSystemSync.dart create mode 100644 client/html/generated/src/interface/DOMFormData.dart create mode 100644 client/html/generated/src/interface/DOMMimeType.dart create mode 100644 client/html/generated/src/interface/DOMMimeTypeArray.dart create mode 100644 client/html/generated/src/interface/DOMParser.dart create mode 100644 client/html/generated/src/interface/DOMPlugin.dart create mode 100644 client/html/generated/src/interface/DOMPluginArray.dart create mode 100644 client/html/generated/src/interface/DOMSelection.dart create mode 100644 client/html/generated/src/interface/DOMSettableTokenList.dart create mode 100644 client/html/generated/src/interface/DOMTokenList.dart create mode 100644 client/html/generated/src/interface/DOMURL.dart create mode 100644 client/html/generated/src/interface/DataListElement.dart create mode 100644 client/html/generated/src/interface/DataTransferItem.dart create mode 100644 client/html/generated/src/interface/DataTransferItems.dart create mode 100644 client/html/generated/src/interface/DataView.dart create mode 100644 client/html/generated/src/interface/DetailsElement.dart create mode 100644 client/html/generated/src/interface/DeviceMotionEvent.dart create mode 100644 client/html/generated/src/interface/DeviceOrientationEvent.dart create mode 100644 client/html/generated/src/interface/DirectoryEntry.dart create mode 100644 client/html/generated/src/interface/DirectoryEntrySync.dart create mode 100644 client/html/generated/src/interface/DirectoryReader.dart create mode 100644 client/html/generated/src/interface/DirectoryReaderSync.dart create mode 100644 client/html/generated/src/interface/DivElement.dart create mode 100644 client/html/generated/src/interface/EmbedElement.dart create mode 100644 client/html/generated/src/interface/Entity.dart create mode 100644 client/html/generated/src/interface/EntityReference.dart create mode 100644 client/html/generated/src/interface/EntriesCallback.dart create mode 100644 client/html/generated/src/interface/Entry.dart create mode 100644 client/html/generated/src/interface/EntryArray.dart create mode 100644 client/html/generated/src/interface/EntryArraySync.dart create mode 100644 client/html/generated/src/interface/EntryCallback.dart create mode 100644 client/html/generated/src/interface/EntrySync.dart create mode 100644 client/html/generated/src/interface/ErrorCallback.dart create mode 100644 client/html/generated/src/interface/ErrorEvent.dart create mode 100644 client/html/generated/src/interface/Event.dart create mode 100644 client/html/generated/src/interface/EventException.dart create mode 100644 client/html/generated/src/interface/FieldSetElement.dart create mode 100644 client/html/generated/src/interface/File.dart create mode 100644 client/html/generated/src/interface/FileCallback.dart create mode 100644 client/html/generated/src/interface/FileEntry.dart create mode 100644 client/html/generated/src/interface/FileEntrySync.dart create mode 100644 client/html/generated/src/interface/FileError.dart create mode 100644 client/html/generated/src/interface/FileException.dart create mode 100644 client/html/generated/src/interface/FileList.dart create mode 100644 client/html/generated/src/interface/FileReader.dart create mode 100644 client/html/generated/src/interface/FileReaderSync.dart create mode 100644 client/html/generated/src/interface/FileSystemCallback.dart create mode 100644 client/html/generated/src/interface/FileWriter.dart create mode 100644 client/html/generated/src/interface/FileWriterCallback.dart create mode 100644 client/html/generated/src/interface/FileWriterSync.dart create mode 100644 client/html/generated/src/interface/Flags.dart create mode 100644 client/html/generated/src/interface/Float32Array.dart create mode 100644 client/html/generated/src/interface/Float64Array.dart create mode 100644 client/html/generated/src/interface/FontElement.dart create mode 100644 client/html/generated/src/interface/FormElement.dart create mode 100644 client/html/generated/src/interface/Geolocation.dart create mode 100644 client/html/generated/src/interface/Geoposition.dart create mode 100644 client/html/generated/src/interface/HRElement.dart create mode 100644 client/html/generated/src/interface/HTMLAllCollection.dart create mode 100644 client/html/generated/src/interface/HashChangeEvent.dart create mode 100644 client/html/generated/src/interface/HeadElement.dart create mode 100644 client/html/generated/src/interface/HeadingElement.dart create mode 100644 client/html/generated/src/interface/History.dart create mode 100644 client/html/generated/src/interface/HtmlElement.dart create mode 100644 client/html/generated/src/interface/IDBAny.dart create mode 100644 client/html/generated/src/interface/IDBCursor.dart create mode 100644 client/html/generated/src/interface/IDBCursorWithValue.dart create mode 100644 client/html/generated/src/interface/IDBDatabase.dart create mode 100644 client/html/generated/src/interface/IDBDatabaseError.dart create mode 100644 client/html/generated/src/interface/IDBDatabaseException.dart create mode 100644 client/html/generated/src/interface/IDBFactory.dart create mode 100644 client/html/generated/src/interface/IDBIndex.dart create mode 100644 client/html/generated/src/interface/IDBKey.dart create mode 100644 client/html/generated/src/interface/IDBKeyRange.dart create mode 100644 client/html/generated/src/interface/IDBObjectStore.dart create mode 100644 client/html/generated/src/interface/IDBRequest.dart create mode 100644 client/html/generated/src/interface/IDBTransaction.dart create mode 100644 client/html/generated/src/interface/IDBVersionChangeEvent.dart create mode 100644 client/html/generated/src/interface/IDBVersionChangeRequest.dart create mode 100644 client/html/generated/src/interface/IFrameElement.dart create mode 100644 client/html/generated/src/interface/ImageData.dart create mode 100644 client/html/generated/src/interface/ImageElement.dart create mode 100644 client/html/generated/src/interface/InputElement.dart create mode 100644 client/html/generated/src/interface/Int16Array.dart create mode 100644 client/html/generated/src/interface/Int32Array.dart create mode 100644 client/html/generated/src/interface/Int8Array.dart create mode 100644 client/html/generated/src/interface/KeyboardEvent.dart create mode 100644 client/html/generated/src/interface/KeygenElement.dart create mode 100644 client/html/generated/src/interface/LIElement.dart create mode 100644 client/html/generated/src/interface/LabelElement.dart create mode 100644 client/html/generated/src/interface/LegendElement.dart create mode 100644 client/html/generated/src/interface/LinkElement.dart create mode 100644 client/html/generated/src/interface/LocalMediaStream.dart create mode 100644 client/html/generated/src/interface/Location.dart create mode 100644 client/html/generated/src/interface/LoseContext.dart create mode 100644 client/html/generated/src/interface/MapElement.dart create mode 100644 client/html/generated/src/interface/MarqueeElement.dart create mode 100644 client/html/generated/src/interface/MediaElement.dart create mode 100644 client/html/generated/src/interface/MediaError.dart create mode 100644 client/html/generated/src/interface/MediaList.dart create mode 100644 client/html/generated/src/interface/MediaQueryList.dart create mode 100644 client/html/generated/src/interface/MediaQueryListListener.dart create mode 100644 client/html/generated/src/interface/MediaStream.dart create mode 100644 client/html/generated/src/interface/MediaStreamList.dart create mode 100644 client/html/generated/src/interface/MediaStreamTrack.dart create mode 100644 client/html/generated/src/interface/MediaStreamTrackList.dart create mode 100644 client/html/generated/src/interface/MenuElement.dart create mode 100644 client/html/generated/src/interface/MessageChannel.dart create mode 100644 client/html/generated/src/interface/MessageEvent.dart create mode 100644 client/html/generated/src/interface/MetaElement.dart create mode 100644 client/html/generated/src/interface/Metadata.dart create mode 100644 client/html/generated/src/interface/MetadataCallback.dart create mode 100644 client/html/generated/src/interface/MeterElement.dart create mode 100644 client/html/generated/src/interface/ModElement.dart create mode 100644 client/html/generated/src/interface/MouseEvent.dart create mode 100644 client/html/generated/src/interface/MutationEvent.dart create mode 100644 client/html/generated/src/interface/Navigator.dart create mode 100644 client/html/generated/src/interface/NavigatorUserMediaError.dart create mode 100644 client/html/generated/src/interface/NavigatorUserMediaErrorCallback.dart create mode 100644 client/html/generated/src/interface/NavigatorUserMediaSuccessCallback.dart create mode 100644 client/html/generated/src/interface/Notation.dart create mode 100644 client/html/generated/src/interface/NotificationCenter.dart create mode 100644 client/html/generated/src/interface/OESStandardDerivatives.dart create mode 100644 client/html/generated/src/interface/OESTextureFloat.dart create mode 100644 client/html/generated/src/interface/OESVertexArrayObject.dart create mode 100644 client/html/generated/src/interface/OListElement.dart create mode 100644 client/html/generated/src/interface/ObjectElement.dart create mode 100644 client/html/generated/src/interface/OperationNotAllowedException.dart create mode 100644 client/html/generated/src/interface/OptGroupElement.dart create mode 100644 client/html/generated/src/interface/OptionElement.dart create mode 100644 client/html/generated/src/interface/OutputElement.dart create mode 100644 client/html/generated/src/interface/OverflowEvent.dart create mode 100644 client/html/generated/src/interface/PageTransitionEvent.dart create mode 100644 client/html/generated/src/interface/ParagraphElement.dart create mode 100644 client/html/generated/src/interface/ParamElement.dart create mode 100644 client/html/generated/src/interface/Point.dart create mode 100644 client/html/generated/src/interface/PopStateEvent.dart create mode 100644 client/html/generated/src/interface/PositionCallback.dart create mode 100644 client/html/generated/src/interface/PositionError.dart create mode 100644 client/html/generated/src/interface/PositionErrorCallback.dart create mode 100644 client/html/generated/src/interface/PreElement.dart create mode 100644 client/html/generated/src/interface/ProcessingInstruction.dart create mode 100644 client/html/generated/src/interface/ProgressElement.dart create mode 100644 client/html/generated/src/interface/ProgressEvent.dart create mode 100644 client/html/generated/src/interface/QuoteElement.dart create mode 100644 client/html/generated/src/interface/RGBColor.dart create mode 100644 client/html/generated/src/interface/Range.dart create mode 100644 client/html/generated/src/interface/RangeException.dart create mode 100644 client/html/generated/src/interface/Rect.dart create mode 100644 client/html/generated/src/interface/Screen.dart create mode 100644 client/html/generated/src/interface/ScriptElement.dart create mode 100644 client/html/generated/src/interface/SelectElement.dart create mode 100644 client/html/generated/src/interface/SourceElement.dart create mode 100644 client/html/generated/src/interface/SpeechInputEvent.dart create mode 100644 client/html/generated/src/interface/SpeechInputResult.dart create mode 100644 client/html/generated/src/interface/SpeechInputResultList.dart create mode 100644 client/html/generated/src/interface/Storage.dart create mode 100644 client/html/generated/src/interface/StorageEvent.dart create mode 100644 client/html/generated/src/interface/StorageInfo.dart create mode 100644 client/html/generated/src/interface/StorageInfoErrorCallback.dart create mode 100644 client/html/generated/src/interface/StorageInfoQuotaCallback.dart create mode 100644 client/html/generated/src/interface/StorageInfoUsageCallback.dart create mode 100644 client/html/generated/src/interface/StringCallback.dart create mode 100644 client/html/generated/src/interface/StyleElement.dart create mode 100644 client/html/generated/src/interface/StyleMedia.dart create mode 100644 client/html/generated/src/interface/StyleSheet.dart create mode 100644 client/html/generated/src/interface/StyleSheetList.dart create mode 100644 client/html/generated/src/interface/TableCaptionElement.dart create mode 100644 client/html/generated/src/interface/TableCellElement.dart create mode 100644 client/html/generated/src/interface/TableColElement.dart create mode 100644 client/html/generated/src/interface/TableElement.dart create mode 100644 client/html/generated/src/interface/TableRowElement.dart create mode 100644 client/html/generated/src/interface/TableSectionElement.dart create mode 100644 client/html/generated/src/interface/TextAreaElement.dart create mode 100644 client/html/generated/src/interface/TextEvent.dart create mode 100644 client/html/generated/src/interface/TextMetrics.dart create mode 100644 client/html/generated/src/interface/TimeRanges.dart create mode 100644 client/html/generated/src/interface/TitleElement.dart create mode 100644 client/html/generated/src/interface/Touch.dart create mode 100644 client/html/generated/src/interface/TouchEvent.dart create mode 100644 client/html/generated/src/interface/TouchList.dart create mode 100644 client/html/generated/src/interface/TrackElement.dart create mode 100644 client/html/generated/src/interface/TransitionEvent.dart create mode 100644 client/html/generated/src/interface/UIEvent.dart create mode 100644 client/html/generated/src/interface/UListElement.dart create mode 100644 client/html/generated/src/interface/Uint16Array.dart create mode 100644 client/html/generated/src/interface/Uint32Array.dart create mode 100644 client/html/generated/src/interface/Uint8Array.dart create mode 100644 client/html/generated/src/interface/UnknownElement.dart create mode 100644 client/html/generated/src/interface/ValidityState.dart create mode 100644 client/html/generated/src/interface/VideoElement.dart create mode 100644 client/html/generated/src/interface/VoidCallback.dart create mode 100644 client/html/generated/src/interface/WebGLActiveInfo.dart create mode 100644 client/html/generated/src/interface/WebGLBuffer.dart create mode 100644 client/html/generated/src/interface/WebGLContextAttributes.dart create mode 100644 client/html/generated/src/interface/WebGLContextEvent.dart create mode 100644 client/html/generated/src/interface/WebGLFramebuffer.dart create mode 100644 client/html/generated/src/interface/WebGLProgram.dart create mode 100644 client/html/generated/src/interface/WebGLRenderbuffer.dart create mode 100644 client/html/generated/src/interface/WebGLRenderingContext.dart create mode 100644 client/html/generated/src/interface/WebGLShader.dart create mode 100644 client/html/generated/src/interface/WebGLTexture.dart create mode 100644 client/html/generated/src/interface/WebGLUniformLocation.dart create mode 100644 client/html/generated/src/interface/WebGLVertexArrayObjectOES.dart create mode 100644 client/html/generated/src/interface/WheelEvent.dart create mode 100644 client/html/generated/src/interface/XMLHttpRequestException.dart create mode 100644 client/html/generated/src/interface/XMLHttpRequestProgressEvent.dart create mode 100644 client/html/generated/src/wrapping/_AnchorElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_AnimationEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_AnimationListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_AnimationWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_AreaElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ArrayBufferViewWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ArrayBufferWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_AudioElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_BRElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_BarInfoWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_BaseElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_BeforeLoadEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_BeforeProcessEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_BlobBuilderWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_BlobWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_BlockquoteElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ButtonElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CDATASectionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSCharsetRuleWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSFontFaceRuleWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSImportRuleWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSKeyframeRuleWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSKeyframesRuleWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSMatrixWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSMediaRuleWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSPageRuleWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSPrimitiveValueWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSRuleListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSRuleWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSStyleRuleWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSStyleSheetWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSTransformValueWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSUnknownRuleWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSValueListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CSSValueWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CanvasElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CanvasGradientWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CanvasPatternWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CanvasPixelArrayWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CanvasRenderingContext2DWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CanvasRenderingContextWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CharacterDataWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ClientRectListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ClientRectWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ClipboardWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CloseEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CommentWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CompositionEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ConsoleWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CoordinatesWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CounterWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CryptoWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_CustomEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DListElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMExceptionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMFileSystemSyncWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMFileSystemWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMFormDataWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMMimeTypeArrayWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMMimeTypeWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMParserWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMPluginArrayWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMPluginWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMSelectionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMSettableTokenListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMTokenListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DOMURLWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DataListElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DataTransferItemWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DataTransferItemsWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DataViewWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DetailsElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DeviceMotionEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DeviceOrientationEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DirectoryEntrySyncWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DirectoryEntryWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DirectoryReaderSyncWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DirectoryReaderWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_DivElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_EmbedElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_EntityReferenceWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_EntityWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_EntriesCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_EntryArraySyncWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_EntryArrayWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_EntryCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_EntrySyncWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_EntryWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ErrorCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ErrorEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_EventExceptionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_EventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FieldSetElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileEntrySyncWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileEntryWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileErrorWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileExceptionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileReaderSyncWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileReaderWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileSystemCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileWriterCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileWriterSyncWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FileWriterWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FlagsWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_Float32ArrayWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_Float64ArrayWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FontElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_FormElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_GeolocationWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_GeopositionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_HRElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_HTMLAllCollectionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_HashChangeEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_HeadElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_HeadingElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_HistoryWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_HtmlElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_HtmlWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBAnyWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBCursorWithValueWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBCursorWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBDatabaseErrorWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBDatabaseExceptionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBDatabaseWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBFactoryWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBIndexWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBKeyRangeWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBKeyWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBObjectStoreWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBRequestWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBTransactionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBVersionChangeEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IDBVersionChangeRequestWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_IFrameElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ImageDataWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ImageElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_InputElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_Int16ArrayWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_Int32ArrayWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_Int8ArrayWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_KeyboardEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_KeygenElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_LIElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_LabelElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_LegendElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_LinkElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_LocalMediaStreamWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_LocationWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_LoseContextWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MapElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MarqueeElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MediaElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MediaErrorWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MediaListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MediaQueryListListenerWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MediaQueryListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MediaStreamListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MediaStreamTrackListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MediaStreamTrackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MediaStreamWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MenuElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MessageChannelWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MessageEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MetaElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MetadataCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MetadataWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MeterElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ModElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MouseEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_MutationEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_NavigatorUserMediaErrorCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_NavigatorUserMediaErrorWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_NavigatorUserMediaSuccessCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_NavigatorWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_NotationWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_NotificationCenterWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_OESStandardDerivativesWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_OESTextureFloatWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_OESVertexArrayObjectWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_OListElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ObjectElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_OperationNotAllowedExceptionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_OptGroupElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_OptionElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_OutputElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_OverflowEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_PageTransitionEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ParagraphElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ParamElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_PointWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_PopStateEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_PositionCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_PositionErrorCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_PositionErrorWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_PreElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ProcessingInstructionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ProgressElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ProgressEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_QuoteElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_RGBColorWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_RangeExceptionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_RangeWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_RectWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ScreenWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ScriptElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_SelectElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_SourceElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_SpeechInputEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_SpeechInputResultListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_SpeechInputResultWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_StorageEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_StorageInfoErrorCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_StorageInfoQuotaCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_StorageInfoUsageCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_StorageInfoWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_StorageWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_StringCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_StyleElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_StyleMediaWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_StyleSheetListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_StyleSheetWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TableCaptionElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TableCellElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TableColElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TableElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TableRowElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TableSectionElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TextAreaElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TextEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TextMetricsWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TimeRangesWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TitleElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TouchEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TouchListWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TouchWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TrackElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_TransitionEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_UIEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_UListElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_Uint16ArrayWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_Uint32ArrayWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_Uint8ArrayWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_UnknownElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_ValidityStateWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_VideoElementWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_VoidCallbackWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WebGLActiveInfoWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WebGLBufferWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WebGLContextAttributesWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WebGLContextEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WebGLFramebufferWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WebGLProgramWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WebGLRenderbufferWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WebGLRenderingContextWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WebGLShaderWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WebGLTextureWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WebGLUniformLocationWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WebGLVertexArrayObjectOESWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_WheelEventWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_XMLHttpRequestExceptionWrappingImplementation.dart create mode 100644 client/html/generated/src/wrapping/_XMLHttpRequestProgressEventWrappingImplementation.dart create mode 100644 client/html/html.dart create mode 100644 client/html/src/AbstractWorker.dart create mode 100644 client/html/src/AbstractWorkerWrappingImplementation.dart create mode 100644 client/html/src/BodyElement.dart create mode 100644 client/html/src/BodyElementWrappingImplementation.dart create mode 100644 client/html/src/BootstrapHacks.dart create mode 100644 client/html/src/CSSStyleDeclaration.dart create mode 100644 client/html/src/CSSStyleDeclarationWrappingImplementation.dart create mode 100644 client/html/src/CssClassSet.dart create mode 100644 client/html/src/DOMApplicationCache.dart create mode 100644 client/html/src/DOMApplicationCacheWrappingImplementation.dart create mode 100644 client/html/src/DOMWrapperBase.dart create mode 100644 client/html/src/Document.dart create mode 100644 client/html/src/DocumentFragment.dart create mode 100644 client/html/src/DocumentFragmentWrappingImplementation.dart create mode 100644 client/html/src/DocumentWrappingImplementation.dart create mode 100644 client/html/src/Element.dart create mode 100644 client/html/src/ElementWrappingImplementation.dart create mode 100644 client/html/src/EventListener.dart create mode 100644 client/html/src/EventSource.dart create mode 100644 client/html/src/EventSourceWrappingImplementation.dart create mode 100644 client/html/src/EventTarget.dart create mode 100644 client/html/src/EventTargetWrappingImplementation.dart create mode 100644 client/html/src/GlobalProperties.dart create mode 100644 client/html/src/MessagePort.dart create mode 100644 client/html/src/MessagePortWrappingImplementation.dart create mode 100644 client/html/src/Node.dart create mode 100644 client/html/src/NodeList.dart create mode 100644 client/html/src/NodeWrappingImplementation.dart create mode 100644 client/html/src/Notification.dart create mode 100644 client/html/src/NotificationWrappingImplementation.dart create mode 100644 client/html/src/RequestAnimationFrameCallback.dart create mode 100644 client/html/src/SharedWorker.dart create mode 100644 client/html/src/SharedWorkerWrappingImplementation.dart create mode 100644 client/html/src/Text.dart create mode 100644 client/html/src/TextWrappingImplementation.dart create mode 100644 client/html/src/TimeoutHandler.dart create mode 100644 client/html/src/WebSocket.dart create mode 100644 client/html/src/WebSocketWrappingImplementation.dart create mode 100644 client/html/src/Window.dart create mode 100644 client/html/src/WindowWrappingImplementation.dart create mode 100644 client/html/src/Worker.dart create mode 100644 client/html/src/WorkerWrappingImplementation.dart create mode 100644 client/html/src/XMLHttpRequest.dart create mode 100644 client/html/src/XMLHttpRequestUpload.dart create mode 100644 client/html/src/XMLHttpRequestUploadWrappingImplementation.dart create mode 100644 client/html/src/XMLHttpRequestWrappingImplementation.dart create mode 100644 client/html/src/_ArrayIterators.dart create mode 100644 client/html/src/_Arrays.dart create mode 100644 client/html/src/_Collections.dart create mode 100644 client/json/dart_json.dart create mode 100644 client/json/json.dart create mode 100644 client/json/json.js create mode 100644 client/layout/GridLayout.dart create mode 100644 client/layout/GridLayoutParams.dart create mode 100644 client/layout/GridLayoutParser.dart create mode 100644 client/layout/GridTracks.dart create mode 100644 client/layout/SizingFunctions.dart create mode 100644 client/layout/ViewLayout.dart create mode 100644 client/layout/layout.dart create mode 100644 client/observable/ChangeEvent.dart create mode 100644 client/observable/EventBatch.dart create mode 100644 client/observable/observable.dart create mode 100644 client/testing/unittest/coverage_controller.js create mode 100644 client/testing/unittest/dom_for_unittest.dart create mode 100644 client/testing/unittest/dom_for_unittest.js create mode 100644 client/testing/unittest/test_controller.js create mode 100644 client/testing/unittest/unittest.dart create mode 100644 client/testing/unittest/unittest_dom.dart create mode 100644 client/testing/unittest/unittestsuite.dart create mode 100644 client/tests/client/client.status create mode 100644 client/tests/client/json/cmd_json_test.dart create mode 100644 client/tests/client/json/json_test.dart create mode 100644 client/tests/client/json/json_test.html create mode 100644 client/tests/client/json/json_tests.dart create mode 100644 client/tests/client/json/web_json_test.dart create mode 100644 client/tests/client/layout/GridExamples.dart create mode 100644 client/tests/client/layout/GridLayoutDemo.dart create mode 100644 client/tests/client/layout/GridLayoutTests.dart create mode 100644 client/tests/client/layout/grid_layout_demo.dart create mode 100644 client/tests/client/layout/grid_layout_demo.html create mode 100644 client/tests/client/layout/layout_tests.dart create mode 100644 client/tests/client/observable/AbstractObservableTests.dart create mode 100644 client/tests/client/observable/ChangeEventTests.dart create mode 100644 client/tests/client/observable/EventBatchTests.dart create mode 100644 client/tests/client/observable/ObservableListTests.dart create mode 100644 client/tests/client/observable/ObservableTestSetBase.dart create mode 100644 client/tests/client/observable/ObservableValueTests.dart create mode 100644 client/tests/client/observable/observable_tests.dart create mode 100644 client/tests/client/samples/dartcombat/dartcombat_tests.dart create mode 100644 client/tests/client/samples/swarm/swarm_tests.dart create mode 100644 client/tests/client/samples/total/TotalTests.dart create mode 100644 client/tests/client/samples/total/total_tests.dart create mode 100644 client/tests/client/testcfg.py create mode 100644 client/tests/client/touch/TouchTests.dart create mode 100644 client/tests/client/util/util_tests.dart create mode 100644 client/tests/client/view/ViewTests.dart create mode 100644 client/tests/client/view/view_tests.dart create mode 100644 client/tests/dartc/dartc.status create mode 100644 client/tests/dartc/testcfg.py create mode 100644 client/tools/buildbot_annotated_steps.py create mode 100755 client/tools/copy_dart.py create mode 100644 client/tools/coverage.css create mode 100755 client/tools/coverage.py create mode 100755 client/tools/dartserver/bin/dartserver create mode 100644 client/tools/dartserver/build.xml create mode 100644 client/tools/dartserver/dartserver.mf create mode 100644 client/tools/dartserver/java/com/google/appstack/tools/AppEngineThumbnailServlet.java create mode 100644 client/tools/dartserver/java/com/google/appstack/tools/AwtThumbnailServlet.java create mode 100644 client/tools/dartserver/java/com/google/appstack/tools/OAuthServlet.java create mode 100644 client/tools/dartserver/java/com/google/appstack/tools/ProxyingServlet.java create mode 100644 client/tools/dartserver/java/com/google/appstack/tools/ThumbnailServlet.java create mode 100644 client/tools/dartserver/java/com/google/appstack/tools/dartserver/AppMaker.java create mode 100644 client/tools/dartserver/java/com/google/appstack/tools/dartserver/DartApp.java create mode 100644 client/tools/dartserver/java/com/google/appstack/tools/dartserver/DartServer.java create mode 100644 client/tools/dartserver/java/com/google/appstack/tools/dartserver/ErrorFormatter.java create mode 100755 client/tools/generate_build.py create mode 100644 client/tools/htmlconverter.py create mode 100644 client/tools/htmlconverter_test.py create mode 100644 client/tools/jscoverage_wrapper.py create mode 100755 client/tools/scss.sh create mode 100644 client/tools/show_coverage.js create mode 100644 client/tools/sourcemap.py create mode 100644 client/touch/BezierPhysics.dart create mode 100644 client/touch/ClickBuster.dart create mode 100644 client/touch/EventUtil.dart create mode 100644 client/touch/FxUtil.dart create mode 100644 client/touch/Geometry.dart create mode 100644 client/touch/InfiniteScroller.dart create mode 100644 client/touch/Math.dart create mode 100644 client/touch/Momentum.dart create mode 100644 client/touch/ScrollWatcher.dart create mode 100644 client/touch/Scrollbar.dart create mode 100644 client/touch/Scroller.dart create mode 100644 client/touch/TimeUtil.dart create mode 100644 client/touch/TouchHandler.dart create mode 100644 client/touch/TouchUtil.dart create mode 100644 client/touch/resources/touch.css create mode 100644 client/touch/touch.dart create mode 100644 client/util/CollectionUtils.dart create mode 100644 client/util/DateTimeUtils.dart create mode 100644 client/util/StringUtils.dart create mode 100644 client/util/Uri.dart create mode 100644 client/util/utilslib.dart create mode 100644 client/view/CompositeView.dart create mode 100644 client/view/ConveyorView.dart create mode 100644 client/view/MeasureText.dart create mode 100644 client/view/PagedViews.dart create mode 100644 client/view/SliderMenu.dart create mode 100644 client/view/resources/view.css create mode 100644 client/view/view.dart diff --git a/client/README b/client/README new file mode 100644 index 00000000000..24ebede8730 --- /dev/null +++ b/client/README @@ -0,0 +1,3 @@ +A Dart-based development stack that enables rapid, scalable development of +client-side applications that run well across desktop and mobile platforms. + diff --git a/client/base/AnimationScheduler.dart b/client/base/AnimationScheduler.dart new file mode 100644 index 00000000000..1b832f2169d --- /dev/null +++ b/client/base/AnimationScheduler.dart @@ -0,0 +1,166 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +typedef void AnimationCallback(num currentTime); + +class CallbackData { + final AnimationCallback callback; + final num minTime; + int id; + + static int _nextId; + + bool ready(num time) => minTime === null || minTime <= time; + + CallbackData(this.callback, this.minTime) { + // TODO(jacobr): static init needs cleanup, see http://b/4161827 + if (_nextId === null) { + _nextId = 1; + } + id = _nextId++; + } +} + +/** + * Animation scheduler implementing the functionality provided by + * [:window.requestAnimationFrame:] for platforms that do not support it + * or support it badly. When multiple UI components are animating at once, + * this approach yields superior performance to calling setTimeout directly as + * all pieces of the UI will animate at the same time resulting in fewer + * layouts. + */ +// TODO(jacobr): use window.requestAnimationFrame when it is available and +// 60fps for the current browser. +class AnimationScheduler { + static final FRAMES_PER_SECOND = 60; + static final MS_PER_FRAME = 1000 ~/ FRAMES_PER_SECOND; + static final USE_INTERVALS = false; + + /** List of callbacks to be executed next animation frame. */ + List _callbacks; + int _intervalId; + bool _isMobileSafari = false; + Css _safariHackCss; + int _frameCount = 0; + bool _webkitAnimationFrameMaybeAvailable = true; + + AnimationScheduler() + : _callbacks = new List() { + if (_isMobileSafari) { + // TODO(jacobr): find a better workaround for the issue that 3d transforms + // sometimes don't render on iOS without forcing a layout. + final element = new Element.tag('div'); + document.body.nodes.add(element); + _safariHackCss = new Css(element.style); + _safariHackCss.position = 'absolute'; + } + } + + /** + * Cancel the pending callback matching the specified [id]. + * This is not heavily optimized as typically users don't cancel animation + * frames. + */ + void cancelRequestAnimationFrame(int id) { + _callbacks = _callbacks.filter((CallbackData e) => e.id != id); + } + + /** + * Schedule [callback] to execute at the next animation frame that occurs + * at or after [minTime]. If [minTime] is not specified, the first available + * animation frame is used. Returns an id that can be used to cancel the + * pending callback. + */ + int requestAnimationFrame(AnimationCallback callback, + [Element element = null, + num minTime = null]) { + final callbackData = new CallbackData(callback, minTime); + _requestAnimationFrameHelper(callbackData); + return callbackData.id; + } + + void _requestAnimationFrameHelper(CallbackData callbackData) { + _callbacks.add(callbackData); + if (_intervalId === null) { + _setupInterval(); + } + } + + void _setupInterval() { + // Assert that we never schedule multiple frames at once. + assert(_intervalId === null); + if (USE_INTERVALS) { + _intervalId = window.setInterval(_step, MS_PER_FRAME); + } else { + if (_webkitAnimationFrameMaybeAvailable) { + try { + // TODO(jacobr): passing in document should not be required. + _intervalId = window.webkitRequestAnimationFrame( + (int ignored) { _step(); }, document); + // TODO(jacobr) fix this odd type error. + } catch (var e) { + _webkitAnimationFrameMaybeAvailable = false; + } + } + if (!_webkitAnimationFrameMaybeAvailable) { + _intervalId = window.setTimeout(() { _step(); }, MS_PER_FRAME); + } + } + } + + void _step() { + if (_callbacks.isEmpty()) { + // Cancel the interval on the first frame where there aren't actually + // any available callbacks. + assert(_intervalId != null); + if (USE_INTERVALS) { + window.clearInterval(_intervalId); + } + _intervalId = null; + } else if (USE_INTERVALS == false) { + _intervalId = null; + _setupInterval(); + } + int numRemaining = 0; + int minTime = new DateTime.now().value + MS_PER_FRAME; + + int len = _callbacks.length; + for (final callback in _callbacks) { + if (!callback.ready(minTime)) { + numRemaining++; + } + } + + if (numRemaining == len) { + // TODO(jacobr): we could be more clever about this case if delayed + // requests really become the main use case... + return; + } + // Some callbacks need to be executed. + final currentCallbacks = _callbacks; + _callbacks = new List(); + + for (final callbackData in currentCallbacks) { + if (callbackData.ready(minTime)) { + try { + (callbackData.callback)(minTime); + } catch (var e) { + final msg = e.toString(); + print('Suppressed exception ${msg} triggered by callback'); + } + } else { + _callbacks.add(callbackData); + } + } + + _frameCount++; + if (_isMobileSafari) { + // Hack to work around an iOS bug where sometimes animations do not + // render if only webkit transforms were modified. + // TODO(jacobr): find a cleaner workaround. + int offset = _frameCount % 2; + _safariHackCss.left = '${offset}px'; + } + } +} diff --git a/client/base/Css.dart b/client/base/Css.dart new file mode 100644 index 00000000000..b9ac4092a24 --- /dev/null +++ b/client/base/Css.dart @@ -0,0 +1,6154 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// WARNING: Do not edit. +// This file was generated by base/scripts/css_code_generator.py + +// Source of CSS properties: +// Source/WebCore/css/CSSPropertyNames.in + +// TODO(jacobr): add versions that take numeric values in px, miliseconds, etc. + +/** + * Browser neutral and typesafe class for setting CSS styles from Dart. + * This class smoothes over browser differences. + */ +class Css { + static String _cachedBrowserPrefix; + + final CSSStyleDeclaration raw; + Css(CSSStyleDeclaration this.raw) { } + + static String get _browserPrefix() { + if (_cachedBrowserPrefix === null) { + if (Device.isFirefox) { + _cachedBrowserPrefix = '-moz-'; + } else { + _cachedBrowserPrefix = '-webkit-'; + } + // TODO(jacobr): support IE 9.0 and Opera as well. + } + return _cachedBrowserPrefix; + } + + /** Gets the value of "animation" */ + static String getAnimation(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}animation'); + } + + /** Sets the value of "animation" */ + static void setAnimation(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}animation', value, ''); + } + + /** Gets the value of "animation-delay" */ + static String getAnimationDelay(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}animation-delay'); + } + + /** Sets the value of "animation-delay" */ + static void setAnimationDelay(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}animation-delay', value, ''); + } + + /** Gets the value of "animation-direction" */ + static String getAnimationDirection(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}animation-direction'); + } + + /** Sets the value of "animation-direction" */ + static void setAnimationDirection(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}animation-direction', value, ''); + } + + /** Gets the value of "animation-duration" */ + static String getAnimationDuration(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}animation-duration'); + } + + /** Sets the value of "animation-duration" */ + static void setAnimationDuration(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}animation-duration', value, ''); + } + + /** Gets the value of "animation-fill-mode" */ + static String getAnimationFillMode(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}animation-fill-mode'); + } + + /** Sets the value of "animation-fill-mode" */ + static void setAnimationFillMode(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}animation-fill-mode', value, ''); + } + + /** Gets the value of "animation-iteration-count" */ + static String getAnimationIterationCount(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}animation-iteration-count'); + } + + /** Sets the value of "animation-iteration-count" */ + static void setAnimationIterationCount(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}animation-iteration-count', value, ''); + } + + /** Gets the value of "animation-name" */ + static String getAnimationName(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}animation-name'); + } + + /** Sets the value of "animation-name" */ + static void setAnimationName(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}animation-name', value, ''); + } + + /** Gets the value of "animation-play-state" */ + static String getAnimationPlayState(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}animation-play-state'); + } + + /** Sets the value of "animation-play-state" */ + static void setAnimationPlayState(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}animation-play-state', value, ''); + } + + /** Gets the value of "animation-timing-function" */ + static String getAnimationTimingFunction(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}animation-timing-function'); + } + + /** Sets the value of "animation-timing-function" */ + static void setAnimationTimingFunction(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}animation-timing-function', value, ''); + } + + /** Gets the value of "appearance" */ + static String getAppearance(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}appearance'); + } + + /** Sets the value of "appearance" */ + static void setAppearance(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}appearance', value, ''); + } + + /** Gets the value of "backface-visibility" */ + static String getBackfaceVisibility(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}backface-visibility'); + } + + /** Sets the value of "backface-visibility" */ + static void setBackfaceVisibility(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}backface-visibility', value, ''); + } + + /** Gets the value of "background" */ + static String getBackground(CSSStyleDeclaration style) { + return style.getPropertyValue('background'); + } + + /** Sets the value of "background" */ + static void setBackground(CSSStyleDeclaration style, String value) { + style.setProperty('background', value, ''); + } + + /** Gets the value of "background-attachment" */ + static String getBackgroundAttachment(CSSStyleDeclaration style) { + return style.getPropertyValue('background-attachment'); + } + + /** Sets the value of "background-attachment" */ + static void setBackgroundAttachment(CSSStyleDeclaration style, String value) { + style.setProperty('background-attachment', value, ''); + } + + /** Gets the value of "background-clip" */ + static String getBackgroundClip(CSSStyleDeclaration style) { + return style.getPropertyValue('background-clip'); + } + + /** Sets the value of "background-clip" */ + static void setBackgroundClip(CSSStyleDeclaration style, String value) { + style.setProperty('background-clip', value, ''); + } + + /** Gets the value of "background-color" */ + static String getBackgroundColor(CSSStyleDeclaration style) { + return style.getPropertyValue('background-color'); + } + + /** Sets the value of "background-color" */ + static void setBackgroundColor(CSSStyleDeclaration style, String value) { + style.setProperty('background-color', value, ''); + } + + /** Gets the value of "background-composite" */ + static String getBackgroundComposite(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}background-composite'); + } + + /** Sets the value of "background-composite" */ + static void setBackgroundComposite(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}background-composite', value, ''); + } + + /** Gets the value of "background-image" */ + static String getBackgroundImage(CSSStyleDeclaration style) { + return style.getPropertyValue('background-image'); + } + + /** Sets the value of "background-image" */ + static void setBackgroundImage(CSSStyleDeclaration style, String value) { + style.setProperty('background-image', value, ''); + } + + /** Gets the value of "background-origin" */ + static String getBackgroundOrigin(CSSStyleDeclaration style) { + return style.getPropertyValue('background-origin'); + } + + /** Sets the value of "background-origin" */ + static void setBackgroundOrigin(CSSStyleDeclaration style, String value) { + style.setProperty('background-origin', value, ''); + } + + /** Gets the value of "background-position" */ + static String getBackgroundPosition(CSSStyleDeclaration style) { + return style.getPropertyValue('background-position'); + } + + /** Sets the value of "background-position" */ + static void setBackgroundPosition(CSSStyleDeclaration style, String value) { + style.setProperty('background-position', value, ''); + } + + /** Gets the value of "background-position-x" */ + static String getBackgroundPositionX(CSSStyleDeclaration style) { + return style.getPropertyValue('background-position-x'); + } + + /** Sets the value of "background-position-x" */ + static void setBackgroundPositionX(CSSStyleDeclaration style, String value) { + style.setProperty('background-position-x', value, ''); + } + + /** Gets the value of "background-position-y" */ + static String getBackgroundPositionY(CSSStyleDeclaration style) { + return style.getPropertyValue('background-position-y'); + } + + /** Sets the value of "background-position-y" */ + static void setBackgroundPositionY(CSSStyleDeclaration style, String value) { + style.setProperty('background-position-y', value, ''); + } + + /** Gets the value of "background-repeat" */ + static String getBackgroundRepeat(CSSStyleDeclaration style) { + return style.getPropertyValue('background-repeat'); + } + + /** Sets the value of "background-repeat" */ + static void setBackgroundRepeat(CSSStyleDeclaration style, String value) { + style.setProperty('background-repeat', value, ''); + } + + /** Gets the value of "background-repeat-x" */ + static String getBackgroundRepeatX(CSSStyleDeclaration style) { + return style.getPropertyValue('background-repeat-x'); + } + + /** Sets the value of "background-repeat-x" */ + static void setBackgroundRepeatX(CSSStyleDeclaration style, String value) { + style.setProperty('background-repeat-x', value, ''); + } + + /** Gets the value of "background-repeat-y" */ + static String getBackgroundRepeatY(CSSStyleDeclaration style) { + return style.getPropertyValue('background-repeat-y'); + } + + /** Sets the value of "background-repeat-y" */ + static void setBackgroundRepeatY(CSSStyleDeclaration style, String value) { + style.setProperty('background-repeat-y', value, ''); + } + + /** Gets the value of "background-size" */ + static String getBackgroundSize(CSSStyleDeclaration style) { + return style.getPropertyValue('background-size'); + } + + /** Sets the value of "background-size" */ + static void setBackgroundSize(CSSStyleDeclaration style, String value) { + style.setProperty('background-size', value, ''); + } + + /** Gets the value of "border" */ + static String getBorder(CSSStyleDeclaration style) { + return style.getPropertyValue('border'); + } + + /** Sets the value of "border" */ + static void setBorder(CSSStyleDeclaration style, String value) { + style.setProperty('border', value, ''); + } + + /** Gets the value of "border-after" */ + static String getBorderAfter(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-after'); + } + + /** Sets the value of "border-after" */ + static void setBorderAfter(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-after', value, ''); + } + + /** Gets the value of "border-after-color" */ + static String getBorderAfterColor(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-after-color'); + } + + /** Sets the value of "border-after-color" */ + static void setBorderAfterColor(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-after-color', value, ''); + } + + /** Gets the value of "border-after-style" */ + static String getBorderAfterStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-after-style'); + } + + /** Sets the value of "border-after-style" */ + static void setBorderAfterStyle(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-after-style', value, ''); + } + + /** Gets the value of "border-after-width" */ + static String getBorderAfterWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-after-width'); + } + + /** Sets the value of "border-after-width" */ + static void setBorderAfterWidth(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-after-width', value, ''); + } + + /** Gets the value of "border-before" */ + static String getBorderBefore(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-before'); + } + + /** Sets the value of "border-before" */ + static void setBorderBefore(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-before', value, ''); + } + + /** Gets the value of "border-before-color" */ + static String getBorderBeforeColor(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-before-color'); + } + + /** Sets the value of "border-before-color" */ + static void setBorderBeforeColor(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-before-color', value, ''); + } + + /** Gets the value of "border-before-style" */ + static String getBorderBeforeStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-before-style'); + } + + /** Sets the value of "border-before-style" */ + static void setBorderBeforeStyle(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-before-style', value, ''); + } + + /** Gets the value of "border-before-width" */ + static String getBorderBeforeWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-before-width'); + } + + /** Sets the value of "border-before-width" */ + static void setBorderBeforeWidth(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-before-width', value, ''); + } + + /** Gets the value of "border-bottom" */ + static String getBorderBottom(CSSStyleDeclaration style) { + return style.getPropertyValue('border-bottom'); + } + + /** Sets the value of "border-bottom" */ + static void setBorderBottom(CSSStyleDeclaration style, String value) { + style.setProperty('border-bottom', value, ''); + } + + /** Gets the value of "border-bottom-color" */ + static String getBorderBottomColor(CSSStyleDeclaration style) { + return style.getPropertyValue('border-bottom-color'); + } + + /** Sets the value of "border-bottom-color" */ + static void setBorderBottomColor(CSSStyleDeclaration style, String value) { + style.setProperty('border-bottom-color', value, ''); + } + + /** Gets the value of "border-bottom-left-radius" */ + static String getBorderBottomLeftRadius(CSSStyleDeclaration style) { + return style.getPropertyValue('border-bottom-left-radius'); + } + + /** Sets the value of "border-bottom-left-radius" */ + static void setBorderBottomLeftRadius(CSSStyleDeclaration style, String value) { + style.setProperty('border-bottom-left-radius', value, ''); + } + + /** Gets the value of "border-bottom-right-radius" */ + static String getBorderBottomRightRadius(CSSStyleDeclaration style) { + return style.getPropertyValue('border-bottom-right-radius'); + } + + /** Sets the value of "border-bottom-right-radius" */ + static void setBorderBottomRightRadius(CSSStyleDeclaration style, String value) { + style.setProperty('border-bottom-right-radius', value, ''); + } + + /** Gets the value of "border-bottom-style" */ + static String getBorderBottomStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('border-bottom-style'); + } + + /** Sets the value of "border-bottom-style" */ + static void setBorderBottomStyle(CSSStyleDeclaration style, String value) { + style.setProperty('border-bottom-style', value, ''); + } + + /** Gets the value of "border-bottom-width" */ + static String getBorderBottomWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('border-bottom-width'); + } + + /** Sets the value of "border-bottom-width" */ + static void setBorderBottomWidth(CSSStyleDeclaration style, String value) { + style.setProperty('border-bottom-width', value, ''); + } + + /** Gets the value of "border-collapse" */ + static String getBorderCollapse(CSSStyleDeclaration style) { + return style.getPropertyValue('border-collapse'); + } + + /** Sets the value of "border-collapse" */ + static void setBorderCollapse(CSSStyleDeclaration style, String value) { + style.setProperty('border-collapse', value, ''); + } + + /** Gets the value of "border-color" */ + static String getBorderColor(CSSStyleDeclaration style) { + return style.getPropertyValue('border-color'); + } + + /** Sets the value of "border-color" */ + static void setBorderColor(CSSStyleDeclaration style, String value) { + style.setProperty('border-color', value, ''); + } + + /** Gets the value of "border-end" */ + static String getBorderEnd(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-end'); + } + + /** Sets the value of "border-end" */ + static void setBorderEnd(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-end', value, ''); + } + + /** Gets the value of "border-end-color" */ + static String getBorderEndColor(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-end-color'); + } + + /** Sets the value of "border-end-color" */ + static void setBorderEndColor(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-end-color', value, ''); + } + + /** Gets the value of "border-end-style" */ + static String getBorderEndStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-end-style'); + } + + /** Sets the value of "border-end-style" */ + static void setBorderEndStyle(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-end-style', value, ''); + } + + /** Gets the value of "border-end-width" */ + static String getBorderEndWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-end-width'); + } + + /** Sets the value of "border-end-width" */ + static void setBorderEndWidth(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-end-width', value, ''); + } + + /** Gets the value of "border-fit" */ + static String getBorderFit(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-fit'); + } + + /** Sets the value of "border-fit" */ + static void setBorderFit(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-fit', value, ''); + } + + /** Gets the value of "border-horizontal-spacing" */ + static String getBorderHorizontalSpacing(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-horizontal-spacing'); + } + + /** Sets the value of "border-horizontal-spacing" */ + static void setBorderHorizontalSpacing(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-horizontal-spacing', value, ''); + } + + /** Gets the value of "border-image" */ + static String getBorderImage(CSSStyleDeclaration style) { + return style.getPropertyValue('border-image'); + } + + /** Sets the value of "border-image" */ + static void setBorderImage(CSSStyleDeclaration style, String value) { + style.setProperty('border-image', value, ''); + } + + /** Gets the value of "border-image-outset" */ + static String getBorderImageOutset(CSSStyleDeclaration style) { + return style.getPropertyValue('border-image-outset'); + } + + /** Sets the value of "border-image-outset" */ + static void setBorderImageOutset(CSSStyleDeclaration style, String value) { + style.setProperty('border-image-outset', value, ''); + } + + /** Gets the value of "border-image-repeat" */ + static String getBorderImageRepeat(CSSStyleDeclaration style) { + return style.getPropertyValue('border-image-repeat'); + } + + /** Sets the value of "border-image-repeat" */ + static void setBorderImageRepeat(CSSStyleDeclaration style, String value) { + style.setProperty('border-image-repeat', value, ''); + } + + /** Gets the value of "border-image-slice" */ + static String getBorderImageSlice(CSSStyleDeclaration style) { + return style.getPropertyValue('border-image-slice'); + } + + /** Sets the value of "border-image-slice" */ + static void setBorderImageSlice(CSSStyleDeclaration style, String value) { + style.setProperty('border-image-slice', value, ''); + } + + /** Gets the value of "border-image-source" */ + static String getBorderImageSource(CSSStyleDeclaration style) { + return style.getPropertyValue('border-image-source'); + } + + /** Sets the value of "border-image-source" */ + static void setBorderImageSource(CSSStyleDeclaration style, String value) { + style.setProperty('border-image-source', value, ''); + } + + /** Gets the value of "border-image-width" */ + static String getBorderImageWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('border-image-width'); + } + + /** Sets the value of "border-image-width" */ + static void setBorderImageWidth(CSSStyleDeclaration style, String value) { + style.setProperty('border-image-width', value, ''); + } + + /** Gets the value of "border-left" */ + static String getBorderLeft(CSSStyleDeclaration style) { + return style.getPropertyValue('border-left'); + } + + /** Sets the value of "border-left" */ + static void setBorderLeft(CSSStyleDeclaration style, String value) { + style.setProperty('border-left', value, ''); + } + + /** Gets the value of "border-left-color" */ + static String getBorderLeftColor(CSSStyleDeclaration style) { + return style.getPropertyValue('border-left-color'); + } + + /** Sets the value of "border-left-color" */ + static void setBorderLeftColor(CSSStyleDeclaration style, String value) { + style.setProperty('border-left-color', value, ''); + } + + /** Gets the value of "border-left-style" */ + static String getBorderLeftStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('border-left-style'); + } + + /** Sets the value of "border-left-style" */ + static void setBorderLeftStyle(CSSStyleDeclaration style, String value) { + style.setProperty('border-left-style', value, ''); + } + + /** Gets the value of "border-left-width" */ + static String getBorderLeftWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('border-left-width'); + } + + /** Sets the value of "border-left-width" */ + static void setBorderLeftWidth(CSSStyleDeclaration style, String value) { + style.setProperty('border-left-width', value, ''); + } + + /** Gets the value of "border-radius" */ + static String getBorderRadius(CSSStyleDeclaration style) { + return style.getPropertyValue('border-radius'); + } + + /** Sets the value of "border-radius" */ + static void setBorderRadius(CSSStyleDeclaration style, String value) { + style.setProperty('border-radius', value, ''); + } + + /** Gets the value of "border-right" */ + static String getBorderRight(CSSStyleDeclaration style) { + return style.getPropertyValue('border-right'); + } + + /** Sets the value of "border-right" */ + static void setBorderRight(CSSStyleDeclaration style, String value) { + style.setProperty('border-right', value, ''); + } + + /** Gets the value of "border-right-color" */ + static String getBorderRightColor(CSSStyleDeclaration style) { + return style.getPropertyValue('border-right-color'); + } + + /** Sets the value of "border-right-color" */ + static void setBorderRightColor(CSSStyleDeclaration style, String value) { + style.setProperty('border-right-color', value, ''); + } + + /** Gets the value of "border-right-style" */ + static String getBorderRightStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('border-right-style'); + } + + /** Sets the value of "border-right-style" */ + static void setBorderRightStyle(CSSStyleDeclaration style, String value) { + style.setProperty('border-right-style', value, ''); + } + + /** Gets the value of "border-right-width" */ + static String getBorderRightWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('border-right-width'); + } + + /** Sets the value of "border-right-width" */ + static void setBorderRightWidth(CSSStyleDeclaration style, String value) { + style.setProperty('border-right-width', value, ''); + } + + /** Gets the value of "border-spacing" */ + static String getBorderSpacing(CSSStyleDeclaration style) { + return style.getPropertyValue('border-spacing'); + } + + /** Sets the value of "border-spacing" */ + static void setBorderSpacing(CSSStyleDeclaration style, String value) { + style.setProperty('border-spacing', value, ''); + } + + /** Gets the value of "border-start" */ + static String getBorderStart(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-start'); + } + + /** Sets the value of "border-start" */ + static void setBorderStart(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-start', value, ''); + } + + /** Gets the value of "border-start-color" */ + static String getBorderStartColor(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-start-color'); + } + + /** Sets the value of "border-start-color" */ + static void setBorderStartColor(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-start-color', value, ''); + } + + /** Gets the value of "border-start-style" */ + static String getBorderStartStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-start-style'); + } + + /** Sets the value of "border-start-style" */ + static void setBorderStartStyle(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-start-style', value, ''); + } + + /** Gets the value of "border-start-width" */ + static String getBorderStartWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-start-width'); + } + + /** Sets the value of "border-start-width" */ + static void setBorderStartWidth(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-start-width', value, ''); + } + + /** Gets the value of "border-style" */ + static String getBorderStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('border-style'); + } + + /** Sets the value of "border-style" */ + static void setBorderStyle(CSSStyleDeclaration style, String value) { + style.setProperty('border-style', value, ''); + } + + /** Gets the value of "border-top" */ + static String getBorderTop(CSSStyleDeclaration style) { + return style.getPropertyValue('border-top'); + } + + /** Sets the value of "border-top" */ + static void setBorderTop(CSSStyleDeclaration style, String value) { + style.setProperty('border-top', value, ''); + } + + /** Gets the value of "border-top-color" */ + static String getBorderTopColor(CSSStyleDeclaration style) { + return style.getPropertyValue('border-top-color'); + } + + /** Sets the value of "border-top-color" */ + static void setBorderTopColor(CSSStyleDeclaration style, String value) { + style.setProperty('border-top-color', value, ''); + } + + /** Gets the value of "border-top-left-radius" */ + static String getBorderTopLeftRadius(CSSStyleDeclaration style) { + return style.getPropertyValue('border-top-left-radius'); + } + + /** Sets the value of "border-top-left-radius" */ + static void setBorderTopLeftRadius(CSSStyleDeclaration style, String value) { + style.setProperty('border-top-left-radius', value, ''); + } + + /** Gets the value of "border-top-right-radius" */ + static String getBorderTopRightRadius(CSSStyleDeclaration style) { + return style.getPropertyValue('border-top-right-radius'); + } + + /** Sets the value of "border-top-right-radius" */ + static void setBorderTopRightRadius(CSSStyleDeclaration style, String value) { + style.setProperty('border-top-right-radius', value, ''); + } + + /** Gets the value of "border-top-style" */ + static String getBorderTopStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('border-top-style'); + } + + /** Sets the value of "border-top-style" */ + static void setBorderTopStyle(CSSStyleDeclaration style, String value) { + style.setProperty('border-top-style', value, ''); + } + + /** Gets the value of "border-top-width" */ + static String getBorderTopWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('border-top-width'); + } + + /** Sets the value of "border-top-width" */ + static void setBorderTopWidth(CSSStyleDeclaration style, String value) { + style.setProperty('border-top-width', value, ''); + } + + /** Gets the value of "border-vertical-spacing" */ + static String getBorderVerticalSpacing(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}border-vertical-spacing'); + } + + /** Sets the value of "border-vertical-spacing" */ + static void setBorderVerticalSpacing(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}border-vertical-spacing', value, ''); + } + + /** Gets the value of "border-width" */ + static String getBorderWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('border-width'); + } + + /** Sets the value of "border-width" */ + static void setBorderWidth(CSSStyleDeclaration style, String value) { + style.setProperty('border-width', value, ''); + } + + /** Gets the value of "bottom" */ + static String getBottom(CSSStyleDeclaration style) { + return style.getPropertyValue('bottom'); + } + + /** Sets the value of "bottom" */ + static void setBottom(CSSStyleDeclaration style, String value) { + style.setProperty('bottom', value, ''); + } + + /** Gets the value of "box-align" */ + static String getBoxAlign(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}box-align'); + } + + /** Sets the value of "box-align" */ + static void setBoxAlign(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}box-align', value, ''); + } + + /** Gets the value of "box-direction" */ + static String getBoxDirection(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}box-direction'); + } + + /** Sets the value of "box-direction" */ + static void setBoxDirection(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}box-direction', value, ''); + } + + /** Gets the value of "box-flex" */ + static String getBoxFlex(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}box-flex'); + } + + /** Sets the value of "box-flex" */ + static void setBoxFlex(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}box-flex', value, ''); + } + + /** Gets the value of "box-flex-group" */ + static String getBoxFlexGroup(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}box-flex-group'); + } + + /** Sets the value of "box-flex-group" */ + static void setBoxFlexGroup(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}box-flex-group', value, ''); + } + + /** Gets the value of "box-lines" */ + static String getBoxLines(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}box-lines'); + } + + /** Sets the value of "box-lines" */ + static void setBoxLines(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}box-lines', value, ''); + } + + /** Gets the value of "box-ordinal-group" */ + static String getBoxOrdinalGroup(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}box-ordinal-group'); + } + + /** Sets the value of "box-ordinal-group" */ + static void setBoxOrdinalGroup(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}box-ordinal-group', value, ''); + } + + /** Gets the value of "box-orient" */ + static String getBoxOrient(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}box-orient'); + } + + /** Sets the value of "box-orient" */ + static void setBoxOrient(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}box-orient', value, ''); + } + + /** Gets the value of "box-pack" */ + static String getBoxPack(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}box-pack'); + } + + /** Sets the value of "box-pack" */ + static void setBoxPack(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}box-pack', value, ''); + } + + /** Gets the value of "box-reflect" */ + static String getBoxReflect(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}box-reflect'); + } + + /** Sets the value of "box-reflect" */ + static void setBoxReflect(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}box-reflect', value, ''); + } + + /** Gets the value of "box-shadow" */ + static String getBoxShadow(CSSStyleDeclaration style) { + return style.getPropertyValue('box-shadow'); + } + + /** Sets the value of "box-shadow" */ + static void setBoxShadow(CSSStyleDeclaration style, String value) { + style.setProperty('box-shadow', value, ''); + } + + /** Gets the value of "box-sizing" */ + static String getBoxSizing(CSSStyleDeclaration style) { + return style.getPropertyValue('box-sizing'); + } + + /** Sets the value of "box-sizing" */ + static void setBoxSizing(CSSStyleDeclaration style, String value) { + style.setProperty('box-sizing', value, ''); + } + + /** Gets the value of "caption-side" */ + static String getCaptionSide(CSSStyleDeclaration style) { + return style.getPropertyValue('caption-side'); + } + + /** Sets the value of "caption-side" */ + static void setCaptionSide(CSSStyleDeclaration style, String value) { + style.setProperty('caption-side', value, ''); + } + + /** Gets the value of "clear" */ + static String getClear(CSSStyleDeclaration style) { + return style.getPropertyValue('clear'); + } + + /** Sets the value of "clear" */ + static void setClear(CSSStyleDeclaration style, String value) { + style.setProperty('clear', value, ''); + } + + /** Gets the value of "clip" */ + static String getClip(CSSStyleDeclaration style) { + return style.getPropertyValue('clip'); + } + + /** Sets the value of "clip" */ + static void setClip(CSSStyleDeclaration style, String value) { + style.setProperty('clip', value, ''); + } + + /** Gets the value of "color" */ + static String getColor(CSSStyleDeclaration style) { + return style.getPropertyValue('color'); + } + + /** Sets the value of "color" */ + static void setColor(CSSStyleDeclaration style, String value) { + style.setProperty('color', value, ''); + } + + /** Gets the value of "color-correction" */ + static String getColorCorrection(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}color-correction'); + } + + /** Sets the value of "color-correction" */ + static void setColorCorrection(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}color-correction', value, ''); + } + + /** Gets the value of "column-break-after" */ + static String getColumnBreakAfter(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}column-break-after'); + } + + /** Sets the value of "column-break-after" */ + static void setColumnBreakAfter(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}column-break-after', value, ''); + } + + /** Gets the value of "column-break-before" */ + static String getColumnBreakBefore(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}column-break-before'); + } + + /** Sets the value of "column-break-before" */ + static void setColumnBreakBefore(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}column-break-before', value, ''); + } + + /** Gets the value of "column-break-inside" */ + static String getColumnBreakInside(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}column-break-inside'); + } + + /** Sets the value of "column-break-inside" */ + static void setColumnBreakInside(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}column-break-inside', value, ''); + } + + /** Gets the value of "column-count" */ + static String getColumnCount(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}column-count'); + } + + /** Sets the value of "column-count" */ + static void setColumnCount(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}column-count', value, ''); + } + + /** Gets the value of "column-gap" */ + static String getColumnGap(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}column-gap'); + } + + /** Sets the value of "column-gap" */ + static void setColumnGap(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}column-gap', value, ''); + } + + /** Gets the value of "column-rule" */ + static String getColumnRule(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}column-rule'); + } + + /** Sets the value of "column-rule" */ + static void setColumnRule(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}column-rule', value, ''); + } + + /** Gets the value of "column-rule-color" */ + static String getColumnRuleColor(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}column-rule-color'); + } + + /** Sets the value of "column-rule-color" */ + static void setColumnRuleColor(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}column-rule-color', value, ''); + } + + /** Gets the value of "column-rule-style" */ + static String getColumnRuleStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}column-rule-style'); + } + + /** Sets the value of "column-rule-style" */ + static void setColumnRuleStyle(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}column-rule-style', value, ''); + } + + /** Gets the value of "column-rule-width" */ + static String getColumnRuleWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}column-rule-width'); + } + + /** Sets the value of "column-rule-width" */ + static void setColumnRuleWidth(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}column-rule-width', value, ''); + } + + /** Gets the value of "column-span" */ + static String getColumnSpan(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}column-span'); + } + + /** Sets the value of "column-span" */ + static void setColumnSpan(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}column-span', value, ''); + } + + /** Gets the value of "column-width" */ + static String getColumnWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}column-width'); + } + + /** Sets the value of "column-width" */ + static void setColumnWidth(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}column-width', value, ''); + } + + /** Gets the value of "columns" */ + static String getColumns(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}columns'); + } + + /** Sets the value of "columns" */ + static void setColumns(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}columns', value, ''); + } + + /** Gets the value of "content" */ + static String getContent(CSSStyleDeclaration style) { + return style.getPropertyValue('content'); + } + + /** Sets the value of "content" */ + static void setContent(CSSStyleDeclaration style, String value) { + style.setProperty('content', value, ''); + } + + /** Gets the value of "content-order" */ + static String getContentOrder(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}content-order'); + } + + /** Sets the value of "content-order" */ + static void setContentOrder(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}content-order', value, ''); + } + + /** Gets the value of "counter-increment" */ + static String getCounterIncrement(CSSStyleDeclaration style) { + return style.getPropertyValue('counter-increment'); + } + + /** Sets the value of "counter-increment" */ + static void setCounterIncrement(CSSStyleDeclaration style, String value) { + style.setProperty('counter-increment', value, ''); + } + + /** Gets the value of "counter-reset" */ + static String getCounterReset(CSSStyleDeclaration style) { + return style.getPropertyValue('counter-reset'); + } + + /** Sets the value of "counter-reset" */ + static void setCounterReset(CSSStyleDeclaration style, String value) { + style.setProperty('counter-reset', value, ''); + } + + /** Gets the value of "cursor" */ + static String getCursor(CSSStyleDeclaration style) { + return style.getPropertyValue('cursor'); + } + + /** Sets the value of "cursor" */ + static void setCursor(CSSStyleDeclaration style, String value) { + style.setProperty('cursor', value, ''); + } + + /** Gets the value of "direction" */ + static String getDirection(CSSStyleDeclaration style) { + return style.getPropertyValue('direction'); + } + + /** Sets the value of "direction" */ + static void setDirection(CSSStyleDeclaration style, String value) { + style.setProperty('direction', value, ''); + } + + /** Gets the value of "display" */ + static String getDisplay(CSSStyleDeclaration style) { + return style.getPropertyValue('display'); + } + + /** Sets the value of "display" */ + static void setDisplay(CSSStyleDeclaration style, String value) { + style.setProperty('display', value, ''); + } + + /** Gets the value of "empty-cells" */ + static String getEmptyCells(CSSStyleDeclaration style) { + return style.getPropertyValue('empty-cells'); + } + + /** Sets the value of "empty-cells" */ + static void setEmptyCells(CSSStyleDeclaration style, String value) { + style.setProperty('empty-cells', value, ''); + } + + /** Gets the value of "filter" */ + static String getFilter(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}filter'); + } + + /** Sets the value of "filter" */ + static void setFilter(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}filter', value, ''); + } + + /** Gets the value of "flex-align" */ + static String getFlexAlign(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}flex-align'); + } + + /** Sets the value of "flex-align" */ + static void setFlexAlign(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}flex-align', value, ''); + } + + /** Gets the value of "flex-flow" */ + static String getFlexFlow(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}flex-flow'); + } + + /** Sets the value of "flex-flow" */ + static void setFlexFlow(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}flex-flow', value, ''); + } + + /** Gets the value of "flex-order" */ + static String getFlexOrder(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}flex-order'); + } + + /** Sets the value of "flex-order" */ + static void setFlexOrder(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}flex-order', value, ''); + } + + /** Gets the value of "flex-pack" */ + static String getFlexPack(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}flex-pack'); + } + + /** Sets the value of "flex-pack" */ + static void setFlexPack(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}flex-pack', value, ''); + } + + /** Gets the value of "float" */ + static String getFloat(CSSStyleDeclaration style) { + return style.getPropertyValue('float'); + } + + /** Sets the value of "float" */ + static void setFloat(CSSStyleDeclaration style, String value) { + style.setProperty('float', value, ''); + } + + /** Gets the value of "flow" */ + static String getFlow(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}flow'); + } + + /** Sets the value of "flow" */ + static void setFlow(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}flow', value, ''); + } + + /** Gets the value of "font" */ + static String getFont(CSSStyleDeclaration style) { + return style.getPropertyValue('font'); + } + + /** Sets the value of "font" */ + static void setFont(CSSStyleDeclaration style, String value) { + style.setProperty('font', value, ''); + } + + /** Gets the value of "font-family" */ + static String getFontFamily(CSSStyleDeclaration style) { + return style.getPropertyValue('font-family'); + } + + /** Sets the value of "font-family" */ + static void setFontFamily(CSSStyleDeclaration style, String value) { + style.setProperty('font-family', value, ''); + } + + /** Gets the value of "font-feature-settings" */ + static String getFontFeatureSettings(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}font-feature-settings'); + } + + /** Sets the value of "font-feature-settings" */ + static void setFontFeatureSettings(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}font-feature-settings', value, ''); + } + + /** Gets the value of "font-size" */ + static String getFontSize(CSSStyleDeclaration style) { + return style.getPropertyValue('font-size'); + } + + /** Sets the value of "font-size" */ + static void setFontSize(CSSStyleDeclaration style, String value) { + style.setProperty('font-size', value, ''); + } + + /** Gets the value of "font-size-delta" */ + static String getFontSizeDelta(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}font-size-delta'); + } + + /** Sets the value of "font-size-delta" */ + static void setFontSizeDelta(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}font-size-delta', value, ''); + } + + /** Gets the value of "font-smoothing" */ + static String getFontSmoothing(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}font-smoothing'); + } + + /** Sets the value of "font-smoothing" */ + static void setFontSmoothing(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}font-smoothing', value, ''); + } + + /** Gets the value of "font-stretch" */ + static String getFontStretch(CSSStyleDeclaration style) { + return style.getPropertyValue('font-stretch'); + } + + /** Sets the value of "font-stretch" */ + static void setFontStretch(CSSStyleDeclaration style, String value) { + style.setProperty('font-stretch', value, ''); + } + + /** Gets the value of "font-style" */ + static String getFontStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('font-style'); + } + + /** Sets the value of "font-style" */ + static void setFontStyle(CSSStyleDeclaration style, String value) { + style.setProperty('font-style', value, ''); + } + + /** Gets the value of "font-variant" */ + static String getFontVariant(CSSStyleDeclaration style) { + return style.getPropertyValue('font-variant'); + } + + /** Sets the value of "font-variant" */ + static void setFontVariant(CSSStyleDeclaration style, String value) { + style.setProperty('font-variant', value, ''); + } + + /** Gets the value of "font-weight" */ + static String getFontWeight(CSSStyleDeclaration style) { + return style.getPropertyValue('font-weight'); + } + + /** Sets the value of "font-weight" */ + static void setFontWeight(CSSStyleDeclaration style, String value) { + style.setProperty('font-weight', value, ''); + } + + /** Gets the value of "height" */ + static String getHeight(CSSStyleDeclaration style) { + return style.getPropertyValue('height'); + } + + /** Sets the value of "height" */ + static void setHeight(CSSStyleDeclaration style, String value) { + style.setProperty('height', value, ''); + } + + /** Gets the value of "highlight" */ + static String getHighlight(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}highlight'); + } + + /** Sets the value of "highlight" */ + static void setHighlight(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}highlight', value, ''); + } + + /** Gets the value of "hyphenate-character" */ + static String getHyphenateCharacter(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}hyphenate-character'); + } + + /** Sets the value of "hyphenate-character" */ + static void setHyphenateCharacter(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}hyphenate-character', value, ''); + } + + /** Gets the value of "hyphenate-limit-after" */ + static String getHyphenateLimitAfter(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}hyphenate-limit-after'); + } + + /** Sets the value of "hyphenate-limit-after" */ + static void setHyphenateLimitAfter(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}hyphenate-limit-after', value, ''); + } + + /** Gets the value of "hyphenate-limit-before" */ + static String getHyphenateLimitBefore(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}hyphenate-limit-before'); + } + + /** Sets the value of "hyphenate-limit-before" */ + static void setHyphenateLimitBefore(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}hyphenate-limit-before', value, ''); + } + + /** Gets the value of "hyphenate-limit-lines" */ + static String getHyphenateLimitLines(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}hyphenate-limit-lines'); + } + + /** Sets the value of "hyphenate-limit-lines" */ + static void setHyphenateLimitLines(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}hyphenate-limit-lines', value, ''); + } + + /** Gets the value of "hyphens" */ + static String getHyphens(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}hyphens'); + } + + /** Sets the value of "hyphens" */ + static void setHyphens(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}hyphens', value, ''); + } + + /** Gets the value of "image-rendering" */ + static String getImageRendering(CSSStyleDeclaration style) { + return style.getPropertyValue('image-rendering'); + } + + /** Sets the value of "image-rendering" */ + static void setImageRendering(CSSStyleDeclaration style, String value) { + style.setProperty('image-rendering', value, ''); + } + + /** Gets the value of "left" */ + static String getLeft(CSSStyleDeclaration style) { + return style.getPropertyValue('left'); + } + + /** Sets the value of "left" */ + static void setLeft(CSSStyleDeclaration style, String value) { + style.setProperty('left', value, ''); + } + + /** Gets the value of "letter-spacing" */ + static String getLetterSpacing(CSSStyleDeclaration style) { + return style.getPropertyValue('letter-spacing'); + } + + /** Sets the value of "letter-spacing" */ + static void setLetterSpacing(CSSStyleDeclaration style, String value) { + style.setProperty('letter-spacing', value, ''); + } + + /** Gets the value of "line-box-contain" */ + static String getLineBoxContain(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}line-box-contain'); + } + + /** Sets the value of "line-box-contain" */ + static void setLineBoxContain(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}line-box-contain', value, ''); + } + + /** Gets the value of "line-break" */ + static String getLineBreak(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}line-break'); + } + + /** Sets the value of "line-break" */ + static void setLineBreak(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}line-break', value, ''); + } + + /** Gets the value of "line-clamp" */ + static String getLineClamp(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}line-clamp'); + } + + /** Sets the value of "line-clamp" */ + static void setLineClamp(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}line-clamp', value, ''); + } + + /** Gets the value of "line-height" */ + static String getLineHeight(CSSStyleDeclaration style) { + return style.getPropertyValue('line-height'); + } + + /** Sets the value of "line-height" */ + static void setLineHeight(CSSStyleDeclaration style, String value) { + style.setProperty('line-height', value, ''); + } + + /** Gets the value of "list-style" */ + static String getListStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('list-style'); + } + + /** Sets the value of "list-style" */ + static void setListStyle(CSSStyleDeclaration style, String value) { + style.setProperty('list-style', value, ''); + } + + /** Gets the value of "list-style-image" */ + static String getListStyleImage(CSSStyleDeclaration style) { + return style.getPropertyValue('list-style-image'); + } + + /** Sets the value of "list-style-image" */ + static void setListStyleImage(CSSStyleDeclaration style, String value) { + style.setProperty('list-style-image', value, ''); + } + + /** Gets the value of "list-style-position" */ + static String getListStylePosition(CSSStyleDeclaration style) { + return style.getPropertyValue('list-style-position'); + } + + /** Sets the value of "list-style-position" */ + static void setListStylePosition(CSSStyleDeclaration style, String value) { + style.setProperty('list-style-position', value, ''); + } + + /** Gets the value of "list-style-type" */ + static String getListStyleType(CSSStyleDeclaration style) { + return style.getPropertyValue('list-style-type'); + } + + /** Sets the value of "list-style-type" */ + static void setListStyleType(CSSStyleDeclaration style, String value) { + style.setProperty('list-style-type', value, ''); + } + + /** Gets the value of "locale" */ + static String getLocale(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}locale'); + } + + /** Sets the value of "locale" */ + static void setLocale(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}locale', value, ''); + } + + /** Gets the value of "logical-height" */ + static String getLogicalHeight(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}logical-height'); + } + + /** Sets the value of "logical-height" */ + static void setLogicalHeight(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}logical-height', value, ''); + } + + /** Gets the value of "logical-width" */ + static String getLogicalWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}logical-width'); + } + + /** Sets the value of "logical-width" */ + static void setLogicalWidth(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}logical-width', value, ''); + } + + /** Gets the value of "margin" */ + static String getMargin(CSSStyleDeclaration style) { + return style.getPropertyValue('margin'); + } + + /** Sets the value of "margin" */ + static void setMargin(CSSStyleDeclaration style, String value) { + style.setProperty('margin', value, ''); + } + + /** Gets the value of "margin-after" */ + static String getMarginAfter(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}margin-after'); + } + + /** Sets the value of "margin-after" */ + static void setMarginAfter(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}margin-after', value, ''); + } + + /** Gets the value of "margin-after-collapse" */ + static String getMarginAfterCollapse(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}margin-after-collapse'); + } + + /** Sets the value of "margin-after-collapse" */ + static void setMarginAfterCollapse(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}margin-after-collapse', value, ''); + } + + /** Gets the value of "margin-before" */ + static String getMarginBefore(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}margin-before'); + } + + /** Sets the value of "margin-before" */ + static void setMarginBefore(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}margin-before', value, ''); + } + + /** Gets the value of "margin-before-collapse" */ + static String getMarginBeforeCollapse(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}margin-before-collapse'); + } + + /** Sets the value of "margin-before-collapse" */ + static void setMarginBeforeCollapse(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}margin-before-collapse', value, ''); + } + + /** Gets the value of "margin-bottom" */ + static String getMarginBottom(CSSStyleDeclaration style) { + return style.getPropertyValue('margin-bottom'); + } + + /** Sets the value of "margin-bottom" */ + static void setMarginBottom(CSSStyleDeclaration style, String value) { + style.setProperty('margin-bottom', value, ''); + } + + /** Gets the value of "margin-bottom-collapse" */ + static String getMarginBottomCollapse(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}margin-bottom-collapse'); + } + + /** Sets the value of "margin-bottom-collapse" */ + static void setMarginBottomCollapse(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}margin-bottom-collapse', value, ''); + } + + /** Gets the value of "margin-collapse" */ + static String getMarginCollapse(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}margin-collapse'); + } + + /** Sets the value of "margin-collapse" */ + static void setMarginCollapse(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}margin-collapse', value, ''); + } + + /** Gets the value of "margin-end" */ + static String getMarginEnd(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}margin-end'); + } + + /** Sets the value of "margin-end" */ + static void setMarginEnd(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}margin-end', value, ''); + } + + /** Gets the value of "margin-left" */ + static String getMarginLeft(CSSStyleDeclaration style) { + return style.getPropertyValue('margin-left'); + } + + /** Sets the value of "margin-left" */ + static void setMarginLeft(CSSStyleDeclaration style, String value) { + style.setProperty('margin-left', value, ''); + } + + /** Gets the value of "margin-right" */ + static String getMarginRight(CSSStyleDeclaration style) { + return style.getPropertyValue('margin-right'); + } + + /** Sets the value of "margin-right" */ + static void setMarginRight(CSSStyleDeclaration style, String value) { + style.setProperty('margin-right', value, ''); + } + + /** Gets the value of "margin-start" */ + static String getMarginStart(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}margin-start'); + } + + /** Sets the value of "margin-start" */ + static void setMarginStart(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}margin-start', value, ''); + } + + /** Gets the value of "margin-top" */ + static String getMarginTop(CSSStyleDeclaration style) { + return style.getPropertyValue('margin-top'); + } + + /** Sets the value of "margin-top" */ + static void setMarginTop(CSSStyleDeclaration style, String value) { + style.setProperty('margin-top', value, ''); + } + + /** Gets the value of "margin-top-collapse" */ + static String getMarginTopCollapse(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}margin-top-collapse'); + } + + /** Sets the value of "margin-top-collapse" */ + static void setMarginTopCollapse(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}margin-top-collapse', value, ''); + } + + /** Gets the value of "marquee" */ + static String getMarquee(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}marquee'); + } + + /** Sets the value of "marquee" */ + static void setMarquee(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}marquee', value, ''); + } + + /** Gets the value of "marquee-direction" */ + static String getMarqueeDirection(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}marquee-direction'); + } + + /** Sets the value of "marquee-direction" */ + static void setMarqueeDirection(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}marquee-direction', value, ''); + } + + /** Gets the value of "marquee-increment" */ + static String getMarqueeIncrement(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}marquee-increment'); + } + + /** Sets the value of "marquee-increment" */ + static void setMarqueeIncrement(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}marquee-increment', value, ''); + } + + /** Gets the value of "marquee-repetition" */ + static String getMarqueeRepetition(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}marquee-repetition'); + } + + /** Sets the value of "marquee-repetition" */ + static void setMarqueeRepetition(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}marquee-repetition', value, ''); + } + + /** Gets the value of "marquee-speed" */ + static String getMarqueeSpeed(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}marquee-speed'); + } + + /** Sets the value of "marquee-speed" */ + static void setMarqueeSpeed(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}marquee-speed', value, ''); + } + + /** Gets the value of "marquee-style" */ + static String getMarqueeStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}marquee-style'); + } + + /** Sets the value of "marquee-style" */ + static void setMarqueeStyle(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}marquee-style', value, ''); + } + + /** Gets the value of "mask" */ + static String getMask(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask'); + } + + /** Sets the value of "mask" */ + static void setMask(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask', value, ''); + } + + /** Gets the value of "mask-attachment" */ + static String getMaskAttachment(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-attachment'); + } + + /** Sets the value of "mask-attachment" */ + static void setMaskAttachment(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-attachment', value, ''); + } + + /** Gets the value of "mask-box-image" */ + static String getMaskBoxImage(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-box-image'); + } + + /** Sets the value of "mask-box-image" */ + static void setMaskBoxImage(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-box-image', value, ''); + } + + /** Gets the value of "mask-box-image-outset" */ + static String getMaskBoxImageOutset(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-box-image-outset'); + } + + /** Sets the value of "mask-box-image-outset" */ + static void setMaskBoxImageOutset(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-box-image-outset', value, ''); + } + + /** Gets the value of "mask-box-image-repeat" */ + static String getMaskBoxImageRepeat(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-box-image-repeat'); + } + + /** Sets the value of "mask-box-image-repeat" */ + static void setMaskBoxImageRepeat(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-box-image-repeat', value, ''); + } + + /** Gets the value of "mask-box-image-slice" */ + static String getMaskBoxImageSlice(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-box-image-slice'); + } + + /** Sets the value of "mask-box-image-slice" */ + static void setMaskBoxImageSlice(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-box-image-slice', value, ''); + } + + /** Gets the value of "mask-box-image-source" */ + static String getMaskBoxImageSource(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-box-image-source'); + } + + /** Sets the value of "mask-box-image-source" */ + static void setMaskBoxImageSource(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-box-image-source', value, ''); + } + + /** Gets the value of "mask-box-image-width" */ + static String getMaskBoxImageWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-box-image-width'); + } + + /** Sets the value of "mask-box-image-width" */ + static void setMaskBoxImageWidth(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-box-image-width', value, ''); + } + + /** Gets the value of "mask-clip" */ + static String getMaskClip(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-clip'); + } + + /** Sets the value of "mask-clip" */ + static void setMaskClip(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-clip', value, ''); + } + + /** Gets the value of "mask-composite" */ + static String getMaskComposite(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-composite'); + } + + /** Sets the value of "mask-composite" */ + static void setMaskComposite(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-composite', value, ''); + } + + /** Gets the value of "mask-image" */ + static String getMaskImage(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-image'); + } + + /** Sets the value of "mask-image" */ + static void setMaskImage(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-image', value, ''); + } + + /** Gets the value of "mask-origin" */ + static String getMaskOrigin(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-origin'); + } + + /** Sets the value of "mask-origin" */ + static void setMaskOrigin(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-origin', value, ''); + } + + /** Gets the value of "mask-position" */ + static String getMaskPosition(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-position'); + } + + /** Sets the value of "mask-position" */ + static void setMaskPosition(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-position', value, ''); + } + + /** Gets the value of "mask-position-x" */ + static String getMaskPositionX(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-position-x'); + } + + /** Sets the value of "mask-position-x" */ + static void setMaskPositionX(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-position-x', value, ''); + } + + /** Gets the value of "mask-position-y" */ + static String getMaskPositionY(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-position-y'); + } + + /** Sets the value of "mask-position-y" */ + static void setMaskPositionY(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-position-y', value, ''); + } + + /** Gets the value of "mask-repeat" */ + static String getMaskRepeat(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-repeat'); + } + + /** Sets the value of "mask-repeat" */ + static void setMaskRepeat(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-repeat', value, ''); + } + + /** Gets the value of "mask-repeat-x" */ + static String getMaskRepeatX(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-repeat-x'); + } + + /** Sets the value of "mask-repeat-x" */ + static void setMaskRepeatX(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-repeat-x', value, ''); + } + + /** Gets the value of "mask-repeat-y" */ + static String getMaskRepeatY(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-repeat-y'); + } + + /** Sets the value of "mask-repeat-y" */ + static void setMaskRepeatY(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-repeat-y', value, ''); + } + + /** Gets the value of "mask-size" */ + static String getMaskSize(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}mask-size'); + } + + /** Sets the value of "mask-size" */ + static void setMaskSize(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}mask-size', value, ''); + } + + /** Gets the value of "match-nearest-mail-blockquote-color" */ + static String getMatchNearestMailBlockquoteColor(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}match-nearest-mail-blockquote-color'); + } + + /** Sets the value of "match-nearest-mail-blockquote-color" */ + static void setMatchNearestMailBlockquoteColor(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}match-nearest-mail-blockquote-color', value, ''); + } + + /** Gets the value of "max-height" */ + static String getMaxHeight(CSSStyleDeclaration style) { + return style.getPropertyValue('max-height'); + } + + /** Sets the value of "max-height" */ + static void setMaxHeight(CSSStyleDeclaration style, String value) { + style.setProperty('max-height', value, ''); + } + + /** Gets the value of "max-logical-height" */ + static String getMaxLogicalHeight(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}max-logical-height'); + } + + /** Sets the value of "max-logical-height" */ + static void setMaxLogicalHeight(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}max-logical-height', value, ''); + } + + /** Gets the value of "max-logical-width" */ + static String getMaxLogicalWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}max-logical-width'); + } + + /** Sets the value of "max-logical-width" */ + static void setMaxLogicalWidth(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}max-logical-width', value, ''); + } + + /** Gets the value of "max-width" */ + static String getMaxWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('max-width'); + } + + /** Sets the value of "max-width" */ + static void setMaxWidth(CSSStyleDeclaration style, String value) { + style.setProperty('max-width', value, ''); + } + + /** Gets the value of "min-height" */ + static String getMinHeight(CSSStyleDeclaration style) { + return style.getPropertyValue('min-height'); + } + + /** Sets the value of "min-height" */ + static void setMinHeight(CSSStyleDeclaration style, String value) { + style.setProperty('min-height', value, ''); + } + + /** Gets the value of "min-logical-height" */ + static String getMinLogicalHeight(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}min-logical-height'); + } + + /** Sets the value of "min-logical-height" */ + static void setMinLogicalHeight(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}min-logical-height', value, ''); + } + + /** Gets the value of "min-logical-width" */ + static String getMinLogicalWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}min-logical-width'); + } + + /** Sets the value of "min-logical-width" */ + static void setMinLogicalWidth(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}min-logical-width', value, ''); + } + + /** Gets the value of "min-width" */ + static String getMinWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('min-width'); + } + + /** Sets the value of "min-width" */ + static void setMinWidth(CSSStyleDeclaration style, String value) { + style.setProperty('min-width', value, ''); + } + + /** Gets the value of "nbsp-mode" */ + static String getNbspMode(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}nbsp-mode'); + } + + /** Sets the value of "nbsp-mode" */ + static void setNbspMode(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}nbsp-mode', value, ''); + } + + /** Gets the value of "opacity" */ + static String getOpacity(CSSStyleDeclaration style) { + return style.getPropertyValue('opacity'); + } + + /** Sets the value of "opacity" */ + static void setOpacity(CSSStyleDeclaration style, String value) { + style.setProperty('opacity', value, ''); + } + + /** Gets the value of "orphans" */ + static String getOrphans(CSSStyleDeclaration style) { + return style.getPropertyValue('orphans'); + } + + /** Sets the value of "orphans" */ + static void setOrphans(CSSStyleDeclaration style, String value) { + style.setProperty('orphans', value, ''); + } + + /** Gets the value of "outline" */ + static String getOutline(CSSStyleDeclaration style) { + return style.getPropertyValue('outline'); + } + + /** Sets the value of "outline" */ + static void setOutline(CSSStyleDeclaration style, String value) { + style.setProperty('outline', value, ''); + } + + /** Gets the value of "outline-color" */ + static String getOutlineColor(CSSStyleDeclaration style) { + return style.getPropertyValue('outline-color'); + } + + /** Sets the value of "outline-color" */ + static void setOutlineColor(CSSStyleDeclaration style, String value) { + style.setProperty('outline-color', value, ''); + } + + /** Gets the value of "outline-offset" */ + static String getOutlineOffset(CSSStyleDeclaration style) { + return style.getPropertyValue('outline-offset'); + } + + /** Sets the value of "outline-offset" */ + static void setOutlineOffset(CSSStyleDeclaration style, String value) { + style.setProperty('outline-offset', value, ''); + } + + /** Gets the value of "outline-style" */ + static String getOutlineStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('outline-style'); + } + + /** Sets the value of "outline-style" */ + static void setOutlineStyle(CSSStyleDeclaration style, String value) { + style.setProperty('outline-style', value, ''); + } + + /** Gets the value of "outline-width" */ + static String getOutlineWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('outline-width'); + } + + /** Sets the value of "outline-width" */ + static void setOutlineWidth(CSSStyleDeclaration style, String value) { + style.setProperty('outline-width', value, ''); + } + + /** Gets the value of "overflow" */ + static String getOverflow(CSSStyleDeclaration style) { + return style.getPropertyValue('overflow'); + } + + /** Sets the value of "overflow" */ + static void setOverflow(CSSStyleDeclaration style, String value) { + style.setProperty('overflow', value, ''); + } + + /** Gets the value of "overflow-x" */ + static String getOverflowX(CSSStyleDeclaration style) { + return style.getPropertyValue('overflow-x'); + } + + /** Sets the value of "overflow-x" */ + static void setOverflowX(CSSStyleDeclaration style, String value) { + style.setProperty('overflow-x', value, ''); + } + + /** Gets the value of "overflow-y" */ + static String getOverflowY(CSSStyleDeclaration style) { + return style.getPropertyValue('overflow-y'); + } + + /** Sets the value of "overflow-y" */ + static void setOverflowY(CSSStyleDeclaration style, String value) { + style.setProperty('overflow-y', value, ''); + } + + /** Gets the value of "padding" */ + static String getPadding(CSSStyleDeclaration style) { + return style.getPropertyValue('padding'); + } + + /** Sets the value of "padding" */ + static void setPadding(CSSStyleDeclaration style, String value) { + style.setProperty('padding', value, ''); + } + + /** Gets the value of "padding-after" */ + static String getPaddingAfter(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}padding-after'); + } + + /** Sets the value of "padding-after" */ + static void setPaddingAfter(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}padding-after', value, ''); + } + + /** Gets the value of "padding-before" */ + static String getPaddingBefore(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}padding-before'); + } + + /** Sets the value of "padding-before" */ + static void setPaddingBefore(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}padding-before', value, ''); + } + + /** Gets the value of "padding-bottom" */ + static String getPaddingBottom(CSSStyleDeclaration style) { + return style.getPropertyValue('padding-bottom'); + } + + /** Sets the value of "padding-bottom" */ + static void setPaddingBottom(CSSStyleDeclaration style, String value) { + style.setProperty('padding-bottom', value, ''); + } + + /** Gets the value of "padding-end" */ + static String getPaddingEnd(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}padding-end'); + } + + /** Sets the value of "padding-end" */ + static void setPaddingEnd(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}padding-end', value, ''); + } + + /** Gets the value of "padding-left" */ + static String getPaddingLeft(CSSStyleDeclaration style) { + return style.getPropertyValue('padding-left'); + } + + /** Sets the value of "padding-left" */ + static void setPaddingLeft(CSSStyleDeclaration style, String value) { + style.setProperty('padding-left', value, ''); + } + + /** Gets the value of "padding-right" */ + static String getPaddingRight(CSSStyleDeclaration style) { + return style.getPropertyValue('padding-right'); + } + + /** Sets the value of "padding-right" */ + static void setPaddingRight(CSSStyleDeclaration style, String value) { + style.setProperty('padding-right', value, ''); + } + + /** Gets the value of "padding-start" */ + static String getPaddingStart(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}padding-start'); + } + + /** Sets the value of "padding-start" */ + static void setPaddingStart(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}padding-start', value, ''); + } + + /** Gets the value of "padding-top" */ + static String getPaddingTop(CSSStyleDeclaration style) { + return style.getPropertyValue('padding-top'); + } + + /** Sets the value of "padding-top" */ + static void setPaddingTop(CSSStyleDeclaration style, String value) { + style.setProperty('padding-top', value, ''); + } + + /** Gets the value of "page" */ + static String getPage(CSSStyleDeclaration style) { + return style.getPropertyValue('page'); + } + + /** Sets the value of "page" */ + static void setPage(CSSStyleDeclaration style, String value) { + style.setProperty('page', value, ''); + } + + /** Gets the value of "page-break-after" */ + static String getPageBreakAfter(CSSStyleDeclaration style) { + return style.getPropertyValue('page-break-after'); + } + + /** Sets the value of "page-break-after" */ + static void setPageBreakAfter(CSSStyleDeclaration style, String value) { + style.setProperty('page-break-after', value, ''); + } + + /** Gets the value of "page-break-before" */ + static String getPageBreakBefore(CSSStyleDeclaration style) { + return style.getPropertyValue('page-break-before'); + } + + /** Sets the value of "page-break-before" */ + static void setPageBreakBefore(CSSStyleDeclaration style, String value) { + style.setProperty('page-break-before', value, ''); + } + + /** Gets the value of "page-break-inside" */ + static String getPageBreakInside(CSSStyleDeclaration style) { + return style.getPropertyValue('page-break-inside'); + } + + /** Sets the value of "page-break-inside" */ + static void setPageBreakInside(CSSStyleDeclaration style, String value) { + style.setProperty('page-break-inside', value, ''); + } + + /** Gets the value of "perspective" */ + static String getPerspective(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}perspective'); + } + + /** Sets the value of "perspective" */ + static void setPerspective(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}perspective', value, ''); + } + + /** Gets the value of "perspective-origin" */ + static String getPerspectiveOrigin(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}perspective-origin'); + } + + /** Sets the value of "perspective-origin" */ + static void setPerspectiveOrigin(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}perspective-origin', value, ''); + } + + /** Gets the value of "perspective-origin-x" */ + static String getPerspectiveOriginX(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}perspective-origin-x'); + } + + /** Sets the value of "perspective-origin-x" */ + static void setPerspectiveOriginX(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}perspective-origin-x', value, ''); + } + + /** Gets the value of "perspective-origin-y" */ + static String getPerspectiveOriginY(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}perspective-origin-y'); + } + + /** Sets the value of "perspective-origin-y" */ + static void setPerspectiveOriginY(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}perspective-origin-y', value, ''); + } + + /** Gets the value of "pointer-events" */ + static String getPointerEvents(CSSStyleDeclaration style) { + return style.getPropertyValue('pointer-events'); + } + + /** Sets the value of "pointer-events" */ + static void setPointerEvents(CSSStyleDeclaration style, String value) { + style.setProperty('pointer-events', value, ''); + } + + /** Gets the value of "position" */ + static String getPosition(CSSStyleDeclaration style) { + return style.getPropertyValue('position'); + } + + /** Sets the value of "position" */ + static void setPosition(CSSStyleDeclaration style, String value) { + style.setProperty('position', value, ''); + } + + /** Gets the value of "quotes" */ + static String getQuotes(CSSStyleDeclaration style) { + return style.getPropertyValue('quotes'); + } + + /** Sets the value of "quotes" */ + static void setQuotes(CSSStyleDeclaration style, String value) { + style.setProperty('quotes', value, ''); + } + + /** Gets the value of "region-break-after" */ + static String getRegionBreakAfter(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}region-break-after'); + } + + /** Sets the value of "region-break-after" */ + static void setRegionBreakAfter(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}region-break-after', value, ''); + } + + /** Gets the value of "region-break-before" */ + static String getRegionBreakBefore(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}region-break-before'); + } + + /** Sets the value of "region-break-before" */ + static void setRegionBreakBefore(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}region-break-before', value, ''); + } + + /** Gets the value of "region-break-inside" */ + static String getRegionBreakInside(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}region-break-inside'); + } + + /** Sets the value of "region-break-inside" */ + static void setRegionBreakInside(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}region-break-inside', value, ''); + } + + /** Gets the value of "region-overflow" */ + static String getRegionOverflow(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}region-overflow'); + } + + /** Sets the value of "region-overflow" */ + static void setRegionOverflow(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}region-overflow', value, ''); + } + + /** Gets the value of "resize" */ + static String getResize(CSSStyleDeclaration style) { + return style.getPropertyValue('resize'); + } + + /** Sets the value of "resize" */ + static void setResize(CSSStyleDeclaration style, String value) { + style.setProperty('resize', value, ''); + } + + /** Gets the value of "right" */ + static String getRight(CSSStyleDeclaration style) { + return style.getPropertyValue('right'); + } + + /** Sets the value of "right" */ + static void setRight(CSSStyleDeclaration style, String value) { + style.setProperty('right', value, ''); + } + + /** Gets the value of "rtl-ordering" */ + static String getRtlOrdering(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}rtl-ordering'); + } + + /** Sets the value of "rtl-ordering" */ + static void setRtlOrdering(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}rtl-ordering', value, ''); + } + + /** Gets the value of "size" */ + static String getSize(CSSStyleDeclaration style) { + return style.getPropertyValue('size'); + } + + /** Sets the value of "size" */ + static void setSize(CSSStyleDeclaration style, String value) { + style.setProperty('size', value, ''); + } + + /** Gets the value of "speak" */ + static String getSpeak(CSSStyleDeclaration style) { + return style.getPropertyValue('speak'); + } + + /** Sets the value of "speak" */ + static void setSpeak(CSSStyleDeclaration style, String value) { + style.setProperty('speak', value, ''); + } + + /** Gets the value of "src" */ + static String getSrc(CSSStyleDeclaration style) { + return style.getPropertyValue('src'); + } + + /** Sets the value of "src" */ + static void setSrc(CSSStyleDeclaration style, String value) { + style.setProperty('src', value, ''); + } + + /** Gets the value of "table-layout" */ + static String getTableLayout(CSSStyleDeclaration style) { + return style.getPropertyValue('table-layout'); + } + + /** Sets the value of "table-layout" */ + static void setTableLayout(CSSStyleDeclaration style, String value) { + style.setProperty('table-layout', value, ''); + } + + /** Gets the value of "text-align" */ + static String getTextAlign(CSSStyleDeclaration style) { + return style.getPropertyValue('text-align'); + } + + /** Sets the value of "text-align" */ + static void setTextAlign(CSSStyleDeclaration style, String value) { + style.setProperty('text-align', value, ''); + } + + /** Gets the value of "text-combine" */ + static String getTextCombine(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-combine'); + } + + /** Sets the value of "text-combine" */ + static void setTextCombine(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-combine', value, ''); + } + + /** Gets the value of "text-decoration" */ + static String getTextDecoration(CSSStyleDeclaration style) { + return style.getPropertyValue('text-decoration'); + } + + /** Sets the value of "text-decoration" */ + static void setTextDecoration(CSSStyleDeclaration style, String value) { + style.setProperty('text-decoration', value, ''); + } + + /** Gets the value of "text-decorations-in-effect" */ + static String getTextDecorationsInEffect(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-decorations-in-effect'); + } + + /** Sets the value of "text-decorations-in-effect" */ + static void setTextDecorationsInEffect(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-decorations-in-effect', value, ''); + } + + /** Gets the value of "text-emphasis" */ + static String getTextEmphasis(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-emphasis'); + } + + /** Sets the value of "text-emphasis" */ + static void setTextEmphasis(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-emphasis', value, ''); + } + + /** Gets the value of "text-emphasis-color" */ + static String getTextEmphasisColor(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-emphasis-color'); + } + + /** Sets the value of "text-emphasis-color" */ + static void setTextEmphasisColor(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-emphasis-color', value, ''); + } + + /** Gets the value of "text-emphasis-position" */ + static String getTextEmphasisPosition(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-emphasis-position'); + } + + /** Sets the value of "text-emphasis-position" */ + static void setTextEmphasisPosition(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-emphasis-position', value, ''); + } + + /** Gets the value of "text-emphasis-style" */ + static String getTextEmphasisStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-emphasis-style'); + } + + /** Sets the value of "text-emphasis-style" */ + static void setTextEmphasisStyle(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-emphasis-style', value, ''); + } + + /** Gets the value of "text-fill-color" */ + static String getTextFillColor(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-fill-color'); + } + + /** Sets the value of "text-fill-color" */ + static void setTextFillColor(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-fill-color', value, ''); + } + + /** Gets the value of "text-indent" */ + static String getTextIndent(CSSStyleDeclaration style) { + return style.getPropertyValue('text-indent'); + } + + /** Sets the value of "text-indent" */ + static void setTextIndent(CSSStyleDeclaration style, String value) { + style.setProperty('text-indent', value, ''); + } + + /** Gets the value of "text-line-through" */ + static String getTextLineThrough(CSSStyleDeclaration style) { + return style.getPropertyValue('text-line-through'); + } + + /** Sets the value of "text-line-through" */ + static void setTextLineThrough(CSSStyleDeclaration style, String value) { + style.setProperty('text-line-through', value, ''); + } + + /** Gets the value of "text-line-through-color" */ + static String getTextLineThroughColor(CSSStyleDeclaration style) { + return style.getPropertyValue('text-line-through-color'); + } + + /** Sets the value of "text-line-through-color" */ + static void setTextLineThroughColor(CSSStyleDeclaration style, String value) { + style.setProperty('text-line-through-color', value, ''); + } + + /** Gets the value of "text-line-through-mode" */ + static String getTextLineThroughMode(CSSStyleDeclaration style) { + return style.getPropertyValue('text-line-through-mode'); + } + + /** Sets the value of "text-line-through-mode" */ + static void setTextLineThroughMode(CSSStyleDeclaration style, String value) { + style.setProperty('text-line-through-mode', value, ''); + } + + /** Gets the value of "text-line-through-style" */ + static String getTextLineThroughStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('text-line-through-style'); + } + + /** Sets the value of "text-line-through-style" */ + static void setTextLineThroughStyle(CSSStyleDeclaration style, String value) { + style.setProperty('text-line-through-style', value, ''); + } + + /** Gets the value of "text-line-through-width" */ + static String getTextLineThroughWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('text-line-through-width'); + } + + /** Sets the value of "text-line-through-width" */ + static void setTextLineThroughWidth(CSSStyleDeclaration style, String value) { + style.setProperty('text-line-through-width', value, ''); + } + + /** Gets the value of "text-orientation" */ + static String getTextOrientation(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-orientation'); + } + + /** Sets the value of "text-orientation" */ + static void setTextOrientation(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-orientation', value, ''); + } + + /** Gets the value of "text-overflow" */ + static String getTextOverflow(CSSStyleDeclaration style) { + return style.getPropertyValue('text-overflow'); + } + + /** Sets the value of "text-overflow" */ + static void setTextOverflow(CSSStyleDeclaration style, String value) { + style.setProperty('text-overflow', value, ''); + } + + /** Gets the value of "text-overline" */ + static String getTextOverline(CSSStyleDeclaration style) { + return style.getPropertyValue('text-overline'); + } + + /** Sets the value of "text-overline" */ + static void setTextOverline(CSSStyleDeclaration style, String value) { + style.setProperty('text-overline', value, ''); + } + + /** Gets the value of "text-overline-color" */ + static String getTextOverlineColor(CSSStyleDeclaration style) { + return style.getPropertyValue('text-overline-color'); + } + + /** Sets the value of "text-overline-color" */ + static void setTextOverlineColor(CSSStyleDeclaration style, String value) { + style.setProperty('text-overline-color', value, ''); + } + + /** Gets the value of "text-overline-mode" */ + static String getTextOverlineMode(CSSStyleDeclaration style) { + return style.getPropertyValue('text-overline-mode'); + } + + /** Sets the value of "text-overline-mode" */ + static void setTextOverlineMode(CSSStyleDeclaration style, String value) { + style.setProperty('text-overline-mode', value, ''); + } + + /** Gets the value of "text-overline-style" */ + static String getTextOverlineStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('text-overline-style'); + } + + /** Sets the value of "text-overline-style" */ + static void setTextOverlineStyle(CSSStyleDeclaration style, String value) { + style.setProperty('text-overline-style', value, ''); + } + + /** Gets the value of "text-overline-width" */ + static String getTextOverlineWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('text-overline-width'); + } + + /** Sets the value of "text-overline-width" */ + static void setTextOverlineWidth(CSSStyleDeclaration style, String value) { + style.setProperty('text-overline-width', value, ''); + } + + /** Gets the value of "text-rendering" */ + static String getTextRendering(CSSStyleDeclaration style) { + return style.getPropertyValue('text-rendering'); + } + + /** Sets the value of "text-rendering" */ + static void setTextRendering(CSSStyleDeclaration style, String value) { + style.setProperty('text-rendering', value, ''); + } + + /** Gets the value of "text-security" */ + static String getTextSecurity(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-security'); + } + + /** Sets the value of "text-security" */ + static void setTextSecurity(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-security', value, ''); + } + + /** Gets the value of "text-shadow" */ + static String getTextShadow(CSSStyleDeclaration style) { + return style.getPropertyValue('text-shadow'); + } + + /** Sets the value of "text-shadow" */ + static void setTextShadow(CSSStyleDeclaration style, String value) { + style.setProperty('text-shadow', value, ''); + } + + /** Gets the value of "text-size-adjust" */ + static String getTextSizeAdjust(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-size-adjust'); + } + + /** Sets the value of "text-size-adjust" */ + static void setTextSizeAdjust(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-size-adjust', value, ''); + } + + /** Gets the value of "text-stroke" */ + static String getTextStroke(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-stroke'); + } + + /** Sets the value of "text-stroke" */ + static void setTextStroke(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-stroke', value, ''); + } + + /** Gets the value of "text-stroke-color" */ + static String getTextStrokeColor(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-stroke-color'); + } + + /** Sets the value of "text-stroke-color" */ + static void setTextStrokeColor(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-stroke-color', value, ''); + } + + /** Gets the value of "text-stroke-width" */ + static String getTextStrokeWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}text-stroke-width'); + } + + /** Sets the value of "text-stroke-width" */ + static void setTextStrokeWidth(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}text-stroke-width', value, ''); + } + + /** Gets the value of "text-transform" */ + static String getTextTransform(CSSStyleDeclaration style) { + return style.getPropertyValue('text-transform'); + } + + /** Sets the value of "text-transform" */ + static void setTextTransform(CSSStyleDeclaration style, String value) { + style.setProperty('text-transform', value, ''); + } + + /** Gets the value of "text-underline" */ + static String getTextUnderline(CSSStyleDeclaration style) { + return style.getPropertyValue('text-underline'); + } + + /** Sets the value of "text-underline" */ + static void setTextUnderline(CSSStyleDeclaration style, String value) { + style.setProperty('text-underline', value, ''); + } + + /** Gets the value of "text-underline-color" */ + static String getTextUnderlineColor(CSSStyleDeclaration style) { + return style.getPropertyValue('text-underline-color'); + } + + /** Sets the value of "text-underline-color" */ + static void setTextUnderlineColor(CSSStyleDeclaration style, String value) { + style.setProperty('text-underline-color', value, ''); + } + + /** Gets the value of "text-underline-mode" */ + static String getTextUnderlineMode(CSSStyleDeclaration style) { + return style.getPropertyValue('text-underline-mode'); + } + + /** Sets the value of "text-underline-mode" */ + static void setTextUnderlineMode(CSSStyleDeclaration style, String value) { + style.setProperty('text-underline-mode', value, ''); + } + + /** Gets the value of "text-underline-style" */ + static String getTextUnderlineStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('text-underline-style'); + } + + /** Sets the value of "text-underline-style" */ + static void setTextUnderlineStyle(CSSStyleDeclaration style, String value) { + style.setProperty('text-underline-style', value, ''); + } + + /** Gets the value of "text-underline-width" */ + static String getTextUnderlineWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('text-underline-width'); + } + + /** Sets the value of "text-underline-width" */ + static void setTextUnderlineWidth(CSSStyleDeclaration style, String value) { + style.setProperty('text-underline-width', value, ''); + } + + /** Gets the value of "top" */ + static String getTop(CSSStyleDeclaration style) { + return style.getPropertyValue('top'); + } + + /** Sets the value of "top" */ + static void setTop(CSSStyleDeclaration style, String value) { + style.setProperty('top', value, ''); + } + + /** Gets the value of "transform" */ + static String getTransform(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}transform'); + } + + /** Sets the value of "transform" */ + static void setTransform(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}transform', value, ''); + } + + /** Gets the value of "transform-origin" */ + static String getTransformOrigin(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}transform-origin'); + } + + /** Sets the value of "transform-origin" */ + static void setTransformOrigin(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}transform-origin', value, ''); + } + + /** Gets the value of "transform-origin-x" */ + static String getTransformOriginX(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}transform-origin-x'); + } + + /** Sets the value of "transform-origin-x" */ + static void setTransformOriginX(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}transform-origin-x', value, ''); + } + + /** Gets the value of "transform-origin-y" */ + static String getTransformOriginY(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}transform-origin-y'); + } + + /** Sets the value of "transform-origin-y" */ + static void setTransformOriginY(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}transform-origin-y', value, ''); + } + + /** Gets the value of "transform-origin-z" */ + static String getTransformOriginZ(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}transform-origin-z'); + } + + /** Sets the value of "transform-origin-z" */ + static void setTransformOriginZ(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}transform-origin-z', value, ''); + } + + /** Gets the value of "transform-style" */ + static String getTransformStyle(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}transform-style'); + } + + /** Sets the value of "transform-style" */ + static void setTransformStyle(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}transform-style', value, ''); + } + + /** Gets the value of "transition" */ + static String getTransition(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}transition'); + } + + /** Sets the value of "transition" */ + static void setTransition(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}transition', value, ''); + } + + /** Gets the value of "transition-delay" */ + static String getTransitionDelay(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}transition-delay'); + } + + /** Sets the value of "transition-delay" */ + static void setTransitionDelay(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}transition-delay', value, ''); + } + + /** Gets the value of "transition-duration" */ + static String getTransitionDuration(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}transition-duration'); + } + + /** Sets the value of "transition-duration" */ + static void setTransitionDuration(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}transition-duration', value, ''); + } + + /** Gets the value of "transition-property" */ + static String getTransitionProperty(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}transition-property'); + } + + /** Sets the value of "transition-property" */ + static void setTransitionProperty(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}transition-property', value, ''); + } + + /** Gets the value of "transition-timing-function" */ + static String getTransitionTimingFunction(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}transition-timing-function'); + } + + /** Sets the value of "transition-timing-function" */ + static void setTransitionTimingFunction(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}transition-timing-function', value, ''); + } + + /** Gets the value of "unicode-bidi" */ + static String getUnicodeBidi(CSSStyleDeclaration style) { + return style.getPropertyValue('unicode-bidi'); + } + + /** Sets the value of "unicode-bidi" */ + static void setUnicodeBidi(CSSStyleDeclaration style, String value) { + style.setProperty('unicode-bidi', value, ''); + } + + /** Gets the value of "unicode-range" */ + static String getUnicodeRange(CSSStyleDeclaration style) { + return style.getPropertyValue('unicode-range'); + } + + /** Sets the value of "unicode-range" */ + static void setUnicodeRange(CSSStyleDeclaration style, String value) { + style.setProperty('unicode-range', value, ''); + } + + /** Gets the value of "user-drag" */ + static String getUserDrag(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}user-drag'); + } + + /** Sets the value of "user-drag" */ + static void setUserDrag(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}user-drag', value, ''); + } + + /** Gets the value of "user-modify" */ + static String getUserModify(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}user-modify'); + } + + /** Sets the value of "user-modify" */ + static void setUserModify(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}user-modify', value, ''); + } + + /** Gets the value of "user-select" */ + static String getUserSelect(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}user-select'); + } + + /** Sets the value of "user-select" */ + static void setUserSelect(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}user-select', value, ''); + } + + /** Gets the value of "vertical-align" */ + static String getVerticalAlign(CSSStyleDeclaration style) { + return style.getPropertyValue('vertical-align'); + } + + /** Sets the value of "vertical-align" */ + static void setVerticalAlign(CSSStyleDeclaration style, String value) { + style.setProperty('vertical-align', value, ''); + } + + /** Gets the value of "visibility" */ + static String getVisibility(CSSStyleDeclaration style) { + return style.getPropertyValue('visibility'); + } + + /** Sets the value of "visibility" */ + static void setVisibility(CSSStyleDeclaration style, String value) { + style.setProperty('visibility', value, ''); + } + + /** Gets the value of "white-space" */ + static String getWhiteSpace(CSSStyleDeclaration style) { + return style.getPropertyValue('white-space'); + } + + /** Sets the value of "white-space" */ + static void setWhiteSpace(CSSStyleDeclaration style, String value) { + style.setProperty('white-space', value, ''); + } + + /** Gets the value of "widows" */ + static String getWidows(CSSStyleDeclaration style) { + return style.getPropertyValue('widows'); + } + + /** Sets the value of "widows" */ + static void setWidows(CSSStyleDeclaration style, String value) { + style.setProperty('widows', value, ''); + } + + /** Gets the value of "width" */ + static String getWidth(CSSStyleDeclaration style) { + return style.getPropertyValue('width'); + } + + /** Sets the value of "width" */ + static void setWidth(CSSStyleDeclaration style, String value) { + style.setProperty('width', value, ''); + } + + /** Gets the value of "word-break" */ + static String getWordBreak(CSSStyleDeclaration style) { + return style.getPropertyValue('word-break'); + } + + /** Sets the value of "word-break" */ + static void setWordBreak(CSSStyleDeclaration style, String value) { + style.setProperty('word-break', value, ''); + } + + /** Gets the value of "word-spacing" */ + static String getWordSpacing(CSSStyleDeclaration style) { + return style.getPropertyValue('word-spacing'); + } + + /** Sets the value of "word-spacing" */ + static void setWordSpacing(CSSStyleDeclaration style, String value) { + style.setProperty('word-spacing', value, ''); + } + + /** Gets the value of "word-wrap" */ + static String getWordWrap(CSSStyleDeclaration style) { + return style.getPropertyValue('word-wrap'); + } + + /** Sets the value of "word-wrap" */ + static void setWordWrap(CSSStyleDeclaration style, String value) { + style.setProperty('word-wrap', value, ''); + } + + /** Gets the value of "wrap-shape" */ + static String getWrapShape(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}wrap-shape'); + } + + /** Sets the value of "wrap-shape" */ + static void setWrapShape(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}wrap-shape', value, ''); + } + + /** Gets the value of "writing-mode" */ + static String getWritingMode(CSSStyleDeclaration style) { + return style.getPropertyValue('${_browserPrefix}writing-mode'); + } + + /** Sets the value of "writing-mode" */ + static void setWritingMode(CSSStyleDeclaration style, String value) { + style.setProperty('${_browserPrefix}writing-mode', value, ''); + } + + /** Gets the value of "z-index" */ + static String getZIndex(CSSStyleDeclaration style) { + return style.getPropertyValue('z-index'); + } + + /** Sets the value of "z-index" */ + static void setZIndex(CSSStyleDeclaration style, String value) { + style.setProperty('z-index', value, ''); + } + + /** Gets the value of "zoom" */ + static String getZoom(CSSStyleDeclaration style) { + return style.getPropertyValue('zoom'); + } + + /** Sets the value of "zoom" */ + static void setZoom(CSSStyleDeclaration style, String value) { + style.setProperty('zoom', value, ''); + } + + /** Gets the value of "animation" */ + String get animation() { + return getAnimation(raw); + } + + /** Sets the value of "animation" */ + void set animation(String value) { + setAnimation(raw, value); + } + + /** Gets the value of "animation-delay" */ + String get animationDelay() { + return getAnimationDelay(raw); + } + + /** Sets the value of "animation-delay" */ + void set animationDelay(String value) { + setAnimationDelay(raw, value); + } + + /** Gets the value of "animation-direction" */ + String get animationDirection() { + return getAnimationDirection(raw); + } + + /** Sets the value of "animation-direction" */ + void set animationDirection(String value) { + setAnimationDirection(raw, value); + } + + /** Gets the value of "animation-duration" */ + String get animationDuration() { + return getAnimationDuration(raw); + } + + /** Sets the value of "animation-duration" */ + void set animationDuration(String value) { + setAnimationDuration(raw, value); + } + + /** Gets the value of "animation-fill-mode" */ + String get animationFillMode() { + return getAnimationFillMode(raw); + } + + /** Sets the value of "animation-fill-mode" */ + void set animationFillMode(String value) { + setAnimationFillMode(raw, value); + } + + /** Gets the value of "animation-iteration-count" */ + String get animationIterationCount() { + return getAnimationIterationCount(raw); + } + + /** Sets the value of "animation-iteration-count" */ + void set animationIterationCount(String value) { + setAnimationIterationCount(raw, value); + } + + /** Gets the value of "animation-name" */ + String get animationName() { + return getAnimationName(raw); + } + + /** Sets the value of "animation-name" */ + void set animationName(String value) { + setAnimationName(raw, value); + } + + /** Gets the value of "animation-play-state" */ + String get animationPlayState() { + return getAnimationPlayState(raw); + } + + /** Sets the value of "animation-play-state" */ + void set animationPlayState(String value) { + setAnimationPlayState(raw, value); + } + + /** Gets the value of "animation-timing-function" */ + String get animationTimingFunction() { + return getAnimationTimingFunction(raw); + } + + /** Sets the value of "animation-timing-function" */ + void set animationTimingFunction(String value) { + setAnimationTimingFunction(raw, value); + } + + /** Gets the value of "appearance" */ + String get appearance() { + return getAppearance(raw); + } + + /** Sets the value of "appearance" */ + void set appearance(String value) { + setAppearance(raw, value); + } + + /** Gets the value of "backface-visibility" */ + String get backfaceVisibility() { + return getBackfaceVisibility(raw); + } + + /** Sets the value of "backface-visibility" */ + void set backfaceVisibility(String value) { + setBackfaceVisibility(raw, value); + } + + /** Gets the value of "background" */ + String get background() { + return getBackground(raw); + } + + /** Sets the value of "background" */ + void set background(String value) { + setBackground(raw, value); + } + + /** Gets the value of "background-attachment" */ + String get backgroundAttachment() { + return getBackgroundAttachment(raw); + } + + /** Sets the value of "background-attachment" */ + void set backgroundAttachment(String value) { + setBackgroundAttachment(raw, value); + } + + /** Gets the value of "background-clip" */ + String get backgroundClip() { + return getBackgroundClip(raw); + } + + /** Sets the value of "background-clip" */ + void set backgroundClip(String value) { + setBackgroundClip(raw, value); + } + + /** Gets the value of "background-color" */ + String get backgroundColor() { + return getBackgroundColor(raw); + } + + /** Sets the value of "background-color" */ + void set backgroundColor(String value) { + setBackgroundColor(raw, value); + } + + /** Gets the value of "background-composite" */ + String get backgroundComposite() { + return getBackgroundComposite(raw); + } + + /** Sets the value of "background-composite" */ + void set backgroundComposite(String value) { + setBackgroundComposite(raw, value); + } + + /** Gets the value of "background-image" */ + String get backgroundImage() { + return getBackgroundImage(raw); + } + + /** Sets the value of "background-image" */ + void set backgroundImage(String value) { + setBackgroundImage(raw, value); + } + + /** Gets the value of "background-origin" */ + String get backgroundOrigin() { + return getBackgroundOrigin(raw); + } + + /** Sets the value of "background-origin" */ + void set backgroundOrigin(String value) { + setBackgroundOrigin(raw, value); + } + + /** Gets the value of "background-position" */ + String get backgroundPosition() { + return getBackgroundPosition(raw); + } + + /** Sets the value of "background-position" */ + void set backgroundPosition(String value) { + setBackgroundPosition(raw, value); + } + + /** Gets the value of "background-position-x" */ + String get backgroundPositionX() { + return getBackgroundPositionX(raw); + } + + /** Sets the value of "background-position-x" */ + void set backgroundPositionX(String value) { + setBackgroundPositionX(raw, value); + } + + /** Gets the value of "background-position-y" */ + String get backgroundPositionY() { + return getBackgroundPositionY(raw); + } + + /** Sets the value of "background-position-y" */ + void set backgroundPositionY(String value) { + setBackgroundPositionY(raw, value); + } + + /** Gets the value of "background-repeat" */ + String get backgroundRepeat() { + return getBackgroundRepeat(raw); + } + + /** Sets the value of "background-repeat" */ + void set backgroundRepeat(String value) { + setBackgroundRepeat(raw, value); + } + + /** Gets the value of "background-repeat-x" */ + String get backgroundRepeatX() { + return getBackgroundRepeatX(raw); + } + + /** Sets the value of "background-repeat-x" */ + void set backgroundRepeatX(String value) { + setBackgroundRepeatX(raw, value); + } + + /** Gets the value of "background-repeat-y" */ + String get backgroundRepeatY() { + return getBackgroundRepeatY(raw); + } + + /** Sets the value of "background-repeat-y" */ + void set backgroundRepeatY(String value) { + setBackgroundRepeatY(raw, value); + } + + /** Gets the value of "background-size" */ + String get backgroundSize() { + return getBackgroundSize(raw); + } + + /** Sets the value of "background-size" */ + void set backgroundSize(String value) { + setBackgroundSize(raw, value); + } + + /** Gets the value of "border" */ + String get border() { + return getBorder(raw); + } + + /** Sets the value of "border" */ + void set border(String value) { + setBorder(raw, value); + } + + /** Gets the value of "border-after" */ + String get borderAfter() { + return getBorderAfter(raw); + } + + /** Sets the value of "border-after" */ + void set borderAfter(String value) { + setBorderAfter(raw, value); + } + + /** Gets the value of "border-after-color" */ + String get borderAfterColor() { + return getBorderAfterColor(raw); + } + + /** Sets the value of "border-after-color" */ + void set borderAfterColor(String value) { + setBorderAfterColor(raw, value); + } + + /** Gets the value of "border-after-style" */ + String get borderAfterStyle() { + return getBorderAfterStyle(raw); + } + + /** Sets the value of "border-after-style" */ + void set borderAfterStyle(String value) { + setBorderAfterStyle(raw, value); + } + + /** Gets the value of "border-after-width" */ + String get borderAfterWidth() { + return getBorderAfterWidth(raw); + } + + /** Sets the value of "border-after-width" */ + void set borderAfterWidth(String value) { + setBorderAfterWidth(raw, value); + } + + /** Gets the value of "border-before" */ + String get borderBefore() { + return getBorderBefore(raw); + } + + /** Sets the value of "border-before" */ + void set borderBefore(String value) { + setBorderBefore(raw, value); + } + + /** Gets the value of "border-before-color" */ + String get borderBeforeColor() { + return getBorderBeforeColor(raw); + } + + /** Sets the value of "border-before-color" */ + void set borderBeforeColor(String value) { + setBorderBeforeColor(raw, value); + } + + /** Gets the value of "border-before-style" */ + String get borderBeforeStyle() { + return getBorderBeforeStyle(raw); + } + + /** Sets the value of "border-before-style" */ + void set borderBeforeStyle(String value) { + setBorderBeforeStyle(raw, value); + } + + /** Gets the value of "border-before-width" */ + String get borderBeforeWidth() { + return getBorderBeforeWidth(raw); + } + + /** Sets the value of "border-before-width" */ + void set borderBeforeWidth(String value) { + setBorderBeforeWidth(raw, value); + } + + /** Gets the value of "border-bottom" */ + String get borderBottom() { + return getBorderBottom(raw); + } + + /** Sets the value of "border-bottom" */ + void set borderBottom(String value) { + setBorderBottom(raw, value); + } + + /** Gets the value of "border-bottom-color" */ + String get borderBottomColor() { + return getBorderBottomColor(raw); + } + + /** Sets the value of "border-bottom-color" */ + void set borderBottomColor(String value) { + setBorderBottomColor(raw, value); + } + + /** Gets the value of "border-bottom-left-radius" */ + String get borderBottomLeftRadius() { + return getBorderBottomLeftRadius(raw); + } + + /** Sets the value of "border-bottom-left-radius" */ + void set borderBottomLeftRadius(String value) { + setBorderBottomLeftRadius(raw, value); + } + + /** Gets the value of "border-bottom-right-radius" */ + String get borderBottomRightRadius() { + return getBorderBottomRightRadius(raw); + } + + /** Sets the value of "border-bottom-right-radius" */ + void set borderBottomRightRadius(String value) { + setBorderBottomRightRadius(raw, value); + } + + /** Gets the value of "border-bottom-style" */ + String get borderBottomStyle() { + return getBorderBottomStyle(raw); + } + + /** Sets the value of "border-bottom-style" */ + void set borderBottomStyle(String value) { + setBorderBottomStyle(raw, value); + } + + /** Gets the value of "border-bottom-width" */ + String get borderBottomWidth() { + return getBorderBottomWidth(raw); + } + + /** Sets the value of "border-bottom-width" */ + void set borderBottomWidth(String value) { + setBorderBottomWidth(raw, value); + } + + /** Gets the value of "border-collapse" */ + String get borderCollapse() { + return getBorderCollapse(raw); + } + + /** Sets the value of "border-collapse" */ + void set borderCollapse(String value) { + setBorderCollapse(raw, value); + } + + /** Gets the value of "border-color" */ + String get borderColor() { + return getBorderColor(raw); + } + + /** Sets the value of "border-color" */ + void set borderColor(String value) { + setBorderColor(raw, value); + } + + /** Gets the value of "border-end" */ + String get borderEnd() { + return getBorderEnd(raw); + } + + /** Sets the value of "border-end" */ + void set borderEnd(String value) { + setBorderEnd(raw, value); + } + + /** Gets the value of "border-end-color" */ + String get borderEndColor() { + return getBorderEndColor(raw); + } + + /** Sets the value of "border-end-color" */ + void set borderEndColor(String value) { + setBorderEndColor(raw, value); + } + + /** Gets the value of "border-end-style" */ + String get borderEndStyle() { + return getBorderEndStyle(raw); + } + + /** Sets the value of "border-end-style" */ + void set borderEndStyle(String value) { + setBorderEndStyle(raw, value); + } + + /** Gets the value of "border-end-width" */ + String get borderEndWidth() { + return getBorderEndWidth(raw); + } + + /** Sets the value of "border-end-width" */ + void set borderEndWidth(String value) { + setBorderEndWidth(raw, value); + } + + /** Gets the value of "border-fit" */ + String get borderFit() { + return getBorderFit(raw); + } + + /** Sets the value of "border-fit" */ + void set borderFit(String value) { + setBorderFit(raw, value); + } + + /** Gets the value of "border-horizontal-spacing" */ + String get borderHorizontalSpacing() { + return getBorderHorizontalSpacing(raw); + } + + /** Sets the value of "border-horizontal-spacing" */ + void set borderHorizontalSpacing(String value) { + setBorderHorizontalSpacing(raw, value); + } + + /** Gets the value of "border-image" */ + String get borderImage() { + return getBorderImage(raw); + } + + /** Sets the value of "border-image" */ + void set borderImage(String value) { + setBorderImage(raw, value); + } + + /** Gets the value of "border-image-outset" */ + String get borderImageOutset() { + return getBorderImageOutset(raw); + } + + /** Sets the value of "border-image-outset" */ + void set borderImageOutset(String value) { + setBorderImageOutset(raw, value); + } + + /** Gets the value of "border-image-repeat" */ + String get borderImageRepeat() { + return getBorderImageRepeat(raw); + } + + /** Sets the value of "border-image-repeat" */ + void set borderImageRepeat(String value) { + setBorderImageRepeat(raw, value); + } + + /** Gets the value of "border-image-slice" */ + String get borderImageSlice() { + return getBorderImageSlice(raw); + } + + /** Sets the value of "border-image-slice" */ + void set borderImageSlice(String value) { + setBorderImageSlice(raw, value); + } + + /** Gets the value of "border-image-source" */ + String get borderImageSource() { + return getBorderImageSource(raw); + } + + /** Sets the value of "border-image-source" */ + void set borderImageSource(String value) { + setBorderImageSource(raw, value); + } + + /** Gets the value of "border-image-width" */ + String get borderImageWidth() { + return getBorderImageWidth(raw); + } + + /** Sets the value of "border-image-width" */ + void set borderImageWidth(String value) { + setBorderImageWidth(raw, value); + } + + /** Gets the value of "border-left" */ + String get borderLeft() { + return getBorderLeft(raw); + } + + /** Sets the value of "border-left" */ + void set borderLeft(String value) { + setBorderLeft(raw, value); + } + + /** Gets the value of "border-left-color" */ + String get borderLeftColor() { + return getBorderLeftColor(raw); + } + + /** Sets the value of "border-left-color" */ + void set borderLeftColor(String value) { + setBorderLeftColor(raw, value); + } + + /** Gets the value of "border-left-style" */ + String get borderLeftStyle() { + return getBorderLeftStyle(raw); + } + + /** Sets the value of "border-left-style" */ + void set borderLeftStyle(String value) { + setBorderLeftStyle(raw, value); + } + + /** Gets the value of "border-left-width" */ + String get borderLeftWidth() { + return getBorderLeftWidth(raw); + } + + /** Sets the value of "border-left-width" */ + void set borderLeftWidth(String value) { + setBorderLeftWidth(raw, value); + } + + /** Gets the value of "border-radius" */ + String get borderRadius() { + return getBorderRadius(raw); + } + + /** Sets the value of "border-radius" */ + void set borderRadius(String value) { + setBorderRadius(raw, value); + } + + /** Gets the value of "border-right" */ + String get borderRight() { + return getBorderRight(raw); + } + + /** Sets the value of "border-right" */ + void set borderRight(String value) { + setBorderRight(raw, value); + } + + /** Gets the value of "border-right-color" */ + String get borderRightColor() { + return getBorderRightColor(raw); + } + + /** Sets the value of "border-right-color" */ + void set borderRightColor(String value) { + setBorderRightColor(raw, value); + } + + /** Gets the value of "border-right-style" */ + String get borderRightStyle() { + return getBorderRightStyle(raw); + } + + /** Sets the value of "border-right-style" */ + void set borderRightStyle(String value) { + setBorderRightStyle(raw, value); + } + + /** Gets the value of "border-right-width" */ + String get borderRightWidth() { + return getBorderRightWidth(raw); + } + + /** Sets the value of "border-right-width" */ + void set borderRightWidth(String value) { + setBorderRightWidth(raw, value); + } + + /** Gets the value of "border-spacing" */ + String get borderSpacing() { + return getBorderSpacing(raw); + } + + /** Sets the value of "border-spacing" */ + void set borderSpacing(String value) { + setBorderSpacing(raw, value); + } + + /** Gets the value of "border-start" */ + String get borderStart() { + return getBorderStart(raw); + } + + /** Sets the value of "border-start" */ + void set borderStart(String value) { + setBorderStart(raw, value); + } + + /** Gets the value of "border-start-color" */ + String get borderStartColor() { + return getBorderStartColor(raw); + } + + /** Sets the value of "border-start-color" */ + void set borderStartColor(String value) { + setBorderStartColor(raw, value); + } + + /** Gets the value of "border-start-style" */ + String get borderStartStyle() { + return getBorderStartStyle(raw); + } + + /** Sets the value of "border-start-style" */ + void set borderStartStyle(String value) { + setBorderStartStyle(raw, value); + } + + /** Gets the value of "border-start-width" */ + String get borderStartWidth() { + return getBorderStartWidth(raw); + } + + /** Sets the value of "border-start-width" */ + void set borderStartWidth(String value) { + setBorderStartWidth(raw, value); + } + + /** Gets the value of "border-style" */ + String get borderStyle() { + return getBorderStyle(raw); + } + + /** Sets the value of "border-style" */ + void set borderStyle(String value) { + setBorderStyle(raw, value); + } + + /** Gets the value of "border-top" */ + String get borderTop() { + return getBorderTop(raw); + } + + /** Sets the value of "border-top" */ + void set borderTop(String value) { + setBorderTop(raw, value); + } + + /** Gets the value of "border-top-color" */ + String get borderTopColor() { + return getBorderTopColor(raw); + } + + /** Sets the value of "border-top-color" */ + void set borderTopColor(String value) { + setBorderTopColor(raw, value); + } + + /** Gets the value of "border-top-left-radius" */ + String get borderTopLeftRadius() { + return getBorderTopLeftRadius(raw); + } + + /** Sets the value of "border-top-left-radius" */ + void set borderTopLeftRadius(String value) { + setBorderTopLeftRadius(raw, value); + } + + /** Gets the value of "border-top-right-radius" */ + String get borderTopRightRadius() { + return getBorderTopRightRadius(raw); + } + + /** Sets the value of "border-top-right-radius" */ + void set borderTopRightRadius(String value) { + setBorderTopRightRadius(raw, value); + } + + /** Gets the value of "border-top-style" */ + String get borderTopStyle() { + return getBorderTopStyle(raw); + } + + /** Sets the value of "border-top-style" */ + void set borderTopStyle(String value) { + setBorderTopStyle(raw, value); + } + + /** Gets the value of "border-top-width" */ + String get borderTopWidth() { + return getBorderTopWidth(raw); + } + + /** Sets the value of "border-top-width" */ + void set borderTopWidth(String value) { + setBorderTopWidth(raw, value); + } + + /** Gets the value of "border-vertical-spacing" */ + String get borderVerticalSpacing() { + return getBorderVerticalSpacing(raw); + } + + /** Sets the value of "border-vertical-spacing" */ + void set borderVerticalSpacing(String value) { + setBorderVerticalSpacing(raw, value); + } + + /** Gets the value of "border-width" */ + String get borderWidth() { + return getBorderWidth(raw); + } + + /** Sets the value of "border-width" */ + void set borderWidth(String value) { + setBorderWidth(raw, value); + } + + /** Gets the value of "bottom" */ + String get bottom() { + return getBottom(raw); + } + + /** Sets the value of "bottom" */ + void set bottom(String value) { + setBottom(raw, value); + } + + /** Gets the value of "box-align" */ + String get boxAlign() { + return getBoxAlign(raw); + } + + /** Sets the value of "box-align" */ + void set boxAlign(String value) { + setBoxAlign(raw, value); + } + + /** Gets the value of "box-direction" */ + String get boxDirection() { + return getBoxDirection(raw); + } + + /** Sets the value of "box-direction" */ + void set boxDirection(String value) { + setBoxDirection(raw, value); + } + + /** Gets the value of "box-flex" */ + String get boxFlex() { + return getBoxFlex(raw); + } + + /** Sets the value of "box-flex" */ + void set boxFlex(String value) { + setBoxFlex(raw, value); + } + + /** Gets the value of "box-flex-group" */ + String get boxFlexGroup() { + return getBoxFlexGroup(raw); + } + + /** Sets the value of "box-flex-group" */ + void set boxFlexGroup(String value) { + setBoxFlexGroup(raw, value); + } + + /** Gets the value of "box-lines" */ + String get boxLines() { + return getBoxLines(raw); + } + + /** Sets the value of "box-lines" */ + void set boxLines(String value) { + setBoxLines(raw, value); + } + + /** Gets the value of "box-ordinal-group" */ + String get boxOrdinalGroup() { + return getBoxOrdinalGroup(raw); + } + + /** Sets the value of "box-ordinal-group" */ + void set boxOrdinalGroup(String value) { + setBoxOrdinalGroup(raw, value); + } + + /** Gets the value of "box-orient" */ + String get boxOrient() { + return getBoxOrient(raw); + } + + /** Sets the value of "box-orient" */ + void set boxOrient(String value) { + setBoxOrient(raw, value); + } + + /** Gets the value of "box-pack" */ + String get boxPack() { + return getBoxPack(raw); + } + + /** Sets the value of "box-pack" */ + void set boxPack(String value) { + setBoxPack(raw, value); + } + + /** Gets the value of "box-reflect" */ + String get boxReflect() { + return getBoxReflect(raw); + } + + /** Sets the value of "box-reflect" */ + void set boxReflect(String value) { + setBoxReflect(raw, value); + } + + /** Gets the value of "box-shadow" */ + String get boxShadow() { + return getBoxShadow(raw); + } + + /** Sets the value of "box-shadow" */ + void set boxShadow(String value) { + setBoxShadow(raw, value); + } + + /** Gets the value of "box-sizing" */ + String get boxSizing() { + return getBoxSizing(raw); + } + + /** Sets the value of "box-sizing" */ + void set boxSizing(String value) { + setBoxSizing(raw, value); + } + + /** Gets the value of "caption-side" */ + String get captionSide() { + return getCaptionSide(raw); + } + + /** Sets the value of "caption-side" */ + void set captionSide(String value) { + setCaptionSide(raw, value); + } + + /** Gets the value of "clear" */ + String get clear() { + return getClear(raw); + } + + /** Sets the value of "clear" */ + void set clear(String value) { + setClear(raw, value); + } + + /** Gets the value of "clip" */ + String get clip() { + return getClip(raw); + } + + /** Sets the value of "clip" */ + void set clip(String value) { + setClip(raw, value); + } + + /** Gets the value of "color" */ + String get color() { + return getColor(raw); + } + + /** Sets the value of "color" */ + void set color(String value) { + setColor(raw, value); + } + + /** Gets the value of "color-correction" */ + String get colorCorrection() { + return getColorCorrection(raw); + } + + /** Sets the value of "color-correction" */ + void set colorCorrection(String value) { + setColorCorrection(raw, value); + } + + /** Gets the value of "column-break-after" */ + String get columnBreakAfter() { + return getColumnBreakAfter(raw); + } + + /** Sets the value of "column-break-after" */ + void set columnBreakAfter(String value) { + setColumnBreakAfter(raw, value); + } + + /** Gets the value of "column-break-before" */ + String get columnBreakBefore() { + return getColumnBreakBefore(raw); + } + + /** Sets the value of "column-break-before" */ + void set columnBreakBefore(String value) { + setColumnBreakBefore(raw, value); + } + + /** Gets the value of "column-break-inside" */ + String get columnBreakInside() { + return getColumnBreakInside(raw); + } + + /** Sets the value of "column-break-inside" */ + void set columnBreakInside(String value) { + setColumnBreakInside(raw, value); + } + + /** Gets the value of "column-count" */ + String get columnCount() { + return getColumnCount(raw); + } + + /** Sets the value of "column-count" */ + void set columnCount(String value) { + setColumnCount(raw, value); + } + + /** Gets the value of "column-gap" */ + String get columnGap() { + return getColumnGap(raw); + } + + /** Sets the value of "column-gap" */ + void set columnGap(String value) { + setColumnGap(raw, value); + } + + /** Gets the value of "column-rule" */ + String get columnRule() { + return getColumnRule(raw); + } + + /** Sets the value of "column-rule" */ + void set columnRule(String value) { + setColumnRule(raw, value); + } + + /** Gets the value of "column-rule-color" */ + String get columnRuleColor() { + return getColumnRuleColor(raw); + } + + /** Sets the value of "column-rule-color" */ + void set columnRuleColor(String value) { + setColumnRuleColor(raw, value); + } + + /** Gets the value of "column-rule-style" */ + String get columnRuleStyle() { + return getColumnRuleStyle(raw); + } + + /** Sets the value of "column-rule-style" */ + void set columnRuleStyle(String value) { + setColumnRuleStyle(raw, value); + } + + /** Gets the value of "column-rule-width" */ + String get columnRuleWidth() { + return getColumnRuleWidth(raw); + } + + /** Sets the value of "column-rule-width" */ + void set columnRuleWidth(String value) { + setColumnRuleWidth(raw, value); + } + + /** Gets the value of "column-span" */ + String get columnSpan() { + return getColumnSpan(raw); + } + + /** Sets the value of "column-span" */ + void set columnSpan(String value) { + setColumnSpan(raw, value); + } + + /** Gets the value of "column-width" */ + String get columnWidth() { + return getColumnWidth(raw); + } + + /** Sets the value of "column-width" */ + void set columnWidth(String value) { + setColumnWidth(raw, value); + } + + /** Gets the value of "columns" */ + String get columns() { + return getColumns(raw); + } + + /** Sets the value of "columns" */ + void set columns(String value) { + setColumns(raw, value); + } + + /** Gets the value of "content" */ + String get content() { + return getContent(raw); + } + + /** Sets the value of "content" */ + void set content(String value) { + setContent(raw, value); + } + + /** Gets the value of "content-order" */ + String get contentOrder() { + return getContentOrder(raw); + } + + /** Sets the value of "content-order" */ + void set contentOrder(String value) { + setContentOrder(raw, value); + } + + /** Gets the value of "counter-increment" */ + String get counterIncrement() { + return getCounterIncrement(raw); + } + + /** Sets the value of "counter-increment" */ + void set counterIncrement(String value) { + setCounterIncrement(raw, value); + } + + /** Gets the value of "counter-reset" */ + String get counterReset() { + return getCounterReset(raw); + } + + /** Sets the value of "counter-reset" */ + void set counterReset(String value) { + setCounterReset(raw, value); + } + + /** Gets the value of "cursor" */ + String get cursor() { + return getCursor(raw); + } + + /** Sets the value of "cursor" */ + void set cursor(String value) { + setCursor(raw, value); + } + + /** Gets the value of "direction" */ + String get direction() { + return getDirection(raw); + } + + /** Sets the value of "direction" */ + void set direction(String value) { + setDirection(raw, value); + } + + /** Gets the value of "display" */ + String get display() { + return getDisplay(raw); + } + + /** Sets the value of "display" */ + void set display(String value) { + setDisplay(raw, value); + } + + /** Gets the value of "empty-cells" */ + String get emptyCells() { + return getEmptyCells(raw); + } + + /** Sets the value of "empty-cells" */ + void set emptyCells(String value) { + setEmptyCells(raw, value); + } + + /** Gets the value of "filter" */ + String get filter() { + return getFilter(raw); + } + + /** Sets the value of "filter" */ + void set filter(String value) { + setFilter(raw, value); + } + + /** Gets the value of "flex-align" */ + String get flexAlign() { + return getFlexAlign(raw); + } + + /** Sets the value of "flex-align" */ + void set flexAlign(String value) { + setFlexAlign(raw, value); + } + + /** Gets the value of "flex-flow" */ + String get flexFlow() { + return getFlexFlow(raw); + } + + /** Sets the value of "flex-flow" */ + void set flexFlow(String value) { + setFlexFlow(raw, value); + } + + /** Gets the value of "flex-order" */ + String get flexOrder() { + return getFlexOrder(raw); + } + + /** Sets the value of "flex-order" */ + void set flexOrder(String value) { + setFlexOrder(raw, value); + } + + /** Gets the value of "flex-pack" */ + String get flexPack() { + return getFlexPack(raw); + } + + /** Sets the value of "flex-pack" */ + void set flexPack(String value) { + setFlexPack(raw, value); + } + + /** Gets the value of "float" */ + String get float() { + return getFloat(raw); + } + + /** Sets the value of "float" */ + void set float(String value) { + setFloat(raw, value); + } + + /** Gets the value of "flow" */ + String get flow() { + return getFlow(raw); + } + + /** Sets the value of "flow" */ + void set flow(String value) { + setFlow(raw, value); + } + + /** Gets the value of "font" */ + String get font() { + return getFont(raw); + } + + /** Sets the value of "font" */ + void set font(String value) { + setFont(raw, value); + } + + /** Gets the value of "font-family" */ + String get fontFamily() { + return getFontFamily(raw); + } + + /** Sets the value of "font-family" */ + void set fontFamily(String value) { + setFontFamily(raw, value); + } + + /** Gets the value of "font-feature-settings" */ + String get fontFeatureSettings() { + return getFontFeatureSettings(raw); + } + + /** Sets the value of "font-feature-settings" */ + void set fontFeatureSettings(String value) { + setFontFeatureSettings(raw, value); + } + + /** Gets the value of "font-size" */ + String get fontSize() { + return getFontSize(raw); + } + + /** Sets the value of "font-size" */ + void set fontSize(String value) { + setFontSize(raw, value); + } + + /** Gets the value of "font-size-delta" */ + String get fontSizeDelta() { + return getFontSizeDelta(raw); + } + + /** Sets the value of "font-size-delta" */ + void set fontSizeDelta(String value) { + setFontSizeDelta(raw, value); + } + + /** Gets the value of "font-smoothing" */ + String get fontSmoothing() { + return getFontSmoothing(raw); + } + + /** Sets the value of "font-smoothing" */ + void set fontSmoothing(String value) { + setFontSmoothing(raw, value); + } + + /** Gets the value of "font-stretch" */ + String get fontStretch() { + return getFontStretch(raw); + } + + /** Sets the value of "font-stretch" */ + void set fontStretch(String value) { + setFontStretch(raw, value); + } + + /** Gets the value of "font-style" */ + String get fontStyle() { + return getFontStyle(raw); + } + + /** Sets the value of "font-style" */ + void set fontStyle(String value) { + setFontStyle(raw, value); + } + + /** Gets the value of "font-variant" */ + String get fontVariant() { + return getFontVariant(raw); + } + + /** Sets the value of "font-variant" */ + void set fontVariant(String value) { + setFontVariant(raw, value); + } + + /** Gets the value of "font-weight" */ + String get fontWeight() { + return getFontWeight(raw); + } + + /** Sets the value of "font-weight" */ + void set fontWeight(String value) { + setFontWeight(raw, value); + } + + /** Gets the value of "height" */ + String get height() { + return getHeight(raw); + } + + /** Sets the value of "height" */ + void set height(String value) { + setHeight(raw, value); + } + + /** Gets the value of "highlight" */ + String get highlight() { + return getHighlight(raw); + } + + /** Sets the value of "highlight" */ + void set highlight(String value) { + setHighlight(raw, value); + } + + /** Gets the value of "hyphenate-character" */ + String get hyphenateCharacter() { + return getHyphenateCharacter(raw); + } + + /** Sets the value of "hyphenate-character" */ + void set hyphenateCharacter(String value) { + setHyphenateCharacter(raw, value); + } + + /** Gets the value of "hyphenate-limit-after" */ + String get hyphenateLimitAfter() { + return getHyphenateLimitAfter(raw); + } + + /** Sets the value of "hyphenate-limit-after" */ + void set hyphenateLimitAfter(String value) { + setHyphenateLimitAfter(raw, value); + } + + /** Gets the value of "hyphenate-limit-before" */ + String get hyphenateLimitBefore() { + return getHyphenateLimitBefore(raw); + } + + /** Sets the value of "hyphenate-limit-before" */ + void set hyphenateLimitBefore(String value) { + setHyphenateLimitBefore(raw, value); + } + + /** Gets the value of "hyphenate-limit-lines" */ + String get hyphenateLimitLines() { + return getHyphenateLimitLines(raw); + } + + /** Sets the value of "hyphenate-limit-lines" */ + void set hyphenateLimitLines(String value) { + setHyphenateLimitLines(raw, value); + } + + /** Gets the value of "hyphens" */ + String get hyphens() { + return getHyphens(raw); + } + + /** Sets the value of "hyphens" */ + void set hyphens(String value) { + setHyphens(raw, value); + } + + /** Gets the value of "image-rendering" */ + String get imageRendering() { + return getImageRendering(raw); + } + + /** Sets the value of "image-rendering" */ + void set imageRendering(String value) { + setImageRendering(raw, value); + } + + /** Gets the value of "left" */ + String get left() { + return getLeft(raw); + } + + /** Sets the value of "left" */ + void set left(String value) { + setLeft(raw, value); + } + + /** Gets the value of "letter-spacing" */ + String get letterSpacing() { + return getLetterSpacing(raw); + } + + /** Sets the value of "letter-spacing" */ + void set letterSpacing(String value) { + setLetterSpacing(raw, value); + } + + /** Gets the value of "line-box-contain" */ + String get lineBoxContain() { + return getLineBoxContain(raw); + } + + /** Sets the value of "line-box-contain" */ + void set lineBoxContain(String value) { + setLineBoxContain(raw, value); + } + + /** Gets the value of "line-break" */ + String get lineBreak() { + return getLineBreak(raw); + } + + /** Sets the value of "line-break" */ + void set lineBreak(String value) { + setLineBreak(raw, value); + } + + /** Gets the value of "line-clamp" */ + String get lineClamp() { + return getLineClamp(raw); + } + + /** Sets the value of "line-clamp" */ + void set lineClamp(String value) { + setLineClamp(raw, value); + } + + /** Gets the value of "line-height" */ + String get lineHeight() { + return getLineHeight(raw); + } + + /** Sets the value of "line-height" */ + void set lineHeight(String value) { + setLineHeight(raw, value); + } + + /** Gets the value of "list-style" */ + String get listStyle() { + return getListStyle(raw); + } + + /** Sets the value of "list-style" */ + void set listStyle(String value) { + setListStyle(raw, value); + } + + /** Gets the value of "list-style-image" */ + String get listStyleImage() { + return getListStyleImage(raw); + } + + /** Sets the value of "list-style-image" */ + void set listStyleImage(String value) { + setListStyleImage(raw, value); + } + + /** Gets the value of "list-style-position" */ + String get listStylePosition() { + return getListStylePosition(raw); + } + + /** Sets the value of "list-style-position" */ + void set listStylePosition(String value) { + setListStylePosition(raw, value); + } + + /** Gets the value of "list-style-type" */ + String get listStyleType() { + return getListStyleType(raw); + } + + /** Sets the value of "list-style-type" */ + void set listStyleType(String value) { + setListStyleType(raw, value); + } + + /** Gets the value of "locale" */ + String get locale() { + return getLocale(raw); + } + + /** Sets the value of "locale" */ + void set locale(String value) { + setLocale(raw, value); + } + + /** Gets the value of "logical-height" */ + String get logicalHeight() { + return getLogicalHeight(raw); + } + + /** Sets the value of "logical-height" */ + void set logicalHeight(String value) { + setLogicalHeight(raw, value); + } + + /** Gets the value of "logical-width" */ + String get logicalWidth() { + return getLogicalWidth(raw); + } + + /** Sets the value of "logical-width" */ + void set logicalWidth(String value) { + setLogicalWidth(raw, value); + } + + /** Gets the value of "margin" */ + String get margin() { + return getMargin(raw); + } + + /** Sets the value of "margin" */ + void set margin(String value) { + setMargin(raw, value); + } + + /** Gets the value of "margin-after" */ + String get marginAfter() { + return getMarginAfter(raw); + } + + /** Sets the value of "margin-after" */ + void set marginAfter(String value) { + setMarginAfter(raw, value); + } + + /** Gets the value of "margin-after-collapse" */ + String get marginAfterCollapse() { + return getMarginAfterCollapse(raw); + } + + /** Sets the value of "margin-after-collapse" */ + void set marginAfterCollapse(String value) { + setMarginAfterCollapse(raw, value); + } + + /** Gets the value of "margin-before" */ + String get marginBefore() { + return getMarginBefore(raw); + } + + /** Sets the value of "margin-before" */ + void set marginBefore(String value) { + setMarginBefore(raw, value); + } + + /** Gets the value of "margin-before-collapse" */ + String get marginBeforeCollapse() { + return getMarginBeforeCollapse(raw); + } + + /** Sets the value of "margin-before-collapse" */ + void set marginBeforeCollapse(String value) { + setMarginBeforeCollapse(raw, value); + } + + /** Gets the value of "margin-bottom" */ + String get marginBottom() { + return getMarginBottom(raw); + } + + /** Sets the value of "margin-bottom" */ + void set marginBottom(String value) { + setMarginBottom(raw, value); + } + + /** Gets the value of "margin-bottom-collapse" */ + String get marginBottomCollapse() { + return getMarginBottomCollapse(raw); + } + + /** Sets the value of "margin-bottom-collapse" */ + void set marginBottomCollapse(String value) { + setMarginBottomCollapse(raw, value); + } + + /** Gets the value of "margin-collapse" */ + String get marginCollapse() { + return getMarginCollapse(raw); + } + + /** Sets the value of "margin-collapse" */ + void set marginCollapse(String value) { + setMarginCollapse(raw, value); + } + + /** Gets the value of "margin-end" */ + String get marginEnd() { + return getMarginEnd(raw); + } + + /** Sets the value of "margin-end" */ + void set marginEnd(String value) { + setMarginEnd(raw, value); + } + + /** Gets the value of "margin-left" */ + String get marginLeft() { + return getMarginLeft(raw); + } + + /** Sets the value of "margin-left" */ + void set marginLeft(String value) { + setMarginLeft(raw, value); + } + + /** Gets the value of "margin-right" */ + String get marginRight() { + return getMarginRight(raw); + } + + /** Sets the value of "margin-right" */ + void set marginRight(String value) { + setMarginRight(raw, value); + } + + /** Gets the value of "margin-start" */ + String get marginStart() { + return getMarginStart(raw); + } + + /** Sets the value of "margin-start" */ + void set marginStart(String value) { + setMarginStart(raw, value); + } + + /** Gets the value of "margin-top" */ + String get marginTop() { + return getMarginTop(raw); + } + + /** Sets the value of "margin-top" */ + void set marginTop(String value) { + setMarginTop(raw, value); + } + + /** Gets the value of "margin-top-collapse" */ + String get marginTopCollapse() { + return getMarginTopCollapse(raw); + } + + /** Sets the value of "margin-top-collapse" */ + void set marginTopCollapse(String value) { + setMarginTopCollapse(raw, value); + } + + /** Gets the value of "marquee" */ + String get marquee() { + return getMarquee(raw); + } + + /** Sets the value of "marquee" */ + void set marquee(String value) { + setMarquee(raw, value); + } + + /** Gets the value of "marquee-direction" */ + String get marqueeDirection() { + return getMarqueeDirection(raw); + } + + /** Sets the value of "marquee-direction" */ + void set marqueeDirection(String value) { + setMarqueeDirection(raw, value); + } + + /** Gets the value of "marquee-increment" */ + String get marqueeIncrement() { + return getMarqueeIncrement(raw); + } + + /** Sets the value of "marquee-increment" */ + void set marqueeIncrement(String value) { + setMarqueeIncrement(raw, value); + } + + /** Gets the value of "marquee-repetition" */ + String get marqueeRepetition() { + return getMarqueeRepetition(raw); + } + + /** Sets the value of "marquee-repetition" */ + void set marqueeRepetition(String value) { + setMarqueeRepetition(raw, value); + } + + /** Gets the value of "marquee-speed" */ + String get marqueeSpeed() { + return getMarqueeSpeed(raw); + } + + /** Sets the value of "marquee-speed" */ + void set marqueeSpeed(String value) { + setMarqueeSpeed(raw, value); + } + + /** Gets the value of "marquee-style" */ + String get marqueeStyle() { + return getMarqueeStyle(raw); + } + + /** Sets the value of "marquee-style" */ + void set marqueeStyle(String value) { + setMarqueeStyle(raw, value); + } + + /** Gets the value of "mask" */ + String get mask() { + return getMask(raw); + } + + /** Sets the value of "mask" */ + void set mask(String value) { + setMask(raw, value); + } + + /** Gets the value of "mask-attachment" */ + String get maskAttachment() { + return getMaskAttachment(raw); + } + + /** Sets the value of "mask-attachment" */ + void set maskAttachment(String value) { + setMaskAttachment(raw, value); + } + + /** Gets the value of "mask-box-image" */ + String get maskBoxImage() { + return getMaskBoxImage(raw); + } + + /** Sets the value of "mask-box-image" */ + void set maskBoxImage(String value) { + setMaskBoxImage(raw, value); + } + + /** Gets the value of "mask-box-image-outset" */ + String get maskBoxImageOutset() { + return getMaskBoxImageOutset(raw); + } + + /** Sets the value of "mask-box-image-outset" */ + void set maskBoxImageOutset(String value) { + setMaskBoxImageOutset(raw, value); + } + + /** Gets the value of "mask-box-image-repeat" */ + String get maskBoxImageRepeat() { + return getMaskBoxImageRepeat(raw); + } + + /** Sets the value of "mask-box-image-repeat" */ + void set maskBoxImageRepeat(String value) { + setMaskBoxImageRepeat(raw, value); + } + + /** Gets the value of "mask-box-image-slice" */ + String get maskBoxImageSlice() { + return getMaskBoxImageSlice(raw); + } + + /** Sets the value of "mask-box-image-slice" */ + void set maskBoxImageSlice(String value) { + setMaskBoxImageSlice(raw, value); + } + + /** Gets the value of "mask-box-image-source" */ + String get maskBoxImageSource() { + return getMaskBoxImageSource(raw); + } + + /** Sets the value of "mask-box-image-source" */ + void set maskBoxImageSource(String value) { + setMaskBoxImageSource(raw, value); + } + + /** Gets the value of "mask-box-image-width" */ + String get maskBoxImageWidth() { + return getMaskBoxImageWidth(raw); + } + + /** Sets the value of "mask-box-image-width" */ + void set maskBoxImageWidth(String value) { + setMaskBoxImageWidth(raw, value); + } + + /** Gets the value of "mask-clip" */ + String get maskClip() { + return getMaskClip(raw); + } + + /** Sets the value of "mask-clip" */ + void set maskClip(String value) { + setMaskClip(raw, value); + } + + /** Gets the value of "mask-composite" */ + String get maskComposite() { + return getMaskComposite(raw); + } + + /** Sets the value of "mask-composite" */ + void set maskComposite(String value) { + setMaskComposite(raw, value); + } + + /** Gets the value of "mask-image" */ + String get maskImage() { + return getMaskImage(raw); + } + + /** Sets the value of "mask-image" */ + void set maskImage(String value) { + setMaskImage(raw, value); + } + + /** Gets the value of "mask-origin" */ + String get maskOrigin() { + return getMaskOrigin(raw); + } + + /** Sets the value of "mask-origin" */ + void set maskOrigin(String value) { + setMaskOrigin(raw, value); + } + + /** Gets the value of "mask-position" */ + String get maskPosition() { + return getMaskPosition(raw); + } + + /** Sets the value of "mask-position" */ + void set maskPosition(String value) { + setMaskPosition(raw, value); + } + + /** Gets the value of "mask-position-x" */ + String get maskPositionX() { + return getMaskPositionX(raw); + } + + /** Sets the value of "mask-position-x" */ + void set maskPositionX(String value) { + setMaskPositionX(raw, value); + } + + /** Gets the value of "mask-position-y" */ + String get maskPositionY() { + return getMaskPositionY(raw); + } + + /** Sets the value of "mask-position-y" */ + void set maskPositionY(String value) { + setMaskPositionY(raw, value); + } + + /** Gets the value of "mask-repeat" */ + String get maskRepeat() { + return getMaskRepeat(raw); + } + + /** Sets the value of "mask-repeat" */ + void set maskRepeat(String value) { + setMaskRepeat(raw, value); + } + + /** Gets the value of "mask-repeat-x" */ + String get maskRepeatX() { + return getMaskRepeatX(raw); + } + + /** Sets the value of "mask-repeat-x" */ + void set maskRepeatX(String value) { + setMaskRepeatX(raw, value); + } + + /** Gets the value of "mask-repeat-y" */ + String get maskRepeatY() { + return getMaskRepeatY(raw); + } + + /** Sets the value of "mask-repeat-y" */ + void set maskRepeatY(String value) { + setMaskRepeatY(raw, value); + } + + /** Gets the value of "mask-size" */ + String get maskSize() { + return getMaskSize(raw); + } + + /** Sets the value of "mask-size" */ + void set maskSize(String value) { + setMaskSize(raw, value); + } + + /** Gets the value of "match-nearest-mail-blockquote-color" */ + String get matchNearestMailBlockquoteColor() { + return getMatchNearestMailBlockquoteColor(raw); + } + + /** Sets the value of "match-nearest-mail-blockquote-color" */ + void set matchNearestMailBlockquoteColor(String value) { + setMatchNearestMailBlockquoteColor(raw, value); + } + + /** Gets the value of "max-height" */ + String get maxHeight() { + return getMaxHeight(raw); + } + + /** Sets the value of "max-height" */ + void set maxHeight(String value) { + setMaxHeight(raw, value); + } + + /** Gets the value of "max-logical-height" */ + String get maxLogicalHeight() { + return getMaxLogicalHeight(raw); + } + + /** Sets the value of "max-logical-height" */ + void set maxLogicalHeight(String value) { + setMaxLogicalHeight(raw, value); + } + + /** Gets the value of "max-logical-width" */ + String get maxLogicalWidth() { + return getMaxLogicalWidth(raw); + } + + /** Sets the value of "max-logical-width" */ + void set maxLogicalWidth(String value) { + setMaxLogicalWidth(raw, value); + } + + /** Gets the value of "max-width" */ + String get maxWidth() { + return getMaxWidth(raw); + } + + /** Sets the value of "max-width" */ + void set maxWidth(String value) { + setMaxWidth(raw, value); + } + + /** Gets the value of "min-height" */ + String get minHeight() { + return getMinHeight(raw); + } + + /** Sets the value of "min-height" */ + void set minHeight(String value) { + setMinHeight(raw, value); + } + + /** Gets the value of "min-logical-height" */ + String get minLogicalHeight() { + return getMinLogicalHeight(raw); + } + + /** Sets the value of "min-logical-height" */ + void set minLogicalHeight(String value) { + setMinLogicalHeight(raw, value); + } + + /** Gets the value of "min-logical-width" */ + String get minLogicalWidth() { + return getMinLogicalWidth(raw); + } + + /** Sets the value of "min-logical-width" */ + void set minLogicalWidth(String value) { + setMinLogicalWidth(raw, value); + } + + /** Gets the value of "min-width" */ + String get minWidth() { + return getMinWidth(raw); + } + + /** Sets the value of "min-width" */ + void set minWidth(String value) { + setMinWidth(raw, value); + } + + /** Gets the value of "nbsp-mode" */ + String get nbspMode() { + return getNbspMode(raw); + } + + /** Sets the value of "nbsp-mode" */ + void set nbspMode(String value) { + setNbspMode(raw, value); + } + + /** Gets the value of "opacity" */ + String get opacity() { + return getOpacity(raw); + } + + /** Sets the value of "opacity" */ + void set opacity(String value) { + setOpacity(raw, value); + } + + /** Gets the value of "orphans" */ + String get orphans() { + return getOrphans(raw); + } + + /** Sets the value of "orphans" */ + void set orphans(String value) { + setOrphans(raw, value); + } + + /** Gets the value of "outline" */ + String get outline() { + return getOutline(raw); + } + + /** Sets the value of "outline" */ + void set outline(String value) { + setOutline(raw, value); + } + + /** Gets the value of "outline-color" */ + String get outlineColor() { + return getOutlineColor(raw); + } + + /** Sets the value of "outline-color" */ + void set outlineColor(String value) { + setOutlineColor(raw, value); + } + + /** Gets the value of "outline-offset" */ + String get outlineOffset() { + return getOutlineOffset(raw); + } + + /** Sets the value of "outline-offset" */ + void set outlineOffset(String value) { + setOutlineOffset(raw, value); + } + + /** Gets the value of "outline-style" */ + String get outlineStyle() { + return getOutlineStyle(raw); + } + + /** Sets the value of "outline-style" */ + void set outlineStyle(String value) { + setOutlineStyle(raw, value); + } + + /** Gets the value of "outline-width" */ + String get outlineWidth() { + return getOutlineWidth(raw); + } + + /** Sets the value of "outline-width" */ + void set outlineWidth(String value) { + setOutlineWidth(raw, value); + } + + /** Gets the value of "overflow" */ + String get overflow() { + return getOverflow(raw); + } + + /** Sets the value of "overflow" */ + void set overflow(String value) { + setOverflow(raw, value); + } + + /** Gets the value of "overflow-x" */ + String get overflowX() { + return getOverflowX(raw); + } + + /** Sets the value of "overflow-x" */ + void set overflowX(String value) { + setOverflowX(raw, value); + } + + /** Gets the value of "overflow-y" */ + String get overflowY() { + return getOverflowY(raw); + } + + /** Sets the value of "overflow-y" */ + void set overflowY(String value) { + setOverflowY(raw, value); + } + + /** Gets the value of "padding" */ + String get padding() { + return getPadding(raw); + } + + /** Sets the value of "padding" */ + void set padding(String value) { + setPadding(raw, value); + } + + /** Gets the value of "padding-after" */ + String get paddingAfter() { + return getPaddingAfter(raw); + } + + /** Sets the value of "padding-after" */ + void set paddingAfter(String value) { + setPaddingAfter(raw, value); + } + + /** Gets the value of "padding-before" */ + String get paddingBefore() { + return getPaddingBefore(raw); + } + + /** Sets the value of "padding-before" */ + void set paddingBefore(String value) { + setPaddingBefore(raw, value); + } + + /** Gets the value of "padding-bottom" */ + String get paddingBottom() { + return getPaddingBottom(raw); + } + + /** Sets the value of "padding-bottom" */ + void set paddingBottom(String value) { + setPaddingBottom(raw, value); + } + + /** Gets the value of "padding-end" */ + String get paddingEnd() { + return getPaddingEnd(raw); + } + + /** Sets the value of "padding-end" */ + void set paddingEnd(String value) { + setPaddingEnd(raw, value); + } + + /** Gets the value of "padding-left" */ + String get paddingLeft() { + return getPaddingLeft(raw); + } + + /** Sets the value of "padding-left" */ + void set paddingLeft(String value) { + setPaddingLeft(raw, value); + } + + /** Gets the value of "padding-right" */ + String get paddingRight() { + return getPaddingRight(raw); + } + + /** Sets the value of "padding-right" */ + void set paddingRight(String value) { + setPaddingRight(raw, value); + } + + /** Gets the value of "padding-start" */ + String get paddingStart() { + return getPaddingStart(raw); + } + + /** Sets the value of "padding-start" */ + void set paddingStart(String value) { + setPaddingStart(raw, value); + } + + /** Gets the value of "padding-top" */ + String get paddingTop() { + return getPaddingTop(raw); + } + + /** Sets the value of "padding-top" */ + void set paddingTop(String value) { + setPaddingTop(raw, value); + } + + /** Gets the value of "page" */ + String get page() { + return getPage(raw); + } + + /** Sets the value of "page" */ + void set page(String value) { + setPage(raw, value); + } + + /** Gets the value of "page-break-after" */ + String get pageBreakAfter() { + return getPageBreakAfter(raw); + } + + /** Sets the value of "page-break-after" */ + void set pageBreakAfter(String value) { + setPageBreakAfter(raw, value); + } + + /** Gets the value of "page-break-before" */ + String get pageBreakBefore() { + return getPageBreakBefore(raw); + } + + /** Sets the value of "page-break-before" */ + void set pageBreakBefore(String value) { + setPageBreakBefore(raw, value); + } + + /** Gets the value of "page-break-inside" */ + String get pageBreakInside() { + return getPageBreakInside(raw); + } + + /** Sets the value of "page-break-inside" */ + void set pageBreakInside(String value) { + setPageBreakInside(raw, value); + } + + /** Gets the value of "perspective" */ + String get perspective() { + return getPerspective(raw); + } + + /** Sets the value of "perspective" */ + void set perspective(String value) { + setPerspective(raw, value); + } + + /** Gets the value of "perspective-origin" */ + String get perspectiveOrigin() { + return getPerspectiveOrigin(raw); + } + + /** Sets the value of "perspective-origin" */ + void set perspectiveOrigin(String value) { + setPerspectiveOrigin(raw, value); + } + + /** Gets the value of "perspective-origin-x" */ + String get perspectiveOriginX() { + return getPerspectiveOriginX(raw); + } + + /** Sets the value of "perspective-origin-x" */ + void set perspectiveOriginX(String value) { + setPerspectiveOriginX(raw, value); + } + + /** Gets the value of "perspective-origin-y" */ + String get perspectiveOriginY() { + return getPerspectiveOriginY(raw); + } + + /** Sets the value of "perspective-origin-y" */ + void set perspectiveOriginY(String value) { + setPerspectiveOriginY(raw, value); + } + + /** Gets the value of "pointer-events" */ + String get pointerEvents() { + return getPointerEvents(raw); + } + + /** Sets the value of "pointer-events" */ + void set pointerEvents(String value) { + setPointerEvents(raw, value); + } + + /** Gets the value of "position" */ + String get position() { + return getPosition(raw); + } + + /** Sets the value of "position" */ + void set position(String value) { + setPosition(raw, value); + } + + /** Gets the value of "quotes" */ + String get quotes() { + return getQuotes(raw); + } + + /** Sets the value of "quotes" */ + void set quotes(String value) { + setQuotes(raw, value); + } + + /** Gets the value of "region-break-after" */ + String get regionBreakAfter() { + return getRegionBreakAfter(raw); + } + + /** Sets the value of "region-break-after" */ + void set regionBreakAfter(String value) { + setRegionBreakAfter(raw, value); + } + + /** Gets the value of "region-break-before" */ + String get regionBreakBefore() { + return getRegionBreakBefore(raw); + } + + /** Sets the value of "region-break-before" */ + void set regionBreakBefore(String value) { + setRegionBreakBefore(raw, value); + } + + /** Gets the value of "region-break-inside" */ + String get regionBreakInside() { + return getRegionBreakInside(raw); + } + + /** Sets the value of "region-break-inside" */ + void set regionBreakInside(String value) { + setRegionBreakInside(raw, value); + } + + /** Gets the value of "region-overflow" */ + String get regionOverflow() { + return getRegionOverflow(raw); + } + + /** Sets the value of "region-overflow" */ + void set regionOverflow(String value) { + setRegionOverflow(raw, value); + } + + /** Gets the value of "resize" */ + String get resize() { + return getResize(raw); + } + + /** Sets the value of "resize" */ + void set resize(String value) { + setResize(raw, value); + } + + /** Gets the value of "right" */ + String get right() { + return getRight(raw); + } + + /** Sets the value of "right" */ + void set right(String value) { + setRight(raw, value); + } + + /** Gets the value of "rtl-ordering" */ + String get rtlOrdering() { + return getRtlOrdering(raw); + } + + /** Sets the value of "rtl-ordering" */ + void set rtlOrdering(String value) { + setRtlOrdering(raw, value); + } + + /** Gets the value of "size" */ + String get size() { + return getSize(raw); + } + + /** Sets the value of "size" */ + void set size(String value) { + setSize(raw, value); + } + + /** Gets the value of "speak" */ + String get speak() { + return getSpeak(raw); + } + + /** Sets the value of "speak" */ + void set speak(String value) { + setSpeak(raw, value); + } + + /** Gets the value of "src" */ + String get src() { + return getSrc(raw); + } + + /** Sets the value of "src" */ + void set src(String value) { + setSrc(raw, value); + } + + /** Gets the value of "table-layout" */ + String get tableLayout() { + return getTableLayout(raw); + } + + /** Sets the value of "table-layout" */ + void set tableLayout(String value) { + setTableLayout(raw, value); + } + + /** Gets the value of "text-align" */ + String get textAlign() { + return getTextAlign(raw); + } + + /** Sets the value of "text-align" */ + void set textAlign(String value) { + setTextAlign(raw, value); + } + + /** Gets the value of "text-combine" */ + String get textCombine() { + return getTextCombine(raw); + } + + /** Sets the value of "text-combine" */ + void set textCombine(String value) { + setTextCombine(raw, value); + } + + /** Gets the value of "text-decoration" */ + String get textDecoration() { + return getTextDecoration(raw); + } + + /** Sets the value of "text-decoration" */ + void set textDecoration(String value) { + setTextDecoration(raw, value); + } + + /** Gets the value of "text-decorations-in-effect" */ + String get textDecorationsInEffect() { + return getTextDecorationsInEffect(raw); + } + + /** Sets the value of "text-decorations-in-effect" */ + void set textDecorationsInEffect(String value) { + setTextDecorationsInEffect(raw, value); + } + + /** Gets the value of "text-emphasis" */ + String get textEmphasis() { + return getTextEmphasis(raw); + } + + /** Sets the value of "text-emphasis" */ + void set textEmphasis(String value) { + setTextEmphasis(raw, value); + } + + /** Gets the value of "text-emphasis-color" */ + String get textEmphasisColor() { + return getTextEmphasisColor(raw); + } + + /** Sets the value of "text-emphasis-color" */ + void set textEmphasisColor(String value) { + setTextEmphasisColor(raw, value); + } + + /** Gets the value of "text-emphasis-position" */ + String get textEmphasisPosition() { + return getTextEmphasisPosition(raw); + } + + /** Sets the value of "text-emphasis-position" */ + void set textEmphasisPosition(String value) { + setTextEmphasisPosition(raw, value); + } + + /** Gets the value of "text-emphasis-style" */ + String get textEmphasisStyle() { + return getTextEmphasisStyle(raw); + } + + /** Sets the value of "text-emphasis-style" */ + void set textEmphasisStyle(String value) { + setTextEmphasisStyle(raw, value); + } + + /** Gets the value of "text-fill-color" */ + String get textFillColor() { + return getTextFillColor(raw); + } + + /** Sets the value of "text-fill-color" */ + void set textFillColor(String value) { + setTextFillColor(raw, value); + } + + /** Gets the value of "text-indent" */ + String get textIndent() { + return getTextIndent(raw); + } + + /** Sets the value of "text-indent" */ + void set textIndent(String value) { + setTextIndent(raw, value); + } + + /** Gets the value of "text-line-through" */ + String get textLineThrough() { + return getTextLineThrough(raw); + } + + /** Sets the value of "text-line-through" */ + void set textLineThrough(String value) { + setTextLineThrough(raw, value); + } + + /** Gets the value of "text-line-through-color" */ + String get textLineThroughColor() { + return getTextLineThroughColor(raw); + } + + /** Sets the value of "text-line-through-color" */ + void set textLineThroughColor(String value) { + setTextLineThroughColor(raw, value); + } + + /** Gets the value of "text-line-through-mode" */ + String get textLineThroughMode() { + return getTextLineThroughMode(raw); + } + + /** Sets the value of "text-line-through-mode" */ + void set textLineThroughMode(String value) { + setTextLineThroughMode(raw, value); + } + + /** Gets the value of "text-line-through-style" */ + String get textLineThroughStyle() { + return getTextLineThroughStyle(raw); + } + + /** Sets the value of "text-line-through-style" */ + void set textLineThroughStyle(String value) { + setTextLineThroughStyle(raw, value); + } + + /** Gets the value of "text-line-through-width" */ + String get textLineThroughWidth() { + return getTextLineThroughWidth(raw); + } + + /** Sets the value of "text-line-through-width" */ + void set textLineThroughWidth(String value) { + setTextLineThroughWidth(raw, value); + } + + /** Gets the value of "text-orientation" */ + String get textOrientation() { + return getTextOrientation(raw); + } + + /** Sets the value of "text-orientation" */ + void set textOrientation(String value) { + setTextOrientation(raw, value); + } + + /** Gets the value of "text-overflow" */ + String get textOverflow() { + return getTextOverflow(raw); + } + + /** Sets the value of "text-overflow" */ + void set textOverflow(String value) { + setTextOverflow(raw, value); + } + + /** Gets the value of "text-overline" */ + String get textOverline() { + return getTextOverline(raw); + } + + /** Sets the value of "text-overline" */ + void set textOverline(String value) { + setTextOverline(raw, value); + } + + /** Gets the value of "text-overline-color" */ + String get textOverlineColor() { + return getTextOverlineColor(raw); + } + + /** Sets the value of "text-overline-color" */ + void set textOverlineColor(String value) { + setTextOverlineColor(raw, value); + } + + /** Gets the value of "text-overline-mode" */ + String get textOverlineMode() { + return getTextOverlineMode(raw); + } + + /** Sets the value of "text-overline-mode" */ + void set textOverlineMode(String value) { + setTextOverlineMode(raw, value); + } + + /** Gets the value of "text-overline-style" */ + String get textOverlineStyle() { + return getTextOverlineStyle(raw); + } + + /** Sets the value of "text-overline-style" */ + void set textOverlineStyle(String value) { + setTextOverlineStyle(raw, value); + } + + /** Gets the value of "text-overline-width" */ + String get textOverlineWidth() { + return getTextOverlineWidth(raw); + } + + /** Sets the value of "text-overline-width" */ + void set textOverlineWidth(String value) { + setTextOverlineWidth(raw, value); + } + + /** Gets the value of "text-rendering" */ + String get textRendering() { + return getTextRendering(raw); + } + + /** Sets the value of "text-rendering" */ + void set textRendering(String value) { + setTextRendering(raw, value); + } + + /** Gets the value of "text-security" */ + String get textSecurity() { + return getTextSecurity(raw); + } + + /** Sets the value of "text-security" */ + void set textSecurity(String value) { + setTextSecurity(raw, value); + } + + /** Gets the value of "text-shadow" */ + String get textShadow() { + return getTextShadow(raw); + } + + /** Sets the value of "text-shadow" */ + void set textShadow(String value) { + setTextShadow(raw, value); + } + + /** Gets the value of "text-size-adjust" */ + String get textSizeAdjust() { + return getTextSizeAdjust(raw); + } + + /** Sets the value of "text-size-adjust" */ + void set textSizeAdjust(String value) { + setTextSizeAdjust(raw, value); + } + + /** Gets the value of "text-stroke" */ + String get textStroke() { + return getTextStroke(raw); + } + + /** Sets the value of "text-stroke" */ + void set textStroke(String value) { + setTextStroke(raw, value); + } + + /** Gets the value of "text-stroke-color" */ + String get textStrokeColor() { + return getTextStrokeColor(raw); + } + + /** Sets the value of "text-stroke-color" */ + void set textStrokeColor(String value) { + setTextStrokeColor(raw, value); + } + + /** Gets the value of "text-stroke-width" */ + String get textStrokeWidth() { + return getTextStrokeWidth(raw); + } + + /** Sets the value of "text-stroke-width" */ + void set textStrokeWidth(String value) { + setTextStrokeWidth(raw, value); + } + + /** Gets the value of "text-transform" */ + String get textTransform() { + return getTextTransform(raw); + } + + /** Sets the value of "text-transform" */ + void set textTransform(String value) { + setTextTransform(raw, value); + } + + /** Gets the value of "text-underline" */ + String get textUnderline() { + return getTextUnderline(raw); + } + + /** Sets the value of "text-underline" */ + void set textUnderline(String value) { + setTextUnderline(raw, value); + } + + /** Gets the value of "text-underline-color" */ + String get textUnderlineColor() { + return getTextUnderlineColor(raw); + } + + /** Sets the value of "text-underline-color" */ + void set textUnderlineColor(String value) { + setTextUnderlineColor(raw, value); + } + + /** Gets the value of "text-underline-mode" */ + String get textUnderlineMode() { + return getTextUnderlineMode(raw); + } + + /** Sets the value of "text-underline-mode" */ + void set textUnderlineMode(String value) { + setTextUnderlineMode(raw, value); + } + + /** Gets the value of "text-underline-style" */ + String get textUnderlineStyle() { + return getTextUnderlineStyle(raw); + } + + /** Sets the value of "text-underline-style" */ + void set textUnderlineStyle(String value) { + setTextUnderlineStyle(raw, value); + } + + /** Gets the value of "text-underline-width" */ + String get textUnderlineWidth() { + return getTextUnderlineWidth(raw); + } + + /** Sets the value of "text-underline-width" */ + void set textUnderlineWidth(String value) { + setTextUnderlineWidth(raw, value); + } + + /** Gets the value of "top" */ + String get top() { + return getTop(raw); + } + + /** Sets the value of "top" */ + void set top(String value) { + setTop(raw, value); + } + + /** Gets the value of "transform" */ + String get transform() { + return getTransform(raw); + } + + /** Sets the value of "transform" */ + void set transform(String value) { + setTransform(raw, value); + } + + /** Gets the value of "transform-origin" */ + String get transformOrigin() { + return getTransformOrigin(raw); + } + + /** Sets the value of "transform-origin" */ + void set transformOrigin(String value) { + setTransformOrigin(raw, value); + } + + /** Gets the value of "transform-origin-x" */ + String get transformOriginX() { + return getTransformOriginX(raw); + } + + /** Sets the value of "transform-origin-x" */ + void set transformOriginX(String value) { + setTransformOriginX(raw, value); + } + + /** Gets the value of "transform-origin-y" */ + String get transformOriginY() { + return getTransformOriginY(raw); + } + + /** Sets the value of "transform-origin-y" */ + void set transformOriginY(String value) { + setTransformOriginY(raw, value); + } + + /** Gets the value of "transform-origin-z" */ + String get transformOriginZ() { + return getTransformOriginZ(raw); + } + + /** Sets the value of "transform-origin-z" */ + void set transformOriginZ(String value) { + setTransformOriginZ(raw, value); + } + + /** Gets the value of "transform-style" */ + String get transformStyle() { + return getTransformStyle(raw); + } + + /** Sets the value of "transform-style" */ + void set transformStyle(String value) { + setTransformStyle(raw, value); + } + + /** Gets the value of "transition" */ + String get transition() { + return getTransition(raw); + } + + /** Sets the value of "transition" */ + void set transition(String value) { + setTransition(raw, value); + } + + /** Gets the value of "transition-delay" */ + String get transitionDelay() { + return getTransitionDelay(raw); + } + + /** Sets the value of "transition-delay" */ + void set transitionDelay(String value) { + setTransitionDelay(raw, value); + } + + /** Gets the value of "transition-duration" */ + String get transitionDuration() { + return getTransitionDuration(raw); + } + + /** Sets the value of "transition-duration" */ + void set transitionDuration(String value) { + setTransitionDuration(raw, value); + } + + /** Gets the value of "transition-property" */ + String get transitionProperty() { + return getTransitionProperty(raw); + } + + /** Sets the value of "transition-property" */ + void set transitionProperty(String value) { + setTransitionProperty(raw, value); + } + + /** Gets the value of "transition-timing-function" */ + String get transitionTimingFunction() { + return getTransitionTimingFunction(raw); + } + + /** Sets the value of "transition-timing-function" */ + void set transitionTimingFunction(String value) { + setTransitionTimingFunction(raw, value); + } + + /** Gets the value of "unicode-bidi" */ + String get unicodeBidi() { + return getUnicodeBidi(raw); + } + + /** Sets the value of "unicode-bidi" */ + void set unicodeBidi(String value) { + setUnicodeBidi(raw, value); + } + + /** Gets the value of "unicode-range" */ + String get unicodeRange() { + return getUnicodeRange(raw); + } + + /** Sets the value of "unicode-range" */ + void set unicodeRange(String value) { + setUnicodeRange(raw, value); + } + + /** Gets the value of "user-drag" */ + String get userDrag() { + return getUserDrag(raw); + } + + /** Sets the value of "user-drag" */ + void set userDrag(String value) { + setUserDrag(raw, value); + } + + /** Gets the value of "user-modify" */ + String get userModify() { + return getUserModify(raw); + } + + /** Sets the value of "user-modify" */ + void set userModify(String value) { + setUserModify(raw, value); + } + + /** Gets the value of "user-select" */ + String get userSelect() { + return getUserSelect(raw); + } + + /** Sets the value of "user-select" */ + void set userSelect(String value) { + setUserSelect(raw, value); + } + + /** Gets the value of "vertical-align" */ + String get verticalAlign() { + return getVerticalAlign(raw); + } + + /** Sets the value of "vertical-align" */ + void set verticalAlign(String value) { + setVerticalAlign(raw, value); + } + + /** Gets the value of "visibility" */ + String get visibility() { + return getVisibility(raw); + } + + /** Sets the value of "visibility" */ + void set visibility(String value) { + setVisibility(raw, value); + } + + /** Gets the value of "white-space" */ + String get whiteSpace() { + return getWhiteSpace(raw); + } + + /** Sets the value of "white-space" */ + void set whiteSpace(String value) { + setWhiteSpace(raw, value); + } + + /** Gets the value of "widows" */ + String get widows() { + return getWidows(raw); + } + + /** Sets the value of "widows" */ + void set widows(String value) { + setWidows(raw, value); + } + + /** Gets the value of "width" */ + String get width() { + return getWidth(raw); + } + + /** Sets the value of "width" */ + void set width(String value) { + setWidth(raw, value); + } + + /** Gets the value of "word-break" */ + String get wordBreak() { + return getWordBreak(raw); + } + + /** Sets the value of "word-break" */ + void set wordBreak(String value) { + setWordBreak(raw, value); + } + + /** Gets the value of "word-spacing" */ + String get wordSpacing() { + return getWordSpacing(raw); + } + + /** Sets the value of "word-spacing" */ + void set wordSpacing(String value) { + setWordSpacing(raw, value); + } + + /** Gets the value of "word-wrap" */ + String get wordWrap() { + return getWordWrap(raw); + } + + /** Sets the value of "word-wrap" */ + void set wordWrap(String value) { + setWordWrap(raw, value); + } + + /** Gets the value of "wrap-shape" */ + String get wrapShape() { + return getWrapShape(raw); + } + + /** Sets the value of "wrap-shape" */ + void set wrapShape(String value) { + setWrapShape(raw, value); + } + + /** Gets the value of "writing-mode" */ + String get writingMode() { + return getWritingMode(raw); + } + + /** Sets the value of "writing-mode" */ + void set writingMode(String value) { + setWritingMode(raw, value); + } + + /** Gets the value of "z-index" */ + String get zIndex() { + return getZIndex(raw); + } + + /** Sets the value of "z-index" */ + void set zIndex(String value) { + setZIndex(raw, value); + } + + /** Gets the value of "zoom" */ + String get zoom() { + return getZoom(raw); + } + + /** Sets the value of "zoom" */ + void set zoom(String value) { + setZoom(raw, value); + } +} diff --git a/client/base/Device.dart b/client/base/Device.dart new file mode 100644 index 00000000000..689cb49ef09 --- /dev/null +++ b/client/base/Device.dart @@ -0,0 +1,76 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// TODO(jacobr): cache these results. +// TODO(jacobr): figure out how to test this. +/** + * Utils for device detection. + */ +class Device { + + /** + * The regular expression for detecting an iPhone or iPod. + */ + static final _IPHONE_REGEX = const RegExp('iPhone|iPod', ''); + + /** + * The regular expression for detecting an iPhone or iPod or iPad. + */ + static final _MOBILE_SAFARI_REGEX = const RegExp('iPhone|iPod|iPad', ''); + + /** + * The regular expression for detecting an iPhone or iPod or iPad simulator. + */ + static final _APPLE_SIM_REGEX = const RegExp('iP.*Simulator', ''); + + /** + * Gets the browser's user agent. Using this function allows tests to inject + * the user agent. + * Returns the user agent. + */ + static String get userAgent() => window.navigator.userAgent; + + /** + * Determines if the current device is an iPhone or iPod. + * Returns true if the current device is an iPhone or iPod. + */ + static bool get isIPhone() => _IPHONE_REGEX.hasMatch(userAgent); + + /** + * Determines if the current device is an iPad. + * Returns true if the current device is an iPad. + */ + static bool get isIPad() => userAgent.contains("iPad", 0); + + /** + * Determines if the current device is running Firefox. + */ + static bool get isFirefox() => userAgent.contains("Firefox", 0); + + /** + * Determines if the current device is an iPhone or iPod or iPad. + * Returns true if the current device is an iPhone or iPod or iPad. + */ + static bool get isMobileSafari() => _MOBILE_SAFARI_REGEX.hasMatch(userAgent); + + /** + * Determines if the current device is the iP* Simulator. + * Returns true if the current device is an iP* Simulator. + */ + static bool get isAppleSimulator() => _APPLE_SIM_REGEX.hasMatch(userAgent); + + /** + * Determines if the current device is an Android. + * Returns true if the current device is an Android. + */ + static bool get isAndroid() => userAgent.contains("Android", 0); + + /** + * Determines if the current device is WebOS WebKit. + * Returns true if the current device is WebOS WebKit. + */ + static bool get isWebOs() => userAgent.contains("webOS", 0); + + static bool get supportsTouch() => isMobileSafari || isAndroid; +} diff --git a/client/base/DomWrapper.dart b/client/base/DomWrapper.dart new file mode 100644 index 00000000000..ab20d033eb3 --- /dev/null +++ b/client/base/DomWrapper.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Embedded DSL for generating DOM elements. + */ +class Dom { + static void ready(void f()) { + if (document.readyState == 'interactive' || + document.readyState == 'complete') { + window.setTimeout(f, 0); + } else { + // TODO(jacobr): give this event a named property. + window.on.contentLoaded.add((Event e) { f(); }); + } + } + + /** Adds the given + + + + + diff --git a/client/tests/client/layout/layout_tests.dart b/client/tests/client/layout/layout_tests.dart new file mode 100644 index 00000000000..7d71b736aa1 --- /dev/null +++ b/client/tests/client/layout/layout_tests.dart @@ -0,0 +1,20 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#library('layout_tests'); + +#import('../../../base/base.dart'); +#import('../../../html/html.dart'); +#import('../../../layout/layout.dart'); +#import('../../../view/view.dart'); +#import('../../../testing/unittest/unittest.dart'); +#import('../../../util/utilslib.dart'); + +#source('GridLayoutDemo.dart'); +#source('GridExamples.dart'); +#source('GridLayoutTests.dart'); + +main() { + GridLayoutTests.main(); +} diff --git a/client/tests/client/observable/AbstractObservableTests.dart b/client/tests/client/observable/AbstractObservableTests.dart new file mode 100644 index 00000000000..54d50180d10 --- /dev/null +++ b/client/tests/client/observable/AbstractObservableTests.dart @@ -0,0 +1,83 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +class AbstractObservableTests extends ObservableTestSetBase { + // TODO(rnystrom): Remove this when default constructors are supported. + AbstractObservableTests() : super(); + + setup() { + addTest(testObservableListeners); + addTest(testObservableFiresImmediatelyIfNoBatch); + + group('addChangeListener()', () { + test('adding the same listener twice returns false the second time', () { + final target = new AbstractObservable(); + final listener = (e) { }; + + expect(target.addChangeListener(listener)) == true; + expect(target.addChangeListener(listener)) == false; + }); + }); + } + + void testObservableListeners() { + // check that add/remove works, see contents of listeners too + final target = new AbstractObservable(); + final l1 = (e) { }; + final l2 = (e) { }; + final l3 = (e) { }; + final l4 = (e) { }; + + expect(target.listeners).equalsCollection([]); + + target.addChangeListener(l1); + expect(target.listeners).equalsCollection([l1]); + + target.addChangeListener(l2); + expect(target.listeners).equalsCollection([l1, l2]); + + target.addChangeListener(l3); + target.addChangeListener(l4); + expect(target.listeners).equalsCollection([l1, l2, l3, l4]); + + target.removeChangeListener(l4); + expect(target.listeners).equalsCollection([l1, l2, l3]); + + target.removeChangeListener(l2); + expect(target.listeners).equalsCollection([l1, l3]); + + target.removeChangeListener(l1); + expect(target.listeners).equalsCollection([l3]); + + target.removeChangeListener(l3); + expect(target.listeners).equalsCollection([]); + } + + void testObservableFiresImmediatelyIfNoBatch() { + // If no batch is created, a summary should be automatically created and + // fired on each property change. + final target = new AbstractObservable(); + EventSummary res = null; + target.addChangeListener((summary) { + expect(res) == null; + res = summary; + expect(res).isNotNull(); + }); + + target.recordPropertyUpdate("pM", 10, 11); + + expect(res).isNotNull(); + expect(res.events.length) == 1; + checkEvent(res.events[0], + target, "pM", null, ChangeEvent.UPDATE, 10, 11); + res = null; + + target.recordPropertyUpdate("pL", "11", "13"); + + expect(res).isNotNull(); + expect(res.events.length) == 1; + checkEvent(res.events[0], + target, "pL", null, ChangeEvent.UPDATE, "11", "13"); + } +} diff --git a/client/tests/client/observable/ChangeEventTests.dart b/client/tests/client/observable/ChangeEventTests.dart new file mode 100644 index 00000000000..da4bc283086 --- /dev/null +++ b/client/tests/client/observable/ChangeEventTests.dart @@ -0,0 +1,32 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +class ChangeEventTests extends ObservableTestSetBase { + // TODO(rnystrom): Remove this when default constructors are supported. + ChangeEventTests() : super(); + + setup() { + addTest(testChangeEventConstructors); + } + + void testChangeEventConstructors() { + // create property, list, global and check the proper initialization. + final target = new AbstractObservable(); + + checkEvent(new ChangeEvent.property(target, "pK", 33, "12"), + target, "pK", null, ChangeEvent.UPDATE, 33, "12"); + + checkEvent(new ChangeEvent.list(target, ChangeEvent.UPDATE, 3, 33, "12"), + target, null, 3, ChangeEvent.UPDATE, 33, "12"); + + checkEvent(new ChangeEvent.list(target, ChangeEvent.INSERT, 3, 33, null), + target, null, 3, ChangeEvent.INSERT, 33, null); + + checkEvent(new ChangeEvent.list(target, ChangeEvent.REMOVE, 3, null, "12"), + target, null, 3, ChangeEvent.REMOVE, null, "12"); + + checkEvent(new ChangeEvent.list(target, ChangeEvent.GLOBAL, 0, null, null), + target, null, 0, ChangeEvent.GLOBAL, null, null); + } +} diff --git a/client/tests/client/observable/EventBatchTests.dart b/client/tests/client/observable/EventBatchTests.dart new file mode 100644 index 00000000000..8f627faee7b --- /dev/null +++ b/client/tests/client/observable/EventBatchTests.dart @@ -0,0 +1,56 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +class EventBatchTests extends ObservableTestSetBase { + // TODO(rnystrom): Remove this when default constructors are supported. + EventBatchTests() : super(); + + setup() { + addTest(testEventBatch); + } + + void testEventBatch() { + // check that all events are fired at the end. Use all record methods + // in abstract observable + final target = new AbstractObservable(); + EventSummary res = null; + target.addChangeListener((summary) { + expect(res) == null; + res = summary; + expect(res).isNotNull(); + }); + + final f = EventBatch.wrap((e) { + target.recordPropertyUpdate("pM", 10, 11); + target.recordPropertyUpdate("pL", "11", "13"); + target.recordListUpdate(2, "a", "b"); + target.recordListInsert(5, "a"); + target.recordListRemove(4, "c"); + target.recordGlobalChange(); + }); + + expect(res) == null; + f(null); + expect(res).isNotNull(); + + expect(res.events.length) == 6; + checkEvent(res.events[0], + target, "pM", null, ChangeEvent.UPDATE, 10, 11); + + checkEvent(res.events[1], + target, "pL", null, ChangeEvent.UPDATE, "11", "13"); + + checkEvent(res.events[2], + target, null, 2, ChangeEvent.UPDATE, "a", "b"); + + checkEvent(res.events[3], + target, null, 5, ChangeEvent.INSERT, "a", null); + + checkEvent(res.events[4], + target, null, 4, ChangeEvent.REMOVE, null, "c"); + + checkEvent(res.events[5], + target, null, null, ChangeEvent.GLOBAL, null, null); + } +} diff --git a/client/tests/client/observable/ObservableListTests.dart b/client/tests/client/observable/ObservableListTests.dart new file mode 100644 index 00000000000..d5f634d1e94 --- /dev/null +++ b/client/tests/client/observable/ObservableListTests.dart @@ -0,0 +1,125 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +class ObservableListTests extends ObservableTestSetBase { + // TODO(rnystrom): Remove this when default constructors are supported. + ObservableListTests() : super(); + + setup() { + addTest(testObservableList); + } + + void testObservableList() { + final arr = new ObservableList(); + + // Add some initial data before listening + arr.add(1); + arr.add(2); + arr.add(3); + arr.add(1); + arr.add(3); + arr.add(4); + + expect(arr).equalsCollection([1, 2, 3, 1, 3, 4]); + + // Add a listener that saves the events + EventSummary res = null; + arr.addChangeListener((summary) { + expect(res) == null; + res = summary; + expect(res).isNotNull(); + }); + + // execute some code with readonly operations only + expect(res) == null; + bool called = false; + EventBatch.wrap((e) { + expect(arr.length) == 6; + expect(arr[0]) == 1; + // TODO(sigmund): why we need write startIndex? it should be optional. + Expect.equals(5, arr.indexOf(4, 0)); + Expect.equals(0, arr.indexOf(1, 0)); + Expect.equals(3, arr.indexOf(1, 1)); + // TODO(rnystrom): Get rid of second arg when lastIndexOf has default. + Expect.equals(3, arr.lastIndexOf(1, arr.length - 1)); + expect(arr.last() == 4); + final copy = new List(); + arr.forEach(f(i) { + copy.add(i); + }); + expect(copy).equalsCollection([1, 2, 3, 1, 3, 4]); + called = true; + })(null); + Expect.isTrue(called); + expect(res) == null; // no change from read-only operators + + // execute some code with mutations + expect(res) == null; + called = false; + expect(arr).equalsCollection([1, 2, 3, 1, 3, 4]); + EventBatch.wrap((e) { + arr.add(5); // 1 2 3 1 3 4(5) + arr.add(6); // 1 2 3 1 3 4 5(6) + arr[1] = arr[arr.length - 1]; // 1(6)3 1 3 4 5 6 + arr.add(7); // 1 6 3 1 3 4 5 6(7) + arr[5] = arr[8]; // 1 6 3 1 3(7)5 6 7 + arr.add(42); // 1 6 3 1 3 7 5 6 7(42) + expect(arr.removeAt(3) == 1); // 1 6 3( )3 7 5 6 7 42 + expect(arr.removeFirstElement(3) == true); // 1 6( ) 3 7 5 6 7 42 + expect(arr.removeLast() == 42); // 1 6 3 7 5 6 7( ) + expect(arr.removeAllElements(6) == 2); // 1( ) 3 7 5( )7 + called = true; + })(null); + Expect.isTrue(called); + expect(res).isNotNull(); + expect(res.events.length) == 11; + checkEvent(res.events[0], arr, null, 6, ChangeEvent.INSERT, 5, null); + checkEvent(res.events[1], arr, null, 7, ChangeEvent.INSERT, 6, null); + checkEvent(res.events[2], arr, null, 1, ChangeEvent.UPDATE, 6, 2); + checkEvent(res.events[3], arr, null, 8, ChangeEvent.INSERT, 7, null); + checkEvent(res.events[4], arr, null, 5, ChangeEvent.UPDATE, 7, 4); + checkEvent(res.events[5], arr, null, 9, ChangeEvent.INSERT, 42, null); + checkEvent(res.events[6], arr, null, 3, ChangeEvent.REMOVE, null, 1); + checkEvent(res.events[7], arr, null, 2, ChangeEvent.REMOVE, null, 3); + checkEvent(res.events[8], arr, null, 7, ChangeEvent.REMOVE, null, 42); + checkEvent(res.events[9], arr, null, 1, ChangeEvent.REMOVE, null, 6); + checkEvent(res.events[10], arr, null, 4, ChangeEvent.REMOVE, null, 6); + expect(arr).equalsCollection([1, 3, 7, 5, 7]); + + res = null; + expect(res) == null; + called = false; + // execute global mutations like sort and clear + EventBatch.wrap((e) { + arr.add(1); + arr.add(4); + arr.add(10); + arr.add(9); + arr.sort(int compare(int a, int b) { return a - b; }); + called = true; + })(null); + Expect.isTrue(called); + expect(res).isNotNull(); + expect(res.events.length) == 5; + checkEvent(res.events[0], arr, null, 5, ChangeEvent.INSERT, 1, null); + checkEvent(res.events[1], arr, null, 6, ChangeEvent.INSERT, 4, null); + checkEvent(res.events[2], arr, null, 7, ChangeEvent.INSERT, 10, null); + checkEvent(res.events[3], arr, null, 8, ChangeEvent.INSERT, 9, null); + checkEvent(res.events[4], arr, null, null, ChangeEvent.GLOBAL, null, null); + expect(arr).equalsCollection([1, 1, 3, 4, 5, 7, 7, 9, 10]); + + res = null; + expect(res) == null; + called = false; + EventBatch.wrap((e) { + arr.clear(); + called = true; + })(null); + Expect.isTrue(called); + expect(res).isNotNull(); + expect(res.events.length) == 1; + checkEvent(res.events[0], arr, null, null, ChangeEvent.GLOBAL, null, null); + expect(arr).equalsCollection([]); + } +} diff --git a/client/tests/client/observable/ObservableTestSetBase.dart b/client/tests/client/observable/ObservableTestSetBase.dart new file mode 100644 index 00000000000..e9a3dd750dd --- /dev/null +++ b/client/tests/client/observable/ObservableTestSetBase.dart @@ -0,0 +1,21 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Defines helper methods that the other TestSet classes in this library + * share. + */ +class ObservableTestSetBase extends TestSet { + // TODO(rnystrom): Remove this when default constructors are supported. + ObservableTestSetBase() : super(); + + void checkEvent(ChangeEvent e, target, pName, index, type, newVal, oldVal) { + expect(e.target) == target; + expect(e.propertyName) == pName; + expect(e.index) == index; + expect(e.type) == type; + expect(e.newValue) == newVal; + expect(e.oldValue) == oldVal; + } +} diff --git a/client/tests/client/observable/ObservableValueTests.dart b/client/tests/client/observable/ObservableValueTests.dart new file mode 100644 index 00000000000..981af3f64b2 --- /dev/null +++ b/client/tests/client/observable/ObservableValueTests.dart @@ -0,0 +1,51 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +class ObservableValueTests extends ObservableTestSetBase { + // TODO(rnystrom): Remove this when default constructors are supported. + ObservableValueTests() : super(); + + setup() { + addTest(testObservableValue); + addTest(testObservableValueDoesNotRaiseEventIfUnchanged); + } + + void testObservableValue() { + final value = new ObservableValue("initial"); + expect(value.value) == "initial"; + + // Set value. + value.value = "new"; + expect(value.value) == "new"; + + // Change event is sent when value is changed. + EventSummary result = null; + value.addChangeListener((summary) { + expect(result) == null; + result = summary; + expect(result).isNotNull(); + }); + + value.value = "newer"; + + expect(result).isNotNull(); + expect(result.events.length) == 1; + checkEvent(result.events[0], + value, "value", null, ChangeEvent.UPDATE, "newer", "new"); + } + + void testObservableValueDoesNotRaiseEventIfUnchanged() { + final value = new ObservableValue("foo"); + expect(value.value) == "foo"; + + bool called = false; + value.addChangeListener((summary) { called = true; }); + + // Set it to the same value. + value.value = "foo"; + + // Should not have gotten an event. + expect(called) == false; + } +} diff --git a/client/tests/client/observable/observable_tests.dart b/client/tests/client/observable/observable_tests.dart new file mode 100644 index 00000000000..01fdb12fe78 --- /dev/null +++ b/client/tests/client/observable/observable_tests.dart @@ -0,0 +1,30 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#library('observable_tests'); + +#import('../../../html/html.dart'); +#import('../../../observable/observable.dart'); +#import('../../../testing/unittest/unittest.dart'); + +#source('AbstractObservableTests.dart'); +#source('ChangeEventTests.dart'); +#source('EventBatchTests.dart'); +#source('ObservableListTests.dart'); +#source('ObservableTestSetBase.dart'); +#source('ObservableValueTests.dart'); + +void main() { + var tests = new UnitTestSuite(); + + tests.addTestSets([ + new AbstractObservableTests(), + new ChangeEventTests(), + new EventBatchTests(), + new ObservableListTests(), + new ObservableValueTests() + ]); + + tests.run(); +} diff --git a/client/tests/client/samples/dartcombat/dartcombat_tests.dart b/client/tests/client/samples/dartcombat/dartcombat_tests.dart new file mode 100644 index 00000000000..0d77f7c735f --- /dev/null +++ b/client/tests/client/samples/dartcombat/dartcombat_tests.dart @@ -0,0 +1,159 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + + +#library('dartcombat_tests'); + +#import('../../../../html/html.dart'); +#import('../../../../testing/unittest/unittest.dart'); +#import('../../../../samples/dartcombat/dartcombatlib.dart'); + +void main() { + new DartCombatTests().run(); +} + +/** Tests for the dart combat app. */ +class DartCombatTests extends UnitTestSuite { + ReceivePort testPort; + + DartCombatTests() : super() { + testPort = new ReceivePort(); + setupUI(); + // add relative URL to stylesheet to the correct location. Note: The CSS is + // needed because the app uses a flexbox layout, which is then used to + // interpret UI events (mousedown/up/click). + var link = document.createElement("link"); + link.rel = "stylesheet"; + link.type = "text/css"; + link.href = "../../samples/dartcombat/dartcombat.css"; + document.head.nodes.add(link); + } + + void setUpTestSuite() { + addAsyncTest(waitUntilSetup, 1); + addAsyncTest(testParallelShoot, 1); + addAsyncTest(testSerialShoot, 1); + } + + void waitUntilSetup() { + int playersReady = 0; + testPort.receive((message, SendPort reply) { + if (message[0] == '_TEST:handleSetup') { + playersReady++; + if (playersReady == 2) { + callbackDone(); + } + } + }); + createPlayersForTest(testPort.toSendPort()); + } + + void testParallelShoot() { + // player 2 is configured to make parallel super shots towards player 1 + var p1OwnBoard = document.queryOne("#p1own"); + + // add a boat of length 4 using mousedown/mousemove/mouseup + var startCell = p1OwnBoard.nodes[0].nodes[4].nodes[2]; + var endCell = p1OwnBoard.nodes[0].nodes[4].nodes[5]; + doMouseEvent("mousedown", startCell); + doMouseEvent("mousemove", endCell); + doMouseEvent("mouseup", endCell); + + // check that the boat was added: + var boat = p1OwnBoard.nodes[1]; + Expect.setEquals(["icons", "boat4", "boatdir-left"], boat.classes); + + // check that the boat shows as sunk in player 1's board: + // Note that the shoot order is respected: center, left, right, up, down, + // left, right again, as if they progress in parallel. + List expectedShots = const [ + Constants.HIT, 3, 4, // initial shot (center) + Constants.HIT, 2, 4, // left + Constants.HIT, 4, 4, // right + Constants.MISS, 3, 3, // up + Constants.MISS, 3, 5, // down + Constants.MISS, 1, 4, // left + Constants.SUNK, 5, 4]; // right + _expectShotSequence(expectedShots, p1OwnBoard, 1); + + // hit the boat from the enemy side. + var p2EnemyBoard = document.queryOne("#p2enemy"); + var hitCell = p2EnemyBoard.nodes[0].nodes[4].nodes[3]; + doMouseEvent("click", hitCell); + } + + void testSerialShoot() { + // player 1 is configured to make serial super shots towards player 2 + var p2OwnBoard = document.queryOne("#p2own"); + + // add a boat of length 4 using mousedown/mousemove/mouseup + var startCell = p2OwnBoard.nodes[0].nodes[3].nodes[8]; + var endCell = p2OwnBoard.nodes[0].nodes[7].nodes[8]; + doMouseEvent("mousedown", startCell); + doMouseEvent("mousemove", endCell); + doMouseEvent("mouseup", endCell); + + // check that the boat was added: + var boat = p2OwnBoard.nodes[1]; + Expect.setEquals(["icons", "boat5", "boatdir-down"], boat.classes); + + // check that the boat shows as sunk in player 2's board: + // Note that the shoot order is respected: center, left, right, up, down + // sequentially. + List expectedShots = const [ + Constants.HIT, 8, 4, // initial shot (center) + Constants.MISS, 7, 4, // left (miss - stop this direction) + Constants.MISS, 9, 4, // right (miss - stop this direction) + Constants.HIT, 8, 3, // up + Constants.MISS, 8, 2, // up (miss - stop this direction) + Constants.HIT, 8, 5, // down + Constants.HIT, 8, 6, // down + Constants.SUNK, 8, 7]; // down (sunk - done) + _expectShotSequence(expectedShots, p2OwnBoard, 2); + + // hit the boat from the enemy side. + var p1EnemyBoard = document.queryOne("#p1enemy"); + var hitCell = p1EnemyBoard.nodes[0].nodes[4].nodes[8]; + doMouseEvent("click", hitCell); + } + + void _expectShotSequence( + List expectedShots, Element playerBoard, int id) { + int shots = 0; + testPort.receive((message, SendPort reply) { + if (message[0] == '_TEST:handleShot') { + Expect.equals(id, message[1]); + Expect.equals(expectedShots[(shots * 3)], message[2]); + Expect.equals(expectedShots[(shots * 3) + 1], message[3]); + Expect.equals(expectedShots[(shots * 3) + 2], message[4]); + _checkNodeInfo(playerBoard.nodes[shots + 2], + "icons " + (expectedShots[shots * 3] == Constants.MISS + ? "miss" : "hit-onboat"), + expectedShots[(shots * 3) + 1] * 50, + expectedShots[(shots * 3) + 2] * 50); + shots++; + if (shots * 3 == expectedShots.length) { + callbackDone(); + } + } + }); + + } + + void _checkNodeInfo(node, className, x, y) { + Expect.setEquals(className.split(" "), node.classes); + Expect.equals("${x}px", node.style.getPropertyValue("left")); + Expect.equals("${y}px", node.style.getPropertyValue("top")); + } + + void doMouseEvent(String type, var targetCell) { + final point = window.webkitConvertPointFromNodeToPage(targetCell, + new Point(5, 5)); + + MouseEvent e = document.createEvent('MouseEvents'); + e.initMouseEvent(type, true, true, window, 0, 0, 0, point.x, point.y, + false, false, false, false, 0, targetCell); + targetCell.on[type].dispatch(e); + } +} diff --git a/client/tests/client/samples/swarm/swarm_tests.dart b/client/tests/client/samples/swarm/swarm_tests.dart new file mode 100644 index 00000000000..2a460a0e908 --- /dev/null +++ b/client/tests/client/samples/swarm/swarm_tests.dart @@ -0,0 +1,145 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#library('swarm_tests'); + +#import('../../../../base/base.dart'); +#import('../../../../html/html.dart'); +#import('../../../../samples/swarm/swarmlib.dart'); +#import('../../../../testing/unittest/unittest.dart'); +#import('../../../../view/view.dart'); +#import('../../../../util/utilslib.dart'); + +void main() { + new SwarmTests().run(); +} + +// TODO(jmesserly): these would probably be easier to debug if they were written +// in the WebKit layout test style, so we could easy compare that the DOM is +// what we expect it to be after performing some simulated user actions. + +class SwarmTests extends UnitTestSuite { + Swarm swarm; + UIStateProxy state; + + SwarmTests() : super() { + swarm = new Swarm(); + swarm.state = state = new UIStateProxy(swarm.sections); + swarm.run(); + } + + Element get storyNode() => swarm.frontView.storyView.node; + + View getView(Section section) { + return CollectionUtils.find(swarm.frontView.sections.childViews, + (view) => view.section == section); + } + + Map getHistory(Article article) { + final feed = article.dataSource; + return { + 'section': CollectionUtils.find(swarm.sections, + (s) => s.feeds.indexOf(feed, 0) >= 0).id, + 'feed': feed.id, + 'article': article.id + }; + } + + void setUpTestSuite() { + // TODO(jmesserly): should be adding the full stylesheet here + Dom.addStyle(''' + .story-content { + -webkit-column-width: 300px; + -webkit-column-gap: 26px; /* 2em */ + }'''); + addTest(testBackButton); + addTest(testStoryView); + addTest(testSliderMenu); + } + + /** Triggers the click event, like [http://api.jquery.com/click/] */ + _click(Element element) { + // TODO(rnystrom): This should be on the DOM API somewhere. + MouseEvent event = document.createEvent('MouseEvents'); + event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, + false, false, false, false, 0, null); + element.on.click.dispatch(event); + } + + void testBackButton() { + Expect.equals(null, swarm.frontView.storyView); // verify initial state + + // Make sure we've transitioned to the section + // In the real app, this isn't needed because ConveyorView fires the + // transition end event before we can click a story. + SectionView section = getView(swarm.sections[0]); + section.showSources(); + + final item = swarm.sections[0].feeds[2].articles[1]; + state.loadFromHistory(getHistory(item)); + + Expect.equals(item, state.currentArticle.value); + + Expect.isFalse(storyNode.classes.contains(CSS.HIDDEN_STORY)); + + state.loadFromHistory({}); + + Expect.equals(null, state.currentArticle.value); + Expect.isTrue(storyNode.classes.contains(CSS.HIDDEN_STORY)); + } + + void testStoryView() { + state.clearHistory(); + + Expect.isTrue(storyNode.classes.contains(CSS.HIDDEN_STORY)); + + final dataSourceView = + swarm.frontView.currentSection.dataSourceView.getSubview(0); + final itemView = dataSourceView.itemsView.getSubview(0); + _click(itemView.node); + state.expectHistory([getHistory(itemView.item)]); + } + + void testSliderMenu() { + Expect.equals(getView(swarm.sections[0]), swarm.frontView.currentSection); + + // Find the first slider menu item, and click on the one next after it. + _click(document.query('.${CSS.SM_ITEM}')[1]); + + Expect.equals(getView(swarm.sections[1]), swarm.frontView.currentSection); + + // Find the first menu item again and click on it. + _click(document.queryOne('.${CSS.SM_ITEM}')); + + Expect.equals(getView(swarm.sections[0]), swarm.frontView.currentSection); + } +} + +/** A proxy so we can intercept history calls */ +class UIStateProxy extends SwarmState { + List> history; + + UIStateProxy(Sections dataModel) : super(dataModel) { + clearHistory(); + } + + void pushToHistory() { + history.add(toHistory()); + super.pushToHistory(); + } + + void clearHistory() { + history = new List>(); + } + + void expectHistory(List> entries) { + Expect.equals(entries.length, history.length); + for (int i = 0; i < entries.length; i++) { + Map e = entries[i]; + Map h = history[i]; + Expect.equals(e['article'], h['article']); + } + clearHistory(); + } +} diff --git a/client/tests/client/samples/total/TotalTests.dart b/client/tests/client/samples/total/TotalTests.dart new file mode 100644 index 00000000000..c92cf14f275 --- /dev/null +++ b/client/tests/client/samples/total/TotalTests.dart @@ -0,0 +1,463 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +class TotalTests extends UnitTestSuite { + TotalTests() : super() { + } + + void setUpTestSuite() { + addTest(() { testDateUtils(); }); + addTest(() { testHtmlUtils(); }); + addTest(() { testStringUtils(); }); + addTest(() { testScanner(); }); + addTest(() { testParser(); }); + addTest(() { testFunctions(); }); + addTest(() { testMortgage(); }); + addTest(() { testVlookup(); }); + addTest(() { testHlookup(); }); + } + + void _checkDate(String date, num value) { + Expect.equals(value.toString(), DateUtils.parseDate(date).toString()); + } + + void _isDate(String date) { + Expect.isTrue(DateUtils.isDate(date), "DateUtils.isDate(${date})"); + } + + void _isNotDate(String date) { + Expect.isFalse(DateUtils.isDate(date), "DateUtils.isDate(${date})"); + } + + void testDateUtils() { + _isDate('1/1'); + _isDate('12/1'); + _isDate('11/31'); + _isDate('01/1'); + _isDate('1/01'); + _isDate('01/01'); + _isDate('1-1'); + _isDate('12-1'); + _isDate('11-31'); + _isDate('01-1'); + _isDate('1-01'); + _isDate('01-01'); + _isDate('1/1/1970'); + _isDate('01/1/1970'); + _isDate('1/01/1970'); + _isDate('1/1/70'); + _isDate('1/01/1970'); + _isNotDate("1/1A"); + _isNotDate("11/222"); + _isNotDate("11/22/"); + _checkDate('7/7/2011', 40731.0); + _checkDate('7/7/11', 40731.0); + _checkDate('7/07/2011', 40731.0); + _checkDate('07/07/2011', 40731.0); + _checkDate('07/7/2011', 40731.0); + _checkDate('7-7-2011', 40731.0); + _checkDate('7-7-11', 40731.0); + _checkDate('7-07-2011', 40731.0); + _checkDate('07-07-2011', 40731.0); + _checkDate('07-7-2011', 40731.0); + + // Test MM-DD- + double date = DateUtils.parseDate('7/7'); + double years = (date - 40731.0) / 365.0; + // Assert days/365 is close to an integer -- this will be true for > 100 years + Expect.isTrue(years - years.floor() < 0.1, "7/7"); + } + + void testHtmlUtils() { + Expect.equals("", HtmlUtils.quoteHtml("")); + Expect.equals("<", HtmlUtils.quoteHtml("<")); + Expect.equals("<<<<", HtmlUtils.quoteHtml("<<<<")); + Expect.equals("Hello<World", HtmlUtils.quoteHtml("Hello 0); + } + + void _testScannerHelper(String input) { + Scanner scanner = + new Scanner.preserveWhitespace(input, new CellLocation(null, new RowCol(1, 1))); + StringBuffer sb = new StringBuffer(); + while (true) { + Token token = scanner.nextToken(); + if (token == null) { + break; + } + sb.add(token.toString()); + } + + Expect.equals(input, sb.toString()); + } + + void testScanner() { + String input = + "ROUND(R1C0 * ((R1C1 / 1234.0000) / (1 - POWER(1 + (R1C1 / 1234.5000), -12 * R1C2))), 2)"; + Scanner scanner = + new Scanner.preserveWhitespace(input, new CellLocation(null, new RowCol(0, 0))); + List tokens = scanner.scan(); + + List expected = [ + "ROUND", "(", "R1C0", " ", "*", " ", "(", "(", "R1C1", " ", "/", " ", + "1234", ")", " ", "/", " ", "(", "1", " ", "-", " ", "POWER", "(", "1", + " ", "+", " ", "(", "R1C1", " ", "/", " ", "1234.5", ")", ",", " ", "-", + "12", " ", "*", " ", "R1C2", ")", ")", ")", ",", " ", "2", ")", ]; + + int index = 0; + tokens.forEach((Token token) { + Expect.equals(expected[index++], token.toString()); + }); + + _testScannerHelper("10 < 12"); + _testScannerHelper("10 > 12"); + _testScannerHelper("10 = 12"); + _testScannerHelper("10 <> 12"); + _testScannerHelper("10 <= 12"); + _testScannerHelper("10 >= 12"); + _testScannerHelper("FALSE"); + _testScannerHelper("TRUE"); + _testScannerHelper("ROUND(R1C0*((R1C1/1200)/(1-POWER(1+(R1C1/1200),-12*R1C2))),2)"); + _testScannerHelper("R1C1 + R2C2"); + _testScannerHelper("ThisIsAFunction999()"); + _testScannerHelper("LOG10(1000)"); + _testScannerHelper("R1C2 R1C2 R1C2 R1C2"); + _testScannerHelper("R[1]C2 R[-1]C2 R[1]C-2\tR[-1]C-2"); + _testScannerHelper("R1C[2]R1C[2]R1C[-2]R1C[-2]"); + _testScannerHelper("R[1]C[2]R[-1]C[2]R[1]C[-2]R[-1]C[-2]"); + _testScannerHelper("R111C222 R111C222 R111C222 R111C2"); + _testScannerHelper("R[111]C222:R[-111]C222, R[111]C222:R[-111]C222"); + _testScannerHelper("R111C[222]R111C[222]R111C[-222]R111C[-222]"); + _testScannerHelper("(R[111]C[222],R[-111]C[222]:R[111]C[-222], R[-111]C[-222])"); + _testScannerHelper("R1C0"); + _testScannerHelper("R[-1]C + 1"); + // Problem: R[-1]C-R[-1]C[2] : the C- is really C[0]- but looks like C + // followed by a (degenerate) number + _testScannerHelper("R[-1]C[1] - R[-1]C[2]"); + _testScannerHelper("RC[-1]* R1C1 / 1200"); + _testScannerHelper("R1C3 -RC[-1]"); + } + + void testParser() { + String input = "ROUND(R1C0*((R1C1/1200)/(1-POWER(1+(R1C1/1200),-12*R1C2))),2)"; + Scanner scanner = new Scanner(input, new CellLocation(null, new RowCol(1, 1))); + Parser parser = new Parser(scanner); + List tokens = parser.parse(); + + List expected = [ + "R1C0", "R1C1", "1200", "/", "1", "1", + "R1C1", "1200", "/", "+", "0", "12", "-", + "R1C2", "*", "2" /* nargs */, "POWER", "-", "/", "*", "2", + "2" /* nargs */, "ROUND"]; + + int index = 0; + tokens.forEach((Token token) { + Expect.equals(expected[index++], token.toString()); + }); + } + + void _testFunctionsHelper(String formula, double expected) { + try { + CellLocation location = new CellLocation(null, new RowCol(0, 0)); + Value value = new StringFormula(formula, location).calculate(); + double actual = value.asDouble(null); + Expect.approxEquals(expected, actual, 0.00001, "Error evaluating formula: ${formula}"); + } catch (var error) { + Expect.fail("Error evaluating formula: ${formula}, error=${error}"); + } + } + + void testFunctions() { + _testFunctionsHelper("2<5", 1.0); + _testFunctionsHelper("2>5", 0.0); + _testFunctionsHelper("2=5", 0.0); + _testFunctionsHelper("5=5", 1.0); + _testFunctionsHelper("2<>5", 1.0); + _testFunctionsHelper("5<>5", 0.0); + _testFunctionsHelper("2<=1", 0.0); + _testFunctionsHelper("2<=2", 1.0); + _testFunctionsHelper("2<=3", 1.0); + _testFunctionsHelper("2>=1", 1.0); + _testFunctionsHelper("2>=2", 1.0); + _testFunctionsHelper("2>=3", 0.0); + _testFunctionsHelper("FALSE", 0.0); + _testFunctionsHelper("TRUE", 1.0); + _testFunctionsHelper("FALSE()", 0.0); + _testFunctionsHelper("TRUE()", 1.0); + _testFunctionsHelper("NOT(FALSE)", 1.0); + _testFunctionsHelper("NOT(TRUE)", 0.0); + _testFunctionsHelper("NOT(FALSE())", 1.0); + _testFunctionsHelper("NOT(TRUE())", 0.0); + _testFunctionsHelper("AND(FALSE)", 0.0); + _testFunctionsHelper("AND(TRUE)", 1.0); + _testFunctionsHelper("AND(FALSE,FALSE)", 0.0); + _testFunctionsHelper("AND(FALSE,TRUE)", 0.0); + _testFunctionsHelper("AND(TRUE,FALSE)", 0.0); + _testFunctionsHelper("AND(TRUE,TRUE)", 1.0); + _testFunctionsHelper("OR(FALSE,FALSE)", 0.0); + _testFunctionsHelper("OR(FALSE,TRUE)", 1.0); + _testFunctionsHelper("OR(TRUE,FALSE)", 1.0); + _testFunctionsHelper("OR(TRUE,TRUE)", 1.0); + _testFunctionsHelper("IF(TRUE,3,4)", 3.0); + _testFunctionsHelper("IF(FALSE,3,4)", 4.0); + _testFunctionsHelper("IF(TRUE,3)", 3.0); + _testFunctionsHelper("IF(FALSE,3)", 0.0); + _testFunctionsHelper("IF(NOT(FALSE()),3,4)", 3.0); + _testFunctionsHelper("IF(NOT(TRUE()),3,4)", 4.0); + // Unary functions + _testFunctionsHelper("5-2", 3.0); + _testFunctionsHelper("5--2", 7.0); + _testFunctionsHelper("ABS(3)", 3.0); + _testFunctionsHelper("ABS(-3)", 3.0); + _testFunctionsHelper("COS(1)", 0.540302306); + _testFunctionsHelper("DEGREES(3)", 171.887339); + _testFunctionsHelper("EVEN(1.5)", 2.0); + _testFunctionsHelper("EVEN(3)", 4.0); + _testFunctionsHelper("EVEN(2)", 2.0); + _testFunctionsHelper("EVEN(-1)", -2.0); + _testFunctionsHelper("EVEN(-2)", -2.0); + _testFunctionsHelper("EXP(0)", 1.0); + _testFunctionsHelper("EXP(1)", 2.71828183); + _testFunctionsHelper("EXP(-1)", 0.367879441); + _testFunctionsHelper("FACT(0)", 1.0); + _testFunctionsHelper("FACT(1)", 1.0); + _testFunctionsHelper("FACT(2)", 2.0); + _testFunctionsHelper("FACT(3)", 6.0); + _testFunctionsHelper("FACT(4)", 24.0); + _testFunctionsHelper("FACTDOUBLE(5)", 15.0); + _testFunctionsHelper("FACTDOUBLE(6)", 48.0); + _testFunctionsHelper("FACTDOUBLE(10)", 3840.0); + _testFunctionsHelper("FACTDOUBLE(0)", 1.0); + _testFunctionsHelper("INT(8.9)", 8.0); + _testFunctionsHelper("INT(-8.9)", -9.0); + _testFunctionsHelper("LN(1)", 0.0); + _testFunctionsHelper("LN(2)", 0.693147181); + _testFunctionsHelper("LOG10(1)", 0.0); + _testFunctionsHelper("LOG10(10)", 1.0); + _testFunctionsHelper("LOG10(20)", 1.30103); + _testFunctionsHelper("ODD(1.5)", 3.0); + _testFunctionsHelper("ODD(3)", 3.0); + _testFunctionsHelper("ODD(2)", 3.0); + _testFunctionsHelper("ODD(-1)", -1.0); + _testFunctionsHelper("ODD(-2)", -3.0); + _testFunctionsHelper("RADIANS(180)", 3.14159265); + _testFunctionsHelper("SIGN(-3)", -1.0); + _testFunctionsHelper("SIGN(0)", 0.0); + _testFunctionsHelper("SIGN(3)", 1.0); + _testFunctionsHelper("SIN(1)", 0.841470985); + _testFunctionsHelper("SQRT(2)", 1.41421356); + _testFunctionsHelper("TANH(0)", 0.0); + _testFunctionsHelper("TANH(LN((1 + SQRT(5))/2))", Math.sqrt(5.0) / 5.0); + + // Binary functions + _testFunctionsHelper("COMBIN(7,3)", 35.0); + _testFunctionsHelper("COMBIN(7,4)", 35.0); + _testFunctionsHelper("LOG(1, 10)", 0.0); + _testFunctionsHelper("LOG(10, 10)", 1.0); + _testFunctionsHelper("LOG(20, 10)", 1.30103); + _testFunctionsHelper("MOD(3, 2)", 1.0); + _testFunctionsHelper("MOD(-3, 2)", 1.0); + _testFunctionsHelper("MOD(3, -2)", -1.0); + _testFunctionsHelper("MOD(-3, -2)", -1.0); + _testFunctionsHelper("QUOTIENT(5,2)", 2.0); + // _testFunctionsHelper("QUOTIENT(4.5,3.1)", 1.0); + _testFunctionsHelper("QUOTIENT(-10,3)", -3.0); + _testFunctionsHelper("ROUND(SQRT(2), 2)", 1.41); + _testFunctionsHelper("ROUND(SQRT(2), 1)", 1.4); + _testFunctionsHelper("POWER(SQRT(2), 2)", 2.0); + _testFunctionsHelper("TRUNC(8.567)", 8.0); + _testFunctionsHelper("TRUNC(8.567, 1)", 8.5); + _testFunctionsHelper("TRUNC(8.567, 2)", 8.56); + _testFunctionsHelper("TRUNC(-8.567)", -8.0); + _testFunctionsHelper("TRUNC(-8.567, 1)", -8.5); + _testFunctionsHelper("TRUNC(-8.567, 2)", -8.56); + + // Date/Time functions + _testFunctionsHelper("HOUR(40730.6789)", 16.0); + _testFunctionsHelper("MINUTE(40730.6789)", 17.0); + _testFunctionsHelper("SECOND(40730.6789)", 36.0); + _testFunctionsHelper("YEAR(DATE(2011,7,4))", 2011.0); + _testFunctionsHelper("MONTH(DATE(2011,7,4))", 7.0); + _testFunctionsHelper("DAY(DATE(2011,7,4))", 4.0); + + // N-ary functions + _testFunctionsHelper("GCD(5,2)", 1.0); + _testFunctionsHelper("GCD(24,36)", 12.0); + _testFunctionsHelper("GCD(24,36,4)", 4.0); + _testFunctionsHelper("GCD(7,1)", 1.0); + _testFunctionsHelper("GCD(5,0)", 5.0); + _testFunctionsHelper("LCM(5,2)", 10.0); + _testFunctionsHelper("LCM(24,36)", 72.0); + _testFunctionsHelper("LCM(24,36,5)", 360.0); + _testFunctionsHelper("MULTINOMIAL(2, 3, 4)", 1260.0); + _testFunctionsHelper("SERIESSUM(PI()/4,0,2,1,-1/FACT(2),1/FACT(4),-1/FACT(6))", 0.707103); + } + + void testMortgage() { + Reader reader = new SYLKReader(); + List data = reader.makeExample("mortgage"); + Spreadsheet spreadsheet = new Spreadsheet(); + reader.loadSpreadsheet(spreadsheet, data); + Expect.approxEquals(383.05, spreadsheet.getDoubleValue(new RowCol(99, 2)), 0.05); + Expect.approxEquals(36977.28, spreadsheet.getDoubleValue(new RowCol(100, 2)), 0.05); + Expect.approxEquals(6976.86, spreadsheet.getDoubleValue(new RowCol(100, 3)), 0.05); + Expect.approxEquals(30000.42, spreadsheet.getDoubleValue(new RowCol(100, 4)), 0.05); + } + + void testVlookup() { + Spreadsheet spreadsheet = new Spreadsheet(); + spreadsheet.setCellFromContentString(new RowCol(1, 1), "4.14"); + spreadsheet.setCellFromContentString(new RowCol(2, 1), "4.19"); + spreadsheet.setCellFromContentString(new RowCol(3, 1), "5.17"); + spreadsheet.setCellFromContentString(new RowCol(4, 1), "5.77"); + spreadsheet.setCellFromContentString(new RowCol(5, 1), "6.39"); + spreadsheet.setCellFromContentString(new RowCol(1, 2), "1"); + spreadsheet.setCellFromContentString(new RowCol(2, 2), "2"); + spreadsheet.setCellFromContentString(new RowCol(3, 2), "3"); + spreadsheet.setCellFromContentString(new RowCol(4, 2), "4"); + spreadsheet.setCellFromContentString(new RowCol(5, 2), "5"); + + // Test exact match: 5.77 ==> 4 + spreadsheet.setCellFromContentString(new RowCol(6, 1), "=VLOOKUP(5.77,A1:B5,2,0)"); + Expect.equals(4.0, spreadsheet.getDoubleValue(new RowCol(6, 1))); + + // Test approximate match: 5.177 < 5.3 < 5.77 ==> 3 + spreadsheet.setCellFromContentString(new RowCol(6, 1), "=VLOOKUP(5.3,A1:B5,2,1)"); + Expect.equals(3.0, spreadsheet.getDoubleValue(new RowCol(6, 1))); + + // Omit 'range_lookup' flag, behavior is the same as "true" + spreadsheet.setCellFromContentString(new RowCol(6, 1), "=VLOOKUP(5.3,A1:B5,2)"); + Expect.equals(3.0, spreadsheet.getDoubleValue(new RowCol(6, 1))); + } + + void testHlookup() { + Spreadsheet spreadsheet = new Spreadsheet(); + spreadsheet.setCellFromContentString(new RowCol(1, 1), "4.14"); + spreadsheet.setCellFromContentString(new RowCol(1, 2), "4.19"); + spreadsheet.setCellFromContentString(new RowCol(1, 3), "5.17"); + spreadsheet.setCellFromContentString(new RowCol(1, 4), "5.77"); + spreadsheet.setCellFromContentString(new RowCol(1, 5), "6.39"); + spreadsheet.setCellFromContentString(new RowCol(2, 1), "1"); + spreadsheet.setCellFromContentString(new RowCol(2, 2), "2"); + spreadsheet.setCellFromContentString(new RowCol(2, 3), "3"); + spreadsheet.setCellFromContentString(new RowCol(2, 4), "4"); + spreadsheet.setCellFromContentString(new RowCol(2, 5), "5"); + + // Test exact match: 5.77 ==> 4 + spreadsheet.setCellFromContentString(new RowCol(1, 6), "=HLOOKUP(5.77,A1:E2,2,0)"); + Expect.equals(4.0, spreadsheet.getDoubleValue(new RowCol(1, 6))); + + // Test approximate match: 5.177 < 5.3 < 5.77 ==> 3 + spreadsheet.setCellFromContentString(new RowCol(1, 6), "=HLOOKUP(5.3,A1:E2,2,1)"); + Expect.equals(3.0, spreadsheet.getDoubleValue(new RowCol(1, 6))); + + // Omit 'range_lookup' flag, behavior is the same as "true" + spreadsheet.setCellFromContentString(new RowCol(6, 1), "=HLOOKUP(5.3,A1:E2,2)"); + Expect.equals(3.0, spreadsheet.getDoubleValue(new RowCol(6, 1))); + } + + static void main() { + new TotalTests().run(); + } +} + diff --git a/client/tests/client/samples/total/total_tests.dart b/client/tests/client/samples/total/total_tests.dart new file mode 100644 index 00000000000..e7605d9576f --- /dev/null +++ b/client/tests/client/samples/total/total_tests.dart @@ -0,0 +1,17 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#library('total_tests'); + +#import('../../../../base/base.dart'); +#import('../../../../html/html.dart'); +#import('../../../../samples/total/src/TotalLib.dart'); +#import('../../../../testing/unittest/unittest.dart'); +#import('../../../../view/view.dart'); + +#source('TotalTests.dart'); + +main() { + TotalTests.main(); +} diff --git a/client/tests/client/testcfg.py b/client/tests/client/testcfg.py new file mode 100644 index 00000000000..b5042f32f5c --- /dev/null +++ b/client/tests/client/testcfg.py @@ -0,0 +1,14 @@ +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +import os +import test + +from os.path import join, exists + +import testing + +def GetConfiguration(context, root): + return testing.BrowserTestConfiguration( + context, root, fatal_static_type_errors=True) diff --git a/client/tests/client/touch/TouchTests.dart b/client/tests/client/touch/TouchTests.dart new file mode 100644 index 00000000000..e04fb2e5975 --- /dev/null +++ b/client/tests/client/touch/TouchTests.dart @@ -0,0 +1,49 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** Unit tests for touch. */ +class TouchTests extends UnitTestSuite { + TouchTests() : super() { + } + + void setUpTestSuite() { + test('Solver', () { + expect(Solver.solve((x) => x * x, 81, 10) == 9; + expect(Solver.solve((x) => x * x, 0, 10) == 0; + expect(Solver.solve((x) => x * x, 1.5625, 10) == 1.25; + expect(Solver.solve((x) => 1 / x, 10, 1) == 0.1; + }); + + group('Momentum', () { + test('SingleDimensionPhysics', () { + expect(new SingleDimensionPhysics().solve(0, 0, 1)) == 0; + expect(new SingleDimensionPhysics().solve(0, 5, 1)) == 0; + expect(new SingleDimensionPhysics().solve(0, 100, 1)) == 0; + expect(new SingleDimensionPhysics().solve(0, 100, 0.5)) == 0; + }); + + test('TimeoutMomentum()', () { + final delegate = new TestMomentumDelegate(); + final momentum = new TimeoutMomentum(null,) + }); + }); + } +} + +class TestMomentumDelegate { + Function onDecelerateCallback; + Function onDecelerationEndCallback; + + void onDecelerate(num x, num y, num duration = 0, + String timingFunction = null) { + onDecelerateCallback(x, y, duration, timingFunction); + } + + /** + * Callback for end of deceleration. + */ + void onDecelerationEnd() { + onDecelerationEndCallback(); + } +} \ No newline at end of file diff --git a/client/tests/client/util/util_tests.dart b/client/tests/client/util/util_tests.dart new file mode 100644 index 00000000000..83192acb5ab --- /dev/null +++ b/client/tests/client/util/util_tests.dart @@ -0,0 +1,52 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#library('util_tests'); + +#import('../../../html/html.dart'); +#import('../../../testing/unittest/unittest.dart'); +#import('../../../util/utilslib.dart'); + +main() { + new UtilsTests().run(); +} + +class UtilsTests extends UnitTestSuite { + + UtilsTests() : super() {} + + void setUpTestSuite() { + addTest(void testInsertAt() { + List a = new List(); + CollectionUtils.insertAt(a, 0, 1); + Expect.listEquals([1], a); + + CollectionUtils.insertAt(a, 0, 2); + Expect.listEquals([2, 1], a); + + CollectionUtils.insertAt(a, 0, 5); + CollectionUtils.insertAt(a, 0, 4); + CollectionUtils.insertAt(a, 0, 3); + Expect.listEquals([3, 4, 5, 2, 1], a); + + a = new List(); + CollectionUtils.insertAt(a, 0, 1); + Expect.listEquals([1], a); + + CollectionUtils.insertAt(a, 1, 2); + Expect.listEquals([1, 2], a); + + CollectionUtils.insertAt(a, 1, 3); + CollectionUtils.insertAt(a, 3, 4); + CollectionUtils.insertAt(a, 3, 5); + Expect.listEquals([1, 3, 2, 5, 4], a); + }); + + addTest(void testDefaultString() { + Expect.equals('', StringUtils.defaultString(null)); + Expect.equals('', StringUtils.defaultString('')); + Expect.equals('test', StringUtils.defaultString('test')); + }); + } +} diff --git a/client/tests/client/view/ViewTests.dart b/client/tests/client/view/ViewTests.dart new file mode 100644 index 00000000000..8bf3846202b --- /dev/null +++ b/client/tests/client/view/ViewTests.dart @@ -0,0 +1,202 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** Unit tests for the [View] class. */ +class ViewTests extends UnitTestSuite { + ViewTests() : super() { + } + + void setUpTestSuite() { + test('does not render immediately', () { + final view = new TestView(); + expect(view.isRendered) == false; + + view.addToDocument(document.body); + expect(view.isRendered) == true; + }); + + group('addToDocument()', () { + test('causes view to render', () { + final view = new TestView(); + view.addToDocument(document.body); + expect(view.isRendered) == true; + }); + + test('calls afterRender()', () { + var result = ''; + final view = new TestView(); + view.renderFn = () { + result += 'render'; + return new Element.html('
'); + }; + + view.afterRenderFn = (node) { result += 'after'; }; + + + view.addToDocument(document.body); + expect(result) == 'renderafter'; + }); + + test('calls enterDocument()', () { + final view = new TestView(); + bool entered = false; + view.enterDocumentFn = () { entered = true; }; + + view.addToDocument(document.body); + expect(entered) == true; + }); + }); + + group('afterRender()', () { + test('passes rendered node', () { + final rendered = new Element.html('
'); + final view = new TestView(); + view.renderFn = () => rendered; + view.afterRenderFn = (node) { expect(node) == rendered; }; + + view.addToDocument(document.body); + }); + }); + + group('childViewAdded()', () { + test('calls enterDocument() if parent is in document', () { + final parent = new TestView(); + parent.addToDocument(document.body); + + bool entered = false; + final child = new TestView(); + child.enterDocumentFn = () { entered = true; }; + + // Add the child. + parent.childViews = [child]; + parent.childViewAdded(child); + + expect(entered) == true; + }); + + test('does not call enterDocument() if parent is not in document', () { + final parent = new TestView(); + + bool entered = false; + final child = new TestView(); + child.enterDocumentFn = () { entered = true; }; + + // Add the child. + parent.childViews = [child]; + parent.childViewAdded(child); + + expect(entered) == false; + }); + + test('calls enterDocument() each time added', () { + final parent = new TestView(); + parent.addToDocument(document.body); + + var entered = 0; + final child = new TestView(); + child.enterDocumentFn = () { entered++; }; + + // Add the child. + parent.childViews = [child]; + parent.childViewAdded(child); + parent.childViewRemoved(child); + parent.childViewAdded(child); + parent.childViewRemoved(child); + parent.childViewAdded(child); + parent.childViewRemoved(child); + + expect(entered) == 3; + }); + }); + + group('childViewRemoved()', () { + test('calls exitDocument() if parent is in document', () { + final parent = new TestView(); + parent.addToDocument(document.body); + + bool exited = false; + final child = new TestView(); + child.exitDocumentFn = () { exited = true; }; + + // Remove the child. + parent.childViews = []; + parent.childViewRemoved(child); + + expect(exited) == true; + }); + + test('does not call exitDocument() if parent is not in document', () { + final parent = new TestView(); + + bool exited = false; + final child = new TestView(); + child.exitDocumentFn = () { exited = true; }; + + // Remove the child. + parent.childViews = []; + parent.childViewRemoved(child); + + expect(exited) == false; + }); + + test('calls exitDocument() each time removed', () { + final parent = new TestView(); + parent.addToDocument(document.body); + + var exited = 0; + final child = new TestView(); + child.exitDocumentFn = () { exited++; }; + + // Add the child. + parent.childViews = [child]; + parent.childViewAdded(child); + parent.childViewRemoved(child); + parent.childViewAdded(child); + parent.childViewRemoved(child); + parent.childViewAdded(child); + parent.childViewRemoved(child); + + expect(exited) == 3; + }); + }); + + group('enterDocument()', () { + test('children are called before parents', () { + var result = ''; + + final parent = new TestView(); + parent.enterDocumentFn = () { result += 'parent'; }; + + final child = new TestView(); + child.enterDocumentFn = () { result += 'child'; }; + + parent.childViews = [child]; + + parent.addToDocument(document.body); + expect(result) == 'childparent'; + }); + }); + } +} + +class TestView extends View { + Function renderFn; + Function afterRenderFn; + Function enterDocumentFn; + Function exitDocumentFn; + List childViews; + + TestView() : super(), childViews = [] { + // Default behavior. + renderFn = () => new Element.html('
'); + afterRenderFn = (node) {}; + enterDocumentFn = () {}; + exitDocumentFn = () {}; + } + + Element render() => renderFn(); + void afterRender(Element node) { afterRenderFn(node); } + void enterDocument() { enterDocumentFn(); } + void exitDocument() { exitDocumentFn(); } +} diff --git a/client/tests/client/view/view_tests.dart b/client/tests/client/view/view_tests.dart new file mode 100644 index 00000000000..3a3cd07a5cc --- /dev/null +++ b/client/tests/client/view/view_tests.dart @@ -0,0 +1,16 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#library('view_tests'); + +#import('../../../base/base.dart'); +#import('../../../html/html.dart'); +#import('../../../testing/unittest/unittest.dart'); +#import('../../../view/view.dart'); + +#source('ViewTests.dart'); + +void main() { + new ViewTests().run(); +} diff --git a/client/tests/dartc/dartc.status b/client/tests/dartc/dartc.status new file mode 100644 index 00000000000..d7bfbedff8e --- /dev/null +++ b/client/tests/dartc/dartc.status @@ -0,0 +1,21 @@ +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +prefix dartc/client + + +[ $arch == ia32 ] +*: Skip + + +[ $arch == x64 ] +*: Skip + + +[ $arch == simarm ] +*: Skip + + +[ $arch == arm ] +*: Skip diff --git a/client/tests/dartc/testcfg.py b/client/tests/dartc/testcfg.py new file mode 100644 index 00000000000..97a941b31a2 --- /dev/null +++ b/client/tests/dartc/testcfg.py @@ -0,0 +1,31 @@ +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +import testing + +def GetConfiguration(context, root): + return ClientCompilationTestConfiguration(context, root) + + +class ClientCompilationTestConfiguration( + testing.CompilationTestConfiguration): + def __init__(self, context, root): + super(ClientCompilationTestConfiguration, self).__init__(context, root) + + def SourceDirs(self): + return [ + 'async', + 'base', + 'box2d', + 'dom', + 'json', + 'observable', + 'samples', + 'streams', + 'testing', + 'tests', + 'touch', + 'util', + 'view', + 'weld'] diff --git a/client/tools/buildbot_annotated_steps.py b/client/tools/buildbot_annotated_steps.py new file mode 100644 index 00000000000..accd94af8db --- /dev/null +++ b/client/tools/buildbot_annotated_steps.py @@ -0,0 +1,199 @@ +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +#!/usr/bin/python + +# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Dart client buildbot steps + +Compiles dart client apps with dartc, and run the client tests both in headless +chromium and headless dartium. +""" + +import os +import re +import socket +import subprocess +import sys +import shutil +import glob + +BUILDER_NAME = 'BUILDBOT_BUILDERNAME' +REVISION = 'BUILDBOT_REVISION' + +# latest dartium location +DARTIUM_VERSION_FILE = 'tests/dartium/BUILD_VERSION' +DARTIUM_V_MATCHER = 'gs://dashium-archive/latest/dashium-\w*-full-([0-9]*).zip' + +# Patterns are of the form "dart_client-linux-ia32-debug" +BUILDER_PATTERN = r'dart_client-(\w+)-(\w+)-(\w+)' + + +def GetBuildInfo(srcpath): + """Returns a tuple (name, version, arch, mode, platform) where: + - name: A name for the build - the buildbot host if a buildbot. + - version: A version string corresponding to this build. + - arch: 'dartium' (default) or 'chromium' + - mode: 'debug' or 'release' (default) + - platform: 'linux' or 'mac' + """ + name = None + version = None + mode = 'release' + arch = 'dartium' + platform = 'linux' + + # Populate via builder environment variables. + name = os.environ.get(BUILDER_NAME) + version = os.environ.get(REVISION) + + if name: + pattern = re.match(BUILDER_PATTERN, name) + if pattern: + platform = pattern.group(1) + arch = pattern.group(2) + mode = pattern.group(3) + + # Fall back if not on builder. + if not name: + name = socket.gethostname().split('.')[0] + if not version: + os.chdir(srcpath) + pipe = subprocess.Popen( + ['svnversion', '-n'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + output = pipe.communicate() + if pipe.returncode == 0: + version = output[0] + else: + version = 'unknown' + return (name, version, arch, mode, platform) + + +def RunDartcCompiler(client_path, mode, outdir): + """Compiles the client code to javascript for dartc tests.""" + # Move to the client directory and call the build script + os.chdir(client_path) + return subprocess.call( + [sys.executable, '../tools/build.py', '--arch=dartc', '--mode=' + mode]) + +def RunBrowserTests(client_path, arch, mode, platform): + """Runs the Dart client tests.""" + if platform == 'linux': + cmd = ['xvfb-run'] + else: + cmd = [] + # Move to the client directory and call the test script + os.chdir(client_path) + cmd += [sys.executable, '../tools/test.py', + '--arch=' + arch, '--mode=' + mode, + '--time', '--report', '--progress=buildbot', '-v'] + return subprocess.call(cmd) + +def GetUtils(srcpath): + ''' + dynamically get the utils module + We use a dynamic import for tools/util.py because we derive its location + dynamically using sys.argv[0]. This allows us to run this script from + different directories. + + args: + srcpath - the location of the source code to build + ''' + sys.path.append(os.path.abspath(os.path.join(srcpath, '..', 'tools'))) + utils = __import__('utils') + return utils + +def GetOutDir(utils, mode, name): + ''' + get the location to place the output + + args: + utils - the tools/utils.py module + mode - the mode release or debug + name - the name of the builder + ''' + return utils.GetBuildRoot(utils.GuessOS(), mode, name) + +def ProcessDartClientTests(srcpath, arch, mode, platform, name): + ''' + build and test the dart client applications + + args: + srcpath - the location of the source code to build + arch - the architecture we are building for + mode - the mode release or debug + platform - the platform we are building for + ''' + print 'ProcessDartClientTests' + if arch == 'chromium': + print ('@@@BUILD_STEP dartc dart clients: %s@@@' % name) + + utils = GetUtils(srcpath) + outdir = GetOutDir(utils, mode, "dartc") + status = RunDartcCompiler(srcpath, mode, outdir) + if status != 0: + return status + + if arch == 'dartium': + version_file = os.path.join(srcpath, DARTIUM_VERSION_FILE) + if os.path.exists(version_file): + latest = open(version_file, 'r').read() + print '@@@BUILD_STEP dartium version: r%s@@@' % ( + re.match(DARTIUM_V_MATCHER, latest).group(1)) + print '@@@BUILD_STEP browser unit tests@@@' + return RunBrowserTests(srcpath, arch, mode, platform) + +def ProcessTools(srcpath, mode, name, version): + ''' + build and test the tools + + args: + srcpath - the locatio of the source code to build + mode - the mode release or debug + version - the svn version of the currently checked out code + ''' + print 'ProcessTools' + + toolsBuildScript = os.path.join(srcpath, '..', 'editor', 'build', 'build.py') + + #TODO: debug statements to be removed in the future. + print "srcpath = " + srcpath + print "mode = " + mode + print "name = " + name + print "version = " + version + print "toolsBuildScript = " + os.path.abspath(toolsBuildScript) + + utils = GetUtils(srcpath) + outdir = GetOutDir(utils, mode, "tools") + cmds = [sys.executable, toolsBuildScript, + '--mode=' + mode, '--revision=' + version, + '--name=' + name, '--out=' + outdir] + return subprocess.call(cmds) + +def main(): + print 'main' + if len(sys.argv) == 0: + print 'Script pathname not known, giving up.' + return 1 + + scriptdir = os.path.dirname(sys.argv[0]) + srcpath = os.path.abspath(os.path.join(scriptdir, '..')) + + (name, version, arch, mode, platform) = GetBuildInfo(srcpath) + if name == 'dart-editor': + status = ProcessTools(srcpath, mode, name, version) + else: + status = ProcessDartClientTests(srcpath, arch, mode, platform, name) + + if status: + print '@@@STEP_FAILURE@@@' + + return status + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/client/tools/copy_dart.py b/client/tools/copy_dart.py new file mode 100755 index 00000000000..6465c90db92 --- /dev/null +++ b/client/tools/copy_dart.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. +"""Used to merge and copy dart source files for deployment to AppEngine""" + +import fileinput +import sys +import shutil +import os +import re +from os.path import abspath, basename, dirname, exists, isabs, join +from glob import glob + +re_library = re.compile(r'^#library\([\'"](.*)[\'"]\);$') +re_import = re.compile(r'^#import\([\'"](.*)[\'"]\);$') +re_source = re.compile(r'^#source\([\'"](.*)[\'"]\);$') + +class Library(object): + def __init__(self, name, imports, sources, code): + self.name = name + self.imports = imports + self.sources = sources + self.code = code + +def parseLibrary(library): + """ Parses a .dart source file that is the root of a library, and returns + information about it: the name, the imports, included sources, and any + code in the file. + """ + libraryname = None + imports = [] + sources = [] + inlinecode = [] + if exists(library): + # TODO(sigmund): stop parsing when import/source + for line in fileinput.input(library): + match = re_import.match(line) + if match: + imports.append(match.group(1)) + else: + match = re_source.match(line) + if match: + sources.append(match.group(1)) + else: + match = re_library.match(line) + if match: + assert libraryname is None + libraryname = match.group(1) + else: + inlinecode.append(line) + + fileinput.close() + return Library(libraryname, imports, sources, inlinecode) + +def normjoin(*args): + return os.path.normpath(os.path.join(*args)) + +def mergefiles(srcs, dstfile): + for src in srcs: + with open(src, 'r') as s: + dstfile.write(s.read()) + +def main(outdir = None, *inputs): + if not outdir or not inputs: + print "Usage: %s OUTDIR INPUTS" % args[0] + print " OUTDIR is the war directory to copy to" + print " INPUTS is a list of files or patterns used to specify the input" + print " .dart files" + print "This script should be run from the client root directory." + print "Files will be merged and copied to: OUTDIR/relative-path-of-file," + print "except for dart files with absolute paths, which will be copied to" + print " OUTDIR/absolute-path-as-directories" + return 1 + + entry_libraries = [] + for i in inputs: + entry_libraries.extend(glob(i)) + + for entrypoint in entry_libraries: + # Get the transitive set of dart files this entrypoint depends on, merging + # each library along the way. + worklist = [os.path.normpath(entrypoint)] + seen = set() + while len(worklist) > 0: + lib = worklist.pop() + if lib in seen: + continue + + seen.add(lib) + + if (dirname(dirname(lib)).endswith('dom/generated/src') + or dirname(lib).endswith('dom/src')): + continue + + if lib.endswith('json/json.dart'): + # TODO(jmesserly): Dartium interprets "json.dart" as "dart_json.dart", + # so we need that add dart_json.dart here. This is hacky. + lib = lib.replace('json.dart', 'dart_json.dart') + + library = parseLibrary(lib) + + # Ensure output directory exists + outpath = join(outdir, lib[1:] if isabs(lib) else lib) + dstpath = dirname(outpath) + if not exists(dstpath): + os.makedirs(dstpath) + + + # Create file containing all imports, and inlining all sources + with open(outpath, 'w') as f: + if library.name: + f.write("#library('%s');\n\n" % library.name) + else: + f.write("#library('%s');\n\n" % basename(lib)) + for importfile in library.imports: + f.write("#import('%s');\n" % importfile) + f.write('%s' % (''.join(library.code))) + mergefiles([normjoin(dirname(lib), s) for s in library.sources], f) + + worklist.extend([normjoin(dirname(lib), i) for i in library.imports]) + + return 0 + +if __name__ == '__main__': + sys.exit(main(*sys.argv[1:])) diff --git a/client/tools/coverage.css b/client/tools/coverage.css new file mode 100644 index 00000000000..bd5b9df2cad --- /dev/null +++ b/client/tools/coverage.css @@ -0,0 +1,105 @@ +.menu { + padding:0 20px 0 0; +} + +.menu-table { + border-collapse: collapse; + width:100%; +} + +.file { + border:1px solid #808080; + cursor:pointer; +} + +.file:hover { + background-color: #f0f0b0; +} + +.file-selected { + background-color: #cccccc; +} + +.package { + font-family:monospace; + border: 0px; + position: relative; +} + +.file-name { + font-family:monospace; + border: 0px; +} + +.file-percent { + font-family:monospace; + display: inline; + text-align: right; + border: 0px; + width: 100px; + position: relative; +} + +.linenum { + font-family:monospace; + white-space: pre; + display:block; +} + +.yes { + background:#af8; +} + +.no { + background:#f77; +} + +.not-code { + background:#fff; +} + +.coverage-bar { + background:#f77; + width:100px; + height:14px; + position:absolute; + top:1px; + left:0px; +} + +.coverage-bar-inner { + background:#af8; + height:14px; + position:absolute; + top:0px; + left:0px; +} + +.details { + position:fixed; + background:white; + z-index:10; + border:1px solid black; + border-radius:5px; + padding:3px; + font-family:monospace; + width:95%; + left:20px; + top:20px; +} + +.details-body { + overflow-x:auto; + overflow-y:scroll; + height:800px; +} + +.close { + text-align:right; + cursor:pointer; + padding-bottom:10px; +} + +.hidden { + display: none; +} diff --git a/client/tools/coverage.py b/client/tools/coverage.py new file mode 100755 index 00000000000..6b557076016 --- /dev/null +++ b/client/tools/coverage.py @@ -0,0 +1,450 @@ +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +#!/usr/bin/python2.4 +# + +"""Uses jscoverage to instrument a web unit test and runs it. + +Uses jscoverage to instrument a web unit test and extracts coverage statistics +from running it in a headless webkit browser. +""" + +import codecs +import json +import optparse +import os +import re +import sourcemap # located in this same directory +import subprocess +import sys + +def InstrumentScript(script_name, src_dir, dst_dir, jscoveragecmd, verbose): + """ Instruments a test using jscoverage. + + Args: + script_name: the original javascript file containing the test. + src_dir: the directory where the test is found. + dst_dir: the directory where to place the instrumented test. + jscoveragecmd: the fully-qualified command to run jscoverage. + + Returns: + 0 if no errors where found. + 1 if jscoverage gave errors. + """ + SafeMakeDirs(dst_dir) + + PrintNewStep("instrumenting") + src_file = os.path.join(src_dir, script_name) + dst_file = os.path.join(dst_dir, script_name) + if not os.path.exists(src_file): + print "Script not found: " + src_file + return 1 + + if os.path.exists(dst_file): + if os.path.getmtime(src_file) < os.path.getmtime(dst_file): + # Skip running jscoverage if the input hasn't been updated + return 0 + + # Create the instrumented code using jscoverage: + status, output, err = ExecuteCommand([sys.executable, + 'tools/jscoverage_wrapper.py', jscoveragecmd, src_file, dst_dir], verbose) + if status: + print "ERROR: jscoverage had errors: " + print output + print err + return 1 + return 0 + +def SafeMakeDirs(dirname): + """ Creates a directory and, if necessary its parent directories. + + This function will safely return if other concurrent jobs try to create the + same directory. + """ + if not os.path.exists(dirname): + try: + os.makedirs(dirname) + except Exception: + # this check allows invoking this script concurrently in many jobs + if not os.path.exists(dirname): + raise + +COVERAGE_TEST_TEMPLATE = ''' + + + Coverage for %s + + +

Running %s

+ + + + +''' + +def CollectCoverageForTest(test, controller, script, drt, src_dir, + dst_dir, sourcemapfile, result, verbose): + """ Collect test coverage information from an instrumented test. + Internally this function generates an html page for collecting the + coverage results. This page is just like the HTML that runs a test, but + instead of using 'test_controller.js' (which indicates whether tests pass + or fail), we use 'coverage_controller.js' (which prints out coverage + information). + + Args: + test: the name of the test + controller: path to coverage_controller.js + script: actual javascript test (previously instrumented with jscoverage) + drt: path to DumpRenderTree + src_dir: directory where original 'script' is found. + dst_dir: directory where the instrumented 'script' is found and where to + generate the html file. + sourcemapfile: sourcemap file associated with the script test. This is + typically the source map for the original + (non-instrumented code) since the jscoverage results are + reported with respect to the original line numbers. + result: a dictionary that wlll hold the results of this invocation. The + dictionary keys are original dart file names, the value is a + pair containing two sets of numbers: covered lines, and + non-covered but executable lines. Note, some lines are not + mentioned because they could be dropped during compilation (e.g. + empty lines, comments, etc). + This dictionary doesn't need to be empty, in which case this + function will combine the results of this test with what + previously was recoded in 'result'. + verbose: show verbose progress mesages + """ + html_contents = COVERAGE_TEST_TEMPLATE % (test, test, controller, script) + html_output_file = os.path.join(dst_dir, test + '_coverage.html') + with open(html_output_file, 'w') as f: + f.write(html_contents) + + PrintNewStep("running") + status, output, err = ExecuteCommand([drt, html_output_file], verbose) + lines = output.split('\n') + if len(lines) <= 2 or status: + print "ERROR: can't obtain coverage for %s%s%s" % ( + RED_COLOR, html_output_file, NO_COLOR) + return 1 if not status else status + + PrintNewStep("processing") + # output is json, possibly split in multiple lines. We skip the first line + # (DumpRenderTree shows a content-type line). + coverage_res = ''.join(lines[1: lines.index("#EOF")]) + try: + json_obj = json.loads(coverage_res) + except Exception: + print "ERROR: can't obtain coverage for %s%s%s" % ( + RED_COLOR, html_output_file, NO_COLOR) + return 1 + _processResult(json_obj, script, src_dir, sourcemapfile, result) + + +# Patterns used to detect declaration sites in the generated js code +HOIST_FUNCTION_PATTERN = re.compile("^function ") +MEMBER_PATTERN = re.compile( + "[^ ]*prototype\.[^ ]*\$member = function\([^\)]*\){$") +GETTER_PATTERN = re.compile( + "[^ ]*prototype\.[^ ]*\$getter = function\([^\)]*\){$") +SETTER_PATTERN = re.compile( + "[^ ]*prototype\.[^ ]*\$setter = function\([^\)]*\){$") + +def _processResult(json_obj, js_file, src_dir, sourcemap_file, result): + """ Process the result of a single test run. See 'CollectCoverageForTest' for + more details. + + Args: + json_obj: the json object that was exported by coverage_controller.js + js_file: name of the script file + src_dir: directory where the generated jsfile is located of the script + sourcemap_file: sourcemap file associated with the script test. + result: a dictionary that will hold the results of this invocation. + """ + if js_file not in json_obj or len(json_obj) != 1: + raise Exception("broken format in coverage result") + + lines_covered = json_obj[js_file] + smap = sourcemap.parse(sourcemap_file) + with open(os.path.join(src_dir, js_file), 'r') as f: + js_code = f.readlines() + + for line in range(len(lines_covered)): + original = smap.get_source_location(line, 1) + if original: + filename, srcline, srccolumn, srcid = original + if filename not in result: + result[filename] = (set(), set()) + if lines_covered[line] is not None: + if lines_covered[line] > 0: + # exclude the line if it looks like a generated class declaration or + # a method declaration + srccode = js_code[line - 1] + if (HOIST_FUNCTION_PATTERN.match(srccode) is None + and GETTER_PATTERN.match(srccode) is None + and SETTER_PATTERN.match(srccode) is None + and MEMBER_PATTERN.match(srccode) is None): + result[filename][0].add(srcline) + elif lines_covered[line] == 0: + result[filename][1].add(srcline) + +# Global color constants +GREEN_COLOR = "\033[32m" +YELLOW_COLOR = "\033[33m" +RED_COLOR = "\033[31m" +NO_COLOR = "\033[0m" + +# Templates for the HTML output +SUMMARY_TEMPLATE = ''' + + + + + + + + +''' + +# Template for exporting the coverage information data for each file +FILE_TEMPLATE = ''' + // file %s + files.push("%s"); + code["%s"] = [%s]; + summary["%s"] = [%s];''' + +# TODO(sigmund): increase these thresholds to 95 and 70 +GOOD_THRESHOLD = 80 +OK_THRESHOLD = 50 + +def ReportSummary(outdir, result): + """ Analyzes the results and produces an ASCII and an HTML summary report. + Args: + outdir: directory where to generate the HTML report + result: a dictionary containing results of the coverage analysis. The + dictionary maps file names to a pair of 2 sets of numbers. The + first set contains executable covered lines, the second set + contains executable non-covered lines. Any missing line is + likely not translated into code (e.g. comments, an interface + body) or translated into declarations (e.g. a getter + declaration). + + """ + basepath = os.path.join(os.path.dirname(sys.argv[0]), "../") + html_summary_lines = [] + print_summary_lines = [] + for key in result.keys(): + filepath = os.path.relpath(os.path.join(basepath, key)) + if (os.path.exists(filepath) and + # exclude library directories under client/ + not "dom/generated" in filepath and + not "json/" in filepath): + linenum = 0 + realcode = 0 + total_covered = 0 + escaped_lines = [] + file_summary = [] + with codecs.open(filepath, 'r', 'utf-8') as f: + lines = f.read() + for line in lines.split('\n'): + linenum += 1 + stripline = line.strip() + if linenum in result[key][0]: + total_covered += 1 + file_summary.append("1") + realcode += 1 + elif linenum in result[key][1]: + file_summary.append("0") + realcode += 1 + else: + file_summary.append("2") + + escaped_lines.append( + '"' + line.replace('"','\\"').replace('<', '<" + "') + '"') + + percent = total_covered * 100 / realcode + + # append a pair, the first component is only used for sorting + print_summary_lines.append((filepath, "%s%3d%% (%4d of %4d) - %s%s" + % (GREEN_COLOR if (percent >= GOOD_THRESHOLD) else + YELLOW_COLOR if (percent >= OK_THRESHOLD) else + RED_COLOR, + percent, total_covered, realcode, + filepath, + NO_COLOR))) + + html_summary_lines.append(FILE_TEMPLATE % ( + filepath, filepath, + filepath, ",".join(escaped_lines), + filepath, ",".join(file_summary))) + + print_summary_lines.sort() + print "\n".join([s for (percent, s) in print_summary_lines]) + + outfile = os.path.join(outdir, 'coverage_summary.html') + resource_dir = os.path.abspath(os.path.dirname(sys.argv[0])) + + # Inject css and js code within the coverage page: + with open(os.path.join(resource_dir, 'coverage.css'), 'r') as f: + style = f.read() + with open(os.path.join(resource_dir, 'show_coverage.js'), 'r') as f: + jscode = f.read() + with codecs.open(outfile, 'w', 'utf-8') as f: + f.write(SUMMARY_TEMPLATE % (style, jscode, "\n".join(html_summary_lines))) + + print ("Detailed summary available at: %s" % outfile) + return 0 + +def ExecuteCommand(cmd, verbose): + """Execute a command in a subprocess. + """ + if verbose: print '\nExecuting: ' + ' '.join(cmd) + pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (output, err) = pipe.communicate() + if pipe.returncode != 0 and verbose: + print 'Execution failed: ' + output + '\n' + err + print output + print err + return pipe.returncode, output, err + +def main(): + global total_tests + parser = Flags() + (options, args) = parser.parse_args() + if not AreOptionsValid(options): + parser.print_help() + return 1 + + # Create dir for instrumented code + instrumented_dir = os.path.join(os.path.dirname(options.dir), + os.path.basename(options.dir) + "_instrumented") + + # Determine the set of tests to execute + prefix = options.tests_prefix + tests = [] + if os.path.exists(prefix) and os.path.isdir(prefix): + test_dir = prefix + test_file_prefix = None + else: + test_dir = os.path.dirname(prefix) + test_file_prefix = os.path.basename(prefix) + + for root, dirs, files in os.walk(test_dir): + for f in files: + if f.endswith('.app'): + path = os.path.join(root, f) + if test_file_prefix is None or path.startswith(prefix): + tests.append(path) + + # Run tests and collect results + result = dict() + total_tests = len(tests) + for test in tests: + testname = test.replace("/", "_") + script = testname + ".js" + PrintNewTest(test) + status = InstrumentScript(script, options.dir, instrumented_dir, + options.jscoverage, options.verbose) + if status: + print "skipped %s " % script + global last_line_length + last_line_length = 0 + else: + sourcemapfile = os.path.join( + os.path.join(options.sourcemapdir, test), test + ".js.map") + CollectCoverageForTest( + testname, options.controller, script, options.drt, + options.dir, instrumented_dir, sourcemapfile, result, options.verbose) + + print "" # end compact progress indication + ReportSummary(options.dir, result) + return 0 + +# special functions and variables to print progress compactly +current_test = 0 +current_test_name = '' +total_tests = 0 # to be filled in later after parsing options +last_line_length = 0 + +def PrintLine(s): + global last_line_length + if last_line_length > 0: + print "\r" + (" " * last_line_length) + "\r", + last_line_length = len(s) + print s, + sys.stdout.flush() + +def PrintNewTest(test): + global current_test + global current_test_name + global total_tests + global GREEN_COLOR + global NO_COLOR + current_test += 1 + current_test_name = test + PrintLine("%d of %d (%d%%): %s (%sstart%s)" % (current_test, total_tests, + (100 * current_test / total_tests), test, GREEN_COLOR, NO_COLOR)) + +def PrintNewStep(message): + global current_test + global current_test_name + global total_tests + global GREEN_COLOR + global NO_COLOR + PrintLine("%d of %d (%d%%): %s (%s%s%s)" % (current_test, total_tests, + (100 * current_test / total_tests), current_test_name, + GREEN_COLOR, message, NO_COLOR)) + + +def Flags(): + result = optparse.OptionParser() + result.add_option("-d", "--dir", + help="Directory where the compiled tests can be found.", + default=None) + result.add_option("--controller", + help="Path to the coverage controller js file.", + default=None) + result.add_option("-v", "--verbose", + help="Print a messages and progress", + default=False, + action="store_true") + result.add_option("-t", "--tests_prefix", + help="Prefix (typically a directory) where to crawl for test app files", + type="string", + action="store", + default=None) + result.add_option("--drt", + help="The location for DumpRenderTree in the local file system", + default=None) + result.add_option("--jscoverage", + help="The location for jscoverage in the local file system", + default=None) + result.add_option("--sourcemapdir", + help="The location for sourcemap files in the local file system", + default=None) + result.set_usage( + "coverage.py -d -t " + "--drt= " + "--jscoverage= " + "--sourcemapdir=" + "[options]") + return result + +def AreOptionsValid(options): + return (options.dir and options.tests_prefix and options.drt + and options.jscoverage and options.sourcemapdir) + +if __name__ == '__main__': + sys.exit(main()) diff --git a/client/tools/dartserver/bin/dartserver b/client/tools/dartserver/bin/dartserver new file mode 100755 index 00000000000..6f8a5d95d3f --- /dev/null +++ b/client/tools/dartserver/bin/dartserver @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +"""Based on experimental/apps/total/endart/bin/endart. +TODO(jacobr): there has to be a better way to integrate this with the build. +""" + +import fnmatch +import glob +import os +import subprocess +import sys + +# Add the tools directory so we can find utils.py. +sys.path.append(os.path.abspath(os.path.join( + os.path.dirname(__file__), + "../../../../tools"))) + +import utils + + +def flatten(iterable): + it = iter(iterable) + for e in it: + if isinstance(e, (list, tuple)): + for f in flatten(e): + yield f + else: + yield e + +def thisJar(file): + root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..')) + return [os.path.join(root, file)] + +def allJars(directory): + matches = [] + root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..')) + for path, dirs, files in os.walk(os.path.join(root, directory)): + for file in fnmatch.filter(files, '*.jar'): + matches.append(os.path.normpath(os.path.join(root, path, file))) + return matches + +def classpath(libs): + return ':'.join(flatten(libs)) + +def main(): + buildRoot = utils.GetBuildRoot(utils.GuessOS(), "debug", "dartc") + + cp = classpath([ + thisJar(os.path.join('../../', buildRoot, 'dartserver/dartserver.jar')), + thisJar(os.path.join('../../', buildRoot, 'dartserver/libutil.jar')), + allJars(os.path.join('../../', buildRoot, 'compiler/lib')), + allJars('../../../third_party/jetty/7.4.4.v20110707'), + ]) + root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), + '../../../../client')) + subprocess.call([ 'java', '-classpath', cp, + 'com.google.appstack.tools.dartserver.DartServer'] + + [root] + sys.argv[1:]) + +if __name__ == '__main__': + main() diff --git a/client/tools/dartserver/build.xml b/client/tools/dartserver/build.xml new file mode 100644 index 00000000000..a25ba8934a0 --- /dev/null +++ b/client/tools/dartserver/build.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/tools/dartserver/dartserver.mf b/client/tools/dartserver/dartserver.mf new file mode 100644 index 00000000000..6b7e7392982 --- /dev/null +++ b/client/tools/dartserver/dartserver.mf @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +Main-Class: com.google.appstack.tools.dartserver.DartServer diff --git a/client/tools/dartserver/java/com/google/appstack/tools/AppEngineThumbnailServlet.java b/client/tools/dartserver/java/com/google/appstack/tools/AppEngineThumbnailServlet.java new file mode 100644 index 00000000000..72220ab87b2 --- /dev/null +++ b/client/tools/dartserver/java/com/google/appstack/tools/AppEngineThumbnailServlet.java @@ -0,0 +1,93 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.appstack.tools; + +import com.google.appengine.api.images.CompositeTransform; +import com.google.appengine.api.images.Image; +import com.google.appengine.api.images.ImagesService; +import com.google.appengine.api.images.ImagesServiceFactory; +import com.google.appengine.api.images.OutputSettings; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; + +/** + * This servlet takes images URLs and replies with a resized thumbnail of the + * image. This servlet uses AppEngine libraries and is only used when + * dartserver is run through the AppEngine dev server or hosted. + */ +public class AppEngineThumbnailServlet extends ThumbnailServlet { + @Override + protected byte[] makeThumbnail(URL originalUrl, int width, int height) { + // Read the original image. + Image original = ImagesServiceFactory.makeImage(readData(originalUrl)); + + double aspect = (double) original.getWidth() / original.getHeight(); + double desiredAspect = (double) width / height; + + CompositeTransform transform = ImagesServiceFactory.makeCompositeTransform(); + + // Adjust the image to fit the thumbnail's aspect ratio. + if (aspect > desiredAspect) { + // Too wide, so crop on the sides. + + // Width of original image cropped to fit thumbnail. + double croppedWidth = (double) original.getHeight() * width / height; + + // Amount to crop on each side, in normal coords. + double normalCrop = (original.getWidth() - croppedWidth) / + original.getWidth() / 2.0f; + + transform.concatenate(ImagesServiceFactory.makeCrop( + normalCrop, 0.0f, 1.0f - normalCrop, 1.0f)); + } else if (aspect < desiredAspect) { + // Too tall, so crop out the bottom. + + // Height of original image cropped to fit thumbnail. + double croppedHeight = (double) original.getWidth() * height / width; + double normalHeight = croppedHeight / original.getHeight(); + + transform.concatenate(ImagesServiceFactory.makeCrop( + 0.0f, 0.0f, 1.0f, normalHeight)); + } + + // Now scale the correctly-cropped image. + transform.concatenate(ImagesServiceFactory.makeResize(width, height)); + + // Resize it. + ImagesService images = ImagesServiceFactory.getImagesService(); + + OutputSettings settings = new OutputSettings( + ImagesService.OutputEncoding.JPEG); + settings.setQuality(75); + Image thumbnail = images.applyTransform(transform, original, settings); + + return thumbnail.getImageData(); + } + + private byte[] readData(URL url) { + final int bufferSize = 16384; + + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + + int bytesRead; + byte[] data = new byte[bufferSize]; + + try { + InputStream stream = url.openStream(); + while ((bytesRead = stream.read(data, 0, data.length)) != -1) { + buffer.write(data, 0, bytesRead); + } + + buffer.flush(); + return buffer.toByteArray(); + } catch (IOException e) { + // TODO(rnystrom): Handle error! + throw new RuntimeException(); + } + } +} diff --git a/client/tools/dartserver/java/com/google/appstack/tools/AwtThumbnailServlet.java b/client/tools/dartserver/java/com/google/appstack/tools/AwtThumbnailServlet.java new file mode 100644 index 00000000000..7d9b63e8b9b --- /dev/null +++ b/client/tools/dartserver/java/com/google/appstack/tools/AwtThumbnailServlet.java @@ -0,0 +1,101 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.appstack.tools; + +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.net.URL; +import java.util.Iterator; +import java.util.Locale; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.imageio.IIOImage; +import javax.imageio.ImageIO; +import javax.imageio.ImageWriteParam; +import javax.imageio.ImageWriter; +import javax.imageio.plugins.jpeg.JPEGImageWriteParam; +import javax.imageio.stream.ImageOutputStream; + +/** + * This servlet takes images URLs and replies with a resized thumbnail of the + * image. Unlike the "real" thumbnail servlet, this one doesn't use any + * AppEngine libs, so can be run locally on top of Jetty. + */ +public class AwtThumbnailServlet extends ThumbnailServlet { + private static Logger logger = + Logger.getLogger(AwtThumbnailServlet.class.getName()); + + @Override + protected byte[] makeThumbnail(URL originalUrl, int width, int height) { + // Read the original image. + BufferedImage image; + try { + image = ImageIO.read(originalUrl); + + // Resize it. + // TODO(rnystrom): This doesn't use the exact same cropping and resize + // logic as the "real" AppEngine thumbnail server. Consider the GSE one a + // cheap approximation. + BufferedImage resized = new BufferedImage(width, height, + BufferedImage.TYPE_INT_RGB); + + Graphics2D g = resized.createGraphics(); + + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, + RenderingHints.VALUE_INTERPOLATION_BILINEAR); + g.setRenderingHint(RenderingHints.KEY_RENDERING, + RenderingHints.VALUE_RENDER_QUALITY); + g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + + g.drawImage(image, 0, 0, width, height, null); + g.dispose(); + + return makeJpeg(resized); + } catch (IOException e) { + // TODO(rnystrom): Handle error better. + logger.log(Level.SEVERE, "Got error generating thumbnail.", e); + throw new RuntimeException(e); + } + } + + /** + * Create a compressed JPEG from the given image and return its data. + */ + private byte[] makeJpeg(BufferedImage image) { + try { + Iterator iterator = ImageIO.getImageWritersByFormatName("jpg"); + ImageWriter writer = iterator.next(); + + ByteArrayOutputStream output = new ByteArrayOutputStream(); + ImageOutputStream imageOutput = ImageIO.createImageOutputStream(output); + writer.setOutput(imageOutput); + + ImageWriteParam param = new JPEGImageWriteParam(Locale.getDefault()); + + param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); + param.setCompressionQuality(0.75F); + + writer.write(null, new IIOImage(image, null, null), param); + + imageOutput.flush(); + writer.dispose(); + imageOutput.close(); + + return output.toByteArray(); + } catch (IOException e) { + // TODO(rnystrom): Handle error better. + logger.log(Level.SEVERE, "Got error creating JPEG.", e); + throw new RuntimeException(e); + } + } + + + +} diff --git a/client/tools/dartserver/java/com/google/appstack/tools/OAuthServlet.java b/client/tools/dartserver/java/com/google/appstack/tools/OAuthServlet.java new file mode 100644 index 00000000000..3e259036012 --- /dev/null +++ b/client/tools/dartserver/java/com/google/appstack/tools/OAuthServlet.java @@ -0,0 +1,99 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.appstack.tools; + +import java.io.InputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URI; +import java.net.URL; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Delegate all Google API requests. The query paramter api has the complete + * API url and form data to forward the request. The first parameter of the + * encoded URI (api parameter) must have the ?oauth_token= for the API request + * to work. Tested with OAuth2. + */ +public class OAuthServlet extends HttpServlet { + private static final int BUFFER_SIZE = 8192; + + private static Logger logger = + Logger.getLogger(OAuthServlet.class.getName()); + + @Override + public void service(HttpServletRequest req, HttpServletResponse resp) { + String api = req.getParameter("api"); + if (api == null) { + // TODO(terry): Better error handling. + throw new RuntimeException("Missing api parameter."); + } + + HttpURLConnection con = null; + InputStream is = null; + OutputStream os = null; + + try { + // Decode the URI passed in the query parameter. + URL url = new URI(api).toURL(); + + logger.info(String.format("api URL = %s", url.toString())); + + con = (HttpURLConnection) url.openConnection(); + + con.setRequestMethod(req.getMethod()); + if (req.getMethod().equals("POST")) { + + con.setRequestProperty("Content-Type", + "application/x-www-form-urlencoded"); + con.setRequestProperty("Content-Language", "en-US"); + + } + + con.connect(); + + resp.setContentType(con.getContentType()); + + is = con.getInputStream(); + os = resp.getOutputStream(); + byte[] b = new byte[BUFFER_SIZE]; + while (true) { + int n = is.read(b); + if (n == -1) { + break; + } + os.write(b, 0, n); + } + + resp.setStatus(con.getResponseCode()); + } catch (Exception e) { + // TODO(terry): Better error handling. + logger.log(Level.SEVERE, "Unexpected error", e); + } finally { + try { + if (os != null) { + os.close(); + } + if (is != null) { + is.close(); + } + + if (con != null) { + con.disconnect(); + } + } catch (java.io.IOException ioe) { + // TODO(terry): Better error handling. + logger.log(Level.SEVERE, "Close/Disconnect error", ioe); + } + } + } +} + diff --git a/client/tools/dartserver/java/com/google/appstack/tools/ProxyingServlet.java b/client/tools/dartserver/java/com/google/appstack/tools/ProxyingServlet.java new file mode 100644 index 00000000000..3389ccd5ea9 --- /dev/null +++ b/client/tools/dartserver/java/com/google/appstack/tools/ProxyingServlet.java @@ -0,0 +1,68 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.appstack.tools; + +import java.io.InputStream; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.logging.Logger; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Simple Servlet that is used to allow clients to connect to + * many different data sources ignoring the single origin + * restrictions on XMLHttpRequest. This servlet will take + * in a cross-site request as a query string and send it along + * to the desired URL. + */ +public class ProxyingServlet extends HttpServlet { + private static final int BUFFER_SIZE = 4096; + + private static Logger logger = + Logger.getLogger(ProxyingServlet.class.getName()); + + @Override + public void service(HttpServletRequest req, HttpServletResponse rsp) { + try { + logger.info(String.format("redirect to '%s'", req.getQueryString())); + URL url = new URL(req.getQueryString()); + HttpURLConnection con = (HttpURLConnection) url.openConnection(); + // TODO(jimhug): Figure out which other headers to propagate. + con.setRequestMethod(req.getMethod()); + con.connect(); + rsp.setContentType(con.getContentType()); + /* + Map> headers = con.getHeaderFields(); + for (Map.Entry> entry : headers.entrySet()) { + for (String value : entry.getValue()) { + if (entry.getKey() == null || value == null) continue; + rsp.addHeader(entry.getKey(), value); + } + } + */ + + // TODO(jimhug): Better error handling. + // TODO(jimhug): Use com.google.common.io.ByteStreams.copy(is, os) - + // as soon as we get another call to justify Guava dependency. + InputStream is = con.getInputStream(); + OutputStream os = rsp.getOutputStream(); + byte[] b = new byte[BUFFER_SIZE]; + while (true) { + int n = is.read(b); + if (n == -1) { + break; + } + os.write(b, 0, n); + } + rsp.setStatus(con.getResponseCode()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff --git a/client/tools/dartserver/java/com/google/appstack/tools/ThumbnailServlet.java b/client/tools/dartserver/java/com/google/appstack/tools/ThumbnailServlet.java new file mode 100644 index 00000000000..fe08241a8df --- /dev/null +++ b/client/tools/dartserver/java/com/google/appstack/tools/ThumbnailServlet.java @@ -0,0 +1,59 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.appstack.tools; + +import java.net.URL; +import java.net.URLDecoder; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +// TODO(rnystrom): Get rid of one of the subclasses of this and just have a +// single way to make thumbnails once we've got our server stuff figured out. +/** + * This servlet takes images URLs and replies with a resized thumbnail of the + * image. Relies on the subclass to provide the actual image resizing. + */ +public abstract class ThumbnailServlet extends HttpServlet { + // TODO(rnystrom): Allow passing this in as a URL parameter. + private static final int THUMBNAIL_SIZE = 156; + + private static Logger logger = + Logger.getLogger(ThumbnailServlet.class.getName()); + + @Override + public void service(HttpServletRequest request, HttpServletResponse response) { + String imageParam = request.getParameter("i"); + if (imageParam == null) { + // TODO(rnystrom): Handle errors better. + throw new RuntimeException("Must have an 'i' parameter."); + } + + try { + URL originalUrl = new URL(URLDecoder.decode(imageParam, "UTF-8")); + + byte[] data = makeThumbnail(originalUrl, THUMBNAIL_SIZE, THUMBNAIL_SIZE); + + // Serve up the thumbnail. + response.setContentType("image/jpeg"); + response.getOutputStream().write(data); + } catch (Exception e) { + // TODO(rnystrom): Handle errors better. + logger.log(Level.SEVERE, "Got error serving thumbnail.", e); + } + } + + /** + * Override this to read the original image at that URL, scale it to a + * thumbnail and return the raw data for a thumbnail PNG. + * + * @param originalUrl URL of the source image to create a thumbnail for. + * @return Raw data for a PNG-formatted thumbnail image. + */ + protected abstract byte[] makeThumbnail(URL originalUrl, int width, int height); +} diff --git a/client/tools/dartserver/java/com/google/appstack/tools/dartserver/AppMaker.java b/client/tools/dartserver/java/com/google/appstack/tools/dartserver/AppMaker.java new file mode 100644 index 00000000000..9467c76cc70 --- /dev/null +++ b/client/tools/dartserver/java/com/google/appstack/tools/dartserver/AppMaker.java @@ -0,0 +1,70 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.appstack.tools.dartserver; + +import com.google.dart.compiler.DartCompilationError; + +import java.io.File; +import java.io.IOException; +import java.util.logging.Logger; + + +/** + * Creates the javascript that we need to send to the browser to + * run a dart app. + */ +public class AppMaker { + + private static final Logger logger = Logger.getLogger(AppMaker.class.getName()); + + /** The application's .app file. */ + private final File appFile; + + /** + * Parses the uri and figure out the app name. + * + * @sourceDir - directory (relative to google3) containing dart source + * @param uri - uri requested by browser + * @return null if the uri isn't a dart app + */ + public static AppMaker create(String sourceDir, String uri) { + String appName; + String path = sourceDir + uri; + + path = path.replaceFirst("\\.js$", ".app"); + + if (!path.endsWith(".app")) { + return null; + } + // Check if the .app file exists. + File appFile = new File(path); + if (!appFile.exists()) { + logger.warning(String.format("cannot find app file '%s'", appFile.getAbsolutePath())); + return null; + } + + logger.info(String.format("found app file '%s'", appFile.getAbsolutePath())); + return new AppMaker(appFile); + } + + /** + * private constructor (use {@code create} factory method above} + */ + private AppMaker(File appFile) { + this.appFile = appFile; + } + + /** + * Creates the JavaScript for this app by running the dart compiler. + */ + public String getJavascript() { + DartApp.Result result = DartApp.build(appFile); + if (result.didBuild()) { + return result.getApp().getJavaScript(); + } else { + return ErrorFormatter.reportErrorsAsJs(result); + } + } +} diff --git a/client/tools/dartserver/java/com/google/appstack/tools/dartserver/DartApp.java b/client/tools/dartserver/java/com/google/appstack/tools/dartserver/DartApp.java new file mode 100644 index 00000000000..4ebbddabd3f --- /dev/null +++ b/client/tools/dartserver/java/com/google/appstack/tools/dartserver/DartApp.java @@ -0,0 +1,189 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.appstack.tools.dartserver; + +import java.io.File; +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.dart.compiler.Backend; +import com.google.dart.compiler.CompilerConfiguration; +import com.google.dart.compiler.CommandLineOptions.CompilerOptions; +import com.google.dart.compiler.DartArtifactProvider; +import com.google.dart.compiler.DartCompilationError; +import com.google.dart.compiler.DartCompilationPhase; +import com.google.dart.compiler.DartCompiler; +import com.google.dart.compiler.DartCompilerListener; +import com.google.dart.compiler.DartSource; +import com.google.dart.compiler.DefaultCompilerConfiguration; +import com.google.dart.compiler.LibrarySource; +import com.google.dart.compiler.Source; +import com.google.dart.compiler.UrlLibrarySource; +import com.google.dart.compiler.backend.js.JavascriptBackend; +import com.google.dart.compiler.metrics.CompilerMetrics; + +public class DartApp { + public static class Result { + private final DartApp app; + private final List errors; + private final Throwable compilationException; + + Result(DartApp app, List errors, Throwable compilationException) { + this.app = app; + this.errors = errors; + this.compilationException = compilationException; + } + + public boolean didBuild() { + return errors.isEmpty() && compilationException == null; + } + + public DartApp getApp() { + return app; + } + + public List getErrors() { + return errors; + } + + public Throwable getCompilationException() { + return compilationException; + } + } + + private final String sources; + + public DartApp(String sources) { + this.sources = sources; + } + + public String getSources() { + return sources; + } + + private static class CompilationState { + private StringWriter appCode; + private List errors = new ArrayList(); + + private class Listener extends DartCompilerListener { + @Override + public void compilationError(DartCompilationError error) { + errors.add(error); + } + + @Override + public void compilationWarning(DartCompilationError error) { + errors.add(error); + } + + @Override + public void typeError(DartCompilationError error) { + errors.add(error); + } + + } + + private static String keyFor(Source source, String part, String extension) { + return source.getName() + "/" + part + "/" + extension; + } + + private class Artifacts extends DartArtifactProvider { + + private final Map artifacts = new HashMap(); + + @Override + public Reader getArtifactReader(Source source, String part, String extension) + throws IOException { + final StringWriter data = artifacts.get(keyFor(source, part, extension)); + return data == null ? null : new StringReader(data.toString()); + } + + @Override + public Writer getArtifactWriter(Source source, String part, String extension) + throws IOException { + final StringWriter data = new StringWriter(); + if (source instanceof LibrarySource + && JavascriptBackend.EXTENSION_JS.equals(extension)) { + appCode = data; + } + + artifacts.put(keyFor(source, part, extension), data); + return data; + } + + @Override + public boolean isOutOfDate(Source source, Source base, String extension) { + return true; + } + + @Override + public URI getArtifactUri(Source source, String part, String extension) { + try { + // TODO(knorton): This is all sorts of wrong but I need to find out + // what these URI's are actually used for. + return new URI("bogus://" + source.getName()); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + } + + } + + private final Listener listener = new Listener(); + private final Artifacts artifacts = new Artifacts(); + + String getJavaScript() { + return appCode.toString(); + } + + List getErrors() { + return errors; + } + + boolean hasErrors() { + return !errors.isEmpty(); + } + } + + public String getJavaScript() { + return sources; + } + + static class StrictOptions extends CompilerOptions { + public boolean typeErrorsAreFatal() { + return true; + } + + /** + * Returns whether warnings (excluding type warnings) are fatal. + */ + public boolean warningsAreFatal() { + return true; + } + } + + public static Result build(File appFile) { + final CompilationState state = new CompilationState(); + try { + CompilerConfiguration config = new DefaultCompilerConfiguration( + new JavascriptBackend(), new StrictOptions()); + DartCompiler.compileLib(new UrlLibrarySource(appFile), + config, state.artifacts, state.listener); + return state.hasErrors() ? new Result(null, state.getErrors(), null) + : new Result(new DartApp(state.getJavaScript()), state.getErrors(), null); + } catch (Throwable e) { + return new Result(new DartApp(""), new ArrayList(), e); + } + } +} diff --git a/client/tools/dartserver/java/com/google/appstack/tools/dartserver/DartServer.java b/client/tools/dartserver/java/com/google/appstack/tools/dartserver/DartServer.java new file mode 100644 index 00000000000..8fd1e9a7cb9 --- /dev/null +++ b/client/tools/dartserver/java/com/google/appstack/tools/dartserver/DartServer.java @@ -0,0 +1,114 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.appstack.tools.dartserver; + +import com.google.appstack.tools.AwtThumbnailServlet; +import com.google.appstack.tools.ProxyingServlet; +import com.google.appstack.tools.OAuthServlet; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.eclipse.jetty.server.Handler; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.handler.AbstractHandler; +import org.eclipse.jetty.server.handler.DefaultHandler; +import org.eclipse.jetty.server.handler.HandlerList; +import org.eclipse.jetty.server.handler.ResourceHandler; +import org.eclipse.jetty.servlet.ServletContextHandler; + +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * A simple HTTP server that automatically trasnlates .dart files into + * Javascript as they're requested. + * + * Should be run from your google3 directory. + * + * Example usage: + * + * 1. build client @{code [your-client]/client/$ ../tools/build.py} + * + * 2. start dartserver @{code [your-client]/client$ tools/dartserver/bin/dartserver} + * 8007 + * + * 3. Now, point your browser to this url to verify it's working + * http://localhost:8007/samples/hello/hello.html + * + */ +public class DartServer { + // TODO(jimhug): Merge this with DartCompilerServer under dart project. + + private static Logger logger = Logger.getLogger(DartServer.class.getName()); + + public static void main(String[] args) throws Exception { + if (args.length < 1) { + throw new RuntimeException("Expected >=1 command line arguments"); + } + String sourceDir = args[0]; + logger.log(Level.INFO, "Source directory: " + sourceDir); + + int port = args.length > 1 ? Integer.parseInt(args[1]) : 8080; + Server server = new Server(port); + + ServletContextHandler servletHandler = new ServletContextHandler( + ServletContextHandler.SESSIONS); + servletHandler.setContextPath("/"); + servletHandler.addServlet(ProxyingServlet.class, "/mirror"); + servletHandler.addServlet(AwtThumbnailServlet.class, "/thumb"); + servletHandler.addServlet(OAuthServlet.class, "/oauth"); + + final ResourceHandler fileServlet = new ResourceHandler(); + fileServlet.setResourceBase(sourceDir); + fileServlet.setDirectoriesListed(true); + // Don't let the corp proxy cache content served out of the filesystem, + // since we expect this may be used by a developer who's modifying it. + fileServlet.setCacheControl("no-cache"); + + HandlerList handlers = new HandlerList(); + handlers.setHandlers(new Handler[] { fileServlet, servletHandler, + new DartHandler(sourceDir), new DefaultHandler() }); + server.setHandler(handlers); + + System.out.println("Sample dart apps served at:\n" + + "http://localhost:" + port + "/samples/"); + server.start(); + server.join(); + } + + /** + * A handler that uses the dart compiler (dartc) to translate .dart files into + * Javascript if the uri is a .js or .app file. + */ + public static class DartHandler extends AbstractHandler { + String sourceDir; + + public DartHandler(String sourceDir) { + this.sourceDir = sourceDir; + } + + @Override + public void handle(String target, Request baseRequest, + HttpServletRequest req, HttpServletResponse rsp) { + try { + String uri = req.getRequestURI(); + AppMaker appMaker = AppMaker.create(sourceDir, uri); + if (appMaker == null) { + return; + } + baseRequest.setHandled(true); + rsp.setHeader("cache-control", "no-cache"); + logger.info(String.format("generating javascript for '%s'", uri)); + rsp.setContentType("application/javascript"); + rsp.getWriter().write(appMaker.getJavascript()); + rsp.setStatus(HttpServletResponse.SC_OK); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } +} diff --git a/client/tools/dartserver/java/com/google/appstack/tools/dartserver/ErrorFormatter.java b/client/tools/dartserver/java/com/google/appstack/tools/dartserver/ErrorFormatter.java new file mode 100644 index 00000000000..94ddec04212 --- /dev/null +++ b/client/tools/dartserver/java/com/google/appstack/tools/dartserver/ErrorFormatter.java @@ -0,0 +1,269 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.appstack.tools.dartserver; + +import com.google.common.base.Preconditions; +import com.google.common.base.Throwables; +import com.google.dart.compiler.DartCompilationError; +import com.google.dart.compiler.Source; + +import java.io.BufferedReader; +import java.io.IOException; + +/** + * Utility class that generates Javascript code to render error messages + * (including dartc compiler errors, and dartc exceptions). + */ +public class ErrorFormatter { + + /** Css used in formatting error messages. */ + private static final String ERROR_CSS = "" + + "@font-face {" + + " font-family: \"Consolas\";" + + " font-style: normal;" + + " font-weight: normal;" + + " src: local(\"Consolas\"), " + + " url(\"http://themes.googleusercontent.com/fonts/" + + "font?kit=i88R1Ke5pSbpLTTuhd51Fw\") format(\"truetype\");" + + " }" + + "body {" + + " overflow: scroll;" + + "}" + + ".error {" + + " background: #eef;" + + " font-size: 11pt;" + + " border-style:solid;" + + " border-width:1px;" + + " padding: 5px 5px 5px 15px;" + + " margin: 2px;" + + " border-radius: 7px;" + + " width: 100%;" + + " font-family: verdana, sans-serif;" + + " color: black;" + + "}" + + ".error td {" + + " vertical-align:top;" + + "}" + + ".error .code-snippet {" + + " font-family: Consolas, Lucida Console, monospace;" + + " white-space: pre;" + + "}" + + ".error .error-portion {" + + " white-space: pre;" + + " color: red;" + + " font-weight: bold;" + + "}" + + ".error .error-message {" + + " color: red;" + + " font-weight: bold;" + + "}" + + ".error .error-location {" + + " color: blue;" + + "}"; + + /** The resutls from calling dartc. */ + private final DartApp.Result result; + + /** Buffer containing the generated JS code. */ + private final StringBuilder buf = new StringBuilder(); + + private ErrorFormatter(DartApp.Result result) { + this.result = result; + } + + /** + * Creates a script that displays dart syntax errors, dart compile errors, and + * internal dartc compiler exceptions to the user. + */ + public static String reportErrorsAsJs(DartApp.Result result) { + return new ErrorFormatter(result).reportErrorsAsJs(); + } + + private String reportErrorsAsJs() { + appendSafe("window.addEventListener('load', function() { document.body.innerHTML = '"); + appendSafe(""); + appendSafe("
"); + for (DartCompilationError error : result.getErrors()) { + formatCompilationError(error); + } + appendSafe("
"); + + if (result.getCompilationException() != null) { + appendSafe("

Dart compiler exception

");
+      append(Throwables.getStackTraceAsString(result.getCompilationException()));
+      appendSafe("
"); + } + + appendSafe("' + document.body.innerHTML;"); + // Report errors to the developer console as well. + for (DartCompilationError error : result.getErrors()) { + appendSafe("console.error(" + + toJavaScriptStringLiteral(error.toString()) + ");\n"); + } + if (result.getCompilationException() != null) { + appendSafe("console.error(" + toJavaScriptStringLiteral( + Throwables.getStackTraceAsString(result.getCompilationException())) + + ");\n"); + } + + appendSafe("}, false);"); + return buf.toString(); + } + + private void formatCompilationError(DartCompilationError error) { + Source sourceFile = error.getSource(); + int line = error.getLineNumber(); + // line numbers start at 1 + Preconditions.checkState(line > 0); + String[] displayLines = getLines(sourceFile, Math.max(line - 1, 1), line); + + if (displayLines == null) { + // default to the basic error format + fallbackFormat(error); + return; + } + + Preconditions.checkState( + displayLines.length == 1 || displayLines.length == 2); + String lineBefore = null; + String errorLine = null; + if (displayLines.length == 1) { + errorLine = displayLines[0]; + } else { + lineBefore = displayLines[0]; + errorLine = displayLines[1]; + } + + // show heading with error message and file: + appendSafe(""); + appendSafe(""); + + // show the previous line for context + if (lineBefore != null && !lineBefore.trim().isEmpty()) { + appendCodeSnippetLine(line - 1, htmlEscape(lineBefore)); + } + + // show error line, highlighting the error portion. + appendCodeSnippetLine(line, highlightRangeHtml( + errorLine, error.getColumnNumber() - 1, error.getLength())); + appendSafe("
Error: "); + append(error.getMessage()); + appendSafe(" ("); + append(sourceFile.getName()); + appendSafe(":"); + appendSafe(line); + appendSafe(")
"); + } + + private void appendCodeSnippetLine(int line, String htmlSafeText) { + appendSafe(""); + appendSafe(line); + appendSafe(""); + appendSafe(htmlSafeText); + appendSafe(""); + } + + /** + * Split text in 3 segments [0, start], [start, start + length], and [start + + * length, ...]. Sanitize each segment to be safe html, and wrap the middle + * range in a &lgt;span> element that highlights an error. + * + * Note: HTML escaping is done on each segment after slicing the text because + * otherwise the start and length could get misaligned. + */ + private String highlightRangeHtml(String text, int start, int length) { + start = clamp(start, 0, text.length()); + length = clamp(length, 0, text.length() - start); + return (length == 0) ? htmlEscape(text) + : htmlEscape(text.substring(0, start)) + + "" + + htmlEscape(text.substring(start, start + length)) + + "" + + htmlEscape(text.substring(start + length)); + } + + private static String htmlEscape(String text) { + return text.replace("&", "&") + .replace("<", "<") + .replace(">", ">") + .replace("\"", """) + .replace("'", "'") + .replace("\n", "
") + .replace(" ", " "); + } + + private void appendSafe(String htmlSafeText) { + buf.append(htmlSafeText); + } + + private void append(String unsafeText) { + buf.append(htmlEscape(unsafeText)); + } + + private void appendSafe(int value) { + buf.append(value); + } + + private void fallbackFormat(DartCompilationError error) { + appendSafe("
"); + append(error.toString()); + appendSafe("
"); + } + + /** + * Return all lines from {@code start} to {@code end} in a source file, or + * null if the line numbers are out of range or any error occurs while reading + * the file. + */ + private static String[] getLines(Source source, int start, int end) { + Preconditions.checkArgument(start >= 1); + Preconditions.checkArgument(end >= start); + BufferedReader reader = null; + try { + if (source.getSourceReader() == null) { + // no file to read from: return the error state (null) + return null; + } + reader = new BufferedReader(source.getSourceReader()); + String[] res = new String[end - start + 1]; + // note that line numbers start at 1: + for (int i = 1; i <= end; i++) { + String currentLine = reader.readLine(); + if (currentLine == null) { + // no line should be out of range: return the error state (null) + return null; + } + if (i >= start) { + res[i - start] = currentLine; + } + } + return res; + } catch (IOException ex) { + // error reading the file: return the error state (null) + return null; + } finally { + if (reader != null) { + try { + reader.close(); + } catch (IOException ex) { + // do nothing + } + } + } + } + + /** + * Returns the closest value in {@code [start,end]} to the given value. If + * the given range is entirely empty, then {@code start} is returned. + */ + private static int clamp(int val, int start, int end) { + return Math.max(start, Math.min(val, end)); + } + + private static String toJavaScriptStringLiteral(String value) { + return "'" + value.replace("'", "\\'").replace("\n", "\\\n") + "'"; + } + +} diff --git a/client/tools/generate_build.py b/client/tools/generate_build.py new file mode 100755 index 00000000000..f1faaa8a30b --- /dev/null +++ b/client/tools/generate_build.py @@ -0,0 +1,25 @@ +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +#!/usr/bin/env python + +import sys +import os +from os import path + +def main(): + client = path.normpath(path.join(path.dirname(sys.argv[0]), os.pardir)) + compiler = path.normpath(path.join(client, os.pardir, 'compiler')) + locations = { + 'client': client, + 'compiler': compiler, + } + + exit_code = os.system("python %(compiler)s/generate_source_list.py " + "dart_server %(client)s/dart_server " + "tools/dartserver/java" % locations) + return exit_code + +if __name__ == '__main__': + sys.exit(main()) diff --git a/client/tools/htmlconverter.py b/client/tools/htmlconverter.py new file mode 100644 index 00000000000..b6a44fc720b --- /dev/null +++ b/client/tools/htmlconverter.py @@ -0,0 +1,442 @@ +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +#!/usr/bin/env python +# + +"""Rewrites HTML files, converting Dart script sections into JavaScript. + +Process HTML files, and internally changes script sections that use Dart code +into JavaScript sections. It also can optimize the HTML to inline code. +""" + +from HTMLParser import HTMLParser +from os.path import abspath, basename, dirname, exists, isabs, join, split +import base64, re, optparse, os, shutil, subprocess, sys, tempfile, codecs +import urllib2 + +CLIENT_PATH = dirname(dirname(abspath(__file__))) +DART_PATH = dirname(CLIENT_PATH) +TOOLS_PATH = join(DART_PATH, 'tools') + +sys.path.append(TOOLS_PATH) +import utils + +DART_MIME_TYPE = "application/dart" + +DARTC_INPUT_IMPORTS = """ +#import('dart:dom'); +#import('dart:json'); +""" + +CSS_TEMPLATE = '' +CHROMIUM_SCRIPT_TEMPLATE = '' + +DARTIUM_TO_JS_SCRIPT = """ + +""" + +class DartCompiler(object): + """ Common code for compiling Dart script tags in an HTML file. """ + + def __init__(self, optimize=False, verbose=False): + self.optimize = optimize + self.verbose = verbose + + def compileCode(self, src=None, body=None): + """ Compile the given source code. + + Either the script tag has a src attribute or a non-empty body (one of the + arguments will be none, the other is not). + + Args: + src: a string pointing to a Dart script file. + body: a string containing Dart code. + """ + + outdir = tempfile.mkdtemp() + indir = None + if src is not None: + if body is not None and body.strip() != '': + raise ConverterException( + "The script body should be empty if src is specified") + elif src.endswith('.dart'): + indir = tempfile.mkdtemp() + inputfile = src + else: + raise ConverterException("invalid file type:" + src) + else: + if body is None or body.strip() == '': + # nothing to do + print 'Warning: empty script tag with no src attribute' + return '' + + indir = tempfile.mkdtemp() + inputfile = join(indir, 'code.dart') + with open(inputfile, 'w') as f: + f.write(DARTC_INPUT_IMPORTS) + f.write(body) + + status, out, err = execute(self.compileCommand(inputfile, outdir), + self.verbose) + if status: + raise ConverterException() + + # Inline the compiled code in the page + with open(self.outputFileName(inputfile, outdir), 'r') as f: + res = f.read() + + # Cleanup + if indir is not None: + shutil.rmtree(indir) + shutil.rmtree(outdir) + return CHROMIUM_SCRIPT_TEMPLATE % res + + def compileCommand(self, inputfile, outdir): + cmd = [abspath(join(CLIENT_PATH, + # TODO(sigmund): support also mode = release + utils.GetBuildRoot(utils.GuessOS(), 'debug', 'dartc'), + 'dartc')), '-noincremental', '-out', outdir] + if self.optimize: + cmd.append('-optimize') + cmd.append(inputfile) + return cmd + + def outputFileName(self, inputfile, outdir): + return join(outdir, + ('file' if isabs(inputfile) else '') + inputfile + + ('.opt' if self.optimize else '.app') + '.js') + + +def execute(cmd, verbose=False): + """Execute a command in a subprocess. """ + if verbose: print 'Executing: ' + ' '.join(cmd) + pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + output, err = pipe.communicate() + if pipe.returncode != 0: + print 'Execution failed: ' + output + '\n' + err + if verbose or pipe.returncode != 0: + print output + print err + return pipe.returncode, output, err + +def convertPath(project_path, prefix_path): + """ Convert a project path (whose root corresponds to the current working + directory) to a system path. + Args: + - project_path: path in the project context. + - prefix_path: prefix for relative paths. + """ + if isabs(project_path): + return project_path[1:] + elif not (project_path.startswith('http://') or + project_path.startswith('https://')): + return join(prefix_path, project_path) + else: + return project_path + +def encodeImage(rootDir, filename): + """ Returns a base64 url encoding for an image """ + filetype = filename[-3:] + if filetype == 'svg': filetype = 'svg+xml' + with open(join(rootDir, filename), 'r') as f: + return 'url(data:image/%s;charset=utf-8;base64,%s)' % ( + filetype, + base64.b64encode(f.read())) + +def encodeImageUrl(filename): + """ Downloads an image and returns a base64 url encoding for it """ + filetype = filename[-3:] + if filetype == 'svg': filetype = 'svg+xml' + print 'Downloading ' + filename + try: + f = urllib2.urlopen(filename) + except: + return filename + + return 'data:image/%s;charset=utf-8;base64,%s' % ( + filetype, + base64.b64encode(f.read())) + +def processCss(filename): + """ Reads and converts a css file by replacing all image refernces into + base64 encoded images. + """ + css = open(filename, 'r').read() + cssDir = os.path.split(filename)[0] + def transformUrl(match): + imagefile = match.group(1) + # if the image is not local or can't be found, leave the url alone: + if (imagefile.startswith('http://') + or imagefile.startswith('https://') + or not exists(join(cssDir, imagefile))): + return match.group(0) + return encodeImage(cssDir, imagefile) + + pattern = 'url\((.*\.(svg|png|jpg|gif))\)' + return re.sub(pattern, transformUrl, css) + +class DartHTMLConverter(HTMLParser): + """ An HTML processor that inlines css and compiled dart code. + + Args: + - compiler: an implementation of DartAnyCompiler + - prefix_path: prefix for relative paths encountered in the HTML. + """ + def __init__(self, compiler, prefix_path): + HTMLParser.__init__(self) + self.in_dart_tag = False + self.output = [] + self.dart_inline_code = [] + self.contains_dart = False + self.compiler = compiler + self.prefix_path = prefix_path + + def inlineCss(self, attrDic): + path = convertPath(attrDic['href'], self.prefix_path) + self.output.append(CSS_TEMPLATE % processCss(path)) + + def compileScript(self, attrDic): + if 'src' in attrDic: + self.output.append(self.compiler.compileCode( + src=convertPath(attrDic.pop('src'), self.prefix_path), + body=None)) + else: + self.in_dart_tag = True + # no tag is generated until we parse the body of the tag + self.dart_inline_code = [] + return True + + def inlineImage(self, attrDic): + pass + + def starttagHelper(self, tag, attrs, isEnd): + attrDic = dict(attrs) + + # collect all script files, and generate a single script before + if (tag == 'script' and 'type' in attrDic + and (attrDic['type'] == DART_MIME_TYPE)): + if self.compileScript(attrDic): + return + + # convert css imports into inlined css + elif (tag == 'link' and + 'rel' in attrDic and attrDic['rel'] == 'stylesheet' and + 'type' in attrDic and attrDic['type'] == 'text/css' and + 'href' in attrDic): + self.inlineCss(attrDic) + return + + elif tag == 'img' and 'src' in attrDic: + self.inlineImage(attrDic) + + # emit everything else as in the input + self.output.append('<%s%s%s>' % ( + tag + (' ' if len(attrDic) else ''), + ' '.join(['%s="%s"' % (k, attrDic[k]) for k in attrDic]), + '/' if isEnd else '')) + + def handle_starttag(self, tag, attrs): + self.starttagHelper(tag, attrs, False) + + def handle_startendtag(self, tag, attrs): + self.starttagHelper(tag, attrs, True) + + def handle_data(self, data): + if self.in_dart_tag: + # collect the dart source code and compile it all at once when no more + # script tags can be included. Note: the code will anyways start on + # DOMContentLoaded, so moving the script is OK. + self.dart_inline_code.append(data) + else: + self.output.append(data), + + def handle_endtag(self, tag): + if tag == 'script' and self.in_dart_tag: + self.in_dart_tag = False + self.output.append(self.compiler.compileCode( + src=None, body='\n'.join(self.dart_inline_code))) + else: + self.output.append('' % tag) + + def handle_charref(self, ref): + self.output.append('&#%s;' % ref) + + def handle_entityref(self, name): + self.output.append('&%s;' % name) + + def handle_comment(self, data): + self.output.append('' % data) + + def handle_decl(self, decl): + self.output.append('' % decl) + + def unknown_decl(self, data): + self.output.append('' % data) + + def handle_pi(self, data): + self.output.append('' % data) + + def getResult(self): + return ''.join(self.output) + + +class DartToDartHTMLConverter(DartHTMLConverter): + def __init__(self, prefix_path, outdir, verbose): + # Note: can't use super calls because HTMLParser is not a subclass of object + DartHTMLConverter.__init__(self, None, prefix_path) + self.outdir = outdir + self.verbose = verbose + + def compileScript(self, attrDic): + self.contains_dart = True + if 'src' in attrDic: + status, out, err = execute([ + sys.executable, + join(CLIENT_PATH, 'tools', 'copy_dart.py'), + self.outdir, + convertPath(attrDic['src'], self.prefix_path)], + self.verbose) + if status: + raise ConverterException('calling copy_dart.py') + + # do not rewrite the script tag + return False + + def handle_endtag(self, tag): + if tag == 'body' and self.contains_dart: + self.output.append(DARTIUM_TO_JS_SCRIPT) + DartHTMLConverter.handle_endtag(self, tag) + +class OfflineHTMLConverter(DartHTMLConverter): + def __init__(self, prefix_path, outdir, verbose): + # Note: can't use super calls because HTMLParser is not a subclass of object + DartHTMLConverter.__init__(self, None, prefix_path) + self.outdir = outdir + self.verbose = verbose + + def compileScript(self, attrDic): + # do not rewrite the script tag + return False + + def inlineImage(self, attrDic): + attrDic['src'] = encodeImageUrl(attrDic['src']) + + +def safeMakeDirs(dirname): + """ Creates a directory and, if necessary its parent directories. + + This function will safely return if other concurrent jobs try to create the + same directory. + """ + if not exists(dirname): + try: + os.makedirs(dirname) + except Exception: + # this check allows invoking this script concurrently in many jobs + if not exists(dirname): + raise + +class ConverterException(Exception): + """ An exception encountered during the convertion process """ + pass + +def Flags(): + """ Consturcts a parser for extracting flags from the command line. """ + result = optparse.OptionParser() + result.add_option("--optimize", + help="Use optimizer in dartc", + default=False, + action="store_true") + result.add_option("--verbose", + help="Print verbose output", + default=False, + action="store_true") + result.add_option("-o", "--out", + help="Output directory", + type="string", + default=None, + action="store") + result.add_option("-t", "--target", + help="The target html to generate", + metavar="[chromium,dartium]", + default='chromium,dartium') + result.set_usage("htmlconverter.py input.html -o OUTDIR -t chromium,dartium") + return result + +def writeOut(contents, filepath): + """ Writes contents to a file, ensuring that the output directory exists. """ + safeMakeDirs(dirname(filepath)) + with open(filepath, 'w') as f: + f.write(contents) + print "Generated output in: " + abspath(filepath) + +def convertForDartium(filename, outfile, verbose): + """ Converts a file for a dartium target. """ + with open(filename, 'r') as f: + contents = f.read() + prefix_path = dirname(filename) + converter = DartToDartHTMLConverter(prefix_path, dirname(outfile), verbose) + converter.feed(contents) + converter.close() + writeOut(converter.getResult(), outfile) + +def convertForChromium(filename, optimize, outfile, verbose): + """ Converts a file for a chromium target. """ + with open(filename, 'r') as f: + contents = f.read() + prefix_path = dirname(filename) + converter = DartHTMLConverter(DartCompiler(optimize, verbose), prefix_path) + converter.feed(contents) + converter.close() + writeOut(converter.getResult(), outfile) + +def convertForOffline(filename, outfile, verbose): + """ Converts a file for offline use. """ + with codecs.open(filename, 'r', 'utf-8') as f: + contents = f.read() + converter = OfflineHTMLConverter(dirname(filename), dirname(outfile), verbose) + converter.feed(contents) + converter.close() + + contents = converter.getResult() + safeMakeDirs(dirname(outfile)) + with codecs.open(outfile, 'w', 'utf-8') as f: + f.write(contents) + print "Generated output in: " + abspath(outfile) + + +def main(): + parser = Flags() + options, args = parser.parse_args() + if len(args) < 1 or not options.out or not options.target: + parser.print_help() + return 1 + + filename = args[0] + outfile = join(options.out, filename) + if 'chromium' in options.target: + convertForChromium( + filename, options.optimize, outfile.replace('.html', '-js.html'), + options.verbose) + if 'dartium' in options.target: + convertForDartium(filename, outfile.replace('.html', '-dartium.html'), + options.verbose) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/client/tools/htmlconverter_test.py b/client/tools/htmlconverter_test.py new file mode 100644 index 00000000000..9b5480752af --- /dev/null +++ b/client/tools/htmlconverter_test.py @@ -0,0 +1,314 @@ +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +#!/usr/bin/env python +# + +"""A test for htmlconverter.py +""" + +from os.path import abspath, basename, dirname, exists, join, split +import optparse +import os +import sys +import subprocess + +# The inputs to our test +TEST1_HTML = """ + + + + + + + + + +""" + +TEST1_OUTPUT = """ +ALERT: hi +Content-Type: text/plain + +#EOF +""" + +TEST2_HTML = """ + + + + + + + + + +""" + +TEST2_DART = """ +#import('dart:dom'); +main() { + window.alert('test2!'); +} +""" + +TEST2_OUTPUT = """ +ALERT: test2! +Content-Type: text/plain + +#EOF +""" + +TEST3_HTML = """ + + + + + + + + + +""" + +TEST3_DART = """ +#import('dart:dom'); +#source('test_3a.dart'); +#source('test_3b.dart'); +""" + +TEST3_DART_A = """ +class MyClass { + static myprint() { + window.alert('test3!'); + } +} +""" + +TEST3_DART_B = """ +main() { + MyClass.myprint(); +} +""" + +TEST3_OUTPUT = """ +ALERT: test3! +Content-Type: text/plain + +#EOF +""" + +TEST4_HTML = """ + + + + + + + + +""" + +TEST4_DART = """ +#import('dart:dom'); +#import('dart:json'); +#import('observable/observable.dart'); + +main() { + // use imported code + var arr = new ObservableArray(); + arr.addChangeListener((EventSummary events) { + var t = ['update', 'add ', + 'remove', 'global'][events.events[0].type]; + var o = events.events[0].oldValue; + o = (o != null ? o : '_'); + var n = events.events[0].newValue; + n = (n != null ? n : '_'); + window.alert(" " + t + " " + o + " -> " + n); + }); + EventBatch.wrap((e) { arr.add(3); })(null); + EventBatch.wrap((e) { arr.add(2); })(null); + EventBatch.wrap((e) { arr.add(1); })(null); + EventBatch.wrap((e) { arr[0] = 5; })(null); + EventBatch.wrap((e) { arr[2] = 0; })(null); + EventBatch.wrap((e) { arr.removeAt(1); })(null); + EventBatch.wrap((e) { arr.clear(); })(null); +} +""" + +# Expected output when run in DumpRenderTree +TEST4_OUTPUT = """ +ALERT: add _ -> 3 +ALERT: add _ -> 2 +ALERT: add _ -> 1 +ALERT: update 3 -> 5 +ALERT: update 1 -> 0 +ALERT: remove 2 -> _ +ALERT: global _ -> _ +Content-Type: text/plain + +#EOF +""" + +FILES = { + 'test_1.html': TEST1_HTML, + + 'test_2.html': TEST2_HTML, + 'test_2.dart': TEST2_DART, + + 'test_3.html': TEST3_HTML, + 'test_3.dart': TEST3_DART, + 'test_3a.dart': TEST3_DART_A, + 'test_3b.dart': TEST3_DART_B, + + 'test_4.html': TEST4_HTML, + 'test_4.dart': TEST4_DART, + } + +INPUTS = ['test_1.html', 'test_2.html', 'test_3.html', 'test_4.html'] +OUTPUTS = [TEST1_OUTPUT, TEST2_OUTPUT, TEST3_OUTPUT, TEST4_OUTPUT] + + +CLIENT_PATH = dirname(dirname(abspath(__file__))) +RED_COLOR = "\033[31m" +GREEN_COLOR = "\033[32m" +YELLOW_COLOR = "\033[33m" +NO_COLOR = "\033[0m" + +last_line_length = 0 +def printLine(s): + """ Prints a line in place (erasing the previous line). """ + global last_line_length + s = " Testing htmlconverter.py: " + s + if last_line_length > 0: + print "\r" + (" " * last_line_length) + "\r", + last_line_length = len(s) + print s, + sys.stdout.flush() + +def execute(cmd, verbose=False): + """Execute a command in a subprocess. """ + if verbose: print 'Executing: ' + ' '.join(cmd) + pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + output, err = pipe.communicate() + if pipe.returncode != 0: + print 'Execution failed: ' + output + '\n' + err + if verbose or pipe.returncode != 0: + print output + print err + return pipe.returncode, output, err + +def browserRun(message, htmlfile, test, verbose): + # run the generated code + printLine(message + ' [%d]' % (test + 1)) + status, out, err = execute([ + 'tests/dartium/DumpRenderTree', + '--dart-flags=--enable_type_checks --enable_asserts', htmlfile], + verbose) + if status != 0: + printLine("%sERROR%s test output [%d]" % (RED_COLOR, NO_COLOR, test + 1)) + return status + + # check that the output is equivalent and cleanup + out = '\n' + out + if out == OUTPUTS[test]: + printLine("%sPASS%s [%d]" % (GREEN_COLOR, NO_COLOR, test + 1)) + else: + printLine("%sFAIL%s [%d]" % (RED_COLOR, NO_COLOR, test + 1)) + print out + print err + return 1 + + return 0 + +def createInputFiles(): + printLine("... creating input files") + for filename in FILES: + with open(filename, 'w') as f: + f.write(FILES[filename]) + +def deleteInputFiles(): + for filename in FILES: + os.remove(filename) + +def runTest(test, target, verbose): + inputfile = INPUTS[test] + suffix = '-js.html' if target == 'chromium' else '-dartium.html' + outfile = abspath(join('out', inputfile.replace(".html", suffix))) + + # TODO(sigmund): tests should also run in dartium before converting them + + # run the htmlconverter.py script on it + printLine("... converting input html [%d]" % (test + 1)) + cmd = [sys.executable, 'tools/htmlconverter.py', inputfile, + '-o', 'out/', '-t', target] + if verbose: cmd.append('--verbose') + status, out, err = execute(cmd, verbose) + if status != 0: + printLine("%sERROR%s converting [%d]" % (RED_COLOR, NO_COLOR, test + 1)) + print out + print err + return status + + status = browserRun( + "... running compiled html in %s" % target, outfile, test, verbose) + os.remove(outfile) + return status + +def Flags(): + """ Consturcts a parser for extracting flags from the command line. """ + result = optparse.OptionParser() + result.add_option("-v", "--verbose", + help="Print verbose output", + default=False, + action="store_true") + result.add_option("-t", "--target", + help="The target html to generate", + metavar="[chromium,dartium]", + default='chromium,dartium') + result.set_usage("htmlconverter_test.py [--verbose -t chromium,dartium]") + return result + +def main(): + os.chdir(CLIENT_PATH) + parser = Flags() + options, args = parser.parse_args() + + createInputFiles() + for test in range(len(INPUTS)): + if 'chromium' in options.target: + if runTest(test, 'chromium', options.verbose) != 0: + deleteInputFiles() + return 1 + if 'dartium' in options.target: + if runTest(test, 'dartium', options.verbose) != 0: + deleteInputFiles() + return 1 + + deleteInputFiles() + return 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/client/tools/jscoverage_wrapper.py b/client/tools/jscoverage_wrapper.py new file mode 100644 index 00000000000..5cb3bee7c15 --- /dev/null +++ b/client/tools/jscoverage_wrapper.py @@ -0,0 +1,48 @@ +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +"""Wraps jscoverage to instrument a single file more efficently. + +JScoverage crawls directories recursively to copy and instrument everything +under a directory. This turns out to be too slow for our use, because our +generated .js files live in directories with > 100K files. Even though +jscoverage has a flag ('--exclude') to skip some files for +instrumentation/copying, it stills crawls recursively everything under the +directory. + +This script is a simple wrap on top of jscoverage. It creates a temporary +directory, copies the file we want to instrument alone, and runs jscoverage +within this small directory. +""" + +import os +import subprocess +import sys + +def main(): + if len(sys.argv) < 3: + print "usage: %s filepath outdir" + return 1 + + jscoveragecmd = sys.argv[1] + filepath = sys.argv[2] + outdir = sys.argv[3] + + tmpdir = filepath + "_" + copypath = os.path.join(tmpdir, os.path.basename(filepath)) + try: + os.mkdir(tmpdir) + except Exception: + if not os.path.exists(tmpdir): + raise + with open(filepath, 'r') as f1: + with open(copypath, 'w') as f2: + f2.write(f1.read()) + status = subprocess.call([jscoveragecmd, tmpdir, outdir]) + os.remove(copypath) + os.rmdir(tmpdir) + return status + +if __name__ == '__main__': + sys.exit(main()) diff --git a/client/tools/scss.sh b/client/tools/scss.sh new file mode 100755 index 00000000000..878b4bd4b96 --- /dev/null +++ b/client/tools/scss.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +echo Dart SCSS Pre-processor +echo +python ../../../third_party/pyscss/scss/tool.py $1 $2 $3 $4 diff --git a/client/tools/show_coverage.js b/client/tools/show_coverage.js new file mode 100644 index 00000000000..50a71f66f6c --- /dev/null +++ b/client/tools/show_coverage.js @@ -0,0 +1,259 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * A simple application that renders coverage results in a page. It sorts data + * by file name, shows a summary table including coverage statistics per + * package, and implements the necessary behaviour to select a file and view + * line-by-line coverage information. + */ + +var files_; +var code_; +var summary_; +var selectedDiv_; +var file_percent_ = {}; +var package_lines_ = {}; +var package_covered_ = {}; +var package_rec_lines_ = {}; +var package_rec_covered_ = {}; + +// handle a click event anywhere on the screen +function clickListener(e) { + var elem = e.target; + // determine if a file or a close link was clicked on: + while (elem != null) { + if (elem.classList) { + if (elem.classList.contains("file")) { + fileSelected(elem); + return; + } else if (elem.classList.contains("close")) { + closeDetails(); + } + } + elem = elem.parentNode; + } +} + +// handle when a row in the list of files is selected +function fileSelected(elem) { + if (selectedDiv_ != null) { + selectedDiv_.classList.remove("file-selected"); + } + if (selectedDiv_ == elem) { + closeDetails(); + return; + } + selectedDiv_ = elem; + elem.classList.add("file-selected"); + var file = elem.getAttribute("data-field"); + var code_with_coverage = ""; + var lines = code_[file]; + var coverage = summary_[file]; + for (var lineNum = 0; lineNum < lines.length; lineNum++) { + var covered = coverage[lineNum] == 1; + var currentLine = lines[lineNum]. + replace(//g, ">"). + replace(/\n/g, "\\n"); + var iscode = coverage[lineNum] == 0 || coverage[lineNum] == 1; + code_with_coverage += + "" + + (lineNum + 1)+ "" + + "" + currentLine + "" + + ""; + } + + var detailsDiv = document.getElementById("details-body"); + detailsDiv.innerHTML = code_with_coverage; + var outerDiv = detailsDiv.parentNode; + outerDiv.classList.remove("hidden"); +} + +// closes the detail view that displays line-by-line coverage info +function closeDetails() { + if (selectedDiv_ != null) { + selectedDiv_.classList.remove("file-selected"); + selectedDiv_ = null; + } + var detailsDiv = document.getElementById("details-body"); + detailsDiv.parentNode.classList.add("hidden"); +} + +// generates an HTML string segment for a coverage-bar +function generatePercentBar(percent) { + return "" + + "" + + ""; +} + +// extracts the top-level directory from a path +function getRootDir(path) { + if (path == null) { + return null; + } + var index = path.indexOf("/"); + return index == -1 ? null : path.substring(0, index); +} + +// extracts the directory portion of a path +function getDirName(path) { + if (path == null) { + return null; + } + var index = path.lastIndexOf("/"); + return index == -1 ? null : path.substring(0, index); +} + +// extracts the file name portion of a path +function getFileName(path) { + if (path == null) { + return null; + } + var index = path.lastIndexOf("/"); + return index == -1 ? path : path.substring(index + 1); +} + +// generates an HTML string segment with the summary stats for a package which +// doesn't include sub-packages statistics. +function generatePackageLine(pkg) { + var percent = ((package_covered_[pkg] * 100) / package_lines_[pkg]). + toFixed(1); + return "" + + pkg + + "" + percent + "%" + + "" + generatePercentBar(percent) + + " "; +} + +// generates an HTML string segment with the summary stats for a package which +// includes sub-packages statistics +function generatePackageLineRec(pkg) { + var percent = ((package_rec_covered_[pkg] * 100) / + package_rec_lines_[pkg]).toFixed(1); + return "" + + pkg + " (with subpackages)" + + "" + percent + "%" + + "" + generatePercentBar(percent) + + " "; +} + +// generates an hTML string segment with the summary stats for a single file +function generateFileLine(file) { + var filename = getFileName(file); + var percent = file_percent_[file].toFixed(1) + return "" + + "" + + "" + + filename + + "" + + "" + percent + "%" + + "" + generatePercentBar(percent) + + "" + + ""; +} + +// Updates coverage information in a package given the coverage data from a file +// that is directly on that package or on some sub-package +function recordPackageLinesRec(pkg, totalcode, covered) { + if (package_rec_lines_[pkg] == null) { + package_rec_lines_[pkg] = totalcode; + package_rec_covered_[pkg] = covered; + } else { + package_rec_lines_[pkg] += totalcode; + package_rec_covered_[pkg] += covered; + } +} + +// Updates coverage information in a package given the coverage data from a file +// directly on that package +function recordPackageLines(pkg, totalcode, covered) { + if (package_lines_[pkg] == null) { + package_lines_[pkg] = totalcode; + package_covered_[pkg] = covered; + } else { + package_lines_[pkg] += totalcode; + package_covered_[pkg] += covered; + } +} + +var EMPTY_ROW = " "; + +// renders the page with a list of files and an area to display more details. +function render(files, code, summary) { + files.sort() + files_ = files; + code_ = code; + summary_ = summary; + var buffer = ""; + var last_pkg = null; + + // compute percent for files and packages. Tally information per package, by + // tracking total lines covered on any file in the package + + for (var i = 0; i < files.length; i++) { + var file = files[i]; + var coverage = summary[file]; + var covered = 0; + var totalcode = 0; + for (var j = 0; j < coverage.length; j++) { + if (coverage[j] == 1 || coverage[j] == 0) { + totalcode += 1; + } + if (coverage[j] == 1) { + covered += 1; + } + } + file_percent_[file] = (covered * 100) / totalcode; + var pkg = getDirName(file); + + // summary for this package alone + recordPackageLines(pkg, totalcode, covered); + + // summary for each package including subpackages + while (pkg != null) { + recordPackageLinesRec(pkg, totalcode, covered); + pkg = getDirName(pkg) + } + recordPackageLinesRec("** everything **", totalcode, covered); + } + + // create UI for the results... + buffer += generatePackageLineRec("** everything **"); + for (var i = 0; i < files.length; i++) { + var file = files[i]; + + var pkg = getDirName(file) + if (pkg != last_pkg) { + var prefix = getRootDir(last_pkg); + var rec_summary = ""; + if (pkg.indexOf(prefix) != 0) { + var current = getDirName(pkg); + while (current != null) { + rec_summary = EMPTY_ROW + generatePackageLineRec(current) + + rec_summary; + current = getDirName(current); + } + } + buffer += rec_summary + EMPTY_ROW + generatePackageLineRec(pkg); + last_pkg = pkg; + } + buffer += generateFileLine(file); + } + + var menu = "" + + // single file details + var details = ""; + + var div = document.createElement("div"); + div.innerHTML = "
" + + "
Select a file to display its details:
" + + menu + details + "
"; + document.body.appendChild(div); + document.body.addEventListener("click", clickListener, true); +} diff --git a/client/tools/sourcemap.py b/client/tools/sourcemap.py new file mode 100644 index 00000000000..72437843b3d --- /dev/null +++ b/client/tools/sourcemap.py @@ -0,0 +1,368 @@ +# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +"""Utilities to extract source map information + +A set of utilities to extract source map information. This python library +consumes source map files v3, but doesn't provide any funcitonality to produce +source maps. This code is an adaptation of the Java implementation originally +written for the closure compiler by John Lenz (johnlenz@google.com) +""" + +import bisect +import json +import sys + +class SourceMap(): + """ An in memory representation of a source map. """ + + def get_source_location(self, line, column): + """ Fetches the original location for a line and column. + + Args: + line: line in the output file to query + column: column in the output file to query + + Returns: + A tuple of the form: + file, src_line, src_column, opt_identifier + When available, opt_identifier contains the name of an identifier + associated with the given program location. + """ + pass # implemented by subclasses + +def parse(sourcemap_file): + """ Parse a file containing source map information as a json string and return + a source map object representing it. + Args: + sourcemap_file: path to a file (optionally containing a 'file:' prefix) + which can either contain a meta-level source map or an + actual source map. + """ + if sourcemap_file.startswith('file:'): + sourcemap_file = sourcemap_file[5:] + + with open(sourcemap_file, 'r') as f: + sourcemap_json = json.load(f) + + return _parseFromJson(sourcemap_json) + + +def _parseFromJson(sourcemap_json): + if sourcemap_json['version'] != 3: + raise SourceMapException("unexpected source map version") + + if not 'file' in sourcemap_json: + raise SourceMapException("unexpected, no file in source map file") + + if 'sections' in sourcemap_json: + sections = sourcemap_json['sections'] + # a meta file + if ('mappings' in sourcemap_json + or 'sources' in sourcemap_json + or 'names' in sourcemap_json): + raise SourceMapException("Invalid map format") + return _MetaSourceMap(sections) + + return _SourceMapFile(sourcemap_json) + +class _MetaSourceMap(SourceMap): + """ A higher-order source map containing nested source maps. """ + + def __init__(self, sections): + """ creates a source map instance given its json input (already parsed). """ + # parse a regular sourcemap file + self.offsets = [] + self.maps = [] + + for section in sections: + line = section['offset']['line'] + if section['offset']['column'] != 0: + # TODO(sigmund): implement if needed + raise Exception("unimplemented") + + if 'url' in section and 'map' in section: + raise SourceMapException( + "Invalid format: section may not contain both 'url' and 'map'") + + self.offsets.append(line) + if 'url' in section: + self.maps.append(parse(section['url'])) + elif 'map' in section: + self.maps.append(_parseFromJson(section['map'])) + else: + raise SourceMapException( + "Invalid format: section must contain either 'url' or 'map'") + + def get_source_location(self, line, column): + """ Fetches the original location from the target location. """ + index = bisect.bisect(self.offsets, line) - 1 + return self.maps[index].get_source_location( + line - self.offsets[index], column) + +class _SourceMapFile(SourceMap): + def __init__(self, sourcemap): + """ creates a source map instance given its json input (already parsed). """ + # parse a regular sourcemap file + self.sourcemap_file = sourcemap['file'] + self.sources = sourcemap['sources'] + self.names = sourcemap['names'] + self.lines = [] + self._build(sourcemap['mappings']) + + def get_source_location(self, line, column): + """ Fetches the original location from the target location. """ + + # Normalize the line and column numbers to 0. + line -= 1 + column -= 1 + + if line < 0 or line >= len(self.lines): + return None + + entries = self.lines[line] + # If the line is empty return the previous mapping. + if not entries or entries == [] or entries[0].gen_column > column: + return self._previousMapping(line) + + index = bisect.bisect(entries, _Entry(column)) - 1 + return self._originalEntryMapping(entries[index]) + + def _previousMapping(self, line): + while True: + if line == 0: + return None + line -= 1 + if self.lines[line]: + return self._originalEntryMapping(self.lines[line][-1]) + + def _originalEntryMapping(self, entry): + if entry.src_file_id is None: + return None + + if entry.name_id: + identifier = self.names[entry.name_id] + else: + identifier = None + + filename = self.sources[entry.src_file_id] + return filename, entry.src_line, entry.src_column, identifier + + def _build(self, linemap): + """ builds this source map from the sourcemap json """ + entries = [] + line = 0 + prev_col = 0 + prev_src_id = 0 + prev_src_line = 0 + prev_src_column = 0 + prev_name_id = 0 + content = _StringCharIterator(linemap) + while content.hasNext(): + # ';' denotes a new line. + token = content.peek() + if token == ';': + content.next() + # The line is complete, store the result for the line, None if empty. + result = entries if len(entries) > 0 else None + self.lines.append(result) + entries = [] + line += 1 + prev_col = 0 + else: + # Grab the next entry for the current line. + values = [] + while (content.hasNext() + and content.peek() != ',' and content.peek() != ';'): + values.append(_Base64VLQDecode(content)) + + # Decodes the next entry, using the previous encountered values to + # decode the relative values. + # + # The values, if present are in the following order: + # 0: the starting column in the current line of the generated file + # 1: the id of the original source file + # 2: the starting line in the original source + # 3: the starting column in the original source + # 4: the id of the original symbol name + # The values are relative to the previous encountered values. + + total = len(values) + if not(total == 1 or total == 4 or total == 5): + raise SourceMapException( + "Invalid entry in source map file: %s\nline: %d\nvalues: %s\n" + % (self.sourcemap_file, line, str(values))) + prev_col += values[0] + if total == 1: + entry = _Entry(prev_col) + else: + prev_src_id += values[1] + if prev_src_id >= len(self.sources): + raise SourceMapException( + "Invalid source id\nfile: %s\nline: %d\nid: %d\n" + % (self.sourcemap_file, line, prev_src_id)) + prev_src_line += values[2] + prev_src_column += values[3] + if total == 4: + entry = _Entry( + prev_col, prev_src_id, prev_src_line, prev_src_column) + elif total == 5: + prev_name_id += values[4] + if prev_name_id >= len(self.names): + raise SourceMapException( + "Invalid name id\nfile: %s\nline: %d\nid: %d\n" + % (self.sourcemap_file, line, prev_name_id)) + entry = _Entry( + prev_col, prev_src_id, prev_src_line, prev_src_column, + prev_name_id) + entries.append(entry); + if content.peek() == ',': + content.next() + +class _StringCharIterator(): + """ An iterator over a string that allows you to peek into the next value. """ + def __init__(self, string): + self.string = string + self.length = len(string) + self.current = 0 + + def __iter__(self): + return self + + def next(self): + res = self.string[self.current] + self.current += 1 + return res + + def peek(self): + return self.string[self.current] + + def hasNext(self): + return self.current < self.length + + +# Base64VLQ decoding + +VLQ_BASE_SHIFT = 5 +VLQ_BASE = 1 << VLQ_BASE_SHIFT +VLQ_BASE_MASK = VLQ_BASE - 1 +VLQ_CONTINUATION_BIT = VLQ_BASE +BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" +BASE64_DECODE_MAP = dict() +for c in range(64): + BASE64_DECODE_MAP[BASE64_MAP[c]] = c + +def _Base64VLQDecode(iterator): + """ + Decodes the next VLQValue from the provided char iterator. + + Sourcemaps are encoded with variable length numbers as base64 encoded strings + with the least significant digit coming first. Each base64 digit encodes a + 5-bit value (0-31) and a continuation bit. Signed values can be represented + by using the least significant bit of the value as the + sign bit. + + This function only contains the decoding logic, since the encoding logic is + only needed to produce source maps. + + Args: + iterator: a _StringCharIterator + """ + result = 0 + stop = False + shift = 0 + while not stop: + c = iterator.next() + if c not in BASE64_DECODE_MAP: + raise Exception("%s not a valid char" % c) + digit = BASE64_DECODE_MAP[c] + stop = digit & VLQ_CONTINUATION_BIT == 0 + digit &= VLQ_BASE_MASK + result += (digit << shift) + shift += VLQ_BASE_SHIFT + + # Result uses the least significant bit as a sign bit. We convert it into a + # two-complement value. For example, + # 2 (10 binary) becomes 1 + # 3 (11 binary) becomes -1 + # 4 (100 binary) becomes 2 + # 5 (101 binary) becomes -2 + # 6 (110 binary) becomes 3 + # 7 (111 binary) becomes -3 + negate = (result & 1) == 1 + result = result >> 1 + return -result if negate else result + + +ERROR_DETAILS =""" + - gen_column = %s + - src_file_id = %s + - src_line = %s + - src_column = %s + - name_id = %s +""" + +class _Entry(): + """ An entry in a source map file. """ + def __init__(self, gen_column, + src_file_id=None, + src_line=None, + src_column=None, + name_id=None): + """ Creates an entry. Many arguments are marked as optional, but we expect + either all being None, or only name_id being none. + """ + + # gen column must be defined: + if gen_column is None: + raise SourceMapException( + "Invalid entry, no gen_column specified:" + + ERROR_DETAILS % ( + gen_column, src_file_id, src_line, src_column, name_id)) + + # if any field other than gen_column is defined, then file_id, line, and + # column must be defined: + if ((src_file_id is not None or src_line is not None or + src_column is not None or name_id is not None) and + (src_file_id is None or src_line is None or src_column is None)): + raise SourceMapException( + "Invalid entry, only name_id is optional:" + + ERROR_DETAILS % ( + gen_column, src_file_id, src_line, src_column, name_id)) + + self.gen_column = gen_column + self.src_file_id = src_file_id + self.src_line = src_line + self.src_column = src_column + self.name_id = name_id + + # define comparison to perform binary search on lookups + def __cmp__(self, other): + return cmp(self.gen_column, other.gen_column) + +class SourceMapException(Exception): + """ An exception encountered while parsing or processing source map files.""" + pass + +def main(): + """ This module is intended to be used as a library. Main is provided to + test the functionality on the command line. + """ + if len(sys.argv) < 3: + print ("Usage: %s line [column]" % sys.argv[0]) + return 1 + + sourcemap = parse(sys.argv[1]) + line = int(sys.argv[2]) + column = int(sys.argv[3]) if len(sys.argv) > 3 else 1 + original = sourcemap.get_source_location(line, column) + if not original: + print "Source location not found" + else: + filename, srcline, srccolumn, srcid = original + print "Source location is: %s, line: %d, column: %d, identifier: %s" % ( + filename, srcline, srccolumn, srcid) + +if __name__ == '__main__': + sys.exit(main()) diff --git a/client/touch/BezierPhysics.dart b/client/touch/BezierPhysics.dart new file mode 100644 index 00000000000..814622676a1 --- /dev/null +++ b/client/touch/BezierPhysics.dart @@ -0,0 +1,114 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Functions to model constant acceleration as a cubic Bezier + * curve (http://en.wikipedia.org/wiki/Bezier_curve). These functions are + * intended to generate the transition timing function for CSS transitions. + * Please see + * [http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag]. + * + * The main operation of computing a cubic Bezier is split up into multiple + * functions so that, should it be required, more operations and cases can be + * supported in the future. + */ +class BezierPhysics { + static final _ONE_THIRD = 1 / 3; + static final _TWO_THIRDS = 2 / 3; + + /** + * A list [:[x1, y1, x2, y2]:] of the intermediate control points of a cubic + * bezier when the final velocity is zero. This is a special case for which + * these control points are constants. + */ + static final List _FINAL_VELOCITY_ZERO_BEZIER = + const [_ONE_THIRD, _TWO_THIRDS, _TWO_THIRDS, 1]; + + /** + * Given consistent kinematics parameters for constant acceleration, returns + * the intermediate control points of the cubic Bezier curve that models the + * motion. All input values must have correct signs. + * Returns a list [:[x1, y1, x2, y2]:] representing the intermediate control + * points of the cubic Bezier. + */ + static List calculateCubicBezierFromKinematics( + num initialVelocity, num finalVelocity, num totalTime, + num totalDisplacement) { + // Total time must be greater than 0. + assert(!GoogleMath.nearlyEquals(totalTime, 0) && totalTime > 0); + // Total displacement must not be 0. + assert(!GoogleMath.nearlyEquals(totalDisplacement, 0)); + // Parameters must form a consistent constant acceleration model in + // Newtonian kinematics. + assert(GoogleMath.nearlyEquals(totalDisplacement, + (initialVelocity + finalVelocity) * 0.5 * totalTime)); + + if (GoogleMath.nearlyEquals(finalVelocity, 0)) { + return _FINAL_VELOCITY_ZERO_BEZIER; + } + List controlPoint = _tangentLinesToQuadraticBezier( + initialVelocity, finalVelocity, totalTime, totalDisplacement); + controlPoint = _normalizeQuadraticBezier(controlPoint[0], controlPoint[1], + totalTime, totalDisplacement); + return _quadraticToCubic(controlPoint[0], controlPoint[1]); + } + + /** + * Given a quadratic curve crossing points (0, 0) and (x2, y2), calculates the + * intermediate control point (x1, y1) of the equivalent quadratic Bezier + * curve with starting point (0, 0) and ending point (x2, y2). + * [m0] The slope of the line tangent to the curve at (0, 0). + * [m2] The slope of the line tangent to the curve at a different + * point (x2, y2). + * [x2] The x-coordinate of the other point on the curve. + * [y2] The y-coordinate of the other point on the curve. + * Returns a list [:[x1, y1]:] representing the intermediate + * control point of the quadratic Bezier. + */ + static List _tangentLinesToQuadraticBezier( + num m0, num m2, num x2, num y2) { + if (GoogleMath.nearlyEquals(m0, m2)) { + return [0, 0]; + } + num x1 = (y2 - x2 * m2) / (m0 - m2); + num y1 = x1 * m0; + return [x1, y1]; + } + + /** + * Normalizes a quadratic Bezier curve to have end point at (1, 1). + * [x1] The x-coordinate of the intermediate control point. + * [y1] The y-coordinate of the intermediate control point. + * [x2] The x-coordinate of the end point. + * [y2] The y-coordinate of the end point. + * Returns a list [:[x1, y1]:] representing the intermediate control point. + */ + static List _normalizeQuadraticBezier( + num x1, num y1, num x2, num y2) { + // The end point must not lie on any axes. + assert(!GoogleMath.nearlyEquals(x2, 0) && !GoogleMath.nearlyEquals(y2, 0)); + return [x1 / x2, y1 / y2]; + } + + /** + * Converts a quadratic Bezier curve defined by the control points + * (x0, y0) = (0, 0), (x1, y1) = (x, y), and (x2, y2) = (1, 1) into an + * equivalent cubic Bezier curve with four control points. Note that the start + * and end points will be unchanged. + * [x] The x-coordinate of the intermediate control point. + * [y] The y-coordinate of the intermediate control point. + * Returns a list [:[x1, y1, x2, y2]:] containing the two + * intermediate points of the equivalent cubic Bezier curve. + */ + static List _quadraticToCubic(num x, num y) { + // The intermediate control point must have coordinates within the + // interval [0,1]. + assert(x >= 0 && x <= 1 && y >= 0 && y <= 1); + num x1 = x * _TWO_THIRDS; + num y1 = y * _TWO_THIRDS; + num x2 = x1 + _ONE_THIRD; + num y2 = y1 + _ONE_THIRD; + return [x1, y1, x2, y2]; + } +} diff --git a/client/touch/ClickBuster.dart b/client/touch/ClickBuster.dart new file mode 100644 index 00000000000..11c67577fad --- /dev/null +++ b/client/touch/ClickBuster.dart @@ -0,0 +1,215 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Click buster implementation, which is a behavior that prevents native clicks + * from firing at undesirable times. There are two scenarios where we may want + * to 'bust' a click. + * + * Buttons implemented with touch events usually have click handlers as well. + * This is because sometimes touch events stop working, and the click handler + * serves as a fallback. Here we use a click buster to prevent the native click + * from firing if the touchend event was succesfully handled. + * + * When native scrolling behavior is disabled (see Scroller), click events will + * fire after the touchend event when the drag sequence is complete. The click + * event also happens to fire at the location of the touchstart event which can + * lead to some very strange behavior. + * + * This class puts a single click handler on the body, and calls preventDefault + * on the click event if we detect that there was a touchend event that already + * fired in the same spot recently. + */ +class ClickBuster { + /** + * The threshold for how long we allow a click to occur after a touchstart. + */ + static final _TIME_THRESHOLD = 2500; + + /** + * The threshold for how close a click has to be to the saved coordinate for + * us to allow it. + */ + static final _DISTANCE_THRESHOLD = 25; + + /** + * The list of coordinates that we use to measure the distance of clicks from. + * If a click is within the distance threshold of any of these coordinates + * then we allow the click. + * TODO(ngeoffray): Should be DoubleLinkedQueue + */ + static var _coordinates; + + /** The last time preventGhostClick was called. */ + static int _lastPreventedTime; + + /** + * This handler will prevent the default behavior for any clicks unless the + * click is within the distance threshold of one of the temporary allowed + * coordinates. + */ + static void _onClick(Event e) { + if (TimeUtil.now() - _lastPreventedTime > _TIME_THRESHOLD) { + return; + } + final coord = new Coordinate.fromClient(e); + // TODO(rnystrom): On Android, we get spurious click events at (0, 0). We + // *do* want those clicks to be busted, so commenting this out fixes it. + // Leaving it commented out instead of just deleting it because I'm not sure + // what this code was intended to do to begin with. + /* + if (coord.x < 1 && coord.y < 1) { + // TODO(jacobr): implement a configurable logging framework. + // _logger.warning( + // "Not busting click on label elem at(${coord.x}, ${coord.y})"); + return; + } + */ + var entry = _coordinates.firstEntry(); + while (entry != null) { + if (_hitTest(entry.element, + entry.nextEntry().element, + coord.x, + coord.y)) { + entry.nextEntry().remove(); + entry.remove(); + return; + } else { + entry = entry.nextEntry().nextEntry(); + } + } + + // TODO(jacobr): implement a configurable logging framework. + // _logger.warning("busting click at ${coord.x}, ${coord.y}"); + e.stopPropagation(); + e.preventDefault(); + } + + /** + * This handler will temporarily allow a click to occur near the touch event's + * coordinates. + */ + static void _onTouchStart(Event e) { + TouchEvent te = e; + final coord = new Coordinate.fromClient(te.touches[0]); + _coordinates.add(coord.x); + _coordinates.add(coord.y); + window.setTimeout(() { + _removeCoordinate(coord.x, coord.y); + }, _TIME_THRESHOLD); + _toggleTapHighlights(true); + } + + /** + * Hit test for whether a coordinate is within the distance threshold of an + * event. + */ + static bool _hitTest(num x, num y, num eventX, num eventY) { + return (eventX - x).abs() < _DISTANCE_THRESHOLD && + (eventY - y).abs() < _DISTANCE_THRESHOLD; + } + + /** + * Remove one specified coordinate from the coordinates list. + */ + static void _removeCoordinate(num x, num y) { + var entry = _coordinates.firstEntry(); + while (entry != null) { + if (entry.element == x && entry.nextEntry().element == y) { + entry.nextEntry().remove(); + entry.remove(); + return; + } else { + entry = entry.nextEntry().nextEntry(); + } + } + } + + /** + * Enable or disable tap highlights. They are disabled when preventGhostClick + * is called so that the flicker on links is not invoked when the ghost click + * does fire. This is due to a bug: links get highlighted even if the click + * event has preventDefault called on it. + */ + static void _toggleTapHighlights(bool enable) { + document.body.style.setProperty( + "-webkit-tap-highlight-color", enable ? "" : "rgba(0,0,0,0)", ""); + } + + /** + * Registers new touches to create temporary "allowable zones" and registers + * new clicks to be prevented unless they fall in one of the current + * "allowable zones". Note that if the touchstart and touchend locations are + * different, it is still possible for a ghost click to be fired if you + * called preventDefault on all touchmove events. In this case the ghost + * click will be fired at the location of the touchstart event, so the + * coordinate you pass in should be the coordinate of the touchstart. + */ + static void preventGhostClick(num x, num y) { + // First time this is called the following occurs: + // 1) Attaches a handler to touchstart events so that each touch will + // temporarily create an "allowable zone" for clicks to occur in. + // 2) Attaches a handler to click events so that each click will be + // prevented unless it is in an "allowable zone". + // + // Every time this is called (including the first) the following occurs: + // 1) Removes an allowable zone that contains the specified coordinate. + // + // How this enables click busting: + // 1) User performs first click. + // - No attached touchstart handler yet. + // - preventGhostClick is called before the click event occurs, it + // attaches the touchstart and click handlers. + // - The click handler captures the user's click event and prevents it + // from propagating since there is no "allowable zone". + // + // 2) User performs subsequent, to-be-busted click. + // - touchstart event triggers the attached handler and creates a + // temporary "allowable zone". + // - preventGhostClick is called and removes the "allowable zone". + // - The click handler captures the user's click event and prevents it + // from propagating since there is no "allowable zone". + // + // 3) User performs a should-not-be-busted click. + // - touchstart event triggers the attached handler and creates a + // temporary "allowable zone". + // - The click handler captures the user's click event and allows it to + // propagate since the click falls in the "allowable zone". + if (_coordinates === null) { + // Listen to clicks on capture phase so they can be busted before anything + // else gets a chance to handle them. + document.on.click.add((e) { _onClick(e); }, true); + document.on.focus.add((e) { _lastPreventedTime = 0; }, true); + + // Listen to touchstart on capture phase since it must be called prior to + // every click or else we will accidentally prevent the click even if we + // don't call preventGhostClick. + Function startFn = (e) { _onTouchStart(e); }; + if (!Device.supportsTouch) { + startFn = mouseToTouchCallback(startFn); + } + EventUtil.observe(document, + Device.supportsTouch ? document.on.touchStart : document.on.mouseDown, + startFn, true, true); + _coordinates = new Queue(); + } + + // Turn tap highlights off until we know the ghost click has fired. + _toggleTapHighlights(false); + + // Above all other rules, we won't bust any clicks if there wasn't some call + // to preventGhostClick in the last time threshold. + _lastPreventedTime = TimeUtil.now(); + var entry = _coordinates.firstEntry(); + while (entry != null) { + if (_hitTest(entry.element, entry.nextEntry().element, x, y)) { + entry.nextEntry().remove(); + entry.remove(); + return; + } else { + entry = entry.nextEntry().nextEntry(); + } + } + } +} diff --git a/client/touch/EventUtil.dart b/client/touch/EventUtil.dart new file mode 100644 index 00000000000..7c44458d18b --- /dev/null +++ b/client/touch/EventUtil.dart @@ -0,0 +1,46 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Common events related helpers. + */ +class EventUtil { + + /** + * Add an event listener to an element. + * The event callback is specified by [handler]. + * If [capture] is true, the listener gets events on the capture phase. + * If [removeHandlerOnFocus] is true the handler is removed when there is any + * focus event, and added back on blur events. + */ + static void observe(Element element, + EventListenerList listenerList, Function handler, + [bool capture = false, bool removeHandlerOnFocus = false]) { + listenerList.add(handler, capture); + // TODO(jacobr): this remove on focus behavior seems really ugly. + if (removeHandlerOnFocus) { + element.on.focus.add((e) { listenerList.remove(handler, capture); }); + element.on.blur.add((e) { listenerList.add(handler, capture); }); + } + } + + // TODO(jacobr): add a comment or remove this method. + static Event createEvent(String eventType) { + Event event = document.createEvent("HTMLEvents"); + event.initEvent(eventType, true, true); + return event; + } + + /** + * Clear the keyboard focus of the currently focused element (if there is + * one). If there is no currently focused element then this function will do + * nothing. For most browsers this will cause the keyboard to be dismissed. + */ + static void blurFocusedElement() { + Element focusedEl = document.queryOne("*:focus"); + if (focusedEl != null) { + focusedEl.blur(); + } + } +} diff --git a/client/touch/FxUtil.dart b/client/touch/FxUtil.dart new file mode 100644 index 00000000000..5e295f5d90d --- /dev/null +++ b/client/touch/FxUtil.dart @@ -0,0 +1,143 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Common effects related helpers. + */ +class FxUtil { + /** On transition end event. */ + static final TRANSITION_END_EVENT = 'webkitTransitionEnd'; + + /** The translate3d transform function. */ + static final TRANSLATE_3D = 'translate3d'; + + /** The rotate transform function. */ + static final ROTATE = 'rotate'; + + /** The scale transform function. */ + static final SCALE = 'scale'; + + /** + * Apply a -webkit-transition on an element using the [duration] of this + * animation in ms. + */ + static void setWebkitTransition( + Element el, num duration, + [String property = StyleUtil.TRANSFORM_STYLE, + String timingFunction = TransitionTimingFunction.EASE_IN_OUT]) { + Css.setTransition(el.style, '${property} ${duration}ms ${timingFunction}'); + } + + /** Stops and clears the transition on an element. */ + static void clearWebkitTransition(Element el) { + Css.setTransition(el.style, ''); + } + + static void setPosition(Element el, Coordinate point) { + num x = point.x; + num y = point.y; + Css.setTransform(el.style, '${TRANSLATE_3D}(${x}px,${y}px,0px)'); + } + + /** Apply a transform using translate3d to an HTML element. */ + static void setTranslate(Element el, num x, num y, num z) { + Css.setTransform(el.style, '${TRANSLATE_3D}(${x}px,${y}px,${z}px)'); + } + + /** Apply a -webkit-transform using translate3d to an HTML element. */ + static void setWebkitTransform( + Element el, num x, num y, [num z = 0, + num rotation = null, num scale = null, + num originX = null, num originY = null]) { + final style = el.style; + // TODO(jacobr): create a helper class that simplifies building + // transformation matricies that will be set as CSS styles. We should + // consider using CSSMatrix although that may be overkill. + String transform = '${TRANSLATE_3D}(${x}px,${y}px,${z}px)'; + if (rotation !== null) { + transform = transform.concat(' ${ROTATE}(${rotation}deg)'); + } + if (scale !== null) { + transform = transform.concat(' ${SCALE}(${scale})'); + } + Css.setTransform(style, transform); + if (originX !== null || originY !== null) { + assert(originX !== null && originY !== null); + Css.setTransformOrigin(style, '${originX}px ${originY}px'); + } + } + + /** + * Determine the position of an [element] relative to a [target] element. + * Moving the [element] to be a child of [target] and setting the + * [element]'s top and left values to the returned coordinate should result + * in the [element]'s position remaining unchanged while its parent is + * changed. + */ + static Coordinate computeRelativePosition(Element element, Element target) { + final testPoint = new Point(0, 0); + final pagePoint = + window.webkitConvertPointFromNodeToPage(element, testPoint); + final pointRelativeToTarget = + window.webkitConvertPointFromPageToNode(target, pagePoint); + return new Coordinate(pointRelativeToTarget.x, pointRelativeToTarget.y); + } + + /** Clear a -webkit-transform from an element. */ + static void clearWebkitTransform(Element el) { + Css.setTransform(el.style, ''); + } + + /** + * Checks whether an element has a translate3d webkit transform applied. + */ + static bool hasWebkitTransform(Element el) { + return Css.getTransform(el.style).indexOf(TRANSLATE_3D, 0) != -1; + } + + /** + * Translates [el], an HTML element that has a relative CSS + * position, by setting its left and top CSS styles. + */ + static void setLeftAndTop(Element el, num x, num y) { + final style = el.style; + Css.setLeft(style, '${x}px'); + Css.setTop(style, '${y}px'); + } +} + + +/** + * Utilities for element styles. + */ +class StyleUtil { + // TODO(jacobr): Need a good way to set this to -moz, or -o names. + /** Style name for transform. */ + static final TRANSFORM_STYLE = '-webkit-transform'; + + /** + * Retrieves a computed style value of a node. + * + * Limitations: + * - Does not report border styles correctly in Webkit. + */ + static Css getComputedStyle(Element element) { + // TODO(jmesserly): last param should be null, see b/5045788 + return new Css(window.getComputedStyle(element, '')); + } + + /** Retrieves the current transform of an element. */ + static CSSMatrix getCurrentTransformMatrix(Element element) { + // TODO(jacobr): when poossible switch back to + // return new CSSMatrix(transform); + return new CSSMatrix( + getComputedStyle(element).transform); + } +} + +class TransitionTimingFunction { + static final EASE_IN = 'ease-in'; + static final EASE_OUT = 'ease-out'; + static final EASE_IN_OUT = 'ease-in-out'; +} diff --git a/client/touch/Geometry.dart b/client/touch/Geometry.dart new file mode 100644 index 00000000000..c406f11136a --- /dev/null +++ b/client/touch/Geometry.dart @@ -0,0 +1,234 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Represents a point in 2 dimensional space. + */ +class Coordinate { + + /** + * X-value + */ + num x; + + /** + * Y-value + */ + num y; + + Coordinate([num this.x = 0, num this.y = 0]) { + } + + /** + * Gets the coordinates of a touch's location relative to the window's + * viewport. [input] is either a touch object or an event object. + */ + Coordinate.fromClient(var input) : this(input.clientX, input.clientY); + + static Coordinate difference(Coordinate a, Coordinate b) { + return new Coordinate(a.x - b.x, a.y - b.y); + } + + static num distance(Coordinate a, Coordinate b) { + final dx = a.x - b.x; + final dy = a.y - b.y; + return Math.sqrt(dx * dx + dy * dy); + } + + bool operator ==(Coordinate other) { + return other !== null && x == other.x && y == other.y; + } + + static num squaredDistance(Coordinate a, Coordinate b) { + final dx = a.x - b.x; + final dy = a.y - b.y; + return dx * dx + dy * dy; + } + + static Coordinate sum(Coordinate a, Coordinate b) { + return new Coordinate(a.x + b.x, a.y + b.y); + } + + /** + * Returns a new copy of the coordinate. + */ + Coordinate clone() { + return new Coordinate(x, y); + } + + /** + * Returns a nice string representing the coordinate. + * @return {string} In the form (50, 73). + */ + String toString() { + return "(${x}, ${y})"; + } +} + +/** + * A utility class for representing two-dimensional sizes. + */ +class Size { + num width; + num height; + + Size(num this.width, num this.height) { + } + + bool operator ==(Size other) { + return other !== null && width == other.width && height == other.height; + } + + /** + * Returns the area of the size (width * height). + */ + num area() { + return width * height; + } + + /** + * Returns the ratio of the size's width to its height. + */ + num aspectRatio() { + return width / height; + } + + /** + * Clamps the width and height parameters upward to integer values. + * Returns this size with ceil'd components. + */ + Size ceil() { + width = width.ceil(); + height = height.ceil(); + return this; + } + + /** + * Returns a new copy of the Size. + */ + Size clone() { + return new Size(width, height); + } + + /** + * Returns true if this Size is the same size or smaller than the + * [target] size in both dimensions. + */ + bool fitsInside(Size target) { + return width <= target.width && height <= target.height; + } + + /** + * Clamps the width and height parameters downward to integer values. + * Returns this size with floored components. + */ + Size floor() { + width = width.floor(); + height = height.floor(); + return this; + } + + /** + * Returns the longer of the two dimensions in the size. + */ + num getLongest() { + return Math.max(width, height); + } + + /** + * Returns the shorter of the two dimensions in the size. + */ + num getShortest() { + return Math.min(width, height); + } + + /** + * Returns true if the size has zero area, false if both dimensions + * are non-zero numbers. + */ + bool isEmpty() { + return area() == 0; + } + + /** + * Returns the perimeter of the size (width + height) * 2. + */ + num perimeter() { + return (width + height) * 2; + } + + /** + * Rounds the width and height parameters to integer values. + * Returns this size with rounded components. + */ + Size round() { + width = width.round(); + height = height.round(); + return this; + } + + /** + * Scales the size uniformly by a factor. + * [s] The scale factor. + * Returns this Size object after scaling. + */ + Size scale(num s) { + width *= s; + height *= s; + return this; + } + + /** + * Uniformly scales the size to fit inside the dimensions of a given size. The + * original aspect ratio will be preserved. + * + * This function assumes that both Sizes contain strictly positive dimensions. + * Returns this Size object, after optional scaling. + */ + Size scaleToFit(Size target) { + num s = aspectRatio() > target.aspectRatio() ? + target.width / width : target.height / height; + return scale(s); + } + + /** + * Returns a nice string representing size. + * Returns in the form (50 x 73). + */ + String toString() { + return "(${width} x ${height})"; + } +} + +/** + * Represents the interval { x | start <= x < end }. + */ +class Interval { + + final num start; + final num end; + + Interval(num this.start, num this.end) {} + + num get length() { + return end - start; + } + + bool operator ==(Interval other) { + return other !== null && other.start == start && other.end == end; + } + + Interval union(Interval other) { + return new Interval(Math.min(start, other.start), + Math.max(end, other.end)); + } + + bool contains(num value) { + return value >= start && value < end; + } + + String toString() { + return '(${start}, ${end})'; + } +} diff --git a/client/touch/InfiniteScroller.dart b/client/touch/InfiniteScroller.dart new file mode 100644 index 00000000000..3f7bc484546 --- /dev/null +++ b/client/touch/InfiniteScroller.dart @@ -0,0 +1,145 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Adds a listener to the scroller with triggers events + * when a trigger point at the top, or bottom, of the screen is reached. + * + * To use this you will need to have an element with a scroller attached + * to it. You need to have defined (in pixels) how far from the top or + * bottom the scroll position must be in order to trigger (the "trigger + * point") The element using this must have functions for hitting the top + * trigger, and the bottom trigger. In general, these methods will + * ascertain whether we have more data to scroll to (i.e. when we hit + * the bottom trigger point but have reached the end of the data + * displayed in the element we should ignore it), make the call for + * more data and reposition the scroller - repositioning is key to + * good user experience. + * + * Triggers are generated by listening for the SCROLL_END event from the + * scroller, so data calls are not initiated whilst scrolling is happening, + * but after. + * + * Controls changing divs between the usual (non-loading) div and the + * loading div. To take advantage of this, callback function should return + * a boolean indicating whether the usual div should be replaced by the + * loading div. + */ +class InfiniteScroller { + Scroller _scroller; + + /** + * Function to invoke when trigger point is reached at the top of the view. + */ + Function _onTopScroll; + + /** + * Function to invoke when trigger point is reached at the bottom of the view. + */ + Function _onBottomScroll; + + /** Offset for trigger point at the top of the view. */ + double _offsetTop; + + /** Offset for trigger point at the bottom of the view. */ + double _offsetBottom; + + /** Saves the last Y position. */ + double _lastScrollY; + Element _topDiv; + Element _topLoadingDiv; + Element _bottomDiv; + Element _bottomLoadingDiv; + + InfiniteScroller(Scroller scroller, + Function onTopScroll, Function onBottomScroll, + double offsetTop, [double offsetBottom = null]) + : _scroller = scroller, + _onTopScroll = onTopScroll, + _onBottomScroll = onBottomScroll, + _offsetTop = offsetTop, + _offsetBottom = offsetBottom == null ? offsetTop : offsetBottom, + _lastScrollY = 0.0 { + } + + /** + * Adds the loading divs. + * [topDiv] The div usually shown at the top. + * [topLoadingDiv] is the div to show at the top when waiting for more + * content to load at the top of the page. + * [bottomDiv] is the div usually shown at the bottom. + * [bottomLoadingDiv] is the div to show at the bottom when waiting for more + * content to load at the end of the page. + */ + void addLoadingDivs([Element topDiv = null, + Element topLoadingDiv = null, + Element bottomDiv = null, + Element bottomLoadingDiv = null]) { + _topDiv = topDiv; + _topLoadingDiv = topLoadingDiv; + _bottomDiv = bottomDiv; + _bottomLoadingDiv = bottomLoadingDiv; + _updateVisibility(false, _topDiv, _topLoadingDiv); + _updateVisibility(false, _bottomDiv, _bottomLoadingDiv); + } + + void initialize() { + _registerEventListeners(); + } + + /** + * Switch back the divs after loading complete. Delegate should call + * this function after loading is complete. + */ + void loadEnd() { + _updateVisibility(false, _topDiv, _topLoadingDiv); + _updateVisibility(false, _bottomDiv, _bottomLoadingDiv); + } + + /** + * Called at the end of a scroll event. + */ + void _onScrollEnd() { + double ypos = _scroller.getVerticalOffset(); + + // Scroll is below last point. + if (ypos < _lastScrollY) { + double bottomTrigger = _scroller.getMinPointY() + _offsetBottom; + // And below trigger point. + if (ypos <= bottomTrigger) { + _updateVisibility(_onBottomScroll(), _bottomDiv, _bottomLoadingDiv); + } + } else { + if (ypos > _lastScrollY) { + // Scroll is above last point. + double topTrigger = _scroller.getMaxPointY() - _offsetTop; + // And above trigger point. + if (ypos >= topTrigger) { + _updateVisibility(_onTopScroll(), _topDiv, _topLoadingDiv); + } + } + } + _lastScrollY = ypos; + } + + /** + * Register the event listeners. + */ + void _registerEventListeners() { + _scroller.onScrollerEnd.add((Event event) { _onScrollEnd(); }); + } + + /** + * Hides one div and shows another. + */ + void _updateVisibility(bool isLoading, Element element, + Element loadingElement) { + if (element != null) { + Css.setDisplay(element.style, isLoading ? "none" : ""); + } + if (loadingElement != null) { + Css.setDisplay(loadingElement.style, isLoading ? "" : "none"); + } + } +} diff --git a/client/touch/Math.dart b/client/touch/Math.dart new file mode 100644 index 00000000000..77b5d88b72a --- /dev/null +++ b/client/touch/Math.dart @@ -0,0 +1,28 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// TODO(jacobr): pick a better name. This was goog.math in Closure. +/** + * Math utility functions originally from the closure Math library. + */ +class GoogleMath { + /** + * Takes a [value] and clamps it to within the bounds specified by + * [min] and [max]. + */ + static num clamp(num value, num min, num max) { + return Math.min(Math.max(value, min), max); + } + + /** + * Tests whether the two values are equal to each other, within a certain + * tolerance to adjust for floating point errors. + * The optional [tolerance] value d Defaults to 0.000001. If specified, + * it should be greater than 0. + * Returns whether [a] and [b] are nearly equal. + */ + static bool nearlyEquals(num a, num b, [num tolerance = 0.000001]) { + return (a - b).abs() <= tolerance; + } +} diff --git a/client/touch/Momentum.dart b/client/touch/Momentum.dart new file mode 100644 index 00000000000..9f0e8153f93 --- /dev/null +++ b/client/touch/Momentum.dart @@ -0,0 +1,554 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Implementations can be used to simulate the deceleration of an element within + * a certain region. To use this behavior you need to provide an initial + * velocity that is meant to represent the gesture that is initiating this + * deceleration. You also provide the bounds of the region that the element + * exists in, and the current offset of the element within that region. The + * transitions will have the element decelerate to rest, or stretch past the + * offset boundaries and then come to rest. + * + * This is primarily designed to solve the problem of slow scrolling in mobile + * safari. You can use this along with the [Scroller] behavior to make a + * scrollable area scroll the same way it would in a native application. + * + * Implementations of this interface do not maintain any references to HTML + * elements, and therefore cannot do any redrawing of elements. They only + * calculates where the element should be on an interval. It is the delegate's + * responsibility to redraw the element when the onDecelerate callback is + * invoked. It is recommended that you move the element with a hardware + * accelerated method such as using 'translate3d' on the element's + * -webkit-transform style property. + */ +interface Momentum factory TimeoutMomentum { + + Momentum(MomentumDelegate delegate, [num defaultDecelerationFactor]); + + bool get decelerating(); + + num get decelerationFactor(); + + /** + * Transition end handler. This function must be invoked after any transition + * that occurred as a result of a call to the delegate's onDecelerate callback. + */ + void onTransitionEnd(); + + /** + * Start decelerating. + * The [velocity] passed should be in terms of number of pixels / millisecond. + * [minCoord] and [maxCoord] specify the content's scrollable boundary. + * The current offset of the element within its boundaries is specified by + * [initialOffset]. + * Returns true if deceleration has been initiated. + */ + bool start(Coordinate velocity, Coordinate minCoord, Coordinate maxCoord, + Coordinate initialOffset, [num decelerationFactor]); + + /** + * Calculate the velocity required to transition between coordinates [start] + * and [target] optionally specifying a custom [decelerationFactor]. + */ + Coordinate calculateVelocity(Coordinate start, Coordinate target, + [num decelerationFactor]); + + /** Stop decelerating and return the current velocity. */ + Coordinate stop(); + + /** Aborts decelerating without dispatching any notification events. */ + void abort(); + + /** null if no transition is in progress. */ + Coordinate get destination(); +} + +/** + * Momentum Delegate interface. + * You are required to implement this interface in order to use the + * Momentum behavior. + */ +interface MomentumDelegate { + /** + * Callback for a deceleration step. The delegate is responsible for redrawing + * the element in its new position specified in px. The [duration] of the + * translation is in ms. + */ + void onDecelerate(num x, num y, [num duration, String timingFunction]); + + /** + * Callback for end of deceleration. + */ + void onDecelerationEnd(); +} + +class BouncingState { + static final NOT_BOUNCING = 0; + static final BOUNCING_AWAY = 1; + static final BOUNCING_BACK = 2; +} + +class _Move { + final num x; + final num y; + final num vx; + final num vy; + final num time; + + _Move(this.x, this.y, this.vx, this.vy, this.time); +} + +/** + * Secant method root solver helper class. + * We use http://en.wikipedia.org/wiki/Secant_method + * falling back to the http://en.wikipedia.org/wiki/Bisection_method + * if it doesn't appear we are converging properlty. + * TODO(jacobr): simplify the code so we don't have to use this solver + * class at all. + */ +class Solver { + + static num solve(num fn(num), num targetY, num startX, + [int maxIterations = 50]) { + num lastX = 0; + num lastY = fn(lastX); + num deltaX; + num deltaY; + num minX = null; + num maxX = null; + num x = startX; + num delta = startX; + for (int i = 0; i < maxIterations; i++) { + num y = fn(x); + if (y.round() == targetY.round()) { + return x; + } + if (y > targetY) { + maxX = x; + } else { + minX = x; + } + + num errorY = targetY - y; + deltaX = x - lastX; + deltaY = y - lastY; + lastX = x; + lastY = y; + // Avoid divide by zero and as a hack just repeat the previous delta. + // Obviously this is a little dangerous and we might not converge. + if (deltaY != 0) { + delta = errorY * deltaX / deltaY; + } + x += delta; + if (minX != null && maxX != null + && (x > minX || x < maxX)) { + // Fall back to binary search. + x = (minX + maxX) / 2; + } + } + window.console.warn('''Could not find an exact solution. LastY=${lastY}, + targetY=${targetY} lastX=$lastX delta=$delta deltaX=$deltaX + deltaY=$deltaY'''); + return x; + } +} + +/** + * Helper class modeling the physics of a throwable scrollable area along a + * single dimension. + */ +class SingleDimensionPhysics { + /** The number of frames per second the animation should run at. */ + static final _FRAMES_PER_SECOND = 60; + + /** + * The spring coefficient for when the element has passed a boundary and is + * decelerating to change direction and bounce back. Each frame, the velocity + * will be changed by x times this coefficient, where x is the current stretch + * value of the element from its boundary. This will end when velocity reaches + * zero. + */ + static final _PRE_BOUNCE_COEFFICIENT = 7.0 / _FRAMES_PER_SECOND; + + /** + * The spring coefficient for when the element is bouncing back from a + * stretched offset to a min or max position. Each frame, the velocity will + * be changed to x times this coefficient, where x is the current stretch + * value of the element from its boundary. This will end when the stretch + * value reaches 0. + */ + static final _POST_BOUNCE_COEFFICIENT = 7.0 / _FRAMES_PER_SECOND; + + /** + * The number of milliseconds per animation frame. + */ + static final _MS_PER_FRAME = 1000.0 / _FRAMES_PER_SECOND; + + /** + * The constant factor applied to velocity at each frame to simulate + * deceleration. + */ + static final _DECELERATION_FACTOR = 0.97; + + + static final _MAX_VELOCITY_STATIC_FRICTION = 0.08 * _MS_PER_FRAME; + static final _DECELERATION_FACTOR_STATIC_FRICTION = 0.92; + + /** + * Minimum velocity required to start or continue deceleration, in + * pixels/frame. This is equivalent to 0.25 px/ms. + */ + static final _MIN_VELOCITY = 0.25 * _MS_PER_FRAME; + + /** + * Minimum velocity during a step, in pixels/frame. This is equivalent to 0.01 + * px/ms. + */ + static final _MIN_STEP_VELOCITY = 0.01 * _MS_PER_FRAME; + + /** + * Boost the initial velocity by a certain factor before applying momentum. + * This just gives the momentum a better feel. + */ + static final _INITIAL_VELOCITY_BOOST_FACTOR = 1.25; + + /** + * Additional deceleration factor to apply for the current move only. This + * is helpful for cases such as scroll wheel scrolling where the default + * amount of deceleration is inadequate. + */ + num customDecelerationFactor = 1; + num _minCoord; + num _maxCoord; + + /** The bouncing state. */ + int _bouncingState; + + + num velocity; + num _currentOffset; + + /** + * constant used when guessing at the velocity required to throw to a specific + * location. Chosen arbitrarily. All that really matters is that the velocity + * is large enough that a throw gesture will occur. + */ + static final _VELOCITY_GUESS = 20; + + SingleDimensionPhysics() : _bouncingState = BouncingState.NOT_BOUNCING { + } + + void configure(num minCoord, num maxCoord, + num initialOffset, num customDecelerationFactor, + num velocity) { + _bouncingState = BouncingState.NOT_BOUNCING; + _minCoord = minCoord; + _maxCoord = maxCoord; + _currentOffset = initialOffset; + this.customDecelerationFactor = customDecelerationFactor; + _adjustInitialVelocityAndBouncingState(velocity); + } + + num solve(num initialOffset, num targetOffset, + num customDecelerationFactor) { + initialOffset = initialOffset.round(); + targetOffset = targetOffset.round(); + if (initialOffset == targetOffset) { + return 0; + } + return Solver.solve((num velocity) { + // Don't specify min and max coordinates as we don't need to bother + // with the simulating bouncing off the edges. + configure(null, null, initialOffset.round(), + customDecelerationFactor, velocity); + stepAll(); + return _currentOffset; + }, + targetOffset, + targetOffset > initialOffset ? _VELOCITY_GUESS : -_VELOCITY_GUESS); + } + + /** + * Helper method to calculate initial velocity. + * The [velocity] passed here should be in terms of number of + * pixels / millisecond. Returns the adjusted x and y velocities. + */ + void _adjustInitialVelocityAndBouncingState(num v) { + velocity = v * _MS_PER_FRAME * _INITIAL_VELOCITY_BOOST_FACTOR; + + if (velocity.abs() < _MIN_VELOCITY) { + if (_minCoord !== null && _currentOffset < _minCoord) { + velocity = (_minCoord - _currentOffset) * _POST_BOUNCE_COEFFICIENT; + velocity = Math.max(velocity, _MIN_STEP_VELOCITY); + _bouncingState = BouncingState.BOUNCING_BACK; + } else if (_maxCoord !== null && _currentOffset > _maxCoord) { + velocity = (_currentOffset - _maxCoord) * _POST_BOUNCE_COEFFICIENT; + velocity = -Math.max(velocity, _MIN_STEP_VELOCITY); + _bouncingState = BouncingState.BOUNCING_BACK; + } + } + } + + /** + * Apply deceleration. + */ + void _adjustVelocity() { + num speed = velocity.abs(); + velocity *= _DECELERATION_FACTOR; + if (customDecelerationFactor != null) { + velocity *= customDecelerationFactor; + } + // This isn't really how static friction works but it is a plausible + // approximation. + if (speed < _MAX_VELOCITY_STATIC_FRICTION) { + velocity *= _DECELERATION_FACTOR_STATIC_FRICTION; + } + + num stretchDistance; + if (_minCoord !== null && _currentOffset < _minCoord) { + stretchDistance = _minCoord - _currentOffset; + } else { + if (_maxCoord !== null && _currentOffset > _maxCoord) { + stretchDistance = _maxCoord - _currentOffset; + } + } + if (stretchDistance != null) { + if (stretchDistance * velocity < 0) { + _bouncingState = _bouncingState == BouncingState.BOUNCING_BACK ? + BouncingState.NOT_BOUNCING : BouncingState.BOUNCING_AWAY; + velocity += stretchDistance * _PRE_BOUNCE_COEFFICIENT; + } else { + _bouncingState = BouncingState.BOUNCING_BACK; + velocity = stretchDistance > 0 ? + Math.max(stretchDistance * _POST_BOUNCE_COEFFICIENT, + _MIN_STEP_VELOCITY) : + Math.min(stretchDistance * _POST_BOUNCE_COEFFICIENT, + -_MIN_STEP_VELOCITY); + } + } else { + _bouncingState = BouncingState.NOT_BOUNCING; + } + } + + void step() { + // It is common for scrolling to be disabled so in these cases we want to + // avoid needless calculations. + if (velocity !== null) { + _currentOffset += velocity; + _adjustVelocity(); + } + } + + void stepAll() { + while(!isDone()) { + step(); + } + } + + /** + * Whether or not the current velocity is above the threshold required to + * continue decelerating. + */ + bool isVelocityAboveThreshold(num threshold) { + return velocity.abs() >= threshold; + } + + bool isDone() { + return _bouncingState == BouncingState.NOT_BOUNCING && + !isVelocityAboveThreshold(_MIN_STEP_VELOCITY); + } +} + +/** + * Implementation of a momentum strategy using webkit-transforms + * and timeouts. + */ +class TimeoutMomentum implements Momentum { + + SingleDimensionPhysics physicsX; + SingleDimensionPhysics physicsY; + Coordinate _previousOffset; + Queue<_Move> _moves; + num _stepTimeout; + bool _decelerating; + MomentumDelegate _delegate; + int _nextY; + int _nextX; + Coordinate _minCoord; + Coordinate _maxCoord; + num _customDecelerationFactor; + num _defaultDecelerationFactor; + + TimeoutMomentum(this._delegate, [this._defaultDecelerationFactor = 1]) + : _decelerating = false, + _moves = new Queue<_Move>(), + physicsX = new SingleDimensionPhysics(), + physicsY = new SingleDimensionPhysics(); + + /** + * Calculate and return the moves for the deceleration motion. + */ + void _calculateMoves() { + _moves.clear(); + num time = TimeUtil.now(); + while (!physicsX.isDone() || !physicsY.isDone()) { + _stepWithoutAnimation(); + time += SingleDimensionPhysics._MS_PER_FRAME; + if (_isStepNecessary()) { + _moves.add(new _Move(_nextX, _nextY, + physicsX.velocity, + physicsY.velocity, time)); + _previousOffset.y = _nextY; + _previousOffset.x = _nextX; + } + } + } + + bool get decelerating() => _decelerating; + num get decelerationFactor() => _customDecelerationFactor; + + /** + * Checks whether or not an animation step is necessary or not. Animations + * steps are not necessary when the velocity gets so low that in several + * frames the offset is the same. + * Returns true if there is movement to be done in the next frame. + */ + bool _isStepNecessary() { + return _nextY != _previousOffset.y || _nextX != _previousOffset.x; + } + + /** + * The [TouchHandler] requires this function but we don't need to do + * anything here. + */ + void onTransitionEnd() { + } + + Coordinate calculateVelocity(Coordinate start, Coordinate target, + [num decelerationFactor = null]) { + return new Coordinate( + physicsX.solve(start.x, target.x, decelerationFactor), + physicsY.solve(start.y, target.y, decelerationFactor)); + } + + bool start(Coordinate velocity, Coordinate minCoord, Coordinate maxCoord, + Coordinate initialOffset, [num decelerationFactor = null]) { + _customDecelerationFactor = _defaultDecelerationFactor; + if (decelerationFactor !== null) { + _customDecelerationFactor = decelerationFactor; + } + + if (_stepTimeout !== null) { + Env.cancelRequestAnimationFrame(_stepTimeout); + _stepTimeout = null; + } + + assert (_stepTimeout === null); + assert(minCoord.x <= maxCoord.x); + assert(minCoord.y <= maxCoord.y); + _previousOffset = initialOffset.clone(); + physicsX.configure(minCoord.x, maxCoord.x, initialOffset.x, + _customDecelerationFactor, velocity.x); + physicsY.configure(minCoord.y, maxCoord.y, initialOffset.y, + _customDecelerationFactor, velocity.y); + if (!physicsX.isDone() || !physicsY.isDone()) { + _calculateMoves(); + if (!_moves.isEmpty()) { + num firstTime = _moves.first().time; + _stepTimeout = Env.requestAnimationFrame( + _step, null, firstTime); + _decelerating = true; + return true; + } + } + _decelerating = false; + return false; + } + + /** + * Update the x, y values of the element offset without actually moving the + * element. This is done because we store decimal values for x, y for + * precision, but moving is only required when the offset is changed by at + * least a whole integer. + */ + void _stepWithoutAnimation() { + physicsX.step(); + physicsY.step(); + // TODO(jacobr): double.round() should return an int, see b/5121907 + _nextX = physicsX._currentOffset.round().toInt(); + _nextY = physicsY._currentOffset.round().toInt(); + } + + /** + * Calculate the next offset of the element and animate it to that position. + */ + void _step(num timestamp) { + _stepTimeout = null; + + // Prune moves that are more than 1 frame behind when we have more + // available moves. + num lastEpoch = timestamp - SingleDimensionPhysics._MS_PER_FRAME; + while (!_moves.isEmpty() && _moves.first() !== _moves.last() + && _moves.first().time < lastEpoch) { + _moves.removeFirst(); + } + + if (!_moves.isEmpty()) { + final move = _moves.removeFirst(); + _delegate.onDecelerate(move.x, move.y); + if (!_moves.isEmpty()) { + num nextTime = _moves.first().time; + assert(_stepTimeout === null); + _stepTimeout = Env.requestAnimationFrame(_step, null, nextTime); + } else { + stop(); + } + } + } + + void abort() { + _decelerating = false; + _moves.clear(); + if (_stepTimeout !== null) { + Env.cancelRequestAnimationFrame(_stepTimeout); + _stepTimeout = null; + } + } + + Coordinate stop() { + final wasDecelerating = _decelerating; + _decelerating = false; + Coordinate velocity; + if (!_moves.isEmpty()) { + final move = _moves.first(); + // This is a workaround for the ugly hacks that get applied when a user + // passed a velocity in to this Momentum implementation. + num velocityScale = SingleDimensionPhysics._MS_PER_FRAME * + SingleDimensionPhysics._INITIAL_VELOCITY_BOOST_FACTOR; + velocity = new Coordinate( + move.vx / velocityScale, move.vy / velocityScale); + } else { + velocity = new Coordinate(0, 0); + } + _moves.clear(); + if (_stepTimeout !== null) { + Env.cancelRequestAnimationFrame(_stepTimeout); + _stepTimeout = null; + } + if (wasDecelerating) { + _delegate.onDecelerationEnd(); + } + return velocity; + } + + Coordinate get destination() { + if (!_moves.isEmpty()) { + final lastMove = _moves.last(); + return new Coordinate(lastMove.x, lastMove.y); + } else { + return null; + } + } +} diff --git a/client/touch/ScrollWatcher.dart b/client/touch/ScrollWatcher.dart new file mode 100644 index 00000000000..603d34c731b --- /dev/null +++ b/client/touch/ScrollWatcher.dart @@ -0,0 +1,101 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +interface ScrollListener { + /** + * The callback invoked for a scroll event. + * [decelerating] specifies whether or not the content is moving due + * to deceleration. It should be false if the content is moving because the + * user is dragging the content. + */ + void onScrollerMoved(double scrollX, double scrollY, bool decelerating); +} + +/** + * The scroll watcher is intended to provide a single way to + * listen for scroll events from instances of Scroller, abstracting the + * various nuances between momentum strategies that require different scroll + * listening strategies. + */ +class ScrollWatcher { + Scroller _scroller; + + List _listeners; + + TimeoutHandler _boundOnDecel; + Element _scrollerEl; + int _decelIntervalId; + + ScrollWatcher(Scroller scroller) + : _scroller = scroller, _listeners = new List() { + _boundOnDecel = () { _onDecelerate(); }; + } + + void addListener(ScrollListener listener) { + _listeners.add(listener); + } + + /** + * Send the scroll event to all listeners. + * [decelerating] is true if the offset is changing because of deceleration. + */ + void _dispatchScroll(num scrollX, num scrollY, + [bool decelerating = false]) { + for (final listener in _listeners) { + listener.onScrollerMoved(scrollX, scrollY, decelerating); + } + } + + /** + * Initializes elements and event handlers. Must be called after construction + * and before usage. + */ + void initialize() { + _scrollerEl = _scroller.getElement(); + _scroller.onContentMoved.add((e) { _onContentMoved(e); }); + } + + /** + * This callback is invoked any time the scroller content offset changes. + */ + void _onContentMoved(Event e) { + num scrollX = _scroller.getHorizontalOffset(); + num scrollY = _scroller.getVerticalOffset(); + _dispatchScroll(scrollX, scrollY); + } + + /** + * This callback is invoked every 30ms while deceleration is happening. + */ + void _onDecelerate() { + final transform = StyleUtil.getCurrentTransformMatrix(_scrollerEl); + num scrollX = transform.m41; + num scrollY = transform.m42; + _dispatchScroll(scrollX, scrollY, true); + } + + /** + * When deceleration begins, clear the interval if it already exists and set + * up a new one. + */ + void _onDecelerationStart(Event e) { + if (_decelIntervalId !== null) { + window.clearInterval(_decelIntervalId); + } + // TODO(jacobr): use Env.requestAnimationFrame and renable this. + // Right now this would kill our performance and is not relevant given + // we are using timeout based momentum. + // _decelIntervalId = window.setInterval(_boundOnDecel, 30); + } + + /** + * When scrolling ends, clear the interval if it exists. + */ + void _onScrollerEnd(Event e) { + if (_decelIntervalId !== null) { + window.clearInterval(_decelIntervalId); + } + _onContentMoved(e); + } +} diff --git a/client/touch/Scrollbar.dart b/client/touch/Scrollbar.dart new file mode 100644 index 00000000000..0f163cec618 --- /dev/null +++ b/client/touch/Scrollbar.dart @@ -0,0 +1,340 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Implementation of a scrollbar for the custom scrolling behavior + * defined in [:Scroller:]. + */ +class Scrollbar implements ScrollListener { + /** + * The minimum size of scrollbars when not compressed. + */ + static final _MIN_SIZE = 30; + + /** + * The minimum compressed size of scrollbars. Scrollbars are compressed when + * the content is stretching past its boundaries. + */ + static final _MIN_COMPRESSED_SIZE = 8; + /** Padding in pixels to add above and bellow the scrollbar. */ + static final _PADDING_LENGTH = 10; + /** + * The amount of time to wait before hiding scrollbars after showing them. + * Measured in ms. + */ + static final _DISPLAY_TIME = 300; + static final DRAG_CLASS_NAME = 'drag'; + + Scroller _scroller; + Element _frame; + bool _scrollInProgress = false; + bool _scrollBarDragInProgressValue = false; + + /** + * Cached values of height and width. Keys will be 'height' and 'width' + * depending on if they are applied to vertical or horizontal scrollbar. + */ + Map _cachedSize; + + /** + * This bound function will be used as the input to window.setTimeout when + * scheduling the hiding of the scrollbars. + */ + Function _boundHideFn; + + Element _verticalElement; + Element _horizontalElement; + + int _currentScrollStartMouse; + num _currentScrollStartOffset; + bool _currentScrollVertical; + num _currentScrollRatio; + num _timerId; + + bool _displayOnHover; + bool _hovering = false; + + Scrollbar(Scroller scroller, [this._displayOnHover = true]) : + _scroller = scroller, + _frame = scroller.getFrame(), + _cachedSize = new Map() { + _boundHideFn = () { _showScrollbars(false); }; + } + + bool get _scrollBarDragInProgress() => _scrollBarDragInProgressValue; + + void set _scrollBarDragInProgress(bool value) { + _scrollBarDragInProgressValue = value; + _toggleClass(_verticalElement, DRAG_CLASS_NAME, + value && _currentScrollVertical); + _toggleClass(_horizontalElement, DRAG_CLASS_NAME, + value && !_currentScrollVertical); + } + + // TODO(jacobr): move this helper method into the DOM. + void _toggleClass(Element e, String className, bool enabled) { + if (enabled) { + if (!e.classes.contains(className)) { + e.classes.add(className); + } + } else { + e.classes.remove(className); + } + } + + /** + * Initializes elements and event handlers. Must be called after + * construction and before usage. + */ + void initialize() { + // Don't initialize if we have already been initialized. + // TODO(jacobr): remove this once bugs are fixed and enterDocument is only + // called once by each view. + if (_verticalElement != null) { + return; + } + _verticalElement = new Element.html( + '
'); + _horizontalElement = new Element.html( + '
'); + _scroller.addScrollListener(this); + + Element scrollerEl = _scroller.getElement(); + + _addEventListeners( + _verticalElement, _onStart, _onMove, _onEnd, _onEnd, true); + _addEventListeners( + _horizontalElement, _onStart, _onMove, _onEnd, _onEnd, true); + + _scroller.addScrollListener(this); + _showScrollbars(false); + _scroller.onScrollerStart.add(_onScrollerStart); + _scroller.onScrollerEnd.add(_onScrollerEnd); + if (_displayOnHover) { + // TODO(jacobr): rather than adding all these event listeners we could + // instead attach a single global event listener and let data in the + // DOM drive. + _frame.on.click.add((Event e) { + // Always focus on click as one of our children isn't all focused. + if (!_frame.contains(document.activeElement)) { + scrollerEl.focus(); + } + }, false); + _frame.on.mouseOver.add((Event e) { + final activeElement = document.activeElement; + // TODO(jacobr): don't steal focus from a child element or a truly + // focusable element. Only support stealing focus ffrom another + // element that was given fake focus. + if (activeElement is BodyElement || + (!_frame.contains(activeElement) && + activeElement is DivElement)) { + scrollerEl.focus(); + } + if (_hovering == false) { + _hovering = true; + _cancelTimeout(); + _showScrollbars(true); + refresh(); + } + }, false); + _frame.on.mouseOut.add((e) { + _hovering = false; + // Start hiding immediately if we aren't + // scrolling or already in the process of + // hidng the scrollbar + if (!_scrollInProgress && _timerId == null) { + _boundHideFn(); + } + }, false); + } + } + + void _onStart(UIEvent e) { + Element elementOver = e.target; + if (elementOver == _verticalElement || + elementOver == _horizontalElement) { + _currentScrollVertical = elementOver == _verticalElement; + if (_currentScrollVertical) { + _currentScrollStartMouse = e.pageY; + _currentScrollStartOffset = _scroller.getVerticalOffset(); + } else { + _currentScrollStartMouse = e.pageX; + _currentScrollStartOffset = _scroller.getHorizontalOffset(); + } + _refreshScrollRatio(); + _scrollBarDragInProgress = true; + _scroller._momentum.abort(); + e.stopPropagation(); + } + } + + void _refreshScrollRatio() { + Size contentSize = _scroller._getAdjustedContentSize(); + if (_currentScrollVertical) { + _refreshScrollRatioHelper( + _scroller._scrollSize.height, contentSize.height); + } else { + _refreshScrollRatioHelper(_scroller._scrollSize.width, + contentSize.width); + } + } + + + void _refreshScrollRatioHelper(num frameSize, num contentSize) { + num frameTravelDistance = frameSize - _defaultScrollSize( + frameSize, contentSize) -_PADDING_LENGTH * 2; + if (frameTravelDistance < 0.001) { + _currentScrollRatio = 0; + } else { + _currentScrollRatio = (contentSize - frameSize) / frameTravelDistance; + } + } + + void _onMove(UIEvent e) { + if (!_scrollBarDragInProgress) { + return; + } + _refreshScrollRatio(); + int coordinate = _currentScrollVertical ? e.pageY : e.pageX; + num delta = (coordinate - _currentScrollStartMouse) * _currentScrollRatio; + if (delta != 0) { + num x; + num y; + _currentScrollStartOffset -= delta; + if (_currentScrollVertical) { + x = _scroller.getHorizontalOffset(); + y = _currentScrollStartOffset.toInt(); + } else { + x = _currentScrollStartOffset.toInt(); + y = _scroller.getVerticalOffset(); + } + _scroller.setPosition(x, y); + } + _currentScrollStartMouse = coordinate; + } + + void _onEnd(UIEvent e) { + _scrollBarDragInProgress = false; + // TODO(jacobr): make scrollbar less tightly coupled to the scroller. + _scroller.onScrollerDragEnd.dispatch( + EventUtil.createEvent(ScrollerEventType.DRAG_END)); + } + + + /** + * When scrolling ends, schedule a timeout to hide the scrollbars. + */ + void _onScrollerEnd(Event e) { + _cancelTimeout(); + _timerId = window.setTimeout(_boundHideFn, _DISPLAY_TIME); + _scrollInProgress = false; + } + void onScrollerMoved(num scrollX, num scrollY, bool decelerating) { + if (_scrollInProgress == false) { + // Display the scrollbar and then immediately prepare to hide it... + _onScrollerStart(null); + _onScrollerEnd(null); + } + updateScrollbars(scrollX, scrollY); + } + + void refresh() { + if (_scrollInProgress == false && _hovering == false) { + // No need to refresh if not visible. + return; + } + _scroller._resize(); + updateScrollbars(_scroller.getHorizontalOffset(), + _scroller.getVerticalOffset()); + } + + void updateScrollbars(num scrollX, num scrollY) { + Size contentSize = _scroller._getAdjustedContentSize(); + if (_scroller._shouldScrollHorizontally()) { + num scrollPercentX = _scroller.getHorizontalScrollPercent(scrollX); + _updateScrollbar(_horizontalElement, scrollX, scrollPercentX, + _scroller._scrollSize.width, + contentSize.width, 'right', 'width'); + } + if (_scroller._shouldScrollVertically()) { + num scrollPercentY = _scroller.getVerticalScrollPercent(scrollY); + _updateScrollbar(_verticalElement, scrollY, scrollPercentY, + _scroller._scrollSize.height, + contentSize.height, 'bottom', 'height'); + } + } + + /** + * When scrolling starts, show scrollbars and clear hide intervals. + */ + void _onScrollerStart(Event e) { + _scrollInProgress = true; + _cancelTimeout(); + _showScrollbars(true); + } + + void _cancelTimeout() { + if (_timerId != null) { + window.clearTimeout(_timerId); + _timerId = null; + } + } + + /** + * Show or hide the scrollbars by changing the opacity. + */ + void _showScrollbars(bool show) { + if (_hovering == true && _displayOnHover) { + show = true; + } + Css.setOpacity(_verticalElement.style, show ? '1' : '0'); + Css.setOpacity(_horizontalElement.style, show ? '1' : '0'); + } + + num _defaultScrollSize(num frameSize, num contentSize) { + return GoogleMath.clamp( + (frameSize -_PADDING_LENGTH * 2) * frameSize / contentSize, + _MIN_SIZE, frameSize -_PADDING_LENGTH * 2); + } + + /** + * Update the vertical or horizontal scrollbar based on the new scroll + * properties. The CSS property to adjust for position (bottom|right) is + * specified by [cssPos]. The CSS property to adjust for size (height|width) + * is specified by [cssSize]. + */ + void _updateScrollbar(Element element, num offset, + num scrollPercent, num frameSize, + num contentSize, String cssPos, String cssSize) { + if (!_cachedSize.containsKey(cssSize)) { + if (offset == null || contentSize < frameSize) { + return; + } + _frame.nodes.add(element); + } + num stretchPercent; + if (scrollPercent > 1) { + stretchPercent = scrollPercent - 1; + } else { + stretchPercent = scrollPercent < 0 ? -scrollPercent : 0; + } + num scrollPx = stretchPercent * (contentSize - frameSize); + num maxSize = _defaultScrollSize(frameSize, contentSize); + num size = Math.max(_MIN_COMPRESSED_SIZE, maxSize - scrollPx); + num maxOffset = frameSize - size -_PADDING_LENGTH * 2; + num pos = GoogleMath.clamp(scrollPercent * maxOffset, + 0, maxOffset) + _PADDING_LENGTH; + pos = pos.round(); + size = size.round(); + final style = element.style; + style.setProperty(cssPos, '${pos}px', ''); + if (_cachedSize[cssSize] != size) { + _cachedSize[cssSize] = size; + style.setProperty(cssSize, '${size}px', ''); + } + if (element.parentElement == null) { + _frame.nodes.add(element); + } + } +} diff --git a/client/touch/Scroller.dart b/client/touch/Scroller.dart new file mode 100644 index 00000000000..1f4d1951c1f --- /dev/null +++ b/client/touch/Scroller.dart @@ -0,0 +1,807 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Implementation of a custom scrolling behavior. + * This behavior overrides native scrolling for an area. This area can be a + * single defined part of a page, the entire page, or several different parts + * of a page. + * + * To use this scrolling behavior you need to define a frame and the content. + * The frame defines the area that the content will scroll within. The frame and + * content must both be HTML Elements, with the content being a direct child of + * the frame. Usually the frame is smaller in size than the content. This is + * not necessary though, if the content is smaller then bouncing will occur to + * provide feedback that you are past the scrollable area. + * + * The scrolling behavior works using the webkit translate3d transformation, + * which means browsers that do not have hardware accelerated transformations + * will not perform as well using this. Simple scrolling should be fine even + * without hardware acceleration, but animating momentum and deceleration is + * unacceptably slow without it. There is also the option to use relative + * positioning (setting the left and top styles). + * + * For this to work properly you need to set -webkit-text-size-adjust to 'none' + * on an ancestor element of the frame, or on the frame itself. If you forget + * this you may see the text content of the scrollable area changing size as it + * moves. + * + * The behavior is intended to support vertical and horizontal scrolling, and + * scrolling with momentum when a touch gesture flicks with enough velocity. + */ + +class Scroller implements Draggable, MomentumDelegate { + + /** Pixels to move each time an arrow key is pressed. */ + static final ARROW_KEY_DELTA = 30; + static final SCROLL_WHEEL_VELOCITY = 0.01; + static final FAST_SNAP_DECELERATION_FACTOR = 0.84; + static final PAGE_KEY_SCROLL_FRACTION = .85; + + // TODO(jacobr): remove this static variable. + static bool _dragInProgress = false; + + /** The node that will actually scroll. */ + Element _element; + + /** + * Frame is the node that will serve as the container for the scrolling + * content. + */ + Element _frame; + + /** Touch manager to track the events on the scrollable area. */ + TouchHandler _touchHandler; + + Momentum _momentum; + + EventListenerList _onScrollerStart; + EventListenerList _onScrollerEnd; + EventListenerList _onScrollerDragEnd; + EventListenerList _onContentMoved; + EventListenerList _onDecelStart; + + /** Set if vertical scrolling should be enabled. */ + bool verticalEnabled; + + /** Set if horizontal scrolling should be enabled. */ + bool horizontalEnabled; + + /** + * Set if momentum should be enabled. + */ + bool _momentumEnabled; + + /** Set which type of scrolling translation technique should be used. */ + int _scrollTechnique; + + /** + * The maximum coordinate that the left upper corner of the content can scroll + * to. + */ + Coordinate _maxPoint; + + /** + * An offset to subtract from the maximum coordinate that the left upper + * corner of the content can scroll to. + */ + Coordinate _maxOffset; + + /** + * An offset to add to the minimum coordinate that the left upper corner of + * the content can scroll to. + */ + Coordinate _minOffset; + + /** Initialize the current content offset. */ + Coordinate _contentOffset; + + // TODO(jacobr): the function type is + // [:Function(Element, num, num)->void:]. + /** + * The function to use that will actually translate the scrollable node. + */ + Function _setOffsetFunction; + /** + * Function that returns the content size that can be specified instead of + * querying the DOM. + */ + Function _lookupContentSizeDelegate; + + Size _scrollSize; + Size _contentSize; + Coordinate _minPoint; + bool _activeTransition = false; + bool _isStopping = false; + Coordinate _contentStartOffset; + bool _started = false; + bool _activeGesture = false; + ScrollWatcher _scrollWatcher; + + Scroller(Element scrollableElem, [this.verticalEnabled = false, + this.horizontalEnabled = false, + this._momentumEnabled = true, + this._lookupContentSizeDelegate = null, + num defaultDecelerationFactor = 1, + int scrollTechnique = null, bool capture = false]) + : _element = scrollableElem, + _frame = scrollableElem.parent, + _touchHandler = new TouchHandler(this, scrollableElem.parent), + _momentum = new Momentum(this, defaultDecelerationFactor), + _scrollTechnique = scrollTechnique !== null + ? scrollTechnique : ScrollerScrollTechnique.TRANSFORM_3D, + _minPoint = new Coordinate(0, 0), + _maxPoint = new Coordinate(0, 0), + _maxOffset = new Coordinate(0, 0), + _minOffset = new Coordinate(0, 0), + _contentOffset = new Coordinate(0, 0) { + + Element parentElem = scrollableElem.parent; + assert(parentElem != null); + _setOffsetFunction = _getOffsetFunction(_scrollTechnique); + _element.on.transitionEnd.add((event) { onTransitionEnd(event); }); + _touchHandler.setDraggable(this); + _touchHandler.enable(capture); + + _frame.on.mouseWheel.add((e) { + if (e.wheelDeltaY != 0 && verticalEnabled || + e.wheelDeltaX != 0 && horizontalEnabled) { + num x = horizontalEnabled ? e.wheelDeltaX : 0; + num y = verticalEnabled ? e.wheelDeltaY : 0; + if (throwDelta(x, y, FAST_SNAP_DECELERATION_FACTOR)) { + e.preventDefault(); + } + } + }); + + _frame.on.keyDown.add((KeyboardEvent e) { + bool handled = false; + // We ignore key events where further scrolling in that direction + // would have no impact which matches default browser behavior with + // nested scrollable areas. + + switch(e.keyCode) { + case 33: // page-up + handled = throwDelta( + 0, + _scrollSize.height * PAGE_KEY_SCROLL_FRACTION); + break; + case 34: // page-down + handled = throwDelta( + 0, -_scrollSize.height * PAGE_KEY_SCROLL_FRACTION); + break; + case 35: // End + handled = throwTo(_maxPoint.x, _minPoint.y, + FAST_SNAP_DECELERATION_FACTOR); + break; + case 36: // Home + handled = throwTo(_maxPoint.x,_maxPoint.y, + FAST_SNAP_DECELERATION_FACTOR); + break; +/* TODO(jacobr): enable arrow keys when the don't conflict with other + application keyboard shortcuts. + case 38: // up + handled = throwDelta( + 0, + ARROW_KEY_DELTA, + FAST_SNAP_DECELERATION_FACTOR); + break; + case 40: // down + handled = throwDelta( + 0, -ARROW_KEY_DELTA, + FAST_SNAP_DECELERATION_FACTOR); + break; + case 37: // left + handled = throwDelta( + ARROW_KEY_DELTA, 0, + FAST_SNAP_DECELERATION_FACTOR); + break; + case 39: // right + handled = throwDelta( + -ARROW_KEY_DELTA, + 0, + FAST_SNAP_DECELERATION_FACTOR); + break; + */ + } + if (handled) { + e.preventDefault(); + } + }); + // The scrollable element must be relatively positioned. + assert(_scrollTechnique != ScrollerScrollTechnique.RELATIVE_POSITIONING || + new Css(window.getComputedStyle( + _element, null)).position != "static"); + _initLayer(); + } + + EventListenerList get onScrollerStart() { + if (_onScrollerStart === null) { + _onScrollerStart = new SimpleEventListenerList(); + } + return _onScrollerStart; + } + + EventListenerList get onScrollerEnd() { + if (_onScrollerEnd === null) { + _onScrollerEnd = new SimpleEventListenerList(); + } + return _onScrollerEnd; + } + + EventListenerList get onScrollerDragEnd() { + if (_onScrollerDragEnd === null) { + _onScrollerDragEnd = new SimpleEventListenerList(); + } + return _onScrollerDragEnd; + } + + EventListenerList get onContentMoved() { + if (_onContentMoved === null) { + _onContentMoved = new SimpleEventListenerList(); + } + return _onContentMoved; + } + + EventListenerList get onDecelStart() { + if (_onDecelStart === null) { + _onDecelStart = new SimpleEventListenerList(); + } + return _onDecelStart; + } + + + /** + * Add a scroll listener. This allows other classes to subscribe to scroll + * notifications from this scroller. + */ + void addScrollListener(ScrollListener listener) { + if (_scrollWatcher === null) { + _scrollWatcher = new ScrollWatcher(this); + _scrollWatcher.initialize(); + } + _scrollWatcher.addListener(listener); + } + + /** + * Adjust the new calculated scroll position based on the minimum allowed + * position and returns the adjusted scroll value. + */ + num _adjustValue(num newPosition, num minPosition, + num maxPosition) { + assert(minPosition <= maxPosition); + + if (newPosition < minPosition) { + newPosition -= (newPosition - minPosition) / 2; + } else { + if (newPosition > maxPosition) { + newPosition -= (newPosition - maxPosition) / 2; + } + } + return newPosition; + } + + /** + * Coordinate we would end up at if we did nothing. + */ + Coordinate get currentTarget() { + Coordinate end = _momentum.destination; + if (end === null) { + end = _contentOffset; + } + return end; + } + + Coordinate get contentOffset() => _contentOffset; + + /** + * Animate the position of the scroller to the specified [x], [y] coordinates + * by applying the throw gesture with the correct velocity to end at that + * location. + * Return false if no delta needs to be applied. + */ + bool throwTo(num x, num y, + [num decelerationFactor = null]) { + reconfigure(); + final snappedTarget = _snapToBounds(x, y); + // If a deceleration factor is not specified, use the existing + // deceleration factor specified by the momentum simulator. + if (decelerationFactor == null) { + decelerationFactor = _momentum.decelerationFactor; + } + + if (snappedTarget != currentTarget) { + _momentum.abort(); + reconfigure(); + + _startDeceleration( + _momentum.calculateVelocity( + _contentOffset, + snappedTarget, + decelerationFactor), + decelerationFactor); + onDecelStart.dispatch( + EventUtil.createEvent(ScrollerEventType.DECEL_START)); + return true; + } else { + return false; + } + } + + bool throwDelta(num deltaX, num deltaY, [num decelerationFactor = null]) { + Coordinate start = _contentOffset; + Coordinate end = currentTarget; + int x = end.x.toInt(); + int y = end.y.toInt(); + // If we are throwing in the opposite direction of the existing momentum, + // cancel the current momentum. + if (deltaX != 0 && deltaX.isNegative() != (end.x - start.x).isNegative()) { + x = start.x; + } + if (deltaY != 0 && deltaY.isNegative() != (end.y - start.y).isNegative()) { + y = start.y; + } + x += deltaX.toInt(); + y += deltaY.toInt(); + return throwTo(x, y, decelerationFactor); + } + + void animateTo(num x, num y, [num duration = null, + String timingFunction = null]) { + if (duration !== null && duration != 0 + && _scrollTechnique == ScrollerScrollTechnique.TRANSFORM_3D) { + _setWebkitTransition(_element, duration, StyleUtil.TRANSFORM_STYLE, + timingFunction); + } + _setContentOffset(x, y); + } + + void setPosition(num x, num y) { + _momentum.abort(); + _contentOffset.x = x; + _contentOffset.y = y; + _snapContentOffsetToBounds(); + _setContentOffset(_contentOffset.x, _contentOffset.y); + } + /** + * Adjusted content size is a size with the combined largest height and width + * of both the content and the frame. + */ + Size _getAdjustedContentSize() { + return new Size(Math.max(_scrollSize.width, _contentSize.width), + Math.max(_scrollSize.height, _contentSize.height)); + } + + // TODO(jmesserly): these should be properties instead of get* methods + num getDefaultVerticalOffset() => _maxPoint.y; + Element getElement() => _element; + Element getFrame() => _frame; + num getHorizontalOffset() => _contentOffset.x; + + /** + * [x] Value to use as reference for percent measurement. If + * none is provided then the content's current x offset will be used. + * Returns the percent of the page scrolled horizontally. + */ + num getHorizontalScrollPercent([num x = null]) { + x = x !== null ? x : _contentOffset.x; + return (x - _minPoint.x) / (_maxPoint.x - _minPoint.x); + } + + num getMaxPointY()=> _maxPoint.y; + num getMinPointY() => _minPoint.y; + Momentum get momentum() => _momentum; + + /** + * Provide access to the touch handler that the scroller created to manage + * touch events. + */ + TouchHandler getTouchHandler() => _touchHandler; + num getVerticalOffset() => _contentOffset.y; + + /** + * [y] value is used as reference for percent measurement. If + * none is provided then the content's current y offset will be used. + */ + num getVerticalScrollPercent([num y = null]) { + y = y !== null ? y : _contentOffset.y; + return (y - _minPoint.y) / Math.max(1, _maxPoint.y - _minPoint.y); + } + + /** + * Initialize the dom elements necessary for the scrolling to work. + */ + void _initLayer() { + // The scrollable node provided to Scroller must be a direct child + // of the scrollable frame. + // TODO(jacobr): Figure out why this is failing on dartium. + // assert(_element.parent == _frame); + _setContentOffset(_maxPoint.x, _maxPoint.y); + } + + void onDecelerate(num x, num y, [num duration = 0, + String timingFunction = null]) { + // TODO(jacobr): remove once dartc fixes default args. + if (duration === null) { + duration = 0; + } + animateTo(x, y, duration, timingFunction); + } + + void onDecelerationEnd() { + _setWebkitTransition(_element, 0); + onScrollerEnd.dispatch( + EventUtil.createEvent(ScrollerEventType.SCROLLER_END)); + _started = false; + } + + void onDragEnd() { + _dragInProgress = false; + + bool decelerating = false; + if (_activeGesture) { + if (_momentumEnabled && !_activeTransition) { + decelerating = _startDeceleration(_touchHandler.getEndVelocity()); + } + } + + onScrollerDragEnd.dispatch( + EventUtil.createEvent(ScrollerEventType.DRAG_END)); + + if (!decelerating) { + _snapContentOffsetToBounds(); + onScrollerEnd.dispatch( + EventUtil.createEvent(ScrollerEventType.SCROLLER_END)); + _started = false; + } else { + onDecelStart.dispatch( + EventUtil.createEvent(ScrollerEventType.DECEL_START)); + } + _activeGesture = false; + } + + void onDragMove() { + if (_isStopping || (!_activeGesture && _dragInProgress)) { + return; + } + + assert(_contentStartOffset != null); // Content start not set + Coordinate contentStart = _contentStartOffset; + num newX = contentStart.x + _touchHandler.getDragDeltaX(); + num newY = contentStart.y + _touchHandler.getDragDeltaY(); + newY = _shouldScrollVertically() ? + _adjustValue(newY, _minPoint.y, _maxPoint.y) : 0; + newX = _shouldScrollHorizontally() ? + _adjustValue(newX, _minPoint.x, _maxPoint.x) : 0; + if (!_activeGesture) { + _activeGesture = true; + _dragInProgress = true; + } + if (!_started) { + _started = true; + onScrollerStart.dispatch( + EventUtil.createEvent(ScrollerEventType.SCROLLER_START)); + } + _setContentOffset(newX, newY); + } + + bool onDragStart(TouchEvent e) { + if (e.touches.length > 1) { + return false; + } + bool shouldHorizontal = _shouldScrollHorizontally(); + bool shouldVertical = _shouldScrollVertically(); + bool verticalish = _touchHandler.getDragDeltaY().abs() > + _touchHandler.getDragDeltaX().abs(); + return !!(shouldVertical || shouldHorizontal && !verticalish); + } + + void onTouchEnd() { + } + + /** + * Prepare the scrollable area for possible movement. + */ + bool onTouchStart(TouchEvent e) { + reconfigure(); + final touch = e.touches[0]; + if (_momentum.decelerating) { + e.preventDefault(); + e.stopPropagation(); + stop(); + } else { + _setWebkitTransition(_element, 0); + } + _contentStartOffset = _contentOffset.clone(); + _snapContentOffsetToBounds(); + return true; + } + + /** + * Transition end event handler. + */ + void onTransitionEnd(Event e) { + if (e.target == _element) { + _activeTransition = false; + _momentum.onTransitionEnd(); + } + } + + /** + * Recalculate dimensions of the frame and the content. Adjust the minPoint + * and maxPoint allowed for scrolling and scroll to a valid position. Call + * this method if you know the frame or content has been updated. Called + * internally on every touchstart event the frame receives. + */ + void reconfigure() { + _resize(); + _snapContentOffsetToBounds(); + } + + void reset() { + stop(); + _touchHandler.reset(); + _setWebkitTransition(_element, 0); + setMinOffset(0, 0); + setMaxOffset(0, 0); + reconfigure(); + _setContentOffset(_maxPoint.x, _maxPoint.y); + } + + /** + * Recalculate dimensions of the frame and the content. Adjust the minPoint + * and maxPoint allowed for scrolling. + */ + void _resize() { + _scrollSize = new Size(_frame.offsetWidth, _frame.offsetHeight); + _contentSize = _lookupContentSizeDelegate !== null ? + _lookupContentSizeDelegate() : + new Size(_element.scrollWidth, _element.scrollHeight); + Size adjusted = _getAdjustedContentSize(); + _maxPoint = new Coordinate(-_maxOffset.x, -_maxOffset.y); + _minPoint = new Coordinate( + Math.min( + _scrollSize.width - adjusted.width + _minOffset.x, _maxPoint.x), + Math.min( + _scrollSize.height - adjusted.height + _minOffset.y, _maxPoint.y)); + } + + Coordinate _snapToBounds(num x, num y) { + num clampX = GoogleMath.clamp(_minPoint.x, x, _maxPoint.x); + num clampY = GoogleMath.clamp(_minPoint.y, y, _maxPoint.y); + return new Coordinate(clampX, clampY); + } + + /** + * Translate the content to a new position specified in px. + */ + void _setContentOffset(num x, num y) { + _contentOffset.x = x; + _contentOffset.y = y; + _setOffsetFunction(_element, x, y); + onContentMoved.dispatch( + EventUtil.createEvent(ScrollerEventType.CONTENT_MOVED)); + } + + /** + * Sets the offset to subtract from the maximum coordinate that the left upper + * corner of the content can scroll to. + */ + void setMaxOffset(num x, num y) { + _maxOffset.x = x; + _maxOffset.y = y; + _resize(); + } + + /** + * Sets the offset to add to the minimum coordinate that the left upper corner + * of the content can scroll to. + */ + void setMinOffset(num x, num y) { + _minOffset.x = x; + _minOffset.y = y; + _resize(); + } + + /** + * Enable or disable momentum. + */ + void setMomentum(bool enable) { + _momentumEnabled = enable; + } + + /** + * Update the scroll technique used for animating the scrollable area. + */ + void setScrollTechnique(int technique) { + _scrollTechnique = technique; + _setOffsetFunction = _getOffsetFunction(technique); + + // The scrollable element must be relatively positioned. + assert(technique != ScrollerScrollTechnique.RELATIVE_POSITIONING || + new Css(window.getComputedStyle(_element, null)).position + != "static"); + + if (technique != ScrollerScrollTechnique.TRANSFORM_3D) { + FxUtil.clearWebkitTransition(_element); + FxUtil.clearWebkitTransform(_element); + } + if (technique != ScrollerScrollTechnique.RELATIVE_POSITIONING) { + FxUtil.setLeftAndTop(_element, 0, 0); + } + _setOffsetFunction(_element, _contentOffset.x, _contentOffset.y); + } + + /** + * Sets the vertical scrolled offset of the element where [y] is the amount + * of vertical space to be scrolled, in pixels. + */ + void setVerticalOffset(num y) { + _setContentOffset(_contentOffset.x, y); + } + + /** + * Applies a webkit transition on the element where the [duration] of the + * animation is specified in ms. + */ + void _setWebkitTransition(Element el, num duration, [String property = null, + String timingFunction = null]) { + _activeTransition = duration > 0; + FxUtil.setWebkitTransition(el, duration, property, timingFunction); + } + + /** + * Whether the scrollable area should scroll horizontally. Only + * returns true if the client has enabled horizontal scrolling, and the + * content is wider than the frame. + */ + bool _shouldScrollHorizontally() { + return horizontalEnabled && _scrollSize.width < _contentSize.width; + } + + /** + * Whether the scrollable area should scroll vertically. Only + * returns true if the client has enabled vertical scrolling. + * Vertical bouncing will occur even if frame is taller than content, because + * this is what iPhone web apps tend to do. If this is not the desired + * behavior, either disable vertical scrolling for this scroller or add a + * 'bouncing' parameter to this interface. + */ + bool _shouldScrollVertically() { + return verticalEnabled; + } + + /** + * In the event that the content is currently beyond the bounds of + * the frame, snap it back in to place. + */ + void _snapContentOffsetToBounds() { + num clampX = + GoogleMath.clamp(_minPoint.x, _contentOffset.x, _maxPoint.x); + num clampY = + GoogleMath.clamp(_minPoint.y, _contentOffset.y, _maxPoint.y); + if (_contentOffset.x != clampX || _contentOffset.y != clampY) { + _setContentOffset(clampX, clampY); + } + } + + /** + * Initiate the deceleration behavior given a flick [velocity]. + * Returns true if deceleration has been initiated. + */ + bool _startDeceleration(Coordinate velocity, + [num decelerationFactor = null]) { + if (!_shouldScrollHorizontally()) { + velocity.x = 0; + } + if (!_shouldScrollVertically()) { + velocity.y = 0; + } + assert(_minPoint != null); // Min point is not set + assert(_maxPoint != null); // Max point is not set + return _momentum.start(velocity, _minPoint, _maxPoint, _contentOffset, + decelerationFactor); + } + + Coordinate stop() { + Coordinate velocity = _momentum.stop(); + + if (_momentum.decelerating) { + CSSMatrix transform1 = StyleUtil.getCurrentTransformMatrix( + _element); + if (!_activeTransition) { + _stopDecelerating(transform1.m41, transform1.m42); + return velocity; + } + _contentOffset.x = transform1.m41; + _contentOffset.y = transform1.m42; + _isStopping = true; + window.setTimeout(() { + CSSMatrix transform2 = StyleUtil.getCurrentTransformMatrix( + _element); + _setWebkitTransition(_element, 0); + window.setTimeout(function() { _isStopping = false; }, 0); + num deltaX = transform2.m41 - transform1.m41; + num deltaY = transform2.m42 - transform1.m42; + num newX = transform2.m41 + 2 * deltaX; + num newY = transform2.m42 + 2 * deltaY; + newX = GoogleMath.clamp(newX, _minPoint.x, _maxPoint.x); + newY = GoogleMath.clamp(newY, _minPoint.y, _maxPoint.y); + _stopDecelerating(newX, newY); + }, 0); + } + return velocity; + } + + /** + * Stop the deceleration of the scrollable content given a new position in px. + */ + void _stopDecelerating(num x, num y) { + _momentum.stop(); + _setContentOffset(x, y); + } + + static Function _getOffsetFunction(int scrollTechnique) { + return scrollTechnique == ScrollerScrollTechnique.TRANSFORM_3D ? + (el, x, y) { FxUtil.setTranslate(el, x, y, 0); } : + (el, x, y) { FxUtil.setLeftAndTop(el, x, y); }; + } +} + +// TODO(jacobr): cleanup this class of enum constants. +class ScrollerEventType { + static final SCROLLER_START = "scroller:scroll_start"; + static final SCROLLER_END = "scroller:scroll_end"; + static final DRAG_END = "scroller:drag_end"; + static final CONTENT_MOVED = "scroller:content_moved"; + static final DECEL_START = "scroller:decel_start"; +} + +// TODO(jacobr): for now this ignores capture. +class SimpleEventListenerList implements EventListenerList { + // Ignores capture for now. + List _listeners; + + SimpleEventListenerList() : _listeners = new List() { } + + EventListenerList add(EventListener handler, [bool useCapture = false]) { + _add(handler, useCapture); + return this; + } + + EventListenerList remove(EventListener handler, [bool useCapture = false]) { + _remove(handler, useCapture); + return this; + } + + EventListenerList addCapture(EventListener handler) { + _add(handler, true); + return this; + } + + EventListenerList removeCapture(EventListener handler) { + _remove(handler, true); + return this; + } + + void _add(EventListener handler, bool useCapture) { + _listeners.add(handler); + } + + void _remove(EventListener handler, bool useCapture) { + // TODO(jacobr): implemenet as needed. + throw 'Not implemented yet.'; + } + + bool dispatch(Event evt) { + for (EventListener listener in _listeners) { + listener(evt); + } + } +} + +class ScrollerScrollTechnique { + static final TRANSFORM_3D = 1; + static final RELATIVE_POSITIONING = 2; +} diff --git a/client/touch/TimeUtil.dart b/client/touch/TimeUtil.dart new file mode 100644 index 00000000000..2d180bf16b4 --- /dev/null +++ b/client/touch/TimeUtil.dart @@ -0,0 +1,14 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Convenience methods for dealing with time. + * In the future this could also provide an entry point to mock out time + * calulation for tests. + */ +class TimeUtil { + static int now() { + return new DateTime.now().value; + } +} diff --git a/client/touch/TouchHandler.dart b/client/touch/TouchHandler.dart new file mode 100644 index 00000000000..fb7025bb39a --- /dev/null +++ b/client/touch/TouchHandler.dart @@ -0,0 +1,393 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Touch Handler. Class that handles all touch events and + * uses them to interpret higher level gestures and behaviors. TouchEvent is a + * built in mobile safari type: + * [http://developer.apple.com/safari/library/documentation/UserExperience/Reference/TouchEventClassReference/TouchEvent/TouchEvent.html]. + * + * Examples of higher level gestures this class is intended to support + * - click, double click, long click + * - dragging, swiping, zooming + * + * Touch Behavior: + * Use this class to make your elements 'touchable' (see Touchable.dart). + * Intended to work with all webkit browsers. + * + * Drag Behavior: + * Use this class to make your elements 'draggable' (see draggable.js). + * This behavior will handle all of the required events and report the + * properties of the drag to you while the touch is happening and at the + * end of the drag sequence. This behavior will NOT perform the actual + * dragging (redrawing the element) for you, this responsibility is left to + * the client code. This behavior contains a work around for a mobile + * safari bug where the 'touchend' event is not dispatched when the touch + * goes past the bottom of the browser window. + * This is intended to work well in iframes. + * Intended to work with all webkit browsers, tested only on iPhone 3.x so + * far. + * + * Click Behavior: + * Not yet implemented. + * + * Zoom Behavior: + * Not yet implemented. + * + * Swipe Behavior: + * Not yet implemented. + */ +class TouchHandler { + Touchable _touchable; + Element _element; + + /** The absolute sum of all touch y deltas. */ + int _totalMoveY; + + /** The absolute sum of all touch x deltas. */ + int _totalMoveX; + + /** + * A list of tuples where the first item is the horizontal component of a + * recent relevant touch and the second item is the touch's time stamp. Old + * touches are removed based on the max tracking time and when direction + * changes. + */ + List _recentTouchesX; + + /** + * A list of tuples where the first item is the vertical component of a + * recent relevant touch and the second item is the touch's time stamp. Old + * touches are removed based on the max tracking time and when direction + * changes. + */ + List _recentTouchesY; + + // TODO(jacobr): make customizable by passing optional parameters to the + // TouchHandler constructor. + /** + * Minimum movement of touch required to be considered a drag. + */ + static final _MIN_TRACKING_FOR_DRAG = 2; + + /** + * The maximum number of ms to track a touch event. After an event is older + * than this value, it will be ignored in velocity calculations. + */ + static final _MAX_TRACKING_TIME = 250; + + /** The maximum number of touches to track. */ + static final _MAX_TRACKING_TOUCHES = 5; + + /** + * The maximum velocity to return, in pixels per millisecond, that is used to + * guard against errors in calculating end velocity of a drag. This is a very + * fast drag velocity. + */ + static final _MAXIMUM_VELOCITY = 5; + + /** + * The velocity to return, in pixel per millisecond, when the time stamps on + * the events are erroneous. The browser can return bad time stamps if the + * thread is blocked for the duration of the drag. This is a low velocity to + * prevent the content from moving quickly after a slow drag. It is less + * jarring if the content moves slowly after a fast drag. + */ + static final _VELOCITY_FOR_INCORRECT_EVENTS = 1; + + Draggable _draggable; + bool _tracking; + bool _dragging; + bool _touching; + int _startTouchX; + int _startTouchY; + int _startTime; + TouchEvent _lastEvent; + int _lastTouchX; + int _lastTouchY; + int _lastMoveX; + int _lastMoveY; + int _endTime; + int _endTouchX; + int _endTouchY; + + TouchHandler(Touchable touchable, [Element element = null]) + : _touchable = touchable, + _totalMoveY = 0, + _totalMoveX = 0, + _recentTouchesX = new List(), + _recentTouchesY = new List(), + // TODO(jmesserly): I don't like having to initialize all booleans here + // See b/5045736 + _dragging = false, + _tracking = false, + _touching = false { + _element = element != null ? element : touchable.getElement(); + } + + /** + * Begin tracking the touchable element, it is eligible for dragging. + */ + void _beginTracking() { + _tracking = true; + } + + /** + * Stop tracking the touchable element, it is no longer dragging. + */ + void _endTracking() { + _tracking = false; + _dragging = false; + _totalMoveY = 0; + _totalMoveX = 0; + } + + /** + * Correct erroneous velocities by capping the velocity if we think it's too + * high, or setting it to a default velocity if know that the event data is + * bad. Returns the corrected velocity. + */ + num _correctVelocity(num velocity) { + num absVelocity = velocity.abs(); + if (absVelocity > _MAXIMUM_VELOCITY) { + absVelocity = _recentTouchesY.length < 6 ? + _VELOCITY_FOR_INCORRECT_EVENTS : _MAXIMUM_VELOCITY; + } + return absVelocity * (velocity < 0 ? -1 : 1); + } + + /** + * Start listenting for events. + * If [capture] is True the TouchHandler should listen during the capture + * phase. + */ + void enable([bool capture = false]) { + Function onEnd = (e) { _onEnd(e.timeStamp, e); }; + _addEventListeners( + _element, + (e) { _onStart(e); }, + (e) { _onMove(e); }, onEnd, onEnd, capture); + } + + /** + * Get the current horizontal drag delta. Drag delta is defined as the deltaX + * of the start touch position and the last touch position. + */ + int getDragDeltaX() { + return _lastTouchX - _startTouchX; + } + + /** + * Get the current vertical drag delta. Drag delta is defined as the deltaY of + * the start touch position and the last touch position. + */ + int getDragDeltaY() { + return _lastTouchY - _startTouchY; + } + + /** + * Get end velocity of the drag. This method is specific to drag behavior, so + * if touch behavior and drag behavior is split then this should go with drag + * behavior. End velocity is defined as deltaXY / deltaTime where deltaXY is + * the difference between endPosition and the oldest recent position, and + * deltaTime is the difference between endTime and the oldest recent time + * stamp. + */ + Coordinate getEndVelocity() { + num velocityX = 0; + num velocityY = 0; + + if (_recentTouchesX.length > 0) { + num timeDeltaX = Math.max(1, _endTime - _recentTouchesX[1]); + velocityX = (_endTouchX - _recentTouchesX[0]) / timeDeltaX; + } + + if (_recentTouchesY.length > 0) { + num timeDeltaY = Math.max(1, _endTime - _recentTouchesY[1]); + velocityY = (_endTouchY - _recentTouchesY[0]) / timeDeltaY; + } + velocityX = _correctVelocity(velocityX); + velocityY = _correctVelocity(velocityY); + return new Coordinate(velocityX, velocityY); + } + + /** + * Return the touch of the last event. + */ + Touch _getLastTouch() { + assert (_lastEvent != null); // Last event not set + return _lastEvent.touches[0]; + } + + /** + * Is the touch manager currently tracking touch moves to detect a drag? + */ + bool isTracking() { + return _tracking; + } + + /** + * Touch end handler. + */ + void _onEnd(int timeStamp, [TouchEvent e = null]) { + _touching = false; + _touchable.onTouchEnd(); + if (!_tracking || _draggable === null) { + return; + } + Touch touch = _getLastTouch(); + int clientX = touch.clientX; + int clientY = touch.clientY; + if (_dragging) { + _endTime = timeStamp; + _endTouchX = clientX; + _endTouchY = clientY; + _recentTouchesX = _removeOldTouches(_recentTouchesX, timeStamp); + _recentTouchesY = _removeOldTouches(_recentTouchesY, timeStamp); + _draggable.onDragEnd(); + if (e !== null) { + e.preventDefault(); + } + ClickBuster.preventGhostClick(_startTouchX, _startTouchY); + } + _endTracking(); + } + + /** + * Touch move handler. + */ + void _onMove(TouchEvent e) { + if (!_tracking || _draggable === null) { + return; + } + final touch = e.touches[0]; + int clientX = touch.clientX; + int clientY = touch.clientY; + int moveX = _lastTouchX - clientX; + int moveY = _lastTouchY - clientY; + _totalMoveX += moveX.abs(); + _totalMoveY += moveY.abs(); + _lastTouchX = clientX; + _lastTouchY = clientY; + if (!_dragging && + ((_totalMoveY > _MIN_TRACKING_FOR_DRAG && _draggable.verticalEnabled) || + (_totalMoveX > _MIN_TRACKING_FOR_DRAG && + _draggable.horizontalEnabled))) { + _dragging = _draggable.onDragStart(e); + if (!_dragging) { + _endTracking(); + } else { + _startTouchX = clientX; + _startTouchY = clientY; + _startTime = e.timeStamp; + } + } + if (_dragging) { + _draggable.onDragMove(); + _lastEvent = e; + e.preventDefault(); + _recentTouchesX = + _removeTouchesInWrongDirection(_recentTouchesX, _lastMoveX, moveX); + _recentTouchesY = + _removeTouchesInWrongDirection(_recentTouchesY, _lastMoveY, moveY); + _recentTouchesX = _removeOldTouches(_recentTouchesX, e.timeStamp); + _recentTouchesY = _removeOldTouches(_recentTouchesY, e.timeStamp); + _recentTouchesX.add(clientX); + _recentTouchesX.add(e.timeStamp); + _recentTouchesY.add(clientY); + _recentTouchesY.add(e.timeStamp); + } + _lastMoveX = moveX; + _lastMoveY = moveY; + } + + /** + * Touch start handler. + */ + void _onStart(TouchEvent e) { + if (_touching) { + return; + } + _touching = true; + if (!_touchable.onTouchStart(e) || _draggable === null) { + return; + } + final touch = e.touches[0]; + _startTouchX = _lastTouchX = touch.clientX; + _startTouchY = _lastTouchY = touch.clientY; + _startTime = e.timeStamp; + // TODO(jacobr): why don't we just clear the lists? + _recentTouchesX = new List(); + _recentTouchesY = new List(); + _recentTouchesX.add(touch.clientX); + _recentTouchesX.add(e.timeStamp); + _recentTouchesY.add(touch.clientY); + _recentTouchesY.add(e.timeStamp); + _lastEvent = e; + _beginTracking(); + } + + /** + * Filters the provided recent touches list to remove all touches older than + * the max tracking time or the 5th most recent touch. + * [recentTouches] specifies a list of tuples where the first item is the x + * or y component of the recent touch and the second item is the touch time + * stamp. The time of the most recent event is specified by [recentTime]. + */ + List _removeOldTouches(List recentTouches, + int recentTime) { + int count = 0; + final len = recentTouches.length; + assert (len % 2 == 0); + while (count < len && + recentTime - recentTouches[count + 1] > _MAX_TRACKING_TIME || + (len - count) > _MAX_TRACKING_TOUCHES * 2) { + count += 2; + } + return count == 0 ? recentTouches : _removeFirstN(recentTouches, count); + } + + static List _removeFirstN(List list, int n) { + return new List.fromList(list, n, list.length); + } + + /** + * Filters the provided recent touches list to remove all touches except the + * last if the move direction has changed. + * [recentTouches] specifies a list of tuples where the first item is the x + * or y component of the recent touch and the second item is the touch time + * stamp. The x or y component of the most recent move is specified by + * [recentMove]. + */ + List _removeTouchesInWrongDirection(List recentTouches, + int lastMove, int recentMove) { + if (lastMove !=0 && recentMove != 0 && recentTouches.length > 2 && + _xor(lastMove > 0, recentMove > 0)) { + return _removeFirstN(recentTouches, recentTouches.length - 2); + } + return recentTouches; + } + + // TODO(jacobr): why doesn't bool implement the xor operator directly? + static bool _xor(bool a, bool b) { + return (a === true || b === true) && !(a === true && b === true); + } + + /** + * Reset the touchable element. + */ + void reset() { + _endTracking(); + _touching = false; + } + + /** + * Call this method to enable drag behavior on a draggable delegate. + * The [draggable] object can be the same as the [_touchable] object, they are + * assigned to different members to allow for strong typing with interfaces. + */ + void setDraggable(Draggable draggable) { + _draggable = draggable; + } +} diff --git a/client/touch/TouchUtil.dart b/client/touch/TouchUtil.dart new file mode 100644 index 00000000000..1d6c160d42a --- /dev/null +++ b/client/touch/TouchUtil.dart @@ -0,0 +1,263 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Wraps a callback with translations of mouse events to touch events. Use + * this function to invoke your callback that expects touch events after + * touch events are created from the actual mouse events. + */ +EventListener mouseToTouchCallback(EventListener callback) { + return (MouseEvent e) { + var touches = []; + var targetTouches = []; + var changedTouches = []; + final mockTouch = new MockTouch(e); + final mockTouchList = [mockTouch]; + if (e.type == 'mouseup') { + changedTouches = mockTouchList; + } else { + touches = mockTouchList; + targetTouches = mockTouchList; + } + callback(new MockTouchEvent(e, touches, targetTouches, changedTouches)); + // Required to prevent spurious selection changes while tracking touches + // on devices that don't support touch events. + e.preventDefault(); + }; +} + +/** Helper method to attach event listeners to a [node]. */ +void _addEventListeners(Element node, + EventListener onStart, EventListener onMove, EventListener onEnd, + EventListener onCancel, [bool capture = false]) { + + Function removeListeners; + + onEndWrapper(e) { + removeListeners(); + return onEnd(e); + } + + onLeaveWrapper(e) { + removeListeners(); + return onEnd(e); + } + + onCancelWrapper(e) { + removeListeners(); + return onCancel(e); + } + + if (Device.supportsTouch) { + removeListeners = () { + document.on.touchMove.remove(onMove, capture); + document.on.touchEnd.remove(onEndWrapper, capture); + document.on.touchLeave.remove(onLeaveWrapper, capture); + document.on.touchCancel.remove(onCancelWrapper, capture); + }; + + node.on.touchStart.add((e) { + document.on.touchMove.add(onMove, capture); + document.on.touchEnd.add(onEndWrapper, capture); + document.on.touchLeave.add(onLeaveWrapper, capture); + document.on.touchCancel.add(onCancelWrapper, capture); + return onStart(e); + }, capture); + } else { + onStart = mouseToTouchCallback(onStart); + onMove = mouseToTouchCallback(onMove); + onEnd = mouseToTouchCallback(onEnd); + // onLeave will never be called if the device does not support touches. + + removeListeners = () { + document.on.mouseMove.remove(onMove, capture); + document.on.mouseUp.remove(onEndWrapper, capture); + document.on.touchCancel.remove(onCancelWrapper, capture); + }; + + node.on.mouseDown.add((e) { + document.on.mouseMove.add(onMove, capture); + document.on.mouseUp.add(onEndWrapper, capture); + document.on.touchCancel.add(onCancelWrapper, capture); + return onStart(e); + }, capture); + } +} + +/** + * Gets whether the given touch event targets the node, or one of the node's + * children. + */ +bool _touchEventTargetsNode(event, Node node) { + Node target = event.changedTouches[0].target; + + // TODO(rnystrom): Move this into Dom. + // Walk up the parents looking for the node. + while (target != null) { + if (target == node) { + return true; + } + target = target.parent; + } + + return false; +} + +interface Touchable { + /** + * Provide the HTML element that should respond to touch events. + */ + Element getElement(); + + /** + * The object has received a touchend event. + */ + void onTouchEnd(); + + /** + * The object has received a touchstart event. + * Returns return true if you want to allow a drag sequence to begin, + * false you want to disable dragging for the duration of this touch. + */ + bool onTouchStart(TouchEvent e); +} + +interface Draggable extends Touchable { + /** + * The object's drag sequence is now complete. + */ + void onDragEnd(); + + /** + * The object has been dragged to a new position. + */ + void onDragMove(); + + /** + * The object has started dragging. + * Returns true to allow a drag sequence to begin (custom behavior), + * false to disable dragging for this touch duration (allow native scrolling). + */ + bool onDragStart(TouchEvent e); + + bool get verticalEnabled(); + bool get horizontalEnabled(); +} + +class MockTouch implements Touch { + MouseEvent wrapped; + + MockTouch(MouseEvent this.wrapped) {} + + int get clientX() => wrapped.clientX; + + int get clientY() => wrapped.clientY; + + int get identifier() => 0; + + int get pageX() => wrapped.pageX; + + int get pageY() => wrapped.pageY; + + int get screenX() => wrapped.screenX; + + int get screenY() {return wrapped.screenY; } + + EventTarget get target() => wrapped.target; + + num get webkitForce() { throw new NotImplementedException(); } + int get webkitRadiusX() { throw new NotImplementedException(); } + int get webkitRadiusY() { throw new NotImplementedException(); } + num get webkitRotationAngle() { throw new NotImplementedException(); } +} + +class MockTouchEvent implements TouchEvent { + MouseEvent wrapped; + // TODO(jacobr): these are currently Lists instead of a TouchList. + final List touches; + final List targetTouches; + final List changedTouches; + MockTouchEvent(MouseEvent this.wrapped, List this.touches, + List this.targetTouches, + List this.changedTouches) {} + + bool get bubbles() => wrapped.bubbles; + + bool get cancelBubble() => wrapped.cancelBubble; + + void set cancelBubble(bool value) { wrapped.cancelBubble = value; } + + bool get cancelable() => wrapped.cancelable; + + EventTarget get currentTarget() => wrapped.currentTarget; + + bool get defaultPrevented() => wrapped.defaultPrevented; + + int get eventPhase() => wrapped.eventPhase; + + void set returnValue(bool value) { wrapped.returnValue = value; } + + bool get returnValue() => wrapped.returnValue; + + EventTarget get srcElement() => wrapped.srcElement; + + EventTarget get target() => wrapped.target; + + int get timeStamp() => wrapped.timeStamp; + + String get type() => wrapped.type; + + void initEvent(String eventTypeArg, bool canBubbleArg, + bool cancelableArg) { + wrapped.initEvent(eventTypeArg, canBubbleArg, cancelableArg); + } + + void preventDefault() { wrapped.preventDefault(); } + + void stopImmediatePropagation() { wrapped.stopImmediatePropagation(); } + + void stopPropagation() { wrapped.stopPropagation(); } + + int get charCode() => wrapped.charCode; + + int get detail() => wrapped.detail; + + int get keyCode() => wrapped.keyCode; + + int get layerX() => wrapped.layerX; + + int get layerY() => wrapped.layerY; + + int get pageX() => wrapped.pageX; + + int get pageY() => wrapped.pageY; + + Window get view() => wrapped.view; + + int get which() => wrapped.which; + + void initUIEvent(String type, bool canBubble, + bool cancelable, Window view, + int detail) { + wrapped.initUIEvent(type, canBubble, cancelable, view, detail); + } + + bool get altKey() => wrapped.altKey; + + bool get ctrlKey() => wrapped.ctrlKey; + + bool get metaKey() => wrapped.metaKey; + + bool get shiftKey() => wrapped.shiftKey; + + void initTouchEvent(TouchList touches, TouchList targetTouches, + TouchList changedTouches, String type, + Window view, int screenX, + int screenY, int clientX, + int clientY, bool ctrlKey, + bool altKey, bool shiftKey, + bool metaKey) { + throw "unimplemented"; + } +} diff --git a/client/touch/resources/touch.css b/client/touch/resources/touch.css new file mode 100644 index 00000000000..2e95243dd33 --- /dev/null +++ b/client/touch/resources/touch.css @@ -0,0 +1,27 @@ +/* Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file + for details. All rights reserved. Use of this source code is governed by a + BSD-style license that can be found in the LICENSE file. */ +.touch-scrollbar { + position: absolute; + background: rgba(127, 127, 127, 0.4); + -webkit-transition: opacity 300ms; + z-index: 1000; +} + +.touch-scrollbar.drag, +.touch-scrollbar:hover { + background: rgba(127, 127, 127, 0.8); +} + + +.touch-scrollbar-vertical { + height: 30px; + width: 7px; + right: 1px; +} + +.touch-scrollbar-horizontal { + width: 30px; + height: 7px; + bottom: 1px; +} diff --git a/client/touch/touch.dart b/client/touch/touch.dart new file mode 100644 index 00000000000..def4a6d9cd9 --- /dev/null +++ b/client/touch/touch.dart @@ -0,0 +1,24 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#library('touch'); + +#import('../base/base.dart'); +#import('../util/utilslib.dart'); +#import('../html/html.dart'); + +#source('BezierPhysics.dart'); +#source('FxUtil.dart'); +#source('InfiniteScroller.dart'); +#source('Momentum.dart'); +#source('Scroller.dart'); +#source('TouchHandler.dart'); +#source('ClickBuster.dart'); +#source('EventUtil.dart'); +#source('Geometry.dart'); +#source('Math.dart'); +#source('Scrollbar.dart'); +#source('ScrollWatcher.dart'); +#source('TimeUtil.dart'); +#source('TouchUtil.dart'); diff --git a/client/util/CollectionUtils.dart b/client/util/CollectionUtils.dart new file mode 100644 index 00000000000..4062212c310 --- /dev/null +++ b/client/util/CollectionUtils.dart @@ -0,0 +1,139 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +typedef num NumericValueSelector(T value); + +/** + * General purpose collection utilities. + * TODO(jmesserly): make these top level functions? + */ +class CollectionUtils { + + static void insertAt(List arr, int pos, value) { + assert (pos >= 0); + assert (pos <= arr.length); + + if (pos == arr.length) { + arr.add(value); + } else { + // TODO(sigmund): replace this push with a call that ensures capacity + // (currently not supported in the JS implementation of list). E.g. + // [: arr.length = arr.length + 1; :] + arr.add(null); + + // shift elements from [pos] (note: arr already has null @ length - 1) + for (int i = arr.length - 2; i >= pos; i--) { + arr[i + 1] = arr[i]; + } + arr[pos] = value; + + // TODO(jmesserly): we won't need to do this once List + // implements insertAt + if (arr is ObservableList) { + // TODO(jmesserly): shouldn't need to cast after testing instanceof + ObservableList obs = arr; + obs.recordListInsert(pos, value); + } + } + } + + // Collection supports most of the ES 5 list methods, but it's missing + // map. + + // TODO(jmesserly): we might want a version of this that return an iterable, + // however JS, Python and Ruby versions are all eager. + static List map(Iterable source, var mapper) { + // TODO(jmesserly): I was trying to set the capacity here, but instead it + // seems to create a fixed list. Hence assigning by index below. + List result = new List(source is List ? source.dynamic.length : null); + int i = 0; + for (final item in source) { + result[i++] = mapper(item); + } + return result; + } + + /** + * Finds the item in [source] that matches [test]. Returns null if + * no item matches. The typing should be: + * T find(Iterable source, bool test(T item)), but we don't have generic + * functions. + */ + static find(Iterable source, bool test(item)) { + for (final item in source) { + if (test(item)) return item; + } + + return null; + } + + /** Compute the minimum of an iterable. Returns null if empty. */ + static num min(Iterable source) { + final iter = source.iterator(); + if (!iter.hasNext()) { + return null; + } + num best = iter.next(); + while (iter.hasNext()) { + best = Math.min(best, iter.next()); + } + return best; + } + + /** Compute the maximum of an iterable. Returns null if empty. */ + static num max(Iterable source) { + final iter = source.iterator(); + if (!iter.hasNext()) { + return null; + } + num best = iter.next(); + while (iter.hasNext()) { + best = Math.max(best, iter.next()); + } + return best; + } + + /** Orders an iterable by its values, or by a key selector. */ + static List orderBy(Iterable source, [NumericValueSelector selector = null]) { + final result = new List.from(source); + sortBy(result, selector); + return result; + } + + /** Sorts a list by its values, or by a key selector. */ + // TODO(jmesserly): we probably don't want to call the key selector more than + // once for a given element. This would improve performance and the API + // contract could be stronger. + static void sortBy(List list, [NumericValueSelector selector = null]) { + if (selector != null) { + list.sort((x, y) => selector(x) - selector(y)); + } else { + list.sort((x, y) => x - y); + } + } + + /** Compute the sum of an iterable. An empty iterable is an error. */ + static num sum(Iterable source, [NumericValueSelector selector = null]) { + final iter = source.iterator(); + num total = 0; + if (selector != null) { + do { + total += selector(iter.next()); + } while (iter.hasNext()); + } else { + do { + total += iter.next(); + } while (iter.hasNext()); + } + return total; + } + + // TODO(jmesserly): something like should exist on Map, either a method or a + // constructor, see bug #5340679 + static void copyMap(Map dest, Map source) { + for (final k in source.getKeys()) { + dest[k] = source[k]; + } + } +} diff --git a/client/util/DateTimeUtils.dart b/client/util/DateTimeUtils.dart new file mode 100644 index 00000000000..f71e1c77323 --- /dev/null +++ b/client/util/DateTimeUtils.dart @@ -0,0 +1,171 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * General purpose date/time utilities. + */ +class DateTimeUtils { + // TODO(jmesserly): localized strings + static final WEEKDAYS = const ['Monday', 'Tuesday', 'Wednesday', 'Thursday', + 'Friday', 'Saturday', 'Sunday']; + + static final YESTERDAY = 'Yesterday'; + + static final MS_IN_WEEK = Date.DAYS_IN_WEEK * Time.MS_PER_DAY; + + // TODO(jmesserly): workaround for missing DateTime.fromDate in Dartium + // Remove this once that is implemented. See b/5055106 + // Parse a string like: "Mon, 27 Jun 2011 15:22:00 -0700" + static DateTime fromString(String text) { + final parts = text.split(' '); + if (parts.length == 1) { + return _parseIsoDateTime(text); + } + + if (parts.length != 6) { + throw 'bad date format, expected 6 parts: ' + text; + } + + // skip parts[0], the weekday + + int day = Math.parseInt(parts[1]); + + final months = const['Jan', 'Feb', 'Mar', 'Apr', + 'May', 'Jun', 'Jul', 'Aug', + 'Sep', 'Oct', 'Nov', 'Dec']; + int month = months.indexOf(parts[2], 0) + 1; + if (month < 0) { + throw 'bad month, expected 3 letter month code, got: ' + parts[2]; + } + + int year = Math.parseInt(parts[3]); + + final timeParts = parts[4].split(':'); + if (timeParts.length != 3) { + throw 'bad time format, expected 3 parts: ' + parts[4]; + } + + int hours = Math.parseInt(timeParts[0]); + int minutes = Math.parseInt(timeParts[1]); + int seconds = Math.parseInt(timeParts[2]); + + // TODO(jmesserly): TimeZone is not implemented in Dartium. This ugly + // hack applies the timezone from the string to the final time + int zoneOffset = Math.parseInt(parts[5]) ~/ 100; + + // Pretend it's a UTC time + DateTime result = new DateTime.withTimeZone( + year, month, day, hours, minutes, seconds, 0, new TimeZone.utc()); + // Shift it to the proper zone, but it's still a UTC time + result = result.subtract(new Time(0, zoneOffset, 0, 0, 0)); + // Then render it as a local time + return result.changeTimeZone(new TimeZone.local()); + } + + /** Parse a string like: 2011-07-19T22:03:04.000Z */ + // TODO(jmesserly): workaround for DateTime.fromDate, which has issues: + // * on Dart VM it doesn't handle all of ISO 8601. See b/5055106. + // * on DartC it doesn't work on Safari. See b/5062557. + // Remove this once that function is fully implemented + static DateTime _parseIsoDateTime(String text) { + void ensure(bool value) { + if (!value) { + throw 'bad date format, expected YYYY-MM-DDTHH:MM:SS.mmmZ: ' + text; + } + } + + TimeZone zone; + if (text.endsWith('Z')) { + text = text.substring(0, text.length - 1); + zone = new TimeZone.utc(); + } else { + zone = new TimeZone.local(); + } + + final parts = text.split('T'); + ensure(parts.length == 2); + + final date = parts[0].split('-'); + ensure(date.length == 3); + + final time = parts[1].split(':'); + ensure(time.length == 3); + + final seconds = time[2].split('.'); + ensure(seconds.length >= 1 && seconds.length <= 2); + int milliseconds = 0; + if (seconds.length == 2) { + milliseconds = Math.parseInt(seconds[1]); + } + + return new DateTime.withTimeZone( + Math.parseInt(date[0]), + Math.parseInt(date[1]), + Math.parseInt(date[2]), + Math.parseInt(time[0]), + Math.parseInt(time[1]), + Math.parseInt(seconds[0]), + milliseconds, + zone); + } + + /** + * A date/time formatter that takes into account the current date/time: + * - if it's from today, just show the time + * - if it's from yesterday, just show 'Yesterday' + * - if it's from the same week, just show the weekday + * - otherwise, show just the date + */ + static String toRecentTimeString(DateTime then) { + final now = new DateTime.now(); + if (then.date == now.date) { + return toHourMinutesString(then.time); + } + + final today = new DateTime(now.year, now.month, now.day, 0, 0, 0, 0); + Time delta = today.difference(then); + if (delta.duration < Time.MS_PER_DAY) { + return YESTERDAY; + } else if (delta.duration < MS_IN_WEEK) { + return WEEKDAYS[getWeekday(then)]; + } else { + // TODO(jmesserly): locale specific date format + return then.date.toString(); + } + } + + // TODO(jmesserly): this is a workaround for unimplemented DateTime.weekday + // Code inspired by v8/src/date.js + static int getWeekday(DateTime dateTime) { + final unixTimeStart = new DateTime(1970, 1, 1, 0, 0, 0, 0); + int msSince1970 = dateTime.difference(unixTimeStart).duration; + int daysSince1970 = msSince1970 ~/ Time.MS_PER_DAY; + // 1970-1-1 was Thursday + return ((daysSince1970 + Date.THU) % Date.DAYS_IN_WEEK); + } + + /** Formats a time in H:MM A format */ + // TODO(jmesserly): should get 12 vs 24 hour clock setting from the locale + static String toHourMinutesString(Time time) { + int hours = time.hours; + String a; + if (hours >= 12) { + a = 'pm'; + if (hours != 12) { + hours -= 12; + } + } else { + a = 'am'; + if (hours == 0) { + hours += 12; + } + } + String twoDigits(int n) { + if (n >= 10) return "${n}"; + return "0${n}"; + } + String mm = twoDigits(time.minutes); + return "${hours}:${mm} ${a}"; + } +} diff --git a/client/util/StringUtils.dart b/client/util/StringUtils.dart new file mode 100644 index 00000000000..870a3fb8855 --- /dev/null +++ b/client/util/StringUtils.dart @@ -0,0 +1,32 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * General purpose string manipulation utilities. + */ +class StringUtils { + /** + * Returns either [str], or if [str] is null, the value of [defaultStr]. + */ + static String defaultString(String str, [String defaultStr='']) { + return str === null ? defaultStr : str; + } + + /** Parse string to a double, and handle null intelligently */ + static double parseDouble(String str, [double ifNull = null]) { + return (str == null) ? ifNull : Math.parseDouble(str); + } + + /** Parse string to a int, and handle null intelligently */ + static int parseInt(String str, [int ifNull = null]) { + return (str == null) ? ifNull : Math.parseInt(str); + } + + /** Parse bool to a double, and handle null intelligently */ + // TODO(jacobr): corelib should have a boolean parsing method + static bool parseBool(String str, [bool ifNull = null]) { + assert(str == null || str == 'true' || str == 'false'); + return (str == null) ? ifNull : (str == 'true'); + } +} diff --git a/client/util/Uri.dart b/client/util/Uri.dart new file mode 100644 index 00000000000..cd50e3c994c --- /dev/null +++ b/client/util/Uri.dart @@ -0,0 +1,145 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * A parsed URI, inspired by: + * http://closure-library.googlecode.com/svn/docs/class_goog_Uri.html + */ +class Uri { + /** + * Parses a URL query string into a map. Because you can have multiple values + * for the same parameter name, each parameter name maps to a list of + * values. For example, '?a=b&c=d&a=e' would be parsed as + * [{'a':['b','e'],'c':['d']}]. + */ + // TODO(jmesserly): consolidate with new Uri.fromString(...) + static Map> parseQuery(String queryString) { + final queryParams = new Map>(); + if (queryString.startsWith('?')) { + final params = queryString.substring(1, queryString.length).split('&'); + for (final param in params) { + List parts = param.split('='); + if (parts.length == 2) { + // TODO(hiltonc) the name and value should be URL decoded. + String name = parts[0]; + String value = parts[1]; + + // Create a list of values for this name if not yet done. + List values = queryParams[name]; + if (values === null) { + values = new List(); + queryParams[name] = values; + } + + values.add(value); + } + } + } + return queryParams; + } + + /** + * Percent-encodes a string for use as a query parameter in a URI. + */ + // TODO(rnystrom): Get rid of this when the real encodeURIComponent() + // function is available within Dart. + static String encodeComponent(String component) { + if (component == null) return component; + + // TODO(terry): Added b/5096547 to track replace should by default behave + // like replaceAll to avoid a problematic usage pattern. + return component.replaceAll(':', '%3A') + .replaceAll('/', '%2F') + .replaceAll('?', '%3F') + .replaceAll('=', '%3D') + .replaceAll('&', '%26') + .replaceAll(' ', '%20'); + } + + /** + * Decodes a string used a query parameter by replacing percent-encoded + * sequences with their original characters. + */ + // TODO(jmesserly): replace this with a better implementation + static String decodeComponent(String component) { + if (component == null) return component; + + return component.replaceAll('%3A', ':') + .replaceAll('%2F', '/') + .replaceAll('%3F', '?') + .replaceAll('%3D', '=') + .replaceAll('%26', '&') + .replaceAll('%20', ' '); + } + + String scheme; + String userInfo; + String domain; + int port; + String path; + String query; + String fragment; + + Uri.fromString(String uri) { + final m = _splitRe.firstMatch(uri); + + scheme = _decodeOrEmpty(m[_COMPONENT_SCHEME]); + userInfo = _decodeOrEmpty(m[_COMPONENT_USER_INFO]); + domain = _decodeOrEmpty(m[_COMPONENT_DOMAIN]); + port = _parseIntOrZero(m[_COMPONENT_PORT]); + path = _decodeOrEmpty(m[_COMPONENT_PATH]); + query = _decodeOrEmpty(m[_COMPONENT_QUERY_DATA]); + fragment = _decodeOrEmpty(m[_COMPONENT_FRAGMENT]); + } + + static String _decodeOrEmpty(String val) { + // TODO(jmesserly): use Uri.decodeComponent when available + //return val ? Uri.decodeComponent(val) : ''; + return val != null ? val : ''; + } + + static int _parseIntOrZero(String val) { + if (val !== null && val != '') { + return Math.parseInt(val); + } else { + return 0; + } + } + + // NOTE: This code was ported from: closure-library/closure/goog/uri/utils.js + static RegExp _splitReLazy; + + static RegExp get _splitRe() { + if (_splitReLazy == null) { + _splitReLazy = new RegExp( + '^' + + '(?:' + + '([^:/?#.]+)' + // scheme - ignore special characters + // used by other URL parts such as :, + // ?, /, #, and . + ':)?' + + '(?://' + + '(?:([^/?#]*)@)?' + // userInfo + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + + // domain - restrict to letters, + // digits, dashes, dots, percent + // escapes, and unicode characters. + '(?::([0-9]+))?' + // port + ')?' + + '([^?#]+)?' + // path + '(?:\\?([^#]*))?' + // query + '(?:#(.*))?' + // fragment + '\$', ''); + } + return _splitReLazy; + } + + static final _COMPONENT_SCHEME = 1; + static final _COMPONENT_USER_INFO = 2; + static final _COMPONENT_DOMAIN = 3; + static final _COMPONENT_PORT = 4; + static final _COMPONENT_PATH = 5; + static final _COMPONENT_QUERY_DATA = 6; + static final _COMPONENT_FRAGMENT = 7; +} diff --git a/client/util/utilslib.dart b/client/util/utilslib.dart new file mode 100644 index 00000000000..de2881caaf7 --- /dev/null +++ b/client/util/utilslib.dart @@ -0,0 +1,12 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#library('utilslib'); + +#import('../observable/observable.dart'); + +#source('CollectionUtils.dart'); +#source('DateTimeUtils.dart'); +#source('StringUtils.dart'); +#source('Uri.dart'); diff --git a/client/view/CompositeView.dart b/client/view/CompositeView.dart new file mode 100644 index 00000000000..c31c87aeacd --- /dev/null +++ b/client/view/CompositeView.dart @@ -0,0 +1,83 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * A View that is composed of child views. + */ +class CompositeView extends View { + + List childViews; + + // TODO(rnystrom): Allowing this to be public is gross. CompositeView should + // encapsulate its markup and provide accessors to do the limited amount of + // things that external users need to access this for. + Element container; + + Scroller scroller; + Scrollbar _scrollbar; + + final String _cssName; + final bool _scrollable; + final bool _vertical; + final bool _nestedContainer; + final bool _showScrollbar; + + CompositeView(String this._cssName, [this._nestedContainer = false, + this._scrollable = false, this._vertical = false, + this._showScrollbar = false]) + : super(), + childViews = new List() { + } + + Element render() { + Element node = new Element.html('
'); + + if (_nestedContainer) { + container = new Element.html('
'); + node.nodes.add(container); + } else { + container = node; + } + + if (_scrollable) { + scroller = new Scroller(container, + _vertical /* verticalScrollEnabled */, + !_vertical /* horizontalScrollEnabled */, + true /* momementumEnabled */); + if (_showScrollbar) { + _scrollbar = new Scrollbar(scroller); + } + } + + for (View childView in childViews) { + container.nodes.add(childView.node); + } + + return node; + } + + void afterRender(Element node) { + if (_scrollbar !== null) { + _scrollbar.initialize(); + } + } + + View addChild(View view) { + childViews.add(view); + // TODO(rnystrom): Container shouldn't be null. Remove this check. + if (container !== null) { + container.nodes.add(view.node); + } + childViewAdded(view); + return view; + } + + void removeChild(View view) { + childViews = childViews.filter(bool _(e) { return view != e; }); + // TODO(rnystrom): Container shouldn't be null. Remove this check. + if (container !== null) { + view.node.remove(); + } + } +} diff --git a/client/view/ConveyorView.dart b/client/view/ConveyorView.dart new file mode 100644 index 00000000000..a878bfef86d --- /dev/null +++ b/client/view/ConveyorView.dart @@ -0,0 +1,98 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/** + * Holds a number of child views. As you switch between views, the old + * view is pushed off to the side and the new view slides in from the other + * side. + */ +class ConveyorView extends CompositeView { + // TODO(jmesserly): some places use this property to know when the slide + // transition is finished. It would be better to have an event that fires + // when we're done sliding + static final ANIMATE_SECONDS = 0.5; + + View targetView; + // TODO(rnystrom): Should not be settable. + View selectedView; + // TODO(rnystrom): Hackish. Should use a real multicast event-like class. + // Or just have it depend on an Observable to select a view and indicate + // which view is selected? (e.g. the MVVM pattern) + Function viewSelected; + + int animationTimeoutId; + + ConveyorView() + : super('conveyor-view', true), + animationTimeoutId = null { + } + + Element render() { + final result = super.render(); + // TODO(rnystrom): Have to do this in render() because container doesn't + // exist before then. Hack. Should find a cleaner solution. One of: + // - Add a ctor param to CompositeView for container class name. + // - Make ConveyorView contain a CompositeView instead of subclass. + // - Add method to CompositeView to set class name. + container.attributes['class'] = 'conveyor-view-container'; + return result; + } + + void selectView(View targetView, [bool animate = true]) { + selectedView = targetView; + + // Only animate if we're actually in the document now. + if (isRendered) { + adjustOffset(animate); + } + } + + void adjustOffset(bool animate) { + int index = getIndexOfSelectedView(); + final durationSeconds = animate ? ANIMATE_SECONDS : 0.0; + + final style = container.style; + // TODO(jacobr): modify setTransitionDuration so the input is always + // specified in miliseconds rather than accepting a string. + Css.setTransitionDuration(style, '${durationSeconds}s'); + final xTranslationPercent = -index * 100; + Css.setTransform(style, 'translate3d(${xTranslationPercent}%, 0px, 0px)'); + + if (animationTimeoutId != null) { + window.clearTimeout(animationTimeoutId); + } + + if (animate) { + animationTimeoutId = window.setTimeout( + () { _onAnimationEnd(); }, (durationSeconds * 1000).toInt()); + } + // TODO(mattsh), we should set the visibility to hide everything but the + // selected view. + } + + int getIndexOfSelectedView() { + for (int i = 0; i < childViews.length; i++) { + if (childViews[i] == selectedView) { + return i; + } + } + throw "view not found"; + } + + /** + * Adds a child view to the ConveyorView. The views are stacked horizontally + * in the order they are added. + */ + View addChild(View view) { + view.addClass('conveyor-item'); + view.transform = 'translate3d(' + (childViews.length * 100) + '%, 0, 0)'; + return super.addChild(view); + } + + void _onAnimationEnd() { + if (viewSelected != null) { + viewSelected(selectedView); + } + } +} diff --git a/client/view/MeasureText.dart b/client/view/MeasureText.dart new file mode 100644 index 00000000000..babdc79c602 --- /dev/null +++ b/client/view/MeasureText.dart @@ -0,0 +1,160 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// TODO(jacobr): handle splitting lines on symbols such as '-' that aren't +// whitespace but are valid word breaking points. +/** + * Utility class to efficiently word break and measure text without requiring + * access to the DOM. + */ +class MeasureText { + static CanvasRenderingContext2D _context; + + final String font; + num _spaceLength; + num _typicalCharLength; + + static final String ELLIPSIS = '...'; + + MeasureText(this.font) { + if (_context === null) { + CanvasElement canvas = new Element.tag('canvas'); + _context = canvas.getContext('2d'); + } + if (_spaceLength === null) { + _context.font = font; + _spaceLength = _context.measureText(' ').width; + _typicalCharLength = _context.measureText('k').width; + } + } + + // TODO(jacobr): we are DOA for i18N... + // the right solution is for the server to send us text perparsed into words + // perhaps even with hints on the guess for the correct breaks so on the + // client all we have to do is verify and fix errors rather than perform the + // full calculation. + static bool isWhitespace(String character) { + return character == ' ' || character == '\t' || character == '\n'; + } + + num get typicalCharLength() { + return _typicalCharLength; + } + + String quickTruncate(String text, num lineWidth, int maxLines) { + int targetLength = (lineWidth * maxLines / _typicalCharLength).toInt(); + // Advance to next word break point. + while(targetLength < text.length && !isWhitespace(text[targetLength])) { + targetLength++; + } + + if (targetLength < text.length) { + return text.substring(0, targetLength) + ELLIPSIS; + } else { + return text; + } + } + + /** + * Add line broken text as text nodes separated by
elements. + * Returns the number of lines in the output. + * This function is safe to call with [:element === null:] in which case the + * line count is returned but no DOM manipulation occurs. + */ + int addLineBrokenText(Element element, String text, num lineWidth, + int maxLines) { + // Strip surrounding whitespace. This ensures we create zero lines if there + // is no visible text. + text = text.trim(); + + // We can often avoid performing a full line break calculation when only + // the number of lines and not the actual linebreaks is required. + if (element === null) { + _context.font = font; + int textWidth = _context.measureText(text).width.toInt(); + // By the pigeon hole principle, the resulting text will require at least + // maxLines if the raw text is longer than the amount of text that will + // fit on maxLines - 1. We add the length of a whitespace + // character to the lineWidth as each line is separated by a whitespace + // character. We assume all whitespace characters have the same length. + if (textWidth >= (lineWidth + _spaceLength) * (maxLines - 1)) { + return maxLines; + } else if (textWidth == 0) { + return 0; + } else if (textWidth < lineWidth) { + return 1; + } + // Fall through to the regular line breaking calculation as the number + // of lines required is unclear. + } + int lines = 0; + lineBreak(text, lineWidth, maxLines, (int start, int end, num width) { + lines++; + if (lines == maxLines) { + // Overflow case... there may be more lines of text than we can handle. + // Add a few characters to the last line so that the browser will + // render ellipses correctly. + // TODO(jacobr): make this optional and only add characters until + // the first whitespace character encountered. + end = Math.min(end + 50, text.length); + } + if (element !== null) { + if (lines > 1) { + element.nodes.add(new Element.tag('br')); + } + element.nodes.add(new Text(text.substring(start, end))); + } + }); + return lines; + } + + void lineBreak(String text, num lineWidth, int maxLines, + Function callback) { + _context.font = font; + int lines = 0; + num currentLength = 0; + int startIndex = 0; + int wordStartIndex = null; + int lastWordEndIndex = null; + bool lastWhitespace = true; + // TODO(jacobr): optimize this further. + // To simplify the logic, we simulate injecting a whitespace character + // at the end of the string. + for (int i = 0, len = text.length; i <= len; i++) { + // Treat the char after the end of the string as whitespace. + bool whitespace = i == len || isWhitespace(text[i]); + if (whitespace && !lastWhitespace) { + num wordLength = _context.measureText(text.substring( + wordStartIndex, i)).width; + // TODO(jimhug): Replace the line above with this one to workaround + // dartium bug - error: unimplemented code + // num wordLength = (i - wordStartIndex) * 17; + currentLength += wordLength; + if (currentLength > lineWidth) { + // Edge case: + // It could be the very first word we ran into was too long for a + // line in which case we let it have its own line. + if (lastWordEndIndex !== null) { + lines++; + callback(startIndex, lastWordEndIndex, currentLength - wordLength); + } + if (lines == maxLines) { + return; + } + startIndex = wordStartIndex; + currentLength = wordLength; + } + lastWordEndIndex = i; + currentLength += _spaceLength; + wordStartIndex = null; + } else if (wordStartIndex === null && !whitespace) { + wordStartIndex = i; + } + lastWhitespace = whitespace; + } + if (currentLength > 0) { + callback(startIndex, text.length, currentLength); + } + } +} diff --git a/client/view/PagedViews.dart b/client/view/PagedViews.dart new file mode 100644 index 00000000000..91428344232 --- /dev/null +++ b/client/view/PagedViews.dart @@ -0,0 +1,268 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +class PageState { + final ObservableValue current; + final ObservableValue target; + final ObservableValue length; + PageState() : + current = new ObservableValue(0), + target = new ObservableValue(0), + length = new ObservableValue(1); +} + +/** Simplifies using a PageNumberView and PagedColumnView together. */ +class PagedContentView extends CompositeView { + final View content; + final PageState pages; + + PagedContentView(this.content) + : super('paged-content'), + pages = new PageState() { + addChild(new PagedColumnView(pages, content)); + addChild(new PageNumberView(pages)); + } +} + +/** Displays current page and a left/right arrow. Used with [PagedColumnView] */ +class PageNumberView extends View { + final PageState pages; + Element _label; + Element _left, _right; + + PageNumberView(this.pages) : super(); + + Element render() { + // TODO(jmesserly): this was supposed to use the somewhat flatter unicode + // glyphs that Chrome uses on the new tab page, but the text is getting + // corrupted. + final node = new Element.html(''' +
+
+
+
+
+ '''); + _left = node.queryOne('.page-number-left'); + _label = node.queryOne('.page-number-label'); + _right = node.queryOne('.page-number-right'); + return node; + } + + void enterDocument() { + watch(pages.current, (s) => _update()); + watch(pages.length, (s) => _update()); + + _left.on.click.add((e) { + if (pages.current.value > 0) { + pages.target.value = pages.current.value - 1; + } + }); + + _right.on.click.add((e) { + if (pages.current.value + 1 < pages.length.value) { + pages.target.value = pages.current.value + 1; + } + }); + } + + void _update() { + _label.text = '${pages.current.value + 1} of ${pages.length.value}'; + } +} + +/** + * A horizontal scrolling view that snaps to items like [ConveyorView], but only + * has one child. Instead of scrolling between views, it scrolls between content + * that flows horizontally in columns. Supports left/right swipe to switch + * between pages. Can also be used with [PageNumberView]. + * + * This control assumes that it is styled with fixed or percent width and + * height, so the content will flow out horizontally. This allows it to compute + * the number of pages using [:scrollWidth:] and [:offsetWidth:]. + */ +class PagedColumnView extends View { + + static final MIN_THROW_PAGE_FRACTION = 0.01; + final View contentView; + + final PageState pages; + + Element _container; + int _columnGap, _columnWidth; + int _viewportSize; + Scroller scroller; + + PagedColumnView(this.pages, this.contentView) : super(); + + Element render() { + final node = new Element.html(''' +
+
+
'''); + _container = node.queryOne('.paged-column-container'); + _container.nodes.add(contentView.node); + + // TODO(jmesserly): if we end up with empty columns on the last page, + // this causes the last page to end up right justified. But it seems to + // work reasonably well for both clicking and throwing. So for now, leave + // the scroller configured the default way. + + // TODO(jacobr): use named arguments when available. + scroller = new Scroller( + _container, + false /* verticalScrollEnabled */, + true /* horizontalScrollEnabled */, + true /* momementumEnabled */, + () => new Size(_viewLength, 1), // Only view width matters. + Scroller.FAST_SNAP_DECELERATION_FACTOR); + + scroller.onDecelStart.add(_snapToPage); + scroller.onScrollerDragEnd.add(_snapToPage); + scroller.onContentMoved.add(_onContentMoved); + return node; + } + + int get _viewLength() => _computePageSize() * pages.length.value; + + // TODO(jmesserly): would be better to not have this code in enterDocument. + // But we need getComputedStyles to read our CSS properties. + void enterDocument() { + _computeColumnGap(); + + // Trigger a fake resize event so we measure our height. + windowResized(); + + // Hook img onload events, so we find out about changes in content size + for (ImageElement img in contentView.node.query("img")) { + if (!img.complete) { + img.on.load.add((e) { + _updatePageCount(); + }); + } + } + + // If the selected page changes, animate to it. + watch(pages.target, (s) => _onPageSelected()); + watch(pages.length, (s) => _onPageSelected()); + } + + /** Read the column-gap setting so we know how far to translate the child. */ + void _computeColumnGap() { + final style = window.getComputedStyle(contentView.node, ''); + String gap = Css.getColumnGap(style); + if (gap == 'normal') { + gap = Css.getFontSize(style); + } + _columnGap = _toPixels(gap, 'column-gap or font-size'); + _columnWidth = _toPixels(Css.getColumnWidth(style), 'column-width'); + } + + static int _toPixels(String value, String message) { + // TODO(jmesserly): Safari 4 has a bug where this property does not end + // in "px" like it should, but the value is correct. Handle that gracefully. + if (value.endsWith('px')) { + value = value.substring(0, value.length - 2); + } + return Math.parseDouble(value).round().toInt(); + } + + /** Watch for resize and update page count. */ + void windowResized() { + // TODO(jmesserly): verify we aren't triggering unnecessary layouts. + + // The content needs to have its height explicitly set, or columns don't + // flow to the right correctly. So we copy our own height and set the height + // of the content. + Css.setHeight(contentView.node.style, '${node.offsetHeight}px'); + + _updatePageCount(); + scroller.reconfigure(); + // TODO(jacobr): calling snapToPage here is overkill. + _snapToPage(null); + } + + bool _updatePageCount() { + int pageLength = 1; + if (_container.scrollWidth > _container.offsetWidth) { + pageLength = (_container.scrollWidth / _computePageSize()).ceil().toInt(); + } + pageLength = Math.max(pageLength, 1); + + int oldPage = pages.target.value; + int newPage = Math.min(oldPage, pageLength - 1); + + // Hacky: make sure a change event always fires. + // This is so we adjust the 3d transform after resize. + if (oldPage == newPage) { + pages.target.value = 0; + } + assert(newPage < pageLength); + pages.target.value = newPage; + pages.length.value = pageLength; + } + + void _onContentMoved(Event e) { + num current = scroller.contentOffset.x; + int pageSize = _computePageSize(); + pages.current.value = -(current / pageSize).round().toInt(); + } + + void _snapToPage(Event e) { + num current = scroller.contentOffset.x; + num currentTarget = scroller.currentTarget.x; + int pageSize = _computePageSize(); + int destination; + num currentPageNumber = -(current / pageSize).round(); + num pageNumber = -currentTarget / pageSize; + if (current == currentTarget) { + // User was just static dragging so round to the nearest page. + pageNumber = pageNumber.round(); + } else { + if (currentPageNumber == pageNumber.round() && + (pageNumber - currentPageNumber).abs() > MIN_THROW_PAGE_FRACTION && + -current + _viewportSize < _viewLength && current < 0) { + // The user is trying to throw so we want to round up to the + // nearest page in the direction they are throwing. + pageNumber = currentTarget < current + ? currentPageNumber + 1 : currentPageNumber - 1; + } else { + pageNumber = pageNumber.round(); + } + } + pageNumber = pageNumber.toInt(); + num translate = -pageNumber * pageSize; + pages.current.value = pageNumber; + if (currentTarget != translate) { + scroller.throwTo(translate, 0); + } else { + // Update the target page number when we are done animating. + pages.target.value = pageNumber; + } + } + + int _computePageSize() { + // Hacky: we need to duplicate the way the columns are being computed, + // including rounding, to figure out how far to translate the div. + // See http://www.w3.org/TR/css3-multicol/#column-width + _viewportSize = _container.offsetWidth; + + // Figure out how many columns we're rendering. + // The algorithm ensures we're bigger than the specified min size. + int perPage = Math.max(1, + (_viewportSize + _columnGap) ~/ (_columnWidth + _columnGap)); + + // Divide up the viewport between the columns. + int columnSize = (_viewportSize - (perPage - 1) * _columnGap) ~/ perPage; + + // Finally, compute how big each page is, and how far to translate. + return perPage * (columnSize + _columnGap); + } + + void _onPageSelected() { + int translate = -pages.target.value * _computePageSize(); + scroller.reconfigure(); + scroller.throwTo(translate, 0); + } +} diff --git a/client/view/SliderMenu.dart b/client/view/SliderMenu.dart new file mode 100644 index 00000000000..8b940871953 --- /dev/null +++ b/client/view/SliderMenu.dart @@ -0,0 +1,170 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +typedef void SelectHandler(String menuText); + +/** + * This implements a horizontal menu bar with a sliding triangle arrow + * that points at the currently selected item. + */ +class SliderMenu extends View { + static final int TRIANGLE_WIDTH = 24; + + // currently selected menu item + Element selectedItem; + + // This holds the element where a touchstart occured. (This is set + // in touchstart, and cleared in touchend.) If this is null, then a + // touch operation is not in progress. + // TODO(mattsh) - move this to a touch mixin + Element touchItem; + + /** + * Callback function that we call when the user chooses something from + * the menu. This is passed the menu item text. + */ + SelectHandler onSelect; + + List _menuItems; + + SliderMenu(this._menuItems, this.onSelect) : super() {} + + Element render() { + // Create a div for each menu item. + final items = new StringBuffer(); + for (final item in _menuItems) { + items.add('
$item
'); + } + + // Create a root node to hold this view. + return new Element.html(''' +
+
+
+ $items +
+
+
+
+
+
+ '''); + } + + void enterDocument() { + // select the first item + // todo(jacobr): too much actual work is performed in enterDocument. + // Ideally, enterDocument should do nothing more than redecorate a view + // and perhaps calculating the correct child sizes for edge cases that + // cannot be handled by the browser layout engine. + selectItem(node.queryOne('.sm-item'), false); + + // TODO(mattsh), abstract this somehow into a touch click mixin + if (Device.supportsTouch) { + node.on.touchStart.add((event) { + touchItem = itemOfTouchEvent(event); + if (touchItem != null) { + selectItemText(touchItem); + } + event.preventDefault(); + }); + node.on.touchEnd.add((event) { + if (touchItem != null) { + if (itemOfTouchEvent(event) == touchItem) { + selectItem(touchItem, true); + } else { + // the Touch target is somewhere other where than the touchstart + // occured, so revert the selected menu text back to where it was + // before the touchstart, + selectItemText(selectedItem); + } + // touch operation has ended + touchItem = null; + } + event.preventDefault(); + }); + } else { + node.on.click.add((event) => selectItem(event.target, true)); + } + + window.on.resize.add((Event event) => updateIndicator(false)); + } + + /** + * Walks the parent chain of the first Touch target to find the first ancestor + * that has sm-item class. + */ + Element itemOfTouchEvent(event) { + Node node = event.changedTouches[0].target; + return itemOfNode(node); + } + + Element itemOfNode(Node node) { + // TODO(jmesserly): workaround for bug 5399957, document.parent == document + while (node != null && node != document) { + if (node is Element) { + Element element = node; + if (element.classes.contains('sm-item')) { + return element; + } + } + node = node.parent; + } + return null; + } + + void selectItemText(Element item) { + // unselect all menu items + for (final sliderItem in node.query('.sm-item')) { + sliderItem.classes.remove('sel'); + } + + // select the item the user clicked on + item.classes.add('sel'); + } + + void selectItem(Element item, bool animate) { + if (!item.classes.contains('sm-item')) { + return; + } + + selectedItem = item; + selectItemText(item); + updateIndicator(animate); + onSelect(item.text); + } + + void selectNext(bool animate) { + final result = node.queryOne('.sm-item.sel').nextElementSibling; + if (result != null) { + selectItem(result, animate); + } + } + + void selectPrevious(bool animate) { + final result = node.queryOne('.sm-item.sel').previousElementSibling; + if (result != null) { + selectItem(result, animate); + } + } + + /** + * animate - if true, then animate the movement of the triangle slider + */ + void updateIndicator(bool animate) { + num x = 0; + if (selectedItem != null) { + // calculate where we want to put the triangle + x = selectedItem.offsetLeft + + selectedItem.offsetWidth / 2 - TRIANGLE_WIDTH / 2; + } + + // find the slider filler (the div element to the left of the + // triangle) set its width the push the triangle to where we want it. + String duration = animate ? '.3s' : '0s'; + final triangle = node.queryOne('.sm-triangle'); + Css.setTransitionDuration(triangle.style, duration); + FxUtil.setWebkitTransform(triangle, x, 0); + } +} diff --git a/client/view/resources/view.css b/client/view/resources/view.css new file mode 100644 index 00000000000..f211383d1f4 --- /dev/null +++ b/client/view/resources/view.css @@ -0,0 +1,174 @@ +/* Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file */ +/* for details. All rights reserved. Use of this source code is governed by a */ +/* BSD-style license that can be found in the LICENSE file. */ + +/* CSS styes needed by reusable views */ + +/* TODO(mattsh), need to figure out what we're doing here. +In particular: + 1. How to allow apps to include this CSS without messing their own styles + (possibly we should use a 'appstack framework' prefix or something to + keep from polluting the CSS namespace). + 2. Need to figure out how to make the appstack widgets and views themeable, so + possibly this file needs to be generated by a theme builder designer tool. +*/ + +.hbox, +.vbox { + display: -moz-box; + display: -webkit-box; + -moz-box-align: stretch; + -webkit-box-align: stretch; + overflow: hidden; +} + +.vbox { + -moz-box-orient: vertical; + -webkit-box-orient: vertical; +} + +.hbox { + -moz-box-orient: horizontal; + -webkit-box-orient: horizontal; +} + +.center { + -moz-box-pack: center; + -webkit-box-pack: center; +} + +.paged-content, +.fullpage { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + overflow: hidden; +} + +.flex-item { + -webkit-box-flex: 1; + -moz-box-flex: 1; + box-flex: 1; +} + +.flex { + -moz-box-flex: 1; + -webkit-box-flex: 1; +} + +.conveyor-view, +.conveyor-item { + overflow: hidden; + left: 0; + right: 0; + top: 0; + bottom: 0; +} + +/* +TODO(jacobr): can we get translate3d working in paged-column and +conveyor-view without setting "overflow: visible"? +*/ +.conveyor-view-container { + overflow: visible; + position: absolute; + width: 100%; + height: 100%; +} + +.paged-column-container { + overflow: visible; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; +} + +.paged-column { + overflow: hidden; +} + +.page-number-left, +.page-number-label, +.page-number-right { + display: inline-block; +} +.page-number-left, .page-number-right { + cursor: pointer; +} + +/* Slider menu (a menu bar with a sliding triangle underneath it) */ + +/* one menu item text */ +.sm-item { + font-size: 16px; + text-transform: uppercase; + text-align: center; + color: #c8c8c8; + padding-left: 20px; + padding-right: 20px; +} + +/* box around all the menu items */ +.sm-item-box { + display: -moz-box; + display: -webkit-box; + padding-top: 5px; + -moz-box-orient: horizontal; + -webkit-box-orient: horizontal; + -webkit-box-pack: center; +} + +/* menu root element */ +.sm-root { + background-color: #191919; + position: relative; + z-index: 1; + height: 32px; + border-bottom: 3px solid #73c6f5; + /* TODO(jacobr): we should really have a two toned border: + border-bottom: 1px solid #71b0d3; */ + + -webkit-box-shadow: 0px 3px 5px rgba(0, 0, 0, .6); + -webkit-transition-property: -webkit-transform; + -webkit-transition-duration: 0.4s; +} + +.sm-root.hidden { + -webkit-transform: translate3d(0px, -46px, 0px); +} + +/* selected menu item text */ +.sm-item.sel { + color: #74c6f5; +} + +/* box around the sliding triangle */ +.sm-slider-box { + padding-bottom: 0; + display: -moz-box; + display: -webkit-box; + -moz-box-orient: horizontal; + -webkit-box-orient: horizontal; +} + +/* draw a upward pointing triangle by making all borders except + the bottom border transparent */ +.sm-triangle { + border-color: transparent transparent #73c6f5 transparent; + border-style: solid; + border-width: 9px; + margin-top: -9px; + position: relative; + /** TODO(jacobr): ugly hack to work around rounding error when nesting CSS + 3d transitions */ + top: 1px; +} + +.invisible { + opacity: 0; + visibility: hidden; +} diff --git a/client/view/view.dart b/client/view/view.dart new file mode 100644 index 00000000000..deb2d1c6928 --- /dev/null +++ b/client/view/view.dart @@ -0,0 +1,353 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#library("view"); + +#import('../base/base.dart'); +#import('../observable/observable.dart'); +#import('../touch/touch.dart'); +#import('../html/html.dart'); +#import('../layout/layout.dart'); + +#source('CompositeView.dart'); +#source('ConveyorView.dart'); +#source('MeasureText.dart'); +#source('PagedViews.dart'); +#source('SliderMenu.dart'); + +// TODO(rnystrom): Note! This class is undergoing heavy construction. It will +// temporary support both some old and some new ways of doing things until all +// subclasses are refactored to use the new way. There will be some scaffolding +// and construction cones laying around. Try not to freak out. + +/** A generic view. */ +class View implements Positionable { + Element _node; + ViewLayout _layout; + + // TODO(jmesserly): instead of tracking this on every View, we could have the + // App track the views that want to be notified of resize() + EventListener _resizeHandler; + + /** + * Style properties configured for this view. + */ + // TODO(jmesserly): We should be getting these from our CSS preprocessor. + // I'm not sure if this will stay as a Map, or just be a get method. + // TODO(jacobr): Consider returning a somewhat typed base.Style wrapper + // object instead, and integrating with built in CSS properties. + final Map customStyle; + + View() + : customStyle = new Map(); + + View.fromNode(Element this._node) + : customStyle = new Map(); + + View.html(String html) + : customStyle = new Map(), + _node = new Element.html(html); + + // TODO(rnystrom): Get rid of this when all views are refactored to not use + // it. + Element get node() { + // Lazy render. + if (_node === null) { + _render(); + } + + return _node; + } + + /** + * A subclass that contains child views should override this to return those + * views. View uses this to ensure that child views are properly rendered + * and initialized when their parent view is without the parent having to + * manually handle that traversal. + */ + Collection get childViews() { + return const []; + } + + /** + * View presumes the collection of views returned by childViews is more or + * less static after the view is first created. Subclasses should call this + * when that invariant doesn't hold to let View know that a new childView has + * appeared. + */ + void childViewAdded(View child) { + if (isInDocument) { + child._enterDocument(); + + // TODO(jmesserly): is this too expensive? + doLayout(); + } + } + + /** + * View presumes the collection of views returned by childViews is more or + * less static after the view is first created. Subclasses should call this + * when that invariant doesn't hold to let View know that a childView has + * been removed. + */ + void childViewRemoved(View child) { + if (isInDocument) { + child._exitDocument(); + } + } + + /** Gets whether this View has already been rendered or not. */ + bool get isRendered() { + return _node !== null; + } + + /** + * Gets whether this View (or one of its parents) has been added to the + * document or not. + */ + bool get isInDocument() { + return _node !== null && node.inDocument; + } + + /** + * Adds this view to the document as a child of the given node. This should + * generally only be called once for the top-level view. + */ + void addToDocument(Element parentNode) { + assert(!isInDocument); + + _render(); + parentNode.nodes.add(_node); + _hookGlobalLayoutEvents(); + _enterDocument(); + } + + void removeFromDocument() { + assert(isInDocument); + + // Remove runs in reverse order of how we entered. + _exitDocument(); + _unhookGlobalLayoutEvents(); + _node.remove(); + } + + /** + * Override this to generate the DOM structure for the view. + */ + // TODO(rnystrom): make this method abstract, see b/5015671 + Element render() { throw 'abstract'; } + + /** + * Override this to perform initialization behavior that requires access to + * the DOM associated with the View, such as event wiring. + */ + void afterRender(Element node) { + // Do nothing by default. + } + + /** + * Override this to perform behavior after this View has been added to the + * document. This is appropriate if you need access to state (such as the + * calculated size of an element) that's only available when the View is in + * the document. + * + * This will be called each time the View is added to the document, if it is + * added and removed multiple times. + */ + void enterDocument() {} + + /** + * Override this to perform behavior after this View has been removed from the + * document. This can be a convenient time to unregister event handlers bound + * in enterDocument(). + * + * This will be called each time the View is removed from the document, if it + * is added and removed multiple times. + */ + void exitDocument() {} + + /** Override this to perform behavior after the window is resized. */ + // TODO(jmesserly): this isn't really the event we want. Ideally we want to + // fire the event only if this particular View changed size. Also we should + // give a view the ability to measure itself when added to the document. + void windowResized() {} + + /** + * Registers the given listener callback to the given observable. Also + * immedially invokes the callback once as if a change has just come in. This + * lets you define a render() method that renders the skeleton of a view, then + * register a bunch of listeners which all fire to populate the view with + * model data. + */ + void watch(Observable observable, void watcher(EventSummary summary)) { + // Make a fake summary for the initial watch. + final summary = new EventSummary(observable); + watcher(summary); + + attachWatch(observable, watcher); + } + + /** Registers the given listener callback to the given observable. */ + void attachWatch(Observable observable, void watcher(EventSummary summary)) { + observable.addChangeListener(watcher); + + // TODO(rnystrom): Should keep track of this and unregister when the view + // is discarded. + } + + void addOnClick(EventListener handler) { + _node.on.click.add(handler); + } + + /** + * Gets whether the view is hidden. + */ + bool get hidden() => Css.getDisplay(_node.style) == 'none'; + + /** + * Sets whether the view is hidden. + */ + void set hidden(bool hidden) { + if (hidden) { + Css.setDisplay(node.style, 'none'); + } else { + Css.setDisplay(node.style, ''); + } + } + + void addClass(String className) { + node.classes.add(className); + } + + void removeClass(String className) { + node.classes.remove(className); + } + + /** Sets the CSS3 transform applied to the view. */ + set transform(String transform) { + Css.setTransform(node.style, transform); + } + + // TODO(rnystrom): Get rid of this, or move into a separate class? + /** Creates a View whose node is a
with the given class(es). */ + static View div(String cssClass, [String body = null]) { + if (body == null) { + body = ''; + } + return new View.html('
$body
'); + } + + /** + * Internal render method that deals with traversing child views. Should not + * be overridden. + */ + void _render() { + // TODO(rnystrom): Should render child views here. Not implemented yet. + // Instead, we rely on the parent accessing .node to implicitly cause the + // child to be rendered. + + // Render this view. + if (_node == null) { + _node = render(); + } + + // Pass the node back to the derived view so it can register event + // handlers on it. + afterRender(_node); + } + + /** + * Internal method that deals with traversing child views. Should not be + * overridden. + */ + void _enterDocument() { + // Notify the children first. + for (final child in childViews) { + child._enterDocument(); + } + + enterDocument(); + } + + // Layout related methods + + ViewLayout get layout() { + if (_layout == null) { + _layout = new ViewLayout.fromView(this); + } + return _layout; + } + + /** + * Internal method that deals with traversing child views. Should not be + * overridden. + */ + void _exitDocument() { + // Notify this View first so that it's children are still valid. + exitDocument(); + + // Notify the children. + for (final child in childViews) { + child._exitDocument(); + } + } + + /** + * If needed, starts a layout computation from the top level. + * Also hooks the relevant events like window resize, so we can layout on too + * demand. + */ + void _hookGlobalLayoutEvents() { + if (_resizeHandler == null) { + _resizeHandler = EventBatch.wrap((e) => doLayout()); + } + window.on.resize.add(_resizeHandler); + + // Trigger the initial layout. + doLayout(); + } + + void _unhookGlobalLayoutEvents() { + if (_resizeHandler != null) { + window.on.resize.remove(_resizeHandler); + _resizeHandler = null; + } + } + + void doLayout() { + if (_measureLayout()) { + _applyLayoutToChildren(); + } + } + + bool _measureLayout() { + windowResized(); + + // TODO(jmesserly): this logic is more complex than it needs to be because + // we're taking pains to not initialize _layout if it's not needed. Is that + // a good tradeoff? + if (ViewLayout.hasCustomLayout(this)) { + return layout.measureLayout(_node.clientWidth, _node.clientHeight); + } else { + bool changed = false; + for (final child in childViews) { + if (child._measureLayout()) changed = true; + } + return changed; + } + } + + void _applyLayoutToChildren() { + for (final child in childViews) { + child._applyLayout(); + } + } + + void _applyLayout() { + if (_layout != null) { + _layout.applyLayout(); + } + _applyLayoutToChildren(); + } +}