adityavaish opened a new pull request, #60146: URL: https://github.com/apache/spark/pull/60146
### What changes were proposed in this pull request? Add `lang="en"` to the root `<html>` element emitted by both shared Spark UI page templates, `headerSparkPage` and `basicSparkPage`. Add a regression test in `UIUtilsSuite` that renders both templates and asserts that each root element declares English as the document language. ### Why are the changes needed? [SPARK-33552](https://issues.apache.org/jira/browse/SPARK-33552) reports that Spark History Server pages lack a document language. Without a `lang` attribute, screen readers cannot reliably determine the language to use when reading the page. The shared templates render English UI text. Declaring that language fixes the accessibility metadata for pages using either template, without changing their layout or content. ### Does this PR introduce _any_ user-facing change? Yes. Pages generated by the shared Spark UI templates now declare `lang="en"`, allowing screen readers to identify the document language. Previously, neither template included a language attribute. Visual appearance is unchanged. ### How was this patch tested? Added `SPARK-33552: Spark UI pages declare their document language` to `UIUtilsSuite`, covering both shared page templates. The following commands passed using Temurin Java 21.0.13: ```sh build/sbt 'core/testOnly org.apache.spark.ui.UIUtilsSuite' build/sbt 'core/scalastyle' 'core/Test/scalastyle' ``` All 10 tests in `UIUtilsSuite` passed. Both Scala style checks reported zero errors and zero warnings. `git diff --check` also passed. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: GitHub Copilot App 1.0.102-0.unstable.r41779900948.gf482387 This patch was authored with generative AI assistance from GitHub Copilot, powered by GPT-6.1 Sol. AI assistance was used to investigate the issue, implement the language attributes and regression test, run validation, and draft this pull request description. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
