5b46b66a298288ac800001f3cf8af1ed3afdc025
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-03-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         [macOS] Copying a table from the Numbers app and pasting into iCloud Numbers fails
4         https://bugs.webkit.org/show_bug.cgi?id=183485
5         <rdar://problem/38041984>
6
7         Reviewed by Ryosuke Niwa.
8
9         After r222656, WebKit now treats raw image data on the pasteboard as files for the purposes of computing
10         DataTransfer.files and DataTransfer.types. However, this is combined with existing policies that suppress
11         DataTransfer.getData and DataTransfer.setData when the pasteboard contains files (generalized to copy/paste in
12         r222688). This means we now don't allow web pages to access "text/plain" in the case where the user copies part
13         of a table from the native Numbers app since Numbers additionally writes a snapshot of the table to the platform
14         pasteboard.
15
16         This restriction on getData/setData was intended to prevent web pages from extracting users' file paths when
17         pasting or dropping, so it doesn't make sense to enforce this restriction even when there is only in-memory
18         image data on the pasteboard. To fix this bug, we make Pasteboard::fileContentState() differentiate between
19         cases where there are (real) files on the pasteboard, and cases where we've fallen back to treating image data
20         as files.
21
22         Rebaselined existing LayoutTests to match new behavior.
23         Also covered by 4 new API tests:
24             - PasteMixedContent.ImageDataAndPlainText
25             - PasteMixedContent.ImageDataAndPlainTextAndURL
26             - PasteMixedContent.ImageDataAndPlainTextAndURLAndHTML
27             - UIPasteboardTests.DataTransferGetDataWhenPastingImageAndText
28
29         * dom/DataTransfer.cpp:
30         (WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
31
32         If custom pasteboard data is enabled, suppress getData and setData if and only if we might actually expose file
33         paths (see Pasteboard::fileContentState).
34
35         (WebCore::DataTransfer::types const):
36
37         Only allow "text/html" or "text/uri-list" in the case where there are actual files in the pasteboard. If there's
38         only image data, add all of the DOM-safe types back into the list of types.
39
40         * platform/Pasteboard.h:
41         * platform/StaticPasteboard.h:
42
43         Add an enum type to represent the result of Pasteboard::fileContentState.
44         -   NoFileOrImageData indicates that there was nothing on the pasteboard that could be considered a file
45             from the point of view of the page.
46         -   InMemoryImage indicates that there are no files on the pasteboard, but there is image data that we consider
47             to be files, exposed via DataTransfer API.
48         -   MayContainFilePaths indicates that there might be file paths on the pasteboard. This means that the source
49             has either written file paths to the pasteboard (for example, through NSFilenamesPboardType) or the source
50             has written image data along with a URL type of some sort that does not match one of the allowed URL schemes
51             that are safe to expose (currently, these are http-family, data, or blob).
52
53         * platform/cocoa/PasteboardCocoa.mm:
54         (WebCore::Pasteboard::fileContentState):
55
56         Refactor to return one of the three enum types described above.
57
58         (WebCore::Pasteboard::containsFiles): Deleted.
59         * platform/gtk/PasteboardGtk.cpp:
60         (WebCore::Pasteboard::fileContentState):
61         (WebCore::Pasteboard::containsFiles): Deleted.
62         * platform/win/PasteboardWin.cpp:
63         (WebCore::Pasteboard::fileContentState):
64         (WebCore::Pasteboard::containsFiles): Deleted.
65         * platform/wpe/PasteboardWPE.cpp:
66         (WebCore::Pasteboard::fileContentState):
67         (WebCore::Pasteboard::containsFiles): Deleted.
68
69         Adjust for Pasteboard::fileContentState() tweaks.
70
71 2018-03-09  Chris Fleizach  <cfleizach@apple.com>
72
73         AX: WebKit seems to be running spell checker even on non-editable content text
74         https://bugs.webkit.org/show_bug.cgi?id=183456
75         <rdar://problem/38076042>
76
77         Reviewed by Joanmarie Diggs.
78
79         Test: accessibility/mac/attributed-string/attributed-string-does-not-includes-misspelled-for-non-editable.html
80
81         Only apply misspelled attributes if it's for editable text. It's not useful or performant to do this for static text.
82
83         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
84         (AXAttributeStringSetSpelling):
85
86 2018-03-09  Nan Wang  <n_wang@apple.com>
87
88         AX: AOM: More accessibility events support
89         https://bugs.webkit.org/show_bug.cgi?id=183023
90         <rdar://problem/37764380>
91
92         Reviewed by Chris Fleizach.
93
94         The test is crashing when we call updateBackingStore when 
95         the AXObjectCache object is gone. Added a check to fix that.
96
97         Modified the test by using the right format of setTimeout and extended the delay.
98
99         * accessibility/AccessibilityObject.cpp:
100         (WebCore::AccessibilityObject::updateBackingStore):
101
102 2018-03-09  Ross Kirsling  <ross.kirsling@sony.com>
103
104         Unreviewed. Fix WinCairo build after r229497.
105
106         * platform/MIMETypeRegistry.cpp:
107         (WebCore::MIMETypeRegistry::getNormalizedMIMEType):
108
109 2018-03-09  Ross Kirsling  <ross.kirsling@sony.com>
110
111         Clean up MIMETypeRegistry::mimeTypeAssociationMap for Curl
112         https://bugs.webkit.org/show_bug.cgi?id=170529
113
114         Reviewed by Alex Christensen.
115
116         * platform/MIMETypeRegistry.cpp:
117         (WebCore::MIMETypeRegistry::getNormalizedMIMEType):
118         (WebCore::mimeTypeAssociationMap): Deleted.
119         Create map with makeNeverDestroyed and a loop instead.
120
121 2018-03-09  Brian Burg  <bburg@apple.com>
122
123         Web Inspector: there should only be one way for async backend commands to send failure
124         https://bugs.webkit.org/show_bug.cgi?id=183524
125
126         Reviewed by Timothy Hatcher.
127
128         Remove some useless ErrorString arguments. Fix some bugs where we
129         may never call the callback in an early exit situation.
130
131         Covered by existing Inspector and protocol generator tests.
132
133         * inspector/agents/InspectorDatabaseAgent.cpp:
134         (WebCore::InspectorDatabaseAgent::executeSQL):
135         * inspector/agents/InspectorDatabaseAgent.h:
136         * inspector/agents/InspectorIndexedDBAgent.h:
137         * inspector/agents/InspectorIndexedDBAgent.cpp:
138         (WebCore::getDocumentAndIDBFactoryFromFrameOrSendFailure):
139         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
140         (WebCore::InspectorIndexedDBAgent::requestDatabase):
141         (WebCore::InspectorIndexedDBAgent::requestData):
142         (WebCore::InspectorIndexedDBAgent::clearObjectStore):
143         (WebCore::assertDocument): Deleted.
144         (WebCore::assertIDBFactory): Deleted.
145         Modernize this code a little bit to share the document/idbFactory extraction code.
146
147         * inspector/agents/InspectorNetworkAgent.cpp:
148         (WebCore::InspectorNetworkAgent::loadResource):
149         * inspector/agents/InspectorNetworkAgent.h:
150
151 2018-03-09  Youenn Fablet  <youenn@apple.com>
152
153         Crash in ServiceWorkerContainer::ready
154         https://bugs.webkit.org/show_bug.cgi?id=183380
155
156         Reviewed by Chris Dumez.
157
158         Not using 'this' through lambdas.
159         Instead rely on the last lambda that is passed a ScriptExecutionContext& to get back 'this' which is a ServiceWorkerContainer.
160
161         Should be covered by imported/w3c/web-platform-tests/service-workers/service-worker/register-default-scope.https.html no longer crashing.
162         Although it should probably be LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html that should crash
163         since this is the main test using ready.
164
165         * workers/service/ServiceWorkerContainer.cpp:
166         (WebCore::ServiceWorkerContainer::ready):
167
168 2018-03-09  Youenn Fablet  <youenn@apple.com>
169
170         RealtimeOutgoingAudioSource and RealtimeOutgoingVideoSource should be destroyed on the main thread
171         https://bugs.webkit.org/show_bug.cgi?id=183483
172         <rdar://problem/38214152>
173
174         Reviewed by Eric Carlson.
175
176         When dereferencing from libwebrtc code path, schedule a call to deref on main thread.
177         WebCore dereferencing is happening in the main thread so this guarantees destruction on the main thread.
178
179         Covered by updated mock libwebrtc peer connection backend.
180         We make mock senders to keep a reference to their source which are RealtimeOutgoingXXSource.
181         We then make mock peer connection backend to free the mock senders in a background thread.
182
183         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
184         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
185         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
186         (WebCore::RealtimeOutgoingAudioSource::stop):
187         * platform/mediastream/RealtimeOutgoingAudioSource.h:
188         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
189         (WebCore::RealtimeOutgoingVideoSource::stop):
190         * platform/mediastream/RealtimeOutgoingVideoSource.h:
191         * testing/MockLibWebRTCPeerConnection.cpp:
192         (WebCore::ThreadKeeper::create):
193         (WebCore::ThreadKeeper::setThread):
194         (WebCore::MockLibWebRTCPeerConnection::~MockLibWebRTCPeerConnection):
195         * testing/MockLibWebRTCPeerConnection.h:
196
197 2018-03-09  Jer Noble  <jer.noble@apple.com>
198
199         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
200         https://bugs.webkit.org/show_bug.cgi?id=183501
201
202         Reviewed by Eric Carlson.
203
204         No need for these methods to be PLATFORM(MAC) only.
205
206         * platform/cocoa/PlaybackSessionModel.h:
207         (WebCore::PlaybackSessionModelClient::ensureControlsManager):
208         * platform/ios/VideoFullscreenInterfaceAVKit.h:
209         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
210         (VideoFullscreenInterfaceAVKit::isPlayingVideoInEnhancedFullscreen const):
211         * platform/mac/VideoFullscreenInterfaceMac.h:
212
213 2018-03-09  Youenn Fablet  <youenn@apple.com>
214
215         ServiceWorker should respect IDB and DOMCache partitioning
216         https://bugs.webkit.org/show_bug.cgi?id=183496
217
218         Reviewed by Brady Eidson.
219
220         Test: http/wpt/service-workers/third-party-registration.html
221
222         Set the correct top origin of service worker ScriptExecutionContext.
223
224         * workers/service/context/ServiceWorkerThread.cpp:
225         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
226
227 2018-03-09  Youenn Fablet  <youenn@apple.com>
228
229         Cannot change audio input source device
230         https://bugs.webkit.org/show_bug.cgi?id=175975
231         <rdar://problem/34073589>
232
233         Reviewed by Eric Carlson.
234
235         Covered by manually testing https://webrtc.github.io/samples/src/content/devices/input-output/ with a USB web cam.
236
237         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
238         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID):
239         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
240
241 2018-03-09  Jer Noble  <jer.noble@apple.com>
242
243         Add new CSS env constants for use with fullscreen
244         https://bugs.webkit.org/show_bug.cgi?id=183498
245
246         Reviewed by Dean Jackson.
247
248         Tests: fullscreen/fullscreen-auto-hide-delay.html
249                fullscreen/fullscreen-inset-top.html
250
251         * dom/ConstantPropertyMap.cpp:
252         (WebCore::ConstantPropertyMap::nameForProperty const):
253         (WebCore::variableDataForPositiveDuration):
254         (WebCore::ConstantPropertyMap::setFullscreenInsetTop):
255         (WebCore::ConstantPropertyMap::setFullscreenAutoHideDelay):
256         * dom/ConstantPropertyMap.h:
257         * page/Page.cpp:
258         (WebCore::Page::setFullscreenInsetTop):
259         (WebCore::Page::setFullscreenAutoHideDelay):
260         * page/Page.h:
261         * testing/Internals.cpp:
262         (WebCore::Internals::resetToConsistentState):
263         (WebCore::Internals::setFullscreenInsetTop):
264         (WebCore::Internals::setFullscreenAutoHideDelay):
265         * testing/Internals.h:
266         * testing/Internals.idl:
267
268 2018-03-09  Zalan Bujtas  <zalan@apple.com>
269
270         RenderTreeBuilder::splitAnonymousBoxesAroundChild should take multicolumn spanners into account.
271         https://bugs.webkit.org/show_bug.cgi?id=183493
272         <rdar://problem/38030461>
273
274         Reviewed by Antti Koivisto.
275
276         Multicolumn spanners are taken out of their original position and placed next
277         to a RenderMultiColumnSet. splitAnonymousBoxesAroundChild needs to know the original parent (in the render tree context).
278
279         Test: fast/multicol/adjust-beforeChild-for-spanner-crash.html
280
281         * rendering/updating/RenderTreeBuilder.cpp:
282         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
283         * rendering/updating/RenderTreeBuilder.h:
284         * rendering/updating/RenderTreeBuilderBlock.cpp:
285         (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
286         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
287         (WebCore::RenderTreeBuilder::MultiColumn::adjustBeforeChildForMultiColumnSpannerIfNeeded):
288         * rendering/updating/RenderTreeBuilderMultiColumn.h:
289         * rendering/updating/RenderTreeBuilderRuby.cpp:
290         (WebCore::RenderTreeBuilder::Ruby::moveChildrenInternal):
291         * rendering/updating/RenderTreeBuilderTable.cpp:
292         (WebCore::RenderTreeBuilder::Table::attach):
293
294 2018-03-09  Jer Noble  <jer.noble@apple.com>
295
296         Add isPictureInPictureActive messaging across WebKit process boundary
297         https://bugs.webkit.org/show_bug.cgi?id=183499
298
299         Reviewed by Eric Carlson.
300
301         * platform/cocoa/PlaybackSessionModel.h:
302         (WebCore::PlaybackSessionModelClient::pictureInPictureActiveChanged):
303         * platform/cocoa/PlaybackSessionModelMediaElement.h:
304         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
305         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
306         (WebCore::PlaybackSessionModelMediaElement::isPictureInPictureActive const):
307         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
308         (VideoFullscreenControllerContext::isPictureInPictureActive const):
309
310 2018-03-09  Basuke Suzuki  <Basuke.Suzuki@sony.com>
311
312         [Curl] Implement connection limit.
313         https://bugs.webkit.org/show_bug.cgi?id=183016
314
315         Implement both connection limit per host and total
316         connection limit on curl network layer.
317
318         Reviewed by Youenn Fablet.
319
320         No new tests because there's no behavior change.
321
322         * platform/network/curl/CurlContext.cpp:
323         (WebCore::EnvironmentVariableReader::sscanTemplate<signed>):
324         (WebCore::CurlContext::CurlContext):
325         (WebCore::CurlMultiHandle::setMaxConnects):
326         (WebCore::CurlMultiHandle::setMaxTotalConnections):
327         (WebCore::CurlMultiHandle::setMaxHostConnections):
328         * platform/network/curl/CurlContext.h:
329         (WebCore::CurlContext::scheduler):
330         * platform/network/curl/CurlRequest.cpp:
331         (WebCore::CurlRequest::startWithJobManager):
332         (WebCore::CurlRequest::cancel):
333         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
334         (WebCore::CurlRequest::completeDidReceiveResponse):
335         (WebCore::CurlRequest::pausedStatusChanged):
336         * platform/network/curl/CurlRequestScheduler.cpp:
337         (WebCore::CurlRequestScheduler::CurlRequestScheduler):
338         (WebCore::CurlRequestScheduler::workerThread):
339         (WebCore::CurlRequestScheduler::singleton): Deleted.
340         * platform/network/curl/CurlRequestScheduler.h:
341
342 2018-03-09  Jer Noble  <jer.noble@apple.com>
343
344         webkitfullscreenchange event not fired at the same time as :-webkit-full-screen pseudo selector changes; causes glitchiness
345         https://bugs.webkit.org/show_bug.cgi?id=183383
346
347         Reviewed by Eric Carlson.
348
349         Fire the webkitfullscreenchange event at the same time as the pseudo class selector changes, during the handling
350         of webkitDidEnterFullScreenForElement. For WebKit2 clients, this is guaranteed to be asynchronous, since the
351         calling method originates in the UIProcess. For WebKit1 clients (and WKTR and DRT), there's the possibility that
352         webkitWillEnterFullScreenForElement will be called synchronously from within
353         Document::requestFullScreenForElement(), so break that synchronousness by starting the
354         ChromeClient::enterFullScreenForElement(...) process in a async task.
355
356         Previously, the firing of the fullscreenchange event was done through a zero-length timer. Use a
357         GenericTaskQueue instead.
358
359         A number of layout tests depend on the behavior that the element will be in fullscreen when the 'playing' event
360         fires. This was true for DRT (but not WKTR), since its fullscreen implementations were deliberately synchronous, but
361         won't necessarily be true for all ports. Fix this in a subsequent patch.
362
363         * dom/Document.cpp:
364         (WebCore::Document::requestFullScreenForElement):
365         (WebCore::Document::webkitExitFullscreen):
366         (WebCore::Document::webkitWillEnterFullScreenForElement):
367         (WebCore::Document::webkitDidEnterFullScreenForElement):
368         (WebCore::Document::webkitDidExitFullScreenForElement):
369         (WebCore::Document::dispatchFullScreenChangeEvents):
370         * dom/Document.h:
371         * html/HTMLMediaElement.cpp:
372         (WebCore::HTMLMediaElement::setReadyState):
373         (WebCore::HTMLMediaElement::playInternal):
374         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
375         (WebCore::HTMLMediaElement::updatePlayState):
376         (WebCore::HTMLMediaElement::setPlaying):
377
378 2018-03-09  Zan Dobersek  <zdobersek@igalia.com>
379
380         [Nicosia] Add threaded PaintingEngine implementation
381         https://bugs.webkit.org/show_bug.cgi?id=183511
382
383         Reviewed by Carlos Garcia Campos.
384
385         Add Nicosia::PaintingEngineThreaded, class that internally uses a thread
386         pool in which painting tasks are executed.
387
388         Implementation for now defaults to using GLib's GThreadPool, defaulting
389         to 4 threads that are exclusive to this pool. These parameters should be
390         fine-tuned in the future, or even made configurable, but are a solid
391         basis for testing.
392
393         In PaintingEngineThreaded::paint(), PaintingContext implementation is
394         used to record all the operations, and the gathered Vector is combined
395         with the Buffer object and dispatched into the thread pool. In the
396         thread function, the provided buffer and painting operations are run
397         through the PaintingContext implementation, replaying all the operations
398         on a painting context that draws into the given buffer.
399
400         The recorded operation objects implement the PaintingOperation interface
401         contain all the data necessary to replay a given operation. They can be
402         executed against a PaintingOperationReplay object, as is the case during
403         PaintingContext::replay(), or they can be dumped into a TextStream
404         object for debugging purposes.
405
406         PaintingContext now also provides the record() and replay() static
407         functions. PaintingContext objects now differ per purpose, which can be
408         either for painting or for recording. paint() and replay() use a
409         for-painting PaintingContext, and record() uses a for-recording one.
410         The for-painting PaintingContext receives a Buffer object, i.e. a memory
411         area on which it can draw, while the for-recording PaintingContext uses
412         the passed-in PaintingOperations Vector that should store all the
413         recorded operations.
414
415         The current Cairo implementation of PaintingContext is moved into
416         PaintingContextCairo::ForPainting. PaintingContextCairo::ForRecording is
417         added but is currently no-op until a Cairo-specific GraphicsContextImpl
418         with recording capabilities is added, allowing any call on the
419         GraphicsContext object used in PaintingContext::record() to be recorded
420         for later replay. PaintingOperationReplayCairo, inheriting from
421         PaintingOperationReplay, will be used for replay purposes, providing
422         only reference to the PlatformContextCairo object that is constructed in
423         PaintingContextCairo::ForPainting.
424
425         The Cairo-specific GraphicsContextImpl implementation will be added in
426         a separate patch. After that, PaintingEngine::create() will be modified
427         so that the Nicosia::PaintingEngineThreaded implementation can be used
428         for testing purposes, probably by setting an environment variable.
429
430         * platform/TextureMapper.cmake:
431         * platform/graphics/nicosia/NicosiaPaintingContext.cpp:
432         (Nicosia::PaintingContext::createForPainting):
433         (Nicosia::PaintingContext::createForRecording):
434         (Nicosia::PaintingContext::create): Deleted.
435         * platform/graphics/nicosia/NicosiaPaintingContext.h:
436         (Nicosia::PaintingContext::paint):
437         (Nicosia::PaintingContext::record):
438         (Nicosia::PaintingContext::replay):
439         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp: Added.
440         (Nicosia::s_threadFunc):
441         (Nicosia::paintLayer):
442         (Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
443         (Nicosia::PaintingEngineThreaded::~PaintingEngineThreaded):
444         (Nicosia::PaintingEngineThreaded::paint):
445         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
446         * platform/graphics/nicosia/NicosiaPaintingOperation.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
447         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
448         (Nicosia::PaintingContextCairo::ForPainting::ForPainting):
449         (Nicosia::PaintingContextCairo::ForPainting::~ForPainting):
450         (Nicosia::PaintingContextCairo::ForPainting::graphicsContext):
451         (Nicosia::PaintingContextCairo::ForPainting::replay):
452         (Nicosia::PaintingContextCairo::ForRecording::ForRecording):
453         (Nicosia::PaintingContextCairo::ForRecording::graphicsContext):
454         (Nicosia::PaintingContextCairo::ForRecording::replay):
455         (Nicosia::PaintingContextCairo::PaintingContextCairo): Deleted.
456         (Nicosia::PaintingContextCairo::~PaintingContextCairo): Deleted.
457         (Nicosia::PaintingContextCairo::graphicsContext): Deleted.
458         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h:
459         * platform/graphics/nicosia/cairo/NicosiaPaintingOperationReplayCairo.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
460         (Nicosia::PaintingOperationReplayCairo::PaintingOperationReplayCairo):
461
462 2018-03-09  Zan Dobersek  <zdobersek@igalia.com>
463
464         Remove some unused cruft in TextureMapperLayer.
465
466         The ScrollingClient class is not used anymore since r229318.
467         findScrollableContentsLayerAt() is similarly unused, but also lacking
468         an actual definition. ContentsLayerCount enum can also be purged.
469
470         Rubber-stamped by Carlos Garcia Campos.
471
472         * platform/graphics/texmap/TextureMapperLayer.h:
473
474 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
475
476         Add basic synchronization capability to Nicosia::Buffer
477         https://bugs.webkit.org/show_bug.cgi?id=183500
478
479         Reviewed by Carlos Garcia Campos.
480
481         Have Nicosia::Buffer track a painting state, and allow that state to be
482         modified and accessed from different threads. The PaintingState enum
483         value is protected by a Lock object, and can be modified via the
484         beginPainting() and completePainting() methods. Additionally, the
485         waitUntilPaintingComplete() method allows the caller to wait until the
486         painting is complete for the given Nicosia::Buffer object.
487
488         This added state doesn't affect a Nicosia::Buffer object internally, and
489         doesn't have any effect on  existing usages of Nicosia::Buffer (which
490         are not multi-threaded).
491
492         * platform/graphics/nicosia/NicosiaBuffer.cpp:
493         (Nicosia::Buffer::beginPainting):
494         (Nicosia::Buffer::completePainting):
495         (Nicosia::Buffer::waitUntilPaintingComplete):
496         * platform/graphics/nicosia/NicosiaBuffer.h:
497
498 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
499
500         Move NicosiaPaintingContextCairo files under Cairo-specific directory
501         https://bugs.webkit.org/show_bug.cgi?id=183497
502
503         Reviewed by Carlos Garcia Campos.
504
505         Pack Cairo-specific files in the Nicosia subsystem under cairo/.
506
507         * platform/TextureMapper.cmake:
508         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp: Renamed from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp.
509         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h: Renamed from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContextCairo.h.
510
511 2018-03-08  Nan Wang  <n_wang@apple.com>
512
513         AX: AOM: More accessibility events support
514         https://bugs.webkit.org/show_bug.cgi?id=183023
515         <rdar://problem/37764380>
516
517         Reviewed by Chris Fleizach.
518
519         Fixed the crash that we shouldn't dispatch the accessibility events if the
520         event path is empty.
521
522         Also added a check to not dispatch events if the runtime flag is not enabled.
523
524         Test: accessibility/mac/AOM-events-webarea-crash.html
525
526         * accessibility/AccessibilityObject.cpp:
527         (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const):
528         (WebCore::AccessibilityObject::dispatchAccessibilityEvent const):
529         * accessibility/AccessibilityObject.h:
530
531 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
532
533         Allow WebViews to disable system appearance
534         https://bugs.webkit.org/show_bug.cgi?id=183418
535         <rdar://problem/36975642>
536
537         Reviewed by Tim Horton.
538
539         Not currently testable, tests will be added in a later patch.
540
541         Allow webviews to choose whether or not to follow the default system appearance.
542
543         * css/StyleColor.cpp:
544         (WebCore::StyleColor::colorFromKeyword):
545         * css/StyleColor.h:
546         * css/StyleResolver.cpp:
547         (WebCore::StyleResolver::colorFromPrimitiveValue const):
548         * css/parser/CSSParser.cpp:
549         (WebCore::CSSParser::parseSystemColor):
550         * css/parser/CSSParser.h:
551         * css/parser/CSSParserMode.h:
552         * html/canvas/CanvasRenderingContext2D.cpp:
553         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
554         * html/canvas/CanvasRenderingContext2DBase.cpp:
555         (WebCore::CanvasRenderingContext2DBase::setStrokeColor):
556         (WebCore::CanvasRenderingContext2DBase::setFillColor):
557         * html/canvas/CanvasStyle.cpp:
558         (WebCore::parseColor):
559         (WebCore::parseColorOrCurrentColor):
560         (WebCore::CanvasStyle::createFromString):
561         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
562         * html/canvas/CanvasStyle.h:
563         * page/Page.h:
564         (WebCore::Page::useSystemAppearance const):
565         (WebCore::Page::setUseSystemAppearance):
566         * platform/Theme.cpp:
567         (WebCore::Theme::paint):
568         * platform/Theme.h:
569         * platform/mac/LocalDefaultSystemAppearance.h:
570         * platform/mac/LocalDefaultSystemAppearance.mm:
571         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
572         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
573         * platform/mac/ThemeMac.h:
574         * platform/mac/ThemeMac.mm:
575         (-[WebCoreThemeView initWithUseSystemAppearance:]):
576         (WebCore::paintToggleButton):
577         (WebCore::paintButton):
578         (WebCore::ThemeMac::ensuredView):
579         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
580         (WebCore::ThemeMac::paint):
581         (-[WebCoreThemeView init]): Deleted.
582         * rendering/RenderTheme.cpp:
583         (WebCore::RenderTheme::paint):
584         (WebCore::RenderTheme::systemColor const):
585         (WebCore::RenderTheme::focusRingColor):
586         * rendering/RenderTheme.h:
587         (WebCore::RenderTheme::platformFocusRingColor const):
588         * rendering/RenderThemeIOS.mm:
589         (WebCore::RenderThemeIOS::systemColor const):
590         * rendering/RenderThemeMac.h:
591         * rendering/RenderThemeMac.mm:
592         (WebCore::RenderThemeMac::documentViewFor const):
593         (WebCore::RenderThemeMac::platformFocusRingColor const):
594         (WebCore::RenderThemeMac::systemColor const):
595         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
596         (WebCore::RenderThemeMac::paintSliderThumb):
597         * rendering/TextPaintStyle.cpp:
598         (WebCore::computeTextPaintStyle):
599
600 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
601
602         Ensure default appearance for selection form control
603         https://bugs.webkit.org/show_bug.cgi?id=183482
604         <rdar://problem/38274894>
605
606         Reviewed by Tim Horton.
607   
608         The appearance for selection form controls was not set to default.
609
610         Not currently testable, will add tests in a later patch.
611
612         * rendering/RenderThemeMac.mm:
613         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
614
615 2018-03-08  Per Arne Vollan  <pvollan@apple.com>
616
617         [Win] Compile error: pal/ExportMacros.h not found.
618         https://bugs.webkit.org/show_bug.cgi?id=183467
619
620         Reviewed by Brent Fulgham.
621
622         PAL header files are no longer located under the WebCore folder in forwarding headers. An additional
623         build step is required to copy the PAL header files to the internal include folder.
624
625         No new tests, no change in functionality. 
626
627         * PlatformWin.cmake:
628         * WebCore.vcxproj/WebCore.proj:
629
630 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
631
632         Ensure system appearance is default for legacy webkit
633         https://bugs.webkit.org/show_bug.cgi?id=183473
634         <rdar://problem/38210306>
635
636         Reviewed by Tim Horton.
637
638         Need to set the appearance on the window for legacy webkit due to differences in drawing.
639
640         Not currently testable, will add tests in a later patch.
641
642         * platform/mac/ThemeMac.mm:
643         (WebCore::paintButton):
644
645 2018-03-08  Youenn Fablet  <youenn@apple.com>
646
647         libwebrtc update broke internal builds
648         https://bugs.webkit.org/show_bug.cgi?id=183454
649
650         Reviewed by Eric Carlson.
651
652         No change of behavior.
653         Fixed header search paths.
654         Removed deleted file from XCode project as an additional clean-up.
655
656         * Configurations/WebCore.xcconfig:
657         * WebCore.xcodeproj/project.pbxproj:
658
659 2018-03-08  Per Arne Vollan  <pvollan@apple.com>
660
661         NSAnimation is not working in the WebContent process when WindowServer access is blocked.
662         https://bugs.webkit.org/show_bug.cgi?id=183291
663
664         Reviewed by Dean Jackson.
665
666         The animation can be implemented by using an NSTimer instead. Use the existing Bezier timing
667         function to create a smooth animation.
668
669         No new tests. This code is used to fade scrollbars in and out by animating the alpha value.
670         This scrollbar setting is not the default in macOS, which makes it non trivial to create
671         layout tests for this.
672
673         * platform/mac/ScrollAnimatorMac.mm:
674         (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
675         (-[WebScrollbarPartAnimation startAnimation]):
676         (-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]):
677         (-[WebScrollbarPartAnimation invalidate]):
678         (-[WebScrollbarPartAnimation setDuration:]):
679         (-[WebScrollbarPartAnimation stopAnimation]):
680         (-[WebScrollbarPartAnimation setCurrentProgress:]): Deleted.
681
682 2018-03-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
683
684         Templatize SVGAnimatedType
685         https://bugs.webkit.org/show_bug.cgi?id=183017
686
687         Reviewed by Dean Jackson.
688
689         This is a work toward https://bugs.webkit.org/show_bug.cgi?id=168586. The
690         goal to have SVGAnimatedType be type independent. The appropriate method
691         of this template will be implicitly instantiated based to the type of the
692         animated attribute(s).
693
694         * Sources.txt: Delete SVGAnimatedType.cpp since its function became template
695         functions or short enough to be inline functions.
696         * WebCore.xcodeproj/project.pbxproj:
697         * svg/SVGAnimatedAngle.cpp:
698         (WebCore::SVGAnimatedAngleAnimator::constructFromString):
699         (WebCore::SVGAnimatedAngleAnimator::startAnimValAnimation):
700         (WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
701         (WebCore::SVGAnimatedAngleAnimator::addAnimatedTypes):
702         (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
703         Use the template functions SVGAnimatedType::create<>() and SVGAnimatedType::as<>().
704
705         * svg/SVGAnimatedBoolean.cpp:
706         (WebCore::SVGAnimatedBooleanAnimator::constructFromString):
707         (WebCore::SVGAnimatedBooleanAnimator::startAnimValAnimation):
708         (WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
709         (WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
710         Ditto.
711
712         * svg/SVGAnimatedColor.cpp:
713         (WebCore::SVGAnimatedColorAnimator::constructFromString):
714         (WebCore::SVGAnimatedColorAnimator::addAnimatedTypes):
715         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
716         Ditto.
717
718         * svg/SVGAnimatedEnumeration.cpp:
719         (WebCore::SVGAnimatedEnumerationAnimator::constructFromString):
720         (WebCore::SVGAnimatedEnumerationAnimator::startAnimValAnimation):
721         (WebCore::SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal):
722         (WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
723         Ditto.
724
725         * svg/SVGAnimatedInteger.cpp:
726         (WebCore::SVGAnimatedIntegerAnimator::constructFromString):
727         (WebCore::SVGAnimatedIntegerAnimator::startAnimValAnimation):
728         (WebCore::SVGAnimatedIntegerAnimator::resetAnimValToBaseVal):
729         (WebCore::SVGAnimatedIntegerAnimator::addAnimatedTypes):
730         (WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
731         Ditto.
732
733         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
734         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString):
735         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::startAnimValAnimation):
736         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal):
737         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::addAnimatedTypes):
738         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
739         Ditto.
740
741         * svg/SVGAnimatedLength.cpp:
742         (WebCore::SVGAnimatedLengthAnimator::constructFromString):
743         (WebCore::SVGAnimatedLengthAnimator::startAnimValAnimation):
744         (WebCore::SVGAnimatedLengthAnimator::resetAnimValToBaseVal):
745         (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
746         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
747         Ditto.
748
749         * svg/SVGAnimatedLengthList.cpp:
750         (WebCore::SVGAnimatedLengthListAnimator::constructFromString):
751         (WebCore::SVGAnimatedLengthListAnimator::startAnimValAnimation):
752         (WebCore::SVGAnimatedLengthListAnimator::resetAnimValToBaseVal):
753         (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
754         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
755         Ditto.
756
757         * svg/SVGAnimatedNumber.cpp:
758         (WebCore::SVGAnimatedNumberAnimator::constructFromString):
759         (WebCore::SVGAnimatedNumberAnimator::startAnimValAnimation):
760         (WebCore::SVGAnimatedNumberAnimator::resetAnimValToBaseVal):
761         (WebCore::SVGAnimatedNumberAnimator::addAnimatedTypes):
762         (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
763         Ditto.
764
765         * svg/SVGAnimatedNumberList.cpp:
766         (WebCore::SVGAnimatedNumberListAnimator::constructFromString):
767         (WebCore::SVGAnimatedNumberListAnimator::startAnimValAnimation):
768         (WebCore::SVGAnimatedNumberListAnimator::resetAnimValToBaseVal):
769         (WebCore::SVGAnimatedNumberListAnimator::addAnimatedTypes):
770         (WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
771         Ditto.
772
773         * svg/SVGAnimatedNumberOptionalNumber.cpp:
774         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::constructFromString):
775         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation):
776         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal):
777         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::addAnimatedTypes):
778         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
779         Ditto.
780
781         * svg/SVGAnimatedPath.cpp:
782         (WebCore::SVGAnimatedPathAnimator::constructFromString):
783         (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation):
784         (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
785         (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes):
786         (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
787         Ditto.
788
789         * svg/SVGAnimatedPointList.cpp:
790         (WebCore::SVGAnimatedPointListAnimator::constructFromString):
791         (WebCore::SVGAnimatedPointListAnimator::startAnimValAnimation):
792         (WebCore::SVGAnimatedPointListAnimator::resetAnimValToBaseVal):
793         (WebCore::SVGAnimatedPointListAnimator::addAnimatedTypes):
794         (WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
795         Ditto.
796
797         * svg/SVGAnimatedPreserveAspectRatio.cpp:
798         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString):
799         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation):
800         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal):
801         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
802         Ditto.
803
804         * svg/SVGAnimatedRect.cpp:
805         (WebCore::SVGAnimatedRectAnimator::constructFromString):
806         (WebCore::SVGAnimatedRectAnimator::startAnimValAnimation):
807         (WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
808         (WebCore::SVGAnimatedRectAnimator::addAnimatedTypes):
809         (WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
810         Ditto.
811
812         * svg/SVGAnimatedString.cpp:
813         (WebCore::SVGAnimatedStringAnimator::constructFromString):
814         (WebCore::SVGAnimatedStringAnimator::startAnimValAnimation):
815         (WebCore::SVGAnimatedStringAnimator::resetAnimValToBaseVal):
816         (WebCore::SVGAnimatedStringAnimator::calculateAnimatedValue):
817         Ditto.
818
819         * svg/SVGAnimatedTransformList.cpp:
820         (WebCore::SVGAnimatedTransformListAnimator::constructFromString):
821         (WebCore::SVGAnimatedTransformListAnimator::startAnimValAnimation):
822         (WebCore::SVGAnimatedTransformListAnimator::resetAnimValToBaseVal):
823         (WebCore::SVGAnimatedTransformListAnimator::addAnimatedTypes):
824         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
825         (WebCore::SVGAnimatedTransformListAnimator::calculateDistance):
826         Ditto.
827
828         * svg/SVGAnimatedType.cpp: Removed.
829         * svg/SVGAnimatedType.h:
830         (WebCore::SVGAnimatedType::create):
831         (WebCore::SVGAnimatedType::SVGAnimatedType):
832         (WebCore::SVGAnimatedType::~SVGAnimatedType):
833         (WebCore::SVGAnimatedType::as const):
834         (WebCore::SVGAnimatedType::as):
835         (WebCore::SVGAnimatedType::type const):
836         (WebCore::SVGAnimatedType::valueAsString const):
837         (WebCore::SVGAnimatedType::setValueAsString):
838         (WebCore::SVGAnimatedType::supportsAnimVal):
839         (WebCore::SVGAnimatedType::angleAndEnumeration const): Deleted.
840         (WebCore::SVGAnimatedType::boolean const): Deleted.
841         (WebCore::SVGAnimatedType::color const): Deleted.
842         (WebCore::SVGAnimatedType::enumeration const): Deleted.
843         (WebCore::SVGAnimatedType::integer const): Deleted.
844         (WebCore::SVGAnimatedType::integerOptionalInteger const): Deleted.
845         (WebCore::SVGAnimatedType::length const): Deleted.
846         (WebCore::SVGAnimatedType::lengthList const): Deleted.
847         (WebCore::SVGAnimatedType::number const): Deleted.
848         (WebCore::SVGAnimatedType::numberList const): Deleted.
849         (WebCore::SVGAnimatedType::numberOptionalNumber const): Deleted.
850         (WebCore::SVGAnimatedType::path const): Deleted.
851         (WebCore::SVGAnimatedType::pointList const): Deleted.
852         (WebCore::SVGAnimatedType::preserveAspectRatio const): Deleted.
853         (WebCore::SVGAnimatedType::rect const): Deleted.
854         (WebCore::SVGAnimatedType::string const): Deleted.
855         (WebCore::SVGAnimatedType::transformList const): Deleted.
856         (WebCore::SVGAnimatedType::angleAndEnumeration): Deleted.
857         (WebCore::SVGAnimatedType::boolean): Deleted.
858         (WebCore::SVGAnimatedType::color): Deleted.
859         (WebCore::SVGAnimatedType::enumeration): Deleted.
860         (WebCore::SVGAnimatedType::integer): Deleted.
861         (WebCore::SVGAnimatedType::integerOptionalInteger): Deleted.
862         (WebCore::SVGAnimatedType::length): Deleted.
863         (WebCore::SVGAnimatedType::lengthList): Deleted.
864         (WebCore::SVGAnimatedType::number): Deleted.
865         (WebCore::SVGAnimatedType::numberList): Deleted.
866         (WebCore::SVGAnimatedType::numberOptionalNumber): Deleted.
867         (WebCore::SVGAnimatedType::path): Deleted.
868         (WebCore::SVGAnimatedType::pointList): Deleted.
869         (WebCore::SVGAnimatedType::preserveAspectRatio): Deleted.
870         (WebCore::SVGAnimatedType::rect): Deleted.
871         (WebCore::SVGAnimatedType::string): Deleted.
872         (WebCore::SVGAnimatedType::transformList): Deleted.
873         Replace the union by a Variant. Replace all the type specific functions
874         by the template functions create() and as(). Use WTF::visit to get the
875         value stored in the variant. Use the SVGPropertyTraits to perform the
876         required operation.
877
878         * svg/SVGAnimatedTypeAnimator.h:
879         (WebCore::SVGAnimatedTypeAnimator::constructFromBaseValue):
880         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue):
881         (WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForType):
882         (WebCore::SVGAnimatedTypeAnimator::animValDidChangeForType):
883         (WebCore::SVGAnimatedTypeAnimator::animValWillChangeForType):
884         (WebCore::SVGAnimatedTypeAnimator::constructFromBaseValues):
885         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues):
886         (WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForTypes):
887         (WebCore::SVGAnimatedTypeAnimator::animValDidChangeForTypes):
888         (WebCore::SVGAnimatedTypeAnimator::animValWillChangeForTypes):
889         (WebCore::SVGAnimatedTypeAnimator::executeAction):
890         Rename the parameters and the local variables to match their types. Use
891         the SVGAnimatedType template functions create() and as().
892
893         * svg/SVGLengthValue.h:
894         (WebCore::SVGPropertyTraits<SVGLengthValue>::parse): This was moved from
895         SVGAnimatedType::setValueAsString()
896         (WebCore::SVGPropertyTraits<SVGLengthValue>::toString): This was moved from
897         SVGAnimatedType::valueAsString().
898
899         * svg/SVGMarkerTypes.h: Add placeholders for parse() and toString() so
900         SVGAnimatedType::valueAsString() and setValueAsString() can compile for 
901         all types.
902
903         * svg/SVGNumberListValues.h:
904         (WebCore::SVGPropertyTraits<SVGNumberListValues>::parse):
905         * svg/SVGPathByteStream.h:
906         (WebCore::SVGPropertyTraits<SVGPathByteStream>::parse):
907         (WebCore::SVGPropertyTraits<SVGPathByteStream>::toString):
908         * svg/SVGPointListValues.h:
909         (WebCore::SVGPropertyTraits<SVGPointListValues>::parse):
910         (WebCore::SVGPropertyTraits<SVGPointListValues>::toString):
911         * svg/SVGPreserveAspectRatioValue.h:
912         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString):
913         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::parse):
914         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::toString):
915         Ditto.
916
917         * svg/SVGTransformListValues.h:
918         (WebCore::SVGPropertyTraits<SVGTransformListValues>::parse):
919         Ditto.
920
921         * svg/SVGValue.h: Added. SVGValueVariant is the replacement of the union
922         SVGAnimatedType::DataUnion.
923
924         * svg/properties/SVGPropertyInfo.h:
925         Add a minimum and maximum AnimatedPropertyType so, SVGAnimatedType::type()
926         can assert that the index of the variant is in the range of this enum.
927
928         * svg/properties/SVGPropertyTraits.h:
929         (WebCore::SVGPropertyTraits<bool>::parse):
930         (WebCore::SVGPropertyTraits<unsigned>::parse):
931         (WebCore::SVGPropertyTraits<int>::parse):
932         Ditto.
933
934 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
935
936         [JSC][WebCore] Extend jsDynamicCast for WebCore types in WebCore and remove jsDynamicDowncast
937         https://bugs.webkit.org/show_bug.cgi?id=183449
938
939         Reviewed by Mark Lam.
940
941         This patch removes jsDynamicDowncast. Our JSC::jsDynamicCast can have a way to inject a fast
942         path that is similar to jsDynamicDowncast. WebCore can leverage this functionality to add
943         a fast path for WebCore's extended JS object types (JSEvent, JSElement, JSNode, and JSDocument).
944
945         No behavior change.
946
947         * WebCore.xcodeproj/project.pbxproj:
948         * bindings/js/CommonVM.cpp:
949         (WebCore::lexicalFrameFromCommonVM):
950         * bindings/js/JSDOMConvertBufferSource.h:
951         (WebCore::toPossiblySharedArrayBufferView):
952         * bindings/js/JSDOMConvertPromise.h:
953         (WebCore::Converter<IDLPromise<T>>::convert):
954         * bindings/js/JSDOMExceptionHandling.cpp:
955         (WebCore::reportException):
956         (WebCore::retrieveErrorMessage):
957         * bindings/js/JSDOMIterator.h:
958         (WebCore::IteratorTraits>::next):
959         * bindings/js/JSDOMWindowProxy.cpp:
960         (WebCore::JSDOMWindowProxy::toWrapped):
961         * bindings/js/JSDOMWrapperCache.h:
962         * bindings/js/JSDocumentCustom.h:
963         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSDocument>::inherits):
964         (WebCore::jsDocumentCast): Deleted.
965         * bindings/js/JSDynamicDowncast.h: Removed.
966         * bindings/js/JSElementCustom.h:
967         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSElement>::inherits):
968         (WebCore::jsElementCast): Deleted.
969         * bindings/js/JSEventCustom.h:
970         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSEvent>::inherits):
971         (WebCore::jsEventCast): Deleted.
972         * bindings/js/JSEventTargetCustom.cpp:
973         (WebCore::jsEventTargetCast):
974         * bindings/js/JSNodeCustom.h:
975         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSNode>::inherits):
976         (WebCore::jsNodeCast): Deleted.
977         * bindings/js/JSPluginElementFunctions.cpp:
978         (WebCore::pluginElementPropertyGetter):
979         * bindings/js/JSReadableStreamSourceCustom.cpp:
980         (WebCore::JSReadableStreamSource::start):
981         * bindings/js/JSWorkerGlobalScopeBase.cpp:
982         (WebCore::toJSDedicatedWorkerGlobalScope):
983         (WebCore::toJSWorkerGlobalScope):
984         (WebCore::toJSServiceWorkerGlobalScope):
985         * bindings/js/ReadableStream.cpp:
986         (WebCore::ReadableStream::create):
987         (WebCore::ReadableStream::isDisturbed):
988         * bindings/js/ReadableStream.h:
989         (WebCore::JSReadableStreamWrapperConverter::toWrapped):
990         * bindings/js/ScriptModuleLoader.cpp:
991         (WebCore::ScriptModuleLoader::evaluate):
992         * bindings/js/SerializedScriptValue.cpp:
993         (WebCore::CloneSerializer::dumpIfTerminal):
994         (WebCore::CloneSerializer::serialize):
995         * bindings/js/StructuredClone.cpp:
996         (WebCore::structuredCloneArrayBufferView):
997         * bindings/scripts/CodeGeneratorJS.pm:
998         (GetCastingHelperForThisObject):
999         (GenerateImplementation):
1000         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1001         (WebCore::jsInterfaceNameConstructor):
1002         (WebCore::setJSInterfaceNameConstructor):
1003         (WebCore::JSInterfaceName::toWrapped):
1004         * bindings/scripts/test/JS/JSMapLike.cpp:
1005         (WebCore::IDLAttribute<JSMapLike>::cast):
1006         (WebCore::IDLOperation<JSMapLike>::cast):
1007         (WebCore::jsMapLikeConstructor):
1008         (WebCore::setJSMapLikeConstructor):
1009         (WebCore::JSMapLike::toWrapped):
1010         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1011         (WebCore::IDLAttribute<JSReadOnlyMapLike>::cast):
1012         (WebCore::IDLOperation<JSReadOnlyMapLike>::cast):
1013         (WebCore::jsReadOnlyMapLikeConstructor):
1014         (WebCore::setJSReadOnlyMapLikeConstructor):
1015         (WebCore::JSReadOnlyMapLike::toWrapped):
1016         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1017         (WebCore::IDLAttribute<JSTestActiveDOMObject>::cast):
1018         (WebCore::IDLOperation<JSTestActiveDOMObject>::cast):
1019         (WebCore::jsTestActiveDOMObjectConstructor):
1020         (WebCore::setJSTestActiveDOMObjectConstructor):
1021         (WebCore::JSTestActiveDOMObject::toWrapped):
1022         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1023         (WebCore::IDLAttribute<JSTestCEReactions>::cast):
1024         (WebCore::IDLOperation<JSTestCEReactions>::cast):
1025         (WebCore::jsTestCEReactionsConstructor):
1026         (WebCore::setJSTestCEReactionsConstructor):
1027         (WebCore::JSTestCEReactions::toWrapped):
1028         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1029         (WebCore::IDLAttribute<JSTestCEReactionsStringifier>::cast):
1030         (WebCore::IDLOperation<JSTestCEReactionsStringifier>::cast):
1031         (WebCore::jsTestCEReactionsStringifierConstructor):
1032         (WebCore::setJSTestCEReactionsStringifierConstructor):
1033         (WebCore::JSTestCEReactionsStringifier::toWrapped):
1034         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1035         (WebCore::IDLAttribute<JSTestCallTracer>::cast):
1036         (WebCore::IDLOperation<JSTestCallTracer>::cast):
1037         (WebCore::jsTestCallTracerConstructor):
1038         (WebCore::setJSTestCallTracerConstructor):
1039         (WebCore::JSTestCallTracer::toWrapped):
1040         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1041         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
1042         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
1043         (WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
1044         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1045         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
1046         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
1047         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
1048         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1049         (WebCore::IDLAttribute<JSTestDOMJIT>::cast):
1050         (WebCore::IDLOperation<JSTestDOMJIT>::cast):
1051         (WebCore::jsTestDOMJITConstructor):
1052         (WebCore::setJSTestDOMJITConstructor):
1053         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1054         (WebCore::IDLAttribute<JSTestEnabledBySetting>::cast):
1055         (WebCore::IDLOperation<JSTestEnabledBySetting>::cast):
1056         (WebCore::jsTestEnabledBySettingConstructor):
1057         (WebCore::setJSTestEnabledBySettingConstructor):
1058         (WebCore::JSTestEnabledBySetting::toWrapped):
1059         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1060         (WebCore::IDLAttribute<JSTestEventConstructor>::cast):
1061         (WebCore::jsTestEventConstructorConstructor):
1062         (WebCore::setJSTestEventConstructorConstructor):
1063         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1064         (WebCore::IDLOperation<JSTestEventTarget>::cast):
1065         (WebCore::jsTestEventTargetConstructor):
1066         (WebCore::setJSTestEventTargetConstructor):
1067         (WebCore::JSTestEventTarget::toWrapped):
1068         * bindings/scripts/test/JS/JSTestException.cpp:
1069         (WebCore::IDLAttribute<JSTestException>::cast):
1070         (WebCore::jsTestExceptionConstructor):
1071         (WebCore::setJSTestExceptionConstructor):
1072         (WebCore::JSTestException::toWrapped):
1073         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1074         (WebCore::IDLAttribute<JSTestGenerateIsReachable>::cast):
1075         (WebCore::jsTestGenerateIsReachableConstructor):
1076         (WebCore::setJSTestGenerateIsReachableConstructor):
1077         (WebCore::JSTestGenerateIsReachable::toWrapped):
1078         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1079         (WebCore::IDLAttribute<JSTestGlobalObject>::cast):
1080         (WebCore::IDLOperation<JSTestGlobalObject>::cast):
1081         (WebCore::jsTestGlobalObjectConstructor):
1082         (WebCore::setJSTestGlobalObjectConstructor):
1083         (WebCore::JSTestGlobalObject::toWrapped):
1084         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1085         (WebCore::jsTestIndexedSetterNoIdentifierConstructor):
1086         (WebCore::setJSTestIndexedSetterNoIdentifierConstructor):
1087         (WebCore::JSTestIndexedSetterNoIdentifier::toWrapped):
1088         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1089         (WebCore::jsTestIndexedSetterThrowingExceptionConstructor):
1090         (WebCore::setJSTestIndexedSetterThrowingExceptionConstructor):
1091         (WebCore::JSTestIndexedSetterThrowingException::toWrapped):
1092         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1093         (WebCore::IDLOperation<JSTestIndexedSetterWithIdentifier>::cast):
1094         (WebCore::jsTestIndexedSetterWithIdentifierConstructor):
1095         (WebCore::setJSTestIndexedSetterWithIdentifierConstructor):
1096         (WebCore::JSTestIndexedSetterWithIdentifier::toWrapped):
1097         * bindings/scripts/test/JS/JSTestInterface.cpp:
1098         (WebCore::IDLAttribute<JSTestInterface>::cast):
1099         (WebCore::IDLOperation<JSTestInterface>::cast):
1100         (WebCore::jsTestInterfaceConstructor):
1101         (WebCore::setJSTestInterfaceConstructor):
1102         (WebCore::JSTestInterface::toWrapped):
1103         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1104         (WebCore::IDLAttribute<JSTestInterfaceLeadingUnderscore>::cast):
1105         (WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
1106         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
1107         (WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
1108         * bindings/scripts/test/JS/JSTestIterable.cpp:
1109         (WebCore::IDLOperation<JSTestIterable>::cast):
1110         (WebCore::jsTestIterableConstructor):
1111         (WebCore::setJSTestIterableConstructor):
1112         (WebCore::JSTestIterable::toWrapped):
1113         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1114         (WebCore::IDLAttribute<JSTestJSBuiltinConstructor>::cast):
1115         (WebCore::IDLOperation<JSTestJSBuiltinConstructor>::cast):
1116         (WebCore::jsTestJSBuiltinConstructorConstructor):
1117         (WebCore::setJSTestJSBuiltinConstructorConstructor):
1118         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1119         (WebCore::IDLOperation<JSTestMediaQueryListListener>::cast):
1120         (WebCore::jsTestMediaQueryListListenerConstructor):
1121         (WebCore::setJSTestMediaQueryListListenerConstructor):
1122         (WebCore::JSTestMediaQueryListListener::toWrapped):
1123         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1124         (WebCore::jsTestNamedAndIndexedSetterNoIdentifierConstructor):
1125         (WebCore::setJSTestNamedAndIndexedSetterNoIdentifierConstructor):
1126         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::toWrapped):
1127         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1128         (WebCore::jsTestNamedAndIndexedSetterThrowingExceptionConstructor):
1129         (WebCore::setJSTestNamedAndIndexedSetterThrowingExceptionConstructor):
1130         (WebCore::JSTestNamedAndIndexedSetterThrowingException::toWrapped):
1131         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1132         (WebCore::IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::cast):
1133         (WebCore::jsTestNamedAndIndexedSetterWithIdentifierConstructor):
1134         (WebCore::setJSTestNamedAndIndexedSetterWithIdentifierConstructor):
1135         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::toWrapped):
1136         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1137         (WebCore::jsTestNamedConstructorConstructor):
1138         (WebCore::setJSTestNamedConstructorConstructor):
1139         (WebCore::JSTestNamedConstructor::toWrapped):
1140         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1141         (WebCore::jsTestNamedDeleterNoIdentifierConstructor):
1142         (WebCore::setJSTestNamedDeleterNoIdentifierConstructor):
1143         (WebCore::JSTestNamedDeleterNoIdentifier::toWrapped):
1144         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1145         (WebCore::jsTestNamedDeleterThrowingExceptionConstructor):
1146         (WebCore::setJSTestNamedDeleterThrowingExceptionConstructor):
1147         (WebCore::JSTestNamedDeleterThrowingException::toWrapped):
1148         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1149         (WebCore::IDLOperation<JSTestNamedDeleterWithIdentifier>::cast):
1150         (WebCore::jsTestNamedDeleterWithIdentifierConstructor):
1151         (WebCore::setJSTestNamedDeleterWithIdentifierConstructor):
1152         (WebCore::JSTestNamedDeleterWithIdentifier::toWrapped):
1153         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1154         (WebCore::jsTestNamedDeleterWithIndexedGetterConstructor):
1155         (WebCore::setJSTestNamedDeleterWithIndexedGetterConstructor):
1156         (WebCore::JSTestNamedDeleterWithIndexedGetter::toWrapped):
1157         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1158         (WebCore::jsTestNamedGetterCallWithConstructor):
1159         (WebCore::setJSTestNamedGetterCallWithConstructor):
1160         (WebCore::JSTestNamedGetterCallWith::toWrapped):
1161         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1162         (WebCore::jsTestNamedGetterNoIdentifierConstructor):
1163         (WebCore::setJSTestNamedGetterNoIdentifierConstructor):
1164         (WebCore::JSTestNamedGetterNoIdentifier::toWrapped):
1165         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1166         (WebCore::IDLOperation<JSTestNamedGetterWithIdentifier>::cast):
1167         (WebCore::jsTestNamedGetterWithIdentifierConstructor):
1168         (WebCore::setJSTestNamedGetterWithIdentifierConstructor):
1169         (WebCore::JSTestNamedGetterWithIdentifier::toWrapped):
1170         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1171         (WebCore::jsTestNamedSetterNoIdentifierConstructor):
1172         (WebCore::setJSTestNamedSetterNoIdentifierConstructor):
1173         (WebCore::JSTestNamedSetterNoIdentifier::toWrapped):
1174         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1175         (WebCore::jsTestNamedSetterThrowingExceptionConstructor):
1176         (WebCore::setJSTestNamedSetterThrowingExceptionConstructor):
1177         (WebCore::JSTestNamedSetterThrowingException::toWrapped):
1178         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1179         (WebCore::IDLOperation<JSTestNamedSetterWithIdentifier>::cast):
1180         (WebCore::jsTestNamedSetterWithIdentifierConstructor):
1181         (WebCore::setJSTestNamedSetterWithIdentifierConstructor):
1182         (WebCore::JSTestNamedSetterWithIdentifier::toWrapped):
1183         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1184         (WebCore::IDLOperation<JSTestNamedSetterWithIndexedGetter>::cast):
1185         (WebCore::jsTestNamedSetterWithIndexedGetterConstructor):
1186         (WebCore::setJSTestNamedSetterWithIndexedGetterConstructor):
1187         (WebCore::JSTestNamedSetterWithIndexedGetter::toWrapped):
1188         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1189         (WebCore::IDLOperation<JSTestNamedSetterWithIndexedGetterAndSetter>::cast):
1190         (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterConstructor):
1191         (WebCore::setJSTestNamedSetterWithIndexedGetterAndSetterConstructor):
1192         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::toWrapped):
1193         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1194         (WebCore::jsTestNamedSetterWithOverrideBuiltinsConstructor):
1195         (WebCore::setJSTestNamedSetterWithOverrideBuiltinsConstructor):
1196         (WebCore::JSTestNamedSetterWithOverrideBuiltins::toWrapped):
1197         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1198         (WebCore::IDLAttribute<JSTestNamedSetterWithUnforgableProperties>::cast):
1199         (WebCore::IDLOperation<JSTestNamedSetterWithUnforgableProperties>::cast):
1200         (WebCore::jsTestNamedSetterWithUnforgablePropertiesConstructor):
1201         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesConstructor):
1202         (WebCore::JSTestNamedSetterWithUnforgableProperties::toWrapped):
1203         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1204         (WebCore::IDLAttribute<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::cast):
1205         (WebCore::IDLOperation<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::cast):
1206         (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
1207         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
1208         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::toWrapped):
1209         * bindings/scripts/test/JS/JSTestNode.cpp:
1210         (WebCore::IDLAttribute<JSTestNode>::cast):
1211         (WebCore::IDLOperation<JSTestNode>::cast):
1212         (WebCore::jsTestNodeConstructor):
1213         (WebCore::setJSTestNodeConstructor):
1214         * bindings/scripts/test/JS/JSTestObj.cpp:
1215         (WebCore::IDLAttribute<JSTestObj>::cast):
1216         (WebCore::IDLOperation<JSTestObj>::cast):
1217         (WebCore::jsTestObjConstructor):
1218         (WebCore::setJSTestObjConstructor):
1219         (WebCore::JSTestObj::toWrapped):
1220         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1221         (WebCore::jsTestOverloadedConstructorsConstructor):
1222         (WebCore::setJSTestOverloadedConstructorsConstructor):
1223         (WebCore::JSTestOverloadedConstructors::toWrapped):
1224         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1225         (WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
1226         (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
1227         (WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped):
1228         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1229         (WebCore::IDLOperation<JSTestOverrideBuiltins>::cast):
1230         (WebCore::jsTestOverrideBuiltinsConstructor):
1231         (WebCore::setJSTestOverrideBuiltinsConstructor):
1232         (WebCore::JSTestOverrideBuiltins::toWrapped):
1233         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1234         (WebCore::jsTestPluginInterfaceConstructor):
1235         (WebCore::setJSTestPluginInterfaceConstructor):
1236         (WebCore::JSTestPluginInterface::toWrapped):
1237         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1238         (WebCore::IDLAttribute<JSTestPromiseRejectionEvent>::cast):
1239         (WebCore::jsTestPromiseRejectionEventConstructor):
1240         (WebCore::setJSTestPromiseRejectionEventConstructor):
1241         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1242         (WebCore::IDLAttribute<JSTestSerialization>::cast):
1243         (WebCore::IDLOperation<JSTestSerialization>::cast):
1244         (WebCore::jsTestSerializationConstructor):
1245         (WebCore::setJSTestSerializationConstructor):
1246         (WebCore::JSTestSerialization::toWrapped):
1247         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1248         (WebCore::jsTestSerializationIndirectInheritanceConstructor):
1249         (WebCore::setJSTestSerializationIndirectInheritanceConstructor):
1250         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1251         (WebCore::IDLAttribute<JSTestSerializationInherit>::cast):
1252         (WebCore::IDLOperation<JSTestSerializationInherit>::cast):
1253         (WebCore::jsTestSerializationInheritConstructor):
1254         (WebCore::setJSTestSerializationInheritConstructor):
1255         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1256         (WebCore::IDLAttribute<JSTestSerializationInheritFinal>::cast):
1257         (WebCore::IDLOperation<JSTestSerializationInheritFinal>::cast):
1258         (WebCore::jsTestSerializationInheritFinalConstructor):
1259         (WebCore::setJSTestSerializationInheritFinalConstructor):
1260         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1261         (WebCore::IDLAttribute<JSTestSerializedScriptValueInterface>::cast):
1262         (WebCore::IDLOperation<JSTestSerializedScriptValueInterface>::cast):
1263         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
1264         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
1265         (WebCore::JSTestSerializedScriptValueInterface::toWrapped):
1266         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1267         (WebCore::IDLOperation<JSTestStringifier>::cast):
1268         (WebCore::jsTestStringifierConstructor):
1269         (WebCore::setJSTestStringifierConstructor):
1270         (WebCore::JSTestStringifier::toWrapped):
1271         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1272         (WebCore::IDLOperation<JSTestStringifierAnonymousOperation>::cast):
1273         (WebCore::jsTestStringifierAnonymousOperationConstructor):
1274         (WebCore::setJSTestStringifierAnonymousOperationConstructor):
1275         (WebCore::JSTestStringifierAnonymousOperation::toWrapped):
1276         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1277         (WebCore::IDLOperation<JSTestStringifierNamedOperation>::cast):
1278         (WebCore::jsTestStringifierNamedOperationConstructor):
1279         (WebCore::setJSTestStringifierNamedOperationConstructor):
1280         (WebCore::JSTestStringifierNamedOperation::toWrapped):
1281         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1282         (WebCore::IDLOperation<JSTestStringifierOperationImplementedAs>::cast):
1283         (WebCore::jsTestStringifierOperationImplementedAsConstructor):
1284         (WebCore::setJSTestStringifierOperationImplementedAsConstructor):
1285         (WebCore::JSTestStringifierOperationImplementedAs::toWrapped):
1286         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1287         (WebCore::IDLOperation<JSTestStringifierOperationNamedToString>::cast):
1288         (WebCore::jsTestStringifierOperationNamedToStringConstructor):
1289         (WebCore::setJSTestStringifierOperationNamedToStringConstructor):
1290         (WebCore::JSTestStringifierOperationNamedToString::toWrapped):
1291         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1292         (WebCore::IDLAttribute<JSTestStringifierReadOnlyAttribute>::cast):
1293         (WebCore::IDLOperation<JSTestStringifierReadOnlyAttribute>::cast):
1294         (WebCore::jsTestStringifierReadOnlyAttributeConstructor):
1295         (WebCore::setJSTestStringifierReadOnlyAttributeConstructor):
1296         (WebCore::JSTestStringifierReadOnlyAttribute::toWrapped):
1297         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1298         (WebCore::IDLAttribute<JSTestStringifierReadWriteAttribute>::cast):
1299         (WebCore::IDLOperation<JSTestStringifierReadWriteAttribute>::cast):
1300         (WebCore::jsTestStringifierReadWriteAttributeConstructor):
1301         (WebCore::setJSTestStringifierReadWriteAttributeConstructor):
1302         (WebCore::JSTestStringifierReadWriteAttribute::toWrapped):
1303         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1304         (WebCore::IDLAttribute<JSTestTypedefs>::cast):
1305         (WebCore::IDLOperation<JSTestTypedefs>::cast):
1306         (WebCore::jsTestTypedefsConstructor):
1307         (WebCore::setJSTestTypedefsConstructor):
1308         (WebCore::JSTestTypedefs::toWrapped):
1309         * bridge/objc/WebScriptObject.mm:
1310         (-[WebScriptObject setValue:forKey:]):
1311         * bridge/runtime_array.cpp:
1312         (JSC::RuntimeArray::lengthGetter):
1313         * bridge/runtime_method.cpp:
1314         (JSC::RuntimeMethod::lengthGetter):
1315         * html/HTMLMediaElement.cpp:
1316         (WebCore::controllerJSValue):
1317         (WebCore::HTMLMediaElement::updateCaptionContainer):
1318         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1319         * inspector/agents/InspectorDOMAgent.cpp:
1320         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1321
1322 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
1323
1324         [JSC] Add inherits<T>(VM&) leveraging JSCast fast path
1325         https://bugs.webkit.org/show_bug.cgi?id=183429
1326
1327         Reviewed by Mark Lam.
1328
1329         * bindings/js/IDBBindingUtilities.cpp:
1330         (WebCore::createIDBKeyFromValue):
1331         * bindings/js/JSDOMConvertDate.cpp:
1332         (WebCore::valueToDate):
1333         * bindings/js/JSDOMGlobalObject.cpp:
1334         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
1335         * bindings/js/JSDOMWindowCustom.cpp:
1336         (WebCore::JSDOMWindow::toWrapped):
1337         * bindings/js/JSEventTargetCustom.cpp:
1338         * bindings/js/JSNodeCustom.cpp:
1339         (WebCore::JSNode::pushEventHandlerScope const):
1340         * bindings/js/JSXPathNSResolverCustom.cpp:
1341         (WebCore::JSXPathNSResolver::toWrapped):
1342         * bindings/js/ScriptState.cpp:
1343         (WebCore::domWindowFromExecState):
1344         (WebCore::scriptExecutionContextFromExecState):
1345         * bindings/js/SerializedScriptValue.cpp:
1346         (WebCore::CloneSerializer::isArray):
1347         (WebCore::CloneSerializer::isMap):
1348         (WebCore::CloneSerializer::isSet):
1349         (WebCore::CloneSerializer::dumpArrayBufferView):
1350         (WebCore::CloneSerializer::dumpDOMPoint):
1351         (WebCore::CloneSerializer::dumpDOMRect):
1352         (WebCore::CloneSerializer::dumpDOMMatrix):
1353         (WebCore::CloneSerializer::dumpIfTerminal):
1354         (WebCore::CloneDeserializer::CloneDeserializer):
1355         (WebCore::CloneDeserializer::readArrayBufferView):
1356         * bindings/scripts/CodeGeneratorJS.pm:
1357         (GenerateOverloadDispatcher):
1358         * bindings/scripts/test/JS/JSTestObj.cpp:
1359         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
1360         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameterOverloadDispatcher):
1361         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnionOverloadDispatcher):
1362         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnionsOverloadDispatcher):
1363         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnionOverloadDispatcher):
1364         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnionOverloadDispatcher):
1365         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameterOverloadDispatcher):
1366         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunctionOverloadDispatcher):
1367         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1368         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
1369         * bridge/c/c_instance.cpp:
1370         (JSC::Bindings::CInstance::invokeMethod):
1371         * bridge/objc/WebScriptObject.mm:
1372         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
1373         * bridge/objc/objc_instance.mm:
1374         (ObjcInstance::invokeMethod):
1375         * bridge/objc/objc_runtime.mm:
1376         (JSC::Bindings::callObjCFallbackObject):
1377         * bridge/runtime_method.cpp:
1378         (JSC::callRuntimeMethod):
1379         * bridge/runtime_object.cpp:
1380         (JSC::Bindings::callRuntimeObject):
1381         (JSC::Bindings::callRuntimeConstructor):
1382         * inspector/WebInjectedScriptHost.cpp:
1383         (WebCore::WebInjectedScriptHost::subtype):
1384         (WebCore::WebInjectedScriptHost::isHTMLAllCollection):
1385
1386 2018-03-08  Tim Horton  <timothy_horton@apple.com>
1387
1388         Stop linking ApplicationServices directly
1389         https://bugs.webkit.org/show_bug.cgi?id=182867
1390         <rdar://problem/38252142>
1391
1392         Reviewed by Alex Christensen.
1393
1394         The frameworks that we use that live inside ApplicationServices
1395         have mostly moved out, so import them directly.
1396
1397         * Configurations/WebCore.xcconfig:
1398         * html/canvas/CanvasRenderingContext2D.cpp:
1399         * html/canvas/CanvasRenderingContext2DBase.cpp:
1400         * platform/MIMETypeRegistry.cpp:
1401         * platform/graphics/ComplexTextController.cpp:
1402         * platform/graphics/cg/ColorCG.cpp:
1403         * platform/graphics/cg/ImageDecoderCG.cpp:
1404         * platform/graphics/cg/UTIRegistry.cpp:
1405         * platform/graphics/cocoa/FontCocoa.mm:
1406         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1407         * platform/graphics/mac/GlyphPageMac.cpp:
1408         * platform/graphics/mac/PDFDocumentImageMac.mm:
1409         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1410         * platform/graphics/win/FontCGWin.cpp:
1411         * platform/graphics/win/FontCacheWin.cpp:
1412         * platform/graphics/win/FontCustomPlatformData.cpp:
1413         * platform/graphics/win/FontPlatformDataCGWin.cpp:
1414         * platform/graphics/win/ImageCGWin.cpp:
1415         * platform/graphics/win/SimpleFontDataCGWin.cpp:
1416
1417 2018-03-07  Tim Horton  <timothy_horton@apple.com>
1418
1419         Sort and separate FeatureDefines.xcconfig
1420         https://bugs.webkit.org/show_bug.cgi?id=183427
1421
1422         Reviewed by Dan Bernstein.
1423
1424         * Configurations/FeatureDefines.xcconfig:
1425         Sort and split FeatureDefines into paragraphs
1426         (to make it easier to sort later).
1427
1428 2018-03-07  Zalan Bujtas  <zalan@apple.com>
1429
1430         Invalid innerTextRenderer in RenderTextControlSingleLine::styleDidChange()
1431         https://bugs.webkit.org/show_bug.cgi?id=183385
1432         <rdar://problem/38085397>
1433
1434         Reviewed by Antti Koivisto.
1435
1436         When HTMLInputElement::updateType() is called with a dirty value, we eagerly change the m_inputType first
1437         and then we take care of the dirty value by calling setAttributeWithoutSynchronization().
1438         With a DOMSubtreeModified event listener attached, setAttributeWithoutSynchronization() can end up running some
1439         layout code (offsetHeight) with a renderer - m_inputType mismatch.
1440
1441         This patch ensures that we don't change the m_inputType until after we finished setting the new value.
1442
1443         Test: fast/DOM/HTMLInputElement/input-value-and-type-change-crash.html
1444
1445         * html/HTMLInputElement.cpp:
1446         (WebCore::HTMLInputElement::updateType):
1447
1448 2018-03-07  Chris Dumez  <cdumez@apple.com>
1449
1450         Get rid of custom bindings for History's replaceState() / pushState()
1451         https://bugs.webkit.org/show_bug.cgi?id=183372
1452
1453         Reviewed by Youenn Fablet.
1454
1455         Get rid of custom bindings for History's replaceState() / pushState() by
1456         moving the cached state from the wrapper to the History implementation
1457         object.
1458
1459         No new tests, no web-facing behavior change.
1460
1461         * bindings/js/JSHistoryCustom.cpp:
1462         (WebCore::JSHistory::state const):
1463         (WebCore::JSHistory::visitAdditionalChildren):
1464         * page/History.cpp:
1465         (WebCore::History::cachedState):
1466         (WebCore::History::stateObjectAdded):
1467         * page/History.h:
1468         (WebCore::History::pushState):
1469         (WebCore::History::replaceState):
1470         * page/History.idl:
1471
1472 2018-03-07  Youenn Fablet  <youenn@apple.com>
1473
1474         Match unsupported plugins based on domains and not origin
1475         https://bugs.webkit.org/show_bug.cgi?id=183384
1476
1477         Reviewed by Chris Dumez.
1478
1479         Move from an origin-keyed map to a vector of plugins.
1480         We iterate through the vector and a match happens if the page host name ends with the provided matching domain.
1481         This allows supporting rules for *.mydomain.com by passing 'mydomain.com'.
1482         Covered by existing tests.
1483         We are not testing subdomains like www.localhost since there is no support in our CI but this is tested through Unit tests.
1484
1485         * loader/EmptyClients.cpp:
1486         * platform/URL.cpp:
1487         (WebCore::URL::isMatchingDomain const):
1488         * platform/URL.h:
1489         * plugins/PluginData.h:
1490         (WebCore::isSupportedPlugin):
1491         (WebCore::SupportedPluginName::decode):
1492         (WebCore::SupportedPluginName::encode const):
1493         * plugins/PluginInfoProvider.h:
1494
1495 2017-12-18  Youenn Fablet  <youenn@apple.com>
1496
1497         Update to libwebrtc revision 4e70a72571dd26b85c2385e9c618e343428df5d3
1498         https://bugs.webkit.org/show_bug.cgi?id=180843
1499
1500         Reviewed by Eric Carlson.
1501
1502         Covered by existing tests.
1503
1504         Moving H264 codecs and factories to libwebrtc.
1505         Updating LibWebRTCProvider according new libwebrtc API.
1506         Updating ref counting according new libwebrtc API.
1507
1508         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1509         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1510         (WebCore::LibWebRTCMediaEndpoint::AddRef const):
1511         (WebCore::LibWebRTCMediaEndpoint::Release const):
1512         (WTF::LogArgument<webrtc::RTCStats>::toString):
1513         * WebCore.xcodeproj/project.pbxproj:
1514         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1515         * platform/mediastream/RealtimeOutgoingVideoSource.h:
1516         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
1517         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1518         (WebCore::LibWebRTCProvider::createPeerConnectionFactory):
1519         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1520         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
1521         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
1522         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
1523         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
1524         (WebCore::LibWebRTCProviderCocoa::setActive):
1525         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
1526         * platform/mediastream/libwebrtc/VideoToolBoxDecoderFactory.cpp: Removed.
1527         * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp: Removed.
1528         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
1529         (WebCore::ConvertToI420):
1530         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
1531         * testing/Internals.cpp:
1532         (WebCore::Internals::setH264HardwareEncoderAllowed):
1533         * testing/MockLibWebRTCPeerConnection.h:
1534
1535 2018-03-07  Sihui Liu  <sihui_liu@apple.com>
1536
1537         replaceState cause back/forward malfunction on html page with <base href="/"> tag
1538         https://bugs.webkit.org/show_bug.cgi?id=182678
1539         <rdar://problem/37517821>
1540
1541         Reviewed by Chris Dumez.
1542
1543         replaceState should not change URL when the URL argument is NULL, but should change URL when the URL argument is an empty string.
1544
1545         Test: http/tests/history/replacestate-no-url.html
1546
1547         * page/History.cpp:
1548         (WebCore::History::urlForState):
1549
1550 2018-03-07  Antti Koivisto  <antti@apple.com>
1551
1552         Don't invalidate descendants for sibling combinators unless needed
1553         https://bugs.webkit.org/show_bug.cgi?id=183410
1554         <rdar://problem/38227297>
1555
1556         Reviewed by Zalan Bujtas.
1557
1558         If we know the matched sibling combinator doesn't affect descendants we shouldn't invalidate them.
1559
1560         * css/SelectorChecker.cpp:
1561         (WebCore::SelectorChecker::matchRecursively const):
1562
1563             Use different bit for the descendant case.
1564
1565         * cssjit/SelectorCompiler.cpp:
1566         (WebCore::SelectorCompiler::fragmentMatchesTheRightmostElement):
1567
1568             Remove unneeded context assert.
1569
1570         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1571
1572             Use different bit for the descendant case.
1573
1574         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
1575         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPseudoElement):
1576         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
1577         * dom/Element.cpp:
1578         (WebCore::invalidateForSiblingCombinators):
1579
1580             Invalidate the target sibling or all descendants based on the bits.
1581
1582         * dom/Element.h:
1583         (WebCore::Element::descendantsAffectedByPreviousSibling const):
1584         (WebCore::Element::setDescendantsAffectedByPreviousSibling const):
1585         * dom/Node.h:
1586         * style/StyleRelations.cpp:
1587         (WebCore::Style::commitRelationsToRenderStyle):
1588         (WebCore::Style::commitRelations):
1589         * style/StyleRelations.h:
1590
1591             Add DescendantsAffectedByPreviousSibling bit. AffectedByPreviousSibling is now just about the target element.
1592
1593 2018-03-07  Antti Koivisto  <antti@apple.com>
1594
1595         checkForSiblingStyleChanges should use internal versions of the invalidation functions
1596         https://bugs.webkit.org/show_bug.cgi?id=183405
1597         <rdar://problem/38218310>
1598
1599         Reviewed by Zalan Bujtas.
1600
1601         Non-internal invalidateStyleForElement/Subtree() implement sibling combinator invalidation. Checking this
1602         is only needed if the element in question changed somehow. In checkForSiblingStyleChanges we know that
1603         another element changed and we really just want to invalidate.
1604
1605         * css/SelectorChecker.cpp:
1606         (WebCore::isFirstOfType):
1607         (WebCore::SelectorChecker::checkOne const):
1608
1609         Also make :first-of-type use ChildrenAffectedByForwardPositionalRules for invalidation similar to :last-of-type
1610         for more correct invalidation.
1611
1612         * dom/Element.cpp:
1613         (WebCore::checkForSiblingStyleChanges):
1614
1615 2018-03-07  Yusuke Suzuki  <utatane.tea@gmail.com>
1616
1617         HTML `pattern` attribute should set `u` flag for regular expressions
1618         https://bugs.webkit.org/show_bug.cgi?id=151598
1619
1620         Reviewed by Chris Dumez.
1621
1622         This patch attaches "u" flag to the RegExp compiled for HTML "pattern" attribute[1].
1623
1624         [1]: https://html.spec.whatwg.org/multipage/forms.html#the-pattern-attribute
1625
1626         * html/BaseTextInputType.cpp:
1627         (WebCore::BaseTextInputType::patternMismatch const):
1628
1629 2018-03-07  Frederic Wang  <fwang@igalia.com>
1630
1631         Relayout frames after AsyncFrameScrolling or FrameFlattening option is changed
1632         https://bugs.webkit.org/show_bug.cgi?id=183081
1633
1634         Reviewed by Antonio Gomes.
1635
1636         The frames may be resized when the FrameFlattening option is modified and hence this patch
1637         forces a relayout. It also does that when AsyncFrameScrolling is modified too, since that
1638         may imply changes in frame flattening after bug 173704. Forcing a relayout will also be
1639         enough to trigger other updates for async frame scrolling in the future (see bug 149264 and
1640         bug 171667).
1641
1642         Test: platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic.html
1643
1644         * page/Settings.yaml: Call setNeedsRelayoutAllFrames when one of the AsyncFrameScrolling or
1645         FrameFlattening options is changed.
1646         * page/SettingsBase.cpp: Include RenderWidget to make call on frame->ownerRenderer().
1647         (WebCore::SettingsBase::setNeedsRelayoutAllFrames):  Make layout and preferred widths dirty
1648         on all frames in the page and schedule a relayout.
1649         * page/SettingsBase.h: Declare setNeedsRelayoutAllFrames().
1650
1651 2018-03-07  Alejandro G. Castro  <alex@igalia.com>
1652
1653         Make NetworkRTCResolver port agnostic
1654         https://bugs.webkit.org/show_bug.cgi?id=178855
1655
1656         Reviewed by Youenn Fablet.
1657
1658         Add new API in the DNSResolveQueue allowing to revolve hostnames and get the result. Add platform
1659         specific code for soup platform and refactor the other platforms. Added new API to the DNS API header
1660         and move the general code to the DNS.cpp file, that way we can reuse that code in all the platforms
1661         and leave the ResolveQueue class of the platforms in a file.
1662
1663         No new tests because this is a refactor.
1664
1665         * PlatformAppleWin.cmake: Move the DNSCFNet class to DNSResolveQueueCFNet.
1666         * PlatformMac.cmake: Ditto.
1667         * Sources.txt: Add the DNS.cpp for compilation.
1668         * SourcesCocoa.txt: Move the DNSCFNet class to DNSResolveQueueCFNet.
1669         * WebCore.xcodeproj/project.pbxproj: Move the DNSCFNet class to DNSResolveQueueCFNet, add the DNS.cpp
1670         for compilation. Add the new DNSResolveQueueCFNet class.
1671         * platform/Curl.cmake: Move the DNSCFNet class to DNSResolveQueueCurl.
1672         * platform/network/DNS.cpp: Add this file with the default implementation of the DNS functions for
1673         all the platforms.
1674         (WebCore::prefetchDNS): Copied from every platform implementation.
1675         (WebCore::resolveDNS): Add the function, resolves a hostname, receives the identifier of the operation
1676         and the completion handler.
1677         (WebCore::stopResolveDNS): Add the function, stops a resolution operation, receives the identifier
1678         of the operation.
1679         * platform/network/DNS.h: Add the new APIs resolveDNS and stopResolveDNS with the classes used for the
1680         implementation.
1681         (WebCore::IPAddress::IPAddress): Add this class used to send the resolved address information, it does
1682         not depend on libwebrtc rtc classes.
1683         (WebCore::IPAddress::get): Get a reference to the struct sockaddr_in in the IPAddress class.
1684         (WebCore::DNSCompletionHandler): Add this CompletionHandler type to be used when resolving the DNS
1685         address.
1686         * platform/network/DNSResolveQueue.cpp: Add the DNSResolveQueue platform instantiation in the singleton.
1687         (WebCore::DNSResolveQueue::singleton): Use DNSResolveQueue platform classes when creating the singleton..
1688         (WebCore::DNSResolveQueue::resolve): Add this method to get the address of a hostname, it sends the
1689         identifier and the completion handler to use when returning the result.
1690         (WebCore::DNSResolveQueue::stopResolve): Add this method to stop the resolve operation when required.
1691         * platform/network/DNSResolveQueue.h: Add the new methods and make the class abstract, so that every
1692         platform can implement the functions.
1693         * platform/network/cf/DNSResolveQueueCFNet.cpp: Renamed from Source/WebCore/platform/network/cf/DNSCFNet.cpp.
1694         Add the methods to the new class DNSResolveQueueCFNet, move the prefetchDNS to the DNS.cpp general
1695         implementation.
1696         * platform/network/cf/DNSResolveQueueCFNet.h: Add the new class inheriting from the DNSResolveQueue. Add the
1697         new methods, we have to implement these methods and move the NetworkRTCResolver for COCOA code here.
1698         (WebCore::DNSResolveQueueCF::resolve): Dummy method, not implemented.
1699         (WebCore::DNSResolveQueueCF::stopResolve): Ditto.
1700         * platform/network/curl/DNSResolveQueueCurl.cpp: Renamed from Source/WebCore/platform/network/curl/DNSCurl.cpp.
1701         * platform/network/curl/DNSResolveQueueCurl.h: Add the new class inheriting from the DNSResolveQueue.
1702         (WebCore::DNSResolveQueueCurl::resolve): Ditto.
1703         (WebCore::DNSResolveQueueCurl::stopResolve): Ditto.
1704         * platform/network/soup/DNSResolveQueueSoup.h: New class inheriting from the DNSResolveQueue class, adding
1705         a HasMap with the active operations, it allows stopping them.
1706         * platform/network/soup/DNSResolveQueueSoup.cpp: Renamed from Source/WebCore/platform/network/curl/DNSSoup.cpp.
1707         (WebCore::resolvedWithObserverCallback): Called when the result address from the soup platform is ready,
1708         sends the address to the completion handler.
1709         (WebCore::DNSResolveQueueSoup::resolve): Launch the resolve operation with the soup library.
1710         (WebCore::DNSResolveQueueSoup::stopResolve): Stop the resolve operation on process with a GCancellable.
1711
1712 2018-03-06  Brian Burg  <bburg@apple.com>
1713
1714         [Cocoa] Stop copying ForwardingHeaders directory that no longer exists
1715         https://bugs.webkit.org/show_bug.cgi?id=183396
1716
1717         Reviewed by Dan Bernstein.
1718
1719         * WebCore.xcodeproj/project.pbxproj:
1720         Rename the phase to "Copy ICU Headers". ForwardingHeaders are no longer a thing.
1721
1722 2018-03-06  Youenn Fablet  <youenn@apple.com>
1723
1724         didReceiveServerRedirectForProvisionalNavigation is not called in case of document redirection with service worker registration change
1725         https://bugs.webkit.org/show_bug.cgi?id=183299
1726         <rdar://problem/37547029>
1727
1728         Reviewed by Alex Christensen.
1729
1730         In case of redirection with service worker registration change, we cancel the load and create a new one.
1731         This prevent ResourceLoader::willSendRequestInternal to call the didReceiveServerRedirectForProvisionalNavigation
1732         callback. We thus explictly call this callback after restarting the load with the new service worker step.
1733         We only call this callback if the main resource is there as we do not want to call it if it was blocked by content extension.
1734
1735         Test: http/wpt/service-workers/navigation-redirect-main-frame.https.html
1736
1737         * loader/DocumentLoader.cpp:
1738         (WebCore::DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange):
1739
1740 2018-03-06  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1741
1742         [Curl] Remove unnecessary copied ResourceRequest member variable.
1743         https://bugs.webkit.org/show_bug.cgi?id=183010
1744
1745         Reviewed by Youenn Fablet.
1746
1747         * platform/network/ResourceHandle.h:
1748         * platform/network/ResourceHandleInternal.h:
1749         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
1750         * platform/network/curl/CurlRequest.h:
1751         (WebCore::CurlRequest::resourceRequest const):
1752         * platform/network/curl/ResourceHandleCurl.cpp:
1753         (WebCore::ResourceHandle::start):
1754         (WebCore::ResourceHandle::addCacheValidationHeaders):
1755         (WebCore::ResourceHandle::createCurlRequest):
1756         (WebCore::ResourceHandle::restartRequestWithCredential):
1757         (WebCore::ResourceHandle::continueAfterWillSendRequest):
1758
1759 2018-03-06  Nan Wang  <n_wang@apple.com>
1760
1761         AX: Flaky test after r229310
1762         https://bugs.webkit.org/show_bug.cgi?id=183376
1763         <rdar://problem/38188685>
1764
1765         Reviewed by Chris Fleizach.
1766
1767         The test that forces the context menu to show sometimes locks up 
1768         the test runner. Also, we missed a case where calling AXShowMenu
1769         action on a combobox is not dispatching the accessibility event.
1770
1771         Using the combobox example to test the event dispatching in order to
1772         avoid the test hang.
1773
1774         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1775         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
1776         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
1777
1778 2018-03-06  Chris Dumez  <cdumez@apple.com>
1779
1780         fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html fails with async policy delegates
1781         https://bugs.webkit.org/show_bug.cgi?id=183345
1782
1783         Reviewed by Alex Christensen.
1784
1785         FrameLoader::loadURL() was calling loadWithNavigationAction() and then resetting the
1786         m_quickRedirectComing flag right after. This works if the navigation policy decision
1787         triggered by loadWithNavigationAction() is made synchronously. However, when it is
1788         made asynchronously, the flag gets reset too early, before the policy decision
1789         handler has been called. This is an issue because the policy decision handler
1790         relies on the m_quickRedirectComing flag.
1791
1792         Similarly, FrameLoader::loadFrameRequest() was calling loadPostRequest() / loadURL()
1793         and then focusing a frame right after. This does not work as intended when the navigation
1794         policy decision is made asynchronously.
1795
1796         To address the issue, we now pass a completion handler that gets called when the operation
1797         has actually completion, after the policy decision has been made. This maintains the
1798         behavior in place with synchronous policy delegates.
1799
1800         Test: fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-async-delegates.html
1801
1802         * loader/FrameLoader.cpp:
1803         (WebCore::FrameLoader::loadURLIntoChildFrame):
1804         (WebCore::FrameLoader::loadFrameRequest):
1805         (WebCore::FrameLoader::loadURL):
1806         (WebCore::FrameLoader::loadWithNavigationAction):
1807         (WebCore::FrameLoader::load):
1808         (WebCore::FrameLoader::loadWithDocumentLoader):
1809         (WebCore::FrameLoader::reloadWithOverrideEncoding):
1810         (WebCore::FrameLoader::reload):
1811         (WebCore::FrameLoader::loadPostRequest):
1812         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1813         (WebCore::FrameLoader::loadDifferentDocumentItem):
1814         * loader/FrameLoader.h:
1815
1816 2018-03-06  Antoine Quint  <graouts@apple.com>
1817
1818         [Web Animations] Add a new CSSTransition subclass of WebAnimation
1819         https://bugs.webkit.org/show_bug.cgi?id=183373
1820         <rdar://problem/38181985>
1821
1822         Reviewed by Dean Jackson.
1823
1824         Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles
1825         upon identifying that a new CSS Animation has been added to an element.
1826
1827         * CMakeLists.txt:
1828         * DerivedSources.make:
1829         * Sources.txt:
1830         * WebCore.xcodeproj/project.pbxproj:
1831         * animation/CSSTransition.cpp: Added.
1832         (WebCore::CSSTransition::create):
1833         (WebCore::CSSTransition::CSSTransition):
1834         * animation/CSSTransition.h: Added.
1835         * animation/CSSTransition.idl: Added.
1836         * animation/KeyframeEffect.cpp:
1837         * animation/WebAnimation.h:
1838         (WebCore::WebAnimation::isCSSTransition const):
1839         * bindings/js/JSWebAnimationCustom.cpp:
1840         (WebCore::toJSNewlyCreated):
1841         * bindings/js/WebCoreBuiltinNames.h:
1842
1843 2018-03-06  Megan Gardner  <megan_gardner@apple.com>
1844
1845         Ensure system appearance is default for web content
1846         https://bugs.webkit.org/show_bug.cgi?id=183354
1847         <rdar://problem/36975571>
1848         <rdar://problem/38162381>
1849
1850         Make sure the the system appearance for web content is default, and
1851         consolidate that code to a single class.
1852
1853         Reviewed by Tim Horton.
1854
1855         Not currently testable, will add tests in a future patch.
1856
1857         * WebCore.xcodeproj/project.pbxproj:
1858         * platform/mac/LocalDefaultSystemAppearance.h: Added.
1859         * platform/mac/LocalDefaultSystemAppearance.mm: Added.
1860         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
1861         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
1862         * platform/mac/ThemeMac.mm:
1863         (-[WebCoreThemeView init]):
1864         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
1865         * rendering/RenderThemeMac.mm:
1866         (WebCore::RenderThemeMac::systemColor const):
1867
1868 2018-03-06  Antoine Quint  <graouts@apple.com>
1869
1870         [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
1871         https://bugs.webkit.org/show_bug.cgi?id=183370
1872         <rdar://problem/38180729>
1873
1874         Reviewed by Dean Jackson.
1875
1876         Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
1877         involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
1878         default while we bring this feature up.
1879
1880         * page/RuntimeEnabledFeatures.h:
1881         (WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
1882         (WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const):
1883
1884 2018-03-06  Daniel Bates  <dabates@apple.com>
1885
1886         Make more use of USE(OPENGL_ES) and replace typedefs with C++11 using statements
1887         in TextureCacheCV.h
1888
1889         Rubber-stamped by Tim Horton.
1890
1891         * platform/graphics/cv/TextureCacheCV.h:
1892
1893 2018-03-06  Antti Koivisto  <antti@apple.com>
1894
1895         Cache hasComplexSelectorsForStyleAttribute bit
1896         https://bugs.webkit.org/show_bug.cgi?id=183363
1897
1898         Reviewed by Andreas Kling.
1899
1900         * css/DocumentRuleSets.cpp:
1901         (WebCore::DocumentRuleSets::collectFeatures const):
1902         (WebCore::DocumentRuleSets::hasComplexSelectorsForStyleAttribute const):
1903
1904         Cache the bit to avoid hash lookups.
1905
1906         * css/DocumentRuleSets.h:
1907         * dom/StyledElement.cpp:
1908         (WebCore::StyledElement::invalidateStyleAttribute):
1909         (WebCore::shouldSynchronizeStyleAttributeImmediatelyForInvalidation): Deleted.
1910
1911         Move code to DocumentRuleSets.
1912
1913 2018-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
1914
1915         Change the type of SVGToOTFFontConverter::m_weight to be not a char
1916         https://bugs.webkit.org/show_bug.cgi?id=183339
1917
1918         Reviewed by Alex Christensen.
1919
1920         No new tests because there is no behavior change.
1921
1922         * svg/SVGToOTFFontConversion.cpp:
1923         (WebCore::SVGToOTFFontConverter::appendOS2Table):
1924         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
1925
1926 2018-03-06  Antoine Quint  <graouts@apple.com>
1927
1928         [Web Animations] Add a new CSSAnimation subclass of WebAnimation
1929         https://bugs.webkit.org/show_bug.cgi?id=183371
1930         <rdar://problem/38181724>
1931
1932         Reviewed by Dean Jackson.
1933
1934         Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles
1935         upon identifying that a new CSS Animation has been added to an element.
1936
1937         * CMakeLists.txt:
1938         * DerivedSources.make:
1939         * Sources.txt:
1940         * WebCore.xcodeproj/project.pbxproj:
1941         * animation/CSSAnimation.cpp: Added.
1942         (WebCore::CSSAnimation::create):
1943         (WebCore::CSSAnimation::CSSAnimation):
1944         * animation/CSSAnimation.h: Added.
1945         * animation/CSSAnimation.idl: Added.
1946         * animation/KeyframeEffectReadOnly.cpp
1947         * animation/WebAnimation.h:
1948         (WebCore::WebAnimation::isCSSAnimation const):
1949         * animation/WebAnimation.idl:
1950         * bindings/js/JSWebAnimationCustom.cpp:
1951         (WebCore::toJSNewlyCreated):
1952         (WebCore::toJS):
1953         * bindings/js/WebCoreBuiltinNames.h:
1954
1955 2018-03-06  Ms2ger  <Ms2ger@igalia.com>
1956
1957         Explicitly qualify some method calls on this in lambdas in Service Worker code.
1958         https://bugs.webkit.org/show_bug.cgi?id=183367
1959
1960         Reviewed by Chris Dumez.
1961
1962         No new tests -- no change in behavior.
1963
1964         * loader/DocumentLoader.cpp:
1965         (WebCore::DocumentLoader::startLoadingMainResource):
1966         * workers/service/server/SWServer.cpp:
1967         (WebCore::SWServer::matchAll):
1968
1969 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
1970
1971         [CoordGraphics] Remove unused scrolling-related code in TextureMapperLayer, CoordinatedGraphics stack
1972         https://bugs.webkit.org/show_bug.cgi?id=183340
1973
1974         Reviewed by Michael Catanzaro.
1975
1976         TextureMapperLayer::scrollBy() method is completely unused and can be
1977         removed. This opens the gates on removing majority of scrolling-related
1978         code in TextureMapperLayer, CoordinatedGraphicsLayer and
1979         CoordinatedGraphicsScene classes, along with smaller bits in other
1980         closely-associated classes.
1981
1982         We're able to remove two virtual method overrides in the
1983         ScrollingCoordinatorCoordinatedGraphics class.
1984
1985         TextureMapperLayer can drop the ScrollingClient member variable, along
1986         with multiple others. Various unused methods in that class are removed
1987         as well.
1988
1989         CoordinatedGraphicsLayer and GraphicsLayerTextureMapper can both remove
1990         the custom scrolling state tracking.
1991
1992         No new tests -- no change in behavior.
1993
1994         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
1995         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange): Deleted.
1996         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea): Deleted.
1997         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
1998         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1999         (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
2000         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
2001         (WebCore::GraphicsLayerTextureMapper::didCommitScrollOffset): Deleted.
2002         (WebCore::GraphicsLayerTextureMapper::setIsScrollable): Deleted.
2003         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2004         * platform/graphics/texmap/TextureMapperLayer.cpp:
2005         (WebCore::TextureMapperLayer::hitTest): Deleted.
2006         (WebCore::TextureMapperLayer::scrollableLayerHitTestCondition): Deleted.
2007         (WebCore::TextureMapperLayer::findScrollableContentsLayerAt): Deleted.
2008         (WebCore::TextureMapperLayer::mapScrollOffset): Deleted.
2009         (WebCore::TextureMapperLayer::commitScrollOffset): Deleted.
2010         (WebCore::TextureMapperLayer::scrollBy): Deleted.
2011         (WebCore::TextureMapperLayer::didCommitScrollOffset): Deleted.
2012         * platform/graphics/texmap/TextureMapperLayer.h:
2013         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2014         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
2015         (WebCore::CoordinatedGraphicsLayer::syncLayerState):
2016         (WebCore::CoordinatedGraphicsLayer::resetLayerState):
2017         (WebCore::CoordinatedGraphicsLayer::setScrollableArea): Deleted.
2018         (WebCore::CoordinatedGraphicsLayer::commitScrollOffset): Deleted.
2019         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2020         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
2021
2022 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
2023
2024         [CoordGraphics] Apply TextureMapperLayer animations with a single MonotonicTime value
2025         https://bugs.webkit.org/show_bug.cgi?id=183360
2026
2027         Reviewed by Sergio Villar Senin.
2028
2029         When animations are being applied on the TextureMapperLayer tree, the
2030         monotonic time value is retrieved repeatedly in TextureMapperAnimation
2031         class. Instead of spawning repeated syscalls that are required to obtain
2032         the time value, TextureMapperLayer::applyAnimationsRecursively() now
2033         accepts a MonotonicTime value that should be used for all animation
2034         updates.
2035
2036         No new tests -- no change in behavior.
2037
2038         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2039         (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
2040         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2041         (WebCore::TextureMapperAnimation::apply):
2042         (WebCore::TextureMapperAnimation::computeTotalRunningTime):
2043         (WebCore::TextureMapperAnimations::apply):
2044         * platform/graphics/texmap/TextureMapperAnimation.h:
2045         (WebCore::TextureMapperAnimation::keyframes const):
2046         (WebCore::TextureMapperAnimation::animation const):
2047         (WebCore::TextureMapperAnimation::boxSize const): Deleted.
2048         (WebCore::TextureMapperAnimation::listsMatch const): Deleted.
2049         (WebCore::TextureMapperAnimation::startTime const): Deleted.
2050         (WebCore::TextureMapperAnimation::pauseTime const): Deleted.
2051         * platform/graphics/texmap/TextureMapperLayer.cpp:
2052         (WebCore::TextureMapperLayer::applyAnimationsRecursively):
2053         (WebCore::TextureMapperLayer::syncAnimations):
2054         * platform/graphics/texmap/TextureMapperLayer.h:
2055
2056 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
2057
2058         [CoordGraphics] Clean up CoordinatedImageBacking
2059         https://bugs.webkit.org/show_bug.cgi?id=183332
2060
2061         Reviewed by Carlos Garcia Campos.
2062
2063         Clean up the CoordinatedImageBacking class. Prefer reference values in
2064         class functions, methods and member variables, where possible. Move
2065         member variables into a more sensible order. Initialize a few member
2066         variables at the place of declaration.
2067
2068         Drop releaseSurfaceIfNeeded() and updateVisibilityIfNeeded() methods,
2069         integrating them into the update() method, which was the only place
2070         where they were called from.
2071
2072         We don't have to keep a reference to the buffer object, since we're
2073         not using it internally after it's been passed to the client's
2074         updateImageBacking() implementation.
2075
2076         No new tests -- no change in behavior.
2077
2078         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2079         (WebCore::CoordinatedGraphicsLayer::syncImageBacking):
2080         (WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded):
2081         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
2082         (WebCore::CoordinatedImageBacking::getCoordinatedImageBackingID):
2083         (WebCore::CoordinatedImageBacking::CoordinatedImageBacking):
2084         (WebCore::CoordinatedImageBacking::addHost):
2085         (WebCore::CoordinatedImageBacking::removeHost):
2086         (WebCore::CoordinatedImageBacking::update):
2087         (WebCore::CoordinatedImageBacking::clearContentsTimerFired):
2088         (WebCore::CoordinatedImageBacking::create): Deleted.
2089         (WebCore::CoordinatedImageBacking::markDirty): Deleted.
2090         (WebCore::CoordinatedImageBacking::releaseSurfaceIfNeeded): Deleted.
2091         (WebCore::CoordinatedImageBacking::updateVisibilityIfNeeded): Deleted.
2092         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
2093
2094 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
2095
2096         GraphicsLayerTextureMapper: remove the setAnimations() method
2097         https://bugs.webkit.org/show_bug.cgi?id=183358
2098
2099         Reviewed by Carlos Garcia Campos.
2100
2101         Remove the GraphicsLayerTextureMapper::setAnimations() method. This was
2102         not called from anywhere, and is not the way animations are generated
2103         for a given GraphicsLayer object (that would be addAnimation() method).
2104
2105         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2106         (WebCore::GraphicsLayerTextureMapper::setAnimations): Deleted.
2107         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2108
2109 2018-03-06  Nan Wang  <n_wang@apple.com>
2110
2111         AX: AOM: More accessibility events support
2112         https://bugs.webkit.org/show_bug.cgi?id=183023
2113         <rdar://problem/37764380>
2114
2115         Reviewed by Chris Fleizach.
2116
2117         Accessibility events.
2118         Spec: https://wicg.github.io/aom/spec/phase2.html
2119
2120         This change adds support for these new events:
2121           accessiblecontextmenu
2122           accessibledecrement
2123           accessibledismiss
2124           accessiblefocus
2125           accessibleincrement
2126           accessiblescrollintoview
2127           accessibleselect
2128
2129         Note: The show context menu action is only supported on macOS now.
2130         The dismiss action is not implemented for all the platforms yet.
2131
2132         Test: accessibility/mac/AOM-events-all.html
2133
2134         * accessibility/AccessibilityListBoxOption.cpp:
2135         (WebCore::AccessibilityListBoxOption::setSelected):
2136         * accessibility/AccessibilityMediaObject.cpp:
2137         (WebCore::AccessibilityMediaObject::increment):
2138         (WebCore::AccessibilityMediaObject::decrement):
2139         * accessibility/AccessibilityMenuListOption.cpp:
2140         (WebCore::AccessibilityMenuListOption::setSelected):
2141         * accessibility/AccessibilityNodeObject.cpp:
2142         (WebCore::AccessibilityNodeObject::increment):
2143         (WebCore::AccessibilityNodeObject::decrement):
2144         * accessibility/AccessibilityObject.cpp:
2145         (WebCore::AccessibilityObject::press):
2146         (WebCore::AccessibilityObject::dispatchAccessibilityEvent const):
2147         (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const):
2148         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent const):
2149         (WebCore::AccessibilityObject::scrollToMakeVisible const):
2150         (WebCore::AccessibilityObject::dispatchAccessibilityEvent): Deleted.
2151         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent): Deleted.
2152         * accessibility/AccessibilityObject.h:
2153         * accessibility/AccessibilityRenderObject.cpp:
2154         (WebCore::AccessibilityRenderObject::setFocused):
2155         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2156         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
2157         * dom/Element.idl:
2158         * dom/EventNames.h:
2159
2160 2018-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2161
2162         Fix std::make_unique / new[] using system malloc
2163         https://bugs.webkit.org/show_bug.cgi?id=182975
2164
2165         Reviewed by JF Bastien.
2166
2167         Use Vector, FAST_ALLOCATED, or UniqueArray instead.
2168
2169         * Modules/webaudio/AudioBufferSourceNode.cpp:
2170         (WebCore::AudioBufferSourceNode::setBuffer):
2171         * Modules/webaudio/AudioBufferSourceNode.h:
2172         * css/StyleRule.h:
2173         * cssjit/CompiledSelector.h:
2174         * html/HTMLFrameSetElement.h:
2175         * html/canvas/WebGLRenderingContextBase.cpp:
2176         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
2177         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
2178         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::LRUImageBufferCache):
2179         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
2180         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::bubbleToFront):
2181         * html/canvas/WebGLRenderingContextBase.h:
2182         * platform/Length.cpp:
2183         (WebCore::newCoordsArray):
2184         (WebCore::newLengthArray):
2185         (): Deleted.
2186         * platform/Length.h:
2187         * platform/audio/DynamicsCompressor.cpp:
2188         (WebCore::DynamicsCompressor::setNumberOfChannels):
2189         * platform/audio/DynamicsCompressor.h:
2190         * platform/audio/FFTFrame.h:
2191         * platform/audio/gstreamer/FFTFrameGStreamer.cpp:
2192         (WebCore::FFTFrame::FFTFrame):
2193         * platform/graphics/FormatConverter.h:
2194         (WebCore::FormatConverter::FormatConverter):
2195         * platform/graphics/GraphicsContext3D.cpp:
2196         (WebCore::GraphicsContext3D::texImage2DResourceSafe):
2197         * platform/graphics/GraphicsContext3D.h:
2198         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2199         (WebCore::getDirtyRects):
2200         * platform/graphics/cairo/CairoUtilities.cpp:
2201         (WebCore::flipImageSurfaceVertically):
2202         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2203         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2204         * platform/graphics/gpu/Texture.cpp:
2205         (WebCore::Texture::updateSubRect):
2206         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2207         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2208         (WebCore::GraphicsContext3D::compileShader):
2209         (WebCore::GraphicsContext3D::getActiveAttribImpl):
2210         (WebCore::GraphicsContext3D::getActiveUniformImpl):
2211         (WebCore::GraphicsContext3D::getProgramInfoLog):
2212         (WebCore::GraphicsContext3D::getShaderInfoLog):
2213         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
2214         (WebCore::getShaderLog):
2215         (WebCore::getProgramLog):
2216         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2217         (WebCore::ImageBufferData::putData):
2218         * platform/image-decoders/png/PNGImageDecoder.cpp:
2219         (WebCore::PNGImageReader::PNGImageReader):
2220         (WebCore::PNGImageReader::close):
2221         (WebCore::PNGImageReader::interlaceBuffer const):
2222         (WebCore::PNGImageReader::createInterlaceBuffer):
2223         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
2224         (WebCore::WEBPImageDecoder::decodeFrame):
2225         * platform/network/curl/SocketStreamHandleImpl.h:
2226         (WebCore::SocketStreamHandleImpl::SocketData::SocketData):
2227         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
2228         (WebCore::createCopy):
2229         (WebCore::SocketStreamHandleImpl::readData):
2230         (): Deleted.
2231         * platform/network/soup/SocketStreamHandleImpl.h:
2232         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2233         (WebCore::SocketStreamHandleImpl::connected):
2234         * platform/win/LoggingWin.cpp:
2235         (WebCore::logLevelString):
2236
2237 2018-03-05  Yoav Weiss  <yoav@yoav.ws>
2238
2239         Support for preconnect Link headers
2240         https://bugs.webkit.org/show_bug.cgi?id=181657
2241
2242         Reviewed by Darin Adler.
2243
2244         Move the preconnect functionality into its own function, and
2245         also call this function when Link headers are processed.
2246
2247         Test: http/tests/preconnect/link-header-rel-preconnect-http.php
2248
2249         * loader/LinkLoader.cpp:
2250         (WebCore::LinkLoader::loadLinksFromHeader): Call preconnectIfNeeded.
2251         (WebCore::LinkLoader::preconnectIfNeeded): Preconnect to a host functionality moved here.
2252         (WebCore::LinkLoader::loadLink): Call preconnectIfNeeded.
2253         * loader/LinkLoader.h:
2254
2255 2018-03-05  Antti Koivisto  <antti@apple.com>
2256
2257         Add ChildrenAffectedByForwardPositionalRules bit for nth-child pseudo class marking
2258         https://bugs.webkit.org/show_bug.cgi?id=183341
2259         <rdar://problem/38151470>
2260
2261         Reviewed by Zalan Bujtas.
2262
2263         Use it instead of AffectsNextSibling/AffectedByPreviousSibling bits, similar to ChildrenAffectedByBackwardPositionalRules bit.
2264         This is more efficient and requires way less marking.
2265
2266         * css/SelectorChecker.cpp:
2267         (WebCore::countElementsBefore):
2268         (WebCore::countElementsOfTypeBefore):
2269         (WebCore::SelectorChecker::checkOne const):
2270
2271             Mark with ChildrenAffectedByForwardPositionalRules.
2272
2273         * cssjit/SelectorCompiler.cpp:
2274         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
2275         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
2276
2277              Mark with ChildrenAffectedByForwardPositionalRules.
2278
2279         * dom/Element.cpp:
2280         (WebCore::checkForSiblingStyleChanges):
2281
2282             Invalidate siblings after added/removed element.
2283
2284         (WebCore::Element::setChildrenAffectedByForwardPositionalRules):
2285         (WebCore::Element::hasFlagsSetDuringStylingOfChildren const):
2286         (WebCore::Element::rareDataChildrenAffectedByForwardPositionalRules const):
2287
2288             Add the new marking bit.
2289
2290         * dom/Element.h:
2291         (WebCore::Element::childrenAffectedByForwardPositionalRules const):
2292         (WebCore::Element::attributeWithoutSynchronization const):
2293
2294             Remove assert so we can use this to get the current unresolved lazy value of style attrbute.
2295
2296         * dom/ElementRareData.h:
2297         (WebCore::ElementRareData::childrenAffectedByForwardPositionalRules const):
2298         (WebCore::ElementRareData::setChildrenAffectedByForwardPositionalRules):
2299         (WebCore::ElementRareData::ElementRareData):
2300         (WebCore::ElementRareData::resetStyleRelations):
2301
2302              Add the new marking bit.
2303
2304         * dom/StyledElement.cpp:
2305         (WebCore::StyledElement::invalidateStyleAttribute):
2306
2307             In special case where we have attribute selectors for style attribute, synchronize the attribute immediately so we get invalidation right.
2308             Tested by fast/css/style-attribute-invalidation-propagates-to-counted-siblings.html    
2309
2310         * style/StyleRelations.cpp:
2311         (WebCore::Style::commitRelationsToRenderStyle):
2312         (WebCore::Style::commitRelations):
2313
2314             Commit the new bit.
2315
2316         * style/StyleRelations.h:
2317
2318 2018-03-05  Ryan Haddad  <ryanhaddad@apple.com>
2319
2320         Unreviewed build fix, remove unused variables.
2321
2322         * css/parser/CSSPropertyParser.cpp:
2323         (WebCore::consumeSpeakAs):
2324         (WebCore::consumeHangingPunctuation):
2325
2326 2018-03-05  Chris Dumez  <cdumez@apple.com>
2327
2328         fast/loader/onload-policy-ignore-for-frame.html is timing out with async policy delegates
2329         https://bugs.webkit.org/show_bug.cgi?id=183337
2330
2331         Reviewed by Ryosuke Niwa.
2332
2333         Make sure we call checkCompleted() before calling checkLoadComplete() in
2334         FrameLoader::continueLoadAfterNavigationPolicy() when the client tells us
2335         to ignore the navigation, so that we properly recognize that the load is
2336         done. This matches what is already done in FrameLoader::receivedMainResourceError().
2337
2338         Test: fast/loader/onload-policy-ignore-for-frame-async-delegates.html
2339
2340         * loader/FrameLoader.cpp:
2341         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2342
2343 2018-03-05  Myles C. Maxfield  <mmaxfield@apple.com>
2344
2345         [Cocoa] Allow user-installed fonts to be disabled
2346         https://bugs.webkit.org/show_bug.cgi?id=183349
2347
2348         Rubber stamped by Brent Fulgham.
2349
2350         Tests: fast/text/user-installed-font.html
2351                fast/text/user-installed-fonts/disable.html
2352                fast/text/user-installed-fonts/shadow-disable.html
2353                fast/text/user-installed-fonts/shadow-family-disable.html
2354                fast/text/user-installed-fonts/shadow-family.html
2355                fast/text/user-installed-fonts/shadow-postscript-disable.html
2356                fast/text/user-installed-fonts/shadow-postscript-family-disable.html
2357                fast/text/user-installed-fonts/shadow-postscript-family.html
2358                fast/text/user-installed-fonts/shadow-postscript.html
2359                fast/text/user-installed-fonts/shadow.html
2360                fast/text/user-installed-fonts/system-ui.html
2361
2362         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2363
2364 2018-03-05  Myles C. Maxfield  <mmaxfield@apple.com>
2365
2366         Silence OpenGL and OpenGL ES deprecation warnings in newer SDKs
2367         https://bugs.webkit.org/show_bug.cgi?id=183350
2368
2369         Unreviewed.
2370
2371         * Configurations/WebCore.xcconfig:
2372
2373 2018-03-05  Andy Estes  <aestes@apple.com>
2374
2375         [Mac] Teach WebCore::Pasteboard about file promise drags
2376         https://bugs.webkit.org/show_bug.cgi?id=183314
2377         <rdar://problem/38105493>
2378
2379         Reviewed by Darin Adler.
2380
2381         While WebKit does support receiving file promise drags (since r210360), WebCore::Pasteboard
2382         has not been instructed on how to read their file paths. When the various pasteboard readers
2383         ask for file paths after a file promise drop, they receive an empty vector. This impacts
2384         various features, most notably the DataTransfer API.
2385
2386         Pasteboard actually cannot learn about promised file paths from the pasteboard itself, as
2387         the pasteboard only contains the dragged files' UTIs. Promised file paths aren't known until
2388         the WebKits call -[NSFilePromiseReceiver receivePromisedFilesAtDestination:...], at which
2389         point the file paths are passed to WebCore as part of WebCore::DragData.
2390
2391         When we construct new Pasteboards for drag and drop, we need to store any promised file
2392         paths from the DragData. Then, when the various pasteboard readers ask for file paths and
2393         NSFilesPromisePboardType is on the pasteboard, we can return these promised file paths.
2394
2395         Tests: editing/pasteboard/data-transfer-items-drag-drop-file-promise.html
2396                editing/pasteboard/data-transfer-items-drop-file-promise.html
2397                editing/pasteboard/datatransfer-items-drop-plaintext-file-promise.html
2398                editing/pasteboard/datatransfer-types-dropping-text-file-promise.html
2399                editing/pasteboard/drag-file-promises-to-editable-element-as-URLs.html
2400                editing/pasteboard/drag-file-promises-to-editable-element-as-attachment.html
2401                editing/pasteboard/file-input-files-access-promise.html
2402
2403         * platform/FileSystem.h:
2404         * platform/Pasteboard.h:
2405         (WebCore::Pasteboard::Pasteboard):
2406         * platform/mac/DragDataMac.mm:
2407         (WebCore::DragData::containsPromise const):
2408         * platform/mac/PasteboardMac.mm:
2409         (WebCore::Pasteboard::Pasteboard):
2410         (WebCore::Pasteboard::createForDragAndDrop):
2411         (WebCore::toString):
2412         (WebCore::Pasteboard::read):
2413         (WebCore::Pasteboard::readFilePaths):
2414         (WebCore::absoluteURLsFromPasteboardFilenames): Deleted.
2415         * platform/mac/PlatformPasteboardMac.mm:
2416         (WebCore::PlatformPasteboard::numberOfFiles const):
2417
2418 2018-03-05  Andy Estes  <aestes@apple.com>
2419
2420         [Mac] Fix the build
2421
2422         * Modules/applepay/ApplePaySession.cpp:
2423         (WebCore::convertAndValidate): Removed unused variables.
2424
2425 2018-03-05  Antti Koivisto  <antti@apple.com>
2426
2427         Don't invalidate all children when doing insertion/deletion in presence of backward positional selectors
2428         https://bugs.webkit.org/show_bug.cgi?id=183325
2429         <rdar://problem/38134480>
2430
2431         Reviewed by Zalan Bujtas.
2432
2433         It is sufficient to invalidate siblings before the mutation point.
2434
2435         * dom/Element.cpp:
2436         (WebCore::checkForSiblingStyleChanges):
2437
2438         We already do sibling walk in the case of forwards positional rules and sibling combinators. The work
2439         done here is insignifant compared to cost of overinvalidating.
2440
2441 2018-03-05  Ali Juma  <ajuma@chromium.org>
2442
2443         imported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html times out with async policy delegates
2444         https://bugs.webkit.org/show_bug.cgi?id=183297
2445
2446         Reviewed by Chris Dumez.
2447
2448         When a FrameLoader's policy document loader is cleared after receiving a navigation policy decision
2449         to not continue loading, we still need to trigger a check for load completion, since this loader or
2450         an ancestor loader may have been in state isLoadingInAPISense only because of the existence of
2451         the just-cleared policy document loader. Without triggering this check, these loaders may never
2452         call WebFrameLoaderClient::dispatchDidFinishLoad.
2453
2454         Test: http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html
2455
2456         * loader/FrameLoader.cpp:
2457         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2458
2459 2018-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2460
2461         [WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
2462         https://bugs.webkit.org/show_bug.cgi?id=183312
2463
2464         Reviewed by Mark Lam.
2465
2466         Remove wtf/CurrentTime.h include pragma.
2467
2468         * Modules/geolocation/Geolocation.cpp:
2469         * Modules/mediasource/SourceBuffer.cpp:
2470         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2471         * Modules/speech/SpeechSynthesis.cpp:
2472         * contentextensions/ContentExtensionCompiler.cpp:
2473         * contentextensions/ContentExtensionParser.cpp:
2474         * dom/Document.cpp:
2475         * dom/Element.cpp:
2476         * dom/Event.cpp:
2477         * dom/ScriptedAnimationController.cpp:
2478         * dom/SimulatedClick.cpp:
2479         * fileapi/File.cpp:
2480         * fileapi/FileReader.cpp:
2481         * history/CachedPage.cpp:
2482         * html/BaseDateAndTimeInputType.cpp:
2483         * html/DateTimeInputType.cpp:
2484         * html/HTMLMediaElement.cpp:
2485         * html/MediaController.cpp:
2486         * html/MediaElementSession.cpp:
2487         * html/MonthInputType.cpp:
2488         * html/TimeInputType.cpp:
2489         * html/parser/HTMLParserScheduler.h:
2490         * inspector/InspectorCanvas.cpp:
2491         * loader/FrameLoader.cpp:
2492         * loader/LoadTiming.cpp:
2493         * loader/NavigationScheduler.cpp:
2494         * loader/ProgressTracker.cpp:
2495         * loader/cache/CachedCSSStyleSheet.cpp:
2496         * loader/cache/CachedImage.cpp:
2497         * loader/cache/CachedResource.cpp:
2498         * loader/cache/MemoryCache.cpp:
2499         * page/DOMTimer.cpp:
2500         * page/DOMWindow.cpp:
2501         * page/DragController.cpp:
2502         * page/EventHandler.cpp:
2503         * page/FocusController.cpp:
2504         * page/FrameView.cpp:
2505         * page/Page.cpp:
2506         * page/Performance.cpp:
2507         * page/PerformanceTiming.cpp:
2508         * page/animation/AnimationBase.cpp:
2509         * page/animation/CSSAnimationController.cpp:
2510         * page/mac/WheelEventDeltaFilterMac.mm:
2511         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2512         * platform/ScrollAnimationKinetic.cpp:
2513         * platform/ScrollAnimationSmooth.cpp:
2514         * platform/ThreadTimers.cpp:
2515         * platform/Timer.cpp:
2516         * platform/audio/mac/AudioSampleDataSource.mm:
2517         * platform/cocoa/ScrollController.mm:
2518         * platform/gamepad/cocoa/GameControllerGamepad.mm:
2519         * platform/gamepad/mac/HIDGamepad.cpp:
2520         * platform/graphics/BitmapImage.cpp:
2521         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2522         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2523         * platform/graphics/ca/GraphicsLayerCA.cpp:
2524         * platform/graphics/ca/LayerPool.cpp:
2525         * platform/graphics/ca/PlatformCALayer.h:
2526         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2527         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2528         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2529         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
2530         * platform/graphics/cg/GraphicsContextCG.cpp:
2531         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2532         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
2533         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
2534         * platform/graphics/texmap/BitmapTexturePool.h:
2535         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2536         * platform/graphics/texmap/TextureMapper.cpp:
2537         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2538         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
2539         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2540         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2541         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
2542         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2543         * platform/gtk/ScrollAnimatorGtk.cpp:
2544         * platform/ios/LegacyTileCache.mm:
2545         * platform/ios/LegacyTileLayerPool.mm:
2546         * platform/ios/ScrollViewIOS.mm:
2547         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
2548         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2549         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2550         * platform/mock/MockRealtimeMediaSource.cpp:
2551         * platform/mock/MockRealtimeVideoSource.cpp:
2552         * platform/network/CacheValidation.cpp:
2553         * platform/network/DNSResolveQueue.cpp:
2554         * platform/network/ResourceResponseBase.cpp:
2555         * platform/network/curl/CurlCacheEntry.cpp:
2556         * platform/network/soup/ResourceHandleSoup.cpp:
2557         * platform/text/TextEncodingRegistry.cpp:
2558         * platform/text/win/LocaleWin.cpp:
2559         * platform/win/MainThreadSharedTimerWin.cpp:
2560         * platform/win/PlatformMouseEventWin.cpp:
2561         * rendering/RenderLayerCompositor.cpp:
2562         * rendering/RenderProgress.cpp:
2563         * svg/animation/SMILTimeContainer.cpp:
2564         * testing/MockGamepad.cpp:
2565         * workers/WorkerRunLoop.cpp:
2566
2567 2018-03-04  Tim Horton  <timothy_horton@apple.com>
2568
2569         Make !ENABLE(DATA_DETECTION) iOS build actually succeed
2570         https://bugs.webkit.org/show_bug.cgi?id=183283
2571         <rdar://problem/38062148>
2572
2573         Reviewed by Sam Weinig.
2574
2575         * Configurations/FeatureDefines.xcconfig:
2576
2577 2018-03-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
2578
2579         Delete incorrect version of clampTo() function from SVGToOTFFontConversion.cpp
2580         https://bugs.webkit.org/show_bug.cgi?id=183165
2581
2582         Reviewed by Darin Adler.
2583
2584         Some of the calls in SVGToOTFFontConversion.cpp were directed to the function
2585         in MathExtras.h while the rest were directed to this local static function.
2586         There should not be two versions with the same name while they are supposed
2587         to do the same thing. Besides, the local version does not work correctly
2588         if the type of the argument's max limit is less the max limit of the returned
2589         type, e.g. char -> uint16_t.
2590
2591         * svg/SVGToOTFFontConversion.cpp:
2592         (WebCore::clampTo): Deleted.
2593
2594 2018-03-03  Zalan Bujtas  <zalan@apple.com>
2595
2596         [RenderTreeBuilder] Move styleDidChange mutation logic to RenderTreeUpdater
2597         https://bugs.webkit.org/show_bug.cgi?id=183273
2598         <rdar://problem/38054892>
2599
2600         Reviewed by Antti Koivisto.
2601
2602         Covered by existing tests.
2603
2604         * rendering/RenderBlockFlow.cpp:
2605         (WebCore::RenderBlockFlow::styleDidChange):
2606         * rendering/RenderElement.cpp:
2607         (WebCore::RenderElement::styleDidChange):
2608         (WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.
2609         * rendering/RenderElement.h:
2610         * rendering/updating/RenderTreeUpdater.cpp:
2611         (WebCore::RenderTreeUpdater::updateElementRenderer):
2612
2613 2018-03-03  Yoav Weiss  <yoav@yoav.ws>
2614
2615         Link headers for subresources are not being processes
2616         https://bugs.webkit.org/show_bug.cgi?id=181789
2617
2618         Reviewed by Youenn Fablet.
2619
2620         Triggers Link header processing when the Link headers arrive on a subresource.
2621
2622         Test: http/tests/preload/link-header-on-subresource.html
2623
2624         * loader/LinkLoader.cpp:
2625         (WebCore::LinkLoader::loadLinksFromHeader): Change the media check conditions.
2626         * loader/LinkLoader.h: Add a third state for media checks.
2627         * loader/SubresourceLoader.cpp:
2628         (WebCore::SubresourceLoader::didReceiveResponse): Preload links from headers for subresources.
2629
2630 2018-03-02  Yusuke Suzuki  <utatane.tea@gmail.com>
2631
2632         [WTF] Remove RunLoop and RunLoop::Timer's interface using double as seconds
2633         https://bugs.webkit.org/show_bug.cgi?id=183293
2634
2635         Reviewed by Alex Christensen.
2636
2637         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2638         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
2639
2640 2018-03-02  Dean Jackson  <dino@apple.com>
2641
2642         Remove NP_GLContext since it is unsupported
2643         https://bugs.webkit.org/show_bug.cgi?id=183305
2644         <rdar://problem/36875555>
2645
2646         Reviewed by Simon Fraser.
2647
2648         * plugins/npapi.h: Remove NP_GLContext and mention that
2649         it is not supported.
2650
2651 2018-03-02  Chris Dumez  <cdumez@apple.com>
2652
2653         imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html crashes with async policy delegates
2654         https://bugs.webkit.org/show_bug.cgi?id=183294
2655         <rdar://problem/38073596>
2656
2657         Reviewed by Youenn Fablet.
2658
2659         Drop code that was added to SubresourceLoader::willCancel() in r228852. The purpose of this code
2660         was to make sure that SubresourceLoader::m_policyForResponseCompletionHandler always gets called,
2661         even when the load is cancelled. However, this code is not needed (since m_policyForResponseCompletionHandler
2662         is a CompletionHandler, an assertion will be hit if we fail to call it and we'll know). Calling
2663         the completionHandler inside SubresourceLoader::willCancel() is too early and leads to crashes.
2664
2665         The completionHandler currently gets called DocumentLoader::responseReceived() via a call to
2666         mainResourceLoader->didReceiveResponsePolicy(). Note that in r229177, we made sure that the
2667         call to didReceiveResponsePolicy() happens *after* the call to continueAfterContentPolicy()
2668         to maintain our non-async policy delegate behavior. However, continueAfterContentPolicy()
2669         would end up calling willCancel() and call the completionHandler when shouldContinue was
2670         false.
2671
2672         Test: http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate.html
2673
2674         * loader/SubresourceLoader.cpp:
2675         (WebCore::SubresourceLoader::willCancel):
2676
2677 2018-03-02  Tim Horton  <timothy_horton@apple.com>
2678
2679         Fix the build after r229185 and r229184
2680
2681         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2682         (WebCore::exernalDeviceDisplayNameForPlayer):
2683         * platform/ios/DeviceOrientationClientIOS.h:
2684         * platform/ios/DeviceOrientationClientIOS.mm:
2685
2686 2018-03-02  Tim Horton  <timothy_horton@apple.com>
2687
2688         Make the !ENABLE(DEVICE_ORIENTATION) iOS build succeed
2689         https://bugs.webkit.org/show_bug.cgi?id=183296
2690
2691         Reviewed by Dan Bernstein.
2692
2693         * platform/ios/DeviceMotionClientIOS.h:
2694         * platform/ios/DeviceMotionClientIOS.mm:
2695         * platform/ios/WebCoreMotionManager.h:
2696         * platform/ios/WebCoreMotionManager.mm:
2697
2698 2018-03-02  Tim Horton  <timothy_horton@apple.com>
2699
2700         Make it possible to build for iOS without Celestial
2701         https://bugs.webkit.org/show_bug.cgi?id=183295
2702         <rdar://problem/38074468>
2703
2704         Reviewed by Dan Bernstein.
2705
2706         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2707         (WebCore::exernalDeviceDisplayNameForPlayer):
2708
2709 2018-03-02  Youenn Fablet  <youenn@apple.com>
2710
2711         Clients should register to StorageProcess with their service worker registration identifier
2712         https://bugs.webkit.org/show_bug.cgi?id=182313
2713         <rdar://problem/38044403>
2714
2715         Reviewed by Chris Dumez.
2716
2717         Relanding with fixing matchAll for uncontrolled clients.
2718
2719         No observable change of behavior in regular conditions.
2720         When service worker process crashes, the service worker identifiers sent by the WebProcess might be wrong
2721         and we will not be able to retrieve the registration from these identifiers.
2722         The storage process will be able to still process correctly messages coming from the WebProcess to register clients of the registration.
2723         Otherwise, there is a chance that WebProcess clients will not be added to the SWServerRegistration.m_clientsUsingRegistration maps.
2724
2725         * dom/Document.cpp:
2726         (WebCore::Document::setServiceWorkerConnection):
2727         * workers/service/SWClientConnection.h:
2728         * workers/service/server/SWServer.cpp:
2729         (WebCore::SWServer::matchAll):
2730         (WebCore::SWServer::claim):
2731         (WebCore::SWServer::registerServiceWorkerClient):
2732         (WebCore::SWServer::unregisterServiceWorkerClient):
2733         (WebCore::SWServer::setClientActiveWorker): Deleted.
2734         * workers/service/server/SWServer.h:
2735         * workers/service/server/SWServerRegistration.cpp:
2736         (WebCore::SWServerRegistration::activate):
2737
2738 2018-03-02  Youenn Fablet  <youenn@apple.com>
2739
2740         Loads for a Document controlled by a Service Worker should not use AppCache
2741         https://bugs.webkit.org/show_bug.cgi?id=183148
2742
2743         Reviewed by Chris Dumez.
2744
2745         Covered by updated test.
2746
2747         Postponing document loading through app cache after matching service worker registration.
2748         Trying to load through app cache only if there is no service worker registration.
2749
2750         Disabling app cache for any load that has a service worker registration identifier.
2751
2752         * loader/DocumentLoader.cpp:
2753         (WebCore::DocumentLoader::redirectReceived):
2754         (WebCore::DocumentLoader::willSendRequest):
2755         (WebCore::DocumentLoader::tryLoadingRequestFromApplicationCache):
2756         (WebCore::DocumentLoader::tryLoadingRedirectRequestFromApplicationCache):
2757         (WebCore::DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange):
2758         (WebCore::DocumentLoader::scheduleSubstituteResourceLoad):
2759         (WebCore::DocumentLoader::startLoadingMainResource):
2760         * loader/DocumentLoader.h:
2761         * loader/appcache/ApplicationCacheHost.cpp:
2762         (WebCore::ApplicationCacheHost::maybeLoadMainResource):
2763         (WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect):
2764         (WebCore::ApplicationCacheHost::maybeLoadResource):
2765         (WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
2766         * loader/appcache/ApplicationCacheHost.h:
2767
2768 2018-03-02  Chris Dumez  <cdumez@apple.com>
2769
2770         fast/events/before-unload-remove-itself.html crashes with async policy delegates
2771         https://bugs.webkit.org/show_bug.cgi?id=183290
2772         <rdar://problem/38069045>
2773
2774         Reviewed by Alex Christensen.
2775
2776         When the navigation policy happens asynchronously, it is now possible for the
2777         Frame / FrameLoader to get destroyed between the point that policyChecker().checkNavigationPolicy()
2778         is called and when continueLoadAfterNavigationPolicy() is called.
2779
2780         To address the issue, we now protect the Frame and capture it in the lambda passed
2781         to policyChecker().checkNavigationPolicy().
2782
2783         Test: fast/events/before-unload-remove-itself-async-delegate.html
2784
2785         * loader/FrameLoader.cpp:
2786         (WebCore::FrameLoader::loadURL):
2787         (WebCore::FrameLoader::loadWithDocumentLoader):
2788
2789 2018-03-02  Chris Dumez  <cdumez@apple.com>
2790
2791         Converting a load to a download does not work with async policy delegates
2792         https://bugs.webkit.org/show_bug.cgi?id=183254
2793         <rdar://problem/38035334>
2794
2795         Reviewed by Youenn Fablet.
2796
2797         Update DocumentLoader::responseReceived() to call didReceiveResponsePolicy()
2798         on the mainResourceLoader *after* calling continueAfterContentPolicy(),
2799         not *before*. This makes sure that the WebResourceLoader sends the
2800         NetworkResourceLoader::ContinueDidReceiveResponse IPC back to the Network
2801         Process *after* the policy decision has been processed, which restores the
2802         pre-r228852 order.
2803
2804         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate.html
2805
2806         * loader/DocumentLoader.cpp:
2807         (WebCore::DocumentLoader::responseReceived):
2808
2809 2018-03-02  Youenn Fablet  <youenn@apple.com>
2810
2811         Some RealtimeMediaSource methods do not need to be marked as virtual
2812         https://bugs.webkit.org/show_bug.cgi?id=183272
2813
2814         Reviewed by Eric Carlson.
2815
2816         No change of behavior.
2817
2818         * platform/mediastream/RealtimeMediaSource.h:
2819
2820 2018-03-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2821
2822         Remove monotonicallyIncreasingTime
2823         https://bugs.webkit.org/show_bug.cgi?id=182911
2824
2825         Reviewed by Michael Catanzaro.
2826
2827         While generic code uses MonotonicTime, CAAnimation uses media time (CFTimeInterval).
2828         At this boundary, we convert MonotonicTime to media time, this is the same logic to
2829         the code before this patch.
2830
2831         * Modules/gamepad/Gamepad.h:
2832         * Modules/mediasource/SourceBuffer.cpp:
2833         (WebCore::SourceBuffer::SourceBuffer):
2834         (WebCore::SourceBuffer::monitorBufferingRate):
2835         * Modules/mediasource/SourceBuffer.h:
2836         * Modules/speech/SpeechSynthesis.cpp:
2837         (WebCore::SpeechSynthesis::startSpeakingImmediately):
2838         (WebCore::SpeechSynthesis::fireEvent):
2839         * Modules/speech/SpeechSynthesisUtterance.h:
2840         * contentextensions/ContentExtensionCompiler.cpp:
2841         (WebCore::ContentExtensions::compileRuleList):
2842         * contentextensions/ContentExtensionParser.cpp:
2843         (WebCore::ContentExtensions::parseRuleList):
2844         * contentextensions/ContentExtensionsBackend.cpp:
2845         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
2846         * dom/Element.cpp:
2847         (WebCore::Element::setActive):
2848         * history/CachedPage.cpp:
2849         (WebCore::CachedPage::CachedPage):
2850         (WebCore::CachedPage::hasExpired const):
2851         * history/CachedPage.h:
2852         * html/HTMLMediaElement.cpp:
2853         (WebCore::HTMLMediaElement::startProgressEventTimer):
2854         (WebCore::HTMLMediaElement::progressEventTimerFired):
2855         (WebCore::HTMLMediaElement::refreshCachedTime const):
2856         (WebCore::HTMLMediaElement::invalidateCachedTime const):
2857         (WebCore::HTMLMediaElement::currentMediaTime const):
2858         (WebCore::HTMLMediaElement::startPlaybackProgressTimer):
2859         * html/HTMLMediaElement.h:
2860         * html/MediaElementSession.cpp:
2861         (WebCore::MediaElementSession::removeBehaviorRestriction):
2862         (WebCore::MediaElementSession::mostRecentUserInteractionTime const):
2863         (WebCore::MediaElementSession::resetPlaybackSessionState):
2864         * html/MediaElementSession.h:
2865         * html/parser/HTMLParserScheduler.cpp:
2866         (WebCore::PumpSession::PumpSession):
2867         (WebCore::HTMLParserScheduler::HTMLParserScheduler):
2868         * html/parser/HTMLParserScheduler.h:
2869         (WebCore::HTMLParserScheduler::checkForYield):
2870         * inspector/InspectorCanvas.cpp:
2871         (WebCore::InspectorCanvas::recordAction):
2872         (WebCore::InspectorCanvas::finalizeFrame):
2873         * inspector/InspectorCanvas.h:
2874         * inspector/agents/InspectorMemoryAgent.cpp:
2875         (WebCore::InspectorMemoryAgent::startTracking):
2876         (WebCore::InspectorMemoryAgent::didHandleMemoryPressure):
2877         (WebCore::InspectorMemoryAgent::collectSample):
2878         * inspector/agents/InspectorNetworkAgent.cpp:
2879         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
2880         (WebCore::InspectorNetworkAgent::timestamp):
2881         (WebCore::InspectorNetworkAgent::didFinishLoading):
2882         * inspector/agents/InspectorPageAgent.cpp:
2883         (WebCore::InspectorPageAgent::timestamp):
2884         * inspector/agents/InspectorTimelineAgent.cpp:
2885         (WebCore::InspectorTimelineAgent::timestamp):
2886         * inspector/agents/WebHeapAgent.cpp:
2887         (WebCore::WebHeapAgent::dispatchGarbageCollectedEvent):
2888         * inspector/agents/WebHeapAgent.h:
2889         * loader/cache/CachedCSSStyleSheet.cpp:
2890         (WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
2891         * loader/cache/CachedImage.cpp:
2892         (WebCore::CachedImage::didDraw):
2893         * loader/cache/CachedResource.cpp:
2894         (WebCore::CachedResource::didAccessDecodedData):
2895         * loader/cache/CachedResource.h:
2896         * loader/cache/MemoryCache.cpp:
2897         (WebCore::MemoryCache::pruneLiveResourcesToSize):
2898         * page/EventHandler.cpp:
2899         (WebCore::MaximumDurationTracker::MaximumDurationTracker):
2900         (WebCore::MaximumDurationTracker::~MaximumDurationTracker):
2901         * page/FocusController.cpp:
2902         (WebCore::FocusController::setFocusedElement):
2903         (WebCore::FocusController::timeSinceFocusWasSet const):
2904         * page/FocusController.h:
2905         * page/FrameView.cpp:
2906         (WebCore::FrameView::reset):
2907         (WebCore::FrameView::willPaintContents):
2908         (WebCore::FrameView::didPaintContents):
2909         * page/FrameView.h:
2910         * page/animation/AnimationBase.cpp:
2911         (WebCore::AnimationBase::freezeAtTime):
2912         (WebCore::AnimationBase::beginAnimationUpdateTime const):
2913         * page/animation/AnimationBase.h:
2914         (WebCore::AnimationBase::onAnimationStartResponse):
2915         * page/animation/CSSAnimationController.cpp:
2916         (WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
2917         (WebCore::CSSAnimationControllerPrivate::receivedStartTimeResponse):
2918         (WebCore::CSSAnimationControllerPrivate::startTimeResponse):
2919         (WebCore::CSSAnimationController::notifyAnimationStarted):
2920         * page/animation/CSSAnimationController.h:
2921         * page/animation/CSSAnimationControllerPrivate.h:
2922         * page/mac/WheelEventDeltaFilterMac.h:
2923         * page/mac/WheelEventDeltaFilterMac.mm:
2924         (WebCore::WheelEventDeltaFilterMac::beginFilteringDeltas):
2925         (WebCore::WheelEventDeltaFilterMac::updateFromDelta):
2926         (WebCore::WheelEventDeltaFilterMac::endFilteringDeltas):
2927         * platform/ControlStates.h:
2928         (WebCore::ControlStates::timeSinceControlWasFocused const):
2929         (WebCore::ControlStates::setTimeSinceControlWasFocused):
2930         * platform/PlatformSpeechSynthesisUtterance.h:
2931         (WebCore::PlatformSpeechSynthesisUtterance::startTime const):
2932         (WebCore::PlatformSpeechSynthesisUtterance::setStartTime):
2933         * platform/gamepad/PlatformGamepad.h:
2934         (WebCore::PlatformGamepad::lastUpdateTime const):
2935         (WebCore::PlatformGamepad::connectTime const):
2936         (WebCore::PlatformGamepad::PlatformGamepad):
2937         * platform/gamepad/cocoa/GameControllerGamepad.mm:
2938         (WebCore::GameControllerGamepad::setupAsExtendedGamepad):
2939         (WebCore::GameControllerGamepad::setupAsGamepad):
2940         * platform/gamepad/mac/HIDGamepad.cpp:
2941         (WebCore::HIDGamepad::HIDGamepad):
2942         (WebCore::HIDGamepad::valueChanged):
2943         * platform/graphics/GraphicsLayer.cpp:
2944         (WebCore::GraphicsLayer::suspendAnimations):
2945         * platform/graphics/GraphicsLayer.h:
2946         * platform/graphics/GraphicsLayerClient.h:
2947         (WebCore::GraphicsLayerClient::notifyAnimationStarted):
2948         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2949         (WebCore::LayerClient::platformCALayerAnimationStarted):
2950         (WebCore::AVFWrapper::createImageForTimeInRect):
2951         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2952         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
2953         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
2954         * platform/graphics/ca/GraphicsLayerCA.cpp:
2955         (WebCore::GraphicsLayerCA::addAnimation):
2956         (WebCore::GraphicsLayerCA::pauseAnimation):
2957         (WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
2958         (WebCore::GraphicsLayerCA::setAnimationOnLayer):
2959         (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
2960         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
2961         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
2962         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2963         * platform/graphics/ca/GraphicsLayerCA.h:
2964         (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
2965         (WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction):
2966         * platform/graphics/ca/LayerPool.cpp:
2967         (WebCore::LayerPool::LayerPool):
2968         (WebCore::LayerPool::addLayer):
2969         (WebCore::LayerPool::decayedCapacity const):
2970         (WebCore::LayerPool::pruneTimerFired):
2971         * platform/graphics/ca/LayerPool.h:
2972         * platform/graphics/ca/PlatformCAAnimation.h:
2973         * platform/graphics/ca/PlatformCALayer.h:
2974         * platform/graphics/ca/PlatformCALayerClient.h:
2975         (WebCore::PlatformCALayerClient::platformCALayerAnimationStarted):
2976         * platform/graphics/ca/TileGrid.cpp:
2977         (WebCore::TileGrid::revalidateTiles):
2978         (WebCore::TileGrid::startedNewCohort):
2979         (WebCore::TileGrid::TileCohortInfo::timeUntilExpiration):
2980         (WebCore::TileGrid::cohortRemovalTimerFired):
2981         * platform/graphics/ca/TileGrid.h:
2982         (WebCore::TileGrid::TileCohortInfo::TileCohortInfo):
2983         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2984         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2985         (mediaTimeToCurrentTime):
2986         (-[WebAnimationDelegate animationDidStart:]):
2987         (PlatformCALayerCocoa::animationStarted):
2988         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2989         (WebCore::CACFLayerTreeHost::notifyAnimationsStarted):
2990         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2991         (PlatformCALayerWin::animationStarted):
2992         (PlatformCALayerWin::layerTreeAsString const):
2993         * platform/graphics/ca/win/PlatformCALayerWin.h:
2994         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2995         (WebCore::WebCoreDecompressionSession::decodeSample):
2996         * platform/graphics/texmap/BitmapTexturePool.cpp:
2997         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
2998         * platform/graphics/texmap/BitmapTexturePool.h:
2999         (WebCore::BitmapTexturePool::Entry::markIsInUse):
3000         (WebCore::BitmapTexturePool::Entry::canBeReleased const):
3001         (): Deleted.
3002         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3003         (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
3004         (WebCore::GraphicsLayerTextureMapper::addAnimation):
3005         (WebCore::GraphicsLayerTextureMapper::pauseAnimation):
3006         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
3007         * platform/graphics/texmap/TextureMapperAnimation.cpp:
3008         (WebCore::TextureMapperAnimation::TextureMapperAnimation):
3009         (WebCore::TextureMapperAnimation::apply):
3010         (WebCore::TextureMapperAnimation::pause):
3011         (WebCore::TextureMapperAnimation::resume):
3012         (WebCore::TextureMapperAnimation::computeTotalRunningTime):
3013         (WebCore::TextureMapperAnimations::pause):
3014         (WebCore::TextureMapperAnimations::suspend):
3015         * platform/graphics/texmap/TextureMapperAnimation.h:
3016         (WebCore::TextureMapperAnimation::startTime const):
3017         (WebCore::TextureMapperAnimation::pauseTime const):
3018         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
3019         (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
3020         (WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
3021         * platform/graphics/texmap/TextureMapperFPSCounter.h:
3022         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
3023         (WebCore::TextureMapperPlatformLayerBuffer::markUsed):
3024         (WebCore::TextureMapperPlatformLayerBuffer::lastUsedTime const):
3025         (): Deleted.
3026         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
3027         (WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired):
3028         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3029         (WebCore::CoordinatedGraphicsLayer::addAnimation):
3030         (WebCore::CoordinatedGraphicsLayer::pauseAnimation):
3031         (WebCore::CoordinatedGraphicsLayer::suspendAnimations):
3032         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3033         * platform/mediastream/RealtimeMediaSource.h:
3034         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
3035         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
3036         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
3037         (WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
3038         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
3039         (WebCore::DisplayCaptureSourceCocoa::startProducingData):
3040         (WebCore::DisplayCaptureSourceCocoa::stopProducingData):
3041         (WebCore::DisplayCaptureSourceCocoa::elapsedTime):
3042         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
3043         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
3044         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
3045         (WebCore::MockRealtimeAudioSourceMac::render):
3046         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3047         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
3048         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
3049         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
3050         (WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer):
3051         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable):
3052         * platform/mock/MockRealtimeAudioSource.cpp:
3053         (WebCore::MockRealtimeAudioSource::startProducingData):
3054         (WebCore::MockRealtimeAudioSource::stopProducingData):
3055         (WebCore::MockRealtimeAudioSource::elapsedTime):
3056         (WebCore::MockRealtimeAudioSource::tick):
3057         (WebCore::MockRealtimeAudioSource::delaySamples):
3058         * platform/mock/MockRealtimeAudioSource.h:
3059         (WebCore::MockRealtimeAudioSource::render):
3060         * platform/mock/MockRealtimeVideoSource.cpp:
3061         (WebCore::MockRealtimeVideoSource::startProducingData):
3062         (WebCore::MockRealtimeVideoSource::stopProducingData):
3063         (WebCore::MockRealtimeVideoSource::elapsedTime):
3064         (WebCore::MockRealtimeVideoSource::drawText):
3065         (WebCore::MockRealtimeVideoSource::delaySamples):
3066         (WebCore::MockRealtimeVideoSource::generateFrame):
3067         * platform/mock/MockRealtimeVideoSource.h:
3068         * platform/network/DNSResolveQueue.cpp:
3069         (WebCore::DNSResolveQueue::DNSResolveQueue):
3070         (WebCore::DNSResolveQueue::isUsingProxy):
3071         * platform/network/DNSResolveQueue.h:
3072         * rendering/RenderBoxModelObject.cpp:
3073         (WebCore::RenderBoxModelObject::suspendAnimations):
3074         * rendering/RenderBoxModelObject.h:
3075         * rendering/RenderElement.cpp:
3076         (WebCore::RenderElement::paintFocusRing):
3077         * rendering/RenderImage.cpp:
3078         (WebCore::RenderImage::paintAreaElementFocusRing):
3079         * rendering/RenderLayerBacking.cpp:
3080         (WebCore::RenderLayerBacking::notifyAnimationStarted):
3081         (WebCore::RenderLayerBacking::suspendAnimations):
3082         * rendering/RenderLayerBacking.h:
3083         * rendering/RenderLayerCompositor.cpp:
3084         (WebCore::RenderLayerCompositor::didPaintBacking):
3085         * rendering/RenderProgress.cpp:
3086         (WebCore::RenderProgress::RenderProgress):
3087         (WebCore::RenderProgress::animationProgress const):
3088         (WebCore::RenderProgress::updateAnimationState):
3089         * rendering/RenderProgress.h:
3090         * rendering/RenderTheme.cpp:
3091         (WebCore::RenderTheme::animationDurationForProgressBar const):
3092         * rendering/RenderTheme.h:
3093         * rendering/RenderThemeGtk.cpp:
3094         (WebCore::RenderThemeGtk::animationDurationForProgressBar const):
3095         * rendering/RenderThemeGtk.h:
3096         * rendering/RenderThemeIOS.h:
3097         * rendering/RenderThemeIOS.mm:
3098         (WebCore::RenderThemeIOS::animationDurationForProgressBar const):
3099         * rendering/RenderThemeMac.h:
3100         * rendering/RenderThemeMac.mm:
3101         (WebCore::RenderThemeMac::animationDurationForProgressBar const):
3102         * svg/animation/SMILTimeContainer.cpp:
3103         (WebCore::SMILTimeContainer::SMILTimeContainer):
3104         (WebCore::SMILTimeContainer::elapsed const):
3105         (WebCore::SMILTimeContainer::isActive const):
3106         (WebCore::SMILTimeContainer::isPaused const):
3107         (WebCore::SMILTimeContainer::isStarted const):
3108         (WebCore::SMILTimeContainer::begin):
3109         (WebCore::SMILTimeContainer::pause):
3110         (WebCore::SMILTimeContainer::resume):
3111         (WebCore::SMILTimeContainer::setElapsed):
3112         (WebCore::SMILTimeContainer::timerFired):
3113         * svg/animation/SMILTimeContainer.h:
3114         * testing/Internals.cpp:
3115         (WebCore::Internals::delayMediaStreamTrackSamples):
3116         * testing/MockGamepad.cpp:
3117         (WebCore::MockGamepad::MockGamepad):
3118         (WebCore::MockGamepad::updateDetails):
3119         (WebCore::MockGamepad::setAxisValue):
3120         (WebCore::MockGamepad::setButtonValue):
3121
3122 2018-03-02  Alejandro G. Castro  <alex@igalia.com>
3123
3124         Make LibWebRTCProvider port agnostic again after r215424
3125         https://bugs.webkit.org/show_bug.cgi?id=183080
3126
3127         Reviewed by Youenn Fablet.
3128
3129         In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
3130         we have moved that code to the cocoa class and created a glib implementation that will be used in the future
3131         to implement the LibWebRTCProviderGlib class.
3132
3133         No new tests, this is a refactor.
3134
3135         * Sources.txt: Add the compilation of the new file.
3136         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
3137         (WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
3138         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
3139         (WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
3140         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
3141         (WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
3142         linking libwebrtc for the moment in these situations.
3143
3144 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
3145
3146         REGRESSION(r222843): [HarfBuzz] Combining enclosed keycap not correctly handled
3147         https://bugs.webkit.org/show_bug.cgi?id=183246
3148
3149         Reviewed by Michael Catanzaro.
3150
3151         We are not correctly handling the combining enclosed keycap since we switched to use
3152         ComplexTextController. This is because fontForCombiningCharacterSequence() always returns the font of the first
3153         character, without checking if that font can render the whole sequence or not. Before 222843, the shaper did
3154         that check when creating the text runs. In this case the sequence was split and a different font was used for the
3155         text and the mark. This patch makes fontForCombiningCharacterSequence() try to find a suitable font for the
3156         whole sequence, first looking at the CSS fallbacks and finally at system ones. The result is much better than
3157         the old one, because we use the same font for both the text and the mark. If there isn't any font to render the
3158         mark, then we fallback to use the first character font, since we will end up rendering the missing glyph
3159         character, it's better to use the same font than the first character one.
3160
3161         Test: fast/text/combining-enclosing-keycap.html
3162
3163         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3164         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Check if the first charatcer font can render
3165         the whole sequence, trying with fallbacks otherwise.
3166         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
3167         (WebCore::Font::canRenderCombiningCharacterSequence const): Check if the font face has glyphs for the whole
3168         sequence not just the first character.
3169
3170 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
3171
3172         [FreeType] Remove FontPlatformData fallbacks
3173         https://bugs.webkit.org/show_bug.cgi?id=183210
3174
3175         Reviewed by Michael Catanzaro.
3176
3177         They are only used by FontCache::systemFallbackForCharacters() where a direct FcFontMatch provides the same
3178         or better results.
3179
3180         * platform/graphics/FontPlatformData.h: Remove fallbacks.
3181         * platform/graphics/freetype/FontCacheFreeType.cpp:
3182         (WebCore::FontCache::systemFallbackForCharacters): Use FcFontMatch() only.
3183         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3184         (WebCore::FontPlatformData::fallbacks): Removed.
3185
3186 2018-03-01  Commit Queue  <commit-queue@webkit.org>
3187
3188         Unreviewed, rolling out r229153.
3189         https://bugs.webkit.org/show_bug.cgi?id=183274
3190
3191         it is breaking imported/w3c/web-platform-tests/service-workers
3192         /service-worker/clients-matchall-exact-controller.https.html
3193         (Requested by youenn on #webkit).
3194
3195         Reverted changeset:
3196
3197         "Clients should register to StorageProcess with their service
3198         worker registration identifier"
3199         https://bugs.webkit.org/show_bug.cgi?id=182313
3200         https://trac.webkit.org/changeset/229153
3201
3202 2018-03-01  Youenn Fablet  <youenn@apple.com>
3203
3204         Clients should register to StorageProcess with their service worker registration identifier
3205         https://bugs.webkit.org/show_bug.cgi?id=182313
3206
3207         Reviewed by Chris Dumez.
3208
3209         No observable change of behavior in regular conditions.
3210         When service worker process crashes, the service worker identifiers sent by the WebProcess might be wrong
3211         and we will not be able to retrieve the registration from these identifiers.
3212         The storage process will be able to still process correctly messages coming from the WebProcess to register clients of the registration.
3213         Otherwise, there is a chance that WebProcess clients will not be added to the SWServerRegistration.m_clientsUsingRegistration maps.
3214
3215         * dom/Document.cpp:
3216         (WebCore::Document::setServiceWorkerConnection):
3217         * workers/service/SWClientConnection.h:
3218         * workers/service/server/SWServer.cpp:
3219         (WebCore::SWServer::registerServiceWorkerClient):
3220         * workers/service/server/SWServer.h:
3221
3222 2018-03-01  Youenn Fablet  <youenn@apple.com>
3223
3224         Add API test to validate setting of service worker and cache storage directories
3225         https://bugs.webkit.org/show_bug.cgi?id=182543
3226
3227         Reviewed by Chris Dumez.
3228
3229         Covered by API tests.
3230
3231         Add getters to service worker registration directory.
3232
3233         * testing/Internals.cpp:
3234         (WebCore::Internals::serviceWorkerRegistrationDirectory):
3235         * testing/Internals.h:
3236         * testing/Internals.idl:
3237         * workers/service/SWClientConnection.h:
3238         * workers/service/server/RegistrationDatabase.h:
3239         (WebCore::RegistrationDatabase::serviceWorkerRegistrationDirectory const):
3240         * workers/service/server/RegistrationStore.h:
3241         (WebCore::RegistrationStore::serviceWorkerRegistrationDirectory const):
3242         * workers/service/server/SWServer.h:
3243         (WebCore::SWServer::serviceWorkerRegistrationDirectory const):
3244
3245 2018-03-01  Youenn Fablet  <youenn@apple.com>
3246
3247         SWServer::removeClientServiceWorkerRegistration should not log an error if there is no registration
3248         https://bugs.webkit.org/show_bug.cgi?id=183248
3249
3250         Reviewed by Chris Dumez.
3251
3252         No change of behavior.
3253         Removed the error logging.
3254         As can be seen from running api and layout tests, a web process can ask a registration to be unregistered
3255         and by the time it goes to the StorageProcess, the registration is already cleared.
3256
3257         * workers/service/server/SWServer.cpp:
3258         (WebCore::SWServer::removeClientServiceWorkerRegistration):
3259
3260 2018-03-01  Daniel Bates  <dabates@apple.com>
3261
3262         CSS ::selection stroke-color and stroke-width are not applied to selected text in text fields
3263         and ::selection:window-inactive stroke-color and stroke-width are never applied
3264         https://bugs.webkit.org/show_bug.cgi?id=183178
3265
3266         Reviewed by David Hyatt.
3267
3268         This change fixes the following two issues:
3269             1. Properties stroke-color and stroke-width are not applied to the ::selection pseudo-
3270                element of text fields.
3271             2. Properties stroke-color and stroke-width are never applied to ::selection:window-inactive
3272                pseudo elements.
3273
3274         Currently when computing the paint styles for selected text we query the cached styles for
3275         the ::selection pseudo element on the renderer. Text fields are implemented using a User Agent
3276         shadow DOM. With regards to issue (1) the renderer queried was the inner most renderer for
3277         the text in the text field. But it should have been the shadow host renderer (i.e. the renderer
3278         for the <input>). With regards to issue (2) we cannot retrieve cached styles for the
3279         ::selection pseudo element because it can be effected by a pseudo class, :window-inactive,
3280         which matches when the page is deactivated (i.e. the window is in the background as the user
3281         made another window the frontmost window). Both of these issues are fixed by making use
3282         of RenderElement::selectionPseudoStyle().
3283
3284         Tests: fast/selectors/selection-window-inactive-stroke-color.html
3285                fast/selectors/selection-window-inactive-text-shadow.html
3286                fast/selectors/text-field-selection-stroke-color.html
3287                fast/selectors/text-field-selection-text-shadow.html
3288                fast/selectors/text-field-selection-window-inactive-stroke-color.html
3289                fast/selectors/text-field-selection-window-inactive-text-shadow.html
3290
3291         * rendering/RenderText.h:
3292         (WebCore::RenderText::selectionPseudoStyle const): Add a convenience function that turns
3293         around and calls the function of the same name on its parent.
3294         * rendering/TextPaintStyle.cpp:
3295         (WebCore::computeTextSelectionPaintStyle): Modified to use RenderText::selectionPseudoStyle()
3296         instead of directly querying for the cached styles for the ::selection pseudo element.
3297
3298 2018-03-01  Per Arne Vollan  <pvollan@apple.com>
3299
3300         Scrollbar preferences are ignored when the WebContent process doesn't have access to the WindowServer.
3301         https://bugs.webkit.org/show_bug.cgi?id=183231
3302         <rdar://problem/37793457>
3303
3304         Reviewed by Brent Fulgham.
3305
3306         When the WebContent process doesn't have access to the WindowServer, the scrollbars are always of the overlay type.
3307         The notification about scrollbar preferences is never received by the WebContent process when there is no
3308         WindowServer access. This can be fixed by adding an observer of scrollbar preferences in the UI process, and
3309         notifying the WebProcess about this by sending it a message. This message should also contain the preferred
3310         scrollbar type, since the call '[NSScroller preferredScrollerStyle]' will always return the overlay style when
3311         there is no WindowServer access.
3312
3313         No new tests, covered by existing tests.
3314
3315         * WebCore.xcodeproj/project.pbxproj:
3316         * platform/mac/NSScrollerImpDetails.h:
3317         * platform/mac/NSScrollerImpDetails.mm:
3318         (WebCore::ScrollerStyle::recommendedScrollerStyle):
3319         (WebCore::ScrollerStyle::setUseOverlayScrollbars):
3320         (WebCore::recommendedScrollerStyle): Deleted.
3321         * platform/mac/ScrollAnimatorMac.mm:
3322         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
3323         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar const):
3324         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar const):
3325         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
3326         * platform/mac/ScrollbarThemeMac.mm:
3327         (WebCore::ScrollbarThemeMac::registerScrollbar):
3328         (WebCore::ScrollbarThemeMac::scrollbarThickness):
3329         (WebCore::ScrollbarThemeMac::usesOverlayScrollbarsChanged):
3330
3331 2018-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
3332
3333         Temporarily enable user-installed-fonts everywhere until we can stop crashing on launch
3334         https://bugs.webkit.org/show_bug.cgi?id=183255
3335
3336         Unreviewed.
3337
3338         Tests are already disabled.
3339
3340         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3341
3342 2018-03-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3343
3344         [Curl] Split DNS cache expiration and connection timeout setting.
3345         https://bugs.webkit.org/show_bug.cgi?id=182979
3346
3347         It was mis-implemented and was named ambiguous name 'enableTimeout'.
3348         Implement each feature correctly.
3349
3350         Reviewed by Per Arne Vollan.
3351
3352         * platform/network/curl/CurlContext.cpp:
3353         (WebCore::EnvironmentVariableReader::read):
3354         (WebCore::EnvironmentVariableReader::defined):
3355         (WebCore::EnvironmentVariableReader::readAs):
3356         (WebCore::EnvironmentVariableReader::sscanTemplate):
3357         (WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>):
3358         (WebCore::CurlContext::CurlContext):
3359         (WebCore::safeTimeValue):
3360         (WebCore::CurlHandle::setDnsCacheTimeout):
3361         (WebCore::CurlHandle::setConnectTimeout):
3362         (WebCore::CurlHandle::setTimeout):
3363         (WebCore::CurlHandle::enableTimeout): Deleted.
3364         * platform/network/curl/CurlContext.h:
3365         (WebCore::CurlContext::dnsCacheTimeout const):
3366         (WebCore::CurlContext::connectTimeout const):
3367         * platform/network/curl/CurlRequest.cpp:
3368         (WebCore::CurlRequest::setupTransfer):
3369
3370 2018-03-01  Zalan Bujtas  <zalan@apple.com>
3371
3372         Remove RenderElement::s_noLongerAffectsParentBlock
3373         https://bugs.webkit.org/show_bug.cgi?id=183196
3374         <rdar://problem/38030797>
3375
3376         Reviewed by Antti Koivisto.
3377
3378         Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.
3379
3380         Covered by existing tests.
3381
3382         * rendering/RenderBlockFlow.cpp:
3383         (WebCore::RenderBlockFlow::styleDidChange):
3384         * rendering/RenderElement.cpp:
3385         (WebCore::RenderElement::styleWillChange):
3386         (WebCore::RenderElement::noLongerAffectsParentBlock const):
3387         (WebCore::RenderElement::styleDidChange):
3388         * rendering/RenderElement.h:
3389         (WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.
3390
3391 2018-03-01  Chris Dumez  <cdumez@apple.com>
3392
3393         imported/w3c/web-platform-tests/html/browsers/windows/browsing-context.html fails with async policy delegates
3394         https://bugs.webkit.org/show_bug.cgi?id=183225
3395         <rdar://problem/38003828>
3396
3397         Reviewed by Alex Christensen.
3398
3399         Bypass navigation policy check when loading about:blank. This does not seem necessary and it would not
3400         be Web-compatible for such policy check to happen synchronously. This is because an iframe without src
3401         or src="about:blank" should load synchronously as per HTML specification.
3402
3403         Test: http/wpt/html/browsers/windows/browsing-context.html
3404
3405         * loader/PolicyChecker.cpp:
3406         (WebCore::PolicyChecker::checkNavigationPolicy):
3407
3408 2018-03-01  Christopher Reid  <chris.reid@sony.com>
3409
3410         [Curl] Linker errors in some curl files due to missing exports
3411         https://bugs.webkit.org/show_bug.cgi?id=183238
3412
3413         Reviewed by Alex Christensen.
3414
3415         No new tests, no change in behavior.
3416
3417         Adding WEBCORE_EXPORT to functions now used in WebKit.
3418
3419         * platform/network/NetworkStorageSession.h:
3420         * platform/network/curl/CookieJarDB.h:
3421         * platform/network/curl/CurlContext.h:
3422
3423 2018-03-01  Commit Queue  <commit-queue@webkit.org>
3424
3425         Unreviewed, rolling out r229130.
3426         https://bugs.webkit.org/show_bug.cgi?id=183244
3427
3428         It breaks AppleWin compilation (Requested by alexg__ on
3429         #webkit).
3430
3431         Reverted changeset:
3432
3433         "Make LibWebRTCProvider port agnostic again after r215424"
3434         https://bugs.webkit.org/show_bug.cgi?id=183080
3435         https://trac.webkit.org/changeset/229130
3436
3437 2018-03-01  Alejandro G. Castro  <alex@igalia.com>
3438
3439         Make LibWebRTCProvider port agnostic again after r215424
3440         https://bugs.webkit.org/show_bug.cgi?id=183080
3441
3442         Reviewed by Youenn Fablet.
3443
3444         In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
3445         we have moved that code to the cocoa class and created a glib implementation that will be used in the future
3446         to implement the LibWebRTCProviderGlib class.
3447
3448         No new tests, this is a refactor.
3449
3450         * Sources.txt: Add the compilation of the new file.
3451         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
3452         (WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
3453         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
3454         (WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
3455         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
3456         (WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
3457         linking libwebrtc for the moment in these situations.
3458
3459 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
3460
3461         [FreeType] Color emojis in WebKitGTK+ for great justice
3462         https://bugs.webkit.org/show_bug.cgi?id=183155
3463
3464         Reviewed by Michael Catanzaro.
3465
3466         Emojis are actually rendered if there's an emoji font installed in the system, but the size is so tiny that we
3467         don't see them. This is because for some reason the matrix we are getting from fontconfig contains a scale,
3468         which we don't expect. We only get the fontconfig matrix to apply rotations in case of oblique fonts, and then we
3469         always apply the scale for the computed pixel font size. Ignoring the fontconfig matrix scale fixes the issue.
3470
3471         * platform/graphics/freetype/FontCacheFreeType.cpp:
3472         (WebCore::fontWeightToFontconfigWeight): Moved here since it's now used by configurePatternForFontDescription().
3473         (WebCore::configurePatternForFontDescription): Helper function to apply the same options for fallback pattern.
3474         (WebCore::createFontConfigPatternForCharacters): Use configurePatternForFontDescription().
3475         (WebCore::findBestFontGivenFallbacks): Adopt the returned reference.
3476         (WebCore::FontCache::systemFallbackForCharacters): Clean it up.
3477         (WebCore::FontCache::createFontPlatformData): Use configurePatternForFontDescription().
3478         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3479         (WebCore::FontPlatformData::buildScaledFont): Ignore the scale returned by fontconfig matrix.
3480
3481 2018-02-28  Philippe Normand  <pnormand@igalia.com>
3482
3483         [GStreamer] text samples no longer processed
3484         https://bugs.webkit.org/show_bug.cgi?id=183212
3485
3486         Reviewed by Xabier Rodriguez-Calvar.
3487
3488         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3489         (WebCore::MediaPlayerPrivateGStreamer::newTextSample): Refer to
3490         track stream ID instead of (potentially) manually generated track
3491         ID stored as hashmap keys.
3492
3493 2018-02-28  Tim Horton  <timothy_horton@apple.com>
3494
3495         Push WTF_PLATFORM_IOS down into preprocessor.pm instead of trying to determine it inside
3496         https://bugs.webkit.org/show_bug.cgi?id=183193
3497
3498         Reviewed by Andy Estes.
3499
3500         * DerivedSources.make:
3501         * bindings/scripts/preprocessor.pm:
3502         (applyPreprocessor):
3503         Instead of trying to discern WTF_PLATFORM_IOS inside preprocessor.pm,
3504         push it down from DerivedSources.make. Also clean up DerivedSources.make
3505         a tiny bit by adding a variable, FEATURE_AND_PLATFORM_DEFINES, which
3506         contains both FEATURE_DEFINES and WTF_PLATFORM macros if needed.
3507
3508 2018-02-28  Nan Wang  <n_wang@apple.com>
3509
3510         AX: AOM: Dispatch accessiblesetvalue event
3511         https://bugs.webkit.org/show_bug.cgi?id=183021
3512         <rdar://problem/37764242>
3513
3514         Reviewed by Chris Fleizach.
3515
3516         Accessibility events.
3517         Spec: https://wicg.github.io/aom/spec/phase2.html
3518
3519         Added a new event type AccessibleSetValueEvent. 
3520
3521         Test: accessibility/mac/AOM-event-accessiblesetvalue.html
3522
3523         * CMakeLists.txt:
3524         * DerivedSources.make:
3525         * Sources.txt:
3526         * WebCore.xcodeproj/project.pbxproj:
3527         * accessibility/AccessibilityAllInOne.cpp:
3528         * accessibility/AccessibilityNodeObject.cpp:
3529         (WebCore::AccessibilityNodeObject::canSetValueAttribute const):
3530         * accessibility/AccessibilityObject.cpp:
3531         (WebCore::AccessibilityObject::press):
3532         (WebCore::AccessibilityObject::dispatchAccessibilityEvent):
3533         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent):
3534         * accessibility/AccessibilityObject.h:
3535         * accessibility/AccessibilityRenderObject.cpp:
3536         (WebCore::AccessibilityRenderObject::setValue):
3537         * accessibility/AccessibilityScrollbar.cpp:
3538         (WebCore::AccessibilityScrollbar::setValue):
3539         * accessibility/AccessibilitySlider.cpp:
3540         (WebCore::AccessibilitySlider::setValue):
3541         * accessibility/AccessibleSetValueEvent.cpp: Added.
3542         (WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent):
3543         * accessibility/AccessibleSetValueEvent.h: Added.
3544         (WebCore::AccessibleSetValueEvent::create):
3545         (WebCore::AccessibleSetValueEvent::value const):
3546         * accessibility/AccessibleSetValueEvent.idl: Added.
3547         * dom/Element.idl:
3548         * dom/EventNames.h:
3549         * dom/EventNames.in:
3550
3551 2018-02-28  Chris Dumez  <cdumez@apple.com>
3552
3553         html/browsers/browsing-the-web/navigating-across-documents/006.html fails with async policy delegates
3554         https://bugs.webkit.org/show_bug.cgi?id=183168
3555         <rdar://problem/37951341>
3556
3557         Reviewed by Alex Christensen.
3558
3559         The test has an anchor element with both a 'click' event handler which submits a form
3560         and an href attribute. When clicking the link, as per specification, things happen in
3561         this order:
3562         1. We fire the click event at the anchor, which will execute the event handler and submit the form.
3563            Submitting the form *schedules* a navigation to 'click.html'.
3564         2. We execute the anchor activation code which *navigates* to 'href.html'. The navigation to
3565            'href' is supposed to cancel the pending navigation to 'click.html' and we should navigate
3566            to 'href.html', which is what the test asserts.
3567
3568         The issue for us is that we do not cancel pending navigations until after the navigation
3569         policy decision is made, when the provisional loads actually starts, in FrameLoader::provisionalLoadStarted().
3570         Because the policy decision for the navigation can now be made asynchronously, the NavigationScheduler
3571         timer can now fire while the decision is made and we'll submit the form, thus navigating to
3572         'click.html'.
3573
3574         To address the issue, we now cancel any pending navigations in FrameLoader::loadWithDocumentLoader(),
3575         *before* doing the policy check for the navigation.
3576
3577         Test: http/wpt/html/browsers/browsing-the-web/navigating-across-documents/006.html
3578
3579         * loader/FrameLoader.cpp:
3580         (WebCore::FrameLoader::loadWithDocumentLoader):
3581
3582 2018-02-28  John Wilander  <wilander@apple.com>
3583
3584         Add a second tier of prevalence to facilitate telemetry on very prevalent domains
3585         https://bugs.webkit.org/show_bug.cgi?id=183218
3586         <rdar://problem/37992388>
3587
3588         Reviewed by Brent Fulgham.
3589
3590         Test: http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html
3591
3592         * loader/ResourceLoadStatistics.cpp:
3593         (WebCore::ResourceLoadStatistics::encode const):
3594         (WebCore::ResourceLoadStatistics::decode):
3595         (WebCore::ResourceLoadStatistics::toString const):
3596         (WebCore::ResourceLoadStatistics::merge):
3597             Handling of the new boolean field isVeryPrevalentResource.
3598         * loader/ResourceLoadStatistics.h:
3599             Added the new boolean field isVeryPrevalentResource.
3600
3601 2018-02-28  Alex Christensen  <achristensen@webkit.org>
3602
3603         Reduce use of NetworkingContext in WebKit
3604         https://bugs.webkit.org/show_bug.cgi?id=183213
3605
3606         Reviewed by Brady Eidson.
3607
3608         NetworkingContext is intended to be used only with ResourceHandle, which is now only used in WebKitLegacy.
3609         Now that we don't use ResourceHandle in the WebProcess, everything that was done through the NetworkingContext
3610         can now be done a cleaner way with no change in behavior.
3611
3612         * loader/FrameLoader.cpp:
3613         (WebCore::FrameLoader::loadResourceSynchronously):
3614         * loader/LinkLoader.cpp:
3615         (WebCore::LinkLoader::loadLink):
3616         * loader/LoaderStrategy.h:
3617         * platform/network/ProxyServer.h:
3618         * platform/network/cf/ProxyServerCFNet.cpp:
3619         (WebCore::proxyServersForURL):
3620         * platform/network/curl/ProxyServerCurl.cpp:
3621         (WebCore::proxyServersForURL):
3622         * platform/network/soup/ProxyServerSoup.cpp:
3623         (WebCore::proxyServersForURL):
3624
3625 2018-02-28  Zalan Bujtas  <zalan@apple.com>
3626
3627         Remove RenderElement::s_affectsParentBlock
3628         https://bugs.webkit.org/show_bug.cgi?id=183187
3629         <rdar://problem/37961079>
3630
3631         Reviewed by Antti Koivisto.
3632
3633         Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.
3634
3635         Covered by existing tests.
3636
3637         * rendering/RenderElement.cpp:
3638         (WebCore::RenderElement::styleWillChange):
3639         (WebCore::RenderElement::styleDidChange):
3640         * rendering/RenderElement.h:
3641
3642 2018-02-28  Antti Koivisto  <antti@apple.com>
3643
3644         Filter attribute selectors with selector filter
3645         https://bugs.webkit.org/show_bug.cgi?id=183200
3646
3647         Reviewed by Zalan Bujtas.
3648
3649         Currently selector filtering is done based on tags, classes and ids. We should include attributes too.
3650
3651         This patch adds filtering based on attribute name (but not content).
3652
3653         * css/SelectorFilter.cpp:
3654         (WebCore::isExcludedAttribute):
3655
3656             Ignore id, class and style attributes. First two are already handled and the last is common but is rarely
3657             used in selectors.
3658
3659         (WebCore::collectElementIdentifierHashes):
3660
3661             Collect attributes.
3662             Remove the unnecessary StyledElement casting.
3663
3664         (WebCore::collectSimpleSelectorHash):
3665
3666             Collect attribute selectors.
3667
3668         (WebCore::chooseSelectorHashesForFilter):
3669
3670             Pick attributes with high priority for the filter as it is likely a good signal.
3671
3672 2018-02-27  Sergio Villar Senin  <svillar@igalia.com>
3673
3674         [WebVR] Convert VRPlatformDisplayInfo into a class
3675         https://bugs.webkit.org/show_bug.cgi?id=183162
3676
3677         Reviewed by Žan Doberšek.
3678
3679         In preparation for further changes we're transforming the
3680         VRPlatformDisplayInfo into a class. All the members are now private
3681         and the class provides the needed getters/setters.
3682
3683         Apart from that VRDisplayCapabilityFlags is now just an unsigned and
3684         the different flags are defined in VRDisplayCapabilityFlag enum.
3685         Another cleanup was the removal of VRDisplayCapabilities.cpp as
3686         everything can be implemented in the header.
3687
3688         * Modules/webvr/VRDisplay.cpp:
3689         (WebCore::VRDisplay::VRDisplay):
3690         (WebCore::VRDisplay::isConnected const):
3691         (WebCore::VRDisplay::stageParameters const):
3692         * Modules/webvr/VRDisplayCapabilities.cpp: Removed.
3693         * Modules/webvr/VRDisplayCapabilities.h:
3694         (WebCore::VRDisplayCapabilities::hasPosition const):
3695         (WebCore::VRDisplayCapabilities::hasOrientation const):
3696         (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
3697         (WebCore::VRDisplayCapabilities::canPresent const):
3698         (WebCore::VRDisplayCapabilities::maxLayer const):
3699         (WebCore::VRDisplayCapabilities::VRDisplayCapabilities):
3700         * Sources.txt:
3701         * platform/vr/VRPlatformDisplay.h:
3702         (WebCore::VRPlatformDisplayInfo::displayName const):
3703         (WebCore::VRPlatformDisplayInfo::setDisplayName):
3704         (WebCore::VRPlatformDisplayInfo::isConnected const):
3705         (WebCore::VRPlatformDisplayInfo::setIsConnected):
3706         (WebCore::VRPlatformDisplayInfo::isMounted const):
3707         (WebCore::VRPlatformDisplayInfo::setIsMounted):
3708         (WebCore::VRPlatformDisplayInfo::capabilityFlags const):
3709         (WebCore::VRPlatformDisplayInfo::setCapabilityFlags):
3710         (WebCore::VRPlatformDisplayInfo::displayIdentifier const):
3711         (WebCore::VRPlatformDisplayInfo::setDisplayIdentifier):
3712         (WebCore::VRPlatformDisplayInfo::eyeTranslation const):
3713         (WebCore::VRPlatformDisplayInfo::setEyeTranslation):
3714         (WebCore::VRPlatformDisplayInfo::eyeFieldOfView const):
3715         (WebCore::VRPlatformDisplayInfo::setEyeFieldOfView):
3716         (WebCore::VRPlatformDisplayInfo::renderSize const):
3717         (WebCore::VRPlatformDisplayInfo::setRenderSize):
3718         (WebCore::VRPlatformDisplayInfo::setPlayAreaBounds):
3719         (WebCore::VRPlatformDisplayInfo::playAreaBounds const):
3720         (WebCore::VRPlatformDisplayInfo::setSittingToStandingTransform):
3721         (WebCore::VRPlatformDisplayInfo::sittingToStandingTransform const):
3722         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
3723         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
3724         (WebCore::VRPlatformDisplayOpenVR::updateEyeParameters):
3725         (WebCore::VRPlatformDisplayOpenVR::updateStageParameters):
3726
3727 2018-02-27  Commit Queue  <commit-queue@webkit.org>
3728
3729         Unreviewed, rolling out r229060.
3730         https://bugs.webkit.org/show_bug.cgi?id=183198
3731
3732         This patch causes crashes on two SVG tests (Requested by fredw
3733         on #webkit).
3734
3735         Reverted changeset:
3736
3737         "Relayout frames after AsyncFrameScrolling or FrameFlattening
3738         option is changed"
3739         https://bugs.webkit.org/show_bug.cgi?id=183081
3740         https://trac.webkit.org/changeset/229060
3741
3742 2018-02-27  Youenn Fablet  <youenn@apple.com>
3743
3744         Do not trigger a service worker match in case of document redirection if it will be already served by AppCache
3745         https://bugs.webkit.org/show_bug.cgi?id=183185
3746         <rdar://problem/37693796>
3747
3748         Reviewed by Chris Dumez.
3749
3750         Disabling service worker matching in case there is a substitute data.
3751         Otherwise there is a risk for a double load, substitute data first and the new load
3752         triggered if matching a new registration.
3753         A future fix should first do service worker registration matching and if there is no registration query appcache.
3754
3755         Test: http/tests/appcache/main-resource-redirect-with-sw.html
3756
3757         * loader/DocumentLoader.cpp:
3758         (WebCore::DocumentLoader::redirectReceived):
3759
3760 2018-02-27  Tim Horton  <timothy_horton@apple.com>
3761
3762         Ensure target triple is propagated correctly to DerivedSources.make
3763         https://bugs.webkit.org/show_bug.cgi?id=183189
3764         <rdar://problem/37959694>
3765
3766         Reviewed by Dan Bernstein.
3767
3768         If we don't propagate the target triple, we can sometimes build with
3769         the wrong options enabled.
3770
3771         * Configurations/Base.xcconfig:
3772         Mentioning LLVM_TARGET_TRIPLE_SUFFIX here is required to get it to be available to scripts.
3773
3774         * DerivedSources.make:
3775         Propagate the target triple into our compiler invocations.
3776
3777 2018-02-27  Doug Russell  <doug@getitdownonpaper.com>
3778
3779         AX: Spell check and style attributes should be optional when fetching attributed string
3780         https://bugs.webkit.org/show_bug.cgi?id=160744
3781
3782         Reviewed by Chris Fleizach.
3783
3784         The overhead of fetching a spell checked attributed string via AX API is substantial. 
3785         In some cases on the order of 7/8 of the total time spent fetching the string.
3786
3787         This change introduces the new attribute AXAttributedStringForTextMarkerRangeWithOptions which accepts an NSDictionary as it's parameter with keys "AXTextMarkerRange" (AXTextMarkerRangeRef) and "AXSpellCheck" (NSNumber(BOOL)).
3788
3789         AXAttributedStringForTextMarkerRange will remain unchanged.
3790
3791         Tests: accessibility/mac/attributed-string/attributed-string-for-range-with-options.html
3792                accessibility/mac/attributed-string/attributed-string-for-range.html
3793
3794         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3795         (AXAttributedStringAppendText):
3796         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
3797         (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
3798         (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]):
3799         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3800         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Deleted.
3801
3802 2018-02-27  Daniel Bates  <dabates@apple.com>
3803
3804         Standardize terminology for marked text
3805         https://bugs.webkit.org/show_bug.cgi?id=180999
3806
3807         Reviewed by Zalan Bujtas.
3808
3809         The name MarkerSubrange is a misnomer for a data structure that associates a text subrange with a type
3810         and optional document marker. In particular, a MarkerSubrange may not always correspond to a document
3811         marker. For instance, selected text is represented using a MarkerSubrange that does not have a
3812         corresponding document marker. Let's standardize on the phrase "marked text" as the canonical way to
3813         describe these tagged text subranges.
3814
3815         * Sources.txt:
3816         * WebCore.xcodeproj/project.pbxproj:
3817         * rendering/InlineTextBox.cpp:
3818         (WebCore::InlineTextBox::localSelectionRect const):
3819         (WebCore::InlineTextBox::MarkedTextStyle::areBackgroundMarkedTextStylesEqual):
3820         (WebCore::InlineTextBox::MarkedTextStyle::areForegroundMarkedTextStylesEqual):
3821         (WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual):
3822         (WebCore::InlineTextBox::StyledMarkedText::StyledMarkedText):
3823         (WebCore::createMarkedTextFromSelectionInBox):
3824         (WebCore::InlineTextBox::paint):
3825         (WebCore::InlineTextBox::paintPlatformDocumentMarkers):
3826         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
3827         (WebCore::InlineTextBox::computeStyleForUnmarkedMarkedText const):
3828         (WebCore::InlineTextBox::resolveStyleForMarkedText):
3829         (WebCore::InlineTextBox::subdivideAndResolveStyle):
3830         (WebCore::InlineTextBox::coalesceAdjacentMarkedTexts):
3831         (WebCore::InlineTextBox::collectMarkedTextsForDraggedContent):
3832         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers):
3833         (WebCore::InlineTextBox::paintMarkedTexts):
3834         (WebCore::InlineTextBox::paintMarkedTextBackground):
3835         (WebCore::InlineTextBox::paintMarkedTextForeground):
3836         (WebCore::InlineTextBox::paintMarkedTextDecoration):
3837         (WebCore::InlineTextBox::paintCompositionBackground):
3838         (WebCore::InlineTextBox::MarkerSubrangeStyle::areBackgroundMarkerSubrangeStylesEqual): Deleted.
3839         (WebCore::InlineTextBox::MarkerSubrangeStyle::areForegroundMarkerSubrangeStylesEqual): Deleted.
3840         (WebCore::InlineTextBox::MarkerSubrangeStyle::areDecorationMarkerSubrangeStylesEqual): Deleted.
3841         (WebCore::InlineTextBox::StyledMarkerSubrange::StyledMarkerSubrange): Deleted.
3842         (WebCore::createMarkerSubrangeFromSelectionInBox): Deleted.
3843         (WebCore::InlineTextBox::computeStyleForUnmarkedMarkerSubrange const): Deleted.
3844         (WebCore::InlineTextBox::resolveStyleForSubrange): Deleted.
3845         (WebCore::InlineTextBox::coalesceAdjacentSubranges): Deleted.
3846         (WebCore::InlineTextBox::collectSubrangesForDraggedContent): Deleted.
3847         (WebCore::InlineTextBox::collectSubrangesForDocumentMarkers): Deleted.
3848         (WebCore::InlineTextBox::paintMarkerSubranges): Deleted.
3849         (WebCore::InlineTextBox::paintTextSubrangeBackground): Deleted.
3850         (WebCore::InlineTextBox::paintTextSubrangeForeground): Deleted.
3851         (WebCore::InlineTextBox::paintTextSubrangeDecoration): Deleted.
3852         * rendering/InlineTextBox.h:
3853         (WebCore::InlineTextBox::paintMarkedTexts):
3854         (WebCore::InlineTextBox::paintMarkerSubranges): Deleted.
3855         * rendering/MarkedText.cpp: Renamed from Source/WebCore/rendering/MarkerSubrange.cpp.
3856         (WebCore::subdivide):
3857         * rendering/MarkedText.h: Renamed from Source/WebCore/rendering/MarkerSubrange.h.
3858         (WebCore::MarkedText::MarkedText):
3859         (WebCore::MarkedText::isEmpty const):
3860         (WebCore::MarkedText::operator!= const):
3861         (WebCore::MarkedText::operator== const):
3862
3863 2018-02-27  Chris Dumez  <cdumez@apple.com>
3864
3865         Unreviewed, roll out r228430.
3866
3867         Roll out r228430 now that it is no longer needed after r228852.
3868
3869         No new tests, initial fix is still covered by WebKit.RespondToPolicyForNavigationResponseAsynchronously
3870         API test.
3871
3872         * loader/FrameLoader.cpp:
3873         (WebCore::FrameLoader::stopLoading):
3874         * loader/NavigationScheduler.cpp:
3875         (WebCore::NavigationScheduler::schedule):
3876
3877 2018-02-27  Antoine Quint  <graouts@apple.com>
3878
3879         [Web Animations] Correct implementation of pending tasks and promises
3880         https://bugs.webkit.org/show_bug.cgi?id=183161
3881
3882         Reviewed by Dean Jackson.
3883
3884         We had an incorrect implementation of the spec due to two misinterpretations.
3885
3886         The first one is about pending tasks (play and pause) which the spec says should
3887         be performed by "scheduling a task". In WebCore, this means using postTask() on a
3888         ScriptExecutionContext, such as Document. One of the big practical changes is that
3889         calling play() on an animation correctly sets its startTime to null (unresolved)
3890         immediately after the call to play() returns before setting it to a resolved value
3891         when the task is performed asynchronously. As a result, the playState is now always
3892         accurate.
3893
3894         The second one is about promises where new promises need to be created in certain
3895         situations called out by the spec. We used to call clear() on them, but this merely
3896         resets the fulfillment or rejection state of the promise, while the spec requires
3897         a different object to be returned for the promise. We now create our promises using
3898         makeUniqueRef<> when new promise objects are expected to be created.
3899
3900         This patch also corrects a few smaller bugs and spec compliant issues, called out
3901         below, related to pending tasks and promises uncovered while looking at relevant
3902         WPT tests.
3903
3904         * animation/DocumentTimeline.h: Expose the Document used to create this timeline such
3905         that it may be used by WebAnimation objects registered for this timeline when scheduling
3906         a task is required via postTask().
3907         * animation/WebAnimation.cpp:
3908         (WebCore::WebAnimation::WebAnimation):
3909         (WebCore::WebAnimation::setBindingsStartTime):
3910         (WebCore::WebAnimation::setCurrentTime):
3911         (WebCore::WebAnimation::cancel): Ensure the finished promise has not already been fulfilled
3912         before rejecting it. While the spec does not specifically call this out, a promise may not
3913         be rejected after being fulfilled, and we would hit an ASSERT if we didn't also check that
3914         it was in the correct pending state before attemping to reject it.
3915         (WebCore::WebAnimation::resetPendingTasks):
3916         (WebCore::WebAnimation::finish):
3917         (WebCore::WebAnimation::updateFinishedState):
3918         (WebCore::WebAnimation::finishNotificationSteps):
3919         (WebCore::WebAnimation::play): We used to only check for a pending pause task before canceling
3920         that task, but the spec says to check for either a pending pause or play task (ie. pending())
3921         and to cancel whichever is scheduled.
3922         (WebCore::WebAnimation::runPendingPlayTask): We were missing an assertion called out by the
3923         spec when running a pending task.
3924         (WebCore::WebAnimation::pause):
3925         (WebCore::WebAnimation::runPendingPauseTask):
3926         (WebCore::WebAnimation::updatePendingTasks): We now use postTask() on the animation's associated
3927         timeline's document to schedule pending tasks for which the criteria to run are met, ie. there
3928         is an associated timeline.
3929         * animation/WebAnimation.h:
3930
3931 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3932
3933         [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior
3934         https://bugs.webkit.org/show_bug.cgi?id=183100
3935         <rdar://problem/37840987>
3936
3937         Reviewed by Tim Horton.
3938
3939         Introduce new customization options to ViewportConfiguration. The first is m_forceHorizontalShrinkToFit, which
3940         (when set to true) forces the viewport to scale using shrink-to-fit heuristics, regardless of whether
3941         "shrink-to-fit=no" is specified via viewport parameters or if content width did not exceed minimum layout size.
3942         The second is m_viewSize, which reflects the true size of the viewport. See WebKit ChangeLog for more details.
3943
3944         Tests: ViewportSizingTests.ForceShrinkToFitViewportOverridesViewportParameters
3945                ViewportSizingTests.ShrinkToFitViewportWithMinimumAllowedLayoutWidth
3946
3947         * page/ViewportConfiguration.cpp:
3948         (WebCore::ViewportConfiguration::ViewportConfiguration):
3949         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
3950
3951         Plumb the real size of the view alongside the minimum layout size when updating the minimum layout size.
3952
3953         (WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit):
3954         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
3955
3956         Bail early and return true if forceHorizontalShrinkToFit is set. This forces shrink-to-fit even in cases where
3957         "shrink-to-fit" is set to "no", or content dimensions don't exceed layout dimensions.
3958
3959         (WebCore::ViewportConfiguration::initialScaleFromSize const):
3960
3961         Use view dimensions rather than minimum layout dimensions when computing the initial scale. Minimum layout size
3962         is no longer always equal to the size of the view if the client has specified a minimum allowed layout width. As
3963         such, when