Bug 262140 - Fix SVG systemLanguage conditional processing
Summary: Fix SVG systemLanguage conditional processing
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2023-09-26 14:21 PDT by Ahmad Saleem
Modified: 2023-10-03 14:22 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmad Saleem 2023-09-26 14:21:13 PDT
Hi Team,

While going through Blink's commit, I came across another failing test case in Safari 17 (macOS Sonoma).

Test Case: https://jsfiddle.net/35yL6qnw/5/

^ above shows 'en FAIL' in Red (Safari) while show 'EN' in Black (Chrome Canary 119 and Firefox Nightly 120).

Blink Commit: https://chromium.googlesource.com/chromium/src.git/+/1f24b02c1e563e405a59d5d44eeb03a6f2c00d59

Web-Spec: https://www.w3.org/TR/SVG11/struct.html#ConditionalProcessingSystemLanguageAttribute

___

Just wanted to raise so we can fix it.

Thanks!
Comment 2 Ahmad Saleem 2023-09-26 14:59:15 PDT
static bool isLangTagPrefix(const String& langTag, const String& language)
{
    if (!langTag.startsWithIgnoringASCIICase(language))
        return false;
    return langTag.length() == language.length() || langTag[language.length()] == '-';
}

static bool matchLanguageList(const String& langTag, const Vector<String>& languages)
{
    for (const auto& value : languages) {
        if (isLangTagPrefix(langTag, value))
            return true;
    }
    return false;
}

and following changes here: "SVGTests::isValid()"

    for (auto& langTag : attributes->systemLanguage().items()) {
        if (matchLanguageList(langTag, genericDefaultLanguage))
            return false;
    }

___

It leads to following compile errors:

candidate function not viable: no known conversion from 'StringView' to 'const Vector<String>'
      for 2nd argument

and

      no matching function for call to 'matchLanguageList'

___

Still looking into it but if someone want to take it. Go ahead and run with it. Might not come back soon but good to share what tried to make it easier for others.
Comment 3 Karl Dubost 2023-09-27 01:13:27 PDT
Probably fixing Bug 262146 first would help with this one.
Comment 4 Radar WebKit Bug Importer 2023-10-03 14:22:21 PDT
<rdar://problem/116424326>