summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm
Commit message (Collapse)AuthorAgeFilesLines
* wasm: Set input field size to 1x1Even Oscar Andersen9 hours1-2/+2
| | | | | | | | | | It seems, for 6.10.x, the size of the input field affects the user interface. Set to 1x1 to minimize the effect. Fixes: QTBUG-141054 Pick-to: 6.10 Change-Id: Id9cc0a84d7cf2f700c4df2155210569b1372e19f Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: a11y - Handle case where a child does not have a childIndexEven Oscar Andersen37 hours1-13/+14
| | | | | | | | Some interfaces will return -1 for childIndex. Work around this by adding an explicit test. Change-Id: I703f20f8d57ed4cb7e69efd87e03c68eb30aec90 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: a11y - Implement fast lookup in eventhandlerEven Oscar Andersen45 hours2-25/+30
| | | | | | | | | | Store the interface with the element when registering the handler, extract it in the eventhandler. Limitations, only one interface for each element. Change-Id: I68b0cf63cf4fa4dfa2f851ae40a6c1f9e6f868e7 Reviewed-by: Morten Johan Sørvig <[email protected]>
* a11y: Add Switch roleLars Schmertmann9 days2-0/+37
| | | | | | | | | | | | | | | Distinguishing a Switch from a CheckBox is necessary on at least Android. Windows uses the already available IToggleProvider interface, which gets correctly recognized as a switch when used with UIA_ButtonControlTypeId. [ChangeLog][QtGui][QAccessible] Added new Switch role that can be used instead of CheckBox for more accurately communicating the elements role to assistive technology. Fixes: QTBUG-139676 Change-Id: I77d33ea5ad32e58ba01c63c418c11ccc25d19c54 Reviewed-by: Michael Weghorn <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* wasm: a11y - Consider partially checked state of checkboxLars Schmertmann2025-10-081-1/+3
| | | | | | | | | https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate Task-number: QTBUG-139676 Change-Id: I2b51cd5616cd9b374c1920a321555a4c49d033df Reviewed-by: Even Oscar Andersen <[email protected]> Reviewed-by: Morten Johan Sørvig <[email protected]>
* Prefer using namespace Qt::StringLiteralsMarc Mutz2025-10-041-1/+1
| | | | | | | | | | | | | | | | | ... over Qt::Literals::StringLiterals. The latter works, but is needlessly verbose. Since such code is copy'n'pasted, use the preferred form everywhere, to avoid proliferation. The docs have been fixed to suggest the shortcut in a separate commit. As a drive-by, move them to their preferred location, after the QT_BEGIN_NAMESPACE, but only if they were far away to begin with. Pick-to: 6.10 6.8 6.5 Change-Id: I0325f749f3b5a331d9c6af458a9bd3bb70d4aa3b Reviewed-by: Paul Wicking <[email protected]>
* wasm: a11y - Add selenium text testsEven Oscar Andersen2025-09-162-0/+14
| | | | | | | | | Also add support for jspi. Fixes: QTBUG-139785 Fixes: QTBUG-129735 Change-Id: Ifd251fd0cd738d2c089084f4fd6d65dd0a7e91e5 Reviewed-by: Piotr Wierciński <[email protected]>
* wasm: a11y - Better handling of missing ParentChanged callbacksEven Oscar Andersen2025-09-162-16/+74
| | | | | | | | We make linkToParent fault tolerant. Among other things make sure that a selected item is still selected after this function returns. Change-Id: Id8ff2a2a24b32f493665730cdfd3ef69731819f0 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: Make ObjectShow set visibility true regardless of stateEven Oscar Andersen2025-09-101-3/+2
| | | | | | | | The state seems to have not been updated when ObjectShow is called. Change-Id: Ia3a68142a5743cbae011ce5f079aeece11bd95dc Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: Use innerText for static textEven Oscar Andersen2025-09-091-2/+3
| | | | | | | | Firefox has problems with reading aria-label in a <div>, switch to innerText instead. Change-Id: Ic49f212dffa76b8b51b06e001f968bf463d7ed36 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: a11y - Implement ParentChanged callbackEven Oscar Andersen2025-09-082-0/+37
| | | | | | | | | | | | | | | | Implement the QAccessible::ParentChanged callback. Probably not possible with a perfect implementation. What can reasonably be done is to issue ParentChanged on; QWidget::setParent, QWindow::setParent, QQuickItem::setParentItem. However calling these functions do not necessarily map 1:1 to QAccessibleInterface::parent(). Fixes: QTBUG-138802 Fixes: QTBUG-134923 Change-Id: Iac4ac7843ba904bf0b7aa9964ee68a94294ad979 Reviewed-by: Morten Johan Sørvig <[email protected]>
* Deprecate and remove traces of RasterGLSurfaceTor Arne Vestbø2025-09-031-1/+0
| | | | | | | | | | We no longer use this hybrid surface type approach for Qt Widget's composition mode. Nowadays we use RHI to compose the widget texture and the native textures, and the window surface type depends on the RHI API in use, e.g. QSurface::MetalSurface, or QSurface::OpenGLSurface. Change-Id: I85001100f681a1cf524b8b7dc50f680a9579b447 Reviewed-by: Laszlo Agocs <[email protected]>
* wasm: a11y - handle text inputEven Oscar Andersen2025-08-295-24/+74
| | | | | | | | | | | | | | The composition callbacks operate on the selected object only. So what we need to do is to make sure that if a11y is enabled, we do not operate on QWasmInputContext::m_inputElement. This also means that we duplicate some code between QWasmInputContext and QWasmAccessibility, which updates the input element on focus changes. Fixes: QTBUG-135590 Change-Id: I722aaccc89f300621e4d0eb74b12a93c0176c444 Reviewed-by: Morten Johan Sørvig <[email protected]>
* Clear focusHelper/innerHTML without looking at event/target II/IIEven Oscar Andersen2025-08-251-1/+1
| | | | | | | | | | The target does not match our inputElements so it can't be used. This is the second patch to handle a missed case. Pick-to: 6.10 Change-Id: I871257f19ce8011dce651983b335663bd21fc3c6 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: a11y - set tabindex -1 on invisible itemsEven Oscar Andersen2025-08-251-1/+7
| | | | | | Task-number: QTBUG-134657 Change-Id: I1c4f8e076397782697c20887461289efb4d38a75 Reviewed-by: Lorn Potter <[email protected]>
* Clear focusHelper/innerHTML without looking at event/targetEven Oscar Andersen2025-08-222-12/+12
| | | | | | | | The target does not match our input elements so it can't be used. Pick-to: 6.10 Change-Id: I325d2419d2d5f7cb9dd13fbc19eb1e7e8beaedef Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: Clear focushelper on inputEven Oscar Andersen2025-08-192-9/+17
| | | | | | | | | | | | | | focusHelper needs to have contenteditable set, which causes innerHTML to contain all input received. Fix this by clearing "innerHTML". This assumes focusHelper does not have any children. Pick-to: 6.10 Change-Id: I6d9b04808d347990e99156be223440f32989d1ac Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: a11y - Fix possible crash in removeObjectEven Oscar Andersen2025-08-061-2/+3
| | | | | | | Add missing tests for isNull() for "parentElement". Change-Id: I3c027c30ea753d3a67ed12828fed553d8f447f43 Reviewed-by: Lorn Potter <[email protected]>
* wasm: a11y - Fix spinbox/sliderEven Oscar Andersen2025-07-281-24/+19
| | | | | | | | | | | Use the value property as the value attribute is for initialization. Use number type for both. Add minimumValue, maximumValue, minimumStepSize. Remove listener, input is handled by Qt. Task-number: QTBUG-134655 Change-Id: I130b4f12d6fd3f83ab2393ca2d8740257dcc3b0f Reviewed-by: Lorn Potter <[email protected]>
* wasm: Switch to a hierarchical element structureEven Oscar Andersen2025-07-222-24/+73
| | | | | | | | | | | | | When showing QWindows traverse from accessibleRoot. Create elements from ObjectCreated for quick, and ObjectShow for widgets. Delete elements from ObjectDestroyed for both. Fixes: QTBUG-137448 Change-Id: I937f8de8cf3bcb4408a5091a8c15b1cdc03d19e4 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: Prepare for hierarchical structureEven Oscar Andersen2025-07-222-55/+94
| | | | | | | | | | | | | | | Replace ensureHtmlElement with getHtmlElement. Later populateAccessibilityTree will create the elements as needed. Create elements when receiving the ObjectCreated event. Destroy elements when receiving the ObjectDestroyed event. Create the parent link in a separate linkToParent function, moved from setHtmlElementVisibility. Change-Id: If2544cffee943fbc34a2c1d4c557fa0fdb751db3 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: a11y - work on create/destroy interface logicEven Oscar Andersen2025-07-222-4/+33
| | | | | | | | | Do not store invisible items, remove them instead. Handle ObjectDestroyed callback. Change-Id: I2dd8909e7640cabb9a258fd3780ba89301373162 Reviewed-by: Morten Johan Sørvig <[email protected]> Reviewed-by: Piotr Wierciński <[email protected]>
* wasm: Introduce wasmdeployqtPiotr Wiercinski2025-07-161-1/+2
| | | | | | | | | | | | | | | | | | | Introduce wasmdeployqt which is analogous to other deployment tools that we currently have like "windeployqt" or "androiddeployqt". Running wasmdeployqt makes it much easier to deploy and ship dynamically linked WebAssembly applications. In case of statically linked applications this tool does not provide any extra value as static apps are ready to be shipped by default. This commit also removes older python scripts which were supposed to serve this same goal as well as some cmake machinery arround it. Fixes: QTBUG-134580 Change-Id: Ib5c8ab128f49897f91c510bfec03b0b772e6548a Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: move setting of input type to updateInputElement()Morten Sørvig2025-07-161-10/+8
| | | | | | | | | | | | | | | | | | | | This is after we set m_inputElement to focusWindow->inputElement(), at this point m_inputElement should be the correct input element. Simplify the implementation a bit: - don't check if the focused UI element accepts complex input, we are only interested if it's a passoword-type input or not here. - set "type" unconditionally, which avoids a crash on "type" not defined, which started happening after recent refactorings. Pick-to: 6.10 Change-Id: Iba342e7adcacdaa6a3d7b7f7e9c7cfe7c30a6177 Reviewed-by: Lorn Potter <[email protected]> Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: Handle multiple mime types in the clipboardMorten Sørvig2025-07-161-71/+27
| | | | | | | | | | | | | | | | | | | | | Create a single ClipboardItem with several mime types instead of multiple ClipboardItems (multiple clipboard items are allowed by the API, but generally not supported by the browsers) Support the web standard mime types for now: text/plain, text/html, and image/png. Adding extra mime types (e.g. text/markdown) may cause the browser to reject the ClipboardItem. Later, we can add support for testing if additional mime types are supported. Done-with: Even Oscar Andersen <[email protected]> Done-with: Volker Hemsen Fixes: QTBUG-138044 Fixes: QTBUG-125366 Pick-to: 6.10 Change-Id: I6adbf239597576e393da824232c5933e76ad851f Reviewed-by: Even Oscar Andersen <[email protected]> Reviewed-by: Morten Johan Sørvig <[email protected]> Reviewed-by: Lorn Potter <[email protected]>
* wasm: move input event handlers to QWasmWindowMorten Sørvig2025-07-165-166/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | Attach input event handlers to the m_window elemement, and make the input context input element be a child element of m_window. Forward input and composition events to QWasmInputContext when it is active. Add a new focusHelper hidden child element which takes focus whenever the window has focus and the input element does not. Using a focus helper means we don't have to set contentEditable on m_window and avoid the side effects caused by that. Make the focus helper take focus on window focus, instead of the canvas. This setup ensures that the window can receive and intercept input events during the event capturing phase, regardless of which child event has focus. This also allows for placing focus on the accessibility elements; QWasmWindow can then decide if it wants to intercept events or pass them through, based on event type and target. Pick-to: 6.10 Change-Id: I9ec6f8e8f7ec0878009eddd05642dc146ea3944f Reviewed-by: Lorn Potter <[email protected]>
* wasm: rewrite handleKeyForInputContextEvent() logicMorten Sørvig2025-07-161-31/+33
| | | | | | | | | | | | Avoid using the "if with fallthrough" pattern. The code is building up a logical expression in order to determine if it should send a key event or not, which can be done more cleanly with boolean variables and sub-expressions. Pick-to: 6.10 Change-Id: I2af3501d1c199e1f7f49f8417a21eece219e11ff Reviewed-by: Lorn Potter <[email protected]> Reviewed-by: Even Oscar Andersen <[email protected]>
* wasm: input context code cleanupMorten Sørvig2025-07-161-69/+59
| | | | | | | | | | Return early on null/undefined inputType string, remove else block and reduce indentation. Pick-to: 6.10 Change-Id: I7d5b52b28fef566f6e3f6fa944246484dfb79b97 Reviewed-by: Even Oscar Andersen <[email protected]> Reviewed-by: Lorn Potter <[email protected]>
* wasm: input context code cleanupMorten Sørvig2025-07-162-45/+36
| | | | | | | | | | | | | | | QWasmEventHandler takes a lambda, capture "this" as state instead of storing it on the event target. Use QString::fromEcmaString() for string conversion. Use isNull() and isUndefined() checks on emscripten::val, instead of creating new null/undefined objects. Pick-to: 6.10 Change-Id: I80f24868f943ad46f05ca527c1129e29660970a7 Reviewed-by: Even Oscar Andersen <[email protected]> Reviewed-by: Lorn Potter <[email protected]>
* wasm: change input element type to password for password echo modeLorn Potter2025-06-261-0/+10
| | | | | | | Fixes: QTBUG-133631 Pick-to: 6.9 6.10 Change-Id: I930de385a24229a7e47f8f80eb607fc59be19d30 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: a11y - Implement support for disabled attributeEven Oscar Andersen2025-06-132-1/+15
| | | | | | Fixes: QTBUG-137449 Change-Id: I6aa07c7108b5ad14c12e6f24e71b8dda12fec483 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: don't recreate WebGL context on surface changeMorten Sørvig2025-06-123-79/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The native WebGL context is tied to a single canvas, and can only be used with that canvas. (Qt creates one canvas per QPlatformWindow). This means that we need new native contexts in cases where a QWindow is repeatedly created and destroyed. It can be tempting to just create a new WebGL context "behind the scenes" on the makeCurrent() call in this case, but this does not work since GL resources created by user code with the original WebGL context in place are now invalid. Inform user code that this has happened by signaling a context loss. This is done by returning false from makeCurrent(), and then making sure isValid() returns false as well. The context becomes invalid whenever the owning platform window is destroyed; add a call from ~QWasmWindow() which handles that bookkeeping. Pick-to: 6.10 Task-number: QTBUG-120138 Change-Id: I929b9bb51153007c16630b1a991399f01ebffa62 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: Fix stacking order problem for transient parent windowsEven Oscar Andersen2025-05-2611-419/+733
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows with a transient parent does not reflect the relationship in the stacking order. Essentially AboveTransientParent is missing as a configuration choice. What makes this slightly convoluted is that the window stack does not depend on the window (for testability). We solve this problem by making the stack and treenode templates, and provide test class as arguments when testing. QWasmWindow and QWasmScreen are not templated as before. There is also a new order type StayAboveTransientParent. Which means that we can no longer use order type to get to the group location (Since StayAboveTransientParent can map to either of the three types). The window stack tests have been updated to handle the StayAboveTransientParent type. Finally, we do not do anything with a normal parent child relationship as this should already work correctly. Fixes: QTBUG-131699 Change-Id: Ie08e18f9e0a2339175c4a09da0a831f031df71e1 Reviewed-by: Lorn Potter <[email protected]>
* wasm: ignore keypresses if alt and numeric keyboardEven Oscar Andersen2025-05-191-0/+8
| | | | | | | | | | | | When left-alt + num lock activated + number pressed the number was inserted in the text. However in this input mode a 4 digit keycode is used to insert a special character, it is wrong to insert the individual digits in addition Fixes: QTBUG-136799 Pick-to: 6.9 6.8 Change-Id: Iebafd1dfe5df1701a87a824ed99a440b122f0c57 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: a11y - move to describedbycontainerEven Oscar Andersen2025-05-193-80/+143
| | | | | | | | | | | | aria-description is more rarely supported than aria-describedby. So switch to the latter. Create a new container inside the a11yContainer. Handle DescriptionChanged to update description in one place only Task-number: QTBUG-134657 Change-Id: I0d025e5739451e6fab133c2590fd20ea13e2d946 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: a11y - Use <div> for StaticTextEven Oscar Andersen2025-05-151-4/+6
| | | | | | | | | VoiceOver reads the readonly textarea as "Multiline text field, read-only, double tap to edit” Fixes: QTBUG-136665 Change-Id: I809a842795a18bcd0756d39b0f6240981b762ef9 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: set focus to m_canvas instead of m_windowEven Oscar Andersen2025-05-144-36/+17
| | | | | | | | | | | | | | | | | | | | | | Setting focus and contentEditable on m_window causes innerHTML to build up with characters. This does not happen when using the m_canvas The downside is that m_canvas is aria-hidden, but this should, in principle, not be a problem since m_canvas should not be focused when a11y is in effect. Later aria-hidden might be set only if a11y is in effect. This is a candidate for manual cherry-picking to 6.9 6.9.1 Task-number: QTBUG-136687 Change-Id: I08a9db2c39f9b0b0038c75fd06d3504b736ea031 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: handle changes in inputMethodAccepted()Even Oscar Andersen2025-05-132-10/+14
| | | | | | | | | | | | | The result of inputMethodAccepted() function might switch after setFocusObject()/showInputPanel() has been called. End result it was not picked up and not acted upon. It turns out update() is called after this flag is set, so check for changes in the update() function. Task-number: QTBUG-136687 Change-Id: I585cc82f2a177bb7708627102d3074a627d0f024 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: Fix keyboard popping up on cell and tabletsEven Oscar Andersen2025-05-081-0/+2
| | | | | | | | | | | | The fix for text/button broke cellphones and tablets. (QTBUG-136562) The fix is reverted on 6.9, and fixed here on 6.10 The fix is to set inputMode so that it matches the focus. Change-Id: I88b0a32787ff97b6f5b057e4ebd240f565b5a284 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: a11y - refactor set/get attribute/propertyEven Oscar Andersen2025-05-072-90/+126
| | | | | | | | | Add setAttribute, setProperty, addEventHandler functions to reduce linelength and improve readability. Task-number: QTBUG-134657 Change-Id: I7deb1ac13872291b848c191198d741669d852e3a Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: Update input field geometry on window geometry changeEven Oscar Andersen2025-05-023-22/+45
| | | | | | | | | | The location of the input field was wrong leading to empty space inserted in the user interface. Fixes: QTBUG-136233 Pick-to: 6.9 6.8 Change-Id: Ic8c9faf5c4dbb8cec43a43c25c1cce8d7809f140 Reviewed-by: Piotr Wierciński <[email protected]>
* wasm: call "focus" on window, not canvasEven Oscar Andersen2025-05-021-1/+2
| | | | | | | | | This is necessary to have correct focus handling on webassembly/ubuntu without this change tabbing from text input to f.ex a button would not work. Change-Id: I78eaa6202d8bdb87b1195d5c38a3f73570a49c90 Reviewed-by: Piotr Wierciński <[email protected]>
* wasm: a11y - add back incorrectly removed focus handlerEven Oscar Andersen2025-05-011-0/+4
| | | | | | Task-number: QTBUG-135024 Change-Id: Ia0b5dba60985e36899a5bee116ab2f6cb05c602c Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: Make sure cellphone keyboard does not show needlesslyEven Oscar Andersen2025-05-011-0/+1
| | | | | | | | | | The last fix for QTBUG-136050 did not set inputMode "none" which causes the keyboard to be visible on cell phones and tablets. Fixes: QTBUG-136050 Change-Id: If8c97fb009c10ff5338ce7e6516ca2c5a992d0d0 Reviewed-by: Lorn Potter <[email protected]>
* wasm: Make sure typing with window focus does not produce charactersEven Oscar Andersen2025-04-294-9/+33
| | | | | | | | | | contenteditable on the window caused characters to be inserted. Instead create a div as a child element, and set contenteditable on that. Fixes: QTBUG-136050 Change-Id: I4ccf3589ea19876f68bb9c7077c3a13ae5f989e6 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: Install cut/copy/paste handlers on window for not chromeEven Oscar Andersen2025-04-281-1/+1
| | | | | | | | This is how it used to be. More changes are needed to fix cut/copy/paste. Change-Id: Ib5073b82a568a391581f0b4d8369eaab57fd8f19 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: fix clipboard event handler leaksMorten Sørvig2025-04-254-28/+32
| | | | | | | | | | | | | Use QWasmEventHandler instead of calling addEventListener() directly (using QWasmEventHandler also allows supporting JSPI). The QWasmEventHandler destructor calls removeEventListener(), which should make sure everything gets cleaned up. Keep the Chrome-specific global (document) event handler code path, but register once at startup instead of once per window. Change-Id: If4314df738afc0dcfdb0f6f1ab9e1f176e1812ac Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: set aria-hidden for input context elementMorten Sørvig2025-04-231-0/+1
| | | | | | | | | This element is not a part of the accessibility implementation, and should not be visible to the screen reader. Change-Id: Ifb8c404f7dd5a916cd42856b1f6b4529f2fb3ae0 Reviewed-by: Piotr Wierciński <[email protected]> Reviewed-by: Even Oscar Andersen <[email protected]>
* wasm a11y: Fix typo in commentsMichael Weghorn2025-04-231-2/+2
| | | | | | | This amends 593c7b9be40f3fa876ffadd7518795a333dc5b74. Change-Id: Iae1e46cb9b85eb1c47e02b286aa832d2e3b92dac Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: Reduce usage of the id attributeEven Oscar Andersen2025-04-222-10/+31
| | | | | | | | | It is not always required, limit it to the cases where it is explicitly given, or if it is necessary. Fixes: QTBUG-135024 Change-Id: I451379d86543e2297574d4cda09ef825736f9c5d Reviewed-by: Morten Johan Sørvig <[email protected]>