Bug 60113 - Add a LineLayoutState object to hold global state during line layout
Summary: Add a LineLayoutState object to hold global state during line layout
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords:
Depends on: 60501 60925
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-03 19:07 PDT by Eric Seidel (no email)
Modified: 2011-05-17 12:45 PDT (History)
7 users (show)

See Also:


Attachments
Patch (10.36 KB, patch)
2011-05-03 19:08 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff
wip patch, currently testing (24.16 KB, patch)
2011-05-05 17:11 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ec2-cr-linux-01 (1.26 MB, application/zip)
2011-05-09 11:53 PDT, WebKit Review Bot
no flags Details
Patch (23.80 KB, patch)
2011-05-09 14:52 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff
Patch for landing (20.80 KB, patch)
2011-05-17 10:36 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff
Patch for landing (21.18 KB, patch)
2011-05-17 10:39 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2011-05-03 19:07:19 PDT
Add a LineLayoutState object to hold global state during line layout
Comment 1 Eric Seidel (no email) 2011-05-03 19:08:20 PDT
Created attachment 92185 [details]
Patch
Comment 2 Eric Seidel (no email) 2011-05-05 17:11:25 PDT
Created attachment 92506 [details]
wip patch, currently testing
Comment 3 WebKit Review Bot 2011-05-09 11:53:24 PDT
Comment on attachment 92506 [details]
wip patch, currently testing

Attachment 92506 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/8683001

New failing tests:
fast/multicol/vertical-lr/float-multicol.html
fast/multicol/vertical-rl/float-multicol.html
fast/repaint/line-flow-with-floats-9.html
Comment 4 WebKit Review Bot 2011-05-09 11:53:29 PDT
Created attachment 92816 [details]
Archive of layout-test-results from ec2-cr-linux-01

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-01  Port: Chromium  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 5 Eric Seidel (no email) 2011-05-09 14:52:32 PDT
Created attachment 92856 [details]
Patch
Comment 6 Ryosuke Niwa 2011-05-09 17:12:46 PDT
Comment on attachment 92856 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=92856&action=review

> Source/WebCore/rendering/RenderBlockLineLayout.cpp:820
> +// Like LayoutState for layout(), LineLayoutState keeps track of global information
> +// during an entire linebox tree layout pass (aka layoutInlineChildren).

Nit: This comment should go into the change log entry as well.

> Source/WebCore/rendering/RenderBlockLineLayout.cpp:1004
> -                        if (useRepaintBounds) // This can only be a positive adjustment, so no need to update repaintTop.
> -                            repaintLogicalBottom = max(repaintLogicalBottom, lineBox->logicalBottomVisualOverflow());
> +                        if (useRepaintBounds)
> +                            layoutState.updateRepaintRangeFromBox(lineBox);

I don't think compiler is smart enough to optimize-away an extra assignment; also, can we assert that m_repaintLogicalTop didn't change? I'm afraid that despite of the comment here, the value might still change.

> Source/WebCore/rendering/RenderBlockLineLayout.cpp:1081
>              // Delete all the remaining lines.

I don't think this comment adds any useful value here.  Could you delete this comment so that we can get rid of curly brackets?

> Source/WebCore/rendering/RenderBlockLineLayout.cpp:1286
> +            bool encounteredNewFloat = checkFloatsInCleanLine(curr, floats, floatIndex, dirtiedByFloat);
> +            if (encounteredNewFloat)

I would have renamed checkFloatsInCleanLine to markFloatsDirtyInCleanLine and wouldn't have introduced 'encounteredNewFloat'.
Comment 7 Eric Seidel (no email) 2011-05-11 20:21:26 PDT
Was that an r+ or r-?
Comment 8 Eric Seidel (no email) 2011-05-12 15:03:27 PDT
This is going to conflict with bug 60729.... but since this is still waiting review, I just pressed onward and upward. :)
Comment 9 Ryosuke Niwa 2011-05-12 21:06:02 PDT
(In reply to comment #7)
> Was that an r+ or r-?

I'm waiting for your answer for:
> Source/WebCore/rendering/RenderBlockLineLayout.cpp:1004
> -                        if (useRepaintBounds) // This can only be a positive adjustment, so no need to update repaintTop.
> -                            repaintLogicalBottom = max(repaintLogicalBottom, lineBox->logicalBottomVisualOverflow());
> +                        if (useRepaintBounds)
> +                            layoutState.updateRepaintRangeFromBox(lineBox);

I don't think compiler is smart enough to optimize-away an extra assignment; also, can we assert that m_repaintLogicalTop didn't change? I'm afraid that despite of the comment here, the value might still change.

Are you sure that this change won't regress any tests?
Comment 10 Eric Seidel (no email) 2011-05-13 11:35:17 PDT
(In reply to comment #9)
> (In reply to comment #7)
> > Was that an r+ or r-?
> 
> I'm waiting for your answer for:
> > Source/WebCore/rendering/RenderBlockLineLayout.cpp:1004
> > -                        if (useRepaintBounds) // This can only be a positive adjustment, so no need to update repaintTop.
> > -                            repaintLogicalBottom = max(repaintLogicalBottom, lineBox->logicalBottomVisualOverflow());
> > +                        if (useRepaintBounds)
> > +                            layoutState.updateRepaintRangeFromBox(lineBox);
> 
> I don't think compiler is smart enough to optimize-away an extra assignment; also, can we assert that m_repaintLogicalTop didn't change? I'm afraid that despite of the comment here, the value might still change.
> 
> Are you sure that this change won't regress any tests?

Yes, I've run the tests.  No regressions. :)
Comment 11 Ryosuke Niwa 2011-05-13 11:36:49 PDT
Comment on attachment 92856 [details]
Patch

(In reply to comment #10)
> Yes, I've run the tests.  No regressions. :)

Great!
Comment 12 Eric Seidel (no email) 2011-05-13 11:37:01 PDT
(In reply to comment #6)
> (From update of attachment 92856 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=92856&action=review
> 
> > Source/WebCore/rendering/RenderBlockLineLayout.cpp:820
> > +// Like LayoutState for layout(), LineLayoutState keeps track of global information
> > +// during an entire linebox tree layout pass (aka layoutInlineChildren).
> 
> Nit: This comment should go into the change log entry as well.

OK, can do.

> > Source/WebCore/rendering/RenderBlockLineLayout.cpp:1004
> > -                        if (useRepaintBounds) // This can only be a positive adjustment, so no need to update repaintTop.
> > -                            repaintLogicalBottom = max(repaintLogicalBottom, lineBox->logicalBottomVisualOverflow());
> > +                        if (useRepaintBounds)
> > +                            layoutState.updateRepaintRangeFromBox(lineBox);
> 
> I don't think compiler is smart enough to optimize-away an extra assignment; also, can we assert that m_repaintLogicalTop didn't change? I'm afraid that despite of the comment here, the value might still change.
> 
> > Source/WebCore/rendering/RenderBlockLineLayout.cpp:1081
> >              // Delete all the remaining lines.
> 
> I don't think this comment adds any useful value here.  Could you delete this comment so that we can get rid of curly brackets?

This can just become deleteLineBoxTree (as I did in a separate patch).

> > Source/WebCore/rendering/RenderBlockLineLayout.cpp:1286
> > +            bool encounteredNewFloat = checkFloatsInCleanLine(curr, floats, floatIndex, dirtiedByFloat);
> > +            if (encounteredNewFloat)
> 
> I would have renamed checkFloatsInCleanLine to markFloatsDirtyInCleanLine and wouldn't have introduced 'encounteredNewFloat'.

OK.  I'll undo and look at doing the rename.  This patch can't be landed as-is, given that I've written bug 60729 since.  But I'd like to get it r+'d in some form and I'll update it on top of bug 60729 once that lands.
Comment 13 Eric Seidel (no email) 2011-05-17 10:36:49 PDT
Created attachment 93792 [details]
Patch for landing
Comment 14 Eric Seidel (no email) 2011-05-17 10:39:51 PDT
Created attachment 93795 [details]
Patch for landing
Comment 15 WebKit Commit Bot 2011-05-17 11:42:46 PDT
Comment on attachment 93795 [details]
Patch for landing

Rejecting attachment 93795 [details] from commit-queue.

Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=cr-jail-8', 'apply-..." exit_code: 1

Last 500 characters of output:
autoinstalled/mechanize/_urllib2_fork.py", line 332, in _call_chain
    result = func(*args)
  File "/mnt/git/webkit-commit-queue/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1170, in https_open
    return self.do_open(conn_factory, req)
  File "/mnt/git/webkit-commit-queue/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1118, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 60] Operation timed out>

Full output: http://queues.webkit.org/results/8704383
Comment 16 WebKit Commit Bot 2011-05-17 12:45:37 PDT
Comment on attachment 93795 [details]
Patch for landing

Clearing flags on attachment: 93795

Committed r86698: <http://trac.webkit.org/changeset/86698>
Comment 17 WebKit Commit Bot 2011-05-17 12:45:47 PDT
All reviewed patches have been landed.  Closing bug.