Bug 114353 - [CoordinatedGraphics] Use ScrollingStateTree to handle fixed elements positioning while scrolling
Summary: [CoordinatedGraphics] Use ScrollingStateTree to handle fixed elements positio...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mikhail Pozdnyakov
URL:
Keywords:
: 113932 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-10 05:16 PDT by Mikhail Pozdnyakov
Modified: 2013-04-12 16:50 PDT (History)
20 users (show)

See Also:


Attachments
WIP (15.12 KB, patch)
2013-04-10 05:50 PDT, Mikhail Pozdnyakov
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
WIP 2 (16.88 KB, patch)
2013-04-10 06:22 PDT, Mikhail Pozdnyakov
no flags Details | Formatted Diff | Diff
WIP 2 (19.03 KB, patch)
2013-04-10 06:25 PDT, Mikhail Pozdnyakov
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
WIP 3 (18.83 KB, patch)
2013-04-10 06:51 PDT, Mikhail Pozdnyakov
no flags Details | Formatted Diff | Diff
patch (22.41 KB, patch)
2013-04-11 00:55 PDT, Mikhail Pozdnyakov
no flags Details | Formatted Diff | Diff
patch v2 (22.07 KB, patch)
2013-04-11 05:37 PDT, Mikhail Pozdnyakov
noam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Pozdnyakov 2013-04-10 05:16:37 PDT
ScrollingCoordinatorCoordinatedGraphics should implement threaded scrolling interface and re-use threaded scrolling approach (ScrollingStateTree and ViewportConstraints) to handle fixed(sticky) elements positioning while scrolling.
The rational:
1) Currently ScrollingCoordinatorCoordinatedGraphics implements Chromium-specific interface which is going to be removed eventually
   as there is no ScrollingCoordinatorChromium existing.(besides this interface has been modified and fixed elements positioning is broken,
   see https://bugs.webkit.org/show_bug.cgi?id=113932)
2) Threaded scrolling has a lot of useful functionality for handling both fixed and sticky elements positioning while scrolling that will
   be needed in coord graphics as well.
Comment 1 Mikhail Pozdnyakov 2013-04-10 05:17:14 PDT
*** Bug 113932 has been marked as a duplicate of this bug. ***
Comment 2 Mikhail Pozdnyakov 2013-04-10 05:50:11 PDT
Created attachment 197251 [details]
WIP

Qt build support is absent as well as change log, however the approach is clear.
Comment 3 Early Warning System Bot 2013-04-10 05:55:10 PDT
Comment on attachment 197251 [details]
WIP

Attachment 197251 [details] did not pass qt-ews (qt):
Output: http://webkit-commit-queue.appspot.com/results/17746002
Comment 4 EFL EWS Bot 2013-04-10 05:55:59 PDT
Comment on attachment 197251 [details]
WIP

Attachment 197251 [details] did not pass efl-ews (efl):
Output: http://webkit-commit-queue.appspot.com/results/17623022
Comment 5 Early Warning System Bot 2013-04-10 05:56:13 PDT
Comment on attachment 197251 [details]
WIP

Attachment 197251 [details] did not pass qt-wk2-ews (qt):
Output: http://webkit-commit-queue.appspot.com/results/17692052
Comment 6 Mikhail Pozdnyakov 2013-04-10 05:58:22 PDT
(In reply to comment #4)
> (From update of attachment 197251 [details])
> Attachment 197251 [details] did not pass efl-ews (efl):
> Output: http://webkit-commit-queue.appspot.com/results/17623022

Apparently need to add ScrollingStateScrollingNode::setCounterScrollingLayer definition, strange that it builds for me locally :/
Comment 7 Mikhail Pozdnyakov 2013-04-10 06:22:21 PDT
Created attachment 197254 [details]
WIP 2

Check EWS.
Comment 8 Mikhail Pozdnyakov 2013-04-10 06:25:00 PDT
Created attachment 197255 [details]
WIP 2

Check EWS.
Comment 9 Early Warning System Bot 2013-04-10 06:29:42 PDT
Comment on attachment 197255 [details]
WIP 2

Attachment 197255 [details] did not pass qt-ews (qt):
Output: http://webkit-commit-queue.appspot.com/results/17699059
Comment 10 EFL EWS Bot 2013-04-10 06:30:09 PDT
Comment on attachment 197255 [details]
WIP 2

Attachment 197255 [details] did not pass efl-ews (efl):
Output: http://webkit-commit-queue.appspot.com/results/17670068
Comment 11 Early Warning System Bot 2013-04-10 06:32:59 PDT
Comment on attachment 197255 [details]
WIP 2

Attachment 197255 [details] did not pass qt-wk2-ews (qt):
Output: http://webkit-commit-queue.appspot.com/results/17609042
Comment 12 Mikhail Pozdnyakov 2013-04-10 06:51:10 PDT
Created attachment 197260 [details]
WIP 3

Added missing functions definitions, completely removed guards from ScrollingTreeState files.
Comment 13 Mikhail Pozdnyakov 2013-04-11 00:55:47 PDT
Created attachment 197519 [details]
patch
Comment 14 Jocelyn Turcotte 2013-04-11 04:51:58 PDT
Comment on attachment 197519 [details]
patch

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

> Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:59
> +    ASSERT(frameView->scrollLayerID());
> +    attachToStateTree(ScrollingNode, frameView->scrollLayerID(), 0);

Do you need this now?
This might cause nasty side effects for WKCoordinatedSceneFindScrollableContentsLayerAt.

> Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp:51
> +void ScrollingStateNode::setScrollLayer(GraphicsLayer* graphicsLayer)
> +{
> +    m_graphicsLayer = graphicsLayer;
> +}

This might not be needed but Mac has this suspicious code that could be helpful when an existing node has its GraphicsLayer changed:
    setPropertyChanged(ScrollLayer);
    m_scrollingStateTree->setHasChangedProperties(true);
Comment 15 Mikhail Pozdnyakov 2013-04-11 05:34:28 PDT
Comment on attachment 197519 [details]
patch

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

>> Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:59
>> +    attachToStateTree(ScrollingNode, frameView->scrollLayerID(), 0);
> 
> Do you need this now?
> This might cause nasty side effects for WKCoordinatedSceneFindScrollableContentsLayerAt.

agree, this could be obviated as we need scroll state tree just to track constrained elements so far.

>> Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp:51
>> +}
> 
> This might not be needed but Mac has this suspicious code that could be helpful when an existing node has its GraphicsLayer changed:
>     setPropertyChanged(ScrollLayer);
>     m_scrollingStateTree->setHasChangedProperties(true);

mm.. I do not see how it can be used for us, as we do not use scroll state tree "commits"
Comment 16 Mikhail Pozdnyakov 2013-04-11 05:37:16 PDT
Created attachment 197581 [details]
patch v2

removed ScrollingCoordinatorCoordinatedGraphics::frameViewRootLayerDidChange
Comment 17 Noam Rosenthal 2013-04-11 06:03:03 PDT
Comment on attachment 197581 [details]
patch v2

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

> Source/WebCore/ChangeLog:10
> +        fixed(sticky) elements positioning while scrolling. The rationals are below.

fixed/sticky

> Source/WebCore/ChangeLog:17
> +        Threaded scrolling has a lot of useful functionality for handling both fixed and sticky elements
> +        positioning while scrolling that will be needed in coord graphics as well.

Comment unnecessary :)

> Source/WebCore/ChangeLog:36
> +

Remove line

> Source/WebCore/ChangeLog:48
> +

Remove line
Comment 18 Mikhail Pozdnyakov 2013-04-11 06:15:16 PDT
Committed r148197: <http://trac.webkit.org/changeset/148197>
Comment 19 Jessie Berlin 2013-04-11 15:01:47 PDT
(In reply to comment #18)
> Committed r148197: <http://trac.webkit.org/changeset/148197>

This broke the Lion Build

http://build.webkit.org/builders/Apple%20Lion%20Debug%20%28Build%29/builds/14913/steps/compile-webkit/logs/stdio

Ld /Volumes/Data/slave/lion-debug/build/WebKitBuild/Debug/WebCore.framework/Versions/A/WebCore normal x86_64
    cd /Volumes/Data/slave/lion-debug/build/Source/WebCore
    setenv MACOSX_DEPLOYMENT_TARGET 10.7
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -dynamiclib -L/Volumes/Data/slave/lion-debug/build/WebKitBuild/Debug -F/Volumes/Data/slave/lion-debug/build/WebKitBuild/Debug -F/System/Library/Frameworks/Carbon.framework/Frameworks -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks -F/System/Library/Frameworks/CoreServices.framework/Frameworks -filelist /Volumes/Data/slave/lion-debug/build/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/WebCore.LinkFileList -Xlinker --no-demangle -exported_symbols_list /Volumes/Data/slave/lion-debug/build/WebKitBuild/Debug/DerivedSources/WebCore/WebCore.LP64.exp -install_name /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore -mmacosx-version-min=10.7 -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport -sub_library libobjc -umbrella WebKit -allowable_client WebKit2 -framework IOSurface -stdlib=libc++ -fobjc-link-runtime -framework Accelerate -framework ApplicationServices -framework AudioToolbox -framework AudioUnit -framework Carbon -framework Cocoa -framework CoreAudio -framework IOKit -framework JavaScriptCore -licucore -lobjc -lxml2 -lz -framework OpenGL -framework QuartzCore -framework SystemConfiguration -single_module -compatibility_version 1 -current_version 537.37 -o /Volumes/Data/slave/lion-debug/build/WebKitBuild/Debug/WebCore.framework/Versions/A/WebCore
Undefined symbols for architecture x86_64:
  "__ZN7WebCore18ScrollingStateNode22setScrollPlatformLayerEP7CALayer", referenced from:
      __ZN7WebCore18ScrollingStateNodeC2ERKS0_ in ScrollingStateNode.o
  "__ZN7WebCore27ScrollingStateScrollingNode24setCounterScrollingLayerEPNS_13GraphicsLayerE", referenced from:
      __ZN7WebCore27ScrollingStateScrollingNodeC2ERKS0_ in ScrollingStateScrollingNode.o
  "__ZNK7WebCore18ScrollingStateNode19platformScrollLayerEv", referenced from:
      __ZN7WebCore18ScrollingStateNodeC2ERKS0_ in ScrollingStateNode.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 20 Ryosuke Niwa 2013-04-11 15:16:48 PDT
Lion build fix attempted in http://trac.webkit.org/changeset/148239.
Comment 21 Simon Fraser (smfr) 2013-04-11 15:24:50 PDT
Comment on attachment 197581 [details]
patch v2

So now all platforms that include these files build Scrolling* code that is only needed by two of them?
Comment 22 Anders Carlsson 2013-04-11 15:43:07 PDT
(In reply to comment #21)
> (From update of attachment 197581 [details])
> So now all platforms that include these files build Scrolling* code that is only needed by two of them?

I think that’s fine.
Comment 23 Ryosuke Niwa 2013-04-11 17:19:37 PDT
Another Lion build fix attempted in http://trac.webkit.org/changeset/148252.
Comment 24 Martin Robinson 2013-04-12 11:32:49 PDT
This broke the GTK+ build (the bots are showing it, likely because they haven't done a full build). It's been broken for a day now. Here's the error:

./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer(WebCore::GraphicsLayer*)'
./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateNode::setScrollPlatformLayer(WebCore::TextureMapperPlatformLayer*)'
./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateNode::platformScrollLayer() const'
./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateStickyNode::create(WebCore::ScrollingStateTree*, unsigned long)'
collect2: error: ld returned 1 exit status
./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer(WebCore::GraphicsLayer*)'
./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateNode::setScrollPlatformLayer(WebCore::TextureMapperPlatformLayer*)'
./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateNode::platformScrollLayer() const'
./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateStickyNode::create(WebCore::ScrollingStateTree*, unsigned long)'
collect2: error: ld returned 1 exit status
./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer(WebCore::GraphicsLayer*)'
./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCoremake[1]: ::ScrollingStateNode::setScrollPlatformLayer(WebCore::TextureMapperPlatformLayer*)'
./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateNode::platformScrollLayer() const'
./.libs/libwebkitgtk-3.0.so: *** [Programs/unittests/testapplicationcache] Error 1undefined 
reference to `WebCore::ScrollingStateStickyNode::.create(WebCore::make[1]: ScrollingStateTree/**** Waiting for unfinished jobs...., .
unsignedlibs long/)make[1]: libwebkitgtk*** [Programs/unittests/testdomdomwindow] Error 1'-
Comment 25 Martin Robinson 2013-04-12 11:34:55 PDT
(In reply to comment #24)
> This broke the GTK+ build (the bots are showing it, likely because they haven't done a full build). It's been broken for a day now. Here's the error:
> 
> ./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer(WebCore::GraphicsLayer*)'
> ./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateNode::setScrollPlatformLayer(WebCore::TextureMapperPlatformLayer*)'
> ./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateNode::platformScrollLayer() const'
> ./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateStickyNode::create(WebCore::ScrollingStateTree*, unsigned long)'
> collect2: error: ld returned 1 exit status
> ./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer(WebCore::GraphicsLayer*)'
> ./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateNode::setScrollPlatformLayer(WebCore::TextureMapperPlatformLayer*)'
> ./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateNode::platformScrollLayer() const'
> ./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateStickyNode::create(WebCore::ScrollingStateTree*, unsigned long)'
> collect2: error: ld returned 1 exit status
> ./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer(WebCore::GraphicsLayer*)'
> ./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCoremake[1]: ::ScrollingStateNode::setScrollPlatformLayer(WebCore::TextureMapperPlatformLayer*)'
> ./.libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::ScrollingStateNode::platformScrollLayer() const'
> ./.libs/libwebkitgtk-3.0.so: *** [Programs/unittests/testapplicationcache] Error 1undefined 
> reference to `WebCore::ScrollingStateStickyNode::.create(WebCore::make[1]: ScrollingStateTree/**** Waiting for unfinished jobs...., .
> unsignedlibs long/)make[1]: libwebkitgtk*** [Programs/unittests/testdomdomwindow] Error 1'-

So it seems that we need an empty implementation for these methods or instead or removing the guards they should be #if ENABLE(THREADED_SCROLLING) || ENABLE(COORDINATED_GRAPHICS). I think extending the guards would have been a lot safer than forcing dead code into other ports.
Comment 26 Mark Salisbury 2013-04-12 16:50:40 PDT
I've created https://bugs.webkit.org/show_bug.cgi?id=114545 and attached a patch to add in #if ENABLE(THREADED_SCROLLING) guards.

If someone would review/commit it, I'd be grateful.