[Fetch API] Memory cache should not bypass redirect mode
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-10  Youenn Fablet  <youenn@apple.com>
2
3         [Fetch API] Memory cache should not bypass redirect mode
4         https://bugs.webkit.org/show_bug.cgi?id=162959
5
6         Reviewed by Darin Adler.
7
8         Test: http/tests/fetch/redirectmode-and-preload.html
9
10         Ensure reloading of resources if the redirect modes are different between request and cached resource, and
11         cached resource has redirections.
12
13         As a temporary workaround, we activate resource update for raw resources in
14         shouldUpdateCachedResourceWithCurrentRequest but disable it in canUpdateFromResource.
15         This allows handling reloading of resources with different redirection mode in canUpdateFromResource.
16
17         A future patch should allow loading cached raw resources from other cached raw resources.
18
19         * loader/cache/CachedResource.h:
20         (WebCore::CachedResource::hasRedirections):
21         * loader/cache/CachedResourceLoader.cpp:
22         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
23         (WebCore::canUpdateFromResource):
24         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
25
26 2016-10-10  Youenn Fablet  <youenn@apple.com>
27
28         Attribute getter binding generated code should use more references
29         https://bugs.webkit.org/show_bug.cgi?id=163179
30
31         Reviewed by Darin Adler.
32
33         No change of behavior.
34
35         Using more references in attribute getter generated code since BindingCaller::attribute can do the
36         pointer-to-references checks once for all.
37
38         Needed to update GenerateCallWith and NativeToJSValue to handle the case where references (attribute getters) or
39         pointers (methods and attribute setters) are to be used.
40         Future refactoring should allign methods/attribute setters to attribute getters.
41
42         * bindings/js/JSDOMBinding.h:
43         (WebCore::BindingCaller::attribute):
44         * bindings/scripts/CodeGeneratorJS.pm:
45         (GenerateImplementation):
46         (GenerateCallWith):
47         (NativeToJSValue):
48         (JSValueToNative):
49         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
50         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
51         * bindings/scripts/test/JS/JSTestException.cpp:
52         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
53         * bindings/scripts/test/JS/JSTestInterface.cpp:
54         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
55         * bindings/scripts/test/JS/JSTestNode.cpp:
56         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
57         * bindings/scripts/test/JS/JSTestObj.cpp:
58         * bindings/scripts/test/JS/JSattribute.cpp:
59
60 2016-10-10  Youenn Fablet  <youenn@apple.com>
61
62         Fix Mac Win build after https://trac.webkit.org/changeset/206966
63         https://bugs.webkit.org/show_bug.cgi?id=163199
64
65         Unreviewed.
66
67         * bindings/js/JSDOMBinding.h: Marking rejectPromiseWithGetterTypeError as WEBCORE_EXPORT.
68
69 2016-10-09  Antti Koivisto  <antti@apple.com>
70
71         Enable optimized stylesheet updates in shadow trees
72         https://bugs.webkit.org/show_bug.cgi?id=163180
73
74         Reviewed by Darin Adler.
75
76         When we get a new stylesheet (for example when load completes) we invalidate only
77         those elements in DOM that are affected by the new sheet. This patch makes the
78         optimization also work in shadow trees.
79
80         Test: fast/shadow-dom/scoped-style-invalidation.html
81
82         * css/StyleInvalidationAnalysis.cpp:
83         (WebCore::StyleInvalidationAnalysis::invalidateStyle):
84         * css/StyleInvalidationAnalysis.h:
85         * dom/Document.cpp:
86         (WebCore::Document::didRemoveAllPendingStylesheet):
87         * style/StyleScope.cpp:
88         (WebCore::Style::Scope::removePendingSheet):
89         (WebCore::Style::Scope::analyzeStyleSheetChange):
90         (WebCore::Style::Scope::updateActiveStyleSheets):
91
92 2016-10-10  Youenn Fablet  <youenn@apple.com>
93
94         Refactor binding generated casted-this checks for attribute setters
95         https://bugs.webkit.org/show_bug.cgi?id=163181
96
97         Reviewed by Darin Adler.
98
99         No change of behavior.
100         Covered by existing tests and binding expectations.
101
102         Adding support for attribute setter in BindingCaller.
103         Updating binding generator to make use of it.
104         Future refactoring should use more reference and rename castedThis to thisObject, like for getters.
105
106         * bindings/js/JSDOMBinding.h:
107         (WebCore::BindingCaller::setAttribute):
108         * bindings/scripts/CodeGeneratorJS.pm:
109         (GenerateImplementation):
110         * bindings/scripts/test/JS/JSTestInterface.cpp:
111         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
112         * bindings/scripts/test/JS/JSTestNode.cpp:
113         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
114         * bindings/scripts/test/JS/JSTestObj.cpp:
115         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
116         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
117
118 2016-10-09  Darin Adler  <darin@apple.com>
119
120         Move encrypted media from legacy to new DOM exceptions
121         https://bugs.webkit.org/show_bug.cgi?id=163194
122
123         Reviewed by Youenn Fablet.
124
125         * Modules/encryptedmedia/CDM.cpp:
126         (WebCore::CDM::createSession): Take a reference instead of a pointer.
127         * Modules/encryptedmedia/CDM.h: Updated for above change.
128
129         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
130         (WebCore::WebKitMediaKeySession::create): Take a reference instead of a pointer.
131         (WebCore::WebKitMediaKeySession::MediaKeySession): Ditto.
132         (WebCore::WebKitMediaKeySession::~MediaKeySession): Removed unneeded code that
133         sets m_session to null.
134         (WebCore::WebKitMediaKeySession::keyRequestTimerFired): Use auto.
135         (WebCore::WebKitMediaKeySession::update): Use ExceptionOr.
136         (WebCore::WebKitMediaKeySession::addKeyTimerFired): Use m_keys directly instead
137         of calling the keys function.
138         (WebCore::WebKitMediaKeySession::sendError): Set m_error directly instead of
139         calling the setError function.
140         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory): Use auto.
141         (WebCore::WebKitMediaKeySession::hasPendingActivity): Check m_session directly
142         instead of writing !isClosed.
143         (WebCore::WebKitMediaKeySession::setError): Deleted.
144
145         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: Use pragma once. Removed
146         unneeded includes. Changed create to take a reference instead of a pointer.
147         Made most members and base classes private instead of public. Also removed
148         a few now-unneeded functions. Made everything that was formerly protected
149         private instead, since the two are the same in a final class.
150
151         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: Removed unneeded comments.
152         Moved from MayThrowLegacyException to MayThrowException.
153
154         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
155         (WebCore::WebKitMediaKeys::create): Use ExceptionOr.
156         (WebCore::WebKitMediaKeys::MediaKeys): Made argument be an rvalue reference.
157         Also initialize m_mediaElement in the class definition.
158         (WebCore::WebKitMediaKeys::~MediaKeys): Call detachKeys instead of setKeys(nullptr).
159         (WebCore::WebKitMediaKeys::createSession): Use ExceptionOr. Also pass reference
160         insteead of pointer to create. Also removed unneeded separate checks for null
161         strings in code that already calls isEmpty.
162         (WebCore::WebKitMediaKeys::isTypeSupported): Removed unneeded checks for null strings
163         in code that already calls isEmpty.
164         (WebCore::WebKitMediaKeys::cdmMediaPlayer): Tweaked a bit.
165         (WebCore::WebKitMediaKeys::cachedKeyForKeyId): Use auto.
166
167         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h: Use pragma once. Removed unneeded includes.
168         Changed cdm() function to return a reference. Initialize m_mediaElement.
169         Use private instead of protected.
170
171         * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: Use ConstructorMayThrowException
172         and MayThrowException instead of the legacy versions.
173
174 2016-10-09  Zan Dobersek  <zdobersek@igalia.com>
175
176         ENABLE_LEGACY_ENCRYPTED_MEDIA interfaces should have a hard-coded WebKit prefix
177         https://bugs.webkit.org/show_bug.cgi?id=162982
178
179         Reviewed by Jer Noble.
180
181         Have the Web-exposed interfaces guarded by ENABLE_LEGACY_ENCRYPTED_MEDIA also use
182         the WebKit prefix in the implementations. This will prevent conflicts between
183         interfaces with same names in both the legacy API and the future EME API.
184
185         Most of the interfaces in this legacy API already used the WebKit prefix when
186         exposed via JS bindings. The only exception is MediaKeyNeededEvent, which gets
187         prefixed in this patch.
188
189         The interface implementations for this legacy API are also moved under the
190         Modules/encryptedmedia/legacy/ directory.
191
192         No new tests -- covered by existing tests (with the relevant changes reflected
193         in the updated baselines).
194
195         * CMakeLists.txt:
196         * DerivedSources.cpp:
197         * DerivedSources.make:
198         * Modules/encryptedmedia/CDM.cpp:
199         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
200         (WebCore::CDMSessionClearKey::generateKeyRequest):
201         (WebCore::CDMSessionClearKey::update):
202         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp.
203         (WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
204         (WebCore::WebKitMediaKeyMessageEvent::~WebKitMediaKeyMessageEvent):
205         (WebCore::WebKitMediaKeyMessageEvent::eventInterface):
206         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h.
207         (WebCore::WebKitMediaKeyMessageEvent::create):
208         (WebCore::WebKitMediaKeyMessageEvent::createForBindings):
209         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl.
210         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp.
211         (WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
212         (WebCore::WebKitMediaKeyNeededEvent::~WebKitMediaKeyNeededEvent):
213         (WebCore::WebKitMediaKeyNeededEvent::eventInterface):
214         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h.
215         (WebCore::WebKitMediaKeyNeededEvent::create):
216         (WebCore::WebKitMediaKeyNeededEvent::createForBindings):
217         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.idl.
218         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp.
219         (WebCore::WebKitMediaKeySession::create):
220         (WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
221         (WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
222         (WebCore::WebKitMediaKeySession::setError):
223         (WebCore::WebKitMediaKeySession::close):
224         (WebCore::WebKitMediaKeySession::cachedKeyForKeyId):
225         (WebCore::WebKitMediaKeySession::sessionId):
226         (WebCore::WebKitMediaKeySession::generateKeyRequest):
227         (WebCore::WebKitMediaKeySession::keyRequestTimerFired):
228         (WebCore::WebKitMediaKeySession::update):
229         (WebCore::WebKitMediaKeySession::addKeyTimerFired):
230         (WebCore::WebKitMediaKeySession::sendMessage):
231         (WebCore::WebKitMediaKeySession::sendError):
232         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
233         (WebCore::WebKitMediaKeySession::hasPendingActivity):
234         (WebCore::WebKitMediaKeySession::stop):
235         (WebCore::WebKitMediaKeySession::activeDOMObjectName):
236         (WebCore::WebKitMediaKeySession::canSuspendForDocumentSuspension):
237         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.h.
238         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl.
239         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp.
240         (WebCore::WebKitMediaKeys::create):
241         (WebCore::WebKitMediaKeys::WebKitMediaKeys):
242         (WebCore::WebKitMediaKeys::~WebKitMediaKeys):
243         (WebCore::WebKitMediaKeys::createSession):
244         (WebCore::WebKitMediaKeys::isTypeSupported):
245         (WebCore::WebKitMediaKeys::setMediaElement):
246         (WebCore::WebKitMediaKeys::cdmMediaPlayer):
247         (WebCore::WebKitMediaKeys::keyAdded):
248         (WebCore::WebKitMediaKeys::cachedKeyForKeyId):
249         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.h.
250         * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.idl.
251         * bindings/js/JSDictionary.cpp:
252         (WebCore::JSDictionary::convertValue):
253         * bindings/js/JSDictionary.h:
254         * dom/EventNames.in:
255         * dom/EventTargetFactory.in:
256         * html/HTMLMediaElement.cpp:
257         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
258         (WebCore::HTMLMediaElement::setMediaKeys):
259         * html/HTMLMediaElement.h:
260         (WebCore::HTMLMediaElement::keys):
261         * html/HTMLMediaElement.idl:
262         * html/WebKitMediaKeyError.h: Renamed from Source/WebCore/html/MediaKeyError.h.
263         (WebCore::WebKitMediaKeyError::create):
264         (WebCore::WebKitMediaKeyError::WebKitMediaKeyError):
265         * html/WebKitMediaKeyError.idl: Renamed from Source/WebCore/html/MediaKeyError.idl.
266         * testing/MockCDM.cpp:
267         (WebCore::MockCDMSession::generateKeyRequest):
268         (WebCore::MockCDMSession::update):
269
270 2016-10-09  Zan Dobersek  <zdobersek@igalia.com>
271
272         Remove stale ENABLE(ENCRYPTED_MEDIA) code in HTMLMediaElement
273         https://bugs.webkit.org/show_bug.cgi?id=163111
274
275         Reviewed by Alex Christensen.
276
277         Remove three method implementations in HTMLMediaElement which had their
278         declarations and the related WebIDL entries removed in the first ENCRYPTED_MEDIA
279         purge in r206440.
280
281         No new tests -- no changes in behavior.
282
283         * html/HTMLMediaElement.cpp:
284         (WebCore::HTMLMediaElement::webkitGenerateKeyRequest): Deleted.
285         (WebCore::HTMLMediaElement::webkitAddKey): Deleted.
286         (WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.
287
288 2016-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>
289
290         Support InputEvent.inputType for the new InputEvent spec
291         https://bugs.webkit.org/show_bug.cgi?id=163025
292         <rdar://problem/28658092>
293
294         Reviewed by Darin Adler.
295
296         Adds support for the inputType attribute of InputEvent. To do this, we introduce a helper to
297         map EditActions to inputType names, and also split out ambiguous EditActions (such as
298         EditActionTyping) into more specific subtypes (such as EditActionTypingDeleteBackward,
299         EditActionTypingInsertParagraph, etc.), each of which corresponds to an inputType.
300
301         In places where we create CompositeEditCommands, we now pass in these specific EditActions
302         where appropriate, and when dispatching `beforeinput` and `input` events, we ask the
303         CompositeEditCommand for its input type name, which it derives from its editingAction.
304
305         Tests: fast/events/before-input-prevent-biu.html
306                fast/events/before-input-prevent-cut.html
307                fast/events/before-input-prevent-paste.html
308                fast/events/before-input-prevent-typing.html
309                fast/events/before-input-prevent-undo.html
310
311         * dom/InputEvent.h:
312         * dom/Node.cpp:
313         (WebCore::Node::dispatchInputEvent):
314         * dom/Node.h:
315         * editing/CompositeEditCommand.cpp:
316         (WebCore::CompositeEditCommand::apply):
317         (WebCore::CompositeEditCommand::inputEventTypeName):
318
319         Allows a CompositeEditCommand to specify the inputType its corresponding `beforeinput` and `input` events
320         should have.
321
322         * editing/CompositeEditCommand.h:
323         (WebCore::CompositeEditCommand::shouldStopCaretBlinking): Deleted.
324         * editing/EditAction.h:
325         * editing/EditCommand.cpp:
326         (WebCore::inputTypeNameForEditingAction):
327         * editing/EditCommand.h:
328         * editing/Editor.cpp:
329         (WebCore::Editor::willApplyEditing):
330         (WebCore::Editor::appliedEditing):
331         (WebCore::Editor::willUnapplyEditing):
332         (WebCore::Editor::unappliedEditing):
333         (WebCore::Editor::willReapplyEditing):
334         (WebCore::Editor::reappliedEditing):
335         (WebCore::Editor::computeAndSetTypingStyle):
336         * editing/InsertListCommand.cpp:
337         (WebCore::InsertListCommand::editingAction):
338         * editing/InsertListCommand.h:
339         (WebCore::InsertListCommand::preservesTypingStyle): Deleted.
340         (WebCore::InsertListCommand::editingAction): Deleted.
341         * editing/ReplaceRangeWithTextCommand.cpp:
342         (WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand):
343         * editing/SpellingCorrectionCommand.cpp:
344         (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
345         * editing/TypingCommand.cpp:
346         (WebCore::editActionForTypingCommand):
347         (WebCore::TypingCommand::TypingCommand):
348         (WebCore::TypingCommand::inputEventTypeName):
349
350         The editingAction() of a TypingCommand is the first editing action the TypingCommand was initialized using.
351         Since subsequent typing commands update the last open typing command, we override inputEventTypeName here to
352         use the last updated editing action rather than the default (initial) editing action.
353
354         (WebCore::TypingCommand::willAddTypingToOpenCommand):
355         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
356         (WebCore::TypingCommand::insertParagraphSeparator):
357         * editing/TypingCommand.h:
358
359 2016-10-09  Darin Adler  <darin@apple.com>
360
361         Move ApplePaySession from legacy to new DOM exceptions
362         https://bugs.webkit.org/show_bug.cgi?id=163191
363
364         Reviewed by Sam Weinig.
365
366         * Modules/applepay/ApplePaySession.cpp:
367         (WebCore::ApplePaySession::create): Use ExceptionOr.
368         (WebCore::ApplePaySession::ApplePaySession): Moved initialization
369         of two of the data members to class definition.
370         (WebCore::ApplePaySession::supportsVersion): Use ExceptionOr.
371         (WebCore::ApplePaySession::canMakePayments): Ditto.
372         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard): Ditto.
373         (WebCore::ApplePaySession::openPaymentSetup): Ditto.
374         (WebCore::ApplePaySession::begin): Ditto.
375         (WebCore::ApplePaySession::abort): Ditto.
376         (WebCore::ApplePaySession::completeMerchantValidation): Ditto.
377         (WebCore::ApplePaySession::completeShippingMethodSelection): Ditto.
378         (WebCore::ApplePaySession::completeShippingContactSelection): Ditto.
379         (WebCore::ApplePaySession::completePaymentMethodSelection): Ditto.
380         (WebCore::ApplePaySession::completePayment): Ditto.
381         (WebCore::ApplePaySession::validateMerchant): Use auto and get instead of
382         using a RefPtr type and * for event dispatching.
383         (WebCore::ApplePaySession::didAuthorizePayment): Ditto.
384         (WebCore::ApplePaySession::didSelectShippingMethod): Ditto.
385         (WebCore::ApplePaySession::didSelectShippingContact): Ditto.
386         (WebCore::ApplePaySession::didSelectPaymentMethod): Ditto.
387         (WebCore::ApplePaySession::didCancelPayment): Ditto.
388         (WebCore::ApplePaySession::paymentCoordinator): Moved dereferencing
389         inside the downcast.
390
391         * Modules/applepay/ApplePaySession.h: Updated for changes above.
392
393         * Modules/applepay/ApplePaySession.idl: Use MayThrowException.
394
395         * bindings/js/JSApplePaySessionCustom.cpp:
396         (WebCore::JSApplePaySession::completeShippingMethodSelection):
397         Use propagateException.
398         (WebCore::JSApplePaySession::completeShippingContactSelection): Ditto.
399         (WebCore::JSApplePaySession::completePaymentMethodSelection): Ditto.
400
401         * bindings/js/JSDOMBinding.h: Added implementation of toJSBoolean.
402
403         * bindings/scripts/CodeGeneratorJS.pm:
404         (GenerateConstructorDefinition): Generate the different arguments for
405         toJSNewlyCreated when ConstructorMayThrowException is specified that
406         activate the version of that function that handles exceptions.
407
408         * bindings/scripts/IDLAttributes.txt: Added ConstructorMayThrowException.
409
410 2016-10-09  Darin Adler  <darin@apple.com>
411
412         Replace all uses of ExceptionCodeWithMessage with WebCore::Exception
413         https://bugs.webkit.org/show_bug.cgi?id=163178
414
415         Reviewed by Sam Weinig.
416
417         * Modules/indexeddb/IDBCursor.cpp:
418         (WebCore::IDBCursor::stringToDirection): Return an Optional instead of
419         using an ExceptionCode out argument, since this function just needs to
420         indicate failure, not actually throw an exception.
421         (WebCore::IDBCursor::update): Return ExceptionOr instead of using an
422         ExceptionCodeWithMessage out argument.
423         (WebCore::IDBCursor::advance): Ditto.
424         (WebCore::IDBCursor::continueFunction): Ditto.
425         (WebCore::IDBCursor::deleteFunction): Ditto.
426         * Modules/indexeddb/IDBCursor.h: Updated for above changes.
427
428         * Modules/indexeddb/IDBCursor.idl: Sorted extended attributes alphabetically.
429         Use MayThrowException instead of MayThrowLegacyExceptionWithMessage.
430
431         * Modules/indexeddb/IDBDatabase.cpp:
432         (WebCore::IDBDatabase::createObjectStore): Return ExceptionOr instead of
433         using an ExceptionCodeWithMessage out argument.
434         (WebCore::IDBDatabase::transaction): Ditto.
435         (WebCore::IDBDatabase::deleteObjectStore): Ditto.
436         * Modules/indexeddb/IDBDatabase.h: Updated for above changes.
437
438         * Modules/indexeddb/IDBDatabase.idl: Use MayThrowException instead of
439         MayThrowLegacyExceptionWithMessage.
440
441         * Modules/indexeddb/IDBFactory.cpp:
442         (WebCore::IDBFactory::open): Return ExceptionOr instead of
443         using an ExceptionCodeWithMessage out argument.
444         (WebCore::IDBFactory::openInternal): Ditto.
445         (WebCore::IDBFactory::deleteDatabase): Ditto.
446         (WebCore::IDBFactory::cmp): Ditto.
447         * Modules/indexeddb/IDBFactory.h: Updated for above changes.
448
449         * Modules/indexeddb/IDBFactory.idl: Use MayThrowException instead of
450         MayThrowLegacyExceptionWithMessage.
451
452         * Modules/indexeddb/IDBIndex.cpp:
453         (WebCore::IDBIndex::openCursor): Return ExceptionOr instead of
454         using an ExceptionCodeWithMessage out argument.
455         (WebCore::IDBIndex::count): Ditto.
456         (WebCore::IDBIndex::doCount): Ditto.
457         (WebCore::IDBIndex::openKeyCursor): Ditto.
458         (WebCore::IDBIndex::get): Ditto.
459         (WebCore::IDBIndex::doGet): Ditto.
460         (WebCore::IDBIndex::getKey): Ditto.
461         (WebCore::IDBIndex::doGetKey): Ditto.
462         * Modules/indexeddb/IDBIndex.h: Updated for above changes.
463
464         * Modules/indexeddb/IDBIndex.idl: Use MayThrowException instead of
465         MayThrowLegacyExceptionWithMessage.
466
467         * Modules/indexeddb/IDBKeyRange.cpp:
468         (WebCore::IDBKeyRange::only): Return ExceptionOr instead of
469         using an ExceptionCode out argument.
470         (WebCore::IDBKeyRange::lowerBound): Ditto.
471         (WebCore::IDBKeyRange::upperBound): Ditto.
472         (WebCore::IDBKeyRange::bound): Ditto.
473         * Modules/indexeddb/IDBKeyRange.h: Updated for above changes.
474         * Modules/indexeddb/IDBKeyRange.idl: Use MayThrowException instead of
475         MayThrowLegacyException.
476
477         * Modules/indexeddb/IDBObjectStore.cpp:
478         (WebCore::IDBObjectStore::openCursor): Return ExceptionOr instead of
479         using an ExceptionCodeWithMessage out argument.
480         (WebCore::IDBObjectStore::get): Ditto.
481         (WebCore::IDBObjectStore::add): Ditto.
482         (WebCore::IDBObjectStore::put): Ditto.
483         (WebCore::IDBObjectStore::putForCursorUpdate): Ditto.
484         (WebCore::IDBObjectStore::putOrAdd): Ditto.
485         (WebCore::IDBObjectStore::deleteFunction): Ditto.
486         (WebCore::IDBObjectStore::doDelete): Ditto.
487         (WebCore::IDBObjectStore::clear): Ditto.
488         (WebCore::IDBObjectStore::createIndex): Ditto.
489         (WebCore::IDBObjectStore::index): Ditto.
490         (WebCore::IDBObjectStore::deleteIndex): Ditto.
491         (WebCore::IDBObjectStore::count): Ditto.
492         (WebCore::IDBObjectStore::doCount): Ditto.
493         * Modules/indexeddb/IDBObjectStore.h: Updated for above changes.
494
495         * Modules/indexeddb/IDBObjectStore.idl: Use MayThrowException instead of
496         MayThrowLegacyExceptionWithMessage.
497
498         * Modules/indexeddb/IDBRequest.cpp:
499         (WebCore::IDBRequest::errorCode): Deleted. Was dead code.
500         (WebCore::IDBRequest::error): Return ExceptionOr instead of
501         using an ExceptionCodeWithMessage out argument.
502         * Modules/indexeddb/IDBRequest.h: Updated for above changes.
503
504         * Modules/indexeddb/IDBRequest.idl: Use GetterMayThrowException instead of
505         GetterMayThrowLegacyExceptionWithMessage.
506
507         * Modules/indexeddb/IDBTransaction.cpp:
508         (WebCore::IDBTransaction::stringToMode): Return an Optional instead of
509         using an ExceptionCode out argument, since this function just needs to
510         indicate failure, not actually throw an exception.
511         (WebCore::IDBTransaction::db): Tweaked code a bit.
512         (WebCore::IDBTransaction::error): Return a pointer instead of a RefPtr.
513         (WebCore::IDBTransaction::objectStore): Return ExceptionOr instead of
514         using an ExceptionCodeWithMessage out argument.
515         (WebCore::IDBTransaction::abortDueToFailedRequest): Call internalAbort.
516         (WebCore::IDBTransaction::abort): Return ExceptionOr instead of
517         using an ExceptionCodeWithMessage out argument.
518         (WebCore::IDBTransaction::internalAbort): Added a version that asserts
519         instead of throwing an exception for internal use.
520         (WebCore::IDBTransaction::stop): Call internalAbort.
521         * Modules/indexeddb/IDBTransaction.h: Updated for above changes.
522
523         * Modules/indexeddb/IDBTransaction.idl: Use MayThrowException instead of
524         MayThrowLegacyExceptionWithMessage.
525
526         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
527         (WebCore::IDBClient::IDBConnectionProxy::openDatabase): Updated to return
528         a Ref instead of a RefPtr, since the function can never return null.
529         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase): Ditto.
530         * Modules/indexeddb/client/IDBConnectionProxy.h: Updated for above changes.
531
532         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
533         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask): Updated
534         exception handling to use ExceptionOr instead of ExceptionCodeWithMessage.
535         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask): Ditto.
536         * Modules/mediastream/MediaEndpointSessionDescription.cpp:
537         (WebCore::MediaEndpointSessionDescription::create): Ditto.
538         * Modules/mediastream/MediaEndpointSessionDescription.h: Updated for above change.
539
540         * bindings/js/JSDOMBinding.cpp:
541         (WebCore::createDOMException): Added overload for Exception.
542         (WebCore::throwDOMException): Deleted overload for ExceptionCodeWithMessage.
543         Updated code to call the new createDOMException function.
544         (WebCore::setDOMExceptionSlow): Ditto.
545         (WebCore::setDOMException): Ditto.
546
547         * bindings/js/JSDOMBinding.h: Added overload of createDOMException that takes
548         an Exception. Deleted functions dealing with ExceptionCodeWithMessage. Fixed
549         interface of toJSNumber and toJSNullableNumber and implemented toJSNumber.
550
551         * bindings/js/JSDOMPromise.cpp:
552         (WebCore::DeferredPromise::reject): Added overload that takes an Exception.
553         * bindings/js/JSDOMPromise.h: Updated for above change.
554
555         * bindings/js/JSHistoryCustom.cpp:
556         (WebCore::JSHistory::pushState): Use propagateException to deal with
557         ExceptionOr instead of ExceptionCodeWithMessage.
558         (WebCore::JSHistory::replaceState): Ditto.
559
560         * bindings/js/JSIDBDatabaseCustom.cpp:
561         (WebCore::JSIDBDatabase::createObjectStore): Use toJS and
562         to deal with ExceptionOr rather than setDOMException to deal
563         with ExceptionCodeWithMessage.
564
565         * bindings/js/JSIDBRequestCustom.cpp:
566         (WebCore::JSIDBRequest::result): Use propagateException and
567         Exception rather than setDOMException and ExceptionCodeWithMessage.
568
569         * bindings/scripts/CodeGeneratorJS.pm:
570         (GenerateImplementation): Removed support for GetterMayThrowLegacyExceptionWithMessage,
571         SetterMayThrowLegacyExceptionWithMessage, and MayThrowLegacyExceptionWithMessage.
572         (GenerateReturnParameters): Ditto.
573         (GenerateImplementationFunctionCall): Ditto.
574         (GenerateConstructorDefinition): Ditto.
575
576         * bindings/scripts/IDLAttributes.txt: Removed GetterMayThrowLegacyExceptionWithMessage,
577         SetterMayThrowLegacyExceptionWithMessage, and MayThrowLegacyExceptionWithMessage.
578
579         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
580         * bindings/scripts/test/TestObj.idl: Removed tests cases for now-removed attributes.
581
582         * dom/CustomElementRegistry.idl: Use MayThrowException instead of
583         MayThrowLegacyExceptionWithMessage.
584
585         * dom/ExceptionCode.h: Removed ExceptionCodeWithMessage. Also updated to use pragma
586         once, removed include of WTFString.h and switched to using instead of typedef.
587
588         * history/HistoryItem.h: Return a pointer instead of a RefPtr from stateObject
589         to cut down a little on unnecessary reference count churn.
590
591         * inspector/InspectorIndexedDBAgent.cpp: Updated all the code that uses IDB
592         classes to use the new versions rather than the old ExceptionCodeWithMessage versions.
593
594         * page/DOMWindow.cpp:
595         (WebCore::DOMWindow::history): Pass a reference instead of a pointer.
596
597         * page/History.cpp:
598         (WebCore::History::History): Take a reference instead of a pointer.
599         (WebCore::History::length): Tweaked to use a local variable.
600         (WebCore::History::state): Return a pointer instead of a PassRefPtr.
601         (WebCore::History::stateInternal): Ditto. Also use early return consistently.
602         (WebCore::History::isSameAsCurrentState): Updated for above change.
603         (WebCore::History::stateObjectAdded): Return ExceptionOr rather than taking an
604         ExceptionCodeWithMessage out argument.
605
606         * page/History.h: Use pragma once. Removed some unneeded includes. Marked class final.
607         Updated for changes above.
608
609         * page/History.idl: Use MayThrowException instead of MayThrowLegacyException.
610
611 2016-10-07  Ryosuke Niwa  <rniwa@webkit.org>
612
613         REGRESSION(r165103): labels list doesn't get invalidated when other lists are invalidated at document level
614         https://bugs.webkit.org/show_bug.cgi?id=163145
615
616         Reviewed by Darin Adler.
617
618         The bug was caused by Document::invalidateNodeListAndCollectionCaches removing all node lists regardless
619         of whether they have been invalidated or not.
620
621         Fixed the bug by removing only those node lists that got invalidated via LiveNodeList::invalidateCache.
622
623         Test: fast/dom/NodeList/form-labels-length.html
624
625         * dom/Document.cpp:
626         (WebCore::Document::Document):
627         (WebCore::Document::unregisterNodeListForInvalidation): Removed the conditional which allowed removal to
628         happen while m_listsInvalidatedAtDocument is empty inside invalidateNodeListAndCollectionCaches.
629         * dom/Document.h:
630         * dom/Node.cpp:
631         (WebCore::Document::invalidateNodeListAndCollectionCaches): Just remove the node lists being invalidated via
632         LiveNodeList's invalidateCache, which calls unregisterNodeListForInvalidation, instead of removing them all.
633         We make a copy of the list of node lists into a local vector because mutating HashMap while iterating over it
634         is not a safe operation.
635
636 2016-10-09  Chris Dumez  <cdumez@apple.com>
637
638         Update generated bindings code so that dictionary structures no longer need explicit constructors
639         https://bugs.webkit.org/show_bug.cgi?id=163188
640
641         Reviewed by Darin Adler.
642
643         Update generated bindings code so that dictionary structures no longer
644         need explicit constructors. We now call the default constructor and
645         then initialize the members one by one.
646
647         * bindings/scripts/CodeGeneratorJS.pm:
648         (GenerateDictionaryImplementationContent):
649         * bindings/scripts/test/JS/JSTestObj.cpp:
650         (WebCore::convertDictionary<TestObj::Dictionary>):
651         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
652         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
653         (WebCore::convertDictionary<AlternateDictionaryName>):
654         (WebCore::convertDictionary<TestObj::ParentDictionary>):
655         (WebCore::convertDictionary<TestObj::ChildDictionary>):
656         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
657         (WebCore::convertDictionary<TestStandaloneDictionary>):
658         * dom/ClipboardEvent.h:
659         * dom/CustomEvent.h:
660         * dom/EventInit.h:
661         (WebCore::EventInit::EventInit): Deleted.
662         * dom/EventModifierInit.h:
663         (WebCore::EventModifierInit::EventModifierInit): Deleted.
664         * dom/KeyboardEvent.cpp:
665         (WebCore::KeyboardEvent::KeyboardEvent):
666         * dom/KeyboardEvent.h:
667         * dom/KeyboardEvent.idl:
668         * dom/UIEventInit.h:
669         (WebCore::UIEventInit::UIEventInit): Deleted.
670         * editing/Editor.cpp:
671         (WebCore::Editor::dispatchCPPEvent):
672
673 2016-10-09  Fujii Hironori  <Hironori.Fujii@sony.com>
674
675         [CMake] CMake does not support the dep files for implicit dependency
676         https://bugs.webkit.org/show_bug.cgi?id=161433
677
678         Reviewed by Brent Fulgham.
679
680         Created a Perl script to generate all IDL bindings for CMake.
681         This script can regenerate outdated bindings by based on the
682         supplemental dependency and dep files created by
683         '--write-dependencies' switch of generate-bindings.pl.
684
685         add_custom_target is used to invoke the script instead of
686         add_custom_command because Ninja deletes all output files before
687         executing the command in case of add_custom_command.
688
689         USES_TERMINAL option of add_custom_target has two effects:
690         1) Not buffering output of the command
691         2) Invoking the command in the special Ninja pool which inhibits parallel build
692         One needs to use CMake 3.2 or later to enable this feature.
693
694         * CMakeLists.txt: Specified target names for
695         GENERATE_BINDINGS. Added dependency for the targets.
696         * bindings/scripts/generate-bindings-all.pl: Added.
697
698 2016-10-09  Chris Dumez  <cdumez@apple.com>
699
700         Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
701         https://bugs.webkit.org/show_bug.cgi?id=163176
702
703         Reviewed by Darin Adler.
704
705         Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
706         and use a proper constructor instead, like in the specification:
707         - https://www.w3.org/TR/uievents/#interface-keyboardevent
708
709         Also add support for passing modifierAltGraph / modifierCapsLock
710         in the inialization dictionary as we support those modifiers via
711         getModifierState().
712
713         No new tests, extended existing test.
714
715         * CMakeLists.txt:
716         * DerivedSources.cpp:
717         * DerivedSources.make:
718         * WebCore.xcodeproj/project.pbxproj:
719         * dom/EventModifierInit.h: Added.
720         (WebCore::EventModifierInit::EventModifierInit):
721         * dom/EventModifierInit.idl: Added.
722         * dom/KeyboardEvent.cpp:
723         (WebCore::KeyboardEvent::KeyboardEvent):
724         (WebCore::KeyboardEvent::getModifierState):
725         * dom/KeyboardEvent.h:
726         * dom/KeyboardEvent.idl:
727         * dom/MouseRelatedEvent.cpp:
728         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
729         * dom/MouseRelatedEvent.h:
730         * dom/UIEvent.cpp:
731         (WebCore::UIEvent::UIEvent):
732         * dom/UIEvent.h:
733         (WebCore::UIEvent::create): Deleted.
734         * dom/UIEventInit.h: Added.
735         (WebCore::UIEventInit::UIEventInit):
736         * dom/UIEventInit.idl: Added.
737         * dom/UIEventWithKeyState.h:
738         (WebCore::UIEventWithKeyState::altGraphKey):
739         (WebCore::UIEventWithKeyState::capsLockKey):
740         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
741         (WebCore::UIEventWithKeyState::ctrlKey): Deleted.
742         (WebCore::UIEventWithKeyState::shiftKey): Deleted.
743         (WebCore::UIEventWithKeyState::altKey): Deleted.
744         (WebCore::UIEventWithKeyState::metaKey): Deleted.
745
746 2016-10-09  Youenn Fablet  <youenn@apple.com>
747
748         Promise attribute getters should reject promises in case of casted-this errors
749         https://bugs.webkit.org/show_bug.cgi?id=163167
750
751         Reviewed by Darin Adler.
752
753         Covered by updated test and binding test.
754
755         * bindings/js/JSDOMBinding.cpp:
756         (WebCore::throwGetterTypeError):
757         (WebCore::rejectPromiseWithGetterTypeError): Added to reject promises for attribute getters
758         * bindings/js/JSDOMBinding.h:
759         (WebCore::BindingCaller::attribute): Introducing promise rejection for type cast errors.
760         * bindings/scripts/CodeGeneratorJS.pm:
761         (GenerateImplementation):
762         * bindings/scripts/test/JS/JSTestObj.cpp: Rebased test. As can be seen, only custom promise attributes are supported.
763         (WebCore::jsTestObjTestReadOnlyPromiseAttribute):
764         (WebCore::jsTestObjTestReadOnlyPromiseAttributeGetter):
765         * bindings/scripts/test/TestObj.idl:
766
767 2016-10-08  Chris Dumez  <cdumez@apple.com>
768
769         [Mac] Write WebArchive to the pasteboard when copying image in WebKit
770         https://bugs.webkit.org/show_bug.cgi?id=163100
771
772         Reviewed by Darin Adler.
773
774         Write WebArchive to the pasteboard when copying image in WebKit. This
775         fixes pasting such images to a content editable field in WebKit because
776         Web archives take priority over RTFD when reading from the pasteboard
777         in WebKit.
778
779         Using RTFD when pasting the image in WebKit was causing issues because:
780         1. The pasted image would not be displayed because our RTFD import code
781            is buggy.
782         2. The pasted image URL was a webkit-fake-url://
783         3. Formatting associated to the image (e.g. inline style) would be lost
784
785         No new tests, unskipped existing test on WebKit2.
786
787         * editing/Editor.h:
788         * editing/mac/EditorMac.mm:
789         (WebCore::Editor::imageInWebArchiveFormat):
790         (WebCore::Editor::writeImageToPasteboard):
791         * platform/Pasteboard.h:
792         * platform/mac/PasteboardMac.mm:
793         (WebCore::writableTypesForImage):
794         (WebCore::Pasteboard::write):
795         (WebCore::Pasteboard::Pasteboard): Deleted.
796         (WebCore::Pasteboard::createForCopyAndPaste): Deleted.
797
798 2016-10-08  Chris Dumez  <cdumez@apple.com>
799
800         Update CustomEvent to stop using legacy [ConstructorTemplate=Event]
801         https://bugs.webkit.org/show_bug.cgi?id=163174
802
803         Reviewed by Darin Adler.
804
805         Update CustomEvent to stop using legacy [ConstructorTemplate=Event] and
806         use an actual constructor instead, like in the specification:
807         - https://dom.spec.whatwg.org/#interface-customevent
808
809         There is a very minor behavior change when explictly passing undefined
810         as detail value in CustomEventInit. We used to initialize detail to
811         undefined but we now initialize it to null instead, which is its default
812         value. The new behavior matches the one of Chrome and Firefox.
813
814         * bindings/scripts/CodeGeneratorJS.pm:
815         (GenerateDefaultValue):
816         (GenerateDictionaryImplementationContent):
817         * bindings/scripts/test/JS/JSTestObj.cpp:
818         (WebCore::convertDictionary<TestObj::Dictionary>):
819         * bindings/scripts/test/TestObj.idl:
820         * dom/CustomEvent.cpp:
821         (WebCore::CustomEvent::CustomEvent):
822         * dom/CustomEvent.h:
823         * dom/CustomEvent.idl:
824         * dom/Document.cpp:
825         (WebCore::Document::createEvent):
826         * dom/Event.cpp:
827         (WebCore::Event::Event):
828         * dom/Event.h:
829
830 2016-10-08  Chris Dumez  <cdumez@apple.com>
831
832         Add support for ClipboardEvent
833         https://bugs.webkit.org/show_bug.cgi?id=163164
834
835         Reviewed by Darin Adler.
836
837         Add support for ClipboardEvent:
838         - https://www.w3.org/TR/clipboard-apis/#clipboard-event-interfaces
839
840         Firefox and Chrome both already support this.
841
842         This gives us 5 more points on html5test.com.
843
844         Tests: editing/pasteboard/clipboard-event.html
845                fast/events/clipboard-event-constructor.html
846
847         * CMakeLists.txt:
848         * DerivedSources.cpp:
849         * DerivedSources.make:
850         * WebCore.xcodeproj/project.pbxproj:
851         * bindings/js/JSEventCustom.cpp:
852         (WebCore::toJSNewlyCreated): Deleted.
853
854         * bindings/scripts/CodeGeneratorJS.pm:
855         (WillConvertUndefinedToDefaultParameterValue):
856         We use [] as implicit default value for dictionary parameters. This change
857         is so we call convertDictionary<>() even if the parameter is undefined
858         because we want to pass a struct to the implementation initialized with
859         the default member values defined in the IDL.
860
861         * dom/ClipboardEvent.cpp:
862         (WebCore::ClipboardEvent::ClipboardEvent):
863         (WebCore::ClipboardEvent::eventInterface):
864         * dom/ClipboardEvent.h:
865         * dom/ClipboardEvent.idl: Added.
866         * dom/Event.cpp:
867         (WebCore::Event::Event):
868         * dom/Event.h:
869         * dom/Event.idl:
870         * dom/EventInit.h: Added.
871         * dom/EventInit.idl: Added.
872         * dom/EventNames.in:
873         * dom/MouseEvent.h:
874         (WebCore::MouseEvent::dataTransfer):
875         * editing/Editor.cpp:
876         (WebCore::Editor::dispatchCPPEvent):
877
878 2016-10-06  Darin Adler  <darin@apple.com>
879
880         Next step on moving to modern way to return DOM exceptions
881         https://bugs.webkit.org/show_bug.cgi?id=163016
882
883         Reviewed by Ryosuke Niwa.
884
885         * Modules/fetch/FetchRequest.idl:
886         Added MayThrowException to initializeWith since it throws an exception.
887
888         * bindings/js/JSCallbackData.cpp:
889         (WebCore::JSCallbackData::invokeCallback):
890         * bindings/js/JSCustomElementInterface.cpp:
891         (WebCore::JSCustomElementInterface::invokeCallback):
892         * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
893         (WebCore::JSSQLStatementErrorCallback::handleEvent):
894         * bindings/js/JSCustomXPathNSResolver.cpp:
895         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
896         * bindings/js/JSDOMBinding.cpp:
897         (WebCore::reportException):
898         (WebCore::reportCurrentException):
899         * bindings/js/JSErrorHandler.cpp:
900         (WebCore::JSErrorHandler::handleEvent):
901         * bindings/js/JSEventListener.cpp:
902         (WebCore::JSEventListener::handleEvent):
903         * bindings/js/JSMutationCallback.cpp:
904         (WebCore::JSMutationCallback::call):
905         * bindings/js/JSNodeFilterCustom.cpp:
906         (WebCore::JSNodeFilter::acceptNode):
907         * bindings/js/ScheduledAction.cpp:
908         (WebCore::ScheduledAction::executeFunctionInContext):
909         * bindings/js/ScriptController.cpp:
910         (WebCore::ScriptController::evaluateInWorld):
911         * bindings/js/WorkerScriptController.cpp:
912         (WebCore::WorkerScriptController::evaluate):
913         * inspector/PageScriptDebugServer.cpp:
914         (WebCore::PageScriptDebugServer::reportException):
915         Use JSC::Exception explicitly to avoid ambiguity with WebCore::Exception,
916         or in some cases use auto instead.
917
918         * bindings/js/JSDOMBinding.cpp:
919         (WebCore::hasUnpairedSurrogate): Factored this inline function out of valueToUSVString
920         for clarity.
921         (WebCore::createDOMException): Removed unused TRY_TO_CREATE_EXCEPTION macro.
922         (WebCore::propagateExceptionSlowPath): Added.
923         (WebCore::propagateException): Added.
924         (WebCore::setDOMException): Removed overload that takes an exception code and message
925         string separately; no longer needed.
926
927         * bindings/js/JSDOMBinding.h: Include the ExceptionOr header
928         rather than forward declaring. Added more of the ExceptionOr handling
929         functions; some just declared and not yet defined. Updated for changes
930         to ExceptionOr interface. Removed the createDOMException function that takes
931         only an exception code; not needed outside JSDOMBinding.cpp.
932
933         * bindings/js/JSXMLHttpRequestCustom.cpp:
934         (WebCore::JSXMLHttpRequest::send): Rewrote this to use ExceptionOr instead
935         of ExceptionCode. Added some FIXMEs as well.
936         (WebCore::JSXMLHttpRequest::responseText): Ditto.
937         (WebCore::JSXMLHttpRequest::retrieveResponse): Ditto.
938
939         * bindings/scripts/CodeGeneratorJS.pm:
940         (GenerateImplementation): Fixed if statements to follow WebKit coding style
941         rather than using extra braces. Added call to propagateException for SetterMayThrowException.
942         (GenerateSerializerFunction): Fixed if statements as above.
943         (GenerateParametersCheck): Ditto. Also added call to propagateException for functions with
944         void return type and MayThrowException.
945         (GenerateReturnParameters): Tweaked coding style a bit.
946         (addIterableProperties): Fixed if statements as above.
947         (NativeToJSValue): Added code to handle various cases of GetterMayThrowException
948         and MayThrowException.
949         (GenerateConstructorDefinition): Used encodedJSValue() instead of
950         JSValue::encode(JSValue()), a longer way to say the same thing.
951
952         * bindings/scripts/IDLAttributes.txt: Added GetterMayThrowException,
953         MayThrowException, and SetterMayThrowException.
954
955         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
956         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
957         * bindings/scripts/test/JS/JSTestException.cpp:
958         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
959         * bindings/scripts/test/JS/JSTestInterface.cpp:
960         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
961         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
962         * bindings/scripts/test/JS/JSTestNode.cpp:
963         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
964         * bindings/scripts/test/JS/JSTestObj.cpp:
965         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
966         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
967         * bindings/scripts/test/JS/JSattribute.cpp:
968         Regenerated results.
969
970         * bindings/scripts/test/TestObj.idl: Added some test cases.
971
972         * dom/DOMImplementation.cpp:
973         (WebCore::DOMImplementation::createDocumentType): Tweaked formatting.
974         (WebCore::DOMImplementation::createDocument): Ditto.
975
976         * dom/DOMImplementation.idl: Added MayThrowException to two functions since
977         I am abandoning, for now, the ability to throw exceptions without any extended
978         attribute in the IDL file. This feature may return at some point if we figure
979         out a way to do it for functions without return values as well as functions with.
980
981         * dom/Document.cpp:
982         (WebCore::Document::exitPointerLock): Rewrote to streamline logic.
983         (WebCore::Document::pointerLockElement): Ditto.
984         (WebCore::Document::inputCursor): Added. No need for this to be inlined.
985         (WebCore::Document::setInputCursor): Changed to take Ref&&.
986         (WebCore::Document::getSelection): Added. Moved here from TreeScope.
987
988         * dom/Document.h: Updated for above changes.
989
990         * dom/Document.idl: Tweaked formatting.
991
992         * dom/Exception.h: Merged the two constructors into one with a default
993         argument value, which should be equally efficient. Added releaseMessage function.
994         Added assertion that this is only created for actual exceptions with non-zero
995         ExceptionCode. Unlike ExceptionCode, which has a value of 0 which means no
996         exception, we do not create an Exception if there is no exception.
997
998         * dom/ExceptionOr.h: Renamed takeReturnValue to releaseReturnValue. Replaced
999         exceptionCode and exceptionMessage with releaseException. Added ExceptionOr<void>
1000         specialization.
1001
1002         * dom/TreeScope.cpp:
1003         (WebCore::TreeScope::~TreeScope): Removed code dealing with
1004         m_selection, which is now in Document.
1005         (WebCore::TreeScope::getSelection): Deleted.
1006
1007         * dom/TreeScope.h: Removed DOMSelection.
1008
1009         * page/DOMSelection.cpp:
1010         (WebCore::selectionShadowAncestor): Changed to take a reference rather than
1011         a guaranteed-non-null pointer.
1012         (WebCore::DOMSelection::DOMSelection): Changed to take a Frame& instead of
1013         of a TreeScope*.
1014         (WebCore::DOMSelection::clearTreeScope): Deleted.
1015         (WebCore::DOMSelection::isCollapsed): Updated call to selectionShadowAncestor.
1016         (WebCore::DOMSelection::type): Took out obsolete uneeeded comment. Got rid
1017         of case where this returns a null string. Use ASCIILiteral.
1018         (WebCore::DOMSelection::rangeCount): Streamlined code.
1019         (WebCore::DOMSelection::collapse): Removed redundant check of m_frame for
1020         null which is already handled by the isValidForPosition function.
1021         Removed non-helpful FIXME.
1022         (WebCore::DOMSelection::collapseToEnd): Changed to use ExceptionOr instead of
1023         ExceptionCode.
1024         (WebCore::DOMSelection::collapseToStart): Ditto.
1025         (WebCore::DOMSelection::setBaseAndExtent): Removed redundant check of m_frame
1026         for null which is already handled by the isValidForPosition function. Removed
1027         non-helpful FIXME.
1028         (WebCore::DOMSelection::setPosition): Ditto.
1029         (WebCore::DOMSelection::extend): Changed to use ExceptionOr instead of
1030         ExceptionCode.
1031         (WebCore::DOMSelection::getRangeAt): Ditto.
1032         (WebCore::DOMSelection::isValidForPosition): Changed to return false when
1033         m_frame is null rather than asserting is is non-null and having every caller
1034         check m_frame before calling this.
1035
1036         * page/DOMSelection.h: Use #pragma once. Fix indentation. Removed unneeded
1037         comments. Use ExceptionOr rather than ExceptionCode.
1038
1039         * page/DOMSelection.idl: Move from MayThrowLegacyException to MayThrowException.
1040
1041         * page/DOMWindow.cpp:
1042         (WebCore::DOMWindow::resetDOMWindowProperties): Sorted properties alphabetically
1043         to make it more obvious if any are accidentally omitted or listed twice.
1044         (WebCore::DOMWindow::getSelection): Changed ownership so that the window owns
1045         the selection like all the other objects, rather than having it be owned by the
1046         document instead.
1047
1048         * page/DOMWindow.h: Added m_selection, sorted all the other related properties
1049         alphabetically so it's easy to compare the list here with elsewhere.
1050
1051         * replay/ReplayController.cpp:
1052         (WebCore::ReplayController::frameNavigated): Updated to call setInputCursor
1053         with a reference rather than a pointer.
1054
1055         * xml/XMLHttpRequest.cpp:
1056         (WebCore::XMLHttpRequest::responseText): Use ExceptionOr rather than ExceptionCode.
1057         (WebCore::XMLHttpRequest::responseXML): Ditto.
1058         (WebCore::XMLHttpRequest::setTimeout): Ditto.
1059         (WebCore::XMLHttpRequest::setResponseType): Ditto.
1060         (WebCore::XMLHttpRequest::setWithCredentials): Ditto.
1061         (WebCore::XMLHttpRequest::open): Ditto.
1062         (WebCore::XMLHttpRequest::prepareToSend): Changed to return an
1063         Optional<ExceptionOr> to reflect the three different states: an exception,
1064         a value to return without sending, or "continue with the send algorithm".
1065         The old code did this with a boolean plus an exception code. This sounds
1066         confusing but is easy to read at the call sites, so probably OK to keep.
1067         (WebCore::XMLHttpRequest::send): Use ExceptionOr rather than ExceptionCode.
1068         (WebCore::XMLHttpRequest::sendBytesData): Ditto.
1069         (WebCore::XMLHttpRequest::createRequest): Ditto.
1070         (WebCore::XMLHttpRequest::overrideMimeType): Ditto.
1071         (WebCore::XMLHttpRequest::setRequestHeader): Ditto.
1072
1073         * xml/XMLHttpRequest.h: Updated for changes above.
1074
1075         * xml/XMLHttpRequest.idl: Sorted interface extended attributes alphabetically.
1076         Changed from MayThrowLegacyException to MayThrowException.
1077
1078 2016-10-06  Sam Weinig  <sam@webkit.org>
1079
1080         Autogenerate passing union types as part of a functions variadic arguments
1081         https://bugs.webkit.org/show_bug.cgi?id=162919
1082
1083         Reviewed by Darin Adler.
1084
1085         * CMakeLists.txt:
1086         * WebCore.xcodeproj/project.pbxproj:
1087         * bindings/js/JSBindingsAllInOne.cpp:
1088         Remove deleted files.
1089
1090         * bindings/generic/IDLTypes.h:
1091         Switch to use std::reference_wrapper as it's implementation type. We may need more
1092         granularity here in the future, but this will work for now.
1093
1094         * bindings/js/JSCharacterDataCustom.cpp: Removed.
1095         * bindings/js/JSDocumentTypeCustom.cpp: Removed.
1096         * bindings/js/JSNodeOrString.cpp: Removed.
1097         * bindings/js/JSNodeOrString.h: Removed.
1098
1099         * bindings/js/JSDOMBinding.h:
1100         (WebCore::VariadicHelperBase::convert): Deleted.
1101         (WebCore::toArguments): Deleted.
1102         Moved to JSDOMConvert.h and renamed to convertVariadicArguments and make
1103         it work in terms of IDLTypes.
1104
1105         * bindings/js/JSDOMConvert.h:
1106         (WebCore::Converter<IDLInterface<T>>::convert):
1107         (WebCore::VariadicConverterBase::convert):
1108         (WebCore::VariadicConverterBase<IDLInterface<T>>::convert):
1109         (WebCore::convertVariadicArguments):
1110
1111         * bindings/js/JSDocumentCustom.cpp:
1112         (WebCore::JSDocument::prepend): Deleted.
1113         (WebCore::JSDocument::append): Deleted.
1114         * bindings/js/JSDocumentFragmentCustom.cpp:
1115         (WebCore::JSDocumentFragment::prepend): Deleted.
1116         (WebCore::JSDocumentFragment::append): Deleted.
1117         * bindings/js/JSElementCustom.cpp:
1118         (WebCore::JSElement::before): Deleted.
1119         (WebCore::JSElement::after): Deleted.
1120         (WebCore::JSElement::replaceWith): Deleted.
1121         (WebCore::JSElement::prepend): Deleted.
1122         (WebCore::JSElement::append): Deleted.
1123         Remove now generated functions.
1124
1125         * bindings/scripts/CodeGenerator.pm:
1126         (assert):
1127         Add assert to help debugging.
1128
1129         (ParseInterface):
1130         Don't treat union types as interfaces.
1131
1132         (GetFlattenedMemberTypes):
1133         (GetNumberOfNullableMemberTypes):
1134         (GetIDLUnionMemberTypes):
1135         Implement WebIDL algorithms for getting the flattened member list of union, and use it
1136         to construct the c++ IDLType.
1137
1138         (GetBaseIDLType):
1139         (GetIDLType):
1140         Add helper to convert an parsed idlType to a c++ IDLType.
1141
1142         (IsWrapperType):
1143         Don't treat union types as wrappers.
1144         
1145         * bindings/scripts/CodeGeneratorJS.pm:
1146         (AddToImplIncludesForIDLType):
1147         Add helper for adding #includes based on a parsed idlType. It recursively handles union types.
1148
1149         (GenerateParametersCheck):
1150         Use the new convertVariadicArguments function to handle all variadic arguments, including
1151         union types.
1152
1153         * bindings/scripts/IDLParser.pm:
1154         (parseDictionaryMember):
1155         (parseAttributeRest):
1156         (parseOptionalOrRequiredArgument):
1157         (parseExceptionField):
1158         Add an idlType to domSignature and populate it.
1159
1160         * bindings/scripts/test/JS/JSTestObj.cpp:
1161         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod13):
1162         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
1163         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
1164         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
1165         (WebCore::jsTestObjPrototypeFunctionVariadicUnionMethod):
1166         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1167         (WebCore::constructJSTestOverloadedConstructors5):
1168         * bindings/scripts/test/TestObj.idl:
1169         Add and update tests.
1170
1171         * dom/ChildNode.idl:
1172         * dom/ParentNode.idl:
1173         Remove Custom extended attribute.
1174
1175         * dom/ContainerNode.cpp:
1176         * dom/ContainerNode.h:
1177         * dom/Node.cpp:
1178         * dom/Node.h:
1179         Switch to using std::reference_wrapper instead of Ref<> for passed in parameters.
1180
1181 2016-10-08  Youenn Fablet  <youenn@apple.com>
1182
1183         [Fetch API] Request constructor should provide exception messages
1184         https://bugs.webkit.org/show_bug.cgi?id=162382
1185
1186         Reviewed by Darin Adler.
1187
1188         No change of behavior, except that exceptions now have error messages.
1189
1190         Added support of exception messages to ExceptionOr.
1191         Making use of ExceptionOr for Request constructor parameter checking.
1192
1193         * Modules/fetch/FetchRequest.cpp:
1194         (WebCore::setReferrerPolicy):
1195         (WebCore::setMode):
1196         (WebCore::setCredentials):
1197         (WebCore::setCache):
1198         (WebCore::setRedirect):
1199         (WebCore::setMethod):
1200         (WebCore::setReferrer):
1201         (WebCore::buildOptions):
1202         (WebCore::FetchRequest::initializeOptions):
1203         (WebCore::FetchRequest::initializeWith):
1204         * Modules/fetch/FetchRequest.h:
1205         * Modules/fetch/FetchRequest.idl:
1206         * bindings/js/JSDOMBinding.cpp:
1207         (WebCore::setDOMException):
1208         * bindings/js/JSDOMBinding.h:
1209         (WebCore::toJS):
1210         (WebCore::toJSNewlyCreated):
1211         * dom/Exception.h:
1212         (WebCore::Exception::code):
1213         (WebCore::Exception::message):
1214         (WebCore::Exception::Exception):
1215         * dom/ExceptionOr.h:
1216         (WebCore::ExceptionOr<ReturnType>::exceptionMessage):
1217
1218 2016-10-08  Youenn Fablet  <youenn@apple.com>
1219
1220         Refactor binding generated casted-this checks
1221         https://bugs.webkit.org/show_bug.cgi?id=162677
1222
1223         Reviewed by Darin Adler.
1224
1225         No change of behavior.
1226
1227         Split the attribute getter function in two, one with the signature expected by JSCore and one used after casted-this checks.
1228
1229         The second function takes directly a JSXX object and returns a JSValue instead of an EncodedJSValue.
1230         In the future, the second function should only take references.
1231
1232         Introducing BindingCaller as a way to templatize binding code used to cast thisValue with the desired JSXX value.
1233         This allows implementing the first function using the second function as template parameter.
1234
1235         Introducing JSClass::castForAttribute as a way to encapsulate differences in the way to handle thisValue access.
1236
1237         * bindings/js/JSDOMBinding.h:
1238         (WebCore::BindingCaller::attribute):
1239         * bindings/scripts/CodeGeneratorJS.pm:
1240         (GenerateHeader):
1241         (GenerateImplementation):
1242         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1243         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1244         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1245         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1246         * bindings/scripts/test/JS/JSTestException.cpp:
1247         * bindings/scripts/test/JS/JSTestException.h:
1248         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1249         * bindings/scripts/test/JS/JSTestInterface.cpp:
1250         * bindings/scripts/test/JS/JSTestInterface.h:
1251         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1252         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
1253         * bindings/scripts/test/JS/JSTestNode.cpp:
1254         * bindings/scripts/test/JS/JSTestNode.h:
1255         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1256         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1257         * bindings/scripts/test/JS/JSTestObj.cpp:
1258         * bindings/scripts/test/JS/JSTestObj.h:
1259         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1260         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1261         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1262         * bindings/scripts/test/JS/JSTestTypedefs.h:
1263         * bindings/scripts/test/JS/JSattribute.cpp:
1264         * bindings/scripts/test/JS/JSattribute.h:
1265
1266 2016-10-08  Enrique Ocaña González  <eocanha@igalia.com>
1267
1268         Missing include in MediaDescription
1269         https://bugs.webkit.org/show_bug.cgi?id=162873
1270
1271         Reviewed by Xabier Rodriguez-Calvar.
1272
1273         Added missing header.
1274
1275         * platform/MediaDescription.h:
1276
1277 2016-10-08  Antti Koivisto  <antti@apple.com>
1278
1279         Move StyleResolver ownership from Document/ShadowRoot to Style::Scope
1280         https://bugs.webkit.org/show_bug.cgi?id=163148
1281
1282         Reviewed by Andreas Kling.
1283
1284         Reduce duplication between Document and ShadowRoot.
1285
1286         * css/CSSComputedStyleDeclaration.cpp:
1287         (WebCore::ComputedStyleExtractor::propertyValue):
1288         * css/CSSStyleSheet.cpp:
1289         (WebCore::CSSStyleSheet::didMutateRules):
1290         * css/ElementRuleCollector.cpp:
1291         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
1292         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
1293         * css/MediaQueryMatcher.cpp:
1294         (WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
1295         * css/StyleMedia.cpp:
1296         (WebCore::StyleMedia::matchMedium):
1297         * css/parser/SizesAttributeParser.cpp:
1298         (WebCore::SizesAttributeParser::mediaConditionMatches):
1299         * dom/Document.cpp:
1300         (WebCore::Document::~Document):
1301         (WebCore::Document::childrenChanged):
1302         (WebCore::Document::isPageBoxVisible):
1303         (WebCore::Document::pageSizeAndMarginsInPixels):
1304         (WebCore::Document::userAgentShadowTreeStyleResolver):
1305         (WebCore::Document::fontsNeedUpdate):
1306         (WebCore::Document::didClearStyleResolver):
1307         (WebCore::Document::updateViewportUnitsOnResize):
1308         (WebCore::Document::createStyleResolver): Deleted.
1309         (WebCore::Document::clearStyleResolver): Deleted.
1310         * dom/Document.h:
1311         (WebCore::Document::styleResolverIfExists): Deleted.
1312         (WebCore::Document::ensureStyleResolver): Deleted.
1313         * dom/Element.cpp:
1314         (WebCore::Element::styleResolver):
1315         * dom/ShadowRoot.cpp:
1316         (WebCore::ShadowRoot::styleResolver): Deleted.
1317         (WebCore::ShadowRoot::styleResolverIfExists): Deleted.
1318         (WebCore::ShadowRoot::resetStyleResolver): Deleted.
1319         * dom/ShadowRoot.h:
1320         * page/DOMWindow.cpp:
1321         (WebCore::DOMWindow::getMatchedCSSRules):
1322         * page/FrameView.cpp:
1323         (WebCore::FrameView::layout):
1324         * page/Page.cpp:
1325         (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
1326         * page/PrintContext.cpp:
1327         (WebCore::PrintContext::pageProperty):
1328         * platform/MemoryPressureHandler.cpp:
1329         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
1330         * style/AttributeChangeInvalidation.cpp:
1331         (WebCore::Style::mayBeAffectedByHostStyle):
1332         * style/ClassChangeInvalidation.cpp:
1333         (WebCore::Style::mayBeAffectedByHostStyle):
1334         * style/IdChangeInvalidation.cpp:
1335         (WebCore::Style::mayBeAffectedByHostStyle):
1336         * style/StyleScope.cpp:
1337         (WebCore::Style::Scope::resolver):
1338         (WebCore::Style::Scope::resolverIfExists):
1339         (WebCore::Style::Scope::clearResolver):
1340         (WebCore::Style::Scope::analyzeStyleSheetChange):
1341         (WebCore::Style::Scope::updateActiveStyleSheets):
1342         (WebCore::Style::Scope::updateStyleResolver):
1343         (WebCore::Style::Scope::styleResolver): Deleted.
1344         (WebCore::Style::Scope::styleResolverIfExists): Deleted.
1345         * style/StyleScope.h:
1346         * style/StyleSharingResolver.cpp:
1347         (WebCore::Style::SharingResolver::resolve):
1348         (WebCore::Style::SharingResolver::canShareStyleWithElement):
1349         * style/StyleTreeResolver.cpp:
1350         (WebCore::Style::TreeResolver::Scope::Scope):
1351         (WebCore::Style::TreeResolver::resolve):
1352
1353 2016-10-07  Chris Dumez  <cdumez@apple.com>
1354
1355         window.navigator.language incorrectly returns all lowercase string
1356         https://bugs.webkit.org/show_bug.cgi?id=163096
1357
1358         Reviewed by Darin Adler.
1359
1360         Update navigator.language so that it no longer returns an all lowercase
1361         string (e.g. 'en-us' -> 'en-US'). This matches the behavior of other
1362         browsers and the specification which indicate we should return a
1363         BCP 47 language tag:
1364         - https://html.spec.whatwg.org/#dom-navigator-language
1365         - https://tools.ietf.org/html/bcp47
1366
1367         The other call sites relying on userPreferredLanguages() use case
1368         insensitive comparison so they will not break.
1369
1370         No new tests, updated existing test.
1371
1372         * platform/Language.h:
1373
1374 2016-10-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1375
1376         Support onbeforeinput event handling for the new InputEvent spec
1377         https://bugs.webkit.org/show_bug.cgi?id=163021
1378         <rdar://problem/28658073>
1379
1380         Reviewed by Darin Adler.
1381
1382         Adds support for parsing the onbeforeinput attribute, and for sending default-preventable
1383         `beforeinput` InputEvents to the page. To do this, we introduce two new virtual methods:
1384         willApplyCommand and didApplyCommand on the CompositeEditCommand that are called before and
1385         after CompositeEditCommand::doApply, respectively. willApplyCommand indicates whether or not
1386         the composite editor command should proceed with applying the command.
1387
1388         Tweaks existing layout tests and adds new tests.
1389
1390         Tests: fast/events/before-input-events-different-start-end-elements.html
1391                fast/events/before-input-events-prevent-default-in-textfield.html
1392                fast/events/before-input-events-prevent-default.html
1393
1394         * dom/Document.idl:
1395         * dom/Element.idl:
1396         * dom/EventNames.h:
1397         * dom/Node.cpp:
1398         (WebCore::Node::dispatchInputEvent):
1399         (WebCore::Node::defaultEventHandler):
1400
1401         Currently, we fire input events in Node in response to dispatching a webkitEditableContentChangedEvent. After
1402         some discussion, Ryosuke and I believe that it will be ok to instead directly dispatch the input event where we
1403         would normally dispatch a webkitEditableContentChangedEvent.
1404
1405         * editing/CompositeEditCommand.cpp:
1406         (WebCore::EditCommandComposition::unapply):
1407         (WebCore::EditCommandComposition::reapply):
1408
1409         Added calls to Editor::willUnapplyEditing and Editor::willReapplyEditing.
1410
1411         (WebCore::CompositeEditCommand::willApplyCommand):
1412         (WebCore::CompositeEditCommand::apply):
1413         (WebCore::CompositeEditCommand::didApplyCommand):
1414
1415         Added new virtual functions, willApplyCommand and didApplyCommand, that surround a call to
1416         CompositeEditCommand::doApply. By default, they call willApplyEditing and appliedEditing on the editor, but may
1417         be overridden in special cases, such as in TypingCommand, where we invoke appliedEditing after adding a new
1418         typing command to the last open command.
1419
1420         If willApplyCommand returns false, CompositeEditCommand::apply will bail and not proceed with the command.
1421
1422         * editing/CompositeEditCommand.h:
1423         * editing/Editor.cpp:
1424         (WebCore::dispatchBeforeInputEvent):
1425         (WebCore::dispatchBeforeInputEvents):
1426         (WebCore::dispatchInputEvents):
1427         (WebCore::Editor::willApplyEditing):
1428         (WebCore::Editor::appliedEditing):
1429         (WebCore::Editor::willUnapplyEditing):
1430         (WebCore::Editor::unappliedEditing):
1431         (WebCore::Editor::willReapplyEditing):
1432         (WebCore::Editor::reappliedEditing):
1433         (WebCore::Editor::computeAndSetTypingStyle):
1434         (WebCore::dispatchEditableContentChangedEvents): Deleted.
1435         * editing/Editor.h:
1436         * editing/TypingCommand.cpp:
1437         (WebCore::TypingCommand::willApplyCommand):
1438         (WebCore::TypingCommand::didApplyCommand):
1439         (WebCore::TypingCommand::willAddTypingToOpenCommand):
1440         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
1441         (WebCore::TypingCommand::insertLineBreak):
1442         (WebCore::TypingCommand::insertParagraphSeparator):
1443         (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
1444         (WebCore::TypingCommand::deleteKeyPressed):
1445         (WebCore::TypingCommand::forwardDeleteKeyPressed):
1446         (WebCore::TypingCommand::deleteSelection):
1447
1448         These now invoke willAddTypingToOpenCommand before proceeding with creating the command and applying it. The
1449         flow is now:
1450             - willAddTypingToOpenCommand
1451             - create and apply a new command
1452             - typingAddedToOpenCommand
1453
1454         * editing/TypingCommand.h:
1455         (WebCore::TypingCommand::preservesTypingStyle): Deleted.
1456         (WebCore::TypingCommand::shouldRetainAutocorrectionIndicator): Deleted.
1457         (WebCore::TypingCommand::setShouldRetainAutocorrectionIndicator): Deleted.
1458         (WebCore::TypingCommand::shouldStopCaretBlinking): Deleted.
1459         * html/HTMLAttributeNames.in:
1460         * html/HTMLElement.cpp:
1461         (WebCore::HTMLElement::createEventHandlerNameMap):
1462
1463 2016-10-07  Nan Wang  <n_wang@apple.com>
1464
1465         AX: <figcaption> should be AXTitleUIElement for other content inside the <figure>
1466         https://bugs.webkit.org/show_bug.cgi?id=108996
1467
1468         Reviewed by Chris Fleizach.
1469
1470         Exposed the figcaption element to be the AXTitleUIElement for the figure element. And used
1471         the figcaption's content as the accessible name of the figure. Also, updated the figure element's
1472         role description on Mac.
1473         Accessible name and description calculation for figure elements: 
1474         https://w3c.github.io/html-aam/#figure-and-figcaption-elements
1475
1476         Test: accessibility/mac/figure-element.html
1477
1478         * English.lproj/Localizable.strings:
1479         * accessibility/AccessibilityNodeObject.cpp:
1480         (WebCore::AccessibilityNodeObject::captionForFigure):
1481         (WebCore::AccessibilityNodeObject::alternativeText):
1482         * accessibility/AccessibilityNodeObject.h:
1483         * accessibility/AccessibilityObject.cpp:
1484         (WebCore::AccessibilityObject::isFigure):
1485         (WebCore::AccessibilityObject::isSuperscriptStyleGroup): Deleted.
1486         * accessibility/AccessibilityObject.h:
1487         * accessibility/AccessibilityRenderObject.cpp:
1488         (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
1489         (WebCore::AccessibilityRenderObject::titleUIElement):
1490         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1491         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1492         (-[WebAccessibilityObjectWrapper roleDescription]):
1493         * platform/LocalizedStrings.cpp:
1494         (WebCore::AXFigureText):
1495         * platform/LocalizedStrings.h:
1496         * platform/efl/LocalizedStringsEfl.cpp:
1497         (WebCore::AXFigureText):
1498         * platform/gtk/LocalizedStringsGtk.cpp:
1499         (WebCore::AXFigureText):
1500
1501 2016-10-07  Alex Christensen  <achristensen@webkit.org>
1502
1503         Non-special URL fragments should percent-encode non-ASCII characters
1504         https://bugs.webkit.org/show_bug.cgi?id=163153
1505
1506         Reviewed by Tim Horton.
1507
1508         This is needed to keep compatibility with data URLs with non-ASCII characters after a '#'
1509         which works in Chrome, Firefox, and Safari, while maintaining compatibility with Chrome, IE, and Edge
1510         which keep non-ASCII characters in the fragments of special URLs.
1511         This was proposed to the spec in https://github.com/whatwg/url/issues/150
1512
1513         Covered by new API tests.
1514
1515         * platform/URLParser.cpp:
1516         (WebCore::URLParser::syntaxViolation):
1517         Removed assertion because we now have fragments that need percent encoding but are all ASCII.
1518         (WebCore::URLParser::fragmentSyntaxViolation):
1519         (WebCore::URLParser::parse):
1520
1521 2016-10-07  Brent Fulgham  <bfulgham@apple.com>
1522
1523         EventHandler functions that need to guarantee event handler lifetime need to use Ref<Frame>
1524         https://bugs.webkit.org/show_bug.cgi?id=98617
1525         <rdar://problem/12778649>
1526
1527         Reviewed by Daniel Bates.
1528
1529         Improve stability by ensuring that the Frame holding an active EventHandler is kept
1530         alive while in the process of handling events and executing JavaScript.
1531
1532         No new tests since there is no change in behavior.
1533
1534         * page/EventHandler.cpp:
1535         (WebCore::EventHandler::handleMousePressEventSingleClick): Protect the Frame with a Ref<>.
1536         (WebCore::EventHandler::handleMousePressEvent): Ditto.
1537         (WebCore::EventHandler::handleMouseDraggedEvent): Ditto.
1538         (WebCore::EventHandler::eventMayStartDrag): Ditto.
1539         (WebCore::EventHandler::handleMouseReleaseEvent): Ditto.
1540         (WebCore::EventHandler::hitTestResultAtPoint): Ditto.
1541         (WebCore::EventHandler::scrollRecursively): Ditto.
1542         (WebCore::EventHandler::logicalScrollRecursively): Ditto.
1543         (WebCore::EventHandler::selectCursor): Ditto.
1544         (WebCore::EventHandler::handleMouseDoubleClickEvent): Ditto.
1545         (WebCore::EventHandler::mouseMoved): Ditto.
1546         (WebCore::EventHandler::handleMouseMoveEvent): Ditto.
1547         (WebCore::EventHandler::handleMouseForceEvent): Ditto.
1548         (WebCore::EventHandler::dispatchDragEvent): Ditto.
1549         (WebCore::EventHandler::updateDragAndDrop): Ditto.
1550         (WebCore::EventHandler::cancelDragAndDrop): Ditto.
1551         (WebCore::EventHandler::performDragAndDrop): Ditto.
1552         (WebCore::EventHandler::prepareMouseEvent): Ditto.
1553         (WebCore::EventHandler::updateMouseEventTargetNode): Ditto.
1554         (WebCore::EventHandler::dispatchMouseEvent): Ditto.
1555         (WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
1556         (WebCore::EventHandler::handleWheelEvent): Ditto.
1557         (WebCore::EventHandler::defaultWheelEventHandler): Ditto.
1558         (WebCore::EventHandler::sendContextMenuEvent): Ditto.
1559         (WebCore::EventHandler::sendContextMenuEventForKey): Ditto.
1560         (WebCore::EventHandler::hoverTimerFired): Ditto.
1561         (WebCore::EventHandler::keyEvent): Ditto.
1562         (WebCore::EventHandler::defaultKeyboardEventHandler): Ditto.
1563         (WebCore::EventHandler::handleDrag): Ditto.
1564         (WebCore::EventHandler::handleTextInputEvent): Ditto.
1565         (WebCore::EventHandler::defaultSpaceEventHandler): Ditto.
1566         (WebCore::EventHandler::defaultTabEventHandler): Ditto.
1567         (WebCore::EventHandler::sendScrollEvent): Ditto.
1568         (WebCore::EventHandler::handleTouchEvent): Ditto.
1569         * page/ios/EventHandlerIOS.mm:
1570         (WebCore::EventHandler::focusDocumentView): Ditto.
1571         * page/mac/EventHandlerMac.mm:
1572         (WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
1573
1574 2016-10-07  Chris Dumez  <cdumez@apple.com>
1575
1576         Regression(r201970): productSub / vendor / vendorSub should not be exposed on WorkerNavigator
1577         https://bugs.webkit.org/show_bug.cgi?id=163124
1578
1579         Reviewed by Ryosuke Niwa.
1580
1581         productSub / vendor / vendorSub should not be exposed on WorkerNavigator:
1582         - https://html.spec.whatwg.org/#navigatorid
1583
1584         Test case:
1585         - http://w3c-test.org/submissions/3881/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker
1586
1587         Note that the specification also restricts NavigatorID's appCodeName and
1588         product attributes to Window. However, it seems the HTML specification is
1589         about to get updated so that these get exposed to workers:
1590         - https://github.com/whatwg/html/pull/1870
1591
1592         No new tests, updated existing test.
1593
1594         * bindings/scripts/generate-bindings.pl:
1595         (shouldPropertyBeExposed):
1596         * page/NavigatorID.idl:
1597
1598 2016-10-07  Alex Christensen  <achristensen@webkit.org>
1599
1600         Disable URLParser logs by default in all builds
1601         https://bugs.webkit.org/show_bug.cgi?id=163135
1602
1603         Reviewed by Brady Eidson.
1604
1605         In debug builds with the URLParser enabled, some tests time out because
1606         parameters to generate log strings are being evaluated for each character of each URL
1607         and then not being used if URLParser logs are disabled.  Generating these unused parameters
1608         is too slow even for debug builds.  Let's only generate them if they are to be used.
1609
1610         No change in behaviour.
1611
1612         * platform/URLParser.cpp:
1613         (WebCore::URLParser::parse):
1614         (WebCore::URLParser::allValuesEqual):
1615
1616 2016-10-07  Andreas Kling  <akling@apple.com>
1617
1618         [WK2] didRemoveFrameFromHierarchy callback doesn't fire for subframes when evicting from PageCache.
1619         <https://webkit.org/b/163098>
1620         <rdar://problem/28663488>
1621
1622         Reviewed by Antti Koivisto.
1623
1624         Fix a bug where WK2 didRemoveFrameFromHierarchy callbacks wouldn't fire for subframes that were getting
1625         kicked out of PageCache. The problem was happening because CachedFrame would disconnect the Frame from
1626         its Page just before calling FrameLoader::detachViewsAndDocumentLoader() where the callbacks are fired.
1627         Without a Page, the WebFrame on WK2 side can't find its WebPage, and so it can't fire its callbacks.
1628
1629         The fix is just to switch the order of those two lines.
1630
1631         This bug was causing frequent DOM and window object leaks in some clients *cough* Safari *cough* that
1632         were relying on didRemoveFrameFromHierarchy to release their isolated worlds.
1633
1634         Test: WebKit2.DidRemoveFrameFromHiearchyInPageCache
1635
1636         * history/CachedFrame.cpp:
1637         (WebCore::CachedFrame::destroy):
1638
1639 2016-10-07  Nan Wang  <n_wang@apple.com>
1640
1641         AX: AXRoleDescription for details and summary elements
1642         https://bugs.webkit.org/show_bug.cgi?id=163094
1643
1644         Reviewed by Chris Fleizach.
1645
1646         details and summary elements should have AXRoleDescription that is consistent with other
1647         elements that have custom AXSubRole.
1648
1649         Test: accessibility/mac/details-summary-role-description.html
1650
1651         * English.lproj/Localizable.strings:
1652         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1653         (-[WebAccessibilityObjectWrapper roleDescription]):
1654         * platform/LocalizedStrings.cpp:
1655         (WebCore::AXDetailsText):
1656         (WebCore::AXSummaryText):
1657         * platform/LocalizedStrings.h:
1658         * platform/efl/LocalizedStringsEfl.cpp:
1659         (WebCore::AXDetailsText):
1660         (WebCore::AXSummaryText):
1661         * platform/gtk/LocalizedStringsGtk.cpp:
1662         (WebCore::AXDetailsText):
1663         (WebCore::AXSummaryText):
1664
1665 2016-10-07  Ryan Haddad  <ryanhaddad@apple.com>
1666
1667         Fix the Windows build after r206917.
1668
1669         Unreviewed build fix.
1670
1671         * dom/DOMAllInOne.cpp:
1672
1673 2016-10-07  Antti Koivisto  <antti@apple.com>
1674
1675         Rename AuthorStyleSheets to Style::Scope
1676         https://bugs.webkit.org/show_bug.cgi?id=163108
1677
1678         Reviewed by Andreas Kling.
1679
1680         It represents the style scope in DOM.
1681         Also move the file under style/.
1682
1683         * CMakeLists.txt:
1684         * WebCore.xcodeproj/project.pbxproj:
1685         * css/CSSStyleSheet.cpp:
1686         (WebCore::CSSStyleSheet::styleSheetScope):
1687         * css/CSSStyleSheet.h:
1688         * css/InspectorCSSOMWrappers.cpp:
1689         (WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
1690         * css/InspectorCSSOMWrappers.h:
1691         * css/StyleSheetList.cpp:
1692         (WebCore::StyleSheetList::styleSheets):
1693         (WebCore::StyleSheetList::detachFromDocument):
1694         * dom/AuthorStyleSheets.cpp: Removed.
1695         * dom/AuthorStyleSheets.h: Removed.
1696         * dom/Document.cpp:
1697         (WebCore::Document::Document):
1698         (WebCore::Document::setContentLanguage):
1699         (WebCore::Document::recalcStyle):
1700         (WebCore::Document::needsStyleRecalc):
1701         (WebCore::Document::updateStyleIfNeeded):
1702         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
1703         (WebCore::Document::createStyleResolver):
1704         (WebCore::Document::didRemoveAllPendingStylesheet):
1705         (WebCore::Document::usesStyleBasedEditability):
1706         (WebCore::Document::processHttpEquiv):
1707         (WebCore::Document::preferredStylesheetSet):
1708         (WebCore::Document::selectedStylesheetSet):
1709         (WebCore::Document::setSelectedStylesheetSet):
1710         (WebCore::Document::haveStylesheetsLoaded):
1711         * dom/Document.h:
1712         (WebCore::Document::styleScope):
1713         (WebCore::Document::authorStyleSheets): Deleted.
1714         * dom/ExtensionStyleSheets.cpp:
1715         (WebCore::ExtensionStyleSheets::clearPageUserSheet):
1716         (WebCore::ExtensionStyleSheets::updatePageUserSheet):
1717         (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
1718         (WebCore::ExtensionStyleSheets::addUserStyleSheet):
1719         (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
1720         (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
1721         * dom/InlineStyleSheetOwner.cpp:
1722         (WebCore::InlineStyleSheetOwner::insertedIntoDocument):
1723         (WebCore::InlineStyleSheetOwner::removedFromDocument):
1724         (WebCore::InlineStyleSheetOwner::clearDocumentData):
1725         (WebCore::InlineStyleSheetOwner::createSheet):
1726         (WebCore::InlineStyleSheetOwner::sheetLoaded):
1727         (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
1728         * dom/InlineStyleSheetOwner.h:
1729         (WebCore::InlineStyleSheetOwner::styleScope):
1730         (WebCore::InlineStyleSheetOwner::styleSheetScope): Deleted.
1731         * dom/ProcessingInstruction.cpp:
1732         (WebCore::ProcessingInstruction::~ProcessingInstruction):
1733         (WebCore::ProcessingInstruction::checkStyleSheet):
1734         (WebCore::ProcessingInstruction::sheetLoaded):
1735         (WebCore::ProcessingInstruction::insertedInto):
1736         (WebCore::ProcessingInstruction::removedFrom):
1737         * dom/ShadowRoot.cpp:
1738         (WebCore::ShadowRoot::styleResolver):
1739         (WebCore::ShadowRoot::styleScope):
1740         (WebCore::ShadowRoot::updateStyle):
1741         (WebCore::ShadowRoot::authorStyleSheets): Deleted.
1742         * dom/ShadowRoot.h:
1743         * html/HTMLLinkElement.cpp:
1744         (WebCore::HTMLLinkElement::~HTMLLinkElement):
1745         (WebCore::HTMLLinkElement::setDisabledState):
1746         (WebCore::HTMLLinkElement::parseAttribute):
1747         (WebCore::HTMLLinkElement::process):
1748         (WebCore::HTMLLinkElement::insertedInto):
1749         (WebCore::HTMLLinkElement::removedFrom):
1750         (WebCore::HTMLLinkElement::addPendingSheet):
1751         (WebCore::HTMLLinkElement::removePendingSheet):
1752         * html/HTMLStyleElement.cpp:
1753         * inspector/InspectorCSSAgent.cpp:
1754         (WebCore::InspectorCSSAgent::collectAllDocumentStyleSheets):
1755         (WebCore::InspectorCSSAgent::forcePseudoState):
1756         (WebCore::InspectorCSSAgent::buildObjectForRule):
1757         (WebCore::InspectorCSSAgent::resetPseudoStates):
1758         * inspector/InspectorPageAgent.cpp:
1759         (WebCore::InspectorPageAgent::setEmulatedMedia):
1760         * page/DOMWindow.cpp:
1761         (WebCore::DOMWindow::getMatchedCSSRules):
1762         * page/Frame.cpp:
1763         (WebCore::Frame::setPrinting):
1764         * page/FrameView.cpp:
1765         (WebCore::FrameView::layout):
1766         (WebCore::FrameView::setPagination):
1767         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
1768         * page/Page.cpp:
1769         (WebCore::Page::setViewMode):
1770         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
1771         (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
1772         * style/StyleScope.cpp: Copied from dom/AuthorStyleSheets.cpp.
1773         (WebCore::Style::Scope::Scope):
1774         (WebCore::Style::Scope::styleResolver):
1775         (WebCore::Style::Scope::styleResolverIfExists):
1776         (WebCore::Style::Scope::forNode):
1777         (WebCore::Style::Scope::removePendingSheet):
1778         (WebCore::Style::Scope::addStyleSheetCandidateNode):
1779         (WebCore::Style::Scope::removeStyleSheetCandidateNode):
1780         (WebCore::Style::Scope::collectActiveStyleSheets):
1781         (WebCore::Style::Scope::analyzeStyleSheetChange):
1782         (WebCore::Style::Scope::updateActiveStyleSheets):
1783         (WebCore::Style::Scope::updateStyleResolver):
1784         (WebCore::Style::Scope::activeStyleSheetsForInspector):
1785         (WebCore::Style::Scope::activeStyleSheetsContains):
1786         (WebCore::Style::Scope::flushPendingUpdate):
1787         (WebCore::Style::Scope::clearPendingUpdate):
1788         (WebCore::Style::Scope::scheduleActiveSetUpdate):
1789         (WebCore::Style::Scope::didChangeCandidatesForActiveSet):
1790         (WebCore::Style::Scope::didChangeContentsOrInterpretation):
1791         (WebCore::Style::Scope::pendingUpdateTimerFired):
1792         (WebCore::AuthorStyleSheets::AuthorStyleSheets): Deleted.
1793         (WebCore::AuthorStyleSheets::styleResolver): Deleted.
1794         (WebCore::AuthorStyleSheets::styleResolverIfExists): Deleted.
1795         (WebCore::AuthorStyleSheets::forNode): Deleted.
1796         (WebCore::AuthorStyleSheets::removePendingSheet): Deleted.
1797         (WebCore::AuthorStyleSheets::addStyleSheetCandidateNode): Deleted.
1798         (WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode): Deleted.
1799         (WebCore::AuthorStyleSheets::collectActiveStyleSheets): Deleted.
1800         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange): Deleted.
1801         (WebCore::AuthorStyleSheets::updateActiveStyleSheets): Deleted.
1802         (WebCore::AuthorStyleSheets::updateStyleResolver): Deleted.
1803         (WebCore::AuthorStyleSheets::activeStyleSheetsForInspector): Deleted.
1804         (WebCore::AuthorStyleSheets::activeStyleSheetsContains): Deleted.
1805         (WebCore::AuthorStyleSheets::flushPendingUpdate): Deleted.
1806         (WebCore::AuthorStyleSheets::clearPendingUpdate): Deleted.
1807         (WebCore::AuthorStyleSheets::scheduleActiveSetUpdate): Deleted.
1808         (WebCore::AuthorStyleSheets::didChangeCandidatesForActiveSet): Deleted.
1809         (WebCore::AuthorStyleSheets::didChangeContentsOrInterpretation): Deleted.
1810         (WebCore::AuthorStyleSheets::pendingUpdateTimerFired): Deleted.
1811         * style/StyleScope.h: Copied from dom/AuthorStyleSheets.h.
1812         * style/StyleTreeResolver.cpp:
1813         * svg/SVGFontFaceElement.cpp:
1814         (WebCore::SVGFontFaceElement::rebuildFontFace):
1815         (WebCore::SVGFontFaceElement::removedFrom):
1816         * xml/XMLTreeViewer.cpp:
1817         (WebCore::XMLTreeViewer::transformDocumentToTreeView):
1818         * xml/parser/XMLDocumentParser.cpp:
1819         (WebCore::XMLDocumentParser::end):
1820         * xml/parser/XMLDocumentParserLibxml2.cpp:
1821         (WebCore::XMLDocumentParser::doEnd):
1822
1823 2016-10-07  Zalan Bujtas  <zalan@apple.com>
1824
1825         https://vuldb.com/?cvssv3.2012 takes long time to load.
1826         https://bugs.webkit.org/show_bug.cgi?id=162994
1827         <rdar://problem/28593746>
1828
1829         Reviewed by Darin Adler.
1830
1831         Stop visiting cousins when we hit the style sharing search threshold.
1832
1833         In addition to mistakenly ignoring the threshold at SharingResolver::findSibling(), we
1834         continued on searching for cousin elements. 
1835
1836         Test: fast/selectors/slow-style-sharing-with-long-cousin-list.html
1837
1838         * style/StyleSharingResolver.cpp:
1839         (WebCore::Style::SharingResolver::resolve):
1840         (WebCore::Style::SharingResolver::findSibling):
1841         (WebCore::Style::SharingResolver::locateCousinList):
1842
1843 2016-10-07  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1844
1845         [Readable Streams API] Implement generic reader functions
1846         https://bugs.webkit.org/show_bug.cgi?id=163003
1847
1848         Reviewed by Darin Adler.
1849
1850         Implements reader generic functions defined by spec in order to prepare BYOBReader integration.
1851         Generic functions factorize some code that is used by both DefaultReader and BYOBReader.
1852
1853         No change in behaviour.
1854
1855         * Modules/streams/ReadableStreamDefaultReader.js:
1856         (cancel): Rely on readableStreamReaderGenericCancel.
1857         (releaseLock): Rely on readableStreamReaderGenericRelease.
1858         * Modules/streams/ReadableStreamInternals.js:
1859         (privateInitializeReadableStreamDefaultReader): Rely on readableStreamReaderGenericInitialize.
1860         (readableStreamReaderGenericInitialize): Added.
1861         (readableStreamReaderGenericCancel): Added.
1862         (readableStreamReaderGenericRelease): Added.
1863
1864 2016-10-07  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1865
1866         WebRTC: Misc gardening: Use typedefs consistently and remove unused code
1867         https://bugs.webkit.org/show_bug.cgi?id=163104
1868
1869         Reviewed by Philippe Normand.
1870
1871         Miscellaneous WebRTC gardening. See file list below for details.
1872
1873         Testing: No change in behavior.
1874
1875         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1876         * Modules/mediastream/MediaEndpointPeerConnection.h:
1877         Move NotImplemented include to cpp-file.
1878         * platform/mediastream/MediaEndpoint.h:
1879         Use MediaPayloadVector typedef (instead of Vector<RefPtr<MediaPayload>>).
1880         * platform/mediastream/PeerMediaDescription.h:
1881         (WebCore::PeerMediaDescription::source): Deleted.
1882         (WebCore::PeerMediaDescription::setSource): Deleted.
1883         Sources are passed to updateSendConfiguration() via a source map and not added to each
1884         PeerMediaDescription anymore. Remove unused code.
1885         * platform/mock/MockMediaEndpoint.cpp:
1886         (WebCore::MockMediaEndpoint::getDefaultAudioPayloads):
1887         (WebCore::MockMediaEndpoint::getDefaultVideoPayloads):
1888         Use MediaPayloadVector typedef.
1889         * platform/mock/MockMediaEndpoint.h:
1890         Use MediaPayloadVector typedef.
1891
1892 2016-10-07  Gwang Yoon Hwang  <yoon@igalia.com>
1893
1894         [GTK] Remove unneeded creation of TextureMapperPlatformLayerProxy
1895         https://bugs.webkit.org/show_bug.cgi?id=163101
1896
1897         Reviewed by Žan Doberšek.
1898
1899         Covered by existing tests.
1900
1901         * platform/graphics/cairo/ImageBufferCairo.cpp:
1902         (WebCore::ImageBufferData::ImageBufferData): Modified not to create
1903         TextureMapperPlatformLayerProxy if it is not created for the
1904         accelerated 2d canvas.
1905
1906 2016-10-07  Fujii Hironori  <Hironori.Fujii@sony.com>
1907
1908         Use 'use lib $FindBin::Bin' to append Perl module include path
1909         https://bugs.webkit.org/show_bug.cgi?id=162256
1910
1911         Reviewed by Carlos Garcia Campos.
1912
1913         Some Perl  scripts are needed to  be executed with '-I'  switch to
1914         explicitly append Perl module include path.  Use 'use lib' as well
1915         as other Perl scripts do.
1916
1917         * CMakeLists.txt: Removed '-I' options from invocation of Perl.
1918         * DerivedSources.make: Ditto.
1919         * bindings/scripts/generate-bindings.pl: Use 'use lib'.
1920         * bindings/scripts/preprocess-idls.pl: Ditto.
1921         * css/make-css-file-arrays.pl: Ditto.
1922         * css/makegrammar.pl: Ditto.
1923         * css/makeprop.pl: Ditto.
1924         * css/makevalues.pl: Ditto.
1925         * dom/make_dom_exceptions.pl: Ditto.
1926         * dom/make_event_factory.pl: Ditto.
1927         * dom/make_names.pl: Ditto.
1928         * page/make_settings.pl: Ditto.
1929
1930 2016-10-07  Youenn Fablet  <youenn@apple.com>
1931
1932         Refactor CachedResourceClient::notifyFinished
1933         https://bugs.webkit.org/show_bug.cgi?id=162060
1934
1935         Reviewed by Darin Adler.
1936
1937         No change of behavior.
1938
1939         Making CachedResourceClient and CachedRawResourceClient callbacks take CachedResource references and not pointers.
1940         In most cases, the CachedResource parameter is only used for assertions.
1941         Removing that parameter might be contemplated in the future.
1942         The only real case is in RenderImage.
1943
1944         Removed the CachedResource parameter from ContentFilter methods as code was calling these methods with null values.
1945
1946         * dom/LoadableClassicScript.cpp:
1947         (WebCore::LoadableClassicScript::notifyFinished):
1948         * dom/LoadableClassicScript.h:
1949         * html/HTMLImageLoader.cpp:
1950         (WebCore::HTMLImageLoader::notifyFinished):
1951         * html/HTMLImageLoader.h:
1952         * loader/ContentFilter.cpp:
1953         (WebCore::ContentFilter::continueAfterResponseReceived):
1954         (WebCore::ContentFilter::continueAfterDataReceived):
1955         (WebCore::ContentFilter::continueAfterNotifyFinished):
1956         (WebCore::ContentFilter::deliverResourceData):
1957         * loader/ContentFilter.h:
1958         * loader/CrossOriginPreflightChecker.cpp:
1959         (WebCore::CrossOriginPreflightChecker::notifyFinished):
1960         * loader/CrossOriginPreflightChecker.h:
1961         * loader/DocumentLoader.cpp:
1962         (WebCore::DocumentLoader::notifyFinished):
1963         (WebCore::DocumentLoader::handleSubstituteDataLoadNow):
1964         (WebCore::DocumentLoader::redirectReceived):
1965         (WebCore::DocumentLoader::responseReceived):
1966         (WebCore::DocumentLoader::continueAfterContentPolicy):
1967         (WebCore::DocumentLoader::dataReceived):
1968         * loader/DocumentLoader.h:
1969         * loader/DocumentThreadableLoader.cpp:
1970         (WebCore::DocumentThreadableLoader::redirectReceived):
1971         (WebCore::DocumentThreadableLoader::dataSent):
1972         (WebCore::DocumentThreadableLoader::responseReceived):
1973         (WebCore::DocumentThreadableLoader::dataReceived):
1974         (WebCore::DocumentThreadableLoader::notifyFinished):
1975         * loader/DocumentThreadableLoader.h:
1976         * loader/ImageLoader.cpp:
1977         (WebCore::ImageLoader::notifyFinished):
1978         * loader/ImageLoader.h:
1979         * loader/LinkLoader.cpp:
1980         (WebCore::LinkLoader::triggerEvents):
1981         (WebCore::LinkLoader::notifyFinished):
1982         * loader/LinkLoader.h:
1983         * loader/LinkPreloadResourceClients.cpp:
1984         (WebCore::LinkPreloadResourceClient::triggerEvents):
1985         * loader/LinkPreloadResourceClients.h:
1986         * loader/MediaResourceLoader.cpp:
1987         (WebCore::MediaResource::responseReceived):
1988         (WebCore::MediaResource::shouldCacheResponse):
1989         (WebCore::MediaResource::redirectReceived):
1990         (WebCore::MediaResource::dataSent):
1991         (WebCore::MediaResource::dataReceived):
1992         (WebCore::MediaResource::notifyFinished):
1993         (WebCore::MediaResource::getOrCreateReadBuffer):
1994         * loader/MediaResourceLoader.h:
1995         * loader/TextTrackLoader.cpp:
1996         (WebCore::TextTrackLoader::processNewCueData):
1997         (WebCore::TextTrackLoader::deprecatedDidReceiveCachedResource):
1998         (WebCore::TextTrackLoader::notifyFinished):
1999         * loader/TextTrackLoader.h:
2000         * loader/cache/CachedRawResource.cpp:
2001         (WebCore::CachedRawResource::notifyClientsDataWasReceived):
2002         (WebCore::CachedRawResource::didAddClient):
2003         (WebCore::CachedRawResource::redirectReceived):
2004         (WebCore::CachedRawResource::responseReceived):
2005         (WebCore::CachedRawResource::shouldCacheResponse):
2006         (WebCore::CachedRawResource::didSendData):
2007         * loader/cache/CachedRawResourceClient.h:
2008         (WebCore::CachedRawResourceClient::dataSent):
2009         (WebCore::CachedRawResourceClient::responseReceived):
2010         (WebCore::CachedRawResourceClient::shouldCacheResponse):
2011         (WebCore::CachedRawResourceClient::dataReceived):
2012         (WebCore::CachedRawResourceClient::redirectReceived):
2013         (WebCore::CachedRawResourceClient::getOrCreateReadBuffer):
2014         * loader/cache/CachedResource.cpp:
2015         (WebCore::CachedResource::checkNotify):
2016         (WebCore::CachedResource::didAddClient):
2017         * loader/cache/CachedResourceClient.h:
2018         (WebCore::CachedResourceClient::notifyFinished):
2019         (WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):
2020         * loader/cache/CachedTextTrack.cpp:
2021         (WebCore::CachedTextTrack::updateData):
2022         * loader/icon/IconLoader.cpp:
2023         (WebCore::IconLoader::notifyFinished):
2024         * loader/icon/IconLoader.h:
2025         * loader/soup/CachedRawResourceSoup.cpp:
2026         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2027         (WebCore::WebCoreAVCFResourceLoader::responseReceived):
2028         (WebCore::WebCoreAVCFResourceLoader::dataReceived):
2029         (WebCore::WebCoreAVCFResourceLoader::notifyFinished):
2030         (WebCore::WebCoreAVCFResourceLoader::fulfillRequestWithResource):
2031         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h:
2032         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
2033         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2034         (WebCore::WebCoreAVFResourceLoader::responseReceived):
2035         (WebCore::WebCoreAVFResourceLoader::dataReceived):
2036         (WebCore::WebCoreAVFResourceLoader::notifyFinished):
2037         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
2038         * rendering/RenderImage.cpp:
2039         (WebCore::RenderImage::notifyFinished):
2040         * rendering/RenderImage.h:
2041         * rendering/RenderLayerFilterInfo.cpp:
2042         (WebCore::RenderLayer::FilterInfo::setRenderer):
2043         (WebCore::RenderLayer::FilterInfo::notifyFinished):
2044         * rendering/RenderLayerFilterInfo.h:
2045         * svg/SVGFEImageElement.cpp:
2046         (WebCore::SVGFEImageElement::notifyFinished):
2047         * svg/SVGFEImageElement.h:
2048         * svg/SVGUseElement.cpp:
2049         (WebCore::SVGUseElement::notifyFinished):
2050         * svg/SVGUseElement.h:
2051         * xml/parser/XMLDocumentParser.cpp:
2052         (WebCore::XMLDocumentParser::notifyFinished):
2053         * xml/parser/XMLDocumentParser.h:
2054
2055 2016-10-06  Youenn Fablet  <youenn@apple.com>
2056
2057         CachedXSLStylesheet does not need to be updated according Origin/Fetch mode
2058         https://bugs.webkit.org/show_bug.cgi?id=162389
2059
2060         Reviewed by Darin Adler.
2061
2062         No change of behavior.
2063
2064         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.
2065
2066         Renaming CachedResource::isClean to CachedResource::isCORSSameOrigin to better match spec terminology.
2067         Updating HTMLLinkElement accordingly.
2068
2069         * html/HTMLLinkElement.cpp:
2070         (WebCore::HTMLLinkElement::initializeStyleSheet):
2071         * loader/cache/CachedResource.cpp:
2072         (WebCore::CachedResource::isCORSSameOrigin): Ensuring that this method is not called for resource types for which CORS is not to be used.
2073         (WebCore::CachedResource::isClean): Deleted.
2074         * loader/cache/CachedResource.h:
2075         * loader/cache/CachedResourceLoader.cpp:
2076         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2077
2078 2016-10-06  Youenn Fablet  <youenn@apple.com>
2079
2080         Add a place for common HTTP Header values
2081         https://bugs.webkit.org/show_bug.cgi?id=163002
2082
2083         Reviewed by Alex Christensen.
2084
2085         No change of behavior.
2086
2087         Introducing HTTPHeaderValues with two Content-Type values.
2088
2089         * CMakeLists.txt:
2090         * Modules/fetch/FetchBody.cpp:
2091         (WebCore::FetchBody::extract):
2092         * WebCore.xcodeproj/project.pbxproj:
2093         * platform/network/HTTPHeaderValues.cpp: Added.
2094         (WebCore::HTTPHeaderValues::TextPlainContentType):
2095         (WebCore::HTTPHeaderValues::FormURLEncodedContentType):
2096         * platform/network/HTTPHeaderValues.h: Added.
2097         * xml/XMLHttpRequest.cpp:
2098         (WebCore::XMLHttpRequest::send):
2099
2100 2016-10-06  Youenn Fablet  <youenn@apple.com>
2101
2102         CachedResourceRequest should not need to store defer and preload options
2103         https://bugs.webkit.org/show_bug.cgi?id=163004
2104
2105         Reviewed by Alex Christensen.
2106
2107         No change of behavior.
2108
2109         Removing CachedResourceRequest defer and preload fields.
2110         These fields are computed inside CachedResourceLoader instead.
2111
2112         Updated setting of priority from CachedResourceRequest to CachedResource.
2113         Priority is set for any new resource (this covers all cases where no cached resource can be reused from the memory cache).
2114         Priority is set for a cached resource if the request is not a preload request.
2115
2116         * loader/LinkLoader.cpp:
2117         (WebCore::LinkLoader::preloadIfNeeded):
2118         * loader/cache/CachedResource.cpp:
2119         (WebCore::CachedResource::CachedResource):
2120         * loader/cache/CachedResourceLoader.cpp:
2121         (WebCore::CachedResourceLoader::requestImage):
2122         (WebCore::CachedResourceLoader::canRequest):
2123         (WebCore::CachedResourceLoader::requestResource):
2124         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
2125         (WebCore::CachedResourceLoader::requestPreload):
2126         * loader/cache/CachedResourceLoader.h:
2127         * loader/cache/CachedResourceRequest.cpp:
2128         (WebCore::CachedResourceRequest::CachedResourceRequest):
2129         * loader/cache/CachedResourceRequest.h:
2130         (WebCore::CachedResourceRequest::priority):
2131         (WebCore::CachedResourceRequest::forPreload): Deleted.
2132         (WebCore::CachedResourceRequest::setForPreload): Deleted.
2133         (WebCore::CachedResourceRequest::defer): Deleted.
2134         (WebCore::CachedResourceRequest::setDefer): Deleted.
2135
2136 2016-10-06  Myles C. Maxfield  <mmaxfield@apple.com>
2137
2138         Variation fonts don't affect glyph advances
2139         https://bugs.webkit.org/show_bug.cgi?id=163093
2140
2141         Reviewed by Darin Adler.
2142
2143         Work around known bug <rdar://problem/28662086>. For variation fonts,
2144         CTFontGetAdvancesForGlyphs() gives correct answers but
2145         CTFontGetUnsummedAdvancesForGlyphsAndStyle() doesn't.
2146
2147         Test: fast/text/variations/advances.html
2148
2149         * platform/graphics/FontPlatformData.h:
2150         (WebCore::FontPlatformData::hasVariations):
2151         * platform/graphics/cocoa/FontCocoa.mm:
2152         (WebCore::Font::platformWidthForGlyph):
2153         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2154         (WebCore::FontPlatformData::FontPlatformData):
2155
2156 2016-10-06  Commit Queue  <commit-queue@webkit.org>
2157
2158         Unreviewed, rolling out r206713.
2159         https://bugs.webkit.org/show_bug.cgi?id=163097
2160
2161         triggers apparent codegen bug on ARM 32-bit (Requested by smfr
2162         on #webkit).
2163
2164         Reverted changeset:
2165
2166         "Support transitions/animations of background-position with
2167         right/bottom-relative values"
2168         https://bugs.webkit.org/show_bug.cgi?id=162048
2169         http://trac.webkit.org/changeset/206713
2170
2171 2016-10-06  Daniel Bates  <dabates@apple.com>
2172
2173         Remove unused WebCore::contentDispositionType()
2174         https://bugs.webkit.org/show_bug.cgi?id=163095
2175
2176         Reviewed by Alex Christensen.
2177
2178         The function WebCore::contentDispositionType() was only used by the Chromium and Qt ports
2179         to parse the Content-Disposition HTTP header. Both of these ports have long since been
2180         removed from the repository. We should remove WebCore::contentDispositionType().
2181
2182         * platform/network/HTTPParsers.cpp:
2183         (WebCore::contentDispositionType): Deleted.
2184         * platform/network/HTTPParsers.h:
2185
2186 2016-10-06  Ryosuke Niwa  <rniwa@webkit.org>
2187
2188         Upgrading and constructing element should always report exception instead of rethrowing
2189         https://bugs.webkit.org/show_bug.cgi?id=162996
2190
2191         Reviewed by Darin Adler.
2192
2193         The latest HTML specification specifies that we must report exceptions thrown during element upgrades:
2194         https://html.spec.whatwg.org/#upgrades
2195
2196         In addition, F2F during 2016 TPAC had a consensus that we should do the same for document.createElement:
2197         https://github.com/w3c/webcomponents/issues/569
2198
2199         Since the HTML parser already reports the exception thrown during custom element construction as it does
2200         not have any JS stack, these changes make exceptions thrown during upgrades and constructions.
2201
2202         In our implementation, this only reduces the code complexity as now we can push the logic to fallback
2203         to HTMLUnknownElement into JSCustomElementInterface's constructElement, which has been renamed
2204         to constructElementWithFallback, and eliminate ShouldClearException enum class entirely. Moreover,
2205         constructElementWithFallback can now return Ref instead of RefPtr.
2206
2207         No new tests. Existing tests have been updated.
2208
2209         * bindings/js/JSCustomElementInterface.cpp:
2210         (WebCore::JSCustomElementInterface::constructElementWithFallback): Create a HTMLUnknownElement if
2211         an attempt to construct a custom element had failed in lieu of returning nullptr.
2212         (WebCore::JSCustomElementInterface::tryToConstructCustomElement): Renamed from constructElement.
2213         Always report exceptions (the same behavior as ShouldClearException::Clear).
2214         (WebCore::JSCustomElementInterface::upgradeElement): Report exceptions instead of rethrowing.
2215         * bindings/js/JSCustomElementInterface.h:
2216         * dom/Document.cpp:
2217         (WebCore::createHTMLElementWithNameValidation):
2218         * html/parser/HTMLDocumentParser.cpp:
2219         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
2220
2221 2016-10-06  Chris Dumez  <cdumez@apple.com>
2222
2223         Overwriting an attribute event listener can lead to wrong event listener firing order
2224         https://bugs.webkit.org/show_bug.cgi?id=163083
2225
2226         Reviewed by Darin Adler.
2227
2228         Overwriting an attribute event listener could lead to wrong event listener
2229         firing order in WebKit. This is because we were removing the old event
2230         listener and then appending the new one instead of actually *replacing*
2231         the old one.
2232
2233         No new tests, rebaselined existing tests.
2234
2235         * dom/EventListenerMap.cpp:
2236         (WebCore::EventListenerMap::replace):
2237         * dom/EventListenerMap.h:
2238         * dom/EventTarget.cpp:
2239         (WebCore::EventTarget::setAttributeEventListener):
2240         (WebCore::EventTarget::hasActiveEventListeners): Deleted.
2241         (WebCore::EventTarget::dispatchEventForBindings): Deleted.
2242         * dom/EventTarget.h:
2243
2244 2016-10-06  Alex Christensen  <achristensen@webkit.org>
2245
2246         URLParser: Non-ASCII characters in Non-UTF-8 encoded queries of relative URLs with ws, wss, or nonspecial schemes should be UTF-8 encoded
2247         https://bugs.webkit.org/show_bug.cgi?id=163089
2248
2249         Reviewed by Tim Horton.
2250
2251         This is a change similar to r206818 but with relative URLs.
2252         This matches the spec, URL::parse, and other browsers' behavior.
2253         Covered by new API tests for URLParser.
2254         This also fixes tests like http/tests/misc/url-in-utf32le.html when URLParser is enabled.
2255
2256         * platform/URL.cpp:
2257         (WebCore::URL::URL):
2258         Use the same encoding for the URL constructor whether or not the URLParser is enabled.
2259         * platform/URLParser.cpp:
2260         (WebCore::URLParser::copyURLPartsUntil):
2261         (WebCore::URLParser::parse):
2262         (WebCore::isSpecial): Deleted.
2263         * platform/URLParser.h:
2264         Use UTF-8 for non-special, ws, or wss schemes.
2265
2266 2016-10-06  Zalan Bujtas  <zalan@apple.com>
2267
2268         Add back ASSERT(!needsLayout) to RenderTableSection which is now valid
2269         https://bugs.webkit.org/show_bug.cgi?id=92954
2270         <rdar://problem/12147973>
2271
2272         Reviewed by Dan Bernstein.
2273
2274         LayoutTests pass fine now with this assert on.
2275
2276         Covered by existing tests.
2277
2278         * rendering/RenderTableSection.cpp:
2279         (WebCore::RenderTableSection::paint):
2280
2281 2016-10-06  Jiewen Tan  <jiewen_tan@apple.com>
2282
2283         Add a dummy SubtleCrypto interface
2284         https://bugs.webkit.org/show_bug.cgi?id=162992
2285         <rdar://problem/28643573>
2286
2287         Reviewed by Brent Fulgham.
2288
2289         Add a dummy SubtleCrypto interface and rename KeyPair to CryptoKeyPair.
2290
2291         Tests: crypto/subtle/gc-2.html
2292                crypto/subtle/gc-3.html
2293                crypto/subtle/gc.html
2294                crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html
2295                crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html
2296                crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html
2297                crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html
2298                crypto/webkitSubtle/aes-cbc-generate-key.html
2299                crypto/webkitSubtle/aes-cbc-import-jwk.html
2300                crypto/webkitSubtle/aes-cbc-invalid-length.html
2301                crypto/webkitSubtle/aes-cbc-unwrap-failure.html
2302                crypto/webkitSubtle/aes-cbc-unwrap-rsa.html
2303                crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html
2304                crypto/webkitSubtle/aes-cbc-wrap-rsa.html
2305                crypto/webkitSubtle/aes-cbc-wrong-key-class.html
2306                crypto/webkitSubtle/aes-export-key.html
2307                crypto/webkitSubtle/aes-kw-key-manipulation.html
2308                crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html
2309                crypto/webkitSubtle/aes-postMessage.html
2310                crypto/webkitSubtle/argument-conversion.html
2311                crypto/webkitSubtle/array-buffer-view-offset.html
2312                crypto/webkitSubtle/crypto-key-algorithm-gc.html
2313                crypto/webkitSubtle/crypto-key-usages-gc.html
2314                crypto/webkitSubtle/hmac-check-algorithm.html
2315                crypto/webkitSubtle/hmac-export-key.html
2316                crypto/webkitSubtle/hmac-generate-key.html
2317                crypto/webkitSubtle/hmac-import-jwk.html
2318                crypto/webkitSubtle/hmac-postMessage.html
2319                crypto/webkitSubtle/hmac-sign-verify-empty-key.html
2320                crypto/webkitSubtle/hmac-sign-verify.html
2321                crypto/webkitSubtle/import-jwk.html
2322                crypto/webkitSubtle/jwk-export-use-values.html
2323                crypto/webkitSubtle/jwk-import-use-values.html
2324                crypto/webkitSubtle/rsa-export-generated-keys.html
2325                crypto/webkitSubtle/rsa-export-key.html
2326                crypto/webkitSubtle/rsa-export-private-key.html
2327                crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
2328                crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
2329                crypto/webkitSubtle/rsa-indexeddb-private.html
2330                crypto/webkitSubtle/rsa-indexeddb.html
2331                crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html
2332                crypto/webkitSubtle/rsa-oaep-key-manipulation.html
2333                crypto/webkitSubtle/rsa-oaep-plaintext-length.html
2334                crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html
2335                crypto/webkitSubtle/rsa-postMessage.html
2336                crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html
2337                crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
2338                crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html
2339                crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html
2340                crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html
2341                crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html
2342                crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html
2343                crypto/webkitSubtle/sha-1.html
2344                crypto/webkitSubtle/sha-224.html
2345                crypto/webkitSubtle/sha-256.html
2346                crypto/webkitSubtle/sha-384.html
2347                crypto/webkitSubtle/sha-512.html
2348                crypto/webkitSubtle/unimplemented-unwrap-crash.html
2349                crypto/webkitSubtle/unwrapKey-check-usage.html
2350                crypto/webkitSubtle/wrapKey-check-usage.html
2351                crypto/workers/subtle/aes-postMessage-worker.html
2352                crypto/workers/subtle/gc-worker.html
2353                crypto/workers/subtle/hmac-postMessage-worker.html
2354                crypto/workers/subtle/hrsa-postMessage-worker.html
2355                crypto/workers/subtle/multiple-postMessage-worker.html
2356                crypto/workers/subtle/rsa-postMessage-worker.html
2357
2358         * CMakeLists.txt:
2359         * DerivedSources.cpp:
2360         * DerivedSources.make:
2361         * PlatformEfl.cmake:
2362         * PlatformGTK.cmake:
2363         * PlatformMac.cmake:
2364         * WebCore.xcodeproj/project.pbxproj:
2365         * crypto/CryptoKeyPair.idl:
2366         * crypto/SubtleCrypto.cpp:
2367         (WebCore::SubtleCrypto::SubtleCrypto):
2368         * crypto/SubtleCrypto.h:
2369         (WebCore::SubtleCrypto::create):
2370         * crypto/SubtleCrypto.idl: Added.
2371         * page/Crypto.cpp:
2372         (WebCore::Crypto::Crypto):
2373         (WebCore::Crypto::subtle):
2374         * page/Crypto.h:
2375         * page/Crypto.idl:
2376
2377 2016-10-06  Anders Carlsson  <andersca@apple.com>
2378
2379         Crash when ApplePaySession.completeMerchantValidation is not passed a dictionary
2380         https://bugs.webkit.org/show_bug.cgi?id=163074
2381         rdar://problem/27824842
2382
2383         Reviewed by Tim Horton.
2384
2385         Raise a type error on a null initializer object.
2386
2387         * Modules/applepay/ApplePaySession.cpp:
2388         (WebCore::ApplePaySession::completeMerchantValidation):
2389
2390 2016-10-06  Antti Koivisto  <antti@apple.com>
2391
2392         Mutating styleSheet in shadow tree doesn't update the style
2393         https://bugs.webkit.org/show_bug.cgi?id=162744
2394         <rdar://problem/28550588>
2395
2396         Reviewed by Ryosuke Niwa.
2397
2398         We weren't always invalidating the right AuthorStyleSheets (to be renamed) instance
2399         for the scope after mutations.
2400
2401         Test: fast/shadow-dom/mutating-stylesheet-in-shadow-tree.html
2402
2403         * css/CSSStyleSheet.cpp:
2404         (WebCore::CSSStyleSheet::didMutateRules):
2405         (WebCore::CSSStyleSheet::didMutate):
2406         (WebCore::CSSStyleSheet::clearOwnerNode):
2407         (WebCore::CSSStyleSheet::rootStyleSheet):
2408         (WebCore::CSSStyleSheet::ownerDocument):
2409         (WebCore::CSSStyleSheet::styleSheetScope):
2410
2411             Invalidate the right scope after stylesheet mutations.
2412
2413         * css/CSSStyleSheet.h:
2414         * dom/AuthorStyleSheets.cpp:
2415         (WebCore::AuthorStyleSheets::styleResolver):
2416         (WebCore::AuthorStyleSheets::styleResolverIfExists):
2417
2418             Take care to update the right style resolver.
2419
2420         (WebCore::AuthorStyleSheets::forNode):
2421         (WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode):
2422
2423             Start the update timer so clients don't need to request update separately.
2424
2425         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
2426         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
2427         (WebCore::AuthorStyleSheets::updateStyleResolver):
2428         * dom/AuthorStyleSheets.h:
2429         * dom/InlineStyleSheetOwner.cpp:
2430         (WebCore::InlineStyleSheetOwner::insertedIntoDocument):
2431
2432             Save the scope we were inserted into so removals can be done reliably.
2433
2434         (WebCore::InlineStyleSheetOwner::removedFromDocument):
2435
2436             Use and clear the saved scope.
2437             Remove didChangeCandidatesForActiveSet() as it is now done by removeStyleSheetCandidateNode() call.
2438
2439         (WebCore::InlineStyleSheetOwner::clearDocumentData):
2440         (WebCore::InlineStyleSheetOwner::createSheet):
2441         (WebCore::InlineStyleSheetOwner::sheetLoaded):
2442         (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
2443         (WebCore::authorStyleSheetsForElement): Deleted.
2444         * dom/InlineStyleSheetOwner.h:
2445         (WebCore::InlineStyleSheetOwner::styleSheetScope):
2446         * dom/ShadowRoot.cpp:
2447         (WebCore::ShadowRoot::styleResolverIfExists):
2448         * dom/ShadowRoot.h:
2449         * html/HTMLLinkElement.cpp:
2450         (WebCore::HTMLLinkElement::removedFrom):
2451
2452             Remove didChangeCandidatesForActiveSet() as it is now done by removeStyleSheetCandidateNode() call.
2453
2454         * html/HTMLStyleElement.cpp:
2455         (WebCore::HTMLStyleElement::~HTMLStyleElement):
2456         (WebCore::HTMLStyleElement::parseAttribute):
2457
2458             Fix a bug where we wouldn't create stylesheet if a style element was activated by removing a media attribute.
2459
2460         (WebCore::HTMLStyleElement::insertedInto):
2461         (WebCore::HTMLStyleElement::removedFrom):
2462         * page/DOMWindow.cpp:
2463         (WebCore::DOMWindow::getMatchedCSSRules):
2464         * svg/SVGStyleElement.cpp:
2465         (WebCore::SVGStyleElement::~SVGStyleElement):
2466         (WebCore::SVGStyleElement::insertedInto):
2467         (WebCore::SVGStyleElement::removedFrom):
2468
2469 2016-10-06  Alex Christensen  <achristensen@webkit.org>
2470
2471         Skip tabs and newlines between end of query and beginning of fragment in non-UTF-8-encoded URLs
2472         https://bugs.webkit.org/show_bug.cgi?id=163071
2473
2474         Reviewed by Tim Horton.
2475
2476         Covered by a new API test that would have asserted before this change.
2477
2478         * platform/URLParser.cpp:
2479         (WebCore::URLParser::encodeQuery):
2480         Skip tabs and newlines before asserting that we are at the end.
2481
2482 2016-10-06  Alex Christensen  <achristensen@webkit.org>
2483
2484         URLParser should parse file URLs with ports consistently
2485         https://bugs.webkit.org/show_bug.cgi?id=163075
2486
2487         Reviewed by Brady Eidson.
2488
2489         Covered by API tests.  We used to assert when parsing the newly tested URLs.
2490
2491         * platform/URLParser.cpp:
2492         (WebCore::URLParser::parse):
2493
2494 2016-10-06  Chris Dumez  <cdumez@apple.com>
2495
2496         [WebIDL] Add support for having dictionaries in their own IDL file
2497         https://bugs.webkit.org/show_bug.cgi?id=162912
2498
2499         Reviewed by Darin Adler.
2500
2501         Add support for having dictionaries in their own IDL file so that they
2502         can be shared by multiple interfaces.
2503
2504         Leverage this new support to merge Element::ScrollToOptions and
2505         DOMWindow::ScrollToOptions.
2506
2507         No new tests, extended bindings tests.
2508
2509         * CMakeLists.txt:
2510         * DerivedSources.cpp:
2511         * DerivedSources.make:
2512         * WebCore.xcodeproj/project.pbxproj:
2513         * bindings/scripts/CodeGenerator.pm:
2514         (ProcessDocument):
2515         (IDLFileForInterface):
2516         (GetDictionaryByName):
2517         (IsDictionaryType):
2518         (HasEnumImplementationNameOverride): Deleted.
2519         (GetEnumImplementationNameOverride): Deleted.
2520         * bindings/scripts/CodeGeneratorJS.pm:
2521         (GenerateDictionary):
2522         (GetEnumerationClassName):
2523         (GenerateEnumerationImplementationContent):
2524         (GenerateEnumerationHeaderContent):
2525         (GetDictionaryClassName):
2526         (GenerateDefaultValue):
2527         (GenerateDictionaryHeaderContent):
2528         (GenerateDictionariesHeaderContent):
2529         (GenerateDictionaryImplementationContent):
2530         (GenerateDictionariesImplementationContent):
2531         (GenerateHeader):
2532         (GenerateImplementation):
2533         (GenerateParametersCheck):
2534         (GenerateDictionaryHeader):
2535         (GenerateDictionaryImplementation):
2536         (GenerateCallbackHeader):
2537         (GenerateCallbackImplementation):
2538         (GetNativeType):
2539         (JSValueToNative):
2540         (GetNestedClassName): Deleted.
2541         (GenerateConversionRuleWithLeadingComma): Deleted.
2542         (addIterableProperties): Deleted.
2543         * bindings/scripts/preprocess-idls.pl:
2544         (containsInterfaceOrExceptionFromIDL):
2545         * bindings/scripts/test/JS/JSTestObj.cpp:
2546         (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter):
2547         (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot): Deleted.
2548         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: Added.
2549         (WebCore::convertDictionary<TestStandaloneDictionary>):
2550         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h: Added.
2551         * bindings/scripts/test/TestObj.idl:
2552         * bindings/scripts/test/TestStandaloneDictionary.idl: Added.
2553         * dom/Element.h:
2554         * dom/Element.idl:
2555         * html/HTMLBodyElement.cpp:
2556         (WebCore::HTMLBodyElement::scrollTo):
2557         * page/DOMWindow.h:
2558         * page/DOMWindow.idl:
2559         * page/ScrollToOptions.h: Added.
2560         * page/ScrollToOptions.idl: Added.
2561
2562 2016-10-06  Brent Fulgham  <bfulgham@apple.com>
2563
2564         Unreviewed build fix.
2565
2566         * platform/graphics/Image.cpp: Add missing include
2567         for 'NotImplemented' when building under Direct2D.
2568
2569 2016-10-06  Brent Fulgham  <bfulgham@apple.com>
2570
2571         [Win][Direct2D] Add Direct2D CMake rules
2572         https://bugs.webkit.org/show_bug.cgi?id=162925
2573
2574         Reviewed by Brent Fulgham.
2575
2576         Modify PlatformAppleWin.cmake to conditionally build the CoreGraphics
2577         and CoreAnimation implementation, or the Direct2D files, depending
2578         on whether the USE_DIRECT2D macro is set in the CMake build options.
2579         By default it builds the normal CA/CG way.
2580
2581         Add a stub GraphicsLayer implementation for Direct2D.
2582
2583         No new tests because there is no change in our active ports.
2584
2585         * PlatformAppleWin.cmake: Conditionalize the build for CA/CG or
2586         Direct2D.
2587         * config.h: Make sure CA is turned of for Direct2D builds.
2588         * page/win/FrameWinDirect2D.cpp: Add missing include file.
2589         * platform/graphics/win/GraphicsLayerDirect2D.cpp: Added.
2590         * platform/graphics/win/GraphicsLayerDirect2D.h: Added.
2591
2592 2016-10-06  Yusuke Suzuki  <utatane.tea@gmail.com>
2593
2594         [WebCore][JSC] Use new @throwTypeError and @throwRangeError intrinsics
2595         https://bugs.webkit.org/show_bug.cgi?id=163001
2596
2597         Reviewed by Keith Miller.
2598
2599         Replace `throw new @XXXError(...)` to @throwXXXError intrinsic.
2600         It reduces the size of bytecode sequence and facilitate inlining.
2601
2602         No behavior change.
2603
2604         * Modules/fetch/FetchHeaders.js:
2605         (initializeFetchHeaders):
2606         * Modules/fetch/FetchInternals.js:
2607         (fillFetchHeaders):
2608         * Modules/fetch/FetchRequest.js:
2609         (initializeFetchRequest):
2610         * Modules/fetch/FetchResponse.js:
2611         (initializeFetchResponse):
2612         (clone):
2613         * Modules/mediastream/NavigatorUserMedia.js:
2614         (webkitGetUserMedia):
2615         * Modules/mediastream/RTCPeerConnection.js:
2616         (initializeRTCPeerConnection):
2617         (getLocalStreams):
2618         (getStreamById):
2619         (addStream):
2620         * Modules/streams/ReadableStream.js:
2621         (initializeReadableStream):
2622         (getReader):
2623         * Modules/streams/ReadableStreamDefaultController.js:
2624         (enqueue):
2625         (error):
2626         (close):
2627         * Modules/streams/ReadableStreamDefaultReader.js:
2628         (releaseLock):
2629         * Modules/streams/ReadableStreamInternals.js:
2630         (privateInitializeReadableStreamDefaultReader):
2631         (privateInitializeReadableStreamDefaultController):
2632         (doStructuredClone):
2633         (readableStreamError):
2634         * Modules/streams/StreamInternals.js:
2635         (validateAndNormalizeQueuingStrategy):
2636         (enqueueValueWithSize):
2637         * Modules/streams/WritableStream.js:
2638         (initializeWritableStream):
2639         (state):
2640         * xml/XMLHttpRequest.js:
2641         (response):
2642
2643 2016-10-06  John Wilander  <wilander@apple.com>
2644
2645         Update Resource Load Statistics
2646         https://bugs.webkit.org/show_bug.cgi?id=162811
2647
2648         Reviewed by Alex Christensen.
2649
2650         No new tests. The counting is based on top privately owned domains
2651         which currently is not supported by layout tests nor API tests.
2652
2653         * Modules/websockets/WebSocket.cpp:
2654         (WebCore::WebSocket::connect):
2655             Now captures statistics for web sockets too.
2656         * loader/FrameLoader.cpp:
2657         (WebCore::FrameLoader::loadResourceSynchronously):
2658         * loader/ResourceLoadObserver.cpp:
2659             Now captures statistics for synchronous XHR too.
2660         (WebCore::is3xxRedirect):
2661             Convenience function.
2662         (WebCore::ResourceLoadObserver::shouldLog):
2663             Convenience function.
2664         (WebCore::ResourceLoadObserver::logFrameNavigation):
2665             Updated to make use of new convenience functions.
2666         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2667             Updated to make use of new convenience functions.
2668         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2669             Added.
2670         (WebCore::ResourceLoadObserver::logUserInteraction):
2671             Updated to make use of new convenience functions.
2672         (WebCore::ResourceLoadObserver::primaryDomain):
2673             Now makes use of the Public Suffix list.
2674             Removed old custom parsing of primary domain.
2675         * loader/ResourceLoadObserver.h:
2676         * loader/ResourceLoadStatisticsStore.cpp:
2677         (WebCore::ResourceLoadStatisticsStore::prevalentResourceDomainsWithoutUserInteraction):
2678             Convenience function.
2679         (WebCore::ResourceLoadStatisticsStore::processStatistics): Deleted.
2680         * loader/ResourceLoadStatisticsStore.h:
2681         * loader/SubresourceLoader.cpp:
2682         (WebCore::SubresourceLoader::willSendRequestInternal):
2683             Moved logging call higher up and added a check for whether we
2684             are loading the main resource. The reason for moving it up is
2685             to capture the request before some data may be cleared out in
2686             redirect handling. We also want to capture failed CORS requests
2687             since they are sent and then cancelled on the way back.
2688
2689 2016-10-06  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2690
2691         WebRTC: Add support for the iceconnectionstatechange event in MediaEndpointPeerConnection
2692         https://bugs.webkit.org/show_bug.cgi?id=162961
2693
2694         Reviewed by Eric Carlson.
2695
2696         Implement MediaEndpointPeerConnection's iceTransportStateChanged callback. When called, it
2697         updates the ICE transport state of the corresponding transceiver and determines if the
2698         RTCPeerConnection's aggregated iceConnectionState needs to be updated.
2699
2700         Update MediaEndpointMock's emulatePlatformEvent feature to support a new action:
2701         "step-ice-transport-states". When initiated, this action replays a predefined set of ICE
2702         transport state changes on a set of transceivers which can be observed via the
2703         iceTransportStateChanged (mentioned above).
2704
2705         Test: fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html
2706
2707         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2708         (WebCore::deriveAggregatedIceConnectionState):
2709         (WebCore::MediaEndpointPeerConnection::iceTransportStateChanged):
2710         * Modules/mediastream/MediaEndpointPeerConnection.h:
2711         * platform/mediastream/MediaEndpoint.h:
2712         (WebCore::MediaEndpointClient::~MediaEndpointClient):
2713         * platform/mock/MockMediaEndpoint.cpp:
2714         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
2715         (WebCore::MockMediaEndpoint::emulatePlatformEvent):
2716         (WebCore::MockMediaEndpoint::stepIceTransportStates):
2717         (WebCore::MockMediaEndpoint::iceTransportTimerFired):
2718         * platform/mock/MockMediaEndpoint.h:
2719
2720 2016-10-06  Youenn Fablet  <youenn@apple.com>
2721
2722         CachedResource client handling methods should take reference
2723         https://bugs.webkit.org/show_bug.cgi?id=163014
2724
2725         Reviewed by Alex Christensen.
2726
2727         No change of behavior.
2728
2729         * bindings/js/CachedScriptSourceProvider.h:
2730         (WebCore::CachedScriptSourceProvider::~CachedScriptSourceProvider):
2731         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
2732         * css/CSSCrossfadeValue.cpp:
2733         (WebCore::CSSCrossfadeValue::~CSSCrossfadeValue):
2734         (WebCore::CSSCrossfadeValue::loadSubimages):
2735         * css/CSSFilterImageValue.cpp:
2736         (WebCore::CSSFilterImageValue::~CSSFilterImageValue):
2737         (WebCore::CSSFilterImageValue::loadSubimages):
2738         * css/CSSFontFaceSource.cpp:
2739         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
2740         (WebCore::CSSFontFaceSource::~CSSFontFaceSource):
2741         * css/StyleRuleImport.cpp:
2742         (WebCore::StyleRuleImport::~StyleRuleImport):
2743         (WebCore::StyleRuleImport::requestStyleSheet):
2744         * dom/DataTransfer.cpp:
2745         (WebCore::DragImageLoader::startLoading):
2746         (WebCore::DragImageLoader::stopLoading):
2747         * dom/LoadableClassicScript.cpp:
2748         (WebCore::LoadableClassicScript::create):
2749         (WebCore::LoadableClassicScript::~LoadableClassicScript):
2750         * dom/ProcessingInstruction.cpp:
2751         (WebCore::ProcessingInstruction::~ProcessingInstruction):
2752         (WebCore::ProcessingInstruction::checkStyleSheet):
2753         (WebCore::ProcessingInstruction::parseStyleSheet):
2754         * html/HTMLLinkElement.cpp:
2755         (WebCore::HTMLLinkElement::~HTMLLinkElement):
2756         (WebCore::HTMLLinkElement::process):
2757         * loader/CrossOriginPreflightChecker.cpp:
2758         (WebCore::CrossOriginPreflightChecker::~CrossOriginPreflightChecker):
2759         (WebCore::CrossOriginPreflightChecker::startPreflight):
2760         * loader/DocumentLoader.cpp:
2761         (WebCore::DocumentLoader::detachFromFrame):
2762         (WebCore::DocumentLoader::clearMainResource):
2763         (WebCore::DocumentLoader::becomeMainResourceClient):
2764         * loader/DocumentThreadableLoader.cpp:
2765         (WebCore::DocumentThreadableLoader::~DocumentThreadableLoader):
2766         (WebCore::DocumentThreadableLoader::clearResource):
2767         (WebCore::DocumentThreadableLoader::loadRequest):
2768         * loader/ImageLoader.cpp:
2769         (WebCore::ImageLoader::~ImageLoader):
2770         (WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
2771         (WebCore::ImageLoader::updateFromElement):
2772         (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
2773         * loader/LinkLoader.cpp:
2774         (WebCore::LinkLoader::~LinkLoader):
2775         (WebCore::LinkLoader::notifyFinished):
2776         (WebCore::LinkLoader::loadLink):
2777         * loader/LinkPreloadResourceClients.h:
2778         (WebCore::LinkPreloadResourceClient::addResource):
2779         (WebCore::LinkPreloadResourceClient::clearResource):
2780         * loader/MediaResourceLoader.cpp:
2781         (WebCore::MediaResource::MediaResource):
2782         (WebCore::MediaResource::stop):
2783         * loader/TextTrackLoader.cpp:
2784         (WebCore::TextTrackLoader::~TextTrackLoader):
2785         (WebCore::TextTrackLoader::cancelLoad):
2786         (WebCore::TextTrackLoader::load):
2787         * loader/cache/CachedCSSStyleSheet.cpp:
2788         (WebCore::CachedCSSStyleSheet::didAddClient):
2789         * loader/cache/CachedCSSStyleSheet.h:
2790         * loader/cache/CachedFont.cpp:
2791         (WebCore::CachedFont::didAddClient):
2792         * loader/cache/CachedFont.h:
2793         * loader/cache/CachedImage.cpp:
2794         (WebCore::CachedImage::didAddClient):
2795         (WebCore::CachedImage::didRemoveClient):
2796         * loader/cache/CachedImage.h:
2797         * loader/cache/CachedRawResource.cpp:
2798         (WebCore::CachedRawResource::didAddClient):
2799         * loader/cache/CachedRawResource.h:
2800         * loader/cache/CachedResource.cpp:
2801         (WebCore::CachedResource::addClient):
2802         (WebCore::CachedResource::didAddClient):
2803         (WebCore::CachedResource::addClientToSet):
2804         (WebCore::CachedResource::removeClient):
2805         (WebCore::CachedResource::switchClientsToRevalidatedResource):
2806         (WebCore::CachedResource::Callback::timerFired):
2807         * loader/cache/CachedResource.h:
2808         (WebCore::CachedResource::hasClient):
2809         (WebCore::CachedResource::didRemoveClient):
2810         * loader/cache/CachedSVGDocumentReference.cpp:
2811         (WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
2812         (WebCore::CachedSVGDocumentReference::load):
2813         * loader/cache/CachedXSLStyleSheet.cpp:
2814         (WebCore::CachedXSLStyleSheet::didAddClient):
2815         * loader/cache/CachedXSLStyleSheet.h:
2816         * loader/cache/MemoryCache.cpp:
2817         (WebCore::MemoryCache::addImageToCache):
2818         (WebCore::MemoryCache::removeImageFromCache):
2819         * loader/icon/IconLoader.cpp:
2820         (WebCore::IconLoader::startLoading):
2821         (WebCore::IconLoader::stopLoading):
2822         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2823         (WebCore::WebCoreAVCFResourceLoader::startLoading):
2824         (WebCore::WebCoreAVCFResourceLoader::stopLoading):
2825         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2826         (WebCore::WebCoreAVFResourceLoader::startLoading):
2827         (WebCore::WebCoreAVFResourceLoader::stopLoading):
2828         * rendering/RenderImageResource.cpp:
2829         (WebCore::RenderImageResource::shutdown):
2830         (WebCore::RenderImageResource::setCachedImage):
2831         * rendering/RenderLayerFilterInfo.cpp:
2832         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
2833         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
2834         * rendering/style/StyleCachedImage.cpp:
2835         (WebCore::StyleCachedImage::addClient):
2836         (WebCore::StyleCachedImage::removeClient):
2837         * svg/SVGFEImageElement.cpp:
2838         (WebCore::SVGFEImageElement::clearResourceReferences):
2839         (WebCore::SVGFEImageElement::requestImageResource):
2840         * svg/SVGFontFaceUriElement.cpp:
2841         (WebCore::SVGFontFaceUriElement::~SVGFontFaceUriElement):
2842         (WebCore::SVGFontFaceUriElement::loadFont):
2843         * svg/SVGUseElement.cpp:
2844         (WebCore::SVGUseElement::~SVGUseElement):
2845         (WebCore::SVGUseElement::updateExternalDocument):
2846         * xml/XSLImportRule.cpp:
2847         (WebCore::XSLImportRule::~XSLImportRule):
2848         (WebCore::XSLImportRule::setXSLStyleSheet):
2849         (WebCore::XSLImportRule::loadSheet):
2850         * xml/parser/XMLDocumentParser.cpp:
2851         (WebCore::XMLDocumentParser::notifyFinished):
2852         * xml/parser/XMLDocumentParserLibxml2.cpp:
2853         (WebCore::XMLDocumentParser::~XMLDocumentParser):
2854         (WebCore::XMLDocumentParser::endElementNs):
2855
2856 2016-10-05  Philippe Normand  <pnormand@igalia.com>
2857
2858         [GStreamer][OWR] GL rendering support
2859         https://bugs.webkit.org/show_bug.cgi?id=162972
2860
2861         Reviewed by Žan Doberšek.
2862
2863         When GStreamer-GL is enabled the GL context needs to be properly passed
2864         to the GStreamer pipeline running within the OpenWebRTC video renderer.
2865         This is now supported using a new OpenWebRTC API that allows the
2866         renderer to request the context from the application using a callback
2867         registered within the renderer.
2868
2869         The player's GL context/display set-up was refactored to a new
2870         method, requestGLContext, which is used as callback for the
2871         OpenWebRTC request_context handler.
2872
2873         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2874         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
2875         (WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext):
2876         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2877         (WebCore::MediaPlayerPrivateGStreamerBase::gstGLContext):
2878         (WebCore::MediaPlayerPrivateGStreamerBase::gstGLDisplay):
2879         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
2880         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink):
2881
2882 2016-10-06  Antoine Quint  <graouts@apple.com>
2883
2884         [Modern Media Controls] Icon service and the IconButton class
2885         https://bugs.webkit.org/show_bug.cgi?id=162970
2886         <rdar://problem/28631803>
2887
2888         Reviewed by Dean Jackson.
2889
2890         We introduce the new IconButton class to display buttons that show an icon
2891         in modern media controls. An IconButton uses a CSS mask-image to display the icon
2892         such that we may set the actual button color to any value by setting the element's
2893         background-color property.
2894
2895         Icons are obtained through the `iconService` singleton which knows how to load the
2896         right icon for the current layout traits and resolution. Icons loaded through the
2897         icon service are cached. In a later patch, we will be introducing functionality,
2898         through the MediaControlsHost, to load the icon from the WebCore bundle.
2899
2900         Tests: media/modern-media-controls/icon-button/icon-button-active-state.html
2901                media/modern-media-controls/icon-button/icon-button.html
2902                media/modern-media-controls/icon-service/icon-service.html
2903
2904         * Modules/modern-media-controls/controls/button.css:
2905         (button):
2906         * Modules/modern-media-controls/controls/icon-button.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/button.css.
2907         (button.icon):
2908         (button.icon:active):
2909         * Modules/modern-media-controls/controls/icon-button.js: Added.
2910         (IconButton):
2911         (IconButton.prototype.get iconName):
2912         (IconButton.prototype.set iconName):
2913         (IconButton.prototype.handleEvent):
2914         (IconButton.prototype.layout):
2915         (IconButton.prototype._imageDidLoad):
2916         (IconButton.prototype._updateImage):
2917         * Modules/modern-media-controls/controls/icon-service.js: Copied from Source/WebCore/Modules/modern-media-controls/controls/layout-item.js.
2918         (const.iconService.new.IconService):
2919         (const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits):
2920         (const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
2921         * Modules/modern-media-controls/controls/layout-item.js:
2922         * Modules/modern-media-controls/images/iOS/pause@2x.png: Added.
2923         * Modules/modern-media-controls/images/iOS/pause@3x.png: Added.
2924         * Modules/modern-media-controls/images/iOS/start@2x.png: Added.
2925         * Modules/modern-media-controls/images/iOS/start@3x.png: Added.
2926         * Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png: Added.
2927         * Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png: Added.
2928         * Modules/modern-media-controls/images/macOS/pause@1x.png: Added.
2929         * Modules/modern-media-controls/images/macOS/pause@2x.png: Added.
2930         * Modules/modern-media-controls/images/macOS/start@1x.png: Added.
2931         * Modules/modern-media-controls/images/macOS/start@2x.png: Added.
2932
2933 2016-10-06  Miguel Gomez  <magomez@igalia.com>
2934
2935         [GTK] Fix build with GSTREAMER_GL enabled and ACCELERATED_2D_CANVAS disabled
2936         https://bugs.webkit.org/show_bug.cgi?id=163008
2937
2938         Reviewed by Carlos Garcia Campos.
2939
2940         Put functions using cairo-gl behind appropriate guards.
2941
2942         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2943         (WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface): Deleted.
2944         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2945
2946 2016-10-06  Miguel Gomez  <magomez@igalia.com>
2947
2948         [GTK] Copying video textures to webgl should not depend on cairo-gl
2949         https://bugs.webkit.org/show_bug.cgi?id=162904
2950
2951         Reviewed by Žan Doberšek.
2952
2953         Perform the texture copy without using cairo-gl.
2954
2955         Covered by existent tests.
2956
2957         * platform/GStreamer.cmake:
2958         Add the new VideoTextureCopierGStreamer class to the build.
2959         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2960         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
2961         Use VideoTextureCopierGStreamer to perform the copy.
2962         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2963         Add a VideoTextureCopierGStreamer as a class attribute.
2964         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp: Added.
2965         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
2966         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
2967         (WebCore::VideoTextureCopierGStreamer::updateTextureSpaceMatrix):
2968         Recalculates the matrix used as the texture coordinates transformation.
2969         (WebCore::VideoTextureCopierGStreamer::updateTransformationMatrix):
2970         Recalculates the matrices used as the vertices coordinates transformation.
2971         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
2972         Performs the texture copy by using a shader that applies the rotation needed to follow
2973         the video orientation.
2974         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: Added.
2975
2976 2016-10-06  Gwang Yoon Hwang  <yoon@igalia.com>
2977
2978         [GTK] Build fix for X11 and GStreamerGL after r183731
2979         https://bugs.webkit.org/show_bug.cgi?id=163000
2980
2981         Reviewed by Philippe Normand.
2982
2983         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2984         Include gstgldisplay_egl.h if platform uses EGL.
2985
2986 2016-10-06  Mario Sanchez Prada  <mario@endlessm.com>
2987
2988         [GStreamer] Can't play any video with GSTREAMER_GL enabled
2989         https://bugs.webkit.org/show_bug.cgi?id=162669
2990
2991         Reviewed by Philippe Normand.
2992
2993         Make sure an EGLDisplay type is passed when creating the GstGlDisplay
2994         for the EGL code path, instead of a native X11 display type, so
2995         that we get a valid GstGlDisplay as a result, not a dummy one.
2996
2997         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2998         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2999
3000 2016-10-06  Youenn Fablet  <youenn@apple.com>
3001
3002         [Fetch API] Forbid redirection to non-HTTP(s) URL in non-navigation mode.
3003         https://bugs.webkit.org/show_bug.cgi?id=162785
3004
3005         Reviewed by Alex Christensen.
3006
3007         Covered by rebased and existing tests.
3008
3009         Ensuring non-HTTP redirection URLs are not followed at DocumentThreadableLoader level for fetch API only.
3010         This should be applied to all clients at some point, but there is still some uncertainty for data URLs.
3011
3012         Did some refactoring to better separate the case of security checks in case of regular request or redirected request.
3013         This allows in particular to handle more clearly the case of data URLs which are allowed in all modes for regular requests.
3014         But they are not allowed for same-origin redirected requests.
3015
3016         * WebCore.xcodeproj/project.pbxproj:
3017         * loader/DocumentThreadableLoader.cpp:
3018         (WebCore::reportRedirectionWithBadScheme): Reporting bad scheme redirection error.
3019         (WebCore::DocumentThreadableLoader::redirectReceived): Checking that redirection URLs are HTTP(s) in case of Fetch API.
3020         * loader/SubresourceLoader.cpp:
3021         (WebCore::SubresourceLoader::willSendRequestInternal):
3022         * loader/cache/CachedResourceLoader.cpp:
3023         (WebCore::CachedResourceLoader::requestImage):
3024         (WebCore::CachedResourceLoader::checkInsecureContent):
3025         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
3026         (WebCore::isSameOriginDataURL):
3027         (WebCore::CachedResourceLoader::canRequest):
3028         (WebCore::CachedResourceLoader::canRequestAfterRedirection):
3029         (WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
3030         (WebCore::CachedResourceLoader::requestResource):
3031         * loader/cache/CachedResourceLoader.h:
3032
3033 2016-10-06  Youenn Fablet  <youenn@apple.com>
3034
3035         [Fetch API] Use ReadableStream pull to transfer binary data to stream when application needs it
3036         https://bugs.webkit.org/show_bug.cgi?id=162892
3037
3038         Reviewed by Alex Christensen.
3039
3040         Covered by existing tests.
3041
3042         Before this patch, FetchResponse was never resolving the start promise.
3043         This way, it could enqueue data, error or close the stream whenever desired.
3044
3045         With this patch, FetchResponse will feed the stream when being asked to.
3046         This allows keeping the data in WebCore until the application needs it.
3047         This is only implemented for network data.
3048         For other data owned by response (blob, text...), data will be enqueued like previously as fast as possible.
3049
3050         Note that FetchResponse can enqueue/error/close the stream at any time since JSFetchResponse has a reference to the stream.
3051         And the stream has a reference to the controller.
3052
3053         In addition to transfer binary chunks to ReadableStream only when needed, WebCore is now aware of the data
3054         stored in the response, which may allow applying backpressure to the network source in the future.
3055
3056         * Modules/fetch/FetchResponse.cpp:
3057         (WebCore::FetchResponse::BodyLoader::didSucceed):
3058         (WebCore::FetchResponse::BodyLoader::didReceiveData): Enqueuing only if stream is pulling.
3059         Otherwise, storing in FetchBodyConsumer. If stream is pulling, we enqueue both buffered data and received chunk.
3060         (WebCore::FetchResponse::consumeBodyAsStream): Resolving pull promise if we enqueued some buffered data.
3061         (WebCore::FetchResponse::closeStream):
3062         (WebCore::FetchResponse::feedStream): If we have some buffered data, we enqueue it. If there is no loader, the stream can be closed.
3063         * Modules/fetch/FetchResponse.h:
3064         * Modules/fetch/FetchResponseSource.cpp:
3065         (WebCore::FetchResponseSource::doPull):
3066         (WebCore::FetchResponseSource::close):
3067         (WebCore::FetchResponseSource::error):
3068         * Modules/fetch/FetchResponseSource.h:
3069         * Modules/streams/ReadableStreamSource.h:
3070         (WebCore::ReadableStreamSource::isPulling): Renamed from isStarting.
3071         (WebCore::ReadableStreamSource::isStarting): Deleted.
3072
3073 2016-10-06  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3074
3075         WebRTC: Add support for the icecandidate event in MediaEndpointPeerConnection
3076         https://bugs.webkit.org/show_bug.cgi?id=162957
3077
3078         Reviewed by Eric Carlson.
3079
3080         Implement MediaEndpointPeerConnection's gotIceCandidate and doneGatheringCandidates
3081         callbacks. These are used by the MediaEndpoint (WebRTC backend implementation) to
3082         notify about ICE events.
3083
3084         Add API to Internals to emulate WebRTC platform events, such as dispatching a set of ICE
3085         candidates followed by a gathering done indication. Initially, only a single action,
3086         "dispatch-fake-ice-candidates", is supported, but the intention is to extend the set of
3087         actions to support more test cases.
3088
3089         Test: fast/mediastream/RTCPeerConnection-icecandidate-event.html
3090
3091         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3092         (WebCore::MediaEndpointPeerConnection::emulatePlatformEvent):
3093         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
3094         (WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
3095         * Modules/mediastream/MediaEndpointPeerConnection.h:
3096         * Modules/mediastream/PeerConnectionBackend.h:
3097         * Modules/mediastream/RTCIceTransport.h: Added.
3098         RTCIceCandidate will eventually be part of the JS API, but right now it's
3099         only used to keep track of the ICE states related to a RTCRtpTranscevier.
3100         (WebCore::RTCIceTransport::create):
3101         (WebCore::RTCIceTransport::~RTCIceTransport):
3102         (WebCore::RTCIceTransport::transportState):
3103         (WebCore::RTCIceTransport::setTransportState):
3104         (WebCore::RTCIceTransport::gatheringState):
3105         (WebCore::RTCIceTransport::setGatheringState):
3106         (WebCore::RTCIceTransport::RTCIceTransport):
3107         * Modules/mediastream/RTCPeerConnection.cpp:
3108         (WebCore::RTCPeerConnection::emulatePlatformEvent):
3109         * Modules/mediastream/RTCPeerConnection.h:
3110         * Modules/mediastream/RTCRtpTransceiver.cpp:
3111         (WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
3112         * Modules/mediastream/RTCRtpTransceiver.h:
3113         (WebCore::RTCRtpTransceiver::iceTransport):
3114         * WebCore.xcodeproj/project.pbxproj:
3115         * platform/mediastream/MediaEndpoint.h:
3116         (WebCore::MediaEndpoint::emulatePlatformEvent):
3117         * platform/mediastream/PeerConnectionStates.h:
3118         * platform/mock/MockMediaEndpoint.cpp:
3119         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
3120         (WebCore::MockMediaEndpoint::updateReceiveConfiguration):
3121         (WebCore::MockMediaEndpoint::emulatePlatformEvent):
3122         (WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
3123         (WebCore::MockMediaEndpoint::iceCandidateTimerFired):
3124         * platform/mock/MockMediaEndpoint.h:
3125         * testing/Internals.cpp:
3126         (WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
3127         Generic API to signal down to the WebRTC platform mock.
3128         * testing/Internals.h:
3129         * testing/Internals.idl:
3130
3131 2016-10-06  Nan Wang  <n_wang@apple.com>
3132
3133         AX:[Mac] Unable to edit text input, textarea fields in iframe using VO naivgation
3134         https://bugs.webkit.org/show_bug.cgi?id=162999
3135
3136         Reviewed by Chris Fleizach.
3137
3138         In WebKit1, the top web area setting the selection to an input element inside an iframe
3139         will make the input field not editable. The issue is that when the web area and the input element
3140         have different documents, the setSelection function in FrameSelection will set the selection on
3141         the input's frame and cause the caret to disappear. I fixed it by not setting the selection in such case.
3142
3143         Test: accessibility/mac/wk1-set-selected-text-marker-range-input-element.html
3144
3145         * accessibility/AccessibilityRenderObject.cpp:
3146         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
3147
3148 2016-10-05  Commit Queue  <commit-queue@webkit.org>
3149
3150         Unreviewed, rolling out r206845.
3151         https://bugs.webkit.org/show_bug.cgi?id=162998
3152
3153         broke el capitan build (Requested by alexchristensen on
3154         #webkit).
3155
3156         Reverted changeset:
3157
3158         "Add Display P3 ColorSpace"
3159         https://bugs.webkit.org/show_bug.cgi?id=162880
3160         http://trac.webkit.org/changeset/206845
3161
3162 2016-10-05  Youenn Fablet  <youenn@apple.com>
3163
3164         Reuse CodeGenerator::UpdateFile in Tools CodeGenerator
3165         https://bugs.webkit.org/show_bug.cgi?id=162960
3166
3167         Reviewed by Alex Christensen.
3168
3169         No change of behavior.
3170
3171         * bindings/scripts/CodeGenerator.pm:
3172         (UpdateFile): Adding FIXME to enable lazy writing when feasible.
3173
3174 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
3175
3176         [SOUP] HostTLSCertificateSet should not use SHA-1 hashes to compare certificates
3177         https://bugs.webkit.org/show_bug.cgi?id=162965
3178
3179         Reviewed by Carlos Garcia Campos.
3180
3181         Use SHA-256 instead.
3182
3183         No new tests, covered by TestSSL.
3184
3185         * platform/network/soup/SoupNetworkSession.cpp:
3186         (WebCore::HostTLSCertificateSet::computeCertificateHash):
3187
3188 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
3189
3190         [GTK] Bump Chrome version in Chrome user agent quirk
3191         https://bugs.webkit.org/show_bug.cgi?id=162984
3192
3193         Reviewed by Carlos Garcia Campos.
3194
3195         * platform/gtk/UserAgentGtk.cpp:
3196         (WebCore::buildUserAgentString):
3197
3198 2016-10-05  Dean Jackson  <dino@apple.com>
3199
3200         Add Display P3 ColorSpace
3201         https://bugs.webkit.org/show_bug.cgi?id=162880
3202         <rdar://problem/28598564>
3203
3204         Reviewed by Sam Weinig.
3205
3206         Add a new ColorSpace for Display P3.
3207
3208         This will be tested once the Color class can create
3209         objects that reference other color spaces.
3210
3211         * platform/graphics/ColorSpace.h:
3212         * platform/graphics/cg/GraphicsContextCG.cpp:
3213         (WebCore::displayP3ColorSpaceRef):
3214         * platform/graphics/cg/GraphicsContextCG.h:
3215         (WebCore::cachedCGColorSpace):
3216
3217 2016-10-05  Wenson Hsieh  <wenson_hsieh@apple.com>
3218
3219         Introduce InputEvent bindings in preparation for the input events spec
3220         https://bugs.webkit.org/show_bug.cgi?id=162954
3221
3222         Reviewed by Ryosuke Niwa.
3223
3224         Creates new bindings for InputEvent. Also introduces a runtime switch that allows Node to dispatch InputEvents
3225         rather than generic events of type 'input'. Adds a new test verifying that when the switch is enabled, inputs
3226         and contenteditable divs fire these new InputEvents on input. So far, only inputType is a part of the object
3227         prototype, since we will be implementing this first. getTargetRanges() will follow once the finer details of
3228         StaticRange are hashed out. See https://bugs.webkit.org/show_bug.cgi?id=162947 for more details.
3229
3230         Tests: fast/events/input-events-fired-when-typing.html
3231                fast/events/ios/input-events-fired-when-typing-in-contenteditable.html
3232
3233         * CMakeLists.txt:
3234         * DerivedSources.cpp:
3235         * DerivedSources.make:
3236         * WebCore.xcodeproj/project.pbxproj:
3237         * dom/DOMAllInOne.cpp:
3238         * dom/Event.cpp:
3239         (WebCore::Event::composed):
3240         (WebCore::Event::isInputEvent):
3241         * dom/Event.h:
3242         * dom/EventNames.in:
3243         * dom/InputEvent.cpp: Added.
3244         (WebCore::InputEvent::InputEvent):
3245         * dom/InputEvent.h: Added.
3246         * dom/InputEvent.idl: Added.
3247         * dom/Node.cpp:
3248         (WebCore::Node::dispatchInputEvent):
3249         (WebCore::Node::defaultEventHandler):
3250         * dom/Node.h:
3251         * editing/Editor.cpp:
3252         (WebCore::Editor::setBaseWritingDirection):
3253         * html/HTMLFormControlElement.cpp:
3254         (WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
3255         * html/HTMLInputElement.cpp:
3256         (WebCore::HTMLInputElement::setEditingValue):
3257         (WebCore::HTMLInputElement::setValueFromRenderer):
3258         * html/HTMLSelectElement.cpp:
3259         (WebCore::HTMLSelectElement::listBoxOnChange):
3260         (WebCore::HTMLSelectElement::dispatchChangeEventForMenuList):
3261         * html/shadow/MediaControlElements.cpp:
3262         (WebCore::MediaControlTimelineElement::defaultEventHandler):
3263         * page/Settings.in:
3264         * testing/InternalSettings.cpp:
3265         (WebCore::InternalSettings::Backup::Backup):
3266         (WebCore::InternalSettings::Backup::restoreTo):
3267         * testing/InternalSettings.h:
3268         * testing/InternalSettings.idl:
3269
3270 2016-10-05  Alex Christensen  <achristensen@webkit.org>
3271
3272         URLParser should parse IPv4 addresses as the last two pieces of an IPv6 address
3273         https://bugs.webkit.org/show_bug.cgi?id=162991
3274
3275         Reviewed by Saam Barati.
3276
3277         The last 32 bits of an IPv6 address can be written in the form of an IPv4 address,
3278         but the syntax is stricter than if it were just an IPv4 address.  There must be 4 pieces,
3279         and each piece must be decimal (no octal or hex allowed).  These should serialize to
3280         regular hex IPv6 addresses.
3281
3282         Covered by new API tests.
3283
3284         * platform/URLParser.cpp:
3285         (WebCore::URLParser::parseIPv4Piece):
3286         (WebCore::URLParser::parseIPv4Host):
3287         (WebCore::URLParser::parseIPv4PieceInsideIPv6):
3288         (WebCore::URLParser::parseIPv4AddressInsideIPv6):
3289         (WebCore::URLParser::parseIPv6Host):
3290         (WebCore::URLParser::parseIPv4Number): Deleted.
3291         * platform/URLParser.h:
3292
3293 2016-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
3294
3295         Put variation fonts work behind a compile-time flag
3296         https://bugs.webkit.org/show_bug.cgi?id=162949
3297
3298         Reviewed by Simon Fraser.
3299
3300         No new tests because there is no behavior change.
3301
3302         * Configurations/FeatureDefines.xcconfig:
3303         * css/CSSComputedStyleDeclaration.cpp:
3304         (WebCore::ComputedStyleExtractor::propertyValue):
3305         * css/CSSFontVariationValue.cpp:
3306         * css/CSSFontVariationValue.h:
3307         * css/CSSPropertyNames.in:
3308         * css/CSSValue.cpp:
3309         (WebCore::CSSValue::equals):
3310         (WebCore::CSSValue::cssText):
3311         (WebCore::CSSValue::destroy):
3312         * css/CSSValue.h:
3313         (WebCore::CSSValue::isFontFeatureValue): Deleted.
3314         (WebCore::CSSValue::isFontVariationValue): Deleted.
3315         * css/StyleBuilderConverter.h:
3316         (WebCore::StyleBuilderConverter::convertFontVariationSettings): Deleted.
3317         * css/StyleBuilderCustom.h:
3318         (WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings): Deleted.
3319         (WebCore::StyleBuilderCustom::applyInheritFontVariationSettings): Deleted.
3320         * css/parser/CSSParser.cpp:
3321         (WebCore::CSSParserContext::CSSParserContext):
3322         (WebCore::operator==):
3323         (WebCore::CSSParser::parseValue):
3324         (WebCore::CSSParser::parseFontVariationSettings): Deleted.
3325         * css/parser/CSSParserMode.h:
3326         * page/Settings.in:
3327         * page/animation/CSSPropertyAnimation.cpp:
3328         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
3329         (WebCore::blendFunc): Deleted.
3330         * platform/graphics/FontCache.h:
3331         (WebCore::FontDescriptionKey::FontDescriptionKey):
3332         (WebCore::FontDescriptionKey::operator==):
3333         (WebCore::FontDescriptionKey::computeHash):
3334         * platform/graphics/FontDescription.cpp:
3335         * platform/graphics/FontDescription.h:
3336         (WebCore::FontDescription::operator==):
3337         (WebCore::FontDescription::setFeatureSettings): Deleted.
3338         (WebCore::FontDescription::setVariationSettings): Deleted.
3339         * platform/graphics/FontTaggedSettings.cpp:
3340         (WebCore::operator<<): Deleted.
3341         * platform/graphics/FontTaggedSettings.h:
3342         (WebCore::FontVariationSettings::isEmpty):
3343         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3344         (WebCore::preparePlatformFont):
3345         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3346         (WebCore::cascadeToLastResortAndVariationsFontDescriptor):
3347         * rendering/style/RenderStyle.cpp:
3348         (WebCore::RenderStyle::setFontVariationSettings): Deleted.
3349         * rendering/style/RenderStyle.h:
3350         (WebCore::RenderStyle::fontVariationSettings): Deleted.
3351         * testing/InternalSettings.cpp:
3352         (WebCore::InternalSettings::Backup::Backup):
3353         (WebCore::InternalSettings::Backup::restoreTo):
3354         (WebCore::InternalSettings::variationFontsEnabled):
3355         (WebCore::InternalSettings::setVariationFontsEnabled):
3356         * testing/InternalSettings.h:
3357
3358 2016-10-05  Brent Fulgham  <bfulgham@apple.com>
3359
3360         Unreviewed build fix after r206830
3361
3362         * platform/graphics/win/FontPlatformDataWin.cpp: Add missing include
3363         when building with Direct2D.
3364
3365 2016-10-05  Brent Fulgham  <bfulgham@apple.com>
3366
3367         [Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when building for D2D
3368         https://bugs.webkit.org/show_bug.cgi?id=162977
3369
3370         Reviewed by Alex Christensen.
3371
3372         Currently the Direct2D implementation does not support some of the accelerated compositing
3373         features that require CoreAnimation. During this bring-up, we want to disable these routines
3374         so that we can build and run in (mostly) unaccelerated drawing.
3375
3376         This patch mostly consists of adding "#if USE(CG)" and "#if USE(CA)" to files that are
3377         specific to those implementations.
3378
3379         This change should have no impact on non-Direct2D ports.
3380
3381         No change in behavior for active ports.
3382
3383         * config.h: Turn of CG when building in Direct2D.
3384         * css/CSSFontFaceSource.cpp:
3385         * loader/cache/CachedFont.cpp:
3386         * loader/cache/CachedSVGFont.cpp:
3387         * page/CaptionUserPreferencesMediaAF.cpp:
3388         * page/win/FrameCGWin.cpp:
3389         * page/win/FrameDirect2D.cpp: Added.
3390         * platform/graphics/Font.cpp:
3391         * platform/graphics/FontCache.cpp:
3392         * platform/graphics/FontPlatformData.cpp:
3393         * platform/graphics/GraphicsContext.h:
3394         * platform/graphics/Image.cpp:
3395         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
3396         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3397         * platform/graphics/ca/GraphicsLayerCA.cpp:
3398         * platform/graphics/ca/PlatformCALayer.cpp:
3399         * platform/graphics/ca/TileController.cpp:
3400         * platform/graphics/ca/TileGrid.cpp:
3401         * platform/graphics/ca/TileGrid.h:
3402         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
3403         * platform/graphics/ca/win/LayerChangesFlusher.cpp:
3404         * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
3405         * platform/graphics/ca/win/PlatformCAAnimationWin.h:
3406         * platform/graphics/ca/win/PlatformCAFiltersWin.cpp:
3407         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3408         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
3409         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
3410         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
3411         * platform/graphics/cg/GradientCG.cpp:
3412