Rubber-banding is often not smooth on infinitely scrolling websites
https://bugs.webkit.org/show_bug.cgi?id=122985

Reviewed by Simon Fraser.

totalContentsSize is an important part of the calculation for 
maximumScrollPosition(). This function is called repeatedly throughout the curve 
of a rubber-band to determine the stretch amount. To keep the rubber-band 
animation smooth, it should be allowed to finish its animation using the old 
totalContentsSize. This patch does that by adding a new variable, 
m_totalContentsSizeForRubberBand. This value should almost always be equivalent to 
m_totalContentsSize. It will only vary if m_totalContentsSize has changed in the 
middle of a rubber-band, and in that case, it will stay equivalent to the old 
totalContentSize value until the rubber band animation finishes.

* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand):
(WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::stopSnapRubberbandTimer):
(WebCore::ScrollingTreeScrollingNodeMac::maximumScrollPosition):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove some Windows specific code from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=123034

Reviewed by Beth Dakin.

* Platform/PlatformProcessIdentifier.h:
* Shared/API/c/WKDeclarationSpecifiers.h:
* UIProcess/API/C/WKNativeEvent.h:
* UIProcess/API/C/WKPreferencesPrivate.h:
* config.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Generate API documentation for GObject DOM bindings
https://bugs.webkit.org/show_bug.cgi?id=121538

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2013-10-18
Reviewed by Gustavo Noronha Silva.

* GNUmakefile.am: Initialize gdom_symbol_files variable.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Frequent RELEASE_ASSERT crashes in Structure::checkOffsetConsistency on WebGL swizzler tests
https://bugs.webkit.org/show_bug.cgi?id=121661

Reviewed by Mark Hahnenberg.
        
This method shouldn't have been called from the concurrent JIT thread. That's hard to prevent
so I added a return-early check using isCompilationThread().
        
Here's why this makes sense. Structure has two ways to tell you about the layout of the objects
it is describing: m_offset and the property table. Most structures only have m_offset and report
null for the property table. If the property table is there, it will tell you additional
information and that information subsumes m_offset - but the m_offset is still there. So, when
we have a property table, we have to keep it in sync with the m_offset. There is a bunch of
machinery to do this.
        
Changing the property table only happens on the main thread.
        
Because the machinery to change the property table is so complex, especially with respect to
keeping it in sync with m_offset, we have the checkOffsetConsistency method. It's meant to be
called at key points before and after changes to the property table or the offset.

Most clients of Structure who care about object layout, including the concurrent thread, will
want to know m_offset and not the property table. If they want the property table, they will
already be super careful. The concurrent thread has special methods for this, like
Structure::getConcurrently(), which uses fine-grained locking to ensure that it sees a coherent
view of the property table.
        
Adding locking to checkOffsetConsistency() is probably a bad idea since that method may be
called when the relevant lock is already held. So, we'd have awkward recursive locking issues.
        
But right now, the concurrent JIT thread may call a method, like Structure::outOfLineCapacity(),
which has a call to checkOffsetConsistency(). The call to checkOffsetConsistency() is there
because we have found that it helps quickly identify situations where the property table and
m_offset get out of sync - mainly because code that changes either of those things will usually
also want to know the outOfLineCapacity(). But Structure::outOfLineCapacity() doesn't *actually*
need the property table; it uses the m_offset. The concurrent JIT is correct to call
outOfLineCapacity(), and is right to do so without holding any locks (since in all cases where
it calls outOfLineCapacity() it has already proven that m_offset is immutable). But because
outOfLineCapacity() calls checkOffsetConsistency(), and checkOffsetConsistency() doesn't grab
locks, and that same structure is having its property table modified by the main thread, we end
up with these spurious assertion failures. FWIW, the structure isn't *actually* having *its*
property table modified - instead what happens is that some downstream structure steals the
property table and then starts adding things to it. The concurrent thread loads the property
table before it's stolen, and hence the badness.
        
I suspect there are other code paths that lead to the concurrent JIT calling some Structure
method that it is fine and safe to call, but then that method calls checkOffsetConsistency(),
and then you have a possible crash.
        
The most sensible solution to this appears to be to make sure that checkOffsetConsistency() is
aware of its uselessness to the concurrent JIT thread. This change makes it return early if
it's in the concurrent JIT.
        
* runtime/StructureInlines.h:
(JSC::Structure::checkOffsetConsistency):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157645 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add Rik Cabanier to list of committers
https://bugs.webkit.org/show_bug.cgi?id=123031

reviewed by Dirk Schulze.


* Tools/Scripts/webkitpy/common/config/contributors.json: Added name.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unable to upload <img src="foo.svg"> as WebGL texture
https://bugs.webkit.org/show_bug.cgi?id=123035

Reviewed by Tim Horton.

Source/WebCore:

If the HTMLImageElement passed to texture2D is an SVG
image, paint it first into a bitmap buffer and upload that.
Note that the SVG image still needs to have an intrinsic
or explicit size - see how the test case must set width and
height.

I also renamed the cache of ImageBuffers since it is
no longer only being used for video frames.

Test: fast/canvas/webgl/tex-image-and-sub-image-2d-with-svg-image.html

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::WebGLRenderingContext): Rename m_videoCache to m_generatedImageCache.
(WebCore::WebGLRenderingContext::drawImageIntoBuffer): New method that creates an ImageBuffer
of the appropriate size and renders into that.
(WebCore::WebGLRenderingContext::texImage2D): If we see an SVG image, render it first.
(WebCore::WebGLRenderingContext::videoFrameToImage): Renamed m_generatedImageCache.
(WebCore::WebGLRenderingContext::texSubImage2D): If we see an SVG image, render it first.
* html/canvas/WebGLRenderingContext.h: Renaming.

LayoutTests:

Test that creates an HTMLImageElement, sets its source
to an SVG file, and then uploads as a WebGLTexture. Based
on the existing WebGL conformance tests.

* fast/canvas/webgl/resources/red-green.svg: Added.
* fast/canvas/webgl/resources/tex-image-and-sub-image-2d-with-svg-image.js: Added.
* fast/canvas/webgl/tex-image-and-sub-image-2d-with-svg-image-expected.txt: Added.
* fast/canvas/webgl/tex-image-and-sub-image-2d-with-svg-image.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] WKBrowsingController accessors crash instead of returning nil
https://bugs.webkit.org/show_bug.cgi?id=123036

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKBrowsingContextController.mm:
(autoreleased): Return nil if the object is NULL.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: CSS Regions: Add the list of flows in the FrameTreeElement
https://bugs.webkit.org/show_bug.cgi?id=122924

Reviewed by Timothy Hatcher.

Added code to collect the flows from the backend into the DOMTree object
on the frontend. Added ContentFlow to represent the flows on the frontend
side and created ContentFlowTreeElement to display the flows in the FrameTreeElement.

* Localizations/en.lproj/localizedStrings.js:
* Scripts/copy-user-interface-resources.sh:
* UserInterface/CSSObserver.js:
(WebInspector.CSSObserver.prototype.namedFlowCreated):
(WebInspector.CSSObserver.prototype.namedFlowRemoved):
(WebInspector.CSSObserver.prototype.regionLayoutUpdated):
(WebInspector.CSSObserver.prototype.regionOversetChanged):
* UserInterface/ContentFlow.js: Added.
(WebInspector.ContentFlow):
(WebInspector.ContentFlow.prototype.get id):
(WebInspector.ContentFlow.prototype.get documentNodeIdentifier):
(WebInspector.ContentFlow.prototype.get name):
(WebInspector.ContentFlow.prototype.get overset):
(WebInspector.ContentFlow.prototype.set overset):
* UserInterface/ContentFlowIcon.css: Added.
(.content-flow-icon .icon):
* UserInterface/ContentFlowTreeElement.js: Added.
(WebInspector.ContentFlowTreeElement):
* UserInterface/DOMTree.js:
(WebInspector.DOMTree):
(WebInspector.DOMTree.prototype.get flowMap):
(WebInspector.DOMTree.prototype.get flowsCount):
(WebInspector.DOMTree.prototype._framePageExecutionContextChanged):
(WebInspector.DOMTree.prototype.requestContentFlowList):
(WebInspector.DOMTree.prototype._isContentFlowInCurrentDocument):
(WebInspector.DOMTree.prototype._contentFlowListWasUpdated):
(WebInspector.DOMTree.prototype._contentFlowWasAdded):
(WebInspector.DOMTree.prototype._contentFlowWasRemoved):
* UserInterface/DOMTreeManager.js:
(WebInspector.DOMTreeManager):
(WebInspector.DOMTreeManager._flowPayloadHashKey):
(WebInspector.DOMTreeManager.prototype._buildHighlightConfig):
(WebInspector.DOMTreeManager.prototype._createContentFlowFromPayload):
(WebInspector.DOMTreeManager.prototype._updateContentFlowFromPayload):
(WebInspector.DOMTreeManager.prototype.getNamedFlowCollection):
(WebInspector.DOMTreeManager.prototype.namedFlowCreated):
(WebInspector.DOMTreeManager.prototype.namedFlowRemoved):
(WebInspector.DOMTreeManager.prototype._sendNamedFlowUpdateEvents):
(WebInspector.DOMTreeManager.prototype.regionLayoutUpdated):
(WebInspector.DOMTreeManager.prototype.regionOversetChanged):
* UserInterface/FrameTreeElement.js:
(WebInspector.FrameTreeElement):
(WebInspector.FrameTreeElement.prototype.onpopulate):
(WebInspector.FrameTreeElement.prototype.onexpand):
(WebInspector.FrameTreeElement.prototype._childContentFlowWasAdded):
(WebInspector.FrameTreeElement.prototype._childContentFlowWasRemoved):
(WebInspector.FrameTreeElement.prototype._rootDOMNodeInvalidated):
(WebInspector.FrameTreeElement.prototype._addChildForRepresentedObject):
(WebInspector.FrameTreeElement.prototype._removeChildForRepresentedObject):
(WebInspector.FrameTreeElement.prototype._addTreeElementForRepresentedObject):
(WebInspector.FrameTreeElement.prototype._compareResourceTreeElements):
(WebInspector.FrameTreeElement.prototype._insertResourceTreeElement):
(WebInspector.FrameTreeElement.prototype._parentTreeElementForRepresentedObject):
(WebInspector.FrameTreeElement.prototype._shouldGroupIntoFolders):
* UserInterface/Images/ContentFlow.svg: Added.
* UserInterface/Main.html:
* UserInterface/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype._treeElementSelected):


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