Commit Graph

4475 Commits

Author SHA1 Message Date
Gabriel Ivăncescu 58479eefea jscript: Implement Set on top of Map.
Because a Set is just a Map where key == value.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-14 23:45:29 +02:00
Gabriel Ivăncescu 15053a1d17 jscript: Compare numbers in a Map bitwise for equality.
Native treats -0 and 0 differently, so it must be doing a bitwise
comparison. This might not order the numbers correctly, but that's not
important, since we don't need them sorted other than for quick lookup
(and any arbitrary sorting is fine, as long as it's consistent).

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-14 23:45:29 +02:00
Gabriel Ivăncescu 251eda6f56 jscript: Support passing 'this' context to the Map callback when iterating.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-14 23:45:29 +02:00
Gabriel Ivăncescu 399f8b6f06 jscript: Pass the Map object to the callback when iterating.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-14 23:45:29 +02:00
Gabriel Ivăncescu 1c4e53dbce mshtml: Implement enumerator for HTMLAttributeCollection.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 20:20:06 +02:00
Gabriel Ivăncescu 201cc01d72 mshtml: Move some static functions up.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 20:20:03 +02:00
Gabriel Ivăncescu ba828a3024 mshtml: Implement enumerator for HTMLSelectElement.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 20:20:00 +02:00
Gabriel Ivăncescu f9fd7b77a2 mshtml: Implement enumerator for HTMLFormElement.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 20:19:56 +02:00
Gabriel Ivăncescu 6c98c65707 mshtml: Implement enumerator for HTMLRectCollection.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 20:19:53 +02:00
Gabriel Ivăncescu 7c311fbcc1 mshtml: Implement enumerator for HTMLStyleSheetsCollection.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 20:19:50 +02:00
Gabriel Ivăncescu 2bdce91e8f jscript: Defer lookup to the actual locals for function statements.
Functions declared as function statements have an associated local_ref and
can be changed from within themselves by using their name (by literally
changing the local variable), while function expressions can not.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 20:19:47 +02:00
Gabriel Ivăncescu 4fd955ae07 jscript: Treat NULL disps as actual null values in html mode.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-12 22:13:05 +02:00
Gabriel Ivăncescu 3485f162e9 mshtml/tests: Add initial tests for NULL Dispatch objects in scripts.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-12 21:39:42 +02:00
Gabriel Ivăncescu fa09e3f36c jscript: Throw proper error when invoking non-method builtin.
Instead of crashing.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-11 21:15:13 +02:00
Gabriel Ivăncescu 45d8af4cf3 jscript: Make idx props enumerable.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-11 21:15:10 +02:00
Gabriel Ivăncescu 0badd67e70 mshtml: Always return the custom user agent if it has been set.
This uses the undocumented MapBrowserEmulationModeToUserAgent and only the
first field of the unknown struct, but it is enough for this purpose. It
is important for some apps (e.g. FFXIV Launcher) which expects it to work
like this.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-11 21:14:53 +02:00
Gabriel Ivăncescu f858318384 jscript: Handle non-JS objects in Object.getPrototypeOf.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 17:55:01 +01:00
Gabriel Ivăncescu b4175eebc0 mshtml/tests: Test for RegExp.prototype.toString with non-regexp.
According to the ES6 spec, it should work in generic way for objects exposing
"source" and "flags", but native IE seems to not follow it here and throws.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 17:54:57 +01:00
Gabriel Ivăncescu ed55216558 jscript: Throw proper error in Object methods with non-objects args.
According to the ES6 spec, they don't throw anymore (compared to ES5),
but native IE seems to not follow it here and throws anyway.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 17:54:49 +01:00
Gabriel Ivăncescu 9785781fbc jscript: Implement Object.prototype.__defineSetter__.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 17:54:44 +01:00
Gabriel Ivăncescu 8eac0fc60a jscript: Implement Object.prototype.__defineGetter__.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 17:54:36 +01:00
Gabriel Ivăncescu fa3095d4d4 mshtml/tests: Add test for setting a prop with same name as a prototype accessor with no setter.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-22 18:39:29 +01:00
Gabriel Ivăncescu 429325b689 jscript: Don't allow changing prototype on non-extensible objects.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 22:33:30 +01:00
Gabriel Ivăncescu 7858f87ae5 jscript: Throw error when attempting to set circular __proto__ chains.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 22:33:27 +01:00
Gabriel Ivăncescu 364e093ab7 jscript: Make Object.prototype.__proto__ an actual accessor.
We have to define it after the constructors are initiated.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 22:33:24 +01:00
Gabriel Ivăncescu 47b02e8c1e jscript: Return the correct string for Object.toString(undefined) in ES5+ modes.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-18 22:17:51 +01:00
Gabriel Ivăncescu 598709f872 jscript: Pass jsval "this" to function calls instead of a dispatch.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-18 22:17:48 +01:00
Gabriel Ivăncescu 22ce4d7ec9 jscript: Return the correct string for Object.toString(null) in ES5+ modes.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-18 22:17:45 +01:00
Gabriel Ivăncescu 8fa923ca2c jscript: Pass null jsval to builtin functions instead of the global host.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-18 22:17:41 +01:00
Pat Leamon 824a7eed53 mshtml: Implement nsIHttpChannel::IsNoCacheReponse.
Signed-off-by: Pat Leamon <pleamonhp@yahoo.com.au>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-10 22:18:58 +01:00
Eric Pouech e06b668f40 mshtml/tests: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-02 20:17:25 +01:00
Jacek Caban 24c10e700c mshtml: Post messages asynchronously in IE9+ modes.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:41:15 +01:00
Jacek Caban e3e17965f3 mshtml: Implement IDOMMessageEvent::data property.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:41:15 +01:00
Jacek Caban 223704aaed mshtml: Add IDOMMessageEvent stub implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:41:15 +01:00
Jacek Caban 680d7e4846 mshtml: Don't try to bind custom events to Gecko event target.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 08:49:27 +01:00
Eric Pouech 210abcd81a mshtml: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-15 16:34:16 +01:00
Nikolay Sivov f961e83284 mshtml: Implement layerX/layerY properties for mouse event.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-07 20:18:10 +01:00
Eric Pouech 88e66e9974 mshtml: Use correct integral type.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-01 18:23:19 +01:00
Eric Pouech bb1fc33570 include/msvcrt: Add attribute((format)) to printf and scanf -like APIs.
Fix a bunch of warnings generated by this patch and the migration of
GUID.Data1 to long in ae2693e2c4

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-31 18:38:55 +01:00
Alexandre Julliard f0cd33c69e include: Add support for defining Win32 types as 'long' where possible.
Add -DWINE_NO_LONG_TYPES to modules that still have compilation
warnings with long types.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 20:38:22 +01:00
Gabriel Ivăncescu 89317f533b mshtml: Fix leak on failure in return_nsstr.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-24 21:44:51 +01:00
Gabriel Ivăncescu 059848c5cd mshtml: Fix nsnode leak when cloning.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-07 11:55:27 +01:00
Jacek Caban d202e4a386 mshtml: Remove duplicate check in get_top_window.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49174
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-05 17:16:42 +01:00
Alex Henrie 4ef2557d87 mshtml: Fix use after free in use_gecko_script (Coverity).
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-30 23:09:45 +01:00
Alex Henrie 06e0220ed6 mshtml: Avoid null pointer dereference in OmHistory_get_length (cppcheck).
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-21 10:34:21 +01:00
Jacek Caban b650e768be mshtml: Fix dispex hooks handling for function objects.
Based on patch by Gabriel Ivăncescu.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:18 +01:00
Gabriel Ivăncescu 0e7d1a601c mshtml: Ignore named and extra arguments when invoking builtin functions.
Native just ignores the named and extra arguments completely.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-07 20:29:59 +01:00
Gabriel Ivăncescu 12ad9b0caf mshtml: Implement index access for HTMLStyleSheetRulesCollection.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-03 16:56:08 +01:00
Gabriel Ivăncescu d750a6b394 mshtml: Implement index access for HTMLStyleSheetsCollection.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-03 16:56:08 +01:00
Gabriel Ivăncescu 1417750717 mshtml: Implement value construction for HTMLOptionElementFactory.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-03 16:56:08 +01:00