Rename RenderObject::showTree() and showTreeForThis() to showNodeTree*().
https://bugs.webkit.org/show_bug.cgi?id=136238

Reviewed by Simon Fraser.

showNodeTree()/showNodeTreeForThis() reflects the functionality better.

No change in functionality.

* rendering/InlineBox.cpp:
(WebCore::InlineBox::showNodeTreeForThis):
(showNodeTree):
(WebCore::InlineBox::showTreeForThis): Deleted.
(showTree): Deleted.
* rendering/InlineBox.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::showNodeTreeForThis):
(showNodeTree):
(WebCore::RenderObject::showTreeForThis): Deleted.
(showTree): Deleted.
* rendering/RenderObject.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172947 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel layout: remove roundedLayoutPoint/roundedLayoutSize functions.
https://bugs.webkit.org/show_bug.cgi?id=136236

Reviewed by Simon Fraser.

These functions simply call LayoutPoint/LayoutSize c'tors. They don't round the input value at all.

Non change in functionality.

Source/WebCore:

* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::computePageLocation):
(WebCore::MouseRelatedEvent::computeRelativePosition):
* dom/Touch.cpp:
(WebCore::Touch::Touch):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::setPositionFromPoint):
* page/DragController.cpp:
(WebCore::elementUnderMouse):
* page/EventHandler.cpp:
(WebCore::selectionExtentRespectingEditingBoundary):
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
* platform/graphics/LayoutPoint.h:
(WebCore::roundedLayoutPoint): Deleted.
* platform/graphics/LayoutSize.h:
(WebCore::roundedLayoutSize): Deleted.
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::nodeAtPoint):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::selectionGapRectsForRepaint):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::mapLocalToContainer):
(WebCore::RenderBox::positionLineBox):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
* rendering/RenderEmbeddedObject.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::localCaretRect):
(WebCore::RenderInline::mapLocalToContainer):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::absoluteToContents):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::mapAbsoluteToLocalPoint):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::mapLocalToContainer):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::createShapeForImage):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::nodeAtFloatPoint):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::nodeAtFloatPoint):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::nodeAtFloatPoint):
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect):

Source/WebKit2:

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Return statement TypeSet's might be duplicated
https://bugs.webkit.org/show_bug.cgi?id=136200

Patch by Saam Barati <sbarati@apple.com> on 2014-08-25
Reviewed by Filip Pizlo.

Currently, the globalTypeSet that converges the types of all
return statements in a function lives off of CodeBlock. It lives
off CodeBlock because of a faulty assumption that CodeBlock
will have a one to one mapping with a function in the source
text of the program. (Currently, there isn't an actual bug
with this design because TypeLocationCache will hash cons to
the same TypeLocation, but this is still an incorrect design).
In this patch, the globalTypeSet for function return statements
is moved to the FunctionExecutable object which does have a one
to one mapping with functions in the source text of a program.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::returnStatementTypeSet): Deleted.
* runtime/Executable.h:
(JSC::FunctionExecutable::returnStatementTypeSet):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
TypeProfiler search breaks on return statements
https://bugs.webkit.org/show_bug.cgi?id=136201

Patch by Saam Barati <sbarati@apple.com> on 2014-08-25
Reviewed by Filip Pizlo.

Searching for return statements in the TypeProfiler currently
breaks down because it expected to see the search descriptor
TypeProfilerSearchDescriptorFunctionReturn when looking for
return statements in the actual source code of the program.
But, TypeProfilerSearchDescriptorFunctionReturn search descriptor
is reserved for looking for return statements that aren't in the
actual source code of the program, but when asking for the
aggregate return type of a function. Now, searching for
return statements in the actual source code of the program will
work when passing in the search descriptor TypeProfilerSearchDescriptorNormal.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* runtime/TypeProfiler.cpp:
(JSC::TypeProfiler::findLocation):
(JSC::descriptorMatchesTypeLocation): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172950 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Generate toFile() instead of manual functions.
https://bugs.webkit.org/show_bug.cgi?id=136207

Reviewed by Darin Adler.

No new tests, no behavior changes.

* fileapi/Blob.h: Define BLOB_TYPE_CASTS.
* fileapi/File.h: Use BLOB_TYPE_CASTS to generate toFile().
(WebCore::toFile): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172951 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix after r172951.

* fileapi/Blob.h: Give the argument the name that the predicates expect.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Build break using clang
https://bugs.webkit.org/show_bug.cgi?id=136245

Reviewed by Gyuyoung Kim.

.:

* Source/cmake/OptionsEfl.cmake:
Disable ENABLE_WERROR when compiler is Clang as workaround because there are too many warnings.
Some warnings are from system libraries.

Source/WebCore:

* css/ViewportStyleResolver.cpp: Includes NodeRenderStyle.h

Source/WebKit2:

* PlatformEfl.cmake: defines GTEST_HAS_RTTI=0

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Remove dead code in WebPageEfl.cpp
https://bugs.webkit.org/show_bug.cgi?id=136246

Reviewed by Gyuyoung Kim.

* WebProcess/WebPage/efl/WebPageEfl.cpp:
(WebKit::scroll): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Utilize espeak as a synthesizer back-end for WebSpeech
https://bugs.webkit.org/show_bug.cgi?id=136127

Reviewed by Gyuyoung Kim.

.:

Add build support for espeak.

* Source/cmake/FindEspeak.cmake: Added.
* Source/cmake/OptionsEfl.cmake: Add Espeak dependency.

Source/WebCore:

Utilize espeak API to have support for speak, cancel and initializeVoiceList.

* PlatformEfl.cmake:
* platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
(WebCore::PlatformSpeechSynthesisProviderEfl::PlatformSpeechSynthesisProviderEfl):
(WebCore::PlatformSpeechSynthesisProviderEfl::convertRateToEspeakValue):
(WebCore::PlatformSpeechSynthesisProviderEfl::convertVolumeToEspeakValue):
(WebCore::PlatformSpeechSynthesisProviderEfl::convertPitchToEspeakValue):
(WebCore::PlatformSpeechSynthesisProviderEfl::voiceName):
(WebCore::PlatformSpeechSynthesisProviderEfl::engineInit):
(WebCore::PlatformSpeechSynthesisProviderEfl::currentVoice):
(WebCore::PlatformSpeechSynthesisProviderEfl::initializeVoiceList):
(WebCore::PlatformSpeechSynthesisProviderEfl::speak):
(WebCore::PlatformSpeechSynthesisProviderEfl::cancel):
(WebCore::PlatformSpeechSynthesisProviderEfl::fireSpeechEvent):
* platform/efl/PlatformSpeechSynthesisProviderEfl.h:
* platform/efl/PlatformSpeechSynthesizerEfl.cpp:
(WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
(WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
(WebCore::PlatformSpeechSynthesizer::pause):
(WebCore::PlatformSpeechSynthesizer::resume):
(WebCore::PlatformSpeechSynthesizer::speak):
(WebCore::PlatformSpeechSynthesizer::cancel):

Tools:

Add espeak dependency.

* efl/install-dependencies:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Translations are not initialized in the UI process
https://bugs.webkit.org/show_bug.cgi?id=136249

Reviewed by Philippe Normand.

This is breaking things like webkitContextMenuActionGetForContextMenuItem()
for non English locales in the cases where we use the action title to guess the
action, because the action title we get from the web process is translated while
the one in the UI process is in English.

* UIProcess/API/gtk/WebKitWebContext.cpp:
(createDefaultWebContext): Initialize gettext right before
creating the default web context.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Selection background is rendered white when unfocused with recent GTK+
https://bugs.webkit.org/show_bug.cgi?id=136251

Reviewed by Martin Robinson.

This is due to a change in the GTK+ theme, but because we are not
using the right flags to get the selections colors. We should use
GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED when focused and
GTK_STATE_FLAG_SELECTED when unfocused, instead of
GTK_STATE_FLAG_ACTIVE when unfocused.

* platform/gtk/RenderThemeGtk3.cpp:
(WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor):
(WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor):
(WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor):
(WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r172794) + 32Bit build: ASSERT failures in for-in-tests.js tests.
https://bugs.webkit.org/show_bug.cgi?id=136165

Reviewed by Mark Hahnenberg.

Changed switch case GetDirectPname: to always use the slow path for X86 since it only has
6 registers available, but the code requires 7.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
runSvnUpdateAndResolveChangeLogs() doesn’t work when invoked from a script outside Tools/Scripts
https://bugs.webkit.org/show_bug.cgi?id=136254

Reviewed by Tim Horton.

* Scripts/webkitdirs.pm:
(runSvnUpdateAndResolveChangeLogs): Locate resolve-ChangeLogs relative to the source tree,
not the invoking script.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r172940.
https://bugs.webkit.org/show_bug.cgi?id=136256

Caused assertions on fast/storage/serialized-script-
value.html, and possibly flakiness on more tests (Requested by
ap on #webkit).

Reverted changeset:

"FTL should be able to do polymorphic call inlining"
https://bugs.webkit.org/show_bug.cgi?id=135145
http://trac.webkit.org/changeset/172940

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172961 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r172794) + 32Bit build: for-in-base-reassigned-later-and-change-structure.js fail with NaN result
https://bugs.webkit.org/show_bug.cgi?id=136187

Reviewed by Mark Hahnenberg.

Added two arg version for 32 bit builds of callOperation(J_JITOperation_ECJ, ...) that
doesn't require a tag for the second argument, instead it fills in a CellTag.  This is
used for the slow case of the GetDirectPname case in SpeculativeJIT::compile since we
haven't set up a register with a tag and we know that argument 2 is a cell.

* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation): New version with implicit CellTag.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile): Eliminated extraneous filling of the scratchGPR
with CellTag as it wasn't in the control flow for the slow path that needed the tag.
Instead changed to calling new version of callOperation with an implicit CellTag.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DOMTimer may be deleted during timer fire
https://bugs.webkit.org/show_bug.cgi?id=136198

Reviewed by Geoff Garen.

Consequentially ScheduledActions may also be deleted mid execution.
This is fairly surprising & fragile, let's make this simpler.

Currently DOMTimer instances are effectively owned by the ScriptExecutionContext.
There is a 1-1 mapping between timers and contexts, all timers are help in a map
on the context and if the context goes away all timers are deleted. Rather than
being implemented in a straightforward fashion (a smart pointer type for the map
value) this is currently implemented by having the timer objects listen for the
context going away using contextDestroyed, and deleting themselves if so.

Switch to using a smart pointer for values of m_timeouts in ScriptExecutionContext.
By using a RefCounted object we can also extend the lifetime of the DOMTimer instance
from within the DOMTimer::fired method, so the object is not destroyed while the
member function is still on the stack.

* WebCore.xcodeproj/project.pbxproj:
    - project -> private since DOMTimer could no longer be a forward declare in ScriptExecutionContext.h.
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::adjustMinimumTimerInterval):
(WebCore::ScriptExecutionContext::didChangeTimerAlignmentInterval):
    - auto* -> auto& since value type in map is no longer a raw pointer.
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::addTimeout):
    - DOMTimer* -> PassRefPtr<DOMTimer>
* page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer):
    - adopt the initial ref, and pass to addTimeout.
(WebCore::DOMTimer::install):
    - updated comment.
(WebCore::DOMTimer::removeById):
    - instead of explicitly deleting the timer and assuming this will implicitly remove it from the context map,
      we explicitly remove it from the context map and assume this will implicitly deleting the timer!
(WebCore::DOMTimer::fired):
    - Add a RefPtr to keep the DOMTimer object alive until the fired method completes; to cancel a one-shot timer
      just remove it from the context's map, rather than explicitly deleting it.
(WebCore::DOMTimer::~DOMTimer): Deleted.
(WebCore::DOMTimer::contextDestroyed): Deleted.
    - no need! object lifetime management now handled by smart pointers.
* page/DOMTimer.h:
    - added parent class RefCounted<DOMTimer>.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the build after r172963

* page/DOMTimer.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172964 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rubber-banding in overflow:scroll regions does not work correctly with 
direction:rtl
https://bugs.webkit.org/show_bug.cgi?id=136176

Reviewed by Tim Horton.

Small cleanup.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::visibleContentRectInternal):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r172771): Amazon product page becomes unresponsive after swiping back to it
https://bugs.webkit.org/show_bug.cgi?id=136260
<rdar://problem/18107826>

Reviewed by Dan Bernstein.

Previously, when a swipe ended up performing a same-document navigation,
we would never get didFinishLoadForMainFrame nor didFirstVisuallyNonEmptyLayoutForMainFrame
nor would we even get didHitRenderTreeSizeThreshold in all cases, so we would never
remove the swipe snapshot. Previous implementations removed the snapshot on
didSameDocumentNavigation for the main frame if the navigation type was Replace or Pop,
so we will match that behavior.

Also, reinstate the watchdog that starts at swipe-end which would have prevented
this bug from forever breaking the view it was associated with.

Also, defend against removing the snapshot before the swipe has finished (before
we have even caused the navigation that we're watching for the effects of).

* UIProcess/API/mac/WKView.mm:
(-[WKView _didSameDocumentNavigationForMainFrame:]):
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):
Plumb main-frame same-document navigation notification from WebPageProxy
to ViewGestureControllerMac via PageClient and WKView.

* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):
Keep track of whether a swipe is currently occurring. We can't use
activeGestureType for this because the swipe currently remains the "active"
gesture until the snapshot is removed.

Reintroduce the old swipeWatchdogTimer (and rename the shorter timer that starts
when we get a visually non-empty layout) so that we will always remove the
snapshot after 5 seconds, even if we haven't committed the load.
This could lead to flashing back to the old content if we fail to get a single
byte for 5 seconds, but that is a rare case and should eventually get additional
special treatment (dropping the tiles until we do get content, or some such).

(WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
If a swipe is still in progress, we haven't done our navigation and thus
don't care about render tree size changes.

(WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
If a swipe is still in progress, we haven't done our navigation and thus
don't care about layouts.

Stop the 5 second overall watchdog if we start the 3 second after-visuallyNonEmptyLayout
watchdog. This means that the snapshot could stay up for a maximum of 8 seconds
for a very, very slow load.

(WebKit::ViewGestureController::didFinishLoadForMainFrame):
If a swipe is still in progress, we haven't done our navigation and thus
don't care about loads that complete.

(WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
Remove the swipe snapshot after painting if we do replaceState or popState.

(WebKit::ViewGestureController::removeSwipeSnapshotAfterRepaint):
If a swipe is still in progress, we shouldn't remove the snapshot yet.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Only define WEBCORE_EXPORT when building DumpRenderTree for Windows and iOS

Rubber-stamped by Tim Horton.

The Windows and iOS ports are the only ports that make use of WebCore headers
in DumpRenderTree.

* DumpRenderTree/config.h:

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