WebKit.git
4 years agoUse a 2px border radius instead to look good on 2x devices as well as 1x.
timothy@apple.com [Thu, 14 Jan 2016 19:05:07 +0000 (19:05 +0000)]
Use a 2px border radius instead to look good on 2x devices as well as 1x.

* wp-content/themes/webkit/style.css:
(.timeline .time):

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

4 years agoAdd a unit test to test BuildbotQueueView._appendPendingRevisionCount. https://bugs...
jmarcell@apple.com [Thu, 14 Jan 2016 19:01:36 +0000 (19:01 +0000)]
Add a unit test to test BuildbotQueueView._appendPendingRevisionCount. https://bugs.webkit.org/show_bug.cgi?id=152910

Reviewed by Daniel Bates.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockBuildbotQueue.js: Added.
(MockBuildbotQueue): Added. Mock BuildbotQueue object that doesn't need to talk to an actual Buildbot server.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockBuildbotQueueView.js: Added.
(MockBuildbotQueueView): Added. Mock BuildbotQueueView object that returns a pre-specified _latestProductiveIteration without
the need to talk to a real Buildbot server.
(MockBuildbotQueueView.prototype._latestProductiveIteration): Added. Returns a pre-specified _latestProductiveIteration
without the need to talk to a real Buildbot server.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js: Added.
(MockTrac): Added. Mock Trac constructor that has pre-populated "recordedCommits" and does not need to talk to a real Trac
server.
(MockTrac.prototype.get oldestRecordedRevisionNumber): Added. Returns a pre-specified revision.
(MockTrac.prototype.get latestRecordedRevisionNumber): Ditto.
(MockTrac.prototype.loadMoreHistoricalData): Added. Overrides the real loadMoreHistoricalData so that we don't waste time
trying to talk to Trac.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/index.html: Added. Web page container for
QUnit unit tests.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js: Added. QUnit unit tests.

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

4 years agoFix hairline crack on 1x devices between arrow and time label.
timothy@apple.com [Thu, 14 Jan 2016 19:00:45 +0000 (19:00 +0000)]
Fix hairline crack on 1x devices between arrow and time label.

* wp-content/themes/webkit/style.css:
(.timeline .content):
(.timeline .time):

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

4 years agoMove streams/webkitGetUserMedia-shadowing-then.html to fast/mediastream
youenn.fablet@crf.canon.fr [Thu, 14 Jan 2016 18:18:19 +0000 (18:18 +0000)]
Move streams/webkitGetUserMedia-shadowing-then.html to fast/mediastream
https://bugs.webkit.org/show_bug.cgi?id=152973

Reviewed by Brent Fulgham.

Moved the test, made it asynchronous to ensure that the error callback is called.

* fast/mediastream/webkitGetUserMedia-shadowing-then-expected.txt: Renamed from LayoutTests/streams/webkitGetUserMedia-shadowing-then-expected.txt.
* fast/mediastream/webkitGetUserMedia-shadowing-then.html: Renamed from LayoutTests/streams/webkitGetUserMedia-shadowing-then.html.

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

4 years agoUnreviewed, rolling out r195002.
commit-queue@webkit.org [Thu, 14 Jan 2016 17:50:12 +0000 (17:50 +0000)]
Unreviewed, rolling out r195002.
https://bugs.webkit.org/show_bug.cgi?id=153098

Crashes many/most editing tests (Requested by ap on #webkit).

Reverted changeset:

"WK2: Request completion candidates when needed"
https://bugs.webkit.org/show_bug.cgi?id=153040
http://trac.webkit.org/changeset/195002

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

4 years ago[GTK] [EFL] Hyphenation can never work in practice due to requirements on lang tags
commit-queue@webkit.org [Thu, 14 Jan 2016 17:32:24 +0000 (17:32 +0000)]
[GTK] [EFL] Hyphenation can never work in practice due to requirements on lang tags
https://bugs.webkit.org/show_bug.cgi?id=147310

Patch by Martin Robinson <mrobinson@igalia.com> on 2016-01-14
Reviewed by Michael Catanzaro.

Source/WebCore:

Test: platform/gtk/fast/text/hyphenate-flexible-locales.html

* platform/text/hyphen/HyphenationLibHyphen.cpp: Make locale matching for dictionary
selection a lot looser by matching case insensitively, matching multiple dictionaries
when only the language is specified, and ignoring the difference between '_' and '-' in
the locale name.
(WebCore::scanDirectoryForDicionaries): Now produce HashMap of Vectors instead of a single
path for each locale. Also add alternate entries to handle different ways of specifying
the locale.
(WebCore::scanTestDictionariesDirectoryIfNecessary): Update to handle the difference
in HashMap type.
(WebCore::availableLocales): Ditto.
(WebCore::canHyphenate): Also look for the lowercased version of the locale.
(WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForKey):
Key on the dictionary path now so that we can load more than one dictionary per locale.
(WebCore::lastHyphenLocation): Iterate through each matched dictionary in turn.

LayoutTests:

Update some baselines and add a GTK+ specific test for locale variations.

* platform/gtk/fast/text/hyphenate-flexible-locales-expected.html: Added.
* platform/gtk/fast/text/hyphenate-flexible-locales.html: Added.
* platform/gtk/fast/text/hyphenate-locale-expected.png: We now properly hyphenate
text with the 'en' locale.
* platform/gtk/fast/text/hyphenate-locale-expected.txt:

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

4 years ago[CMake][GTK] CMake Error: Could not create named generator Eclipse CDT4 - Ninja
commit-queue@webkit.org [Thu, 14 Jan 2016 16:31:58 +0000 (16:31 +0000)]
[CMake][GTK] CMake Error: Could not create named generator Eclipse CDT4 - Ninja
https://bugs.webkit.org/show_bug.cgi?id=132599

Patch by Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au> on 2016-01-14
Reviewed by Michael Catanzaro.

Check if cmake Ninja generators are installed.

* Scripts/webkitdirs.pm:
(canUseNinjaGenerator):
(canUseEclipseNinjaGenerator):
(generateBuildSystemFromCMakeProject):
(canUseEclipse): Deleted.

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

4 years ago[EFL][GTK][SeccompFilter] Fix build break when enabling --seccomp-filters
gyuyoung.kim@webkit.org [Thu, 14 Jan 2016 14:42:22 +0000 (14:42 +0000)]
[EFL][GTK][SeccompFilter] Fix build break when enabling --seccomp-filters
https://bugs.webkit.org/show_bug.cgi?id=153094

Reviewed by Csaba Osztrogonác.

diskCacheDirectory and cookiePersistentStoragePath were removed by r192796.
But SyscallPolicy::addDefaultWebProcessPolicy has added directory permission
to the removed paths.

It looks two paths needs to be handled by network process.

* Shared/linux/SeccompFilters/SyscallPolicy.cpp:
(WebKit::SyscallPolicy::addDefaultWebProcessPolicy): Deleted.

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

4 years agoPart 2/2: Stop using USE(CFNETWORK) path on iOS
ddkilzer@apple.com [Thu, 14 Jan 2016 12:04:58 +0000 (12:04 +0000)]
Part 2/2: Stop using USE(CFNETWORK) path on iOS
<https://webkit.org/b/142540>

Original patch by Antti Koivisto <antti@apple.com> on 2015-03-10
Reviewed by Chris Dumez.

* wtf/Platform.h: Turn off USE(CFNETWORK) for PLATFORM(IOS).

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

4 years ago[Win] Remove workarounds for fixed bugs in fmod and pow.
peavo@outlook.com [Thu, 14 Jan 2016 08:50:23 +0000 (08:50 +0000)]
[Win] Remove workarounds for fixed bugs in fmod and pow.
https://bugs.webkit.org/show_bug.cgi?id=153071

Reviewed by Brent Fulgham.

Source/WebCore:

Compile fix, help MSVC pick correct pow overload.

* rendering/shapes/BoxShape.cpp:
(WebCore::adjustRadiusForMarginBoxShape):

Source/WTF:

The bugs have been fixed in the MSVC CRT, and we can remove the workarounds.

* wtf/MathExtras.h:
(wtf_fmod): Deleted.
(wtf_pow): Deleted.

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

4 years agoFix problems with cross-origin redirects
youenn.fablet@crf.canon.fr [Thu, 14 Jan 2016 08:39:13 +0000 (08:39 +0000)]
Fix problems with cross-origin redirects
https://bugs.webkit.org/show_bug.cgi?id=116075

Reviewed by Daniel Bates.

LayoutTests/imported/w3c:

Rebasing test expectations.
These tests cannot work as expected as WTR/DRT block access to www2.localhost and example.not.

* web-platform-tests/XMLHttpRequest/send-redirect-bogus-expected.txt:
* web-platform-tests/XMLHttpRequest/send-redirect-to-cors-expected.txt:
* web-platform-tests/XMLHttpRequest/send-redirect-to-non-cors-expected.txt:

Source/WebCore:

Merging https://chromium.googlesource.com/chromium/blink/+/7ea774e478f84f355748108d2aaabca15355d512 by Ken Russell
Same origin redirect responses leading to cross-origin requests were checked as cross-origin redirect responses.
Introduced ClientRequestedCredentials to manage whether credentials are needed or not in the cross-origin request.

In addition to Blink patch, it was needed to update some loaders with the newly introduced ClientRequestedCredentials parameter.
Added the clearing of "Accept-Encoding" header from cross-origin requests as Mac HTTP network layer is adding it for same-origin requests.

Test: http/tests/xmlhttprequest/access-control-and-redirects-async-same-origin.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource): Added new security parameter (from Blink patch).
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived): Updated checks so that same origin redirections are not treated as cross origin redirections (from Blink patch).
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::start):
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader): Added new security parameter.
* loader/ResourceLoaderOptions.h:
(WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Added new security parameter (from Blink patch).
(WebCore::ResourceLoaderOptions::credentialRequest):
(WebCore::ResourceLoaderOptions::setCredentialRequest):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Ditto.
(WebCore::CachedResourceLoader::defaultCachedResourceOptions): Ditto.
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading): Added new security parameter.
* page/EventSource.cpp:
(WebCore::EventSource::connect): Added new security parameter (from Blink patch).
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::startLoading): Added new security parameter.
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::startLoading): Ditto.
* platform/network/ResourceHandleTypes.h: Added new security parameter constants (from Blink patch).
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::clearHTTPAcceptEncoding): Function to remove "Accept-Encoding" header.
* platform/network/ResourceRequestBase.h: Ditto.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest): Added new security parameter.

LayoutTests:

Merging https://chromium.googlesource.com/chromium/blink/+/7ea774e478f84f355748108d2aaabca15355d512 by Ken Russell
This merge adds tests for cross origin requests triggered from same origin redirection responses with and without credentials).
Rebaseline of some tests due to console error messages generated from newly hit CORS checks.

* TestExpectations: Disabled WPT tests that require access to non localhost URLs which are currently blocked by DTR/WTR.
* http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt:
* http/tests/xmlhttprequest/access-control-and-redirects-async-same-origin-expected.txt: Added.
* http/tests/xmlhttprequest/access-control-and-redirects-async-same-origin.html: Added.
* http/tests/xmlhttprequest/access-control-and-redirects-async.html:
* http/tests/xmlhttprequest/access-control-and-redirects-expected.txt:
* http/tests/xmlhttprequest/access-control-and-redirects.html:
* http/tests/xmlhttprequest/redirect-cross-origin-2-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-post-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-tripmine-expected.txt:
* http/tests/xmlhttprequest/resources/access-control-basic-allow-no-credentials.cgi: Added.
* http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt:

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

4 years ago[CMake] Do not use LLVM static libraries for FTL JIT
carlosgc@webkit.org [Thu, 14 Jan 2016 07:34:09 +0000 (07:34 +0000)]
[CMake] Do not use LLVM static libraries for FTL JIT
https://bugs.webkit.org/show_bug.cgi?id=151559

Reviewed by Michael Catanzaro.

.:

Also export LLVM_LIBRARIES variable that can be used to prefer
linking to the llvm dynamic libraries.

* Source/cmake/FindLLVM.cmake:

Source/JavaScriptCore:

Allow ports decide whether to prefer linking to llvm static or
dynamic libraries. This patch only changes the behavior of the GTK
port, other ports can change the default behavior by setting
llvmForJSC_LIBRARIES in their platform specific cmake files.

* CMakeLists.txt: Move llvmForJSC library definition after the
WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS, to allow platform specific
files to set their own llvmForJSC_LIBRARIES. When not set, it
defaults to LLVM_STATIC_LIBRARIES. The command to create
WebKitLLVMLibraryToken.h no longer depends on the static
libraries, since we are going to make the build fail anyway when
not found in case of linking to the static libraries. If platform
specific file defined llvmForJSC_INSTALL_DIR llvmForJSC is also
installed to the given destination.
* PlatformGTK.cmake: Set llvmForJSC_LIBRARIES and
llvmForJSC_INSTALL_DIR.

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

4 years agoCorrect some history timeline styles.
timothy@apple.com [Thu, 14 Jan 2016 07:00:06 +0000 (07:00 +0000)]
Correct some history timeline styles.

* wp-content/themes/webkit/style.css:
(.timeline .content):

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

4 years agoAdd styles for a history timeline, needed by an upcoming blog post.
timothy@apple.com [Thu, 14 Jan 2016 06:49:05 +0000 (06:49 +0000)]
Add styles for a history timeline, needed by an upcoming blog post.

* wp-content/themes/webkit/style.css:
(.timeline):
(.timeline:after):
(.timeline *):
(.timeline:before):
(.timeline > li):
(.timeline > li:before):
(.timeline .content):
(.timeline figure):
(.timeline .time):
(.timeline h2, .timeline h3):
(.timeline .time::before):
(.timeline img):
(@media (min-width: 900px)):
(.timeline > li.force-clear):
(.timeline > li:nth-child(odd)):
(.timeline > li:nth-child(even)):
(.timeline > li.force-clear + li):
(.timeline li .time):
(.timeline li:nth-child(odd) .time):
(.timeline li:nth-child(even) .time):
(.timeline li:nth-child(even) .time::before):
(.timeline > li:nth-child(even):before):

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

4 years agoAddressing more post-review comments after r194566
mmaxfield@apple.com [Thu, 14 Jan 2016 06:22:24 +0000 (06:22 +0000)]
Addressing more post-review comments after r194566

Unreviewed.

No new tests because there is no behavior change.

* platform/text/mac/TextBreakIteratorInternalICUMac.mm:
(WebCore::topLanguagePreference):

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

4 years agoImplement custom protocols when using NetworkSession
commit-queue@webkit.org [Thu, 14 Jan 2016 02:43:48 +0000 (02:43 +0000)]
Implement custom protocols when using NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=153078

Patch by Alex Christensen <achristensen@webkit.org> on 2016-01-13
Reviewed by Andy Estes.

Source/WebCore:

No new tests, but this makes the WebKit2CustomProtocolsTest api tests pass when using NetworkSession.

* WebCore.xcodeproj/project.pbxproj:
Make NSURLConnectionSPI.h private so we can include it from within WebKit2.

Source/WebKit2:

* NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
(WebKit::generateCustomProtocolID):
(+[WKCustomProtocol canInitWithRequest:]):
(+[WKCustomProtocol canonicalRequestForRequest:]):
(-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
(-[WKCustomProtocol startLoading]):
(-[WKCustomProtocol stopLoading]):
There's no need to have a static pointer when we can use NetworkProcess::singleton to access
the process-global CustomProtocolManager, and add null checks because that's a good thing to do.
(WebKit::CustomProtocolManager::CustomProtocolManager):
Call UTF8Encoding when creating the CustomProtocolManager on the main thread to make sure it exists
for when we decode URLS in ResourceResponses from IPC later, which is done on a different WorkQueue.
(WebKit::CustomProtocolManager::initializeConnection):
(WebKit::CustomProtocolManager::initialize):
(WebKit::CustomProtocolManager::removeCustomProtocol):
(WebKit::CustomProtocolManager::registerProtocolClass):
(WebKit::CustomProtocolManager::registerScheme):
* NetworkProcess/CustomProtocols/CustomProtocolManager.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSession::NetworkSession):
Call registerProtocolClass to set configuration.protocolClasses if there is a CustomProtocolManager.

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

4 years agoCross-protocol, cross-site scripting (XPSS) using HTML forms
bfulgham@apple.com [Thu, 14 Jan 2016 01:29:17 +0000 (01:29 +0000)]
Cross-protocol, cross-site scripting (XPSS) using HTML forms
https://bugs.webkit.org/show_bug.cgi?id=153017
<rdar://problem/5873254>

Reviewed by David Kilzer.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): If response HTTP version is 0.9,
sandbox against script execution and plugins.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveResponse): Ditto.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse): Ditto.
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::adopt): Update for HTTP version.
(WebCore::ResourceResponseBase::copyData): Ditto.
(WebCore::ResourceResponseBase::httpVersion): Added.
(WebCore::ResourceResponseBase::setHTTPVersion): Ditto.
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::encode): Update for HTTP version.
(WebCore::ResourceResponseBase::decode): Ditto.
* platform/network/cf/ResourceResponseCFNet.cpp:
(WebCore::ResourceResponse::platformLazyInit): Capture HTTP version.
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformLazyInit): Ditto.

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

4 years agoMarking test as flaky: sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object...
ryanhaddad@apple.com [Thu, 14 Jan 2016 01:12:46 +0000 (01:12 +0000)]
Marking test as flaky: sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.3/15.1.3.3_encodeURI/S15.1.3.3_A2.4_T2.html
https://bugs.webkit.org/show_bug.cgi?id=153086

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoWK2: Request completion candidates when needed
bdakin@apple.com [Thu, 14 Jan 2016 01:03:01 +0000 (01:03 +0000)]
WK2: Request completion candidates when needed
https://bugs.webkit.org/show_bug.cgi?id=153040
-and corresponding-
rdar://problem/24155631

Reviewed by Enrica Casucci.

Source/WebCore:

Helper functions for stringForCandidateRequest() and
handleAcceptedCandidate()
* editing/Editor.cpp:
(WebCore::candidateRangeForSelection):
(WebCore::candidateWouldReplaceText):

Request candidates for the word that is currently being typed so long as the
candidate would replace that word. Otherwise, use String().
(WebCore::Editor::stringForCandidateRequest):

When a candidate has been accepted, insert the text.
(WebCore::Editor::handleAcceptedCandidate):
* editing/Editor.h:

Source/WebKit2:

Mac needs to support postLayoutData in order to have some layout-related
editing information to request candidates. This patch re-shuffles some items
in the struct so that they can be shared by Mac and iOS, and it adds 3 new
items for Mac only.
* Shared/EditorState.cpp:
(WebKit::EditorState::encode):
(WebKit::EditorState::decode):
(WebKit::EditorState::PostLayoutData::encode):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:

Request and handle candidates here in WebViewImpl, and cache the
m_lastStringForCandidateRequest so that we can ensure the results we receive
were received in a timely enough manner that they are still for the same
String.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::selectionDidChange):

When selection changes, request new candidates.
(WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):

Once candidates have been received, we ask the sharedSpellChecker to show
them.
(WebKit::WebViewImpl::handleRequestedCandidates):

If a candidate is accepted, we ask the WebProcess to accept it, so we start
by converting the NSTextCheckingResult to a WebCore::TextCheckingResult.
(WebKit::textCheckingResultFromNSTextCheckingResult):
(WebKit::WebViewImpl::handleAcceptedCandidate):

Ask the WebProcess to handle accepting the candidate.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleAcceptedCandidate):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage:: handleAcceptedCandidate):
* WebProcess/WebPage/WebPage.messages.in:

Now that Mac has some postLayoutData in the EditorState, fill that in in
platformEditorState().
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformEditorState):

Ask WebCore::Editor to handle the accepted candidate.
(WebKit::WebPage::handleAcceptedCandidate):

LayoutTests:

Getting updated EditorState in platformEditorState causes some extra layout
to happen, so now the layout test results for WK2 reflect the results that we
already see on iOS for this test and they reflect the render tree as it is
when you load the page in browser.
* platform/mac/fast/dom/focus-contenteditable-expected.txt:

WebKit 1 is not affected by these new results, so this adds WK-1 only results
that match the old Mac results.
* platform/mac-wk1/fast/dom: Added.
* platform/mac-wk1/fast/dom/focus-contenteditable-expected.txt: Added.

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

4 years agoAddressing post-review comments after r194566
mmaxfield@apple.com [Thu, 14 Jan 2016 00:29:55 +0000 (00:29 +0000)]
Addressing post-review comments after r194566

Unreviewed.

No new tests because there is no behavior difference.

* platform/text/mac/TextBreakIteratorInternalICUMac.mm:
(WebCore::textBreakLocalePreference):
(WebCore::topLanguagePreference):
(WebCore::getSearchLocale):
(WebCore::getTextBreakLocale):
(WebCore::canonicalLanguageIdentifier): Deleted.

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

4 years agoNativeExecutable should have a name field
sbarati@apple.com [Thu, 14 Jan 2016 00:28:40 +0000 (00:28 +0000)]
NativeExecutable should have a name field
https://bugs.webkit.org/show_bug.cgi?id=153083

Reviewed by Geoffrey Garen.

This is going to help the SamplingProfiler come up
with names for NativeExecutable objects it encounters.

* jit/JITThunks.cpp:
(JSC::JITThunks::finalize):
(JSC::JITThunks::hostFunctionStub):
* jit/JITThunks.h:
* runtime/Executable.h:
* runtime/JSBoundFunction.cpp:
(JSC::JSBoundFunction::create):
* runtime/JSFunction.cpp:
(JSC::JSFunction::create):
(JSC::JSFunction::lookUpOrCreateNativeExecutable):
* runtime/JSFunction.h:
(JSC::JSFunction::createImpl):
* runtime/JSNativeStdFunction.cpp:
(JSC::JSNativeStdFunction::create):
* runtime/VM.cpp:
(JSC::thunkGeneratorForIntrinsic):
(JSC::VM::getHostFunction):
* runtime/VM.h:
(JSC::VM::getCTIStub):
(JSC::VM::exceptionOffset):

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

4 years agoformaction must return document's address when formaction is missing
rniwa@webkit.org [Thu, 14 Jan 2016 00:04:56 +0000 (00:04 +0000)]
formaction must return document's address when formaction is missing
https://bugs.webkit.org/show_bug.cgi?id=148874

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Rebaselined the tests now that more test cases are passing.

* web-platform-tests/html/semantics/forms/attributes-common-to-form-controls/formAction_document_address-expected.txt:
* web-platform-tests/html/semantics/forms/attributes-common-to-form-controls/formaction-expected.txt:

Source/WebCore:

Fixed the bug by falling back to document.url() when the attribute is not set or is empty in formAction getter.

Test: fast/forms/formaction-attribute-with-empty-value.html

* html/HTMLButtonElement.idl:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::formAction): Added.
(WebCore::HTMLFormControlElement::setFormAction): Added.
* html/HTMLFormControlElement.h:
* html/HTMLInputElement.idl:

LayoutTests:

Added a regression test and rebaselined imported W3C tests.

* fast/forms/formaction-attribute-with-empty-value-expected.txt: Added.
* fast/forms/formaction-attribute-with-empty-value.html: Added.
* fast/forms/submit-form-attributes-expected.txt:
* fast/forms/submit-form-attributes.html:

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

4 years ago[ES6] Support subclassing the String builtin object
keith_miller@apple.com [Wed, 13 Jan 2016 23:45:14 +0000 (23:45 +0000)]
[ES6] Support subclassing the String builtin object
https://bugs.webkit.org/show_bug.cgi?id=153068

Reviewed by Michael Saboff.

This patch adds subclassing of strings. Also, this patch fixes a bug where we could have
the wrong indexing type for builtins constructed without storage.

* runtime/PrototypeMap.cpp:
(JSC::PrototypeMap::emptyStructureForPrototypeFromBaseStructure):
* runtime/StringConstructor.cpp:
(JSC::constructWithStringConstructor):
* tests/stress/class-subclassing-string.js: Added.
(test):

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

4 years ago[Cocoa] Testing with font family name "System Font" is unused
mmaxfield@apple.com [Wed, 13 Jan 2016 23:31:08 +0000 (23:31 +0000)]
[Cocoa] Testing with font family name "System Font" is unused
https://bugs.webkit.org/show_bug.cgi?id=153073
<rdar://problem/24091683>

Reviewed by Brent Fulgham.

* DumpRenderTree/mac/DumpRenderTree.mm:
(allowedFontFamilySet): Deleted.
* WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm:
(WTR::allowedFontFamilySet): Deleted.
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::allowedFontFamilySet): Deleted.

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

4 years agoThe StringFromCharCode DFG intrinsic should support untyped operands.
mark.lam@apple.com [Wed, 13 Jan 2016 23:28:38 +0000 (23:28 +0000)]
The StringFromCharCode DFG intrinsic should support untyped operands.
https://bugs.webkit.org/show_bug.cgi?id=153046

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

The current StringFromCharCode DFG intrinsic assumes that its operand charCode
must be an Int32.  This results in 26000+ BadType OSR exits in the LongSpider
crypto-aes benchmark.  With support for Untyped operands, the number of OSR
exits drops to 202.

* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileFromCharCode):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGValidate.cpp:
(JSC::DFG::Validate::validate):
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::toUInt32):

LayoutTests:

* js/regress/ftl-polymorphic-StringFromCharCode-expected.txt: Added.
* js/regress/ftl-polymorphic-StringFromCharCode.html: Added.
* js/regress/script-tests/ftl-polymorphic-StringFromCharCode.js: Added.
(o1.valueOf):
(foo):

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

4 years ago[GTK] Add comments above options declarations in OptionsGTK.cmake
mcatanzaro@igalia.com [Wed, 13 Jan 2016 23:06:20 +0000 (23:06 +0000)]
[GTK] Add comments above options declarations in OptionsGTK.cmake
https://bugs.webkit.org/show_bug.cgi?id=153074

Reviewed by Martin Robinson.

* Source/cmake/OptionsGTK.cmake:

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

4 years agoUnreviewed, rolling out r194900.
cdumez@apple.com [Wed, 13 Jan 2016 23:00:14 +0000 (23:00 +0000)]
Unreviewed, rolling out r194900.

Roll back in as this did not actually regress PLT

Reverted changeset:

"Unreviewed, rolling out r194826."
https://bugs.webkit.org/show_bug.cgi?id=153020
http://trac.webkit.org/changeset/194900

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

4 years agoWebKit2 should have an API for eagerly querying whether the web process is responsive
ggaren@apple.com [Wed, 13 Jan 2016 22:45:38 +0000 (22:45 +0000)]
WebKit2 should have an API for eagerly querying whether the web process is responsive
https://bugs.webkit.org/show_bug.cgi?id=153037

Reviewed by Tim Horton.

WebKit2 provides a delegate notification when the web process doesn't
respond to a message after a while. But there's no way to send a message
eagerly and check for reply.

We want this new mechanism so that navigation can terminate the web
process eagerly if it is hung.

* UIProcess/API/C/WKPage.cpp:
(WKPageGetWebProcessIsResponsive):
* UIProcess/API/C/WKPagePrivate.h: This is the new API.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::sendWheelEvent): Updated for interface change.

(WebKit::WebPageProxy::getWebProcessIsResponsive): Calls through to the
web process proxy. We claim that we are responsive when there is no
web process because we assume that a fresh web process will not hang.

* UIProcess/WebPageProxy.h:

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::WebProcessProxy::didBecomeUnresponsive): Keep a flag indicating
whether the process is unresponsive so that we can fire unresponsiveness
callbacks immediately for a hung process instead of waiting another 3s.

(WebKit::WebProcessProxy::didBecomeResponsive): We don't fire responsiveness
callbacks inside didBecomeResponsive because we assume that a responsive
web process will invoke didReceiveMainThreadPing -- and we fire the
callbacks there.

(WebKit::WebProcessProxy::getIsResponsive): If the web process is already
known to be unresponsive, fire the callback right away. Otherwise, queue
it up to fire once we have an answer from a main thread ping.

(WebKit::WebProcessProxy::didReceiveMainThreadPing): Fire any pending
callbacks when we learn that the web process is responsive.

* UIProcess/WebProcessProxy.h:

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

4 years agoRemoved empty #if block from Font.h
commit-queue@webkit.org [Wed, 13 Jan 2016 22:32:55 +0000 (22:32 +0000)]
Removed empty #if block from Font.h
https://bugs.webkit.org/show_bug.cgi?id=153067

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-01-13
Reviewed by Alex Christensen.

No new tests needed.

* platform/graphics/Font.h:
(WebCore::Font::scriptCache): Deleted.

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

4 years ago[GTK] Consistently use virtual and override specifiers in ScrollbarThemeGtk
mcatanzaro@igalia.com [Wed, 13 Jan 2016 22:29:01 +0000 (22:29 +0000)]
[GTK] Consistently use virtual and override specifiers in ScrollbarThemeGtk
https://bugs.webkit.org/show_bug.cgi?id=153076

Reviewed by Alex Christensen.

No behavior change.

* platform/gtk/ScrollbarThemeGtk.h:

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

4 years agoUse DFG Graph::binary/unaryArithShouldSpeculateInt32/MachineInt() functions consistently.
mark.lam@apple.com [Wed, 13 Jan 2016 22:21:40 +0000 (22:21 +0000)]
Use DFG Graph::binary/unaryArithShouldSpeculateInt32/MachineInt() functions consistently.
https://bugs.webkit.org/show_bug.cgi?id=153080

Reviewed by Geoffrey Garen.

We currently have Graph::mulShouldSpeculateInt32/machineInt() and
Graph::negateShouldSpeculateInt32/MachineInt() functions which are only used by
the ArithMul and ArithNegate nodes.  However, the same tests need to be done for
many other arith nodes in the DFG.  This patch renames these functions as
Graph::binaryArithShouldSpeculateInt32/machineInt() and
Graph::unaryArithShouldSpeculateInt32/MachineInt(), and uses them consistently
in the DFG.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::addShouldSpeculateMachineInt):
(JSC::DFG::Graph::binaryArithShouldSpeculateInt32):
(JSC::DFG::Graph::binaryArithShouldSpeculateMachineInt):
(JSC::DFG::Graph::unaryArithShouldSpeculateInt32):
(JSC::DFG::Graph::unaryArithShouldSpeculateMachineInt):
(JSC::DFG::Graph::mulShouldSpeculateInt32): Deleted.
(JSC::DFG::Graph::mulShouldSpeculateMachineInt): Deleted.
(JSC::DFG::Graph::negateShouldSpeculateInt32): Deleted.
(JSC::DFG::Graph::negateShouldSpeculateMachineInt): Deleted.
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
(JSC::DFG::PredictionPropagationPhase::doDoubleVoting):

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

4 years agoCleanup: XSS Auditor should avoid re-evaluating the parsed script tag
commit-queue@webkit.org [Wed, 13 Jan 2016 21:45:07 +0000 (21:45 +0000)]
Cleanup: XSS Auditor should avoid re-evaluating the parsed script tag
https://bugs.webkit.org/show_bug.cgi?id=152870

Patch by Daniel Bates <dabates@apple.com> on 2016-01-13
Reviewed by Brent Fulgham.

Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
<https://src.chromium.org/viewvc/blink?revision=154354&view=revision>

Although the XSS Auditor caches the decoded start tag of a script as an optimization to
avoid decoding it again when filtering the character data of the script, it is sufficient
to cache whether the HTTP response contains the decoded start tag of a script. This
avoids both decoding the start tag of a script and determining whether the HTTP response
contains it again when filtering the character data of the script. Moreover, this removes
the need to cache a string object.

* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::filterCharacterToken):
(WebCore::XSSAuditor::filterScriptToken):
* html/parser/XSSAuditor.h:

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

4 years agoWeb Inspector: Inspector should use the last sourceURL / sourceMappingURL directive
commit-queue@webkit.org [Wed, 13 Jan 2016 21:32:44 +0000 (21:32 +0000)]
Web Inspector: Inspector should use the last sourceURL / sourceMappingURL directive
https://bugs.webkit.org/show_bug.cgi?id=153072
<rdar://problem/24168312>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-01-13
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* parser/Lexer.cpp:
(JSC::Lexer<T>::parseCommentDirective):
Just keep overwriting the member variable so we end up with
the last directive value.

Source/WebInspectorUI:

* UserInterface/Base/Utilities.js:
Prepend instead of append the sourceURL so the provided string
can include a sourceURL and override it. Such as manually
evaluating a script through the quick console with a sourceURL.

* UserInterface/Models/SourceMapResource.js:
Fix an incorrectly named property.

LayoutTests:

* inspector/console/console-api-expected.txt:
* inspector/console/console-table-expected.txt:
* platform/mac/inspector/model/remote-object-expected.txt:
Updated line number in output now that code evaluated through the frontend
gets the __WebInspectorInternal__ sourceURL prepended to the start instead
of appended to the end.

* inspector/debugger/sourceURLs-expected.txt:
* inspector/debugger/sourceURLs.html:
Update the test to find the second sourceURL, not the first.

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

4 years agoUnreviewed, rolling out r194963.
ryanhaddad@apple.com [Wed, 13 Jan 2016 21:24:11 +0000 (21:24 +0000)]
Unreviewed, rolling out r194963.
https://bugs.webkit.org/show_bug.cgi?id=153079

This change causes ASan tests to crash and exit early
(Requested by ryanhaddad on #webkit).

Reverted changeset:

"Fragmentation-free allocator for timeless and/or coupled
allocations."
https://bugs.webkit.org/show_bug.cgi?id=152696
http://trac.webkit.org/changeset/194963

Patch by Commit Queue <commit-queue@webkit.org> on 2016-01-13

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

4 years ago[XSS Auditor] Do not include trailing comment characters in JavaScript snippets
commit-queue@webkit.org [Wed, 13 Jan 2016 21:20:38 +0000 (21:20 +0000)]
[XSS Auditor] Do not include trailing comment characters in JavaScript snippets
https://bugs.webkit.org/show_bug.cgi?id=152873

Patch by Daniel Bates <dabates@apple.com> on 2016-01-13
Reviewed by Brent Fulgham.

Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
<https://src.chromium.org/viewvc/blink?view=rev&revision=169967>

Source/WebCore:

Test: http/tests/security/xssAuditor/script-tag-with-injected-comment.html

* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::decodedSnippetForJavaScript):

LayoutTests:

* http/tests/security/xssAuditor/script-tag-with-injected-comment-expected.txt: Added.
* http/tests/security/xssAuditor/script-tag-with-injected-comment.html: Added.

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

4 years ago[XSS Auditor] Add test when XSS payload is in the path portion of the URL
commit-queue@webkit.org [Wed, 13 Jan 2016 21:18:39 +0000 (21:18 +0000)]
[XSS Auditor] Add test when XSS payload is in the path portion of the URL
https://bugs.webkit.org/show_bug.cgi?id=152871

Patch by Daniel Bates <dabates@apple.com> on 2016-01-13
Reviewed by Brent Fulgham.

Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
<https://src.chromium.org/viewvc/blink?revision=164746&view=revision>

Tools:

* Scripts/webkitpy/layout_tests/servers/lighttpd.conf:

LayoutTests:

Add infrastructure and a test for an XSS attack where the payload is
embedded in the path portion of the URL.

Many XSS Auditor tests pass the XSS payload to CGI scripts via the
query string portion of the URL. Now we also support calling these
same scripts with the payload embedded in the path portion of the
URL.

Loading <http://127.0.0.1:8000/security/xssAuditor/intercept/X/Y>
returns a response whose content is identical to <http://127.0.0.1:8000/security/xssAuditor/resoures/X?q=Y>,
where X is the filename of some CGI script in directory LayoutTests/http/tests/security/xssAuditor/resources
and Y is the XSS payload.

* http/tests/security/xssAuditor/intercept/.htaccess: Added.
* http/tests/security/xssAuditor/reflection-in-path-expected.txt: Added.
* http/tests/security/xssAuditor/reflection-in-path.html: Added.
* http/tests/security/xssAuditor/resources/echo-form-action.pl: Added.

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

4 years agoWeb Inspector: Add support for the existing GradientEditor in the CSS Rules sidebar
commit-queue@webkit.org [Wed, 13 Jan 2016 21:14:44 +0000 (21:14 +0000)]
Web Inspector: Add support for the existing GradientEditor in the CSS Rules sidebar
https://bugs.webkit.org/show_bug.cgi?id=153004

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-01-13
Reviewed by Timothy Hatcher.

Both the Visual sidebar and Resource view have editors for CSS gradient
values, but the Rules sidebar instead only adds editors for basic color
values. Instead of duplicating the code for gradient swatches, existing
code will be used to give this same functionality to the Rules sidebar.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:

* UserInterface/Models/Gradient.js:
(WebInspector.Gradient):
(WebInspector.Gradient.fromString):
(WebInspector.Gradient.stopsWithComponents):
(WebInspector.Gradient.prototype.copy):
(WebInspector.Gradient.prototype.toString):
Refactored WebInspector.Gradient into its own class.

(WebInspector.LinearGradient):
(WebInspector.LinearGradient.prototype.toString):
Now uses WebInspector.Gradient inheritance and methods.

(WebInspector.RadialGradient):
(WebInspector.RadialGradient.prototype.toString):
Now uses WebInspector.Gradient inheritance and methods.

* UserInterface/Views/CSSStyleDeclarationTextEditor.css:
Use InlineSwatch.css values instead.

(.css-style-text-editor > .CodeMirror .CodeMirror-lines .cubic-bezier-marker): Deleted.
(@media (-webkit-max-device-pixel-ratio: 1)): Deleted.
(.css-style-text-editor > .CodeMirror .CodeMirror-lines .cubic-bezier-marker:hover): Deleted.
(.css-style-text-editor > .CodeMirror .CodeMirror-lines .cubic-bezier-marker:active): Deleted.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype.didDismissPopover): Deleted.
Removed unused popover member variable.

(WebInspector.CSSStyleDeclarationTextEditor.prototype._contentChanged):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._updateTextMarkers.update):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._createInlineSwatches.createSwatch):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._createInlineSwatches.update):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._createInlineSwatches):
Renamed variables for more consistent naming and reimplemented the logic
to use the new WebInspector.InlineSwatch methods.  As a result, it was
possible to consolidate the 3 different type of swatch functions into a
single function.

(WebInspector.CSSStyleDeclarationTextEditor.prototype._commentProperty.update):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._uncommentRange.update):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._inlineSwatchValueChanged.update):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._inlineSwatchValueChanged):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._resetContent.update):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._createColorSwatches.createSwatch): Deleted.
(WebInspector.CSSStyleDeclarationTextEditor.prototype._createColorSwatches.update): Deleted.
(WebInspector.CSSStyleDeclarationTextEditor.prototype._createColorSwatches): Deleted.
(WebInspector.CSSStyleDeclarationTextEditor.prototype._createBezierEditors.update): Deleted.
(WebInspector.CSSStyleDeclarationTextEditor.prototype._createBezierEditors): Deleted.
(WebInspector.CSSStyleDeclarationTextEditor.prototype._colorSwatchColorChanged.update): Deleted.
(WebInspector.CSSStyleDeclarationTextEditor.prototype._colorSwatchColorChanged): Deleted.
(WebInspector.CSSStyleDeclarationTextEditor.prototype._cubicBezierMarkerClicked.updateCodeMirror.update): Deleted.
(WebInspector.CSSStyleDeclarationTextEditor.prototype._cubicBezierMarkerClicked.updateCodeMirror): Deleted.
(WebInspector.CSSStyleDeclarationTextEditor.prototype._cubicBezierMarkerClicked): Deleted.

* UserInterface/Views/CodeMirrorTextMarkers.js:
(createCodeMirrorColorTextMarkers.matchFunction):
Added logic so that if the matched color string is found inside a gradient,
it will not have a marker created for it.

* UserInterface/Views/InlineSwatch.css: Renamed from Source/WebInspectorUI/UserInterface/Views/ColorSwatch.css.
Consolidated the various swatch CSS classes into one file.

(.inline-swatch):
(.inline-swatch.bezier):
(.inline-swatch.bezier:hover):
(.inline-swatch.bezier:active):
(@media (-webkit-max-device-pixel-ratio: 1)):
(.inline-swatch > span):
Ensured that the inner swatch element can not be selected so that the "click"
listener on its parent always fires.

(.inline-swatch:hover > span):
(.inline-swatch:active > span):
(.inline-swatch.bezier > span):

* UserInterface/Views/InlineSwatch.js: Renamed from Source/WebInspectorUI/UserInterface/Views/ColorSwatch.js.
(WebInspector.InlineSwatch):
Now accepts a new first argument to indicate what type of color swatch
to create and what functionality it will have.  Currently has options
for WebInspector.Color, WebInspector.Gradient, and WebInspector.CubicBezier.

(WebInspector.InlineSwatch.prototype.get element):
(WebInspector.InlineSwatch.prototype.get value):
(WebInspector.InlineSwatch.prototype.set value):
(WebInspector.InlineSwatch.prototype._fallbackValue):
(WebInspector.InlineSwatch.prototype._updateSwatch):
(WebInspector.InlineSwatch.prototype._swatchElementClicked):
(WebInspector.InlineSwatch.prototype._valueEditorValueDidChange):
(WebInspector.InlineSwatch.prototype._handleContextMenuEvent):
(WebInspector.InlineSwatch.prototype._getNextValidHEXFormat.hexMatchesCurrentColor):
(WebInspector.InlineSwatch.prototype._getNextValidHEXFormat):

* UserInterface/Views/VisualStyleBackgroundPicker.css:
(.visual-style-property-container.background-picker > .visual-style-property-value-container > .inline-swatch.gradient):
(.visual-style-property-container.background-picker > .visual-style-property-value-container:not(.gradient-value) > .inline-swatch.gradient):
(.visual-style-property-container.background-picker > .visual-style-property-value-container > .inline-swatch.gradient:hover):
(.visual-style-property-container.background-picker > .visual-style-property-value-container > .inline-swatch.gradient:active):
(.visual-style-property-container.background-picker > .visual-style-property-value-container > .inline-swatch.gradient > span):
(.visual-style-property-container.background-picker > .visual-style-property-value-container.gradient-value > .inline-swatch.gradient + .value-input):
(.visual-style-property-container.background-picker > .visual-style-property-value-container > .color-swatch): Deleted.
(.visual-style-property-container.background-picker > .visual-style-property-value-container:not(.gradient-value) > .color-swatch): Deleted.
(.visual-style-property-container.background-picker > .visual-style-property-value-container > .color-swatch:hover): Deleted.
(.visual-style-property-container.background-picker > .visual-style-property-value-container > .color-swatch:active): Deleted.
(.visual-style-property-container.background-picker > .visual-style-property-value-container > .color-swatch > span): Deleted.
(.visual-style-property-container.background-picker > .visual-style-property-value-container.gradient-value > .color-swatch + .value-input): Deleted.

* UserInterface/Views/VisualStyleBackgroundPicker.js:
Removed the specific code for the gradient swatch and moved to using a
gradient-type InlineSwatch for gradient values instead.

(WebInspector.VisualStyleBackgroundPicker):
(WebInspector.VisualStyleBackgroundPicker.prototype.set value):
(WebInspector.VisualStyleBackgroundPicker.prototype._updateGradient):
(WebInspector.VisualStyleBackgroundPicker.prototype._gradientSwatchColorChanged):
(WebInspector.VisualStyleBackgroundPicker.prototype._valueInputValueChanged):
(WebInspector.VisualStyleBackgroundPicker.prototype._handleKeywordChanged):
(WebInspector.VisualStyleBackgroundPicker.prototype._updateGradientSwatch): Deleted.
(WebInspector.VisualStyleBackgroundPicker.prototype._gradientSwatchClicked.handleColorPickerToggled): Deleted.
(WebInspector.VisualStyleBackgroundPicker.prototype._gradientSwatchClicked): Deleted.
(WebInspector.VisualStyleBackgroundPicker.prototype._gradientEditorGradientChanged): Deleted.

* UserInterface/Views/VisualStyleColorPicker.css:
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .inline-swatch.color):
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .inline-swatch.color:hover):
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .inline-swatch.color:active):
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .inline-swatch.color > span):
Add override CSS to ensure that the color-type InlineSwatch displays nicely
next to the flexbox style Visual sidebar.

(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch): Deleted.
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch:hover): Deleted.
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch:active): Deleted.
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch > span): Deleted.
Refactored to only use overriding properties of the basic .inline-swatch values.

* UserInterface/Views/VisualStyleColorPicker.js:
(WebInspector.VisualStyleColorPicker):
(WebInspector.VisualStyleColorPicker.prototype._colorSwatchColorChanged):
(WebInspector.VisualStyleColorPicker.prototype._updateColorSwatch):

* UserInterface/Views/VisualStyleTimingEditor.css:
(.visual-style-property-container.timing-editor > .visual-style-property-value-container > .inline-swatch.bezier):
(.visual-style-property-container.timing-editor > .visual-style-property-value-container:not(.bezier-value) > .inline-swatch.bezier):
(@media (-webkit-min-device-pixel-ratio: 2)):
Add override CSS to ensure that the color-type InlineSwatch displays nicely
next to the flexbox style Visual sidebar.

(.visual-style-property-container.timing-editor > .visual-style-property-value-container > .bezier-editor): Deleted.
(.visual-style-property-container.timing-editor > .visual-style-property-value-container > .bezier-editor:hover): Deleted.
(.visual-style-property-container.timing-editor > .visual-style-property-value-container > .bezier-editor:active): Deleted.
Refactored to only use overriding properties of the basic .inline-swatch values.

* UserInterface/Views/VisualStyleTimingEditor.js:
Removed the specific code for the cubic-bezier swatch and moved to using a
cubic-bezier-type InlineSwatch for gradient values instead.

(WebInspector.VisualStyleTimingEditor):
(WebInspector.VisualStyleTimingEditor.prototype.get bezierValue):
(WebInspector.VisualStyleTimingEditor.prototype.set bezierValue):
(WebInspector.VisualStyleTimingEditor.prototype._setValue):
(WebInspector.VisualStyleTimingEditor.prototype._handleKeywordChanged):
(WebInspector.VisualStyleTimingEditor.prototype._bezierSwatchValueChanged):
(WebInspector.VisualStyleTimingEditor.prototype._bezierMarkerClicked): Deleted.

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

4 years agoUnreviewed, rolling out r194969.
cdumez@apple.com [Wed, 13 Jan 2016 20:52:46 +0000 (20:52 +0000)]
Unreviewed, rolling out r194969.
https://bugs.webkit.org/show_bug.cgi?id=153075

This change broke the iOS build (Requested by ryanhaddad on
#webkit).

Reverted changeset:

"[JSC] Legalize Memory Offsets for ARM64 before lowering to
Air"
https://bugs.webkit.org/show_bug.cgi?id=153065
http://trac.webkit.org/changeset/194969

Patch by Commit Queue <commit-queue@webkit.org> on 2016-01-13

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

4 years ago[JSC] Legalize Memory Offsets for ARM64 before lowering to Air
commit-queue@webkit.org [Wed, 13 Jan 2016 19:33:02 +0000 (19:33 +0000)]
[JSC] Legalize Memory Offsets for ARM64 before lowering to Air
https://bugs.webkit.org/show_bug.cgi?id=153065

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-01-13
Reviewed by Mark Lam.
Reviewed by Filip Pizlo.

On ARM64, we cannot use signed 32bits offset for memory addressing.
There are two available addressing: signed 9bits and unsigned scaled 12bits.
Air already knows about it.

In this patch, the offsets are changed to something valid for ARM64
prior to lowering. When an offset is invalid, it is just computed
before the instruction and used as the base for addressing.

* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* b3/B3LegalizeMemoryOffsets.cpp: Added.
(JSC::B3::legalizeMemoryOffsets):
* b3/B3LegalizeMemoryOffsets.h: Added.
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::effectiveAddr): Deleted.
* b3/testb3.cpp:
(JSC::B3::testLoadWithOffsetImpl):
(JSC::B3::testLoadOffsetImm9Max):
(JSC::B3::testLoadOffsetImm9MaxPlusOne):
(JSC::B3::testLoadOffsetImm9MaxPlusTwo):
(JSC::B3::testLoadOffsetImm9Min):
(JSC::B3::testLoadOffsetImm9MinMinusOne):
(JSC::B3::testLoadOffsetScaledUnsignedImm12Max):
(JSC::B3::testLoadOffsetScaledUnsignedOverImm12Max):
(JSC::B3::run):

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

4 years agoWebRTC: Add support for RTCRtpSender.replaceTrack()
adam.bergkvist@ericsson.com [Wed, 13 Jan 2016 19:22:28 +0000 (19:22 +0000)]
WebRTC: Add support for RTCRtpSender.replaceTrack()
https://bugs.webkit.org/show_bug.cgi?id=153063

Reviewed by Eric Carlson.

Source/WebCore:

Add the API and infrastructure to support RTCRtpSender.replaceTrack(). The platform is
reached through the RTCPeerConnection object that created the RTCRtpSender via a client
interface.

Test: fast/mediastream/RTCRtpSender-replaceTrack.html

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::replaceTrack):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTrack):
(WebCore::RTCPeerConnection::removeTrack):
(WebCore::RTCPeerConnection::replaceTrack):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::RTCRtpSender):
(WebCore::RTCRtpSender::replaceTrack):
* Modules/mediastream/RTCRtpSender.h:
(WebCore::RTCRtpSenderClient::~RTCRtpSenderClient):
(WebCore::RTCRtpSender::create):
(WebCore::RTCRtpSender::trackId):
(WebCore::RTCRtpSender::stop):
* Modules/mediastream/RTCRtpSender.idl:

LayoutTests:

Add API test for RTCRtpSender.replaceTrack(). A successful call is still
rejected (promise) until proper support is available in the WebRTC backend.

* fast/mediastream/RTCRtpSender-replaceTrack-expected.txt: Added.
* fast/mediastream/RTCRtpSender-replaceTrack.html: Added.

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

4 years agoModern IDB: A few cursor tests are flaky because JS wrappers are GC'ed.
beidson@apple.com [Wed, 13 Jan 2016 18:42:00 +0000 (18:42 +0000)]
Modern IDB: A few cursor tests are flaky because JS wrappers are GC'ed.
https://bugs.webkit.org/show_bug.cgi?id=153038

Reviewed by Alex Christensen.

No new tests (Couldn't write a test that was any more reliable than "flaky", so fixing the existing flaky tests will do).

And IDBCursor has an associated IDBRequest that is re-used each time the IDBCursor iterates.

The normal ActiveDOMObject approach to prevent the IDBRequest's wrapper from being garbage collected was not good enough
because, while the IDBRequest may not currently be waiting on any activity, as long as its associated IDBCursor is still
reachable then the request might be reused in the future.

Fortunately there's an IDL allowance for "one object keeping another alive during GC" and that's JSCustomMarkFunction
combined with GenerateIsReachable.

Applying those to IDBCursor and IDBRequest fix this handily.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

* Modules/indexeddb/IDBCursor.h:
(WebCore::IDBCursor::isModernCursor):
* Modules/indexeddb/IDBCursor.idl:

* Modules/indexeddb/IDBRequest.idl:

* Modules/indexeddb/client/IDBCursorImpl.cpp:
(WebCore::IDBClient::IDBCursor::advance):
(WebCore::IDBClient::IDBCursor::continueFunction):
(WebCore::IDBClient::IDBCursor::uncheckedIterateCursor):
(WebCore::IDBClient::IDBCursor::uncheckedIteratorCursor): Deleted. Fixed the typo of this name.
* Modules/indexeddb/client/IDBCursorImpl.h:

* bindings/js/JSIDBCursorCustom.cpp: Added.
(WebCore::JSIDBCursor::visitAdditionalChildren):

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

4 years agoGet text drawing working with display lists.
zalan@apple.com [Wed, 13 Jan 2016 18:19:45 +0000 (18:19 +0000)]
Get text drawing working with display lists.
https://bugs.webkit.org/show_bug.cgi?id=152957

Reviewed by Simon Fraser.

This patch enables text drawing for display lists.

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::drawGlyphBuffer):
* platform/graphics/FontCascade.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawGlyphs):
(WebCore::GraphicsContext::drawText): Deleted.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawGlyphs::apply):

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

4 years agoSimple line layout: Add support for word-break property.
zalan@apple.com [Wed, 13 Jan 2016 17:08:35 +0000 (17:08 +0000)]
Simple line layout: Add support for word-break property.
https://bugs.webkit.org/show_bug.cgi?id=153054

Reviewed by Antti Koivisto.

This patch enables word-break property for simple line layout.
(https://drafts.csswg.org/css-text-3/#propdef-word-break)

word-break: normal and keep-all -> existing, non-(force)breaking behaviour.
            break-all -> breaks words when needed.

Covered by existing tests like fast/text/word-break.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::createLineRuns):
(WebCore::SimpleLineLayout::canUseForStyle): Deleted.
(WebCore::SimpleLineLayout::printReason): Deleted.
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::findNextTextFragment):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isBreakable): Deleted.
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.

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

4 years agoReference cycle between SVGPathElement and SVGPathSegWithContext leaks Document
commit-queue@webkit.org [Wed, 13 Jan 2016 17:04:36 +0000 (17:04 +0000)]
Reference cycle between SVGPathElement and SVGPathSegWithContext leaks Document
https://bugs.webkit.org/show_bug.cgi?id=151810

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-01-13
Reviewed by Darin Adler.

Break the reference cycle between SVGPathElement and SVGPathSegWithContext
by changing the back-pointer to be a WeakPtr pointer instead of having it
RefPtr. Make sure the SVGPathSegWithContext derived classes handle correctly
the case when the SVGPathElement back-pointer is deleted.

Also change the SVGPathElement argument to the SVGPathSeg creation functions
and constructors to be a const reference instead of having it as a pointer
since SVGPathElement is the class factory for all these classes.

* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::SVGPathElement):
(WebCore::SVGPathElement::createSVGPathSegClosePath):
(WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
(WebCore::SVGPathElement::createSVGPathSegMovetoRel):
(WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
(WebCore::SVGPathElement::createSVGPathSegLinetoRel):
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
(WebCore::SVGPathElement::createSVGPathSegArcAbs):
(WebCore::SVGPathElement::createSVGPathSegArcRel):
(WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
(WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
(WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
(WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
(WebCore::SVGPathElement::isSupportedAttribute):
* svg/SVGPathElement.h:
* svg/SVGPathSegArc.h:
(WebCore::SVGPathSegArc::SVGPathSegArc):
* svg/SVGPathSegArcAbs.h:
(WebCore::SVGPathSegArcAbs::create):
(WebCore::SVGPathSegArcAbs::SVGPathSegArcAbs):
* svg/SVGPathSegArcRel.h:
(WebCore::SVGPathSegArcRel::create):
(WebCore::SVGPathSegArcRel::SVGPathSegArcRel):
* svg/SVGPathSegClosePath.h:
(WebCore::SVGPathSegClosePath::create):
(WebCore::SVGPathSegClosePath::SVGPathSegClosePath):
* svg/SVGPathSegCurvetoCubic.h:
(WebCore::SVGPathSegCurvetoCubic::SVGPathSegCurvetoCubic):
* svg/SVGPathSegCurvetoCubicAbs.h:
(WebCore::SVGPathSegCurvetoCubicAbs::create):
(WebCore::SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs):
* svg/SVGPathSegCurvetoCubicRel.h:
(WebCore::SVGPathSegCurvetoCubicRel::create):
(WebCore::SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel):
* svg/SVGPathSegCurvetoCubicSmooth.h:
(WebCore::SVGPathSegCurvetoCubicSmooth::SVGPathSegCurvetoCubicSmooth):
* svg/SVGPathSegCurvetoCubicSmoothAbs.h:
(WebCore::SVGPathSegCurvetoCubicSmoothAbs::create):
(WebCore::SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs):
* svg/SVGPathSegCurvetoCubicSmoothRel.h:
(WebCore::SVGPathSegCurvetoCubicSmoothRel::create):
(WebCore::SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel):
* svg/SVGPathSegCurvetoQuadratic.h:
(WebCore::SVGPathSegCurvetoQuadratic::SVGPathSegCurvetoQuadratic):
* svg/SVGPathSegCurvetoQuadraticAbs.h:
(WebCore::SVGPathSegCurvetoQuadraticAbs::create):
(WebCore::SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs):
* svg/SVGPathSegCurvetoQuadraticRel.h:
(WebCore::SVGPathSegCurvetoQuadraticRel::create):
(WebCore::SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel):
* svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
(WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create):
(WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs):
* svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
(WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create):
(WebCore::SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel):
* svg/SVGPathSegLinetoAbs.h:
(WebCore::SVGPathSegLinetoAbs::create):
(WebCore::SVGPathSegLinetoAbs::SVGPathSegLinetoAbs):
* svg/SVGPathSegLinetoHorizontal.h:
(WebCore::SVGPathSegLinetoHorizontal::SVGPathSegLinetoHorizontal):
* svg/SVGPathSegLinetoHorizontalAbs.h:
(WebCore::SVGPathSegLinetoHorizontalAbs::create):
(WebCore::SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs):
* svg/SVGPathSegLinetoHorizontalRel.h:
(WebCore::SVGPathSegLinetoHorizontalRel::create):
(WebCore::SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel):
* svg/SVGPathSegLinetoRel.h:
(WebCore::SVGPathSegLinetoRel::create):
(WebCore::SVGPathSegLinetoRel::SVGPathSegLinetoRel):
* svg/SVGPathSegLinetoVertical.h:
(WebCore::SVGPathSegLinetoVertical::SVGPathSegLinetoVertical):
* svg/SVGPathSegLinetoVerticalAbs.h:
(WebCore::SVGPathSegLinetoVerticalAbs::create):
(WebCore::SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs):
* svg/SVGPathSegLinetoVerticalRel.h:
(WebCore::SVGPathSegLinetoVerticalRel::create):
(WebCore::SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel):
* svg/SVGPathSegMovetoAbs.h:
(WebCore::SVGPathSegMovetoAbs::create):
(WebCore::SVGPathSegMovetoAbs::SVGPathSegMovetoAbs):
* svg/SVGPathSegMovetoRel.h:
(WebCore::SVGPathSegMovetoRel::create):
(WebCore::SVGPathSegMovetoRel::SVGPathSegMovetoRel):
* svg/SVGPathSegWithContext.h:
(WebCore::SVGPathSegWithContext::SVGPathSegWithContext):
(WebCore::SVGPathSegWithContext::animatedProperty):
(WebCore::SVGPathSegWithContext::contextElement):
(WebCore::SVGPathSegWithContext::setContextAndRole):
(WebCore::SVGPathSegWithContext::commitChange):
(WebCore::SVGPathSegSingleCoordinate::setY):
(WebCore::SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate):
* svg/properties/SVGPathSegListPropertyTearOff.cpp:
(WebCore::SVGPathSegListPropertyTearOff::clearContextAndRoles):
(WebCore::SVGPathSegListPropertyTearOff::replaceItem):
(WebCore::SVGPathSegListPropertyTearOff::removeItem):

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

4 years agoSource/WebCore:
akling@apple.com [Wed, 13 Jan 2016 14:52:16 +0000 (14:52 +0000)]
Source/WebCore:
Use BumpArena for style sheet object tree.
<https://webkit.org/b/152696>

Reviewed by Antti Koivisto.

Give each StyleSheetContents its own BumpArena, and plumb it down through CSSParser
to allocate StyleRule, StyleProperties and CSSSelectorList's selector arrays there.

This basically means that most objects that make up a given style sheet will end up
in one (or a few) contiguous region(s) of memory, instead of being scattered all
over the malloc heap.

In the common case (no CSSOM manipulation), the lifetimes of these objects are very
predictable: everything tends to die when the StyleSheetContents dies.
This dramatically improves space-efficiency in those cases, and allows us to return
contiguous chunks of memory to the system once a style sheet is no longer needed.

One-off CSS parses that don't work within a StyleSheetContents context will have
their StyleRules & co allocated out of the global BumpArena.

Bonus: give SelectorQueryCache a dedicated BumpArena as well, since it has very
predictable lifetime.

* css/CSSGrammar.y.in:
* css/CSSKeyframesRule.h:
(WebCore::StyleRuleKeyframes::create):
* css/CSSParser.cpp:
(WebCore::CSSParser::createStyleProperties):
(WebCore::CSSParser::createMediaRule):
(WebCore::CSSParser::createSupportsRule):
(WebCore::CSSParser::createKeyframesRule):
(WebCore::CSSParser::setArena):
(WebCore::CSSParser::arena):
(WebCore::CSSParser::createStyleRule):
(WebCore::CSSParser::createFontFaceRule):
(WebCore::CSSParser::createPageRule):
(WebCore::CSSParser::createRegionRule):
(WebCore::CSSParser::createViewportRule):
* css/CSSParser.h:
* css/CSSParserValues.cpp:
(WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
(WebCore::CSSParserSelector::adoptSelectorVector):
* css/CSSParserValues.h:
* css/CSSSelectorList.cpp:
(WebCore::CSSSelectorList::CSSSelectorList):
(WebCore::CSSSelectorList::adoptSelectorVector):
(WebCore::CSSSelectorList::deleteSelectors):
* css/CSSSelectorList.h:
* css/StyleProperties.cpp:
(WebCore::ImmutableStyleProperties::create):
(WebCore::StyleProperties::immutableCopyIfNeeded):
* css/StyleProperties.h:
* css/StyleRule.cpp:
(WebCore::StyleRule::create):
(WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
(WebCore::StyleRuleRegion::StyleRuleRegion):
* css/StyleRule.h:
(WebCore::StyleRule::create):
(WebCore::StyleRule::parserAdoptSelectorVector):
(WebCore::StyleRuleFontFace::create):
(WebCore::StyleRulePage::create):
(WebCore::StyleRulePage::parserAdoptSelectorVector):
(WebCore::StyleRuleMedia::create):
(WebCore::StyleRuleSupports::create):
(WebCore::StyleRuleRegion::create):
(WebCore::StyleRuleViewport::create):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
(WebCore::StyleSheetContents::parseStringAtPosition):
* css/StyleSheetContents.h:
* dom/SelectorQuery.cpp:
(WebCore::SelectorQueryCache::SelectorQueryCache):
(WebCore::SelectorQueryCache::add):
* dom/SelectorQuery.h:
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::SVGFontFaceElement):

Source/WTF:
Fragmentation-free allocator for timeless and/or coupled allocations.
<https://webkit.org/b/152696>

Reviewed by Antti Koivisto.

Introduce BumpArena, a space-efficient memory allocator for situations where
you feel pretty confident betting on allocation lifetimes.

Basic design:

    - Allocates 4kB-aligned blocks of 4kB from bmalloc at a time.
    - Bump-pointer allocates out of a block until it reaches end.
    - Each allocation increments the ref-count of its block.
    - Each deallocation decrements the ref-count of its block.

Interface:

    - BumpArena::create()

        Create your very own BumpArena!

    - BumpArena::allocate(BumpArena* arena, size_t size)

        Allocates 'size' bytes of memory from 'arena'.
        If 'arena' is null, allocation comes out of the shared global BumpArena.

    - BumpArena::deallocate(void* ptr)

        Deallocates 'ptr', decrementing the ref-count of its block.

    - WTF_MAKE_BUMPARENA_ALLOCATED;

        Macro that gives a class or struct custom operators new and delete
        for allocation out of BumpArena. Just like WTF_MAKE_FAST_ALLOCATED;

Note that while the name of this patch says "fragmentation-free allocator"
it will only be fragmentation-free when used for appropriate things.
This is not meant to be a general-purpose allocator. Only use it for sets of
allocations that are known to die roughly at the same time.

BumpArena will never resume allocating from a block that has been filled,
so it's even more important than usual that everything gets deallocated.

As noted above, calling allocate() with a null BumpArena will allocate out
of a global shared arena. Ideally you're always allocating out of a specific,
controlled arena, but there are situations where you may not have one.

* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/BumpArena.cpp: Added.
(WTF::BumpArena::Block::defaultCapacity):
(WTF::BumpArena::Block::arena):
(WTF::BumpArena::Block::payloadStart):
(WTF::globalArena):
(WTF::arenas):
(WTF::BumpArena::Block::Block):
(WTF::BumpArena::Block::~Block):
(WTF::BumpArena::Block::ref):
(WTF::BumpArena::Block::deref):
(WTF::BumpArena::Block::create):
(WTF::BumpArena::Block::dump):
(WTF::BumpArena::dump):
(WTF::BumpArena::create):
(WTF::BumpArena::BumpArena):
(WTF::BumpArena::~BumpArena):
(WTF::BumpArena::allocateSlow):
(WTF::BumpArena::allocate):
(WTF::BumpArena::deallocate):
(WTF::BumpArena::Block::blockFor):
(WTF::BumpArena::arenaFor):
* wtf/BumpArena.h: Added.
* wtf/CMakeLists.txt:

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

4 years ago[GTK] Unreviewed gardening.
mario@webkit.org [Wed, 13 Jan 2016 12:30:26 +0000 (12:30 +0000)]
[GTK] Unreviewed gardening.

Patch by Mario Sanchez Prada <mario@webkit.org> on 2016-01-13

* platform/gtk/TestExpectations: Mark three tests failing in the
GTK bots as Crash, Timeout (release builds only) and Failure.

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

4 years ago[TexMap] BitmapTextureGL is not released while scene is updated continuously.
commit-queue@webkit.org [Wed, 13 Jan 2016 10:32:31 +0000 (10:32 +0000)]
[TexMap] BitmapTextureGL is not released while scene is updated continuously.
https://bugs.webkit.org/show_bug.cgi?id=152524

Patch by YongGeol Jung <yg48.jung@samsung.com> on 2016-01-13
Reviewed by Žan Doberšek.

This patch fixes two issues.
First, m_releaseUnusedTexturesTimer is not fired if scene is updated within 0.5s continuously.
In this case, BitmapTexturePool will not remove texture even if texture is not used for long time.
Second, m_releaseUnusedTexturesTimer is triggered by acquireTexture function only.
So, if next scene does not need to use BitmapTexture, remained textures in pool will not removed.

No new tests needed.

* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::scheduleReleaseUnusedTextures):
(WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):

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

4 years ago[Streams API] Refactor builtin internals to prepare support for streams API in worker
youenn.fablet@crf.canon.fr [Wed, 13 Jan 2016 09:54:24 +0000 (09:54 +0000)]
[Streams API] Refactor builtin internals to prepare support for streams API in worker
https://bugs.webkit.org/show_bug.cgi?id=152535

Reviewed by Darin Adler.

Moving the code that links internal functions to the GlobalObject in WebCoreJSBuiltinInternals.cpp.
This file should be generated by the builtin generator once refactoring is done.
This code is located in JSBuiltinInternalFunctions::initialize.

Adding private controller and reader constructors to the JS DOM constructor map so that they do not get garbage collected.

No change in behavior, except that private builtins are usable in workers (but not actually used).

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
(WebCore::JSDOMGlobalObject::finishCreation):
(WebCore::JSDOMGlobalObject::visitChildren):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::finishCreation):
(WebCore::JSDOMWindowBase::visitChildren):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/WebCoreJSBuiltinInternals.cpp: Added.
(WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions):
(WebCore::JSBuiltinInternalFunctions::visit):
(WebCore::JSBuiltinInternalFunctions::initialize):
* bindings/js/WebCoreJSBuiltinInternals.h:

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

4 years agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.11.3 release.
carlosgc@webkit.org [Wed, 13 Jan 2016 08:12:57 +0000 (08:12 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.11.3 release.

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers.

Source/WebKit2:

* gtk/NEWS: Add release notes for 2.11.3.

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

4 years ago[EFL] Fix wrong return value of paintThemePart in RenderThemeEfl
gyuyoung.kim@webkit.org [Wed, 13 Jan 2016 08:01:56 +0000 (08:01 +0000)]
[EFL] Fix wrong return value of paintThemePart in RenderThemeEfl
https://bugs.webkit.org/show_bug.cgi?id=153058

Reviewed by Carlos Garcia Campos.

To return false in paint functions in RenderThemeEfl means that it is supported though,
paintThemePart has returned false even when failing to get image cache of theme.

* rendering/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::paintThemePart):

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

4 years ago[Content Filtering] forEachContentFilterUntilBlocked should accept a lambda by rvalue...
aestes@apple.com [Wed, 13 Jan 2016 06:58:34 +0000 (06:58 +0000)]
[Content Filtering] forEachContentFilterUntilBlocked should accept a lambda by rvalue reference
https://bugs.webkit.org/show_bug.cgi?id=153057

Reviewed by Dan Bernstein.

No new tests. No change in behavior.

Instead of having ContentFilter::forEachContentFilterUntilBlocked() take a std::function, just have it take an
rvalue reference to the lambda its passed.

* loader/ContentFilter.cpp:
(WebCore::ContentFilter::forEachContentFilterUntilBlocked):
* loader/ContentFilter.h:

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

4 years ago[GTK] Fix return value of some paint methods in RenderThemeGtk
carlosgc@webkit.org [Wed, 13 Jan 2016 06:47:10 +0000 (06:47 +0000)]
[GTK] Fix return value of some paint methods in RenderThemeGtk
https://bugs.webkit.org/show_bug.cgi?id=153015

Reviewed by Michael Catanzaro.

The bool value returned by paint methods in RenderTheme means
whether the appearance is supported or not, so we should return
true when not supported (so we didn't paint anything) and false
when supported (so we actually painted the theme part).

* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
(WebCore::RenderThemeGtk::paintMediaButton):
(WebCore::RenderThemeGtk::paintMediaMuteButton):
(WebCore::RenderThemeGtk::paintMediaPlayButton):
(WebCore::RenderThemeGtk::paintMediaSliderTrack):
(WebCore::RenderThemeGtk::paintMediaVolumeSliderContainer): Deleted.
* rendering/RenderThemeGtk.h:

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

4 years agoVersioning.
bshafiei@apple.com [Wed, 13 Jan 2016 05:55:33 +0000 (05:55 +0000)]
Versioning.

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

4 years ago[Content Filtering] De-virtualize PlatformContentFilter::{needsMoreData, didBlockData}()
aestes@apple.com [Wed, 13 Jan 2016 03:23:12 +0000 (03:23 +0000)]
[Content Filtering] De-virtualize PlatformContentFilter::{needsMoreData, didBlockData}()
https://bugs.webkit.org/show_bug.cgi?id=153052

Reviewed by Andreas Kling.

No new tests. No change in behavior.

Instead of having virtual functions that each platform content filter implement in terms of their own state,
store the state in the base class so that these functions can be non-virtual. Teach each subclass to update the
base class state appropriately.

* loader/ContentFilter.h:
* platform/PlatformContentFilter.h:
(WebCore::PlatformContentFilter::needsMoreData):
(WebCore::PlatformContentFilter::didBlockData):
* platform/cocoa/NetworkExtensionContentFilter.h:
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::willSendRequest):
(WebCore::NetworkExtensionContentFilter::responseReceived):
(WebCore::NetworkExtensionContentFilter::handleDecision):
(WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Deleted.
(WebCore::NetworkExtensionContentFilter::needsMoreData): Deleted.
(WebCore::NetworkExtensionContentFilter::didBlockData): Deleted.
* platform/cocoa/ParentalControlsContentFilter.h:
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::ParentalControlsContentFilter::responseReceived):
(WebCore::ParentalControlsContentFilter::updateFilterState):
(WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Deleted.
(WebCore::ParentalControlsContentFilter::needsMoreData): Deleted.
(WebCore::ParentalControlsContentFilter::didBlockData): Deleted.
* platform/spi/cocoa/NEFilterSourceSPI.h:
* testing/MockContentFilter.cpp:
(WebCore::MockContentFilter::willSendRequest):
(WebCore::MockContentFilter::maybeDetermineStatus):
(WebCore::MockContentFilter::needsMoreData): Deleted.
(WebCore::MockContentFilter::didBlockData): Deleted.
* testing/MockContentFilter.h:

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

4 years agoAddress missed review feedback after r194950.
aestes@apple.com [Wed, 13 Jan 2016 02:09:37 +0000 (02:09 +0000)]
Address missed review feedback after r194950.

* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize): Renamed the NetworkExtension dispatch queue.

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

4 years ago[Content Filtering] Lazily load platform frameworks
aestes@apple.com [Wed, 13 Jan 2016 02:07:11 +0000 (02:07 +0000)]
[Content Filtering] Lazily load platform frameworks
https://bugs.webkit.org/show_bug.cgi?id=152881
rdar://problem/23270886

Reviewed by Brady Eidson.

Source/WebCore:

On Cocoa platforms, ContentFilter soft-links two frameworks that perform the underlying filtering operations.
There is a one-time cost associated with the soft-linking, and the current design requires all clients to pay
this cost whether or not they ever load a resource that is subject to filtering.

Addressed this by deferring the loading of frameworks until it is known that a resource will require filtering.
It is rather simple to defer the soft-linking at the PlatformContentFilter level, but doing this alone would
mean that every CachedRawResourceClient callback would be routed through ContentFilter, even in the very common
case where both platform content filters are disabled. This is because checking if a platform content filter is
enabled involves loading its framework, so creating a ContentFilter (which DocumentLoader will add as the
CachedRawResource client in place of itself) cannot be avoided by checking that all its platform content filters
are disabled.

Resolved this by inverting the relationship between ContentFilter and DocumentLoader. Instead of ContentFilter
being the CachedRawResource's client and forwarding callbacks to DocumentLoader when one or more platform
filters are enabled, DocumentLoader is now always the client and it forwards callbacks to ContentFilter.
ContentFilter then returns a boolean value indicating whether or not DocumentLoader should proceed with each
callback.

New API test: ContentFiltering.LazilyLoadPlatformFrameworks

* loader/ContentFilter.cpp:
(WebCore::ContentFilter::create): Renamed from createIfEnabled(). Since the enabled check causes frameworks to
be loaded, the check is skipped here and all types are always created.
(WebCore::ContentFilter::continueAfterWillSendRequest): Renamed from willSendRequest(). Renamed requestCopy to
originalRequest, and only created it for logging purposes. Since the copy was only used for logging purposes,
request is now modified directly. Returned false if request is null.
(WebCore::ContentFilter::continueAfterResponseReceived): Renamed from responseReceived(). Stopped asserting that
resource is non-null, since it will be null in the case of substitute data loads. Stopped asserting that m_state
is not Initialized, since that state was removed and the function can now be called in all states. Only logged
if m_state is Filtering. Returned false if m_state is Blocked.
(WebCore::ContentFilter::continueAfterDataReceived): Renamed from dataReceived(). Stopped asserting that
resource is non-null and that m_state is Initialized, and moved the logging, for the same reasons as above.
Returned false if m_state is Filtering or Blocked.
(WebCore::ContentFilter::continueAfterNotifyFinished): Renamed from notifyFinished(). Stopped asserting that
resource is non-null and that m_state is not Initialized, and moved the logging, for the same reasons as above.
If m_state is not Blocked at this point, set m_state to Allowed in order for deliverResourceData() to not get
caught in continueAfterDataReceived(). Returned false if m_state is Blocked or Stopped after delivering data.
(WebCore::ContentFilter::createIfEnabled): Renamed to create().
(WebCore::ContentFilter::~ContentFilter): Stopped removing ourself as m_mainResource's client.
(WebCore::ContentFilter::willSendRequest): Renamed to continueAfterWillSendRequest().
(WebCore::ContentFilter::startFilteringMainResource): Stopped adding ourself as m_mainResource's client. Stopped
asserting that m_state is not Initialized and instead returned early if m_state is not Stopped.
(WebCore::ContentFilter::stopFilteringMainResource): Stopped removing ourself as m_mainResource's client.
(WebCore::ContentFilter::responseReceived): Renamed to continueAfterResponseReceived().
(WebCore::ContentFilter::dataReceived): Renamed to continueAfterDataReceived().
(WebCore::ContentFilter::redirectReceived): Removed. DocumentLoader now calls continueAfterWillSendRequest()
directly on redirects.
(WebCore::ContentFilter::notifyFinished): Renamed to continueAfterNotifyFinished().
(WebCore::ContentFilter::didDecide): Instead of calling DocumentLoader::contentFilterDidDecide(), called
DocumentLoader::contentFilterDidBlock() when m_state is Blocked.
(WebCore::ContentFilter::deliverResourceData): Asserted that m_state is Allowed.
* loader/ContentFilter.h: Stopped inheriting from CachedRawResourceClient. Redeclared the
CachedRawResourceClient virtual functions as the continue* functions mentioned above. Made State enum private
and removed Initialized. Initialized m_state to Stopped and removed its getter.
(WebCore::ContentFilter::type): Returned a ContentFilter::Type that does not include an enabled function.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished): Returned early if ContentFilter::continueAfterNotifyFinished()
returned false.
(WebCore::DocumentLoader::willSendRequest): Called ContentFilter::continueAfterWillSendRequest() even for
redirects, since ContentFilter is no longer a CachedRawResourceClient and so will no longer receive
redirectReceived(). Returned early if continueAfterWillSendRequest() returns false.
(WebCore::DocumentLoader::responseReceived): Returned early if ContentFilter::continueAfterResponseReceived()
returned false.
(WebCore::DocumentLoader::dataReceived): Ditto for ContentFilter::continueAfterDataReceived().
(WebCore::DocumentLoader::startLoadingMainResource): Called ContentFilter::create(), not createIfEnabled().
(WebCore::DocumentLoader::becomeMainResourceClient): Called ContentFilter::startFilteringMainResource() even if
m_state is not Initialized. Added ourself as a client of m_mainResource unconditionally.
(WebCore::DocumentLoader::contentFilterDidBlock): Renamed from contentFilterDidDecide. Removed assertions and
the early return when m_state is Allowed, since the state is guaranteed to be Blocked.
(WebCore::DocumentLoader::contentFilterDidDecide): Renamed to contentFilterDidBlock.
* platform/cocoa/NetworkExtensionContentFilter.h: Moved definition of HAVE_NETWORK_EXTENSION to Platform.h so
that this file doesn't need to become a Private header. Made enabled() private, and declared initialize().
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize): Added a function to lazily initialize the object.
(WebCore::NetworkExtensionContentFilter::willSendRequest): For the modern NEFilterSource, checked if it is
enabled only after checking if the request is HTTP(S). If both checks pass, then called initialize().
(WebCore::NetworkExtensionContentFilter::responseReceived): Ditto for the legacy NEFilterSource.
* platform/cocoa/ParentalControlsContentFilter.h: Made enabled() private.
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::ParentalControlsContentFilter::responseReceived): Checked if WebFilterEvaluator is enabled only after
checking if the response is from a protocol that can be handled.
* testing/MockContentFilter.cpp:
(WebCore::MockContentFilter::willSendRequest): Immediately set m_status to Status::Allowed if !enabled().
* testing/MockContentFilter.h: Made enabled() private.

Source/WTF:

* wtf/Platform.h: Moved definition of HAVE_NETWORK_EXTENSION to here from WebCore/platform/cocoa/NetworkExtensionContentFilter.h.

Tools:

Added an API test that verifies that the Parental Controls and Network Extension frameworks are loaded at the
expected times. The test verifies that they are not loaded after creating a WKWebView, loading an HTML string,
loading NSData, loading a file, or loading from a custom protocol. It verifies that Network Extension on Mac/iOS
and Parental Controls on iOS are loaded after an HTTP request. It finally verifies that Parental Controls on Mac
is loaded after an HTTPS request.

To accomplish this, TestProtocol was generalized to allow tests to specify the scheme they wish to use.
Other tests that used TestProtocol were updated to account for this change. TestProtocol was removed from
WebKit2.PreventImageLoadWithAutoResizingTest, which didn't actually need to use it. ContentFiltering tests were
also re-enabled on iOS after mistakenly being disabled by r188892.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.h: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm:
(TEST):
(downloadTest):
(-[LazilyLoadPlatformFrameworksController init]):
(-[LazilyLoadPlatformFrameworksController webView]):
(-[LazilyLoadPlatformFrameworksController expectParentalControlsLoaded:networkExtensionLoaded:]):
(-[LazilyLoadPlatformFrameworksController webView:didFinishNavigation:]):
* TestWebKitAPI/Tests/WebKit2Cocoa/ContentFilteringPlugIn.mm:
(-[ContentFilteringPlugIn webProcessPlugIn:didCreateBrowserContextController:]):
(-[ContentFilteringPlugIn observeValueForKeyPath:ofObject:change:context:]):
(-[ContentFilteringPlugIn checkIfPlatformFrameworksAreLoaded:]):
* TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm:
(TestWebKitAPI::TEST): Deleted.
* TestWebKitAPI/cocoa/TestProtocol.h:
* TestWebKitAPI/cocoa/TestProtocol.mm:
(+[TestProtocol registerWithScheme:]):
(+[TestProtocol unregister]):

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

4 years agoChanging expectation from flaky to skip for two crashing tests.
ryanhaddad@apple.com [Wed, 13 Jan 2016 01:18:01 +0000 (01:18 +0000)]
Changing expectation from flaky to skip for two crashing tests.
https://bugs.webkit.org/show_bug.cgi?id=152279

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

4 years agoWeb Inspector: Timeline recording controls should use NavigationBar
mattbaker@apple.com [Wed, 13 Jan 2016 01:14:14 +0000 (01:14 +0000)]
Web Inspector: Timeline recording controls should use NavigationBar
https://bugs.webkit.org/show_bug.cgi?id=152997

Reviewed by Brian Burg.

NavigtaionBar should always be preferred over manually editing the DOM.
Reusing existing button types for the record button and status element lets us
eliminate a bunch of CSS, and will make future changes to the Timelines UI
(such as adding addition recording controls), easier to implement.

* Localizations/en.lproj/localizedStrings.js:
New tooltip strings.

* UserInterface/Views/TimelineSidebarPanel.css:
(.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop):
(.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop:hover):
(.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop:active):
Replaced similar styles used for the record glyph.
(.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop *):
Prevent multiple mouseover/mouseout events while hovering the navigation item.
(.sidebar > .panel.navigation.timeline > .navigation-bar > .item.flexible-space):
Replaced similar styles used for the record status element.
(.sidebar > .panel.navigation.timeline > .status-bar): Deleted.
(body.window-inactive .sidebar > .panel.navigation.timeline > .status-bar): Deleted.
(.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph): Deleted.
(.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph:hover): Deleted.
(.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph:active): Deleted.
(.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph.recording): Deleted.
(.sidebar > .panel.navigation.timeline > .status-bar > .record-status): Deleted.
(.panel.timeline .navigation-bar.timelines-view): Deleted.
No longer used.

* UserInterface/Views/TimelineSidebarPanel.js:
Removed unused CSS static variables.
(WebInspector.TimelineSidebarPanel):
Create navigation bar, remove status bar DOM elements. Create keyboard shortcut
before the record button, so the shortcut's display name can be used in tooltips.
(WebInspector.TimelineSidebarPanel.prototype._capturingStartedOrStopped):
Update record button state and flexible space (status) text.
(WebInspector.TimelineSidebarPanel.prototype._recordButtonClicked):
Toggle recording state, and update record button state and flexible space (status) text.
(WebInspector.TimelineSidebarPanel.prototype._recordButtonMousedOver):
(WebInspector.TimelineSidebarPanel.prototype._recordButtonMousedOut):
Update flexible space (status) text.
(WebInspector.TimelineSidebarPanel.prototype._updateRecordButton):
(WebInspector.TimelineSidebarPanel.prototype._updateReplayInterfaceVisibility):
(WebInspector.TimelineSidebarPanel.prototype._toggleRecording): Deleted.
(WebInspector.TimelineSidebarPanel.prototype._capturingStarted): Deleted.
(WebInspector.TimelineSidebarPanel.prototype._capturingStopped): Deleted.
(WebInspector.TimelineSidebarPanel.prototype._recordGlyphMousedOver): Deleted.
(WebInspector.TimelineSidebarPanel.prototype._recordGlyphMousedOut): Deleted.
(WebInspector.TimelineSidebarPanel.prototype._recordGlyphClicked): Deleted.
No longer used.

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

4 years agobuildbot syncing scripts sometimes schedule more than one requests per builder
rniwa@webkit.org [Wed, 13 Jan 2016 01:05:20 +0000 (01:05 +0000)]
buildbot syncing scripts sometimes schedule more than one requests per builder
https://bugs.webkit.org/show_bug.cgi?id=153047

Reviewed by Chris Dumez.

The bug was caused by the check for singularity of scheduledRequests being conducted per configuration
instead of per builder. So if there were multiple test configurations (e.g. Speedometer and Octane) that
both used the same builder, then we may end up scheduling both at once.

Fixed the bug by sharing a single set to keep track of the scheduled requests for all configurations per
builder.

* tools/sync-with-buildbot.py:
(load_config): Share a set amongst test configurations for each builder.
(find_request_updates): Instead of creating a new set for each configuration, reuse the existing sets to
share a single set agmonst test configurations for each builder.

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

4 years agoUnreviewed, rolling out r194926 and r194928.
commit-queue@webkit.org [Wed, 13 Jan 2016 00:32:00 +0000 (00:32 +0000)]
Unreviewed, rolling out r194926 and r194928.
https://bugs.webkit.org/show_bug.cgi?id=153048

This change is causing LayoutTest crashes (Requested by
ryanhaddad on #webkit).

Reverted changesets:

"Avoid downloading the wrong image for <picture> elements."
https://bugs.webkit.org/show_bug.cgi?id=153027
http://trac.webkit.org/changeset/194926

"Avoid downloading the wrong image for <picture> elements."
https://bugs.webkit.org/show_bug.cgi?id=153027
http://trac.webkit.org/changeset/194928

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

4 years ago[iOS] Antialiasing doesn't work in WebGL
dino@apple.com [Wed, 13 Jan 2016 00:10:26 +0000 (00:10 +0000)]
[iOS] Antialiasing doesn't work in WebGL
https://bugs.webkit.org/show_bug.cgi?id=153000
<rdar://problem/9165531>

Reviewed by Alex Christensen.

Source/WebCore:

WebGL has supported platform antialiasing since
the beginning, but we never hooked it up for iOS
because it used a slightly different extension.

Test: fast/canvas/webgl/antialiasing-enabled.html

* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::endPaint): Resolve the multisampling
buffer once we're done painting.
(WebCore::GraphicsContext3D::~GraphicsContext3D): We never created
the m_compositorTexture RenderBuffer on iOS, so no point deleting
it.

* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supportsExtension): The iOS extension
has a slightly different name.
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs): Make sure to create the
multisample buffer with the correct format.
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary): We
need to remember what our bound frame buffer is when we
enter this call, and restore it afterwards. In the middle we can
discard our multisample read buffer once we have resolved it
into the normal framebuffer.

LayoutTests:

New test to check if WebGL antialiasing happened on a rendered canvas.

* fast/canvas/webgl/antialiasing-enabled-expected.txt: Added.
* fast/canvas/webgl/antialiasing-enabled.html: Added.

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

4 years agoWeb Inspector: Move helper methods for getting icons/text to TimelineTabContentView
mattbaker@apple.com [Wed, 13 Jan 2016 00:04:25 +0000 (00:04 +0000)]
Web Inspector: Move helper methods for getting icons/text to TimelineTabContentView
https://bugs.webkit.org/show_bug.cgi?id=152996

Reviewed by Brian Burg.

In preparation for the Timelines UI redesign, helper methods which existed
in the sidebar panel and timeline tree elements need to be relocated,
since the sidebar won't exist in the new UI.

* UserInterface/Views/TimelineRecordTreeElement.js:
(WebInspector.TimelineRecordTreeElement):
Removed icon/title code, replaced with calls to new helper methods.
Code to create the alternate subtitle was broken out form the rest
of the icon/title code, and kept in the constructor.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._instrumentAdded):
Updated calls to helper methods.

* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype._instrumentAdded):
(WebInspector.TimelineSidebarPanel.displayNameForTimeline): Deleted.
(WebInspector.TimelineSidebarPanel.iconClassNameForTimeline): Deleted.
Moved to TimelineTabContentView.

* UserInterface/Views/TimelineTabContentView.js:
(WebInspector.TimelineTabContentView.displayNameForTimeline):
(WebInspector.TimelineTabContentView.iconClassNameForTimeline):
Relocated from TimelineSidebarPanel.
(WebInspector.TimelineTabContentView.iconClassNameForRecord):
(WebInspector.TimelineTabContentView.displayNameForRecord):
New helper methods. Previously part of TimelineRecordTreeElement.

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

4 years agoSkipped more tests related to picture element on ios-simulator and grouped them toget...
ryanhaddad@apple.com [Wed, 13 Jan 2016 00:02:04 +0000 (00:02 +0000)]
Skipped more tests related to picture element on ios-simulator and grouped them together in TestExpectations file.

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

4 years agoSkipping crashing test fast/picture/image-picture-loads-1x.html on ios-simulator
ryanhaddad@apple.com [Tue, 12 Jan 2016 23:51:46 +0000 (23:51 +0000)]
Skipping crashing test fast/picture/image-picture-loads-1x.html on ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=153043

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

4 years agoAnalysis results viewer sometimes doesn't show the correct relative difference
rniwa@webkit.org [Tue, 12 Jan 2016 22:48:22 +0000 (22:48 +0000)]
Analysis results viewer sometimes doesn't show the correct relative difference
https://bugs.webkit.org/show_bug.cgi?id=152930

Reviewed by Chris Dumez.

The bug was caused by single A/B testing result associated with multiple rows when there are multiple data
points with the same root set which matches that of an A/B testing.

Fixed the bug by detecting such a case, and only associating each A/B testing result with the row created
for the first matching point.

* public/v3/components/analysis-results-viewer.js:
(AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):

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

4 years agoAvoid downloading the wrong image for <picture> elements.
hyatt@apple.com [Tue, 12 Jan 2016 22:29:43 +0000 (22:29 +0000)]
Avoid downloading the wrong image for <picture> elements.
https://bugs.webkit.org/show_bug.cgi?id=153027

Reviewed by Dean Jackson.

* fast/picture/image-picture-loads-1x-expected.txt: Added.
* fast/picture/image-picture-loads-1x.html: Added.

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

4 years agoXSS Auditor should navigate to empty substitute data on full page block
dbates@webkit.org [Tue, 12 Jan 2016 22:28:59 +0000 (22:28 +0000)]
XSS Auditor should navigate to empty substitute data on full page block
https://bugs.webkit.org/show_bug.cgi?id=152868
<rdar://problem/18658448>

Reviewed by David Kilzer and Andy Estes.

Derived from Blink patch (by Tom Sepez <tsepez@chromium.org>):
<https://src.chromium.org/viewvc/blink?view=rev&revision=179240>

Source/WebCore:

Test: http/tests/security/xssAuditor/block-does-not-leak-that-page-was-blocked-using-empty-data-url.html

* html/parser/XSSAuditorDelegate.cpp:
(WebCore::XSSAuditorDelegate::didBlockScript): Modified to call NavigationScheduler::schedulePageBlock().
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledPageBlock::ScheduledPageBlock): Added.
(WebCore::NavigationScheduler::schedulePageBlock): Navigate to empty substitute data with
the same URL as the originating document.
* loader/NavigationScheduler.h:

LayoutTests:

Added additional test block-does-not-leak-that-page-was-blocked-using-empty-data-url.html to explicitly
tests that we do redirect to an empty data URL when a full page block is triggered.

* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-allow-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-block-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-block-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-block-filter-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-block-invalid-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-block-unset-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-filter-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-invalid-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-unset-block-expected.txt:
* http/tests/security/xssAuditor/block-does-not-leak-location-expected.txt:
* http/tests/security/xssAuditor/block-does-not-leak-referrer-expected.txt:
* http/tests/security/xssAuditor/block-does-not-leak-that-page-was-blocked-using-empty-data-url-expected.txt: Added.
* http/tests/security/xssAuditor/block-does-not-leak-that-page-was-blocked-using-empty-data-url.html: Added.
* http/tests/security/xssAuditor/full-block-base-href-expected.txt:
* http/tests/security/xssAuditor/full-block-iframe-javascript-url-expected.txt:
* http/tests/security/xssAuditor/full-block-javascript-link-expected.txt:
* http/tests/security/xssAuditor/full-block-link-onclick-expected.txt:
* http/tests/security/xssAuditor/full-block-object-tag-expected.txt:
* http/tests/security/xssAuditor/full-block-script-tag-cross-domain-expected.txt:
* http/tests/security/xssAuditor/full-block-script-tag-expected.txt:
* http/tests/security/xssAuditor/full-block-script-tag-with-source-expected.txt:
* http/tests/security/xssAuditor/full-block-script-tag.html:
* http/tests/security/xssAuditor/xss-protection-parsing-03-expected.txt:
* http/tests/security/xssAuditor/xss-protection-parsing-04-expected.txt:

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

4 years agoAvoid downloading the wrong image for <picture> elements.
hyatt@apple.com [Tue, 12 Jan 2016 22:18:19 +0000 (22:18 +0000)]
Avoid downloading the wrong image for <picture> elements.
https://bugs.webkit.org/show_bug.cgi?id=153027

Reviewed by Dean Jackson.

I was unable to write a reliable test for this feature (I welcome suggestions regarding
how this could be tested).

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::~HTMLImageElement):
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
(WebCore::HTMLImageElement::insertedInto):
(WebCore::HTMLImageElement::removedFrom):
(WebCore::HTMLImageElement::pictureNode):
(WebCore::HTMLImageElement::setPictureNode):
* html/HTMLImageElement.h:
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::createHTMLElement):

Images that are built underneath a <picture> element are now connected
to that picture element via a setPictureNode call from the parser. This
ensures that the correct <source> elements are examined before checking the image.

This connection between images and their picture owners is handled using a static
HashMap in HTMLImageElement. This connection is made both from the parser and from
DOM insertions, and the map is queried now instead of looking directly at the
image's parentNode().

Also note the change to pass the document element's computed style in for media
query evaluation. Just as with the preload scanner, the image's style can't be
used as it has not been determined yet.

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

4 years agoWebPageProxy should reattach to the web process before navigating
ggaren@apple.com [Tue, 12 Jan 2016 22:06:46 +0000 (22:06 +0000)]
WebPageProxy should reattach to the web process before navigating
https://bugs.webkit.org/show_bug.cgi?id=153026

Reviewed by Anders Carlsson.

This fixes a crash (and lots of other corruption) when force-quitting
the web process during navigation.

Some objects (like ViewGestureController) use one-time initialization
to point to a ChildProcessProxy -- and, by design, we destroy them when
the ChildProcessProxy becomes invalid (i.e., crashes or quits).

If we navigate *before* creating a new, valid ChildProcessProxy, then
we accidentally re-create these objects pointing to the old, invalid
ChildProcessProxy.

We need to wait until we have a valid ChildProcessProxy before we
initialize these objects.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcessWithItem): Navigate after
reattaching to the web process so that lazily allocated helper objects
point to the right ChildProcessProxy.

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

4 years agoFix the Sunpider converage in slow device.
dewei_zhu@apple.com [Tue, 12 Jan 2016 21:53:21 +0000 (21:53 +0000)]
Fix the Sunpider converage in slow device.
https://bugs.webkit.org/show_bug.cgi?id=152938
<rdar://problem/22511411>

Reviewed by Ryosuke Niwa.

Updated the patch for RunBenchmark to resume sunspider coverage by removing unused subresources in sub-tests.

* Scripts/webkitpy/benchmark_runner/data/patches/SunSpider.patch:

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

4 years agoCleanup in font loading code
mmaxfield@apple.com [Tue, 12 Jan 2016 21:36:41 +0000 (21:36 +0000)]
Cleanup in font loading code
https://bugs.webkit.org/show_bug.cgi?id=153023

Reviewed by Zalan Bujtas.

See detailed notes below.

No new tests because there is no behavior change.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::isLoaded): Deleted. Never called.
* css/CSSFontFace.h: Ditto.
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font): No need to use a helper
isLoaded() function.
(WebCore::CSSFontFaceSource::isLoaded): Deleted. Unnecessary.
* css/CSSFontFaceSource.h:
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::cachedFont): Un-indent code.
* css/CSSFontSelector.cpp:
(WebCore::registerLocalFontFacesForFamily): constructFamilyFontFaces()
always returns an empty Vector. Therefore, the function of this function
is to perform the ancillary processing related to the case where the Faces
don't already exist. Renames the function and removes the empty vector
return.
(WebCore::CSSFontSelector::addFontFaceRule): Update for
registerLocalFontFacesForFamily().
(WebCore::FontFaceComparator::FontFaceComparator): Instead of using a static,
construct a wrapper class around the comparator.
(WebCore::FontFaceComparator::operator()): Ditto.
(WebCore::CSSFontSelector::getFontFace): Un-indent code and update to use
FontFaceComparator.
(WebCore::CSSFontSelector::fallbackFontAt): Migrate off PassRefPtr.
(WebCore::constructFamilyFontFaces): Deleted.
(WebCore::compareFontFaces): Deleted.
(WebCore::CSSFontSelector::resolvesFamilyFor): Deleted. Never called.
* css/CSSFontSelector.h:
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::isValid): Deleted.
(WebCore::CSSSegmentedFontFace::fontRanges): Cache negative validity results.
* css/CSSSegmentedFontFace.h:
* platform/graphics/FontCascade.h:
(WebCore::FontCascade::fontSelector): Use nullptr.
* platform/graphics/FontSelector.h:

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

4 years ago[FTL][Win64] Compile error.
peavo@outlook.com [Tue, 12 Jan 2016 21:34:29 +0000 (21:34 +0000)]
[FTL][Win64] Compile error.
https://bugs.webkit.org/show_bug.cgi?id=153031

Reviewed by Brent Fulgham.

The header file dlfcn.h does not exist on Windows.

* ftl/FTLLowerDFGToLLVM.cpp:

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

4 years agoAdd a build flag for custom element
rniwa@webkit.org [Tue, 12 Jan 2016 21:25:34 +0000 (21:25 +0000)]
Add a build flag for custom element
https://bugs.webkit.org/show_bug.cgi?id=153005

Reviewed by Alex Christensen.

.:

* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Added a build flag for enabling custom elements.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

Added --custom-elements option to enable custom elements support.

* Scripts/webkitperl/FeatureList.pm:

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

4 years agoWeb Inspector: fix some common misspellings in localized strings
bburg@apple.com [Tue, 12 Jan 2016 20:52:23 +0000 (20:52 +0000)]
Web Inspector: fix some common misspellings in localized strings
https://bugs.webkit.org/show_bug.cgi?id=153030
<rdar://problem/24153340>

Reviewed by Joseph Pecoraro.

Replace 'occured', 'transfered' with 'occurred' and 'transferred'.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/DatabaseTableContentView.js:
(WebInspector.DatabaseTableContentView.prototype._queryError):
* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView):
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel):

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

4 years agoNull dereference loading Blink layout test fast/frames/navigation-in-pagehide.html
jiewen_tan@apple.com [Tue, 12 Jan 2016 20:28:54 +0000 (20:28 +0000)]
Null dereference loading Blink layout test fast/frames/navigation-in-pagehide.html
https://bugs.webkit.org/show_bug.cgi?id=149303
<rdar://problem/22747634>

Reviewed by Brent Fulgham.

* imported/blink/fast/frames/navigation-in-pagehide-expected.txt: Added.
* imported/blink/fast/frames/navigation-in-pagehide.html: Added.

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

4 years agoWebRTC: Update RTCPeerConnection.add/removeTrack() and add test
adam.bergkvist@ericsson.com [Tue, 12 Jan 2016 20:20:13 +0000 (20:20 +0000)]
WebRTC: Update RTCPeerConnection.add/removeTrack() and add test
https://bugs.webkit.org/show_bug.cgi?id=153010

Reviewed by Eric Carlson.

Source/WebCore:

RTCPeerConnection.add/removeTrack() are not fully spec compliant yet, since that would
require support for RTCRtpTransceiver which is a new work-in-progress feature. Use
Vector, instead of map, for senders and receivers since nothing is removed from these
sets anymore.

Test: fast/mediastream/RTCPeerConnection-add-removeTrack.html

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTrack):
(WebCore::RTCPeerConnection::removeTrack):
(WebCore::RTCPeerConnection::queuedCreateOffer): Deleted.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::RTCRtpSender):
* Modules/mediastream/RTCRtpSender.h:
(WebCore::RTCRtpSender::create):
(WebCore::RTCRtpSender::mediaStreamIds):

LayoutTests:

Add test for RTCPeerConnection.add/removeTrack() (currently not covered by other tests).
This test also covers some of the functionality of RTCRtpSender.

* fast/mediastream/RTCPeerConnection-add-removeTrack-expected.txt: Added.
* fast/mediastream/RTCPeerConnection-add-removeTrack.html: Added.

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

4 years agoNull dereference loading Blink layout test editing/selection/selectstart-event-crash...
jiewen_tan@apple.com [Tue, 12 Jan 2016 20:16:50 +0000 (20:16 +0000)]
Null dereference loading Blink layout test editing/selection/selectstart-event-crash.html
https://bugs.webkit.org/show_bug.cgi?id=150210
<rdar://problem/23137259>

Reviewed by Brent Fulgham.

* imported/blink/editing/selection/selectstart-event-crash-expected.txt: Added.
* imported/blink/editing/selection/selectstart-event-crash.html: Added.
* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoNull dereference loading Blink layout test editing/apply-inline-style-to-element...
jiewen_tan@apple.com [Tue, 12 Jan 2016 20:11:03 +0000 (20:11 +0000)]
Null dereference loading Blink layout test editing/apply-inline-style-to-element-with-no-renderer-crash.html
https://bugs.webkit.org/show_bug.cgi?id=149287
<rdar://problem/22746217>

Reviewed by Brent Fulgham.

* imported/blink/editing/apply-inline-style-to-element-with-no-renderer-crash-expected.txt: Added.
* imported/blink/editing/apply-inline-style-to-element-with-no-renderer-crash.html: Added.

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

4 years ago[JSC] Remove some invalid immediate instruction forms from ARM64 Air
commit-queue@webkit.org [Tue, 12 Jan 2016 20:05:52 +0000 (20:05 +0000)]
[JSC] Remove some invalid immediate instruction forms from ARM64 Air
https://bugs.webkit.org/show_bug.cgi?id=153024

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-01-12
Reviewed by Michael Saboff.

* b3/B3BasicBlock.h:
Export the symbols for testb3.

* b3/air/AirOpcode.opcodes:
We had 2 invalid opcodes:
-Compare with immediate just does not exist.
-Test64 with immediate exists but Air does not recognize
 the valid form of bit-immediates.

* b3/testb3.cpp:
(JSC::B3::genericTestCompare):
(JSC::B3::testCompareImpl):
Extend the tests to cover what was invalid.

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

4 years ago[l10n] Updated French translation for WebKitGTK+
mcatanzaro@igalia.com [Tue, 12 Jan 2016 19:27:18 +0000 (19:27 +0000)]
[l10n] Updated French translation for WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=153013

Patch by Sam Friedmann <sfriedma@redhat.com> on 2016-01-12
Rubber-stamped by Michael Catanzaro.

* fr.po:

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

4 years agoWeb Inspector: Fix DataGrid row disclosure appearance and behavior
mattbaker@apple.com [Tue, 12 Jan 2016 19:27:13 +0000 (19:27 +0000)]
Web Inspector: Fix DataGrid row disclosure appearance and behavior
https://bugs.webkit.org/show_bug.cgi?id=152991

Reviewed by Brian Burg.

* UserInterface/Views/DataGrid.css:
(.data-grid tr.parent td.disclosure::before):
Ensure triangle is vertically aligned for any row height.
(.data-grid tr:not(.parent) td.disclosure):
Fix indent size.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGridNode.prototype.createCell):
Added `icon` column property, encapsulate icon element creation.
(WebInspector.DataGridNode.prototype.isEventWithinDisclosureTriangle):
Fix hit test logic by computing left padding.

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

4 years agoModern IDB: Check in empty SQLite backing store implementation.
beidson@apple.com [Tue, 12 Jan 2016 19:17:55 +0000 (19:17 +0000)]
Modern IDB: Check in empty SQLite backing store implementation.
https://bugs.webkit.org/show_bug.cgi?id=153022

Reviewed by Alex Christensen.

No new tests (No change in behavior).

Just to get the implementation files in the tree, this backing store currently does nothing
other than return errors for every operation.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Added.
(WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
(WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h: Added.

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

4 years agoModern IDB: storage/indexeddb/dont-wedge.html is flaky.
beidson@apple.com [Tue, 12 Jan 2016 19:17:45 +0000 (19:17 +0000)]
Modern IDB: storage/indexeddb/dont-wedge.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=152892

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Reenabled existing test).

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
(WebCore::IDBClient::IDBOpenDBRequest::requestCompleted): If the database was opened
  or an upgrade transaction was started, but the script execution context is already
  stopped, immediately message back to the server so it doesn't wedge.

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::abortOpenAndUpgradeNeeded):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::abortWithoutCallback):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::abortOpenAndUpgradeNeeded):
* Modules/indexeddb/shared/InProcessIDBServer.h:

LayoutTests:

* platform/mac-wk1/TestExpectations:

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

4 years agoWeb Inspector: REGRESSION (r194879) - Opening views without being previously opened...
commit-queue@webkit.org [Tue, 12 Jan 2016 19:16:24 +0000 (19:16 +0000)]
Web Inspector: REGRESSION (r194879) - Opening views without being previously opened causes an Uncaught Exception
https://bugs.webkit.org/show_bug.cgi?id=153006

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-01-12
Reviewed by Brian Burg.

* UserInterface/Views/MultipleScopeBarItem.js:
(WebInspector.MultipleScopeBarItem.prototype.displaySelectedItem):
If there is no selected item, default to the first item in the list.

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

4 years agoAsk for UI Process approval of ProtectionSpace when authenticating downloads with...
achristensen@apple.com [Tue, 12 Jan 2016 18:48:31 +0000 (18:48 +0000)]
Ask for UI Process approval of ProtectionSpace when authenticating downloads with NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=152999

Reviewed by Brady Eidson.

* DerivedSources.make:
I mistakenly added PendingDownload.messages.in in r194810, but this will not be needed because
the PendingDownload is not a MessageReceiver.  Rather, the NetworkProcess receives the messages
and forwards their contents to the PendingDownload through its DownloadManager.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::dataTaskBecameDownloadTask):
(WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
(WebKit::DownloadManager::convertHandleToDownload):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::continueWillSendRequest):
(WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
Instead of taking a shortcut I added in r194810, send a message to the UI process and wait for its
asynchronous reply to determine if we can authenticate against this protection space.
(WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace):
(WebKit::PendingDownload::didConvertToDownload):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/Downloads/PendingDownload.messages.in: Removed.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::cancelDownload):
(WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
(WebKit::NetworkProcess::setCacheModel):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Shared/Authentication/AuthenticationManager.h:
* UIProcess/API/APIDownloadClient.h:
(API::DownloadClient::didFail):
(API::DownloadClient::didCancel):
(API::DownloadClient::processDidCrash):
(API::DownloadClient::canAuthenticateAgainstProtectionSpace):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
(WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
(WebKit::DownloadProxy::didReceiveResponse):
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoWeb Inspector: creating a gradient in the Visual sidebar causes a crash
commit-queue@webkit.org [Tue, 12 Jan 2016 18:44:23 +0000 (18:44 +0000)]
Web Inspector: creating a gradient in the Visual sidebar causes a crash
https://bugs.webkit.org/show_bug.cgi?id=153003

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-01-12
Reviewed by Brian Burg.

* UserInterface/Views/VisualStyleBackgroundPicker.js:
(WebInspector.VisualStyleBackgroundPicker.prototype._gradientSwatchClicked):
If a gradient does not already exist when the swatch is clicked, create a basic
gradient using the current type and two "transparent" color stops (a minimum of
two color stops are needed for a valid gradient).

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

4 years agoUnreviewed, rolling out r194826.
commit-queue@webkit.org [Tue, 12 Jan 2016 18:13:57 +0000 (18:13 +0000)]
Unreviewed, rolling out r194826.
https://bugs.webkit.org/show_bug.cgi?id=153020

Appears to have regressed PLT (Requested by kling on #webkit).

Reverted changeset:

"Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
cont'd"
https://bugs.webkit.org/show_bug.cgi?id=152902
http://trac.webkit.org/changeset/194826

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

4 years ago[JSC] Add a help message when run-jsc-stress-tests fails
commit-queue@webkit.org [Tue, 12 Jan 2016 17:48:19 +0000 (17:48 +0000)]
[JSC] Add a help message when run-jsc-stress-tests fails
https://bugs.webkit.org/show_bug.cgi?id=153014

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-01-12
Reviewed by Csaba Osztrogonác.

* Scripts/run-jsc-stress-tests:

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

4 years agoDon't reuse memory cache entries with different charset
antti@apple.com [Tue, 12 Jan 2016 17:31:02 +0000 (17:31 +0000)]
Don't reuse memory cache entries with different charset
https://bugs.webkit.org/show_bug.cgi?id=110031
Source/WebCore:

rdar://problem/13666418

Reviewed by Andreas Kling.

Test: fast/loader/cache-encoding.html

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
(WebCore::logResourceRevalidationDecision):
(WebCore::CachedResourceLoader::determineRevalidationPolicy):

    Pass full CachedResourceRequest to the function.
    If charset differs don't reuse the cache entry.

* loader/cache/CachedResourceLoader.h:

LayoutTests:

Reviewed by Andreas Kling.

* fast/loader/cache-encoding-expected.txt: Added.
* fast/loader/cache-encoding.html: Added.
* fast/loader/resources/success.js: Added.

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

4 years agoMarking inspector/model/scope-chain-node.html as flaky on Mac debug
ryanhaddad@apple.com [Tue, 12 Jan 2016 17:28:31 +0000 (17:28 +0000)]
Marking inspector/model/scope-chain-node.html as flaky on Mac debug
https://bugs.webkit.org/show_bug.cgi?id=153018

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoUse a pointer instead of PassRefPtr in AbstractView argument of UIEvent class
gyuyoung.kim@webkit.org [Tue, 12 Jan 2016 17:23:47 +0000 (17:23 +0000)]
Use a pointer instead of PassRefPtr in AbstractView argument of UIEvent class
https://bugs.webkit.org/show_bug.cgi?id=152829

Reviewed by Darin Adler.

As a step to reduce uses of PassRefPtr, UIEvent class doesn't need to use PassRefPtr for AbstractView argument.
Nobody hands us ownership when making one of these objects.

* dom/FocusEvent.cpp:
(WebCore::FocusEvent::FocusEvent):
* dom/FocusEvent.h:
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
(WebCore::MouseEvent::initMouseEvent):
(WebCore::SimulatedMouseEvent::create):
(WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
* dom/MouseEvent.h:
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
* dom/MouseRelatedEvent.h:
* dom/TextEvent.cpp:
(WebCore::TextEvent::create):
(WebCore::TextEvent::createForPlainTextPaste):
(WebCore::TextEvent::createForFragmentPaste):
(WebCore::TextEvent::createForDrop):
(WebCore::TextEvent::createForDictation):
(WebCore::TextEvent::TextEvent):
(WebCore::TextEvent::initTextEvent):
* dom/TextEvent.h:
* dom/TouchEvent.cpp:
(WebCore::TouchEvent::TouchEvent):
(WebCore::TouchEvent::initTouchEvent):
* dom/TouchEvent.h:
* dom/UIEvent.cpp:
(WebCore::UIEvent::UIEvent):
(WebCore::UIEvent::initUIEvent):
* dom/UIEvent.h:
(WebCore::UIEvent::create):
(WebCore::UIEvent::view):
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::UIEventWithKeyState):

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

4 years agoMove ChildProcessProxy from Shared to UIProcess
commit-queue@webkit.org [Tue, 12 Jan 2016 17:23:27 +0000 (17:23 +0000)]
Move ChildProcessProxy from Shared to UIProcess
https://bugs.webkit.org/show_bug.cgi?id=125570

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2016-01-12
Reviewed by Darin Adler.

ChildProcessProxy is only used by the UI process.

* CMakeLists.txt:
* PlatformGTK.cmake:
* UIProcess/ChildProcessProxy.cpp: Renamed from Source/WebKit2/Shared/ChildProcessProxy.cpp.
(WebKit::ChildProcessProxy::ChildProcessProxy):
(WebKit::ChildProcessProxy::~ChildProcessProxy):
(WebKit::ChildProcessProxy::fromConnection):
(WebKit::ChildProcessProxy::getLaunchOptions):
(WebKit::ChildProcessProxy::connect):
(WebKit::ChildProcessProxy::terminate):
(WebKit::ChildProcessProxy::state):
(WebKit::ChildProcessProxy::sendMessage):
(WebKit::ChildProcessProxy::addMessageReceiver):
(WebKit::ChildProcessProxy::removeMessageReceiver):
(WebKit::ChildProcessProxy::dispatchMessage):
(WebKit::ChildProcessProxy::dispatchSyncMessage):
(WebKit::ChildProcessProxy::didFinishLaunching):
(WebKit::ChildProcessProxy::shutDownProcess):
(WebKit::ChildProcessProxy::connectionWillOpen):
* UIProcess/ChildProcessProxy.h: Renamed from Source/WebKit2/Shared/ChildProcessProxy.h.
(WebKit::ChildProcessProxy::connection):
(WebKit::ChildProcessProxy::processIdentifier):
(WebKit::ChildProcessProxy::canSendMessage):
(WebKit::ChildProcessProxy::send):
(WebKit::ChildProcessProxy::sendSync):
* WebKit2.xcodeproj/project.pbxproj:

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

4 years ago[JSC] JSC does not build with FTL_USES_B3 on ARM64
commit-queue@webkit.org [Tue, 12 Jan 2016 17:17:44 +0000 (17:17 +0000)]
[JSC] JSC does not build with FTL_USES_B3 on ARM64
https://bugs.webkit.org/show_bug.cgi?id=153011

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-01-12
Reviewed by Saam Barati.

Apparently the static const member can only be used for constexpr.
C++ is weird.

* jit/GPRInfo.cpp:
* jit/GPRInfo.h:

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

4 years agoMarking inspector/script-profiler/event-type-Other.html as flaky on Mac
ryanhaddad@apple.com [Tue, 12 Jan 2016 17:11:33 +0000 (17:11 +0000)]
Marking inspector/script-profiler/event-type-Other.html as flaky on Mac
https://bugs.webkit.org/show_bug.cgi?id=153016

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoFix unused-private-field warnings in DisplayListItems.h
ossy@webkit.org [Tue, 12 Jan 2016 16:47:13 +0000 (16:47 +0000)]
Fix unused-private-field warnings in DisplayListItems.h
https://bugs.webkit.org/show_bug.cgi?id=153012

Reviewed by Michael Catanzaro.

* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawNativeImage::DrawNativeImage):
* platform/graphics/displaylists/DisplayListItems.h:

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

4 years agoUnreviewed GTK+ gardening. Rebaseline test results after r194847.
carlosgc@webkit.org [Tue, 12 Jan 2016 14:32:54 +0000 (14:32 +0000)]
Unreviewed GTK+ gardening. Rebaseline test results after r194847.

Before r194847 we were always taking the separator of combo boxes
into account when calculating the size of menu list buttons, even
when we didn't render the separator. In r194847 we removed all the
code to deal with separators in combo boxes. Also, since r194847
we are correctly adding the padding between the icon and the text
in search fileds.

* platform/gtk/css3/selectors3/html/css3-modsel-161-expected.txt:
* platform/gtk/css3/selectors3/xhtml/css3-modsel-161-expected.txt:
* platform/gtk/css3/selectors3/xml/css3-modsel-161-expected.txt:
* platform/gtk/editing/pasteboard/4641033-expected.txt:
* platform/gtk/editing/pasteboard/4944770-1-expected.txt:
* platform/gtk/editing/pasteboard/4944770-2-expected.txt:
* platform/gtk/editing/selection/caret-before-select-expected.txt:
* platform/gtk/editing/selection/replaced-boundaries-3-expected.txt:
* platform/gtk/editing/selection/select-box-expected.txt:
* platform/gtk/editing/selection/select-element-paragraph-boundary-expected.txt:
* platform/gtk/fast/css/focus-ring-exists-for-search-field-expected.txt:
* platform/gtk/fast/css/input-search-padding-expected.txt:
* platform/gtk/fast/css/text-input-with-webkit-border-radius-expected.txt:
* platform/gtk/fast/css/text-overflow-input-expected.txt:
* platform/gtk/fast/css/text-transform-select-expected.txt:
* platform/gtk/fast/forms/001-expected.txt:
* platform/gtk/fast/forms/003-expected.txt:
* platform/gtk/fast/forms/004-expected.txt:
* platform/gtk/fast/forms/basic-inputs-expected.txt:
* platform/gtk/fast/forms/basic-selects-expected.txt:
* platform/gtk/fast/forms/box-shadow-override-expected.txt:
* platform/gtk/fast/forms/control-restrict-line-height-expected.txt:
* platform/gtk/fast/forms/disabled-select-change-index-expected.txt:
* platform/gtk/fast/forms/form-element-geometry-expected.txt:
* platform/gtk/fast/forms/input-appearance-height-expected.txt:
* platform/gtk/fast/forms/input-value-expected.txt:
* platform/gtk/fast/forms/menulist-deselect-update-expected.txt:
* platform/gtk/fast/forms/menulist-narrow-width-expected.txt:
* platform/gtk/fast/forms/menulist-no-overflow-expected.txt:
* platform/gtk/fast/forms/menulist-restrict-line-height-expected.txt:
* platform/gtk/fast/forms/menulist-separator-painting-expected.txt:
* platform/gtk/fast/forms/menulist-style-color-expected.txt:
* platform/gtk/fast/forms/menulist-width-change-expected.txt:
* platform/gtk/fast/forms/option-script-expected.txt:
* platform/gtk/fast/forms/option-strip-whitespace-expected.txt:
* platform/gtk/fast/forms/placeholder-position-expected.txt:
* platform/gtk/fast/forms/placeholder-pseudo-style-expected.txt:
* platform/gtk/fast/forms/search-cancel-button-style-sharing-expected.txt:
* platform/gtk/fast/forms/search-display-none-cancel-button-expected.txt:
* platform/gtk/fast/forms/search-rtl-expected.txt:
* platform/gtk/fast/forms/search-styled-expected.txt:
* platform/gtk/fast/forms/search/search-size-with-decorations-expected.txt:
* platform/gtk/fast/forms/searchfield-heights-expected.txt:
* platform/gtk/fast/forms/select-background-none-expected.txt:
* platform/gtk/fast/forms/select-baseline-expected.txt:
* platform/gtk/fast/forms/select-change-listbox-to-popup-expected.txt:
* platform/gtk/fast/forms/select-dirty-parent-pref-widths-expected.txt:
* platform/gtk/fast/forms/select-disabled-appearance-expected.txt:
* platform/gtk/fast/forms/select-element-focus-ring-expected.txt:
* platform/gtk/fast/forms/select-initial-position-expected.txt:
* platform/gtk/fast/forms/select-selected-expected.txt:
* platform/gtk/fast/forms/select-size-expected.txt:
* platform/gtk/fast/forms/select-style-expected.txt:
* platform/gtk/fast/forms/select-visual-hebrew-expected.txt:
* platform/gtk/fast/forms/select/optgroup-rendering-expected.txt:
* platform/gtk/fast/forms/selectlist-minsize-expected.txt:
* platform/gtk/fast/forms/stuff-on-my-optgroup-expected.txt:
* platform/gtk/fast/forms/validation-message-appearance-expected.txt:
* platform/gtk/fast/html/keygen-expected.txt:
* platform/gtk/fast/invalid/014-expected.txt:
* platform/gtk/fast/parser/document-write-option-expected.txt:
* platform/gtk/fast/repaint/search-field-cancel-expected.txt:
* platform/gtk/fast/replaced/replaced-breaking-expected.txt:
* platform/gtk/fast/replaced/replaced-breaking-mixture-expected.txt:
* platform/gtk/fast/replaced/three-selects-break-expected.txt:
* platform/gtk/fast/replaced/width100percent-menulist-expected.txt:
* platform/gtk/fast/replaced/width100percent-searchfield-expected.txt:
* platform/gtk/http/tests/navigation/javascriptlink-frames-expected.txt:

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

4 years ago[GTK] UI process crashes if webkit_web_view_get_tls_info is called before internal...
carlosgc@webkit.org [Tue, 12 Jan 2016 11:41:21 +0000 (11:41 +0000)]
[GTK] UI process crashes if webkit_web_view_get_tls_info is called before internal load-committed event
https://bugs.webkit.org/show_bug.cgi?id=142375

Reviewed by Michael Catanzaro.

Remove all the hacks to emit delayed load events now that the
page cache resource load delegates are consistent with all other
resource loads.

* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewLoadChanged):
(webkitWebViewResourceLoadStarted):
(webkit_web_view_get_tls_info): Add a g_return_val_if_fail to
prevent this function from being misused.
(webkitWebViewDisconnectMainResourceResponseChangedSignalHandler): Deleted.
(webkitWebViewDispose): Deleted.
(webkitWebViewEmitLoadChanged): Deleted.
(webkitWebViewEmitDelayedLoadEvents): Deleted.
(mainResourceResponseChangedCallback): Deleted.
(waitForMainResourceResponseIfWaitingForResource): Deleted.

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

4 years agoUnreviewed. Fix isRecording condition logic in GraphicsContext::roundToDevicePixels...
carlosgc@webkit.org [Tue, 12 Jan 2016 08:29:19 +0000 (08:29 +0000)]
Unreviewed. Fix isRecording condition logic in GraphicsContext::roundToDevicePixels after r194816.

This looks like a typo introduced in r194816, we want to return early logging
a message when isRecording() returns true.

* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::roundToDevicePixels):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::roundToDevicePixels):

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

4 years agoInconsistencies in main resource load delegates when loading from history
carlosgc@webkit.org [Tue, 12 Jan 2016 08:23:36 +0000 (08:23 +0000)]
Inconsistencies in main resource load delegates when loading from history
https://bugs.webkit.org/show_bug.cgi?id=150927

Reviewed by Michael Catanzaro.

Source/WebCore:

When restoring a page from the page cache, even though there
isn't an actual load of resources, we are still emitting the load
delegates to let the API layer know there are contents being
loaded in the web view. This makes the page cache restoring
transparent for the API layer. However, when restoring a page from
the cache, all the delegates are emitted after the load is
committed. This is not consistent with real loads, where we first
load the main resource and once we get a response we commit the
load. This inconsistency is problematic if the API layer expects
to always have a main resource with a response when the load is
committed. This is the case of the GTK+ port, for example. So,
this patch ensures that when a page is restored from the page
cache, the main resource load delegates that are emitted until a
response is received in normal loads, are emitted before the load
is committed.

Test: http/tests/loading/main-resource-delegates-on-back-navigation.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad): When loading from
the page cache, send delegate messages up to didReceiveResponse
for the main resource before the load is committed, and the
remaining messages afterwards.

LayoutTests:

Add test to check that main resource load delegates are emitted in
the same order before the load is committed when loading a page
from history with the page cache enabled and disabled.

* http/tests/loading/main-resource-delegates-on-back-navigation-expected.txt: Added.
* http/tests/loading/main-resource-delegates-on-back-navigation.html: Added.
* http/tests/loading/resources/page-go-back-onload.html: Added.
* loader/go-back-cached-main-resource-expected.txt:

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

4 years agoWeb Inspector: console.count() shouldn't show a colon in front of a number
commit-queue@webkit.org [Tue, 12 Jan 2016 07:39:16 +0000 (07:39 +0000)]
Web Inspector: console.count() shouldn't show a colon in front of a number
https://bugs.webkit.org/show_bug.cgi?id=152038

Patch by Johan K. Jensen <jj@johanjensen.dk> on 2016-01-11
Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::count):
Do not include title and colon if the title is empty.

LayoutTests:

* inspector/console/console-api-expected.txt:
* inspector/console/console-api.html:
Add testcases for console.count

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