WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 224404
RenderFlexibleBox::m_hasDefiniteHeight should not need to be mutable
https://bugs.webkit.org/show_bug.cgi?id=224404
Summary
RenderFlexibleBox::m_hasDefiniteHeight should not need to be mutable
zalan
Reported
2021-04-10 04:46:40 PDT
fix constness instead.
Attachments
Patch
(7.30 KB, patch)
2021-04-10 04:48 PDT
,
zalan
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
zalan
Comment 1
2021-04-10 04:48:50 PDT
Created
attachment 425684
[details]
Patch
EWS
Comment 2
2021-04-10 05:31:32 PDT
Committed
r275796
(
236367@main
): <
https://commits.webkit.org/236367@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 425684
[details]
.
Radar WebKit Bug Importer
Comment 3
2021-04-10 05:32:13 PDT
<
rdar://problem/76491463
>
Sergio Villar Senin
Comment 4
2021-04-12 03:42:30 PDT
I know I'm a bit late but I slightly disagree with this change. The reason why we kept it as mutable is because there are several methods like: childMainSizeIsDefinite() childCrossSizeIsDefinite() childHasIntrinsicMainAxisSize() that should be really const as we're just checking some values, they are not meant to change the internal state of the object. The m_hasDefiniteHeight is more a cache than part of the internal state of the object as checking definiteness is sometimes pretty expensive.
zalan
Comment 5
2021-04-12 08:47:39 PDT
(In reply to Sergio Villar Senin from
comment #4
)
> I know I'm a bit late but I slightly disagree with this change. The reason > why we kept it as mutable is because there are several methods like: > > childMainSizeIsDefinite() > childCrossSizeIsDefinite() > childHasIntrinsicMainAxisSize() > > that should be really const as we're just checking some values, they are not > meant to change the internal state of the object. The m_hasDefiniteHeight is > more a cache than part of the internal state of the object as checking > definiteness is sometimes pretty expensive.
Having mutable to solve issues like this is sometimes an indication of a bigger design problem. I prefer solving them instead (and while this change is not addressing that but it may force you in a long run).
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug