Bug 100796 - Should add FixedPositionViewportConstraints to ScrollingConstraints.h
Summary: Should add FixedPositionViewportConstraints to ScrollingConstraints.h
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Beth Dakin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-30 16:53 PDT by Beth Dakin
Modified: 2012-11-01 10:22 PDT (History)
7 users (show)

See Also:


Attachments
Patch (5.39 KB, patch)
2012-10-30 16:57 PDT, Beth Dakin
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Dakin 2012-10-30 16:53:52 PDT
ScrollingConstraints.h currently contains an abstract class called ViewportConstraints that is intended to encapsulate data and logic required to reposition elements whose layout depends on the viewport rect (positions fixed and sticky), when scrolling and zooming. However, at this time there is only a subclass for sticky. We should add a sub-class for fixed. This is required to get pages with fixes position elements scrolling on the scrolling thread.
Comment 1 Beth Dakin 2012-10-30 16:57:52 PDT
Created attachment 171551 [details]
Patch
Comment 2 Beth Dakin 2012-10-30 17:18:53 PDT
Thanks Simon!

http://trac.webkit.org/changeset/132968
Comment 3 Darin Adler 2012-11-01 09:59:28 PDT
Comment on attachment 171551 [details]
Patch

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

> Source/WebCore/page/scrolling/ScrollingConstraints.h:54
> +    ViewportConstraints(ViewportConstraints* constraints)

This seems a little strange. It’s like a copy constructor, but takes a pointer instead of a reference. Can we just make this a copy constructor instead? I suspect we could, and we could let the compiler generate it.

> Source/WebCore/page/scrolling/ScrollingConstraints.h:78
> +    FixedPositionViewportConstraints()

If we eliminate the other constructor, replacing it with an automatically generated copy constructor, I believe we can also remove this default constructor and let the compiler generate it.

> Source/WebCore/page/scrolling/ScrollingConstraints.h:81
> +    FixedPositionViewportConstraints(FixedPositionViewportConstraints* constraints)

Same comment about this copy constructor.

> Source/WebCore/page/scrolling/ScrollingConstraints.h:87
> +    virtual ConstraintType constraintType() const OVERRIDE { return FixedPositionConstaint; };

Can this override be private instead of public?
Comment 4 Beth Dakin 2012-11-01 10:22:08 PDT
(In reply to comment #3)
> (From update of attachment 171551 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=171551&action=review
> 
> > Source/WebCore/page/scrolling/ScrollingConstraints.h:54
> > +    ViewportConstraints(ViewportConstraints* constraints)
> 
> This seems a little strange. It’s like a copy constructor, but takes a pointer instead of a reference. Can we just make this a copy constructor instead? I suspect we could, and we could let the compiler generate it.
> 
> > Source/WebCore/page/scrolling/ScrollingConstraints.h:78
> > +    FixedPositionViewportConstraints()
> 
> If we eliminate the other constructor, replacing it with an automatically generated copy constructor, I believe we can also remove this default constructor and let the compiler generate it.
> 
> > Source/WebCore/page/scrolling/ScrollingConstraints.h:81
> > +    FixedPositionViewportConstraints(FixedPositionViewportConstraints* constraints)
> 
> Same comment about this copy constructor.
> 
> > Source/WebCore/page/scrolling/ScrollingConstraints.h:87
> > +    virtual ConstraintType constraintType() const OVERRIDE { return FixedPositionConstaint; };
> 
> Can this override be private instead of public?

Sure. I wil address these issues in a follow-up patch.