WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
217479
Sanitize the usage of override sizes
https://bugs.webkit.org/show_bug.cgi?id=217479
Summary
Sanitize the usage of override sizes
Sergio Villar Senin
Reported
2020-10-08 09:13:13 PDT
Sanitize the usage of override sizes
Attachments
Patch
(46.53 KB, patch)
2020-10-08 09:44 PDT
,
Sergio Villar Senin
no flags
Details
Formatted Diff
Diff
Patch
(57.77 KB, patch)
2020-10-13 08:53 PDT
,
Sergio Villar Senin
rego
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Sergio Villar Senin
Comment 1
2020-10-08 09:44:56 PDT
Created
attachment 410852
[details]
Patch
Manuel Rego Casasnovas
Comment 2
2020-10-09 01:50:30 PDT
Comment on
attachment 410852
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=410852&action=review
Thanks for doing this, I believe this was really needed as it was a mess what we were storing on those overrides. There's one test failing yet, so we need to check what's going on before merging this.
> Source/WebCore/rendering/RenderBox.cpp:95 > // Used by flexible boxes when flexing this element and by table cells.
Nit: Maybe we want to update this comment, as grid layout also uses these.
> Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:170 > + return std::max<LayoutUnit>(0, widthForChild(child) - child->borderAndPaddingLogicalWidth());
Don't we need to subsctract scrollbar sizes here?
Sergio Villar Senin
Comment 3
2020-10-13 08:53:21 PDT
Created
attachment 411222
[details]
Patch
Darin Adler
Comment 4
2020-10-13 09:07:29 PDT
Note the point here, but: I’m not a big fan of the broken grammar of naming something "override size" or a "size override". The word "override" is a verb and it’s not very good as a noun. It’s the kind of poor grammar that programmers sometimes use that in the end makes it hard to translate between software and spoken English, making it just that little bit harder to think about a program. If I was creating something new I might call it an "overriding size" or an "explicitly set size" or an "explicit size" or search for other terminology that matches how people would speak about this if explaining it to another person. Possibly also some additional consideration needs to be applied since we want this to be English that works well for many different types of English speakers. Sometimes people argue in favor of jargon because of that; not sure if that applies here.
zalan
Comment 5
2020-10-13 09:40:55 PDT
(In reply to Darin Adler from
comment #4
)
> Note the point here, but: > > I’m not a big fan of the broken grammar of naming something "override size" > or a "size override". The word "override" is a verb and it’s not very good > as a noun. It’s the kind of poor grammar that programmers sometimes use that > in the end makes it hard to translate between software and spoken English, > making it just that little bit harder to think about a program. > > If I was creating something new I might call it an "overriding size" or an > "explicitly set size" or an "explicit size" or search for other terminology > that matches how people would speak about this if explaining it to another > person. > > Possibly also some additional consideration needs to be applied since we > want this to be English that works well for many different types of English > speakers. Sometimes people argue in favor of jargon because of that; not > sure if that applies here.
Agree and it's also contagious. I started using it in LFC without even giving it a thought (
bug 217657
).
Sergio Villar Senin
Comment 6
2020-10-13 10:31:28 PDT
(In reply to zalan from
comment #5
)
> (In reply to Darin Adler from
comment #4
) > > Note the point here, but: > > > > I’m not a big fan of the broken grammar of naming something "override size" > > or a "size override". The word "override" is a verb and it’s not very good > > as a noun. It’s the kind of poor grammar that programmers sometimes use that > > in the end makes it hard to translate between software and spoken English, > > making it just that little bit harder to think about a program. > > > > If I was creating something new I might call it an "overriding size" or an > > "explicitly set size" or an "explicit size" or search for other terminology > > that matches how people would speak about this if explaining it to another > > person. > > > > Possibly also some additional consideration needs to be applied since we > > want this to be English that works well for many different types of English > > speakers. Sometimes people argue in favor of jargon because of that; not > > sure if that applies here. > Agree and it's also contagious. I started using it in LFC without even > giving it a thought (
bug 217657
).
Fair enough. I could replace it to OverriddenXXX to make it consistent with Zalan's changes but I wonder if we should do it as part of this patch or in a follow up in order not to make it more difficult to understand for future readers.
Darin Adler
Comment 7
2020-10-13 10:35:07 PDT
(In reply to Sergio Villar Senin from
comment #6
)
> Fair enough. I could replace it to OverriddenXXX to make it consistent with > Zalan's changes but I wonder if we should do it as part of this patch or in > a follow up in order not to make it more difficult to understand for future > readers.
I don’t feel strongly about that either way. What I care about is the future, not how quickly we make a change.
Radar WebKit Bug Importer
Comment 8
2020-10-15 09:14:16 PDT
<
rdar://problem/70338631
>
Sergio Villar Senin
Comment 9
2020-10-16 01:53:27 PDT
(In reply to Manuel Rego Casasnovas from
comment #2
)
> Comment on
attachment 410852
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=410852&action=review
> > Thanks for doing this, I believe this was really needed as it was a mess > what we were storing on those overrides.
Thanks for the review!
> There's one test failing yet, so we need to check what's going on before > merging this.
Already fixed in the new patch, I forgot to add the border and padding when storing the overriden size in the case of border-fit: line.
> > Source/WebCore/rendering/RenderBox.cpp:95 > > // Used by flexible boxes when flexing this element and by table cells. > > Nit: Maybe we want to update this comment, as grid layout also uses these.
I've finally decided to remove it. The overriden sizes mechanism shouldn't be attached to flex or grid, it's mean to be general usage.
> > Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:170 > > + return std::max<LayoutUnit>(0, widthForChild(child) - child->borderAndPaddingLogicalWidth()); > > Don't we need to subsctract scrollbar sizes here?
I wondered the same but the current code does not take scrollbars into account, for example: static LayoutUnit contentWidthForChild(RenderBox* child) { if (child->hasOverrideContentLogicalWidth()) return child->overrideContentLogicalWidth(); return child->logicalWidth() - child->borderAndPaddingLogicalWidth(); } so I'm basically respecting that the current code is doing. Maybe there is a bug but that would be orthogonal to this bug IMO.
Manuel Rego Casasnovas
Comment 10
2020-10-16 02:28:50 PDT
(In reply to Sergio Villar Senin from
comment #9
)
> > > Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:170 > > > + return std::max<LayoutUnit>(0, widthForChild(child) - child->borderAndPaddingLogicalWidth()); > > > > Don't we need to subsctract scrollbar sizes here? > > I wondered the same but the current code does not take scrollbars into > account, for example: > > static LayoutUnit contentWidthForChild(RenderBox* child) > { > if (child->hasOverrideContentLogicalWidth()) > return child->overrideContentLogicalWidth(); > return child->logicalWidth() - child->borderAndPaddingLogicalWidth(); > } > > so I'm basically respecting that the current code is doing. Maybe there is a > bug but that would be orthogonal to this bug IMO.
I agree this can be done in a separated issue, so please check if this is a bug or not, and report it if that's the case.
Manuel Rego Casasnovas
Comment 11
2020-10-16 02:29:24 PDT
Comment on
attachment 411222
[details]
Patch r=me, but please do the suggested renaming in a follow-up patch.
Sergio Villar Senin
Comment 12
2020-10-19 02:40:24 PDT
Committed
r268666
: <
https://trac.webkit.org/changeset/268666
>
zalan
Comment 13
2021-01-11 13:18:59 PST
This caused the following regression:
bug 220524
Brent Fulgham
Comment 14
2021-01-12 13:38:13 PST
We should roll this out until they have a good patch for this. The regression is too severe to keep in the tree.
zalan
Comment 15
2021-01-12 14:12:06 PST
auto-revert fails with bunch of conflicts. Sergio could you revert this patch soon?
Sergio Villar Senin
Comment 16
2021-01-12 23:51:57 PST
(In reply to zalan from
comment #15
)
> auto-revert fails with bunch of conflicts. Sergio could you revert this > patch soon?
I'll try to fix the regression ASAP. Otherwise I'll try to revert it indeed.
Sergio Villar Senin
Comment 17
2021-01-13 03:55:38 PST
(In reply to Sergio Villar Senin from
comment #16
)
> (In reply to zalan from
comment #15
) > > auto-revert fails with bunch of conflicts. Sergio could you revert this > > patch soon? > > I'll try to fix the regression ASAP. Otherwise I'll try to revert it indeed.
Should be fixed now. Thanks for reporting!
Darin Adler
Comment 18
2021-01-13 10:03:10 PST
Wanted to figure out what you mean. Are saying you this was fixed by
r271436
or by something else?
Darin Adler
Comment 19
2021-01-13 10:04:14 PST
Oh, I see there’s a reference above to the bug number.
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