Skip to content

Add deprecation attributes to deprecated struct fields - #27545

Open
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:html5-deprecated-fields
Open

Add deprecation attributes to deprecated struct fields#27545
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:html5-deprecated-fields

Conversation

@sbc100

@sbc100 sbc100 commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Mark deprecated fields in EmscriptenKeyboardEvent,
EmscriptenMouseEvent, and EmscriptenTouchPoint with
__attribute__((deprecated(...))) attributes in html5.h, and add
corresponding warnings in html5.h.rst.

Also add deprecation message to emscripten_fetch_wait in fetch.h,
and add -Wno-deprecated-declarations to existing tests that inspect
deprecated fields.

canvasX and canvasY were documented as deprecated in #7977.

@sbc100
sbc100 requested a review from kripken August 15, 2026 00:05
@sbc100
sbc100 force-pushed the html5-deprecated-fields branch from c3c512c to 8792ec1 Compare August 15, 2026 00:09
@sbc100 sbc100 changed the title Add [[deprecated]] attributes to deprecated struct fields [headers] Add deprecation attributes to deprecated struct fields Aug 15, 2026
@sbc100 sbc100 changed the title [headers] Add deprecation attributes to deprecated struct fields Add deprecation attributes to deprecated struct fields Aug 15, 2026
Mark deprecated fields in `EmscriptenKeyboardEvent`,
`EmscriptenMouseEvent`, and `EmscriptenTouchPoint` with
`__attribute__((deprecated(...)))` attributes in `html5.h`, and add
corresponding warnings in `html5.h.rst`.

Also add deprecation message to `emscripten_fetch_wait` in `fetch.h`,
and add `-Wno-deprecated-declarations` to existing tests that inspect
deprecated fields.
@sbc100
sbc100 force-pushed the html5-deprecated-fields branch from 8792ec1 to d26c3ab Compare August 15, 2026 00:14
the nearest integer).

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps link to where this was deprecated? (where was that?)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar questions for the others - I'm not sure how to verify that we deprecated these.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a comment in the header file, but it was not previously reflected in the docs:

// 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)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you mean the commit which deprecated them, maybe? That was #7977. I'll add that the PR desc too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants