REGRESSION: RELEASE_ASSERT in CodeBlock::baselineVersion @ cnn.com
https://bugs.webkit.org/show_bug.cgi?id=132581

Reviewed by Filip Pizlo.

* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::isStillValid): Check that the alternative codeBlock we
started compiling for is still the same at the end of compilation.
Also did some minor restructuring.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WIN] Enhance auto-version.sh to handle all-caps or mixed-case build environment variable
https://bugs.webkit.org/show_bug.cgi?id=132580
<rdar://problem/16811179>

Reviewed by Dean Jackson.

* win/tools/scripts/auto-version.sh: Fall back to all-caps version
of environment variable if mixed-case version is not present.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168320 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WIN] Enhance auto-version.sh to handle all-caps or mixed-case build environment variable
https://bugs.webkit.org/show_bug.cgi?id=132580
<rdar://problem/16811179>

Reviewed by Dean Jackson.

* win/tools/scripts/auto-version.sh: Incorporate Mark's revised syntax.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Named element cache can become invalid during HTMLCollection::updateNamedElementCache()
https://bugs.webkit.org/show_bug.cgi?id=132575

Reviewed by Ryosuke Niwa.

Source/WebCore:
Make sure the named element cache object stays valid in
HTMLCollection::updateNamedElementCache() while it is populating it.

The method was previously creating and setting the cache first, and then start
traversing the DOM tree to populate it. As a consequence, hasNamedElementCache()
would start returning true before the cache is actually populated.
The issue is that finding matches in the DOM tree can cause
HTMLCollection::invalidateCache() to be called under certain circumstances and
thus the named element cache object can become invalid while
updateNamedElementCache() is populating it.

To avoid the issue, this patch updates updateNamedElementCache() so that the
named element cache map is set *after* traversing the DOM tree. This way,
hasNamedElementCache() returns false while the cache is being populated and
there is no chance of it being invalidated too early.

Test: fast/dom/htmlcollection-selectedOptions-namedItem-crash.html

* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::updateNamedElementCache):
* html/HTMLCollection.h:
(WebCore::HTMLCollection::setNameItemCache):
(WebCore::HTMLCollection::createNameItemCache): Deleted.
* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::updateNamedElementCache):

LayoutTests:
Add layout test to verify that HTMLCollection::updateNamedElementCache() is no longer
crashing for collections of selected options.

* fast/dom/htmlcollection-selectedOptions-namedItem-crash-expected.txt: Added.
* fast/dom/htmlcollection-selectedOptions-namedItem-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=132522
Clean up ProcessThrottler

Unreviewed: bad build fix. Will work out what the right include is asap.

* UIProcess/ios/WebProcessProxyIOS.mm:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add SPI to provide the WebCrypto master key
https://bugs.webkit.org/show_bug.cgi?id=132586
<rdar://problem/16091460>

Reviewed by Dan Bernstein.

* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::webCryptoMasterKey):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::LoaderClient::webCryptoMasterKey):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::wrapCryptoKey):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Need a delegate that informs the UI process when the page's pin state changes
https://bugs.webkit.org/show_bug.cgi?id=132583
-and corresponding-
<rdar://problem/16806231>

Reviewed by Anders Carlsson.


Source/WebCore: 
We should default all of these pin-state value to true.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::ScrollingTree):

Source/WebKit2: 
New UIClient function pinnedStateDidChange. 

* UIProcess/API/APIUIClient.h:
(API::UIClient::pinnedStateDidChange):

Create WKPageUIClientV3 to add this function.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:

Change default initialization to true instead of false, which makes more sense for 
this API.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up Image Document and tweak the layout and viewport
https://bugs.webkit.org/show_bug.cgi?id=132552


Source/WebCore: 
Reviewed by Sam Weinig.

The #ifdef in every function was making quite a mess. A lot of that code does
not make sense on iOS.

This patch make a clean split between mouse related stuff and iOS.

Also:
-Change the viewport to be only width based, and avoid scaling in portrait.
-Center the image horizontally in the view.

* html/ImageDocument.cpp:
(WebCore::ImageDocument::ImageDocument):
(WebCore::ImageDocument::createDocumentStructure):
(WebCore::ImageDocument::imageUpdated):
(WebCore::ImageDocument::scale):
(WebCore::ImageDocument::resizeImageToFit):
(WebCore::ImageDocument::imageFitsInWindow):
(WebCore::ImageDocument::windowSizeChanged):
(WebCore::ImageDocument::imageClicked):
* html/ImageDocument.h:

Tools: 
Reviewed by Anders Carlsson.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
Update the default settings to have something consistent with WebKit2.

LayoutTests: 
Reviewed by Anders Carlsson.

* svg/custom/anchor-on-use-expected.svg:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r168256): ASSERTION FAILED: (buffer + m_length) == position loading vanityfair.com article.
<https://webkit.org/b/168256>
<rdar://problem/16816316>

Source/JavaScriptCore:
Make resolveRopeSlowCase8() behave like its 16-bit counterpart and not
clear the fibers. The caller takes care of this.

Test: fast/dom/getElementById-with-rope-string-arg.html

Reviewed by Geoffrey Garen.

* runtime/JSString.cpp:
(JSC::JSRopeString::resolveRopeSlowCase8):

LayoutTests:
Reviewed by Geoffrey Garen.

* fast/dom/getElementById-with-rope-string-arg-expected.txt: Added.
* fast/dom/getElementById-with-rope-string-arg.html: Added.

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