Bug 251657 - avoid creating ElementRareData when lang="" matches the effective document language
Summary: avoid creating ElementRareData when lang="" matches the effective document la...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
: 251904 (view as bug list)
Depends on: 251932
Blocks:
  Show dependency treegraph
 
Reported: 2023-02-02 18:48 PST by Cameron McCormack (:heycam)
Modified: 2023-02-08 21:11 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2023-02-02 18:48:26 PST
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.
Comment 1 Radar WebKit Bug Importer 2023-02-02 18:48:49 PST
<rdar://problem/104987630>
Comment 2 Cameron McCormack (:heycam) 2023-02-02 20:14:33 PST
Pull request: https://github.com/WebKit/WebKit/pull/9566
Comment 3 Cameron McCormack (:heycam) 2023-02-02 20:19:20 PST
Pull request: https://github.com/WebKit/WebKit/pull/9580
Comment 4 EWS 2023-02-06 19:16:33 PST
Committed 259931@main (8858f1de792a): <https://commits.webkit.org/259931@main>

Reviewed commits have been landed. Closing PR #9580 and removing active labels.
Comment 6 WebKit Commit Bot 2023-02-08 10:06:21 PST
Re-opened since this is blocked by bug 251932
Comment 7 Ryan Haddad 2023-02-08 10:12:39 PST
Reverted in https://commits.webkit.org/260019@main due to the assertion failures.
Comment 8 Cameron McCormack (:heycam) 2023-02-08 12:07:07 PST
*** Bug 251904 has been marked as a duplicate of this bug. ***
Comment 9 Cameron McCormack (:heycam) 2023-02-08 12:55:27 PST
Pull request: https://github.com/WebKit/WebKit/pull/9833
Comment 10 EWS 2023-02-08 21:11:43 PST
Committed 260047@main (f31c6cd34376): <https://commits.webkit.org/260047@main>

Reviewed commits have been landed. Closing PR #9833 and removing active labels.