Bug 11607 - Possible optimization in RenderBlock::calcMinMaxWidth()
Summary: Possible optimization in RenderBlock::calcMinMaxWidth()
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: EasyFix
Depends on:
Blocks:
 
Reported: 2006-11-15 15:24 PST by mitz
Modified: 2023-09-28 07:21 PDT (History)
7 users (show)

See Also:


Attachments
Possible patch adapting the fix from Bug 12049. (2.04 KB, patch)
2007-04-12 01:32 PDT, Brian Heung
hyatt: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2006-11-15 15:24:45 PST
RenderBlock::calcMinMaxWidth() shouldn't call calcInlineMinMaxWidth/calcBlockMinMaxWidth (which iterate over all children) if it's not a table cell and has fixed positive width, since in that case it overwrites m_minWidth and m_maxWidth anyway. This is a fairly common case, and a very easy fix that could improve performance.

I think this also applies to RenderFlexibleBox.
Comment 1 mitz 2007-01-01 09:31:10 PST
I forgot about this bug when I filed bug 12049. Leaving this one open for the RenderFlexibleBox stuff. Also see other comments in bug 12049.
Comment 2 Brian Heung 2007-04-12 01:32:07 PDT
Created attachment 14016 [details]
Possible patch adapting the fix from Bug 12049.

I think this might be correct. I ran the layout regression tests and there were no failures.
Comment 3 Dave Hyatt 2007-04-18 13:27:42 PDT
Comment on attachment 14016 [details]
Possible patch adapting the fix from Bug 12049.

The way flexible boxes are eventually going to work is that width will not dictate the minwidth or maxwidth.  That makes this optimization (eventually) pretty irrelevant for flexboxes.

Also a flexbox can't ever be a table cell so the !isTableCell() bit is unnecessary.
Comment 4 Ahmad Saleem 2023-09-20 08:15:09 PDT
@Alan - this optimization is still applicable or we can close this?
Comment 5 zalan 2023-09-28 07:21:55 PDT
(In reply to Ahmad Saleem from comment #4)
> @Alan - this optimization is still applicable or we can close this?
looks dated to me.