On Wikipedia, there's a lang="" attribute on the <div> that contains the article content. On the page I'm looking at, this lang="" matches the value on the document element. Currently we'll create ElementRareData to store the effective language for the entire subtree, which for large articles can be several MB worth. We can optimize this by detecting when the explicitly set lang="" matches the effective document language, and avoid the subtree traversal / restyle / ElementRareData creation.
<rdar://problem/104987630>
Pull request: https://github.com/WebKit/WebKit/pull/9566
Pull request: https://github.com/WebKit/WebKit/pull/9580
Committed 259931@main (8858f1de792a): <https://commits.webkit.org/259931@main> Reviewed commits have been landed. Closing PR #9580 and removing active labels.
Since this landed the !hasLanguageAttribute() assertion has been firing when running regression tests on bots: https://ews-build.s3-us-west-2.amazonaws.com/macOS-AppleSilicon-Ventura-Debug-WK2-Tests-EWS/72c673b1-6062/css3/masking/mask-svg-no-fragmentId-tiled-crash-log.txt https://ews-build.s3-us-west-2.amazonaws.com/macOS-AppleSilicon-Ventura-Debug-WK2-Tests-EWS/72c673b1-6062/fast/css/large-font-size-crash-crash-log.txt https://ews-build.s3-us-west-2.amazonaws.com/macOS-AppleSilicon-Ventura-Debug-WK2-Tests-EWS/72c673b1-6062/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-with-span-crash-log.txt https://ews-build.s3-us-west-2.amazonaws.com/macOS-AppleSilicon-Ventura-Debug-WK2-Tests-EWS/72c673b1-6062/imported/w3c/web-platform-tests/css/selectors/invalidation/lang-pseudo-class-in-has-xhtml-crash-log.txt
Re-opened since this is blocked by bug 251932
Reverted in https://commits.webkit.org/260019@main due to the assertion failures.
*** Bug 251904 has been marked as a duplicate of this bug. ***
Pull request: https://github.com/WebKit/WebKit/pull/9833
Committed 260047@main (f31c6cd34376): <https://commits.webkit.org/260047@main> Reviewed commits have been landed. Closing PR #9833 and removing active labels.