WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
110520
Add computeInstrinsicLogicalWidths functions to TableLayout subclasses
https://bugs.webkit.org/show_bug.cgi?id=110520
Summary
Add computeInstrinsicLogicalWidths functions to TableLayout subclasses
Ojan Vafai
Reported
2013-02-21 15:12:24 PST
Add computeInstrinsicLogicalWidths functions to TableLayout subclasses
Attachments
Patch
(7.90 KB, patch)
2013-02-21 15:16 PST
,
Ojan Vafai
no flags
Details
Formatted Diff
Diff
Sync to ToT
(8.12 KB, patch)
2013-02-21 19:22 PST
,
Ojan Vafai
tony
: review+
tony
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Ojan Vafai
Comment 1
2013-02-21 15:16:22 PST
Created
attachment 189611
[details]
Patch
Ojan Vafai
Comment 2
2013-02-21 15:16:52 PST
This patch depends on the cleanup in
bug 110515
.
Ojan Vafai
Comment 3
2013-02-21 19:22:50 PST
Created
attachment 189662
[details]
Sync to ToT
Tony Chang
Comment 4
2013-02-22 10:33:43 PST
Comment on
attachment 189662
[details]
Sync to ToT View in context:
https://bugs.webkit.org/attachment.cgi?id=189662&action=review
> Source/WebCore/rendering/AutoTableLayout.cpp:251 > + // if there was no remaining percent, maxWidth is invalid
Nit: Capitalize the first letter and end the sentence with a period.
> Source/WebCore/rendering/FixedTableLayout.cpp:181 > + minWidth = maxWidth = calcWidthArray();
Julien is right that this style is rare. I see it mostly when setting min and max preferred width to the same value. I don't think it's actually against the style guide and this seems fine to me.
Ojan Vafai
Comment 5
2013-02-22 11:37:44 PST
(In reply to
comment #4
)
> (From update of
attachment 189662
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=189662&action=review
> > > Source/WebCore/rendering/FixedTableLayout.cpp:181 > > + minWidth = maxWidth = calcWidthArray(); > > Julien is right that this style is rare. I see it mostly when setting min and max preferred width to the same value. I don't think it's actually against the style guide and this seems fine to me.
Yup. As to whether it's more readable, it just seems like a matter of taste. I find this more clear for these functions that all have the same pattern of setting the min and max widths.
Ojan Vafai
Comment 6
2013-02-22 11:42:28 PST
Committed
r143762
: <
http://trac.webkit.org/changeset/143762
>
Julien Chaffraix
Comment 7
2013-02-22 12:18:50 PST
Comment on
attachment 189662
[details]
Sync to ToT View in context:
https://bugs.webkit.org/attachment.cgi?id=189662&action=review
>>> Source/WebCore/rendering/FixedTableLayout.cpp:181 >>> + minWidth = maxWidth = calcWidthArray(); >> >> Julien is right that this style is rare. I see it mostly when setting min and max preferred width to the same value. I don't think it's actually against the style guide and this seems fine to me. > > Yup. As to whether it's more readable, it just seems like a matter of taste. I find this more clear for these functions that all have the same pattern of setting the min and max widths.
The readability argument stems from not being consistent with the rest of the code (which is not something subjective). It's easy to browse over this code and miss that both logical widths are set up. Also it *is* a style violation, I just couldn't find the relevant point in the coding style: see
http://www.webkit.org/coding/coding-style.html
, Line breaking, point 1. "Each statement should get its own line."
Ojan Vafai
Comment 8
2013-02-22 13:55:16 PST
(In reply to
comment #7
)
> The readability argument stems from not being consistent with the rest of the code (which is not something subjective). It's easy to browse over this code and miss that both logical widths are set up.
It *is* consistent with all the computePreferredLogicalWidth functions that do this. I feel like this pattern makes it much easier to browse this code and see that they're just being set to the same value.
> Also it *is* a style violation, I just couldn't find the relevant point in the coding style: see
http://www.webkit.org/coding/coding-style.html
, Line breaking, point 1. "Each statement should get its own line."
I think this case is not what this style rule is referring to, but I see how it's open to interpretation. If you want an official ruling on this, we should probably discuss this on webkit-dev.
Julien Chaffraix
Comment 9
2013-02-22 14:51:41 PST
(In reply to
comment #8
)
> (In reply to
comment #7
) > > The readability argument stems from not being consistent with the rest of the code (which is not something subjective). It's easy to browse over this code and miss that both logical widths are set up. > > It *is* consistent with all the computePreferredLogicalWidth functions that do this. I feel like this pattern makes it much easier to browse this code and see that they're just being set to the same value.
I would expect computePreferredLogicalWidth's code to be old and thus don't match our current style very well.
> > Also it *is* a style violation, I just couldn't find the relevant point in the coding style: see
http://www.webkit.org/coding/coding-style.html
, Line breaking, point 1. "Each statement should get its own line." > > I think this case is not what this style rule is referring to, but I see how it's open to interpretation. If you want an official ruling on this, we should probably discuss this on webkit-dev.
I pointed it out on webkit-dev:
https://lists.webkit.org/pipermail/webkit-dev/2013-February/023947.html
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