Skip to content

JavaScript port: getNativeTheme() can return themes that aren't in the bundle #5468

Description

@shai-almog

HTML5Implementation.getNativeTheme() can return six theme resources, but only three of them exist in Ports/JavaScriptPort/src/main/webapp/assets/:

returned by getNativeTheme() present in webapp/assets
/iOS7Theme.res
/iPhoneTheme.res
/android_holo_light.res
/iOSModernTheme.res missing
/AndroidMaterialTheme.res missing
/androidTheme.res missing

The missing ones are not obscure branches — HTML5Implementation.java:4021 makes them the default for the modern theme mode:

String modern = isIOSLikeBrowser() ? "/iOSModernTheme.res" : "/AndroidMaterialTheme.res";

with a fallback at :4029 to android_holo_light.res / iOS7Theme.res.

Noticed while auditing what a JavaScript bundle actually ships. Logging every request from a running app (desktop Chromium) shows it fetching assets/iOS7Theme.res — i.e. the fallback, because the preferred modern theme isn't there to load. So the modern native theme silently never applies on the JavaScript port.

Either the three missing .res files should be added to the port webapp, or getNativeTheme() should stop offering names the port cannot resolve.

Unrelated to #5466, which only removes genuinely unused fixtures — it deliberately keeps all three themes that are present and reachable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions