Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions site/source/docs/api_reference/html5.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,9 @@ Struct
client area (Emscripten-specific extension; coordinates are rounded down to
the nearest integer).

.. warning:: These attributes are deprecated. Register a listener on the
canvas directly to get canvas coordinates, or translate manually.


.. c:member:: int padding

Expand Down Expand Up @@ -1696,6 +1699,9 @@ Struct

The touch coordinates mapped to the Emscripten canvas client area, in pixels (Emscripten-specific extension).

.. warning:: These attributes are deprecated. Register a listener on the
canvas directly to get canvas coordinates, or translate manually.



.. c:type:: EmscriptenTouchEvent
Expand Down
2 changes: 1 addition & 1 deletion system/include/emscripten/fetch.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void emscripten_fetch_attr_init(emscripten_fetch_attr_t * _Nonnull fetch_attr);
// given URL or from IndexedDB database.
emscripten_fetch_t *emscripten_fetch(emscripten_fetch_attr_t * _Nonnull fetch_attr, const char * _Nonnull url);

EMSCRIPTEN_RESULT emscripten_fetch_wait(emscripten_fetch_t * _Nonnull fetch, double timeoutMSecs) __attribute__((deprecated));
EMSCRIPTEN_RESULT emscripten_fetch_wait(emscripten_fetch_t * _Nonnull fetch, double timeoutMSecs) __attribute__((deprecated("waitable fetch requests are no longer implemented")));

// Closes a finished or an executing fetch operation and frees up all memory. If
// the fetch operation was still executing, the onerror() handler will be called
Expand Down
26 changes: 16 additions & 10 deletions system/include/emscripten/html5.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ typedef struct EmscriptenKeyboardEvent {
bool altKey;
bool metaKey;
bool repeat;
unsigned int charCode;
unsigned int keyCode;
unsigned int which;
unsigned int charCode __attribute__((deprecated("use key instead")));
unsigned int keyCode __attribute__((deprecated("use key or code instead")));
unsigned int which __attribute__((deprecated("use key or code instead")));
EM_UTF8 key[EM_HTML5_SHORT_STRING_LEN_BYTES];
EM_UTF8 code[EM_HTML5_SHORT_STRING_LEN_BYTES];
EM_UTF8 charValue[EM_HTML5_SHORT_STRING_LEN_BYTES];
EM_UTF8 charValue[EM_HTML5_SHORT_STRING_LEN_BYTES] __attribute__((deprecated("use key instead")));
EM_UTF8 locale[EM_HTML5_SHORT_STRING_LEN_BYTES];
} EmscriptenKeyboardEvent;

Expand All @@ -126,9 +126,12 @@ typedef struct EmscriptenMouseEvent {
int movementY;
int targetX;
int targetY;
// canvasX and canvasY are deprecated - there no longer exists a Module['canvas'] object, so canvasX/Y are no longer reported (register a listener on canvas directly to get canvas coordinates, or translate manually)
int canvasX;
int canvasY;
// canvasX and canvasY are deprecated - there no longer exists a
// Module['canvas'] object, so canvasX/Y are no longer reported (register a
// listener on canvas directly to get canvas coordinates, or translate
// manually)
int canvasX __attribute__((deprecated("register a listener on canvas directly to get canvas coordinates, or translate manually")));
int canvasY __attribute__((deprecated("register a listener on canvas directly to get canvas coordinates, or translate manually")));
int padding;
} EmscriptenMouseEvent;

Expand Down Expand Up @@ -346,9 +349,12 @@ typedef struct EmscriptenTouchPoint {
bool onTarget;
int targetX;
int targetY;
// canvasX and canvasY are deprecated - there no longer exists a Module['canvas'] object, so canvasX/Y are no longer reported (register a listener on canvas directly to get canvas coordinates, or translate manually)
int canvasX;
int canvasY;
// canvasX and canvasY are deprecated - there no longer exists a
// Module['canvas'] object, so canvasX/Y are no longer reported (register a
// listener on canvas directly to get canvas coordinates, or translate
// manually)
int canvasX __attribute__((deprecated("register a listener on canvas directly to get canvas coordinates, or translate manually")));
int canvasY __attribute__((deprecated("register a listener on canvas directly to get canvas coordinates, or translate manually")));
} EmscriptenTouchPoint;

typedef struct EmscriptenTouchEvent {
Expand Down
2 changes: 1 addition & 1 deletion test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2523,7 +2523,7 @@ def test_html5_core(self, opts):
});
''')
self.cflags.append('--pre-js=pre.js')
self.btest_exit('test_html5_core.c', cflags=opts)
self.btest_exit('test_html5_core.c', cflags=opts + ['-Wno-deprecated-declarations'])

def test_html5_remove_event_listener(self):
self.btest_exit('test_html5_remove_event_listener.c')
Expand Down
12 changes: 6 additions & 6 deletions test/test_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ def setUpClass(cls):
print()

def test_html5_core(self):
self.btest_exit('test_html5_core.c', cflags=['-DKEEP_ALIVE'])
self.btest_exit('test_html5_core.c', cflags=['-DKEEP_ALIVE', '-Wno-deprecated-declarations'])

def test_html5_fullscreen(self):
self.btest('test_html5_fullscreen.c', expected='0', cflags=['-sDISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR', '-sEXPORTED_FUNCTIONS=_requestFullscreen,_enterSoftFullscreen,_main', '--shell-file', test_file('browser/test_html5_fullscreen.html')])

def test_html5_emscripten_exit_with_escape(self):
self.btest('test_html5_emscripten_exit_fullscreen.c', expected='1', cflags=['-DEXIT_WITH_F'])
self.btest('test_html5_emscripten_exit_fullscreen.c', expected='1', cflags=['-DEXIT_WITH_F', '-Wno-deprecated-declarations'])

def test_html5_emscripten_exit_fullscreen(self):
self.btest('test_html5_emscripten_exit_fullscreen.c', expected='1')
self.btest('test_html5_emscripten_exit_fullscreen.c', expected='1', cflags=['-Wno-deprecated-declarations'])

def test_html5_mouse(self):
self.btest_exit('test_html5_mouse.c', cflags=['-sDISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR'])

def test_html5_pointerlockerror(self):
self.btest('test_html5_pointerlockerror.c', expected='0', cflags=['-sDISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR'])
self.btest('test_html5_pointerlockerror.c', expected='0', cflags=['-sDISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR', '-Wno-deprecated-declarations'])

def test_sdl_mousewheel(self):
self.btest_exit('test_sdl_mousewheel.c')
Expand Down Expand Up @@ -250,7 +250,7 @@ def test_threadprofiler(self):
def test_html5_callbacks_on_calling_thread(self):
# TODO: Make this automatic by injecting mouse event in e.g. shell html file.
for args in ([], ['-DTEST_SYNC_BLOCKING_LOOP=1']):
self.btest('html5_callbacks_on_calling_thread.c', expected='1', cflags=args + ['-sDISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR', '-pthread', '-sPROXY_TO_PTHREAD'])
self.btest('html5_callbacks_on_calling_thread.c', expected='1', cflags=args + ['-sDISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR', '-pthread', '-sPROXY_TO_PTHREAD', '-Wno-deprecated-declarations'])

# Test that it is possible to register HTML5 event callbacks on either main browser thread, or
# application main thread, and that the application can manually proxy the event from main browser
Expand Down Expand Up @@ -350,7 +350,7 @@ def test_audio_worklet_memory_growth(self):
os.mkdir('audio_files')
copy_asset('webaudio/audio_files/emscripten-beat.mp3', 'audio_files/')
copy_asset('webaudio/audio_files/emscripten-bass.mp3', 'audio_files/')
self.btest_exit('webaudio/audioworklet_memory_growth.c', cflags=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sALLOW_MEMORY_GROWTH'])
self.btest_exit('webaudio/audioworklet_memory_growth.c', cflags=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-sALLOW_MEMORY_GROWTH', '-Wno-deprecated-declarations'])

def test_html_source_map(self):
# browsers will try to 'guess' the corresponding original line if a
Expand Down
Loading