Bug 193383 - [LFC] Block/InlinFormattingContext should take Block/InlineFormattingState
Summary: [LFC] Block/InlinFormattingContext should take Block/InlineFormattingState
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
Keywords: InRadar
Depends on:
Reported: 2019-01-12 12:44 PST by zalan
Modified: 2019-01-12 13:29 PST (History)
5 users (show)

See Also:

Patch (13.34 KB, patch)
2019-01-12 12:47 PST, zalan
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2019-01-12 12:44:49 PST
This is a just downcast really.
Comment 1 zalan 2019-01-12 12:47:00 PST
Created attachment 358995 [details]
Comment 2 Antti Koivisto 2019-01-12 12:55:03 PST
Comment on attachment 358995 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=358995&action=review

> Source/WebCore/layout/FormattingContext.h:-68
> -    FormattingState& formattingState() const;

I think you could also keep this as-is (and keep m_formattingState private). You can override a function with a more specific return type in the subclass:

BlockFormattingState& formattingState() const { return downcast<BlockFormattingState>(FormattingContext::formattingState()); }
Comment 3 zalan 2019-01-12 13:28:21 PST
Committed r239903: <https://trac.webkit.org/changeset/239903>
Comment 4 Radar WebKit Bug Importer 2019-01-12 13:29:33 PST