Web Runtime 0.12.0
Release notes for Web Runtime 0.12.0.
7 changes — 3 features, 3 fixes, 1 breaking change
Minor Changes
-
#238
2daa8a0Thanks @dm-balakin! -ResizeObserveris a global that observes nodes, as on the Web: its callback is told after a frame'srequestAnimationFramecallbacks and layout of each node whose content, border or device-pixel content box changed size. In the web runtime it takes the browser's place for nodes, and passes DOM elements on to it. The simulated runtime's observes nodes and never calls back, as nothing is laid out there.useScrollbarno longer reads sizes every frame: it is told of changes by aResizeObserverand byscrollevents. NewuseCanvasSizekeeps a canvas's drawing buffer exactly the device pixels its box covers. -
#240
ca0158bThanks @dm-balakin! - Any view scrolls when its style says so, anAnimated.Viewtoo:overflow: 'scroll'scrolls, as in CSS, andoverflowXandoverflowYscroll one axis (they win overoverflow).ScrollViewis now a view with that style, its children in a content container, and it always scrolls;scrollIndicatorsandonScrollare props of everyView. Nodes scroll smoothly withscrollTo()/scrollBy()andbehavior: 'smooth', andscrollIntoView()brings a node into view in every view around it that scrolls.Breaking:
createScrollView()and the'scroll'node type are gone: create a view withoverflow: 'scroll'.overflow: 'scroll'on a view scrolls it; it used to only clip, as'hidden'still does.scrollTo()on a node that does not scroll does nothing, as in browsers, instead of throwing.useScrollbar(ref)returns{ vertical, horizontal }, a bar for each axis, and no longer takesaxis:useScrollbar(ref, { axis: 'horizontal' })isuseScrollbar(ref).horizontal.
-
#235
9110364Thanks @dm-balakin! -useScrollbarmakes a scrollbar of your own from ordinary nodes, andScrollView'sscrollIndicators={false}leaves out the built-in one. Nodes gainscrollIndicators,clientWidthandclientHeight. -
#234
5964ac0Thanks @dm-balakin! - The web runtime now lays out with Yoga, the engine's own, compiled to WebAssembly: a plugin UI gets the same boxes in the browser as in a plugin. CSS only draws them. Text wraps as natively, only at spaces and line breaks, text and inputs sit on the same baselines, and scroll views draw the JUCE runtime's thin indicators in place of the browser's scrollbar. Under a strict Content Security Policy the page needswasm-unsafe-eval.
Patch Changes
-
#239
8a8f912Thanks @dm-balakin! - The wheel with Control, which is how a browser reports a trackpad's pinch, no longer scrolls a scroll view: the browser zooms the page as it does elsewhere, unless plugin code callspreventDefault()to zoom something of its own. Before, a pinch over the plugin scrolled its content and the page could not be zoomed from there. And a wheel no scroll view can use any more, at the end of its content, now goes on to the page, as natively to the host: a page zoomed past the window can be scrolled with the pointer over the plugin. -
#238
2daa8a0Thanks @dm-balakin! - Scrolling a scroll view from code (scrollTo,scrollBy,scrollTop,scrollLeft) now fires itsscrollevent in the web runtime too, once, on the browser's next frame, as in the JUCE runtime; dragging or pressing its scrollbar fires it at once, as the wheel does. -
#235
9110364Thanks @dm-balakin! - A mouse can use a scroll view's indicators: near the scroll view's edge a track appears under a grown bar, which can be dragged, and a press on the track jumps there. After touch, indicators show only while scrolling.