Changeset 171307 in webkit


Ignore:
Timestamp:
Jul 21, 2014 11:26:45 AM (10 years ago)
Author:
Simon Fraser
Message:

Add helper functions to dump the scrolling state tree from the debugger
https://bugs.webkit.org/show_bug.cgi?id=135101

Reviewed by Darin Adler.

Add debug-only showScrollingStateTree() functions that take a ScrollingStateTree* and ScrollingStateNode*
for use while debugging.

  • page/scrolling/ScrollingStateTree.cpp:

(showScrollingStateTree):

  • page/scrolling/ScrollingStateTree.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r171306 r171307  
     12014-07-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add helper functions to dump the scrolling state tree from the debugger
     4        https://bugs.webkit.org/show_bug.cgi?id=135101
     5
     6        Reviewed by Darin Adler.
     7
     8        Add debug-only showScrollingStateTree() functions that take a ScrollingStateTree* and ScrollingStateNode*
     9        for use while debugging.
     10
     11        * page/scrolling/ScrollingStateTree.cpp:
     12        (showScrollingStateTree):
     13        * page/scrolling/ScrollingStateTree.h:
     14
    1152014-07-20  Simon Fraser  <simon.fraser@apple.com>
    216
  • trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp

    r170774 r171307  
    3434#include "ScrollingStateOverflowScrollingNode.h"
    3535#include "ScrollingStateStickyNode.h"
     36#include <wtf/Text/CString.h>
    3637
    3738namespace WebCore {
     
    247248} // namespace WebCore
    248249
     250#ifndef NDEBUG
     251void showScrollingStateTree(const WebCore::ScrollingStateTree* tree)
     252{
     253    if (!tree)
     254        return;
     255
     256    auto rootNode = tree->rootStateNode();
     257    if (!rootNode) {
     258        fprintf(stderr, "Scrolling state tree %p with no root node\n", tree);
     259        return;
     260    }
     261
     262    String output = rootNode->scrollingStateTreeAsText();
     263    fprintf(stderr, "%s\n", output.utf8().data());
     264}
     265
     266void showScrollingStateTree(const WebCore::ScrollingStateNode* node)
     267{
     268    if (!node)
     269        return;
     270
     271    showScrollingStateTree(&node->scrollingStateTree());
     272}
     273
     274#endif
     275
    249276#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
  • trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h

    r170198 r171307  
    106106} // namespace WebCore
    107107
     108#ifndef NDEBUG
     109void showScrollingStateTree(const WebCore::ScrollingStateTree*);
     110void showScrollingStateTree(const WebCore::ScrollingStateNode*);
     111#endif
     112
    108113#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
    109114
Note: See TracChangeset for help on using the changeset viewer.