Bug 112024 - Sticky positioning is broken for table rows
Summary: Sticky positioning is broken for table rows
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Viatcheslav Ostapenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-11 08:23 PDT by Jon Rimmer
Modified: 2014-01-28 14:17 PST (History)
13 users (show)

See Also:


Attachments
Simple testcase (568 bytes, text/html)
2013-03-11 08:24 PDT, Jon Rimmer
no flags Details
Patch (14.49 KB, patch)
2014-01-28 12:07 PST, Viatcheslav Ostapenko
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Rimmer 2013-03-11 08:23:38 PDT
position: -webkit-sticky is not working for tr elements. It is still working for at least some others. See attached testcase.

Testing info...

Google Chrome: 27.0.1436.0 (Official Build 187216) canary
OS: Windows 
WebKit:	537.33 (@145278)
JavaScript: V8 3.17.9
Comment 1 Jon Rimmer 2013-03-11 08:24:09 PDT
Created attachment 192475 [details]
Simple testcase
Comment 2 Viatcheslav Ostapenko 2014-01-28 12:07:06 PST
Created attachment 222471 [details]
Patch
Comment 3 Simon Fraser (smfr) 2014-01-28 12:36:50 PST
Comment on attachment 222471 [details]
Patch

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

> Source/WebCore/rendering/RenderBox.cpp:3093
> +        const RenderBlock* cb = containingBlock->isRenderBlock() ? toRenderBlock(containingBlock) : containingBlock->containingBlock();

It's pretty confusing that a parameter called "containingBlock" is not actually the containingBlock. Should we make the parameter a RenderBlock* and fix the callers?
Comment 4 Viatcheslav Ostapenko 2014-01-28 12:47:47 PST
Comment on attachment 222471 [details]
Patch

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

>> Source/WebCore/rendering/RenderBox.cpp:3093
>> +        const RenderBlock* cb = containingBlock->isRenderBlock() ? toRenderBlock(containingBlock) : containingBlock->containingBlock();
> 
> It's pretty confusing that a parameter called "containingBlock" is not actually the containingBlock. Should we make the parameter a RenderBlock* and fix the callers?

It appears to be pretty big change, because there are other methods (like containingBlockLogicalWidthForPositioned) that have the same problem and they call containingBlockLogicalHeightForPositioned .
Can it be done in another patch?
Comment 5 Simon Fraser (smfr) 2014-01-28 13:01:53 PST
Comment on attachment 222471 [details]
Patch

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

>>> Source/WebCore/rendering/RenderBox.cpp:3093
>>> +        const RenderBlock* cb = containingBlock->isRenderBlock() ? toRenderBlock(containingBlock) : containingBlock->containingBlock();
>> 
>> It's pretty confusing that a parameter called "containingBlock" is not actually the containingBlock. Should we make the parameter a RenderBlock* and fix the callers?
> 
> It appears to be pretty big change, because there are other methods (like containingBlockLogicalWidthForPositioned) that have the same problem and they call containingBlockLogicalHeightForPositioned .
> Can it be done in another patch?

OK. Also in some rare cases containingBlock() can return nil; not sure if we need to handle that here.
Comment 6 Viatcheslav Ostapenko 2014-01-28 13:13:34 PST
(In reply to comment #5)
> (From update of attachment 222471 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=222471&action=review
> 
> >>> Source/WebCore/rendering/RenderBox.cpp:3093
> >>> +        const RenderBlock* cb = containingBlock->isRenderBlock() ? toRenderBlock(containingBlock) : containingBlock->containingBlock();
> >> 
> >> It's pretty confusing that a parameter called "containingBlock" is not actually the containingBlock. Should we make the parameter a RenderBlock* and fix the callers?
> > 
> > It appears to be pretty big change, because there are other methods (like containingBlockLogicalWidthForPositioned) that have the same problem and they call containingBlockLogicalHeightForPositioned .
> > Can it be done in another patch?
> 
> OK. Also in some rare cases containingBlock() can return nil; not sure if we need to handle that here.

I have put ASSERT there and didn't manage to make it fire.

Also, callers for containingBlockLogicalWidthForPositioned and containingBlockLogicalHeightForPositioned have this comment:

// We don't use containingBlock(), since we may be positioned by an enclosing
// relative positioned inline.

Checking what I can do about this.
Comment 7 WebKit Commit Bot 2014-01-28 14:17:11 PST
Comment on attachment 222471 [details]
Patch

Clearing flags on attachment: 222471

Committed r162960: <http://trac.webkit.org/changeset/162960>
Comment 8 WebKit Commit Bot 2014-01-28 14:17:15 PST
All reviewed patches have been landed.  Closing bug.