WebKit-https.git
3 years agoNetworkSession: downloads started by startDownload() can fail before starting from...
carlosgc@webkit.org [Mon, 10 Oct 2016 07:45:52 +0000 (07:45 +0000)]
NetworkSession: downloads started by startDownload() can fail before starting from the API point of view
https://bugs.webkit.org/show_bug.cgi?id=163107

Reviewed by Alex Christensen.

In the network process we use a PendingDownload in this case, but in the UI process we always have a single
download proxy. If an error happens before the pending download is converted inot a real download, the DidFail
messages is received in the download proxy before the DidStart one. This is problematic at least for the GTK+
API, because it's common to connect to the started signal and connect to all other signals from there, but in
this case the started signal is never emitted, and then the failed one is not handled. This is not a problem for
downloads started by convertTaskToDownload, because in that case those loads are not considered a download by
the UI process when those early errors happen, and then the web page handles them.

* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::PendingDownload): Send DidStart message right after the network load starts like the
non network session code does.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::convertTaskToDownload): Send DidStart message now that the normal load has been converted
into a download.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::findPendingDownloadLocation): Do not send DidStart message here.

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

3 years agoNetwork Session: PendingDownload is always nullptr in DownloadManager::dataTaskBecame...
carlosgc@webkit.org [Mon, 10 Oct 2016 07:28:48 +0000 (07:28 +0000)]
Network Session: PendingDownload is always nullptr in DownloadManager::dataTaskBecameDownloadTask
https://bugs.webkit.org/show_bug.cgi?id=163006

Reviewed by Alex Christensen.

In DownloadManager::dataTaskBecameDownloadTask() we are supposed to have either a pending download, or a network
data task depending on whether the download was started by startDownload() or convertTaskToDownload. However, in
both cases we do have a data task and never a pending download. In the case of startDownload() the pending
download is removed from m_pendingDownloads in willDecidePendingDownloadDestination(). The task is always
added to m_downloadsWaitingForDestination in willDecidePendingDownloadDestination() and to
m_downloadsAfterDestinationDecided in continueDecidePendingDownloadDestination() in both cases.

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::dataTaskBecameDownloadTask): Add an ASSERT to ensure we don't have a pending download
at this point and that the download is not already in the map. Remove the download from the
m_downloadsAfterDestinationDecided map, but don't check its result because it might not bein that map if
dataTaskBecameDownloadTask is called synchronously from the didReceiveResponse completion handler.
(WebKit::DownloadManager::willDecidePendingDownloadDestination): Do not take the pending download here, wait
until didReceiveResponse completion handler is called.
(WebKit::DownloadManager::continueDecidePendingDownloadDestination): Take the pending download here ensuring
it's alive while the didReceiveResponse completion handler is called. Also remove invalid early return when
either networkDataTask or completionHandler are nullptr because we are using both unconditionally, we should
return early if both are nullptr to avoid crashes. However, we are checking that the download is in the
m_downloadsWaitingForDestination and in that case we should always have both, so better add asserts there. If
the download is already in the map after the completion handler it means that dataTaskBecameDownloadTask() has
alrady been called, so we can just return in that case.
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Protect the NetworkDataTask that can
be deleted by dataTaskBecameDownloadTask().

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

3 years agoShare more code between iOS and macOS ViewGestureController
timothy_horton@apple.com [Mon, 10 Oct 2016 07:13:32 +0000 (07:13 +0000)]
Share more code between iOS and macOS ViewGestureController
https://bugs.webkit.org/show_bug.cgi?id=163158

Reviewed by Simon Fraser.

Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
because it shouldn't know anything about WKWebView.
Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView setAllowsBackForwardNavigationGestures:]):
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
(WebKit::ViewGestureController::canSwipeInDirection):
(WebKit::ViewGestureController::gestureControllerForPage): Deleted.
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::createWeakPtr):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
(WebKit::ViewGestureController::canSwipeInDirection): Deleted.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):

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

3 years ago[GTK] UIProcess crashes when using Japanese IM
commit-queue@webkit.org [Mon, 10 Oct 2016 07:12:35 +0000 (07:12 +0000)]
[GTK] UIProcess crashes when using Japanese IM
https://bugs.webkit.org/show_bug.cgi?id=163011

We have to reference the current GdkEventKey before we try process it
as later when the lambda body is reached the event could be already
freed.

Patch by Tomas Popela <tpopela@redhat.com> on 2016-10-10
Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseKeyPressEvent):
(webkitWebViewBaseKeyReleaseEvent):
* UIProcess/gtk/InputMethodFilter.h:
Use non-copyable Function so we can use WTFMove to pass the event to
lambda.

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

3 years agoMove encrypted media from legacy to new DOM exceptions
darin@apple.com [Mon, 10 Oct 2016 06:54:21 +0000 (06:54 +0000)]
Move encrypted media from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163194

Reviewed by Youenn Fablet.

* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::createSession): Take a reference instead of a pointer.
* Modules/encryptedmedia/CDM.h: Updated for above change.

* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::create): Take a reference instead of a pointer.
(WebCore::WebKitMediaKeySession::MediaKeySession): Ditto.
(WebCore::WebKitMediaKeySession::~MediaKeySession): Removed unneeded code that
sets m_session to null.
(WebCore::WebKitMediaKeySession::keyRequestTimerFired): Use auto.
(WebCore::WebKitMediaKeySession::update): Use ExceptionOr.
(WebCore::WebKitMediaKeySession::addKeyTimerFired): Use m_keys directly instead
of calling the keys function.
(WebCore::WebKitMediaKeySession::sendError): Set m_error directly instead of
calling the setError function.
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory): Use auto.
(WebCore::WebKitMediaKeySession::hasPendingActivity): Check m_session directly
instead of writing !isClosed.
(WebCore::WebKitMediaKeySession::setError): Deleted.

* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: Use pragma once. Removed
unneeded includes. Changed create to take a reference instead of a pointer.
Made most members and base classes private instead of public. Also removed
a few now-unneeded functions. Made everything that was formerly protected
private instead, since the two are the same in a final class.

* Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: Removed unneeded comments.
Moved from MayThrowLegacyException to MayThrowException.

* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
(WebCore::WebKitMediaKeys::create): Use ExceptionOr.
(WebCore::WebKitMediaKeys::MediaKeys): Made argument be an rvalue reference.
Also initialize m_mediaElement in the class definition.
(WebCore::WebKitMediaKeys::~MediaKeys): Call detachKeys instead of setKeys(nullptr).
(WebCore::WebKitMediaKeys::createSession): Use ExceptionOr. Also pass reference
insteead of pointer to create. Also removed unneeded separate checks for null
strings in code that already calls isEmpty.
(WebCore::WebKitMediaKeys::isTypeSupported): Removed unneeded checks for null strings
in code that already calls isEmpty.
(WebCore::WebKitMediaKeys::cdmMediaPlayer): Tweaked a bit.
(WebCore::WebKitMediaKeys::cachedKeyForKeyId): Use auto.

* Modules/encryptedmedia/legacy/WebKitMediaKeys.h: Use pragma once. Removed unneeded includes.
Changed cdm() function to return a reference. Initialize m_mediaElement.
Use private instead of protected.

* Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: Use ConstructorMayThrowException
and MayThrowException instead of the legacy versions.

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

3 years agoENABLE_LEGACY_ENCRYPTED_MEDIA interfaces should have a hard-coded WebKit prefix
zandobersek@gmail.com [Mon, 10 Oct 2016 06:21:52 +0000 (06:21 +0000)]
ENABLE_LEGACY_ENCRYPTED_MEDIA interfaces should have a hard-coded WebKit prefix
https://bugs.webkit.org/show_bug.cgi?id=162982

Reviewed by Jer Noble.

Have the Web-exposed interfaces guarded by ENABLE_LEGACY_ENCRYPTED_MEDIA also use
the WebKit prefix in the implementations. This will prevent conflicts between
interfaces with same names in both the legacy API and the future EME API.

Most of the interfaces in this legacy API already used the WebKit prefix when
exposed via JS bindings. The only exception is MediaKeyNeededEvent, which gets
prefixed in this patch.

The interface implementations for this legacy API are also moved under the
Modules/encryptedmedia/legacy/ directory.

No new tests -- covered by existing tests (with the relevant changes reflected
in the updated baselines).

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/encryptedmedia/CDM.cpp:
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::generateKeyRequest):
(WebCore::CDMSessionClearKey::update):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp.
(WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
(WebCore::WebKitMediaKeyMessageEvent::~WebKitMediaKeyMessageEvent):
(WebCore::WebKitMediaKeyMessageEvent::eventInterface):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h.
(WebCore::WebKitMediaKeyMessageEvent::create):
(WebCore::WebKitMediaKeyMessageEvent::createForBindings):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl.
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp.
(WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
(WebCore::WebKitMediaKeyNeededEvent::~WebKitMediaKeyNeededEvent):
(WebCore::WebKitMediaKeyNeededEvent::eventInterface):
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h.
(WebCore::WebKitMediaKeyNeededEvent::create):
(WebCore::WebKitMediaKeyNeededEvent::createForBindings):
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.idl.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp.
(WebCore::WebKitMediaKeySession::create):
(WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
(WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
(WebCore::WebKitMediaKeySession::setError):
(WebCore::WebKitMediaKeySession::close):
(WebCore::WebKitMediaKeySession::cachedKeyForKeyId):
(WebCore::WebKitMediaKeySession::sessionId):
(WebCore::WebKitMediaKeySession::generateKeyRequest):
(WebCore::WebKitMediaKeySession::keyRequestTimerFired):
(WebCore::WebKitMediaKeySession::update):
(WebCore::WebKitMediaKeySession::addKeyTimerFired):
(WebCore::WebKitMediaKeySession::sendMessage):
(WebCore::WebKitMediaKeySession::sendError):
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
(WebCore::WebKitMediaKeySession::hasPendingActivity):
(WebCore::WebKitMediaKeySession::stop):
(WebCore::WebKitMediaKeySession::activeDOMObjectName):
(WebCore::WebKitMediaKeySession::canSuspendForDocumentSuspension):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.h.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp.
(WebCore::WebKitMediaKeys::create):
(WebCore::WebKitMediaKeys::WebKitMediaKeys):
(WebCore::WebKitMediaKeys::~WebKitMediaKeys):
(WebCore::WebKitMediaKeys::createSession):
(WebCore::WebKitMediaKeys::isTypeSupported):
(WebCore::WebKitMediaKeys::setMediaElement):
(WebCore::WebKitMediaKeys::cdmMediaPlayer):
(WebCore::WebKitMediaKeys::keyAdded):
(WebCore::WebKitMediaKeys::cachedKeyForKeyId):
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.h.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.idl.
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
(WebCore::HTMLMediaElement::setMediaKeys):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::keys):
* html/HTMLMediaElement.idl:
* html/WebKitMediaKeyError.h: Renamed from Source/WebCore/html/MediaKeyError.h.
(WebCore::WebKitMediaKeyError::create):
(WebCore::WebKitMediaKeyError::WebKitMediaKeyError):
* html/WebKitMediaKeyError.idl: Renamed from Source/WebCore/html/MediaKeyError.idl.
* testing/MockCDM.cpp:
(WebCore::MockCDMSession::generateKeyRequest):
(WebCore::MockCDMSession::update):

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

3 years agoRemove stale ENABLE(ENCRYPTED_MEDIA) code in HTMLMediaElement
zandobersek@gmail.com [Mon, 10 Oct 2016 06:19:12 +0000 (06:19 +0000)]
Remove stale ENABLE(ENCRYPTED_MEDIA) code in HTMLMediaElement
https://bugs.webkit.org/show_bug.cgi?id=163111

Reviewed by Alex Christensen.

Remove three method implementations in HTMLMediaElement which had their
declarations and the related WebIDL entries removed in the first ENCRYPTED_MEDIA
purge in r206440.

No new tests -- no changes in behavior.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::webkitGenerateKeyRequest): Deleted.
(WebCore::HTMLMediaElement::webkitAddKey): Deleted.
(WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.

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

3 years agoUnreviewed, EFL Gardening on Oct. 10th - 2
gyuyoung.kim@webkit.org [Mon, 10 Oct 2016 05:34:11 +0000 (05:34 +0000)]
Unreviewed, EFL Gardening on Oct. 10th - 2

Mark missing test to Skip because the tests aren't supported by EFL yet.
Unskip passing tests and add *PASS* to some flaky tests because I guess
it is still flaky.

Patch by Gyuyoung Kim <gyuyoung.kim@navercorp.com> on 2016-10-09

* platform/efl/TestExpectations:

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

3 years agoMake validate-committer-lists show inactive reviewers
simon.fraser@apple.com [Mon, 10 Oct 2016 05:22:09 +0000 (05:22 +0000)]
Make validate-committer-lists show inactive reviewers
https://bugs.webkit.org/show_bug.cgi?id=163193

Reviewed by Sam Weinig.

In preparation for updating contributors.json with the WebKit policy of retiring
inactive reviewers, make validate-committer-lists show the list of reviewers who
have not reviewed in the past year.

This list is computed by grepping the output of 'git log --since=1.year" for
the reviewer line, and looking up reviewers via Contributor.mentioned_in_text(),
which looks for full names, aliases, irc nicks and email addresses.

Support for aliases is added to Contributor. Aliases are alternates
or misspellings of the reviewer's name. Some common aliases were added to
contributors.json by manual examination of "Reviewed by" lines.

* Scripts/validate-committer-lists:
(CommitterListFromGit.possibly_expired_committers):
(CommitterListFromGit):
(CommitterListFromGit.possibly_inactive_reviewers):
(CommitterListFromGit.print_possibly_expired_committers):
(CommitterListFromGit.print_possibly_inactive_reviewers):
* Scripts/webkitpy/common/config/committers.py:
(Contributor.__init__):
(Contributor.contains_string):
(Contributor.mentioned_in_text):
(Contributor.as_dict):
(Committer.__init__):
(Reviewer.__init__):
(CommitterList.load_json):
* Scripts/webkitpy/common/config/contributors.json:

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

3 years agoSupport InputEvent.inputType for the new InputEvent spec
wenson_hsieh@apple.com [Mon, 10 Oct 2016 03:11:20 +0000 (03:11 +0000)]
Support InputEvent.inputType for the new InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163025
<rdar://problem/28658092>

Reviewed by Darin Adler.

Source/WebCore:

Adds support for the inputType attribute of InputEvent. To do this, we introduce a helper to
map EditActions to inputType names, and also split out ambiguous EditActions (such as
EditActionTyping) into more specific subtypes (such as EditActionTypingDeleteBackward,
EditActionTypingInsertParagraph, etc.), each of which corresponds to an inputType.

In places where we create CompositeEditCommands, we now pass in these specific EditActions
where appropriate, and when dispatching `beforeinput` and `input` events, we ask the
CompositeEditCommand for its input type name, which it derives from its editingAction.

Tests: fast/events/before-input-prevent-biu.html
       fast/events/before-input-prevent-cut.html
       fast/events/before-input-prevent-paste.html
       fast/events/before-input-prevent-typing.html
       fast/events/before-input-prevent-undo.html

* dom/InputEvent.h:
* dom/Node.cpp:
(WebCore::Node::dispatchInputEvent):
* dom/Node.h:
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::inputEventTypeName):

Allows a CompositeEditCommand to specify the inputType its corresponding `beforeinput` and `input` events
should have.

* editing/CompositeEditCommand.h:
(WebCore::CompositeEditCommand::shouldStopCaretBlinking): Deleted.
* editing/EditAction.h:
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
* editing/EditCommand.h:
* editing/Editor.cpp:
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::willUnapplyEditing):
(WebCore::Editor::unappliedEditing):
(WebCore::Editor::willReapplyEditing):
(WebCore::Editor::reappliedEditing):
(WebCore::Editor::computeAndSetTypingStyle):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::editingAction):
* editing/InsertListCommand.h:
(WebCore::InsertListCommand::preservesTypingStyle): Deleted.
(WebCore::InsertListCommand::editingAction): Deleted.
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand):
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
* editing/TypingCommand.cpp:
(WebCore::editActionForTypingCommand):
(WebCore::TypingCommand::TypingCommand):
(WebCore::TypingCommand::inputEventTypeName):

The editingAction() of a TypingCommand is the first editing action the TypingCommand was initialized using.
Since subsequent typing commands update the last open typing command, we override inputEventTypeName here to
use the last updated editing action rather than the default (initial) editing action.

(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
(WebCore::TypingCommand::insertParagraphSeparator):
* editing/TypingCommand.h:

Source/WebKit/mac:

Accounts for some changes to the EditAction enum in nameForEditAction. See WebCore ChangeLog
entry for more details.

* WebCoreSupport/WebEditorClient.mm:
(undoNameForEditAction):

Source/WebKit/win:

* WebCoreSupport/WebEditorClient.cpp:
(undoNameForEditAction):

Source/WebKit2:

Accounts for some changes to the EditAction enum in nameForEditAction. Some former edit
actions, such as EditActionTyping, have been split out into its more specific subtypes,
so we preserve shipping behavior by treating all of the new subtypes the same way as the
original type.

* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction):

LayoutTests:

Adds new layout tests to check that various actions, such as cutting, pasting and undoing can
be prevented via the InputEvent fired in a `beforechange` handler.

* fast/events/before-input-prevent-biu-expected.txt: Added.
* fast/events/before-input-prevent-biu.html: Added.
* fast/events/before-input-prevent-cut-expected.txt: Added.
* fast/events/before-input-prevent-cut.html: Added.
* fast/events/before-input-prevent-paste-expected.txt: Added.
* fast/events/before-input-prevent-paste.html: Added.
* fast/events/before-input-prevent-typing-expected.txt: Added.
* fast/events/before-input-prevent-typing.html: Added.
* fast/events/before-input-prevent-undo-expected.txt: Added.
* fast/events/before-input-prevent-undo.html: Added.
* platform/ios-simulator/TestExpectations:

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

3 years ago[EFL] Gardening timout tests, failure tests on Oct. 10th.
gyuyoung.kim@webkit.org [Mon, 10 Oct 2016 02:19:32 +0000 (02:19 +0000)]
[EFL] Gardening timout tests, failure tests on Oct. 10th.

Unreviewed EFL gardening.

Patch by Gyuyoung Kim <gyuyoung.kim@navercorp.com> on 2016-10-09

* platform/efl/TestExpectations:

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

3 years agoMove ApplePaySession from legacy to new DOM exceptions
darin@apple.com [Mon, 10 Oct 2016 02:14:05 +0000 (02:14 +0000)]
Move ApplePaySession from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163191

Reviewed by Sam Weinig.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::create): Use ExceptionOr.
(WebCore::ApplePaySession::ApplePaySession): Moved initialization
of two of the data members to class definition.
(WebCore::ApplePaySession::supportsVersion): Use ExceptionOr.
(WebCore::ApplePaySession::canMakePayments): Ditto.
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard): Ditto.
(WebCore::ApplePaySession::openPaymentSetup): Ditto.
(WebCore::ApplePaySession::begin): Ditto.
(WebCore::ApplePaySession::abort): Ditto.
(WebCore::ApplePaySession::completeMerchantValidation): Ditto.
(WebCore::ApplePaySession::completeShippingMethodSelection): Ditto.
(WebCore::ApplePaySession::completeShippingContactSelection): Ditto.
(WebCore::ApplePaySession::completePaymentMethodSelection): Ditto.
(WebCore::ApplePaySession::completePayment): Ditto.
(WebCore::ApplePaySession::validateMerchant): Use auto and get instead of
using a RefPtr type and * for event dispatching.
(WebCore::ApplePaySession::didAuthorizePayment): Ditto.
(WebCore::ApplePaySession::didSelectShippingMethod): Ditto.
(WebCore::ApplePaySession::didSelectShippingContact): Ditto.
(WebCore::ApplePaySession::didSelectPaymentMethod): Ditto.
(WebCore::ApplePaySession::didCancelPayment): Ditto.
(WebCore::ApplePaySession::paymentCoordinator): Moved dereferencing
inside the downcast.

* Modules/applepay/ApplePaySession.h: Updated for changes above.

* Modules/applepay/ApplePaySession.idl: Use MayThrowException.

* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
Use propagateException.
(WebCore::JSApplePaySession::completeShippingContactSelection): Ditto.
(WebCore::JSApplePaySession::completePaymentMethodSelection): Ditto.

* bindings/js/JSDOMBinding.h: Added implementation of toJSBoolean.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition): Generate the different arguments for
toJSNewlyCreated when ConstructorMayThrowException is specified that
activate the version of that function that handles exceptions.

* bindings/scripts/IDLAttributes.txt: Added ConstructorMayThrowException.

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

3 years agoReplace all uses of ExceptionCodeWithMessage with WebCore::Exception
darin@apple.com [Mon, 10 Oct 2016 02:13:28 +0000 (02:13 +0000)]
Replace all uses of ExceptionCodeWithMessage with WebCore::Exception
https://bugs.webkit.org/show_bug.cgi?id=163178

Reviewed by Sam Weinig.

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::stringToDirection): Return an Optional instead of
using an ExceptionCode out argument, since this function just needs to
indicate failure, not actually throw an exception.
(WebCore::IDBCursor::update): Return ExceptionOr instead of using an
ExceptionCodeWithMessage out argument.
(WebCore::IDBCursor::advance): Ditto.
(WebCore::IDBCursor::continueFunction): Ditto.
(WebCore::IDBCursor::deleteFunction): Ditto.
* Modules/indexeddb/IDBCursor.h: Updated for above changes.

* Modules/indexeddb/IDBCursor.idl: Sorted extended attributes alphabetically.
Use MayThrowException instead of MayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBDatabase::transaction): Ditto.
(WebCore::IDBDatabase::deleteObjectStore): Ditto.
* Modules/indexeddb/IDBDatabase.h: Updated for above changes.

* Modules/indexeddb/IDBDatabase.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::open): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBFactory::openInternal): Ditto.
(WebCore::IDBFactory::deleteDatabase): Ditto.
(WebCore::IDBFactory::cmp): Ditto.
* Modules/indexeddb/IDBFactory.h: Updated for above changes.

* Modules/indexeddb/IDBFactory.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::openCursor): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBIndex::count): Ditto.
(WebCore::IDBIndex::doCount): Ditto.
(WebCore::IDBIndex::openKeyCursor): Ditto.
(WebCore::IDBIndex::get): Ditto.
(WebCore::IDBIndex::doGet): Ditto.
(WebCore::IDBIndex::getKey): Ditto.
(WebCore::IDBIndex::doGetKey): Ditto.
* Modules/indexeddb/IDBIndex.h: Updated for above changes.

* Modules/indexeddb/IDBIndex.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::only): Return ExceptionOr instead of
using an ExceptionCode out argument.
(WebCore::IDBKeyRange::lowerBound): Ditto.
(WebCore::IDBKeyRange::upperBound): Ditto.
(WebCore::IDBKeyRange::bound): Ditto.
* Modules/indexeddb/IDBKeyRange.h: Updated for above changes.
* Modules/indexeddb/IDBKeyRange.idl: Use MayThrowException instead of
MayThrowLegacyException.

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBObjectStore::get): Ditto.
(WebCore::IDBObjectStore::add): Ditto.
(WebCore::IDBObjectStore::put): Ditto.
(WebCore::IDBObjectStore::putForCursorUpdate): Ditto.
(WebCore::IDBObjectStore::putOrAdd): Ditto.
(WebCore::IDBObjectStore::deleteFunction): Ditto.
(WebCore::IDBObjectStore::doDelete): Ditto.
(WebCore::IDBObjectStore::clear): Ditto.
(WebCore::IDBObjectStore::createIndex): Ditto.
(WebCore::IDBObjectStore::index): Ditto.
(WebCore::IDBObjectStore::deleteIndex): Ditto.
(WebCore::IDBObjectStore::count): Ditto.
(WebCore::IDBObjectStore::doCount): Ditto.
* Modules/indexeddb/IDBObjectStore.h: Updated for above changes.

* Modules/indexeddb/IDBObjectStore.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::errorCode): Deleted. Was dead code.
(WebCore::IDBRequest::error): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
* Modules/indexeddb/IDBRequest.h: Updated for above changes.

* Modules/indexeddb/IDBRequest.idl: Use GetterMayThrowException instead of
GetterMayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::stringToMode): Return an Optional instead of
using an ExceptionCode out argument, since this function just needs to
indicate failure, not actually throw an exception.
(WebCore::IDBTransaction::db): Tweaked code a bit.
(WebCore::IDBTransaction::error): Return a pointer instead of a RefPtr.
(WebCore::IDBTransaction::objectStore): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBTransaction::abortDueToFailedRequest): Call internalAbort.
(WebCore::IDBTransaction::abort): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBTransaction::internalAbort): Added a version that asserts
instead of throwing an exception for internal use.
(WebCore::IDBTransaction::stop): Call internalAbort.
* Modules/indexeddb/IDBTransaction.h: Updated for above changes.

* Modules/indexeddb/IDBTransaction.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::openDatabase): Updated to return
a Ref instead of a RefPtr, since the function can never return null.
(WebCore::IDBClient::IDBConnectionProxy::deleteDatabase): Ditto.
* Modules/indexeddb/client/IDBConnectionProxy.h: Updated for above changes.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask): Updated
exception handling to use ExceptionOr instead of ExceptionCodeWithMessage.
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask): Ditto.
* Modules/mediastream/MediaEndpointSessionDescription.cpp:
(WebCore::MediaEndpointSessionDescription::create): Ditto.
* Modules/mediastream/MediaEndpointSessionDescription.h: Updated for above change.

* bindings/js/JSDOMBinding.cpp:
(WebCore::createDOMException): Added overload for Exception.
(WebCore::throwDOMException): Deleted overload for ExceptionCodeWithMessage.
Updated code to call the new createDOMException function.
(WebCore::setDOMExceptionSlow): Ditto.
(WebCore::setDOMException): Ditto.

* bindings/js/JSDOMBinding.h: Added overload of createDOMException that takes
an Exception. Deleted functions dealing with ExceptionCodeWithMessage. Fixed
interface of toJSNumber and toJSNullableNumber and implemented toJSNumber.

* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::reject): Added overload that takes an Exception.
* bindings/js/JSDOMPromise.h: Updated for above change.

* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState): Use propagateException to deal with
ExceptionOr instead of ExceptionCodeWithMessage.
(WebCore::JSHistory::replaceState): Ditto.

* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::createObjectStore): Use toJS and
to deal with ExceptionOr rather than setDOMException to deal
with ExceptionCodeWithMessage.

* bindings/js/JSIDBRequestCustom.cpp:
(WebCore::JSIDBRequest::result): Use propagateException and
Exception rather than setDOMException and ExceptionCodeWithMessage.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Removed support for GetterMayThrowLegacyExceptionWithMessage,
SetterMayThrowLegacyExceptionWithMessage, and MayThrowLegacyExceptionWithMessage.
(GenerateReturnParameters): Ditto.
(GenerateImplementationFunctionCall): Ditto.
(GenerateConstructorDefinition): Ditto.

* bindings/scripts/IDLAttributes.txt: Removed GetterMayThrowLegacyExceptionWithMessage,
SetterMayThrowLegacyExceptionWithMessage, and MayThrowLegacyExceptionWithMessage.

* bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
* bindings/scripts/test/TestObj.idl: Removed tests cases for now-removed attributes.

* dom/CustomElementRegistry.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.

* dom/ExceptionCode.h: Removed ExceptionCodeWithMessage. Also updated to use pragma
once, removed include of WTFString.h and switched to using instead of typedef.

* history/HistoryItem.h: Return a pointer instead of a RefPtr from stateObject
to cut down a little on unnecessary reference count churn.

* inspector/InspectorIndexedDBAgent.cpp: Updated all the code that uses IDB
classes to use the new versions rather than the old ExceptionCodeWithMessage versions.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::history): Pass a reference instead of a pointer.

* page/History.cpp:
(WebCore::History::History): Take a reference instead of a pointer.
(WebCore::History::length): Tweaked to use a local variable.
(WebCore::History::state): Return a pointer instead of a PassRefPtr.
(WebCore::History::stateInternal): Ditto. Also use early return consistently.
(WebCore::History::isSameAsCurrentState): Updated for above change.
(WebCore::History::stateObjectAdded): Return ExceptionOr rather than taking an
ExceptionCodeWithMessage out argument.

* page/History.h: Use pragma once. Removed some unneeded includes. Marked class final.
Updated for changes above.

* page/History.idl: Use MayThrowException instead of MayThrowLegacyException.

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

3 years agoREGRESSION(r165103): labels list doesn't get invalidated when other lists are invalid...
rniwa@webkit.org [Mon, 10 Oct 2016 02:03:35 +0000 (02:03 +0000)]
REGRESSION(r165103): labels list doesn't get invalidated when other lists are invalidated at document level
https://bugs.webkit.org/show_bug.cgi?id=163145

Reviewed by Darin Adler.

Source/WebCore:

The bug was caused by Document::invalidateNodeListAndCollectionCaches removing all node lists regardless
of whether they have been invalidated or not.

Fixed the bug by removing only those node lists that got invalidated via LiveNodeList::invalidateCache.

Test: fast/dom/NodeList/form-labels-length.html

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::unregisterNodeListForInvalidation): Removed the conditional which allowed removal to
happen while m_listsInvalidatedAtDocument is empty inside invalidateNodeListAndCollectionCaches.
* dom/Document.h:
* dom/Node.cpp:
(WebCore::Document::invalidateNodeListAndCollectionCaches): Just remove the node lists being invalidated via
LiveNodeList's invalidateCache, which calls unregisterNodeListForInvalidation, instead of removing them all.
We make a copy of the list of node lists into a local vector because mutating HashMap while iterating over it
is not a safe operation.

LayoutTests:

Added a regression test.

* fast/dom/NodeList/form-labels-length-expected.txt: Added.
* fast/dom/NodeList/form-labels-length.html: Added.

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

3 years agoUpdate generated bindings code so that dictionary structures no longer need explicit...
cdumez@apple.com [Mon, 10 Oct 2016 01:16:05 +0000 (01:16 +0000)]
Update generated bindings code so that dictionary structures no longer need explicit constructors
https://bugs.webkit.org/show_bug.cgi?id=163188

Reviewed by Darin Adler.

Update generated bindings code so that dictionary structures no longer
need explicit constructors. We now call the default constructor and
then initialize the members one by one.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::convertDictionary<TestObj::ParentDictionary>):
(WebCore::convertDictionary<TestObj::ChildDictionary>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<TestStandaloneDictionary>):
* dom/ClipboardEvent.h:
* dom/CustomEvent.h:
* dom/EventInit.h:
(WebCore::EventInit::EventInit): Deleted.
* dom/EventModifierInit.h:
(WebCore::EventModifierInit::EventModifierInit): Deleted.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/UIEventInit.h:
(WebCore::UIEventInit::UIEventInit): Deleted.
* editing/Editor.cpp:
(WebCore::Editor::dispatchCPPEvent):

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

3 years agoConvert contributors.json to a flat list
simon.fraser@apple.com [Mon, 10 Oct 2016 00:45:20 +0000 (00:45 +0000)]
Convert contributors.json to a flat list
https://bugs.webkit.org/show_bug.cgi?id=163183

Reviewed by Darin Adler.

Make contributors.json easier to maintain by eliminating the big groupings ("Committers", "Reviewers" etc)
and moving that data to a "status" property on each contributor.
Tools:

* Scripts/webkitpy/common/config/committers.py:
(Contributor.__eq__): Implement this to fix unit tests, now that load_json() is not @memoized.
(Contributor.as_dict): Include status in the dict.
(CommitterList.__init__): Clean up to make the testing code path more explicit.
(CommitterList.load_json):
(CommitterList.load_test_data):
(CommitterList.as_json):
(Contributor.__unicode__): Deleted.
* Scripts/webkitpy/common/config/contributors.json:
* Scripts/webkitpy/tool/bot/irc_command_unittest.py:
(IRCCommandTest.test_whois): The ordering here is now alphabetical.

Websites/bugs.webkit.org:

Fix script that does bugzilla autocomplete.

* committers-autocomplete.js:
(statusToType):
(parseCommittersPy):
(parseType): Deleted.

Websites/webkit.org:

Fix script that generates webkit.org/team.

* wp-content/themes/webkit/team.php:

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

3 years ago[CMake] CMake does not support the dep files for implicit dependency
commit-queue@webkit.org [Mon, 10 Oct 2016 00:38:06 +0000 (00:38 +0000)]
[CMake] CMake does not support the dep files for implicit dependency
https://bugs.webkit.org/show_bug.cgi?id=161433

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2016-10-09
Reviewed by Brent Fulgham.

Created a Perl script to generate all IDL bindings for CMake.
This script can regenerate outdated bindings by based on the
supplemental dependency and dep files created by
'--write-dependencies' switch of generate-bindings.pl.

add_custom_target is used to invoke the script instead of
add_custom_command because Ninja deletes all output files before
executing the command in case of add_custom_command.

USES_TERMINAL option of add_custom_target has two effects:
1) Not buffering output of the command
2) Invoking the command in the special Ninja pool which inhibits parallel build
One needs to use CMake 3.2 or later to enable this feature.

.:

* Source/cmake/WebKitMacros.cmake (GENERATE_BINDINGS): Included
ProcessorCount.  Added a new argument 'target'.  Use
add_custom_target instead of add_custom_command.  Invoke the new
script.

Source/WebCore:

* CMakeLists.txt: Specified target names for
GENERATE_BINDINGS. Added dependency for the targets.
* bindings/scripts/generate-bindings-all.pl: Added.

Tools:

* DumpRenderTree/CMakeLists.txt: Specified a target name for
GENERATE_BINDINGS. Added dependency for the target.
* WebKitTestRunner/CMakeLists.txt: Ditto.

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

3 years agoUpdate KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
cdumez@apple.com [Sun, 9 Oct 2016 23:11:56 +0000 (23:11 +0000)]
Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163176

Reviewed by Darin Adler.

Source/WebCore:

Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
and use a proper constructor instead, like in the specification:
- https://www.w3.org/TR/uievents/#interface-keyboardevent

Also add support for passing modifierAltGraph / modifierCapsLock
in the inialization dictionary as we support those modifiers via
getModifierState().

No new tests, extended existing test.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventModifierInit.h: Added.
(WebCore::EventModifierInit::EventModifierInit):
* dom/EventModifierInit.idl: Added.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::getModifierState):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
* dom/MouseRelatedEvent.h:
* dom/UIEvent.cpp:
(WebCore::UIEvent::UIEvent):
* dom/UIEvent.h:
(WebCore::UIEvent::create): Deleted.
* dom/UIEventInit.h: Added.
(WebCore::UIEventInit::UIEventInit):
* dom/UIEventInit.idl: Added.
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::altGraphKey):
(WebCore::UIEventWithKeyState::capsLockKey):
(WebCore::UIEventWithKeyState::UIEventWithKeyState):
(WebCore::UIEventWithKeyState::ctrlKey): Deleted.
(WebCore::UIEventWithKeyState::shiftKey): Deleted.
(WebCore::UIEventWithKeyState::altKey): Deleted.
(WebCore::UIEventWithKeyState::metaKey): Deleted.

LayoutTests:

Rebaseline existing test now that the exception message is slightly
different in some cases. Also add test coverage for passing
modifierAltGraph / modifierCapsLock in initialization dictionary.

* fast/events/constructors/keyboard-event-constructor-expected.txt:
* fast/events/constructors/keyboard-event-constructor.html:

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

3 years agoAdd support for canonicalizing contributors.json, and have check-webkit-style check...
simon.fraser@apple.com [Sun, 9 Oct 2016 22:47:57 +0000 (22:47 +0000)]
Add support for canonicalizing contributors.json, and have check-webkit-style check the format.
https://bugs.webkit.org/show_bug.cgi?id=163177

Follow-up fix.

For unknown reasons, overriding Commiter.__dict__() caused mysterious test failures.
Rename it to as_dict().

* Scripts/webkitpy/common/config/committers.py:
(Contributor.as_dict):
(CommitterList._contributor_list_to_dict):
(Contributor.__dict__): Deleted.

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

3 years ago[GTK] Miscellaneous unreviewed test gardening
mcatanzaro@igalia.com [Sun, 9 Oct 2016 20:47:47 +0000 (20:47 +0000)]
[GTK] Miscellaneous unreviewed test gardening

* platform/gtk/TestExpectations:

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

3 years ago[GTK] Skip new custom elements tests, they're all failing
mcatanzaro@igalia.com [Sun, 9 Oct 2016 19:19:19 +0000 (19:19 +0000)]
[GTK] Skip new custom elements tests, they're all failing

* platform/gtk/TestExpectations:

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

3 years agoAdd support for canonicalizing contributors.json, and have check-webkit-style check...
simon.fraser@apple.com [Sun, 9 Oct 2016 16:34:53 +0000 (16:34 +0000)]
Add support for canonicalizing contributors.json, and have check-webkit-style check the format.
https://bugs.webkit.org/show_bug.cgi?id=163177

Reviewed by Ryosuke Niwa.

Make it possible to round-trip contributors.json through CommitterList, so we can
support writing out contributors.json in canonical format. This requires saving
the case-preserved email and expertise in Contributor. CommitterList also needs
to be able to generate the "exclusive" lists, since it currently uses lists
that are the union of, say, committers and reviewers.

If contributors.json is malformed (invalid JSON), catch the Exception, report it
and exit rather than allowing the exception to propagate. With an invalid file,
an exception would be thrown before the JSON style checker reached this file, so
the error was not correctly reported.

Add style/checker/committer.py for checking that committers.json has the canonical format.

Add support to validate-committer-lists to dump out the canonical json (-d) or update
the file in-place (-c).

* Scripts/validate-committer-lists:
(CommitterListFromGit._print_three_column_row):
(CommitterListFromGit.possibly_expired_committers):
(CommitterListFromGit):
(CommitterListFromGit.print_possibly_expired_committers):
(main):
* Scripts/webkitpy/common/config/committers.py:
(Contributor.__init__):
(Contributor.__dict__):
(Committer.__init__):
(Reviewer.__init__):
(CommitterList.load_json):
(CommitterList):
(CommitterList._contributor_list_to_dict):
(CommitterList.as_json):
(CommitterList.reformat_in_place):
(CommitterList._exclusive_contributors):
(CommitterList._exclusive_committers):
(Contributor.matches_glob): Deleted.
(CommitterList.contributors): Deleted.
* Scripts/webkitpy/common/config/contributors.json:
* Scripts/webkitpy/style/checker.py:
(CheckerDispatcher._create_checker):
* Scripts/webkitpy/style/checkers/contributors.py: Added.
(ContributorsChecker):
(ContributorsChecker.__init__):
(ContributorsChecker.check):
(ContributorsChecker._unidiff_output):

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

3 years agoPromise attribute getters should reject promises in case of casted-this errors
commit-queue@webkit.org [Sun, 9 Oct 2016 07:34:08 +0000 (07:34 +0000)]
Promise attribute getters should reject promises in case of casted-this errors
https://bugs.webkit.org/show_bug.cgi?id=163167

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-09
Reviewed by Darin Adler.

Source/WebCore:

Covered by updated test and binding test.

* bindings/js/JSDOMBinding.cpp:
(WebCore::throwGetterTypeError):
(WebCore::rejectPromiseWithGetterTypeError): Added to reject promises for attribute getters
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::attribute): Introducing promise rejection for type cast errors.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp: Rebased test. As can be seen, only custom promise attributes are supported.
(WebCore::jsTestObjTestReadOnlyPromiseAttribute):
(WebCore::jsTestObjTestReadOnlyPromiseAttributeGetter):
* bindings/scripts/test/TestObj.idl:

LayoutTests:

* fast/text/font-face-set-javascript-expected.txt:
* fast/text/font-face-set-javascript.html:

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

3 years agoSource/WebCore:
cdumez@apple.com [Sun, 9 Oct 2016 04:17:26 +0000 (04:17 +0000)]
Source/WebCore:
[Mac] Write WebArchive to the pasteboard when copying image in WebKit
https://bugs.webkit.org/show_bug.cgi?id=163100

Reviewed by Darin Adler.

Write WebArchive to the pasteboard when copying image in WebKit. This
fixes pasting such images to a content editable field in WebKit because
Web archives take priority over RTFD when reading from the pasteboard
in WebKit.

Using RTFD when pasting the image in WebKit was causing issues because:
1. The pasted image would not be displayed because our RTFD import code
   is buggy.
2. The pasted image URL was a webkit-fake-url://
3. Formatting associated to the image (e.g. inline style) would be lost

No new tests, unskipped existing test on WebKit2.

* editing/Editor.h:
* editing/mac/EditorMac.mm:
(WebCore::Editor::imageInWebArchiveFormat):
(WebCore::Editor::writeImageToPasteboard):
* platform/Pasteboard.h:
* platform/mac/PasteboardMac.mm:
(WebCore::writableTypesForImage):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::Pasteboard): Deleted.
(WebCore::Pasteboard::createForCopyAndPaste): Deleted.

LayoutTests:
[Mac] Write HTML to the pasteboard when copying image in WebKit
https://bugs.webkit.org/show_bug.cgi?id=163100

Reviewed by Darin Adler.

Convert editing/pasteboard/copy-standalone-image.html into a ref test
and unskip on WebKit2 now that it passes there as well. Before this
patch, the test would fail on WebKit2 (the pasted image would not be
displayed).

* editing/pasteboard/copy-standalone-image-expected.html: Added.
* editing/pasteboard/copy-standalone-image.html:
* platform/gtk/editing/pasteboard/copy-standalone-image-expected.png: Removed.
* platform/gtk/editing/pasteboard/copy-standalone-image-expected.txt: Removed.
* platform/ios-simulator-wk2/editing/pasteboard/copy-standalone-image-expected.png: Removed.
* platform/ios-simulator/editing/pasteboard/copy-standalone-image-expected.txt: Removed.
* platform/mac/editing/pasteboard/copy-standalone-image-expected.png: Removed.
* platform/mac/editing/pasteboard/copy-standalone-image-expected.txt: Removed.
* platform/win/editing/pasteboard/copy-standalone-image-expected.txt: Removed.
* platform/wk2/TestExpectations:

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

3 years agoUpdate CustomEvent to stop using legacy [ConstructorTemplate=Event]
cdumez@apple.com [Sun, 9 Oct 2016 03:46:39 +0000 (03:46 +0000)]
Update CustomEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163174

Reviewed by Darin Adler.

Source/WebCore:

Update CustomEvent to stop using legacy [ConstructorTemplate=Event] and
use an actual constructor instead, like in the specification:
- https://dom.spec.whatwg.org/#interface-customevent

There is a very minor behavior change when explictly passing undefined
as detail value in CustomEventInit. We used to initialize detail to
undefined but we now initialize it to null instead, which is its default
value. The new behavior matches the one of Chrome and Firefox.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
* bindings/scripts/test/TestObj.idl:
* dom/CustomEvent.cpp:
(WebCore::CustomEvent::CustomEvent):
* dom/CustomEvent.h:
* dom/CustomEvent.idl:
* dom/Document.cpp:
(WebCore::Document::createEvent):
* dom/Event.cpp:
(WebCore::Event::Event):
* dom/Event.h:

LayoutTests:

Update existing layout test to reflect minor behavior change.

* fast/events/constructors/custom-event-constructor-expected.txt:
* fast/events/constructors/custom-event-constructor.html:

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

3 years agoAdd support for ClipboardEvent
cdumez@apple.com [Sun, 9 Oct 2016 00:03:14 +0000 (00:03 +0000)]
Add support for ClipboardEvent
https://bugs.webkit.org/show_bug.cgi?id=163164

Reviewed by Darin Adler.

Source/WebCore:

Add support for ClipboardEvent:
- https://www.w3.org/TR/clipboard-apis/#clipboard-event-interfaces

Firefox and Chrome both already support this.

This gives us 5 more points on html5test.com.

Tests: editing/pasteboard/clipboard-event.html
       fast/events/clipboard-event-constructor.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSEventCustom.cpp:
(WebCore::toJSNewlyCreated): Deleted.

* bindings/scripts/CodeGeneratorJS.pm:
(WillConvertUndefinedToDefaultParameterValue):
We use [] as implicit default value for dictionary parameters. This change
is so we call convertDictionary<>() even if the parameter is undefined
because we want to pass a struct to the implementation initialized with
the default member values defined in the IDL.

* dom/ClipboardEvent.cpp:
(WebCore::ClipboardEvent::ClipboardEvent):
(WebCore::ClipboardEvent::eventInterface):
* dom/ClipboardEvent.h:
* dom/ClipboardEvent.idl: Added.
* dom/Event.cpp:
(WebCore::Event::Event):
* dom/Event.h:
* dom/Event.idl:
* dom/EventInit.h: Added.
* dom/EventInit.idl: Added.
* dom/EventNames.in:
* dom/MouseEvent.h:
(WebCore::MouseEvent::dataTransfer):
* editing/Editor.cpp:
(WebCore::Editor::dispatchCPPEvent):

LayoutTests:

Extended layout test coverage.

* editing/pasteboard/clipboard-event-expected.txt: Added.
* editing/pasteboard/clipboard-event.html: Added.
* fast/events/clipboard-event-constructor-expected.txt: Added.
* fast/events/clipboard-event-constructor.html: Added.
* fast/xmlhttprequest/xmlhttprequest-get-expected.txt:
* http/tests/workers/worker-importScriptsOnError-expected.txt:
* inspector/model/remote-object-get-properties-expected.txt:
* js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:

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

3 years agoMarking js/regress-141098.html as flaky on mac.
ryanhaddad@apple.com [Sat, 8 Oct 2016 23:17:05 +0000 (23:17 +0000)]
Marking js/regress-141098.html as flaky on mac.
https://bugs.webkit.org/show_bug.cgi?id=163046

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years ago[GTK] Drop redundant wl_display_flush_clients() call
commit-queue@webkit.org [Sat, 8 Oct 2016 23:12:17 +0000 (23:12 +0000)]
[GTK] Drop redundant wl_display_flush_clients() call
https://bugs.webkit.org/show_bug.cgi?id=161904

Patch by Emanuele Aina <emanuele.aina@collabora.com> on 2016-10-08
Reviewed by Michael Catanzaro.

The Wayland GSource::prepare() function already calls
wl_display_flush_clients() at every mainloop iteration, so there's no
need to further call it on Surface::commit().

* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::Surface::commit):
* UIProcess/gtk/WaylandCompositor.h:

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

3 years agoNext step on moving to modern way to return DOM exceptions
darin@apple.com [Sat, 8 Oct 2016 23:01:27 +0000 (23:01 +0000)]
Next step on moving to modern way to return DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163016

Reviewed by Ryosuke Niwa.

Source/WebCore:

* Modules/fetch/FetchRequest.idl:
Added MayThrowException to initializeWith since it throws an exception.

* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::invokeCallback):
* bindings/js/JSCustomSQLStatementErrorCallback.cpp:
(WebCore::JSSQLStatementErrorCallback::handleEvent):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
(WebCore::reportCurrentException):
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSMutationCallback.cpp:
(WebCore::JSMutationCallback::call):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::reportException):
Use JSC::Exception explicitly to avoid ambiguity with WebCore::Exception,
or in some cases use auto instead.

* bindings/js/JSDOMBinding.cpp:
(WebCore::hasUnpairedSurrogate): Factored this inline function out of valueToUSVString
for clarity.
(WebCore::createDOMException): Removed unused TRY_TO_CREATE_EXCEPTION macro.
(WebCore::propagateExceptionSlowPath): Added.
(WebCore::propagateException): Added.
(WebCore::setDOMException): Removed overload that takes an exception code and message
string separately; no longer needed.

* bindings/js/JSDOMBinding.h: Include the ExceptionOr header
rather than forward declaring. Added more of the ExceptionOr handling
functions; some just declared and not yet defined. Updated for changes
to ExceptionOr interface. Removed the createDOMException function that takes
only an exception code; not needed outside JSDOMBinding.cpp.

* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send): Rewrote this to use ExceptionOr instead
of ExceptionCode. Added some FIXMEs as well.
(WebCore::JSXMLHttpRequest::responseText): Ditto.
(WebCore::JSXMLHttpRequest::retrieveResponse): Ditto.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Fixed if statements to follow WebKit coding style
rather than using extra braces. Added call to propagateException for SetterMayThrowException.
(GenerateSerializerFunction): Fixed if statements as above.
(GenerateParametersCheck): Ditto. Also added call to propagateException for functions with
void return type and MayThrowException.
(GenerateReturnParameters): Tweaked coding style a bit.
(addIterableProperties): Fixed if statements as above.
(NativeToJSValue): Added code to handle various cases of GetterMayThrowException
and MayThrowException.
(GenerateConstructorDefinition): Used encodedJSValue() instead of
JSValue::encode(JSValue()), a longer way to say the same thing.

* bindings/scripts/IDLAttributes.txt: Added GetterMayThrowException,
MayThrowException, and SetterMayThrowException.

* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSattribute.cpp:
Regenerated results.

* bindings/scripts/test/TestObj.idl: Added some test cases.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType): Tweaked formatting.
(WebCore::DOMImplementation::createDocument): Ditto.

* dom/DOMImplementation.idl: Added MayThrowException to two functions since
I am abandoning, for now, the ability to throw exceptions without any extended
attribute in the IDL file. This feature may return at some point if we figure
out a way to do it for functions without return values as well as functions with.

* dom/Document.cpp:
(WebCore::Document::exitPointerLock): Rewrote to streamline logic.
(WebCore::Document::pointerLockElement): Ditto.
(WebCore::Document::inputCursor): Added. No need for this to be inlined.
(WebCore::Document::setInputCursor): Changed to take Ref&&.
(WebCore::Document::getSelection): Added. Moved here from TreeScope.

* dom/Document.h: Updated for above changes.

* dom/Document.idl: Tweaked formatting.

* dom/Exception.h: Merged the two constructors into one with a default
argument value, which should be equally efficient. Added releaseMessage function.
Added assertion that this is only created for actual exceptions with non-zero
ExceptionCode. Unlike ExceptionCode, which has a value of 0 which means no
exception, we do not create an Exception if there is no exception.

* dom/ExceptionOr.h: Renamed takeReturnValue to releaseReturnValue. Replaced
exceptionCode and exceptionMessage with releaseException. Added ExceptionOr<void>
specialization.

* dom/TreeScope.cpp:
(WebCore::TreeScope::~TreeScope): Removed code dealing with
m_selection, which is now in Document.
(WebCore::TreeScope::getSelection): Deleted.

* dom/TreeScope.h: Removed DOMSelection.

* page/DOMSelection.cpp:
(WebCore::selectionShadowAncestor): Changed to take a reference rather than
a guaranteed-non-null pointer.
(WebCore::DOMSelection::DOMSelection): Changed to take a Frame& instead of
of a TreeScope*.
(WebCore::DOMSelection::clearTreeScope): Deleted.
(WebCore::DOMSelection::isCollapsed): Updated call to selectionShadowAncestor.
(WebCore::DOMSelection::type): Took out obsolete uneeeded comment. Got rid
of case where this returns a null string. Use ASCIILiteral.
(WebCore::DOMSelection::rangeCount): Streamlined code.
(WebCore::DOMSelection::collapse): Removed redundant check of m_frame for
null which is already handled by the isValidForPosition function.
Removed non-helpful FIXME.
(WebCore::DOMSelection::collapseToEnd): Changed to use ExceptionOr instead of
ExceptionCode.
(WebCore::DOMSelection::collapseToStart): Ditto.
(WebCore::DOMSelection::setBaseAndExtent): Removed redundant check of m_frame
for null which is already handled by the isValidForPosition function. Removed
non-helpful FIXME.
(WebCore::DOMSelection::setPosition): Ditto.
(WebCore::DOMSelection::extend): Changed to use ExceptionOr instead of
ExceptionCode.
(WebCore::DOMSelection::getRangeAt): Ditto.
(WebCore::DOMSelection::isValidForPosition): Changed to return false when
m_frame is null rather than asserting is is non-null and having every caller
check m_frame before calling this.

* page/DOMSelection.h: Use #pragma once. Fix indentation. Removed unneeded
comments. Use ExceptionOr rather than ExceptionCode.

* page/DOMSelection.idl: Move from MayThrowLegacyException to MayThrowException.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::resetDOMWindowProperties): Sorted properties alphabetically
to make it more obvious if any are accidentally omitted or listed twice.
(WebCore::DOMWindow::getSelection): Changed ownership so that the window owns
the selection like all the other objects, rather than having it be owned by the
document instead.

* page/DOMWindow.h: Added m_selection, sorted all the other related properties
alphabetically so it's easy to compare the list here with elsewhere.

* replay/ReplayController.cpp:
(WebCore::ReplayController::frameNavigated): Updated to call setInputCursor
with a reference rather than a pointer.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseText): Use ExceptionOr rather than ExceptionCode.
(WebCore::XMLHttpRequest::responseXML): Ditto.
(WebCore::XMLHttpRequest::setTimeout): Ditto.
(WebCore::XMLHttpRequest::setResponseType): Ditto.
(WebCore::XMLHttpRequest::setWithCredentials): Ditto.
(WebCore::XMLHttpRequest::open): Ditto.
(WebCore::XMLHttpRequest::prepareToSend): Changed to return an
Optional<ExceptionOr> to reflect the three different states: an exception,
a value to return without sending, or "continue with the send algorithm".
The old code did this with a boolean plus an exception code. This sounds
confusing but is easy to read at the call sites, so probably OK to keep.
(WebCore::XMLHttpRequest::send): Use ExceptionOr rather than ExceptionCode.
(WebCore::XMLHttpRequest::sendBytesData): Ditto.
(WebCore::XMLHttpRequest::createRequest): Ditto.
(WebCore::XMLHttpRequest::overrideMimeType): Ditto.
(WebCore::XMLHttpRequest::setRequestHeader): Ditto.

* xml/XMLHttpRequest.h: Updated for changes above.

* xml/XMLHttpRequest.idl: Sorted interface extended attributes alphabetically.
Changed from MayThrowLegacyException to MayThrowException.

Source/WebKit/mac:

* DOM/DOMDOMImplementation.mm:
(-[DOMImplementation createDocumentType:publicId:systemId:]): Updated for
name change from takeReturnValue to releaseReturnValue.
(-[DOMImplementation createDocument:qualifiedName:doctype:]): Ditto.

Source/WebKit2:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
(webkit_dom_dom_implementation_create_document_type): Updated for name change
from takeReturnValue to releaseReturnValue.
(webkit_dom_dom_implementation_create_document): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
(webkit_dom_dom_selection_collapse_to_end): Use ExceptionOr instead of ExceptionCode.
(webkit_dom_dom_selection_collapse_to_start): Ditto.
(webkit_dom_dom_selection_extend): Ditto.
(webkit_dom_dom_selection_get_range_at): Ditto.

Tools:

* Scripts/do-webcore-rename: Add proposed name change of setDOMException
to propagateException, since this function is primarily used to take an
exception already effectively "thrown" by setting an ExceptionCode out
argument and propagate it into the JavaScript engine's exception machinery.

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

3 years agoUnreviewed, rolling out r206950.
commit-queue@webkit.org [Sat, 8 Oct 2016 20:42:52 +0000 (20:42 +0000)]
Unreviewed, rolling out r206950.
https://bugs.webkit.org/show_bug.cgi?id=163169

broke an API test (Requested by thorton on #webkit).

Reverted changeset:

"Share more code between iOS and macOS ViewGestureController"
https://bugs.webkit.org/show_bug.cgi?id=163158
http://trac.webkit.org/changeset/206950

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

3 years agoMarking http/tests/media/track-in-band-hls-metadata.html as a flaky timeout on mac.
ryanhaddad@apple.com [Sat, 8 Oct 2016 20:14:22 +0000 (20:14 +0000)]
Marking http/tests/media/track-in-band-hls-metadata.html as a flaky timeout on mac.
https://bugs.webkit.org/show_bug.cgi?id=140022

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoMarking storage/indexeddb/key-generator.html as flaky on mac-wk2 debug.
ryanhaddad@apple.com [Sat, 8 Oct 2016 19:50:59 +0000 (19:50 +0000)]
Marking storage/indexeddb/key-generator.html as flaky on mac-wk2 debug.
https://bugs.webkit.org/show_bug.cgi?id=161653

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoAutogenerate passing union types as part of a functions variadic arguments
weinig@apple.com [Sat, 8 Oct 2016 19:07:14 +0000 (19:07 +0000)]
Autogenerate passing union types as part of a functions variadic arguments
https://bugs.webkit.org/show_bug.cgi?id=162919

Reviewed by Darin Adler.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Remove deleted files.

* bindings/generic/IDLTypes.h:
Switch to use std::reference_wrapper as it's implementation type. We may need more
granularity here in the future, but this will work for now.

* bindings/js/JSCharacterDataCustom.cpp: Removed.
* bindings/js/JSDocumentTypeCustom.cpp: Removed.
* bindings/js/JSNodeOrString.cpp: Removed.
* bindings/js/JSNodeOrString.h: Removed.

* bindings/js/JSDOMBinding.h:
(WebCore::VariadicHelperBase::convert): Deleted.
(WebCore::toArguments): Deleted.
Moved to JSDOMConvert.h and renamed to convertVariadicArguments and make
it work in terms of IDLTypes.

* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLInterface<T>>::convert):
(WebCore::VariadicConverterBase::convert):
(WebCore::VariadicConverterBase<IDLInterface<T>>::convert):
(WebCore::convertVariadicArguments):

* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::prepend): Deleted.
(WebCore::JSDocument::append): Deleted.
* bindings/js/JSDocumentFragmentCustom.cpp:
(WebCore::JSDocumentFragment::prepend): Deleted.
(WebCore::JSDocumentFragment::append): Deleted.
* bindings/js/JSElementCustom.cpp:
(WebCore::JSElement::before): Deleted.
(WebCore::JSElement::after): Deleted.
(WebCore::JSElement::replaceWith): Deleted.
(WebCore::JSElement::prepend): Deleted.
(WebCore::JSElement::append): Deleted.
Remove now generated functions.

* bindings/scripts/CodeGenerator.pm:
(assert):
Add assert to help debugging.

(ParseInterface):
Don't treat union types as interfaces.

(GetFlattenedMemberTypes):
(GetNumberOfNullableMemberTypes):
(GetIDLUnionMemberTypes):
Implement WebIDL algorithms for getting the flattened member list of union, and use it
to construct the c++ IDLType.

(GetBaseIDLType):
(GetIDLType):
Add helper to convert an parsed idlType to a c++ IDLType.

(IsWrapperType):
Don't treat union types as wrappers.

* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
Add helper for adding #includes based on a parsed idlType. It recursively handles union types.

(GenerateParametersCheck):
Use the new convertVariadicArguments function to handle all variadic arguments, including
union types.

* bindings/scripts/IDLParser.pm:
(parseDictionaryMember):
(parseAttributeRest):
(parseOptionalOrRequiredArgument):
(parseExceptionField):
Add an idlType to domSignature and populate it.

* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod13):
(WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicUnionMethod):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors5):
* bindings/scripts/test/TestObj.idl:
Add and update tests.

* dom/ChildNode.idl:
* dom/ParentNode.idl:
Remove Custom extended attribute.

* dom/ContainerNode.cpp:
* dom/ContainerNode.h:
* dom/Node.cpp:
* dom/Node.h:
Switch to using std::reference_wrapper instead of Ref<> for passed in parameters.

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

3 years agoHasIndexedProperty clobberize rule is wrong for Array::ForceOSRExit
sbarati@apple.com [Sat, 8 Oct 2016 18:32:12 +0000 (18:32 +0000)]
HasIndexedProperty clobberize rule is wrong for Array::ForceOSRExit
https://bugs.webkit.org/show_bug.cgi?id=159942
<rdar://problem/27328836>

Reviewed by Filip Pizlo.

When HasIndexedProperty has a ForceOSRExit array mode, it should
report to write to side state, like the ForceOSRExit node, and the
other nodes with ForceOSRExit array mode.

* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):

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

3 years ago[Fetch API] Request constructor should provide exception messages
commit-queue@webkit.org [Sat, 8 Oct 2016 14:49:47 +0000 (14:49 +0000)]
[Fetch API] Request constructor should provide exception messages
https://bugs.webkit.org/show_bug.cgi?id=162382

Source/WebCore:

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-08
Reviewed by Darin Adler.

No change of behavior, except that exceptions now have error messages.

Added support of exception messages to ExceptionOr.
Making use of ExceptionOr for Request constructor parameter checking.

* Modules/fetch/FetchRequest.cpp:
(WebCore::setReferrerPolicy):
(WebCore::setMode):
(WebCore::setCredentials):
(WebCore::setCache):
(WebCore::setRedirect):
(WebCore::setMethod):
(WebCore::setReferrer):
(WebCore::buildOptions):
(WebCore::FetchRequest::initializeOptions):
(WebCore::FetchRequest::initializeWith):
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchRequest.idl:
* bindings/js/JSDOMBinding.cpp:
(WebCore::setDOMException):
* bindings/js/JSDOMBinding.h:
(WebCore::toJS):
(WebCore::toJSNewlyCreated):
* dom/Exception.h:
(WebCore::Exception::code):
(WebCore::Exception::message):
(WebCore::Exception::Exception):
* dom/ExceptionOr.h:
(WebCore::ExceptionOr<ReturnType>::exceptionMessage):

LayoutTests:

Patch by Youenn Fablet <youennf@gmail.com> on 2016-10-08
Reviewed by Darin Adler.

* fetch/fetch-url-serialization-expected.txt: Rebasing test expectation.

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

3 years agoRefactor binding generated casted-this checks
commit-queue@webkit.org [Sat, 8 Oct 2016 13:09:30 +0000 (13:09 +0000)]
Refactor binding generated casted-this checks
https://bugs.webkit.org/show_bug.cgi?id=162677

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-08
Reviewed by Darin Adler.

No change of behavior.

Split the attribute getter function in two, one with the signature expected by JSCore and one used after casted-this checks.

The second function takes directly a JSXX object and returns a JSValue instead of an EncodedJSValue.
In the future, the second function should only take references.

Introducing BindingCaller as a way to templatize binding code used to cast thisValue with the desired JSXX value.
This allows implementing the first function using the second function as template parameter.

Introducing JSClass::castForAttribute as a way to encapsulate differences in the way to handle thisValue access.

* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::attribute):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.cpp:
* bindings/scripts/test/JS/JSattribute.h:

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

3 years agoMissing include in MediaDescription
eocanha@igalia.com [Sat, 8 Oct 2016 11:54:50 +0000 (11:54 +0000)]
Missing include in MediaDescription
https://bugs.webkit.org/show_bug.cgi?id=162873

Reviewed by Xabier Rodriguez-Calvar.

Added missing header.

* platform/MediaDescription.h:

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

3 years agoMove StyleResolver ownership from Document/ShadowRoot to Style::Scope
antti@apple.com [Sat, 8 Oct 2016 08:42:03 +0000 (08:42 +0000)]
Move StyleResolver ownership from Document/ShadowRoot to Style::Scope
https://bugs.webkit.org/show_bug.cgi?id=163148

Reviewed by Andreas Kling.

Reduce duplication between Document and ShadowRoot.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::didMutateRules):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchHostPseudoClassRules):
(WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::mediaConditionMatches):
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::childrenChanged):
(WebCore::Document::isPageBoxVisible):
(WebCore::Document::pageSizeAndMarginsInPixels):
(WebCore::Document::userAgentShadowTreeStyleResolver):
(WebCore::Document::fontsNeedUpdate):
(WebCore::Document::didClearStyleResolver):
(WebCore::Document::updateViewportUnitsOnResize):
(WebCore::Document::createStyleResolver): Deleted.
(WebCore::Document::clearStyleResolver): Deleted.
* dom/Document.h:
(WebCore::Document::styleResolverIfExists): Deleted.
(WebCore::Document::ensureStyleResolver): Deleted.
* dom/Element.cpp:
(WebCore::Element::styleResolver):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::styleResolver): Deleted.
(WebCore::ShadowRoot::styleResolverIfExists): Deleted.
(WebCore::ShadowRoot::resetStyleResolver): Deleted.
* dom/ShadowRoot.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* page/Page.cpp:
(WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseCriticalMemory):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostStyle):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostStyle):
* style/IdChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostStyle):
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::resolverIfExists):
(WebCore::Style::Scope::clearResolver):
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
(WebCore::Style::Scope::updateStyleResolver):
(WebCore::Style::Scope::styleResolver): Deleted.
(WebCore::Style::Scope::styleResolverIfExists): Deleted.
* style/StyleScope.h:
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::canShareStyleWithElement):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Scope::Scope):
(WebCore::Style::TreeResolver::resolve):

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

3 years agoShare more code between iOS and macOS ViewGestureController
timothy_horton@apple.com [Sat, 8 Oct 2016 08:31:00 +0000 (08:31 +0000)]
Share more code between iOS and macOS ViewGestureController
https://bugs.webkit.org/show_bug.cgi?id=163158

Reviewed by Simon Fraser.

Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
because it shouldn't know anything about WKWebView.
Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView setAllowsBackForwardNavigationGestures:]):
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
(WebKit::ViewGestureController::canSwipeInDirection):
(WebKit::ViewGestureController::gestureControllerForPage): Deleted.
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::createWeakPtr):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
(WebKit::ViewGestureController::canSwipeInDirection): Deleted.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):

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

3 years agowindow.navigator.language incorrectly returns all lowercase string
cdumez@apple.com [Sat, 8 Oct 2016 03:31:15 +0000 (03:31 +0000)]
window.navigator.language incorrectly returns all lowercase string
https://bugs.webkit.org/show_bug.cgi?id=163096

Reviewed by Darin Adler.

Source/WebCore:

Update navigator.language so that it no longer returns an all lowercase
string (e.g. 'en-us' -> 'en-US'). This matches the behavior of other
browsers and the specification which indicate we should return a
BCP 47 language tag:
- https://html.spec.whatwg.org/#dom-navigator-language
- https://tools.ietf.org/html/bcp47

The other call sites relying on userPreferredLanguages() use case
insensitive comparison so they will not break.

No new tests, updated existing test.

* platform/Language.h:

Source/WTF:

Update platformUserPreferredLanguages() so that it no longer lowercases
the string it returns. On Mac, we rely on CFLocale which returns
BCP-47 language tags as per:
- https://developer.apple.com/reference/corefoundation/1666963-cflocale?language=objc

* wtf/PlatformUserPreferredLanguagesMac.mm:
(WTF::httpStyleLanguageCode):
* wtf/PlatformUserPreferredLanguagesUnix.cpp:
(WTF::platformLanguage):

LayoutTests:

Update existing test so that it does not lowercase navigator.language
before checking it. This way, we can make sure it returns en-US and
not en-us.

* js/dom/navigator-language-expected.txt:
* js/dom/navigator-language.html:

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

3 years agoObject.freeze() and seal() should throw if [[PreventExtensions]]() fails.
mark.lam@apple.com [Sat, 8 Oct 2016 03:20:53 +0000 (03:20 +0000)]
Object.freeze() and seal() should throw if [[PreventExtensions]]() fails.
https://bugs.webkit.org/show_bug.cgi?id=163160

Reviewed by Saam Barati.

JSTests:

* stress/object-freeze-with-proxy-preventExtensions.js: Added.
* stress/object-seal-with-proxy-preventExtensions.js: Added.

Source/JavaScriptCore:

See https://tc39.github.io/ecma262/#sec-object.freeze,
https://tc39.github.io/ecma262/#sec-object.seal, and
https://tc39.github.io/ecma262/#sec-setintegritylevel.  We need to call
preventExtensions first before proceeding to freeze / seal the object.  If
preventExtensions fails, we should throw a TypeError.

* runtime/ObjectConstructor.cpp:
(JSC::setIntegrityLevel):
(JSC::objectConstructorSeal):
(JSC::objectConstructorFreeze):

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

3 years agoREGRESSION (r206853?): LayoutTest js/regress-141098.html failing
utatane.tea@gmail.com [Sat, 8 Oct 2016 02:07:09 +0000 (02:07 +0000)]
REGRESSION (r206853?): LayoutTest js/regress-141098.html failing
https://bugs.webkit.org/show_bug.cgi?id=163046

Reviewed by Saam Barati.

This is attempt-to-fix patch since I cannot reproduce this flakiness.
We reduce the number of frames to back off from the stack overflow to
catch the closer frame limit to the actual stack limit.

* js/script-tests/regress-141098.js:

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

3 years agoUnreviewed, mark a test as failing on iOS simulator
wenson_hsieh@apple.com [Sat, 8 Oct 2016 00:23:46 +0000 (00:23 +0000)]
Unreviewed, mark a test as failing on iOS simulator

This was intended to be a part of r206944.

* platform/ios-simulator/TestExpectations:

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

3 years ago[WK1 Mac] Fix repaints of fixed-background elements in layer-backed WebViews
simon.fraser@apple.com [Sat, 8 Oct 2016 00:20:05 +0000 (00:20 +0000)]
[WK1 Mac] Fix repaints of fixed-background elements in layer-backed WebViews
https://bugs.webkit.org/show_bug.cgi?id=163154
rdar://problem/28674216

Reviewed by Tim Horton.

r55159 added code to counteract AppKit's adjustment of dirty regions during scrolling,
by offsetting the dirty rect in -setNeedsDisplayInRect: if the call happens during
the NSViewBoundsDidChangeNotification handling.

However, AppKit only does dirty region adjustment in the code path that blits ("copy
on scroll"), so r55159 produces incorrect behavior in, for example, layer-backed views.

Fix by overriding -[NSClipView _canCopyOnScrollForDeltaX:deltaY:] to know if a single
scroll is going to blit, and only do adjustments in -setNeedsDisplayInRect: if it is.

* WebView/WebClipView.h:
* WebView/WebClipView.mm:
(-[WebClipView _immediateScrollToPoint:]):
(-[WebClipView _canCopyOnScrollForDeltaX:deltaY:]):
(-[WebClipView currentScrollIsBlit]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView setNeedsDisplayInRect:]):
(-[WebHTMLView drawRect:]):

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

3 years agoSupport onbeforeinput event handling for the new InputEvent spec
wenson_hsieh@apple.com [Fri, 7 Oct 2016 23:47:18 +0000 (23:47 +0000)]
Support onbeforeinput event handling for the new InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163021
<rdar://problem/28658073>

Reviewed by Darin Adler.

Source/WebCore:

Adds support for parsing the onbeforeinput attribute, and for sending default-preventable
`beforeinput` InputEvents to the page. To do this, we introduce two new virtual methods:
willApplyCommand and didApplyCommand on the CompositeEditCommand that are called before and
after CompositeEditCommand::doApply, respectively. willApplyCommand indicates whether or not
the composite editor command should proceed with applying the command.

Tweaks existing layout tests and adds new tests.

Tests: fast/events/before-input-events-different-start-end-elements.html
       fast/events/before-input-events-prevent-default-in-textfield.html
       fast/events/before-input-events-prevent-default.html

* dom/Document.idl:
* dom/Element.idl:
* dom/EventNames.h:
* dom/Node.cpp:
(WebCore::Node::dispatchInputEvent):
(WebCore::Node::defaultEventHandler):

Currently, we fire input events in Node in response to dispatching a webkitEditableContentChangedEvent. After
some discussion, Ryosuke and I believe that it will be ok to instead directly dispatch the input event where we
would normally dispatch a webkitEditableContentChangedEvent.

* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::unapply):
(WebCore::EditCommandComposition::reapply):

Added calls to Editor::willUnapplyEditing and Editor::willReapplyEditing.

(WebCore::CompositeEditCommand::willApplyCommand):
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::didApplyCommand):

Added new virtual functions, willApplyCommand and didApplyCommand, that surround a call to
CompositeEditCommand::doApply. By default, they call willApplyEditing and appliedEditing on the editor, but may
be overridden in special cases, such as in TypingCommand, where we invoke appliedEditing after adding a new
typing command to the last open command.

If willApplyCommand returns false, CompositeEditCommand::apply will bail and not proceed with the command.

* editing/CompositeEditCommand.h:
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchBeforeInputEvents):
(WebCore::dispatchInputEvents):
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::willUnapplyEditing):
(WebCore::Editor::unappliedEditing):
(WebCore::Editor::willReapplyEditing):
(WebCore::Editor::reappliedEditing):
(WebCore::Editor::computeAndSetTypingStyle):
(WebCore::dispatchEditableContentChangedEvents): Deleted.
* editing/Editor.h:
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::willApplyCommand):
(WebCore::TypingCommand::didApplyCommand):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
(WebCore::TypingCommand::deleteSelection):

These now invoke willAddTypingToOpenCommand before proceeding with creating the command and applying it. The
flow is now:
    - willAddTypingToOpenCommand
    - create and apply a new command
    - typingAddedToOpenCommand

* editing/TypingCommand.h:
(WebCore::TypingCommand::preservesTypingStyle): Deleted.
(WebCore::TypingCommand::shouldRetainAutocorrectionIndicator): Deleted.
(WebCore::TypingCommand::setShouldRetainAutocorrectionIndicator): Deleted.
(WebCore::TypingCommand::shouldStopCaretBlinking): Deleted.
* html/HTMLAttributeNames.in:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):

LayoutTests:

Tweak an existing test to hook into the 'input' event instead of 'webkitEditableContentChanged', as well as
tests added in r206843 to verify that `onbeforeinput` handlers are invoked with InputEvents. Also introduces
new unit tests verifying that calling preventDefault on InputEvents fired by `onbeforeinput` correctly prevent
text from being inserted or deleted.

* editing/undo/undo-after-event-edited.html:
* fast/events/before-input-events-different-start-end-elements-expected.txt: Added.
* fast/events/before-input-events-different-start-end-elements.html: Added.
* fast/events/before-input-events-prevent-default-expected.txt: Added.
* fast/events/before-input-events-prevent-default-in-textfield-expected.txt: Added.
* fast/events/before-input-events-prevent-default-in-textfield.html: Added.
* fast/events/before-input-events-prevent-default.html: Added.
* fast/events/input-events-fired-when-typing-expected.txt:
* fast/events/input-events-fired-when-typing.html:
* platform/ios-simulator/TestExpectations:

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

3 years agoAX: <figcaption> should be AXTitleUIElement for other content inside the <figure>
n_wang@apple.com [Fri, 7 Oct 2016 23:30:16 +0000 (23:30 +0000)]
AX: <figcaption> should be AXTitleUIElement for other content inside the <figure>
https://bugs.webkit.org/show_bug.cgi?id=108996

Reviewed by Chris Fleizach.

Source/WebCore:

Exposed the figcaption element to be the AXTitleUIElement for the figure element. And used
the figcaption's content as the accessible name of the figure. Also, updated the figure element's
role description on Mac.
Accessible name and description calculation for figure elements:
https://w3c.github.io/html-aam/#figure-and-figcaption-elements

Test: accessibility/mac/figure-element.html

* English.lproj/Localizable.strings:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::captionForFigure):
(WebCore::AccessibilityNodeObject::alternativeText):
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isFigure):
(WebCore::AccessibilityObject::isSuperscriptStyleGroup): Deleted.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::exposesTitleUIElement):
(WebCore::AccessibilityRenderObject::titleUIElement):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXFigureText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXFigureText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXFigureText):

LayoutTests:

* accessibility/mac/figure-element-expected.txt: Added.
* accessibility/mac/figure-element.html: Added.

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

3 years agoNon-special URL fragments should percent-encode non-ASCII characters
achristensen@apple.com [Fri, 7 Oct 2016 23:06:32 +0000 (23:06 +0000)]
Non-special URL fragments should percent-encode non-ASCII characters
https://bugs.webkit.org/show_bug.cgi?id=163153

Reviewed by Tim Horton.

Source/WebCore:

This is needed to keep compatibility with data URLs with non-ASCII characters after a '#'
which works in Chrome, Firefox, and Safari, while maintaining compatibility with Chrome, IE, and Edge
which keep non-ASCII characters in the fragments of special URLs.
This was proposed to the spec in https://github.com/whatwg/url/issues/150

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::syntaxViolation):
Removed assertion because we now have fragments that need percent encoding but are all ASCII.
(WebCore::URLParser::fragmentSyntaxViolation):
(WebCore::URLParser::parse):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

3 years agoEventHandler functions that need to guarantee event handler lifetime need to use...
bfulgham@apple.com [Fri, 7 Oct 2016 22:59:22 +0000 (22:59 +0000)]
EventHandler functions that need to guarantee event handler lifetime need to use Ref<Frame>
https://bugs.webkit.org/show_bug.cgi?id=98617
<rdar://problem/12778649>

Reviewed by Daniel Bates.

Improve stability by ensuring that the Frame holding an active EventHandler is kept
alive while in the process of handling events and executing JavaScript.

No new tests since there is no change in behavior.

* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick): Protect the Frame with a Ref<>.
(WebCore::EventHandler::handleMousePressEvent): Ditto.
(WebCore::EventHandler::handleMouseDraggedEvent): Ditto.
(WebCore::EventHandler::eventMayStartDrag): Ditto.
(WebCore::EventHandler::handleMouseReleaseEvent): Ditto.
(WebCore::EventHandler::hitTestResultAtPoint): Ditto.
(WebCore::EventHandler::scrollRecursively): Ditto.
(WebCore::EventHandler::logicalScrollRecursively): Ditto.
(WebCore::EventHandler::selectCursor): Ditto.
(WebCore::EventHandler::handleMouseDoubleClickEvent): Ditto.
(WebCore::EventHandler::mouseMoved): Ditto.
(WebCore::EventHandler::handleMouseMoveEvent): Ditto.
(WebCore::EventHandler::handleMouseForceEvent): Ditto.
(WebCore::EventHandler::dispatchDragEvent): Ditto.
(WebCore::EventHandler::updateDragAndDrop): Ditto.
(WebCore::EventHandler::cancelDragAndDrop): Ditto.
(WebCore::EventHandler::performDragAndDrop): Ditto.
(WebCore::EventHandler::prepareMouseEvent): Ditto.
(WebCore::EventHandler::updateMouseEventTargetNode): Ditto.
(WebCore::EventHandler::dispatchMouseEvent): Ditto.
(WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
(WebCore::EventHandler::handleWheelEvent): Ditto.
(WebCore::EventHandler::defaultWheelEventHandler): Ditto.
(WebCore::EventHandler::sendContextMenuEvent): Ditto.
(WebCore::EventHandler::sendContextMenuEventForKey): Ditto.
(WebCore::EventHandler::hoverTimerFired): Ditto.
(WebCore::EventHandler::keyEvent): Ditto.
(WebCore::EventHandler::defaultKeyboardEventHandler): Ditto.
(WebCore::EventHandler::handleDrag): Ditto.
(WebCore::EventHandler::handleTextInputEvent): Ditto.
(WebCore::EventHandler::defaultSpaceEventHandler): Ditto.
(WebCore::EventHandler::defaultTabEventHandler): Ditto.
(WebCore::EventHandler::sendScrollEvent): Ditto.
(WebCore::EventHandler::handleTouchEvent): Ditto.
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::focusDocumentView): Ditto.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformCompleteWheelEvent): Ditto.

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

3 years agoBuild fix for “Move functionality common to Darwin ports into a base class”
jbedard@apple.com [Fri, 7 Oct 2016 22:17:06 +0000 (22:17 +0000)]
Build fix for “Move functionality common to Darwin ports into a base class”
https://bugs.webkit.org/show_bug.cgi?id=160709

Unreviewed build fix.

* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort._get_crash_log): Added iOS implementation.
* Scripts/webkitpy/port/mac.py:
(MacPort._get_crash_log): Added Mac implementation.

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

3 years agoMarking inspector/debugger/stepping tests as flaky.
ryanhaddad@apple.com [Fri, 7 Oct 2016 22:14:41 +0000 (22:14 +0000)]
Marking inspector/debugger/stepping tests as flaky.
https://bugs.webkit.org/show_bug.cgi?id=161951

Unreviewed test gardening.

* TestExpectations:

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

3 years agoUnreviewed. Added myself to the list of committers.
cpugh@apple.com [Fri, 7 Oct 2016 21:25:03 +0000 (21:25 +0000)]
Unreviewed. Added myself to the list of committers.

* Scripts/webkitpy/common/config/contributors.json:

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

3 years agoGet rid of API::Session and WKSessionRef
andersca@apple.com [Fri, 7 Oct 2016 21:20:52 +0000 (21:20 +0000)]
Get rid of API::Session and WKSessionRef
https://bugs.webkit.org/show_bug.cgi?id=163140

Reviewed by Tim Horton.

This API is no longer used.

* CMakeLists.txt:
* Shared/API/APIObject.h:
* Shared/API/c/WKSharedAPICast.h:
* UIProcess/API/APISession.cpp: Removed.
(API::generateID): Deleted.
(API::Session::defaultSession): Deleted.
(API::Session::Session): Deleted.
(API::Session::createEphemeral): Deleted.
(API::Session::isEphemeral): Deleted.
(API::Session::getID): Deleted.
(API::Session::~Session): Deleted.
* UIProcess/API/APISession.h: Removed.
* UIProcess/API/C/WKPage.h:
* UIProcess/API/C/WKSessionRef.cpp: Removed.
(WKSessionCreate): Deleted.
(WKSessionGetTypeID): Deleted.
(WKSessionIsEphemeral): Deleted.
* UIProcess/API/C/WKSessionRef.h: Removed.
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.h:
* WebKit2.xcodeproj/project.pbxproj:

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

3 years agoMove ViewGestureController files to more accurate locations
timothy_horton@apple.com [Fri, 7 Oct 2016 21:11:59 +0000 (21:11 +0000)]
Move ViewGestureController files to more accurate locations
https://bugs.webkit.org/show_bug.cgi?id=163141

Reviewed by Anders Carlsson.

* PlatformMac.cmake:
* UIProcess/Cocoa/ViewGestureController.cpp: Renamed from UIProcess/ViewGestureController.cpp.
* UIProcess/Cocoa/ViewGestureController.h: Renamed from UIProcess/mac/ViewGestureController.h.
* UIProcess/Cocoa/ViewGestureController.messages.in: Renamed from UIProcess/mac/ViewGestureController.messages.in.
* WebKit2.xcodeproj/project.pbxproj:

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

3 years agojs/function-apply-aliased.html is timing out
jbedard@apple.com [Fri, 7 Oct 2016 21:06:56 +0000 (21:06 +0000)]
js/function-apply-aliased.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=127860

Reviewed by Darin Adler.

This test no longer times out.  Reintegrating into test suites.

* TestExpectations: Stopped skipping js/function-apply-aliased.html.

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

3 years agoMove functionality common to Darwin ports into a base class
jbedard@apple.com [Fri, 7 Oct 2016 21:06:43 +0000 (21:06 +0000)]
Move functionality common to Darwin ports into a base class
https://bugs.webkit.org/show_bug.cgi?id=160709

Reviewed by Darin Adler.

* Scripts/webkitpy/port/apple.py:
(ApplePort.determine_full_port_name): Specific iOS port check.
(ApplePort.__init__): Move leak detector to DarwinPort.
(ApplePort._make_leak_detector): Moved to DarwinPort.
(ApplePort.supports_per_test_timeout): Moved to Port.
(ApplePort.check_for_leaks): Moved to DarwinPort.
(ApplePort.print_leaks_summary): Moved to DarwinPort.
(ApplePort._path_to_webcore_library): Moved to DarwinPort.
(ApplePort.show_results_html_file): Moved to DarwinPort.
(ApplePort._merge_crash_logs): Moved to DarwinPort.
(ApplePort._look_for_all_crash_logs_in_log_dir): Moved to DarwinPort.
(ApplePort._get_crash_log): Moved to DarwinPort.
(ApplePort.look_for_new_crash_logs): Moved to DarwinPort.
(ApplePort.sample_process): Moved to DarwinPort.
(ApplePort.sample_file_path): Moved to DarwinPort.
(ApplePort.look_for_new_samples): Moved to DarwinPort.
* Scripts/webkitpy/port/base.py:
(Port.supports_per_test_timeout): Return true for all ports.
* Scripts/webkitpy/port/darwin.py: Added.
(DarwinPort): Shared iOS and Mac functions.
* Scripts/webkitpy/port/darwin_testcase.py: Added.
(DarwinTest): Shared iOS and Mac testing.
* Scripts/webkitpy/port/efl.py:
(EflPort):
(EflPort.supports_per_test_timeout): Moved to Port.
* Scripts/webkitpy/port/gtk.py:
(GtkPort._driver_class):
(GtkPort):
(GtkPort.supports_per_test_timeout): Moved to Port.
* Scripts/webkitpy/port/ios.py:
(IOSPort):
(IOSPort.operating_system):
(IOSSimulatorPort):
(IOSSimulatorPort.__init__): Inherits from DarwinPort.
(IOSSimulatorPort._port_specific_expectations_files): Moved to DarwinPort.
(IOSSimulatorPort._get_crash_log): Deleted.
(IOSSimulatorPort.xcrun_find): Deleted.
* Scripts/webkitpy/port/ios_unittest.py: Added.
(iosTest): Unit tests for the iOS port.
* Scripts/webkitpy/port/mac.py:
(MacPort):
(MacPort.__init__): Inherits from DarwinPort.
(MacPort._port_specific_expectations_files): Moved to DarwinPort.
(MacPort.make_command): Moved to DarwinPort.
(MacPort._get_crash_log): Moved to DarwinPort.
(MacPort.nm_command): Moved to DarwinPort.
* Scripts/webkitpy/port/mac_unittest.py:
(MacTest):
(MacTest.test_sdk_name): Added test.
(MacTest.test_xcrun): Added test.
(MacTest.assert_skipped_file_search_paths): Moved to DarwinTest.
(MacTest.test_default_timeout_ms): Moved to DarwinTest.
(MacTest.assert_name): Moved to DarwinTest.
(MacTest.test_helper_starts): Moved to DarwinTest.
(MacTest.test_helper_fails_to_start): Moved to DarwinTest.
(MacTest.test_helper_fails_to_stop): Moved to DarwinTest.
(MacTest.test_spindump): Moved to DarwinTest.
(MacTest.test_sample_process): Moved to DarwinTest.
(MacTest.test_sample_process_exception): Moved to DarwinTest.
* Scripts/webkitpy/port/port_testcase.py:
(PortTestCase):
(PortTestCase.test_diff_image): Added is_simulator flag.
(PortTestCase.test_diff_image): Skip test if on a simulator.
(PortTestCase.test_diff_image_crashed): Skip test if on a simulator.
* Scripts/webkitpy/port/win.py:
(WinPort):
(WinPort.look_for_new_samples): Used default, ApplePort no longer implements.
(WinPort.sample_process): Ditto.
(WinPort._make_leak_detector): Ditto.
(WinPort.check_for_leaks): Ditto.
(WinPort.print_leaks_summary): Ditto.
(WinPort._path_to_webcore_library): Ditto.

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

3 years agoMarking inspector/console/addInspectedNode.html as flaky on mac-debug.
ryanhaddad@apple.com [Fri, 7 Oct 2016 20:51:45 +0000 (20:51 +0000)]
Marking inspector/console/addInspectedNode.html as flaky on mac-debug.
https://bugs.webkit.org/show_bug.cgi?id=155138

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoMarking http/tests/cache/disk-cache/memory-cache-revalidation-updates-disk-cache...
ryanhaddad@apple.com [Fri, 7 Oct 2016 20:46:34 +0000 (20:46 +0000)]
Marking http/tests/cache/disk-cache/memory-cache-revalidation-updates-disk-cache.html as flaky on mac-wk2 debug.
https://bugs.webkit.org/show_bug.cgi?id=162975

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoAdopt BlockPtr in ViewGestureController
timothy_horton@apple.com [Fri, 7 Oct 2016 20:25:07 +0000 (20:25 +0000)]
Adopt BlockPtr in ViewGestureController
https://bugs.webkit.org/show_bug.cgi?id=163132

Reviewed by Anders Carlsson.

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::setDidMoveSwipeSnapshotCallback):
* UIProcess/ViewGestureController.cpp:
(WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
* UIProcess/mac/ViewGestureController.h:
(WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
(WebKit::ViewGestureController::m_didMoveSwipeSnapshotCallback): Deleted.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::platformTeardown):
(WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback): Deleted.

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

3 years agoGet rid of WKPageSetSession
andersca@apple.com [Fri, 7 Oct 2016 20:04:46 +0000 (20:04 +0000)]
Get rid of WKPageSetSession
https://bugs.webkit.org/show_bug.cgi?id=163129

Reviewed by Tim Horton.

Source/WebKit2:

This function is no longer used.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetSession): Deleted.
* UIProcess/API/C/WKPage.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setSessionID): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::sessionID):
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Rewrite this test to use WKPageConfigurationRef and WKWebsiteDataStoreRef.

* TestWebKitAPI/Tests/WebKit2/EphemeralSessionPushStateNoHistoryCallback.cpp:
(TestWebKitAPI::TEST):

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

3 years agoMarking http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html as flaky...
ryanhaddad@apple.com [Fri, 7 Oct 2016 19:43:52 +0000 (19:43 +0000)]
Marking http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html as flaky on mac-wk2
https://bugs.webkit.org/show_bug.cgi?id=163139

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoRegression(r201970): productSub / vendor / vendorSub should not be exposed on WorkerN...
cdumez@apple.com [Fri, 7 Oct 2016 19:37:30 +0000 (19:37 +0000)]
Regression(r201970): productSub / vendor / vendorSub should not be exposed on WorkerNavigator
https://bugs.webkit.org/show_bug.cgi?id=163124

Reviewed by Ryosuke Niwa.

Source/WebCore:

productSub / vendor / vendorSub should not be exposed on WorkerNavigator:
- https://html.spec.whatwg.org/#navigatorid

Test case:
- http://w3c-test.org/submissions/3881/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker

Note that the specification also restricts NavigatorID's appCodeName and
product attributes to Window. However, it seems the HTML specification is
about to get updated so that these get exposed to workers:
- https://github.com/whatwg/html/pull/1870

No new tests, updated existing test.

* bindings/scripts/generate-bindings.pl:
(shouldPropertyBeExposed):
* page/NavigatorID.idl:

LayoutTests:

Update existing test to reflect behavior change.

* fast/workers/resources/worker-navigator.js:
* fast/workers/worker-navigator-expected.txt:

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

3 years agoMarking http/tests/xmlhttprequest/auth-reject-protection-space.html as flaky on mac...
ryanhaddad@apple.com [Fri, 7 Oct 2016 19:03:53 +0000 (19:03 +0000)]
Marking http/tests/xmlhttprequest/auth-reject-protection-space.html as flaky on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=163136

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoDisable URLParser logs by default in all builds
achristensen@apple.com [Fri, 7 Oct 2016 19:03:13 +0000 (19:03 +0000)]
Disable URLParser logs by default in all builds
https://bugs.webkit.org/show_bug.cgi?id=163135

Reviewed by Brady Eidson.

In debug builds with the URLParser enabled, some tests time out because
parameters to generate log strings are being evaluated for each character of each URL
and then not being used if URLParser logs are disabled.  Generating these unused parameters
is too slow even for debug builds.  Let's only generate them if they are to be used.

No change in behaviour.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::allValuesEqual):

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

3 years agoMarking storage/indexeddb/key-type-array.html as flaky on mac-debug.
ryanhaddad@apple.com [Fri, 7 Oct 2016 18:55:43 +0000 (18:55 +0000)]
Marking storage/indexeddb/key-type-array.html as flaky on mac-debug.
https://bugs.webkit.org/show_bug.cgi?id=161720

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years ago[WK2] didRemoveFrameFromHierarchy callback doesn't fire for subframes when evicting...
akling@apple.com [Fri, 7 Oct 2016 18:55:09 +0000 (18:55 +0000)]
[WK2] didRemoveFrameFromHierarchy callback doesn't fire for subframes when evicting from PageCache.
<https://webkit.org/b/163098>
<rdar://problem/28663488>

Reviewed by Antti Koivisto.

Source/WebCore:

Fix a bug where WK2 didRemoveFrameFromHierarchy callbacks wouldn't fire for subframes that were getting
kicked out of PageCache. The problem was happening because CachedFrame would disconnect the Frame from
its Page just before calling FrameLoader::detachViewsAndDocumentLoader() where the callbacks are fired.
Without a Page, the WebFrame on WK2 side can't find its WebPage, and so it can't fire its callbacks.

The fix is just to switch the order of those two lines.

This bug was causing frequent DOM and window object leaks in some clients *cough* Safari *cough* that
were relying on didRemoveFrameFromHierarchy to release their isolated worlds.

Test: WebKit2.DidRemoveFrameFromHiearchyInPageCache

* history/CachedFrame.cpp:
(WebCore::CachedFrame::destroy):

Tools:

Add an API test that puts a 10-subframe page into the page cache, then loads other pages
until the first page gets kicked out. The test succeeds if we receive didRemoveFrameFromHierarchy
callbacks for all the subframes.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/DidRemoveFrameFromHiearchyInPageCache.cpp: Added.
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::setPageLoaderClient):
(TestWebKitAPI::didReceivePageMessageFromInjectedBundle):
(TestWebKitAPI::setInjectedBundleClient):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp: Added.
(TestWebKitAPI::didRemoveFrameFromHierarchyCallback):
(TestWebKitAPI::DidRemoveFrameFromHiearchyInPageCacheTest::DidRemoveFrameFromHiearchyInPageCacheTest):
(TestWebKitAPI::DidRemoveFrameFromHiearchyInPageCacheTest::didCreatePage):
* TestWebKitAPI/Tests/WebKit2/many-iframes.html: Added.

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

3 years agoAX: AXRoleDescription for details and summary elements
n_wang@apple.com [Fri, 7 Oct 2016 17:44:51 +0000 (17:44 +0000)]
AX: AXRoleDescription for details and summary elements
https://bugs.webkit.org/show_bug.cgi?id=163094

Reviewed by Chris Fleizach.

Source/WebCore:

details and summary elements should have AXRoleDescription that is consistent with other
elements that have custom AXSubRole.

Test: accessibility/mac/details-summary-role-description.html

* English.lproj/Localizable.strings:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXDetailsText):
(WebCore::AXSummaryText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXDetailsText):
(WebCore::AXSummaryText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXDetailsText):
(WebCore::AXSummaryText):

LayoutTests:

* accessibility/mac/details-summary-role-description-expected.txt: Added.
* accessibility/mac/details-summary-role-description.html: Added.

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

3 years agoFix the Windows build after r206917.
ryanhaddad@apple.com [Fri, 7 Oct 2016 17:26:54 +0000 (17:26 +0000)]
Fix the Windows build after r206917.

Unreviewed build fix.

* dom/DOMAllInOne.cpp:

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

3 years agoMarking imported/blink/storage/indexeddb/blob-valid-after-deletion.html as flaky...
ryanhaddad@apple.com [Fri, 7 Oct 2016 17:15:13 +0000 (17:15 +0000)]
Marking imported/blink/storage/indexeddb/blob-valid-after-deletion.html as flaky on mac.
https://bugs.webkit.org/show_bug.cgi?id=163122

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoReplace bug URL placeholders independently of the short desc one
commit-queue@webkit.org [Fri, 7 Oct 2016 17:04:27 +0000 (17:04 +0000)]
Replace bug URL placeholders independently of the short desc one
https://bugs.webkit.org/show_bug.cgi?id=161684

Patch by Emanuele Aina <emanuele.aina@collabora.com> on 2016-10-07
Reviewed by Darin Adler.

Instead of adding the bug URL when replacing the short description
placeholder and then ignoring the bug URL placeholder, use the former
to set the short description and the latter for the bug URL.
This means that developers can fully prepare the changelog with short
and long description before submission leaving the bug placeholder in
place, and the changelog machinery will make sure to replace the
latter with the URL of the newly created bug while submitting.

Note that this also means that the short description placeholder alone
no longer causes the bug URL to be added.

* Scripts/webkitpy/common/checkout/changelog.py:
(ChangeLog.set_short_description_and_bug_url):
* Scripts/webkitpy/common/checkout/changelog_unittest.py:
(test_set_short_description_and_bug_url):

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

3 years agoRename AuthorStyleSheets to Style::Scope
antti@apple.com [Fri, 7 Oct 2016 16:55:11 +0000 (16:55 +0000)]
Rename AuthorStyleSheets to Style::Scope
https://bugs.webkit.org/show_bug.cgi?id=163108

Reviewed by Andreas Kling.

It represents the style scope in DOM.
Also move the file under style/.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::styleSheetScope):
* css/CSSStyleSheet.h:
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
* css/InspectorCSSOMWrappers.h:
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::styleSheets):
(WebCore::StyleSheetList::detachFromDocument):
* dom/AuthorStyleSheets.cpp: Removed.
* dom/AuthorStyleSheets.h: Removed.
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::setContentLanguage):
(WebCore::Document::recalcStyle):
(WebCore::Document::needsStyleRecalc):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::createStyleResolver):
(WebCore::Document::didRemoveAllPendingStylesheet):
(WebCore::Document::usesStyleBasedEditability):
(WebCore::Document::processHttpEquiv):
(WebCore::Document::preferredStylesheetSet):
(WebCore::Document::selectedStylesheetSet):
(WebCore::Document::setSelectedStylesheetSet):
(WebCore::Document::haveStylesheetsLoaded):
* dom/Document.h:
(WebCore::Document::styleScope):
(WebCore::Document::authorStyleSheets): Deleted.
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::clearPageUserSheet):
(WebCore::ExtensionStyleSheets::updatePageUserSheet):
(WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
(WebCore::ExtensionStyleSheets::addUserStyleSheet):
(WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
(WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::insertedIntoDocument):
(WebCore::InlineStyleSheetOwner::removedFromDocument):
(WebCore::InlineStyleSheetOwner::clearDocumentData):
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::sheetLoaded):
(WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
* dom/InlineStyleSheetOwner.h:
(WebCore::InlineStyleSheetOwner::styleScope):
(WebCore::InlineStyleSheetOwner::styleSheetScope): Deleted.
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::~ProcessingInstruction):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::sheetLoaded):
(WebCore::ProcessingInstruction::insertedInto):
(WebCore::ProcessingInstruction::removedFrom):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::styleResolver):
(WebCore::ShadowRoot::styleScope):
(WebCore::ShadowRoot::updateStyle):
(WebCore::ShadowRoot::authorStyleSheets): Deleted.
* dom/ShadowRoot.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::setDisabledState):
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::insertedInto):
(WebCore::HTMLLinkElement::removedFrom):
(WebCore::HTMLLinkElement::addPendingSheet):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLStyleElement.cpp:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::collectAllDocumentStyleSheets):
(WebCore::InspectorCSSAgent::forcePseudoState):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::resetPseudoStates):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setEmulatedMedia):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules):
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::setPagination):
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
* page/Page.cpp:
(WebCore::Page::setViewMode):
(WebCore::Page::setNeedsRecalcStyleInAllFrames):
(WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
* style/StyleScope.cpp: Copied from dom/AuthorStyleSheets.cpp.
(WebCore::Style::Scope::Scope):
(WebCore::Style::Scope::styleResolver):
(WebCore::Style::Scope::styleResolverIfExists):
(WebCore::Style::Scope::forNode):
(WebCore::Style::Scope::removePendingSheet):
(WebCore::Style::Scope::addStyleSheetCandidateNode):
(WebCore::Style::Scope::removeStyleSheetCandidateNode):
(WebCore::Style::Scope::collectActiveStyleSheets):
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
(WebCore::Style::Scope::updateStyleResolver):
(WebCore::Style::Scope::activeStyleSheetsForInspector):
(WebCore::Style::Scope::activeStyleSheetsContains):
(WebCore::Style::Scope::flushPendingUpdate):
(WebCore::Style::Scope::clearPendingUpdate):
(WebCore::Style::Scope::scheduleActiveSetUpdate):
(WebCore::Style::Scope::didChangeCandidatesForActiveSet):
(WebCore::Style::Scope::didChangeContentsOrInterpretation):
(WebCore::Style::Scope::pendingUpdateTimerFired):
(WebCore::AuthorStyleSheets::AuthorStyleSheets): Deleted.
(WebCore::AuthorStyleSheets::styleResolver): Deleted.
(WebCore::AuthorStyleSheets::styleResolverIfExists): Deleted.
(WebCore::AuthorStyleSheets::forNode): Deleted.
(WebCore::AuthorStyleSheets::removePendingSheet): Deleted.
(WebCore::AuthorStyleSheets::addStyleSheetCandidateNode): Deleted.
(WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode): Deleted.
(WebCore::AuthorStyleSheets::collectActiveStyleSheets): Deleted.
(WebCore::AuthorStyleSheets::analyzeStyleSheetChange): Deleted.
(WebCore::AuthorStyleSheets::updateActiveStyleSheets): Deleted.
(WebCore::AuthorStyleSheets::updateStyleResolver): Deleted.
(WebCore::AuthorStyleSheets::activeStyleSheetsForInspector): Deleted.
(WebCore::AuthorStyleSheets::activeStyleSheetsContains): Deleted.
(WebCore::AuthorStyleSheets::flushPendingUpdate): Deleted.
(WebCore::AuthorStyleSheets::clearPendingUpdate): Deleted.
(WebCore::AuthorStyleSheets::scheduleActiveSetUpdate): Deleted.
(WebCore::AuthorStyleSheets::didChangeCandidatesForActiveSet): Deleted.
(WebCore::AuthorStyleSheets::didChangeContentsOrInterpretation): Deleted.
(WebCore::AuthorStyleSheets::pendingUpdateTimerFired): Deleted.
* style/StyleScope.h: Copied from dom/AuthorStyleSheets.h.
* style/StyleTreeResolver.cpp:
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::rebuildFontFace):
(WebCore::SVGFontFaceElement::removedFrom):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd):

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

3 years agohttps://vuldb.com/?cvssv3.2012 takes long time to load.
zalan@apple.com [Fri, 7 Oct 2016 16:41:48 +0000 (16:41 +0000)]
https://vuldb.com/?cvssv3.2012 takes long time to load.
https://bugs.webkit.org/show_bug.cgi?id=162994
<rdar://problem/28593746>

Reviewed by Darin Adler.

Source/WebCore:

Stop visiting cousins when we hit the style sharing search threshold.

In addition to mistakenly ignoring the threshold at SharingResolver::findSibling(), we
continued on searching for cousin elements.

Test: fast/selectors/slow-style-sharing-with-long-cousin-list.html

* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::findSibling):
(WebCore::Style::SharingResolver::locateCousinList):

LayoutTests:

It takes ~100 seconds to run this test case without the fix (300ms with the fix).
Surely it will timeout if it gets regressed.

* fast/selectors/slow-style-sharing-with-long-cousin-list-expected.txt: Added.
* fast/selectors/slow-style-sharing-with-long-cousin-list.html: Added.
* platform/mac/TestExpectations: Skip perf test in debug.

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

3 years agoUnreviewed, rolling out r206909.
commit-queue@webkit.org [Fri, 7 Oct 2016 16:39:21 +0000 (16:39 +0000)]
Unreviewed, rolling out r206909.
https://bugs.webkit.org/show_bug.cgi?id=163116

Caused most of  GTK layout tests to crash (Requested by KaL on
#webkit).

Reverted changeset:

"[GTK] UIProcess crashes when using Japanese IM"
https://bugs.webkit.org/show_bug.cgi?id=163011
http://trac.webkit.org/changeset/206909

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

3 years agoMarking contentextensions tests as flaky on mac-wk2.
ryanhaddad@apple.com [Fri, 7 Oct 2016 16:35:37 +0000 (16:35 +0000)]
Marking contentextensions tests as flaky on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=162942

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoNetwork Session: Allow NetworkDataTask decide what to do when override is allowed...
carlosgc@webkit.org [Fri, 7 Oct 2016 16:32:42 +0000 (16:32 +0000)]
Network Session: Allow NetworkDataTask decide what to do when override is allowed for a download
https://bugs.webkit.org/show_bug.cgi?id=163010

Reviewed by Alex Christensen.

Current code always deletes the file before starting a download when allow override is True. In soup backend we
use glib API that takes care of it and tries to ensure that the original file is not deleted if the new file
creation fails for whatever reason.

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::continueDecidePendingDownloadDestination): Pass allowOverride to setPendingDownloadLocation().
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTask::setPendingDownloadLocation): Delete the destination file if exists and allowOverride
is True.

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

3 years ago[Readable Streams API] Implement generic reader functions
commit-queue@webkit.org [Fri, 7 Oct 2016 15:10:46 +0000 (15:10 +0000)]
[Readable Streams API] Implement generic reader functions
https://bugs.webkit.org/show_bug.cgi?id=163003

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2016-10-07
Reviewed by Darin Adler.

Implements reader generic functions defined by spec in order to prepare BYOBReader integration.
Generic functions factorize some code that is used by both DefaultReader and BYOBReader.

No change in behaviour.

* Modules/streams/ReadableStreamDefaultReader.js:
(cancel): Rely on readableStreamReaderGenericCancel.
(releaseLock): Rely on readableStreamReaderGenericRelease.
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultReader): Rely on readableStreamReaderGenericInitialize.
(readableStreamReaderGenericInitialize): Added.
(readableStreamReaderGenericCancel): Added.
(readableStreamReaderGenericRelease): Added.

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

3 years agoStyle Checking Error when Objective C Blocks passed as Argument
jbedard@apple.com [Fri, 7 Oct 2016 15:00:57 +0000 (15:00 +0000)]
Style Checking Error when Objective C Blocks passed as Argument
https://bugs.webkit.org/show_bug.cgi?id=162463

Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py:
(regex_for_lambdas_and_blocks): Consider case where block is passed as a function argument.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_objective_c_block_as_argument): Test case where block is passed as a function argument.

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

3 years agoWebRTC: Test gardening
adam.bergkvist@ericsson.com [Fri, 7 Oct 2016 12:50:21 +0000 (12:50 +0000)]
WebRTC: Test gardening
https://bugs.webkit.org/show_bug.cgi?id=163106

Reviewed by Philippe Normand.

* fast/mediastream/RTCPeerConnection-add-removeTrack-expected.txt:
Update expected results to include webkit prefix on RTCPeerConnection name. (Not GTK+
specific.)
* platform/gtk/TestExpectations:
Skip some tests since the GTK+ MediaPlayer, used with MediaStreams, isn't capable enough.

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

3 years ago[GTK] UIProcess crashes when using Japanese IM
commit-queue@webkit.org [Fri, 7 Oct 2016 12:04:21 +0000 (12:04 +0000)]
[GTK] UIProcess crashes when using Japanese IM
https://bugs.webkit.org/show_bug.cgi?id=163011

We have to reference the current GdkEventKey before we try process it
as later when the lambda body is reached the event could be already
freed.

Patch by Tomas Popela <tpopela@redhat.com> on 2016-10-07
Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseKeyPressEvent):
(webkitWebViewBaseKeyReleaseEvent):
* UIProcess/gtk/InputMethodFilter.h:
Use non-copyable Function so we can use WTFMove to pass the event to
lambda.

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

3 years agoWebRTC: Misc gardening: Use typedefs consistently and remove unused code
adam.bergkvist@ericsson.com [Fri, 7 Oct 2016 11:57:30 +0000 (11:57 +0000)]
WebRTC: Misc gardening: Use typedefs consistently and remove unused code
https://bugs.webkit.org/show_bug.cgi?id=163104

Reviewed by Philippe Normand.

Miscellaneous WebRTC gardening. See file list below for details.

Testing: No change in behavior.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
* Modules/mediastream/MediaEndpointPeerConnection.h:
Move NotImplemented include to cpp-file.
* platform/mediastream/MediaEndpoint.h:
Use MediaPayloadVector typedef (instead of Vector<RefPtr<MediaPayload>>).
* platform/mediastream/PeerMediaDescription.h:
(WebCore::PeerMediaDescription::source): Deleted.
(WebCore::PeerMediaDescription::setSource): Deleted.
Sources are passed to updateSendConfiguration() via a source map and not added to each
PeerMediaDescription anymore. Remove unused code.
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::getDefaultAudioPayloads):
(WebCore::MockMediaEndpoint::getDefaultVideoPayloads):
Use MediaPayloadVector typedef.
* platform/mock/MockMediaEndpoint.h:
Use MediaPayloadVector typedef.

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

3 years ago[GTK] Remove unneeded creation of TextureMapperPlatformLayerProxy
yoon@igalia.com [Fri, 7 Oct 2016 11:45:22 +0000 (11:45 +0000)]
[GTK] Remove unneeded creation of TextureMapperPlatformLayerProxy
https://bugs.webkit.org/show_bug.cgi?id=163101

Reviewed by Žan Doberšek.

Covered by existing tests.

* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBufferData::ImageBufferData): Modified not to create
TextureMapperPlatformLayerProxy if it is not created for the
accelerated 2d canvas.

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

3 years ago[GTK] Expose WebKitDOMHTMLInputElement APIs for form autofill
mcatanzaro@igalia.com [Fri, 7 Oct 2016 09:28:27 +0000 (09:28 +0000)]
[GTK] Expose WebKitDOMHTMLInputElement APIs for form autofill
https://bugs.webkit.org/show_bug.cgi?id=163082

Reviewed by Darin Adler.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
(webkit_dom_html_input_element_get_auto_filled): Added.
(webkit_dom_html_input_element_set_auto_filled): Added.
(webkit_dom_html_input_element_set_editing_value): Added.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:

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

3 years ago[GTK] Docs build failure
philn@webkit.org [Fri, 7 Oct 2016 08:20:20 +0000 (08:20 +0000)]
[GTK] Docs build failure
https://bugs.webkit.org/show_bug.cgi?id=163102

Reviewed by Carlos Garcia Campos.

* gtk/jhbuild.modules: Bump to gtk-doc 1.25 to fix build errors on Debian Testing.

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

3 years agoUse 'use lib $FindBin::Bin' to append Perl module include path
commit-queue@webkit.org [Fri, 7 Oct 2016 07:56:29 +0000 (07:56 +0000)]
Use 'use lib $FindBin::Bin' to append Perl module include path
https://bugs.webkit.org/show_bug.cgi?id=162256

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2016-10-07
Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/WebKitMacros.cmake: Removed '-I' options from
invocation of Perl.

Source/WebCore:

Some Perl  scripts are needed to  be executed with '-I'  switch to
explicitly append Perl module include path.  Use 'use lib' as well
as other Perl scripts do.

* CMakeLists.txt: Removed '-I' options from invocation of Perl.
* DerivedSources.make: Ditto.
* bindings/scripts/generate-bindings.pl: Use 'use lib'.
* bindings/scripts/preprocess-idls.pl: Ditto.
* css/make-css-file-arrays.pl: Ditto.
* css/makegrammar.pl: Ditto.
* css/makeprop.pl: Ditto.
* css/makevalues.pl: Ditto.
* dom/make_dom_exceptions.pl: Ditto.
* dom/make_event_factory.pl: Ditto.
* dom/make_names.pl: Ditto.
* page/make_settings.pl: Ditto.

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

3 years agoRefactor CachedResourceClient::notifyFinished
commit-queue@webkit.org [Fri, 7 Oct 2016 07:02:02 +0000 (07:02 +0000)]
Refactor CachedResourceClient::notifyFinished
https://bugs.webkit.org/show_bug.cgi?id=162060

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-07
Reviewed by Darin Adler.

No change of behavior.

Making CachedResourceClient and CachedRawResourceClient callbacks take CachedResource references and not pointers.
In most cases, the CachedResource parameter is only used for assertions.
Removing that parameter might be contemplated in the future.
The only real case is in RenderImage.

Removed the CachedResource parameter from ContentFilter methods as code was calling these methods with null values.

* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::notifyFinished):
* dom/LoadableClassicScript.h:
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::notifyFinished):
* html/HTMLImageLoader.h:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::continueAfterResponseReceived):
(WebCore::ContentFilter::continueAfterDataReceived):
(WebCore::ContentFilter::continueAfterNotifyFinished):
(WebCore::ContentFilter::deliverResourceData):
* loader/ContentFilter.h:
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::notifyFinished):
* loader/CrossOriginPreflightChecker.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished):
(WebCore::DocumentLoader::handleSubstituteDataLoadNow):
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::responseReceived):
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::DocumentLoader::dataReceived):
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):
(WebCore::DocumentThreadableLoader::dataSent):
(WebCore::DocumentThreadableLoader::responseReceived):
(WebCore::DocumentThreadableLoader::dataReceived):
(WebCore::DocumentThreadableLoader::notifyFinished):
* loader/DocumentThreadableLoader.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::notifyFinished):
* loader/ImageLoader.h:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::triggerEvents):
(WebCore::LinkLoader::notifyFinished):
* loader/LinkLoader.h:
* loader/LinkPreloadResourceClients.cpp:
(WebCore::LinkPreloadResourceClient::triggerEvents):
* loader/LinkPreloadResourceClients.h:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
(WebCore::MediaResource::shouldCacheResponse):
(WebCore::MediaResource::redirectReceived):
(WebCore::MediaResource::dataSent):
(WebCore::MediaResource::dataReceived):
(WebCore::MediaResource::notifyFinished):
(WebCore::MediaResource::getOrCreateReadBuffer):
* loader/MediaResourceLoader.h:
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::processNewCueData):
(WebCore::TextTrackLoader::deprecatedDidReceiveCachedResource):
(WebCore::TextTrackLoader::notifyFinished):
* loader/TextTrackLoader.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::notifyClientsDataWasReceived):
(WebCore::CachedRawResource::didAddClient):
(WebCore::CachedRawResource::redirectReceived):
(WebCore::CachedRawResource::responseReceived):
(WebCore::CachedRawResource::shouldCacheResponse):
(WebCore::CachedRawResource::didSendData):
* loader/cache/CachedRawResourceClient.h:
(WebCore::CachedRawResourceClient::dataSent):
(WebCore::CachedRawResourceClient::responseReceived):
(WebCore::CachedRawResourceClient::shouldCacheResponse):
(WebCore::CachedRawResourceClient::dataReceived):
(WebCore::CachedRawResourceClient::redirectReceived):
(WebCore::CachedRawResourceClient::getOrCreateReadBuffer):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::checkNotify):
(WebCore::CachedResource::didAddClient):
* loader/cache/CachedResourceClient.h:
(WebCore::CachedResourceClient::notifyFinished):
(WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::updateData):
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::notifyFinished):
* loader/icon/IconLoader.h:
* loader/soup/CachedRawResourceSoup.cpp:
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::responseReceived):
(WebCore::WebCoreAVCFResourceLoader::dataReceived):
(WebCore::WebCoreAVCFResourceLoader::notifyFinished):
(WebCore::WebCoreAVCFResourceLoader::fulfillRequestWithResource):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::responseReceived):
(WebCore::WebCoreAVFResourceLoader::dataReceived):
(WebCore::WebCoreAVFResourceLoader::notifyFinished):
(WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::notifyFinished):
* rendering/RenderImage.h:
* rendering/RenderLayerFilterInfo.cpp:
(WebCore::RenderLayer::FilterInfo::setRenderer):
(WebCore::RenderLayer::FilterInfo::notifyFinished):
* rendering/RenderLayerFilterInfo.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::notifyFinished):
* svg/SVGFEImageElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::notifyFinished):
* svg/SVGUseElement.h:
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished):
* xml/parser/XMLDocumentParser.h:

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

3 years agoCachedXSLStylesheet does not need to be updated according Origin/Fetch mode
commit-queue@webkit.org [Fri, 7 Oct 2016 06:18:37 +0000 (06:18 +0000)]
CachedXSLStylesheet does not need to be updated according Origin/Fetch mode
https://bugs.webkit.org/show_bug.cgi?id=162389

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-06
Reviewed by Darin Adler.

No change of behavior.

Making clear that there is no reason to update cached XSLT resources according the origin, given that CORS is never checked and loading is always same-origin.

Renaming CachedResource::isClean to CachedResource::isCORSSameOrigin to better match spec terminology.
Updating HTMLLinkElement accordingly.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::initializeStyleSheet):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::isCORSSameOrigin): Ensuring that this method is not called for resource types for which CORS is not to be used.
(WebCore::CachedResource::isClean): Deleted.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):

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

3 years agoAdd a place for common HTTP Header values
commit-queue@webkit.org [Fri, 7 Oct 2016 06:01:24 +0000 (06:01 +0000)]
Add a place for common HTTP Header values
https://bugs.webkit.org/show_bug.cgi?id=163002

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-06
Reviewed by Alex Christensen.

No change of behavior.

Introducing HTTPHeaderValues with two Content-Type values.

* CMakeLists.txt:
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* WebCore.xcodeproj/project.pbxproj:
* platform/network/HTTPHeaderValues.cpp: Added.
(WebCore::HTTPHeaderValues::TextPlainContentType):
(WebCore::HTTPHeaderValues::FormURLEncodedContentType):
* platform/network/HTTPHeaderValues.h: Added.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):

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

3 years agoCachedResourceRequest should not need to store defer and preload options
commit-queue@webkit.org [Fri, 7 Oct 2016 06:00:10 +0000 (06:00 +0000)]
CachedResourceRequest should not need to store defer and preload options
https://bugs.webkit.org/show_bug.cgi?id=163004

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-06
Reviewed by Alex Christensen.

No change of behavior.

Removing CachedResourceRequest defer and preload fields.
These fields are computed inside CachedResourceLoader instead.

Updated setting of priority from CachedResourceRequest to CachedResource.
Priority is set for any new resource (this covers all cases where no cached resource can be reused from the memory cache).
Priority is set for a cached resource if the request is not a preload request.

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
(WebCore::CachedResourceLoader::requestPreload):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::priority):
(WebCore::CachedResourceRequest::forPreload): Deleted.
(WebCore::CachedResourceRequest::setForPreload): Deleted.
(WebCore::CachedResourceRequest::defer): Deleted.
(WebCore::CachedResourceRequest::setDefer): Deleted.

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

3 years ago[DOMJIT] Support slow path call
utatane.tea@gmail.com [Fri, 7 Oct 2016 05:07:13 +0000 (05:07 +0000)]
[DOMJIT] Support slow path call
https://bugs.webkit.org/show_bug.cgi?id=162978

Reviewed by Saam Barati.

One of the most important features required in DOMJIT::Patchpoint is slow path calls.
DOM operation typically returns DOMWrapper object. At that time, if wrapper cache hits, we can go
to the fast path. However, if we cannot use the cache, we need to go to the slow path to call toJS function.
At that time, slow path call functionality is necessary.

This patch expose DOMJIT::PatchpointParams::addSlowPathCall. We can request slow path call code generation
through this interface. DOMJIT::PatchpointParams automatically leverages appropriate slow path call systems
in each tier. In DFG, we use slow path call system. In FTL, we implement slow path call by using addLatePath
to construct slow path call. But these details are completely hidden by DOMJIT::PatchpointParams. Users can
just use addSlowPathCall.

Since DFG and FTL slow path call systems are implemented in variadic templates, directly using this means
that we need to expose core part of DFG and FTL. For example, DFG::SpeculativeJIT need to be exposed in
such a design. That is too bad. Instead, we use magical macro in DOMJITSlowPathCalls.h. We can list up the
call signatures in DOMJIT_SLOW_PATH_CALLS. DOMJIT uses these signatures to generate an interface to request
slow path calls inside DFG and FTL instead of exposing everything.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGCommon.h:
* dfg/DFGDOMJITPatchpointParams.cpp: Copied from Source/JavaScriptCore/domjit/DOMJITPatchpointParams.h.
(JSC::DFG::dispatch):
* dfg/DFGDOMJITPatchpointParams.h: Copied from Source/JavaScriptCore/domjit/DOMJITPatchpointParams.h.
(JSC::DFG::DOMJITPatchpointParams::DOMJITPatchpointParams):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCallDOM):
(JSC::DFG::SpeculativeJIT::compileCheckDOM):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::extractResult): Deleted.
* domjit/DOMJITPatchpointParams.h:
(JSC::DOMJIT::PatchpointParams::addSlowPathCall):
* domjit/DOMJITSlowPathCalls.h: Copied from Source/JavaScriptCore/domjit/DOMJITPatchpointParams.h.
* ftl/FTLDOMJITPatchpointParams.cpp: Added.
(JSC::FTL::dispatch):
* ftl/FTLDOMJITPatchpointParams.h: Copied from Source/JavaScriptCore/domjit/DOMJITPatchpointParams.h.
(JSC::FTL::DOMJITPatchpointParams::DOMJITPatchpointParams):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCheckDOM):
(JSC::FTL::DFG::LowerDFGToB3::compileCallDOM):
* jit/GPRInfo.h:
(JSC::extractResult):
* jsc.cpp:

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

3 years agocheck-webkit-style: Enable the legal/copyright rule for cpp/h files
commit-queue@webkit.org [Fri, 7 Oct 2016 03:26:29 +0000 (03:26 +0000)]
check-webkit-style: Enable the legal/copyright rule for cpp/h files
https://bugs.webkit.org/show_bug.cgi?id=162707

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-10-06
Reviewed by Darin Adler.

* Scripts/webkitpy/style/checker.py:
Enable this rule by default.

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

3 years agoHeader guard style should be updated to be "#pragma once"
commit-queue@webkit.org [Fri, 7 Oct 2016 03:26:03 +0000 (03:26 +0000)]
Header guard style should be updated to be "#pragma once"
https://bugs.webkit.org/show_bug.cgi?id=159785

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-10-06
Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_for_header_guard):
(_process_lines):
Simplify header_guard check to warn for a missing #pragma once
in header files. For legacy files that contain an #ifndef only
warn if the #ifndef line itself is changing.

* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTestBase.perform_header_guard_check):
(CppStyleTestBase.assert_header_guard):
Helpers for enabling just this warning.

(CppStyleTest.test_build_header_guard):
Test different header guard cases.

* Scripts/webkitpy/style/error_handlers.py:
(DefaultStyleErrorHandler.should_line_be_checked):
Always allow warnings that output for "line 0" which won't be in
the list of modified lines that are 1-based.

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

3 years agoVariation fonts don't affect glyph advances
mmaxfield@apple.com [Fri, 7 Oct 2016 03:21:27 +0000 (03:21 +0000)]
Variation fonts don't affect glyph advances
https://bugs.webkit.org/show_bug.cgi?id=163093

Reviewed by Darin Adler.

Source/WebCore:

Work around known bug <rdar://problem/28662086>. For variation fonts,
CTFontGetAdvancesForGlyphs() gives correct answers but
CTFontGetUnsummedAdvancesForGlyphsAndStyle() doesn't.

Test: fast/text/variations/advances.html

* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::hasVariations):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformWidthForGlyph):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::FontPlatformData):

LayoutTests:

* platform/ios-simulator/TestExpectations: Mark the test
as failing on iOS because that OS doesn't have Skia.
* fast/text/variations/advances-expected.txt: Added.
* fast/text/variations/advances.html: Added.

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

3 years ago[EFL] Skip to test imported/w3c/web-platform-tests/
gyuyoung.kim@webkit.org [Fri, 7 Oct 2016 03:03:57 +0000 (03:03 +0000)]
[EFL] Skip to test imported/w3c/web-platform-tests/

Unreivewed EFL gardening

Too many tests have been failures, timeout, and crash.
Skip it for a while until we fix it.

* platform/efl/TestExpectations:

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

3 years agoUnreviewed, rolling out r206713.
commit-queue@webkit.org [Fri, 7 Oct 2016 02:33:38 +0000 (02:33 +0000)]
Unreviewed, rolling out r206713.
https://bugs.webkit.org/show_bug.cgi?id=163097

triggers apparent codegen bug on ARM 32-bit (Requested by smfr
on #webkit).

Reverted changeset:

"Support transitions/animations of background-position with
right/bottom-relative values"
https://bugs.webkit.org/show_bug.cgi?id=162048
http://trac.webkit.org/changeset/206713

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

3 years agoRemove unused WebCore::contentDispositionType()
dbates@webkit.org [Fri, 7 Oct 2016 00:51:12 +0000 (00:51 +0000)]
Remove unused WebCore::contentDispositionType()
https://bugs.webkit.org/show_bug.cgi?id=163095

Reviewed by Alex Christensen.

The function WebCore::contentDispositionType() was only used by the Chromium and Qt ports
to parse the Content-Disposition HTTP header. Both of these ports have long since been
removed from the repository. We should remove WebCore::contentDispositionType().

* platform/network/HTTPParsers.cpp:
(WebCore::contentDispositionType): Deleted.
* platform/network/HTTPParsers.h:

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

3 years agoUpgrading and constructing element should always report exception instead of rethrowing
rniwa@webkit.org [Fri, 7 Oct 2016 00:46:31 +0000 (00:46 +0000)]
Upgrading and constructing element should always report exception instead of rethrowing
https://bugs.webkit.org/show_bug.cgi?id=162996

Reviewed by Darin Adler.

Source/WebCore:

The latest HTML specification specifies that we must report exceptions thrown during element upgrades:
https://html.spec.whatwg.org/#upgrades

In addition, F2F during 2016 TPAC had a consensus that we should do the same for document.createElement:
https://github.com/w3c/webcomponents/issues/569

Since the HTML parser already reports the exception thrown during custom element construction as it does
not have any JS stack, these changes make exceptions thrown during upgrades and constructions.

In our implementation, this only reduces the code complexity as now we can push the logic to fallback
to HTMLUnknownElement into JSCustomElementInterface's constructElement, which has been renamed
to constructElementWithFallback, and eliminate ShouldClearException enum class entirely. Moreover,
constructElementWithFallback can now return Ref instead of RefPtr.

No new tests. Existing tests have been updated.

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::constructElementWithFallback): Create a HTMLUnknownElement if
an attempt to construct a custom element had failed in lieu of returning nullptr.
(WebCore::JSCustomElementInterface::tryToConstructCustomElement): Renamed from constructElement.
Always report exceptions (the same behavior as ShouldClearException::Clear).
(WebCore::JSCustomElementInterface::upgradeElement): Report exceptions instead of rethrowing.
* bindings/js/JSCustomElementInterface.h:
* dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):

LayoutTests:

Updated the tests to expect exceptions thrown during custom element constructions are always reported.

* fast/custom-elements/Document-createElement-expected.txt:
* fast/custom-elements/Document-createElement.html:
* fast/custom-elements/defined-pseudo-class-expected.txt:
* fast/custom-elements/defined-pseudo-class.html:
* fast/custom-elements/upgrading/Node-cloneNode.html:
* fast/custom-elements/upgrading/upgrading-parser-created-element.html:

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

3 years agoOverwriting an attribute event listener can lead to wrong event listener firing order
cdumez@apple.com [Fri, 7 Oct 2016 00:16:36 +0000 (00:16 +0000)]
Overwriting an attribute event listener can lead to wrong event listener firing order
https://bugs.webkit.org/show_bug.cgi?id=163083

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline a couple of W3C tests now that more checks are passing.

* web-platform-tests/html/webappapis/scripting/events/event-handler-spec-example-expected.txt:
* web-platform-tests/html/webappapis/scripting/events/inline-event-handler-ordering-expected.txt:

Source/WebCore:

Overwriting an attribute event listener could lead to wrong event listener
firing order in WebKit. This is because we were removing the old event
listener and then appending the new one instead of actually *replacing*
the old one.

No new tests, rebaselined existing tests.

* dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::replace):
* dom/EventListenerMap.h:
* dom/EventTarget.cpp:
(WebCore::EventTarget::setAttributeEventListener):
(WebCore::EventTarget::hasActiveEventListeners): Deleted.
(WebCore::EventTarget::dispatchEventForBindings): Deleted.
* dom/EventTarget.h:

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

3 years agoInspector exception in `parseTextForRule()` when pasting into CSS rule selector
commit-queue@webkit.org [Thu, 6 Oct 2016 23:11:01 +0000 (23:11 +0000)]
Inspector exception in `parseTextForRule()` when pasting into CSS rule selector
https://bugs.webkit.org/show_bug.cgi?id=162792

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-10-06
Reviewed by Matt Baker.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype._handleSelectorPaste.parseTextForRule):
Changed regular expression for matching CSS rules to allow newlines in pasted text.

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

3 years agoURLParser: Non-ASCII characters in Non-UTF-8 encoded queries of relative URLs with...
achristensen@apple.com [Thu, 6 Oct 2016 23:05:17 +0000 (23:05 +0000)]
URLParser: Non-ASCII characters in Non-UTF-8 encoded queries of relative URLs with ws, wss, or nonspecial schemes should be UTF-8 encoded
https://bugs.webkit.org/show_bug.cgi?id=163089

Reviewed by Tim Horton.

Source/WebCore:

This is a change similar to r206818 but with relative URLs.
This matches the spec, URL::parse, and other browsers' behavior.
Covered by new API tests for URLParser.
This also fixes tests like http/tests/misc/url-in-utf32le.html when URLParser is enabled.

* platform/URL.cpp:
(WebCore::URL::URL):
Use the same encoding for the URL constructor whether or not the URLParser is enabled.
* platform/URLParser.cpp:
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::parse):
(WebCore::isSpecial): Deleted.
* platform/URLParser.h:
Use UTF-8 for non-special, ws, or wss schemes.

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::checkURL):
(TestWebKitAPI::TEST_F):

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

3 years agoHasOwnPropertyCache flattening dictionaries is causing insane memory usage with the...
sbarati@apple.com [Thu, 6 Oct 2016 22:40:37 +0000 (22:40 +0000)]
HasOwnPropertyCache flattening dictionaries is causing insane memory usage with the uBlock Safari extension
https://bugs.webkit.org/show_bug.cgi?id=163091

Reviewed by Mark Lam.

I'm investigating a real fix for this in:
https://bugs.webkit.org/show_bug.cgi?id=163092
However, it's best to get this out of trunk for now.

* runtime/HasOwnPropertyCache.h:
(JSC::HasOwnPropertyCache::tryAdd):

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

3 years agoAdd back ASSERT(!needsLayout) to RenderTableSection which is now valid
zalan@apple.com [Thu, 6 Oct 2016 21:40:38 +0000 (21:40 +0000)]
Add back ASSERT(!needsLayout) to RenderTableSection which is now valid
https://bugs.webkit.org/show_bug.cgi?id=92954
<rdar://problem/12147973>

Reviewed by Dan Bernstein.

LayoutTests pass fine now with this assert on.

Covered by existing tests.

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paint):

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