34a12f8b007863ca21af061bb23e803cb0258593
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-04-18  Manuel Rego Casasnovas  <rego@igalia.com>
2
3         [css-grid] Fix positioned items with content alignment
4         https://bugs.webkit.org/show_bug.cgi?id=156597
5
6         Reviewed by Darin Adler.
7
8         Like for the case of gaps we need to take into account
9         the content alignment in order to properly place and size
10         the positioned items.
11
12         Regarding content alignment we need to care about 2 values:
13         the position offset and the distribution offset.
14         The position offset can be extracted from m_column|rowPositions,
15         but the distribution offset is stored in 2 new variables called
16         m_offsetBetweenColumns|Rows.
17
18         Tests: fast/css-grid-layout/grid-positioned-items-content-alignment.html
19                fast/css-grid-layout/grid-positioned-items-content-alignment-rtl.html
20
21         * rendering/RenderGrid.cpp:
22         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
23         (WebCore::RenderGrid::populateGridPositions):
24         (WebCore::RenderGrid::columnAxisOffsetForChild):
25         (WebCore::RenderGrid::rowAxisOffsetForChild):
26         (WebCore::RenderGrid::rowAxisPositionForChild): Deleted.
27         * rendering/RenderGrid.h:
28
29 2016-04-18  Manuel Rego Casasnovas  <rego@igalia.com>
30
31         [css-grid] Add method to translate RTL coordinates
32         https://bugs.webkit.org/show_bug.cgi?id=156589
33
34         Reviewed by Antonio Gomes.
35
36         This is just a small refactoring adding a new function
37         LayoutGrid::translateRTLCoordinate().
38         This method translates to physical coordinates the information
39         stored in m_columnPositions when you're using RTL direction.
40
41         No new tests, no change of behavior.
42
43         * rendering/RenderGrid.cpp:
44         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): Use the new
45         method translateRTLCoordinate().
46         (WebCore::RenderGrid::translateRTLCoordinate): New method that converts
47         a coordinate from m_columnPositions in RTL into a physical coordinate.
48         (WebCore::RenderGrid::findChildLogicalPosition): Use the new method
49         translateRTLCoordinate().
50         * rendering/RenderGrid.h: Add method signature.
51
52 2016-04-18  Yusuke Suzuki  <utatane.tea@gmail.com>
53
54         [Fetch] Use @isArray instead of `instanceof @Array`
55         https://bugs.webkit.org/show_bug.cgi?id=156682
56
57         Reviewed by Alex Christensen.
58
59         Currently, we query whether the given value is Array by using `instanceof @Array`.
60         But it is not enough; Array from the other realm should be accepted. And Array
61         not inheriting @Array should be also accepted.
62
63         Test: fetch/header-constructor-is-array.html
64
65         * Modules/fetch/FetchHeaders.js:
66         (initializeFetchHeaders):
67
68 2016-04-17  Yoav Weiss  <yoav@yoav.ws>
69
70         Initial Link preload support
71         https://bugs.webkit.org/show_bug.cgi?id=156334
72
73         Added basic `<link rel=preload>` functionality that enables preloading
74         of resources according to their type.
75
76         Reviewed by Darin Adler.
77
78         Tests: http/tests/preload/download_resources.html
79                http/tests/preload/dynamic_adding_preload.html
80                http/tests/preload/dynamic_remove_preload_href.html
81                http/tests/preload/dynamic_removing_preload.html
82
83         * bindings/generic/RuntimeEnabledFeatures.cpp: Added a runtime flag for the feature.
84         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
85         * bindings/generic/RuntimeEnabledFeatures.h: Added a runtime flag for the feature.
86         (WebCore::RuntimeEnabledFeatures::setLinkPreloadEnabled):
87         (WebCore::RuntimeEnabledFeatures::linkPreloadEnabled):
88         * html/HTMLAttributeNames.in: Added an `as` attribute.
89         * html/HTMLLinkElement.cpp:
90         (WebCore::HTMLLinkElement::process): Added `as` and `crossorigin` attribute values to the loadLink() call.
91         (WebCore::HTMLLinkElement::setCrossOrigin): Setter for crossOrigin.
92         (WebCore::HTMLLinkElement::crossOrigin): Getter for crossOrigin.
93         * html/HTMLLinkElement.idl: Added `as` and `crossorigin` to HTMLLinkElement.
94         * html/HTMLLinkElement.h: Added getter and setter for crossorigin.
95         * html/LinkRelAttribute.cpp:
96         (WebCore::LinkRelAttribute::LinkRelAttribute): Added "preload" as a potential value.
97         * html/LinkRelAttribute.h: Added isLinkPreload.
98         * loader/LinkLoader.cpp:
99         (WebCore::LinkLoader::resourceTypeFromAsAttribute): Translates an `as` value into a resource type.
100         (WebCore::preloadIfNeeded): Triggers a resource preload when link element is a preload one.
101         (WebCore::LinkLoader::loadLink): Added a call to preloadIfNeeded.
102         * loader/LinkLoader.h: Added signatures.
103         * loader/ResourceLoadInfo.cpp:
104         (WebCore::toResourceType): Added LinkPreload as a possible CachedResource::type.
105         * loader/SubresourceLoader.cpp:
106         (WebCore::logResourceLoaded): Added LinkPreload as a possible CachedResource::type.
107         * loader/cache/CachedResource.cpp: Turned defaultPriorityForResourceType into a static member, as it's now also called from LinkLoader.
108         (WebCore::CachedResource::defaultPriorityForResourceType): Added LinkPreload as a possible CachedResource::type, giving it low priority.
109         (WebCore::defaultPriorityForResourceType): Deleted.
110         * loader/cache/CachedResource.h: Added LinkPreload as a possible CachedResource::type. Added defaultPriorityForResourceType as static.
111         * loader/cache/CachedResourceLoader.cpp:
112         (WebCore::contentTypeFromResourceType): Added LinkPreload as a possible CachedResource::type.
113         (WebCore::createResource): Added creation of a LinkPreload resource if needed.
114         (WebCore::CachedResourceLoader::checkInsecureContent): Added LinkPreload as a possible CachedResource::type.
115         (WebCore::CachedResourceLoader::canRequest): Added LinkPreload as a possible CachedResource::type.
116         * testing/Internals.cpp: Added function to turn on the link preload feature.
117         (WebCore::setLinkPreloadSupport):
118         * testing/Internals.idl: Added function to turn on the link preload feature.
119         * testing/Internals.h: Added function signature to turn on the link preload feature.
120
121 2016-04-17  Conrad Shultz  <conrad_shultz@apple.com>
122
123         Try (again) to fix debug builds after r199643.
124
125         Unreviewed.
126
127         * dom/ScriptExecutionContext.cpp:
128         Add another missing include.
129
130 2016-04-17  Conrad Shultz  <conrad_shultz@apple.com>
131
132         Try to fix debug builds after r199643.
133
134         Unreviewed.
135
136         * Modules/indexeddb/IDBObjectStore.cpp:
137         Add a missing include.
138
139 2016-04-17  Chris Dumez  <cdumez@apple.com>
140
141         [WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess
142         https://bugs.webkit.org/show_bug.cgi?id=156639
143
144         Reviewed by Darin Adler.
145
146         Do not unnecessarily dlopen() QuickLook in the NetworkProcess on iOS, as
147         we already dlopen() this library in the WebContent process. This patch
148         moves the resource response MIME type adjusting code for QuickLook from
149         adjustMIMETypeIfNecessary() to a new adjustMIMETypeForQuickLook() function.
150         adjustMIMETypeIfNecessary() is called in didReceiveResponse() in the Network
151         process side, for *every* resource response, even though QuickLook can only
152         be used to preview main resources. The new adjustMIMETypeForQuickLook()
153         function is called in the QuickLookHandle::createIfNecessary() factory
154         function, right before checking the MIME type to determine if we need to
155         use QuickLook, and after checking that the load is for a main resource.
156         In the WebKit2 case, the factory function is called from
157         WebResourceLoader::didReceiveResponse(), on the WebContent process side.
158
159         This patch speeds up the first page load during PLT by ~22%, because the
160         first load no longer triggers a dlopen() to QuickLook in the NetworkProcess.
161         The overall PLT score seems to be progressed by 0.9-1% as well. The change
162         should also be memory-positive as we no longer need to dlopen() the
163         QuickLook library in the NetworkProcess at all (and we would already dlopen()
164         it on the WebContent process side anyway). Sadly, PLUM benchmark does not
165         show the memory benefit because it does not measure the memory used by the
166         Network process.
167
168         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
169         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
170         Refactor the code a bit for clarity, so that we only
171         ResourceHandle::setQuickLookHandle() when QuickLookHandle::createIfNecessary()
172         returns a non-null pointer.
173
174         * platform/network/ios/QuickLook.h:
175         - Rename the factories from create() to createIfNecessary() given that they
176           return nullptr when it is unnecessary to create such handle (i.e. this is not
177           a main resource loader, or it is unecessary given the response's MIME type.
178         - Make shouldCreateForMIMEType() private now that this is always called inside
179           the factory functions.
180
181         * platform/network/ios/QuickLook.mm:
182         (adjustMIMETypeForQuickLook):
183         Extracted code for adjusting the MIME type for QuickLook from the generic
184         adjustMIMETypeIfNecessary() in WebCoreURLResponseIOS.mm to its own function
185         here.
186
187         (WebCore::QuickLookHandle::createIfNecessary):
188         Call adjustMIMETypeForQuickLook() before checking the MIME type.
189
190         * platform/network/ios/WebCoreURLResponseIOS.mm:
191         (WebCore::adjustMIMETypeIfNecessary):
192         Extracted QuickLook-specific code to QuickLook.mm.
193
194         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
195         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
196         Refactor the code a bit for clarity, so that we only
197         ResourceHandle::setQuickLookHandle() when QuickLookHandle::createIfNecessary()
198         returns a non-null pointer.
199
200 2016-04-17  Brady Eidson  <beidson@apple.com>
201
202         Clean up IDBBindingUtilities.
203         https://bugs.webkit.org/show_bug.cgi?id=156472
204
205         Reviewed by Alex Christensen.
206
207         No new tests (No change in behavior).
208
209         - Get rid of a whole bunch of unused functions (since we got rid of Legacy IDB).
210         - Make more functions deal in ExecState/ScriptExecutionContexts instead of DOMRequestState.
211         - Make more functions deal in JSValue (as JSC::Strong<JSC::Unknown>) instead of Deprecated::ScriptValue.
212
213         * bindings/scripts/IDLAttributes.txt: Add a new attribute to signify that an implementation returns
214           JSValues instead of Deprecated::ScriptState
215         * bindings/scripts/CodeGeneratorJS.pm:
216         (NativeToJSValue): Use that new attribute.
217         
218         * Modules/indexeddb/IDBAny.cpp:
219         (WebCore::IDBAny::IDBAny):
220         (WebCore::IDBAny::scriptValue):
221         * Modules/indexeddb/IDBAny.h:
222         (WebCore::IDBAny::create):
223         
224         * Modules/indexeddb/IDBCursor.cpp:
225         (WebCore::IDBCursor::key):
226         (WebCore::IDBCursor::primaryKey):
227         (WebCore::IDBCursor::value):
228         (WebCore::IDBCursor::update):
229         (WebCore::IDBCursor::continueFunction):
230         (WebCore::IDBCursor::deleteFunction):
231         (WebCore::IDBCursor::setGetResult):
232         * Modules/indexeddb/IDBCursor.h:
233         * Modules/indexeddb/IDBCursor.idl:
234         * Modules/indexeddb/IDBCursorWithValue.idl:
235         
236         * Modules/indexeddb/IDBFactory.cpp:
237         (WebCore::IDBFactory::cmp):
238         
239         * Modules/indexeddb/IDBIndex.cpp:
240         (WebCore::IDBIndex::count):
241         (WebCore::IDBIndex::get):
242         (WebCore::IDBIndex::getKey):
243         
244         * Modules/indexeddb/IDBKeyRange.cpp:
245         (WebCore::IDBKeyRange::lowerValue):
246         (WebCore::IDBKeyRange::upperValue):
247         (WebCore::IDBKeyRange::only):
248         (WebCore::IDBKeyRange::lowerBound):
249         (WebCore::IDBKeyRange::upperBound):
250         (WebCore::IDBKeyRange::bound):
251         * Modules/indexeddb/IDBKeyRange.h:
252         * Modules/indexeddb/IDBKeyRange.idl:
253         
254         * Modules/indexeddb/IDBObjectStore.cpp:
255         (WebCore::IDBObjectStore::get):
256         (WebCore::IDBObjectStore::modernDelete):
257         (WebCore::IDBObjectStore::count):
258         
259         * Modules/indexeddb/IDBRequest.cpp:
260         (WebCore::IDBRequest::setResult):
261         (WebCore::IDBRequest::setResultToStructuredClone):
262         
263         * Modules/indexeddb/server/MemoryObjectStore.cpp:
264         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
265         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
266         
267         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
268         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
269         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
270         
271         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
272         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
273         
274         * bindings/js/IDBBindingUtilities.cpp:
275         (WebCore::idbKeyPathFromValue):
276         (WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath):
277         (WebCore::injectIDBKeyIntoScriptValue):
278         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
279         (WebCore::canInjectIDBKeyIntoScriptValue):
280         (WebCore::deserializeIDBValueToJSValue):
281         (WebCore::deserializeIDBValueDataToJSValue):
282         (WebCore::scriptValueToIDBKey):
283         (WebCore::idbKeyDataToScriptValue):
284         (WebCore::idbKeyDataToJSValue): Deleted.
285         (WebCore::createIDBKeyFromScriptValueAndKeyPath): Deleted.
286         (WebCore::deserializeIDBValue): Deleted.
287         (WebCore::deserializeIDBValueData): Deleted.
288         (WebCore::deserializeIDBValueBuffer): Deleted.
289         (WebCore::idbValueDataToJSValue): Deleted.
290         (WebCore::idbKeyToScriptValue): Deleted.
291         * bindings/js/IDBBindingUtilities.h:
292
293         * bindings/js/JSIDBAnyCustom.cpp:
294         (WebCore::toJS):
295
296         * bindings/js/JSIDBDatabaseCustom.cpp:
297         (WebCore::JSIDBDatabase::createObjectStore):
298
299         * bindings/js/JSIDBObjectStoreCustom.cpp:
300         (WebCore::JSIDBObjectStore::createIndex):
301
302         * dom/ScriptExecutionContext.cpp:
303         (WebCore::ScriptExecutionContext::execState):
304         * dom/ScriptExecutionContext.h:
305
306         * inspector/InspectorIndexedDBAgent.cpp:
307
308 2016-04-17  Darin Adler  <darin@apple.com>
309
310         Remove more uses of Deprecated::ScriptXXX
311         https://bugs.webkit.org/show_bug.cgi?id=156660
312
313         Reviewed by Antti Koivisto.
314
315         * Modules/mediacontrols/MediaControlsHost.h: Removed unneeded include.
316
317         * Modules/plugins/PluginReplacement.h: Removed unneeded include.
318         Changed argument to installReplacement into a reference. Changed return
319         value for creation function from PassRefPtr to Ref.
320
321         * Modules/plugins/QuickTimePluginReplacement.h: Removed unneeded includes and
322         forward declarations. Marked class final. Made almost everything private.
323
324         * Modules/plugins/QuickTimePluginReplacement.mm:
325         (WebCore::QuickTimePluginReplacement::create): Changed to return Ref.
326         (WebCore::QuickTimePluginReplacement::installReplacement): Changed to take
327         a reference.
328
329         * Modules/plugins/YouTubePluginReplacement.cpp:
330         (WebCore::YouTubePluginReplacement::create): Changed to return Ref.
331         (WebCore::YouTubePluginReplacement::installReplacement): Changed to take
332         a reference.
333
334         * Modules/plugins/YouTubePluginReplacement.h: Removed unneeded includes and
335         forward declarations. Marked class final. Changed return type of create.
336
337         * Modules/websockets/WebSocket.cpp:
338         (WebCore::WebSocket::didReceiveBinaryData): Removed local variable so the
339         MessageEvent::create function gets a Ref&& instead of a RefPtr without having
340         to add explicit WTFMove.
341
342         * bindings/js/DOMRequestState.h: Removed code that set m_exec twice.
343
344         * bindings/js/Dictionary.h: Reformatted function templates to use a single
345         line so they are easier to look at.
346         (WebCore::Dictionary::getEventListener): Rewrote this so it no longer uses
347         a Deprecated::ScriptValue and also make it a little more compact and terse.
348
349         * bindings/js/JSCommandLineAPIHostCustom.cpp:
350         (WebCore::JSCommandLineAPIHost::inspect): Rewrote to use JSValue instead of
351         Deprecated::ScriptValue. Considerably more efficient.
352
353         * bindings/js/JSMessageEventCustom.cpp:
354         (WebCore::JSMessageEvent::data): Streamlined to use Deprecated::ScriptValue
355         a little bit less.
356
357         * bindings/js/JSNodeCustom.cpp: Moved include here from header.
358         * bindings/js/JSNodeCustom.h: Moved include from here to cpp file.
359
360         * bindings/js/JSPopStateEventCustom.cpp:
361         (WebCore::JSPopStateEvent::state): Updated for changes to return value of the
362         state() and serializedState functions.
363
364         * bindings/js/ScriptState.h: Removed the ScriptState typedef.
365
366         * bindings/js/SerializedScriptValue.cpp: Moved include here from header.
367         * bindings/js/SerializedScriptValue.h: Moved include from here to cpp file.
368
369         * css/FontFace.cpp:
370         (WebCore::FontFace::create): Changed argument to JSValue instead of ScriptValue.
371         * css/FontFace.h: Ditto.
372
373         * dom/MessageEvent.cpp: Moved create functions in here from header file.
374         Removed some unused ones including one that took a Deprecated::ScriptValue.
375         * dom/MessageEvent.h: Streamlined create functions, removing unused functions,
376         unused arguments, and unused default values for arguments. Also moved them all
377         into the cpp file instead of inlining them. Also changed the return type of
378         dataAsScriptValue to JSValue.
379
380         * dom/NodeFilterCondition.h: Removed unneeded include. Tweaked formatting.
381
382         * dom/PopStateEvent.h: Changed return value of state to be a JSValue and of
383         serializedState to be a raw pointer, not a PassRefPtr.
384
385         * dom/Traversal.h: Removed unneeded include. Removed unnecessary use of
386         unsigned long instead of unsigned. Fixed indentation.
387
388         * html/HTMLPlugInElement.cpp:
389         (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot): Pass reference.
390
391         * inspector/InspectorDOMAgent.cpp:
392         (WebCore::InspectorDOMAgent::buildObjectForEventListener): Pass JSValue instead
393         of constructing a Deprecated::ScriptValue.
394
395         * inspector/InspectorFrontendHost.cpp:
396         (WebCore::FrontendMenuProvider::disconnect): Initialize without explicitly
397         mentioning the Deprecated::ScriptObject type.
398
399         * inspector/InspectorIndexedDBAgent.cpp: Removed unneeded include.
400
401         * inspector/InspectorInstrumentation.h: Removed unneeded include and also
402         declaration of two non-existent functions.
403
404         * page/DOMWindow.cpp:
405         (WebCore::PostMessageTimer::PostMessageTimer): Tweaked types a little bit to
406         match what is used in MessageEvent now.
407         (WebCore::PostMessageTimer::event): Streamlined a bit and changed type to
408         reference.
409         (WebCore::DOMWindow::postMessage): Updated for changes above.
410         (WebCore::DOMWindow::postMessageTimerFired): Ditto.
411
412         * page/EventSource.cpp:
413         (WebCore::EventSource::createMessageEvent): Removed now-unneeded
414         "false, false" from MessageEvent::create function call.
415
416         * page/csp/ContentSecurityPolicy.h: Removed unneeded include.
417
418         * page/csp/ContentSecurityPolicyDirectiveList.h: Removed unneeded
419         include and also unneeded non-copyable, since the class has a reference as
420         a data member and so is automatically non-copyable.
421
422         * testing/Internals.cpp:
423         (WebCore::Internals::description): Changed to take JSValue.
424         (WebCore::Internals::parserMetaData): Ditto.
425         (WebCore::Internals::serializeObject): Removed unnecessary copying of vector.
426         (WebCore::Internals::isFromCurrentWorld): Changed to take JSValue.
427         (WebCore::Internals::isReadableStreamDisturbed): Changed to not rely on the
428         ScriptState typedef and call it JSC::ExecState.
429
430         * testing/Internals.h: Removed unneeded includes. Removed unneeded and
431         inappropriate use of ASSERT_NO_EXCEPTION.
432
433 2016-04-17  Youenn Fablet  <youenn.fablet@crf.canon.fr>
434
435         [Fetch API] Consume HTTP data as a ReadableStream
436         https://bugs.webkit.org/show_bug.cgi?id=138968
437
438         Reviewed by Alex Christensen.
439
440         This patch introduces ReadableStreamSource and ReadableStreamController which allow feeding a ReadableStream from DOM classes.
441         ReadableStreamSource is a base class for all DOM ReadableStream sources.
442         ReadableStreamController is a wrapper around JSReadableStreamController that can be invoked by DOM code to enqueue/close/error a ReadableStream.
443         A createReadableStream function is introduced to allow DOM classes creating ReadableStream.
444
445         Added support for a FetchResponse ReadableStream source.
446         Both synthetic FetchResponse and loading FetchResponse are supported.
447         A new "Stream" FetchLoader::Type is introduced to allow receiving data as chunks and feeding them to a ReadableStream through ReadableStreamSource.
448
449         Currently, FetchResponse is consumed and marked as disturbed as soon as a ReadableStreamSource is created.
450         This should be changed so that consumption happens on the first read call to the ReadableStreamReader, i.e. when stream gets disturbed.
451
452         FetchResponseSource never fulfills the start promise, which allows to enqueue, error or close the stream at any time.
453         FetchResponseSource must therefore always ensure to close or error the stream.
454         Added support for locked check in FetchResponse.
455
456         Tests: imported/w3c/web-platform-tests/fetch/api/response/response-cancel-stream.html
457                imported/w3c/web-platform-tests/fetch/api/response/response-consume-stream.html
458                imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-1.html
459                imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-2.html
460                imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-3.html
461                imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-4.html
462                imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-5.html
463         Also covered by rebased tests.
464
465         * CMakeLists.txt:
466         * DerivedSources.make:
467         * Modules/fetch/FetchBody.cpp:
468         (WebCore::FetchBody::consumeAsStream): Fill stream with body data.
469         * Modules/fetch/FetchBody.h:
470         (WebCore::FetchBody::type): Added accessor to body type, used for assertions.
471         * Modules/fetch/FetchBodyOwner.cpp:
472         (WebCore::FetchBodyOwner::isDisturbed): Adding stream isLocked check.
473         (WebCore::FetchBodyOwner::blobLoadingSucceeded): Added assertion that body type is blob. Closing stream if created.
474         (WebCore::FetchBodyOwner::blobLoadingFailed): Erroring the stream if created and not cancelled.
475         (WebCore::FetchBodyOwner::blobChunk): Filling stream with chunk.
476         (WebCore::FetchBodyOwner::stop): Rmoved call to finishBlobLoading as it should be called as part of FetchLoaderCLient::didFail callbacki.
477         * Modules/fetch/FetchBodyOwner.h:
478         * Modules/fetch/FetchLoader.cpp: Fixing the case of cancel being called when creating the ThreadableLoader by introducing FetchLoader::m_isStarted.
479         (WebCore::FetchLoader::start): Setting m_isStarted at the end of the start method.
480         (WebCore::FetchLoader::stop): Fixing the case that FetchLoader can be destroyed when cancelling its loader.
481         (WebCore::FetchLoader::startStreaming): Introduced to switch the loading type from ArayBuffer to Stream. Already buffered data is returned.
482         (WebCore::FetchLoader::didReceiveData): Handling of the new Stream type.
483         (WebCore::FetchLoader::didFinishLoading):
484         * Modules/fetch/FetchLoader.h:
485         * Modules/fetch/FetchLoaderClient.h:
486         (WebCore::FetchLoaderClient::didReceiveData): Callback to get data as chunks if loader is of type Stream.
487         * Modules/fetch/FetchResponse.cpp:
488         (WebCore::FetchResponse::clone): Removed m_isLocked as it is handled within isDisturbed().
489         (WebCore::FetchResponse::isDisturbed): Checking whether related ReadableStream is locked.
490         (WebCore::FetchResponse::BodyLoader::didSucceed): Introduced to handle ReadableStream case.
491         (WebCore::FetchResponse::BodyLoader::didFail): Ditto.
492         (WebCore::FetchResponse::BodyLoader::didReceiveData): Ditto.
493         (WebCore::FetchResponse::BodyLoader::startStreaming): Ditto.
494         (WebCore::FetchResponse::consumeBodyAsStream): Start filling the ReadableStream with data. Changing loader to Stream if there is one.
495         (WebCore::FetchResponse::createReadableStreamSource): Called by custom binding to create the source.
496         (WebCore::FetchResponse::stop): Fixing potential crash in case of cancelling the ibody stream.
497         (WebCore::FetchResponse::startFetching):
498         (WebCore::FetchResponse::BodyLoader::didFinishLoadingAsArrayBuffer):
499         * Modules/fetch/FetchResponse.h:
500         * Modules/fetch/FetchResponse.idl:
501         * Modules/fetch/FetchResponseSource.cpp: Specialization of ReadableStreamSource for FetchResponse. It is a push source that never resolves the start promise.
502         (WebCore::FetchResponseSource::FetchResponseSource):
503         (WebCore::FetchResponseSource::isReadableStreamLocked):
504         (WebCore::FetchResponseSource::setActive):
505         (WebCore::FetchResponseSource::setInactive):
506         (WebCore::FetchResponseSource::doStart):
507         (WebCore::FetchResponseSource::doCancel):
508         (WebCore::FetchResponseSource::close):
509         (WebCore::FetchResponseSource::error):
510         * Modules/fetch/FetchResponseSource.h: Added.
511         * Modules/streams/ReadableStreamController.js:
512         (error):
513         * Modules/streams/ReadableStreamSource.h: Added (base class for ReadableStream DOM sources).
514         (WebCore::ReadableStreamSource::~ReadableStreamSource):
515         (WebCore::ReadableStreamSource::isStarting):
516         (WebCore::ReadableStreamSource::isPulling):
517         (WebCore::ReadableStreamSource::isCancelling):
518         (WebCore::ReadableStreamSource::controller):
519         (WebCore::ReadableStreamSource::doStart):
520         (WebCore::ReadableStreamSource::doCancel):
521         (WebCore::ReadableStreamSource::start):
522         (WebCore::ReadableStreamSource::cancel):
523         (WebCore::ReadableStreamSource::startFinished):
524         (WebCore::ReadableStreamSource::clean):
525         * Modules/streams/ReadableStreamSource.idl: Added.
526         * WebCore.xcodeproj/project.pbxproj:
527         * bindings/js/JSDOMGlobalObject.h:
528         * bindings/js/JSFetchResponseCustom.cpp: In case body is not created, call createReadableStreamSource.
529         (WebCore::JSFetchResponse::body):
530         * bindings/js/JSReadableStreamSourceCustom.cpp: Added.
531         (WebCore::JSReadableStreamSource::start):
532         (WebCore::JSReadableStreamSource::pull):
533         (WebCore::JSReadableStreamSource::controller):
534         * bindings/js/ReadableStreamController.cpp: Added.
535         (WebCore::callFunction):
536         (WebCore::ReadableStreamController::invoke):
537         (WebCore::ReadableStreamController::isControlledReadableStreamLocked):
538         (WebCore::createReadableStream):
539         * bindings/js/ReadableStreamController.h: The DOM wrapper for JSReadableStreamController.
540         (WebCore::ReadableStreamController::ReadableStreamController):
541         (WebCore::ReadableStreamController::close):
542         (WebCore::ReadableStreamController::error):
543         (WebCore::ReadableStreamController::enqueue):
544         (WebCore::ReadableStreamController::globalObject):
545         (WebCore::ReadableStreamController::enqueue<RefPtr<JSC::ArrayBuffer>>):
546         (WebCore::ReadableStreamController::error<String>):
547
548 2016-04-16  Antti Koivisto  <antti@apple.com>
549
550         Element should be const in StyleResolver
551         https://bugs.webkit.org/show_bug.cgi?id=156672
552
553         Reviewed by Darin Adler.
554
555         Resolving element style shouldn't mutate it.
556
557         This patch just does Element* -> const Element*, all the groundwork has been done already.
558
559         * css/StyleResolver.cpp:
560         (WebCore::StyleResolver::sweepMatchedPropertiesCache):
561         (WebCore::StyleResolver::State::State):
562         (WebCore::StyleResolver::State::setStyle):
563         (WebCore::isAtShadowBoundary):
564         (WebCore::StyleResolver::styleForElement):
565         (WebCore::doesNotInheritTextDecoration):
566         (WebCore::StyleResolver::adjustStyleForInterCharacterRuby):
567         (WebCore::StyleResolver::adjustRenderStyle):
568         (WebCore::StyleResolver::checkRegionStyle):
569         (WebCore::StyleResolver::updateFont):
570         (WebCore::StyleResolver::styleRulesForElement):
571         (WebCore::StyleResolver::pseudoStyleRulesForElement):
572         (WebCore::StyleResolver::applyMatchedProperties):
573         * css/StyleResolver.h:
574         (WebCore::StyleResolver::style):
575         (WebCore::StyleResolver::parentStyle):
576         (WebCore::StyleResolver::rootElementStyle):
577         (WebCore::StyleResolver::element):
578         (WebCore::StyleResolver::document):
579         (WebCore::StyleResolver::documentSettings):
580         (WebCore::StyleResolver::usesFirstLineRules):
581         (WebCore::StyleResolver::usesFirstLetterRules):
582         (WebCore::StyleResolver::State::State):
583         (WebCore::StyleResolver::State::document):
584         (WebCore::StyleResolver::State::element):
585         (WebCore::StyleResolver::State::style):
586         (WebCore::StyleResolver::hasSelectorForId):
587         (WebCore::checkRegionSelector):
588         * rendering/RenderTheme.cpp:
589         (WebCore::RenderTheme::RenderTheme):
590         (WebCore::RenderTheme::adjustStyle):
591         (WebCore::RenderTheme::adjustCheckboxStyle):
592         (WebCore::RenderTheme::adjustRadioStyle):
593         (WebCore::RenderTheme::adjustButtonStyle):
594         (WebCore::RenderTheme::adjustInnerSpinButtonStyle):
595         (WebCore::RenderTheme::adjustTextFieldStyle):
596         (WebCore::RenderTheme::adjustTextAreaStyle):
597         (WebCore::RenderTheme::adjustMenuListStyle):
598         (WebCore::RenderTheme::adjustMeterStyle):
599         (WebCore::RenderTheme::paintMeter):
600         (WebCore::RenderTheme::adjustCapsLockIndicatorStyle):
601         (WebCore::RenderTheme::paintCapsLockIndicator):
602         (WebCore::RenderTheme::adjustAttachmentStyle):
603         (WebCore::RenderTheme::animationDurationForProgressBar):
604         (WebCore::RenderTheme::adjustProgressBarStyle):
605         (WebCore::RenderTheme::shouldHaveCapsLockIndicator):
606         (WebCore::RenderTheme::adjustMenuListButtonStyle):
607         (WebCore::RenderTheme::adjustMediaControlStyle):
608         (WebCore::RenderTheme::adjustSliderTrackStyle):
609         (WebCore::RenderTheme::adjustSliderThumbStyle):
610         (WebCore::RenderTheme::adjustSliderThumbSize):
611         (WebCore::RenderTheme::adjustSearchFieldStyle):
612         (WebCore::RenderTheme::adjustSearchFieldCancelButtonStyle):
613         (WebCore::RenderTheme::adjustSearchFieldDecorationPartStyle):
614         (WebCore::RenderTheme::adjustSearchFieldResultsDecorationPartStyle):
615         (WebCore::RenderTheme::adjustSearchFieldResultsButtonStyle):
616         * rendering/RenderTheme.h:
617         (WebCore::RenderTheme::minimumMenuListSize):
618         (WebCore::RenderTheme::popupInternalPaddingBox):
619         (WebCore::RenderTheme::popupOptionSupportsTextIndent):
620         (WebCore::RenderTheme::paintRadioDecorations):
621         (WebCore::RenderTheme::paintButtonDecorations):
622         (WebCore::RenderTheme::paintTextField):
623         (WebCore::RenderTheme::paintTextFieldDecorations):
624         (WebCore::RenderTheme::paintTextArea):
625         (WebCore::RenderTheme::paintTextAreaDecorations):
626         (WebCore::RenderTheme::paintMenuList):
627         (WebCore::RenderTheme::paintMenuListDecorations):
628         (WebCore::RenderTheme::paintMenuListButtonDecorations):
629         (WebCore::RenderTheme::paintPushButtonDecorations):
630         (WebCore::RenderTheme::paintSquareButtonDecorations):
631         (WebCore::RenderTheme::paintProgressBar):
632         (WebCore::RenderTheme::paintSliderTrack):
633         (WebCore::RenderTheme::paintSliderThumb):
634         (WebCore::RenderTheme::paintSliderThumbDecorations):
635         (WebCore::RenderTheme::paintSearchField):
636         (WebCore::RenderTheme::paintSearchFieldDecorations):
637         (WebCore::RenderTheme::paintSearchFieldCancelButton):
638         (WebCore::RenderTheme::paintSearchFieldDecorationPart):
639         (WebCore::RenderTheme::paintSearchFieldResultsDecorationPart):
640         (WebCore::RenderTheme::paintSearchFieldResultsButton):
641         (WebCore::RenderTheme::paintMediaFullscreenButton):
642         (WebCore::RenderTheme::paintMediaPlayButton):
643         (WebCore::RenderTheme::paintMediaOverlayPlayButton):
644         * rendering/RenderThemeEfl.cpp:
645         (WebCore::RenderThemeEfl::paintSliderTrack):
646         (WebCore::RenderThemeEfl::adjustSliderTrackStyle):
647         (WebCore::RenderThemeEfl::adjustSliderThumbStyle):
648         (WebCore::RenderThemeEfl::adjustSliderThumbSize):
649         (WebCore::RenderThemeEfl::paintSliderThumb):
650         (WebCore::RenderThemeEfl::adjustCheckboxStyle):
651         (WebCore::RenderThemeEfl::paintCheckbox):
652         (WebCore::RenderThemeEfl::adjustRadioStyle):
653         (WebCore::RenderThemeEfl::paintRadio):
654         (WebCore::RenderThemeEfl::adjustButtonStyle):
655         (WebCore::RenderThemeEfl::paintButton):
656         (WebCore::RenderThemeEfl::adjustMenuListStyle):
657         (WebCore::RenderThemeEfl::paintMenuList):
658         (WebCore::RenderThemeEfl::adjustMenuListButtonStyle):
659         (WebCore::RenderThemeEfl::paintMenuListButtonDecorations):
660         (WebCore::RenderThemeEfl::adjustTextFieldStyle):
661         (WebCore::RenderThemeEfl::paintTextField):
662         (WebCore::RenderThemeEfl::adjustTextAreaStyle):
663         (WebCore::RenderThemeEfl::paintTextArea):
664         (WebCore::RenderThemeEfl::adjustSearchFieldResultsButtonStyle):
665         (WebCore::RenderThemeEfl::paintSearchFieldResultsButton):
666         (WebCore::RenderThemeEfl::adjustSearchFieldResultsDecorationPartStyle):
667         (WebCore::RenderThemeEfl::paintSearchFieldResultsDecorationPart):
668         (WebCore::RenderThemeEfl::adjustSearchFieldCancelButtonStyle):
669         (WebCore::RenderThemeEfl::paintSearchFieldCancelButton):
670         (WebCore::RenderThemeEfl::adjustSearchFieldStyle):
671         (WebCore::RenderThemeEfl::paintSearchField):
672         (WebCore::RenderThemeEfl::adjustInnerSpinButtonStyle):
673         (WebCore::RenderThemeEfl::updateCachedSystemFontDescription):
674         (WebCore::RenderThemeEfl::adjustProgressBarStyle):
675         * rendering/RenderThemeEfl.h:
676         * rendering/RenderThemeGtk.cpp:
677         (WebCore::RenderThemeGtk::adjustRepaintRect):
678         (WebCore::RenderThemeGtk::adjustButtonStyle):
679         (WebCore::RenderThemeGtk::paintButton):
680         (WebCore::RenderThemeGtk::adjustMenuListStyle):
681         (WebCore::RenderThemeGtk::adjustMenuListButtonStyle):
682         (WebCore::RenderThemeGtk::paintMenuListButtonDecorations):
683         (WebCore::RenderThemeGtk::adjustTextFieldStyle):
684         (WebCore::RenderThemeGtk::paintTextField):
685         (WebCore::RenderThemeGtk::paintTextArea):
686         (WebCore::RenderThemeGtk::adjustSearchFieldResultsButtonStyle):
687         (WebCore::RenderThemeGtk::paintSearchFieldResultsButton):
688         (WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle):
689         (WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle):
690         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
691         (WebCore::RenderThemeGtk::adjustSearchFieldStyle):
692         (WebCore::RenderThemeGtk::shouldHaveCapsLockIndicator):
693         (WebCore::RenderThemeGtk::adjustSliderTrackStyle):
694         (WebCore::RenderThemeGtk::adjustSliderThumbStyle):
695         (WebCore::RenderThemeGtk::paintSliderTrack):
696         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
697         (WebCore::RenderThemeGtk::innerSpinButtonLayout):
698         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
699         (WebCore::spinButtonArrowSize):
700         (WebCore::RenderThemeGtk::paintMediaCurrentTime):
701         (WebCore::RenderThemeGtk::adjustProgressBarStyle):
702         * rendering/RenderThemeGtk.h:
703         * rendering/RenderThemeIOS.h:
704         * rendering/RenderThemeIOS.mm:
705         (WebCore::RenderThemeIOS::addRoundedBorderClip):
706         (WebCore::RenderThemeIOS::adjustCheckboxStyle):
707         (WebCore::RenderThemeIOS::isControlStyled):
708         (WebCore::RenderThemeIOS::adjustRadioStyle):
709         (WebCore::adjustInputElementButtonStyle):
710         (WebCore::RenderThemeIOS::adjustMenuListButtonStyle):
711         (WebCore::RenderThemeIOS::adjustSliderTrackStyle):
712         (WebCore::RenderThemeIOS::paintSliderTrack):
713         (WebCore::RenderThemeIOS::adjustSliderThumbSize):
714         (WebCore::RenderThemeIOS::sliderTickOffsetFromTrackCenter):
715         (WebCore::RenderThemeIOS::adjustSearchFieldStyle):
716         (WebCore::RenderThemeIOS::paintSearchFieldDecorations):
717         (WebCore::RenderThemeIOS::adjustButtonStyle):
718         * rendering/RenderThemeMac.h:
719         * rendering/RenderThemeMac.mm:
720         (WebCore::RenderThemeMac::paintTextField):
721         (WebCore::RenderThemeMac::adjustTextFieldStyle):
722         (WebCore::RenderThemeMac::paintTextArea):
723         (WebCore::RenderThemeMac::adjustTextAreaStyle):
724         (WebCore::RenderThemeMac::animationDurationForProgressBar):
725         (WebCore::RenderThemeMac::adjustProgressBarStyle):
726         (WebCore::menuListButtonSizes):
727         (WebCore::RenderThemeMac::adjustMenuListStyle):
728         (WebCore::RenderThemeMac::popupMenuSize):
729         (WebCore::RenderThemeMac::adjustMenuListButtonStyle):
730         (WebCore::RenderThemeMac::adjustSliderTrackStyle):
731         (WebCore::RenderThemeMac::paintSliderTrack):
732         (WebCore::RenderThemeMac::adjustSliderThumbStyle):
733         (WebCore::RenderThemeMac::setSearchFieldSize):
734         (WebCore::RenderThemeMac::adjustSearchFieldStyle):
735         (WebCore::RenderThemeMac::cancelButtonSizes):
736         (WebCore::RenderThemeMac::adjustSearchFieldCancelButtonStyle):
737         (WebCore::RenderThemeMac::resultsButtonSizes):
738         (WebCore::RenderThemeMac::adjustSearchFieldDecorationPartStyle):
739         (WebCore::RenderThemeMac::paintSearchFieldDecorationPart):
740         (WebCore::RenderThemeMac::adjustSearchFieldResultsDecorationPartStyle):
741         (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
742         (WebCore::RenderThemeMac::adjustSearchFieldResultsButtonStyle):
743         (WebCore::RenderThemeMac::adjustSliderThumbSize):
744         * rendering/RenderThemeWin.cpp:
745         (WebCore::RenderThemeWin::paintButton):
746         (WebCore::RenderThemeWin::adjustInnerSpinButtonStyle):
747         (WebCore::RenderThemeWin::paintMenuList):
748         (WebCore::RenderThemeWin::adjustMenuListStyle):
749         (WebCore::RenderThemeWin::adjustMenuListButtonStyle):
750         (WebCore::RenderThemeWin::adjustSliderThumbSize):
751         (WebCore::RenderThemeWin::paintSearchField):
752         (WebCore::RenderThemeWin::adjustSearchFieldStyle):
753         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
754         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle):
755         (WebCore::RenderThemeWin::adjustSearchFieldDecorationPartStyle):
756         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle):
757         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
758         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle):
759         (WebCore::RenderThemeWin::adjustMeterStyle):
760         * rendering/RenderThemeWin.h:
761
762 2016-04-16  Antti Koivisto  <antti@apple.com>
763
764         CSSCursorImageValue shouldn't mutate element during style resolution
765         https://bugs.webkit.org/show_bug.cgi?id=156659
766
767         Reviewed by Darin Adler.
768
769         CSSCursorImageValue::updateIfSVGCursorIsUsed may mutate the argument element.
770
771         This patch removes the code that caches cursor element and image to SVGElement rare data.
772         The whole things is basically unused. CSSCursorImageValue now maintains a weak map to
773         SVGCursorElements directly instead of indirectly via the using SVGElements.
774
775         * css/CSSCursorImageValue.cpp:
776         (WebCore::CSSCursorImageValue::CSSCursorImageValue):
777         (WebCore::CSSCursorImageValue::~CSSCursorImageValue):
778         (WebCore::CSSCursorImageValue::customCSSText):
779         (WebCore::CSSCursorImageValue::updateCursorElement):
780
781             We no longer rely on SVGElement rare data so no need to test for SVGElement.
782
783         (WebCore::CSSCursorImageValue::cursorElementRemoved):
784         (WebCore::CSSCursorImageValue::cursorElementChanged):
785
786             Factor to a function.
787
788         (WebCore::CSSCursorImageValue::cachedImage):
789         (WebCore::CSSCursorImageValue::clearCachedImage):
790         (WebCore::CSSCursorImageValue::equals):
791         (WebCore::CSSCursorImageValue::removeReferencedElement): Deleted.
792
793             Don't track client elements anymore. Just track referenced SVGCursorElements.
794
795         * css/CSSCursorImageValue.h:
796         * css/StyleBuilderCustom.h:
797         (WebCore::StyleBuilderCustom::applyValueCursor):
798
799             No need to make style unique. Initialization is now done in updateSVGCursorElement.
800
801         * svg/SVGCursorElement.cpp:
802         (WebCore::SVGCursorElement::~SVGCursorElement):
803         (WebCore::SVGCursorElement::isSupportedAttribute):
804         (WebCore::SVGCursorElement::parseAttribute):
805         (WebCore::SVGCursorElement::addClient):
806         (WebCore::SVGCursorElement::removeClient):
807
808             Client is now an CSSCursorImageValue rather than SVGElement.
809
810         (WebCore::SVGCursorElement::svgAttributeChanged):
811
812             Instead of invalidating element style just invalidate the CSSCursorImageValue directly.
813
814         (WebCore::SVGCursorElement::addSubresourceAttributeURLs):
815         (WebCore::SVGCursorElement::removeReferencedElement): Deleted.
816         * svg/SVGCursorElement.h:
817         * svg/SVGElement.cpp:
818         (WebCore::SVGElement::~SVGElement):
819         (WebCore::SVGElement::getBoundingBox):
820         (WebCore::SVGElement::correspondingElement):
821         (WebCore::SVGElement::setCursorElement): Deleted.
822         (WebCore::SVGElement::cursorElementRemoved): Deleted.
823         (WebCore::SVGElement::setCursorImageValue): Deleted.
824         (WebCore::SVGElement::cursorImageValueRemoved): Deleted.
825
826             SVGElements no longer need to know about their cursors.
827
828         * svg/SVGElement.h:
829         * svg/SVGElementRareData.h:
830         (WebCore::SVGElementRareData::instanceUpdatesBlocked):
831         (WebCore::SVGElementRareData::setInstanceUpdatesBlocked):
832         (WebCore::SVGElementRareData::correspondingElement):
833         (WebCore::SVGElementRareData::setCorrespondingElement):
834         (WebCore::SVGElementRareData::animatedSMILStyleProperties):
835         (WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties):
836         (WebCore::SVGElementRareData::cursorElement): Deleted.
837         (WebCore::SVGElementRareData::setCursorElement): Deleted.
838         (WebCore::SVGElementRareData::cursorImageValue): Deleted.
839         (WebCore::SVGElementRareData::setCursorImageValue): Deleted.
840
841 2016-04-15  Darin Adler  <darin@apple.com>
842
843         Reduce use of Deprecated::ScriptXXX classes
844         https://bugs.webkit.org/show_bug.cgi?id=156632
845
846         Reviewed by Alex Christensen.
847
848         * Modules/mediastream/SDPProcessor.cpp: Removed unneeded include.
849
850         * bindings/js/JSCommandLineAPIHostCustom.cpp:
851         (WebCore::JSCommandLineAPIHost::inspectedObject): Use JSValue.
852         * bindings/js/JSCustomEventCustom.cpp:
853         (WebCore::JSCustomEvent::detail): Ditto.
854         * bindings/js/ScriptController.cpp:
855         (WebCore::ScriptController::evaluateInWorld): Ditto.
856         (WebCore::ScriptController::evaluate): Ditto.
857         (WebCore::ScriptController::executeScriptInWorld): Ditto.
858         (WebCore::ScriptController::executeScript): Ditto.
859         (WebCore::ScriptController::executeIfJavaScriptURL): Ditto.
860         * bindings/js/ScriptController.h: Ditto.
861
862         * bindings/js/ScriptGlobalObject.cpp: Removed unused overload of set,
863         and unused remove and folded handleException function into its one call site.
864         (WebCore::ScriptGlobalObject::set): Take references instead of pointers.
865         (WebCore::ScriptGlobalObject::get): Use JSObject instead of Deprecated::ScriptObject.
866         * bindings/js/ScriptGlobalObject.h: Updated for the above.
867
868         * dom/CustomEvent.cpp:
869         (WebCore::CustomEvent::initCustomEvent): Take JSValue and ExecState instead of
870         Deprecated::ScriptValue.
871         (WebCore::CustomEvent::trySerializeDetail): Take a reference instead of a pointer.
872         Also removed an unneeded null check.
873         * dom/CustomEvent.h: Use JSValue.
874         * dom/CustomEvent.idl: Updated for the above.
875
876         * html/HTMLMediaElement.cpp: Remove unneeded include.
877
878         * inspector/CommandLineAPIHost.cpp:
879         (WebCore::CommandLineAPIHost::InspectableObject::get): Take reference instead of
880         pointer and return JSValue.
881         * inspector/CommandLineAPIHost.h: Updated for the above.
882
883         * inspector/InspectorDOMAgent.cpp:
884         (WebCore::InspectorDOMAgent::setDocument): Use "document" instead of "doc".
885         (WebCore::InspectorDOMAgent::setAttributesAsText): Omit redundant class name.
886         (WebCore::InspectorDOMAgent::focusNode): Ditto. Pass reference instead of pointer.
887         (WebCore::InspectorDOMAgent::undo): Ditto.
888         (WebCore::InspectorDOMAgent::redo): Ditto.
889         (WebCore::InspectorDOMAgent::nodeForObjectId): Stop using Deprecated::ScriptValue.
890         (WebCore::InspectorDOMAgent::resolveNode): Ditto.
891         (WebCore::InspectorDOMAgent::scriptValueAsNode): Removed unneeded isObject check,
892         which is already done by JSNode::toWrapped. Use JSValue.
893         (WebCore::InspectorDOMAgent::nodeAsScriptValue): Use JSValue.
894         * inspector/InspectorDOMAgent.h: Updated for the above.
895
896         * inspector/InspectorFrontendClientLocal.cpp:
897         (WebCore::InspectorFrontendClientLocal::windowObjectCleared): Use references instead of
898         pointers and removed unneeded local.
899         (WebCore::InspectorFrontendClientLocal::evaluateAsBoolean): More of the same.
900         * inspector/InspectorFrontendHost.cpp:
901         (WebCore::InspectorFrontendHost::showContextMenu): Ditto.
902
903         * inspector/InspectorTimelineAgent.cpp:
904         (WebCore::InspectorTimelineAgent::breakpointActionProbe): Updated to take
905         reference instead of pointer and JSValue instead of ScriptValue.
906         * inspector/InspectorTimelineAgent.h: Ditto.
907         * inspector/PageConsoleAgent.cpp: Ditto.
908         * inspector/PageDebuggerAgent.cpp:
909         (WebCore::PageDebuggerAgent::breakpointActionLog): Ditto.
910         * inspector/PageDebuggerAgent.h: Ditto.
911
912 2016-04-15  Daniel Bates  <dabates@apple.com>
913
914         CSP: Ignore paths in CSP matching after redirects
915         https://bugs.webkit.org/show_bug.cgi?id=153154
916         <rdar://problem/24383215>
917
918         Reviewed by Brent Fulgham.
919
920         For sub-resources that redirect, match the URL that is the result of the redirect against
921         the source expressions in Content Security Policy ignoring any paths in those source
922         expressions as per section Paths and Redirects of the Content Security Policy Level 2 spec.,
923         <https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 29 August 2015).
924
925         Tests: http/tests/security/contentSecurityPolicy/audio-redirect-allowed2.html
926                http/tests/security/contentSecurityPolicy/embed-redirect-allowed.html
927                http/tests/security/contentSecurityPolicy/embed-redirect-allowed2.html
928                http/tests/security/contentSecurityPolicy/embed-redirect-blocked.html
929                http/tests/security/contentSecurityPolicy/embed-redirect-blocked2.html
930                http/tests/security/contentSecurityPolicy/embed-redirect-blocked3.html
931                http/tests/security/contentSecurityPolicy/font-redirect-allowed2.html
932                http/tests/security/contentSecurityPolicy/form-action-src-redirect-allowed.html
933                http/tests/security/contentSecurityPolicy/form-action-src-redirect-allowed2.html
934                http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-child-src.html
935                http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-child-src2.html
936                http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-frame-src.html
937                http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-frame-src2.html
938                http/tests/security/contentSecurityPolicy/iframe-redirect-blocked-by-child-src.html
939                http/tests/security/contentSecurityPolicy/iframe-redirect-blocked-by-frame-src.html
940                http/tests/security/contentSecurityPolicy/image-redirect-allowed2.html
941                http/tests/security/contentSecurityPolicy/object-redirect-allowed.html
942                http/tests/security/contentSecurityPolicy/object-redirect-allowed2.html
943                http/tests/security/contentSecurityPolicy/object-redirect-blocked.html
944                http/tests/security/contentSecurityPolicy/object-redirect-blocked2.html
945                http/tests/security/contentSecurityPolicy/object-redirect-blocked3.html
946                http/tests/security/contentSecurityPolicy/script-redirect-allowed2.html
947                http/tests/security/contentSecurityPolicy/stylesheet-redirect-allowed2.html
948                http/tests/security/contentSecurityPolicy/svg-font-redirect-allowed2.html
949                http/tests/security/contentSecurityPolicy/svg-image-redirect-allowed2.html
950                http/tests/security/contentSecurityPolicy/track-redirect-allowed2.html
951                http/tests/security/contentSecurityPolicy/video-redirect-allowed2.html
952                http/tests/security/contentSecurityPolicy/xsl-redirect-allowed2.html
953
954         * loader/DocumentLoader.cpp:
955         (WebCore::DocumentLoader::willSendRequest): Define a local variable didReceiveRedirectResponse as
956         to whether this request follows from having received a redirect response from the server. Pass this
957         information to FrameLoader::checkIfFormActionAllowedByCSP() and PolicyChecker::checkNavigationPolicy()
958         for its consideration.
959         * loader/DocumentThreadableLoader.cpp:
960         (WebCore::DocumentThreadableLoader::redirectReceived): Pass whether we have a non-null redirect
961         response (i.e. received a redirect response from the server) to DocumentThreadableLoader::isAllowedByContentSecurityPolicy()
962         for its consideration.
963         (WebCore::DocumentThreadableLoader::loadRequest): Pass whether we performed a redirect to
964         DocumentThreadableLoader::isAllowedByContentSecurityPolicy() for its consideration.
965         (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): Modified to take a boolean
966         argument as to whether a redirect was performed. We pass this information to the appropriate
967         ContentSecurityPolicy method.
968         * loader/DocumentThreadableLoader.h:
969         * loader/FrameLoader.cpp:
970         (WebCore::FrameLoader::checkIfFormActionAllowedByCSP): Modified to take a boolean argument as to whether
971         a redirect response was received and passes this information to ContentSecurityPolicy::allowFormAction()
972         for its consideration.
973         (WebCore::FrameLoader::loadURL): Modified to tell PolicyChecker::checkNavigationPolicy() that the navigation
974         is not in response to having received a redirect response from the server.
975         (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
976         * loader/FrameLoader.h:
977         * loader/PolicyChecker.cpp:
978         (WebCore::isAllowedByContentSecurityPolicy): Modified to take a boolean argument as to whether
979         a redirect response was received and passes this information to the appropriate ContentSecurityPolicy member
980         function for consideration.
981         (WebCore::PolicyChecker::checkNavigationPolicy): Modified to take a boolean argument as to whether a redirect
982         response was received and passes this information through to WebCore::isAllowedByContentSecurityPolicy().
983         * loader/PolicyChecker.h:
984         * loader/SubresourceLoader.cpp:
985         (WebCore::SubresourceLoader::willSendRequestInternal): Modified to tell CachedResourceLoader::canRequest() that
986         the request is in response to having received a redirect response from the server.
987         * loader/cache/CachedResourceLoader.cpp:
988         (WebCore::CachedResourceLoader::canRequest): Modified to take a boolean argument as to whether a redirect
989         response was received and passes this information through to the appropriate ContentSecurityPolicy member
990         function for consideration.
991         * loader/cache/CachedResourceLoader.h:
992         * page/csp/ContentSecurityPolicy.cpp:
993         (WebCore::ContentSecurityPolicy::allowScriptFromSource): Modified to take an argument as to whether a
994         redirect response was received and passes this information through to ContentSecurityPolicyDirectiveList.
995         (WebCore::ContentSecurityPolicy::allowObjectFromSource): Ditto.
996         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource): Ditto.
997         (WebCore::ContentSecurityPolicy::allowChildContextFromSource): Ditto.
998         (WebCore::ContentSecurityPolicy::allowImageFromSource): Ditto.
999         (WebCore::ContentSecurityPolicy::allowStyleFromSource): Ditto.
1000         (WebCore::ContentSecurityPolicy::allowFontFromSource): Ditto.
1001         (WebCore::ContentSecurityPolicy::allowMediaFromSource): Ditto.
1002         (WebCore::ContentSecurityPolicy::allowConnectToSource): Ditto.
1003         (WebCore::ContentSecurityPolicy::allowFormAction): Ditto.
1004         * page/csp/ContentSecurityPolicy.h:
1005         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
1006         (WebCore::checkSource):
1007         (WebCore::checkFrameAncestors):
1008         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForChildContext): Modified to take an argument
1009         as to whether a redirect response was received and passes this information through to the CSP directive.
1010         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForConnectSource): Ditto.
1011         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFont): Ditto.
1012         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFormAction): Ditto.
1013         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrame): Ditto.
1014         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForImage): Ditto.
1015         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForMedia): Ditto.
1016         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForObjectSource): Ditto.
1017         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScript): Ditto.
1018         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForStyle): Ditto.
1019         * page/csp/ContentSecurityPolicyDirectiveList.h:
1020         * page/csp/ContentSecurityPolicySource.cpp:
1021         (WebCore::ContentSecurityPolicySource::matches): Modified to take an argument as to whether a redirect response
1022         was received. When the specified URL follows from having received a redirect response then ignore the path
1023         component of the source expression when checking for a match. Otherwise, consider the path component of the
1024         source expression when performing the match.
1025         * page/csp/ContentSecurityPolicySource.h:
1026         * page/csp/ContentSecurityPolicySourceList.cpp:
1027         (WebCore::ContentSecurityPolicySourceList::matches): Modified to take an argument as to whether a redirect
1028         response was received and pass this information through to ContentSecurityPolicySource::matches().
1029         * page/csp/ContentSecurityPolicySourceList.h:
1030         * page/csp/ContentSecurityPolicySourceListDirective.cpp:
1031         (WebCore::ContentSecurityPolicySourceListDirective::allows): Modified to take an argument as to whether a
1032         redirect response was received and pass this information through to ContentSecurityPolicySourceList::matches().
1033         * page/csp/ContentSecurityPolicySourceListDirective.h:
1034
1035 2016-04-15  Myles C. Maxfield  <mmaxfield@apple.com>
1036
1037         [CSS Font Loading] FontFace's promise may never be resolved/rejected if Content Security Policy blocks all the URLs
1038         https://bugs.webkit.org/show_bug.cgi?id=156605
1039
1040         Reviewed by Daniel Bates.
1041
1042         If all the fonts are blocked, we will create a FontFace with no FontFaceSources.
1043         Loading such a FontFace should reject the promise.
1044
1045         Test: fast/text/font-loading-csp-block-all.html
1046
1047         * css/CSSFontFace.cpp:
1048         (WebCore::CSSFontFace::pump):
1049
1050 2016-04-15  Alex Christensen  <achristensen@webkit.org>
1051
1052         [WinCairo] Another unreviewed build fix.
1053
1054         * platform/network/curl/MultipartHandle.cpp:
1055         (WebCore::MultipartHandle::parseHeadersIfPossible):
1056
1057 2016-04-15  Brent Fulgham  <bfulgham@apple.com>
1058
1059         [WinCairo] Unreviewed build fix.,
1060
1061         * platform/network/curl/MultipartHandle.cpp:
1062         (WebCore::MultipartHandle::parseHeadersIfPossible): Correct for new method signature.
1063
1064 2016-04-15  Myles C. Maxfield  <mmaxfield@apple.com>
1065
1066         ASSERT when loading github.com
1067         https://bugs.webkit.org/show_bug.cgi?id=156604
1068         <rdar://problem/19890634>
1069
1070         Reviewed by Darin Adler.
1071
1072         HTMLFormControlElement::m_isValid is a cache of the results of the valid() function.
1073         When cloning the node, we were preserving each individual item, but not the state
1074         of the cache. Therefore, the cache and the attributes didn't agree with each other.
1075
1076         Test: fast/forms/checkValidity-cloneNode-crash.html
1077
1078         * html/HTMLInputElement.cpp:
1079         (WebCore::HTMLInputElement::copyNonAttributePropertiesFromElement):
1080
1081 2016-04-15  Brent Fulgham  <bfulgham@apple.com>
1082
1083         Remove support for X-Frame-Options in `<meta>`
1084         https://bugs.webkit.org/show_bug.cgi?id=156625
1085         <rdar://problem/25748714>
1086
1087         Reviewed by Darin Adler.
1088
1089         Follow RFC7034 (Section 4), which recommends that 'X-Frame-Options' be ignored when delivered as part of
1090         a '<meta http-equiv="...">' tag. This brings us in line with Firefox, Edge, and Blink.
1091
1092         Tests: http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body.html
1093                http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow.html
1094                http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny.html
1095                http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag.html
1096                http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-ignored.html
1097
1098         * dom/Document.cpp:
1099         (WebCore::Document::processHttpEquiv): Log error message instead of blocking the load.
1100
1101 2016-04-15  Jer Noble  <jer.noble@apple.com>
1102
1103         Audio elements should be able to have a controls manager.
1104         https://bugs.webkit.org/show_bug.cgi?id=156630
1105
1106         Reviewed by Beth Dakin.
1107
1108         Now that there is no longer a architectural restriction about what kind of media elements
1109         can be used with WebPlaybackSessionManager, allow audio elements to create a controls
1110         manager.
1111
1112         Drive-by fix: clear the controls manager when destroying the media player due to entering
1113         the page cache, and when destroying the media element.
1114
1115         * html/HTMLMediaElement.cpp:
1116         (WebCore::HTMLMediaElement::~HTMLMediaElement):
1117         (WebCore::HTMLMediaElement::updatePlayState):
1118         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
1119         * html/MediaElementSession.cpp:
1120         (WebCore::MediaElementSession::canControlControlsManager):
1121
1122 2016-04-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
1123
1124         Calling SVGAnimatedPropertyTearOff::animationEnded() will crash if the SVG property is not animating
1125         https://bugs.webkit.org/show_bug.cgi?id=156549
1126
1127         Reviewed by Darin Adler.
1128
1129         A speculative fix for a crash which may happen when calling animationEnded()
1130         of any SVGAnimatedProperty while it is not animating.
1131
1132         * svg/SVGAnimatedTypeAnimator.h:
1133         (WebCore::SVGAnimatedTypeAnimator::executeAction):
1134
1135 2016-04-15  Jer Noble  <jer.noble@apple.com>
1136
1137         Unreviewed build fix for iOS simulator. Assert the correct variable.
1138
1139         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1140         (-[WebAVPlayerLayer layoutSublayers]):
1141         (-[WebAVPlayerLayer resolveBounds]):
1142         (-[WebAVPlayerLayer setVideoGravity:]):
1143
1144 2016-04-14  Jer Noble  <jer.noble@apple.com>
1145
1146         Allow WebVideoFullscreenManager and Proxy to be used by audio elements.
1147         https://bugs.webkit.org/show_bug.cgi?id=156564
1148
1149         Reviewed by Beth Dakin.
1150
1151         No new tests; this refactors existing functionality into new classes.
1152
1153         Tease apart the various WebVideoFullscreen{Interface,Model}{AVKit,Mac,VideoElement} into new
1154         WebPlaybackSession… classes dealing exclusively with playback state and commands, leaving
1155         fullscreen state and commands in the WebVideoFullscreen… classes. Specifically, create the
1156         following new classes:
1157
1158         - WebPlaybackSessionInterface (copied from WebVideoFullscreenInterface)
1159         - WebPlaybackSessionModelMediaElement (copied from WebVideoFullscreenModelMediaElement)
1160         - WebPlaybackSessionModel (copied from WebVideoFullscreenModel)
1161         - WebPlaybackSessionInterfaceAVKit (copied from WebVideoFullscreenInterfaceAVKit)
1162         - WebPlaybackSessionInterfaceMac (copied from WebVideoFullscreenInterfaceMac)
1163
1164         WebVideoFullscreenInterface and WebVideoFullscreenModel now inherit from
1165         WebPlaybackSessionInterface and WebPlaybackSessionModel, respectively. The concrete
1166         WebVideoFullscreen… subclasses each take their respective WebPlaybackSession… subclasses and
1167         fulfill their WebPlaybackSession interfaces through composition.
1168
1169         As part of this big tease-apart, the WebAVPlayerController class needs to be exposed in a
1170         header (as it's accessed by two different classes now), so that class is moved into its own
1171         implementation and header files.
1172
1173         The one case where a change in a WebPlaybackSession… class needs to be reflected in a
1174         WebVideoFullscreen… class is in WebPlaybackSessionInterfaceAVKit, where
1175         WebVideoFullscreenInterfaceAVKit needs to be notified when external playback becomes dis/en-
1176         abled, so a new WebPlaybackSessionInterfaceAVKitClient interface has been added to allow the
1177         WebPlaybackSession… to notify the WebVideoFullscreen….
1178
1179         The responsibility for the "controls manager" has moved from the WebVideoFullscreen… classes
1180         to the WebPlaybackSession… classes, so the ChromeClient interface for creating and destroying
1181         those controls is similarly renamed from setUpVideoControlsManager() to
1182         setUpPlaybackControlsManager().
1183
1184         * WebCore.xcodeproj/project.pbxproj:
1185         * html/HTMLMediaElement.cpp:
1186         (WebCore::HTMLMediaElement::updatePlayState):
1187         * page/ChromeClient.h:
1188         * platform/cocoa/WebPlaybackSessionInterface.h: Copied from Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h.
1189         (WebCore::WebPlaybackSessionInterface::~WebPlaybackSessionInterface):
1190         * platform/cocoa/WebPlaybackSessionModel.h: Added.
1191         (WebCore::WebPlaybackSessionModel::~WebPlaybackSessionModel):
1192         * platform/cocoa/WebPlaybackSessionModelMediaElement.h: Added.
1193         (WebCore::WebPlaybackSessionModelMediaElement::create):
1194         (WebCore::WebPlaybackSessionModelMediaElement::mediaElement):
1195         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm: Added.
1196         (WebPlaybackSessionModelMediaElement::WebPlaybackSessionModelMediaElement):
1197         (WebPlaybackSessionModelMediaElement::~WebPlaybackSessionModelMediaElement):
1198         (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
1199         (WebPlaybackSessionModelMediaElement::setMediaElement):
1200         (WebPlaybackSessionModelMediaElement::handleEvent):
1201         (WebPlaybackSessionModelMediaElement::updateForEventName):
1202         (WebPlaybackSessionModelMediaElement::play):
1203         (WebPlaybackSessionModelMediaElement::pause):
1204         (WebPlaybackSessionModelMediaElement::togglePlayState):
1205         (WebPlaybackSessionModelMediaElement::beginScrubbing):
1206         (WebPlaybackSessionModelMediaElement::endScrubbing):
1207         (WebPlaybackSessionModelMediaElement::seekToTime):
1208         (WebPlaybackSessionModelMediaElement::fastSeek):
1209         (WebPlaybackSessionModelMediaElement::beginScanningForward):
1210         (WebPlaybackSessionModelMediaElement::beginScanningBackward):
1211         (WebPlaybackSessionModelMediaElement::endScanning):
1212         (WebPlaybackSessionModelMediaElement::selectAudioMediaOption):
1213         (WebPlaybackSessionModelMediaElement::selectLegibleMediaOption):
1214         (WebPlaybackSessionModelMediaElement::updateLegibleOptions):
1215         (WebPlaybackSessionModelMediaElement::observedEventNames):
1216         (WebPlaybackSessionModelMediaElement::eventNameAll):
1217         * platform/cocoa/WebPlaybackSessionModelVideoElement.cpp: Copied from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm.
1218         (WebPlaybackSessionModelVideoElement::WebPlaybackSessionModelVideoElement):
1219         (WebPlaybackSessionModelVideoElement::~WebPlaybackSessionModelVideoElement):
1220         (WebPlaybackSessionModelVideoElement::setWebVideoFullscreenInterface):
1221         (WebPlaybackSessionModelVideoElement::setVideoElement):
1222         (WebPlaybackSessionModelVideoElement::handleEvent):
1223         (WebPlaybackSessionModelVideoElement::updateForEventName):
1224         (WebPlaybackSessionModelVideoElement::play):
1225         (WebPlaybackSessionModelVideoElement::pause):
1226         (WebPlaybackSessionModelVideoElement::togglePlayState):
1227         (WebPlaybackSessionModelVideoElement::beginScrubbing):
1228         (WebPlaybackSessionModelVideoElement::endScrubbing):
1229         (WebPlaybackSessionModelVideoElement::seekToTime):
1230         (WebPlaybackSessionModelVideoElement::fastSeek):
1231         (WebPlaybackSessionModelVideoElement::beginScanningForward):
1232         (WebPlaybackSessionModelVideoElement::beginScanningBackward):
1233         (WebPlaybackSessionModelVideoElement::endScanning):
1234         (WebPlaybackSessionModelVideoElement::selectAudioMediaOption):
1235         (WebPlaybackSessionModelVideoElement::selectLegibleMediaOption):
1236         (WebPlaybackSessionModelVideoElement::updateLegibleOptions):
1237         (WebPlaybackSessionModelVideoElement::observedEventNames):
1238         (WebPlaybackSessionModelVideoElement::eventNameAll):
1239         * platform/cocoa/WebVideoFullscreenInterface.h:
1240         * platform/cocoa/WebVideoFullscreenModel.h:
1241         (WebCore::WebVideoFullscreenModel::~WebVideoFullscreenModel): Deleted.
1242         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
1243         (WebCore::WebVideoFullscreenModelVideoElement::create):
1244         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
1245         (WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement):
1246         (WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface):
1247         (WebVideoFullscreenModelVideoElement::setVideoElement):
1248         (WebVideoFullscreenModelVideoElement::play):
1249         (WebVideoFullscreenModelVideoElement::pause):
1250         (WebVideoFullscreenModelVideoElement::togglePlayState):
1251         (WebVideoFullscreenModelVideoElement::beginScrubbing):
1252         (WebVideoFullscreenModelVideoElement::endScrubbing):
1253         (WebVideoFullscreenModelVideoElement::seekToTime):
1254         (WebVideoFullscreenModelVideoElement::fastSeek):
1255         (WebVideoFullscreenModelVideoElement::beginScanningForward):
1256         (WebVideoFullscreenModelVideoElement::beginScanningBackward):
1257         (WebVideoFullscreenModelVideoElement::endScanning):
1258         (WebVideoFullscreenModelVideoElement::selectAudioMediaOption):
1259         (WebVideoFullscreenModelVideoElement::selectLegibleMediaOption):
1260         (WebVideoFullscreenModelVideoElement::handleEvent): Deleted.
1261         (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): Deleted.
1262         (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted.
1263         (WebVideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted.
1264         (WebVideoFullscreenModelVideoElement::observedEventNames): Deleted.
1265         (WebVideoFullscreenModelVideoElement::eventNameAll): Deleted.
1266         (WebVideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted.
1267         (WebVideoFullscreenModelVideoElement::isVisible): Deleted.
1268         * platform/ios/WebAVPlayerController.h: Added.
1269         * platform/ios/WebAVPlayerController.mm: Added.
1270         (-[WebAVPlayerController dealloc]):
1271         (-[WebAVPlayerController resetState]):
1272         (-[WebAVPlayerController player]):
1273         (-[WebAVPlayerController forwardingTargetForSelector:]):
1274         (-[WebAVPlayerController play:]):
1275         (-[WebAVPlayerController pause:]):
1276         (-[WebAVPlayerController togglePlayback:]):
1277         (-[WebAVPlayerController togglePlaybackEvenWhenInBackground:]):
1278         (-[WebAVPlayerController isPlaying]):
1279         (-[WebAVPlayerController setPlaying:]):
1280         (+[WebAVPlayerController keyPathsForValuesAffectingPlaying]):
1281         (-[WebAVPlayerController beginScrubbing:]):
1282         (-[WebAVPlayerController endScrubbing:]):
1283         (-[WebAVPlayerController seekToTime:]):
1284         (-[WebAVPlayerController currentTimeWithinEndTimes]):
1285         (-[WebAVPlayerController setCurrentTimeWithinEndTimes:]):
1286         (+[WebAVPlayerController keyPathsForValuesAffectingCurrentTimeWithinEndTimes]):
1287         (-[WebAVPlayerController hasLiveStreamingContent]):
1288         (+[WebAVPlayerController keyPathsForValuesAffectingHasLiveStreamingContent]):
1289         (-[WebAVPlayerController skipBackwardThirtySeconds:]):
1290         (-[WebAVPlayerController gotoEndOfSeekableRanges:]):
1291         (-[WebAVPlayerController canScanForward]):
1292         (+[WebAVPlayerController keyPathsForValuesAffectingCanScanForward]):
1293         (-[WebAVPlayerController beginScanningForward:]):
1294         (-[WebAVPlayerController endScanningForward:]):
1295         (-[WebAVPlayerController beginScanningBackward:]):
1296         (-[WebAVPlayerController endScanningBackward:]):
1297         (-[WebAVPlayerController canSeekToBeginning]):
1298         (+[WebAVPlayerController keyPathsForValuesAffectingCanSeekToBeginning]):
1299         (-[WebAVPlayerController seekToBeginning:]):
1300         (-[WebAVPlayerController seekChapterBackward:]):
1301         (-[WebAVPlayerController canSeekToEnd]):
1302         (+[WebAVPlayerController keyPathsForValuesAffectingCanSeekToEnd]):
1303         (-[WebAVPlayerController seekToEnd:]):
1304         (-[WebAVPlayerController seekChapterForward:]):
1305         (-[WebAVPlayerController hasMediaSelectionOptions]):
1306         (+[WebAVPlayerController keyPathsForValuesAffectingHasMediaSelectionOptions]):
1307         (-[WebAVPlayerController hasAudioMediaSelectionOptions]):
1308         (+[WebAVPlayerController keyPathsForValuesAffectingHasAudioMediaSelectionOptions]):
1309         (-[WebAVPlayerController hasLegibleMediaSelectionOptions]):
1310         (+[WebAVPlayerController keyPathsForValuesAffectingHasLegibleMediaSelectionOptions]):
1311         (-[WebAVPlayerController currentAudioMediaSelectionOption]):
1312         (-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]):
1313         (-[WebAVPlayerController currentLegibleMediaSelectionOption]):
1314         (-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]):
1315         (-[WebAVPlayerController isPlayingOnExternalScreen]):
1316         (+[WebAVPlayerController keyPathsForValuesAffectingPlayingOnExternalScreen]):
1317         (-[WebAVPlayerController isPictureInPictureInterrupted]):
1318         (-[WebAVPlayerController setPictureInPictureInterrupted:]):
1319         * platform/ios/WebPlaybackSessionInterfaceAVKit.h: Added.
1320         (WebCore::WebPlaybackSessionInterfaceAVKitClient::~WebPlaybackSessionInterfaceAVKitClient):
1321         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm: Added.
1322         (WebCore::WebPlaybackSessionInterfaceAVKit::WebPlaybackSessionInterfaceAVKit):
1323         (WebCore::WebPlaybackSessionInterfaceAVKit::~WebPlaybackSessionInterfaceAVKit):
1324         (WebCore::WebPlaybackSessionInterfaceAVKit::resetMediaState):
1325         (WebCore::WebPlaybackSessionInterfaceAVKit::setWebPlaybackSessionModel):
1326         (WebCore::WebPlaybackSessionInterfaceAVKit::setDuration):
1327         (WebCore::WebPlaybackSessionInterfaceAVKit::setCurrentTime):
1328         (WebCore::WebPlaybackSessionInterfaceAVKit::setBufferedTime):
1329         (WebCore::WebPlaybackSessionInterfaceAVKit::setRate):
1330         (WebCore::WebPlaybackSessionInterfaceAVKit::setSeekableRanges):
1331         (WebCore::WebPlaybackSessionInterfaceAVKit::setCanPlayFastReverse):
1332         (WebCore::mediaSelectionOptions):
1333         (WebCore::WebPlaybackSessionInterfaceAVKit::setAudioMediaSelectionOptions):
1334         (WebCore::WebPlaybackSessionInterfaceAVKit::setLegibleMediaSelectionOptions):
1335         (WebCore::WebPlaybackSessionInterfaceAVKit::setExternalPlayback):
1336         (WebCore::WebPlaybackSessionInterfaceAVKit::setWirelessVideoPlaybackDisabled):
1337         (WebCore::WebPlaybackSessionInterfaceAVKit::wirelessVideoPlaybackDisabled):
1338         (WebCore::WebPlaybackSessionInterfaceAVKit::invalidate):
1339         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1340         (WebVideoFullscreenControllerContext::setUpFullscreen):
1341         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1342         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1343         (-[WebAVPlayerViewControllerDelegate fullscreenInterface]):
1344         (-[WebAVPlayerViewControllerDelegate setFullscreenInterface:]):
1345         (-[WebAVPlayerLayer fullscreenInterface]):
1346         (-[WebAVPlayerLayer setFullscreenInterface:]):
1347         (-[WebAVPlayerLayer layoutSublayers]):
1348         (-[WebAVPlayerLayer resolveBounds]):
1349         (-[WebAVPlayerLayer setVideoGravity:]):
1350         (WebVideoFullscreenInterfaceAVKit::create):
1351         (WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):
1352         (WebVideoFullscreenInterfaceAVKit::~WebVideoFullscreenInterfaceAVKit):
1353         (WebVideoFullscreenInterfaceAVKit::playerController):
1354         (WebVideoFullscreenInterfaceAVKit::resetMediaState):
1355         (WebVideoFullscreenInterfaceAVKit::setDuration):
1356         (WebVideoFullscreenInterfaceAVKit::setCurrentTime):
1357         (WebVideoFullscreenInterfaceAVKit::setBufferedTime):
1358         (WebVideoFullscreenInterfaceAVKit::setRate):
1359         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
1360         (WebVideoFullscreenInterfaceAVKit::setSeekableRanges):
1361         (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse):
1362         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions):
1363         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions):
1364         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback):
1365         (WebVideoFullscreenInterfaceAVKit::externalPlaybackEnabledChanged):
1366         (WebVideoFullscreenInterfaceAVKit::setWirelessVideoPlaybackDisabled):
1367         (WebVideoFullscreenInterfaceAVKit::wirelessVideoPlaybackDisabled):
1368         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
1369         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
1370         (WebVideoFullscreenInterfaceAVKit::mayAutomaticallyShowVideoPictureInPicture):
1371         (-[WebAVPlayerViewControllerDelegate playerViewControllerWillStartPictureInPicture:]): Deleted.
1372         (-[WebAVPlayerViewControllerDelegate playerViewControllerDidStartPictureInPicture:]): Deleted.
1373         (-[WebAVPlayerViewControllerDelegate playerViewControllerFailedToStartPictureInPicture:withError:]): Deleted.
1374         (-[WebAVPlayerViewControllerDelegate playerViewControllerWillStopPictureInPicture:]): Deleted.
1375         (-[WebAVPlayerViewControllerDelegate playerViewControllerDidStopPictureInPicture:]): Deleted.
1376         (convertToExitFullScreenReason): Deleted.
1377         (-[WebAVPlayerViewControllerDelegate playerViewController:shouldExitFullScreenWithReason:]): Deleted.
1378         (-[WebAVPlayerViewControllerDelegate playerViewController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:]): Deleted.
1379         (-[WebAVPlayerLayer init]): Deleted.
1380         (-[WebAVPlayerLayer dealloc]): Deleted.
1381         (-[WebAVPlayerLayer videoGravity]): Deleted.
1382         (-[WebAVPlayerLayer videoRect]): Deleted.
1383         (+[WebAVPlayerLayer keyPathsForValuesAffectingVideoRect]): Deleted.
1384         (WebAVPictureInPicturePlayerLayerView_layerClass): Deleted.
1385         (getWebAVPictureInPicturePlayerLayerViewClass): Deleted.
1386         (WebAVPlayerLayerView_layerClass): Deleted.
1387         (WebAVPlayerLayerView_playerController): Deleted.
1388         (WebAVPlayerLayerView_setPlayerController): Deleted.
1389         (WebAVPlayerLayerView_videoView): Deleted.
1390         (WebAVPlayerLayerView_setVideoView): Deleted.
1391         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView): Deleted.
1392         (WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView): Deleted.
1393         (WebAVPlayerLayerView_pictureInPicturePlayerLayerView): Deleted.
1394         (WebAVPlayerLayerView_dealloc): Deleted.
1395         (getWebAVPlayerLayerViewClass): Deleted.
1396         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel): Deleted.
1397         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenChangeObserver): Deleted.
1398         (WebVideoFullscreenInterfaceAVKit::applicationDidBecomeActive): Deleted.
1399         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): Deleted.
1400         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): Deleted.
1401         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Deleted.
1402         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture): Deleted.
1403         (WebVideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): Deleted.
1404         (WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture): Deleted.
1405         (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture): Deleted.
1406         (WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler): Deleted.
1407         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Deleted.
1408         (WebVideoFullscreenInterfaceAVKit::watchdogTimerFired): Deleted.
1409         (WebVideoFullscreenInterfaceAVKit::setMode): Deleted.
1410         (WebVideoFullscreenInterfaceAVKit::clearMode): Deleted.
1411         (WebCore::supportsPictureInPicture): Deleted.
1412         * platform/mac/WebPlaybackSessionInterfaceMac.h: Added.
1413         * platform/mac/WebPlaybackSessionInterfaceMac.mm: Copied from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm.
1414         (-[WebAVMediaSelectionOptionMac localizedDisplayName]):
1415         (-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]):
1416         (-[WebPlaybackControlsManager initWithWebPlaybackSessionInterfaceMac:]):
1417         (-[WebPlaybackControlsManager timing]):
1418         (-[WebPlaybackControlsManager setTiming:]):
1419         (-[WebPlaybackControlsManager seekableTimeRanges]):
1420         (-[WebPlaybackControlsManager setSeekableTimeRanges:]):
1421         (-[WebPlaybackControlsManager isSeeking]):
1422         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
1423         (-[WebPlaybackControlsManager audioMediaSelectionOptions]):
1424         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]):
1425         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
1426         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
1427         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
1428         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]):
1429         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
1430         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
1431         (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
1432         (WebCore::WebPlaybackSessionInterfaceMac::~WebPlaybackSessionInterfaceMac):
1433         (WebCore::WebPlaybackSessionInterfaceMac::setWebPlaybackSessionModel):
1434         (WebCore::WebPlaybackSessionInterfaceMac::setDuration):
1435         (WebCore::WebPlaybackSessionInterfaceMac::setCurrentTime):
1436         (WebCore::WebPlaybackSessionInterfaceMac::setRate):
1437         (WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
1438         (WebCore::mediaSelectionOptions):
1439         (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
1440         (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
1441         (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
1442         (WebCore::WebPlaybackSessionInterfaceMac::ensureControlsManager):
1443         (WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager):
1444         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1445         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1446         (WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):
1447         (WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenModel):
1448         (WebCore::WebVideoFullscreenInterfaceMac::setDuration):
1449         (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
1450         (WebCore::WebVideoFullscreenInterfaceMac::setRate):
1451         (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
1452         (WebCore::WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions):
1453         (WebCore::WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions):
1454         (WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager):
1455         (WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac): Deleted.
1456         (WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenChangeObserver): Deleted.
1457         (WebCore::WebVideoFullscreenInterfaceMac::setMode): Deleted.
1458         (WebCore::WebVideoFullscreenInterfaceMac::clearMode): Deleted.
1459         (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen): Deleted.
1460         (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen): Deleted.
1461         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen): Deleted.
1462         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode): Deleted.
1463         (WebCore::WebVideoFullscreenInterfaceMac::cleanupFullscreen): Deleted.
1464         (WebCore::WebVideoFullscreenInterfaceMac::invalidate): Deleted.
1465         (WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline): Deleted.
1466         (WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions): Deleted.
1467         (WebCore::supportsPictureInPicture): Deleted.
1468
1469 2016-04-15  Chris Dumez  <cdumez@apple.com>
1470
1471         [COCOA] Do not unnecessarily initialize ResourceResponse::m_httpVersion as part of common fields
1472         https://bugs.webkit.org/show_bug.cgi?id=156606
1473
1474         Reviewed by Darin Adler.
1475
1476         Do not unnecessarily initialize ResourceResponse::m_httpVersion as part of common fields.
1477
1478         We previously initialized m_httpVersion when calling platformLazyInit(CommonFieldsOnly),
1479         even though this is not a common field. The corresponding getter/setter in
1480         HTTPResponseBase call lazyInit(AllFields).
1481
1482         * platform/network/cf/ResourceResponseCFNet.cpp:
1483         (WebCore::ResourceResponse::platformLazyInit):
1484         * platform/network/cocoa/ResourceResponseCocoa.mm:
1485         (WebCore::ResourceResponse::platformLazyInit):
1486
1487 2016-04-15  John Wilander  <wilander@apple.com>
1488
1489         Refactor WebSockets handshake to use StringView instead of String for header validation.
1490         https://bugs.webkit.org/show_bug.cgi?id=155602
1491
1492         Reviewed by Darin Adler.
1493
1494         No new tests. Existing test have been augmented.
1495
1496         * Modules/websockets/WebSocketHandshake.cpp:
1497         (WebCore::WebSocketHandshake::readServerHandshake):
1498             Made sure failure reason was set consistently with makeString().
1499         (WebCore::headerHasValidHTTPVersion):
1500             Now operates on the HTTP status line with StringView.
1501         (WebCore::WebSocketHandshake::readStatusLine):
1502             Now operates on the HTTP status line with StringView.
1503         (WebCore::WebSocketHandshake::readHTTPHeaders):
1504             Now operates on header names with StringView.
1505             Made sure failure reason was set consistently with makeString() and ASCIILiteral().
1506         (WebCore::WebSocketHandshake::checkResponseHeaders):
1507             Made sure failure reason was set consistently with ASCIILiteral().
1508         * platform/network/HTTPParsers.cpp:
1509         (WebCore::parseHTTPRequestLine):
1510             Made sure failure reason was set consistently with ASCIILiteral().
1511         (WebCore::isValidHeaderNameCharacter):
1512             Inlined function to check if a character is allowed in an HTTP header name according to RFC 7230.
1513             https://tools.ietf.org/html/rfc7230 (June 2014)
1514         (WebCore::parseHTTPHeader):
1515         * platform/network/HTTPParsers.h:
1516             Now receives the HTTP header name as a StringView.
1517             Checks that header names only contain valid characters according to RFC 7230 (see above).
1518         * platform/network/ResourceRequestBase.cpp:
1519         (WebCore::ResourceRequestBase::addHTTPHeaderField):
1520         * platform/network/ResourceRequestBase.h:
1521              Now has an overloaded function which receives the HTTP header name as an HTTPHeaderName enum value.
1522         * platform/network/ResourceResponseBase.cpp:
1523         (WebCore::ResourceResponseBase::addHTTPHeaderField):
1524         * platform/network/ResourceResponseBase.h:
1525              Now has an overloaded function which receives the HTTP header name as an HTTPHeaderName enum value.
1526
1527 2016-04-15  Joanmarie Diggs  <jdiggs@igalia.com>
1528
1529         AX: Presentational role on SVG elements is trumped by child 'title' and 'desc' elements
1530         https://bugs.webkit.org/show_bug.cgi?id=156519
1531
1532         Reviewed by Chris Fleizach.
1533
1534         Override the presentational role on SVG elements which have a child 'title' or 'desc'
1535         element. As a result of this change, AccessibilitySVGRoot objects would be exposed
1536         with an AccessibilityRole of UnknownRole. Therefore map included AccessibilitySVGRoot
1537         objects to GroupRole as per the SVG Accessibility API Mapping specification.
1538
1539         Also use indexOfBestMatchingLanguageInList() to identify which child 'title' or 'desc'
1540         element is the best match for the parent element.
1541
1542         New Test: accessibility/w3c-svg-content-language-attribute.html
1543
1544         Also: Update w3c-svg-presentational-role.html expectations because there are test cases
1545         in which elements are now being included in the accessibility tree as a result of this
1546         change. Also add new test cases which lack child 'title' and 'desc' elements.
1547
1548         * accessibility/AccessibilityNodeObject.h:
1549         * accessibility/AccessibilitySVGElement.cpp:
1550         (WebCore::AccessibilitySVGElement::childElementWithMatchingLanguage):
1551         (WebCore::AccessibilitySVGElement::accessibilityDescription):
1552         (WebCore::AccessibilitySVGElement::helpText):
1553         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored):
1554         (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute):
1555         * accessibility/AccessibilitySVGElement.h:
1556         * accessibility/AccessibilitySVGRoot.h:
1557
1558 2016-04-15  Chris Dumez  <cdumez@apple.com>
1559
1560         Rename [GlobalContext] extended attribute to [Exposed] and align with WebIDL
1561         https://bugs.webkit.org/show_bug.cgi?id=156615
1562
1563         Reviewed by Youenn Fablet.
1564
1565         Rename [GlobalContext] extended attribute to [Exposed] and align with WebIDL:
1566         - http://heycam.github.io/webidl/#Exposed
1567
1568         * bindings/scripts/IDLAttributes.txt:
1569         Stop recognizing [GlobalContext] and start recognizing [Exposed].
1570
1571         * bindings/scripts/IDLParser.pm:
1572         (parseIdentifierList):
1573         (parseExtendedAttributeRest2):
1574         Add IDL parser support for having a list of identifiers as value
1575         for an IDL extended attribute, e.g. Exposed=(Window, Worker).
1576
1577         * bindings/scripts/preprocess-idls.pl:
1578         Tweak existing support for [GlobalContext] to use [Exposed] instead
1579         and support the new syntax.
1580
1581         (getInterfaceExtendedAttributesFromIDL):
1582         Do not split on commas that are within brackets.
1583
1584         * Modules/fetch/FetchBody.idl:
1585         * Modules/fetch/FetchHeaders.idl:
1586         * Modules/fetch/FetchRequest.idl:
1587         * Modules/fetch/FetchResponse.idl:
1588         * Modules/streams/ByteLengthQueuingStrategy.idl:
1589         * Modules/streams/CountQueuingStrategy.idl:
1590         * Modules/streams/ReadableStream.idl:
1591         * Modules/streams/ReadableStreamController.idl:
1592         * Modules/streams/ReadableStreamReader.idl:
1593         * Modules/websockets/WebSocket.idl:
1594         * dom/MessageChannel.idl:
1595         * dom/MessageEvent.idl:
1596         * fileapi/Blob.idl:
1597         * fileapi/FileReader.idl:
1598         * fileapi/FileReaderSync.idl:
1599         * html/DOMURL.idl:
1600         * html/ImageData.idl:
1601         * page/EventSource.idl:
1602         * workers/DedicatedWorkerGlobalScope.idl:
1603         * workers/WorkerGlobalScope.idl:
1604         * workers/WorkerLocation.idl:
1605         * xml/XMLHttpRequest.idl:
1606         * xml/XMLHttpRequestEventTarget.idl:
1607         Use [Exposed] instead of [GlobalContext] to match their respective
1608         specifications.
1609
1610 2016-04-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1611
1612         Selection.deleteFromDocument should not leave a selection character
1613         https://bugs.webkit.org/show_bug.cgi?id=151442
1614
1615         Reviewed by Michael Catanzaro.
1616
1617         This is a merge of Blink r172511:
1618         https://codereview.chromium.org/255453003
1619
1620         Let Selection.deleteFromDocument not delete a character when the
1621         selection is a caret.
1622
1623         Selection.deleteFromDocument delete a character when the selection
1624         is a caret.
1625         However, current standard says that Selection.deleteFromDocument
1626         does nothing when the selection is a caret:
1627         https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-selection-deletefromdocument
1628         Both IE10 and FireFox seem following the spec.
1629
1630         Test: imported/blink/editing/selection/deleteFromDocument-undo-crash.html
1631
1632         * page/DOMSelection.cpp:
1633         (WebCore::DOMSelection::deleteFromDocument): Deleted.
1634
1635 2016-04-15  Antti Koivisto  <antti@apple.com>
1636
1637         Fix return value nullptr -> false.
1638
1639         * style/StyleSharingResolver.cpp:
1640         (WebCore::Style::SharingResolver::canShareStyleWithElement):
1641
1642 2016-04-14  Antti Koivisto  <antti@apple.com>
1643
1644         AffectsNextSibling style relation marking is inefficient
1645         https://bugs.webkit.org/show_bug.cgi?id=156593
1646
1647         Reviewed by Benjamin Poulain.
1648
1649         We currently add a Style::Relation entry for each sibling to mark. With long sibling lists this can be inefficient
1650         in terms of both memory and speed. Instead make a single entry that includes the sibling count to mark.
1651
1652         * css/SelectorChecker.cpp:
1653         (WebCore::addStyleRelation):
1654
1655             When adding AffectsNextSibling entry check if the last entry in the style relation vector has the
1656             same type and is part of the same sibling chain. If so just update the existing entry.
1657
1658         * cssjit/SelectorCompiler.cpp:
1659         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
1660
1661             The same thing in hand-crafted macro assembler.
1662
1663         * cssjit/SelectorCompiler.h:
1664
1665             Stop lying about the constness of the CheckingContext.
1666
1667         * style/StyleRelations.cpp:
1668         (WebCore::Style::commitRelations):
1669
1670             Mark as many sibling elements as the value indicates.
1671
1672         * style/StyleRelations.h:
1673         (WebCore::Style::Relation::Relation):
1674
1675             Make element a pointer so we can udpate it.
1676
1677 2016-04-15  Brady Eidson  <beidson@apple.com>
1678
1679         Add the message property to DOMError.
1680         https://bugs.webkit.org/show_bug.cgi?id=139173
1681
1682         Reviewed by Alex Christensen.
1683
1684         No new tests (Updated existing tests).
1685         
1686         Adding this property brings us up to date with other browsers, and will help
1687         test the few web features that still use DOMError.
1688
1689         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1690         (WebCore::IDBOpenDBRequest::onError):
1691         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
1692
1693         * Modules/indexeddb/IDBRequest.cpp:
1694         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
1695         (WebCore::IDBRequest::onError):
1696
1697         * Modules/indexeddb/IDBTransaction.cpp:
1698         (WebCore::IDBTransaction::didCreateIndexOnServer):
1699
1700         * Modules/mediastream/NavigatorUserMediaError.h:
1701         (WebCore::NavigatorUserMediaError::NavigatorUserMediaError):
1702
1703         * dom/DOMError.cpp:
1704         (WebCore::DOMError::DOMError):
1705
1706         * dom/DOMError.h:
1707         (WebCore::DOMError::create):
1708         (WebCore::DOMError::message):
1709         * dom/DOMError.idl:
1710
1711 2016-04-14  Brent Fulgham  <bfulgham@apple.com>
1712
1713         Make <a download> a runtime enabled option
1714         https://bugs.webkit.org/show_bug.cgi?id=156583
1715         <rdar://problem/25733449>
1716
1717         Reviewed by Alex Christensen.
1718
1719         Mark the download attribute interface as EnabledAtRuntime=DownloadAttribute.
1720         Add DownloadAttribute runtime flag getter and setter.
1721
1722         * bindings/generic/RuntimeEnabledFeatures.h:
1723         (WebCore::RuntimeEnabledFeatures::fetchAPIEnabled):
1724         (WebCore::RuntimeEnabledFeatures::setDownloadAttributeEnabled):
1725         (WebCore::RuntimeEnabledFeatures::downloadAttributeEnabled):
1726         * html/HTMLAnchorElement.cpp:
1727         (WebCore::HTMLAnchorElement::handleClick):
1728         * html/HTMLAnchorElement.idl:
1729
1730 2016-04-14  David Kilzer  <ddkilzer@apple.com>
1731
1732         REGRESSION (r158956): Remove vestigial range code in FileReaderLoader class after removing ENABLE(STREAM)
1733         <http://webkit.org/b/156609>
1734
1735         Reviewed by Brent Fulgham.
1736
1737         This code was left behind when ENABLE(STREAM) was removed in
1738         November 2013.
1739
1740         * fileapi/FileReaderLoader.cpp:
1741         (WebCore::FileReaderLoader::FileReaderLoader): Remove
1742         initializers.
1743         (WebCore::FileReaderLoader::start): Remove code that uses
1744         m_hasRange, which is always false.
1745         (WebCore::FileReaderLoader::didReceiveResponse): Ditto.
1746         * fileapi/FileReaderLoader.h:
1747         (WebCore::FileReaderLoader): Remove unused instance variables.
1748
1749 2016-04-14  Alex Christensen  <achristensen@webkit.org>
1750
1751         Build fix after r199549.
1752         https://bugs.webkit.org/show_bug.cgi?id=156580
1753
1754         * CMakeLists.txt:
1755         * PlatformEfl.cmake:
1756         * PlatformGTK.cmake:
1757         * PlatformWin.cmake:
1758         KillRingNone.cpp is indeed platform-specific. KillRingMac.mm is used instead only on Mac.
1759
1760 2016-04-14  Dean Jackson  <dino@apple.com>
1761
1762         CrashTracer: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::CachedResource::addClientToSet + 27
1763         https://bugs.webkit.org/show_bug.cgi?id=156602
1764         <rdar://problem/18921091>
1765
1766         Reviewed by Simon Fraser.
1767
1768         The CSS property list-style-image is inherited, so a transition on a parent
1769         might cause a transition on a child. On that child, the value might be between
1770         two generated crossfade images which haven't yet resolved, causing a crash.
1771
1772         Test: transitions/crossfade-transition.html
1773
1774         * css/CSSCrossfadeValue.cpp:
1775         (WebCore::CSSCrossfadeValue::blend): Return null if there are no cached images.
1776         * page/animation/CSSPropertyAnimation.cpp:
1777         (WebCore::blendFunc): If we don't have an actual image to blend between, fall
1778         out to the default case.
1779
1780 2016-04-14  Antonio Gomes  <tonikitoo@webkit.org>
1781
1782         Allow listbox content and scrollbar to intrude padding area.
1783         https://bugs.webkit.org/show_bug.cgi?id=128489
1784
1785         Reviewed by Myles C. Maxfield.
1786
1787         Originally when the RenderListBox::controlClipRect method was implemented (see [1]), it used
1788         to allow its content (<option>'s) to intrude padding to get rendered. Overlay scrollbars were also
1789         allowed to paint over the padding area, if necessary.
1790
1791         [2] changed this behavior to restrict list-box'es content within the content box rect (excluding padding and border).
1792
1793         This had two consequences:
1794         1) it made WebKit disallow list-box' content to intrude the padding area, diverging from other vendors.
1795         like Firefox and Chrome.
1796         2) Since overlay scrollbar might get painted over the padding area, if any, [2] could result
1797         in the scrollbar being clipped out if padding-right is set (or padding-left in case of RTL content).
1798
1799         Patch changed WebKit back so that it allows list-box' content and overlay scrollbars to intrude the
1800         padding area, matching other browsers vendors
1801
1802         [1] https://trac.webkit.org/changeset/18819/trunk/WebCore/rendering/RenderListBox.cpp
1803         [2] https://trac.webkit.org/changeset/19037/trunk/WebCore/rendering/RenderListBox.cpp
1804
1805         Tests: fast/forms/listbox-selection-3.html
1806                fast/forms/listbox-padding-clip-selected.html
1807                fast/forms/listbox-padding-clip-expected-mismatch.html (renamed from listbox-padding-clip-overlay-expected.html)
1808                fast/forms/listbox-padding-clip-overlay-expected-mismatch.html (renamed from listbox-padding-clip-expected.html)
1809
1810         * rendering/RenderListBox.cpp:
1811         (WebCore::RenderListBox::numVisibleItems): changed to allow list-box items to get rendered on the padding-bottom area.
1812         This matches Firefox and Chrome.
1813         (WebCore::RenderListBox::listIndexAtOffset): relax the check for a given list-box item at a specific offset in the vertical axis.
1814         This means if an list-box item has its content painted into the padding-bottom area, it will be actionable by mouse clicking.
1815         This matches Firefox and Chrome.
1816         (WebCore::RenderListBox::controlClipRect): clips list-box content against the padding box rect rather than the content box rect,
1817         to allow its list-box items' content intrude the padding area.
1818         This matches Firefox and Chrome.
1819
1820 2016-04-14  Antti Koivisto  <antti@apple.com>
1821
1822         Collapsed border cache invalidation can lead to O(n^2) during style resolve
1823         https://bugs.webkit.org/show_bug.cgi?id=156570
1824
1825         Reviewed by Darin Adler.
1826
1827         RenderTable::invalidateCollapsedBorders traverses all cells. It is called when table cell border changes.
1828         This can result in O(n^2) during style resolve.
1829
1830         * rendering/RenderTable.cpp:
1831         (WebCore::RenderTable::layout):
1832         (WebCore::RenderTable::invalidateCollapsedBorders):
1833
1834             For cell border style change invalidate the hasEmptyCollapsedBorder bits only for the neighbouring cells.
1835             They are the only ones that can be affected.
1836
1837         * rendering/RenderTable.h:
1838         (WebCore::RenderTable::collapsedBordersAreValid):
1839         (WebCore::RenderTable::collapsedEmptyBorderIsPresent):
1840         (WebCore::RenderTable::currentBorderValue):
1841         * rendering/RenderTableCell.cpp:
1842         (WebCore::RenderTableCell::styleDidChange):
1843
1844 2016-04-14  Manuel Rego Casasnovas  <rego@igalia.com>
1845
1846         [css-grid] Implement CSSGridTemplateAreasValue::equals
1847         https://bugs.webkit.org/show_bug.cgi?id=156578
1848
1849         Reviewed by Darin Adler.
1850
1851         This was causing an infinite loop setting grid-template-areas
1852         from JavaScript.
1853
1854         The reason was that CSSGridTemplateAreasValue needs
1855         an specific implementation of equals() method.
1856
1857         Test: fast/css-grid-layout/grid-template-areas-infinite-loop.html
1858
1859         * css/CSSGridTemplateAreasValue.cpp:
1860         (WebCore::CSSGridTemplateAreasValue::equals):
1861         * css/CSSGridTemplateAreasValue.h:
1862
1863 2016-04-14  Brent Fulgham  <bfulgham@apple.com>
1864
1865         [CMake] Clean up CMake files
1866         https://bugs.webkit.org/show_bug.cgi?id=156580
1867
1868         Reviewed by Alex Christensen.
1869
1870         Revise the various CMake input files to reduce the amount of duplicated file references in
1871         the various ports.
1872
1873         * CMakeLists.txt:
1874         * PlatformAppleWin.cmake:
1875         * PlatformEfl.cmake:
1876         * PlatformGTK.cmake:
1877         * PlatformWin.cmake:
1878         * PlatformWinCairo.cmake:
1879
1880 2016-04-14  Frederic Wang  <fred.wang@free.fr>
1881
1882         RenderMathMLOperator: Add helper function to retrieve italic correction
1883         https://bugs.webkit.org/show_bug.cgi?id=156572
1884
1885         Reviewed by Darin Adler.
1886
1887         No new tests, the helper function will only be used in bug 153918.
1888
1889         * rendering/mathml/RenderMathMLOperator.cpp:
1890         (WebCore::RenderMathMLOperator::italicCorrection): Return the italic correction from the MATH table if it's a large operator.
1891         * rendering/mathml/RenderMathMLOperator.h: Declare italicCorrection.
1892
1893 2016-04-14  Frederic Wang  <fwang@igalia.com>
1894
1895         RenderMathMLOperator: Move glyph measuring helper functions outside the class
1896         https://bugs.webkit.org/show_bug.cgi?id=156571
1897
1898         Reviewed by Darin Adler.
1899
1900         No new tests, this is just a simple refactoring to prepare the patch
1901         for bug 156542, without any behavior change.
1902
1903         * rendering/mathml/RenderMathMLOperator.cpp: MATHML_OPDICT_SIZE was removed in bug 152242, so no need to undef it.
1904         (WebCore::boundsForGlyph): Static inline helper function moved from the RenderMathMLOperator class.
1905         (WebCore::heightForGlyph): Ditto.
1906         (WebCore::advanceWidthForGlyph): Ditto and renamed.
1907         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Rename advanceForGlyph.
1908         (WebCore::RenderMathMLOperator::findStretchyData): Ditto.
1909         (WebCore::RenderMathMLOperator::updateStyle): Ditto.
1910         (WebCore::RenderMathMLOperator::paintGlyph): Ditto.
1911         (WebCore::RenderMathMLOperator::paint): Ditto.
1912         (WebCore::RenderMathMLOperator::trailingSpaceError): Ditto.
1913         (WebCore::RenderMathMLOperator::setOperatorProperties): Deleted.
1914         (WebCore::RenderMathMLOperator::boundsForGlyph): Deleted.
1915         (WebCore::RenderMathMLOperator::heightForGlyph): Deleted.
1916         (WebCore::RenderMathMLOperator::advanceForGlyph): Deleted.
1917         * rendering/mathml/RenderMathMLOperator.h:
1918
1919 2016-04-14  Frederic Wang  <fred.wang@free.fr>
1920
1921         Set some RenderMathMLOperator members as final
1922         https://bugs.webkit.org/show_bug.cgi?id=156574
1923
1924         Reviewed by Darin Adler.
1925
1926         No new tests, this is only a simple refactoring without behavior change.
1927
1928         * rendering/mathml/RenderMathMLOperator.h: Replace "override" with "final" for some members.
1929
1930 2016-04-14  Frederic Wang  <fwang@igalia.com>
1931
1932         Ensure that RenderMathMLOperator::stretchTo functions are called with stretchy operators that have the correct direction
1933         https://bugs.webkit.org/show_bug.cgi?id=156542
1934
1935         Reviewed by Darin Adler.
1936
1937         In the RenderMathMLUnderOver refactoring (r199293), we avoided doing a
1938         horizontal stretchTo call for non-stretchy operators. Here we do the
1939         same for RenderMathMLRow and avoid doing a vertical stretchTo call for
1940         horizontal or non-stretchy operators. We also add appropriate ASSERT in
1941         the RenderMathMLOperator::stretchTo functions. To avoid failing tests
1942         with DOM/style update, we make our updates a bit stricter. Hopefully,
1943         we could manage such things better in the future (bug 156536).
1944
1945         Tests: mathml/presentation/row-nonstretchy-or-horizontal.html
1946                mathml/presentation/underover-nonstretchy-or-vertical.html
1947
1948         * mathml/MathMLTextElement.cpp:
1949         (WebCore::MathMLTextElement::parseAttribute): Replace setOperatorFlagAndScheduleLayoutIfNeeded with a stronger rendering update.
1950         Also ensure that this is done when the lspace/rspace attributes change.
1951         This avoids breaking mathml/presentation/mo-lspace-rspace-dynamic.html
1952         * rendering/mathml/RenderMathMLOperator.cpp:
1953         (WebCore::RenderMathMLOperator::stretchTo): Add ASSERT to ensure that it is only called with stretchy operators that have the correct direction.
1954         (WebCore::RenderMathMLOperator::styleDidChange): Do a stronger rendering update when the style changes.
1955         This avoids breaking mathml/presentation/style-changed.html
1956         (WebCore::RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded): Deleted.
1957         * rendering/mathml/RenderMathMLOperator.h: Make updateFromElement public so that it can be called from MathMLTextElement::parseAttribute
1958         Remove setOperatorFlagAndScheduleLayoutIfNeeded and declare styleDidChange.
1959         * rendering/mathml/RenderMathMLRow.cpp:
1960         (WebCore::RenderMathMLRow::layoutRowItems): Only call stretchTo for vertical stretchy operators.
1961
1962 2016-04-14  Anders Carlsson  <andersca@apple.com>
1963
1964         When FileInputType::setFiles is called with an empty file list, the last set icon is not cleared
1965         https://bugs.webkit.org/show_bug.cgi?id=156582
1966
1967         Reviewed by Beth Dakin.
1968
1969         * html/FileInputType.cpp:
1970         (WebCore::FileInputType::requestIcon):
1971
1972 2016-04-14  Darin Adler  <darin@apple.com>
1973
1974         Remove UsePointersEvenForNonNullableObjectArguments from Internals
1975         https://bugs.webkit.org/show_bug.cgi?id=156539
1976
1977         Reviewed by Alex Christensen.
1978
1979         * html/HTMLImageElement.idl: Exported this so it can be used as the type for
1980         a function argument in Internals.idl.
1981         * html/HTMLInputElement.idl: Ditto.
1982         * html/HTMLLinkElement.idl: Ditto.
1983         * html/HTMLSelectElement.idl: Ditto.
1984
1985         * testing/Internals.cpp:
1986         (WebCore::InspectorStubFrontend::InspectorStubFrontend): Take a Page&.
1987         (WebCore::Internals::create): Take a Document&.
1988         (WebCore::Internals::resetToConsistentState): Take a Page&.
1989         (WebCore::Internals::Internals): Take a Document&.
1990         (WebCore::Internals::settings): Use nullptr instead of 0.
1991         (WebCore::Internals::address): Take a Node&.
1992         (WebCore::Internals::nodeNeedsStyleRecalc): Take a Node& and no ExceptionCode&.
1993         (WebCore::Internals::styleChangeType): Ditto.
1994         (WebCore::Internals::xhrResponseSource): Take an XMLHttpRequest&.
1995         (WebCore::Internals::isSharingStyleSheetContents): Take two
1996         HTMLLinkElement&.
1997         (WebCore::Internals::isStyleSheetLoadingSubresources): Take an HTMLLinkElement&.
1998         (WebCore::Internals::imageFrameIndex): Take an HTMLImageElement& and no
1999         ExceptionCode&. Also return an unsigned rather than size_t, since the IDL expects
2000         unsigned long, which means unsigned in C++ code.
2001         (WebCore::Internals::treeScopeRootNode): Take a Node& and no ExceptionCode&.
2002         (WebCore::Internals::parentTreeScope): Ditto.
2003         (WebCore::Internals::pauseAnimationAtTimeOnElement): Take an Element&.
2004         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Ditto.
2005         (WebCore::Internals::pauseTransitionAtTimeOnElement): Ditto.
2006         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Ditto.
2007         (WebCore::Internals::attached): Deleted.
2008         (WebCore::Internals::elementRenderTreeAsText): Take an Element&.
2009         (WebCore::Internals::hasPausedImageAnimations): Take an Element& and no
2010         ExceptionCode&.
2011         (WebCore::Internals::computedStyleIncludingVisitedInfo): Take a Node& and no
2012         ExceptionCode&.
2013         (WebCore::Internals::ensureShadowRoot): Take an Element&.
2014         (WebCore::Internals::ensureUserAgentShadowRoot): Take an Element& and no
2015         ExceptionCode&.
2016         (WebCore::Internals::createShadowRoot): Take an Element&.
2017         (WebCore::Internals::shadowRoot): Take an Element& and no ExceptionCode&.
2018         (WebCore::Internals::shadowRootType): Take a Node&.
2019         (WebCore::Internals::includerFor): Deleted.
2020         (WebCore::Internals::shadowPseudoId): Take an Element& and no ExceptionCode&.
2021         (WebCore::Internals::setShadowPseudoId): Ditto.
2022         (WebCore::Internals::visiblePlaceholder): Take an Element&.
2023         (WebCore::Internals::selectColorInColorChooser): Take an HTMLInputElement&.
2024         (WebCore::Internals::boundingBox): Take an Element& and no ExceptionCode&.
2025         (WebCore::Internals::markerCountForNode): Take a Node&.
2026         (WebCore::Internals::markerAt): Ditto.
2027         (WebCore::Internals::markerRangeForNode): Ditto.
2028         (WebCore::Internals::markerDescriptionForNode): Ditto.
2029         (WebCore::Internals::addTextMatchMarker): Take a const Range&.
2030         (WebCore::Internals::setScrollViewPosition): Take int instead of long; long in
2031         IDL means int in C++ code.
2032         (WebCore::Internals::wasLastChangeUserEdit): Take an Element&.
2033         (WebCore::Internals::elementShouldAutoComplete): Take an HTMLInputElement&.
2034         (WebCore::Internals::setEditingValue): Take an HTMLInputElement& and no
2035         ExceptionCode&.
2036         (WebCore::Internals::setAutofilled): Ditto.
2037         (WebCore::Internals::setShowAutoFillButton): Ditto.
2038         (WebCore::Internals::scrollElementToRect): Take an Element& and int instead of long.
2039         (WebCore::Internals::autofillFieldName): Take an Element&.
2040         (WebCore::Internals::rangeFromLocationAndLength): Take an Element& and no ExceptionCode&.
2041         (WebCore::Internals::locationFromRange): Ditto.
2042         (WebCore::Internals::lengthFromRange): Take an Element& and const Range& and no
2043         ExceptionCode&.
2044         (WebCore::Internals::rangeAsText): Take const Range& an no ExceptionCode&.
2045         (WebCore::Internals::subrange): Take Range& an no ExceptionCode&.
2046         (WebCore::Internals::nodesFromRect): Take a Document&.
2047         (WebCore::Internals::openDummyInspectorFrontend): Ditto.
2048         (WebCore::Internals::layerTreeAsText): Take an Element&.
2049         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
2050         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
2051         (WebCore::Internals::displayListForElement): Ditto.
2052         (WebCore::Internals::replayDisplayListForElement): Ditto.
2053         (WebCore::Internals::counterValue): Ditto.
2054         (WebCore::Internals::pageNumber): Ditto.
2055         (WebCore::Internals::webkitWillEnterFullScreenForElement): Ditto.
2056         (WebCore::Internals::webkitDidEnterFullScreenForElement): Ditto.
2057         (WebCore::Internals::webkitWillExitFullScreenForElement): Ditto.
2058         (WebCore::Internals::webkitDidExitFullScreenForElement): Ditto.
2059         (WebCore::Internals::layerFlushCount): Return unsigned instead of unsigned long.
2060         IDL unsigned long means unsigned in C++ code.
2061         (WebCore::Internals::styleRecalcCount): Ditto.
2062         (WebCore::Internals::compositingUpdateCount): Ditto.
2063         (WebCore::Internals::deserializeBuffer): Take an ArrayBuffer&.
2064         (WebCore::Internals::markerTextForListItem): Take an Element& and no ExceptionCode&.
2065         (WebCore::Internals::toolTipFromElement): Ditto.
2066         (WebCore::Internals::getImageSourceURL): Ditto.
2067         (WebCore::Internals::simulateAudioInterruption): Take an HTMLMediaElement&.
2068         (WebCore::Internals::mediaElementHasCharacteristic): Ditto.
2069         (WebCore::Internals::isSelectPopupVisible): Take an HTMLSelectElement&.
2070         (WebCore::Internals::closestTimeToTimeRanges): Take a TimeRange&.
2071         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Take an Element&.
2072         (WebCore::Internals::isPluginSnapshotted): Take an Element& and no ExceptionCode&.
2073         (WebCore::Internals::bufferedSamplesForTrackID): Take a SourceBuffer&.
2074         (WebCore::Internals::setShouldGenerateTimestamps): Ditto.
2075         (WebCore::Internals::setMediaElementRestrictions): Take an HTMLMediaElement&.
2076         (WebCore::Internals::elementIsBlockingDisplaySleep): Take an HTMLMediaElement&.
2077         (WebCore::Internals::setAudioContextRestrictions): Take an AudioContext&.
2078         (WebCore::Internals::scrollSnapOffsets): Take an Element&.
2079         (WebCore::Internals::getCurrentMediaControlsStatusForElement): Take an HTMLMediaElement&.
2080         (WebCore::Internals::userVisibleString): Take a const DOMURL&.
2081         (WebCore::Internals::composedTreeAsText): Take a Node&.
2082
2083         * testing/Internals.h: Update for all the changes listed above.
2084
2085         * testing/Internals.idl: Removed UsePointersEvenForNonNullableObjectArguments. Removed
2086         many unneeded [RaisesException]. Used more specific types for many arguments. Removed
2087         unused, and unimplemented, attached and includedFor functions. Made the node argument to
2088         updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks nullable as well as optional.
2089
2090         * testing/Internals.mm:
2091         (WebCore::Internals::userVisibleString): Take a const DOMURL&.
2092
2093         * testing/js/WebCoreTestSupport.cpp:
2094         (WebCoreTestSupport::injectInternalsObject): Pass a Document& rather than a Document*.
2095         (WebCoreTestSupport::resetInternalsObject): Pass a Page& rather than a Page*.
2096
2097 2016-04-14  Daniel Bates  <dabates@apple.com>
2098
2099         CSP: Ignore report-only policy delivered via meta element
2100         https://bugs.webkit.org/show_bug.cgi?id=156565
2101         <rdar://problem/25718167>
2102
2103         Reviewed by Brent Fulgham.
2104
2105         Only honor a report-only policy delivered via the HTTP header Content-Security-Policy-Report-Only
2106         or X-WebKit-CSP-Report-Only as per section Content-Security-Policy-Report-Only Header Field of 
2107         the Content Security Policy Level 2 spec., <https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 29 August 2015).
2108
2109         Currently we honor a report-only policy delivered via a meta element or an HTTP header. Instead
2110         we should only honor such a policy when delivered via an HTTP header.
2111
2112         Tests: http/tests/security/contentSecurityPolicy/1.1/reportonly-in-meta-ignored2.html
2113                http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-and-sends-report.php
2114                http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode.php
2115                http/tests/security/contentSecurityPolicy/report-multiple-violations-01.php
2116                http/tests/security/contentSecurityPolicy/report-multiple-violations-02.php
2117                http/tests/security/contentSecurityPolicy/report-only-report-uri-missing.php
2118
2119         * dom/Document.cpp:
2120         (WebCore::Document::processHttpEquiv): Do not process policy for HTTP equivalent header
2121         Content-Security-Policy-Report-Only and X-WebKit-CSP-Report-Only.
2122
2123 2016-04-14  Antoine Quint  <graouts@apple.com>
2124
2125         Dashboard is spelled as Dashbard in several source files
2126         https://bugs.webkit.org/show_bug.cgi?id=156577
2127
2128         Reviewed by Eric Carlson.
2129
2130         * html/HTMLCanvasElement.cpp:
2131         (WebCore::HTMLCanvasElement::getContext):
2132         * html/canvas/CanvasGradient.cpp:
2133         (WebCore::CanvasGradient::CanvasGradient):
2134         (WebCore::CanvasGradient::addColorStop):
2135         * html/canvas/CanvasGradient.h:
2136         (WebCore::CanvasGradient::setDashboardCompatibilityMode):
2137
2138 2016-04-14  Antoine Quint  <graouts@apple.com>
2139
2140         WebGL based canvases composite incorrectly after changing size
2141         https://bugs.webkit.org/show_bug.cgi?id=152556
2142         <rdar://problem/24012678>
2143
2144         Reviewed by Dean Jackson.
2145
2146         On iOS, we use the CAEAGLLayer's bounds to set the size of the backing store.
2147         However, that layer's bounds is also used to size the layer during layout. If
2148         the canvas backing store is resized after layout has been performed, the call
2149         to setBounds loses the layout value and the <canvas> element is incorrectly
2150         sized on screen.
2151
2152         To address this, when updating the backing store, we keep track of the previous
2153         layer bounds so we can reset it after we sized the backing store.
2154
2155         Test: webgl/webgl-backing-store-size-update.html
2156
2157         * platform/graphics/GraphicsContext3D.h:
2158         * platform/graphics/mac/GraphicsContext3DMac.mm:
2159         (WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable):
2160
2161 2016-04-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2162
2163         Unreviewed. Fix GObject DOM bindings API break after r199392.
2164
2165         Since r199392 webkit_dom_attr_set_value() no longer raises exceptions, but we need to keep the GError parameter
2166         to keep backwards compatibility.
2167
2168         * bindings/scripts/CodeGeneratorGObject.pm:
2169         (FunctionUsedToRaiseException):
2170
2171 2016-04-13  Daniel Bates  <dabates@apple.com>
2172
2173         CSP: Nested browsing context created for <object> or <embed> should respect object-src directive
2174         https://bugs.webkit.org/show_bug.cgi?id=156563
2175         <rdar://problem/25715713>
2176
2177         Reviewed by Darin Adler.
2178
2179         As per section object-src of the Content Security Policy Level 2 spec.,
2180         <https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 29 August 2015), a nested browsing
2181         context created for an HTML object or HTML embed element should respect the object-src directive.
2182
2183         Currently a nested browsing context created for an HTML object or HTML embed element respects
2184         the child-src directive or frame-src directive (in that order). Instead such nested browsing
2185         contexts should respect the object-src directive.
2186
2187         Tests: http/tests/security/contentSecurityPolicy/object-src-allows-embed-blocked-by-child-src.html
2188                http/tests/security/contentSecurityPolicy/object-src-allows-embed-blocked-by-frame-src.html
2189                http/tests/security/contentSecurityPolicy/object-src-allows-object-blocked-by-child-src.html
2190                http/tests/security/contentSecurityPolicy/object-src-allows-object-blocked-by-frame-src.html
2191                http/tests/security/contentSecurityPolicy/object-src-blocks-embed-allowed-by-child-src.html
2192                http/tests/security/contentSecurityPolicy/object-src-blocks-embed-allowed-by-frame-src.html
2193                http/tests/security/contentSecurityPolicy/object-src-blocks-object-allowed-by-child-src.html
2194                http/tests/security/contentSecurityPolicy/object-src-blocks-object-allowed-by-frame-src.html
2195
2196         * loader/PolicyChecker.cpp:
2197         (WebCore::isAllowedByContentSecurityPolicy): Added. Checks whether the specified URL is allowed by the
2198         object-src or the child-src/frame-src directive for a plugin element and non-plugin element, respectively.
2199         (WebCore::PolicyChecker::checkNavigationPolicy): Modified to call isAllowedByContentSecurityPolicy().
2200
2201 2016-04-13  Daniel Bates  <dabates@apple.com>
2202
2203         CSP: Remove experimental directive reflected-xss
2204         https://bugs.webkit.org/show_bug.cgi?id=156554
2205
2206         Reviewed by Brent Fulgham.
2207
2208         The Content Security Policy directive reflected-xss was removed from the Content Security
2209         Policy Level 2 spec., <https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 29 August 2015).
2210         This directive was considered experimental and was guarded by a run-time flag that was never
2211         enabled by default. We should remove support for this directive.
2212
2213         * html/parser/XSSAuditor.cpp:
2214         (WebCore::XSSAuditor::XSSAuditor): Initialize m_xssProtection to XSSProtectionDisposition::Enabled.
2215         (WebCore::XSSAuditor::init): Write logic in terms of enum class XSSProtectionDisposition.
2216         (WebCore::XSSAuditor::filterToken): Ditto.
2217         (WebCore::combineXSSProtectionHeaderAndCSP): Deleted.
2218         * html/parser/XSSAuditor.h: Change data type of m_xssProtection from ContentSecurityPolicy::ReflectedXSSDisposition
2219         to XSSProtectionDisposition.
2220         * html/parser/XSSAuditorDelegate.cpp: Ditto.
2221         (WebCore::buildConsoleError): Remove logic to emit a remarks in the console error when a XSS is
2222         blocked because of the directive reflected-xss. Also substituted "because" for "as" in the remark
2223         added to the error message when the XSS Auditor is enabled because the server did not send HTTP
2224         header X-XSS-Protection.
2225         * html/parser/XSSAuditorDelegate.h:
2226         (WebCore::XSSInfo::XSSInfo): Removed argument didSendCSPHeader as we are removing support for the
2227         directive reflected-xss.
2228         * page/csp/ContentSecurityPolicy.cpp:
2229         (WebCore::ContentSecurityPolicy::reflectedXSSDisposition): Deleted.
2230         (WebCore::ContentSecurityPolicy::reportInvalidReflectedXSS): Deleted.
2231         * page/csp/ContentSecurityPolicy.h:
2232         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2233         (WebCore::ContentSecurityPolicyDirectiveList::ContentSecurityPolicyDirectiveList): Remove initialization
2234         of m_reflectedXSSDisposition as we are removing support for the directive reflected-xss.
2235         (WebCore::ContentSecurityPolicyDirectiveList::parseReflectedXSS): Deleted.
2236         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Remove logic to parse directive reflected-xss.
2237         * page/csp/ContentSecurityPolicyDirectiveList.h:
2238         (WebCore::ContentSecurityPolicyDirectiveList::reflectedXSSDisposition): Deleted.
2239         * page/csp/ContentSecurityPolicyDirectiveNames.cpp:
2240         * page/csp/ContentSecurityPolicyDirectiveNames.h:
2241         * page/csp/ContentSecurityPolicySourceList.cpp:
2242         (WebCore::isCSPDirectiveName):
2243         (WebCore::isExperimentalDirectiveName): Deleted.
2244         * platform/network/HTTPParsers.cpp:
2245         (WebCore::parseXSSProtectionHeader): Write it terms of enum class XSSProtectionDisposition.
2246         * platform/network/HTTPParsers.h: Define enum class XSSProtectionDisposition. Change return type
2247         of parseXSSProtectionHeader() from ContentSecurityPolicy::ReflectedXSSDisposition to XSSProtectionDisposition
2248         as we are removing the former.
2249
2250 2016-04-13  Brady Eidson  <beidson@apple.com>
2251
2252         Modern IDB (Blob support): Support retrieving Blobs from IDB.
2253         https://bugs.webkit.org/show_bug.cgi?id=156367
2254
2255         Reviewed by Alex Christensen.
2256
2257         No new tests (No testable change in behavior yet, current tests pass).
2258
2259         This patch does the following:
2260         - Pulls BlobURLs and stored filenames out of IDB whenever an IDB record is fetched.
2261         - Adds those URLs and filenames to IDBValue.
2262         - Uses IDBValue in more places instead of SharedBuffer/ThreadSafeBuffer.
2263         - Teaches SerializedScriptValue, Blob, and File how to read the URLs and filenames when they exist.
2264         - Teaches the Blob registry to register a new type of Blob that is not a "File" but is backed by one.
2265
2266         * Modules/indexeddb/IDBCursor.cpp:
2267         (WebCore::IDBCursor::setGetResult):
2268         
2269         * Modules/indexeddb/IDBGetResult.h:
2270         (WebCore::IDBGetResult::IDBGetResult):
2271         
2272         * Modules/indexeddb/IDBRequest.cpp:
2273         (WebCore::IDBRequest::setResultToStructuredClone):
2274         * Modules/indexeddb/IDBRequest.h:
2275         
2276         * Modules/indexeddb/IDBTransaction.cpp:
2277         (WebCore::IDBTransaction::didGetRecordOnServer):
2278         
2279         * Modules/indexeddb/IDBValue.cpp:
2280         (WebCore::IDBValue::IDBValue):
2281         * Modules/indexeddb/IDBValue.h:
2282         
2283         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
2284         (WebCore::IDBServer::MemoryIndexCursor::currentData):
2285         
2286         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2287         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
2288         
2289         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2290         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
2291         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
2292         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2293         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2294         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2295         
2296         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2297         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
2298         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
2299         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2300         (WebCore::IDBServer::SQLiteIDBCursor::currentValue):
2301         (WebCore::IDBServer::SQLiteIDBCursor::currentValueBuffer): Deleted.
2302         
2303         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
2304         (WebCore::IDBServer::SQLiteIDBTransaction::backingStore):
2305         
2306         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
2307         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
2308         
2309         * bindings/js/IDBBindingUtilities.cpp:
2310         (WebCore::deserializeIDBValueDataToJSValue):
2311         (WebCore::deserializeIDBValueData):
2312         (WebCore::deserializeIDBValue):
2313         * bindings/js/IDBBindingUtilities.h:
2314         
2315         * bindings/js/SerializedScriptValue.cpp:
2316         (WebCore::CloneDeserializer::deserialize):
2317         (WebCore::CloneDeserializer::CloneDeserializer):
2318         (WebCore::CloneDeserializer::readFile):
2319         (WebCore::CloneDeserializer::readTerminal):
2320         (WebCore::CloneDeserializer::blobFilePathForBlobURL):
2321         (WebCore::SerializedScriptValue::deserialize):
2322         * bindings/js/SerializedScriptValue.h:
2323
2324         * fileapi/Blob.cpp:
2325         (WebCore::Blob::Blob):
2326         * fileapi/Blob.h:
2327         (WebCore::Blob::deserialize):
2328
2329         * fileapi/File.cpp:
2330         (WebCore::File::File):
2331
2332         * fileapi/ThreadableBlobRegistry.cpp:
2333         (WebCore::threadableQueue):
2334         (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked):
2335         * fileapi/ThreadableBlobRegistry.h:
2336
2337         * platform/CrossThreadTask.h:
2338         (WebCore::createCrossThreadTask):
2339
2340         * platform/network/BlobRegistry.h:
2341
2342         * platform/network/BlobRegistryImpl.cpp:
2343         (WebCore::BlobRegistryImpl::registerBlobURL):
2344         (WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
2345         * platform/network/BlobRegistryImpl.h:
2346
2347 2016-04-13  Zalan Bujtas  <zalan@apple.com>
2348
2349         Text on compositing layer with negative letter-spacing is truncated.
2350         https://bugs.webkit.org/show_bug.cgi?id=156550
2351         <rdar://problem/24212140>
2352
2353         Reviewed by Antti Koivisto.
2354
2355         Negative letter-spacing affects the right edge of content's visual overflow (for both RTL and LTR).
2356         This is similar to how normal line layout adjusts it at InlineFlowBox::addTextBoxVisualOverflow().
2357
2358         Test: fast/text/negative-letter-spacing-visual-overflow.html
2359
2360         * rendering/SimpleLineLayoutFunctions.cpp:
2361         (WebCore::SimpleLineLayout::computeOverflow):
2362         (WebCore::SimpleLineLayout::paintFlow):
2363         (WebCore::SimpleLineLayout::collectFlowOverflow):
2364
2365 2016-04-13  Eric Carlson  <eric.carlson@apple.com>
2366
2367         [iOS] remote command should be considered user events
2368         https://bugs.webkit.org/show_bug.cgi?id=156546
2369         <rdar://problem/25560877>
2370
2371         Reviewed by Jer Noble.
2372
2373         Test: media/remote-control-command-is-user-gesture.html
2374
2375         * html/HTMLMediaElement.cpp:
2376         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Increment/decrement 
2377           m_processingRemoteControlCommand around calling remote command method.
2378         (WebCore::HTMLMediaElement::processingUserGesture): Return true if called while handling
2379           a remote control command.
2380         * html/HTMLMediaElement.h:
2381
2382 2016-04-13  Antonio Gomes  <tonikitoo@webkit.org>
2383
2384         Non-resizable text field looks resizable
2385         https://bugs.webkit.org/show_bug.cgi?id=152271
2386
2387         Reviewed by Darin Adler.
2388
2389         The 'resizability' of an HTML element is controlled by its 'resize' CSS property value.
2390         By default it is 'none', but certain HTML elements, including <textarea>, have it
2391         set to 'both' by default (defined in html.css). These values mean no resize at all, and
2392         resizable in both vertical and horizontal axis, respectively.
2393         Additionally, 'vertical' and 'horizontal' values are also valid.
2394
2395         Problem here is that the way WebKit handles the 'resize' property on single line
2396         input elements (e.g. <input>) is different than other engines (read Gecko, Blink and Presto):
2397
2398         - Match: WebKit, Firefox, Presto and Blink all force single line input elements to be non-resizable,
2399         regardless of either the 'resize' properly is set or not.
2400
2401         - Mismatch: WebKit is the only engine that actually paints the resize control on single line
2402         input elements, even it having no effect.
2403
2404         On WebKit, this happens because the 'resize' property is wrongly implemented as 'inheritable',
2405         differently from other engines. In the way WebKit contructs its RenderTree, 'resize' property
2406         ends up spilling out of <input> and entering its shadow representation, carrying the 'resize'
2407         property on.
2408
2409         Patch fixes this by making the 'resize' properly be non-inherited, matching other vendors
2410         and the spec [1].
2411
2412         [1] https://drafts.csswg.org/css-ui/#resize
2413
2414         Tests: fast/css/resize-not-inherited.html
2415                fast/css/resize-single-line-input-no-paint.html
2416
2417         * rendering/style/RenderStyle.h:
2418         * rendering/style/StyleRareInheritedData.cpp:
2419         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2420         (WebCore::StyleRareInheritedData::operator==):
2421         * rendering/style/StyleRareInheritedData.h:
2422         * rendering/style/StyleRareNonInheritedData.cpp:
2423         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2424         (WebCore::StyleRareNonInheritedData::operator==):
2425         * rendering/style/StyleRareNonInheritedData.h:
2426
2427 2016-04-13  Darin Adler  <darin@apple.com>
2428
2429         Remove UsePointersEvenForNonNullableObjectArguments from DataTransfer
2430         https://bugs.webkit.org/show_bug.cgi?id=156495
2431
2432         Reviewed by Chris Dumez.
2433
2434         * dom/DataTransfer.idl: Removed UsePointersEvenForNonNullableObjectArguments
2435         and marked the element argument to setDragImage as nullable.
2436
2437 2016-04-13  Brady Eidson  <beidson@apple.com>
2438
2439         Modern IDB (Blob support): Support deleting stored blob files.
2440         https://bugs.webkit.org/show_bug.cgi?id=156523
2441
2442         Reviewed by Alex Christensen.
2443
2444         No new tests (No testable change in behavior yet, current tests pass).
2445
2446         There's 3 points in time when we need to delete blob files (and records of them):
2447         1 - When deleting a specific object store record.
2448         2 - When deleting an entire object store.
2449         3 - When deleting a whole database.
2450         
2451         This patch does those three things.
2452
2453         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2454         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
2455         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
2456         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
2457         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2458         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2459         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
2460         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2461
2462         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
2463         (WebCore::IDBServer::SQLiteIDBTransaction::commit):
2464         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
2465         (WebCore::IDBServer::SQLiteIDBTransaction::addRemovedBlobFile):
2466         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
2467
2468 2016-04-13  Frederic Wang  <fwang@igalia.com>
2469
2470         Fix two coding mistakes in MathMLInlineContainerElement::childrenChanged
2471         https://bugs.webkit.org/show_bug.cgi?id=156538
2472
2473         Reviewed by Darin Adler.
2474
2475         We fix the call to updateOperatorProperties inside MathMLInlineContainerElement::childrenChanged
2476         for the <math> and <msqrt> tags.
2477
2478         The <math> tag is already a RenderMathMLRow so the hasTagName(mathTag)
2479         conditional is never executed. The tag does not create any anonymous
2480         wrapper so we do not need a special case for it anyway.
2481
2482         The <msqrt> tag is not a RenderMathMLRow (yet). However, the anonymous
2483         wrapper behaving as a RenderMathMLRow is actually the last child, not
2484         the first one.
2485
2486         No new tests, this is already covered by mathml/presentation/mo-form-dynamic.html
2487         Note that for some reason the coding error for <msqrt> only shows up
2488         after the refactoring of bug 152244.
2489
2490         * mathml/MathMLInlineContainerElement.cpp:
2491         (WebCore::MathMLInlineContainerElement::childrenChanged): Fix the two mistakes and add some FIXME comments.
2492
2493 2016-04-12  Chris Dumez  <cdumez@apple.com>
2494
2495         Attr.value should not be nullable
2496         https://bugs.webkit.org/show_bug.cgi?id=156515
2497
2498         Reviewed by Benjamin Poulain.
2499
2500         Update Attr.value so that it is no longer nullable, as per:
2501         https://dom.spec.whatwg.org/#interface-attr
2502
2503         This aligns our behavior with Firefox and Chrome as well.
2504
2505         Test: fast/dom/Attr/value-not-nullable.html
2506
2507         * dom/Attr.cpp:
2508         (WebCore::Attr::setValueForBindings):
2509         (WebCore::Attr::setNodeValue):
2510         (WebCore::Attr::setValue):
2511         * dom/Attr.h:
2512         * dom/Attr.idl:
2513
2514 2016-04-12  Konstantin Tokarev  <annulen@yandex.ru>
2515
2516         Fixed uninitialization of Node::DataUnion with GCC 4.8.
2517         https://bugs.webkit.org/show_bug.cgi?id=156507
2518
2519         Reviewed by Michael Catanzaro.
2520
2521         This change fixes run time crashes caused by access to uninitialized
2522         memory in Node::renderer().
2523
2524         No new tests needed.
2525
2526         * dom/Node.h:
2527
2528 2016-04-12  Eric Carlson  <eric.carlson@apple.com>
2529
2530         [iOS] do not exit AirPlay when the screen locks
2531         https://bugs.webkit.org/show_bug.cgi?id=156502
2532         <rdar://problem/24616592>
2533
2534         Reviewed by Jer Noble.
2535
2536         * html/HTMLMediaElement.cpp:
2537         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Add logging.
2538         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): Don't tell the media engine to purge 
2539           data if it is playing to a wireless target because that will drop the connection.
2540
2541         * html/MediaElementSession.cpp:
2542         (WebCore::MediaElementSession::playbackPermitted): Add logging.
2543         (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget): Drive by fix: iOS doesn't 
2544           have an explicit playbackTarget, don't test for it.
2545         (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget): Ditto.
2546
2547 2016-04-12  Gavin Barraclough  <barraclough@apple.com>
2548
2549         WebKit should adopt journal_mode=wal for all SQLite databases.
2550         https://bugs.webkit.org/show_bug.cgi?id=133496
2551
2552         Rubber stamped by Chris Dumez.
2553
2554         Temporarily disable on iOS - this broke a test.
2555         (storage/websql/alter-to-info-table.html)
2556
2557         * platform/sql/SQLiteDatabase.cpp:
2558         (WebCore::SQLiteDatabase::open):
2559
2560 2016-04-12  Joseph Pecoraro  <pecoraro@apple.com>
2561
2562         Web Inspector: Keyboard shortcut for "Inspect Element" only works when Web Inspector is open.
2563         https://bugs.webkit.org/show_bug.cgi?id=111193
2564         <rdar://problem/13325889>
2565
2566         Reviewed by Timothy Hatcher.
2567
2568         * inspector/InspectorClient.h:
2569         (WebCore::InspectorClient::elementSelectionChanged):
2570         * inspector/InspectorDOMAgent.cpp:
2571         (WebCore::InspectorDOMAgent::setSearchingForNode):
2572         Inform the client when element selection changes.
2573
2574 2016-04-12  Chris Dumez  <cdumez@apple.com>
2575
2576         Regression(r199360): assertion hit in Element::fastGetAttribute()
2577         https://bugs.webkit.org/show_bug.cgi?id=156509
2578
2579         Reviewed by Ryosuke Niwa.
2580
2581         Stop using fastGetAttribute() / setAttributeWithoutSynchronization()
2582         given that DOMTokenList is used for the class attribute and we need
2583         to synchronize in this case.
2584
2585         No new tests, already covered by existing tests.
2586
2587         * html/DOMTokenList.cpp:
2588         (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
2589         (WebCore::DOMTokenList::tokens):
2590
2591 2016-04-12  Myles C. Maxfield  <mmaxfield@apple.com>
2592
2593         [RTL Scrollbars] Overlay scrollbars push contents inwards
2594         https://bugs.webkit.org/show_bug.cgi?id=156225
2595         <rdar://problem/25137040>
2596
2597         Reviewed by Darin Adler.
2598
2599         The contents should be pushed in by the occupied width of the
2600         scrollbar, which is 0 for overlay scrollbars.
2601
2602         Test: fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html
2603
2604         * rendering/RenderLayer.cpp:
2605         (WebCore::RenderLayer::computeScrollDimensions):
2606
2607 2016-04-12  Myles C. Maxfield  <mmaxfield@apple.com>
2608
2609         [OS X] Flakey crash after ScrollAnimatorMac destruction
2610         https://bugs.webkit.org/show_bug.cgi?id=156372
2611
2612         Reviewed by Darin Adler.
2613
2614         Previously, we were disabling the mock scrollbars using JavaScript after
2615         the WebView was created. However, enabling these mock scrollbars can be
2616         triggered with a bit of state inside the WebPreferences object, which
2617         means WebKit clients can change it at any point. DumpRenderTree is doing
2618         this during the document's lifetime.
2619
2620         This means that the creation of the Scrollbar objects saw a non-mock
2621         ScrollbarTheme, but the destruction of the Scrollbar objects saw a mock
2622         ScrollbarTheme. Therefore, the non-mock ScrollbarTheme doesn't get
2623         cleaned up correctly (ScrollAnimatorMac::willRemoveVerticalScrollbar()
2624         returns early because it sees that there is nothing to deregister
2625         due to the ScrollbarTheme being mocked).
2626
2627         This cleanup is necessary because it sets the NSScrollerImp's delegate
2628         to nil before the NSScrollerImpDelegate gets destroyed. Because the
2629         cleanup wasn't happening, the delegate pointer wasn't getting set to
2630         nil, so the pointer was dangling, and AppKit was following it and
2631         crashing.
2632
2633         Because the clients of this bit of state can change it at any time,
2634         it is incorrect to change it in JavaScript. Instead, the client must
2635         manage this bit of state (so the client and the web process are always
2636         in sync). Therefore, the correct way to set this bit of state must be
2637         done in the test runner rather than Javascript internals. The mechanism
2638         we have to do that is the <!-- webkit-test-runner --> comment at the
2639         beginning of the test. This patch migrates to this mechanism and removes
2640         the old internals method.
2641
2642         Test: fast/scrolling/rtl-scrollbars-animation-property.html
2643
2644         * page/Settings.cpp:
2645         * testing/Internals.cpp:
2646         (WebCore::Internals::setMockScrollbarsEnabled): Deleted.
2647         * testing/Internals.h:
2648         * testing/Internals.idl:
2649
2650 2016-04-12  Darin Adler  <darin@apple.com>
2651
2652         Remove UsePointersEvenForNonNullableObjectArguments from SVG lists
2653         https://bugs.webkit.org/show_bug.cgi?id=156494
2654
2655         Reviewed by Chris Dumez.
2656
2657         * bindings/scripts/CodeGenerator.pm:
2658         (ShouldPassWrapperByReference): For now, don't do this for any tear-off classes.
2659         This includes the items stored in most SVG list classes.
2660
2661         * svg/SVGLengthList.idl: Removed UsePointersEvenForNonNullableObjectArguments.
2662         * svg/SVGNumberList.idl: Ditto.
2663         * svg/SVGPointList.idl: Ditto.
2664         * svg/SVGTransformList.idl: Ditto.
2665
2666         * svg/SVGPathSegList.idl: Removed UsePointersEvenForNonNullableObjectArguments.
2667         Marked the arguments nullable, and added FIXMEs about returning later since they
2668         don't really need to be nullable. But fixing this requires some reworking of the
2669         SVG list template and it's not urgent at this time. Preserves behavior where we
2670         get an exception when passing null, it's just an SVG exception instead of TypeError.
2671
2672 2016-04-12  Chris Dumez  <cdumez@apple.com>
2673
2674         Lazily update tokens in DOMTokenList when the associated attribute value changes
2675         https://bugs.webkit.org/show_bug.cgi?id=156474
2676
2677         Reviewed by Ryosuke Niwa.
2678
2679         Lazily update tokens in DOMTokenList when the associated attribute value
2680         changes for performance. Constructing the sanitized vector of tokens
2681         every time the associated Element attribute changes is too expensive.
2682         Instead, we mark the vector as dirty whenever the attribute changes, and
2683         we only construct the sanitized vector when it is actually required.
2684
2685         Also do some renaming for clarity.
2686
2687         There is no web-exposed behavior change.
2688
2689         * dom/Element.cpp:
2690         (WebCore::Element::classAttributeChanged):
2691         * html/DOMTokenList.cpp:
2692         (WebCore::DOMTokenList::contains):
2693         (WebCore::DOMTokenList::addInternal):
2694         (WebCore::DOMTokenList::removeInternal):
2695         (WebCore::DOMTokenList::toggle):
2696         (WebCore::DOMTokenList::value):
2697         (WebCore::DOMTokenList::setValue):
2698         (WebCore::DOMTokenList::updateTokensFromAttributeValue):
2699         (WebCore::DOMTokenList::associatedAttributeValueChanged):
2700         (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
2701         (WebCore::DOMTokenList::tokens):
2702         (WebCore::DOMTokenList::DOMTokenList): Deleted.
2703         * html/DOMTokenList.h:
2704         (WebCore::DOMTokenList::tokens):
2705         (WebCore::DOMTokenList::length):
2706         (WebCore::DOMTokenList::item):
2707         * html/HTMLAnchorElement.cpp:
2708         (WebCore::HTMLAnchorElement::parseAttribute):
2709         * html/HTMLIFrameElement.cpp:
2710         (WebCore::HTMLIFrameElement::parseAttribute):
2711         * html/HTMLLinkElement.cpp:
2712         (WebCore::HTMLLinkElement::parseAttribute):
2713         * html/HTMLOutputElement.cpp:
2714         (WebCore::HTMLOutputElement::parseAttribute):
2715
2716 2016-04-12  Darin Adler  <darin@apple.com>
2717
2718         Remove UsePointersEvenForNonNullableObjectArguments from HTMLMediaElement
2719         https://bugs.webkit.org/show_bug.cgi?id=156492
2720
2721         Reviewed by Chris Dumez.
2722
2723         * html/HTMLMediaElement.idl: Removed UsePointersEvenForNonNullableObjectArguments,
2724         sorted remaining class attributes, simplified #if around canPlayType a bit,
2725         removed comment that is not all that useful, made the argument to
2726         webkitSetMediaKeys nullable since the implementation supports that.
2727
2728 2016-04-12  Eric Carlson  <eric.carlson@apple.com>
2729
2730         [iOS] media title sometimes remain in Control Center after tab is closed
2731         https://bugs.webkit.org/show_bug.cgi?id=156243
2732         <rdar://problem/20167445>
2733
2734         Reviewed by Darin Adler.
2735
2736         * Modules/webaudio/AudioContext.h: Implement characteristics.
2737
2738         * html/HTMLMediaElement.cpp:
2739         (WebCore::HTMLMediaElement::mediaLoadingFailed): Call mediaSession->clientCharacteristicsChanged.
2740         (WebCore::HTMLMediaElement::setReadyState): Ditto.
2741         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
2742         (WebCore::HTMLMediaElement::stop): Call mediaSession->stopSession.
2743         (WebCore::HTMLMediaElement::characteristics): New, return current characteristics.
2744         * html/HTMLMediaElement.h:
2745
2746         * platform/audio/PlatformMediaSession.cpp:
2747         (WebCore::PlatformMediaSession::stopSession): Suspend playback, and remove the session 
2748           from the manager, it will never play again.
2749         (WebCore::PlatformMediaSession::characteristics): Return client characteristics.
2750         (WebCore::PlatformMediaSession::clientCharacteristicsChanged):
2751         * platform/audio/PlatformMediaSession.h:
2752
2753         * platform/audio/PlatformMediaSessionManager.cpp:
2754         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess): Call stopSession 
2755           instead of pauseSession to signal that playback will never start again.
2756         * platform/audio/PlatformMediaSessionManager.h:
2757
2758         * platform/audio/ios/MediaSessionManagerIOS.h:
2759         * platform/audio/ios/MediaSessionManagerIOS.mm:
2760         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Add logging.
2761         (WebCore::MediaSessionManageriOS::removeSession): Update NowPlaying.
2762         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Add logging.
2763         (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Update NowPlaying.
2764         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): New, return the first session
2765           that is an audio or video element with playable audio. WebAudio is not currently controllable
2766           so it isn't appropriate to show it in the NowPlaying info center.
2767         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Remember the last state passed to
2768           NowPlaying so we can call it only when something has changed.
2769
2770 2016-04-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2771
2772         [GTK] Rework scrollbars theming code for GTK+ 3.20
2773         https://bugs.webkit.org/show_bug.cgi?id=156462
2774
2775         Reviewed by Michael Catanzaro.
2776
2777         In r199292, we reworked the theming code to ensure it works with the new GTK+ CSS theming system. The same is
2778         needed for scrollbars, this patch uses the RenderThemeGadget classes introduced in r199292 to render the native
2779         scrollbars. The code is now split in 3 parts: stub methods for GTK+2 (since this file is compiled for
2780         WebCoreGTK, but not used), the implementation for GTK+ < 3.20 and the implementation for GTK+ >= 3.20. This
2781         reduces the amount of ifdefed code, and ensures that changes in new code don't break the rendering with older
2782         versions of GTK+. I noticed that we were overriding both, the specific paint methods to render scrollbars
2783         parts and the global paint method that renders all the scrollbar parts. We don't really need the specific paint
2784         methods, so I've removed the implemention leaving only the paint method. This also allows us to get rid of the
2785         GtkStyleContext cache.
2786
2787         * platform/gtk/RenderThemeGadget.cpp:
2788         (WebCore::RenderThemeGadget::create): Handle scrollbars gadgets.
2789         (WebCore::appendElementToPath): In case of scrollbar gadget, use the scrollbar GType when creating the path to
2790         be able to get non-CSS style properties.
2791         (WebCore::RenderThemeGadget::opacity): Add method to get the opacity CSS style property.
2792         (WebCore::RenderThemeScrollbarGadget::RenderThemeScrollbarGadget): Initialize m_steppers option set with the
2793         steppers used by the theme.
2794         * platform/gtk/RenderThemeGadget.h:
2795         * platform/gtk/ScrollbarThemeGtk.cpp:
2796         (WebCore::themeChangedCallback):
2797         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
2798         (WebCore::createStyleContext):
2799         (WebCore::createChildStyleContext):
2800         (WebCore::ScrollbarThemeGtk::themeChanged):
2801         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
2802         (WebCore::scrollbarPartStateFlags):
2803         (WebCore::scrollbarGadgetForLayout):
2804         (WebCore::contentsGadgetForLayout):
2805         (WebCore::ScrollbarThemeGtk::trackRect):
2806         (WebCore::ScrollbarThemeGtk::hasThumb):
2807         (WebCore::ScrollbarThemeGtk::backButtonRect):
2808         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
2809         (WebCore::ScrollbarThemeGtk::paint):
2810         (WebCore::paintStepper):
2811         (WebCore::adjustRectAccordingToMargin):
2812         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
2813         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
2814         * platform/gtk/ScrollbarThemeGtk.h:
2815
2816 2016-03-17  Sergio Villar Senin  <svillar@igalia.com>
2817
2818         [css-grid] Add parsing support for <auto-repeat> syntax
2819         https://bugs.webkit.org/show_bug.cgi?id=155583
2820
2821         Reviewed by Antti Koivisto.
2822
2823         The repeat() notation allows now to specify auto-fill or auto-fit instead of
2824         a fixed number of repetitions meaning that it will be automatically computed
2825         depending on the available space.
2826
2827         This patch just adds the parsing support, the expansion of the repeat notation
2828         will be implemented in a follow up patch because it cannot be done at
2829         parsing level (since it requires knowledge about the available space).
2830
2831         Test: fast/css-grid-layout/grid-element-auto-repeat-get-set.html
2832
2833         * CMakeLists.txt:
2834         * css/CSSGridAutoRepeatValue.cpp: Added.
2835         (WebCore::CSSGridAutoRepeatValue::customCSSText):
2836         * css/CSSGridAutoRepeatValue.h: Added.
2837         (WebCore::CSSGridAutoRepeatValue::create):
2838         (WebCore::CSSGridAutoRepeatValue::autoRepeatID):
2839         (WebCore::CSSGridAutoRepeatValue::CSSGridAutoRepeatValue):
2840         * css/CSSParser.cpp:
2841         (WebCore::allTracksAreFixedSized):
2842         (WebCore::CSSParser::parseGridTrackList):
2843         (WebCore::CSSParser::parseGridTrackRepeatFunction):
2844         (WebCore::CSSParser::parseGridTrackSize):
2845         (WebCore::CSSParser::parseGridBreadth):
2846         * css/CSSParser.h:
2847         * css/CSSValue.cpp:
2848         (WebCore::CSSValue::equals):
2849         (WebCore::CSSValue::cssText):
2850         (WebCore::CSSValue::destroy):
2851         * css/CSSValue.h:
2852         (WebCore::CSSValue::isGridAutoRepeatValue):
2853         * css/CSSValueKeywords.in:
2854
2855 2016-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2856
2857         [JSC] addStaticGlobals should emit SymbolTableEntry watchpoints to encourage constant folding in DFG
2858         https://bugs.webkit.org/show_bug.cgi?id=155110
2859
2860         Reviewed by Saam Barati.
2861
2862         * bindings/js/JSDOMWindowBase.cpp:
2863         (WebCore::JSDOMWindowBase::updateDocument):
2864
2865 2016-04-12  Sergio Villar Senin  <svillar@igalia.com>
2866
2867         [css-grid] Pass GridSizingData instead of columnTracks to track sizing methods
2868         https://bugs.webkit.org/show_bug.cgi?id=156466
2869
2870         Reviewed by Darin Adler.
2871
2872         Several methods used to compute the items' size contribution to the tracks they span in, get
2873         as an argument a vector with the sizes of the column tracks.
2874
2875         In order to support grids with orthogonal flows (among other things) it's much better to
2876         pass the GridSizingData struct and let those methods decide whether to use the columns or
2877         the rows.
2878
2879         No new tests as this is just a minor refactoring with no change in behavior.
2880
2881         * rendering/RenderGrid.cpp:
2882         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2883         (WebCore::RenderGrid::logicalContentHeightForChild):
2884         (WebCore::RenderGrid::minSizeForChild):
2885         (WebCore::RenderGrid::minContentForChild):
2886         (WebCore::RenderGrid::maxContentForChild):
2887         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
2888         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
2889         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
2890         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2891         * rendering/RenderGrid.h:
2892
2893 2016-04-11  Darin Adler  <darin@apple.com>
2894
2895         Remove UsePointersEvenForNonNullableObjectArguments from HTMLOptionsCollection
2896         https://bugs.webkit.org/show_bug.cgi?id=156491
2897
2898         Reviewed by Chris Dumez.
2899
2900         * html/HTMLOptionsCollection.cpp:
2901         (WebCore::HTMLOptionsCollection::add): Take a reference instead of a pointer.
2902         * html/HTMLOptionsCollection.h: Removed unneeded forward declaration. Changed
2903         add to take a reference instead of a pointer for the element to add. Used
2904         final instead of override on virtual functions.
2905         * html/HTMLOptionsCollection.idl: Removed now-unneeded attribute
2906         UsePointersEvenForNonNullableObjectArguments; the only function affected was
2907         add, and the overloading code was already checking for null.
2908
2909 2016-04-11  Darin Adler  <darin@apple.com>
2910
2911         Remove UsePointersEvenForNonNullableObjectArguments from HTMLSelectElement
2912         https://bugs.webkit.org/show_bug.cgi?id=156458
2913
2914         Reviewed by Chris Dumez.
2915
2916         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
2917         (WebCore::JSHTMLOptionsCollection::remove): Updated to call remove with a reference
2918         rather than a pointer.
2919
2920         * bindings/js/JSHTMLSelectElementCustom.cpp:
2921         (WebCore::JSHTMLSelectElement::remove): Updated to call remove with a reference
2922         rather than a pointer.
2923         (WebCore::selectIndexSetter): Updated to call setOption with a reference rather
2924         than a pointer.
2925
2926         * bindings/scripts/CodeGeneratorGObject.pm:
2927         (GenerateFunction): Added basic support for passing wrappers by reference.
2928         GObject bindings already check arguments for null, so didn't add any new checks.
2929
2930         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
2931         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
2932         * bindings/scripts/test/GObject/WebKitDOMTestCallbackFunction.cpp:
2933         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
2934         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2935         Updated.
2936
2937         * editing/FrameSelection.cpp: Updated includes.
2938
2939         * html/HTMLOptionElement.cpp:
2940         (WebCore::HTMLOptionElement::setSelected): Pass reference when calling
2941         HTMLSelectElement::optionSelectionStateChanged.
2942         (WebCore::HTMLOptionElement::insertedInto): Ditto.
2943
2944         * html/HTMLOptionsCollection.cpp:
2945         (WebCore::HTMLOptionsCollection::add): Moved null checking behavior here.
2946         Preserves existing "silently do nothing if null".
2947         (WebCore::HTMLOptionsCollection::remove): Changed function to take a reference
2948         instead of a pointer.
2949
2950         * html/HTMLOptionsCollection.h: Updated include. Changed remove to take a
2951         reference instead of a pointer.
2952
2953         * html/HTMLSelectElement.cpp:
2954         (WebCore::HTMLSelectElement::add): Changed to take a reference instead of
2955         a pointer. Also removed unneeded protect code, since insertBefore already
2956         protects itself, and unneeded call to updateValidity, since the
2957         HTMLSelectElement::childrenChanged function already calls updateValidity.
2958         (WebCore::HTMLSelectElement::remove): Changed to take a reference instead
2959         of a pointer.
2960         (WebCore::HTMLSelectElement::setOption): Changed to take a reference
2961         instead of a pointer.
2962         (WebCore::HTMLSelectElement::setLength): Renamed "newLen" to "newLength".
2963         Use Ref instead of RefPtr for result of createElement, which makes the
2964         argument passed to add be a reference rather than a pointer.
2965         (WebCore::HTMLSelectElement::willRespondToMouseClickEvents): Put the #if
2966         for this here instead of in the header.
2967         (WebCore::HTMLSelectElement::optionSelectionStateChanged): Changed to take
2968         a reference instead of a pointer for the option element.
2969
2970         * html/HTMLSelectElement.h: Removed unneeded includes. Derive privately
2971         from TypeAheadDataSource instead of publicly. Make all overrides final
2972         except for the one that is actually overridden by a derived class.
2973         Changed the arguments of the add, remove, setOption, and
2974         optionSelectionStateChanged functions to be references instead of pointers.
2975         Tweaked formatting a bit and used nullptr instead of 0. Override
2976         willRespondToMouseClickEvents on all platforms, not just iOS.
2977
2978         * html/HTMLSelectElement.idl: Removed UsePointersEvenForNonNullableObjectArguments.
2979         Removed a comment that is no longer needed. Made some types nullable to match
2980         the specification, in places that currently have no effect on code generation.
2981         Added a FIXME comment about the argument to setCustomValidity incorrectly being
2982         marked as nullable.
2983
2984 2016-04-11  Brent Fulgham  <bfulgham@apple.com>
2985
2986         Use WeakPtrs to avoid using deallocated Widgets and ScrollableAreas
2987         https://bugs.webkit.org/show_bug.cgi?id=156420
2988         <rdar://problem/25637378>
2989
2990         Reviewed by Darin Adler.
2991
2992         Avoid the risk of using deallocated Widgets and ScrollableAreas by using WeakPtrs instead of
2993         bare pointers. This allows us to remove some explicit calls to get ScrollableArea and Widget
2994         members in the event handling logic. Instead, null checks are sufficient to ensure we never
2995         accidentally dereference a deleted element.
2996
2997         1. Modify the ScrollableArea class to support vending WeakPtrs.
2998         2. Modify the Event Handling code to use WeakPtrs to hold ScrollableArea and RenderWidget
2999            objects, and to null-check these elements after event handling dispatching is finished
3000            to handle cases where these objects are destroyed.
3001
3002         Test: fast/events/wheel-event-destroys-frame.html
3003               fast/events/wheel-event-destroys-overflow.html
3004
3005         * page/EventHandler.cpp:
3006         (WebCore::EventHandler::platformPrepareForWheelEvents): Change signature for WeakPtr.
3007         (WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
3008         (WebCore::EventHandler::platformNotifyIfEndGesture): Ditto.
3009         (WebCore::widgetForElement): Change to return a WeakPtr.
3010         (WebCore::EventHandler::handleWheelEvent): Use WeakPtrs to hold elements that might be destroyed
3011         during event handling.
3012         * page/EventHandler.h:
3013         * page/mac/EventHandlerEfl.cpp: Rename passWheelEventToWidget to widgetDidHandleWheelEvent.
3014         * page/mac/EventHandlerGtk.cpp: Ditto.
3015         * page/mac/EventHandlerIOS.mm: Ditto.
3016         * page/mac/EventHandlerMac.mm:
3017         (WebCore::scrollableAreaForEventTarget): Renamed from scrollViewForEventTarget. Return
3018         a WeakPtr rather than a bare pointer.
3019         (WebCore::scrollableAreaForContainerNode): Return WeakPtr rather than bare pointer.
3020         (WebCore::EventHandler::completeWidgetWheelEvent): Added.
3021         (WebCore::EventHandler::passWheelEventToWidget): Deleted.
3022         (WebCore::EventHandler::platformPrepareForWheelEvents): Convert to WeakPtrs.
3023         (WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
3024         (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): Ditto.
3025         (WebCore::EventHandler::platformNotifyIfEndGesture): Ditto.
3026         (WebCore::EventHandler::widgetDidHandleWheelEvent): Renamed from passWheelEventToWidget.
3027         (WebCore::EventHandler::widgetForEventTarget): Converted from static function to static
3028         method so it can be shared with EventHandlerMac.
3029         (WebCore::scrollViewForEventTarget): Deleted.
3030         * page/mac/EventHandlerWin.cpp: Rename passWheelEventToWidget to widgetDidHandleWheelEvent.
3031         * platform/ScrollableArea.cpp:
3032         * platform/ScrollableArea.h:
3033         (WebCore::ScrollableArea::createWeakPtr): Added.
3034         * platform/Widget.h:
3035         (WebCore::ScrollableArea::createWeakPtr): Added.
3036
3037 2016-04-11  Dean Jackson  <dino@apple.com>
3038
3039         putImageData needs to premultiply input
3040         https://bugs.webkit.org/show_bug.cgi?id=156488
3041         <rdar://problem/25672675>
3042
3043         Reviewed by Zalan Bujtas.
3044
3045         I made a mistake in r187534 as I was converting get and putImageData
3046         to use Accelerate. The incoming data is unmultiplied, and should
3047         be premultiplied before copying into the backing store. I was
3048         accidentally unmultiplying unmultiplied data, which caused
3049         some pretty psychedelic results.
3050
3051         Test: fast/canvas/putImageData-unmultiplied.html
3052
3053         * platform/graphics/cg/ImageBufferDataCG.cpp:
3054         (WebCore::ImageBufferData::putData): Call premultiply, not unpremultiply.
3055
3056 2016-04-11  Jeremy Jones  <jeremyj@apple.com>
3057
3058         When clearing cache, also clear AVFoundation cache.
3059         https://bugs.webkit.org/show_bug.cgi?id=155783
3060         rdar://problem/25252541
3061
3062         Reviewed by Darin Adler.
3063
3064         Use AVAssetCache at a specified location on disk for all AVURLAssets. This AVAssetCache
3065         can then be used to manage the cache storage used by AVFoundation. It is used to query the
3066         contents of the cache in originsInMediaCache() and to clear the cache completely or partially in
3067         clearMediaCache() and clearMediaCacheForOrigins().
3068
3069         Use SecurityOrigin instead of the less formal site String to represent origins in the cache.
3070
3071         * html/HTMLMediaElement.cpp:
3072         (WebCore::sharedMediaCacheDirectory): Added.
3073         (WebCore::HTMLMediaElement::setMediaCacheDirectory): Added.
3074         (WebCore::HTMLMediaElement::mediaCacheDirectory): Added.
3075         (WebCore::HTMLMediaElement::originsInMediaCache): Added.
3076         (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
3077         (WebCore::HTMLMediaElement::clearMediaCacheForOrigins): Added.
3078         (WebCore::HTMLMediaElement::mediaPlayerMediaCacheDirectory): Added.
3079         (WebCore::HTMLMediaElement::getSitesInMediaCache): Deleted.
3080         (WebCore::HTMLMediaElement::clearMediaCacheForSite): Deleted.
3081         * html/HTMLMediaElement.h:
3082         (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
3083         * platform/graphics/MediaPlayer.cpp:
3084         (WebCore::addMediaEngine): Add new cache methods.
3085         (WebCore::addToHash): Added.
3086         (WebCore::MediaPlayer::originsInMediaCache): Added.
3087         (WebCore::MediaPlayer::clearMediaCache): Added parameter.
3088         (WebCore::MediaPlayer::clearMediaCacheForOrigins): Added.
3089         (WebCore::MediaPlayer::getSitesInMediaCache): Deleted.
3090         (WebCore::MediaPlayer::clearMediaCacheForSite): Deleted.
3091         * platform/graphics/MediaPlayer.h:
3092         (WebCore::MediaPlayerClient::mediaPlayerMediaCacheDirectory): Added.
3093         * platform/graphics/MediaPlayerPrivate.h:
3094         (WebCore::MediaPlayerPrivateInterface::originsInMediaCache): Added.
3095         (WebCore::MediaPlayerPrivateInterface::clearMediaCache): Added parameter.
3096         (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForOrigins): Added.
3097         (WebCore::MediaPlayerPrivateInterface::getSitesInMediaCache): Deleted.
3098         (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForSite): Deleted.
3099         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3100         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3101         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Added cache methods.
3102         (WebCore::assetCacheForPath): Added.
3103         (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache): Added.
3104         (WebCore::toSystemClockTime): Added.
3105         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): Added parameter.
3106         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins): Added.
3107         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Added.
3108         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3109         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3110         (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine): Added cache methods.
3111         (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache): Added.
3112         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache): Added parameter.
3113         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins): Added.
3114         (WebCore::MediaPlayerPrivateQTKit::getSitesInMediaCache): Deleted.
3115         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForSite): Deleted.
3116         * platform/spi/mac/AVFoundationSPI.h:
3117
3118 2016-04-11  Commit Queue  <commit-queue@webkit.org>
3119
3120         Unreviewed, rolling out r199310.
3121         https://bugs.webkit.org/show_bug.cgi?id=156483
3122
3123         This change turns many indexeddb tests into crashes (Requested
3124         by jwtan on #webkit).
3125
3126         Reverted changeset:
3127
3128         "Clean up IDBBindingUtilities."
3129         https://bugs.webkit.org/show_bug.cgi?id=156472
3130         http://trac.webkit.org/changeset/199310
3131
3132 2016-04-11  Commit Queue  <commit-queue@webkit.org>
3133
3134         Unreviewed, rolling out r199315.
3135         https://bugs.webkit.org/show_bug.cgi?id=156482
3136
3137         This change broke the OS X Yosemite build. (Requested by jwtan
3138         on #webkit).
3139
3140         Reverted changeset:
3141
3142         "When clearing cache, also clear AVFoundation cache."
3143         https://bugs.webkit.org/show_bug.cgi?id=155783
3144         http://trac.webkit.org/changeset/199315
3145
3146 2016-04-11  Brian Burg  <bburg@apple.com>
3147
3148         Web Inspector: get rid of InspectorBasicValue and InspectorString subclasses
3149         https://bugs.webkit.org/show_bug.cgi?id=156407
3150         <rdar://problem/25627659>
3151
3152         Reviewed by Joseph Pecoraro.
3153
3154         * inspector/InspectorDatabaseAgent.cpp: Don't use deleted subclasses.
3155
3156 2016-04-11  Commit Queue  <commit-queue@webkit.org>
3157
3158         Unreviewed, rolling out r198909.
3159         https://bugs.webkit.org/show_bug.cgi?id=156479
3160
3161         made double-click-and-drag on text drag instead of
3162         highlighting (Requested by alexchristensen_ on #webkit).
3163
3164         Reverted changeset:
3165
3166         "eventMayStartDrag() does not check for shiftKey or
3167         isOverLink"
3168         https://bugs.webkit.org/show_bug.cgi?id=155746
3169         http://trac.webkit.org/changeset/198909
3170
3171 2016-04-11  Chris Dumez  <cdumez@apple.com>
3172
3173         [WebIDL] Add support for [ImplementedAs] for EventHandler attributes
3174         https://bugs.webkit.org/show_bug.cgi?id=156421
3175
3176         Reviewed by Darin Adler.
3177
3178         Add support for [ImplementedAs] for EventHandler attributes so we can
3179         get rid of some ugly name hard-coding in the bindings generator.
3180
3181         * Modules/notifications/Notification.idl:
3182         * bindings/scripts/CodeGeneratorJS.pm:
3183         (EventHandlerAttributeEventName):
3184         * bindings/scripts/test/JS/JSTestObj.cpp:
3185         (WebCore::jsTestObjOnwebkitfoo):
3186         (WebCore::setJSTestObjOnwebkitfoo):
3187         * bindings/scripts/test/TestObj.idl:
3188         * dom/Element.idl:
3189         * page/DOMWindow.idl:
3190
3191 2016-04-11  Jeremy Jones  <jeremyj@apple.com>
3192
3193         When clearing cache, also clear AVFoundation cache.
3194         https://bugs.webkit.org/show_bug.cgi?id=155783
3195         rdar://problem/25252541
3196
3197         Reviewed by Darin Adler.
3198
3199         Use AVAssetCache at a specified location on disk for all AVURLAssets. This AVAssetCache
3200         can then be used to manage the cache storage used by AVFoundation. It is used to query the
3201         contents of the cache in originsInMediaCache() and to clear the cache completely or partially in
3202         clearMediaCache() and clearMediaCacheForOrigins().
3203
3204         Use SecurityOrigin instead of the less formal site String to represent origins in the cache.
3205
3206         * html/HTMLMediaElement.cpp:
3207         (WebCore::sharedMediaCacheDirectory): Added.
3208         (WebCore::HTMLMediaElement::setMediaCacheDirectory): Added.
3209         (WebCore::HTMLMediaElement::mediaCacheDirectory): Added.
3210         (WebCore::HTMLMediaElement::originsInMediaCache): Added.
3211         (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
3212         (WebCore::HTMLMediaElement::clearMediaCacheForOrigins): Added.
3213         (WebCore::HTMLMediaElement::mediaPlayerMediaCacheDirectory): Added.
3214         (WebCore::HTMLMediaElement::getSitesInMediaCache): Deleted.
3215         (WebCore::HTMLMediaElement::clearMediaCacheForSite): Deleted.
3216         * html/HTMLMediaElement.h:
3217         (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
3218         * platform/graphics/MediaPlayer.cpp:
3219         (WebCore::addMediaEngine): Add new cache methods.
3220         (WebCore::addToHash): Added.
3221         (WebCore::MediaPlayer::originsInMediaCache): Added.
3222         (WebCore::MediaPlayer::clearMediaCache): Added parameter.
3223         (WebCore::MediaPlayer::clearMediaCacheForOrigins): Added.
3224         (WebCore::MediaPlayer::getSitesInMediaCache): Deleted.
3225         (WebCore::MediaPlayer::clearMediaCacheForSite): Deleted.
3226         * platform/graphics/MediaPlayer.h:
3227         (WebCore::MediaPlayerClient::mediaPlayerMediaCacheDirectory): Added.
3228         * platform/graphics/MediaPlayerPrivate.h:
3229         (WebCore::MediaPlayerPrivateInterface::originsInMediaCache): Added.
3230         (WebCore::MediaPlayerPrivateInterface::clearMediaCache): Added parameter.
3231         (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForOrigins): Added.
3232         (WebCore::MediaPlayerPrivateInterface::getSitesInMediaCache): Deleted.
3233         (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForSite): Deleted.
3234         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3235         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3236         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Added cache methods.
3237         (WebCore::assetCacheForPath): Added.
3238         (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache): Added.
3239         (WebCore::toSystemClockTime): Added.
3240         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): Added parameter.
3241         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins): Added.
3242         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Added.
3243         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3244         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3245         (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine): Added cache methods.
3246         (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache): Added.
3247         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache): Added parameter.
3248         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins): Added.
3249         (WebCore::MediaPlayerPrivateQTKit::getSitesInMediaCache): Deleted.
3250         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForSite): Deleted.
3251         * platform/spi/mac/AVFoundationSPI.h:
3252
3253 2016-04-11  Antoine Quint  <graouts@apple.com>
3254
3255         [WebGL2] Use Open GL ES 3.0 to back WebGL2 contexts
3256         https://bugs.webkit.org/show_bug.cgi?id=141178
3257
3258         Reviewed by Dean Jackson.
3259
3260         We add a new `useGLES3` attribute when creating a GraphicsContext3D in the event that the
3261         context type is "webgl2". This attribute is then read by the GraphicsContext3D constructor
3262         to request an Open GL ES 3.0 backend when creating the EAGLContext on iOS.
3263
3264         * html/canvas/WebGLRenderingContextBase.cpp:
3265         (WebCore::WebGLRenderingContextBase::create):
3266         * platform/graphics/GraphicsContext3D.h:
3267         (WebCore::GraphicsContext3D::Attributes::Attributes):
3268         * platform/graphics/mac/GraphicsContext3DMac.mm:
3269         (WebCore::GraphicsContext3D::GraphicsContext3D):
3270
3271 2016-04-11  Jiewen Tan  <jiewen_tan@apple.com>
3272
3273         fast/loader/opaque-base-url.html crashing during mac and ios debug tests
3274         https://bugs.webkit.org/show_bug.cgi?id=156179
3275         <rdar://problem/25507719>
3276
3277         Reviewed by Ryosuke Niwa.
3278
3279         Navigate to about:blank if the provided src of an iframe/frame cannot be
3280         resolved to a valid URL.
3281
3282         Test: fast/loader/iframe-src-invalid-url.html
3283
3284         * loader/SubframeLoader.cpp:
3285         (WebCore::SubframeLoader::requestFrame):
3286
3287 2016-04-11  Said Abou-Hallawa  <sabouhallawa@apple,com>
3288
3289         Merge CG ImageSource and non CG ImageSource implementation in one file
3290         https://bugs.webkit.org/show_bug.cgi?id=155456
3291
3292         Reviewed by Darin Adler.
3293
3294         ImageSource for CG and CG code paths look very similar. All the platform
3295         specific code can be moved to ImageDecoder classes for CG and non CG. And
3296         we can have the ImageSource be platform independent and we get rid of
3297         ImageSourceCG.cpp.
3298
3299         Test: fast/images/image-subsampling.html
3300
3301         * CMakeLists.txt:
3302         * PlatformAppleWin.cmake:
3303         * PlatformMac.cmake:
3304         * WebCore.xcodeproj/project.pbxproj:
3305         Delete ImageSourceCG.cpp form all make files and add ImageSource.cpp to
3306         CMakeLists.txt.
3307         
3308         * platform/Cursor.cpp:
3309         (WebCore::determineHotSpot):
3310         * platform/graphics/BitmapImage.cpp:
3311         (WebCore::BitmapImage::hotSpot):
3312         (WebCore::BitmapImage::getHotSpot): Deleted.
3313         * platform/graphics/BitmapImage.h:
3314         * platform/graphics/Image.h:
3315         (WebCore::Image::hotSpot):
3316         (WebCore::Image::getHotSpot): Deleted.
3317         Rename getHotSpot() to hotSpot() and change it to return Optional<IntPoint>.
3318         
3319         * platform/graphics/ImageSource.cpp:
3320         (WebCore::ImageSource::~ImageSource): Remove clear(true) call. It does nothing.
3321         (WebCore::ImageSource::clearFrameBufferCache): A wrapper which calls ImageDecoder::clearFrameBufferCache().
3322         (WebCore::ImageSource::clear): Calls clearFrameBufferCache() which will do nothing for CG.
3323         
3324         (WebCore::ImageSource::ensureDecoderIsCreated): Change SharedBuffer* to
3325         const SharedBuffer& and remove the call to ImageDecoder::setMaxNumPixels().
3326         The value of const static int CG ImageDecoder::m_maxNumPixels will be set
3327         based on IMAGE_DECODER_DOWN_SAMPLING.
3328         
3329         (WebCore::ImageSource::setData): Pass SharedBuffer& to the underlying functions.
3330         
3331         (WebCore::ImageSource::calculateMaximumSubsamplingLevel): Returns the maximum
3332         subsampling level allowed for an image.
3333         
3334         (WebCore::ImageSource::subsamplingLevelForScale): Converts from a scale to
3335         SubsamplingLevel taking into consideration the maximumSubsamplingLevel for
3336         a particular image.
3337         
3338         (WebCore::ImageSource::bytesDecodedToDetermineProperties): Returns the number
3339         of encoded bytes which can determine the image properties. For non CG it's
3340         zero. For CG it is a maximum value which can be corrected later.
3341         
3342         (WebCore::ImageSource::isSizeAvailable):
3343         (WebCore::ImageSource::sizeRespectingOrientation):
3344         (WebCore::ImageSource::frameCount):
3345         (WebCore::ImageSource::repetitionCount):
3346         (WebCore::ImageSource::filenameExtension):
3347         (WebCore::ImageSource::getHotSpot):
3348         (WebCore::ImageSource::frameIsCompleteAtIndex):
3349         (WebCore::ImageSource::frameHasAlphaAtIndex):
3350         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
3351         (WebCore::ImageSource::frameSizeAtIndex):
3352         (WebCore::ImageSource::frameBytesAtIndex):
3353         (WebCore::ImageSource::frameDurationAtIndex):
3354         (WebCore::ImageSource::orientationAtIndex):
3355         (WebCore::ImageSource::createFrameImageAtIndex):
3356         These are wrappers for the ImageDecoder APIs. The purpose of these functions
3357         is to ensure the ImageDecoder is created.
3358         
3359         (WebCore::ImageSource::dump): Called from BitmapImage::dump().
3360         
3361         (WebCore::ImageSource::getHotSpot): Deleted.
3362         
3363         * platform/graphics/ImageSource.h:
3364         (WebCore::ImageSource::setAllowSubsampling): Called from BitmapImage::setAllowSubsampling().
3365         
3366         (WebCore::ImageSource::maxPixelsPerDecodedImage): Deleted.
3367         (WebCore::ImageSource::setMaxPixelsPerDecodedImage): Deleted.
3368         Setting maxPixelsPerDecodedImage was moved to the non CG ImageDecoder.
3369         
3370         * platform/graphics/cg/ImageDecoderCG.cpp:
3371         (WebCore::ImageDecoder::setData): Change SharedBuffer* to SharedBuffer&.
3372
3373         (WebCore::ImageDecoder::subsamplingLevelForScale): Deleted.
3374         The code was moved to ImageSource::subsamplingLevelForScale().
3375         
3376         * platform/graphics/cg/ImageDecoderCG.h:
3377         (WebCore::ImageDecoder::create): Make the prototype of this function
3378         suitable for CG and non CG cases.
3379         (WebCore::ImageDecoder::clearFrameBufferCache): Empty functions for CG.
3380         
3381         * platform/graphics/cg/ImageSourceCG.cpp: Removed.
3382         
3383         * platform/image-decoders/ImageDecoder.cpp:
3384         (WebCore::ImageDecoder::frameIsCompleteAtIndex): A mew function to return
3385         whether the frame decoding is complete or not.
3386         
3387         (WebCore::ImageDecoder::frameHasAlphaAtIndex): Simplify the logic.
3388         
3389         (WebCore::ImageDecoder::frameDurationAtIndex): The code was moved from
3390         ImageSource::frameDurationAtIndex() in ImageSource.cpp.
3391         
3392         (WebCore::ImageDecoder::createFrameImageAtIndex): The code was moved from
3393         ImageSource::createFrameImageAtIndex() in ImageSource.cpp.
3394         
3395         * platform/image-decoders/ImageDecoder.h:
3396         (WebCore::ImageDecoder::ImageDecoder): Initialize the members in class.
3397         (WebCore::ImageDecoder::~ImageDecoder): Fix the braces style.
3398         (WebCore::ImageDecoder::setData): Change the type of the argument from
3399         SharedBuffer* to SharedBuffer&.
3400         (WebCore::ImageDecoder::frameSizeAtIndex): Add the argument SubsamplingLevel
3401         so it can have the same prototype as CG.
3402         (WebCore::ImageDecoder::orientationAtIndex): Rename it to the same of CG.
3403         
3404         (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
3405         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
3406         (WebCore::ImageDecoder::subsamplingLevelForScale): Add these functions
3407         and return the default values so we do not have to add directive compiled
3408         non CG blocks in ImageSource.cpp.
3409
3410         (WebCore::ImageDecoder::hotSpot): Return Optional<IntPoint>.
3411         
3412         (WebCore::ImageDecoder::orientation): Deleted.
3413         (WebCore::ImageDecoder::setMaxNumPixels): Deleted.
3414         
3415         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
3416         (WebCore::BMPImageDecoder::setData):
3417         * platform/image-decoders/bmp/BMPImageDecoder.h:
3418         * platform/image-decoders/gif/GIFImageDecoder.cpp:
3419         (WebCore::GIFImageDecoder::setData):
3420         (WebCore::GIFImageDecoder::decode):
3421         * platform/image-decoders/gif/GIFImageDecoder.h:
3422         * platform/image-decoders/gif/GIFImageReader.h:
3423         (GIFImageReader::setData):
3424         * platform/image-decoders/ico/ICOImageDecoder.cpp:
3425         (WebCore::ICOImageDecoder::setData):
3426         Use reference SharedBuffer instead of pointer SharedBuffer.
3427         
3428         (WebCore::ICOImageDecoder::hotSpot):
3429         (WebCore::ICOImageDecoder::hotSpotAtIndex):
3430         Change hotSpot() to return Optional<IntPoint>.
3431         * platform/image-decoders/ico/ICOImageDecoder.h:
3432                 
3433         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
3434         Pass reference SharedBuffer instead of pointer SharedBuffer.
3435
3436 2016-04-08  Said Abou-Hallawa  <sabouhallawa@apple,com>
3437
3438         Timing attack on SVG feComposite filter circumvents same-origin policy
3439         https://bugs.webkit.org/show_bug.cgi?id=154338
3440
3441         Reviewed by Oliver Hunt.
3442
3443         Ensure the FEComposite arithmetic filter is clamping the resulted color
3444         components in a constant time.
3445
3446         * platform/graphics/filters/FEComposite.cpp:
3447         (WebCore::clampByte):
3448         (WebCore::computeArithmeticPixels):
3449
3450 2016-04-11  Brady Eidson  <beidson@apple.com>
3451
3452         Clean up IDBBindingUtilities.
3453         https://bugs.webkit.org/show_bug.cgi?id=156472
3454
3455         Reviewed by Alex Christensen.
3456
3457         No new tests (No change in behavior).
3458
3459         - Get rid of a whole bunch of unused functions (since we got rid of Legacy IDB).
3460         - Make more functions deal in ExecState/ScriptExecutionContexts instead of DOMRequestState.
3461         - Make more functions deal in JSValue instead of Deprecated::ScriptValue.
3462
3463         * bindings/scripts/IDLAttributes.txt: Add a new attribute to signify that an implementation returns
3464           JSValues instead of Deprecated::ScriptState
3465         * bindings/scripts/CodeGeneratorJS.pm:
3466         (NativeToJSValue): Use that new attribute.
3467         
3468         * Modules/indexeddb/IDBAny.cpp:
3469         (WebCore::IDBAny::IDBAny):
3470         (WebCore::IDBAny::scriptValue):
3471         * Modules/indexeddb/IDBAny.h:
3472         (WebCore::IDBAny::create):
3473         * Modules/indexeddb/IDBCursor.cpp:
3474         (WebCore::IDBCursor::key):
3475         (WebCore::IDBCursor::primaryKey):
3476         (WebCore::IDBCursor::value):
3477         (WebCore::IDBCursor::update):
3478         (WebCore::IDBCursor::continueFunction):
3479         (WebCore::IDBCursor::deleteFunction):
3480         (WebCore::IDBCursor::setGetResult):
3481         * Modules/indexeddb/IDBCursor.h:
3482         * Modules/indexeddb/IDBCursor.idl:
3483         * Modules/indexeddb/IDBCursorWithValue.idl:
3484         * Modules/indexeddb/IDBFactory.cpp:
3485         (WebCore::IDBFactory::cmp):
3486         * Modules/indexeddb/IDBIndex.cpp:
3487         (WebCore::IDBIndex::count):
3488         (WebCore::IDBIndex::get):
3489         (WebCore::IDBIndex::getKey):
3490         * Modules/indexeddb/IDBKeyRange.cpp:
3491         (WebCore::IDBKeyRange::lowerValue):
3492         (WebCore::IDBKeyRange::upperValue):
3493         (WebCore::IDBKeyRange::only):
3494         (WebCore::IDBKeyRange::lowerBound):
3495         (WebCore::IDBKeyRange::upperBound):
3496         (WebCore::IDBKeyRange::bound):
3497         * Modules/indexeddb/IDBKeyRange.h:
3498         * Modules/indexeddb/IDBKeyRange.idl:
3499         * Modules/indexeddb/IDBObjectStore.cpp:
3500         (WebCore::IDBObjectStore::get):
3501         (WebCore::IDBObjectStore::modernDelete):
3502         (WebCore::IDBObjectStore::count):
3503         * Modules/indexeddb/IDBRequest.cpp:
3504         (WebCore::IDBRequest::setResult):
3505         (WebCore::IDBRequest::setResultToStructuredClone):
3506         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3507         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
3508         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
3509         * bindings/js/IDBBindingUtilities.cpp:
3510         (WebCore::idbKeyPathFromValue):
3511         (WebCore::deserializeIDBValueDataToJSValue):
3512         (WebCore::scriptValueToIDBKey):
3513         (WebCore::idbKeyDataToScriptValue):
3514         (WebCore::idbKeyDataToJSValue): Deleted.
3515         (WebCore::injectIDBKeyIntoScriptValue): Deleted.
3516         (WebCore::createIDBKeyFromScriptValueAndKeyPath): Deleted.
3517         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
3518         (WebCore::canInjectIDBKeyIntoScriptValue): Deleted.
3519         (WebCore::deserializeIDBValue): Deleted.
3520         (WebCore::deserializeIDBValueData): Deleted.
3521         (WebCore::deserializeIDBValueBuffer): Deleted.
3522         (WebCore::idbValueDataToJSValue): Deleted.
3523         (WebCore::idbKeyToScriptValue): Deleted.
3524         * bindings/js/IDBBindingUtilities.h:
3525         * bindings/js/JSIDBAnyCustom.cpp:
3526         (WebCore::toJS):
3527         * bindings/js/JSIDBDatabaseCustom.cpp:
3528         (WebCore::JSIDBDatabase::createObjectStore):
3529         * bindings/js/JSIDBObjectStoreCustom.cpp:
3530         (WebCore::JSIDBObjectStore::createIndex):
3531         * dom/ScriptExecutionContext.cpp:
3532         (WebCore::ScriptExecutionContext::execState):
3533         * dom/ScriptExecutionContext.h:
3534         * inspector/InspectorIndexedDBAgent.cpp:
3535
3536 2016-04-09  Gavin Barraclough  <barraclough@apple.com>
3537
3538         WebKit should adopt journal_mode=wal for all SQLite databases.
3539         https://bugs.webkit.org/show_bug.cgi?id=133496
3540
3541         Reviewed by Darin Adler.
3542
3543         The statement intended to enable WAL mode is always failing because it is missing a
3544         prepare(). Fix this. We were also previously permitting SQLITE_OK results - this
3545         was in error (we were only getting these because stepping the unprepared statement
3546         returned SQLITE_OK). Also set the SQLITE_OPEN_AUTOPROXY flag when opening the
3547         database - this will improve perfomance when the database is accessed via an AFP
3548         mount.
3549
3550         This exposed a bug, that deleteAllDatabases does not actually delete the databases on
3551         iOS, for testing to reset back to a known state between tests it should be doing so.
3552
3553         * Modules/webdatabase/DatabaseTracker.cpp:
3554         (WebCore::DatabaseTracker::deleteAllDatabases):
3555             - force databases to actually be deleted on iOS.
3556               This method is only used from testing code (DumpRenderTree / WebKitTestRunner).
3557         (WebCore::DatabaseTracker::deleteOrigin):
3558             - added IOSDeletionMode.
3559         (WebCore::DatabaseTracker::deleteDatabaseFile):
3560             - added IOSDeletionMode, modified to actually delete if this is set.
3561         * Modules/webdatabase/DatabaseTracker.h:
3562             - added IOSDeletionMode.
3563         * platform/sql/SQLiteDatabase.cpp:
3564         (WebCore::SQLiteDatabase::open):
3565             - call prepareAndStep(), only check for SQLITE_ROW result.
3566         * platform/sql/SQLiteFileSystem.cpp:
3567         (WebCore::SQLiteFileSystem::openDatabase):
3568             - should set SQLITE_OPEN_AUTOPROXY flag when opening database.
3569
3570 2016-04-11  Zalan Bujtas  <zalan@apple.com>
3571
3572         Simplify InlineTextBox::selectionStartEnd()
3573         https://bugs.webkit.org/show_bug.cgi?id=156459
3574
3575         Reviewed by Darin Adler.
3576
3577         No change in functionality.
3578
3579         * rendering/InlineTextBox.cpp:
3580         (WebCore::InlineTextBox::selectionState):
3581         (WebCore::InlineTextBox::paint):
3582         (WebCore::InlineTextBox::selectionStartEnd):
3583         (WebCore::InlineTextBox::paintSelection):
3584         (WebCore::InlineTextBox::paintCompositionBackground):
3585         * rendering/InlineTextBox.h:
3586         * rendering/svg/SVGInlineTextBox.cpp:
3587         (WebCore::SVGInlineTextBox::paintSelectionBackground):
3588         (WebCore::SVGInlineTextBox::paintText):
3589
3590 2016-04-11  Zalan Bujtas  <zalan@apple.com>
3591
3592         REGRESSION (r193857): Text selection causes text to disappear.
3593         https://bugs.webkit.org/show_bug.cgi?id=156448
3594         rdar://problem/25578952
3595
3596         Reviewed by Simon Fraser.
3597
3598         Apparently when the end position of the selection range is smaller than the start position, we need
3599         to repaint the entire text as it indicates selection clearing.
3600
3601         Test: fast/text/text-disappear-on-deselect.html
3602
3603         * rendering/TextPainter.cpp:
3604         (WebCore::TextPainter::paintText):
3605
3606 2016-04-05  Oliver Hunt  <oliver@apple.com>
3607
3608         Remove compile time define for SEPARATED_HEAP
3609         https://bugs.webkit.org/show_bug.cgi?id=155508
3610
3611         Reviewed by Mark Lam.
3612
3613         * Configurations/FeatureDefines.xcconfig:
3614
3615 2016-04-11  Chris Dumez  <cdumez@apple.com>
3616
3617         Merge AttributedDOMTokenList into DOMTokenList
3618         https://bugs.webkit.org/show_bug.cgi?id=156468
3619
3620         Reviewed by Ryosuke Niwa.
3621
3622         Merge AttributedDOMTokenList into DOMTokenList to simplify the code.
3623         DOMTokenList is not constructible and AttributedDOMTokenList is its
3624         only constructible subclass after r196123.
3625
3626         * CMakeLists.txt:
3627         * WebCore.xcodeproj/project.pbxproj:
3628         * dom/Element.cpp:
3629         (WebCore::Element::classList):
3630         * dom/ElementRareData.h:
3631         (WebCore::ElementRareData::classList):
3632         (WebCore::ElementRareData::setClassList):
3633         * html/AttributeDOMTokenList.cpp: Removed.
3634         * html/AttributeDOMTokenList.h: Removed.
3635         * html/DOMTokenList.cpp:
3636         (WebCore::DOMTokenList::DOMTokenList):
3637         (WebCore::DOMTokenList::attributeValueChanged):
3638         (WebCore::DOMTokenList::updateAfterTokenChange):
3639         * html/DOMTokenList.h:
3640         (WebCore::DOMTokenList::ref):
3641         (WebCore::DOMTokenList::deref):
3642         (WebCore::DOMTokenList::element):
3643         (WebCore::DOMTokenList::~DOMTokenList): Deleted.
3644         (WebCore::DOMTokenList::updateAfterTokenChange): Deleted.
3645         * html/HTMLAnchorElement.cpp:
3646         (WebCore::HTMLAnchorElement::relList):
3647         * html/HTMLAnchorElement.h:
3648         * html/HTMLIFrameElement.cpp:
3649         (WebCore::HTMLIFrameElement::sandbox):
3650         * html/HTMLIFrameElement.h:
3651         * html/HTMLLinkElement.cpp:
3652         (WebCore::HTMLLinkElement::sizes):
3653         (WebCore::HTMLLinkElement::relList):
3654         * html/HTMLLinkElement.h:
3655         * html/HTMLOutputElement.cpp:
3656         (WebCore::HTMLOutputElement::htmlFor):
3657         * html/HTMLOutputElement.h:
3658
3659 2016-04-11  Chris Dumez  <cdumez@apple.com>
3660
3661         DOMTokenList.contains() should not throw
3662         https://bugs.webkit.org/show_bug.cgi?id=156453
3663
3664         Reviewed by Ryosuke Niwa.
3665
3666         DOMTokenList.contains() should not throw if the input token is invalid:
3667         https://github.com/whatwg/dom/commit/6d3076e3cbcba662489b272a718bc6b8c0082a74
3668
3669         We now return false in such cases, instead of throwing, which should be
3670         safe with regards to backward compatibility.
3671
3672         No new tests, already covered by existing tests.
3673
3674         * html/DOMTokenList.cpp:
3675         (WebCore::DOMTokenList::contains):
3676         * html/DOMTokenList.h:
3677         * html/DOMTokenList.idl:
3678
3679 2016-04-11  Frederic Wang  <fwang@igalia.com>
3680
3681         Refactor RenderMathMLFraction layout to avoid using flexbox
3682         https://bugs.webkit.org/show_bug.cgi?id=153917
3683
3684         Reviewed by Sergio Villar Senin.
3685
3686         Based on a patch by Alejandro G. Castro <alex@igalia.com>
3687
3688         Implement the layoutBlock method to handle the layout calculations
3689         directly in the class. This also fixes parsing of absolute values for
3690         linethickness attribute (e.g. 10px) and adds support for the AxisHeight
3691         and FractionRuleThickness MATH parameters.
3692
3693         Test: mathml/opentype/fraction-line.html
3694
3695         * accessibility/AccessibilityRenderObject.cpp:
3696         (WebCore::AccessibilityRenderObject::mathLineThickness): Use the thickness relative to the
3697         default line thickness since that's really what is expected by mathml-line-fraction.html
3698         * css/mathml.css: Remove flexbox properties for mfrac.
3699         (mfrac): Deleted.
3700         (mfrac > *): Deleted.
3701         (mfrac[numalign="left"] > :first-child): Deleted.
3702         (mfrac[numalign="right"] > :first-child): Deleted.
3703         (mfrac[denomalign="left"] > :last-child): Deleted.
3704         (mfrac[denomalign="right"] > :last-child): Deleted.
3705         (mfrac > :first-child): Deleted.
3706         (mfrac > :last-child): Deleted.
3707         (mfrac): Deleted.
3708         * rendering/mathml/RenderMathMLBlock.cpp: Introduce a helper function to retrieve the math
3709         axis height.
3710         (WebCore::RenderMathMLBlock::mathAxisHeight):
3711         * rendering/mathml/RenderMathMLBlock.h: Declare mathAxisHeight.
3712         * rendering/mathml/RenderMathMLFraction.cpp:
3713         (WebCore::RenderMathMLFraction::RenderMathMLFraction):
3714         (WebCore::RenderMathMLFraction::parseAlignmentAttribute): Helper function to parse the align
3715         attribute.
3716         (WebCore::RenderMathMLFraction::isValid): Helper function to verify whether the child list
3717         is valid with respect to the MathML specificitation.
3718         (WebCore::RenderMathMLFraction::numerator): Helper function to retrieve the numerator.
3719         (WebCore::RenderMathMLFraction::denominator): Helper function to retrieve the denominator.
3720         (WebCore::RenderMathMLFraction::updateFromElement): Use the FractionRuleThickness parameter
3721         when avaiable to calculate the default linethickness.
3722         Fix computation of linethickness for absolute values (e.g. 10px), the default linethickness
3723         must not be involved for such values.
3724         We no longer need to manage style of anonymous wrappers.
3725         (WebCore::RenderMathMLFraction::unembellishedOperator): Use the helper function and we no
3726         longer care about anonymous wrappers.
3727         (WebCore::RenderMathMLFraction::computePreferredLogicalWidths): Implement this function
3728         without using flexbox.
3729         (WebCore::RenderMathMLFraction::horizontalOffset): Helper function to get the horizontal
3730         offsets of children depending of the alignment.
3731         (WebCore::RenderMathMLFraction::layoutBlock): Implement this function without using flexbox.
3732         (WebCore::RenderMathMLFraction::paint): Do not paint if the fraction is invalid. Use helper
3733         function. Use the width of the renderer (instead of the one of the denominator) as the
3734         length of the fraction bar.
3735         (WebCore::RenderMathMLFraction::firstLineBaseline): Use the helper functions to get children
3736         and axis height.
3737         (WebCore::RenderMathMLFraction::paintChildren): Temporary function to remove in a
3738         follow-up patch.
3739         (WebCore::RenderMathMLFraction::fixChildStyle): Deleted. We no longer need to manage style
3740         of anonymous wrappers.
3741         (WebCore::RenderMathMLFraction::addChild): Deleted. We no longer need to manage
3742         anonymous wrappers.
3743         (WebCore::RenderMathMLFraction::styleDidChange): We no longer need to manage style of
3744         anonymous wrappers.
3745         (WebCore::RenderMathMLFraction::layout): Deleted.
3746         * rendering/mathml/RenderMathMLFraction.h: Replace lineThickness with relativeLineThickness,
3747         as needed by the accessibility code. Update function and members declarations.
3748
3749 2016-04-11  Commit Queue  <commit-queue@webkit.org>
3750
3751         Unreviewed, rolling out r199290.
3752         https://bugs.webkit.org/show_bug.cgi?id=156465
3753
3754         broke 300 tests (Requested by mcatanzaro on #webkit).
3755
3756         Reverted changeset:
3757
3758         "Merge CG ImageSource and non CG ImageSource implementation in
3759         one file"
3760         https://bugs.webkit.org/show_bug.cgi?id=155456
3761         http://trac.webkit.org/changeset/199290
3762
3763 2016-04-11  Frederic Wang  <fwang@igalia.com>
3764
3765         Refactor RenderMathMLUnderOver layout functions to avoid using flexbox
3766         https://bugs.webkit.org/show_bug.cgi?id=153742
3767
3768         Reviewed by Sergio Villar Senin.
3769
3770         Based on a patch by Javier Fernandez <jfernandez@igalia.com>
3771
3772         Refactor the UnderOver renderer to use its own layoutBlock method that
3773         does all the layout calculations without considering the flexbox
3774         restrictions.
3775
3776         * css/mathml.css:
3777         (mo, mfrac, munder, mover, munderover): Delete the underover elements from the line defining
3778         the column direction.
3779         (munder, mover, munderover): Deleted. This flexbox property is no longer needed.
3780         (mover > :last-child, munderover > :last-child): Deleted. This flexbox property is no longer
3781         needed.
3782         * rendering/mathml/RenderMathMLUnderOver.cpp:
3783         (WebCore::RenderMathMLUnderOver::firstLineBaseline): Use ascentForChild.
3784         (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Avoid stretching
3785         operators that are not stretchy.
3786         (WebCore::RenderMathMLUnderOver::isValid): Helper function to ensure that the child list is
3787         valid with respect to the MathML specification.
3788         (WebCore::RenderMathMLUnderOver::base): Added. Helper function.
3789         (WebCore::RenderMathMLUnderOver::under): Added. Helper function.
3790         (WebCore::RenderMathMLUnderOver::over): Added. Helper function.
3791         (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths): Added.
3792         The preferred width is the maximum preferred width of the base, under and over scripts.
3793         (WebCore::RenderMathMLUnderOver::horizontalOffset): Added, helper to calculate the
3794         horizontal position of children (horizontally centered).
3795         (WebCore::RenderMathMLUnderOver::layoutBlock): Added, it lays out the base, underscript and
3796         overscript. It calculates the exact logical width, which may differ from the preferred width when
3797         one child contains stretchy operators. It later sets the locations of children accordingly
3798         and sets the heigth of the render element.
3799         (WebCore::RenderMathMLUnderOver::paintChildren): Added, we have to use the usual traverse
3800         instead of the one that comes from the flexbox. This will be removed in a follow-up patch.
3801         (WebCore::RenderMathMLUnderOver::layout): Deleted.
3802         * rendering/mathml/RenderMathMLUnderOver.h: Added new functions definitions.
3803
3804 2016-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3805
3806         [GTK] Rework the theming code for GTK+ 3.20
3807         https://bugs.webkit.org/show_bug.cgi?id=156333
3808
3809         Reviewed by Michael Catanzaro.
3810
3811         During the 3.19 GTK+ release cycle, the GTK+ css system was reworked, making themes and programs rendering
3812         themed widgets, incompatible with the new system. We were trying to fix our rendering every time GTK+ broke
3813         something, but we were just changing whatever it was needed to make our rendering look like current GTK+ with
3814         the default theme Adwaita. This means that our rendering will be broken for other themes or that changes in
3815         Adwaita can break our rendering. This solution was good enough to ensure WebKitGTK+ 2.12 looked good with GTK+
3816         3.20, but it doesn't work in the long term. We need to ensure that our theming code honors the new GTK+ CSS
3817         properties (max-width, min-width, margin, padding, border, ...) in all the cases, not only the cases where
3818         Adwaita uses them like we currently do.
3819         This patch splits all rendering methods to keep the current code for previous GTK+ versions and adds new code
3820         for GTK+ >= 3.20 using the new RenderThemeGadget classes. This makes the code easier to read, since there aren't
3821         ifdef blocks in the functions, and we ensure we don't break previous rendering.
3822
3823         * PlatformGTK.cmake: Add new files to compilation.
3824         * html/shadow/SpinButtonElement.cpp:
3825         (WebCore::SpinButtonElement::defaultEventHandler): Check the button layout used by the theme to decide the
3826         current buttons state.
3827         * platform/gtk/RenderThemeGadget.cpp: Added.
3828         (WebCore::RenderThemeGadget::create):
3829         (WebCore::createStyleContext):
3830         (WebCore::appendElementToPath):
3831         (WebCore::RenderThemeGadget::RenderThemeGadget):
3832         (WebCore::RenderThemeGadget::~RenderThemeGadget):
3833         (WebCore::RenderThemeGadget::marginBox):
3834         (WebCore::RenderThemeGadget::borderBox):
3835         (WebCore::RenderThemeGadget::paddingBox):
3836         (WebCore::RenderThemeGadget::contentsBox):
3837         (WebCore::RenderThemeGadget::color):
3838         (WebCore::RenderThemeGadget::backgroundColor):
3839         (WebCore::RenderThemeGadget::minimumSize):
3840         (WebCore::RenderThemeGadget::preferredSize):
3841         (WebCore::RenderThemeGadget::render):
3842         (WebCore::RenderThemeGadget::renderFocus):
3843         (WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget):
3844         (WebCore::RenderThemeTextFieldGadget::RenderThemeTextFieldGadget):
3845         (WebCore::RenderThemeTextFieldGadget::minimumSize):
3846         (WebCore::RenderThemeToggleGadget::RenderThemeToggleGadget):
3847         (WebCore::RenderThemeToggleGadget::render):
3848         (WebCore::RenderThemeArrowGadget::RenderThemeArrowGadget):
3849         (WebCore::RenderThemeArrowGadget::render):
3850         (WebCore::RenderThemeIconGadget::RenderThemeIconGadget):
3851         (WebCore::RenderThemeIconGadget::gtkIconSizeForPixelSize):
3852         (WebCore::RenderThemeIconGadget::render):
3853         (WebCore::RenderThemeIconGadget::minimumSize):
3854         * platform/gtk/RenderThemeGadget.h: Added.
3855         (WebCore::RenderThemeGadget::context):
3856         * rendering/RenderTheme.h:
3857         (WebCore::RenderTheme::innerSpinButtonLayout): Added this method to allow themes use a different layout for the
3858         buttons.
3859         * rendering/RenderThemeGtk.cpp:
3860         (WebCore::themeChangedCallback): Just moved this code to a common place.
3861         (WebCore::RenderThemeGtk::RenderThemeGtk): Initialize the theme monitor in the constructor.
3862         (WebCore::createStyleContext): Remove the render parts that are specific to GTK+ 3.20.
3863         (WebCore::RenderThemeGtk::adjustRepaintRect): Moved inside a GTK+ < 3.20 ifdef block.
3864         (WebCore::themePartStateFlags): Helper function to get the GtkStateFlags of a theme part for a given RenderObject.
3865         (WebCore::shrinkToMinimumSizeAndCenterRectangle): Move this common code to a helper function.
3866         (WebCore::setToggleSize):
3867         (WebCore::paintToggle):
3868         (WebCore::RenderThemeGtk::paintButton):
3869         (WebCore::RenderThemeGtk::popupInternalPaddingBox):
3870         (WebCore::RenderThemeGtk::paintMenuList):
3871         (WebCore::RenderThemeGtk::adjustTextFieldStyle): For GTK+ 3.20 we need to ensure a minimum size for spin buttons,
3872         so if the text field is for a spin button, we adjust the desired size here.
3873         (WebCore::RenderThemeGtk::paintTextField): In GTK+ 3.20 the CSS gadgets used to render spin buttons are
3874         different, so we check here if this is the entry of a spin button to use the right gadgets.
3875         (WebCore::adjustSearchFieldIconStyle):
3876         (WebCore::RenderThemeGtk::paintTextArea):
3877         (WebCore::RenderThemeGtk::adjustSearchFieldResultsButtonStyle):
3878         (WebCore::RenderThemeGtk::paintSearchFieldResultsButton):