Add optional debug logging for tiled scrolling
https://bugs.webkit.org/show_bug.cgi?id=93305

Reviewed by Simon Fraser.

Add scrolling performance logging to ScrollingTreeNodeMac and WebTileLayer, which will log
the amount of unpainted area exposed during scrolling and painting, respectively.

The logging output looks like this:

    SCROLLING: Exposed tileless area. Time: 1344464850.154839 Unfilled Pixels: 1122008
    SCROLLING: Filled visible fresh tile. Time: 1344464850.575303 Unfilled Pixels: 1078272
    SCROLLING: Filled visible fresh tile. Time: 1344464850.676569 Unfilled Pixels: 823808
    SCROLLING: Filled visible fresh tile. Time: 1344464850.795877 Unfilled Pixels: 569344
    SCROLLING: Filled visible fresh tile. Time: 1344464850.846940 Unfilled Pixels: 524288
    SCROLLING: Filled visible fresh tile. Time: 1344464850.984113 Unfilled Pixels: 262144
    SCROLLING: Filled visible fresh tile. Time: 1344464851.027985 Unfilled Pixels: 0

No new tests, as this is just debugging logging.

* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::setScrollingPerformanceLoggingEnabled):
Added setScrollingPerformanceLoggingEnabled, passes flag into TiledBacking.

* page/FrameView.h:
* page/Settings.cpp:
(WebCore::Settings::Settings):
(WebCore::Settings::setScrollingPerformanceLoggingEnabled):
Added setScrollingPerformanceLoggingEnabled, passes flag into FrameView.

* page/Settings.h:
(WebCore::Settings::scrollingPerformanceLoggingEnabled):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::ScrollingTree):
(WebCore::ScrollingTree::setScrollingPerformanceLoggingEnabled):
(WebCore::ScrollingTree::scrollingPeformanceLoggingEnabled):
Added ScrollingPerformanceLoggingEnabled setter/getter; this is where it's accessed from ScrollingTreeNodeMac.

* page/scrolling/ScrollingTree.h:
* page/scrolling/mac/ScrollingTreeNodeMac.h:
(ScrollingTreeNodeMac):
* page/scrolling/mac/ScrollingTreeNodeMac.mm:
(WebCore::ScrollingTreeNodeMac::setScrollPosition):
When updating scroll position, conditionally log the amount of unpainted area that was just exposed.

(WebCore::ScrollingTreeNodeMac::logExposedTilelessArea):
* platform/graphics/TiledBacking.h:
(WebCore::TiledBacking::TiledBacking):
(WebCore::TiledBacking::setScrollingPerformanceLoggingEnabled):
(WebCore::TiledBacking::scrollingPerformanceLoggingEnabled):
Added ScrollingPerformanceLoggingEnabled setter/getter; this is where it's accessed from WebTileLayer.

* platform/graphics/ca/mac/TileCache.h:
(WebCore::TileCache::visibleRect):
* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::blankPixelCount):
(WebCore::TileCache::blankPixelCountForTiles):
Compute the exposed, unpainted area of the tile cache by iterating over the layers,
checking if they've been painted, and subtracting painted layers from the total visible area.

* platform/graphics/ca/mac/WebTileLayer.h:
* platform/graphics/ca/mac/WebTileLayer.mm:
(-[WebTileLayer drawInContext:]):
(-[WebTileLayer repaintCount]):
(-[WebTileLayer logFilledFreshTile]):
When painting a WebTileLayer, conditionally log the amount of unpainted area remaining after painting said tile.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
Plumb ScrollingPerformanceLoggingEnabled through to TiledBacking.

Add a new boolean preference, ScrollingPerformanceLoggingEnabled, which will be used to toggle
the WebCore parts of this change.

* Shared/WebPreferencesStore.h: Add ScrollingPerformanceLoggingEnabled.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetScrollingPerformanceLoggingEnabled): Added.
(WKPreferencesGetScrollingPerformanceLoggingEnabled): Added.
* UIProcess/API/C/WKPreferencesPrivate.h: Add getters and setters for ScrollingPerformanceLoggingEnabled.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Add ScrollingPerformanceLoggingEnabled.
(WebKit::WebPage::updatePreferences): Add ScrollingPerformanceLoggingEnabled.
(WebKit::WebPage::setScrollingPerformanceLoggingEnabled): Propagate settings changes through to FrameView.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::scrollingPerformanceLoggingEnabled): Add a getter for the setting so that TiledCoreAnimationDrawingArea can access it.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updatePreferences): Pass ScrollingPerformanceLoggingEnabled down into the scrolling thread.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Microdata: HTMLPropertiesCollection does not contain all properties when item is not attached to the DOM tree.
https://bugs.webkit.org/show_bug.cgi?id=93456

Reviewed by Ryosuke Niwa.

Source/WebCore:

HTMLPropertiesCollection does not contain the item properties added through
itemref attribute when item is not attached to the DOM tree. We need to
find the root node of the item if its not attached in the document.

It is also possible that itemref attribute of item refers to the root node.
Made changes in getItemRefElements() method so that the traversal should
start from the root node.

Tests: fast/dom/MicroData/add-remove-property-to-item-which-is-not-attached-to-domtree.html
       fast/dom/MicroData/item-not-attached-to-domtree.html
       fast/dom/MicroData/itemref-pointing-to-root-node.html

* dom/DynamicNodeList.cpp:
(WebCore::DynamicNodeListCacheBase::rootNode):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::getItemRefElements):

LayoutTests:

Added tests to ensure that HTMLPropertiesCollection contains all item properties
when item is not attached to the DOM tree.

* fast/dom/MicroData/add-remove-property-to-item-which-is-not-attached-to-domtree-expected.txt: Added.
* fast/dom/MicroData/add-remove-property-to-item-which-is-not-attached-to-domtree.html: Added.
* fast/dom/MicroData/item-not-attached-to-domtree-expected.txt: Added.
* fast/dom/MicroData/item-not-attached-to-domtree.html: Added.
* fast/dom/MicroData/itemref-pointing-to-root-node-expected.txt: Added.
* fast/dom/MicroData/itemref-pointing-to-root-node.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125157 268f45cc-cd09-0410-ab3c-d52691b4dbfc