Bug 66921

Summary: [CSSRegions] RenderFlowThread::renderRegionForLine should use a faster search method
Product: WebKit Reporter: Alexandru Chiculita <achicu>
Component: Layout and RenderingAssignee: Andrei Bucur <abucur>
Status: RESOLVED FIXED    
Severity: Normal CC: abucur, donggwan.kim, eric, esprehn+autocc, ojan.autocc, simon.fraser, webkit-bug-importer, WebkitBugTracker, webkit.review.bot
Priority: P2 Keywords: AdobeTracked, InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 113303    
Bug Blocks: 57312    
Attachments:
Description Flags
A sample from a client, that might prove to be a good test-case for this. Addmitedly, the algorithm is (very) naive, but it shouldn't take 5 minutes to finish, nonetheless.
none
Patch
none
Patch none

Description Alexandru Chiculita 2011-08-24 23:17:47 PDT
The RenderRegion rects are always in order. There should be a faster way to search the region at a specified position.
Comment 1 Radar WebKit Bug Importer 2011-09-30 16:08:38 PDT
<rdar://problem/10218165>
Comment 2 Mihai Balan 2012-08-16 09:36:17 PDT
Created attachment 158840 [details]
A sample from a client, that might prove to be a good test-case for this. Addmitedly, the algorithm is (very) naive, but it shouldn't take 5 minutes to finish, nonetheless.
Comment 3 Andrei Bucur 2013-04-03 08:38:58 PDT
Created attachment 196358 [details]
Patch
Comment 4 Andrei Bucur 2013-04-03 08:40:52 PDT
Comment on attachment 196358 [details]
Patch

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

> Source/WebCore/rendering/RenderFlowThread.cpp:968
> +    if (interval.data()->isRenderRegionSet())

Is it possible we'd want to return a region set that's not the last region? The old code seemed to have allowed it.
Comment 5 Dave Hyatt 2013-04-03 08:49:13 PDT
Comment on attachment 196358 [details]
Patch

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

Please handle

expandToEncompassFlowThreadContentsIfNeeded()

which hacks the flow thread portion rect. You'll want to make sure that interval gets correctly updated.

> Source/WebCore/rendering/RenderFlowThread.cpp:827
> +        m_regionIntervalTree.add(RegionIntervalTree::createInterval(regionRect.y(), regionRect.maxY(), region));

I think because of writing modes it would read better not to use y() and maxY() here. You could just use logicalHeight and logicalHeight + regionLogicalHeight, and I think that would read slightly better.

>> Source/WebCore/rendering/RenderFlowThread.cpp:968
>> +    if (interval.data()->isRenderRegionSet())
> 
> Is it possible we'd want to return a region set that's not the last region? The old code seemed to have allowed it.

Yes, it will be possible to have multiple region sets. Your code is going to be applicable to region sets.
Comment 6 Andrei Bucur 2013-04-03 09:33:25 PDT
Created attachment 196363 [details]
Patch
Comment 7 Dave Hyatt 2013-04-03 12:38:52 PDT
Comment on attachment 196363 [details]
Patch

r=me
Comment 8 WebKit Review Bot 2013-04-04 04:08:44 PDT
Comment on attachment 196363 [details]
Patch

Clearing flags on attachment: 196363

Committed r147620: <http://trac.webkit.org/changeset/147620>
Comment 9 WebKit Review Bot 2013-04-04 04:08:49 PDT
All reviewed patches have been landed.  Closing bug.