Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextField does not handle <img> on platforms other than Flash #2684

Open
Oxdeception opened this issue Jan 24, 2024 · 3 comments
Open

TextField does not handle <img> on platforms other than Flash #2684

Oxdeception opened this issue Jan 24, 2024 · 3 comments

Comments

@Oxdeception
Copy link

Describe the bug
The <img> html tag is ignored on non-flash platforms

To Reproduce
Steps to reproduce the behavior:

  1. Create AddingText
  2. Change the TextField htmlText to include <img src="openfl.png"/>
  3. Build linux or hashlink
  4. Copy openfl.png to the bin directory
  5. Launch

Expected behavior
OpenFL logo is displayed, text is wrapped around and able to be selected and interacted with as normal.

Screenshots
Flash result:
image
Linux result:
image

OpenFL Targets
Linux, Hashlink and any that use OpenFL's HTMLParser.

Additional context
The API documentation for TextField#htmlText lists the image tag as valid, with a noted exception for AIR.

@joshtynjala
Copy link
Member

The API documentation for TextField#htmlText lists the image tag as valid, with a noted exception for AIR.

It's worth mentioning that native platforms (windows/mac/linux, neko, hashlink) in OpenFL are generally implemented to behave the same as AIR.

With that in mind, the html5 target would be the only one that should support the tag in htmlText, similar to Flash Player.

@Oxdeception
Copy link
Author

AIR has at least stated plans to support this tag in AIR 51 with domain whitelists for security: airsdk/Adobe-Runtime-Support#1242

Could there be a similar solution, or would this be a situation to wait for the actual API to be released?

Also, does OpenFL provide any method of achieving the same effect?

@joshtynjala
Copy link
Member

Looking over the code, as best I can tell, our TextField implementation doesn't support the <img> tag at all. Not even on the html5 target. So we'd need to add a base implementation before considering security implications of native targets and supporting the proposed API in AIR.

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

No branches or pull requests

2 participants