[GTK] Rename libtestnetscapeplugin to libTestNetscapePlugin
https://bugs.webkit.org/show_bug.cgi?id=126349

Reviewed by Carlos Garcia Campos.

All CMake ports use "libTestNetscapePlugin," so choosing the same
name in the autotools port will make the transition easier.

Source/WebKit2:

* UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
(testWebContextGetPlugins): Use the new plugin library name.

Tools:

* GNUmakefile.am: Rename the plugin library.

LayoutTests:

* platform/gtk/plugins/plugin-javascript-access-expected.txt: Change the plugin name.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] [CMake] Fix the WEBKIT_SRC_DIR define when building the WebKit2 GObject API unit tests
https://bugs.webkit.org/show_bug.cgi?id=126350

Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/tests/CMakeLists.txt: Fix the define.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Give ScrollingStateNodes a nodeType()
https://bugs.webkit.org/show_bug.cgi?id=126347

Reviewed by Tim Horton.

When we start serializing ScrollingStateNodes to send to the UI process,
it's more convenient if they have a nodeType member rather than virtual functions,
so give them one, and fix the casting macros to use it. This allows us to use
a switch() on node creation, so the compiler will tell us if we forgot to create
a node type.

* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::ScrollingStateNode):
* page/scrolling/ScrollingStateNode.h: const ScrollingNodeType field
(can't be modified after construction), and move the m_scrollingStateTree
member after it (the awkward protected:/private: will be cleaned up in a later patch).
(WebCore::ScrollingStateNode::nodeType):
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::updateTreeFromStateNode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ScrollingStateNodes should have a reference to the ScrollingStateTree
https://bugs.webkit.org/show_bug.cgi?id=126348

Reviewed by Sam Weinig.

Make ScrollingStateNodes always belong to a ScrollingStateTree, and thus
have a reference to the tree rather than a pointer. When cloning nodes,
they are adopted by a new ScrollingStateTree, which adds them to its
node map (which didn't happen before).

In subclasses access the ScrollingStateTree through a member function.

* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::create):
(WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
(WebCore::ScrollingStateFixedNode::clone):
(WebCore::ScrollingStateFixedNode::updateConstraints):
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::ScrollingStateNode):
(WebCore::ScrollingStateNode::cloneAndReset):
(WebCore::ScrollingStateNode::cloneAndResetChildren):
(WebCore::ScrollingStateNode::willBeRemovedFromStateTree):
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::scrollingStateTree):
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::create):
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::clone):
(WebCore::ScrollingStateScrollingNode::setViewportRect):
(WebCore::ScrollingStateScrollingNode::setTotalContentsSize):
(WebCore::ScrollingStateScrollingNode::setScrollOrigin):
(WebCore::ScrollingStateScrollingNode::setScrollableAreaParameters):
(WebCore::ScrollingStateScrollingNode::setFrameScaleFactor):
(WebCore::ScrollingStateScrollingNode::setNonFastScrollableRegion):
(WebCore::ScrollingStateScrollingNode::setWheelEventHandlerCount):
(WebCore::ScrollingStateScrollingNode::setSynchronousScrollingReasons):
(WebCore::ScrollingStateScrollingNode::setScrollBehaviorForFixedElements):
(WebCore::ScrollingStateScrollingNode::setRequestedScrollPosition):
(WebCore::ScrollingStateScrollingNode::setHeaderHeight):
(WebCore::ScrollingStateScrollingNode::setFooterHeight):
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::create):
(WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
(WebCore::ScrollingStateStickyNode::clone):
(WebCore::ScrollingStateStickyNode::updateConstraints):
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::attachNode):
(WebCore::ScrollingStateTree::commit):
(WebCore::ScrollingStateTree::addNode):
* page/scrolling/ScrollingStateTree.h:
* page/scrolling/mac/ScrollingStateNodeMac.mm:
(WebCore::ScrollingStateNode::setScrollLayer):
* page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
(WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer):
(WebCore::ScrollingStateScrollingNode::setHeaderLayer):
(WebCore::ScrollingStateScrollingNode::setFooterLayer):
(WebCore::ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a typedef for PlatformLayerID on GraphicsLayer, and migrate RemoteLayerTreeTransaction to use it
https://bugs.webkit.org/show_bug.cgi?id=126346

Source/WebCore:

Reviewed by Tim Horton.

Remote scrolling tree code is soon going to use RemoteLayerTreeTransaction::LayerID,
so it makes more sense to put this layerID type on GraphicsLayer as
GraphicsLayer::PlatformLayerID.

Also add some type cast macros for PlatformCALayer and subclasses, and use them
where appropriate.

* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setName):
* platform/graphics/ca/PlatformCALayer.h:
(WebCore::PlatformCALayer::isPlatformCALayerMac):
(WebCore::PlatformCALayer::isPlatformCALayerRemote):
(WebCore::PlatformCALayer::PlatformCALayer):
* platform/graphics/ca/mac/PlatformCALayerMac.h:

Source/WebKit2:

Reviewed by Tim Horton.

Remote scrolling tree code is soon going to use RemoteLayerTreeTransaction::LayerID,
so it makes more sense to put this layerID type on GraphicsLayer as
GraphicsLayer::PlatformLayerID.

Also add some type cast macros for PlatformCALayer and subclasses, and use them
where appropriate.

* Shared/mac/RemoteLayerTreePropertyApplier.h:
* Shared/mac/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::rootLayerID):
(WebKit::RemoteLayerTreeTransaction::changedLayers):
(WebKit::RemoteLayerTreeTransaction::destroyedLayers):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::decode):
(WebKit::RemoteLayerTreeTransaction::setRootLayerID):
(WebKit::RemoteLayerTreeTransaction::setDestroyedLayerIDs):
(WebKit::RemoteLayerTreeTextStream::operator<<):
(WebKit::dumpChangedLayers):
(WebKit::RemoteLayerTreeTransaction::description):
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::commit):
(WebKit::RemoteLayerTreeHost::getLayer):
* WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
(WebKit::GraphicsLayerCARemote::primaryLayerID):
* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(generateLayerID):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
(WebKit::PlatformCALayerRemote::layerID):
* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening.
Updating test baselines after the introduction of lazy render tree attaching,
enabling the saturated layout arithmetics for the GTK port, and other changes.

* platform/gtk/css2.1/t0905-c414-flt-wrap-00-e-expected.txt:
* platform/gtk/fast/backgrounds/size/contain-and-cover-zoomed-expected.txt:
* platform/gtk/fast/block/float/016-expected.txt:
* platform/gtk/fast/css-generated-content/table-row-group-to-inline-expected.txt:
* platform/gtk/fast/dynamic/011-expected.txt:
* platform/gtk/fast/forms/formmove3-expected.txt:
* platform/gtk/fast/forms/preserveFormDuringResidualStyle-expected.txt:
* platform/gtk/fast/invalid/001-expected.txt:
* platform/gtk/fast/invalid/003-expected.txt:
* platform/gtk/fast/invalid/004-expected.txt:
* platform/gtk/fast/invalid/007-expected.txt:
* platform/gtk/fast/invalid/019-expected.txt:
* platform/gtk/fast/multicol/span/span-as-immediate-child-generated-content-expected.txt:
* platform/gtk/fast/multicol/span/span-as-immediate-columns-child-dynamic-expected.txt:
* platform/gtk/fast/multicol/span/span-as-nested-columns-child-dynamic-expected.txt:
* platform/gtk/fast/ruby/ruby-base-merge-block-children-crash-expected.txt:
* platform/gtk/fast/spatial-navigation/snav-unit-overflow-and-scroll-in-direction-expected.txt:
* platform/gtk/fast/table/empty-cells-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug113235-1-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug647-expected.txt:
* platform/gtk/tables/mozilla/other/wa_table_tr_align-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Updating the scrolling tree should use references to state nodes
https://bugs.webkit.org/show_bug.cgi?id=126360

Reviewed by Anders Carlsson.

Change functions related to ScrollingTreeNode updating to take
const references to state nodes rather than pointers.

* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::hasChangedProperty):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitNewTreeState):
(WebCore::ScrollingTree::updateTreeFromStateNode): The node can be nil so
this continues to take a pointer.
(WebCore::ScrollingTree::removeDestroyedNodes):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::updateAfterChildren):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::updateBeforeChildren):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):
(WebCore::ScrollingTreeScrollingNodeMac::updateAfterChildren):
* page/scrolling/mac/ScrollingTreeStickyNode.h:
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::updateBeforeChildren):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Do less synchronous render tree construction
https://bugs.webkit.org/show_bug.cgi?id=126359

Source/WebCore: 

Reviewed by Anders Carlsson.

Remove some now-unnecessary attachRenderTree calls.

* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::parseAttribute):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::renderFallbackContent):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::willRecalcStyle):
(WebCore::HTMLPlugInImageElement::createShadowIFrameSubtree):
(WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
* html/HTMLViewSourceDocument.cpp:
(WebCore::HTMLViewSourceDocument::createContainingTable):
(WebCore::HTMLViewSourceDocument::addSpanWithClassName):
(WebCore::HTMLViewSourceDocument::addLine):
(WebCore::HTMLViewSourceDocument::finishLine):
(WebCore::HTMLViewSourceDocument::addBase):
(WebCore::HTMLViewSourceDocument::addLink):
* xml/XMLErrors.cpp:
(WebCore::XMLErrors::insertErrorMessageBlock):

LayoutTests: 

* fast/html/object-image-nested-fallback.html: Update test to work with asynchronous load failures.
* fast/overflow/overflow-height-float-not-removed-crash3-expected.txt: Whitespace change.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove elementChildren/elementDescendants shorthands
https://bugs.webkit.org/show_bug.cgi?id=126363

Reviewed by Anders Carlsson.

Just use childrenOfType<Element>/descendantsOfType<Element> instead. They are not that much longer
and consistency is valuable.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
(WebCore::siblingWithAriaRole):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::isDataTable):
* css/StyleInvalidationAnalysis.cpp:
(WebCore::StyleInvalidationAnalysis::invalidateStyle):
* dom/ChildNodeList.cpp:
(WebCore::ChildNodeList::namedItem):
* dom/Document.cpp:
(WebCore::Document::buildAccessKeyMap):
(WebCore::Document::childrenChanged):
* dom/Element.cpp:
(WebCore::Element::resetComputedStyle):
* dom/ElementChildIterator.h:
* dom/ElementDescendantIterator.h:
* dom/SelectorQuery.cpp:
(WebCore::elementsForLocalName):
(WebCore::anyElement):
(WebCore::SelectorDataList::executeSingleTagNameSelectorData):
(WebCore::SelectorDataList::executeSingleClassNameSelectorData):
(WebCore::SelectorDataList::executeSingleSelectorData):
(WebCore::SelectorDataList::executeSingleMultiSelectorData):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::removeHeadContents):
* editing/markup.cpp:
(WebCore::completeURLs):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::refreshElementsIfNeeded):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::containsJavaApplet):
* loader/PlaceholderDocument.cpp:
(WebCore::PlaceholderDocument::createRenderTree):
* rendering/RenderChildIterator.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::getElementById):
* svg/SVGUseElement.cpp:
(WebCore::subtreeContainsDisallowedElement):
(WebCore::removeDisallowedElementsFromSubtree):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FrameView: Store scroll corner renderer in a RenderPtr.
<https://webkit.org/b/126364>

Make FrameView::m_scrollCorner a RenderPtr<RenderScrollbarPart> and
remove two manual destroy() calls.

Reviewed by Antti Koivisto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Create a ThreadedScrollingTree subclass of ScrollingTree, and push all knowledge of the scrolling thread into it
https://bugs.webkit.org/show_bug.cgi?id=126362

Reviewed by Sam Weinig.

Eventually we'll have a ScrollingTree in situations where there is no scrolling
thread, so make the ScrollingTree base class thread-agnostic (but threadsafe),
and subclass it in ThreadedScrollingTree for scrolling-thread-specific functionality.

The ScrollingTree base class also no longer needs to know about the
ScrollingCoordinator.

ScrollingCoordinatorMac creates a ThreadedScrollingTree.

Source/WebCore:

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj: Add ThreadedScrollingTree.*
Make some headers Private that we'll need in WebKit2 soon.
* page/scrolling/ScrollingStateTree.h: Drive-by cleanup: clone() was unimplemented.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::ScrollingTree):
(WebCore::ScrollingTree::~ScrollingTree):
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): Wrap up some logic that
involves taking the mutex, so ThreadedScrollingTree can conveniently call it.
(WebCore::ScrollingTree::handleWheelEvent):
(WebCore::ScrollingTree::commitNewTreeState):
(WebCore::ScrollingTree::setMainFrameScrollPosition):
(WebCore::ScrollingTree::isHandlingProgrammaticScroll):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::isThreadedScrollingTree):
(WebCore::ScrollingTree::invalidate):
* page/scrolling/ThreadedScrollingTree.cpp: Added.
(WebCore::ThreadedScrollingTree::create):
(WebCore::ThreadedScrollingTree::ThreadedScrollingTree):
(WebCore::ThreadedScrollingTree::~ThreadedScrollingTree):
(WebCore::ThreadedScrollingTree::tryToHandleWheelEvent):
(WebCore::ThreadedScrollingTree::handleWheelEvent):
(WebCore::derefScrollingCoordinator):
(WebCore::ThreadedScrollingTree::invalidate):
(WebCore::ThreadedScrollingTree::commitNewTreeState):
(WebCore::ThreadedScrollingTree::updateMainFrameScrollPosition):
(WebCore::ThreadedScrollingTree::handleWheelEventPhase):
* page/scrolling/ThreadedScrollingTree.h: Added.
(WebCore::ThreadedScrollingTree::isThreadedScrollingTree):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac):
(WebCore::ScrollingCoordinatorMac::handleWheelEvent):

Source/WebKit2:

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::addScrollingTreeForPage):
(WebKit::EventDispatcher::wheelEvent):
* WebProcess/WebPage/EventDispatcher.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove reattachRenderTree
https://bugs.webkit.org/show_bug.cgi?id=126366

Reviewed by Andreas Kling.

Remove the last remaining client.

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute):
        
    Reconstruct render tree asynchronously.

(WebCore::HTMLSelectElement::scrollToSelection):
(WebCore::HTMLSelectElement::setOptionsChangedOnRenderer):
(WebCore::HTMLSelectElement::selectOption):
        
    It is not safe to cast the renderer based on usesMenuList test. Switch to RenderObject::isMenuList test.

(WebCore::HTMLSelectElement::parseMultipleAttribute):
        
    Reconstruct render tree asynchronously.

(WebCore::HTMLSelectElement::platformHandleKeydownEvent):
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
(WebCore::HTMLSelectElement::defaultEventHandler):
* style/StyleResolveTree.cpp:
* style/StyleResolveTree.h:
        
    Remove the function.



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