RESOLVED FIXED185249
[LFC] Box invalidation logic should go to dedicated classes.
https://bugs.webkit.org/show_bug.cgi?id=185249
Summary [LFC] Box invalidation logic should go to dedicated classes.
alan
Reported 2018-05-03 07:39:54 PDT
The idea here is that when certain style attribute changes, the invalidation logic depends on the type of the formatting context the box lives in.
Attachments
Patch (22.05 KB, patch)
2018-05-03 07:44 PDT, alan
no flags
Patch (21.93 KB, patch)
2018-05-03 09:04 PDT, alan
no flags
Patch (21.86 KB, patch)
2018-05-03 09:28 PDT, alan
no flags
Patch (22.00 KB, patch)
2018-05-03 09:34 PDT, alan
no flags
alan
Comment 1 2018-05-03 07:44:29 PDT
Antti Koivisto
Comment 2 2018-05-03 08:20:43 PDT
Comment on attachment 339407 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=339407&action=review > Source/WebCore/layout/FormattingState.h:60 > + enum BaseTypeFlag { > + BlockStateFlag = 1 << 0, > + InlineStateFlag = 1 << 1 > + }; > + > + FormattingState(Ref<FloatingState>&&, BaseTypeFlags); These two are mutually exclusive so could be replaced with 'enum class Type { Block, Inline }'. But maybe there is going to be a deeper hierarchy of FormattingStates and this will expand? This could be done with virtual functions but maybe it is a good idea to avoid them entirely.
alan
Comment 3 2018-05-03 09:04:32 PDT
Antti Koivisto
Comment 4 2018-05-03 09:09:26 PDT
Comment on attachment 339411 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=339411&action=review > Source/WebCore/layout/FormattingState.h:57 > + enum StateType { > + BlockState, > + InlineState > + }; I would go with enum class Type { Block, Inline } This is all scoped to FormattingState so repeating word 'State' is redundant. > Source/WebCore/layout/LayoutContext.h:62 > + enum UpdateType { enum class?
alan
Comment 5 2018-05-03 09:28:11 PDT
alan
Comment 6 2018-05-03 09:34:50 PDT
WebKit Commit Bot
Comment 7 2018-05-03 10:15:27 PDT
Comment on attachment 339419 [details] Patch Clearing flags on attachment: 339419 Committed r231312: <https://trac.webkit.org/changeset/231312>
WebKit Commit Bot
Comment 8 2018-05-03 10:15:29 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 9 2018-05-03 10:16:26 PDT
Antti Koivisto
Comment 10 2018-05-04 07:29:48 PDT
Comment on attachment 339419 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=339419&action=review > Source/WebCore/layout/LayoutContext.h:69 > + enum class UpdateType { > + Overflow = 1 << 0, > + Position = 1 << 1, > + Size = 1 << 2, > + All = Overflow | Position | Size > + }; > + void markNeedsUpdate(const Box&, OptionSet<UpdateType>); 'All' value like this is awkward with OptionSet (it will assert unless used with OptionSet::fromRaw), the enum should contain single bit values only. Defining constant like static constexpr OptionSet<UpdateType> UpdateAll = { Overflow, Position, Size }; should work (after 185298).
alan
Comment 11 2018-05-04 07:43:57 PDT
(In reply to Antti Koivisto from comment #10) > Comment on attachment 339419 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=339419&action=review > > > Source/WebCore/layout/LayoutContext.h:69 > > + enum class UpdateType { > > + Overflow = 1 << 0, > > + Position = 1 << 1, > > + Size = 1 << 2, > > + All = Overflow | Position | Size > > + }; > > + void markNeedsUpdate(const Box&, OptionSet<UpdateType>); > > 'All' value like this is awkward with OptionSet (it will assert unless used > with OptionSet::fromRaw), the enum should contain single bit values only. > Defining constant like > > static constexpr OptionSet<UpdateType> UpdateAll = { Overflow, Position, > Size }; > > should work (after 185298). Good point. Will fix it soon.
Note You need to log in before you can comment on or make changes to this bug.