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