WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
110515
Clean up computePreferredLogicalWidths functions in TableLayout subclasses
https://bugs.webkit.org/show_bug.cgi?id=110515
Summary
Clean up computePreferredLogicalWidths functions in TableLayout subclasses
Ojan Vafai
Reported
2013-02-21 14:57:54 PST
Clean up computePreferredLogicalWidths functions in TableLayout subclasses
Attachments
Patch
(5.72 KB, patch)
2013-02-21 15:00 PST
,
Ojan Vafai
tony
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Ojan Vafai
Comment 1
2013-02-21 15:00:41 PST
Created
attachment 189606
[details]
Patch
Tony Chang
Comment 2
2013-02-21 15:36:48 PST
Does this work with
bug 109462
? Maybe Julien should review this patch :)
Ojan Vafai
Comment 3
2013-02-21 15:39:19 PST
(In reply to
comment #2
)
> Does this work with
bug 109462
? Maybe Julien should review this patch :)
As best I can tell, the two patches are totally orthogonal.
Ojan Vafai
Comment 4
2013-02-21 15:39:44 PST
Also, this patch does not cause any change in behavior. It's just moving code around.
Tony Chang
Comment 5
2013-02-21 17:00:06 PST
Comment on
attachment 189606
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=189606&action=review
> Source/WebCore/rendering/AutoTableLayout.cpp:261 > - Length tableLogicalWidth = m_table->style()->logicalWidth(); > - if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive()) { > - minWidth = max<int>(minWidth, tableLogicalWidth.value()); > - maxWidth = minWidth; > - } else if (!remainingPercent && maxNonPercent) { > - // if there was no remaining percent, maxWidth is invalid > + // if there was no remaining percent, maxWidth is invalid > + if (!remainingPercent && maxNonPercent) > maxWidth = tableMaxWidth; > - } > + > + Length tableLogicalWidth = m_table->style()->logicalWidth(); > + if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive()) > + minWidth = maxWidth = max<int>(minWidth, tableLogicalWidth.value());
I would revert this section of the patch. It doesn't seem equally readable and it's slower.
> Source/WebCore/rendering/FixedTableLayout.cpp:82 > + // FIXME: we might want to wait until we have all of the first row before computing for the first time.
Nit: Capitalize the first letter of the sentence.
Ojan Vafai
Comment 6
2013-02-21 19:13:45 PST
Committed
r143683
: <
http://trac.webkit.org/changeset/143683
>
Julien Chaffraix
Comment 7
2013-02-21 20:51:08 PST
Comment on
attachment 189606
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=189606&action=review
The change is good, sorry for the delay. (In reply to
comment #3
)
> (In reply to
comment #2
) > > Does this work with
bug 109462
? Maybe Julien should review this patch :) > > As best I can tell, the two patches are totally orthogonal.
They are indeed. However you make the assumption that
r130774
which cause
bug 109462
is there to cover your back and properly apply min-width / max-width to the result of computePreferredLogicalWidths thus making it difficult to revert the change.
> Source/WebCore/rendering/FixedTableLayout.cpp:182 > + minWidth = maxWidth = calcWidthArray() + bordersPaddingAndSpacing;
WebKit style is one assignment per line (though I couldn't find an entry in our coding style). That would make this line a lot more readable IMO.
> Source/WebCore/rendering/FixedTableLayout.cpp:186 > + minWidth = maxWidth = max<int>(minWidth, tableLogicalWidth.value() - bordersPaddingAndSpacing);
Ditto.
Ojan Vafai
Comment 8
2013-02-22 11:38:56 PST
(In reply to
comment #7
)
> > Source/WebCore/rendering/FixedTableLayout.cpp:182 > > + minWidth = maxWidth = calcWidthArray() + bordersPaddingAndSpacing; > > WebKit style is one assignment per line (though I couldn't find an entry in our coding style). That would make this line a lot more readable IMO.
Discussed this on
bug 110520
.
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