Mark mathml/wbr-in-mroot-crash.html as "Timeout Pass"
https://bugs.webkit.org/show_bug.cgi?id=130353

Unreviewed gardening.

* platform/efl/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Set main thread QoS policies after IPC initialization.
<https://webkit.org/b/134014>

Something was flipping the QoS level back to "unspecified" after
setting it in the ChildProcess initialization code. Pending a better
understanding of what really happens, move the code to a later stage,
after IPC channels are up and running. Now the priority sticks.

Reviewed by Anders Carlsson.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* Shared/ChildProcess.cpp:
(WebKit::ChildProcess::initialize):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove the unused _WKBackForwardListDidChangeNotification.

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKBackForwardList.mm:
* UIProcess/API/Cocoa/WKBackForwardListInternal.h:
* UIProcess/API/Cocoa/WKBackForwardListPrivate.h: Removed.
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::LoaderClient::didChangeBackForwardList): Deleted.
* WebKit2.xcodeproj/project.pbxproj:



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

Introduced a layouttest failure to the mac bots (Requested by
bradeeoh on #webkit).

Reverted changeset:

"Mark mathml/wbr-in-mroot-crash.html as "Timeout Pass""
https://bugs.webkit.org/show_bug.cgi?id=130353
http://trac.webkit.org/changeset/170099

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WinCairo] Compile errors when trying to compile CA code.
https://bugs.webkit.org/show_bug.cgi?id=134030

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-06-18
Reviewed by Simon Fraser.

WinCairo does not USE(CA).

* WebCore.vcxproj/WebCore.vcxproj:
* platform/graphics/ca/TileController.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Bump the GLib and GTK+ dependencies in jhbuild-wayland.modules
https://bugs.webkit.org/show_bug.cgi?id=133971

Reviewed by Martin Robinson.

* gtk/jhbuild-wayland.modules: Bump the GTK+ dependency that's required for
building for the Wayland target. The latest 3.12 version is required to match
the xdg_shell protocol version used in Weston 1.5. GLib dependency is bumped
as well due to GTK+ depending on a newer version.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ScriptExecutionContext::Task parameters should always be rvalue references
https://bugs.webkit.org/show_bug.cgi?id=133615

Reviewed by Darin Adler.

ScriptExecutionContext::Task parameters should be rvalue references as the
passed-in objects are always ScriptExecutionContext::Task rvalues that were
implicitly constructed from a lambda function or rvalues of objects that
derive from ScriptExecutionContext::Task.

This isn't really necessary since ScriptExecutionContext::Task is non-copyable
and we have to use move semantics anyway, but it makes it clear that these
objects are expiring rvalues that must be properly dealt with.

* dom/Document.cpp:
(WebCore::Document::postTask):
* dom/Document.h:
* dom/ScriptExecutionContext.h:
* workers/DefaultSharedWorkerRepository.cpp:
(WebCore::SharedWorkerProxy::postTaskToLoader):
(WebCore::SharedWorkerProxy::postTaskForModeToWorkerGlobalScope):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::postTask):
* workers/WorkerGlobalScope.h:
* workers/WorkerLoaderProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postTaskToLoader):
(WebCore::WorkerMessagingProxy::postTaskForModeToWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::postTask):
(WebCore::WorkerRunLoop::postTaskAndTerminate):
(WebCore::WorkerRunLoop::postTaskForMode):
(WebCore::WorkerRunLoop::Task::create):
(WebCore::WorkerRunLoop::Task::Task):
* workers/WorkerRunLoop.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove duplicate code using sdiv.
https://bugs.webkit.org/show_bug.cgi?id=133764

Reviewed by Daniel Bates.


Source/JavaScriptCore: 
* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::sdiv):
Make sdiv a template to match arm64.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithDiv):
(JSC::DFG::SpeculativeJIT::compileArithMod):
Remove duplicate code that was identical except for sdiv not being a template.

Source/WebCore: 
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
Use template sdiv for apple armv7s and arm64.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add CF type cast function templates and use them in KeyedDecoder in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=134033

Reviewed by Sam Weinig.

Source/WebKit2:
* Shared/cf/KeyedDecoder.cpp:
(WebKit::KeyedDecoder::KeyedDecoder):
(WebKit::KeyedDecoder::decodeBytes):
(WebKit::KeyedDecoder::decodeBool):
(WebKit::KeyedDecoder::decodeInt32):
(WebKit::KeyedDecoder::decodeInt64):
(WebKit::KeyedDecoder::decodeFloat):
(WebKit::KeyedDecoder::decodeDouble):
(WebKit::KeyedDecoder::decodeString):
(WebKit::KeyedDecoder::beginObject):
(WebKit::KeyedDecoder::beginArray):
(WebKit::KeyedDecoder::beginArrayElement):

Source/WTF:
* WTF.xcodeproj/project.pbxproj:
* wtf/cf/TypeCasts.h: Added.
(WTF::dynamic_cf_cast):
Returns null if the given CFTypeRef object doesn't have the right type.

(WTF::checked_cf_cast):
ASSERTs (with security implication) if the given CFTypeRef object is null or doesn't have the right type.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFGGraph::m_doubleConstantMap will not map 0 values correctly.
<https://webkit.org/b/133994>

Reviewed by Geoffrey Garen.

DFGGraph::m_doubleConstantsMap should not use a double as a key to its HashMap,
because it means two unfortunate things:
- It will probably break for zero.
- It will think that -0 is the same as +0 under some circumstances, size
  -0==+0 even though they are distinct values (for example 1/-0 != 1/+0).

The fix is to use std::unordered_map which does not require special empty
and deleted values, and to use the raw bits instead of the double value as
the key.

* dfg/DFGGraph.h:
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::addressOfDoubleConstant):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove stale include, header was removed in r170101.

Unreviewed build fix.

* Shared/API/Cocoa/WebKitPrivate.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Give WKWebView on iOS a mobile user agent
https://bugs.webkit.org/show_bug.cgi?id=134034
<rdar://problem/17346489>

Reviewed by Enrica Casucci.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: REGRESSION: Style declaration editor: placeholder misaligned
https://bugs.webkit.org/show_bug.cgi?id=134012

Reviewed by Timothy Hatcher.

Removed a rule needed to align the placeholder for selectors in
the style declation text editors with no rules declared in
http://trac.webkit.org/changeset/170077. The necessary
rule has been added back to fix the issue.

* UserInterface/Views/CSSStyleDeclarationTextEditor.css:
(.css-style-text-editor > .CodeMirror .CodeMirror-placeholder):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adopt modern C++11 loops and fix WebArchive creation functions
https://bugs.webkit.org/show_bug.cgi?id=134032

Reviewed by Andreas Kling.

Source/WebCore:
Use modern loops in a couple of places, fix DocumentLoader::subresources() to return a Vector,
and stop using Vectors of PassRefPtrs.

* WebCore.exp.in:
* dom/Document.cpp:
(WebCore::Document::textInserted):
(WebCore::Document::textRemoved):
(WebCore::Document::textNodesMerged):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::subresources):
(WebCore::DocumentLoader::getSubresources): Deleted.
* loader/DocumentLoader.h:
* loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::dump):
* loader/appcache/ApplicationCache.h:
(WebCore::ApplicationCache::resources):
(WebCore::ApplicationCache::begin): Deleted.
(WebCore::ApplicationCache::end): Deleted.
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::fillResourceList):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::empty):
(WebCore::ApplicationCacheStorage::storeCopyOfCache):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
(WebCore::LegacyWebArchive::createFromSelection):
* loader/archive/cf/LegacyWebArchive.h:
* xml/XMLHttpRequestProgressEventThrottle.cpp:
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):

Source/WebKit/mac:
* WebView/WebArchive.mm:
(-[WebArchive initWithMainResource:subresources:subframeArchives:]):
* WebView/WebDataSource.mm:
(-[WebDataSource subresources]):

Source/WebKit2:
* Shared/APIWebArchive.cpp:
(API::WebArchive::WebArchive):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Simplify WebCredential
https://bugs.webkit.org/show_bug.cgi?id=134036

Reviewed by Andreas Kling.

* UIProcess/API/C/WKCredential.cpp:
(WKCredentialCreate):
(WKCredentialCreateWithCertificateInfo):
(WKCredentialCopyUser):
* UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
(WebKit::AuthenticationChallengeProxy::useCredential):
* UIProcess/Authentication/WebCredential.cpp:
(WebKit::WebCredential::credential):
(WebKit::WebCredential::core): Deleted.
(WebKit::WebCredential::user): Deleted.
* UIProcess/Authentication/WebCredential.h:
(WebKit::WebCredential::create): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Re-sync didCommitLoadForMainFrame with its corresponding tile update
https://bugs.webkit.org/show_bug.cgi?id=134009

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-06-18
Reviewed by Tim Horton.

WKWebView assumed the first _didCommitLayerTree: after _didCommitLoadForMainFrame
had the state of the page being loaded.

This is not always true. Sometimes, a set of tiles can be rendering asynchronously while the next
page is loaded, and does not flush the queue until after didCommitLoadForMainFrame is executed.

Tim introduced a transactionID with each layer tree update. This patch uses that to synchronize
WKWebView with the right set of tiles.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLoadForMainFrame]):
(-[WKWebView _didCommitLayerTree:WebKit::]):
(-[WKWebView _updateVisibleContentRects]):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
(WebKit::RemoteLayerTreeDrawingAreaProxy::nextLayerTreeTransactionID):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.messages.in:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Do not add padding when magnifying replaced elements
https://bugs.webkit.org/show_bug.cgi?id=134019

Reviewed by Tim Horton.

Having margins for regular blocks make sense to improve readability. For replaced elements,
we should follow iOS's UI and display edge to edge.

* UIProcess/ios/SmartMagnificationController.mm:
(WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-[JSContext setName:] leaks NSString
<http://webkit.org/b/134038>

Reviewed by Joseph Pecoraro.

Fixes the following static analyzer warning:

    JavaScriptCore/API/JSContext.mm:200:73: warning: Potential leak of an object
        JSStringRef nameJS = name ? JSStringCreateWithCFString((CFStringRef)[name copy]) : nullptr;
                                                                            ^

* API/JSContext.mm:
(-[JSContext setName:]): Autorelease the copy of |name|.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make ScrollingStateNodes refcounted, and other minor cleanup
https://bugs.webkit.org/show_bug.cgi?id=134040

Reviewed by Beth Dakin.

Source/WebCore:
Prepare for future scrolling frame gyrations by making
ScrollingStateNodes refcounted.

Rename ScrollingStateNode::removeChild() to removeDescendant()
since that's what it does. Also rename didRemoveNode() to willRemoveNode()
to better match the behavior.

Use 'auto' in more places.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::syncChildPositions):
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::create):
(WebCore::ScrollingStateFixedNode::clone):
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::create):
(WebCore::ScrollingStateFrameScrollingNode::clone):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::cloneAndReset):
(WebCore::ScrollingStateNode::appendChild):
(WebCore::ScrollingStateNode::removeDescendant):
(WebCore::ScrollingStateNode::willBeRemovedFromStateTree):
(WebCore::ScrollingStateNode::removeChild): Deleted.
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::children):
* page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
(WebCore::ScrollingStateOverflowScrollingNode::create):
(WebCore::ScrollingStateOverflowScrollingNode::clone):
* page/scrolling/ScrollingStateOverflowScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::create):
(WebCore::ScrollingStateStickyNode::clone):
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::attachNode):
(WebCore::ScrollingStateTree::removeNode):
(WebCore::ScrollingStateTree::willRemoveNode):
(WebCore::ScrollingStateTree::didRemoveNode): Deleted.
* page/scrolling/ScrollingStateTree.h:
(WebCore::ScrollingStateTree::setRootStateNode):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::updateTreeFromStateNode):

Source/WebKit2:
* Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::encodeNodeAndDescendants):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix after r170107.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithMod):
Use non-template sub for armv7s.



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