ranger-compiler 3.5.0 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1160 -19
- package/LICENSE +3 -1
- package/README.md +124 -29
- package/dist/Lang.rgr +1188 -290
- package/dist/api.d.ts +2343 -879
- package/dist/api.js +79924 -56922
- package/dist/lib/JSON.rgr +102 -91
- package/dist/lib/Shell.rgr +4 -4
- package/dist/lib/apple/AppleToolchain.rgr +4 -4
- package/dist/lib/apple/README.md +5 -4
- package/dist/lib/apple/apple_test.rgr +1 -1
- package/dist/lib/core/README.md +1 -1
- package/dist/lib/evg/EVG.rgr +12 -0
- package/dist/lib/evg/EVGA11yFromTree.rgr +302 -0
- package/dist/lib/evg/EVGA11yTree.rgr +894 -0
- package/dist/lib/evg/EVGBox.rgr +267 -0
- package/dist/lib/evg/EVGBoxShorthandTest.rgr +220 -0
- package/dist/lib/evg/EVGCodepoint.rgr +316 -0
- package/dist/lib/evg/EVGColor.rgr +700 -0
- package/dist/lib/evg/EVGCommands.rgr +177 -0
- package/dist/lib/evg/EVGComponent.rgr +331 -0
- package/dist/lib/evg/EVGComponentTest.rgr +387 -0
- package/dist/lib/evg/EVGConnector.rgr +541 -0
- package/dist/lib/evg/EVGConnectorTest.rgr +306 -0
- package/dist/lib/evg/EVGDisplayList.rgr +4186 -0
- package/dist/lib/evg/EVGEasing.rgr +370 -0
- package/dist/lib/evg/EVGEffectTest.rgr +253 -0
- package/dist/lib/evg/EVGElement.rgr +4914 -0
- package/dist/lib/evg/EVGFixedTest.rgr +289 -0
- package/dist/lib/evg/EVGFlexRulesTest.rgr +317 -0
- package/dist/lib/evg/EVGFlexWrapTest.rgr +246 -0
- package/dist/lib/evg/EVGFling.rgr +244 -0
- package/dist/lib/evg/EVGFocus.rgr +400 -0
- package/dist/lib/evg/EVGFocusTest.rgr +399 -0
- package/dist/lib/evg/EVGGradient.rgr +322 -0
- package/dist/lib/evg/EVGGrapheme.rgr +190 -0
- package/dist/lib/evg/EVGGrid.rgr +975 -0
- package/dist/lib/evg/EVGHitTest.rgr +208 -0
- package/dist/lib/evg/EVGHoles.rgr +294 -0
- package/dist/lib/evg/EVGHostMeasurerTest.rgr +281 -0
- package/dist/lib/evg/EVGHostTextMeasurer.rgr +331 -0
- package/dist/lib/evg/EVGHostTree.rgr +834 -0
- package/dist/lib/evg/EVGHostTreeTest.rgr +447 -0
- package/dist/lib/evg/EVGImageDecode.rgr +117 -0
- package/dist/lib/evg/EVGImageMeasurer.rgr +86 -0
- package/dist/lib/evg/EVGInspect.rgr +883 -0
- package/dist/lib/evg/EVGInvalidateTest.rgr +432 -0
- package/dist/lib/evg/EVGJsonTest.rgr +535 -0
- package/dist/lib/evg/EVGLayout.rgr +4220 -0
- package/dist/lib/evg/EVGMeasure.rgr +1267 -0
- package/dist/lib/evg/EVGOverlayTest.rgr +626 -0
- package/dist/lib/evg/EVGPatch.rgr +1721 -0
- package/dist/lib/evg/EVGPatchTest.rgr +692 -0
- package/dist/lib/evg/EVGPopoverTest.rgr +395 -0
- package/dist/lib/evg/EVGReconcile.rgr +226 -0
- package/dist/lib/evg/EVGReconcileTest.rgr +421 -0
- package/dist/lib/evg/EVGReject.rgr +126 -0
- package/dist/lib/evg/EVGRelayoutTest.rgr +375 -0
- package/dist/lib/evg/EVGRtlLayoutTest.rgr +319 -0
- package/dist/lib/evg/EVGRuler.rgr +232 -0
- package/dist/lib/evg/EVGRulerTest.rgr +172 -0
- package/dist/lib/evg/EVGSelectChrome.rgr +178 -0
- package/dist/lib/evg/EVGStyleCacheTest.rgr +419 -0
- package/dist/lib/evg/EVGStyleSheet.rgr +2148 -0
- package/dist/lib/evg/EVGStyleStateTest.rgr +407 -0
- package/dist/lib/evg/EVGStyleVarTest.rgr +471 -0
- package/dist/lib/evg/EVGText.rgr +105 -0
- package/dist/lib/evg/EVGTextEngine.rgr +536 -0
- package/dist/lib/evg/EVGTextMeasurer.rgr +720 -0
- package/dist/lib/evg/EVGTimingTest.rgr +1417 -0
- package/dist/lib/evg/EVGToolbar.rgr +1369 -0
- package/dist/lib/evg/EVGTransition.rgr +728 -0
- package/dist/lib/evg/EVGTreeJson.rgr +721 -0
- package/dist/lib/evg/EVGUnit.rgr +554 -0
- package/dist/lib/evg/EVGViewportUnitTest.rgr +236 -0
- package/dist/lib/evg/EvgApp.rgr +189 -0
- package/dist/lib/evg/EvgBitmapTracer.rgr +4277 -0
- package/dist/lib/evg/EvgBitmapTracerTest.rgr +2119 -0
- package/dist/lib/evg/EvgHost.rgr +451 -0
- package/dist/lib/evg/EvgTest.rgr +91 -0
- package/dist/lib/evg/EvgTraceColor.rgr +236 -0
- package/dist/lib/evg/EvgTraceCurve.rgr +648 -0
- package/dist/lib/evg/EvgTraceFit.rgr +767 -0
- package/dist/lib/evg/EvgTracePath.rgr +435 -0
- package/dist/lib/evg/EvgTraceTypes.rgr +559 -0
- package/dist/lib/evg/EvgViewport.rgr +313 -0
- package/dist/lib/evg/FxDemoDoc.rgr +185 -0
- package/dist/lib/evg/HOSTS.md +227 -0
- package/dist/lib/evg/ISSUES.md +835 -0
- package/dist/lib/evg/PLAN_ACCESSIBILITY.md +650 -0
- package/dist/lib/evg/PLAN_CSS_LAYOUT_AND_FONTS.md +1124 -0
- package/dist/lib/evg/PLAN_EFFECTS.md +431 -0
- package/dist/lib/evg/PLAN_EVG.md +518 -0
- package/dist/lib/evg/PLAN_EVG_RENDERER.md +1674 -0
- package/dist/lib/evg/PLAN_INSPECTOR.md +788 -0
- package/dist/lib/evg/PLAN_LINKS_AND_FORMS.md +157 -0
- package/dist/lib/evg/PLAN_NATIVE_HOSTS.md +671 -0
- package/dist/lib/evg/PLAN_VECTOR_IR.md +664 -0
- package/dist/lib/evg/PLAN_VIEW_TRANSFORM.md +322 -0
- package/dist/lib/evg/PathBuilder.rgr +333 -0
- package/dist/lib/evg/README.md +1236 -0
- package/dist/lib/evg/SPEC.md +1252 -0
- package/dist/lib/evg/SVGPathParser.rgr +1199 -0
- package/dist/lib/evg/SvgParser.rgr +1736 -0
- package/dist/lib/evg/TODO_EVG_RENDERER.md +595 -0
- package/dist/lib/evg/VectorShapes.rgr +331 -0
- package/dist/lib/evg/VectorStroke.rgr +107 -0
- package/dist/lib/evg/VectorViewBox.rgr +380 -0
- package/dist/lib/evg/agent/README.md +290 -0
- package/dist/lib/evg/agent/evg_agent.rgr +899 -0
- package/dist/lib/evg/agent/fixtures/broken.evg.json +7 -0
- package/dist/lib/evg/agent/fixtures/card.evg.json +9 -0
- package/dist/lib/evg/agent/fixtures/connector.css +63 -0
- package/dist/lib/evg/agent/fixtures/connector.evg.json +14 -0
- package/dist/lib/evg/agent/fixtures/drawn.evg.json +129 -0
- package/dist/lib/evg/agent/fixtures/gradient.evg.json +4 -0
- package/dist/lib/evg/agent/fixtures/popover.css +99 -0
- package/dist/lib/evg/agent/fixtures/popover.evg.json +30 -0
- package/dist/lib/evg/agent/roundtrip.sh +74 -0
- package/dist/lib/evg/agent/smoke.sh +230 -0
- package/dist/lib/evg/android/README.md +97 -0
- package/dist/lib/evg/android/androidstubs/AndroidStubs.kt +175 -0
- package/dist/lib/evg/android/androidstubs/Annotation.kt +10 -0
- package/dist/lib/evg/android/androidstubs/App.kt +30 -0
- package/dist/lib/evg/android/androidstubs/Content.kt +41 -0
- package/dist/lib/evg/android/androidstubs/ContentRes.kt +12 -0
- package/dist/lib/evg/android/androidstubs/InputMethod.kt +46 -0
- package/dist/lib/evg/android/androidstubs/Net.kt +6 -0
- package/dist/lib/evg/android/androidstubs/Os.kt +30 -0
- package/dist/lib/evg/android/androidstubs/Util.kt +15 -0
- package/dist/lib/evg/android/androidstubs/View.kt +113 -0
- package/dist/lib/evg/android/androidstubs/Widget.kt +16 -0
- package/dist/lib/evg/android/src/android/kotlin/fi/ranger/evg/AndroidEvgSurface.kt +323 -0
- package/dist/lib/evg/android/src/android/kotlin/fi/ranger/evg/AndroidTextMeasurer.kt +56 -0
- package/dist/lib/evg/android/src/android/kotlin/fi/ranger/evg/RippleEffect.kt +262 -0
- package/dist/lib/evg/android/src/awt/kotlin/fi/ranger/evg/AwtEvgSurface.kt +238 -0
- package/dist/lib/evg/android/src/awt/kotlin/fi/ranger/evg/AwtTextMeasurer.kt +85 -0
- package/dist/lib/evg/android/src/main/kotlin/fi/ranger/evg/EvgEngineThread.kt +115 -0
- package/dist/lib/evg/android/src/main/kotlin/fi/ranger/evg/EvgPainter.kt +231 -0
- package/dist/lib/evg/android/src/main/kotlin/fi/ranger/evg/EvgSurface.kt +117 -0
- package/dist/lib/evg/android/src/main/kotlin/fi/ranger/evg/RecordingSurface.kt +94 -0
- package/dist/lib/evg/apple/README.md +128 -0
- package/dist/lib/evg/apple/Sources/CoreGraphicsEvgSurface.swift +329 -0
- package/dist/lib/evg/apple/Sources/CoreTextMeasurer.swift +70 -0
- package/dist/lib/evg/apple/Sources/EvgEngineQueue.swift +105 -0
- package/dist/lib/evg/apple/Sources/EvgPainter.swift +225 -0
- package/dist/lib/evg/apple/Sources/EvgSurface.swift +163 -0
- package/dist/lib/evg/apple/Sources/RecordingSurface.swift +110 -0
- package/dist/lib/evg/bench/EvgLayoutBench.rgr +34 -0
- package/dist/lib/evg/bench/README.md +64 -0
- package/dist/lib/evg/bench/layout-bench.mjs +316 -0
- package/dist/lib/evg/bench/layout-cases.mjs +510 -0
- package/dist/lib/evg/bench/layout-conformance.mjs +254 -0
- package/dist/lib/evg/bin/.gitignore +17 -0
- package/dist/lib/evg/evg_test.rgr +313 -0
- package/dist/lib/evg/gl/README.md +198 -0
- package/dist/lib/evg/gl/a11y-paint-check.mjs +73 -0
- package/dist/lib/evg/gl/blur-check.mjs +399 -0
- package/dist/lib/evg/gl/boxmodel.json +1 -0
- package/dist/lib/evg/gl/demo.html +46 -0
- package/dist/lib/evg/gl/effect-presets.css +285 -0
- package/dist/lib/evg/gl/effect-presets.js +63 -0
- package/dist/lib/evg/gl/effect-shots.mjs +135 -0
- package/dist/lib/evg/gl/evg-a11y.js +566 -0
- package/dist/lib/evg/gl/evg-binary.js +160 -0
- package/dist/lib/evg/gl/evg-engine.js +296 -0
- package/dist/lib/evg/gl/evg-fx.js +237 -0
- package/dist/lib/evg/gl/evg-gestures.js +209 -0
- package/dist/lib/evg/gl/evg-list.js +167 -0
- package/dist/lib/evg/gl/evg-measure.js +186 -0
- package/dist/lib/evg/gl/evg-textinput.js +303 -0
- package/dist/lib/evg/gl/evg-view.js +144 -0
- package/dist/lib/evg/gl/evg-webgl.js +3942 -0
- package/dist/lib/evg/gl/fx-check.mjs +998 -0
- package/dist/lib/evg/gl/fx-demo.html +166 -0
- package/dist/lib/evg/gl/fx-demo.js +2 -0
- package/dist/lib/evg/gl/fx-serve.mjs +47 -0
- package/dist/lib/evg/gl/gestures-check.mjs +189 -0
- package/dist/lib/evg/gl/list-binary-check.mjs +152 -0
- package/dist/lib/evg/gl/measure-check.mjs +135 -0
- package/dist/lib/evg/gl/rotation-check.mjs +207 -0
- package/dist/lib/evg/gl/shift-check.mjs +113 -0
- package/dist/lib/evg/gl/stroke-check.mjs +168 -0
- package/dist/lib/evg/gl/text-snap-check.mjs +139 -0
- package/dist/lib/evg/gl/view-check.mjs +343 -0
- package/dist/lib/evg/gl/view-policy-check.mjs +184 -0
- package/dist/lib/evg/html/evg-dom.js +318 -0
- package/dist/lib/evg/html/evg-html.js +600 -0
- package/dist/lib/evg/inspect/README.md +415 -0
- package/dist/lib/evg/inspect/browser-smoke.mjs +115 -0
- package/dist/lib/evg/inspect/evg-inspect.js +947 -0
- package/dist/lib/evg/inspect/shots/css.png +0 -0
- package/dist/lib/evg/inspect/shots/dashboard.png +0 -0
- package/dist/lib/evg/inspect/shots/pptx-slide.png +0 -0
- package/dist/lib/evg/inspect/shots/state.png +0 -0
- package/dist/lib/evg/inspect/shots.mjs +226 -0
- package/dist/lib/evg/oracle/css-blur.json +576 -0
- package/dist/lib/evg/oracle/css-box.json +157 -0
- package/dist/lib/evg/oracle/css-timing.json +709 -0
- package/dist/lib/evg/oracle/css_blur_oracle.mjs +529 -0
- package/dist/lib/evg/oracle/css_box_oracle.mjs +106 -0
- package/dist/lib/evg/oracle/css_timing_oracle.mjs +389 -0
- package/dist/lib/evg/original/EVGColor.clj +310 -0
- package/dist/lib/evg/original/EVGColorContext.rgr +178 -0
- package/dist/lib/evg/original/SVGPath.rgr +627 -0
- package/dist/lib/evg/original/Vec2.crgr +103 -0
- package/dist/lib/evg/ranger.json +9 -0
- package/dist/lib/evg/showcase/README.md +246 -0
- package/dist/lib/evg/showcase/assets/emblem.svg +30 -0
- package/dist/lib/evg/showcase/assets/rosette.svg +22 -0
- package/dist/lib/evg/showcase/build.mjs +651 -0
- package/dist/lib/evg/showcase/pages/album.tsx +30 -0
- package/dist/lib/evg/showcase/pages/boxmodel.tsx +37 -0
- package/dist/lib/evg/showcase/pages/cards.tsx +41 -0
- package/dist/lib/evg/showcase/pages/chart_api.tsx +170 -0
- package/dist/lib/evg/showcase/pages/charts.tsx +219 -0
- package/dist/lib/evg/showcase/pages/drawing.tsx +160 -0
- package/dist/lib/evg/showcase/pages/emoji.tsx +91 -0
- package/dist/lib/evg/showcase/pages/flex.tsx +46 -0
- package/dist/lib/evg/showcase/pages/more.tsx +332 -0
- package/dist/lib/evg/showcase/pages/plots.tsx +262 -0
- package/dist/lib/evg/showcase/pages/svg.tsx +63 -0
- package/dist/lib/evg/showcase/pages/tables.tsx +209 -0
- package/dist/lib/evg/showcase/pages/typography.tsx +43 -0
- package/dist/lib/evg/showcase/pages/units.tsx +35 -0
- package/dist/lib/evg/showcase/pages/variants.tsx +233 -0
- package/dist/lib/evg/showcase/pages/vector.tsx +75 -0
- package/dist/lib/evg/showcase/pages/views.tsx +223 -0
- package/dist/lib/evg/showcase/tests/chart_api_smoke.mjs +339 -0
- package/dist/lib/evg/showcase/tests/gl_smoke.mjs +125 -0
- package/dist/lib/evg/showcase/themes/chart_api-default.css +15 -0
- package/dist/lib/evg/showcase/themes/charts-default.css +29 -0
- package/dist/lib/evg/showcase/themes/drawing-default.css +35 -0
- package/dist/lib/evg/showcase/themes/more-default.css +128 -0
- package/dist/lib/evg/showcase/themes/plots-default.css +18 -0
- package/dist/lib/evg/showcase/themes/showcase.css +508 -0
- package/dist/lib/evg/showcase/themes/tables-default.css +123 -0
- package/dist/lib/evg/showcase/themes/variants-default.css +15 -0
- package/dist/lib/evg/showcase/themes/views-default.css +15 -0
- package/dist/lib/evg/tools/bench_vs_potrace.mjs +290 -0
- package/dist/lib/evg/tools/evg_image_tool.rgr +488 -0
- package/dist/lib/evg/tools/evg_trace_bench.rgr +114 -0
- package/dist/lib/evg/tools/evg_trace_cli.rgr +662 -0
- package/dist/lib/evg/tools/evg_trace_cpp_bench.rgr +83 -0
- package/dist/lib/evg/tools/run_trace_bench.sh +74 -0
- package/dist/lib/evg/tools/run_trace_cli_smoke.sh +128 -0
- package/dist/lib/evg/web/responsive/EvgResponsiveCheck.rgr +271 -0
- package/dist/lib/evg/web/responsive/EvgResponsiveDemo.rgr +531 -0
- package/dist/lib/evg/web/responsive/README.md +97 -0
- package/dist/lib/evg/web/responsive/build.mjs +90 -0
- package/dist/lib/evg/web/responsive/dom-check.mjs +169 -0
- package/dist/lib/evg/web/responsive/index.html +177 -0
- package/dist/lib/evg/web/responsive/smoke.mjs +221 -0
- package/dist/lib/evg/web/tools/assets-client.mjs +95 -0
- package/dist/lib/evg/web/tools/boot-bench.mjs +189 -0
- package/dist/lib/evg/web/tools/inline-assets.mjs +119 -0
- package/dist/lib/evg/web/tools/minify.mjs +60 -0
- package/dist/lib/evg/web/tracer/build.mjs +87 -0
- package/dist/lib/evg/web/tracer/index.html +2805 -0
- package/dist/lib/evg/web/tracer/sample.png +0 -0
- package/dist/lib/evg/web/tracer/smoke.mjs +1162 -0
- package/dist/lib/evgr/Cargo.lock +21 -0
- package/dist/lib/evgr/Cargo.toml +19 -0
- package/dist/lib/evgr/README.md +140 -0
- package/dist/lib/evgr/bench/NativeBench.rgr +246 -0
- package/dist/lib/evgr/bench/compare.mjs +252 -0
- package/dist/lib/evgr/bench/speed.mjs +277 -0
- package/dist/lib/evgr/bin/.gitignore +3 -0
- package/dist/lib/evgr/src/bin/bench.rs +106 -0
- package/dist/lib/evgr/src/bin/smoke.rs +13 -0
- package/dist/lib/evgr/src/grid.rs +730 -0
- package/dist/lib/evgr/src/lib.rs +1003 -0
- package/dist/lib/evgr/src/style.rs +468 -0
- package/dist/lib/evgr/src/text.rs +83 -0
- package/dist/lib/image/BitReader.rgr +171 -0
- package/dist/lib/image/Buffer.rgr +173 -0
- package/dist/lib/image/DCT.rgr +283 -0
- package/dist/lib/image/Deflate.rgr +339 -0
- package/dist/lib/image/HuffmanDecoder.rgr +181 -0
- package/dist/lib/image/ImageBuffer.rgr +706 -0
- package/dist/lib/image/JPEGDecoder.rgr +808 -0
- package/dist/lib/image/PNGDecoder.rgr +544 -0
- package/dist/lib/image/PNGEncoder.rgr +388 -0
- package/dist/lib/image/PPMImage.rgr +224 -0
- package/dist/lib/image/ProgressiveJPEGDecoder.rgr +1154 -0
- package/dist/lib/image/README.md +33 -0
- package/dist/lib/image/RasterBuffer.rgr +294 -0
- package/dist/lib/image/VP8BoolDecoder.rgr +163 -0
- package/dist/lib/image/WebPDecoder.rgr +433 -0
- package/dist/lib/image/WebPLossless.rgr +1035 -0
- package/dist/lib/image/WebPLossy.rgr +1929 -0
- package/dist/lib/image/ranger.json +9 -0
- package/dist/lib/image/testdata/webp/anim_2f_24x16.webp +0 -0
- package/dist/lib/image/testdata/webp/fixtures.txt +33 -0
- package/dist/lib/image/testdata/webp/gen_fixtures.py +261 -0
- package/dist/lib/image/testdata/webp/ll_1x1.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_alpha_29x21.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_gradient_64x64.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_meta_32x32.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_noise_17x9.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_pal11_23x11.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_pal2_19x7.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_pal40_16x16.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_pal4_13x5.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_photo_40x30.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_predictors_64x32.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_1x1.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_raw_f0_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_raw_f1_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_raw_f2_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_raw_f3_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_vp8l_f0_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_vp8l_f1_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_vp8l_f2_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_vp8l_f3_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alpha_33x17.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_exif_15x11.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_i16_96x80.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_nofilter_24x20.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_odd_17x9.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_photo_48x40.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_q100_20x18.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_sharp_40x36.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_simple_filter_33x31.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_vpx_parts8_37x45.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_vpx_skip_96x80.webp +0 -0
- package/dist/lib/image/tests/WebPDecodeTool.rgr +81 -0
- package/dist/lib/image/tests/WebPDecoderTest.rgr +1162 -0
- package/dist/lib/image/tests/run_webp_tests.sh +39 -0
- package/dist/lib/rust/RsJson.rgr +468 -0
- package/dist/lib/rust/RsPrelude.rgr +1663 -0
- package/dist/lib/shell_test.rgr +7 -7
- package/dist/lib/stdlib.rgr +21 -5
- package/dist/lib/zip/ranger.json +6 -0
- package/dist/rgrc.js +87318 -67610
- package/package.json +1010 -1040
- package/dist/README.md +0 -117
- package/dist/package.json +0 -47
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
; SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
; ==============================================================================
|
|
4
|
+
; EVGStyleStateTest — CSS that reacts, and CSS that moves
|
|
5
|
+
; ==============================================================================
|
|
6
|
+
;
|
|
7
|
+
; Two things a stylesheet has to be able to say about a control that is being
|
|
8
|
+
; used, and neither of them existed here:
|
|
9
|
+
;
|
|
10
|
+
; `.btn:hover { … }` the look of a thing under the pointer, decided by the
|
|
11
|
+
; sheet rather than by the controller writing a second
|
|
12
|
+
; class. A controller that has to know about hover is a
|
|
13
|
+
; controller that has to know about presentation.
|
|
14
|
+
; `transition: …` and the look CHANGING over time rather than snapping.
|
|
15
|
+
; Not decoration: an instant colour swap reads as a
|
|
16
|
+
; glitch, and the reason every real toolkit has this.
|
|
17
|
+
;
|
|
18
|
+
; Everything below runs without a browser. A pseudo-class is a flag on the
|
|
19
|
+
; element and a rule that asks for it; a transition is a clock the caller
|
|
20
|
+
; advances. Both are therefore testable exactly, which is the only reason to
|
|
21
|
+
; put them in the engine rather than in a page.
|
|
22
|
+
; ==============================================================================
|
|
23
|
+
|
|
24
|
+
Import "EVGElement.rgr"
|
|
25
|
+
Import "EVGUnit.rgr"
|
|
26
|
+
Import "EVGStyleSheet.rgr"
|
|
27
|
+
Import "EVGTransition.rgr"
|
|
28
|
+
Import "EVGLayout.rgr"
|
|
29
|
+
Import "EVGDisplayList.rgr"
|
|
30
|
+
|
|
31
|
+
class StyleCheck {
|
|
32
|
+
def passed:int 0
|
|
33
|
+
def failed:int 0
|
|
34
|
+
|
|
35
|
+
fn ok:void (name:string cond:boolean) {
|
|
36
|
+
if cond {
|
|
37
|
+
passed = (passed + 1)
|
|
38
|
+
print (" PASS " + name)
|
|
39
|
+
} {
|
|
40
|
+
failed = (failed + 1)
|
|
41
|
+
print (" FAIL " + name)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
fn eqStr:void (name:string got:string want:string) {
|
|
46
|
+
def good:boolean (got == want)
|
|
47
|
+
if (good == false) {
|
|
48
|
+
print (" got '" + got + "' want '" + want + "'")
|
|
49
|
+
}
|
|
50
|
+
this.ok(name good)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
fn eqInt:void (name:string got:int want:int) {
|
|
54
|
+
def good:boolean (got == want)
|
|
55
|
+
if (good == false) {
|
|
56
|
+
print (" got " + (to_string got) + " want " + (to_string want))
|
|
57
|
+
}
|
|
58
|
+
this.ok(name good)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
class EVGStyleStateTest {
|
|
63
|
+
|
|
64
|
+
sfn sheetOf:EVGStyleSheet (css:string) {
|
|
65
|
+
def s (new EVGStyleSheet())
|
|
66
|
+
s.parse(css)
|
|
67
|
+
s.setViewport(800.0 600.0 false)
|
|
68
|
+
return s
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
sfn button:EVGElement () {
|
|
72
|
+
def el (EVGElement.createDiv())
|
|
73
|
+
el.id = "btn"
|
|
74
|
+
el.className = "btn"
|
|
75
|
+
return el
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
; The background as an integer 0..255 per channel, so a check can say what
|
|
79
|
+
; it saw rather than "not equal".
|
|
80
|
+
sfn bgRed:int (el:EVGElement) {
|
|
81
|
+
if el.backgroundColor {
|
|
82
|
+
def c:EVGColor (unwrap el.backgroundColor)
|
|
83
|
+
return (c.red())
|
|
84
|
+
}
|
|
85
|
+
return (0 - 1)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
sfn testHover:void (c:StyleCheck) {
|
|
89
|
+
print "--- a rule can ask for the pointer ---"
|
|
90
|
+
def css:string ".btn { background-color: rgb(0,0,0) } .btn:hover { background-color: rgb(255,0,0) }"
|
|
91
|
+
def s:EVGStyleSheet (EVGStyleStateTest.sheetOf(css))
|
|
92
|
+
c.eqInt("both rules parsed" (s.getRuleCount()) 2)
|
|
93
|
+
c.eqInt("and neither was rejected" (s.getErrorCount()) 0)
|
|
94
|
+
|
|
95
|
+
def el:EVGElement (EVGStyleStateTest.button())
|
|
96
|
+
s.applyTree(el "")
|
|
97
|
+
c.eqInt("at rest it is the base rule" (EVGStyleStateTest.bgRed(el)) 0)
|
|
98
|
+
|
|
99
|
+
el.isHovered = true
|
|
100
|
+
s.applyTree(el "")
|
|
101
|
+
c.eqInt("under the pointer the hover rule wins" (EVGStyleStateTest.bgRed(el)) 255)
|
|
102
|
+
|
|
103
|
+
el.isHovered = false
|
|
104
|
+
s.applyTree(el "")
|
|
105
|
+
c.eqInt("and it goes back when the pointer leaves" (EVGStyleStateTest.bgRed(el)) 0)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
sfn testOrder:void (c:StyleCheck) {
|
|
109
|
+
print "--- a pseudo rule wins wherever it is written ---"
|
|
110
|
+
; The hover rule comes FIRST here. In CSS the later rule of equal
|
|
111
|
+
; specificity wins, but `:hover` is more specific than the bare class,
|
|
112
|
+
; so it has to win from either position — the version that simply
|
|
113
|
+
; applied rules in order got this backwards.
|
|
114
|
+
def css:string ".btn:hover { background-color: rgb(255,0,0) } .btn { background-color: rgb(0,0,0) }"
|
|
115
|
+
def s:EVGStyleSheet (EVGStyleStateTest.sheetOf(css))
|
|
116
|
+
def el:EVGElement (EVGStyleStateTest.button())
|
|
117
|
+
el.isHovered = true
|
|
118
|
+
s.applyTree(el "")
|
|
119
|
+
c.eqInt("even declared before the base rule" (EVGStyleStateTest.bgRed(el)) 255)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
sfn testStates:void (c:StyleCheck) {
|
|
123
|
+
print "--- focus, active and disabled are the same mechanism ---"
|
|
124
|
+
def css:string (".btn { background-color: rgb(0,0,0) }"
|
|
125
|
+
+ " .btn:focus { background-color: rgb(10,0,0) }"
|
|
126
|
+
+ " .btn:active { background-color: rgb(20,0,0) }"
|
|
127
|
+
+ " .btn:disabled { background-color: rgb(30,0,0) }")
|
|
128
|
+
def s:EVGStyleSheet (EVGStyleStateTest.sheetOf(css))
|
|
129
|
+
def el:EVGElement (EVGStyleStateTest.button())
|
|
130
|
+
el.isFocused = true
|
|
131
|
+
s.applyTree(el "")
|
|
132
|
+
c.eqInt("focus" (EVGStyleStateTest.bgRed(el)) 10)
|
|
133
|
+
el.isFocused = false
|
|
134
|
+
el.isPressed = true
|
|
135
|
+
s.applyTree(el "")
|
|
136
|
+
c.eqInt("active" (EVGStyleStateTest.bgRed(el)) 20)
|
|
137
|
+
el.isPressed = false
|
|
138
|
+
el.a11yDisabled = true
|
|
139
|
+
s.applyTree(el "")
|
|
140
|
+
c.eqInt("disabled" (EVGStyleStateTest.bgRed(el)) 30)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
sfn testUnknownPseudo:void (c:StyleCheck) {
|
|
144
|
+
print "--- an unsupported pseudo is reported, not ignored ---"
|
|
145
|
+
; Silently dropping it would leave a rule in the file that never fires
|
|
146
|
+
; and a developer looking at the wrong thing.
|
|
147
|
+
def s:EVGStyleSheet (EVGStyleStateTest.sheetOf(".btn:nth-child(2) { background-color: rgb(1,0,0) }"))
|
|
148
|
+
c.eqInt("no rule was made" (s.getRuleCount()) 0)
|
|
149
|
+
c.ok("and an error says why" ((s.getErrorCount()) > 0))
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
sfn testUnknownTiming:void (c:StyleCheck) {
|
|
153
|
+
print "--- an unsupported timing function is reported too ---"
|
|
154
|
+
def bad:EVGStyleSheet (EVGStyleStateTest.sheetOf(".btn { transition: opacity 200ms spring(1, 2) }"))
|
|
155
|
+
c.ok("a made-up easing is an error" ((bad.getErrorCount()) > 0))
|
|
156
|
+
; And the shape that IS legal has to survive the same check, or the
|
|
157
|
+
; report is just noise: a function with commas inside it is normal CSS.
|
|
158
|
+
def good:EVGStyleSheet (EVGStyleStateTest.sheetOf(".btn { transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) }"))
|
|
159
|
+
c.eqInt("a real one is not" (good.getErrorCount()) 0)
|
|
160
|
+
c.eqInt("and the rule survives" (good.getRuleCount()) 1)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
; A property declared ONLY under a state has to go away again when the
|
|
164
|
+
; state does.
|
|
165
|
+
;
|
|
166
|
+
; This is the case a stylesheet that mutates the element in place gets
|
|
167
|
+
; wrong, and `transform` is where it bites, because nobody writes
|
|
168
|
+
; `transform: none` on a base rule the way they always write a base colour.
|
|
169
|
+
; The symptom is a row that lifts under the pointer and never comes back
|
|
170
|
+
; down — the colour returns, so it looks like a transform bug rather than a
|
|
171
|
+
; cascade one.
|
|
172
|
+
sfn testStateOnlyPropertyReverts:void (c:StyleCheck) {
|
|
173
|
+
print "--- a state-only property goes away with the state ---"
|
|
174
|
+
def css:string (".btn { background-color: rgb(0,0,0) }"
|
|
175
|
+
+ " .btn:hover { transform: scale(2) translate(4, 0); opacity: 0.5 }")
|
|
176
|
+
def s:EVGStyleSheet (EVGStyleStateTest.sheetOf(css))
|
|
177
|
+
def el:EVGElement (EVGStyleStateTest.button())
|
|
178
|
+
|
|
179
|
+
s.applyTree(el "")
|
|
180
|
+
c.ok("no scale at rest" ((fabs (el.scale - 1.0)) < 0.001))
|
|
181
|
+
|
|
182
|
+
el.isHovered = true
|
|
183
|
+
s.applyTree(el "")
|
|
184
|
+
c.ok("scaled under the pointer" ((fabs (el.scale - 2.0)) < 0.001))
|
|
185
|
+
; EIGHT, not four: `scale(2) translate(4, 0)` scales the translation
|
|
186
|
+
; too, because the functions compose. Writing the four here and being
|
|
187
|
+
; told otherwise is how that got checked.
|
|
188
|
+
c.ok("and moved by the SCALED offset" ((fabs (el.translateX - 8.0)) < 0.001))
|
|
189
|
+
c.ok("and faded" ((fabs (el.opacity - 0.5)) < 0.001))
|
|
190
|
+
|
|
191
|
+
el.isHovered = false
|
|
192
|
+
s.applyTree(el "")
|
|
193
|
+
c.ok("the scale goes back" ((fabs (el.scale - 1.0)) < 0.001))
|
|
194
|
+
c.ok("so does the offset" ((fabs el.translateX) < 0.001))
|
|
195
|
+
c.ok("and the opacity" ((fabs (el.opacity - 1.0)) < 0.001))
|
|
196
|
+
; And the base rule is still in charge of what it does declare.
|
|
197
|
+
c.eqInt("while the base colour is untouched" (EVGStyleStateTest.bgRed(el)) 0)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
; `transform-origin` is in the same trap and needs the same treatment: a
|
|
201
|
+
; corner pivot set only under `:hover` would otherwise stay the pivot
|
|
202
|
+
; forever, and the next rotation would turn about a point nothing on screen
|
|
203
|
+
; explains.
|
|
204
|
+
sfn testStateOnlyOriginReverts:void (c:StyleCheck) {
|
|
205
|
+
print "--- a state-only transform-origin goes back to the centre ---"
|
|
206
|
+
def css:string (".btn { background-color: rgb(0,0,0) }"
|
|
207
|
+
+ " .btn:hover { transform-origin: left top }")
|
|
208
|
+
def s:EVGStyleSheet (EVGStyleStateTest.sheetOf(css))
|
|
209
|
+
def el:EVGElement (EVGStyleStateTest.button())
|
|
210
|
+
|
|
211
|
+
el.isHovered = true
|
|
212
|
+
s.applyTree(el "")
|
|
213
|
+
c.ok("the corner while hovered" ((fabs (EVGElement.resolveOrigin(el.transformOriginX 100.0))) < 0.001))
|
|
214
|
+
|
|
215
|
+
el.isHovered = false
|
|
216
|
+
s.applyTree(el "")
|
|
217
|
+
c.ok("and the centre again after" ((fabs ((EVGElement.resolveOrigin(el.transformOriginX 100.0)) - 50.0)) < 0.001))
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
; `text-align` was parsed by EVGElement and read by NOTHING — a documented
|
|
221
|
+
; attribute that did nothing at all, which is the defect PLAN.md complains
|
|
222
|
+
; about by name. It was found by using it: a row of cards whose labels sat
|
|
223
|
+
; stubbornly in the top-left corner.
|
|
224
|
+
;
|
|
225
|
+
; What is checked is the painted position, not the attribute: the whole
|
|
226
|
+
; point is that the value now reaches the display list.
|
|
227
|
+
sfn testTextAlign:void (c:StyleCheck) {
|
|
228
|
+
print "--- text-align moves the text, not just the attribute ---"
|
|
229
|
+
def lefts:[double] (EVGStyleStateTest.labelXs("left"))
|
|
230
|
+
def centres:[double] (EVGStyleStateTest.labelXs("center"))
|
|
231
|
+
def rights:[double] (EVGStyleStateTest.labelXs("right"))
|
|
232
|
+
c.ok("a label was painted at all" ((array_length lefts) > 0))
|
|
233
|
+
if ((array_length lefts) > 0) {
|
|
234
|
+
def l:double (itemAt lefts 0)
|
|
235
|
+
def m:double (itemAt centres 0)
|
|
236
|
+
def r:double (itemAt rights 0)
|
|
237
|
+
c.ok("centred starts right of left-aligned" (m > (l + 1.0)))
|
|
238
|
+
c.ok("and right-aligned right of centred" (r > (m + 1.0)))
|
|
239
|
+
; Centred is the MIDDLE of the two, not merely somewhere between:
|
|
240
|
+
; the slack is halved, so the offset is half the right-aligned one.
|
|
241
|
+
def half:double ((l + r) / 2.0)
|
|
242
|
+
c.ok("and centred is exactly half the slack" ((fabs (m - half)) < 1.0))
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
; The x of every text command in a 300px-wide box aligned this way.
|
|
247
|
+
sfn labelXs:[double] (align:string) {
|
|
248
|
+
def page (new EVGElement())
|
|
249
|
+
page.setAttribute("width" "400")
|
|
250
|
+
page.setAttribute("height" "100")
|
|
251
|
+
def card (new EVGElement())
|
|
252
|
+
card.setAttribute("width" "300")
|
|
253
|
+
card.setAttribute("height" "40")
|
|
254
|
+
card.setAttribute("text-align" align)
|
|
255
|
+
card.textContent = "hi"
|
|
256
|
+
page.addChild(card)
|
|
257
|
+
def lay (new EVGLayout())
|
|
258
|
+
lay.layout(page)
|
|
259
|
+
def dl (new EVGDisplayList())
|
|
260
|
+
dl.setTextEngine((lay.getTextEngine()))
|
|
261
|
+
dl.build(page)
|
|
262
|
+
def out:[double]
|
|
263
|
+
def i:int 0
|
|
264
|
+
while (i < (array_length dl.cmds)) {
|
|
265
|
+
def cmd:EVGDrawCmd (itemAt dl.cmds i)
|
|
266
|
+
if (cmd.kind == 3) {
|
|
267
|
+
push out cmd.x
|
|
268
|
+
}
|
|
269
|
+
i = (i + 1)
|
|
270
|
+
}
|
|
271
|
+
return out
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
; --- transitions -------------------------------------------------------------
|
|
275
|
+
|
|
276
|
+
sfn testTransition:void (c:StyleCheck) {
|
|
277
|
+
print "--- a colour moves instead of jumping ---"
|
|
278
|
+
def css:string (".btn { background-color: rgb(0,0,0); transition: background-color 200ms }"
|
|
279
|
+
+ " .btn:hover { background-color: rgb(200,0,0) }")
|
|
280
|
+
def s:EVGStyleSheet (EVGStyleStateTest.sheetOf(css))
|
|
281
|
+
def el:EVGElement (EVGStyleStateTest.button())
|
|
282
|
+
def tr (new EVGTransition())
|
|
283
|
+
|
|
284
|
+
s.applyTree(el "")
|
|
285
|
+
tr.reconcile(el)
|
|
286
|
+
c.eqInt("it starts where the base rule put it" (EVGStyleStateTest.bgRed(el)) 0)
|
|
287
|
+
|
|
288
|
+
el.isHovered = true
|
|
289
|
+
s.applyTree(el "")
|
|
290
|
+
tr.reconcile(el)
|
|
291
|
+
; The target is 200, but no time has passed: a transition that jumps on
|
|
292
|
+
; the first frame is not a transition.
|
|
293
|
+
c.eqInt("the pointer arrives and nothing has moved yet" (EVGStyleStateTest.bgRed(el)) 0)
|
|
294
|
+
|
|
295
|
+
tr.advance(el 100.0)
|
|
296
|
+
c.eqInt("half way through, half way there" (EVGStyleStateTest.bgRed(el)) 100)
|
|
297
|
+
|
|
298
|
+
tr.advance(el 100.0)
|
|
299
|
+
c.eqInt("and at the end it has arrived" (EVGStyleStateTest.bgRed(el)) 200)
|
|
300
|
+
|
|
301
|
+
tr.advance(el 500.0)
|
|
302
|
+
c.eqInt("and stays there" (EVGStyleStateTest.bgRed(el)) 200)
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
sfn testReverseMidFlight:void (c:StyleCheck) {
|
|
306
|
+
print "--- reversed half way, it goes back from where it IS ---"
|
|
307
|
+
def css:string (".btn { background-color: rgb(0,0,0); transition: background-color 200ms }"
|
|
308
|
+
+ " .btn:hover { background-color: rgb(200,0,0) }")
|
|
309
|
+
def s:EVGStyleSheet (EVGStyleStateTest.sheetOf(css))
|
|
310
|
+
def el:EVGElement (EVGStyleStateTest.button())
|
|
311
|
+
def tr (new EVGTransition())
|
|
312
|
+
s.applyTree(el "")
|
|
313
|
+
tr.reconcile(el)
|
|
314
|
+
el.isHovered = true
|
|
315
|
+
s.applyTree(el "")
|
|
316
|
+
tr.reconcile(el)
|
|
317
|
+
tr.advance(el 100.0)
|
|
318
|
+
c.eqInt("half way" (EVGStyleStateTest.bgRed(el)) 100)
|
|
319
|
+
|
|
320
|
+
; The pointer leaves mid-flight. Restarting from the ORIGINAL value
|
|
321
|
+
; would snap the colour to 200 and then fade — the flicker every
|
|
322
|
+
; hand-rolled version of this has.
|
|
323
|
+
el.isHovered = false
|
|
324
|
+
s.applyTree(el "")
|
|
325
|
+
tr.reconcile(el)
|
|
326
|
+
c.eqInt("the reversal starts from where it had got to" (EVGStyleStateTest.bgRed(el)) 100)
|
|
327
|
+
tr.advance(el 100.0)
|
|
328
|
+
c.eqInt("and lands back at the start" (EVGStyleStateTest.bgRed(el)) 0)
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
sfn testNoTransitionDeclared:void (c:StyleCheck) {
|
|
332
|
+
print "--- without a transition it is instant, as CSS says ---"
|
|
333
|
+
def css:string (".btn { background-color: rgb(0,0,0) } .btn:hover { background-color: rgb(200,0,0) }")
|
|
334
|
+
def s:EVGStyleSheet (EVGStyleStateTest.sheetOf(css))
|
|
335
|
+
def el:EVGElement (EVGStyleStateTest.button())
|
|
336
|
+
def tr (new EVGTransition())
|
|
337
|
+
s.applyTree(el "")
|
|
338
|
+
tr.reconcile(el)
|
|
339
|
+
el.isHovered = true
|
|
340
|
+
s.applyTree(el "")
|
|
341
|
+
tr.reconcile(el)
|
|
342
|
+
c.eqInt("there on the first frame" (EVGStyleStateTest.bgRed(el)) 200)
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
sfn testOpacity:void (c:StyleCheck) {
|
|
346
|
+
print "--- opacity moves too, and it is not a colour ---"
|
|
347
|
+
def css:string (".btn { opacity: 1; transition: opacity 100ms } .btn:hover { opacity: 0 }")
|
|
348
|
+
def s:EVGStyleSheet (EVGStyleStateTest.sheetOf(css))
|
|
349
|
+
def el:EVGElement (EVGStyleStateTest.button())
|
|
350
|
+
def tr (new EVGTransition())
|
|
351
|
+
s.applyTree(el "")
|
|
352
|
+
tr.reconcile(el)
|
|
353
|
+
el.isHovered = true
|
|
354
|
+
s.applyTree(el "")
|
|
355
|
+
tr.reconcile(el)
|
|
356
|
+
c.eqInt("still opaque on the frame the pointer arrives" (to_int (el.opacity * 100.0)) 100)
|
|
357
|
+
tr.advance(el 50.0)
|
|
358
|
+
c.eqInt("half faded" (to_int (el.opacity * 100.0)) 50)
|
|
359
|
+
tr.advance(el 50.0)
|
|
360
|
+
c.eqInt("gone" (to_int (el.opacity * 100.0)) 0)
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
sfn testSubtree:void (c:StyleCheck) {
|
|
364
|
+
print "--- the whole tree is advanced, not one element ---"
|
|
365
|
+
def css:string (".row { background-color: rgb(0,0,0); transition: background-color 100ms }"
|
|
366
|
+
+ " .row:hover { background-color: rgb(100,0,0) }")
|
|
367
|
+
def s:EVGStyleSheet (EVGStyleStateTest.sheetOf(css))
|
|
368
|
+
def page:EVGElement (EVGElement.createDiv())
|
|
369
|
+
def kid:EVGElement (EVGElement.createDiv())
|
|
370
|
+
kid.id = "kid"
|
|
371
|
+
kid.className = "row"
|
|
372
|
+
page.addChild(kid)
|
|
373
|
+
def tr (new EVGTransition())
|
|
374
|
+
s.applyTree(page "")
|
|
375
|
+
tr.reconcileTree(page)
|
|
376
|
+
kid.isHovered = true
|
|
377
|
+
s.applyTree(page "")
|
|
378
|
+
tr.reconcileTree(page)
|
|
379
|
+
tr.advanceTree(page 50.0)
|
|
380
|
+
c.eqInt("a child half way through" (EVGStyleStateTest.bgRed(kid)) 50)
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
sfn main:void () {
|
|
384
|
+
def c (new StyleCheck())
|
|
385
|
+
print "=== EVG stylesheet: states and transitions ==="
|
|
386
|
+
EVGStyleStateTest.testHover(c)
|
|
387
|
+
EVGStyleStateTest.testOrder(c)
|
|
388
|
+
EVGStyleStateTest.testStates(c)
|
|
389
|
+
EVGStyleStateTest.testUnknownPseudo(c)
|
|
390
|
+
EVGStyleStateTest.testUnknownTiming(c)
|
|
391
|
+
EVGStyleStateTest.testStateOnlyPropertyReverts(c)
|
|
392
|
+
EVGStyleStateTest.testStateOnlyOriginReverts(c)
|
|
393
|
+
EVGStyleStateTest.testTextAlign(c)
|
|
394
|
+
EVGStyleStateTest.testTransition(c)
|
|
395
|
+
EVGStyleStateTest.testReverseMidFlight(c)
|
|
396
|
+
EVGStyleStateTest.testNoTransitionDeclared(c)
|
|
397
|
+
EVGStyleStateTest.testOpacity(c)
|
|
398
|
+
EVGStyleStateTest.testSubtree(c)
|
|
399
|
+
print ""
|
|
400
|
+
print ("passed=" + (to_string c.passed) + " failed=" + (to_string c.failed))
|
|
401
|
+
if (c.failed > 0) {
|
|
402
|
+
print "FAILURES"
|
|
403
|
+
} {
|
|
404
|
+
print "ALL PASS"
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|