Add SPI for authentication
https://bugs.webkit.org/show_bug.cgi?id=128847

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame):
(WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement a few more Array prototype functions in JS
https://bugs.webkit.org/show_bug.cgi?id=128788

Reviewed by Gavin Barraclough.

Source/JavaScriptCore:

Remove a pile of awful C++, and rewrite in simple JS.

Needed to make a few other changes to get fully builtins
behavior to more accurately match a host function's.

* builtins/Array.prototype.js:
(every):
(forEach):
(filter):
(map):
(some):
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::BuiltinExecutables):
(JSC::BuiltinExecutables::createBuiltinExecutable):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitPutByVal):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitExpressionInfo):
* interpreter/Interpreter.cpp:
(JSC::GetStackTraceFunctor::operator()):
* parser/Nodes.h:
(JSC::FunctionBodyNode::overrideName):
* profiler/LegacyProfiler.cpp:
(JSC::createCallIdentifierFromFunctionImp):
* runtime/ArrayPrototype.cpp:
* runtime/JSFunction.cpp:
(JSC::JSFunction::deleteProperty):
* runtime/JSFunction.h:

Source/WebCore:

Minor change to ensure that the inspector is treating builtins
as host functions.

Tests: js/regress/array-prototype-filter.html
       js/regress/array-prototype-forEach.html
       js/regress/array-prototype-map.html
       js/regress/array-prototype-some.html

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
  Make sure we treat builtins as regular host functions

LayoutTests:

Add performance tests, and update a couple of profiler tests as
we unavoidably show the call out to some of the builtin methods.

* fast/profiler/built-in-function-calls-anonymous-expected.txt:
* fast/profiler/built-in-function-calls-user-defined-function-expected.txt:
* js/dom/array-foreach-expected.txt:
* js/dom/array-prototype-properties-expected.txt:
* js/dom/array-some-expected.txt:
* js/regress/array-prototype-filter-expected.txt: Added.
* js/regress/array-prototype-filter.html: Added.
* js/regress/array-prototype-forEach-expected.txt: Added.
* js/regress/array-prototype-forEach.html: Added.
* js/regress/array-prototype-map-expected.txt: Added.
* js/regress/array-prototype-map.html: Added.
* js/regress/array-prototype-some-expected.txt: Added.
* js/regress/array-prototype-some.html: Added.
* js/regress/script-tests/array-prototype-filter.js: Added.
(test1):
(test2):
(test3):
* js/regress/script-tests/array-prototype-forEach.js: Added.
(test1):
(test2):
(test3):
* js/regress/script-tests/array-prototype-map.js: Added.
(test1):
(test2):
(test3):
* js/regress/script-tests/array-prototype-some.js: Added.
(test1):
(test2):
(test3):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac rebaseline after r164127.

* platform/mac/media/audio-controls-rendering-expected.txt:
* platform/mac/media/controls-after-reload-expected.txt:
* platform/mac/media/controls-strict-expected.txt:
* platform/mac/media/controls-styling-strict-expected.txt:
* platform/mac/media/controls-without-preload-expected.txt:
* platform/mac/media/video-no-audio-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Make tests more consistent with Mac platform
https://bugs.webkit.org/show_bug.cgi?id=128848

Reviewed by Simon Fraser.

Source/WebKit/win: 

* Interfaces/IWebPreferencesPrivate.idl: Add access to the
mock scrollbar and screen font substitution features.
* WebPreferenceKeysPrivate.h: Ditto
* WebPreferences.cpp: Ditto
(WebPreferences::mockScrollbarsEnabled):
(WebPreferences::setMockScrollbarsEnabled):
(WebPreferences::screenFontSubstitutionEnabled):
(WebPreferences::setScreenFontSubstitutionEnabled):
* WebPreferences.h: Ditto
* WebView.cpp:
(WebView::notifyPreferencesChanged): Ditto

Tools: 

* DumpRenderTree/win/DumpRenderTree.cpp:
(resetDefaultsToConsistentValues): Turn CSS regions on,
turn mock scrollbars on, and allow screen font
substitution.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support for specced event handlers to HTMLMediaElement
https://bugs.webkit.org/show_bug.cgi?id=128292

Reviewed by Andreas Kling.

Source/WebCore:

Test: media/media-event-listeners.html

Add explicit event listener IDL attributes to HTMLMediaElement.

* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:

LayoutTests:

* media/media-event-listeners-expected.txt: Added.
* media/media-event-listeners.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Activate CSS Region Tests on Windows
https://bugs.webkit.org/show_bug.cgi?id=128854

Reviewed by Simon Fraser.

* platform/win/TestExpectations: Activate CSS Region tests, turning off a
few failures.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Replay: AtomicString replay input names should be stored in a thread-local table
https://bugs.webkit.org/show_bug.cgi?id=128829

Reviewed by Andreas Kling.

Similar to how DOM event names are frequently-used AtomicStrings, replay input
names are also checked in many places as a "type tag". This patch puts all known
input names into a class held by ThreadGlobalData and adds the shortcut `inputTypes()`
so that replay input types can be referenced with `inputTypes.InputName()`.

* WebCore.xcodeproj/project.pbxproj:
* platform/ThreadGlobalData.cpp: Add inputTypes() shortcut.
(WebCore::ThreadGlobalData::ThreadGlobalData):
* platform/ThreadGlobalData.h: Add inputTypes() shortcut.
(WebCore::ThreadGlobalData::inputTypes):
* replay/ReplayInputTypes.cpp: Added.
(WebCore::ReplayInputTypes::ReplayInputTypes):
* replay/ReplayInputTypes.h: Added.
(WebCore::inputTypes): The input names are provided by per-framework macros that
are generated by the replay inputs code generator.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164144 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r157443): Search fields with a non-white background don’t have a round bezel
https://bugs.webkit.org/show_bug.cgi?id=126295

Reviewed by Ryosuke Niwa.

Source/WebCore: 

Reverted r157443 and improved comment.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isControlStyled):

LayoutTests: 

Reverted r157443.

* fast/forms/search/search-field-background-color-expected.txt: Removed.
* fast/forms/search/search-field-background-color.html: Removed.
* platform/efl/fast/forms/search: Removed.
* platform/efl/fast/forms/search/search-field-background-color-expected.png: Removed.
* platform/efl/fast/forms/search/search-size-with-decorations-expected.png: Removed.
* platform/efl/fast/forms/search/search-size-with-decorations-expected.txt: Removed.
* platform/mac/fast/forms/search-styled-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add SPI for monitoring web process crashes
https://bugs.webkit.org/show_bug.cgi?id=128851

Reviewed by Beth Dakin.

* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::LoaderClient::processDidCrash):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-[JSManagedValue value] needs to be protected by the API lock
https://bugs.webkit.org/show_bug.cgi?id=128857

Reviewed by Mark Lam.

* API/APICast.h:
(toRef): Added an ASSERT so that we can detect these sorts of errors earlier. On 32-bit, toRef
can allocate objects so we need to be holding the lock.
* API/APIShims.h: Removed outdated comments.
* API/JSManagedValue.mm: Added RefPtr<JSLock> to JSManagedValue.
(-[JSManagedValue initWithValue:]): Initialize the m_lock field.
(-[JSManagedValue value]): Lock the JSLock, check the VM*, return nil if invalid, take the APIEntryShim otherwise.
* runtime/JSLock.cpp: Bug fix in JSLock. We were assuming that the VM was always non-null in JSLock::lock.
(JSC::JSLock::lock):


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