Computing animated style should not require renderers
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-09-14  Antti Koivisto  <antti@apple.com>
2
3         Computing animated style should not require renderers
4         https://bugs.webkit.org/show_bug.cgi?id=171926
5         <rdar://problem/34428035>
6
7         Reviewed by Sam Weinig.
8
9         CSS animation system is now element rather than renderer based. This allows cleaning up
10         style resolution and render tree update code.
11
12         This also fixes bug animation doesn't run if display property is animated from one rendered type
13         to another. Added a test case for this.
14
15         Test: transitions/transition-display-property-2.html
16
17         * page/animation/CSSAnimationController.cpp:
18         (WebCore::CSSAnimationController::updateAnimations):
19
20             Pass in the old style instead of getting it from the renderer.
21             Factor to return the animated style as a return value.
22
23         * page/animation/CSSAnimationController.h:
24         * rendering/RenderElement.cpp:
25         (WebCore::RenderElement::RenderElement):
26         (WebCore::RenderElement::willBeDestroyed):
27
28             Animation are now canceled by RenderTreeUpdater::tearDownRenderers.
29
30         * rendering/RenderElement.h:
31         (WebCore::RenderElement::hasInitialAnimatedStyle const): Deleted.
32         (WebCore::RenderElement::setHasInitialAnimatedStyle): Deleted.
33
34             We no longer need to this concept.
35
36         * style/RenderTreeUpdater.cpp:
37         (WebCore::RenderTreeUpdater::updateElementRenderer):
38         (WebCore::RenderTreeUpdater::createRenderer):
39
40             We now get correct animated style from style resolution in all cases so we don't need to compute
41             it separately for new renderers.
42
43         (WebCore::RenderTreeUpdater::tearDownRenderers):
44
45             Cancel animations when render tree is fully torn down. Keep them when updating style.
46
47         * style/RenderTreeUpdater.h:
48         * style/StyleTreeResolver.cpp:
49         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
50
51             We can now compute animated style without renderer. Special cases dealing with rendererless case
52             can be removed.
53
54 2017-09-14  Joseph Pecoraro  <pecoraro@apple.com>
55
56         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
57         https://bugs.webkit.org/show_bug.cgi?id=176824
58         <rdar://problem/34290931>
59
60         Reviewed by Devin Rousso.
61
62         Test: inspector/timeline/timeline-event-EventDispatch.html
63
64         * dom/EventTarget.cpp:
65         (WebCore::EventTarget::fireEventListeners):
66         * page/DOMWindow.cpp:
67         (WebCore::DOMWindow::dispatchEvent):
68         Include defaultPrevented when notifying inspector.
69
70         * inspector/InspectorInstrumentation.cpp:
71         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
72         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
73         * inspector/InspectorInstrumentation.h:
74         (WebCore::InspectorInstrumentation::didDispatchEvent):
75         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
76         Pass defaultPrevented on to agent.
77
78         * inspector/InspectorTimelineAgent.cpp:
79         (WebCore::InspectorTimelineAgent::didDispatchEvent):
80         (WebCore::InspectorTimelineAgent::didLayout):
81         (WebCore::InspectorTimelineAgent::didPaint):
82         * inspector/InspectorTimelineAgent.h:
83         * inspector/TimelineRecordFactory.cpp:
84         (WebCore::TimelineRecordFactory::appendLayoutRoot):
85         (WebCore::TimelineRecordFactory::appendDidDispatchEventData):
86         * inspector/TimelineRecordFactory.h:
87         Append a boolean defaultPrevented property on the EventDispatch timeline record's data.
88
89 2017-09-14  Ryan Haddad  <ryanhaddad@apple.com>
90
91         Unreviewed, rolling out r222015.
92
93         The LayoutTests added with this change are flaky.
94
95         Reverted changeset:
96
97         "Web Inspector: Timeline should show when events
98         preventDefault() was called on an event or not"
99         https://bugs.webkit.org/show_bug.cgi?id=176824
100         http://trac.webkit.org/changeset/222015
101
102 2017-09-14  Ms2ger  <Ms2ger@igalia.com>
103
104         Allow passing sequences to various WebGL2 methods.
105         https://bugs.webkit.org/show_bug.cgi?id=176892
106
107         Reviewed by Sam Weinig.
108
109         This matches the specification as well as Gecko and Chromium.
110
111         Test: fast/canvas/webgl/webgl2/sequences.html
112
113         * html/canvas/WebGL2RenderingContext.cpp:
114         (WebCore::WebGL2RenderingContext::uniform1uiv):
115         (WebCore::WebGL2RenderingContext::uniform2uiv):
116         (WebCore::WebGL2RenderingContext::uniform3uiv):
117         (WebCore::WebGL2RenderingContext::uniform4uiv):
118         (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
119         (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
120         (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
121         (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
122         (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
123         (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
124         (WebCore::WebGL2RenderingContext::vertexAttribI4iv):
125         (WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
126         (WebCore::WebGL2RenderingContext::clearBufferiv):
127         (WebCore::WebGL2RenderingContext::clearBufferuiv):
128         (WebCore::WebGL2RenderingContext::clearBufferfv):
129         * html/canvas/WebGL2RenderingContext.h:
130         * html/canvas/WebGL2RenderingContext.idl:
131
132 2017-09-14  Sam Weinig  <sam@webkit.org>
133
134         [Cleanup] Cleanup uses of the FileList class
135         https://bugs.webkit.org/show_bug.cgi?id=176800
136
137         Reviewed by Alex Christensen.
138
139         * fileapi/FileList.cpp:
140         * fileapi/FileList.h:
141
142             Store list of files as Refs, rather than RefPtrs.
143             Add direct accessor to the underlying Vector for faster iteration.
144             Add file(unsigned) function to allow direct indexing, rather than using
145             the DOM exposed item function which always does a length check.
146
147         * Modules/entriesapi/HTMLInputElementEntriesAPI.cpp:
148         
149             Remove unused RuntimeEnabledFeatures.h #include.
150             Use modern for loop and the new direct file vector access. 
151         
152         * bindings/js/SerializedScriptValue.cpp:
153         (WebCore::CloneSerializer::dumpIfTerminal):
154         (WebCore::CloneSerializer::write):
155         (WebCore::CloneDeserializer::readFile):
156         (WebCore::CloneDeserializer::readTerminal):
157         
158             Remove unnecessary #includes, adopt auto, and use modern for-loop
159             for FileList.
160         
161         * dom/DataTransfer.cpp:
162         (WebCore::DataTransfer::files const):
163         (WebCore::DataTransfer::hasFileOfType):
164         
165             Use auto.
166         
167         (WebCore::DataTransfer::createForInputEvent):
168         
169             Use initializer list for the typeToStringMap.
170         
171         * dom/DataTransferItemList.cpp:
172         (WebCore::DataTransferItemList::ensureItems const):
173         
174             Use auto and modern for-loop for FileList.
175         
176         * html/FileInputType.cpp:
177         (WebCore::FileInputType::filesFromFormControlState):
178         (WebCore::FileInputType::saveFormControlState const):
179         (WebCore::FileInputType::appendFormData const):
180         (WebCore::FileInputType::handleDOMActivateEvent):
181         (WebCore::FileInputType::getTypeSpecificValue):
182         (WebCore::FileInputType::disabledAttributeChanged):
183         (WebCore::FileInputType::multipleAttributeChanged):
184         (WebCore::FileInputType::setFiles):
185         (WebCore::FileInputType::receiveDroppedFiles):
186         (WebCore::FileInputType::defaultToolTip const):
187
188             Adopt auto, brace-initialization, and modern for-loops.
189
190         * html/FileListCreator.cpp:
191         (WebCore::appendDirectoryFiles):
192         (WebCore::FileListCreator::createFileList):
193         
194             Update to work in terms of Vector<Ref<File>>.
195
196         * html/FormController.h:
197         (WebCore::FormControlState::FormControlState):
198         
199             Re-format existing constructors and add one that takes an r-value
200             Vector<String> to allow construction from a pre-created list (used 
201             in FileInputType::saveFormControlState)
202         
203         * platform/DragData.h:
204         * platform/gtk/DragDataGtk.cpp:
205         (WebCore::DragData::asFilenames const):
206         * platform/mac/DragDataMac.mm:
207         (WebCore::DragData::asFilenames const):
208         * platform/win/DragDataWin.cpp:
209         (WebCore::DragData::asFilenames const):
210         
211             Convert asFilenames to return, rather than take, a Vector<String>.
212
213 2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
214
215         [Harfbuzz] Wrong offset returned by HarfBuzzShaper::offsetForPosition() when target point is at the middle of a character
216         https://bugs.webkit.org/show_bug.cgi?id=176897
217
218         Reviewed by Michael Catanzaro.
219
220         We should include the character when the point is greater than the center of the character.
221
222         Fixes: fast/multicol/hit-test-end-of-column-with-line-height.html
223                fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height.html
224
225         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
226         (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition):
227
228 2017-09-14  Yusuke Suzuki  <utatane.tea@gmail.com>
229
230         [JSC] Add PrivateSymbolMode::{Include,Exclude} for PropertyNameArray
231         https://bugs.webkit.org/show_bug.cgi?id=176867
232
233         Reviewed by Sam Weinig.
234
235         * bindings/js/JSDOMConvertRecord.h:
236         * bindings/js/SerializedScriptValue.cpp:
237         (WebCore::CloneSerializer::serialize):
238         * bridge/NP_jsobject.cpp:
239         (_NPN_Enumerate):
240
241 2017-09-14  Joseph Pecoraro  <pecoraro@apple.com>
242
243         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
244         https://bugs.webkit.org/show_bug.cgi?id=176824
245         <rdar://problem/34290931>
246
247         Reviewed by Devin Rousso.
248
249         Tests: inspector/timeline/timeline-event-CancelAnimationFrame.html
250                inspector/timeline/timeline-event-EventDispatch.html
251                inspector/timeline/timeline-event-FireAnimationFrame.html
252                inspector/timeline/timeline-event-RequestAnimationFrame.html
253                inspector/timeline/timeline-event-TimerFire.html
254                inspector/timeline/timeline-event-TimerInstall.html
255                inspector/timeline/timeline-event-TimerRemove.html
256
257         * dom/EventTarget.cpp:
258         (WebCore::EventTarget::fireEventListeners):
259         * page/DOMWindow.cpp:
260         (WebCore::DOMWindow::dispatchEvent):
261         Include defaultPrevented when notifying inspector.
262
263         * inspector/InspectorInstrumentation.cpp:
264         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
265         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
266         * inspector/InspectorInstrumentation.h:
267         (WebCore::InspectorInstrumentation::didDispatchEvent):
268         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
269         Pass defaultPrevented on to agent.
270
271         * inspector/InspectorTimelineAgent.cpp:
272         (WebCore::InspectorTimelineAgent::didDispatchEvent):
273         (WebCore::InspectorTimelineAgent::didLayout):
274         (WebCore::InspectorTimelineAgent::didPaint):
275         * inspector/InspectorTimelineAgent.h:
276         * inspector/TimelineRecordFactory.cpp:
277         (WebCore::TimelineRecordFactory::appendLayoutRoot):
278         (WebCore::TimelineRecordFactory::appendDidDispatchEventData):
279         * inspector/TimelineRecordFactory.h:
280         Append a boolean defaultPrevented property on the EventDispatch timeline record's data.
281
282 2017-09-14  Maureen Daum  <mdaum@apple.com>
283
284         Introduce the option to mark an HTML element as having AutoFill available.
285         https://bugs.webkit.org/show_bug.cgi?id=176710
286
287         Reviewed by Alex Christensen.
288
289         Introduce the option to mark an HTML element as having AutoFill available. Accessibility
290         can use this property when deciding whether to announce that the focused field offers
291         AutoFill.
292
293         * accessibility/AccessibilityObject.cpp:
294         (WebCore::AccessibilityObject::isValueAutofillAvailable const):
295         Check if the field is explicitly marked as having AutoFill available.
296         * html/HTMLInputElement.cpp:
297         (WebCore::HTMLInputElement::HTMLInputElement):
298         * html/HTMLInputElement.h:
299         (WebCore::HTMLInputElement::isAutoFillAvailable const):
300         (WebCore::HTMLInputElement::setAutoFillAvailable):
301
302 2017-09-13  Basuke Suzuki  <Basuke.Suzuki@sony.com>
303
304         [Curl] Move response related features into ResourceResponse
305         https://bugs.webkit.org/show_bug.cgi?id=174654
306
307         Reviewed by Alex Christensen.
308
309         * platform/Curl.cmake:
310         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
311         (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
312         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
313         (WebCore::isHttpRedirect): Deleted.
314         (WebCore::isHttpAuthentication): Deleted.
315         (WebCore::isHttpNotModified): Deleted.
316         (WebCore::isAppendableHeader): Deleted.
317         (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderLine): Deleted.
318         * platform/network/curl/ResourceHandleCurlDelegate.h:
319         * platform/network/curl/ResourceResponse.h:
320         (WebCore::ResourceResponse::platformSuggestedFilename const): Deleted.
321         * platform/network/curl/ResourceResponseCurl.cpp: Added.
322         (WebCore::ResourceResponse::isAppendableHeader):
323         (WebCore::ResourceResponse::appendHTTPHeaderField):
324         (WebCore::ResourceResponse::setStatusLine):
325         (WebCore::ResourceResponse::platformSuggestedFilename const):
326         (WebCore::ResourceResponse::isRedirection const):
327         (WebCore::ResourceResponse::isNotModified const):
328         (WebCore::ResourceResponse::isUnauthorized const):
329
330 2017-09-13  Zalan Bujtas  <zalan@apple.com>
331
332         Switch multicolumn's spanner map from raw over to weak pointers.
333         https://bugs.webkit.org/show_bug.cgi?id=176367
334         <rdar://problem/34254896>
335
336         Reviewed by Antti Koivisto.
337
338         Test: fast/multicol/spanner-crash-when-adding-summary.html
339
340         * rendering/RenderMultiColumnFlowThread.cpp:
341         (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
342         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
343         (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval):
344         * rendering/RenderMultiColumnFlowThread.h:
345         * rendering/RenderMultiColumnSet.cpp:
346         (WebCore::RenderMultiColumnSet::firstRendererInFlowThread const):
347         (WebCore::RenderMultiColumnSet::lastRendererInFlowThread const):
348         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
349         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
350         * rendering/RenderMultiColumnSpannerPlaceholder.h:
351
352 2017-09-13  John Wilander  <wilander@apple.com>
353
354         Introduce Storage Access API (document parts) as an experimental feature
355         https://bugs.webkit.org/show_bug.cgi?id=175759
356         <rdar://problem/34414107>
357
358         Reviewed by Alex Christensen.
359
360         Storage Access API is an experimental feature which allows cross-origin,
361         sandboxed iframes to request access to their first-party storage (as
362         opposed to partitioned storage). This might be restricted to cookies or
363         might cover all stateful mechanisms.
364
365         It introduces the following three developer-facing things:
366         - A new readonly attribute, document.hasStorageAccess.
367         - A new function, document.requestStorageAccess().
368         - A new iframe sandbox token, allow-storage-access-by-user-activation.
369
370         Tests: http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe.html
371                http/tests/storageAccess/request-and-deny-storage-access-cross-origin-sandboxed-iframe.html
372                http/tests/storageAccess/request-and-grant-storage-access-cross-origin-iframe.html
373                http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe.html
374                http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-with-unique-origin.html
375                http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-without-allow-token.html
376                http/tests/storageAccess/request-storage-access-same-origin-iframe.html
377                http/tests/storageAccess/request-storage-access-same-origin-sandboxed-iframe-without-allow-token.html
378                http/tests/storageAccess/request-storage-access-same-origin-sandboxed-iframe.html
379                http/tests/storageAccess/request-storage-access-top-frame.html
380
381         * dom/Document.cpp:
382         (WebCore::Document::requestStorageAccess):
383         * dom/Document.h:
384         (WebCore::Document::hasStorageAccess const):
385         (WebCore::Document::setUserGrantsStorageAccessOverride):
386             See comments on WebCore::Internals below.
387         * dom/Document.idl:
388         * dom/SecurityContext.cpp:
389         (WebCore::SecurityContext::isSupportedSandboxPolicy):
390         (WebCore::SecurityContext::parseSandboxPolicy):
391             Support for allow-storage-access-by-user-activation.
392         * dom/SecurityContext.h:
393         * loader/ResourceLoadObserver.cpp:
394         (WebCore::ResourceLoadObserver::registerStorageAccess):
395             Newly granted storage access is reported to 
396             WebCore::ResourceLoadObserver.
397         * loader/ResourceLoadObserver.h:
398         * loader/ResourceLoadStatistics.cpp:
399         (WebCore::encodeHashSet):
400         (WebCore::ResourceLoadStatistics::encode const):
401         (WebCore::decodeHashSet):
402         (WebCore::ResourceLoadStatistics::decode):
403         (WebCore::appendHashSet):
404         (WebCore::ResourceLoadStatistics::toString const):
405         (WebCore::mergeHashSet):
406         (WebCore::ResourceLoadStatistics::merge):
407             Storage of the new type of data.
408         * loader/ResourceLoadStatistics.h:
409         * page/Settings.in:
410         * testing/Internals.cpp:
411         (WebCore::Internals::resetToConsistentState):
412         (WebCore::Internals::setUserGrantsStorageAccess):
413         * testing/Internals.h:
414         * testing/Internals.idl:
415             Added setUserGrantsStorageAccess(). It is used to
416             override the eventSender's keyboard input which
417             always results in a cancel action on the confirm()
418             dialog.
419
420 2017-09-13  Wenson Hsieh  <wenson_hsieh@apple.com>
421
422         Submitting a form can cause HTMLFormElement's associated elements vector to be mutated during iteration
423         https://bugs.webkit.org/show_bug.cgi?id=176368
424         <rdar://problem/34254998>
425
426         Reviewed by Ryosuke Niwa.
427
428         In the process of iterating over form.associatedElements() during form submission in FormSubmission::create, the
429         page may cause us to clobber the vector of FormAssociatedElements* we're currently iterating over by inserting
430         new form controls beneath the form element we're in the process of submitting. This happens because
431         FormSubmission::create calls HTMLTextAreaElement::appendFormData, which requires layout to be up to date, which
432         in turn makes us updateLayout() and set focus, which fires a `change` event, upon which the page's JavaScript
433         inserts additonal DOM nodes into the form, modifying the vector of associated elements.
434
435         To mitigate this, instead of iterating over HTMLFormElement::associatedElements(), which returns a reference to
436         the HTMLFormElement's actual m_associatedElements vector, we iterate over a new vector of
437         Ref<FormAssociatedElement>s created from m_associatedElements.
438
439         This patch also removes an event dispatch assertion added in r212026. This assertion was added to catch any
440         other events dispatched in this scope, since dispatching events there would have had security implications, but
441         after making iteration over associated elements robust, this NoEventDispatchAssertion is no longer useful.
442
443         Test: fast/forms/append-children-during-form-submission.html
444
445         * loader/FormSubmission.cpp:
446         (WebCore::FormSubmission::create):
447
448 2017-09-13  Devin Rousso  <webkit@devinrousso.com>
449
450         Web Inspector: Event Listeners section does not update when listeners are added/removed
451         https://bugs.webkit.org/show_bug.cgi?id=170570
452         <rdar://problem/31501645>
453
454         Reviewed by Joseph Pecoraro.
455
456         Test: inspector/dom/event-listener-add-remove.html
457
458         * dom/EventTarget.cpp:
459         (WebCore::EventTarget::setAttributeEventListener):
460         Fire willRemoveEventListener/didAddEventListener events when an attribute event listener is
461         replaced by another event listener.
462
463         * inspector/InspectorDOMAgent.h:
464         * inspector/InspectorDOMAgent.cpp:
465         (WebCore::InspectorDOMAgent::didAddEventListener):
466         (WebCore::InspectorDOMAgent::willRemoveEventListener):
467         Dispatch an event to the inspector frontend whenever an event listener is added/removed.
468
469         * inspector/InspectorInstrumentation.cpp:
470         (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
471         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
472         Tie into existing instrumentation points for adding/removing event listeners.
473
474 2017-09-13  Basuke Suzuki  <Basuke.Suzuki@sony.com>
475
476         [Curl] Bug fix for synchronous transfer
477         https://bugs.webkit.org/show_bug.cgi?id=176552
478
479         Reviewed by Alex Christensen.
480
481         ResourceHandleInternal::m_delegate is null when transfer is synchronous. It should be set ResourceHandleCurlDelegate.
482         Also the callback functions called when transfer is completed is wrong.
483
484         * platform/network/curl/ResourceHandleCurl.cpp:
485         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
486         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
487         (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
488         (WebCore::ResourceHandleCurlDelegate::notifyFinish):
489         (WebCore::ResourceHandleCurlDelegate::notifyFail):
490         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
491         (WebCore::ResourceHandleCurlDelegate::didReceiveData):
492         (WebCore::ResourceHandleCurlDelegate::willSendData):
493
494 2017-09-13  Matt Lewis  <jlewis3@apple.com>
495
496         Unreviewed, rolling out r221976.
497
498         The test introduced was flaky from point of addition.
499
500         Reverted changeset:
501
502         "Introduce Storage Access API (document parts) as an
503         experimental feature"
504         https://bugs.webkit.org/show_bug.cgi?id=175759
505         http://trac.webkit.org/changeset/221976
506
507 2017-09-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
508
509         Followup (r221805): Address comments and add more tests
510         https://bugs.webkit.org/show_bug.cgi?id=176732
511
512         Reviewed by Darin Adler.
513
514         Test: http/tests/images/decode-slow-load-static-image.html
515
516         Code clean up and adding a new test to ensure multiple decode() promises
517         can be resolved or rejected simultaneously without any issues.
518
519         * loader/ImageLoader.cpp:
520         (WebCore::ImageLoader::decode):
521         (WebCore::ImageLoader::decodeError):
522         * loader/ImageLoader.h:
523         * platform/graphics/BitmapImage.cpp:
524         (WebCore::BitmapImage::decode):
525         (WebCore::BitmapImage::callDecodingCallbacks):
526         * platform/graphics/BitmapImage.h:
527
528 2017-09-13  Youenn Fablet  <youenn@apple.com>
529
530         Internals clearCacheStorageMemoryRepresentation should return a Promise
531         https://bugs.webkit.org/show_bug.cgi?id=176818
532
533         Reviewed by Alex Christensen.
534
535         No observable change of behavior.
536
537         * Modules/cache/DOMCacheEngine.h:
538         * testing/Internals.cpp:
539         (WebCore::Internals::clearCacheStorageMemoryRepresentation): Returning a promise when clearing is completed.
540         * testing/Internals.h:
541         * testing/Internals.idl:
542
543 2017-09-13  Nikita Vasilyev  <nvasilyev@apple.com>
544
545         Web Inspector: Frontend should be made to expect and handle disabled properties
546         https://bugs.webkit.org/show_bug.cgi?id=166787
547         <rdar://problem/34379593>
548
549         Reviewed by Joseph Pecoraro.
550
551         Include disabled (commented out) CSS properties in the payload.
552
553         Tests: inspector/css/css-property.html
554                inspector/css/matched-style-properties.html
555
556         * inspector/InspectorStyleSheet.cpp:
557         (WebCore::InspectorStyle::populateAllProperties const):
558         (WebCore::InspectorStyle::styleWithProperties const):
559
560 2017-09-13  Carlos Alberto Lopez Perez  <clopez@igalia.com>
561
562         [GTK] Fails to build because 'Float32Array' has not been declared in AudioContext.h
563         https://bugs.webkit.org/show_bug.cgi?id=176870
564
565         Reviewed by Konstantin Tokarev.
566
567         Add missing include of Float32Array.h
568
569         No new tests, its a build fix.
570
571         * Modules/webaudio/AudioContext.h:
572
573 2017-09-13  Andy Estes  <aestes@apple.com>
574
575         [CF] Upstream CFNetwork-related WebKitSystemInterface functions
576         https://bugs.webkit.org/show_bug.cgi?id=176729
577
578         Reviewed by Alex Christensen.
579
580         * platform/ios/WebCoreSystemInterfaceIOS.mm:
581         * platform/mac/PublicSuffixMac.mm:
582         (WebCore::isPublicSuffix):
583         * platform/mac/WebCoreSystemInterface.h:
584         * platform/mac/WebCoreSystemInterface.mm:
585         * platform/network/cf/ResourceRequestCFNet.cpp:
586         (WebCore::ResourceRequest::doUpdatePlatformRequest):
587         (WebCore::ResourceRequest::doUpdateResourceRequest):
588         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
589         (WebCore::setCONNECTProxyForStream):
590         (WebCore::SocketStreamHandleImpl::createStreams):
591         (WebCore::setCONNECTProxyAuthorizationForStream):
592         (WebCore::SocketStreamHandleImpl::addCONNECTCredentials):
593         (WebCore::copyCONNECTProxyResponse):
594         (WebCore::SocketStreamHandleImpl::readStreamCallback):
595         (WebCore::SocketStreamHandleImpl::writeStreamCallback):
596         * platform/network/cocoa/ResourceRequestCocoa.mm:
597         (WebCore::ResourceRequest::doUpdateResourceRequest):
598         (WebCore::ResourceRequest::doUpdatePlatformRequest):
599
600 2017-09-13  Antti Koivisto  <antti@apple.com>
601
602         Make more of the CSS animation system internals element based
603         https://bugs.webkit.org/show_bug.cgi?id=176832
604
605         Reviewed by Zalan Bujtas.
606
607         CSS animations animate element style. Continue moving away from renderers in the animation code.
608
609         Also do some general modernization.
610
611         * css/CSSComputedStyleDeclaration.cpp:
612         (WebCore::computeRenderStyleForProperty):
613         * page/animation/AnimationBase.cpp:
614         (WebCore::AnimationBase::AnimationBase):
615         * page/animation/AnimationBase.h:
616         * page/animation/CSSAnimationController.cpp:
617         (WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
618         (WebCore::CSSAnimationControllerPrivate::clear):
619         (WebCore::CSSAnimationControllerPrivate::updateAnimations):
620         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForElement):
621         (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
622         (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
623         (WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
624         (WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
625         (WebCore::CSSAnimationControllerPrivate::animatedStyleForElement):
626         (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
627         (WebCore::CSSAnimationController::cancelAnimations):
628         (WebCore::CSSAnimationController::updateAnimations):
629         (WebCore::CSSAnimationController::animatedStyleForRenderer):
630         (WebCore::CSSAnimationController::computeExtentOfAnimation const):
631         (WebCore::CSSAnimationController::pauseAnimationAtTime):
632         (WebCore::CSSAnimationController::pauseTransitionAtTime):
633         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer): Deleted.
634         (WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer): Deleted.
635         (WebCore::CSSAnimationController::getAnimatedStyleForRenderer): Deleted.
636         * page/animation/CSSAnimationController.h:
637         * page/animation/CSSAnimationControllerPrivate.h:
638         * page/animation/CompositeAnimation.cpp:
639         (WebCore::CompositeAnimation::~CompositeAnimation):
640         (WebCore::CompositeAnimation::clearElement):
641         (WebCore::CompositeAnimation::updateTransitions):
642         (WebCore::CompositeAnimation::updateKeyframeAnimations):
643         (WebCore::CompositeAnimation::animate):
644         (WebCore::CompositeAnimation::clearRenderer): Deleted.
645         * page/animation/CompositeAnimation.h:
646         * page/animation/ImplicitAnimation.cpp:
647         (WebCore::ImplicitAnimation::ImplicitAnimation):
648         (WebCore::ImplicitAnimation::animate):
649         * page/animation/ImplicitAnimation.h:
650         (WebCore::ImplicitAnimation::create):
651         * page/animation/KeyframeAnimation.cpp:
652         (WebCore::KeyframeAnimation::KeyframeAnimation):
653         (WebCore::KeyframeAnimation::animate):
654         * page/animation/KeyframeAnimation.h:
655         * rendering/RenderElement.cpp:
656         (WebCore::RenderElement::willBeDestroyed):
657         * rendering/RenderLayer.cpp:
658         (WebCore::RenderLayer::currentTransform const):
659         * style/RenderTreeUpdater.cpp:
660         (WebCore::RenderTreeUpdater::createRenderer):
661         * style/StyleTreeResolver.cpp:
662         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
663         * testing/Internals.cpp:
664         (WebCore::Internals::pauseAnimationAtTimeOnElement):
665         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement):
666         (WebCore::Internals::pauseTransitionAtTimeOnElement):
667         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement):
668
669 2017-09-13  Daniel Bates  <dabates@apple.com>
670
671         Make history.pushState()/replaceState() more closely aligned to the HTML standard
672         https://bugs.webkit.org/show_bug.cgi?id=176730
673         <rdar://problem/33839265>
674
675         Reviewed by Alex Christensen.
676
677         Update history.pushState()/replaceState() to more closely align with the algorithm
678         specified in <https://html.spec.whatwg.org/multipage/history.html#dom-history-pushstate-2> (9 September 2017).
679
680         Test: http/tests/security/history-pushState-replaceState-from-sandboxed-iframe.html
681
682         * page/History.cpp:
683         (WebCore::History::stateObjectAdded):
684         * page/SecurityOrigin.cpp:
685         (WebCore::SecurityOrigin::extractInnerURL): Use URL constructor that takes a base URL as opposed
686         to using the special ParsedURLString-variant because the latter can only be used to parse a string
687         returned from URL::string(). And the extracted inner URL does not meet this criterion. Using the
688         ParsedURLString-variant of the URL constructor with a string that is not the result of URL::string()
689         will cause an assertion failure in a debug build.
690
691 2017-09-13  John Wilander  <wilander@apple.com>
692
693         Introduce Storage Access API (document parts) as an experimental feature
694         https://bugs.webkit.org/show_bug.cgi?id=175759
695         <rdar://problem/33666847>
696
697         Reviewed by Alex Christensen.
698
699         Storage Access API is an experimental feature which allows cross-origin,
700         sandboxed iframes to request access to their first-party storage (as
701         opposed to partitioned storage). This might be restricted to cookies or
702         might cover all stateful mechanisms.
703
704         It introduces the following three developer-facing things:
705         - A new readonly attribute, document.hasStorageAccess.
706         - A new function, document.requestStorageAccess().
707         - A new iframe sandbox token, allow-storage-access-by-user-activation.
708
709         Tests: http/tests/loading/resourceLoadStatistics/request-and-deny-storage-access-cross-origin-iframe.html
710                http/tests/loading/resourceLoadStatistics/request-and-deny-storage-access-cross-origin-sandboxed-iframe.html
711                http/tests/loading/resourceLoadStatistics/request-and-grant-storage-access-cross-origin-iframe.html
712                http/tests/loading/resourceLoadStatistics/request-and-grant-storage-access-cross-origin-sandboxed-iframe.html
713                http/tests/loading/resourceLoadStatistics/request-storage-access-cross-origin-sandboxed-iframe-with-unique-origin.html
714                http/tests/loading/resourceLoadStatistics/request-storage-access-cross-origin-sandboxed-iframe-without-allow-token.html
715                http/tests/loading/resourceLoadStatistics/request-storage-access-same-origin-iframe.html
716                http/tests/loading/resourceLoadStatistics/request-storage-access-same-origin-sandboxed-iframe-without-allow-token.html
717                http/tests/loading/resourceLoadStatistics/request-storage-access-same-origin-sandboxed-iframe.html
718                http/tests/loading/resourceLoadStatistics/request-storage-access-top-frame.html
719
720         * dom/Document.cpp:
721         (WebCore::Document::requestStorageAccess):
722         * dom/Document.h:
723         (WebCore::Document::hasStorageAccess const):
724         (WebCore::Document::setUserGrantsStorageAccessOverride):
725             See comments on WebCore::Internals below.
726         * dom/Document.idl:
727         * dom/SecurityContext.cpp:
728         (WebCore::SecurityContext::isSupportedSandboxPolicy):
729         (WebCore::SecurityContext::parseSandboxPolicy):
730             Support for allow-storage-access-by-user-activation.
731         * dom/SecurityContext.h:
732         * loader/ResourceLoadObserver.cpp:
733         (WebCore::ResourceLoadObserver::registerStorageAccess):
734             Newly granted storage access is reported to 
735             WebCore::ResourceLoadObserver.
736         * loader/ResourceLoadObserver.h:
737         * loader/ResourceLoadStatistics.cpp:
738         (WebCore::encodeHashSet):
739         (WebCore::ResourceLoadStatistics::encode const):
740         (WebCore::decodeHashSet):
741         (WebCore::ResourceLoadStatistics::decode):
742         (WebCore::appendHashSet):
743         (WebCore::ResourceLoadStatistics::toString const):
744         (WebCore::mergeHashSet):
745         (WebCore::ResourceLoadStatistics::merge):
746             Storage of the new type of data.
747         * loader/ResourceLoadStatistics.h:
748         * page/Settings.in:
749         * testing/Internals.cpp:
750         (WebCore::Internals::resetToConsistentState):
751         (WebCore::Internals::setUserGrantsStorageAccess):
752         * testing/Internals.h:
753         * testing/Internals.idl:
754             Added setUserGrantsStorageAccess(). It is used to
755             override the eventSender's keyboard input which
756             always results in a cancel action on the confirm()
757             dialog.
758
759 2017-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
760
761         [HarfBuzz] Wrong offset returned by HarfBuzzShaper::offsetForPosition in some cases
762         https://bugs.webkit.org/show_bug.cgi?id=176848
763
764         Reviewed by Michael Catanzaro.
765
766         This patch rewrites HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition() to make it simpler and ensure we
767         return the right offset in all the cases, also honoring now the includePartialGlyphs parameter that we were
768         ignoring in FontCascade::offsetForPositionForComplexText().
769
770         Fixes several tests that started to fail after r221909.
771
772         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
773         (WebCore::FontCascade::offsetForPositionForComplexText const):
774         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
775         (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition):
776         (WebCore::HarfBuzzShaper::offsetForPosition):
777         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
778
779 2017-09-13  Per Arne Vollan  <pvollan@apple.com>
780
781         Initialize InternalSettings member variable.
782         https://bugs.webkit.org/show_bug.cgi?id=176838
783
784         Reviewed by Brent Fulgham.
785
786         Initialize the m_webVREnabled member in the constructor.
787
788         * testing/InternalSettings.cpp:
789         (WebCore::InternalSettings::Backup::Backup):
790
791 2017-09-13  Ms2ger  <Ms2ger@igalia.com>
792
793         Make WebGLRenderingContextBase::TypedList::data() const-correct.
794         https://bugs.webkit.org/show_bug.cgi?id=176833
795
796         Reviewed by Sam Weinig.
797
798         No change of behavior.
799
800         * html/canvas/WebGLRenderingContextBase.cpp:
801         (WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters):
802         * html/canvas/WebGLRenderingContextBase.h:
803         (WebCore::WebGLRenderingContextBase::TypedList::data const):
804         * platform/graphics/GraphicsContext3D.h:
805         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
806         (WebCore::GraphicsContext3D::uniform1fv):
807         (WebCore::GraphicsContext3D::uniform2fv):
808         (WebCore::GraphicsContext3D::uniform3fv):
809         (WebCore::GraphicsContext3D::uniform4fv):
810         (WebCore::GraphicsContext3D::uniform1iv):
811         (WebCore::GraphicsContext3D::uniform2iv):
812         (WebCore::GraphicsContext3D::uniform3iv):
813         (WebCore::GraphicsContext3D::uniform4iv):
814         (WebCore::GraphicsContext3D::uniformMatrix2fv):
815         (WebCore::GraphicsContext3D::uniformMatrix3fv):
816         (WebCore::GraphicsContext3D::uniformMatrix4fv):
817         (WebCore::GraphicsContext3D::vertexAttrib1fv):
818         (WebCore::GraphicsContext3D::vertexAttrib2fv):
819         (WebCore::GraphicsContext3D::vertexAttrib3fv):
820         (WebCore::GraphicsContext3D::vertexAttrib4fv):
821
822 2017-09-13  Sam Weinig  <sam@webkit.org>
823
824         Remove CanvasRenderingContext2D.commit(), it is a no-op and not part the standard
825         https://bugs.webkit.org/show_bug.cgi?id=176821
826
827         Reviewed by Darin Adler.
828
829         * html/canvas/CanvasRenderingContext2D.h:
830         * html/canvas/CanvasRenderingContext2D.idl:
831         
832             Remove the commit operation. It is no longer part the standard (it was
833             moved to OffscreenCanvasRenderingContext2D) and it was a no-op.
834
835 2017-09-12  Matt Rajca  <mrajca@apple.com>
836
837         Ensure the user interacted with the page before setting m_userHasInteractedWithMediaElement
838         https://bugs.webkit.org/show_bug.cgi?id=176816
839
840         Reviewed by Eric Carlson.
841
842         Currently, when the user presses a keyboard shortcut in the client to reload a page, that may
843         get registered as a user gesture on the reloaded page. Before setting the
844         m_userHasInteractedWithMediaElement flag, we should check if a user gesture was actually handled
845         by checking the userDidInteractWithPage flag. In case of key events that aren't handled by the
846         page, this will be set to false by EventHandler:
847
848             // If the key event was not handled, do not treat it as user interaction with the page.
849             if (topDocument && !wasHandled)
850                 topDocument->setUserDidInteractWithPage(savedUserDidInteractWithPage);
851
852         We need to revisit this in the future in webkit.org/b/176817 and ensure user gesture tokens
853         don't carry over across reloads of the page.
854
855         Tests: I wasn't able to trigger the pathological scenario this aims to fix with a test that calls
856         window.location.reload() from a synthetic keyDown event.
857
858         * dom/Document.cpp:
859         (WebCore::Document::noteUserInteractionWithMediaElement):
860
861 2017-09-13  Ms2ger  <Ms2ger@igalia.com>
862
863         Disallow passing null values to various WebGL2 methods.
864         https://bugs.webkit.org/show_bug.cgi?id=176829
865
866         Reviewed by Yusuke Suzuki.
867
868         This matches the specification as well as Gecko and Chromium.
869
870         Test: fast/canvas/webgl/webgl2/bindings.html
871
872         * html/canvas/WebGL2RenderingContext.cpp:
873         (WebCore::WebGL2RenderingContext::beginQuery):
874         (WebCore::WebGL2RenderingContext::getQueryParameter):
875         (WebCore::WebGL2RenderingContext::samplerParameteri):
876         (WebCore::WebGL2RenderingContext::samplerParameterf):
877         (WebCore::WebGL2RenderingContext::getSamplerParameter):
878         (WebCore::WebGL2RenderingContext::clientWaitSync):
879         (WebCore::WebGL2RenderingContext::waitSync):
880         (WebCore::WebGL2RenderingContext::getSyncParameter):
881         (WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
882         (WebCore::WebGL2RenderingContext::getTransformFeedbackVarying):
883         (WebCore::WebGL2RenderingContext::getUniformIndices):
884         (WebCore::WebGL2RenderingContext::getUniformBlockIndex):
885         (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter):
886         (WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
887         (WebCore::WebGL2RenderingContext::uniformBlockBinding):
888         * html/canvas/WebGL2RenderingContext.h:
889         * html/canvas/WebGL2RenderingContext.idl:
890
891 2017-09-13  Sergio Villar Senin  <svillar@igalia.com>
892
893         [WebVR] Add IDLs and stubs
894         https://bugs.webkit.org/show_bug.cgi?id=174202
895
896         Reviewed by Dean Jackson.
897
898         Adding the complete set of IDLs for the WebVR 1.1 spec including the interface stubs which
899         currently do nothing.
900
901         Tests: webvr/webvr-disabled.html
902                webvr/webvr-enabled.html
903
904         * CMakeLists.txt:
905         * DerivedSources.make:
906         * Modules/webvr/DOMWindowWebVR.idl: Added.
907         * Modules/webvr/GamepadWebVR.cpp: Added.
908         (WebCore::GamepadWebVR::GamepadWebVR):
909         (WebCore::GamepadWebVR::~GamepadWebVR):
910         (WebCore::GamepadWebVR::displayId):
911         * Modules/webvr/GamepadWebVR.h: Added.
912         * Modules/webvr/GamepadWebVR.idl: Added.
913         * Modules/webvr/NavigatorWebVR.cpp: Added.
914         (WebCore::NavigatorWebVR::getVRDisplays):
915         (WebCore::NavigatorWebVR::activeVRDisplays):
916         (WebCore::NavigatorWebVR::vrEnabled):
917         * Modules/webvr/NavigatorWebVR.h: Added.
918         * Modules/webvr/NavigatorWebVR.idl: Added.
919         * Modules/webvr/VRDisplay.cpp: Added.
920         (WebCore::VRDisplay::create):
921         (WebCore::VRDisplay::VRDisplay):
922         (WebCore::VRDisplay::isConnected const):
923         (WebCore::VRDisplay::isPresenting const):
924         (WebCore::VRDisplay::capabilities const):
925         (WebCore::VRDisplay::stageParameters const):
926         (WebCore::VRDisplay::getEyeParameters const):
927         (WebCore::VRDisplay::displayId const):
928         (WebCore::VRDisplay::displayName const):
929         (WebCore::VRDisplay::getFrameData const):
930         (WebCore::VRDisplay::getPose const):
931         (WebCore::VRDisplay::resetPose):
932         (WebCore::VRDisplay::depthNear const):
933         (WebCore::VRDisplay::setDepthNear):
934         (WebCore::VRDisplay::depthFar const):
935         (WebCore::VRDisplay::setDepthFar):
936         (WebCore::VRDisplay::requestAnimationFrame):
937         (WebCore::VRDisplay::cancelAnimationFrame):
938         (WebCore::VRDisplay::requestPresent):
939         (WebCore::VRDisplay::exitPresent):
940         (WebCore::VRDisplay::getLayers const):
941         (WebCore::VRDisplay::submitFrame):
942         (WebCore::VRDisplay::hasPendingActivity const):
943         (WebCore::VRDisplay::activeDOMObjectName const):
944         (WebCore::VRDisplay::canSuspendForDocumentSuspension const):
945         (WebCore::VRDisplay::stop):
946         * Modules/webvr/VRDisplay.h: Added.
947         * Modules/webvr/VRDisplay.idl: Added.
948         * Modules/webvr/VRDisplayCapabilities.cpp: Added.
949         (WebCore::VRDisplayCapabilities::hasPosition const):
950         (WebCore::VRDisplayCapabilities::hasOrientation const):
951         (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
952         (WebCore::VRDisplayCapabilities::canPresent const):
953         (WebCore::VRDisplayCapabilities::maxLayer const):
954         * Modules/webvr/VRDisplayCapabilities.h: Added.
955         (WebCore::VRDisplayCapabilities::create):
956         * Modules/webvr/VRDisplayCapabilities.idl: Added.
957         * Modules/webvr/VRDisplayEvent.cpp: Added.
958         (WebCore::VRDisplayEvent::VRDisplayEvent):
959         (WebCore::VRDisplayEvent::display const):
960         (WebCore::VRDisplayEvent::reason const):
961         (WebCore::VRDisplayEvent::eventInterface const):
962         * Modules/webvr/VRDisplayEvent.h: Added.
963         * Modules/webvr/VRDisplayEvent.idl: Added.
964         * Modules/webvr/VRDisplayEventReason.h: Added.
965         * Modules/webvr/VRDisplayEventReason.idl: Added.
966         * Modules/webvr/VREye.h: Added.
967         * Modules/webvr/VREye.idl: Added.
968         * Modules/webvr/VREyeParameters.cpp: Added.
969         (WebCore::VREyeParameters::VREyeParameters):
970         (WebCore::VREyeParameters::offset const):
971         (WebCore::VREyeParameters::fieldOfView const):
972         (WebCore::VREyeParameters::renderWidth const):
973         (WebCore::VREyeParameters::renderHeight const):
974         * Modules/webvr/VREyeParameters.h: Added.
975         (WebCore::VREyeParameters::create):
976         * Modules/webvr/VREyeParameters.idl: Added.
977         * Modules/webvr/VRFieldOfView.cpp: Added.
978         (WebCore::VRFieldOfView::upDegrees const):
979         (WebCore::VRFieldOfView::rightDegrees const):
980         (WebCore::VRFieldOfView::downDegrees const):
981         (WebCore::VRFieldOfView::leftDegrees const):
982         * Modules/webvr/VRFieldOfView.h: Added.
983         (WebCore::VRFieldOfView::create):
984         * Modules/webvr/VRFieldOfView.idl: Added.
985         * Modules/webvr/VRFrameData.cpp: Added.
986         (WebCore::VRFrameData::VRFrameData):
987         (WebCore::VRFrameData::timestamp const):
988         (WebCore::VRFrameData::leftProjectionMatrix const):
989         (WebCore::VRFrameData::leftViewMatrix const):
990         (WebCore::VRFrameData::rightProjectionMatrix const):
991         (WebCore::VRFrameData::rightViewMatrix const):
992         (WebCore::VRFrameData::pose const):
993         * Modules/webvr/VRFrameData.h: Added.
994         (WebCore::VRFrameData::create):
995         * Modules/webvr/VRFrameData.idl: Added.
996         * Modules/webvr/VRLayerInit.h: Added.
997         * Modules/webvr/VRLayerInit.idl: Added.
998         * Modules/webvr/VRPose.cpp: Added.
999         (WebCore::VRPose::position const):
1000         (WebCore::VRPose::linearVelocity const):
1001         (WebCore::VRPose::linearAcceleration const):
1002         (WebCore::VRPose::orientation const):
1003         (WebCore::VRPose::angularVelocity const):
1004         (WebCore::VRPose::angularAcceleration const):
1005         * Modules/webvr/VRPose.h: Added.
1006         (WebCore::VRPose::create):
1007         * Modules/webvr/VRPose.idl: Added.
1008         * Modules/webvr/VRStageParameters.cpp: Added.
1009         (WebCore::VRStageParameters::sittingToStandingTransform const):
1010         (WebCore::VRStageParameters::sizeX const):
1011         (WebCore::VRStageParameters::sizeZ const):
1012         * Modules/webvr/VRStageParameters.h: Added.
1013         (WebCore::VRStageParameters::create):
1014         * Modules/webvr/VRStageParameters.idl: Added.
1015         * WebCore.xcodeproj/project.pbxproj:
1016         * bindings/js/WebCoreBuiltinNames.h:
1017         * dom/EventNames.h:
1018         * dom/EventNames.in:
1019         * dom/EventTargetFactory.in:
1020         * features.json:
1021         * page/RuntimeEnabledFeatures.h:
1022         (WebCore::RuntimeEnabledFeatures::setWebVREnabled):
1023         (WebCore::RuntimeEnabledFeatures::webVREnabled const):
1024         * testing/InternalSettings.cpp:
1025         (WebCore::InternalSettings::Backup::restoreTo):
1026         (WebCore::InternalSettings::setWebVREnabled):
1027         * testing/InternalSettings.h:
1028         * testing/InternalSettings.idl:
1029
1030 2017-09-13  Ms2ger  <Ms2ger@igalia.com>
1031
1032         Update the type of the texture argument to framebufferTextureLayer().
1033         https://bugs.webkit.org/show_bug.cgi?id=176785
1034
1035         Reviewed by Yusuke Suzuki.
1036
1037         This matches the specification as well as Gecko and Chromium.
1038
1039         Also move getInternalformatParameter() to the position it has in the
1040         specification, for easier comparison.
1041
1042         Test: fast/canvas/webgl/webgl2/bindings.html
1043
1044         * html/canvas/WebGL2RenderingContext.cpp:
1045         (WebCore::WebGL2RenderingContext::framebufferTextureLayer):
1046         * html/canvas/WebGL2RenderingContext.h:
1047         * html/canvas/WebGL2RenderingContext.idl:
1048
1049 2017-09-13  Zan Dobersek  <zdobersek@igalia.com>
1050
1051         [EME] Implement CDMInstanceClearKey::updateLicense()
1052         https://bugs.webkit.org/show_bug.cgi?id=176791
1053
1054         Reviewed by Xabier Rodriguez-Calvar.
1055
1056         Implement the updateLicense() method for CDMInstanceClearKey.
1057         The response data is parsed as JSON, matching that agains either
1058         'license' or 'license release acknowledgement' formats (depending
1059         on either 'keys' or 'kids' object keys being present). If any
1060         format is recognized, appropriate steps are taken.
1061
1062         In case of the 'license' format, the passed-in keys are matched
1063         against existing ones. If some keys have changed or have been
1064         newly introduced, the key information is sorted by key ID size
1065         and data to enforce order. After that the KeyStatusVector object
1066         is constructed, containing key ID and status information for all
1067         the keys associated with this session. Finally callback is
1068         dispatched, signalling a successful operation and passing the
1069         KeyStatusVector, if any, back to the caller.
1070
1071         In case of the 'license release acknowledgement' format, the
1072         session data for this session ID is removed from the ClearKey state
1073         singleton. The callback is dispatched signalling the session closure
1074         and successfull completion of the operation.
1075
1076         Finally, if no format is deduced, the callback is again dispatched,
1077         but now signalling an operation failure.
1078
1079         No new tests -- expectations for the relevant tests are updated
1080         to reflect the introduced changes.
1081
1082         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1083         (WebCore::ClearKeyState::keys):
1084         (WebCore::ClearKeyState::singleton):
1085         (WebCore::parseLicenseFormat):
1086         (WebCore::parseLicenseReleaseAcknowledgementFormat):
1087         (WebCore::CDMInstanceClearKey::updateLicense):
1088
1089 2017-09-13  Ryosuke Niwa  <rniwa@webkit.org>
1090
1091         Refactor WebContentReader out of EditorMac and EditorIOS
1092         https://bugs.webkit.org/show_bug.cgi?id=176770
1093
1094         Reviewed by Sam Weinig.
1095
1096         Extracted WebContentReader.h, WebContentReaderMac.mm, and WebContentIOS.mm from Pasteboard.h,
1097         EditorMac.mm, and EditorIOS.mm respectively.
1098
1099         Also moved createFragmentAndAddResources from EditorCocoa.mm to WebContentReaderCocoa.mm
1100         and createFragmentForImageAndURL and createFragmentForImageResourceAndAddResource to markup.cpp.
1101
1102         * Configurations/WebCore.xcconfig:
1103         * PlatformMac.cmake:
1104         * WebCore.xcodeproj/project.pbxproj:
1105         * editing/Editor.cpp:
1106         (WebCore::Editor::createFragmentForImageAndURL): Deleted.
1107         * editing/Editor.h:
1108         * editing/WebContentReader.h: Added.
1109         * editing/cocoa/EditorCocoa.mm:
1110         (WebCore::Editor::replaceSelectionWithAttributedString):
1111         (WebCore::Editor::createFragment): Deleted.
1112         (WebCore::Editor::createFragmentForImageResourceAndAddResource): Deleted.
1113         (WebCore::Editor::createFragmentAndAddResources): Deleted.
1114         * editing/cocoa/WebContentReaderCocoa.mm: Added.
1115         (WebCore::createFragmentForImageResourceAndAddResource):
1116         (WebCore::createFragment):
1117         (WebCore::createFragmentAndAddResources):
1118         * editing/ios/EditorIOS.mm:
1119         (WebCore::Editor::WebContentReader): Moved to WebContentReaderIOS.mm.
1120         * editing/ios/WebContentReaderIOS.mm: Added.
1121         (WebCore::WebContentReader::addFragment):
1122         (WebCore::WebContentReader::readWebArchive):
1123         (WebCore::WebContentReader::readFilenames):
1124         (WebCore::WebContentReader::readHTML):
1125         (WebCore::WebContentReader::readRTFD):
1126         (WebCore::WebContentReader::readRTF):
1127         (WebCore::WebContentReader::readImage):
1128         (WebCore::WebContentReader::readURL):
1129         (WebCore::WebContentReader::readPlainText):
1130         * editing/mac/EditorMac.mm:
1131         (WebCore::Editor::WebContentReader): Moved to WebContentReaderMac.mm.
1132         * editing/mac/WebContentReaderMac.mm: Added.
1133         (WebCore::WebContentReader::readWebArchive):
1134         (WebCore::WebContentReader::readFilenames):
1135         (WebCore::WebContentReader::readHTML):
1136         (WebCore::WebContentReader::readRTFD):
1137         (WebCore::WebContentReader::readRTF):
1138         (WebCore::WebContentReader::readImage):
1139         (WebCore::WebContentReader::readURL):
1140         (WebCore::WebContentReader::readPlainText):
1141         * editing/markup.cpp:
1142         (WebCore::createFragmentForImageAndURL):
1143         (WebCore::createFragmentForImageResourceAndAddResource):
1144         * editing/markup.h:
1145
1146 2017-09-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1147
1148         [DFG] Optimize WeakMap::get by adding intrinsic and fixup
1149         https://bugs.webkit.org/show_bug.cgi?id=176010
1150
1151         Reviewed by Filip Pizlo.
1152
1153         * platform/network/curl/CurlJobManager.cpp:
1154         (WebCore::CurlJobList::finishJobs):
1155
1156 2017-09-12  Frederic Wang  <fwang@igalia.com>
1157
1158         Rename isRootLayer to isRenderViewLayer
1159         https://bugs.webkit.org/show_bug.cgi?id=176684
1160
1161         Reviewed by Darin Adler.
1162
1163         This patch was generated with the help of do-webcore-rename with some coding style adjustment.
1164
1165         No new tests, behavior unchanged.
1166
1167         * rendering/RenderLayer.cpp:
1168         (WebCore::RenderLayer::RenderLayer):
1169         (WebCore::RenderLayer::enclosingTransformedAncestor const):
1170         (WebCore::RenderLayer::enclosingFilterRepaintLayer const):
1171         (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
1172         (WebCore::RenderLayer::clippingRootForPainting const):
1173         (WebCore::RenderLayer::beginTransparencyLayers):
1174         (WebCore::shouldSuppressPaintingLayer):
1175         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
1176         (WebCore::RenderLayer::hitTest):
1177         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
1178         (WebCore::RenderLayer::calculateClipRects const):
1179         * rendering/RenderLayer.h:
1180         * rendering/RenderLayerBacking.cpp:
1181         (WebCore::RenderLayerBacking::RenderLayerBacking):
1182         (WebCore::RenderLayerBacking::updateConfiguration):
1183         (WebCore::RenderLayerBacking::updateAfterDescendants):
1184         (WebCore::RenderLayerBacking::paintsIntoWindow const):
1185         (WebCore::RenderLayerBacking::paintIntoLayer):
1186         * rendering/RenderLayerCompositor.cpp:
1187         (WebCore::RenderLayerCompositor::logLayerInfo):
1188         (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
1189         (WebCore::RenderLayerCompositor::updateBacking):
1190         (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
1191         (WebCore::RenderLayerCompositor::addToOverlapMap):
1192         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
1193         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1194         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed):
1195         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1196         (WebCore::RenderLayerCompositor::needsToBeComposited const):
1197         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): Also move the IOS condition
1198         up to avoid that check-webkit-style complains.
1199         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1200         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
1201         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
1202         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1203
1204 2017-09-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1205
1206         [iOS DnD] Support DataTransfer.getData and DataTransfer.setData when dragging or dropping
1207         https://bugs.webkit.org/show_bug.cgi?id=176672
1208         <rdar://problem/34353723>
1209
1210         Reviewed by Ryosuke Niwa.
1211
1212         Makes several tweaks to support DataTransfer.getData and DataTransfer.setData when dragging and dropping on iOS.
1213         See per-method changes below for more details. This patch also renames some old variable and property names
1214         along the way, so they no longer reference "data interaction", and instead refer to the feature by its post-WWDC
1215         name.
1216
1217         New test: DataInteractionTests.ExternalSourceInlineTextToFileInput
1218         Modified: DataInteractionTests.CanStartDragOnDivWithDraggableAttribute
1219                   DataInteractionTests.SinglePlainTextURLTypeIdentifiers
1220                   DataInteractionTests.SinglePlainTextWordTypeIdentifiers
1221
1222         * platform/ios/AbstractPasteboard.h:
1223         * platform/ios/PasteboardIOS.mm:
1224         (WebCore::cocoaTypeFromHTMLClipboardType):
1225
1226         In cocoaTypeFromHTMLClipboardType, map the "text/plain" MIME type to the "public.plain-text" UTI. Previously,
1227         this corresponded to "public.text", which is incorrect, since "public.text" also includes non-plain-text types
1228         such as "public.html", thereby confusing NSItemProviders. Importantly, this makes it so that plain text strings
1229         written via DataTransfer.setData() can actually be read back as a cocoa value, since "public.plain-text" is one
1230         of the UTIs in +[NSString readableTypeIdentifiersForItemProvider].
1231
1232         (WebCore::Pasteboard::writeString):
1233
1234         Instead of writing { type : data } to the pasteboard, write { cocoaType : data }. It appears that this was
1235         changed unintentionally in r156588 when upstreaming the iOS pasteboard implementation. This is made apparent by
1236         how Pasteboard::readString() requests the cocoa UTI from the platform pasteboard, but Pasteboard::writeString()
1237         sends the MIME type.
1238
1239         * platform/ios/PlatformPasteboardIOS.mm:
1240         (WebCore::PlatformPasteboard::filenamesForDataInteraction):
1241         (WebCore::PlatformPasteboard::write):
1242
1243         When writing plain text or a URL, specify that the item wants inline style representation. This prevents odd and
1244         unexpected behaviors (for instance, being able to drag plain text into the Files app as a file), but it also
1245         makes getData() not bail and return the null string on drop, due to forFileDrag() being true in
1246         DataTransfer::getData().
1247
1248         * platform/ios/WebItemProviderPasteboard.h:
1249         * platform/ios/WebItemProviderPasteboard.mm:
1250         (-[WebItemProviderRegistrationInfoList init]):
1251         (uiPreferredPresentationStyle):
1252         (-[WebItemProviderRegistrationInfoList itemProvider]):
1253
1254         Set the preferred presentation style when generating an item provider from a registration list.
1255
1256         (+[WebItemProviderLoadResult emptyLoadResult]):
1257         (+[WebItemProviderLoadResult loadResultWithFileURLMap:presentationStyle:]):
1258         (-[WebItemProviderLoadResult initWithFileURLMap:presentationStyle:]):
1259         (-[WebItemProviderLoadResult fileURLForType:]):
1260         (-[WebItemProviderLoadResult loadedFileURLs]):
1261         (-[WebItemProviderLoadResult loadedTypeIdentifiers]):
1262
1263         Introduce WebItemProviderLoadResult, an object that encapsulates information needed to represent the contents of
1264         an NSItemProvider dropped in web content. Previously, WebItemProviderPasteboard maintained an array of
1265         dictionaries of UTI => file URL, where each dictionary represents where the dropped data for a given item
1266         provider lives. Now that we additionally need to remember (for each item provider) whether we should consider
1267         its data as a file upload, it's more helpful to have a separate object representing the "load results" of a
1268         dropped item provider.
1269
1270         (-[WebItemProviderPasteboard init]):
1271         (-[WebItemProviderPasteboard pasteboardTypes]):
1272         (-[WebItemProviderPasteboard setItemProviders:]):
1273         (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
1274         (-[WebItemProviderPasteboard droppedFileURLs]):
1275
1276         Respect item provider load results that should not be exposed as a file to the page.
1277
1278         (-[WebItemProviderPasteboard numberOfFiles]):
1279
1280         Respect item providers with UIPreferredPresentationStyleInline by not counting them towards the number of files.
1281
1282         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
1283
1284         Adjust for the transition from an array of dictionaries representing loaded item providers to an array of
1285         WebItemProviderLoadResults.
1286
1287         (-[WebItemProviderPasteboard fileURLsForDataInteraction]): Deleted.
1288         * platform/mac/DragDataMac.mm:
1289         (WebCore::DragData::containsFiles const):
1290
1291         DragData::containsFiles previously only considered whether or not particular UTIs appear in the pasteboard. In
1292         the case of Mac, this is NSFilesPromisePboardType and NSFilenamesPboardType, but in the case of iOS, this is a
1293         much broader category (anything conforming to "public.content"), since files are not exposed explicitly as
1294         "promise" or "file" types in the list of registered UTIs. This caused us to always bail in
1295         DataTransfer.getData() on drop on iOS, since we will always believe there's a file on the pasteboard if there's
1296         anything conforming to "public.content" at all.
1297
1298         To fix this and simplify the code at the same time, we simply replace the currently implementation of
1299         DragData::containsFiles to return true iff the number of files is nonzero. On Mac, DragData::numberOfFiles
1300         checks the same UTIs as DragData::containsFiles (NSFilesPromisePboardType and NSFilenamesPboardType), but
1301         additionally counts the number of file URLs corresponding to those UTIs.
1302
1303         On iOS, the implementation of numberOfFiles is new to iOS 11, and relevant only in the drag and drop flow.
1304         Previously, we would consider an item provider to "contain" a file if it had a UTI conforming to one of the UTIs
1305         acceptable for drag and drop (at the time of writing, these are ["public.content", "public.zip",
1306         "public.folder"]). With this patch, anything conforming to these UTIs will continue to be represented as files,
1307         but importantly, if an item provider indicates that it should be represented inline (i.e. a plain text
1308         selection), then we don't consider that item provider as vending a file. This allows us to distinguish between
1309         cases where we are dragging a plain text selection over a file input, and when we are dragging a plain text file.
1310         In both cases, "public.plain-text" is offered as a registered UTI, but in the former, the item provider should
1311         indicate that inline presentation style is preferred. Refer to <rdar://problem/32202542> for more details.
1312
1313 2017-09-12  Joseph Pecoraro  <pecoraro@apple.com>
1314
1315         QualifiedName::init should assume AtomicStrings::init was already called
1316         https://bugs.webkit.org/show_bug.cgi?id=176639
1317
1318         Reviewed by Sam Weinig.
1319
1320         * dom/QualifiedName.cpp:
1321         (WebCore::QualifiedName::init):
1322         All callers of QualifiedName::init precede it with their own call to
1323         AtomicString::init, so QualifiedName doesn't need to do it.
1324
1325 2017-09-12  Myles C. Maxfield  <mmaxfield@apple.com>
1326
1327         Unskip fast/text/system-font-synthetic-italic.html
1328         https://bugs.webkit.org/show_bug.cgi?id=175944
1329         <rdar://problem/32864306>
1330
1331         Reviewed by Jon Lee.
1332
1333         Our buildbots now all have this symbol.
1334
1335         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
1336         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
1337
1338 2017-09-12  Myles C. Maxfield  <mmaxfield@apple.com>
1339
1340         ASSERTION FAILED: !m_valueOrException under FontFaceSet::completedLoading loading a Serious Eats page
1341         https://bugs.webkit.org/show_bug.cgi?id=175899
1342
1343         Reviewed by Tim Horton.
1344
1345         Slight style update to r221835. Also adds a test.
1346
1347         Test: fast/text/document-fonts-while-loading-crash.html
1348
1349         * css/CSSFontFaceSet.h:
1350         * css/FontFaceSet.cpp:
1351         (WebCore::FontFaceSet::FontFaceSet):
1352
1353 2017-09-12  Myles C. Maxfield  <mmaxfield@apple.com>
1354
1355         Inline ParserUtilities.h
1356         https://bugs.webkit.org/show_bug.cgi?id=176572
1357
1358         Reviewed by Darin Adler.
1359
1360         Its contents are only ever used from SVG files which also include SVGParserUtilities.h.
1361
1362         No new tests because there is no behavior change.
1363
1364         * WebCore.xcodeproj/project.pbxproj:
1365         * platform/text/ParserUtilities.h: Removed.
1366         * svg/SVGParserUtilities.h:
1367         (WebCore::skipString):
1368
1369 2017-09-12  Ryosuke Niwa  <rniwa@webkit.org>
1370
1371         Dragging & dropping a file creates an attachment element even when it's disabled
1372         https://bugs.webkit.org/show_bug.cgi?id=176769
1373
1374         Reviewed by Tim Horton.
1375
1376         The bug that dropping a file always created an attachment element even when it's disabled by settings
1377         was caused by WebContentReader::readFilenames always creating an attachment element. Fixed this by
1378         checking the runtime flag. The fix is tested by drag-files-to-editable-element-as-URLs.html
1379
1380         To fix the bug that HTMLAttachmentElement is always exposed on the global object even when it's disabled
1381         by settings, replaced the setting to enable attachment element by an equivalent runtime enabled flag,
1382         and hid both the interface as well as the element behind it. Fixed various bugs in our code generator
1383         to make this work.
1384
1385         Tests: editing/pasteboard/drag-files-to-editable-element-as-URLs.html
1386                editing/pasteboard/drag-files-to-editable-element-as-attachment.html
1387
1388         * bindings/js/WebCoreBuiltinNames.h: Added symbols used in the generated code.
1389         * dom/make_event_factory.pl:
1390         (defaultItemFactory): Replaced "runtimeConditonal" option by "runtimeEnabled".
1391         (generateImplementation):
1392         * dom/make_names.pl:
1393         (defaultTagPropertyHash):
1394         (printConstructorInterior): Return a HTMLUnknownElement if the element is disabled by a runtime flag.
1395         (printTypeHelpers): Make is<HTMLAttachmentElement>(~) returns false when the feature is disabled by
1396         checking whether the given element is an instance of HTMLUnknownElement.
1397         (printWrapperFunctions): Simplified this code by matching the code for settingsConditional.
1398         * editing/mac/EditorMac.mm:
1399         (WebCore::Editor::WebContentReader::readFilenames): Fixed the bug that this code was always creating
1400         an attachment element even when the feature is disabled.
1401         * html/HTMLAttachmentElement.idl: Hide this behind a runtime flag.
1402         * html/HTMLTagNames.in: 
1403         * page/RuntimeEnabledFeatures.h:
1404         (WebCore::RuntimeEnabledFeatures::setAttachmentElementEnabled): Added.
1405         (WebCore::RuntimeEnabledFeatures::attachmentElementEnabled const): Added.
1406         * page/Settings.in: Removed attachmentElementEnabled.
1407
1408 2017-09-12  Youenn Fablet  <youenn@apple.com>
1409
1410         Introduce a RecordData for Cache to efficiently check whether it matches a corresponding request or not
1411         https://bugs.webkit.org/show_bug.cgi?id=176579
1412
1413         Reviewed by Alex Christensen.
1414
1415         No change of behavior.
1416
1417         Introducing another version of queryCacheMatch used for the NetworkProcess implementation of the Cache.
1418         Exporting the copy of a response body to be used also there.
1419
1420         * Modules/cache/DOMCacheEngine.cpp:
1421         (WebCore::DOMCacheEngine::matchURLs):
1422         (WebCore::DOMCacheEngine::queryCacheMatch):
1423         (WebCore::DOMCacheEngine::copyResponseBody):
1424         * Modules/cache/DOMCacheEngine.h:
1425
1426 2017-09-12  Antti Koivisto  <antti@apple.com>
1427
1428         AnimationBase should point to Element instead of RenderElement
1429         https://bugs.webkit.org/show_bug.cgi?id=176807
1430
1431         Reviewed by Andreas Kling.
1432
1433         This is a step towards making animation system operate on elements and styles instead renderers.
1434
1435         No functional changes.
1436
1437         * page/animation/AnimationBase.cpp:
1438         (WebCore::AnimationBase::AnimationBase):
1439         (WebCore::AnimationBase::renderer const):
1440         (WebCore::AnimationBase::compositedRenderer const):
1441         (WebCore::AnimationBase::updateStateMachine):
1442         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
1443         (WebCore::AnimationBase::timeToNextService):
1444         (WebCore::AnimationBase::freezeAtTime):
1445         (WebCore::AnimationBase::getElapsedTime const):
1446         * page/animation/AnimationBase.h:
1447         (WebCore::AnimationBase::clear):
1448         (WebCore::AnimationBase::renderer const): Deleted.
1449         * page/animation/ImplicitAnimation.cpp:
1450         (WebCore::ImplicitAnimation::shouldSendEventForListener const):
1451         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation const):
1452         (WebCore::ImplicitAnimation::startAnimation):
1453         (WebCore::ImplicitAnimation::pauseAnimation):
1454         (WebCore::ImplicitAnimation::endAnimation):
1455         (WebCore::ImplicitAnimation::sendTransitionEvent):
1456         (WebCore::ImplicitAnimation::reset):
1457         * page/animation/KeyframeAnimation.cpp:
1458         (WebCore::KeyframeAnimation::getAnimatedStyle):
1459         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
1460         (WebCore::KeyframeAnimation::startAnimation):
1461         (WebCore::KeyframeAnimation::pauseAnimation):
1462         (WebCore::KeyframeAnimation::endAnimation):
1463         (WebCore::KeyframeAnimation::shouldSendEventForListener const):
1464         (WebCore::KeyframeAnimation::sendAnimationEvent):
1465         (WebCore::KeyframeAnimation::resolveKeyframeStyles):
1466
1467 2017-09-12  Per Arne Vollan  <pvollan@apple.com>
1468
1469         [Win] Add Modules/fetch to list of forwarding headers folders.
1470         https://bugs.webkit.org/show_bug.cgi?id=176747
1471
1472         Reviewed by Brent Fulgham.
1473
1474         * PlatformWin.cmake:
1475
1476 2017-09-12  Jer Noble  <jer.noble@apple.com>
1477
1478         [MSE] Don't increase the reported totalFrameDelay for non-displayed frames (or frames coming in while paused).
1479         https://bugs.webkit.org/show_bug.cgi?id=175900
1480
1481         Reviewed by Eric Carlson.
1482
1483         When seeking to a specific time, the decompression session necessarily needs to be fed samples from before that
1484         time (i.e., all samples from the previous I-frame forward). These shouldn't contribute to the "total frame
1485         delay" metric. Neither should samples delivered when the video is paused (like, during seeking), as a frame can't
1486         be "late" if time is not moving forward.
1487
1488         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
1489         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
1490         * platform/cf/CoreMediaSoftLink.cpp:
1491         * platform/cf/CoreMediaSoftLink.h:
1492
1493 2017-09-12  Sam Weinig  <sam@webkit.org>
1494
1495         Gtk build fix for "Finish off the FormData implementation" - https://bugs.webkit.org/show_bug.cgi?id=176659
1496
1497         * fileapi/Blob.cpp:
1498         (WebCore::Blob::Blob):
1499         * fileapi/Blob.h:
1500         * fileapi/File.cpp:
1501         (WebCore::File::File):
1502         
1503             Replace copy constructor with a tagged constructor.
1504
1505 2017-09-12  Dean Jackson  <dino@apple.com>
1506
1507         [WebGL] VideoTextureCopierCV doesn't correctly restore vertex attribute state
1508         https://bugs.webkit.org/show_bug.cgi?id=176771
1509         <rdar://problem/34386621>
1510
1511         Reviewed by Antoine Quint.
1512
1513         The OpenGL context in VideoTextureCopierCV wasn't being restored to
1514         the state it had before rendering a video to a texture. Specifically
1515         the vertex attribute values were never recorded by the state saver.
1516
1517         Update the existing test of VideoTextureCopierCV so that it is
1518         explicitly doing something different from the WebCore code, which
1519         means that state will have to be correctly restored for the test
1520         to pass.
1521
1522         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1523         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Make sure
1524         to record the vertex attribute state once we know the location of the position attribute.
1525         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
1526         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
1527         (WebCore::VideoTextureCopierCV::GC3DStateSaver::saveVertexAttribState): Save all the
1528         applicable vertex attribute state information.
1529         * platform/graphics/cv/VideoTextureCopierCV.h: GC3DStateSaver can use a reference
1530         to the GC3D rather than a pointer.
1531
1532 2017-09-12  Dean Jackson  <dino@apple.com>
1533
1534         [WebGL] accelerated texImage2D for video doesn't respect flipY
1535         https://bugs.webkit.org/show_bug.cgi?id=176491
1536         <rdar://problem/33833511>
1537
1538         Reviewed by Jer Noble.
1539
1540         (Take 2 - this was rolled out due to a test failure, but the following
1541         commit will fix that)
1542
1543         Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
1544         back to software or fail to upload texture data. Fix this by intercepting
1545         the texImage2D call, checking the orientation of the video, and running
1546         a small shader program to flip it if necessary.
1547
1548         While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
1549         none of our media decoders support video with alpha, so unfortunately
1550         this will have no visible change.
1551
1552         Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
1553                fast/canvas/webgl/texImage2D-video-flipY-true.html
1554
1555         * platform/cocoa/CoreVideoSoftLink.cpp: Add link to CVOpenGL(ES)TextureGetCleanTexCoords,
1556         which is used to check the orientation of the source video.
1557         * platform/cocoa/CoreVideoSoftLink.h:
1558
1559         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1560         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): We can
1561         now handle flipped or premultiplied requests.
1562         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1563         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): Ditto.
1564
1565         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1566         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV): Rename readFramebuffer to
1567         simply framebuffer.
1568         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV): Delete the program and buffer
1569         if they were created.
1570         (WebCore::VideoTextureCopierCV::initializeContextObjects): Sets up the shader program
1571         and the vertex buffer for drawing. Also records the location of the uniforms.
1572         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Create a new
1573         framebuffer object, and render the video texture into that framebuffer using a
1574         shader that can flip the coordinates.
1575         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver): Helper to restore
1576         the state of the user's GraphicsContext3D while we're intercepting calls.
1577         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
1578         * platform/graphics/cv/VideoTextureCopierCV.h:
1579
1580         * platform/graphics/GraphicsContext3D.h: Add two new entry points, for direct shader
1581         compilation and attribute access. This avoids going through ANGLE.
1582         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1583         (WebCore::GraphicsContext3D::compileShader):
1584         (WebCore::GraphicsContext3D::compileShaderDirect):
1585         (WebCore::GraphicsContext3D::getAttribLocationDirect):
1586
1587 2017-09-12  Manuel Rego Casasnovas  <rego@igalia.com>
1588
1589         [css-grid] Stretching auto tracks should be done as part of the track sizing algorithm
1590         https://bugs.webkit.org/show_bug.cgi?id=176783
1591
1592         Reviewed by Sergio Villar Senin.
1593
1594         CSS WG has agreed to modify the track sizing algorithm to include
1595         a new step: https://drafts.csswg.org/css-grid/#algo-stretch
1596         We used to do the stretch of the "auto" tracks at the end of
1597         the track sizing algorithm, however this change integrates it
1598         into the algorithm itself as the last step.
1599         See: https://github.com/w3c/csswg-drafts/issues/1150
1600
1601         The patch moves the method
1602         RenderGrid::applyStretchAlignmentToTracksIfNeeded() to
1603         GridTrackSizingAlgorithm::stretchAutoTracks().
1604         And then modifies the grid track sizing algorithm to execute
1605         the new step.
1606
1607         This patch uses the WPT test updated to check the new behavior.
1608
1609         * rendering/GridTrackSizingAlgorithm.cpp:
1610         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes): Initialize
1611         the list of auto tracks.
1612         (WebCore::GridTrackSizingAlgorithm::stretchFlexibleTracks): Add
1613         early return if there are not flexible tracks.
1614         (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks): Code moved from
1615         RenderGrid::applyStretchAlignmentToTracksIfNeeded().
1616         (WebCore::GridTrackSizingAlgorithm::setup): Reset list of auto tracks.
1617         (WebCore::GridTrackSizingAlgorithm::run): Add new step
1618         stretchAutoTracks().
1619         (WebCore::GridTrackSizingAlgorithm::reset): Reset auto tracks.
1620         * rendering/GridTrackSizingAlgorithm.h: Add m_autoSizedTracksIndex.
1621         * rendering/RenderGrid.cpp:
1622         (WebCore::RenderGrid::layoutBlock): Avoid applying stretch here.
1623         (WebCore::RenderGrid::contentAlignmentNormalBehaviorGrid): Make public.
1624         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): Moved to
1625         GridTrackSizingAlgorithm::stretchAutoTracks().
1626         * rendering/RenderGrid.h:
1627
1628 2017-09-12  Eric Carlson  <eric.carlson@apple.com>
1629
1630         Switch MediaPlayerPrivateAVFoundation to release logging
1631         https://bugs.webkit.org/show_bug.cgi?id=176621
1632         <rdar://problem/34335311>
1633
1634         Reviewed by Jer Noble.
1635
1636         * html/HTMLMediaElement.h:
1637         * platform/graphics/MediaPlayer.cpp:
1638         (WebCore::nullLogger):
1639         (WebCore::MediaPlayer::mediaPlayerLogger):
1640         * platform/graphics/MediaPlayer.h:
1641         (WebCore::MediaPlayerClient::mediaPlayerLogIdentifier):
1642         (WebCore::MediaPlayerClient::mediaPlayerLogger):
1643         (WebCore::MediaPlayer::mediaPlayerLogIdentifier):
1644         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1645         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
1646         (WebCore::MediaPlayerPrivateAVFoundation::~MediaPlayerPrivateAVFoundation):
1647         (WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
1648         (WebCore::MediaPlayerPrivateAVFoundation::tearDownVideoRendering):
1649         (WebCore::MediaPlayerPrivateAVFoundation::load):
1650         (WebCore::MediaPlayerPrivateAVFoundation::playabilityKnown):
1651         (WebCore::MediaPlayerPrivateAVFoundation::prepareToPlay):
1652         (WebCore::MediaPlayerPrivateAVFoundation::play):
1653         (WebCore::MediaPlayerPrivateAVFoundation::pause):
1654         (WebCore::MediaPlayerPrivateAVFoundation::durationMediaTime const):
1655         (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance):
1656         (WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize):
1657         (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable const):
1658         (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable const):
1659         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
1660         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
1661         (WebCore::MediaPlayerPrivateAVFoundation::timeChanged):
1662         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted):
1663         (WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration):
1664         (WebCore::MediaPlayerPrivateAVFoundation::setPreload):
1665         (WebCore::MediaPlayerPrivateAVFoundation::mainThreadCallback):
1666         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
1667         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
1668         (WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks):
1669         (WebCore::MediaPlayerPrivateAVFoundation::logChannel const):
1670         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1671         (WebCore::MediaPlayerPrivateAVFoundation::logClassName const):
1672         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1673         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1674         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
1675         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
1676         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1677         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
1678         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyImageGenerator):
1679         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
1680         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
1681         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1682         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1683         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1684         (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
1685         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
1686         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMedia const):
1687         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
1688         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
1689         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration const):
1690         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
1691         (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
1692         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
1693         (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus const):
1694         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
1695         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
1696         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
1697         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1698         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
1699         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
1700         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
1701         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoOutput):
1702         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
1703         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1704         (WebCore::MediaPlayerPrivateAVFoundationObjC::createOpenGLVideoOutput):
1705         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyOpenGLVideoOutput):
1706         (WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
1707         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
1708         (WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues):
1709         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
1710         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
1711         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
1712         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
1713         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
1714         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
1715         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
1716         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
1717         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
1718         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
1719         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1720         (WebCore::boolString): Deleted.
1721
1722 2017-09-12  Daniel Bates  <dabates@apple.com>
1723
1724         REGRESSION (r215784): The title of right-to-left pages are empty
1725         https://bugs.webkit.org/show_bug.cgi?id=176746
1726         <rdar://problem/34211419>
1727
1728         Reviewed by Brent Fulgham.
1729
1730         Left truncate a long right-to-left title.
1731
1732         Right-to-left text represents the visual ordering of text. Internally WebKit stores
1733         right-to-left text identically to left-to-right text in memory. So, we can use the
1734         same string operation to truncate right-to-left text as we do to truncate left-to-right
1735         text.
1736
1737         * platform/text/StringWithDirection.h:
1738         (WebCore::truncateFromEnd):
1739
1740 2017-09-12  Chris Fleizach  <cfleizach@apple.com>
1741
1742         AX: On generic container elements, WebKit should distinguish between tooltip (e.g. @title) and label (e.g. @aria-label) attributes
1743         https://bugs.webkit.org/show_bug.cgi?id=170475
1744         <rdar://problem/31439222>
1745
1746         Reviewed by Joanmarie Diggs.
1747
1748         Test: accessibility/title-tag-on-unimportant-elements-is-help-text.html
1749
1750         * accessibility/AccessibilityNodeObject.cpp:
1751         (WebCore::AccessibilityNodeObject::helpText):
1752         (WebCore::AccessibilityNodeObject::accessibilityDescription):
1753         (WebCore::AccessibilityNodeObject::roleIgnoresTitle):
1754         * accessibility/AccessibilityNodeObject.h:
1755
1756 2017-09-12  Brent Fulgham  <bfulgham@apple.com>
1757
1758         Show punycode to user if a URL mixes Armenian Seh or Vo with other scripts
1759         https://bugs.webkit.org/show_bug.cgi?id=176578
1760         <rdar://problem/33906231>
1761
1762         Reviewed by Alex Christensen.
1763
1764         Revise our "lookalike character" logic to include the Armenian Vo and Seh
1765         characters, which can be mistaken for 'n' and 'v' when displayed in
1766         certain fonts.
1767
1768         Tested by new API tests.
1769
1770         * platform/mac/WebCoreNSURLExtras.mm:
1771         (WebCore::isArmenianLookalikeCharacter): Added utility function.
1772         (WebCore::isArmenianScriptCharacter): Ditto.
1773         (WebCore::isLookalikeCharacter): Handle Armenian-lookalike cases.
1774
1775 2017-09-12  Antti Koivisto  <antti@apple.com>
1776
1777         Remove RenderElement::isCSSAnimating boolean
1778         https://bugs.webkit.org/show_bug.cgi?id=176779
1779
1780         Reviewed by Andreas Kling.
1781
1782         This optimization can be replaced with a simple style test that doesn't require keeping
1783         two sources of truth in sync.
1784
1785         * page/animation/CSSAnimationController.cpp:
1786         (WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
1787         (WebCore::CSSAnimationControllerPrivate::clear):
1788
1789             Can't test here as style might have become non-animating and we don't clear animation when that happens.
1790             This is only called on renderer destruction so it is not an important optimization.
1791
1792         (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
1793         (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
1794         (WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer):
1795         (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
1796         (WebCore::CSSAnimationController::cancelAnimations):
1797         (WebCore::CSSAnimationController::getAnimatedStyleForRenderer):
1798         (WebCore::CSSAnimationController::computeExtentOfAnimation const):
1799         (WebCore::CSSAnimationController::isRunningAnimationOnRenderer const):
1800         (WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const):
1801
1802             Test if the style has any animations. This is roughly equivalent of the old test.
1803             (it is actually somewhat better as the boolean was never cleared on style changes)
1804
1805         * rendering/RenderElement.cpp:
1806         (WebCore::RenderElement::RenderElement):
1807         * rendering/RenderElement.h:
1808         (WebCore::RenderElement::isCSSAnimating const): Deleted.
1809         (WebCore::RenderElement::setIsCSSAnimating): Deleted.
1810         * rendering/style/RenderStyle.h:
1811         (WebCore::RenderStyle::hasAnimationsOrTransitions const):
1812
1813 2017-09-12  Ms2ger  <Ms2ger@igalia.com>
1814
1815         Disallow passing null data to uniform1uiv() and friends.
1816         https://bugs.webkit.org/show_bug.cgi?id=176777
1817
1818         Reviewed by Sam Weinig.
1819
1820         This matches the specification as well as Gecko and Chromium.
1821
1822         Test: fast/canvas/webgl/webgl2/bindings.html
1823
1824         * html/canvas/WebGL2RenderingContext.idl:
1825
1826 2017-09-12  Sam Weinig  <sam@webkit.org>
1827
1828         [Cleanup] Follow up cleanup for DOMFormData implementation
1829         https://bugs.webkit.org/show_bug.cgi?id=176740
1830
1831         Reviewed by Alex Christensen.
1832
1833         - Merges FormDataList into DOMFormData.
1834         - Streamline / refactor FormData creation from DOMFormData.
1835
1836         * CMakeLists.txt:
1837         * WebCore.xcodeproj/project.pbxproj:
1838         * html/FormDataList.cpp: Removed.
1839         * html/FormDataList.h: Removed.
1840
1841             Remove FormDataList.
1842
1843         * html/DOMFormData.cpp:
1844         (WebCore::DOMFormData::DOMFormData):
1845         (WebCore::DOMFormData::createFileEntry):
1846         (WebCore::DOMFormData::append):
1847         (WebCore::DOMFormData::set):
1848         (WebCore::DOMFormData::Iterator::next):
1849         * html/DOMFormData.h:
1850         (WebCore::DOMFormData::items const):
1851         (WebCore::DOMFormData::encoding const):
1852
1853             Merge FormDataList into DOMFormData. FormDataList's additional
1854             appendData/appendBlob functions have been removed, and their
1855             functionality inlined into DOMFormData's append functions. 
1856
1857             Adopted makeKeyValuePair in DOMFormData::Iterator::next().
1858
1859         * platform/network/FormData.cpp:
1860         (WebCore::FormData::create):
1861         (WebCore::FormData::createMultiPart):
1862         (WebCore::normalizeStringData):
1863         (WebCore::FormData::appendMultiPartFileValue):
1864         (WebCore::FormData::appendMultiPartStringValue):
1865         (WebCore::FormData::appendMultiPartKeyValuePairItems):
1866         (WebCore::FormData::appendNonMultiPartKeyValuePairItems):
1867         (WebCore::FormData::appendKeyValuePairItems): Deleted.
1868         * platform/network/FormData.h:
1869
1870             Split-up appendKeyValuePairItems into separate multipart and non-multipart
1871             functions, as the two edges of the branch didn't share much in common. Further
1872             split out multipart file and multipart string appending, since they too did not
1873             share that much in common and makes the code easier to follow. 
1874
1875             String value normalization has been moved entirely here (previously it was a member 
1876             function of FormDataList) as FormData is the only user.
1877
1878         * xml/XMLHttpRequest.cpp:
1879         (WebCore::XMLHttpRequest::send):
1880         * loader/FormSubmission.cpp:
1881         (WebCore::FormSubmission::create):
1882         * Modules/fetch/FetchBody.cpp:
1883         (WebCore::FetchBody::extract):
1884         
1885             Update for new FormData create functions which don't need the
1886             encoding passed explicitly, since it is part of the DOMFormData.
1887         
1888         * html/BaseButtonInputType.cpp:
1889         * html/BaseButtonInputType.h:
1890         * html/BaseCheckableInputType.cpp:
1891         * html/BaseCheckableInputType.h:
1892         * html/FileInputType.cpp:
1893         * html/FileInputType.h:
1894         * html/FormAssociatedElement.h:
1895         * html/HTMLButtonElement.cpp:
1896         * html/HTMLButtonElement.h:
1897         * html/HTMLFormControlElement.h:
1898         * html/HTMLInputElement.cpp:
1899         * html/HTMLInputElement.h:
1900         * html/HTMLKeygenElement.cpp:
1901         * html/HTMLKeygenElement.h:
1902         * html/HTMLMeterElement.cpp:
1903         * html/HTMLObjectElement.cpp:
1904         * html/HTMLObjectElement.h:
1905         * html/HTMLSelectElement.cpp:
1906         * html/HTMLSelectElement.h:
1907         * html/HTMLTextAreaElement.cpp:
1908         * html/HTMLTextAreaElement.h:
1909         * html/HiddenInputType.cpp:
1910         * html/HiddenInputType.h:
1911         * html/ImageInputType.cpp:
1912         * html/ImageInputType.h:
1913         * html/InputType.cpp:
1914         * html/InputType.h:
1915         * html/SubmitInputType.cpp:
1916         * html/SubmitInputType.h:
1917         * html/TextFieldInputType.cpp:
1918         * html/TextFieldInputType.h:
1919
1920             Update to use DOMFormData directly, rather than the FormDataList, which 
1921             has been removed.
1922
1923         * page/csp/ContentSecurityPolicy.cpp:
1924
1925             Remove unnecessary #include of unused (and now removed) FormDataList.h
1926
1927 2017-09-12  Zan Dobersek  <zdobersek@igalia.com>
1928
1929         [EME] Implement CDMInstanceClearKey::requestLicense()
1930         https://bugs.webkit.org/show_bug.cgi?id=176773
1931
1932         Reviewed by Xabier Rodriguez-Calvar.
1933
1934         Implement the requestLicense() method for CDMInstanceClearKey. Per
1935         the specification, the session ID must be a 32-bit numerical value.
1936         A session ID value counter is thus kept in a static uint32_ object
1937         and incremented upon each call of requestLicense(). Init data and
1938         the session ID value are then embedded in the asynchronous dispatch
1939         that invokes the callback. That invocation now also passes along the
1940         init data, the session ID in string format, and Succeeded to now
1941         indicate the operation was completed successfully.
1942
1943         No new tests -- expectations for the relevant tests are updated
1944         to reflect the introduced changes.
1945
1946         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1947         (WebCore::CDMInstanceClearKey::requestLicense):
1948
1949 2017-09-12  Manuel Rego Casasnovas  <rego@igalia.com>
1950
1951         [css-grid] Use transferred size over content size for automatic minimum size
1952         https://bugs.webkit.org/show_bug.cgi?id=176688
1953
1954         Reviewed by Sergio Villar Senin.
1955
1956         CSS WG has agreed to modify the spec so now the transferred size is used
1957         (if it exists) independently if it's bigger or smaller
1958         than the content size.
1959         See: https://github.com/w3c/csswg-drafts/issues/1149
1960
1961         The spec text (https://drafts.csswg.org/css-grid/#min-size-auto):
1962           "The automatic minimum size for a grid item in a given dimension is
1963            its specified size if it exists, otherwise its transferred size
1964            if that exists, else its content size"
1965
1966         This patch use the WPT tests updated to check the new behavior.
1967
1968         * rendering/GridTrackSizingAlgorithm.cpp:
1969         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1970         Modified so it always returns the transferred size (if any).
1971
1972 2017-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
1973
1974         [Freetype] Doesn't support coloured fonts
1975         https://bugs.webkit.org/show_bug.cgi?id=156579
1976
1977         Reviewed by Michael Catanzaro.
1978
1979         Covered by existing tests. This needs a large rebaseline that will be done in follow up commits.
1980
1981         * platform/graphics/FontCascade.h: Enable advance text rendering mode by default.
1982         (WebCore::FontCascade::advancedTextRenderingMode const):
1983         (WebCore::FontCascade::computeRequiresShaping const):
1984         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1985         (WebCore::Font::platformInit): Do not get metrics from OS/2 table for non-scalable fonts.
1986         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
1987         (WebCore::harfBuzzGetGlyph): Use U8_APPEND_UNSAFE() instead of converting to a String and then encoding it with
1988         UTF8Encoding().
1989
1990 2017-09-12  Frederic Wang  <fwang@igalia.com>
1991
1992         Remove unnecessary virtual keyword from JS test files
1993         https://bugs.webkit.org/show_bug.cgi?id=176683
1994
1995         Reviewed by Simon Fraser.
1996
1997         JS bindings headers do not comply with the WebKit coding style since they use both the
1998         "virtual" and "override" keywords. This patch modifies the generator script to only use
1999         "override" and regenerates the bindings accordingly.
2000
2001         No new tests, behavior unchanged.
2002
2003         * bindings/scripts/CodeGeneratorJS.pm:
2004         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
2005         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h:
2006         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h:
2007         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
2008         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
2009         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.h:
2010
2011 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2012
2013         [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS
2014         https://bugs.webkit.org/show_bug.cgi?id=176721
2015         <rdar://problem/34373660>
2016
2017         Reviewed by Tim Horton.
2018
2019         Adds support for setting the drag lift preview frame in the case where DataTransfer.setDragImage is being used
2020         to override the default drag preview. Currently, the frame of the drag preview we supply in this case is the
2021         same as the bounds of the source element in root view coordinates, but this means that any custom drag image
2022         the page supplies will be stretched to fill the frame of the source element. Instead, when handling a DHTML drag,
2023         position the lift and cancel drag previews relative to the event location, respecting any drag offset specified
2024         in setDragImage. The size of this preview matches the size of the drag image source (since this is all in root
2025         view coordinates, this means the drag preview will also enlarge if the user pinches to zoom in). If a
2026         disconnected image source element was provided, then we just fall back to the image size.
2027
2028         Additionally, renames DragItem's elementBounds to dragPreviewFrameInRootViewCoordinates to better reflect the
2029         purpose of this variable. This patch also introduces API test plumbing to grab targeted drag previews from the
2030         drag interaction delegate (i.e. WKContentView), and uses this in a new API test that checks the frame of the
2031         resulting UITargetedDragPreview after initiating a drag in various circumstances (see changes in Tools/ for more
2032         detail).
2033
2034         Test: DataInteractionTests.DragLiftPreviewDataTransferSetDragImage
2035
2036         * dom/DataTransfer.cpp:
2037         (WebCore::DataTransfer::dragImageElement const):
2038         * dom/DataTransfer.h:
2039         * page/DragController.cpp:
2040         (WebCore::dragLocForDHTMLDrag):
2041
2042         The logic to flip the y offset when computing the drag location is only relevant on Mac, but currently, this is
2043         guarded by #if PLATFORM(COCOA), which causes the y offset to shift the drag image in the opposite direction on
2044         iOS. To fix this, simply change the platform define to Mac.
2045
2046         (WebCore::DragController::doSystemDrag):
2047         * platform/DragItem.h:
2048         (WebCore::DragItem::encode const):
2049         (WebCore::DragItem::decode):
2050
2051 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2052
2053         [iOS WK2] Support tapping to add items to the current drag session in web content
2054         https://bugs.webkit.org/show_bug.cgi?id=176421
2055         <rdar://problem/31144674>
2056
2057         Reviewed by Tim Horton.
2058
2059         Refactors some drag initiation logic to handle starting a drag when data has already been written to the
2060         pasteboard (in the case of iOS, WebItemProviderPasteboard). See annotated comments below for more detail.
2061
2062         Tests: DataInteractionTests.AdditionalLinkAndImageIntoContentEditable
2063
2064         * page/DragActions.h:
2065         * page/DragController.cpp:
2066         (WebCore::DragController::startDrag):
2067
2068         Add a HasNonDefaultPasteboardData argument here, and replace checks for !dataTransfer.pasteboard().hasData()
2069         with checks for whether the argument is HasNonDefaultPasteboardData::No. These checks for Pasteboard::hasData()
2070         currently prevent us from overwriting custom pasteboard data, in the case that the page has written pasteboard
2071         data using the event's DataTransfer. However, in the case of adding additional drag items to the session, we
2072         will already have pasteboard data, so these checks will prevent us from writing default data to the pasteboard.
2073         See EventHandler::handleDrag for more detail.
2074
2075         * page/DragController.h:
2076         * page/DragState.h:
2077
2078         Remove the draggedContentRange member from DragState. See below.
2079
2080         * page/EventHandler.cpp:
2081         (WebCore::removeDraggedContentDocumentMarkersFromAllFramesInPage):
2082
2083         Simplify the handling of dragged content range markers. Instead of storing the DOM Range being dragged and
2084         removing/repainting the range after dragging ends, just repaint the contentRenderer of the frame being dragged.
2085         When the dragging session has completely ended, remove all dragged content ranges from the page's mainframe and
2086         all of its subframes, and repaint everything.
2087
2088         (WebCore::EventHandler::dragCancelled):
2089         (WebCore::EventHandler::didStartDrag):
2090         (WebCore::EventHandler::dragSourceEndedAt):
2091
2092         Add a MayExtendDragSession argument, indicating whether or not the web process will attempt to continue the drag
2093         session, in which case EventHandler::dragSourceEndedAt should not remove any existing dragged content range
2094         document markers.
2095
2096         (WebCore::EventHandler::dispatchDragStartEvent):
2097
2098         Helper method to dispatch a `dragstart` event, return whether or not to proceed with the drag, and also compute
2099         (as an outparam) whether or not custom pasteboard data was written during the event.
2100
2101         (WebCore::EventHandler::handleDrag):
2102
2103         If custom data was written during `dragstart`, pass along HasNonDefaultPasteboardData::Yes when calling
2104         DragController::startDrag.
2105
2106         (WebCore::repaintContentsOfRange): Deleted.
2107         * page/EventHandler.h:
2108         * page/ios/EventHandlerIOS.mm:
2109         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
2110         * platform/Pasteboard.h:
2111         * platform/ios/PasteboardIOS.mm:
2112         (WebCore::Pasteboard::changeCount const):
2113         * platform/ios/WebItemProviderPasteboard.mm:
2114         (-[WebItemProviderPasteboard setItemProviders:]):
2115
2116         Stop clearing out the staged item provider registration list when setting item providers. After refactoring in
2117         r221595, staged registration lists are now automatically cleared out when (1) the drag-and-drop interaction
2118         state is cleared out in the UI process, or (2) when the registration list is taken by WKContentView (see
2119         -takeRegistrationList) when generating an item provider.
2120
2121         * platform/mac/PasteboardMac.mm:
2122         (WebCore::Pasteboard::changeCount const):
2123
2124         Add a changeCount method to Pasteboard on Cocoa platforms (Mac, iOS) which support changeCount natively. In
2125         theory, there's no reason Windows, GTK and WPE ports can't also implement a similar mechanism in
2126         PlatformPasteboard, but this isn't needed for anything yet. Upon dragstart, it is safe to assume that the
2127         pasteboard has been cleared on these platforms, so checking for Pasteboard::hasData (as we do for all platforms
2128         currently) is sufficient.
2129
2130 2017-09-11  Ryan Haddad  <ryanhaddad@apple.com>
2131
2132         Unreviewed, rolling out r221762.
2133
2134         This change caused flakiness in a webgl LayoutTest.
2135
2136         Reverted changeset:
2137
2138         "[WebGL] accelerated texImage2D for video doesn't respect
2139         flipY"
2140         https://bugs.webkit.org/show_bug.cgi?id=176491
2141         http://trac.webkit.org/changeset/221762
2142
2143 2017-09-11  Per Arne Vollan  <pvollan@apple.com>
2144
2145         [Win] Add Modules/cache to list of forwarding headers folders.
2146         https://bugs.webkit.org/show_bug.cgi?id=176737
2147
2148         Reviewed by Alex Christensen.
2149
2150         * PlatformWin.cmake:
2151
2152 2017-09-11  Joanmarie Diggs  <jdiggs@igalia.com>
2153
2154         AX: [ATK] aria-autocomplete not exposed on comboboxes
2155         https://bugs.webkit.org/show_bug.cgi?id=176724
2156
2157         Reviewed by Chris Fleizach.
2158
2159         Add a check to AccessibilityObject::supportsARIAAutoComplete() for
2160         combobox because isARIATextControl() returns false for that role.
2161
2162         Add new combobox test cases to existing aria-autocomplete.html test.
2163
2164         * accessibility/AccessibilityObject.cpp:
2165         (WebCore::AccessibilityObject::supportsARIAAutoComplete const):
2166
2167 2017-09-11  Ryan Haddad  <ryanhaddad@apple.com>
2168
2169         Unreviewed, rolling out r221854.
2170
2171         The test added with this change fails on 32-bit JSC bots.
2172
2173         Reverted changeset:
2174
2175         "[DFG] Optimize WeakMap::get by adding intrinsic and fixup"
2176         https://bugs.webkit.org/show_bug.cgi?id=176010
2177         http://trac.webkit.org/changeset/221854
2178
2179 2017-09-11  Dean Jackson  <dino@apple.com>
2180
2181         [WebGL macOS] No need to multisample when blitting into WebGLLayer
2182         https://bugs.webkit.org/show_bug.cgi?id=176666
2183         <rdar://problem/27774626>
2184
2185         Reviewed by Sam Weinig.
2186
2187         We were seeing performance profiles suggesting WebGL was
2188         doing 8x MSAA, even though we explicitly set it to only
2189         use 4 samples in the GLPixelFormatObj used to create
2190         the WebGL CGLContextObj. However, that same CGLPixelFormatObj
2191         was also used for the WebGLLayer's CGLContextObj, meaning the
2192         blit of the WebGL FBO into the WebGLLayer's backing store was
2193         multisampling as well -- so an extra 4 samples on top of the
2194         original 4, making it look like we were doing 8x.
2195
2196         This was obviously unnecessary, since we already have the
2197         multisampled FBO and just want to copy it, as is, into the layer.
2198
2199         Now, instead of copying the CGLPixelFormatObj, we create
2200         a new one and copy most of the attributes, leaving out
2201         the multisample flags (and the depth buffer, since we're
2202         only doing 2d blits).
2203
2204         Covered by existing WebGL tests, since there should be no
2205         visible change.
2206
2207         * platform/graphics/cocoa/WebGLLayer.mm:
2208         (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Create a new
2209         CGLPixelFormatObj that copies most of the values from
2210         the corresponding object on the WebGL's backing CGLContextObj.
2211
2212 2017-09-11  Zan Dobersek  <zdobersek@igalia.com>
2213
2214         [EME] ClearKey: implement CDMInstanceClearKey state modifiers, callback dispatches
2215         https://bugs.webkit.org/show_bug.cgi?id=176687
2216
2217         Reviewed by Xabier Rodriguez-Calvar.
2218
2219         Implement the state modification methods on the CDMInstanceClearKey class.
2220         Initialization method is a no-op, but returns Succeeded. Distinctive
2221         identifier and persistent state setters return Succeeded if the passed-in
2222         value is false. setServerCertificate() still returns Failed due to server
2223         certificates not being supported in this ClearKey implementation.
2224
2225         The license and session operation methods are also implemented, but for
2226         now the implementations simply schedule a main thread dispatch that
2227         invokes the callback with failure-indicating values. This avoids various
2228         tests timing out, instead preferring that the tests for now fail with an
2229         exception (in most cases NotSupportedError).
2230
2231         No new tests -- relevant tests have baselines updated.
2232
2233         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2234         (WebCore::CDMInstanceClearKey::CDMInstanceClearKey):
2235         (WebCore::CDMInstanceClearKey::initializeWithConfiguration):
2236         (WebCore::CDMInstanceClearKey::setDistinctiveIdentifiersAllowed):
2237         (WebCore::CDMInstanceClearKey::setPersistentStateAllowed):
2238         (WebCore::CDMInstanceClearKey::setServerCertificate):
2239         (WebCore::CDMInstanceClearKey::requestLicense):
2240         (WebCore::CDMInstanceClearKey::updateLicense):
2241         (WebCore::CDMInstanceClearKey::loadSession):
2242         (WebCore::CDMInstanceClearKey::closeSession):
2243         (WebCore::CDMInstanceClearKey::removeSessionData):
2244         * platform/encryptedmedia/clearkey/CDMClearKey.h:
2245
2246 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2247
2248         Modernize BoxExtent into RectEdges
2249         https://bugs.webkit.org/show_bug.cgi?id=176437
2250
2251         Reviewed by Simon Fraser.
2252
2253         And give it its own header.
2254         No change in behavior.
2255
2256         * WebCore.xcodeproj/project.pbxproj:
2257         * css/CSSProperty.cpp:
2258         (WebCore::resolveToPhysicalProperty):
2259         (WebCore::CSSProperty::resolveDirectionAwareProperty):
2260         * platform/LengthBox.h:
2261         (WebCore::LengthBox::LengthBox):
2262         (WebCore::BoxExtent::BoxExtent): Deleted.
2263         (WebCore::BoxExtent::at): Deleted.
2264         (WebCore::BoxExtent::top): Deleted.
2265         (WebCore::BoxExtent::right): Deleted.
2266         (WebCore::BoxExtent::bottom): Deleted.
2267         (WebCore::BoxExtent::left): Deleted.
2268         (WebCore::BoxExtent::at const): Deleted.
2269         (WebCore::BoxExtent::top const): Deleted.
2270         (WebCore::BoxExtent::right const): Deleted.
2271         (WebCore::BoxExtent::bottom const): Deleted.
2272         (WebCore::BoxExtent::left const): Deleted.
2273         (WebCore::BoxExtent::setAt): Deleted.
2274         (WebCore::BoxExtent::setTop): Deleted.
2275         (WebCore::BoxExtent::setRight): Deleted.
2276         (WebCore::BoxExtent::setBottom): Deleted.
2277         (WebCore::BoxExtent::setLeft): Deleted.
2278         (WebCore::BoxExtent::before): Deleted.
2279         (WebCore::BoxExtent::after): Deleted.
2280         (WebCore::BoxExtent::start): Deleted.
2281         (WebCore::BoxExtent::end): Deleted.
2282         (WebCore::BoxExtent::before const): Deleted.
2283         (WebCore::BoxExtent::after const): Deleted.
2284         (WebCore::BoxExtent::start const): Deleted.
2285         (WebCore::BoxExtent::end const): Deleted.
2286         (WebCore::BoxExtent::setBefore): Deleted.
2287         (WebCore::BoxExtent::setAfter): Deleted.
2288         (WebCore::BoxExtent::setStart): Deleted.
2289         (WebCore::BoxExtent::setEnd): Deleted.
2290         (WebCore::BoxExtent::operator== const): Deleted.
2291         (WebCore::BoxExtent::operator!= const): Deleted.
2292         * platform/RectEdges.h: Added.
2293         (WebCore::RectEdges::RectEdges):
2294         (WebCore::RectEdges::at):
2295         (WebCore::RectEdges::top):
2296         (WebCore::RectEdges::right):
2297         (WebCore::RectEdges::bottom):
2298         (WebCore::RectEdges::left):
2299         (WebCore::RectEdges::at const):
2300         (WebCore::RectEdges::top const):
2301         (WebCore::RectEdges::right const):
2302         (WebCore::RectEdges::bottom const):
2303         (WebCore::RectEdges::left const):
2304         (WebCore::RectEdges::setAt):
2305         (WebCore::RectEdges::setTop):
2306         (WebCore::RectEdges::setRight):
2307         (WebCore::RectEdges::setBottom):
2308         (WebCore::RectEdges::setLeft):
2309         (WebCore::RectEdges::before):
2310         (WebCore::RectEdges::after):
2311         (WebCore::RectEdges::start):
2312         (WebCore::RectEdges::end):
2313         (WebCore::RectEdges::before const):
2314         (WebCore::RectEdges::after const):
2315         (WebCore::RectEdges::start const):
2316         (WebCore::RectEdges::end const):
2317         (WebCore::RectEdges::setBefore):
2318         (WebCore::RectEdges::setAfter):
2319         (WebCore::RectEdges::setStart):
2320         (WebCore::RectEdges::setEnd):
2321         (WebCore::RectEdges::operator== const):
2322         (WebCore::RectEdges::operator!= const):
2323         * platform/graphics/ca/TileController.cpp:
2324         (WebCore::TileController::setHasMargins):
2325         * platform/graphics/ca/TileController.h:
2326         * platform/text/WritingMode.h:
2327         (WebCore::isHorizontalPhysicalSide):
2328         * rendering/style/NinePieceImage.cpp:
2329         (WebCore::NinePieceImage::isEmptyPieceRect):
2330         * rendering/style/NinePieceImage.h:
2331         (WebCore::imagePieceHorizontalSide):
2332         (WebCore::imagePieceVerticalSide):
2333         * rendering/style/RenderStyle.cpp:
2334         (WebCore::RenderStyle::getShadowInsetExtent const):
2335
2336 2017-09-11  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2337
2338         [WinCairo] Fix the wincairo build after r221839
2339         https://bugs.webkit.org/show_bug.cgi?id=176681
2340
2341         Reviewed by Per Arne Vollan.
2342
2343         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2344         (WebCore::ResourceHandleCurlDelegate::setupPOST):
2345
2346 2017-09-11  Andy Estes  <aestes@apple.com>
2347
2348         [Mac] Upstream QTKit-related WebKitSystemInterface functions
2349         https://bugs.webkit.org/show_bug.cgi?id=176472
2350
2351         Reviewed by Eric Carlson.
2352
2353         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2354         (WebCore::disableComponentsOnce):
2355         (WebCore::MediaPlayerPrivateQTKit::createQTMovie):
2356         (WebCore::MediaPlayerPrivateQTKit::hasClosedCaptions const):
2357         (WebCore::MediaPlayerPrivateQTKit::setClosedCaptionsVisible):
2358         (WebCore::selectPreferredAlternateTrackForMediaType):
2359         (WebCore::selectPreferredAlternates):
2360         (WebCore::MediaPlayerPrivateQTKit::updateStates):
2361         (WebCore::mimeModernTypesCache):
2362         (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache):
2363         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
2364         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins):
2365         (WebCore::MediaPlayerPrivateQTKit::hasSingleSecurityOrigin const):
2366         (WebCore::MediaPlayerPrivateQTKit::movieLoadType const):
2367         (WebCore::MediaPlayerPrivateQTKit::canSaveMediaData const):
2368         * platform/mac/WebCoreSystemInterface.h:
2369         * platform/mac/WebCoreSystemInterface.mm:
2370         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
2371         (createMediaUIControl):
2372         (createControlWithMediaUIControlType):
2373         (createMediaUIBackgroundView):
2374         (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
2375
2376 2017-09-08  Andy Estes  <aestes@apple.com>
2377
2378         Try to fix the Internal El Capitan build after r221773.
2379
2380         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2381         (WebCore::mimeModernTypesCache):
2382
2383 2017-09-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2384
2385         [WPE] Bump freetype version to 2.8.0
2386         https://bugs.webkit.org/show_bug.cgi?id=176501
2387
2388         Reviewed by Michael Catanzaro.
2389
2390         Enable back the changes done by r221670 that were disabled for WPE on r221719.
2391
2392         Covered by existing tests.
2393
2394         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2395         (WebCore::scaledFontWithoutMetricsHinting):
2396         (WebCore::Font::platformInit):
2397
2398 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
2399
2400         [DFG] Optimize WeakMap::get by adding intrinsic and fixup
2401         https://bugs.webkit.org/show_bug.cgi?id=176010
2402
2403         Reviewed by Filip Pizlo.
2404
2405         * platform/network/curl/CurlJobManager.cpp:
2406         (WebCore::CurlJobList::finishJobs):
2407
2408 2017-09-10  Zan Dobersek  <zdobersek@igalia.com>
2409
2410         [GStreamer] Drop libgcrypt initialization in webkit_media_clear_key_decrypt_init()
2411         https://bugs.webkit.org/show_bug.cgi?id=176656
2412
2413         Reviewed by Michael Catanzaro.
2414
2415         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2416         (webkit_media_clear_key_decrypt_init): Don't re-initialize libgcrypt here
2417         since that's already done in the WebProcess main(), and the calls here
2418         only result in libgcrypt writing out 'Oops' warnings on stderr.
2419
2420 2017-09-10  Mark Lam  <mark.lam@apple.com>
2421
2422         Fix all ExceptionScope verification failures in JavaScriptCore.
2423         https://bugs.webkit.org/show_bug.cgi?id=176662
2424         <rdar://problem/34352085>
2425
2426         Reviewed by Filip Pizlo.
2427
2428         No new tests because this is covered by existing tests with the JSC_validateExceptionChecks=true enabled.
2429
2430         * bindings/js/JSCustomElementInterface.cpp:
2431         (WebCore::JSCustomElementInterface::tryToConstructCustomElement):
2432         * bindings/js/JSCustomElementRegistryCustom.cpp:
2433         (WebCore::whenDefinedPromise):
2434         * bindings/js/JSDOMConvertRecord.h:
2435         * bindings/js/JSDOMMapLike.cpp:
2436         (WebCore::createBackingMap):
2437         * bindings/js/JSDOMPromiseDeferred.cpp:
2438         (WebCore::DeferredPromise::callFunction):
2439         (WebCore::DeferredPromise::reject):
2440         * bindings/js/JSDOMPromiseDeferred.h:
2441         (WebCore::callPromiseFunction):
2442
2443 2017-09-10  Frederic Wang  <fwang@igalia.coml>
2444
2445         Make RenderLayerCompositor always use isRootLayer()
2446         https://bugs.webkit.org/show_bug.cgi?id=176591
2447
2448         Reviewed by Darin Adler.
2449
2450         RenderLayerCompositor contains a few comparisons of the form &layer == m_renderView.layer().
2451         This patch replaces them with "layer.isRootLayer()" which simply verifies that "layer" is
2452         associated to the one (and only one) RenderView of the RenderLayerCompositor. It makes things
2453         more readable and more consistent with the rest of the file.
2454
2455         No new tests, behavior unchanged.
2456
2457         * rendering/RenderLayerCompositor.cpp:
2458         (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
2459         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
2460         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2461
2462 2017-09-09  Sam Weinig  <sam@webkit.org>
2463
2464         Finish off the FormData implementation
2465         https://bugs.webkit.org/show_bug.cgi?id=176659
2466
2467         Reviewed by Darin Adler.
2468
2469         * fileapi/Blob.cpp:
2470         * fileapi/Blob.h:
2471         * fileapi/File.cpp:
2472         * fileapi/File.h:
2473
2474             Add constructors / create functions for making File objects
2475             from an existing Blob or File with an override name.
2476
2477         * html/DOMFormData.cpp:
2478         * html/DOMFormData.h:
2479
2480             Add missing operations and iterator implementation
2481             and bring append up to spec by no ignoring empty names.
2482
2483         * html/DOMFormData.idl:
2484
2485             Bring IDL up to spec. Leave its exposure to just the window for
2486             now, as FormData currently depends on the Document/Page for replace
2487             file generation and therefore cannot operate in a worker.
2488
2489         * html/FormDataList.cpp:
2490         * html/FormDataList.h:
2491
2492             Changes FormDataList::Item to a String key and Variant<RefPtr<File>, String>
2493             data, matching spec concepts more cleanly. Normalization / encoding has also
2494             been made lazy, and now does not happen until creating a FormData from the
2495             FormDataList.
2496
2497             Since we now store Files, rather than Blobs, we follow the spec's 'create an 
2498             entry' algorithm to convert Blobs into Files with the same backing bytes. This
2499             was previously done as part of FormData::appendKeyValuePairItems.
2500
2501         * html/HTMLKeygenElement.cpp:
2502         (WebCore::HTMLKeygenElement::appendFormData):
2503
2504             Remove unnecessary conversion to utf8, the data is base64 encoded, allowing
2505             us to remove an overload of appendData that took a CString.
2506
2507         * inspector/InspectorNetworkAgent.cpp:
2508         (WebCore::buildObjectForResourceRequest):
2509
2510             Update for new signature of FormData::flatten() which now
2511             returns a Vector, rather than takes one in.
2512
2513         * platform/network/FormData.h:
2514         * platform/network/FormData.cpp:
2515         (WebCore::FormData::FormData):
2516         (WebCore::FormData::create):
2517         (WebCore::FormData::createMultiPart):
2518         
2519             Cleanup redundancy by using auto.
2520         
2521         (WebCore::FormData::appendKeyValuePairItems):
2522         
2523             Updated to handle new FormDataList item format (e.g. pairs of key / data) allowing
2524             us to remove two-by-two iteration. Some complexity was removed around Blobs, as
2525             FormDataList now always creates File. 
2526
2527             Since FormDataList no longer eagerly encodes / normalizes the keys and string data
2528             values, we now perform those operations here.
2529         
2530         (WebCore::FormData::expandDataStore):
2531         (WebCore::appendBlobResolved):
2532         (WebCore::FormData::resolveBlobReferences):
2533         (WebCore::FormData::generateFiles):
2534         (WebCore::FormData::hasGeneratedFiles const):
2535         (WebCore::FormData::hasOwnedGeneratedFiles const):
2536         (WebCore::FormData::removeGeneratedFilesIfNeeded):
2537
2538             Adopt auto and modern for-in loops.
2539
2540         (WebCore::FormData::flatten const):
2541         (WebCore::FormData::flattenToString const):
2542
2543             Update flatten to return a Vector, rather than take it in.
2544
2545 2017-09-10  Darin Adler  <darin@apple.com>
2546
2547         Refactor Document::updateTitleElement to use traits instead of function pointers
2548         https://bugs.webkit.org/show_bug.cgi?id=176671
2549
2550         Reviewed by Sam Weinig.
2551
2552         This template implementation seems slightly more readable and
2553         also likely to be slightly more efficient. Also takes a suggestion
2554         from Antti of factoring out the "select a new title element" into a
2555         function, which is a natural thing to do in this version.
2556
2557         * dom/Document.cpp:
2558         (WebCore::TitleTraits<HTMLTitleElement>::isInEligibleLocation): Added.
2559         (WebCore::TitleTraits<HTMLTitleElement>::findTitleElement): Added.
2560         (WebCore::TitleTraits<SVGTitleElement>::isInEligibleLocation): Added.
2561         (WebCore::TitleTraits<SVGTitleElement>::findTitleElement): Added.
2562         (WebCore::selectNewTitleElement): Added.
2563         (WebCore::findHTMLTitle): Deleted.
2564         (WebCore::isHTMLTitle): Deleted.
2565         (WebCore::isHTMLTitleEligible): Deleted.
2566         (WebCore::findSVGTitle): Deleted.
2567         (WebCore::isSVGTitle): Deleted.
2568         (WebCore::isSVGTitleEligible): Deleted.
2569         (WebCore::Document::updateTitleElement): Call selectNewTitleElement
2570         instead of having the logic here.
2571
2572 2017-09-07  Darin Adler  <darin@apple.com>
2573
2574         Fix double resolve assertion in FontFaceSet seen while running tests
2575         https://bugs.webkit.org/show_bug.cgi?id=176525
2576
2577         Reviewed by Brent Fulgham.
2578
2579         * css/FontFaceSet.cpp:
2580         (WebCore::FontFaceSet::FontFaceSet): Only resolve the promise if the CSSFontFaceSet
2581         is already loaded. Otherwise, we will resolve it later when it calls completedLoading.
2582
2583 2017-09-08  Dean Jackson  <dino@apple.com>
2584
2585         gl.detachShader breaks shader program
2586         https://bugs.webkit.org/show_bug.cgi?id=137689
2587         <rdar://problem/34025056>
2588
2589         Reviewed by Sam Weinig.
2590
2591         It should be possible to compile shaders, attach them to a program,
2592         link the program, detach the shaders, delete the shaders, and then
2593         ask for the uniform and attribute locations. That is, once you've
2594         linked, the shaders can be thrown away.
2595
2596         We were using the attached shaders to look up uniform locations, so
2597         we now keep around a separate map that remembers what shaders were
2598         attached when the program links.
2599
2600         This fixes the bug, but the whole area is still a bit messy. For one,
2601         we're keeping around all the shader information even after it is
2602         no longer used.
2603         See https://bugs.webkit.org/show_bug.cgi?id=98204
2604
2605         Test: fast/canvas/webgl/detachShader-before-accessing-uniform.html
2606
2607         * platform/graphics/GraphicsContext3D.h: Add another map to remember
2608         what shaders were used when a program was linked.
2609         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2610         (WebCore::GraphicsContext3D::mappedSymbolInShaderSourceMap): New helper
2611         to look up a name in our source maps.
2612         (WebCore::GraphicsContext3D::mappedSymbolName): Use the helper, and look
2613         at linked shaders if there are no attached shaders.
2614         (WebCore::GraphicsContext3D::originalSymbolInShaderSourceMap): Does the
2615         reverse of the above.
2616         (WebCore::GraphicsContext3D::originalSymbolName):
2617         (WebCore::GraphicsContext3D::linkProgram): Add to the new map.
2618         (WebCore::GraphicsContext3D::deleteProgram): Delete the program from
2619         our shader entries.
2620
2621 2017-09-09  Mark Lam  <mark.lam@apple.com>
2622
2623         Avoid duplicate computations of ExecState::vm().
2624         https://bugs.webkit.org/show_bug.cgi?id=176647
2625
2626         Reviewed by Saam Barati.
2627
2628         No new tests because this is only a refactoring patch.  There is no
2629         significant behavior change.
2630
2631         * Modules/mediastream/SDPProcessor.cpp:
2632         (WebCore::SDPProcessor::callScript const):
2633         * Modules/plugins/QuickTimePluginReplacement.mm:
2634         (WebCore::QuickTimePluginReplacement::installReplacement):
2635         * bindings/js/JSCallbackData.cpp:
2636         (WebCore::JSCallbackData::invokeCallback):
2637         * bindings/js/JSCustomElementInterface.cpp:
2638         (WebCore::constructCustomElementSynchronously):
2639         (WebCore::JSCustomElementInterface::upgradeElement):
2640         (WebCore::JSCustomElementInterface::invokeCallback):
2641         * bindings/js/JSDOMConvertRecord.h:
2642         * bindings/js/JSDOMMapLike.h:
2643         (WebCore::forwardSizeToMapLike):
2644         (WebCore::forwardEntriesToMapLike):
2645         (WebCore::forwardKeysToMapLike):
2646         (WebCore::forwardValuesToMapLike):
2647         (WebCore::forwardGetToMapLike):
2648         (WebCore::forwardHasToMapLike):
2649         * bindings/js/JSDOMWindowCustom.cpp:
2650         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2651         (WebCore::addCrossOriginWindowOwnPropertyNames):
2652         * bindings/js/JSDocumentCustom.cpp:
2653         (WebCore::reportMemoryForDocumentIfFrameless):
2654         * bindings/js/JSErrorHandler.cpp:
2655         (WebCore::JSErrorHandler::handleEvent):
2656         * bindings/js/JSImageDataCustom.cpp:
2657         (WebCore::toJSNewlyCreated):
2658         * bindings/js/JSLocationCustom.cpp:
2659         (WebCore::getOwnPropertySlotCommon):
2660         (WebCore::putCommon):
2661         (WebCore::addCrossOriginLocationPropertyNames):
2662         (WebCore::addCrossOriginLocationOwnPropertyNames):
2663         (WebCore::JSLocation::defineOwnProperty):
2664         (WebCore::JSLocationPrototype::put):
2665         (WebCore::JSLocationPrototype::defineOwnProperty):
2666         * bindings/js/SerializedScriptValue.cpp:
2667         (WebCore::CloneSerializer::serialize):
2668         * bindings/scripts/CodeGeneratorJS.pm:
2669         (GenerateImplementation):
2670         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2671         (WebCore::setJSInterfaceNameConstructor):
2672         * bindings/scripts/test/JS/JSMapLike.cpp:
2673         (WebCore::setJSMapLikeConstructor):
2674         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2675         (WebCore::setJSReadOnlyMapLikeConstructor):
2676         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2677         (WebCore::setJSTestActiveDOMObjectConstructor):
2678         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2679         (WebCore::setJSTestCEReactionsConstructor):
2680         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2681         (WebCore::setJSTestCEReactionsStringifierConstructor):
2682         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2683         (WebCore::setJSTestCallTracerConstructor):
2684         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2685         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
2686         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2687         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
2688         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
2689         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2690         (WebCore::setJSTestDOMJITConstructor):
2691         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2692         (WebCore::setJSTestEnabledBySettingConstructor):
2693         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2694         (WebCore::setJSTestEventConstructorConstructor):
2695         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2696         (WebCore::setJSTestEventTargetConstructor):
2697         * bindings/scripts/test/JS/JSTestException.cpp:
2698         (WebCore::setJSTestExceptionConstructor):
2699         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2700         (WebCore::setJSTestGenerateIsReachableConstructor):
2701         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2702         (WebCore::setJSTestGlobalObjectConstructor):
2703         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2704         (WebCore::setJSTestIndexedSetterNoIdentifierConstructor):
2705         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2706         (WebCore::setJSTestIndexedSetterThrowingExceptionConstructor):
2707         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2708         (WebCore::setJSTestIndexedSetterWithIdentifierConstructor):
2709         * bindings/scripts/test/JS/JSTestInterface.cpp:
2710         (WebCore::setJSTestInterfaceConstructor):
2711         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2712         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
2713         * bindings/scripts/test/JS/JSTestIterable.cpp:
2714         (WebCore::setJSTestIterableConstructor):
2715         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2716         (WebCore::setJSTestJSBuiltinConstructorConstructor):
2717         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2718         (WebCore::setJSTestMediaQueryListListenerConstructor):
2719         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2720         (WebCore::setJSTestNamedAndIndexedSetterNoIdentifierConstructor):
2721         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2722         (WebCore::setJSTestNamedAndIndexedSetterThrowingExceptionConstructor):
2723         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2724         (WebCore::setJSTestNamedAndIndexedSetterWithIdentifierConstructor):
2725         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2726         (WebCore::setJSTestNamedConstructorConstructor):
2727         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2728         (WebCore::setJSTestNamedDeleterNoIdentifierConstructor):
2729         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2730         (WebCore::setJSTestNamedDeleterThrowingExceptionConstructor):
2731         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2732         (WebCore::setJSTestNamedDeleterWithIdentifierConstructor):
2733         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2734         (WebCore::setJSTestNamedDeleterWithIndexedGetterConstructor):
2735         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2736         (WebCore::setJSTestNamedGetterCallWithConstructor):
2737         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2738         (WebCore::setJSTestNamedGetterNoIdentifierConstructor):
2739         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2740         (WebCore::setJSTestNamedGetterWithIdentifierConstructor):
2741         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2742         (WebCore::setJSTestNamedSetterNoIdentifierConstructor):
2743         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2744         (WebCore::setJSTestNamedSetterThrowingExceptionConstructor):
2745         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2746         (WebCore::setJSTestNamedSetterWithIdentifierConstructor):
2747         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2748         (WebCore::setJSTestNamedSetterWithIndexedGetterConstructor):
2749         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2750         (WebCore::setJSTestNamedSetterWithIndexedGetterAndSetterConstructor):
2751         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2752         (WebCore::setJSTestNamedSetterWithOverrideBuiltinsConstructor):
2753         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2754         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesConstructor):
2755         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2756         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
2757         * bindings/scripts/test/JS/JSTestNode.cpp:
2758         (WebCore::setJSTestNodeConstructor):
2759         * bindings/scripts/test/JS/JSTestObj.cpp:
2760         (WebCore::setJSTestObjConstructor):
2761         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2762         (WebCore::setJSTestOverloadedConstructorsConstructor):
2763         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2764         (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
2765         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2766         (WebCore::setJSTestOverrideBuiltinsConstructor):
2767         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2768         (WebCore::setJSTestPluginInterfaceConstructor):
2769         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2770         (WebCore::setJSTestPromiseRejectionEventConstructor):
2771         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2772         (WebCore::setJSTestSerializationConstructor):
2773         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2774         (WebCore::setJSTestSerializationIndirectInheritanceConstructor):
2775         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2776         (WebCore::setJSTestSerializationInheritConstructor):
2777         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2778         (WebCore::setJSTestSerializationInheritFinalConstructor):
2779         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2780         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
2781         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2782         (WebCore::setJSTestStringifierConstructor):
2783         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2784         (WebCore::setJSTestStringifierAnonymousOperationConstructor):
2785         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2786         (WebCore::setJSTestStringifierNamedOperationConstructor):
2787         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2788         (WebCore::setJSTestStringifierOperationImplementedAsConstructor):
2789         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2790         (WebCore::setJSTestStringifierOperationNamedToStringConstructor):
2791         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2792         (WebCore::setJSTestStringifierReadOnlyAttributeConstructor):
2793         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2794         (WebCore::setJSTestStringifierReadWriteAttributeConstructor):
2795         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2796         (WebCore::setJSTestTypedefsConstructor):
2797         * bridge/NP_jsobject.cpp:
2798         (_NPN_SetProperty):
2799         (_NPN_RemoveProperty):
2800         (_NPN_Enumerate):
2801         * bridge/c/c_instance.cpp:
2802         (JSC::Bindings::CRuntimeMethod::create):
2803         * bridge/objc/WebScriptObject.mm:
2804         (-[WebScriptObject setValue:forKey:]):
2805         (-[WebScriptObject removeWebScriptKey:]):
2806         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
2807         * bridge/objc/objc_instance.mm:
2808         (ObjCRuntimeMethod::create):
2809         * bridge/objc/objc_runtime.h:
2810         (JSC::Bindings::ObjcFallbackObjectImp::create):
2811         * bridge/runtime_array.cpp:
2812         (JSC::RuntimeArray::getOwnPropertyNames):
2813         (JSC::RuntimeArray::getOwnPropertySlot):
2814         (JSC::RuntimeArray::put):
2815         * bridge/runtime_array.h:
2816         (JSC::RuntimeArray::create):
2817         * bridge/runtime_method.cpp:
2818         (JSC::RuntimeMethod::getOwnPropertySlot):
2819         * bridge/runtime_method.h:
2820         * html/HTMLMediaElement.cpp:
2821         (WebCore::HTMLMediaElement::updateCaptionContainer):
2822         (WebCore::HTMLMediaElement::setControllerJSProperty):
2823         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
2824         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
2825         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
2826         * html/HTMLPlugInImageElement.cpp:
2827         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
2828         * testing/Internals.cpp:
2829         (WebCore::Internals::cloneArrayBuffer):
2830
2831 2017-09-09  Zan Dobersek  <zdobersek@igalia.com>
2832
2833         [EME] MediaKeySession: handle MediaKeys association through a WeakPtr
2834         https://bugs.webkit.org/show_bug.cgi?id=176584
2835
2836         Reviewed by Xabier Rodriguez-Calvar.
2837
2838         Don't keep a raw pointer to the originating MediaKeys object in
2839         MediaKeySession that gets nulled out once MediaKeys is destroyed.
2840         Instead, make MediaKeys a WeakPtrFactory and use a WeakPtr<MediaKeys>
2841         object to maintain the association between MediaKeySession and
2842         MediaKeys.
2843
2844         * Modules/encryptedmedia/MediaKeySession.cpp:
2845         (WebCore::MediaKeySession::create):
2846         (WebCore::MediaKeySession::MediaKeySession):
2847         (WebCore::MediaKeySession::detachKeys): Deleted.
2848         * Modules/encryptedmedia/MediaKeySession.h:
2849         * Modules/encryptedmedia/MediaKeys.cpp:
2850         (WebCore::MediaKeys::MediaKeys):
2851         (WebCore::MediaKeys::createSession):
2852         (WebCore::MediaKeys::~MediaKeys): Deleted.
2853         * Modules/encryptedmedia/MediaKeys.h:
2854
2855 2017-09-09  Zan Dobersek  <zdobersek@igalia.com>
2856
2857         [GStreamer] Missing GRefPtr adoptions in MediaPlayerPrivateGStreamerBase, PlaybackPipeline
2858         https://bugs.webkit.org/show_bug.cgi?id=176646
2859
2860         Reviewed by Carlos Garcia Campos.
2861
2862         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2863         (WebCore::registerWebKitGStreamerElements): Adopt the return value
2864         of gst_element_factory_find(), which is transferred in full.
2865         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2866         (WebCore::PlaybackPipeline::flush): Adopt the return values
2867         of gst_element_get_static_pad() and gst_pad_get_peer(), both being
2868         transferred in full.
2869
2870 2017-09-09  Frederic Wang  <fwang@igalia.com>
2871
2872         Use RenderLayerBacking::renderer() when possible
2873         https://bugs.webkit.org/show_bug.cgi?id=176585
2874
2875         The private member renderer() is a shorthand for m_owningLayer.renderer(). This patch uses
2876         it in RenderLayerBacking when possible.
2877
2878         Reviewed by Carlos Garcia Campos.
2879
2880         No new tests, behavior not changed.
2881
2882         * rendering/RenderLayerBacking.cpp:
2883         (WebCore::RenderLayerBacking::updateGeometry):
2884         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
2885         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
2886
2887 2017-09-08  Sam Weinig  <sam@webkit.org>
2888
2889         Replace JS builtin implementation of the FetchResponse constructor with a C++ one
2890         https://bugs.webkit.org/show_bug.cgi?id=176627
2891
2892         Reviewed by Alex Christensen.
2893
2894         Removes the last of the Fetch related JS builtin code.
2895
2896         * CMakeLists.txt:
2897         * DerivedSources.make:
2898         * WebCore.xcodeproj/project.pbxproj:
2899         * Modules/fetch/FetchInternals.js: Removed.
2900         * Modules/fetch/FetchResponse.js: Removed.
2901         
2902             Remove FetchInternals.js and FetchResponse.js.
2903
2904
2905         * Modules/fetch/FetchBody.idl:
2906         * Modules/fetch/FetchBodyConsumer.h:
2907
2908             Remove no longer correct FIXMEs.
2909
2910         * Modules/fetch/FetchBodySource.cpp:
2911
2912             Add missing newline between functions.
2913
2914         * Modules/fetch/FetchHeaders.idl:
2915         * Modules/fetch/FetchResponse.idl:
2916
2917             Remove builtin related operations and extended attributes.
2918
2919         * Modules/fetch/FetchHeaders.h:
2920         (WebCore::FetchHeaders::fastHas const):
2921         * Modules/fetch/FetchHeaders.cpp:
2922
2923             Added fastHas to allow checking for a header using a HTTPHeaderName. Remove
2924             now unused filter function.
2925
2926         * Modules/fetch/FetchResponse.cpp:
2927         (WebCore::isNullBodyStatus):
2928
2929             Added helper predicate for 'null body status' concept.
2930
2931         (WebCore::FetchResponse::create):
2932
2933             Add spec defined constructor implementation.
2934
2935         (WebCore::FetchResponse::setBodyData):
2936
2937             Reformatted to match more common WTF::switchOn style.
2938
2939         (WebCore::FetchResponse::setStatus): Deleted.
2940         (WebCore::FetchResponse::initializeWith): Deleted.
2941
2942             Removed now unused functions.
2943
2944         * Modules/fetch/FetchResponse.h:
2945         (WebCore::FetchResponse::create):
2946
2947             Move inline create out of the class definition to make things a bit less crowded.
2948
2949 2017-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
2950
2951         Implement HTMLImageElement.decoode() method
2952         https://bugs.webkit.org/show_bug.cgi?id=176016
2953
2954         Reviewed by Simon Fraser.
2955
2956         The specs is:
2957         https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode.
2958
2959         -- img.decode() waits till loading the image finishes. Otherwise it starts
2960         decoding the image immediately.
2961         -- If the image frame is already decoded, the promise will be resolved
2962         before return.
2963         -- If an error happens in loading the image or decoding the image frame,
2964         the promise will be rejected with 'EncodingError' exception.
2965         -- Animated image resolves the promise when the next frame is decoded and 
2966         the animation is advanced it. If the image is not displayed, decode() will
2967         request the decoding the first frame and start animating the image.
2968
2969         Tests: fast/images/decode-animated-image.html
2970                fast/images/decode-render-animated-image.html
2971                fast/images/decode-render-static-image.html
2972                fast/images/decode-static-image-reject.html
2973                fast/images/decode-static-image-resolve.html
2974
2975         * html/HTMLImageElement.cpp:
2976         (WebCore::HTMLImageElement::decode):
2977         * html/HTMLImageElement.h:
2978         * html/HTMLImageElement.idl:
2979         * loader/ImageLoader.cpp:
2980         (WebCore::ImageLoader::notifyFinished):
2981         (WebCore::ImageLoader::decode):
2982         (WebCore::ImageLoader::decodeError):
2983         * loader/ImageLoader.h:
2984         (WebCore::ImageLoader::hasPendingDecodePromise const):
2985         * platform/graphics/BitmapImage.cpp:
2986         (WebCore::BitmapImage::internalStartAnimation):
2987         (WebCore::BitmapImage::internalAdvanceAnimation):
2988         (WebCore::BitmapImage::decode):
2989         (WebCore::BitmapImage::imageFrameAvailableAtIndex):
2990         * platform/graphics/BitmapImage.h:
2991         * platform/graphics/Image.h:
2992         (WebCore::Image::decode):
2993
2994 2017-09-08  Joseph Pecoraro  <pecoraro@apple.com>
2995
2996         Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses
2997         https://bugs.webkit.org/show_bug.cgi?id=176479
2998
2999         Reviewed by Alex Christensen.
3000
3001         Test: http/wpt/fetch/response-status-text.html
3002
3003         HTTP/2 doesn't include a status reason phrase. So the "status line"
3004         ends up just being the version and status code. Fallback to the empty
3005         string instead of the full line.
3006
3007         * platform/network/HTTPParsers.cpp:
3008         (WebCore::extractReasonPhraseFromHTTPStatusLine):
3009
3010 2017-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3011
3012         Implement the attribute HTMLImageElement.async 
3013         https://bugs.webkit.org/show_bug.cgi?id=176204
3014
3015         Reviewed by Darin Adler.
3016
3017         Adding this attribute to the <img> element will force async decoding for
3018         this image all the times. None of the heuristics, which  prevents flickering
3019         the image, will be checked.
3020
3021         Test: fast/images/async-attribute-with-small-image.html
3022
3023         * html/HTMLImageElement.cpp:
3024         (WebCore::HTMLImageElement::parseAttribute):
3025         * html/HTMLImageElement.h:
3026         (WebCore::HTMLImageElement::async const):
3027         * html/HTMLImageElement.idl:
3028         * rendering/RenderBoxModelObject.cpp:
3029         (WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
3030
3031 2017-09-08  Commit Queue  <commit-queue@webkit.org>
3032
3033         Unreviewed, rolling out r221773.
3034         https://bugs.webkit.org/show_bug.cgi?id=176614
3035
3036         This caused build failures. (Requested by mlewis13 on
3037         #webkit).
3038
3039         Reverted changeset:
3040
3041         "[Mac] Upstream QTKit-related WebKitSystemInterface functions"
3042         https://bugs.webkit.org/show_bug.cgi?id=176472
3043         http://trac.webkit.org/changeset/221773
3044
3045 2017-09-08  Antti Koivisto  <antti@apple.com>
3046
3047         Remove support for >> descendant combinator syntax
3048         https://bugs.webkit.org/show_bug.cgi?id=175765
3049
3050         Reviewed by Sam Weinig.
3051
3052         This is an alternative syntax for the normal descendant combinator (just space) that was
3053         advertised as being consistent with > (child combinator) and >>> (shadow piercing combinator).
3054         The latter has been killed so it is not consistent with anything anymore.
3055
3056         No other engine besides WebKit has implemented this and the WPT tests have been removed
3057         (in https://github.com/w3c/web-platform-tests/pull/6785). Full removal from spec is still
3058         open (https://github.com/w3c/csswg-drafts/issues/641) but we shouldn't encourage adoption of
3059         this pointless feature.
3060
3061         While this has shipped the compatibility risk is low as no other engine implemented it and
3062         there were no incentives to use it over the standard syntax.
3063
3064         * css/CSSSelector.cpp:
3065         (WebCore::CSSSelector::selectorText const):
3066         * css/CSSSelector.h:
3067         (WebCore::CSSSelector::hasDescendantRelation const):
3068         * css/SelectorChecker.cpp:
3069         (WebCore::SelectorChecker::matchRecursively const):
3070         * css/SelectorFilter.cpp:
3071         (WebCore::SelectorFilter::collectIdentifierHashes):
3072         * css/parser/CSSParserSelector.cpp:
3073         (WebCore::CSSParserSelector::appendTagHistory):
3074         * css/parser/CSSParserSelector.h:
3075         * css/parser/CSSSelectorParser.cpp:
3076         (WebCore::isDescendantCombinator):
3077         (WebCore::CSSSelectorParser::consumeCombinator):
3078         * cssjit/SelectorCompiler.cpp:
3079         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
3080
3081 2017-09-08  Zan Dobersek  <zdobersek@igalia.com>
3082
3083         [GStreamer] initializationDataEncountered() dispatch can outlive MediaPlayerPrivateGStreamerBase
3084         https://bugs.webkit.org/show_bug.cgi?id=176544
3085
3086         Reviewed by Xabier Rodriguez-Calvar.
3087
3088         The RunLoop dispatch that invokes MediaPlayer::initializationDataEncountered()
3089         can outlive the MediaPlayerPrivateGStreamerBase object that is referenced
3090         from the dispatched functor. To avoid this, a WeakPtrFactory is placed onto
3091         MediaPlayerPrivateGStreamerBase and a WeakPtr object is kept in the functor,
3092         bailing during dispatch if the factory (along with MediaPlayerPrivateGStreamerBase)
3093         has already been destroyed since the schedule of this dispatch.
3094
3095         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3096         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
3097         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
3098         Also remove the unused `sessionId` string.
3099         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3100
3101 2017-09-08  Zan Dobersek  <zdobersek@igalia.com>
3102
3103         [GStreamer] Add GRefPtr specializations for GstGLDisplay, GstGLContext
3104         https://bugs.webkit.org/show_bug.cgi?id=176543
3105
3106         Reviewed by Xabier Rodriguez-Calvar.
3107
3108         Both GstGLDisplay and GstGLContext inherit from GstObject, meaning
3109         gst_object_ref_sink() and gst_object_unref() should be used for
3110         incrementing and decrementing reference count. Template specializations
3111         for the adoptGRef(), refGPtr() and derefGPtr() are added for both types,
3112         preventing GRefPtr<> from falling back to using g_object_ref() and
3113         g_object_unref() for reference count modification purposes.
3114
3115         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
3116         (WTF::adoptGRef):
3117         (WTF::refGPtr<GstGLDisplay>):
3118         (WTF::derefGPtr<GstGLDisplay>):
3119         (WTF::refGPtr<GstGLContext>):
3120         (WTF::derefGPtr<GstGLContext>):
3121         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
3122
3123 2017-09-08  Zan Dobersek  <zdobersek@igalia.com>
3124
3125         [GStreamer] Incorrect GstCaps unreffing in GStreamerEMEUtilities::createDecryptor()
3126         https://bugs.webkit.org/show_bug.cgi?id=176540
3127
3128         Reviewed by Xabier Rodriguez-Calvar.
3129
3130         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
3131         Include the GRefPtrGStreamer.h header in order to use specialized template
3132         functions that correctly adopt and dereference GstCaps object that is
3133         wrapped the GRefPtr<>.
3134
3135 2017-09-07  Joseph Pecoraro  <pecoraro@apple.com>
3136
3137         WebKit should claim that it can show responses for a broader range of JSON MIMETypes
3138         https://bugs.webkit.org/show_bug.cgi?id=176252
3139         <rdar://problem/34212885>
3140
3141         Reviewed by Ryosuke Niwa.
3142
3143         * platform/MIMETypeRegistry.h:
3144         * platform/MIMETypeRegistry.cpp:
3145         (WebCore::MIMETypeRegistry::canShowMIMEType):
3146         Extend this to support JavaScript and JSON MIMETypes that WebKit
3147         knows how to treat as text.
3148
3149 2017-09-07  Andy Estes  <aestes@apple.com>
3150
3151         [Mac] Upstream QTKit-related WebKitSystemInterface functions
3152         https://bugs.webkit.org/show_bug.cgi?id=176472
3153
3154         Reviewed by Eric Carlson.
3155
3156         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3157         (WebCore::disableComponentsOnce):
3158         (WebCore::MediaPlayerPrivateQTKit::createQTMovie):
3159         (WebCore::MediaPlayerPrivateQTKit::hasClosedCaptions const):
3160         (WebCore::MediaPlayerPrivateQTKit::setClosedCaptionsVisible):
3161         (WebCore::selectPreferredAlternateTrackForMediaType):
3162         (WebCore::selectPreferredAlternates):
3163         (WebCore::MediaPlayerPrivateQTKit::updateStates):
3164         (WebCore::mimeModernTypesCache):
3165         (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache):
3166         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
3167         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins):
3168         (WebCore::MediaPlayerPrivateQTKit::hasSingleSecurityOrigin const):
3169         (WebCore::MediaPlayerPrivateQTKit::movieLoadType const):
3170         (WebCore::MediaPlayerPrivateQTKit::canSaveMediaData const):
3171         * platform/mac/WebCoreSystemInterface.h:
3172         * platform/mac/WebCoreSystemInterface.mm:
3173         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
3174         (createMediaUIControl):
3175         (createControlWithMediaUIControlType):
3176         (createMediaUIBackgroundView):
3177         (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
3178
3179 2017-09-07  Youenn Fablet  <youenn@apple.com>
3180
3181         Align FetchResponse and FetchRequest body handling
3182         https://bugs.webkit.org/show_bug.cgi?id=176539
3183
3184         Reviewed by Alex Christensen.
3185
3186         Covered by rebased tests.
3187
3188         Removing most of FetchResponse JS Builtins now that ReadableStream has full support.
3189         Implementing FetchResponse body cloning through ReadableStream.
3190         Cloning a loading FetchResponse still requires to create a ReadableStream for the purpose of teeing.
3191
3192         Moving exposure of the body from FetchResponse to FetchBodyOwner.
3193         This is controlled by a boolean flag set according response tainting.
3194
3195         Moving handling of body ReadableStream consuming from FetchResponse to FetchBodyConsumer.
3196         For that purpose, a loading boolean flag is added to FetchBodyConsumer so that it will resolve consume promises
3197         when loading is finished.
3198
3199         Added support for getting a body in case the request/response body is already consumed.
3200         In that case, a locked ReadableStream is returned.
3201
3202         * Modules/cache/DOMCache.cpp:
3203         (WebCore::DOMCache::doMatch):
3204         (WebCore::DOMCache::matchAll):
3205         * Modules/fetch/FetchBody.h:
3206         (WebCore::FetchBody::loadingBody):
3207         (WebCore::FetchBody::FetchBody):
3208         * Modules/fetch/FetchBody.idl:
3209         * Modules/fetch/FetchBodyConsumer.cpp:
3210         (WebCore::FetchBodyConsumer::resolve):
3211         (WebCore::FetchBodyConsumer::loadingFailed):
3212         (WebCore::FetchBodyConsumer::loadingSucceeded):
3213         * Modules/fetch/FetchBodyConsumer.h:
3214         (WebCore::FetchBodyConsumer::setAsLoading):
3215         * Modules/fetch/FetchBodyOwner.cpp:
3216         (WebCore::FetchBodyOwner::arrayBuffer):
3217         (WebCore::FetchBodyOwner::blob):
3218         (WebCore::FetchBodyOwner::formData):
3219         (WebCore::FetchBodyOwner::json):
3220         (WebCore::FetchBodyOwner::text):
3221         (WebCore::FetchBodyOwner::readableStream):
3222         * Modules/fetch/FetchBodyOwner.h:
3223         (WebCore::FetchBodyOwner::isBodyNullOrOpaque const):
3224         (WebCore::FetchBodyOwner::setBodyAsOpaque):
3225         (WebCore::FetchBodyOwner::isBodyOpaque const):
3226         * Modules/fetch/FetchInternals.js:
3227         (fillFetchHeaders):
3228         * Modules/fetch/FetchResponse.cpp:
3229         (WebCore::FetchResponse::clone):
3230         (WebCore::FetchResponse::fetch):
3231         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
3232         (WebCore::FetchResponse::setBodyData):
3233         (WebCore::FetchResponse::consumeChunk):
3234         (WebCore::FetchResponse::consumeBodyAsStream):
3235         * Modules/fetch/FetchResponse.h:
3236         * Modules/fetch/FetchResponse.idl:
3237         * Modules/fetch/FetchResponse.js:
3238         (initializeFetchResponse):
3239         * bindings/js/ReadableStream.cpp:
3240         (WebCore::ReadableStream::create):
3241         (WebCore::ReadableStream::lock):
3242         * bindings/js/ReadableStream.h:
3243         * bindings/js/WebCoreBuiltinNames.h:
3244
3245 2017-09-07  Michael Saboff  <msaboff@apple.com>
3246
3247         Add support for RegExp named capture groups
3248         https://bugs.webkit.org/show_bug.cgi?id=176435
3249
3250         Reviewed by Filip Pizlo.
3251
3252         Implemented stub routines to support named capture groups.  These are no-ops
3253         just like for number capture group.
3254
3255         No new tests as this is covered by existing tests.
3256
3257         * contentextensions/URLFilterParser.cpp:
3258         (WebCore::ContentExtensions::PatternParser::atomNamedBackReference):
3259         (WebCore::ContentExtensions::PatternParser::atomParenthesesSubpatternBegin):
3260
3261 2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
3262
3263         [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
3264         https://bugs.webkit.org/show_bug.cgi?id=176561
3265
3266         Reviewed by Brent Fulgham.
3267
3268         No new tests because there is no behavior change.
3269
3270         * CMakeLists.txt:
3271         * WebCore.xcodeproj/project.pbxproj:
3272         * accessibility/AccessibilitySVGElement.cpp:
3273         * bindings/js/JSDOMWindowBase.cpp:
3274         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3275         * dom/Document.cpp:
3276         * html/HTMLInputElement.cpp:
3277         * html/HTMLMediaElement.cpp:
3278         * html/shadow/MediaControlElements.cpp:
3279         * html/track/TrackBase.cpp:
3280         * page/CaptionUserPreferences.cpp:
3281         * page/CaptionUserPreferencesMediaAF.cpp:
3282         * page/DOMWindow.cpp:
3283         * page/Navigator.cpp:
3284         * page/NavigatorBase.cpp:
3285         * platform/graphics/FontGenericFamilies.cpp:
3286         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
3287         * platform/network/HTTPParsers.cpp:
3288         * platform/text/PlatformLocale.h:
3289         * platform/text/cf/HyphenationCF.cpp:
3290         * platform/text/mac/LocaleMac.mm:
3291         * svg/SVGTests.cpp:
3292         * testing/InternalSettings.cpp:
3293         * testing/Internals.cpp:
3294         (WebCore::Internals::resetToConsistentState):
3295         (WebCore::Internals::userPreferredLanguages const):
3296         (WebCore::Internals::setUserPreferredLanguages):
3297
3298 2017-09-06  Dean Jackson  <dino@apple.com>
3299
3300         [WebGL] accelerated texImage2D for video doesn't respect flipY
3301         https://bugs.webkit.org/show_bug.cgi?id=176491
3302         <rdar://problem/33833511>
3303
3304         Reviewed by Jer Noble.
3305
3306         Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
3307         back to software or fail to upload texture data. Fix this by intercepting
3308         the texImage2D call, checking the orientation of the video, and running
3309         a small shader program to flip it if necessary.
3310
3311         While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
3312         none of our media decoders support video with alpha, so unfortunately
3313         this will have no visible change.
3314
3315         Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
3316                fast/canvas/webgl/texImage2D-video-flipY-true.html
3317
3318         * platform/cocoa/CoreVideoSoftLink.cpp: Add link to CVOpenGL(ES)TextureGetCleanTexCoords,
3319         which is used to check the orientation of the source video.
3320         * platform/cocoa/CoreVideoSoftLink.h:
3321
3322         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3323         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): We can
3324         now handle flipped or premultiplied requests.
3325         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3326         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): Ditto.
3327
3328         * platform/graphics/cv/VideoTextureCopierCV.cpp:
3329         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV): Rename readFramebuffer to
3330         simply framebuffer.
3331         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV): Delete the program and buffer
3332         if they were created.
3333         (WebCore::VideoTextureCopierCV::initializeContextObjects): Sets up the shader program
3334         and the vertex buffer for drawing. Also records the location of the uniforms.
3335         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Create a new
3336         framebuffer object, and render the video texture into that framebuffer using a
3337         shader that can flip the coordinates.
3338         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver): Helper to restore
3339         the state of the user's GraphicsContext3D while we're intercepting calls.
3340         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
3341         * platform/graphics/cv/VideoTextureCopierCV.h:
3342
3343         * platform/graphics/GraphicsContext3D.h: Add two new entry points, for direct shader
3344         compilation and attribute access. This avoids going through ANGLE.
3345         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3346         (WebCore::GraphicsContext3D::compileShader):
3347         (WebCore::GraphicsContext3D::compileShaderDirect):
3348         (WebCore::GraphicsContext3D::getAttribLocationDirect):
3349
3350 2017-09-07  Wenson Hsieh  <wenson_hsieh@apple.com>
3351
3352         [Directory Upload] Extend drag and drop support to iOS
3353         https://bugs.webkit.org/show_bug.cgi?id=176492
3354         <rdar://problem/34291584>
3355
3356         Reviewed by Tim Horton.
3357
3358         Adds support for accepting dropped folders on iOS.
3359
3360         Tests: DataInteractionTests.ExternalSourceDataTransferItemGetFolderAsEntry
3361                DataInteractionTests.ExternalSourceDataTransferItemGetPlainTextFileAsEntry
3362
3363         * platform/ios/PasteboardIOS.mm:
3364         (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
3365
3366         Add "public.folder" as a compatible pasteboard type for drops on iOS. This means file inputs and custom drop
3367         targets that preventDefault() will, by default, be able to accept incoming folders.
3368
3369         * platform/ios/WebItemProviderPasteboard.mm:
3370         (linkTemporaryItemProviderFilesToDropStagingDirectory):
3371
3372         Tweak temporaryFileURLForDataInteractionContent to also hard link UIKit's temporary files instead, and return
3373         a non-null destination URL only if the necessary file operations succeeded. Also renames this helper to
3374         linkTemporaryItemProviderFilesToDropStagingDirectory to better reflect its new purpose. This makes logic much
3375         cleaner at the call site, which no longer checks against various conditions before proceeding to set the data
3376         transfer URL.
3377
3378         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
3379         (temporaryFileURLForDataInteractionContent): Deleted.
3380
3381 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3382
3383         Modernize Geolocation code
3384         https://bugs.webkit.org/show_bug.cgi?id=176496
3385
3386         Reviewed by Andy Estes.
3387
3388         No change in behavior.  Just more references instead of pointers.
3389
3390         * Modules/geolocation/Geolocation.cpp:
3391         (WebCore::createPositionError):
3392         (WebCore::Geolocation::resetAllGeolocationPermission):
3393         (WebCore::Geolocation::stop):
3394         (WebCore::Geolocation::requestPermission):
3395         (WebCore::Geolocation::setError):
3396         (WebCore::Geolocation::startUpdating):
3397         (WebCore::Geolocation::stopUpdating):
3398         * Modules/geolocation/Geolocation.h:
3399         * Modules/geolocation/GeolocationClient.h:
3400         * Modules/geolocation/GeolocationController.cpp:
3401         (WebCore::GeolocationController::addObserver):
3402         (WebCore::GeolocationController::removeObserver):
3403         (WebCore::GeolocationController::requestPermission):
3404         (WebCore::GeolocationController::cancelPermissionRequest):
3405         (WebCore::GeolocationController::positionChanged):
3406         (WebCore::GeolocationController::errorOccurred):
34