Bug 253969

Summary: Stop including the expensive headers Document.h / LocalFrame.h in Page.h
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   

Description Brent Fulgham 2023-03-15 09:59:21 PDT
The 'Page.h' header is included in many places, and pulls in Document.h and LocalFrame.h, which are costly to parse. Instead, we should forward-declare these types and limit the includes to files that actually use the implementation details.

Correct a layering violation introduced in Bug 253293 that moved the implementation of Document::page() to the Page.h header by relocating that to the existing 'DocumentInlines.h'. This should retain the performance improvement without providing an implementation in an unrelated file.

Similarly, move the inline implementation of Frame::page() that was moved into Page.h in Bug 253204 to Frame.h.

This patch adds the necessary includes that should have been added in Bugs 253293 and 253204 instead of adding the implementation in a header that happened to be commonly included.
Comment 1 Radar WebKit Bug Importer 2023-03-15 10:52:43 PDT
<rdar://problem/106762759>
Comment 2 Brent Fulgham 2023-03-15 12:13:58 PDT
Actually, after investigating this more, I think the changes in Bugs 253293 and 253204  are desirable and should be retained.