aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix spec compliance for the RegExp constructorLars Knoll2018-08-153-31/+76
| | | | | Change-Id: I767b27faab912e91962797ca154d929473113cc1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix some details in RegExp handlingLars Knoll2018-08-156-46/+52
| | | | | Change-Id: If9f7c07ea657ba8503b9188a7b77e301f23423ef Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement RegExp.prototype[Symbol.replace]Lars Knoll2018-08-155-64/+182
| | | | | Change-Id: I5a2c9cb1e9dcca664526b3949671d72d2ffee427 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement RegExp.prototype[Symbol.search]Lars Knoll2018-08-153-18/+36
| | | | | Change-Id: Ie966628d020eb010eb5ecc3279fed2b002975728 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement String.prototype.match as per ES7 specLars Knoll2018-08-152-31/+17
| | | | | | | The implementation is supposed to call arg[Symbol.match]. Change-Id: Ia8028d259e152b1e65eb6b0e817ef60bdc0d37e2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Improve RegExp.prototype[Symbol.match] implementationLars Knoll2018-08-154-30/+70
| | | | | Change-Id: Id632a4f4648f68f3b46d31f84e4ee05c86391f3e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Cleanup RegExpObjectLars Knoll2018-08-1512-210/+256
| | | | | | | | | | | Move properties from RegExpObject to getters in RegExp.prototype to be compliant with the JS spec. Implement support for the sticky flags ('y') and correctly parse the flags in the RegExp constructor. Change-Id: I5cf05d14e8139cf30d46235b8d466fb96084fcb7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Partial implementation of RegExp.prototype[Symbol.match]Lars Knoll2018-08-153-62/+98
| | | | | Change-Id: Id94c3cc25835b53bae08713cdd8f2e384d907690 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix explicit export of imported variablesSimon Hausmann2018-08-143-4/+24
| | | | | | | | | | | | | | | | | | | | Instead of using a re-export, it's also possible to write import { foo } from "./bar.js" and then export it again export { foo } Typically exported variables are referenced from the locals, but since we don't add imports to the locals, we need another way of locating them. This patch uses the index space after the locals in the internal class for imports, so that after we've identifier the export in the local export entry table, we can use the local name to search in the internal class and find imports past the locals. Change-Id: I58ab79ad3df1bbc1b972f0a2771d9ca1268de27b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Simplify ES module body handlingSimon Hausmann2018-08-145-100/+17
| | | | | | | | | Now that ImportDeclaration and ExportDeclaration are also statements in the AST, we can get rid of the ModuleItemList in the AST. We keep it in the grammar, but map it to a statement list. Change-Id: I4cab29fe9b075e88454fe3b194126f728000856a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix module dependency handlingSimon Hausmann2018-08-1410-47/+54
| | | | | | | | | | | | | | | | | | | | | The evaluation of a module can have side-effects by modifying the global object or objects in it. Therefore even a seemingly empty import such as import "./foo.js" needs to be listed in the module requests. It's also important that they are evaluated in the order of declaration. Therefore we collect all module requests separately - even those that don't have import variables to process. This patch also ensures that the export and import declarations are visited in the correct order, by unifying both AST nodes to be hooked into the statement list. The fact that we connect the module list items into a statement list is solely an artifact of re-using defineFunction() which takes a StatementList as body. Change-Id: I75dc357b2aecfc324d9a9fe66952eff1ec1dfd8a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix multi variable module import listsSimon Hausmann2018-08-142-4/+1
| | | | | | | | Select the correct head when finishing the linked list for ImportList AST nodes. Change-Id: I34ae2ccfd0e969dbd92ce2458de019bb02046aa5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Improve error handling for non-existent file importsSimon Hausmann2018-08-141-1/+3
| | | | | Change-Id: Ic043d30738c97836cf6afada6ee7cade23bf50f9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Implement star re-exportsSimon Hausmann2018-08-142-8/+30
| | | | | | | | | | | An export such as export * from "./foo.js" allows re-directing imports. Change-Id: I359ce7d4516ed4a7b95e6fcefb4725d854f9c2ce Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Implement initial support for import namespacesSimon Hausmann2018-08-145-34/+134
| | | | | | | | | | | | | The import via import * as foo from "./bar.js" allows accessing all exports via the special namespace object. This is conceptually quite similar to the existing import of .js files in QtQuick. Change-Id: Ia6d79342f0884a89dfe4dc07316570ca7789cac0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Implement indirect exports in modulesSimon Hausmann2018-08-143-24/+63
| | | | | | | | | This allows exports in the style of export { foo as bar } from "./baz.js" Change-Id: I2f723c3d9c5fbc530a30ac5bcb12a02f21918648 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQuickTableView: rename attached prop tableView to viewRichard Moe Gustavsen2018-08-133-10/+10
| | | | | | | | ListView calls the same attached property for 'view'. So do the same for TableView. Change-Id: I99034869813750e2fab56fe6ffcc4b4a6a4d9c52 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* StorageModel manual test: use enum class for Column enumShawn Rutledge2018-08-112-48/+48
| | | | | | | | We should set a good example by using enum classes more: internally, in examples, and in manual tests which might become examples eventually. Change-Id: Ife6f3b8eaf2f534d474c35e34370361d026f2c47 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Enable the Yarr JIT for regexps with nested parenthesisLars Knoll2018-08-113-2/+11
| | | | | Change-Id: I4e7a44ae2b5759febec6f83ab9fa85612515ab04 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Get rid of the Macro assembler for ARMv6 and earlierLars Knoll2018-08-117-3083/+0
| | | | | | | | We've not been using it for quite some time, and the interpreter is the better fallback option there. Change-Id: If4d698115eec6038b369586ebdd8c1e4b88ea0ba Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Get rid of the SH4 macro assemblerLars Knoll2018-08-116-4520/+0
| | | | | | | | It's not being used afaict, and is completely untested. If someone wants to use QML on SH4, the interpreter will have to do. Change-Id: I609c0646b19120abca5ad1ee893de9ec944d8dbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix support for default exports in modulesSimon Hausmann2018-08-109-34/+87
| | | | | | | | | | | Default export declarations require a binding setup step at run-time, so we hook it into the ESModule's statement list to make it visible to the code gen visitor. We also reserve local slot zero for the default export. Change-Id: Ie064caad0422b92cfdadbd7d94db72a05e95c0cc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQuickTableView: remove cacheBuffer from the public APIRichard Moe Gustavsen2018-08-1013-38/+0
| | | | | | | | | | | | | | | | | | As discussed during API review, remove cacheBuffer from the public API. The cache buffer was a feature inherited from ListView to avoid loading a lot of items (and affect performance) when the user started to flick. But now that TableView has support for reusing items, the point of the cache buffer is more or less gone. At least we choose to remove it from the public API until we have better understanding if this is really needed. Note that the cacheBuffer still plays a small role internally, so we don't remove it from the implementation. We want to preload an extra row and column for reuse at start-up, since you often cannot reuse the first row and column during the first flick (they will still be visible on the screen). Change-Id: Ie62835a04ac29a84c9a76151b73fe2f75d9ae844 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTableView: add a 'forceLayout()' function to the public APIRichard Moe Gustavsen2018-08-104-5/+131
| | | | | | | | | | | | | | | | | This function needs to be called from the application whenever it needs to change column widths (or row heights) for the currently visible columns. Changing column widths is done by changing what values the columnWidthProvider returns. But TableView doesn't know that the assigned function has new values to return for the current columns. Calling 'forceLayout()' will inform about this, and trigger a re-layout. Change-Id: I3cf15bbfb522baf93c7e01a34841e54455a098b9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Enable unicode regular expressionsLars Knoll2018-08-1011-24/+30
| | | | | | | Add support for the 'u' flag for regular expressions. Change-Id: I409054eaa9c50183619752d14f2638f5a38c0ea7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Update Yarr to the latest version from WebKitLars Knoll2018-08-1059-1694/+6163
| | | | | | | | | | | Updated Yarr to a to commit 4d2a53d60487cb1f8b2a9a1e9f684af336fd7d2c in WebKit. Adjusted the yarr code base to work with our older version of wtf and masm. Change-Id: I04b4593ece051e1d7aa087b87aa08c92595d1098 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Blacklist shadersource-dynamic-shadersource::test_endresultJoni Jantti2018-08-101-0/+2
| | | | | | | | This autotest fails on Ubuntu 18.04. Task-number: QTBUG-69893 Change-Id: If1af2baff0019fb8c9e6e9a30b8a56137ec57366 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* QQuickTableView: rename enforceFirstRowColumnAtOrigo to enforceTableAtOriginRichard Moe Gustavsen2018-08-102-3/+3
| | | | | Change-Id: Ib2a60bd8994bded2299ff96ac73137c9267398fa Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Update qtdeclarative-testsuitesJani Heikkinen2018-08-101-0/+0
| | | | | | Task-number: QTBUG-69754 Change-Id: Ib88ad63e13f0598608d9305aeae77fd409e52ef7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQuickTableView: override contentWidth/Height propertiesRichard Moe Gustavsen2018-08-094-6/+117
| | | | | | | | | | | | | | | | | TableView uses contentWidth/height to report the size of the table (this will e.g make scrollbars written for Flickable work out of the box). This value is continuously calculated, and will change/improve as more columns are loaded into view. At the same time, we want to open up for the possibility that the application can set the content width explicitly, in case it knows what the exact width should be from the start. We therefore override the contentWidth/height properties from QQuickFlickable, to be able to implement this combined behavior. This also lets us lazy build the table if the application needs to know the content size early on. The latter will also fix problems related to querying the content size from Component.onCompleted. Change-Id: Ife7ef551dc46cf15d6940e3c6dff78545a3e4330 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add initial basic support for ES6 modulesSimon Hausmann2018-08-0930-73/+905
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The entry point from the parsing perspective into modules is not QV4::Script but QV4::ExecutionEngine::compileModule. For convenience, the ESModule AST node gets a body, which is the statement list connected between the ModuleItemList items that are not import/export declarations. The QV4::Module allocates a call context where the exported variables are stored as named locals. This will also become the module namespace object. The imports in turn is an array of value pointers that point into the locals array of the context of the imported modules. The default module loading in ExecutionEngine assumes the accessibility of module urls via QFile (so local file system or resource). This is what qmljs also uses and QJSEngine as well via public API in the future. The test runner compiles the modules manually and injects them, because they need to be compiled together with the test harness code. The QML type loader will the mechanism for injection in the future for module imports from .qml files. Change-Id: I93be9cfe54c651fdbd08c5e1d22d58f47284e54f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build warning in tst_drawingmodesTor Arne Vestbø2018-08-091-2/+2
| | | | | Change-Id: Ie6cee9c4cf549eb582f86436908d6f3481026a72 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQuickTableView: change how we calculate content sizeRichard Moe Gustavsen2018-08-093-17/+180
| | | | | | | | | | The current calculations where a bit off. Change it to be precise, and add an auto test to verify the contentWidth/Height ends up correct as the flickable is flicked towards the end of the table. Change-Id: I784a1bba2ea8fddd09cee8ecda7e2089c8b5c74f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TableView Conway's Game of Life exampleNicolas Ettlin2018-08-099-1/+688
| | | | | | | | | | This new example shows how a Conway's Game of Life implementation can be created with QML and the new TableView component. Change-Id: I940210c5e5a0554e6f052ff109070e69e59cab56 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* JS: Also have modulo return integer 0 when the lhs is 0Erik Verbruggen2018-08-091-4/+7
| | | | | | | | | | | | | | When both operands of a modulo are integers, and the right-hand side is bigger than zero, it is fine to have the left-hand side be 0, as the result is (positive) zero. This also handles the somewhat common case below, where lhs is 0, and where returning a double would result in the slow path to do the actual array access: array[lhs % array.length] Change-Id: I4ca268a08604c3c77a23a92eee193c807696d5ba Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Compressed textures: Replace file decoding code with QtGui functionalityEirik Aavitsland2018-08-0912-690/+60
| | | | | | | | | | The functionality for reading and decoding texture files (currently pkm and ktx formats) is now available in QtGui util API. Utilize that instead of keeping equivalent code here. Task-number: QTBUG-67026 Change-Id: Icb7c348eaa51cd15e41031508ef54164fc876c9e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix ASAN warnings about new-delete-size-mismatchSimon Hausmann2018-08-081-1/+9
| | | | | | | | | | | | | | | | | | The optimization of allocating memory for a QML type along with its declarative data in one shot works well and has worked well for many years. However ASAN complains about it, because when the delete expression is called from _anywhere_ on for example a QQuickItem, the size returned by the virtual destructor and then passed to operator delete is less than what was allocated earlier (to include the declarative data structure). Fix this by providing an operator delete for the final QQmlElement class that we _do_ allocate, which is passed along by the virtual destructor. That operator ignores the size and thus silences ASAN. Task-number: QTBUG-58524 Change-Id: Ibb6120e7e07301bb4602130064c5157b21ec2202 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Add missing header guardJędrzej Nowacki2018-08-081-0/+5
| | | | | Change-Id: I58aaa65047c3b7244cb69a84117b41453ff9ee0a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix ASAN error about new-delete-size mismatchSimon Hausmann2018-08-081-1/+4
| | | | | | | | | | When object cache for list model items is a plain QObject that was allocated together with declarative data in one go. Since we control the site of deletion, we can call the destructor manually as well as operator delete to avoid the ASAN error. Change-Id: I346d6ef34876cb495573ba9cfbc68be92dd937ab Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* QQmlTableInstanceModel: remove false assertRichard Moe Gustavsen2018-08-071-6/+18
| | | | | | | | | | | | | | There current assert turned out to not be valid for all cases. If the model is currently incubating an object, m_modelItems list will contain it, but the view will not. So be more specific what we check. Also, we need to release the object for items that are being incubated. The code snippet for doing that is more or less the same as found in the destructor of QQmlDelegateModel. Change-Id: I84b4286a037b27ad809c3a63afed94ce61febc19 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTableView: don't access the model from the destructorRichard Moe Gustavsen2018-08-072-20/+15
| | | | | | | | | | | | | | Calling clear() from the destructor is problematic, since clear() will try to access the application model, which has typically already been destructed at that point. Instead we should just clean-up any local resources. Since we don't really have a need for the clear() function anymore, we move the code where it belongs: into the beginRebuildTable() function. Task-number: QTBUG-69554 Change-Id: Ic43704c71407e805427de27cf10dbdeeae475ba8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTableView: improve draining of reuse poolRichard Moe Gustavsen2018-08-075-18/+152
| | | | | | | | | | | | It turns out that using a maxTime of 2 when draining the pool was a bit naive. If e.g the width of the table is greater than the height, it starts releasing pooled items to quickly. So change the logic to be more dynamic, and to calculate what the maxTime should be based on the geometry of the table. Change-Id: Ifeed62789575f98cff063f550f45eb54ef312fdb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTableView, auto test: ensure we flick more than one pageRichard Moe Gustavsen2018-08-071-1/+1
| | | | | | | | | The included test only flicked one page while testing reusing of items. This must have been an oversight. It should flick several pages while running the test. Change-Id: I74899a540c9428c663bbf35b78e260c26ddaf700 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Minor cleanupSimon Hausmann2018-08-062-5/+5
| | | | | | | | | | | | | | | Rename bool String::compare(const String *other) to the slightly more self-explaining bool String::lessThan(const String *other) as the returned boolean value does not relate to equality. Change-Id: Ia7b1a7f47beca0659fb199c0c9d49951468ad03d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add sidebar manual test to the main pointer test launcherShawn Rutledge2018-08-062-0/+2
| | | | | Change-Id: I16356ee214c80ff23c6b520c7ad492f86d85f986 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Modify grid example to use DragHandlerShawn Rutledge2018-08-061-17/+23
| | | | | | | | It shows that DnD is still possible even though DragHandler doesn't do anything specifically to enable it. Change-Id: I600e16c4f0f601d504fcf6b6b32ff865af2a2d67 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QQuickWindow: obey AA_SynthesizeMouseForUnhandledTouchEventsShawn Rutledge2018-08-066-68/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, AA_SynthesizeMouseForUnhandledTouchEvents has only affected behavior of QGuiApplicationPrivate::processTouchEvent, but had no effect in Qt Quick. QQuickWindow also accepts the touch event just to make sure that QGuiApplication will not synthesize mouse from touch, because it would be redundant: QQuickWindow does that for itself. Now we make it have an effect in Qt Quick too: skip mouse synthesis if it is set to false. This provides a way to simplify the event delivery. If you set it false, then you cannot manipulate old mouse-only items like MouseArea and Flickable on a touchscreen. (You can of course use event handlers for that.) [ChangeLog][QtQuick][QQuickWindow] You can now disable touch->mouse event synthesis in QtQuick by calling qGuiApp.setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, false); This will simplify and speed up event delivery, and it will also prevent any and all interaction with mouse-only items like MouseArea and Flickable on a touchscreen. Task-number: QTBUG-52748 Change-Id: I71f1731b5abaeabd9dbce1112cd23bc97d24c12a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* tst_FlickableInterop: use categorized logging rather than qDebugShawn Rutledge2018-08-061-6/+6
| | | | | | | Don't slow down CI for logging unless the test fails. Change-Id: I2d5faedf3fadb30ec5a732445d695bda7e290233 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Mark non-notifying properties in event types CONSTANTShawn Rutledge2018-08-062-43/+43
| | | | | | | | | | | | | | Event objects are valid only within the context of a JS callback that receives the object as a signal parameter, and the object will not change during the runtime of that callback. It's not true that the properties will never change, because event objects are pooled and reused; but the QML is not allowed to keep a reference to an event, so the property changes during this reuse are not meant to be seen. QQuickMouseEvent is similar, and its properties were already marked CONSTANT. Change-Id: I4985e4a27bf192779629311eb8c6c1f63d22df3e Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Setup the prototype correctly when subclassing error objectsLars Knoll2018-08-065-27/+21
| | | | | Change-Id: I5e394ef8d4d6d87bedb26070d51660e3ebe3ab1b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>