ed48028556bf579ebaeec5b7b586311ade7382f5
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-03-16  Chris Dumez  <cdumez@apple.com>
2
3         WebKit.RestoreSessionStateContainingScrollRestorationDefault API test is failing with async policy delegates
4         https://bugs.webkit.org/show_bug.cgi?id=183679
5
6         Reviewed by Alex Christensen.
7
8         Update CachedRawResource::didAddClient() to not send data until we've received
9         the policy decision for the response.
10
11         No new tests, covered by new API test.
12
13         * loader/DocumentLoader.cpp:
14         (WebCore::DocumentLoader::handleSubstituteDataLoadNow):
15         (WebCore::DocumentLoader::responseReceived):
16         * loader/DocumentLoader.h:
17         * loader/DocumentThreadableLoader.cpp:
18         (WebCore::DocumentThreadableLoader::responseReceived):
19         * loader/DocumentThreadableLoader.h:
20         * loader/MediaResourceLoader.cpp:
21         (WebCore::MediaResource::responseReceived):
22         * loader/MediaResourceLoader.h:
23         * loader/appcache/ApplicationCacheResourceLoader.cpp:
24         (WebCore::ApplicationCacheResourceLoader::responseReceived):
25         * loader/appcache/ApplicationCacheResourceLoader.h:
26         * loader/cache/CachedRawResource.cpp:
27         (WebCore::CachedRawResource::didAddClient):
28         (WebCore::CachedRawResource::responseReceived):
29         * loader/cache/CachedRawResourceClient.h:
30         (WebCore::CachedRawResourceClient::responseReceived):
31         * loader/cache/KeepaliveRequestTracker.cpp:
32         (WebCore::KeepaliveRequestTracker::responseReceived):
33         * loader/cache/KeepaliveRequestTracker.h:
34         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
35         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
36         (WebCore::WebCoreAVFResourceLoader::responseReceived):
37
38 2018-03-16  Youenn Fablet  <youenn@apple.com>
39
40         Name Service Worker threads differently from regular Worker threads
41         https://bugs.webkit.org/show_bug.cgi?id=183698
42
43         Reviewed by Chris Dumez.
44
45         No observable change of behavior.
46         For debugging purposes, knowing that a thread is a service worker thread might help give context.
47         It might also identify on a crash log whether the process is a service worker process or a regular web process.
48
49         * workers/WorkerThread.cpp:
50         (WebCore::WorkerThread::start):
51         * workers/WorkerThread.h:
52         (WebCore::WorkerThread::isServiceWorkerThread const):
53         * workers/service/context/ServiceWorkerThread.h:
54
55 2018-03-16  Youenn Fablet  <youenn@apple.com>
56
57         IceCandidates leak on webrtc/datachannel/basic.html and other tests
58         https://bugs.webkit.org/show_bug.cgi?id=183676
59         <rdar://problem/36116228>
60
61         Reviewed by Eric Carlson.
62
63         Covered by manual testing using --leaks option on WK1.
64         WebKit should not release the candidates since libwebrtc is not taking ownership.
65
66         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
67         (WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
68         (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
69
70 2018-03-16  Zan Dobersek  <zdobersek@igalia.com>
71
72         [Nicosia] Add Cairo-specific GraphicsContext operation recorder
73         https://bugs.webkit.org/show_bug.cgi?id=183593
74
75         Reviewed by Carlos Garcia Campos.
76
77         Add Nicosia::CairoOperationRecorder, GraphicsContextImpl implementation
78         that records all GraphicsContext operations for deferred replay on a
79         different thread. Recording here mostly consists of storing all the
80         Cairo resources in a thread-safe manner, which is eased by the atomic
81         reference counting used in Cairo.
82
83         Nicosia::PaintingOperation derivatives are used for operations or state
84         updates that require recording. Instances of these classes are appended
85         to a Vector<> object that is then pushed into a thread pool in
86         Nicosia::PaintingEngineThreaded , replaying all the operations against
87         the Cairo context established from an associated target Nicosia::Buffer.
88
89         This GraphicsContextImpl implementation is now used in the
90         PaintingContextCairo::ForRecording constructor to construct the
91         GraphicsContext implementation that will be used for recording.
92
93         * platform/TextureMapper.cmake:
94         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: Added.
95         (Nicosia::getContext):
96         (Nicosia::OperationData::arg const const):
97         (Nicosia::createCommand):
98         (Nicosia::CairoOperationRecorder::CairoOperationRecorder):
99         (Nicosia::m_commandList):
100         (Nicosia::CairoOperationRecorder::updateState):
101         (Nicosia::CairoOperationRecorder::clearShadow):
102         (Nicosia::CairoOperationRecorder::setLineCap):
103         (Nicosia::CairoOperationRecorder::setLineDash):
104         (Nicosia::CairoOperationRecorder::setLineJoin):
105         (Nicosia::CairoOperationRecorder::setMiterLimit):
106         (Nicosia::CairoOperationRecorder::fillRect):
107         (Nicosia::CairoOperationRecorder::fillRoundedRect):
108         (Nicosia::CairoOperationRecorder::fillRectWithRoundedHole):
109         (Nicosia::CairoOperationRecorder::fillPath):
110         (Nicosia::CairoOperationRecorder::fillEllipse):
111         (Nicosia::CairoOperationRecorder::strokeRect):
112         (Nicosia::CairoOperationRecorder::strokePath):
113         (Nicosia::CairoOperationRecorder::strokeEllipse):
114         (Nicosia::CairoOperationRecorder::clearRect):
115         (Nicosia::CairoOperationRecorder::drawGlyphs):
116         (Nicosia::CairoOperationRecorder::drawImage):
117         (Nicosia::CairoOperationRecorder::drawTiledImage):
118         (Nicosia::CairoOperationRecorder::drawNativeImage):
119         (Nicosia::CairoOperationRecorder::drawPattern):
120         (Nicosia::CairoOperationRecorder::drawRect):
121         (Nicosia::CairoOperationRecorder::drawLine):
122         (Nicosia::CairoOperationRecorder::drawLinesForText):
123         (Nicosia::CairoOperationRecorder::drawLineForDocumentMarker):
124         (Nicosia::CairoOperationRecorder::drawEllipse):
125         (Nicosia::CairoOperationRecorder::drawPath):
126         (Nicosia::CairoOperationRecorder::drawFocusRing):
127         (Nicosia::CairoOperationRecorder::save):
128         (Nicosia::CairoOperationRecorder::restore):
129         (Nicosia::CairoOperationRecorder::translate):
130         (Nicosia::CairoOperationRecorder::rotate):
131         (Nicosia::CairoOperationRecorder::scale):
132         (Nicosia::CairoOperationRecorder::concatCTM):
133         (Nicosia::CairoOperationRecorder::setCTM):
134         (Nicosia::CairoOperationRecorder::getCTM):
135         (Nicosia::CairoOperationRecorder::beginTransparencyLayer):
136         (Nicosia::CairoOperationRecorder::endTransparencyLayer):
137         (Nicosia::CairoOperationRecorder::clip):
138         (Nicosia::CairoOperationRecorder::clipOut):
139         (Nicosia::CairoOperationRecorder::clipPath):
140         (Nicosia::CairoOperationRecorder::clipBounds):
141         (Nicosia::CairoOperationRecorder::applyDeviceScaleFactor):
142         (Nicosia::CairoOperationRecorder::roundToDevicePixels):
143         (Nicosia::CairoOperationRecorder::append):
144         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: Added.
145         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
146         (Nicosia::PaintingContextCairo::ForRecording::ForRecording):
147
148 2018-03-16  Zan Dobersek  <zdobersek@igalia.com>
149
150         [TexMap] Clean up TextureMapperLayer constructor
151         https://bugs.webkit.org/show_bug.cgi?id=183634
152
153         Reviewed by Michael Catanzaro.
154
155         In the TextureMapperLayer header, only declare the constructor, and move
156         all the previous member initialization to the point of declaration of
157         these member variables.
158
159         In the TextureMapperLayer implementation file, the constructor and
160         destructor are moved into proper order at the top of the file. The
161         former is defaulted, and the latter remains unchanged.
162
163         No change in behavior.
164
165         * platform/graphics/texmap/TextureMapperLayer.cpp:
166         (WebCore::TextureMapperLayer::~TextureMapperLayer):
167         * platform/graphics/texmap/TextureMapperLayer.h:
168
169 2018-03-16  Miguel Gomez  <magomez@igalia.com>
170
171         [GTK] When using EGL, request an OpenGL core profile when possible
172         https://bugs.webkit.org/show_bug.cgi?id=178719
173
174         Reviewed by Carlos Garcia Campos.
175
176         When using EGL and OpenGL, try to request a context with version >= 3.2 with a core profile
177         whenever possible. In order to to this, we require EGL version 1.5 or version 1.4 with the
178         extension EGL_KHR_create_context. If EGL requirements are not met, or we cannot get a
179         context with version >= 3.2 then use whatever EGL gives us.
180
181         Covered by existent tests.
182
183         * platform/graphics/egl/GLContextEGL.cpp:
184         (WebCore::GLContextEGL::createWindowContext):
185         (WebCore::GLContextEGL::createPbufferContext):
186         (WebCore::GLContextEGL::createSurfacelessContext):
187         (WebCore::GLContextEGL::createContextForEGLVersion):
188         * platform/graphics/egl/GLContextEGL.h:
189         * platform/graphics/egl/GLContextEGLWPE.cpp:
190         (WebCore::GLContextEGL::createWPEContext):
191         * platform/graphics/egl/GLContextEGLWayland.cpp:
192         (WebCore::GLContextEGL::createWaylandContext):
193         * platform/graphics/egl/GLContextEGLX11.cpp:
194         (WebCore::GLContextEGL::createPixmapContext):
195
196 2018-03-16  Zan Dobersek  <zdobersek@igalia.com>
197
198         [TexMap] Don't use the TextureMapperAnimation::Client interface to apply animation
199         https://bugs.webkit.org/show_bug.cgi?id=183656
200
201         Reviewed by Carlos Garcia Campos.
202
203         Don't have the TextureMapperLayer class inherit from the
204         TextureMapperAnimation::Client interface just for the purposes of
205         synchronization of animation-affected attributes in syncAnimations().
206         For that purpose it's enough to provide a struct that is passed to that
207         method, and with the TextureMapperAnimation class filling out any of the
208         animated attributes that need to be updated.
209
210         TextureMapperAnimation::ApplicationResult struct is introducted for that
211         purpose. std::optional<> members in it are assigned values during the
212         application process, if an appropriate animation affects them. The
213         relevant member values in TextureMapperLayer are then updated, or value
214         from the default state is used.
215
216         TextureMapperAnimation::Client is removed.
217
218         No new tests -- no change in behavior.
219
220         * platform/graphics/texmap/TextureMapperAnimation.cpp:
221         (WebCore::TextureMapperAnimation::apply):
222         (WebCore::TextureMapperAnimation::applyInternal):
223         (WebCore::TextureMapperAnimations::apply):
224         * platform/graphics/texmap/TextureMapperAnimation.h:
225         * platform/graphics/texmap/TextureMapperLayer.cpp:
226         (WebCore::TextureMapperLayer::syncAnimations):
227         (WebCore::TextureMapperLayer::setAnimatedTransform): Deleted.
228         (WebCore::TextureMapperLayer::setAnimatedOpacity): Deleted.
229         (WebCore::TextureMapperLayer::setAnimatedFilters): Deleted.
230         * platform/graphics/texmap/TextureMapperLayer.h:
231
232 2018-03-16  Devin Rousso  <webkit@devinrousso.com>
233
234         Web Inspector: Canvas Tab: main WebGL canvas on acko.net has no reported size
235         https://bugs.webkit.org/show_bug.cgi?id=178798
236         <rdar://problem/35175740>
237
238         Reviewed by Brian Burg.
239
240         When the main frame navigates, the DOMAgent would recieve two InspectorInstrumentation calls,
241         one when the frame begins its navigation and the other when the document for that frame has
242         loaded. Both of these would discard the DOMAgent's bindings, which included the map of
243         `nodeId`s. This was an issue for canvases, as the frontend would be notified whenever any
244         canvas is created, which would usually occur before the `DOMContentLoaded` event is fired.
245         As a result, the canvases would attempt to retrieve their associated node, only to have the
246         DOMAgent discard those bindings quickly thereafter.
247
248         This patch removes DOMAgent's and DOMDebuggerAgent's (parity) instrumentation hooks for the
249         latter event, ensuring that the bindings are only discarded once.
250
251         * inspector/agents/InspectorDOMAgent.h:
252         * inspector/agents/InspectorDOMAgent.cpp:
253         (WebCore::InspectorDOMAgent::mainFrameDOMContentLoaded): Deleted.
254
255         * inspector/agents/InspectorDOMDebuggerAgent.h:
256         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
257         (WebCore::InspectorDOMDebuggerAgent::frameDocumentUpdated): Added.
258         (WebCore::InspectorDOMDebuggerAgent::mainFrameDOMContentLoaded): Deleted.
259
260         * inspector/InspectorInstrumentation.cpp:
261         (WebCore::InspectorInstrumentation::domContentLoadedEventFiredImpl):
262         (WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
263
264 2018-03-15  Tim Horton  <timothy_horton@apple.com>
265
266         Include CADisplayLink explicitly where needed, instead of all of CA
267         https://bugs.webkit.org/show_bug.cgi?id=183689
268         <rdar://problem/38528719>
269
270         Reviewed by Wenson Hsieh.
271
272         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
273
274 2018-03-15  Tim Horton  <timothy_horton@apple.com>
275
276         Include MobileCoreServices in the WebCore prefix header
277         https://bugs.webkit.org/show_bug.cgi?id=183688
278         <rdar://problem/38527621>
279
280         Reviewed by Dan Bernstein.
281
282         * WebCorePrefix.h:
283
284 2018-03-15  Megan Gardner  <megan_gardner@apple.com>
285
286         Create MediaQueryParserContext to provide additional context for the evaluation of media queries
287         https://bugs.webkit.org/show_bug.cgi?id=183677
288
289         Reviewed by Tim Horton.
290
291         We need additional context for parsing media queries to make sure they are parsed correctly and valid.
292
293         Not currently testable, will add tests in a later patch.
294
295         * WebCore.xcodeproj/project.pbxproj:
296         * css/MediaList.cpp:
297         (WebCore::MediaQuerySet::create):
298         (WebCore::MediaQuerySet::set):
299         (WebCore::MediaQuerySet::add):
300         (WebCore::MediaQuerySet::remove):
301         * css/MediaList.h:
302         * css/MediaQueryEvaluator.cpp:
303         (WebCore::MediaQueryEvaluator::mediaAttributeMatches):
304         * css/MediaQueryExpression.cpp:
305         (WebCore::featureWithValidIdent):
306         (WebCore::featureWithValidDensity):
307         (WebCore::featureWithValidPositiveLength):
308         (WebCore::featureWithPositiveInteger):
309         (WebCore::featureWithPositiveNumber):
310         (WebCore::featureWithZeroOrOne):
311         (WebCore::isFeatureValidWithoutValue):
312         (WebCore::MediaQueryExpression::MediaQueryExpression):
313         * css/MediaQueryExpression.h:
314         * css/MediaQueryMatcher.cpp:
315         (WebCore::MediaQueryMatcher::matchMedia):
316         * css/MediaQueryParserContext.cpp: Added.
317         (WebCore::MediaQueryParserContext::MediaQueryParserContext):
318         * css/MediaQueryParserContext.h: Added.
319         (WebCore::MediaQueryParserContext::MediaQueryParserContext):
320         * css/StyleMedia.cpp:
321         (WebCore::StyleMedia::matchMedium const):
322         * css/StyleRuleImport.cpp:
323         (WebCore::StyleRuleImport::StyleRuleImport):
324         (WebCore::StyleRuleImport::setCSSStyleSheet):
325         * css/parser/CSSParser.cpp:
326         (WebCore::CSSParserContext::CSSParserContext):
327         (WebCore::operator==):
328         * css/parser/CSSParserImpl.cpp:
329         (WebCore::CSSParserImpl::consumeImportRule):
330         (WebCore::CSSParserImpl::consumeMediaRule):
331         * css/parser/MediaQueryParser.cpp:
332         (WebCore::MediaQueryParser::parseMediaQuerySet):
333         (WebCore::MediaQueryParser::parseMediaCondition):
334         (WebCore::MediaQueryParser::MediaQueryParser):
335         (WebCore::MediaQueryData::addExpression):
336         * css/parser/MediaQueryParser.h:
337         (WebCore::MediaQueryData::setMediaQueryParserContext):
338         * css/parser/SizesAttributeParser.cpp:
339         (WebCore::SizesAttributeParser::parse):
340         * dom/DOMImplementation.cpp:
341         (WebCore::DOMImplementation::createCSSStyleSheet):
342         * dom/InlineStyleSheetOwner.cpp:
343         (WebCore::InlineStyleSheetOwner::createSheet):
344         * dom/ProcessingInstruction.cpp:
345         (WebCore::ProcessingInstruction::setCSSStyleSheet):
346         * html/HTMLImageElement.cpp:
347         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
348         * html/HTMLLinkElement.cpp:
349         (WebCore::HTMLLinkElement::process):
350         (WebCore::HTMLLinkElement::initializeStyleSheet):
351         (WebCore::HTMLLinkElement::setCSSStyleSheet):
352         * html/HTMLLinkElement.h:
353         * html/HTMLMediaElement.cpp:
354         (WebCore::HTMLMediaElement::selectNextSourceChild):
355         * html/HTMLSourceElement.cpp:
356         (WebCore::HTMLSourceElement::parsedMediaAttribute const):
357         * html/HTMLSourceElement.h:
358         * html/HTMLStyleElement.cpp:
359         (WebCore::HTMLStyleElement::parseAttribute):
360         * html/parser/HTMLPreloadScanner.cpp:
361         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
362
363 2018-03-15  Commit Queue  <commit-queue@webkit.org>
364
365         Unreviewed, rolling out r229639.
366         https://bugs.webkit.org/show_bug.cgi?id=183683
367
368         it is causing a crash in API tests (Requested by youenn on
369         #webkit).
370
371         Reverted changeset:
372
373         "ActiveDOMObject should assert that they are destroyed in the
374         thread they are created"
375         https://bugs.webkit.org/show_bug.cgi?id=183671
376         https://trac.webkit.org/changeset/229639
377
378 2018-03-15  Youenn Fablet  <youenn@apple.com>
379
380         Bad configuration parameters should make RTCPeerConnection constructor throw
381         https://bugs.webkit.org/show_bug.cgi?id=183615
382
383         Reviewed by Eric Carlson.
384
385         Implement more of https://w3c.github.io/webrtc-pc/#set-pc-configuration.
386         Throw an error whenever underlying libwebrtc set configuration fails.
387
388         Covered by rebased test.
389
390         * Modules/mediastream/PeerConnectionBackend.h:
391         * Modules/mediastream/RTCPeerConnection.cpp:
392         (WebCore::iceServersFromConfiguration):
393         (WebCore::RTCPeerConnection::initializeConfiguration):
394         (WebCore::RTCPeerConnection::setConfiguration):
395         * Modules/mediastream/RTCPeerConnection.js:
396         (initializeRTCPeerConnection):
397         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
398
399 2018-03-15  Youenn Fablet  <youenn@apple.com>
400
401         replaceTrack triggers negotiationneeded
402         https://bugs.webkit.org/show_bug.cgi?id=180342
403         <rdar://problem/35822426>
404
405         Reviewed by Eric Carlson.
406
407         Covered by updated test.
408         Fix the case of replacing a track for which data is already flowing.
409         We should probably do the same for null tracks when fully implementing transceivers.
410
411         * Modules/mediastream/RTCPeerConnection.cpp:
412         (WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
413
414 2018-03-15  Keith Rollin  <krollin@apple.com>
415
416         Telemetry for stalled webpage loads
417         https://bugs.webkit.org/show_bug.cgi?id=183221
418         <rdar://problem/36549013>
419
420         Reviewed by Chris Dumez.
421
422         Add telemetry for page loads, tracking the pages that succeed, fail,
423         or are canceled. This information will be used to track the overall
424         health of our page loading as time goes on.
425
426         No new tests -- no new/changed user-level functionality.
427
428         * page/DiagnosticLoggingKeys.cpp:
429         (WebCore::DiagnosticLoggingKeys::telemetryPageLoadKey):
430         (WebCore::DiagnosticLoggingKeys::timedOutKey):
431         (WebCore::DiagnosticLoggingKeys::canceledLessThan2SecondsKey):
432         (WebCore::DiagnosticLoggingKeys::canceledLessThan5SecondsKey):
433         (WebCore::DiagnosticLoggingKeys::canceledLessThan20SecondsKey):
434         (WebCore::DiagnosticLoggingKeys::canceledMoreThan20SecondsKey):
435         (WebCore::DiagnosticLoggingKeys::failedLessThan2SecondsKey):
436         (WebCore::DiagnosticLoggingKeys::failedLessThan5SecondsKey):
437         (WebCore::DiagnosticLoggingKeys::failedLessThan20SecondsKey):
438         (WebCore::DiagnosticLoggingKeys::failedMoreThan20SecondsKey):
439         (WebCore::DiagnosticLoggingKeys::occurredKey):
440         (WebCore::DiagnosticLoggingKeys::succeededLessThan2SecondsKey):
441         (WebCore::DiagnosticLoggingKeys::succeededLessThan5SecondsKey):
442         (WebCore::DiagnosticLoggingKeys::succeededLessThan20SecondsKey):
443         (WebCore::DiagnosticLoggingKeys::succeededMoreThan20SecondsKey):
444         * page/DiagnosticLoggingKeys.h:
445         * platform/network/cf/ResourceError.h:
446         (WebCore::ResourceError::ResourceError):
447         * platform/network/mac/ResourceErrorMac.mm:
448         (WebCore::ResourceError::ResourceError):
449         (WebCore::ResourceError::getNSURLErrorDomain const):
450         (WebCore::ResourceError::getCFErrorDomainCFNetwork const):
451         (WebCore::ResourceError::mapPlatformError):
452
453 2018-03-15  Youenn Fablet  <youenn@apple.com>
454
455         ActiveDOMObject should assert that they are destroyed in the thread they are created
456         https://bugs.webkit.org/show_bug.cgi?id=183671
457
458         Reviewed by Chris Dumez.
459
460         No change of behavior.
461         Moved MessagePort assertion to ActiveDOMObject.
462
463         * dom/ActiveDOMObject.cpp:
464         (WebCore::ActiveDOMObject::~ActiveDOMObject):
465         * dom/ActiveDOMObject.h:
466         * dom/MessagePort.cpp:
467         (WebCore::MessagePort::~MessagePort):
468         * dom/MessagePort.h:
469
470 2018-03-15  Youenn Fablet  <youenn@apple.com>
471
472         MessagePort is not always destroyed on the right thread
473         https://bugs.webkit.org/show_bug.cgi?id=183619
474         <rdar://problem/38204711>
475
476         Reviewed by Chris Dumez.
477
478         Add assertion to ensure MessagePort is destroyed in the right thread.
479         Modify methods taking a ref in a lambda to rely on weak pointers and refing the WorkerThread if in a worker context.
480         It is safe to ref the WorkerThread since it is thread safe ref counted and we are passing the ref to the main thread
481         where the WorkerThread is expected to be destroyed.
482
483         Test: http/tests/workers/worker-messageport-2.html
484
485         * dom/MessagePort.cpp:
486         (WebCore::MessagePort::~MessagePort):
487         (WebCore::MessagePort::dispatchMessages):
488         (WebCore::MessagePort::updateActivity):
489         (WebCore::MessagePort::hasPendingActivity const):
490         * dom/MessagePort.h:
491
492 2018-03-15  Jer Noble  <jer.noble@apple.com>
493
494         Adopt new AVURLAssetUseClientURLLoadingExclusively AVURLAsset creation option.
495         https://bugs.webkit.org/show_bug.cgi?id=183660
496
497         Reviewed by Jon Lee.
498
499         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
500         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
501
502 2018-03-15  Chris Dumez  <cdumez@apple.com>
503
504         Unreviewed, fix tiny mistake in r229615 that caused API tests failures.
505
506         * workers/service/server/SWServer.cpp:
507         (WebCore::SWServer::addRegistrationFromStore):
508
509 2018-03-15  Zan Dobersek  <zdobersek@igalia.com>
510
511         [TexMap] Remove TextureMapperLayer::texture()
512         https://bugs.webkit.org/show_bug.cgi?id=183635
513
514         Reviewed by Michael Catanzaro.
515
516         Remove the unused TextureMapperLayer::texture() method. This enables
517         removing the virtual TextureMapperBackingStore::texture() method, as
518         well as the implementations of it in TextureMapperTiledBackingStore and
519         CoordinatedBackingStore classes.
520
521         No change in behavior.
522
523         * platform/graphics/texmap/TextureMapperBackingStore.h:
524         * platform/graphics/texmap/TextureMapperLayer.h:
525         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
526         (WebCore::TextureMapperTiledBackingStore::texture const): Deleted.
527         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
528
529 2018-03-15  Zan Dobersek  <zdobersek@igalia.com>
530
531         [TexMap] Don't bother caching pattern transform matrix
532         https://bugs.webkit.org/show_bug.cgi?id=183633
533
534         Reviewed by Michael Catanzaro.
535
536         Remove the m_patternTransform and m_patternTransformDirty member
537         variables from the TextureMapperLayer class. These unnecessarily
538         complicate the state update methods that need to compare the given
539         attribute against the current state, and only update it if it has
540         changed.
541
542         Instead, compute the pattern TransformationMatrix value on-the-fly in
543         the paintSelf() method, if at all necessary.
544
545         No change in functionality.
546
547         * platform/graphics/texmap/TextureMapperLayer.cpp:
548         (WebCore::TextureMapperLayer::paintSelf):
549         (WebCore::TextureMapperLayer::setContentsRect):
550         (WebCore::TextureMapperLayer::setContentsTileSize):
551         (WebCore::TextureMapperLayer::setContentsTilePhase):
552         (WebCore::TextureMapperLayer::computePatternTransformIfNeeded): Deleted.
553         * platform/graphics/texmap/TextureMapperLayer.h:
554
555 2018-03-14  John Wilander  <wilander@apple.com>
556
557         Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory()
558         https://bugs.webkit.org/show_bug.cgi?id=183641
559         <rdar://problem/38469497>
560
561         Reviewed by Brent Fulgham and Chris Dumez.
562
563         No new tests. This change is to stabilize existing layout tests.
564         See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620.
565
566         * platform/network/NetworkStorageSession.h:
567         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
568         (WebCore::NetworkStorageSession::removeAllStorageAccess):
569             New function to clear out all storage access entries.
570
571 2018-03-14  Youenn Fablet  <youenn@apple.com>
572
573         imported/w3c/web-platform-tests/WebCryptoAPI/wrapKey_unwrapKey/wrapKey_unwrapKey.worker.html is crashing
574         https://bugs.webkit.org/show_bug.cgi?id=183602
575
576         Reviewed by Chris Dumez.
577
578         Introduce a map of ScriptExecutionContext that is read/write protected using a Lock.
579         This allows introducing postTaskTo taking a ScriptExecutionContext identifier and callable from any thread.
580         Use that method in Crypto instead of refing/unrefing  the context.
581         Lock only happens if context does some postTask activity. This is governed by calling or not the new contextIdentifier() getter.
582
583         Covered by crypto tests no longer failing m_workerGlobalScope->hasOneRef() assertion.
584
585         * crypto/CryptoAlgorithm.cpp:
586         (WebCore::dispatchAlgorithmOperation):
587         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
588         (WebCore::CryptoAlgorithmECDH::deriveBits):
589         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
590         (WebCore::CryptoAlgorithmSHA1::digest):
591         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
592         (WebCore::CryptoAlgorithmSHA224::digest):
593         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
594         (WebCore::CryptoAlgorithmSHA256::digest):
595         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
596         (WebCore::CryptoAlgorithmSHA384::digest):
597         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
598         (WebCore::CryptoAlgorithmSHA512::digest):
599         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
600         (WebCore::CryptoKeyRSA::generatePair):
601         * crypto/mac/CryptoKeyRSAMac.cpp:
602         (WebCore::CryptoKeyRSA::generatePair):
603         * dom/Document.cpp:
604         (WebCore::Document::~Document):
605         * dom/ScriptExecutionContext.cpp:
606         (WebCore::allScriptExecutionContextsMapLock):
607         (WebCore::ScriptExecutionContext::ScriptExecutionContext):
608         (WebCore::ScriptExecutionContext::removeFromContextsMap):
609         (WebCore::ScriptExecutionContext::checkConsistency const):
610         (WebCore::ScriptExecutionContext::postTaskTo):
611         * dom/ScriptExecutionContext.h:
612         (WebCore::ScriptExecutionContext::contextIdentifier const):
613         * workers/WorkerGlobalScope.cpp:
614         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
615
616 2018-03-14  Chris Dumez  <cdumez@apple.com>
617
618         Reduce use of SWServerToContextConnection::globalServerToContextConnection()
619         https://bugs.webkit.org/show_bug.cgi?id=183626
620
621         Reviewed by Youenn Fablet.
622
623         Reduce use of SWServerToContextConnection::globalServerToContextConnection() as we are moving towards
624         having multiple context connections.
625
626         No new tests, no expected behavior change.
627
628         * workers/service/server/SWServer.cpp:
629         (WebCore::SWServer::matchAll):
630         (WebCore::SWServer::serverToContextConnectionCreated):
631         (WebCore::SWServer::runServiceWorkerIfNecessary):
632         (WebCore::SWServer::runServiceWorker):
633         (WebCore::SWServer::terminateWorkerInternal):
634         (WebCore::SWServer::markAllWorkersAsTerminated):
635         (WebCore::SWServer::workerContextTerminated):
636         (WebCore::SWServer::fireInstallEvent):
637         (WebCore::SWServer::fireActivateEvent):
638         * workers/service/server/SWServer.h:
639         * workers/service/server/SWServerToContextConnection.cpp:
640         (WebCore::SWServerToContextConnection::findClientByIdentifier):
641         (WebCore::SWServerToContextConnection::matchAll):
642         (WebCore::SWServerToContextConnection::claim):
643         * workers/service/server/SWServerWorker.cpp:
644         (WebCore::SWServerWorker::contextConnection):
645         (WebCore::SWServerWorker::matchAll):
646         * workers/service/server/SWServerWorker.h:
647
648 2018-03-14  Youenn Fablet  <youenn@apple.com>
649
650         MessagePort should remove its listeners when being closed
651         https://bugs.webkit.org/show_bug.cgi?id=183644
652
653         Reviewed by Chris Dumez.
654
655         Test: http/tests/workers/worker-messageport.html
656
657         * dom/MessagePort.cpp:
658         (WebCore::MessagePort::close):
659         (WebCore::MessagePort::contextDestroyed):
660
661 2018-03-14  Chris Dumez  <cdumez@apple.com>
662
663         Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
664         https://bugs.webkit.org/show_bug.cgi?id=183624
665
666         Reviewed by Youenn Fablet.
667
668         Pass in context connection to SWServer::serverToContextConnectionCreated() to avoid
669         relying on the deprecated globalServerToContextConnection().
670
671         No new tests, no expected behavior change.
672
673         * workers/service/server/SWServer.cpp:
674         (WebCore::SWServer::serverToContextConnectionCreated):
675         * workers/service/server/SWServer.h:
676
677 2018-03-14  Mark Lam  <mark.lam@apple.com>
678
679         Enhance the MacroAssembler and LinkBuffer to support pointer profiling.
680         https://bugs.webkit.org/show_bug.cgi?id=183623
681         <rdar://problem/38443314>
682
683         Reviewed by Michael Saboff.
684
685         No new tests.  Just adding PtrTags required by new MacroAssembler API.
686
687         * cssjit/FunctionCall.h:
688         (WebCore::FunctionCall::prepareAndCall):
689         * cssjit/SelectorCompiler.cpp:
690         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
691
692 2018-03-14  Chris Fleizach  <cfleizach@apple.com>
693
694         AX: Implement accessible dismiss action on iOS
695         https://bugs.webkit.org/show_bug.cgi?id=183352
696         <rdar://problem/38161500>
697
698         Reviewed by Zalan Bujtas.
699
700         Test: accessibility/ios-simulator/AOM-dismiss-event.html
701
702         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
703         (-[WebAccessibilityObjectWrapper accessibilityPerformEscape]):
704
705 2018-03-14  Youenn Fablet  <youenn@apple.com>
706
707         Update libwebrtc up to 36af4e9614f707f733eb2340fae66d6325aaac5b
708         https://bugs.webkit.org/show_bug.cgi?id=183481
709
710         Reviewed by Eric Carlson.
711
712         Covered by existing tests.
713         Updated libwebrtc binding code.
714
715         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
716         (WebCore::fillEncodingParameters):
717         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
718
719 2018-03-14  Tim Horton  <timothy_horton@apple.com>
720
721         Fix the build after r229567
722
723         * Configurations/FeatureDefines.xcconfig:
724
725 2018-03-13  John Wilander  <wilander@apple.com>
726
727         Resource Load Statistics: Immediately forward cookie access for domains with previous user interaction when there's an opener document
728         https://bugs.webkit.org/show_bug.cgi?id=183620
729         <rdar://problem/38431469>
730
731         Reviewed by Brent Fulgham.
732
733         Tests: http/tests/storageAccess/deny-storage-access-under-opener.html
734                http/tests/storageAccess/grant-storage-access-under-opener.html
735
736         It turns out the fix in https://bugs.webkit.org/show_bug.cgi?id=183577
737         wasn't enough to address the compatibility issues with popups. Some of
738         them just detect their unpartitioned cookies, auto-dismiss themselves,
739         and expect their unpartitioned cookies to be available under the opener
740         afterwards. We should grant them access if the popup's domain has had
741         user interaction _previously_.
742
743         Note that we still need https://bugs.webkit.org/show_bug.cgi?id=183577
744         because if the popup's domain has not received user interaction
745         previously, we will not grant it storage access on just the window open.
746
747         * dom/Document.cpp:
748         (WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
749         (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
750         (WebCore::Document::hasGrantedPageSpecificStorageAccess): Deleted.
751         (WebCore::Document::setHasGrantedPageSpecificStorageAccess): Deleted.
752             Renamed from *Granted* to *Requested* since there is now a case
753             where access will not be granted, i.e. when the popup domain has
754             not had user interaction previously.
755         * dom/Document.h:
756         * loader/ResourceLoadObserver.cpp:
757         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
758             Renamed *Grant* to *Request*.
759         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
760         (WebCore::ResourceLoadObserver::logWindowCreation):
761             New function called from DOMWindow::createWindow().
762         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
763             New convenience function.
764         (WebCore::ResourceLoadObserver::setGrantStorageAccessUnderOpenerCallback): Deleted.
765             Renamed *Grant* to *Request*.
766         * loader/ResourceLoadObserver.h:
767         * page/DOMWindow.cpp:
768         (WebCore::DOMWindow::createWindow):
769             Now calls ResourceLoadObserver::logWindowCreation() if a window
770             was created and the opener has a document and a page ID.
771
772 2018-03-13  Chris Dumez  <cdumez@apple.com>
773
774         fast/loader/javascript-url-iframe-remove-on-navigate.html is a flaky crash on iOS with async delegates
775         https://bugs.webkit.org/show_bug.cgi?id=183610
776
777         Reviewed by Youenn Fablet.
778
779         The issue was that in DocumentLoader::loadMainResource(), the call to requestMainResource() which
780         return null due to the load getting cancelled synchronously. If this load is the parent frame's last
781         pending load, then the 'load' event gets fired in the parent frame. In the test, the parent frame's
782         load event handler does a document.write() call which blows away the iframe. As a result, when
783         we return from the requestMainResource(), m_frame is null and we crash later on dereferencing it.
784
785         No new tests, covered by fast/loader/javascript-url-iframe-remove-on-navigate-async-delegate.html
786         which was crashing flakily.
787
788         * loader/DocumentLoader.cpp:
789         (WebCore::DocumentLoader::loadMainResource):
790
791 2018-03-13  Jer Noble  <jer.noble@apple.com>
792
793         [iOS] Muted media playback can interrupt out-of-process audio
794         https://bugs.webkit.org/show_bug.cgi?id=183606
795         <rdar://problem/37466253>
796
797         Reviewed by Eric Carlson.
798
799         Test: Updated TestWebKitAPI test to verify the correct AVAudioSession category is set.
800
801         A non-playing, non-muted media element will cause the AVAudioSession category to be set to
802         "playing" when a muted media element begins playback. Ignore these non-playing elements for
803         the purposes of determining the AVAudioSession category.
804
805         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
806         (PlatformMediaSessionManager::updateSessionState):
807
808 2018-03-13  Youenn Fablet  <youenn@apple.com>
809
810         Calling removeTrack with RTCRtpSender does not set SenderTrack to null
811         https://bugs.webkit.org/show_bug.cgi?id=183308
812
813         Reviewed by Eric Carlson.
814
815         Covered by updated test.
816
817         * Modules/mediastream/RTCRtpSender.cpp:
818         (WebCore::RTCRtpSender::stop): Set track to null when being stopped i.e. removed.
819         * Modules/mediastream/RTCRtpSender.h:
820
821 2018-03-13  Youenn Fablet  <youenn@apple.com>
822
823         Changing link element rel attribute from preload to stylesheet should succeed loading the stylesheet
824         https://bugs.webkit.org/show_bug.cgi?id=183601
825         <rdar://problem/38309441>
826
827         Reviewed by Antti Koivisto.
828
829         Test: http/wpt/preload/change-link-rel-attribute.html
830
831         * loader/LinkPreloadResourceClients.h:
832         (WebCore::LinkPreloadResourceClient::clearResource): Remove the call to CachedResource::cancelLoad.
833         This call is expected to be called by ResourceLoader when cancelling the load from below CachedResource.
834         * loader/cache/CachedResource.cpp:
835         (WebCore::CachedResource::allClientsRemoved): In case of preload,
836         cancel the load if not finished when there is no more client attached to it.
837         * loader/cache/CachedResource.h:
838
839 2018-03-12  John Wilander  <wilander@apple.com>
840
841         Resource Load Statistics: Immediately forward cookie access at user interaction when there's an opener document
842         https://bugs.webkit.org/show_bug.cgi?id=183577
843         <rdar://problem/38266987>
844
845         Reviewed by Brent Fulgham.
846
847         Tested manually on live websites.
848         No new automated tests because of a bug in WebKitTestRunner:
849         https://bugs.webkit.org/show_bug.cgi?id=183578
850         The event sender triggers gestures in the opener rather than
851         in the popup.
852
853         * dom/Document.cpp:
854         (WebCore::Document::removedLastRef):
855             Clears the new m_primaryDomainsGrantedPageSpecificStorageAccess.
856         (WebCore::Document::hasGrantedPageSpecificStorageAccess):
857         (WebCore::Document::setHasGrantedPageSpecificStorageAccess):
858         * dom/Document.h:
859             Added member m_primaryDomainsGrantedPageSpecificStorageAccess
860             where we store domains that have been granted access.
861         * loader/ResourceLoadObserver.cpp:
862         (WebCore::ResourceLoadObserver::setGrantStorageAccessUnderOpenerCallback):
863         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
864             Now checks if there is a cross-origin opener and if so, immediately
865             grants cookie access to the popup's domain if it is partitioned or
866             blocked. 
867         * loader/ResourceLoadObserver.h:
868         * platform/network/NetworkStorageSession.h:
869             Added member m_pagesGrantedStorageAccess.
870         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
871         (WebCore::NetworkStorageSession::cookieStoragePartition const):
872         (WebCore::NetworkStorageSession::hasStorageAccess const):
873             Renamed from hasStorageAccessForFrame since the frameID now is optional.
874         (WebCore::NetworkStorageSession::grantStorageAccess):
875             Renamed from grantStorageAccessForFrame since the frameID now is optional.
876         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
877             Now removes the pageID entry in m_pagesGrantedStorageAccess.
878         (WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Deleted.
879             Renamed since the frameID now is optional.
880         (WebCore::NetworkStorageSession::grantStorageAccessForFrame): Deleted.
881             Renamed since the frameID now is optional.
882
883 2018-03-12  Tim Horton  <timothy_horton@apple.com>
884
885         Stop using SDK conditionals to control feature definitions
886         https://bugs.webkit.org/show_bug.cgi?id=183430
887         <rdar://problem/38251619>
888
889         Reviewed by Dan Bernstein.
890
891         * Configurations/FeatureDefines.xcconfig:
892         * Configurations/WebKitTargetConditionals.xcconfig: Renamed.
893
894 2018-03-12  Chris Dumez  <cdumez@apple.com>
895
896         Return boolean from DOMTokenList's replace() method
897         https://bugs.webkit.org/show_bug.cgi?id=183567
898
899         Reviewed by Youenn Fablet.
900
901         Have DOMTokenList's replace() method return a boolean indicating if the
902         token was replaced, as per:
903         - https://dom.spec.whatwg.org/#dom-domtokenlist-replace
904
905         This is a recent addition to the DOM specification:
906         - https://github.com/whatwg/dom/pull/582
907
908         No new tests, rebaselined existing test.
909
910         * html/DOMTokenList.cpp:
911         (WebCore::replaceInOrderedSet):
912         (WebCore::DOMTokenList::replace):
913         * html/DOMTokenList.h:
914         * html/DOMTokenList.idl:
915
916 2018-03-12  Brian Burg  <bburg@apple.com>
917
918         Ignore some deprecation warnings encountered when compiling with newer versions of ICU
919         https://bugs.webkit.org/show_bug.cgi?id=183584
920         <rdar://problem/38395317>
921
922         Reviewed by Daniel Bates.
923
924         Ignore new deprecation warnings. Where a function has more than one
925         deprecation warning, mark out the entire function so it remains readable.
926
927         * editing/TextIterator.cpp:
928         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
929         (WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
930         * platform/text/TextEncoding.cpp:
931
932 2018-03-12  Yoav Weiss  <yoav@yoav.ws>
933
934         Runtime flag for link prefetch and remove link subresource.
935         https://bugs.webkit.org/show_bug.cgi?id=183540
936
937         Reviewed by Chris Dumez.
938
939         This patch removes the LINK_PREFETCH build time flag, removes
940         link subresource, adds an off-by-default runtime flag for link
941         prefetch and makes sure link prefetch only works when this flag is on.
942
943         Subresource is removed as it's not a part of any spec, nor supported by any
944         other browser. It was replaced by link preload.
945
946         No new tests as this is not adding any new functionality.
947
948         * Configurations/FeatureDefines.xcconfig: Remove the LINK_PREFETCH flag.
949         * html/LinkRelAttribute.cpp:
950         (WebCore::LinkRelAttribute::LinkRelAttribute): Put prefetch support behind the runtime flag.
951         (WebCore::LinkRelAttribute::isSupported): Add prefetch.
952         * html/LinkRelAttribute.h: Remove the LINK_PREFETCH flag.
953         * loader/LinkLoader.cpp:
954         (WebCore::createLinkPreloadResourceClient): Remove the LINK_PREFETCH flag.
955         (WebCore::LinkLoader::prefetchIfNeeded): Move the prefetch code to `prefetchIfNeeded()`. Remove subresource bits.
956         (WebCore::LinkLoader::loadLink): Call `prefetchIfNeeded()`.
957         * loader/LinkLoader.h:
958         * loader/ResourceLoadInfo.cpp:
959         (WebCore::toResourceType): Remove the LINK_PREFETCH flag as well as subresource.
960         * loader/SubresourceLoader.cpp:
961         (WebCore::logResourceLoaded): Remove the LINK_PREFETCH flag as well as subresource.
962         * loader/cache/CachedResource.cpp:
963         (WebCore::CachedResource::defaultPriorityForResourceType): Remove the LINK_PREFETCH flag as well as subresource.
964         (WebCore::CachedResource::load): Remove the LINK_PREFETCH flag.
965         * loader/cache/CachedResource.h:
966         (WebCore::CachedResource::ignoreForRequestCount const): Remove the LINK_PREFETCH flag as well as subresource.
967         * loader/cache/CachedResourceLoader.cpp:
968         (WebCore::createResource): Remove the LINK_PREFETCH flag as well as subresource.
969         (WebCore::CachedResourceLoader::requestLinkResource): Remove subresource.
970         (WebCore::contentTypeFromResourceType): Remove the LINK_PREFETCH flag as well as subresource.
971         (WebCore::CachedResourceLoader::checkInsecureContent const): Remove the LINK_PREFETCH flag as well as subresource.
972         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest): Remove the LINK_PREFETCH flag as well as subresource.
973         * loader/cache/CachedResourceLoader.h:
974         * page/RuntimeEnabledFeatures.h:
975         (WebCore::RuntimeEnabledFeatures::setLinkPrefetchEnabled): Set the prefetch flag.
976         (WebCore::RuntimeEnabledFeatures::linkPrefetchEnabled const): Get the prefetch flag.
977
978 2018-03-12  Youenn Fablet  <youenn@apple.com>
979
980         RTCPeerConnection's close method should update signalingState
981         https://bugs.webkit.org/show_bug.cgi?id=174314
982         <rdar://problem/33267977>
983
984         Reviewed by Eric Carlson.
985
986         Covered by rebased test.
987         Add closed as signalingState enum value.
988         Set peer connection signaling state to closed once close is called.
989
990         * Modules/mediastream/RTCPeerConnection.cpp:
991         (WebCore::RTCPeerConnection::doClose):
992         * Modules/mediastream/RTCSignalingState.idl:
993         * platform/mediastream/RTCSignalingState.h:
994
995 2018-03-12  Mark Lam  <mark.lam@apple.com>
996
997         Make a NativeFunction into a class to support pointer profiling.
998         https://bugs.webkit.org/show_bug.cgi?id=183573
999         <rdar://problem/38384697>
1000
1001         Reviewed by Filip Pizlo.
1002
1003         No new tests because there's no new behavior.  Only updating bindings.
1004
1005         * bindings/scripts/CodeGeneratorJS.pm:
1006         (GenerateHashTableValueArray):
1007         * bindings/scripts/test/JS/JSMapLike.cpp:
1008         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1009         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1010         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1011         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1012         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1013         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1014         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1015         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1016         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1017         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1018         * bindings/scripts/test/JS/JSTestInterface.cpp:
1019         * bindings/scripts/test/JS/JSTestIterable.cpp:
1020         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1021         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1022         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1023         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1024         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1025         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1026         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1027         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1028         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1029         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1030         * bindings/scripts/test/JS/JSTestNode.cpp:
1031         * bindings/scripts/test/JS/JSTestObj.cpp:
1032         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1033         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1034         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1035         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1036         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1037         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1038         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1039         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1040         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1041         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1042         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1043         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1044         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1045
1046 2018-03-12  Tim Horton  <timothy_horton@apple.com>
1047
1048         Use a different SPI header for some AudioToolbox enums
1049         https://bugs.webkit.org/show_bug.cgi?id=183574
1050         <rdar://problem/38385889>
1051
1052         Reviewed by Anders Carlsson.
1053
1054         * platform/audio/ios/AudioDestinationIOS.cpp:
1055         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1056         Adjust SPI imports.
1057
1058 2018-03-12  Danyao Wang  <danyao@chromium.org>
1059
1060         Add a query and fragment exception to history API's unique origin restriction.
1061         https://bugs.webkit.org/show_bug.cgi?id=183028
1062
1063         Reviewed by Brent Fulgham.
1064
1065         Tests: http/tests/navigation/pushstate-at-unique-origin-denied.php
1066                Tools/TestWebKitAPI/Tests/WebCore/URL.cpp
1067
1068         * page/History.cpp:
1069         (WebCore::History::stateObjectAdded):
1070
1071 2018-03-12  Antti Koivisto  <antti@apple.com>
1072
1073         Don't invalidate descendants for nth pseudo classes unless needed
1074         https://bugs.webkit.org/show_bug.cgi?id=183566
1075
1076         Reviewed by Zalan Bujtas.
1077
1078         We currently invalidate the whole subtrees that may match :nth-child and similar. In many common
1079         cases we know that only the direct siblings may be affected.
1080
1081         * css/SelectorChecker.cpp:
1082         (WebCore::localContextForParent):
1083         (WebCore::SelectorChecker::matchRecursively const):
1084
1085             Track if the context matches the subject element if the selector or its siblings only.
1086
1087         (WebCore::SelectorChecker::checkOne const):
1088
1089             Use different bits of descendant and child invalidation cases.
1090
1091         * cssjit/SelectorCompiler.cpp:
1092         (WebCore::SelectorCompiler::fragmentMatchesRightmostOrAdjacentElement):
1093         (WebCore::SelectorCompiler::constructFragmentsInternal):
1094
1095             Track if the context matches the subject element if the selector or its siblings only.
1096
1097         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
1098         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
1099         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
1100
1101             Use different bits of descendant and child invalidation cases.
1102
1103         * dom/Element.cpp:
1104         (WebCore::invalidateForForwardPositionalRules):
1105         (WebCore::invalidateForBackwardPositionalRules):
1106
1107             Invalidate more precisely based on the new bits.
1108
1109         (WebCore::checkForSiblingStyleChanges):
1110         (WebCore::Element::setDescendantsAffectedByForwardPositionalRules):
1111         (WebCore::Element::setDescendantsAffectedByBackwardPositionalRules):
1112         (WebCore::Element::hasFlagsSetDuringStylingOfChildren const):
1113         (WebCore::Element::rareDataDescendantsAffectedByForwardPositionalRules const):
1114         (WebCore::Element::rareDataDescendantsAffectedByBackwardPositionalRules const):
1115
1116             New bits.
1117
1118         * dom/Element.h:
1119         (WebCore::Element::descendantsAffectedByForwardPositionalRules const):
1120         (WebCore::Element::descendantsAffectedByBackwardPositionalRules const):
1121         * dom/ElementRareData.h:
1122         (WebCore::ElementRareData::descendantsAffectedByForwardPositionalRules const):
1123         (WebCore::ElementRareData::setDescendantsAffectedByForwardPositionalRules):
1124         (WebCore::ElementRareData::descendantsAffectedByBackwardPositionalRules const):
1125         (WebCore::ElementRareData::setDescendantsAffectedByBackwardPositionalRules):
1126         (WebCore::ElementRareData::ElementRareData):
1127         (WebCore::ElementRareData::resetStyleRelations):
1128         * style/StyleRelations.cpp:
1129         (WebCore::Style::commitRelationsToRenderStyle):
1130         (WebCore::Style::commitRelations):
1131         * style/StyleRelations.h:
1132
1133 2018-03-12  Javier Fernandez  <jfernandez@igalia.com>
1134
1135         Remove GridLayout runtime flag
1136         https://bugs.webkit.org/show_bug.cgi?id=183484
1137
1138         Reviewed by Myles C. Maxfield.
1139
1140         The Grid Layout feature has been enabled by default for almost a
1141         year, so I think it's time to remove the runtime flag and the
1142         codepath run when the feature is disabled.
1143
1144         No new tests, because there are no changes in functionality.
1145
1146         * css/CSSComputedStyleDeclaration.cpp:
1147         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
1148         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1149         * css/StyleBuilderConverter.h:
1150         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
1151         * css/parser/CSSParser.cpp:
1152         (WebCore::CSSParserContext::CSSParserContext):
1153         (WebCore::operator==):
1154         * css/parser/CSSParserFastPaths.cpp:
1155         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1156         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1157         * css/parser/CSSParserMode.h:
1158         (WebCore::CSSParserContextHash::hash):
1159         * css/parser/CSSPropertyParser.cpp:
1160         (WebCore::CSSPropertyParser::parseSingleValue):
1161         * dom/Document.cpp:
1162         * dom/Document.h:
1163         * page/RuntimeEnabledFeatures.h:
1164         * rendering/RenderFlexibleBox.cpp:
1165         (WebCore::alignmentOffset):
1166         * rendering/style/RenderStyle.cpp:
1167         * rendering/style/RenderStyle.h:
1168         (WebCore::RenderStyle::initialDefaultAlignment):
1169         * testing/InternalSettings.cpp:
1170         (WebCore::InternalSettings::Backup::Backup):
1171         (WebCore::InternalSettings::Backup::restoreTo):
1172         * testing/InternalSettings.h:
1173         * testing/InternalSettings.idl:
1174
1175 2018-03-12  Antoine Quint  <graouts@apple.com>
1176
1177         [Web Animations] Implement CSS Animations and CSS Transitions as Web Animations
1178         https://bugs.webkit.org/show_bug.cgi?id=183504
1179         <rdar://problem/38372965>
1180
1181         Reviewed by Dean Jackson and Jon Lee.
1182
1183         Tests: webanimations/css-animations.html
1184                webanimations/css-transitions.html
1185
1186         This patch implements CSS Animations and CSS Transitions as Web Animations. The main changes are:
1187
1188         * StyleTreeResolver: StyleTreeResolver now has a code path to add CSSAnimation and CSSTransition objects onto the DocumentTimeline
1189         to be picked up by the Web Animations engine. The previous CSSAnimationController code path is preserved if the runtime flag is disabled.
1190
1191         * AnimationTimeline: we add two new methods, updateCSSAnimationsForElement() and updateCSSTransitionsForElement() which are called from
1192         TreeResolver::createAnimatedElementUpdate(). These look at the AnimationList for the old and new RenderStyle objects and create, update
1193         and remove matching CSSAnimation and CSSTransition instances.
1194
1195         * DeclarativeAnimation: a new superclass to both CSSAnimation and CSSTransition which introduces the concept of a backingAnimation(),
1196         which is an Animation held by the RenderStyle objects, and two virtual methods with base implementations, initialize() which is called
1197         upon creating by create() methods in subclasses, and syncPropertiesWithBackingAnimation() which ensures that properties on the
1198         DeclarativeAnimation objects (Web Animations side) match the backing animation (CSS side).
1199
1200         * KeyframeEffectReadOnly: two new important methods to create blending keyframes (KeyframeList) based on backing Animation objects,
1201         computeCSSAnimationBlendingKeyframes() and computeCSSTransitionBlendingKeyframes().
1202
1203         * Sources.txt:
1204         * WebCore.xcodeproj/project.pbxproj:
1205         * animation/AnimationEffectReadOnly.h:
1206         (WebCore::AnimationEffectReadOnly::isKeyframeEffectReadOnly const): We fix this method such that calling it on a KeyframeEffect, which
1207         is a subclass of KeyframeEffectReadOnly, returns true.
1208         * animation/AnimationEffectTimingReadOnly.cpp: In order for DeclarativeAnimation::syncPropertiesWithBackingAnimation() to set the timing
1209         function for a declarative animation's effect, we need a public method to set an effect's timing function outside of just the "easing"
1210         property setter exposed via the JS API. So we introduce a setTimingFunction() method and call it from setEasing().
1211         (WebCore::AnimationEffectTimingReadOnly::setEasing):
1212         (WebCore::AnimationEffectTimingReadOnly::setTimingFunction):
1213         * animation/AnimationEffectTimingReadOnly.h:
1214         * animation/AnimationTimeline.cpp:
1215         (WebCore::AnimationTimeline::~AnimationTimeline): Clear all maps and sets containing WebAnimation references to ensure these get destructed
1216         when the AnimationTimeline is being destructed and should no longer hold a reference to them.
1217         (WebCore::AnimationTimeline::relevantMapForAnimation): We store various subclasses of WebAnimation in dedicated maps so we can composite
1218         animations in the correct order when animating. This function returns the correct map for a given animation such that animationWasAddedToElement()
1219         and animationWasRemovedFromElement() mutate the right map.
1220         (WebCore::AnimationTimeline::animationWasAddedToElement):
1221         (WebCore::AnimationTimeline::animationWasRemovedFromElement):
1222         (WebCore::AnimationTimeline::animationsForElement): Make sure to look for animations in the lists of CSS Animations and CSS Transitions as well
1223         as Web Animations.
1224         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): This method is called by TreeResolver::createAnimatedElementUpdate() during style
1225         resolution. It compares the AnimationList of the previous style and the new style for a given element, checks that animations with a given name
1226         that were not present in the old AnimationList have a new matching CSSAnimation object for them added to the AnimationTimeline, that animations
1227         with a given name that are no longer present in the new AnimationList have their matching CSSAnimation object removed from the AnimationTimeline,
1228         and that animations with a given name that are present in both the old and new AnimationList have their matching CSSAnimation updated to match
1229         the current state of the animation in the AnimationList.
1230         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Similarly to updateCSSAnimationsForElement(), this method is called during style
1231         resolution by TreeResolver::createAnimatedElementUpdate(). Its role is to create or remove CSSTransition objects based on the AnimationList found
1232         in the old and new styles for a given element. It follows a slightly different logic than updateCSSAnimationsForElement() since for CSS Transitions,
1233         there is no need to update CSSTransition objects for a CSS property existing in both the old and new AnimationList, since when a CSS transitions
1234         property is changed, a whole new transition is initiated. However, it's important to check that different Animation objects and styles would actually
1235         result in different timing properties and blending keyframes, so check for this as well before creating new CSSTransition objects.
1236         * animation/AnimationTimeline.h:
1237         (WebCore::AnimationTimeline::animations const): Change the m_animations type from HashSet to ListHashSet to guarantee we preserve the insertion order which is
1238         required by getAnimations().
1239         (WebCore::AnimationTimeline::hasElementAnimations const): Indicates to DocumentTimeline::updateAnimations() that there are animations targeting the provided element.
1240         (WebCore::AnimationTimeline::elementToAnimationsMap):
1241         (WebCore::AnimationTimeline::elementToCSSAnimationsMap):
1242         (WebCore::AnimationTimeline::elementToCSSTransitionsMap):
1243         * animation/CSSAnimation.cpp: CSSAnimation is now a subclass of DeclarativeAnimation and subclasses initialize() and syncPropertiesWithBackingAnimation()
1244         to perform work specific to CSS Animations.
1245         (WebCore::CSSAnimation::create): Set the animationName property based on the provided backing animation.
1246         (WebCore::CSSAnimation::CSSAnimation):
1247         (WebCore::CSSAnimation::initialize): Create the blending keyframes for this CSSAnimation.
1248         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): Reflect the animation-fill-mode, animation-direction, animation-iteration-count and
1249         animation-play-state CSS properties on the AnimationEffectTimingReadOnly object associated with this CSSAnimation.
1250         * animation/CSSAnimation.h:
1251         * animation/CSSTransition.cpp: CSSTransition is now a subclass of DeclarativeAnimation.
1252         (WebCore::CSSTransition::create): Set the transitionProperty property based on the provided backing animation.
1253         (WebCore::CSSTransition::CSSTransition):
1254         (WebCore::CSSTransition::matchesBackingAnimationAndStyles const):
1255         (WebCore::CSSTransition::canBeListed const): Subclass this method such that we also check that we have blending keyframes for a CSSTransition to be
1256         listed by calls to getAnimations().
1257         * animation/CSSTransition.h:
1258         * animation/DeclarativeAnimation.cpp: Added. This new WebAnimation subclass now is the common base class for both CSSAnimation and CSSTransition.
1259         It establishes a relationship with a "backing animation", which is an Animation obtained from a style's AnimationList while resolving styles.
1260         These backing animations contain all of the parsed CSS styles related to CSS Animations and CSS Transitions and we use those to set matching properties
1261         of the Web Animations timing model in the new syncPropertiesWithBackingAnimation() virtual method, which subclasses can override to perform further
1262         work that is specific to a given declarative animation type. The initialize() method is called during create() methods to perform common animation
1263         setup work. Note that while both initialize() and syncPropertiesWithBackingAnimation() are called, we suspend invalidation to that animation's effect
1264         since these methods are meant to be called during style invalidation and we would hit an assertion if we followed the usual route of calling
1265         updateStyleIfNeeded() on the target's document during invalidation.
1266         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
1267         (WebCore::DeclarativeAnimation::setBackingAnimation):
1268         (WebCore::DeclarativeAnimation::initialize): Create a KeyframeEffectReadOnly for this animation and set the provided element as its target, set that
1269         element's document's timeline and play the animation if the backing animation's play state is playing.
1270         (WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): Reflect the {animation|transition}-delay, {animation|transition}-duration and
1271         {animation|transition}-timing-function properties as set on the backing animation.
1272         * animation/DeclarativeAnimation.h: Added.
1273         (WebCore::DeclarativeAnimation::backingAnimation const):
1274         * animation/DocumentTimeline.cpp:
1275         (WebCore::DocumentTimeline::updateAnimations): Trigger style invalidation for elements targeted not just by WebAnimation instances, but also by any
1276         of the DeclarativeAnimation subclasses. We also remove the call to updateFinishedState() which should have been removed when we implemented correct
1277         support for asynchronous WebAnimation operations.
1278         (WebCore::DocumentTimeline::animatedStyleForRenderer): Declarative animations are backed by KeyframeEffectReadOnly effects, so make sure we check
1279         for KeyframeEffectReadOnly or one of its subclasses and not just KeyframeEffect since there now are animation types that use the ReadOnly variant.
1280         (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated): Same as for animatedStyleForRenderer, check for KeyframeEffectReadOnly
1281         and not simply KeyframeEffect.
1282         * animation/KeyframeEffectReadOnly.cpp:
1283         (WebCore::invalidateElement): Stop forcing a style resolution as we invalidate element, marking them as dirty is sufficient. Calls to getAnimations()
1284         already force a style resolution as needed.
1285         (WebCore::KeyframeEffectReadOnly::create): Add a new create() method that only provides a target and which is used by DeclarativeAnimation::initialize().
1286         (WebCore::KeyframeEffectReadOnly::getKeyframes): The previous implementation of getKeyframes() used the ParsedKeyframe list held as m_parsedKeyframes
1287         to compute keyframes. In the case of declarative animations, there are no ParsedKeyframe since the JS API was not involved, so we use the blending keyframes
1288         to look for keyframe data.
1289         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): Called by CSSAnimation::initialize(), this function creates blending keyframes by
1290         looking up the keyframes date obtained from the @keyframes rule with this backing animation's name.
1291         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes): Called by CSSTransition::create(), this function creates blending keyframes by
1292         creating a 0-offset keyframe with the old style and a 1-offset keyframe with the new style as provided during TreeResolver::createAnimatedElementUpdate().
1293         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Called by AnimationTimeline::updateCSSTransitionsForElement()
1294         to check that a provided backing Animation and a pair of old and new RenderStyles that may be different objects actually would yield different timing
1295         properties and keyframe CSS values for a given CSS transition to avoid the deletion and creation of CSSTransition objects.
1296         (WebCore::KeyframeEffectReadOnly::shouldRunAccelerated): We mistakenly assumed we always had blending keyframes, which is not always the case with a
1297         CSSTransition where the transition style itself might be set first, but the target value after. So we should only run accelerated provided there are blending
1298         keyframes at least, the function already returning false if it finds a blending keyframe animating a non-accelerated CSS property.
1299         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): Check that there actually is a matching ParsedKeyframe to read the timing function from.
1300         * animation/KeyframeEffectReadOnly.h:
1301         (WebCore::KeyframeEffectReadOnly::hasBlendingKeyframes const):
1302         * animation/WebAnimation.cpp:
1303         (WebCore::WebAnimation::~WebAnimation): We used to do something very wrong when a WebAnimation was destroyed which uncovered crashes when dealing with
1304         declarative animations. In AnimationTimeline's updateCSSAnimationsForElement() and updateCSSTransitionsForElement(), when we identify that a DeclarativeAnimation
1305         no longer matches an Animation from the current style's AnimationList, we set that DeclarativeAnimation's effect to null and call removeAnimation() on
1306         the timeline. This removes all references from AnimationTimeline to this DeclarativeAnimation and leads to ~WebAnimation being called. Calling removeAnimation()
1307         again in the destructor means that we'd hit ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun) in ref(). It was also meaningless to perform this work in
1308         the WebAnimation destructor since an animation could never be destroyed if it were still registered on a timeline.
1309         (WebCore::WebAnimation::suspendEffectInvalidation): DeclarativeAnimation instances have their timing model properties set during style invalidation, so we need
1310         a mechanism to allow the usual effect invalidation to be suspended in this case. We now maintain a simple m_suspendCount count that increases and decreases with
1311         calls to this method and unsuspendEffectInvalidation() and a isEffectInvalidationSuspended() method returning true whenever that count is positive.
1312         (WebCore::WebAnimation::unsuspendEffectInvalidation):
1313         (WebCore::WebAnimation::timingModelDidChange): Check that effect invalidation is not suspended before proceeding with invalidating the effect.
1314         (WebCore::WebAnimation::setEffect): Check for KeyframeEffectReadOnly and not just KeyframeEffect since declarative animations have ReadOnly effects.
1315         (WebCore::WebAnimation::setTimeline): Check for KeyframeEffectReadOnly and not just KeyframeEffect since declarative animations have ReadOnly effects.
1316         (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Ensure that the WebAnimation's lifecycle is extended at least to the completion of the scheduled microtask.
1317         This would otherwise cause crashes after declarative animations were destroyed when they were no longer applied.
1318         (WebCore::WebAnimation::runPendingPlayTask): Only fulfill the "ready" promise if it hasn't already been, which might have been the case if multiple calls to play()
1319         are made as a result of updating the animation play state in CSSAnimation::syncPropertiesWithBackingAnimation().
1320         (WebCore::WebAnimation::runPendingPauseTask): Same as above but with multiple pause() calls.
1321         (WebCore::WebAnimation::startOrStopAccelerated): Check for KeyframeEffectReadOnly and not just KeyframeEffect since declarative animations have ReadOnly effects.
1322         (WebCore::WebAnimation::canBeListed const): This new method is called by {Document|Element}::getAnimations() to check that an animation is in the correct state to
1323         be listed. The Web Animations spec explains that only animations "that have an associated target effect which is current or in effect" can be listed. We implement
1324         this behavior as specified.
1325         * animation/WebAnimation.h:
1326         (WebCore::WebAnimation::isDeclarativeAnimation const):
1327         (WebCore::WebAnimation::isEffectInvalidationSuspended):
1328         * dom/Document.cpp:
1329         (WebCore::Document::getAnimations): Ensure that the document's pending styles are resolved before returning animations to ensure that any pending declarative
1330         animations are created. Additionally, we ensure that we only list qualifying animations that have effects targeting elements that are children of thi document.
1331         * dom/Element.cpp:
1332         (WebCore::Element::getAnimations): Same as Document::getAnimations().
1333         * style/StyleTreeResolver.cpp:
1334         (WebCore::Style::TreeResolver::createAnimatedElementUpdate): When resolving styles, call into the AnimationTimeline if the runtime flag to enable CSS Animations and
1335         CSS Transitions as Web Animations is on. Otherwise, use CSSAnimationController.
1336
1337 2018-03-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1338
1339         [GTK] Crash in WebCore::PlatformDisplayWayland::~PlatformDisplayWayland
1340         https://bugs.webkit.org/show_bug.cgi?id=176490
1341
1342         Reviewed by Žan Doberšek.
1343
1344         Destroy the wl_display with wl_display_disconnect() (client process API), not
1345         wl_display_destroy() (server process API). It has to be destroyed last, so explicitly
1346         destroy the wl_registry and wl_compositor first.
1347
1348         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1349         (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
1350
1351 2018-03-10  Megan Gardner  <megan_gardner@apple.com>
1352
1353         Media query for default appearance
1354         https://bugs.webkit.org/show_bug.cgi?id=183539
1355         <rdar://problem/38326388>
1356
1357         Reviewed by Tim Horton.
1358
1359         Not currently testable, will add tests in a later patch.
1360
1361         Write a media query to evaluate appearance.
1362
1363         * css/CSSValueKeywords.in:
1364         * css/MediaFeatureNames.h:
1365         * css/MediaQueryEvaluator.cpp:
1366         (WebCore::defaultAppearanceEvaluate):
1367         * css/MediaQueryExpression.cpp:
1368         (WebCore::featureWithValidIdent):
1369         (WebCore::isFeatureValidWithoutValue):
1370         * page/Page.h:
1371         (WebCore::Page::defaultAppearance const):
1372         (WebCore::Page::setDefaultAppearance):
1373
1374 2018-03-10  Daniel Bates  <dabates@apple.com>
1375
1376         InlineTextBox should own shadow data
1377         https://bugs.webkit.org/show_bug.cgi?id=183359
1378         <rdar://problem/38171343>
1379
1380         Reviewed by Darin Adler.
1381
1382         Following r229147 we recompute the selection style, including any shadow data, whenever we
1383         paint the inline text box. Therefore, InlineTextBox needs to take ownership of the shadow
1384         data or it may be deallocated before it can be used.
1385
1386         Covered by existing tests.
1387
1388         * rendering/InlineTextBox.cpp: Changed data type of InlineTextBox::MarkedTextStyle::textShadow
1389         from const ShadowData* to std::optional<ShadowData>. Also removed explicitly deleted equality
1390         and inequality operators as they are unnecessary. Layout tests should catch if these are ever
1391         implemented and used when painting because the painted results will be wrong.
1392         (WebCore::InlineTextBox::computeStyleForUnmarkedMarkedText const): Clone ShadowData.
1393         (WebCore::InlineTextBox::resolveStyleForMarkedText): Simplified logic.
1394         (WebCore::InlineTextBox::paintMarkedTextForeground): Modified code now that MarkedTextStyle
1395         holds a std::optional<ShadowData>.
1396         (WebCore::InlineTextBox::paintMarkedTextDecoration): Ditto.
1397         * rendering/TextPaintStyle.cpp:
1398         (WebCore::computeTextSelectionPaintStyle): Changed the out parameter type from const ShadowData*
1399         to std::optional<ShadowData>& and modified code as needed.
1400         * rendering/TextPaintStyle.h:
1401         * rendering/style/ShadowData.cpp: Removed unncessary #include of header LayoutRect.h.
1402         This header will be included via ShadowData.h.
1403         (WebCore::ShadowData::clone): Convenience method that returns an std::optional to a
1404         cloned ShadowData object.
1405         * rendering/style/ShadowData.h:
1406
1407 2018-03-09  Zalan Bujtas  <zalan@apple.com>
1408
1409         Turn off offset*/scroll* optimization for input elements with shadow content
1410         https://bugs.webkit.org/show_bug.cgi?id=182383
1411         <rdar://problem/37114190>
1412
1413         Reviewed by Antti Koivisto.
1414
1415         We normally ensure clean tree before calling offsetHeight/Width, scrollHeight/Width.
1416         In certain cases (see updateLayoutIfDimensionsOutOfDate() for details), it's okay to return
1417         the previously computed values even when some part of the tree is dirty.
1418         In case of shadow content, updateLayoutIfDimensionsOutOfDate() might return false (no need to layout)
1419         for the root, while true (needs layout) for the shadow content.
1420         This could confuse the caller (Element::scrollWidth/Height etc) and lead to incorrect result.
1421
1422         Test: fast/forms/scrollheight-with-mutation-crash.html
1423
1424         * dom/Document.cpp:
1425         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1426
1427 2018-03-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1428
1429         [macOS] Copying a table from the Numbers app and pasting into iCloud Numbers fails
1430         https://bugs.webkit.org/show_bug.cgi?id=183485
1431         <rdar://problem/38041984>
1432
1433         Reviewed by Ryosuke Niwa.
1434
1435         After r222656, WebKit now treats raw image data on the pasteboard as files for the purposes of computing
1436         DataTransfer.files and DataTransfer.types. However, this is combined with existing policies that suppress
1437         DataTransfer.getData and DataTransfer.setData when the pasteboard contains files (generalized to copy/paste in
1438         r222688). This means we now don't allow web pages to access "text/plain" in the case where the user copies part
1439         of a table from the native Numbers app since Numbers additionally writes a snapshot of the table to the platform
1440         pasteboard.
1441
1442         This restriction on getData/setData was intended to prevent web pages from extracting users' file paths when
1443         pasting or dropping, so it doesn't make sense to enforce this restriction even when there is only in-memory
1444         image data on the pasteboard. To fix this bug, we make Pasteboard::fileContentState() differentiate between
1445         cases where there are (real) files on the pasteboard, and cases where we've fallen back to treating image data
1446         as files.
1447
1448         Rebaselined existing LayoutTests to match new behavior.
1449         Also covered by 4 new API tests:
1450             - PasteMixedContent.ImageDataAndPlainText
1451             - PasteMixedContent.ImageDataAndPlainTextAndURL
1452             - PasteMixedContent.ImageDataAndPlainTextAndURLAndHTML
1453             - UIPasteboardTests.DataTransferGetDataWhenPastingImageAndText
1454
1455         * dom/DataTransfer.cpp:
1456         (WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
1457
1458         If custom pasteboard data is enabled, suppress getData and setData if and only if we might actually expose file
1459         paths (see Pasteboard::fileContentState).
1460
1461         (WebCore::DataTransfer::types const):
1462
1463         Only allow "text/html" or "text/uri-list" in the case where there are actual files in the pasteboard. If there's
1464         only image data, add all of the DOM-safe types back into the list of types.
1465
1466         * platform/Pasteboard.h:
1467         * platform/StaticPasteboard.h:
1468
1469         Add an enum type to represent the result of Pasteboard::fileContentState.
1470         -   NoFileOrImageData indicates that there was nothing on the pasteboard that could be considered a file
1471             from the point of view of the page.
1472         -   InMemoryImage indicates that there are no files on the pasteboard, but there is image data that we consider
1473             to be files, exposed via DataTransfer API.
1474         -   MayContainFilePaths indicates that there might be file paths on the pasteboard. This means that the source
1475             has either written file paths to the pasteboard (for example, through NSFilenamesPboardType) or the source
1476             has written image data along with a URL type of some sort that does not match one of the allowed URL schemes
1477             that are safe to expose (currently, these are http-family, data, or blob).
1478
1479         * platform/cocoa/PasteboardCocoa.mm:
1480         (WebCore::Pasteboard::fileContentState):
1481
1482         Refactor to return one of the three enum types described above.
1483
1484         (WebCore::Pasteboard::containsFiles): Deleted.
1485         * platform/gtk/PasteboardGtk.cpp:
1486         (WebCore::Pasteboard::fileContentState):
1487         (WebCore::Pasteboard::containsFiles): Deleted.
1488         * platform/win/PasteboardWin.cpp:
1489         (WebCore::Pasteboard::fileContentState):
1490         (WebCore::Pasteboard::containsFiles): Deleted.
1491         * platform/wpe/PasteboardWPE.cpp:
1492         (WebCore::Pasteboard::fileContentState):
1493         (WebCore::Pasteboard::containsFiles): Deleted.
1494
1495         Adjust for Pasteboard::fileContentState() tweaks.
1496
1497 2018-03-09  Chris Fleizach  <cfleizach@apple.com>
1498
1499         AX: WebKit seems to be running spell checker even on non-editable content text
1500         https://bugs.webkit.org/show_bug.cgi?id=183456
1501         <rdar://problem/38076042>
1502
1503         Reviewed by Joanmarie Diggs.
1504
1505         Test: accessibility/mac/attributed-string/attributed-string-does-not-includes-misspelled-for-non-editable.html
1506
1507         Only apply misspelled attributes if it's for editable text. It's not useful or performant to do this for static text.
1508
1509         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1510         (AXAttributeStringSetSpelling):
1511
1512 2018-03-09  Nan Wang  <n_wang@apple.com>
1513
1514         AX: AOM: More accessibility events support
1515         https://bugs.webkit.org/show_bug.cgi?id=183023
1516         <rdar://problem/37764380>
1517
1518         Reviewed by Chris Fleizach.
1519
1520         The test is crashing when we call updateBackingStore when 
1521         the AXObjectCache object is gone. Added a check to fix that.
1522
1523         Modified the test by using the right format of setTimeout and extended the delay.
1524
1525         * accessibility/AccessibilityObject.cpp:
1526         (WebCore::AccessibilityObject::updateBackingStore):
1527
1528 2018-03-09  Ross Kirsling  <ross.kirsling@sony.com>
1529
1530         Unreviewed. Fix WinCairo build after r229497.
1531
1532         * platform/MIMETypeRegistry.cpp:
1533         (WebCore::MIMETypeRegistry::getNormalizedMIMEType):
1534
1535 2018-03-09  Ross Kirsling  <ross.kirsling@sony.com>
1536
1537         Clean up MIMETypeRegistry::mimeTypeAssociationMap for Curl
1538         https://bugs.webkit.org/show_bug.cgi?id=170529
1539
1540         Reviewed by Alex Christensen.
1541
1542         * platform/MIMETypeRegistry.cpp:
1543         (WebCore::MIMETypeRegistry::getNormalizedMIMEType):
1544         (WebCore::mimeTypeAssociationMap): Deleted.
1545         Create map with makeNeverDestroyed and a loop instead.
1546
1547 2018-03-09  Brian Burg  <bburg@apple.com>
1548
1549         Web Inspector: there should only be one way for async backend commands to send failure
1550         https://bugs.webkit.org/show_bug.cgi?id=183524
1551
1552         Reviewed by Timothy Hatcher.
1553
1554         Remove some useless ErrorString arguments. Fix some bugs where we
1555         may never call the callback in an early exit situation.
1556
1557         Covered by existing Inspector and protocol generator tests.
1558
1559         * inspector/agents/InspectorDatabaseAgent.cpp:
1560         (WebCore::InspectorDatabaseAgent::executeSQL):
1561         * inspector/agents/InspectorDatabaseAgent.h:
1562         * inspector/agents/InspectorIndexedDBAgent.h:
1563         * inspector/agents/InspectorIndexedDBAgent.cpp:
1564         (WebCore::getDocumentAndIDBFactoryFromFrameOrSendFailure):
1565         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
1566         (WebCore::InspectorIndexedDBAgent::requestDatabase):
1567         (WebCore::InspectorIndexedDBAgent::requestData):
1568         (WebCore::InspectorIndexedDBAgent::clearObjectStore):
1569         (WebCore::assertDocument): Deleted.
1570         (WebCore::assertIDBFactory): Deleted.
1571         Modernize this code a little bit to share the document/idbFactory extraction code.
1572
1573         * inspector/agents/InspectorNetworkAgent.cpp:
1574         (WebCore::InspectorNetworkAgent::loadResource):
1575         * inspector/agents/InspectorNetworkAgent.h:
1576
1577 2018-03-09  Youenn Fablet  <youenn@apple.com>
1578
1579         Crash in ServiceWorkerContainer::ready
1580         https://bugs.webkit.org/show_bug.cgi?id=183380
1581
1582         Reviewed by Chris Dumez.
1583
1584         Not using 'this' through lambdas.
1585         Instead rely on the last lambda that is passed a ScriptExecutionContext& to get back 'this' which is a ServiceWorkerContainer.
1586
1587         Should be covered by imported/w3c/web-platform-tests/service-workers/service-worker/register-default-scope.https.html no longer crashing.
1588         Although it should probably be LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html that should crash
1589         since this is the main test using ready.
1590
1591         * workers/service/ServiceWorkerContainer.cpp:
1592         (WebCore::ServiceWorkerContainer::ready):
1593
1594 2018-03-09  Youenn Fablet  <youenn@apple.com>
1595
1596         RealtimeOutgoingAudioSource and RealtimeOutgoingVideoSource should be destroyed on the main thread
1597         https://bugs.webkit.org/show_bug.cgi?id=183483
1598         <rdar://problem/38214152>
1599
1600         Reviewed by Eric Carlson.
1601
1602         When dereferencing from libwebrtc code path, schedule a call to deref on main thread.
1603         WebCore dereferencing is happening in the main thread so this guarantees destruction on the main thread.
1604
1605         Covered by updated mock libwebrtc peer connection backend.
1606         We make mock senders to keep a reference to their source which are RealtimeOutgoingXXSource.
1607         We then make mock peer connection backend to free the mock senders in a background thread.
1608
1609         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1610         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
1611         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
1612         (WebCore::RealtimeOutgoingAudioSource::stop):
1613         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1614         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
1615         (WebCore::RealtimeOutgoingVideoSource::stop):
1616         * platform/mediastream/RealtimeOutgoingVideoSource.h:
1617         * testing/MockLibWebRTCPeerConnection.cpp:
1618         (WebCore::ThreadKeeper::create):
1619         (WebCore::ThreadKeeper::setThread):
1620         (WebCore::MockLibWebRTCPeerConnection::~MockLibWebRTCPeerConnection):
1621         * testing/MockLibWebRTCPeerConnection.h:
1622
1623 2018-03-09  Jer Noble  <jer.noble@apple.com>
1624
1625         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
1626         https://bugs.webkit.org/show_bug.cgi?id=183501
1627
1628         Reviewed by Eric Carlson.
1629
1630         No need for these methods to be PLATFORM(MAC) only.
1631
1632         * platform/cocoa/PlaybackSessionModel.h:
1633         (WebCore::PlaybackSessionModelClient::ensureControlsManager):
1634         * platform/ios/VideoFullscreenInterfaceAVKit.h:
1635         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1636         (VideoFullscreenInterfaceAVKit::isPlayingVideoInEnhancedFullscreen const):
1637         * platform/mac/VideoFullscreenInterfaceMac.h:
1638
1639 2018-03-09  Youenn Fablet  <youenn@apple.com>
1640
1641         ServiceWorker should respect IDB and DOMCache partitioning
1642         https://bugs.webkit.org/show_bug.cgi?id=183496
1643
1644         Reviewed by Brady Eidson.
1645
1646         Test: http/wpt/service-workers/third-party-registration.html
1647
1648         Set the correct top origin of service worker ScriptExecutionContext.
1649
1650         * workers/service/context/ServiceWorkerThread.cpp:
1651         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1652
1653 2018-03-09  Youenn Fablet  <youenn@apple.com>
1654
1655         Cannot change audio input source device
1656         https://bugs.webkit.org/show_bug.cgi?id=175975
1657         <rdar://problem/34073589>
1658
1659         Reviewed by Eric Carlson.
1660
1661         Covered by manually testing https://webrtc.github.io/samples/src/content/devices/input-output/ with a USB web cam.
1662
1663         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1664         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID):
1665         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
1666
1667 2018-03-09  Jer Noble  <jer.noble@apple.com>
1668
1669         Add new CSS env constants for use with fullscreen
1670         https://bugs.webkit.org/show_bug.cgi?id=183498
1671
1672         Reviewed by Dean Jackson.
1673
1674         Tests: fullscreen/fullscreen-auto-hide-delay.html
1675                fullscreen/fullscreen-inset-top.html
1676
1677         * dom/ConstantPropertyMap.cpp:
1678         (WebCore::ConstantPropertyMap::nameForProperty const):
1679         (WebCore::variableDataForPositiveDuration):
1680         (WebCore::ConstantPropertyMap::setFullscreenInsetTop):
1681         (WebCore::ConstantPropertyMap::setFullscreenAutoHideDelay):
1682         * dom/ConstantPropertyMap.h:
1683         * page/Page.cpp:
1684         (WebCore::Page::setFullscreenInsetTop):
1685         (WebCore::Page::setFullscreenAutoHideDelay):
1686         * page/Page.h:
1687         * testing/Internals.cpp:
1688         (WebCore::Internals::resetToConsistentState):
1689         (WebCore::Internals::setFullscreenInsetTop):
1690         (WebCore::Internals::setFullscreenAutoHideDelay):
1691         * testing/Internals.h:
1692         * testing/Internals.idl:
1693
1694 2018-03-09  Zalan Bujtas  <zalan@apple.com>
1695
1696         RenderTreeBuilder::splitAnonymousBoxesAroundChild should take multicolumn spanners into account.
1697         https://bugs.webkit.org/show_bug.cgi?id=183493
1698         <rdar://problem/38030461>
1699
1700         Reviewed by Antti Koivisto.
1701
1702         Multicolumn spanners are taken out of their original position and placed next
1703         to a RenderMultiColumnSet. splitAnonymousBoxesAroundChild needs to know the original parent (in the render tree context).
1704
1705         Test: fast/multicol/adjust-beforeChild-for-spanner-crash.html
1706
1707         * rendering/updating/RenderTreeBuilder.cpp:
1708         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
1709         * rendering/updating/RenderTreeBuilder.h:
1710         * rendering/updating/RenderTreeBuilderBlock.cpp:
1711         (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
1712         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
1713         (WebCore::RenderTreeBuilder::MultiColumn::adjustBeforeChildForMultiColumnSpannerIfNeeded):
1714         * rendering/updating/RenderTreeBuilderMultiColumn.h:
1715         * rendering/updating/RenderTreeBuilderRuby.cpp:
1716         (WebCore::RenderTreeBuilder::Ruby::moveChildrenInternal):
1717         * rendering/updating/RenderTreeBuilderTable.cpp:
1718         (WebCore::RenderTreeBuilder::Table::attach):
1719
1720 2018-03-09  Jer Noble  <jer.noble@apple.com>
1721
1722         Add isPictureInPictureActive messaging across WebKit process boundary
1723         https://bugs.webkit.org/show_bug.cgi?id=183499
1724
1725         Reviewed by Eric Carlson.
1726
1727         * platform/cocoa/PlaybackSessionModel.h:
1728         (WebCore::PlaybackSessionModelClient::pictureInPictureActiveChanged):
1729         * platform/cocoa/PlaybackSessionModelMediaElement.h:
1730         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
1731         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
1732         (WebCore::PlaybackSessionModelMediaElement::isPictureInPictureActive const):
1733         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1734         (VideoFullscreenControllerContext::isPictureInPictureActive const):
1735
1736 2018-03-09  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1737
1738         [Curl] Implement connection limit.
1739         https://bugs.webkit.org/show_bug.cgi?id=183016
1740
1741         Implement both connection limit per host and total
1742         connection limit on curl network layer.
1743
1744         Reviewed by Youenn Fablet.
1745
1746         No new tests because there's no behavior change.
1747
1748         * platform/network/curl/CurlContext.cpp:
1749         (WebCore::EnvironmentVariableReader::sscanTemplate<signed>):
1750         (WebCore::CurlContext::CurlContext):
1751         (WebCore::CurlMultiHandle::setMaxConnects):
1752         (WebCore::CurlMultiHandle::setMaxTotalConnections):
1753         (WebCore::CurlMultiHandle::setMaxHostConnections):
1754         * platform/network/curl/CurlContext.h:
1755         (WebCore::CurlContext::scheduler):
1756         * platform/network/curl/CurlRequest.cpp:
1757         (WebCore::CurlRequest::startWithJobManager):
1758         (WebCore::CurlRequest::cancel):
1759         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
1760         (WebCore::CurlRequest::completeDidReceiveResponse):
1761         (WebCore::CurlRequest::pausedStatusChanged):
1762         * platform/network/curl/CurlRequestScheduler.cpp:
1763         (WebCore::CurlRequestScheduler::CurlRequestScheduler):
1764         (WebCore::CurlRequestScheduler::workerThread):
1765         (WebCore::CurlRequestScheduler::singleton): Deleted.
1766         * platform/network/curl/CurlRequestScheduler.h:
1767
1768 2018-03-09  Jer Noble  <jer.noble@apple.com>
1769
1770         webkitfullscreenchange event not fired at the same time as :-webkit-full-screen pseudo selector changes; causes glitchiness
1771         https://bugs.webkit.org/show_bug.cgi?id=183383
1772
1773         Reviewed by Eric Carlson.
1774
1775         Fire the webkitfullscreenchange event at the same time as the pseudo class selector changes, during the handling
1776         of webkitDidEnterFullScreenForElement. For WebKit2 clients, this is guaranteed to be asynchronous, since the
1777         calling method originates in the UIProcess. For WebKit1 clients (and WKTR and DRT), there's the possibility that
1778         webkitWillEnterFullScreenForElement will be called synchronously from within
1779         Document::requestFullScreenForElement(), so break that synchronousness by starting the
1780         ChromeClient::enterFullScreenForElement(...) process in a async task.
1781
1782         Previously, the firing of the fullscreenchange event was done through a zero-length timer. Use a
1783         GenericTaskQueue instead.
1784
1785         A number of layout tests depend on the behavior that the element will be in fullscreen when the 'playing' event
1786         fires. This was true for DRT (but not WKTR), since its fullscreen implementations were deliberately synchronous, but
1787         won't necessarily be true for all ports. Fix this in a subsequent patch.
1788
1789         * dom/Document.cpp:
1790         (WebCore::Document::requestFullScreenForElement):
1791         (WebCore::Document::webkitExitFullscreen):
1792         (WebCore::Document::webkitWillEnterFullScreenForElement):
1793         (WebCore::Document::webkitDidEnterFullScreenForElement):
1794         (WebCore::Document::webkitDidExitFullScreenForElement):
1795         (WebCore::Document::dispatchFullScreenChangeEvents):
1796         * dom/Document.h:
1797         * html/HTMLMediaElement.cpp:
1798         (WebCore::HTMLMediaElement::setReadyState):
1799         (WebCore::HTMLMediaElement::playInternal):
1800         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
1801         (WebCore::HTMLMediaElement::updatePlayState):
1802         (WebCore::HTMLMediaElement::setPlaying):
1803
1804 2018-03-09  Zan Dobersek  <zdobersek@igalia.com>
1805
1806         [Nicosia] Add threaded PaintingEngine implementation
1807         https://bugs.webkit.org/show_bug.cgi?id=183511
1808
1809         Reviewed by Carlos Garcia Campos.
1810
1811         Add Nicosia::PaintingEngineThreaded, class that internally uses a thread
1812         pool in which painting tasks are executed.
1813
1814         Implementation for now defaults to using GLib's GThreadPool, defaulting
1815         to 4 threads that are exclusive to this pool. These parameters should be
1816         fine-tuned in the future, or even made configurable, but are a solid
1817         basis for testing.
1818
1819         In PaintingEngineThreaded::paint(), PaintingContext implementation is
1820         used to record all the operations, and the gathered Vector is combined
1821         with the Buffer object and dispatched into the thread pool. In the
1822         thread function, the provided buffer and painting operations are run
1823         through the PaintingContext implementation, replaying all the operations
1824         on a painting context that draws into the given buffer.
1825
1826         The recorded operation objects implement the PaintingOperation interface
1827         contain all the data necessary to replay a given operation. They can be
1828         executed against a PaintingOperationReplay object, as is the case during
1829         PaintingContext::replay(), or they can be dumped into a TextStream
1830         object for debugging purposes.
1831
1832         PaintingContext now also provides the record() and replay() static
1833         functions. PaintingContext objects now differ per purpose, which can be
1834         either for painting or for recording. paint() and replay() use a
1835         for-painting PaintingContext, and record() uses a for-recording one.
1836         The for-painting PaintingContext receives a Buffer object, i.e. a memory
1837         area on which it can draw, while the for-recording PaintingContext uses
1838         the passed-in PaintingOperations Vector that should store all the
1839         recorded operations.
1840
1841         The current Cairo implementation of PaintingContext is moved into
1842         PaintingContextCairo::ForPainting. PaintingContextCairo::ForRecording is
1843         added but is currently no-op until a Cairo-specific GraphicsContextImpl
1844         with recording capabilities is added, allowing any call on the
1845         GraphicsContext object used in PaintingContext::record() to be recorded
1846         for later replay. PaintingOperationReplayCairo, inheriting from
1847         PaintingOperationReplay, will be used for replay purposes, providing
1848         only reference to the PlatformContextCairo object that is constructed in
1849         PaintingContextCairo::ForPainting.
1850
1851         The Cairo-specific GraphicsContextImpl implementation will be added in
1852         a separate patch. After that, PaintingEngine::create() will be modified
1853         so that the Nicosia::PaintingEngineThreaded implementation can be used
1854         for testing purposes, probably by setting an environment variable.
1855
1856         * platform/TextureMapper.cmake:
1857         * platform/graphics/nicosia/NicosiaPaintingContext.cpp:
1858         (Nicosia::PaintingContext::createForPainting):
1859         (Nicosia::PaintingContext::createForRecording):
1860         (Nicosia::PaintingContext::create): Deleted.
1861         * platform/graphics/nicosia/NicosiaPaintingContext.h:
1862         (Nicosia::PaintingContext::paint):
1863         (Nicosia::PaintingContext::record):
1864         (Nicosia::PaintingContext::replay):
1865         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp: Added.
1866         (Nicosia::s_threadFunc):
1867         (Nicosia::paintLayer):
1868         (Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
1869         (Nicosia::PaintingEngineThreaded::~PaintingEngineThreaded):
1870         (Nicosia::PaintingEngineThreaded::paint):
1871         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
1872         * platform/graphics/nicosia/NicosiaPaintingOperation.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
1873         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
1874         (Nicosia::PaintingContextCairo::ForPainting::ForPainting):
1875         (Nicosia::PaintingContextCairo::ForPainting::~ForPainting):
1876         (Nicosia::PaintingContextCairo::ForPainting::graphicsContext):
1877         (Nicosia::PaintingContextCairo::ForPainting::replay):
1878         (Nicosia::PaintingContextCairo::ForRecording::ForRecording):
1879         (Nicosia::PaintingContextCairo::ForRecording::graphicsContext):
1880         (Nicosia::PaintingContextCairo::ForRecording::replay):
1881         (Nicosia::PaintingContextCairo::PaintingContextCairo): Deleted.
1882         (Nicosia::PaintingContextCairo::~PaintingContextCairo): Deleted.
1883         (Nicosia::PaintingContextCairo::graphicsContext): Deleted.
1884         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h:
1885         * platform/graphics/nicosia/cairo/NicosiaPaintingOperationReplayCairo.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
1886         (Nicosia::PaintingOperationReplayCairo::PaintingOperationReplayCairo):
1887
1888 2018-03-09  Zan Dobersek  <zdobersek@igalia.com>
1889
1890         Remove some unused cruft in TextureMapperLayer.
1891
1892         The ScrollingClient class is not used anymore since r229318.
1893         findScrollableContentsLayerAt() is similarly unused, but also lacking
1894         an actual definition. ContentsLayerCount enum can also be purged.
1895
1896         Rubber-stamped by Carlos Garcia Campos.
1897
1898         * platform/graphics/texmap/TextureMapperLayer.h:
1899
1900 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
1901
1902         Add basic synchronization capability to Nicosia::Buffer
1903         https://bugs.webkit.org/show_bug.cgi?id=183500
1904
1905         Reviewed by Carlos Garcia Campos.
1906
1907         Have Nicosia::Buffer track a painting state, and allow that state to be
1908         modified and accessed from different threads. The PaintingState enum
1909         value is protected by a Lock object, and can be modified via the
1910         beginPainting() and completePainting() methods. Additionally, the
1911         waitUntilPaintingComplete() method allows the caller to wait until the
1912         painting is complete for the given Nicosia::Buffer object.
1913
1914         This added state doesn't affect a Nicosia::Buffer object internally, and
1915         doesn't have any effect on  existing usages of Nicosia::Buffer (which
1916         are not multi-threaded).
1917
1918         * platform/graphics/nicosia/NicosiaBuffer.cpp:
1919         (Nicosia::Buffer::beginPainting):
1920         (Nicosia::Buffer::completePainting):
1921         (Nicosia::Buffer::waitUntilPaintingComplete):
1922         * platform/graphics/nicosia/NicosiaBuffer.h:
1923
1924 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
1925
1926         Move NicosiaPaintingContextCairo files under Cairo-specific directory
1927         https://bugs.webkit.org/show_bug.cgi?id=183497
1928
1929         Reviewed by Carlos Garcia Campos.
1930
1931         Pack Cairo-specific files in the Nicosia subsystem under cairo/.
1932
1933         * platform/TextureMapper.cmake:
1934         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp: Renamed from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp.
1935         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h: Renamed from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContextCairo.h.
1936
1937 2018-03-08  Nan Wang  <n_wang@apple.com>
1938
1939         AX: AOM: More accessibility events support
1940         https://bugs.webkit.org/show_bug.cgi?id=183023
1941         <rdar://problem/37764380>
1942
1943         Reviewed by Chris Fleizach.
1944
1945         Fixed the crash that we shouldn't dispatch the accessibility events if the
1946         event path is empty.
1947
1948         Also added a check to not dispatch events if the runtime flag is not enabled.
1949
1950         Test: accessibility/mac/AOM-events-webarea-crash.html
1951
1952         * accessibility/AccessibilityObject.cpp:
1953         (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const):
1954         (WebCore::AccessibilityObject::dispatchAccessibilityEvent const):
1955         * accessibility/AccessibilityObject.h:
1956
1957 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
1958
1959         Allow WebViews to disable system appearance
1960         https://bugs.webkit.org/show_bug.cgi?id=183418
1961         <rdar://problem/36975642>
1962
1963         Reviewed by Tim Horton.
1964
1965         Not currently testable, tests will be added in a later patch.
1966
1967         Allow webviews to choose whether or not to follow the default system appearance.
1968
1969         * css/StyleColor.cpp:
1970         (WebCore::StyleColor::colorFromKeyword):
1971         * css/StyleColor.h:
1972         * css/StyleResolver.cpp:
1973         (WebCore::StyleResolver::colorFromPrimitiveValue const):
1974         * css/parser/CSSParser.cpp:
1975         (WebCore::CSSParser::parseSystemColor):
1976         * css/parser/CSSParser.h:
1977         * css/parser/CSSParserMode.h:
1978         * html/canvas/CanvasRenderingContext2D.cpp:
1979         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
1980         * html/canvas/CanvasRenderingContext2DBase.cpp:
1981         (WebCore::CanvasRenderingContext2DBase::setStrokeColor):
1982         (WebCore::CanvasRenderingContext2DBase::setFillColor):
1983         * html/canvas/CanvasStyle.cpp:
1984         (WebCore::parseColor):
1985         (WebCore::parseColorOrCurrentColor):
1986         (WebCore::CanvasStyle::createFromString):
1987         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
1988         * html/canvas/CanvasStyle.h:
1989         * page/Page.h:
1990         (WebCore::Page::useSystemAppearance const):
1991         (WebCore::Page::setUseSystemAppearance):
1992         * platform/Theme.cpp:
1993         (WebCore::Theme::paint):
1994         * platform/Theme.h:
1995         * platform/mac/LocalDefaultSystemAppearance.h:
1996         * platform/mac/LocalDefaultSystemAppearance.mm:
1997         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
1998         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
1999         * platform/mac/ThemeMac.h:
2000         * platform/mac/ThemeMac.mm:
2001         (-[WebCoreThemeView initWithUseSystemAppearance:]):
2002         (WebCore::paintToggleButton):
2003         (WebCore::paintButton):
2004         (WebCore::ThemeMac::ensuredView):
2005         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
2006         (WebCore::ThemeMac::paint):
2007         (-[WebCoreThemeView init]): Deleted.
2008         * rendering/RenderTheme.cpp:
2009         (WebCore::RenderTheme::paint):
2010         (WebCore::RenderTheme::systemColor const):
2011         (WebCore::RenderTheme::focusRingColor):
2012         * rendering/RenderTheme.h:
2013         (WebCore::RenderTheme::platformFocusRingColor const):
2014         * rendering/RenderThemeIOS.mm:
2015         (WebCore::RenderThemeIOS::systemColor const):
2016         * rendering/RenderThemeMac.h:
2017         * rendering/RenderThemeMac.mm:
2018         (WebCore::RenderThemeMac::documentViewFor const):
2019         (WebCore::RenderThemeMac::platformFocusRingColor const):
2020         (WebCore::RenderThemeMac::systemColor const):
2021         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
2022         (WebCore::RenderThemeMac::paintSliderThumb):
2023         * rendering/TextPaintStyle.cpp:
2024         (WebCore::computeTextPaintStyle):
2025
2026 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
2027
2028         Ensure default appearance for selection form control
2029         https://bugs.webkit.org/show_bug.cgi?id=183482
2030         <rdar://problem/38274894>
2031
2032         Reviewed by Tim Horton.
2033   
2034         The appearance for selection form controls was not set to default.
2035
2036         Not currently testable, will add tests in a later patch.
2037
2038         * rendering/RenderThemeMac.mm:
2039         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
2040
2041 2018-03-08  Per Arne Vollan  <pvollan@apple.com>
2042
2043         [Win] Compile error: pal/ExportMacros.h not found.
2044         https://bugs.webkit.org/show_bug.cgi?id=183467
2045
2046         Reviewed by Brent Fulgham.
2047
2048         PAL header files are no longer located under the WebCore folder in forwarding headers. An additional
2049         build step is required to copy the PAL header files to the internal include folder.
2050
2051         No new tests, no change in functionality. 
2052
2053         * PlatformWin.cmake:
2054         * WebCore.vcxproj/WebCore.proj:
2055
2056 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
2057
2058         Ensure system appearance is default for legacy webkit
2059         https://bugs.webkit.org/show_bug.cgi?id=183473
2060         <rdar://problem/38210306>
2061
2062         Reviewed by Tim Horton.
2063
2064         Need to set the appearance on the window for legacy webkit due to differences in drawing.
2065
2066         Not currently testable, will add tests in a later patch.
2067
2068         * platform/mac/ThemeMac.mm:
2069         (WebCore::paintButton):
2070
2071 2018-03-08  Youenn Fablet  <youenn@apple.com>
2072
2073         libwebrtc update broke internal builds
2074         https://bugs.webkit.org/show_bug.cgi?id=183454
2075
2076         Reviewed by Eric Carlson.
2077
2078         No change of behavior.
2079         Fixed header search paths.
2080         Removed deleted file from XCode project as an additional clean-up.
2081
2082         * Configurations/WebCore.xcconfig:
2083         * WebCore.xcodeproj/project.pbxproj:
2084
2085 2018-03-08  Per Arne Vollan  <pvollan@apple.com>
2086
2087         NSAnimation is not working in the WebContent process when WindowServer access is blocked.
2088         https://bugs.webkit.org/show_bug.cgi?id=183291
2089
2090         Reviewed by Dean Jackson.
2091
2092         The animation can be implemented by using an NSTimer instead. Use the existing Bezier timing
2093         function to create a smooth animation.
2094
2095         No new tests. This code is used to fade scrollbars in and out by animating the alpha value.
2096         This scrollbar setting is not the default in macOS, which makes it non trivial to create
2097         layout tests for this.
2098
2099         * platform/mac/ScrollAnimatorMac.mm:
2100         (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
2101         (-[WebScrollbarPartAnimation startAnimation]):
2102         (-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]):
2103         (-[WebScrollbarPartAnimation invalidate]):
2104         (-[WebScrollbarPartAnimation setDuration:]):
2105         (-[WebScrollbarPartAnimation stopAnimation]):
2106         (-[WebScrollbarPartAnimation setCurrentProgress:]): Deleted.
2107
2108 2018-03-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
2109
2110         Templatize SVGAnimatedType
2111         https://bugs.webkit.org/show_bug.cgi?id=183017
2112
2113         Reviewed by Dean Jackson.
2114
2115         This is a work toward https://bugs.webkit.org/show_bug.cgi?id=168586. The
2116         goal to have SVGAnimatedType be type independent. The appropriate method
2117         of this template will be implicitly instantiated based to the type of the
2118         animated attribute(s).
2119
2120         * Sources.txt: Delete SVGAnimatedType.cpp since its function became template
2121         functions or short enough to be inline functions.
2122         * WebCore.xcodeproj/project.pbxproj:
2123         * svg/SVGAnimatedAngle.cpp:
2124         (WebCore::SVGAnimatedAngleAnimator::constructFromString):
2125         (WebCore::SVGAnimatedAngleAnimator::startAnimValAnimation):
2126         (WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
2127         (WebCore::SVGAnimatedAngleAnimator::addAnimatedTypes):
2128         (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
2129         Use the template functions SVGAnimatedType::create<>() and SVGAnimatedType::as<>().
2130
2131         * svg/SVGAnimatedBoolean.cpp:
2132         (WebCore::SVGAnimatedBooleanAnimator::constructFromString):
2133         (WebCore::SVGAnimatedBooleanAnimator::startAnimValAnimation):
2134         (WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
2135         (WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
2136         Ditto.
2137
2138         * svg/SVGAnimatedColor.cpp:
2139         (WebCore::SVGAnimatedColorAnimator::constructFromString):
2140         (WebCore::SVGAnimatedColorAnimator::addAnimatedTypes):
2141         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
2142         Ditto.
2143
2144         * svg/SVGAnimatedEnumeration.cpp:
2145         (WebCore::SVGAnimatedEnumerationAnimator::constructFromString):
2146         (WebCore::SVGAnimatedEnumerationAnimator::startAnimValAnimation):
2147         (WebCore::SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal):
2148         (WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
2149         Ditto.
2150
2151         * svg/SVGAnimatedInteger.cpp:
2152         (WebCore::SVGAnimatedIntegerAnimator::constructFromString):
2153         (WebCore::SVGAnimatedIntegerAnimator::startAnimValAnimation):
2154         (WebCore::SVGAnimatedIntegerAnimator::resetAnimValToBaseVal):
2155         (WebCore::SVGAnimatedIntegerAnimator::addAnimatedTypes):
2156         (WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
2157         Ditto.
2158
2159         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
2160         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString):
2161         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::startAnimValAnimation):
2162         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal):
2163         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::addAnimatedTypes):
2164         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
2165         Ditto.
2166
2167         * svg/SVGAnimatedLength.cpp:
2168         (WebCore::SVGAnimatedLengthAnimator::constructFromString):
2169         (WebCore::SVGAnimatedLengthAnimator::startAnimValAnimation):
2170         (WebCore::SVGAnimatedLengthAnimator::resetAnimValToBaseVal):
2171         (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
2172         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
2173         Ditto.
2174
2175         * svg/SVGAnimatedLengthList.cpp:
2176         (WebCore::SVGAnimatedLengthListAnimator::constructFromString):
2177         (WebCore::SVGAnimatedLengthListAnimator::startAnimValAnimation):
2178         (WebCore::SVGAnimatedLengthListAnimator::resetAnimValToBaseVal):
2179         (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
2180         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
2181         Ditto.
2182
2183         * svg/SVGAnimatedNumber.cpp:
2184         (WebCore::SVGAnimatedNumberAnimator::constructFromString):
2185         (WebCore::SVGAnimatedNumberAnimator::startAnimValAnimation):
2186         (WebCore::SVGAnimatedNumberAnimator::resetAnimValToBaseVal):
2187         (WebCore::SVGAnimatedNumberAnimator::addAnimatedTypes):
2188         (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
2189         Ditto.
2190
2191         * svg/SVGAnimatedNumberList.cpp:
2192         (WebCore::SVGAnimatedNumberListAnimator::constructFromString):
2193         (WebCore::SVGAnimatedNumberListAnimator::startAnimValAnimation):
2194         (WebCore::SVGAnimatedNumberListAnimator::resetAnimValToBaseVal):
2195         (WebCore::SVGAnimatedNumberListAnimator::addAnimatedTypes):
2196         (WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
2197         Ditto.
2198
2199         * svg/SVGAnimatedNumberOptionalNumber.cpp:
2200         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::constructFromString):
2201         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation):
2202         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal):
2203         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::addAnimatedTypes):
2204         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
2205         Ditto.
2206
2207         * svg/SVGAnimatedPath.cpp:
2208         (WebCore::SVGAnimatedPathAnimator::constructFromString):
2209         (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation):
2210         (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
2211         (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes):
2212         (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
2213         Ditto.
2214
2215         * svg/SVGAnimatedPointList.cpp:
2216         (WebCore::SVGAnimatedPointListAnimator::constructFromString):
2217         (WebCore::SVGAnimatedPointListAnimator::startAnimValAnimation):
2218         (WebCore::SVGAnimatedPointListAnimator::resetAnimValToBaseVal):
2219         (WebCore::SVGAnimatedPointListAnimator::addAnimatedTypes):
2220         (WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
2221         Ditto.
2222
2223         * svg/SVGAnimatedPreserveAspectRatio.cpp:
2224         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString):
2225         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation):
2226         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal):
2227         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
2228         Ditto.
2229
2230         * svg/SVGAnimatedRect.cpp:
2231         (WebCore::SVGAnimatedRectAnimator::constructFromString):
2232         (WebCore::SVGAnimatedRectAnimator::startAnimValAnimation):
2233         (WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
2234         (WebCore::SVGAnimatedRectAnimator::addAnimatedTypes):
2235         (WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
2236         Ditto.
2237
2238         * svg/SVGAnimatedString.cpp:
2239         (WebCore::SVGAnimatedStringAnimator::constructFromString):
2240         (WebCore::SVGAnimatedStringAnimator::startAnimValAnimation):
2241         (WebCore::SVGAnimatedStringAnimator::resetAnimValToBaseVal):
2242         (WebCore::SVGAnimatedStringAnimator::calculateAnimatedValue):
2243         Ditto.
2244
2245         * svg/SVGAnimatedTransformList.cpp:
2246         (WebCore::SVGAnimatedTransformListAnimator::constructFromString):
2247         (WebCore::SVGAnimatedTransformListAnimator::startAnimValAnimation):
2248         (WebCore::SVGAnimatedTransformListAnimator::resetAnimValToBaseVal):
2249         (WebCore::SVGAnimatedTransformListAnimator::addAnimatedTypes):
2250         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
2251         (WebCore::SVGAnimatedTransformListAnimator::calculateDistance):
2252         Ditto.
2253
2254         * svg/SVGAnimatedType.cpp: Removed.
2255         * svg/SVGAnimatedType.h:
2256         (WebCore::SVGAnimatedType::create):
2257         (WebCore::SVGAnimatedType::SVGAnimatedType):
2258         (WebCore::SVGAnimatedType::~SVGAnimatedType):
2259         (WebCore::SVGAnimatedType::as const):
2260         (WebCore::SVGAnimatedType::as):
2261         (WebCore::SVGAnimatedType::type const):
2262         (WebCore::SVGAnimatedType::valueAsString const):
2263         (WebCore::SVGAnimatedType::setValueAsString):
2264         (WebCore::SVGAnimatedType::supportsAnimVal):
2265         (WebCore::SVGAnimatedType::angleAndEnumeration const): Deleted.
2266         (WebCore::SVGAnimatedType::boolean const): Deleted.
2267         (WebCore::SVGAnimatedType::color const): Deleted.
2268         (WebCore::SVGAnimatedType::enumeration const): Deleted.
2269         (WebCore::SVGAnimatedType::integer const): Deleted.
2270         (WebCore::SVGAnimatedType::integerOptionalInteger const): Deleted.
2271         (WebCore::SVGAnimatedType::length const): Deleted.
2272         (WebCore::SVGAnimatedType::lengthList const): Deleted.
2273         (WebCore::SVGAnimatedType::number const): Deleted.
2274         (WebCore::SVGAnimatedType::numberList const): Deleted.
2275         (WebCore::SVGAnimatedType::numberOptionalNumber const): Deleted.
2276         (WebCore::SVGAnimatedType::path const): Deleted.
2277         (WebCore::SVGAnimatedType::pointList const): Deleted.
2278         (WebCore::SVGAnimatedType::preserveAspectRatio const): Deleted.
2279         (WebCore::SVGAnimatedType::rect const): Deleted.
2280         (WebCore::SVGAnimatedType::string const): Deleted.
2281         (WebCore::SVGAnimatedType::transformList const): Deleted.
2282         (WebCore::SVGAnimatedType::angleAndEnumeration): Deleted.
2283         (WebCore::SVGAnimatedType::boolean): Deleted.
2284         (WebCore::SVGAnimatedType::color): Deleted.
2285         (WebCore::SVGAnimatedType::enumeration): Deleted.
2286         (WebCore::SVGAnimatedType::integer): Deleted.
2287         (WebCore::SVGAnimatedType::integerOptionalInteger): Deleted.
2288         (WebCore::SVGAnimatedType::length): Deleted.
2289         (WebCore::SVGAnimatedType::lengthList): Deleted.
2290         (WebCore::SVGAnimatedType::number): Deleted.
2291         (WebCore::SVGAnimatedType::numberList): Deleted.
2292         (WebCore::SVGAnimatedType::numberOptionalNumber): Deleted.
2293         (WebCore::SVGAnimatedType::path): Deleted.
2294         (WebCore::SVGAnimatedType::pointList): Deleted.
2295         (WebCore::SVGAnimatedType::preserveAspectRatio): Deleted.
2296         (WebCore::SVGAnimatedType::rect): Deleted.
2297         (WebCore::SVGAnimatedType::string): Deleted.
2298         (WebCore::SVGAnimatedType::transformList): Deleted.
2299         Replace the union by a Variant. Replace all the type specific functions
2300         by the template functions create() and as(). Use WTF::visit to get the
2301         value stored in the variant. Use the SVGPropertyTraits to perform the
2302         required operation.
2303
2304         * svg/SVGAnimatedTypeAnimator.h:
2305         (WebCore::SVGAnimatedTypeAnimator::constructFromBaseValue):
2306         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue):
2307         (WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForType):
2308         (WebCore::SVGAnimatedTypeAnimator::animValDidChangeForType):
2309         (WebCore::SVGAnimatedTypeAnimator::animValWillChangeForType):
2310         (WebCore::SVGAnimatedTypeAnimator::constructFromBaseValues):
2311         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues):
2312         (WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForTypes):
2313         (WebCore::SVGAnimatedTypeAnimator::animValDidChangeForTypes):
2314         (WebCore::SVGAnimatedTypeAnimator::animValWillChangeForTypes):
2315         (WebCore::SVGAnimatedTypeAnimator::executeAction):
2316         Rename the parameters and the local variables to match their types. Use
2317         the SVGAnimatedType template functions create() and as().
2318
2319         * svg/SVGLengthValue.h:
2320         (WebCore::SVGPropertyTraits<SVGLengthValue>::parse): This was moved from
2321         SVGAnimatedType::setValueAsString()
2322         (WebCore::SVGPropertyTraits<SVGLengthValue>::toString): This was moved from
2323         SVGAnimatedType::valueAsString().
2324
2325         * svg/SVGMarkerTypes.h: Add placeholders for parse() and toString() so
2326         SVGAnimatedType::valueAsString() and setValueAsString() can compile for 
2327         all types.
2328
2329         * svg/SVGNumberListValues.h:
2330         (WebCore::SVGPropertyTraits<SVGNumberListValues>::parse):
2331         * svg/SVGPathByteStream.h:
2332         (WebCore::SVGPropertyTraits<SVGPathByteStream>::parse):
2333         (WebCore::SVGPropertyTraits<SVGPathByteStream>::toString):
2334         * svg/SVGPointListValues.h:
2335         (WebCore::SVGPropertyTraits<SVGPointListValues>::parse):
2336         (WebCore::SVGPropertyTraits<SVGPointListValues>::toString):
2337         * svg/SVGPreserveAspectRatioValue.h:
2338         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString):
2339         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::parse):
2340         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::toString):
2341         Ditto.
2342
2343         * svg/SVGTransformListValues.h:
2344         (WebCore::SVGPropertyTraits<SVGTransformListValues>::parse):
2345         Ditto.
2346
2347         * svg/SVGValue.h: Added. SVGValueVariant is the replacement of the union
2348         SVGAnimatedType::DataUnion.
2349
2350         * svg/properties/SVGPropertyInfo.h:
2351         Add a minimum and maximum AnimatedPropertyType so, SVGAnimatedType::type()
2352         can assert that the index of the variant is in the range of this enum.
2353
2354         * svg/properties/SVGPropertyTraits.h:
2355         (WebCore::SVGPropertyTraits<bool>::parse):
2356         (WebCore::SVGPropertyTraits<unsigned>::parse):
2357         (WebCore::SVGPropertyTraits<int>::parse):
2358         Ditto.
2359
2360 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2361
2362         [JSC][WebCore] Extend jsDynamicCast for WebCore types in WebCore and remove jsDynamicDowncast
2363         https://bugs.webkit.org/show_bug.cgi?id=183449
2364
2365         Reviewed by Mark Lam.
2366
2367         This patch removes jsDynamicDowncast. Our JSC::jsDynamicCast can have a way to inject a fast
2368         path that is similar to jsDynamicDowncast. WebCore can leverage this functionality to add
2369         a fast path for WebCore's extended JS object types (JSEvent, JSElement, JSNode, and JSDocument).
2370
2371         No behavior change.
2372
2373         * WebCore.xcodeproj/project.pbxproj:
2374         * bindings/js/CommonVM.cpp:
2375         (WebCore::lexicalFrameFromCommonVM):
2376         * bindings/js/JSDOMConvertBufferSource.h:
2377         (WebCore::toPossiblySharedArrayBufferView):
2378         * bindings/js/JSDOMConvertPromise.h:
2379         (WebCore::Converter<IDLPromise<T>>::convert):
2380         * bindings/js/JSDOMExceptionHandling.cpp:
2381         (WebCore::reportException):
2382         (WebCore::retrieveErrorMessage):
2383         * bindings/js/JSDOMIterator.h:
2384         (WebCore::IteratorTraits>::next):
2385         * bindings/js/JSDOMWindowProxy.cpp:
2386         (WebCore::JSDOMWindowProxy::toWrapped):
2387         * bindings/js/JSDOMWrapperCache.h:
2388         * bindings/js/JSDocumentCustom.h:
2389         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSDocument>::inherits):
2390         (WebCore::jsDocumentCast): Deleted.
2391         * bindings/js/JSDynamicDowncast.h: Removed.
2392         * bindings/js/JSElementCustom.h:
2393         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSElement>::inherits):
2394         (WebCore::jsElementCast): Deleted.
2395         * bindings/js/JSEventCustom.h:
2396         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSEvent>::inherits):
2397         (WebCore::jsEventCast): Deleted.
2398         * bindings/js/JSEventTargetCustom.cpp:
2399         (WebCore::jsEventTargetCast):
2400         * bindings/js/JSNodeCustom.h:
2401         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSNode>::inherits):
2402         (WebCore::jsNodeCast): Deleted.
2403         * bindings/js/JSPluginElementFunctions.cpp:
2404         (WebCore::pluginElementPropertyGetter):
2405         * bindings/js/JSReadableStreamSourceCustom.cpp:
2406         (WebCore::JSReadableStreamSource::start):
2407         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2408         (WebCore::toJSDedicatedWorkerGlobalScope):
2409         (WebCore::toJSWorkerGlobalScope):
2410         (WebCore::toJSServiceWorkerGlobalScope):
2411         * bindings/js/ReadableStream.cpp:
2412         (WebCore::ReadableStream::create):
2413         (WebCore::ReadableStream::isDisturbed):
2414         * bindings/js/ReadableStream.h:
2415         (WebCore::JSReadableStreamWrapperConverter::toWrapped):
2416         * bindings/js/ScriptModuleLoader.cpp:
2417         (WebCore::ScriptModuleLoader::evaluate):
2418         * bindings/js/SerializedScriptValue.cpp:
2419         (WebCore::CloneSerializer::dumpIfTerminal):
2420         (WebCore::CloneSerializer::serialize):
2421         * bindings/js/StructuredClone.cpp:
2422         (WebCore::structuredCloneArrayBufferView):
2423         * bindings/scripts/CodeGeneratorJS.pm:
2424         (GetCastingHelperForThisObject):
2425         (GenerateImplementation):
2426         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2427         (WebCore::jsInterfaceNameConstructor):
2428         (WebCore::setJSInterfaceNameConstructor):
2429         (WebCore::JSInterfaceName::toWrapped):
2430         * bindings/scripts/test/JS/JSMapLike.cpp:
2431         (WebCore::IDLAttribute<JSMapLike>::cast):
2432         (WebCore::IDLOperation<JSMapLike>::cast):
2433         (WebCore::jsMapLikeConstructor):
2434         (WebCore::setJSMapLikeConstructor):
2435         (WebCore::JSMapLike::toWrapped):
2436         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2437         (WebCore::IDLAttribute<JSReadOnlyMapLike>::cast):
2438         (WebCore::IDLOperation<JSReadOnlyMapLike>::cast):
2439         (WebCore::jsReadOnlyMapLikeConstructor):
2440         (WebCore::setJSReadOnlyMapLikeConstructor):
2441         (WebCore::JSReadOnlyMapLike::toWrapped):
2442         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2443         (WebCore::IDLAttribute<JSTestActiveDOMObject>::cast):
2444         (WebCore::IDLOperation<JSTestActiveDOMObject>::cast):
2445         (WebCore::jsTestActiveDOMObjectConstructor):
2446         (WebCore::setJSTestActiveDOMObjectConstructor):
2447         (WebCore::JSTestActiveDOMObject::toWrapped):
2448         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2449         (WebCore::IDLAttribute<JSTestCEReactions>::cast):
2450         (WebCore::IDLOperation<JSTestCEReactions>::cast):
2451         (WebCore::jsTestCEReactionsConstructor):
2452         (WebCore::setJSTestCEReactionsConstructor):
2453         (WebCore::JSTestCEReactions::toWrapped):
2454         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2455         (WebCore::IDLAttribute<JSTestCEReactionsStringifier>::cast):
2456         (WebCore::IDLOperation<JSTestCEReactionsStringifier>::cast):
2457         (WebCore::jsTestCEReactionsStringifierConstructor):
2458         (WebCore::setJSTestCEReactionsStringifierConstructor):
2459         (WebCore::JSTestCEReactionsStringifier::toWrapped):
2460         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2461         (WebCore::IDLAttribute<JSTestCallTracer>::cast):
2462         (WebCore::IDLOperation<JSTestCallTracer>::cast):
2463         (WebCore::jsTestCallTracerConstructor):
2464         (WebCore::setJSTestCallTracerConstructor):
2465         (WebCore::JSTestCallTracer::toWrapped):
2466         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2467         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
2468         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
2469         (WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
2470         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2471         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
2472         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
2473         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
2474         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2475         (WebCore::IDLAttribute<JSTestDOMJIT>::cast):
2476         (WebCore::IDLOperation<JSTestDOMJIT>::cast):
2477         (WebCore::jsTestDOMJITConstructor):
2478         (WebCore::setJSTestDOMJITConstructor):
2479         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2480         (WebCore::IDLAttribute<JSTestEnabledBySetting>::cast):
2481         (WebCore::IDLOperation<JSTestEnabledBySetting>::cast):
2482         (WebCore::jsTestEnabledBySettingConstructor):
2483         (WebCore::setJSTestEnabledBySettingConstructor):
2484         (WebCore::JSTestEnabledBySetting::toWrapped):
2485         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2486         (WebCore::IDLAttribute<JSTestEventConstructor>::cast):
2487         (WebCore::jsTestEventConstructorConstructor):
2488         (WebCore::setJSTestEventConstructorConstructor):
2489         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2490         (WebCore::IDLOperation<JSTestEventTarget>::cast):
2491         (WebCore::jsTestEventTargetConstructor):
2492         (WebCore::setJSTestEventTargetConstructor):
2493         (WebCore::JSTestEventTarget::toWrapped):
2494         * bindings/scripts/test/JS/JSTestException.cpp:
2495         (WebCore::IDLAttribute<JSTestException>::cast):
2496         (WebCore::jsTestExceptionConstructor):
2497         (WebCore::setJSTestExceptionConstructor):
2498         (WebCore::JSTestException::toWrapped):
2499         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2500         (WebCore::IDLAttribute<JSTestGenerateIsReachable>::cast):
2501         (WebCore::jsTestGenerateIsReachableConstructor):
2502         (WebCore::setJSTestGenerateIsReachableConstructor):
2503         (WebCore::JSTestGenerateIsReachable::toWrapped):
2504         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2505         (WebCore::IDLAttribute<JSTestGlobalObject>::cast):
2506         (WebCore::IDLOperation<JSTestGlobalObject>::cast):
2507         (WebCore::jsTestGlobalObjectConstructor):
2508         (WebCore::setJSTestGlobalObjectConstructor):
2509         (WebCore::JSTestGlobalObject::toWrapped):
2510         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2511         (WebCore::jsTestIndexedSetterNoIdentifierConstructor):
2512         (WebCore::setJSTestIndexedSetterNoIdentifierConstructor):
2513         (WebCore::JSTestIndexedSetterNoIdentifier::toWrapped):
2514         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2515         (WebCore::jsTestIndexedSetterThrowingExceptionConstructor):
2516         (WebCore::setJSTestIndexedSetterThrowingExceptionConstructor):
2517         (WebCore::JSTestIndexedSetterThrowingException::toWrapped):
2518         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2519         (WebCore::IDLOperation<JSTestIndexedSetterWithIdentifier>::cast):
2520         (WebCore::jsTestIndexedSetterWithIdentifierConstructor):
2521         (WebCore::setJSTestIndexedSetterWithIdentifierConstructor):
2522         (WebCore::JSTestIndexedSetterWithIdentifier::toWrapped):
2523         * bindings/scripts/test/JS/JSTestInterface.cpp:
2524         (WebCore::IDLAttribute<JSTestInterface>::cast):
2525         (WebCore::IDLOperation<JSTestInterface>::cast):
2526         (WebCore::jsTestInterfaceConstructor):
2527         (WebCore::setJSTestInterfaceConstructor):
2528         (WebCore::JSTestInterface::toWrapped):
2529         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2530         (WebCore::IDLAttribute<JSTestInterfaceLeadingUnderscore>::cast):
2531         (WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
2532         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
2533         (WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
2534         * bindings/scripts/test/JS/JSTestIterable.cpp:
2535         (WebCore::IDLOperation<JSTestIterable>::cast):
2536         (WebCore::jsTestIterableConstructor):
2537         (WebCore::setJSTestIterableConstructor):
2538         (WebCore::JSTestIterable::toWrapped):
2539         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2540         (WebCore::IDLAttribute<JSTestJSBuiltinConstructor>::cast):
2541         (WebCore::IDLOperation<JSTestJSBuiltinConstructor>::cast):
2542         (WebCore::jsTestJSBuiltinConstructorConstructor):
2543         (WebCore::setJSTestJSBuiltinConstructorConstructor):
2544         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2545         (WebCore::IDLOperation<JSTestMediaQueryListListener>::cast):
2546         (WebCore::jsTestMediaQueryListListenerConstructor):
2547         (WebCore::setJSTestMediaQueryListListenerConstructor):
2548         (WebCore::JSTestMediaQueryListListener::toWrapped):
2549         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2550         (WebCore::jsTestNamedAndIndexedSetterNoIdentifierConstructor):
2551         (WebCore::setJSTestNamedAndIndexedSetterNoIdentifierConstructor):
2552         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::toWrapped):
2553         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2554         (WebCore::jsTestNamedAndIndexedSetterThrowingExceptionConstructor):
2555         (WebCore::setJSTestNamedAndIndexedSetterThrowingExceptionConstructor):
2556         (WebCore::JSTestNamedAndIndexedSetterThrowingException::toWrapped):
2557         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2558         (WebCore::IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::cast):
2559         (WebCore::jsTestNamedAndIndexedSetterWithIdentifierConstructor):
2560         (WebCore::setJSTestNamedAndIndexedSetterWithIdentifierConstructor):
2561         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::toWrapped):
2562         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2563         (WebCore::jsTestNamedConstructorConstructor):
2564         (WebCore::setJSTestNamedConstructorConstructor):
2565         (WebCore::JSTestNamedConstructor::toWrapped):
2566         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2567         (WebCore::jsTestNamedDeleterNoIdentifierConstructor):
2568         (WebCore::setJSTestNamedDeleterNoIdentifierConstructor):
2569         (WebCore::JSTestNamedDeleterNoIdentifier::toWrapped):
2570         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2571         (WebCore::jsTestNamedDeleterThrowingExceptionConstructor):
2572         (WebCore::setJSTestNamedDeleterThrowingExceptionConstructor):
2573         (WebCore::JSTestNamedDeleterThrowingException::toWrapped):
2574         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2575         (WebCore::IDLOperation<JSTestNamedDeleterWithIdentifier>::cast):
2576         (WebCore::jsTestNamedDeleterWithIdentifierConstructor):
2577         (WebCore::setJSTestNamedDeleterWithIdentifierConstructor):
2578         (WebCore::JSTestNamedDeleterWithIdentifier::toWrapped):
2579         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2580         (WebCore::jsTestNamedDeleterWithIndexedGetterConstructor):
2581         (WebCore::setJSTestNamedDeleterWithIndexedGetterConstructor):
2582         (WebCore::JSTestNamedDeleterWithIndexedGetter::toWrapped):
2583         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2584         (WebCore::jsTestNamedGetterCallWithConstructor):
2585         (WebCore::setJSTestNamedGetterCallWithConstructor):
2586         (WebCore::JSTestNamedGetterCallWith::toWrapped):
2587         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2588         (WebCore::jsTestNamedGetterNoIdentifierConstructor):
2589         (WebCore::setJSTestNamedGetterNoIdentifierConstructor):
2590         (WebCore::JSTestNamedGetterNoIdentifier::toWrapped):
2591         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2592         (WebCore::IDLOperation<JSTestNamedGetterWithIdentifier>::cast):
2593         (WebCore::jsTestNamedGetterWithIdentifierConstructor):
2594         (WebCore::setJSTestNamedGetterWithIdentifierConstructor):
2595         (WebCore::JSTestNamedGetterWithIdentifier::toWrapped):
2596         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2597         (WebCore::jsTestNamedSetterNoIdentifierConstructor):
2598         (WebCore::setJSTestNamedSetterNoIdentifierConstructor):
2599         (WebCore::JSTestNamedSetterNoIdentifier::toWrapped):
2600         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2601         (WebCore::jsTestNamedSetterThrowingExceptionConstructor):
2602         (WebCore::setJSTestNamedSetterThrowingExceptionConstructor):
2603         (WebCore::JSTestNamedSetterThrowingException::toWrapped):
2604         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2605         (WebCore::IDLOperation<JSTestNamedSetterWithIdentifier>::cast):
2606         (WebCore::jsTestNamedSetterWithIdentifierConstructor):
2607         (WebCore::setJSTestNamedSetterWithIdentifierConstructor):
2608         (WebCore::JSTestNamedSetterWithIdentifier::toWrapped):
2609         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2610         (WebCore::IDLOperation<JSTestNamedSetterWithIndexedGetter>::cast):
2611         (WebCore::jsTestNamedSetterWithIndexedGetterConstructor):
2612         (WebCore::setJSTestNamedSetterWithIndexedGetterConstructor):
2613         (WebCore::JSTestNamedSetterWithIndexedGetter::toWrapped):
2614         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2615         (WebCore::IDLOperation<JSTestNamedSetterWithIndexedGetterAndSetter>::cast):
2616         (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterConstructor):
2617         (WebCore::setJSTestNamedSetterWithIndexedGetterAndSetterConstructor):
2618         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::toWrapped):
2619         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2620         (WebCore::jsTestNamedSetterWithOverrideBuiltinsConstructor):
2621         (WebCore::setJSTestNamedSetterWithOverrideBuiltinsConstructor):
2622         (WebCore::JSTestNamedSetterWithOverrideBuiltins::toWrapped):
2623         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2624         (WebCore::IDLAttribute<JSTestNamedSetterWithUnforgableProperties>::cast):
2625         (WebCore::IDLOperation<JSTestNamedSetterWithUnforgableProperties>::cast):
2626         (WebCore::jsTestNamedSetterWithUnforgablePropertiesConstructor):
2627         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesConstructor):
2628         (WebCore::JSTestNamedSetterWithUnforgableProperties::toWrapped):
2629         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2630         (WebCore::IDLAttribute<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::cast):
2631         (WebCore::IDLOperation<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::cast):
2632         (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
2633         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
2634         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::toWrapped):
2635         * bindings/scripts/test/JS/JSTestNode.cpp:
2636         (WebCore::IDLAttribute<JSTestNode>::cast):
2637         (WebCore::IDLOperation<JSTestNode>::cast):
2638         (WebCore::jsTestNodeConstructor):
2639         (WebCore::setJSTestNodeConstructor):
2640         * bindings/scripts/test/JS/JSTestObj.cpp:
2641         (WebCore::IDLAttribute<JSTestObj>::cast):
2642         (WebCore::IDLOperation<JSTestObj>::cast):
2643         (WebCore::jsTestObjConstructor):
2644         (WebCore::setJSTestObjConstructor):
2645         (WebCore::JSTestObj::toWrapped):
2646         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2647         (WebCore::jsTestOverloadedConstructorsConstructor):
2648         (WebCore::setJSTestOverloadedConstructorsConstructor):
2649         (WebCore::JSTestOverloadedConstructors::toWrapped):
2650         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2651         (WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
2652         (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
2653         (WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped):
2654         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2655         (WebCore::IDLOperation<JSTestOverrideBuiltins>::cast):
2656         (WebCore::jsTestOverrideBuiltinsConstructor):
2657         (WebCore::setJSTestOverrideBuiltinsConstructor):
2658         (WebCore::JSTestOverrideBuiltins::toWrapped):
2659         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2660         (WebCore::jsTestPluginInterfaceConstructor):
2661         (WebCore::setJSTestPluginInterfaceConstructor):
2662         (WebCore::JSTestPluginInterface::toWrapped):
2663         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2664         (WebCore::IDLAttribute<JSTestPromiseRejectionEvent>::cast):
2665         (WebCore::jsTestPromiseRejectionEventConstructor):
2666         (WebCore::setJSTestPromiseRejectionEventConstructor):
2667         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2668         (WebCore::IDLAttribute<JSTestSerialization>::cast):
2669         (WebCore::IDLOperation<JSTestSerialization>::cast):
2670         (WebCore::jsTestSerializationConstructor):
2671         (WebCore::setJSTestSerializationConstructor):
2672         (WebCore::JSTestSerialization::toWrapped):
2673         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2674         (WebCore::jsTestSerializationIndirectInheritanceConstructor):
2675         (WebCore::setJSTestSerializationIndirectInheritanceConstructor):
2676         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2677         (WebCore::IDLAttribute<JSTestSerializationInherit>::cast):
2678         (WebCore::IDLOperation<JSTestSerializationInherit>::cast):
2679         (WebCore::jsTestSerializationInheritConstructor):
2680         (WebCore::setJSTestSerializationInheritConstructor):
2681         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2682         (WebCore::IDLAttribute<JSTestSerializationInheritFinal>::cast):
2683         (WebCore::IDLOperation<JSTestSerializationInheritFinal>::cast):
2684         (WebCore::jsTestSerializationInheritFinalConstructor):
2685         (WebCore::setJSTestSerializationInheritFinalConstructor):
2686         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2687         (WebCore::IDLAttribute<JSTestSerializedScriptValueInterface>::cast):
2688         (WebCore::IDLOperation<JSTestSerializedScriptValueInterface>::cast):
2689         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
2690         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
2691         (WebCore::JSTestSerializedScriptValueInterface::toWrapped):
2692         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2693         (WebCore::IDLOperation<JSTestStringifier>::cast):
2694         (WebCore::jsTestStringifierConstructor):
2695         (WebCore::setJSTestStringifierConstructor):
2696         (WebCore::JSTestStringifier::toWrapped):
2697         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2698         (WebCore::IDLOperation<JSTestStringifierAnonymousOperation>::cast):
2699         (WebCore::jsTestStringifierAnonymousOperationConstructor):
2700         (WebCore::setJSTestStringifierAnonymousOperationConstructor):
2701         (WebCore::JSTestStringifierAnonymousOperation::toWrapped):
2702         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2703         (WebCore::IDLOperation<JSTestStringifierNamedOperation>::cast):
2704         (WebCore::jsTestStringifierNamedOperationConstructor):
2705         (WebCore::setJSTestStringifierNamedOperationConstructor):
2706         (WebCore::JSTestStringifierNamedOperation::toWrapped):
2707         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2708         (WebCore::IDLOperation<JSTestStringifierOperationImplementedAs>::cast):
2709         (WebCore::jsTestStringifierOperationImplementedAsConstructor):
2710         (WebCore::setJSTestStringifierOperationImplementedAsConstructor):
2711         (WebCore::JSTestStringifierOperationImplementedAs::toWrapped):
2712         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2713         (WebCore::IDLOperation<JSTestStringifierOperationNamedToString>::cast):
2714         (WebCore::jsTestStringifierOperationNamedToStringConstructor):
2715         (WebCore::setJSTestStringifierOperationNamedToStringConstructor):
2716         (WebCore::JSTestStringifierOperationNamedToString::toWrapped):
2717         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2718         (WebCore::IDLAttribute<JSTestStringifierReadOnlyAttribute>::cast):
2719         (WebCore::IDLOperation<JSTestStringifierReadOnlyAttribute>::cast):
2720         (WebCore::jsTestStringifierReadOnlyAttributeConstructor):
2721         (WebCore::setJSTestStringifierReadOnlyAttributeConstructor):
2722         (WebCore::JSTestStringifierReadOnlyAttribute::toWrapped):
2723         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2724         (WebCore::IDLAttribute<JSTestStringifierReadWriteAttribute>::cast):
2725         (WebCore::IDLOperation<JSTestStringifierReadWriteAttribute>::cast):
2726         (WebCore::jsTestStringifierReadWriteAttributeConstructor):
2727         (WebCore::setJSTestStringifierReadWriteAttributeConstructor):
2728         (WebCore::JSTestStringifierReadWriteAttribute::toWrapped):
2729         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2730         (WebCore::IDLAttribute<JSTestTypedefs>::cast):
2731         (WebCore::IDLOperation<JSTestTypedefs>::cast):
2732         (WebCore::jsTestTypedefsConstructor):
2733         (WebCore::setJSTestTypedefsConstructor):
2734         (WebCore::JSTestTypedefs::toWrapped):
2735         * bridge/objc/WebScriptObject.mm:
2736         (-[WebScriptObject setValue:forKey:]):
2737         * bridge/runtime_array.cpp:
2738         (JSC::RuntimeArray::lengthGetter):
2739         * bridge/runtime_method.cpp:
2740         (JSC::RuntimeMethod::lengthGetter):
2741         * html/HTMLMediaElement.cpp:
2742         (WebCore::controllerJSValue):
2743         (WebCore::HTMLMediaElement::updateCaptionContainer):
2744         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
2745         * inspector/agents/InspectorDOMAgent.cpp:
2746         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2747
2748 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2749
2750         [JSC] Add inherits<T>(VM&) leveraging JSCast fast path
2751         https://bugs.webkit.org/show_bug.cgi?id=183429
2752
2753         Reviewed by Mark Lam.
2754
2755         * bindings/js/IDBBindingUtilities.cpp:
2756         (WebCore::createIDBKeyFromValue):
2757         * bindings/js/JSDOMConvertDate.cpp:
2758         (WebCore::valueToDate):
2759         * bindings/js/JSDOMGlobalObject.cpp:
2760         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
2761         * bindings/js/JSDOMWindowCustom.cpp:
2762         (WebCore::JSDOMWindow::toWrapped):
2763         * bindings/js/JSEventTargetCustom.cpp:
2764         * bindings/js/JSNodeCustom.cpp:
2765         (WebCore::JSNode::pushEventHandlerScope const):
2766         * bindings/js/JSXPathNSResolverCustom.cpp:
2767         (WebCore::JSXPathNSResolver::toWrapped):
2768         * bindings/js/ScriptState.cpp:
2769         (WebCore::domWindowFromExecState):
2770         (WebCore::scriptExecutionContextFromExecState):
2771         * bindings/js/SerializedScriptValue.cpp:
2772         (WebCore::CloneSerializer::isArray):
2773         (WebCore::CloneSerializer::isMap):
2774         (WebCore::CloneSerializer::isSet):
2775         (WebCore::CloneSerializer::dumpArrayBufferView):
2776         (WebCore::CloneSerializer::dumpDOMPoint):
2777         (WebCore::CloneSerializer::dumpDOMRect):
2778         (WebCore::CloneSerializer::dumpDOMMatrix):
2779         (WebCore::CloneSerializer::dumpIfTerminal):
2780         (WebCore::CloneDeserializer::CloneDeserializer):
2781         (WebCore::CloneDeserializer::readArrayBufferView):
2782         * bindings/scripts/CodeGeneratorJS.pm:
2783         (GenerateOverloadDispatcher):
2784         * bindings/scripts/test/JS/JSTestObj.cpp:
2785         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
2786         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameterOverloadDispatcher):
2787         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnionOverloadDispatcher):
2788         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnionsOverloadDispatcher):
2789         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnionOverloadDispatcher):
2790         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnionOverloadDispatcher):
2791         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameterOverloadDispatcher):
2792         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunctionOverloadDispatcher):
2793         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2794         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
2795         * bridge/c/c_instance.cpp:
2796         (JSC::Bindings::CInstance::invokeMethod):
2797         * bridge/objc/WebScriptObject.mm:
2798         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
2799         * bridge/objc/objc_instance.mm:
2800         (ObjcInstance::invokeMethod):
2801         * bridge/objc/objc_runtime.mm:
2802         (JSC::Bindings::callObjCFallbackObject):
2803         * bridge/runtime_method.cpp:
2804         (JSC::callRuntimeMethod):
2805         * bridge/runtime_object.cpp:
2806         (JSC::Bindings::callRuntimeObject):
2807         (JSC::Bindings::callRuntimeConstructor):
2808         * inspector/WebInjectedScriptHost.cpp:
2809         (WebCore::WebInjectedScriptHost::subtype):
2810         (WebCore::WebInjectedScriptHost::isHTMLAllCollection):
2811
2812 2018-03-08  Tim Horton  <timothy_horton@apple.com>
2813
2814         Stop linking ApplicationServices directly
2815         https://bugs.webkit.org/show_bug.cgi?id=182867
2816         <rdar://problem/38252142>
2817
2818         Reviewed by Alex Christensen.
2819
2820         The frameworks that we use that live inside ApplicationServices
2821         have mostly moved out, so import them directly.
2822
2823         * Configurations/WebCore.xcconfig:
2824         * html/canvas/CanvasRenderingContext2D.cpp:
2825         * html/canvas/CanvasRenderingContext2DBase.cpp:
2826         * platform/MIMETypeRegistry.cpp:
2827         * platform/graphics/ComplexTextController.cpp:
2828         * platform/graphics/cg/ColorCG.cpp:
2829         * platform/graphics/cg/ImageDecoderCG.cpp:
2830         * platform/graphics/cg/UTIRegistry.cpp:
2831         * platform/graphics/cocoa/FontCocoa.mm:
2832         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2833         * platform/graphics/mac/GlyphPageMac.cpp:
2834         * platform/graphics/mac/PDFDocumentImageMac.mm:
2835         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
2836         * platform/graphics/win/FontCGWin.cpp:
2837         * platform/graphics/win/FontCacheWin.cpp:
2838         * platform/graphics/win/FontCustomPlatformData.cpp:
2839         * platform/graphics/win/FontPlatformDataCGWin.cpp:
2840         * platform/graphics/win/ImageCGWin.cpp:
2841         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2842
2843 2018-03-07  Tim Horton  <timothy_horton@apple.com>
2844
2845         Sort and separate FeatureDefines.xcconfig
2846         https://bugs.webkit.org/show_bug.cgi?id=183427
2847
2848         Reviewed by Dan Bernstein.
2849
2850         * Configurations/FeatureDefines.xcconfig:
2851         Sort and split FeatureDefines into paragraphs
2852         (to make it easier to sort later).
2853
2854 2018-03-07  Zalan Bujtas  <zalan@apple.com>
2855
2856         Invalid innerTextRenderer in RenderTextControlSingleLine::styleDidChange()
2857         https://bugs.webkit.org/show_bug.cgi?id=183385
2858         <rdar://problem/38085397>
2859
2860         Reviewed by Antti Koivisto.
2861
2862         When HTMLInputElement::updateType() is called with a dirty value, we eagerly change the m_inputType first
2863         and then we take care of the dirty value by calling setAttributeWithoutSynchronization().
2864         With a DOMSubtreeModified event listener attached, setAttributeWithoutSynchronization() can end up running some
2865         layout code (offsetHeight) with a renderer - m_inputType mismatch.
2866
2867         This patch ensures that we don't change the m_inputType until after we finished setting the new value.
2868
2869         Test: fast/DOM/HTMLInputElement/input-value-and-type-change-crash.html
2870
2871         * html/HTMLInputElement.cpp:
2872         (WebCore::HTMLInputElement::updateType):
2873
2874 2018-03-07  Chris Dumez  <cdumez@apple.com>
2875
2876         Get rid of custom bindings for History's replaceState() / pushState()
2877         https://bugs.webkit.org/show_bug.cgi?id=183372
2878
2879         Reviewed by Youenn Fablet.
2880
2881         Get rid of custom bindings for History's replaceState() / pushState() by
2882         moving the cached state from the wrapper to the History implementation
2883         object.
2884
2885         No new tests, no web-facing behavior change.
2886
2887         * bindings/js/JSHistoryCustom.cpp:
2888         (WebCore::JSHistory::state const):
2889         (WebCore::JSHistory::visitAdditionalChildren):
2890         * page/History.cpp:
2891         (WebCore::History::cachedState):
2892         (WebCore::History::stateObjectAdded):
2893         * page/History.h:
2894         (WebCore::History::pushState):
2895         (WebCore::History::replaceState):
2896         * page/History.idl:
2897
2898 2018-03-07  Youenn Fablet  <youenn@apple.com>
2899
2900         Match unsupported plugins based on domains and not origin
2901         https://bugs.webkit.org/show_bug.cgi?id=183384
2902
2903         Reviewed by Chris Dumez.
2904
2905         Move from an origin-keyed map to a vector of plugins.
2906         We iterate through the vector and a match happens if the page host name ends with the provided matching domain.
2907         This allows supporting rules for *.mydomain.com by passing 'mydomain.com'.
2908         Covered by existing tests.
2909         We are not testing subdomains like www.localhost since there is no support in our CI but this is tested through Unit tests.
2910
2911         * loader/EmptyClients.cpp:
2912         * platform/URL.cpp:
2913         (WebCore::URL::isMatchingDomain const):
2914         * platform/URL.h:
2915         * plugins/PluginData.h:
2916         (WebCore::isSupportedPlugin):
2917         (WebCore::SupportedPluginName::decode):
2918         (WebCore::SupportedPluginName::encode const):
2919         * plugins/PluginInfoProvider.h:
2920
2921 2017-12-18  Youenn Fablet  <youenn@apple.com>
2922
2923         Update to libwebrtc revision 4e70a72571dd26b85c2385e9c618e343428df5d3
2924         https://bugs.webkit.org/show_bug.cgi?id=180843
2925
2926         Reviewed by Eric Carlson.
2927
2928         Covered by existing tests.
2929
2930         Moving H264 codecs and factories to libwebrtc.
2931         Updating LibWebRTCProvider according new libwebrtc API.
2932         Updating ref counting according new libwebrtc API.
2933
2934         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2935         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2936         (WebCore::LibWebRTCMediaEndpoint::AddRef const):
2937         (WebCore::LibWebRTCMediaEndpoint::Release const):
2938         (WTF::LogArgument<webrtc::RTCStats>::toString):
2939         * WebCore.xcodeproj/project.pbxproj:
2940         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2941         * platform/mediastream/RealtimeOutgoingVideoSource.h:
2942         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
2943         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2944         (WebCore::LibWebRTCProvider::createPeerConnectionFactory):
2945         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2946         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2947         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
2948         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
2949         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
2950         (WebCore::LibWebRTCProviderCocoa::setActive):
2951         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
2952         * platform/mediastream/libwebrtc/VideoToolBoxDecoderFactory.cpp: Removed.
2953         * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp: Removed.
2954         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
2955         (WebCore::ConvertToI420):
2956         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
2957         * testing/Internals.cpp:
2958         (WebCore::Internals::setH264HardwareEncoderAllowed):
2959         * testing/MockLibWebRTCPeerConnection.h:
2960
2961 2018-03-07  Sihui Liu  <sihui_liu@apple.com>
2962
2963         replaceState cause back/forward malfunction on html page with <base href="/"> tag
2964         https://bugs.webkit.org/show_bug.cgi?id=182678
2965         <rdar://problem/37517821>
2966
2967         Reviewed by Chris Dumez.
2968
2969         replaceState should not change URL when the URL argument is NULL, but should change URL when the URL argument is an empty string.
2970
2971         Test: http/tests/history/replacestate-no-url.html
2972
2973         * page/History.cpp:
2974         (WebCore::History::urlForState):
2975
2976 2018-03-07  Antti Koivisto  <antti@apple.com>
2977
2978         Don't invalidate descendants for sibling combinators unless needed
2979         https://bugs.webkit.org/show_bug.cgi?id=183410
2980         <rdar://problem/38227297>
2981
2982         Reviewed by Zalan Bujtas.
2983
2984         If we know the matched sibling combinator doesn't affect descendants we shouldn't invalidate them.
2985
2986         * css/SelectorChecker.cpp:
2987         (WebCore::SelectorChecker::matchRecursively const):
2988
2989             Use different bit for the descendant case.
2990
2991         * cssjit/SelectorCompiler.cpp:
2992         (WebCore::SelectorCompiler::fragmentMatchesTheRightmostElement):
2993
2994             Remove unneeded context assert.
2995
2996         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
2997
2998             Use different bit for the descendant case.
2999
3000         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
3001         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPseudoElement):
3002         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
3003         * dom/Element.cpp:
3004         (WebCore::invalidateForSiblingCombinators):
3005
3006             Invalidate the target sibling or all descendants based on the bits.
3007
3008         * dom/Element.h:
3009         (WebCore::Element::descendantsAffectedByPreviousSibling const):
3010         (WebCore::Element::setDescendantsAffectedByPreviousSibling const):
3011         * dom/Node.h:
3012         * style/StyleRelations.cpp:
3013         (WebCore::Style::commitRelationsToRenderStyle):
3014         (WebCore::Style::commitRelations):
3015         * style/StyleRelations.h:
3016
3017             Add DescendantsAffectedByPreviousSibling bit. AffectedByPreviousSibling is now just about the target element.
3018
3019 2018-03-07  Antti Koivisto  <antti@apple.com>
3020
3021         checkForSiblingStyleChanges should use internal versions of the invalidation functions
3022         https://bugs.webkit.org/show_bug.cgi?id=183405
3023         <rdar://problem/38218310>
3024
3025         Reviewed by Zalan Bujtas.
3026
3027         Non-internal invalidateStyleForElement/Subtree() implement sibling combinator invalidation. Checking this
3028         is only needed if the element in question changed somehow. In checkForSiblingStyleChanges we know that
3029         another element changed and we really just want to invalidate.
3030
3031         * css/SelectorChecker.cpp:
3032         (WebCore::isFirstOfType):
3033         (WebCore::SelectorChecker::checkOne const):
3034
3035         Also make :first-of-type use ChildrenAffectedByForwardPositionalRules for invalidation similar to :last-of-type
3036         for more correct invalidation.
3037
3038         * dom/Element.cpp:
3039         (WebCore::checkForSiblingStyleChanges):
3040
3041 2018-03-07  Yusuke Suzuki  <utatane.tea@gmail.com>
3042
3043         HTML `pattern` attribute should set `u` flag for regular expressions
3044         https://bugs.webkit.org/show_bug.cgi?id=151598
3045
3046         Reviewed by Chris Dumez.
3047
3048         This patch attaches "u" flag to the RegExp compiled for HTML "pattern" attribute[1].
3049
3050         [1]: https://html.spec.whatwg.org/multipage/forms.html#the-pattern-attribute
3051
3052         * html/BaseTextInputType.cpp:
3053         (WebCore::BaseTextInputType::patternMismatch const):
3054
3055 2018-03-07  Frederic Wang  <fwang@igalia.com>
3056
3057         Relayout frames after AsyncFrameScrolling or FrameFlattening option is changed
3058         https://bugs.webkit.org/show_bug.cgi?id=183081
3059
3060         Reviewed by Antonio Gomes.
3061
3062         The frames may be resized when the FrameFlattening option is modified and hence this patch
3063         forces a relayout. It also does that when AsyncFrameScrolling is modified too, since that
3064         may imply changes in frame flattening after bug 173704. Forcing a relayout will also be
3065         enough to trigger other updates for async frame scrolling in the future (see bug 149264 and
3066         bug 171667).
3067
3068         Test: platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic.html
3069
3070         * page/Settings.yaml: Call setNeedsRelayoutAllFrames when one of the AsyncFrameScrolling or
3071         FrameFlattening options is changed.
3072         * page/SettingsBase.cpp: Include RenderWidget to make call on frame->ownerRenderer().
3073         (WebCore::SettingsBase::setNeedsRelayoutAllFrames):  Make layout and preferred widths dirty
3074         on all frames in the page and schedule a relayout.
3075         * page/SettingsBase.h: Declare setNeedsRelayoutAllFrames().
3076
3077 2018-03-07  Alejandro G. Castro  <alex@igalia.com>
3078
3079         Make NetworkRTCResolver port agnostic
3080         https://bugs.webkit.org/show_bug.cgi?id=178855
3081
3082         Reviewed by Youenn Fablet.
3083
3084         Add new API in the DNSResolveQueue allowing to revolve hostnames and get the result. Add platform
3085         specific code for soup platform and refactor the other platforms. Added new API to the DNS API header
3086         and move the general code to the DNS.cpp file, that way we can reuse that code in all the platforms
3087         and leave the ResolveQueue class of the platforms in a file.
3088
3089         No new tests because this is a refactor.
3090
3091         * PlatformAppleWin.cmake: Move the DNSCFNet class to DNSResolveQueueCFNet.
3092         * PlatformMac.cmake: Ditto.
3093         * Sources.txt: Add the DNS.cpp for compilation.
3094         * SourcesCocoa.txt: Move the DNSCFNet class to DNSResolveQueueCFNet.
3095         * WebCore.xcodeproj/project.pbxproj: Move the DNSCFNet class to DNSResolveQueueCFNet, add the DNS.cpp
3096         for compilation. Add the new DNSResolveQueueCFNet class.
3097         * platform/Curl.cmake: Move the DNSCFNet class to DNSResolveQueueCurl.
3098         * platform/network/DNS.cpp: Add this file with the default implementation of the DNS functions for
3099         all the platforms.
3100         (WebCore::prefetchDNS): Copied from every platform implementation.
3101         (WebCore::resolveDNS): Add the function, resolves a hostname, receives the identifier of the operation
3102         and the completion handler.
3103         (WebCore::stopResolveDNS): Add the function, stops a resolution operation, receives the identifier
3104         of the operation.
3105         * platform/network/DNS.h: Add the new APIs resolveDNS and stopResolveDNS with the classes used for the
3106         implementation.
3107         (WebCore::IPAddress::IPAddress): Add this class used to send the resolved address information, it does
3108         not depend on libwebrtc rtc classes.
3109         (WebCore::IPAddress::get): Get a reference to the struct sockaddr_in in the IPAddress class.
3110         (WebCore::DNSCompletionHandler): Add this CompletionHandler type to be used when resolving the DNS
3111         address.
3112         * platform/network/DNSResolveQueue.cpp: Add the DNSResolveQueue platform instantiation in the singleton.
3113         (WebCore::DNSResolveQueue::singleton): Use DNSResolveQueue platform classes when creating the singleton..
3114         (WebCore::DNSResolveQueue::resolve): Add this method to get the address of a hostname, it sends the
3115         identifier and the completion handler to use when returning the result.
3116         (WebCore::DNSResolveQueue::stopResolve): Add this method to stop the resolve operation when required.
3117         * platform/network/DNSResolveQueue.h: Add the new methods and make the class abstract, so that every
3118         platform can implement the functions.
3119         * platform/network/cf/DNSResolveQueueCFNet.cpp: Renamed from Source/WebCore/platform/network/cf/DNSCFNet.cpp.
3120         Add the methods to the new class DNSResolveQueueCFNet, move the prefetchDNS to the DNS.cpp general
3121         implementation.
3122         * platform/network/cf/DNSResolveQueueCFNet.h: Add the new class inheriting from the DNSResolveQueue. Add the
3123         new methods, we have to implement these methods and move the NetworkRTCResolver for COCOA code here.
3124         (WebCore::DNSResolveQueueCF::resolve): Dummy method, not implemented.
3125         (WebCore::DNSResolveQueueCF::stopResolve): Ditto.
3126         * platform/network/curl/DNSResolveQueueCurl.cpp: Renamed from Source/WebCore/platform/network/curl/DNSCurl.cpp.
3127         * platform/network/curl/DNSResolveQueueCurl.h: Add the new class inheriting from the DNSResolveQueue.
3128         (WebCore::DNSResolveQueueCurl::resolve): Ditto.
3129         (WebCore::DNSResolveQueueCurl::stopResolve): Ditto.
3130         * platform/network/soup/DNSResolveQueueSoup.h: New class inheriting from the DNSResolveQueue class, adding
3131         a HasMap with the active operations, it allows stopping them.
3132         * platform/network/soup/DNSResolveQueueSoup.cpp: Renamed from Source/WebCore/platform/network/curl/DNSSoup.cpp.
3133         (WebCore::resolvedWithObserverCallback): Called when the result address from the soup platform is ready,
3134         sends the address to the completion handler.
3135         (WebCore::DNSResolveQueueSoup::resolve): Launch the resolve operation with the soup library.
3136         (WebCore::DNSResolveQueueSoup::stopResolve): Stop the resolve operation on process with a GCancellable.
3137
3138 2018-03-06  Brian Burg  <bburg@apple.com>
3139
3140         [Cocoa] Stop copying ForwardingHeaders directory that no longer exists
3141         https://bugs.webkit.org/show_bug.cgi?id=183396
3142
3143         Reviewed by Dan Bernstein.
3144
3145         * WebCore.xcodeproj/project.pbxproj:
3146         Rename the phase to "Copy ICU Headers". ForwardingHeaders are no longer a thing.
3147
3148 2018-03-06  Youenn Fablet  <youenn@apple.com>
3149
3150         didReceiveServerRedirectForProvisionalNavigation is not called in case of document redirection with service worker registration change
3151         https://bugs.webkit.org/show_bug.cgi?id=183299
3152         <rdar://problem/37547029>
3153
3154         Reviewed by Alex Christensen.
3155
3156         In case of redirection with service worker registration change, we cancel the load and create a new one.
3157         This prevent ResourceLoader::willSendRequestInternal to call the didReceiveServerRedirectForProvisionalNavigation
3158         callback. We thus explictly call this callback after restarting the load with the new service worker step.
3159         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.
3160
3161         Test: http/wpt/service-workers/navigation-redirect-main-frame.https.html
3162
3163         * loader/DocumentLoader.cpp:
3164         (WebCore::DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange):
3165
3166 2018-03-06  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3167
3168         [Curl] Remove unnecessary copied ResourceRequest member variable.
3169         https://bugs.webkit.org/show_bug.cgi?id=183010
3170
3171         Reviewed by Youenn Fablet.
3172
3173         * platform/network/ResourceHandle.h:
3174         * platform/network/ResourceHandleInternal.h:
3175         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3176         * platform/network/curl/CurlRequest.h:
3177         (WebCore::CurlRequest::resourceRequest const):
3178         * platform/network/curl/ResourceHandleCurl.cpp:
3179         (WebCore::ResourceHandle::start):
3180         (WebCore::ResourceHandle::addCacheValidationHeaders):
3181         (WebCore::ResourceHandle::createCurlRequest):
3182         (WebCore::ResourceHandle::restartRequestWithCredential):
3183         (WebCore::ResourceHandle::continueAfterWillSendRequest):
3184
3185 2018-03-06  Nan Wang  <n_wang@apple.com>
3186
3187         AX: Flaky test after r229310
3188         https://bugs.webkit.org/show_bug.cgi?id=183376
3189         <rdar://problem/38188685>
3190
3191         Reviewed by Chris Fleizach.
3192
3193         The test that forces the context menu to show sometimes locks up 
3194         the test runner. Also, we missed a case where calling AXShowMenu
3195         action on a combobox is not dispatching the accessibility event.
3196
3197         Using the combobox example to test the event dispatching in order to
3198         avoid the test hang.
3199
3200         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3201         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
3202         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
3203
3204 2018-03-06  Chris Dumez  <cdumez@apple.com>
3205
3206         fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html fails with async policy delegates
3207         https://bugs.webkit.org/show_bug.cgi?id=183345
3208
3209         Reviewed by Alex Christensen.
3210
3211         FrameLoader::loadURL() was calling loadWithNavigationAction() and then resetting the
3212         m_quickRedirectComing flag right after. This works if the navigation policy decision
3213         triggered by loadWithNavigationAction() is made synchronously. However, when it is
3214         made asynchronously, the flag gets reset too early, before the policy decision
3215         handler has been called. This is an issue because the policy decision handler
3216         relies on the m_quickRedirectComing flag.
3217
3218         Similarly, FrameLoader::loadFrameRequest() was calling loadPostRequest() / loadURL()
3219         and then focusing a frame right after. This does not work as intended when the navigation
3220         policy decision is made asynchronously.
3221
3222         To address the issue, we now pass a completion handler that gets called when the operation
3223         has actually completion, after the policy decision has been made. This maintains the
3224         behavior in place with synchronous policy delegates.
3225
3226         Test: fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-async-delegates.html
3227
3228         * loader/FrameLoader.cpp:
3229         (WebCore::FrameLoader::loadURLIntoChildFrame):
3230         (WebCore::FrameLoader::loadFrameRequest):
3231         (WebCore::FrameLoader::loadURL):
3232         (WebCore::FrameLoader::loadWithNavigationAction):
3233         (WebCore::FrameLoader::load):
3234         (WebCore::FrameLoader::loadWithDocumentLoader):
3235         (WebCore::FrameLoader::reloadWithOverrideEncoding):
3236         (WebCore::FrameLoader::reload):
3237         (WebCore::FrameLoader::loadPostRequest):
3238         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
3239         (WebCore::FrameLoader::loadDifferentDocumentItem):
3240         * loader/FrameLoader.h:
3241
3242 2018-03-06  Antoine Quint  <graouts@apple.com>
3243
3244         [Web Animations] Add a new CSSTransition subclass of WebAnimation
3245         https://bugs.webkit.org/show_bug.cgi?id=183373
3246         <rdar://problem/38181985>
3247
3248         Reviewed by Dean Jackson.
3249
3250         Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles
3251         upon identifying that a new CSS Animation has been added to an element.
3252
3253         * CMakeLists.txt:
3254         * DerivedSources.make:
3255         * Sources.txt:
3256         * WebCore.xcodeproj/project.pbxproj:
3257         * animation/CSSTransition.cpp: Added.
3258         (WebCore::CSSTransition::create):
3259         (WebCore::CSSTransition::CSSTransition):
3260         * animation/CSSTransition.h: Added.
3261         * animation/CSSTransition.idl: Added.
3262         * animation/KeyframeEffect.cpp:
3263         * animation/WebAnimation.h:
3264         (WebCore::WebAnimation::isCSSTransition const):
3265         * bindings/js/JSWebAnimationCustom.cpp:
3266         (WebCore::toJSNewlyCreated):
3267         * bindings/js/WebCoreBuiltinNames.h:
3268
3269 2018-03-06  Megan Gardner  <megan_gardner@apple.com>
3270
3271         Ensure system appearance is default for web content
3272         https://bugs.webkit.org/show_bug.cgi?id=183354
3273         <rdar://problem/36975571>
3274         <rdar://problem/38162381>
3275
3276         Make sure the the system appearance for web content is default, and
3277         consolidate that code to a single class.
3278
3279         Reviewed by Tim Horton.
3280
3281         Not currently testable, will add tests in a future patch.
3282
3283         * WebCore.xcodeproj/project.pbxproj:
3284         * platform/mac/LocalDefaultSystemAppearance.h: Added.
3285         * platform/mac/LocalDefaultSystemAppearance.mm: Added.
3286         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
3287         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
3288         * platform/mac/ThemeMac.mm:
3289         (-[WebCoreThemeView init]):
3290         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
3291         * rendering/RenderThemeMac.mm:
3292         (WebCore::RenderThemeMac::systemColor const):
3293
3294 2018-03-06  Antoine Quint  <graouts@apple.com>
3295
3296         [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
3297         https://bugs.webkit.org/show_bug.cgi?id=183370
3298         <rdar://problem/38180729>
3299
3300         Reviewed by Dean Jackson.
3301
3302         Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
3303         involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
3304         default while we bring this feature up.
3305
3306         * page/RuntimeEnabledFeatures.h:
3307         (WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
3308         (WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const):
3309
3310 2018-03-06  Daniel Bates  <dabates@apple.com>
3311
3312         Make more use of USE(OPENGL_ES) and replace typedefs with C++11 using statements
3313         in TextureCacheCV.h
3314
3315         Rubber-stamped by Tim Horton.
3316
3317         * platform/graphics/cv/TextureCacheCV.h:
3318
3319 2018-03-06  Antti Koivisto  <antti@apple.com>
3320
3321         Cache hasComplexSelectorsForStyleAttribute bit
3322         https://bugs.webkit.org/show_bug.cgi?id=183363
3323
3324         Reviewed by Andreas Kling.
3325
3326         * css/DocumentRuleSets.cpp:
3327         (WebCore::DocumentRuleSets::collectFeatures const):
3328         (WebCore::DocumentRuleSets::hasComplexSelectorsForStyleAttribute const):
3329
3330         Cache the bit to avoid hash lookups.
3331
3332         * css/DocumentRuleSets.h:
3333         * dom/StyledElement.cpp:
3334         (WebCore::StyledElement::invalidateStyleAttribute):
3335         (WebCore::shouldSynchronizeStyleAttributeImmediatelyForInvalidation): Deleted.
3336
3337         Move code to DocumentRuleSets.
3338
3339 2018-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
3340
3341         Change the type of SVGToOTFFontConverter::m_weight to be not a char
3342         https://bugs.webkit.org/show_bug.cgi?id=183339
3343
3344         Reviewed by Alex Christensen.
3345
3346         No new tests because there is no behavior change.
3347
3348         * svg/SVGToOTFFontConversion.cpp:
3349         (WebCore::SVGToOTFFontConverter::appendOS2Table):
3350         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
3351
3352 2018-03-06  Antoine Quint  <graouts@apple.com>
3353
3354         [Web Animations] Add a new CSSAnimation subclass of WebAnimation
3355         https://bugs.webkit.org/show_bug.cgi?id=183371
3356         <rdar://problem/38181724>
3357
3358         Reviewed by Dean Jackson.
3359
3360         Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles
3361         upon identifying that a new CSS Animation has been added to an element.
3362
3363         * CMakeLists.txt:
3364         * DerivedSources.make:
3365         * Sources.txt:
3366         * WebCore.xcodeproj/project.pbxproj:
3367         * animation/CSSAnimation.cpp: Added.
3368         (WebCore::CSSAnimation::create):
3369         (WebCore::CSSAnimation::CSSAnimation):
3370         * animation/CSSAnimation.h: Added.
3371         * animation/CSSAnimation.idl: Added.
3372         * animation/KeyframeEffectReadOnly.cpp
3373         * animation/WebAnimation.h:
3374         (WebCore::WebAnimation::isCSSAnimation const):
3375         * animation/WebAnimation.idl:
3376         * bindings/js/JSWebAnimationCustom.cpp:
3377         (WebCore::toJSNewlyCreated):
3378         (WebCore::toJS):
3379         * bindings/js/WebCoreBuiltinNames.h:
3380
3381 2018-03-06  Ms2ger  <Ms2ger@igalia.com>
3382
3383         Explicitly qualify some method calls on this in lambdas in Service Worker code.
3384         https://bugs.webkit.org/show_bug.cgi?id=183367
3385
3386         Reviewed by Chris Dumez.
3387
3388         No new tests -- no change in behavior.
3389
3390         * loader/DocumentLoader.cpp:
3391         (WebCore::DocumentLoader::startLoadingMainResource):
3392         * workers/service/server/SWServer.cpp:
3393         (WebCore::SWServer::matchAll):
3394
3395 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
3396
3397         [CoordGraphics] Remove unused scrolling-related code in TextureMapperLayer, CoordinatedGraphics stack
3398         https://bugs.webkit.org/show_bug.cgi?id=183340
3399
3400         Reviewed by Michael Catanzaro.
3401
3402         TextureMapperLayer::scrollBy() method is completely unused and can be
3403         removed. This opens the gates on removing majority of scrolling-related
3404         code in TextureMapperLayer, CoordinatedGraphicsLayer and
3405         CoordinatedGraphicsScene classes, along with smaller bits in other
3406         closely-associated classes.
3407
3408         We're able to remove two virtual method overrides in the
3409         ScrollingCoordinatorCoordinatedGraphics class.
3410
3411         TextureMapperLayer can drop the ScrollingClient member variable, along
3412         with multiple others. Various unused methods in that class are removed
3413         as well.
3414
3415         CoordinatedGraphicsLayer and GraphicsLayerTextureMapper can both remove
3416         the custom scrolling state tracking.
3417
3418         No new tests -- no change in behavior.
3419
3420         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
3421         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange): Deleted.
3422         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea): Deleted.
3423         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
3424         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3425         (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
3426         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
3427         (WebCore::GraphicsLayerTextureMapper::didCommitScrollOffset): Deleted.
3428         (WebCore::GraphicsLayerTextureMapper::setIsScrollable): Deleted.
3429         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
3430         * platform/graphics/texmap/TextureMapperLayer.cpp:
3431         (WebCore::TextureMapperLayer::hitTest): Deleted.
3432         (WebCore::TextureMapperLayer::scrollableLayerHitTestCondition): Deleted.
3433         (WebCore::TextureMapperLayer::findScrollableContentsLayerAt): Deleted.
3434         (WebCore::TextureMapperLayer::mapScrollOffset): Deleted.
3435         (WebCore::TextureMapperLayer::commitScrollOffset): Deleted.
3436         (WebCore::TextureMapperLayer::scrollBy): Deleted.
3437         (WebCore::TextureMapperLayer::didCommitScrollOffset): Deleted.
3438         * platform/graphics/texmap/TextureMapperLayer.h:
3439         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3440         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
3441         (WebCore::CoordinatedGraphicsLayer::syncLayerState):
3442         (WebCore::CoordinatedGraphicsLayer::resetLayerState):
3443         (WebCore::CoordinatedGraphicsLayer::setScrollableArea): Deleted.
3444         (WebCore::CoordinatedGraphicsLayer::commitScrollOffset): Deleted.
3445         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3446         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3447
3448 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
3449
3450         [CoordGraphics] Apply TextureMapperLayer animations with a single MonotonicTime value
3451         https://bugs.webkit.org/show_bug.cgi?id=183360
3452
3453         Reviewed by Sergio Villar Senin.
3454
3455         When animations are being applied on the TextureMapperLayer tree, the
3456         monotonic time value is retrieved repeatedly in TextureMapperAnimation
3457         class. Instead of spawning repeated syscalls that are required to obtain
3458         the time value, TextureMapperLayer::applyAnimationsRecursively() now
3459         accepts a MonotonicTime value that should be used for all animation
3460         updates.
3461
3462         No new tests -- no change in behavior.
3463
3464         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3465         (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
3466         * platform/graphics/texmap/TextureMapperAnimation.cpp:
3467         (WebCore::TextureMapperAnimation::apply):
3468         (WebCore::TextureMapperAnimation::computeTotalRunningTime):
3469         (WebCore::TextureMapperAnimations::apply):
3470         * platform/graphics/texmap/TextureMapperAnimation.h:
3471         (WebCore::TextureMapperAnimation::keyframes const):
3472         (WebCore::TextureMapperAnimation::animation const):
3473         (WebCore::TextureMapperAnimation::boxSize const): Deleted.
3474         (WebCore::TextureMapperAnimation::listsMatch const): Deleted.
3475         (WebCore::TextureMapperAnimation::startTime const): Deleted.
3476         (WebCore::TextureMapperAnimation::pauseTime const): Deleted.
3477         * platform/graphics/texmap/TextureMapperLayer.cpp:
3478         (WebCore::TextureMapperLayer::applyAnimationsRecursively):
3479         (WebCore::TextureMapperLayer::syncAnimations):
3480         * platform/graphics/texmap/TextureMapperLayer.h:
3481
3482 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
3483
3484         [CoordGraphics] Clean up CoordinatedImageBacking
3485         https://bugs.webkit.org/show_bug.cgi?id=183332
3486
3487         Reviewed by Carlos Garcia Campos.
3488
3489         Clean up the CoordinatedImageBacking class. Prefer reference values in
3490         class functions, methods and member variables, where possible. Move
3491         member variables into a more sensible order. Initialize a few member
3492         variables at the place of declaration.
3493
3494         Drop releaseSurfaceIfNeeded() and updateVisibilityIfNeeded() methods,
3495         integrating them into the update() method, which was the only place
3496         where they were called from.
3497
3498         We don't have to keep a reference to the buffer object, since we're
3499         not using it internally after it's been passed to the client's
3500         updateImageBacking() implementation.
3501
3502         No new tests -- no change in behavior.
3503
3504         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3505         (WebCore::CoordinatedGraphicsLayer::syncImageBacking):
3506         (WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded):
3507         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
3508         (WebCore::CoordinatedImageBacking::getCoordinatedImageBackingID):
3509         (WebCore::CoordinatedImageBacking::CoordinatedImageBacking):
3510         (WebCore::CoordinatedImageBacking::addHost):
3511         (WebCore::CoordinatedImageBacking::removeHost):
3512         (WebCore::CoordinatedImageBacking::update):
3513         (WebCore::CoordinatedImageBacking::clearContentsTimerFired):
3514         (WebCore::CoordinatedImageBacking::create): Deleted.
3515         (WebCore::CoordinatedImageBacking::markDirty): Deleted.
3516         (WebCore::CoordinatedImageBacking::releaseSurfaceIfNeeded): Deleted.
3517         (WebCore::CoordinatedImageBacking::updateVisibilityIfNeeded): Deleted.
3518         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
3519
3520 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
3521
3522         GraphicsLayerTextureMapper: remove the setAnimations() method
3523         https://bugs.webkit.org/show_bug.cgi?id=183358
3524
3525         Reviewed by Carlos Garcia Campos.
3526
3527         Remove the GraphicsLayerTextureMapper::setAnimations() method. This was
3528         not called from anywhere, and is not the way animations are generated
3529         for a given GraphicsLayer object (that would be addAnimation() method).
3530
3531         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3532         (WebCore::GraphicsLayerTextureMapper::setAnimations): Deleted.
3533         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
3534
3535 2018-03-06  Nan Wang  <n_wang@apple.com>
3536
3537         AX: AOM: More accessibility events support
3538         https://bugs.webkit.org/show_bug.cgi?id=183023
3539         <rdar://problem/37764380>
3540
3541         Reviewed by Chris Fleizach.
3542
3543         Accessibility events.
3544         Spec: https://wicg.github.io/aom/spec/phase2.html
3545
3546         This change adds support for these new events:
3547           accessiblecontextmenu
3548           accessibledecrement
3549           accessibledismiss
3550           accessiblefocus
3551           accessibleincrement
3552           accessiblescrollintoview
3553           accessibleselect
3554
3555         Note: The show context menu action is only supported on macOS now.
3556         The dismiss action is not implemented for all the platforms yet.
3557
3558         Test: accessibility/mac/AOM-events-all.html
3559
3560         * accessibility/AccessibilityListBoxOption.cpp:
3561         (WebCore::AccessibilityListBoxOption::setSelected):
3562         * accessibility/AccessibilityMediaObject.cpp:
3563         (WebCore::AccessibilityMediaObject::increment):
3564         (WebCore::AccessibilityMediaObject::decrement):
3565         * accessibility/AccessibilityMenuListOption.cpp:
3566         (WebCore::AccessibilityMenuListOption::setSelected):
3567         * accessibility/AccessibilityNodeObject.cpp:
3568         (WebCore::AccessibilityNodeObject::increment):
3569         (WebCore::AccessibilityNodeObject::decrement):
3570         * accessibility/AccessibilityObject.cpp:
3571         (WebCore::AccessibilityObject::press):
3572         (WebCore::AccessibilityObject::dispatchAccessibilityEvent const):
3573         (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const):
3574         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent const):
3575         (WebCore::AccessibilityObject::scrollToMakeVisible const):
3576         (WebCore::AccessibilityObject::dispatchAccessibilityEvent): Deleted.
3577         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent): Deleted.
3578         * accessibility/AccessibilityObject.h:
3579         * accessibility/AccessibilityRenderObject.cpp:
3580         (WebCore::AccessibilityRenderObject::setFocused):
3581         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3582         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
3583         * dom/Element.idl:
3584         * dom/EventNames.h:
3585
3586 2018-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3587
3588         Fix std::make_unique / new[] using system malloc
3589         https://bugs.webkit.org/show_bug.cgi?id=182975
3590
3591         Reviewed by JF Bastien.
3592
3593         Use Vector, FAST_ALLOCATED, or UniqueArray instead.
3594
3595         * Modules/webaudio/AudioBufferSourceNode.cpp:
3596         (WebCore::AudioBufferSourceNode::setBuffer):
3597         * Modules/webaudio/AudioBufferSourceNode.h:
3598         * css/StyleRule.h:
3599         * cssjit/CompiledSelector.h:
3600         * html/HTMLFrameSetElement.h:
3601         * html/canvas/WebGLRenderingContextBase.cpp:
3602         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
3603         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
3604         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::LRUImageBufferCache):
3605         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
3606         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::bubbleToFront):
3607         * html/canvas/WebGLRenderingContextBase.h:
3608         * platform/Length.cpp:
3609         (WebCore::newCoordsArray):
3610         (WebCore::newLengthArray):
3611         (): Deleted.
3612         * platform/Length.h:
3613         * platform/audio/DynamicsCompressor.cpp:
3614         (WebCore::DynamicsCompressor::setNumberOfChannels):
3615         * platform/audio/DynamicsCompressor.h:
3616         * platform/audio/FFTFrame.h:
3617         * platform/audio/gstreamer/FFTFrameGStreamer.cpp:
3618         (WebCore::FFTFrame::FFTFrame):
3619         * platform/graphics/FormatConverter.h:
3620         (WebCore::FormatConverter::FormatConverter):
3621         * platform/graphics/GraphicsContext3D.cpp:
3622         (WebCore::GraphicsContext3D::texImage2DResourceSafe):
3623         * platform/graphics/GraphicsContext3D.h:
3624         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
3625         (WebCore::getDirtyRects):
3626         * platform/graphics/cairo/CairoUtilities.cpp:
3627         (WebCore::flipImageSurfaceVertically):
3628         * platform/graphics/cg/GraphicsContext3DCG.cpp:
3629         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3630         * platform/graphics/gpu/Texture.cpp:
3631         (WebCore::Texture::updateSubRect):
3632         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3633         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
3634         (WebCore::GraphicsContext3D::compileShader):
3635         (WebCore::GraphicsContext3D::getActiveAttribImpl):
3636         (WebCore::GraphicsContext3D::getActiveUniformImpl):
3637         (WebCore::GraphicsContext3D::getProgramInfoLog):
3638         (WebCore::GraphicsContext3D::getShaderInfoLog):
3639         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
3640         (WebCore::getShaderLog):
3641         (WebCore::getProgramLog):
3642         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
3643         (WebCore::ImageBufferData::putData):
3644         * platform/image-decoders/png/PNGImageDecoder.cpp:
3645         (WebCore::PNGImageReader::PNGImageReader):
3646         (WebCore::PNGImageReader::close):
3647         (WebCore::PNGImageReader::interlaceBuffer const):
3648         (WebCore::PNGImageReader::createInterlaceBuffer):
3649         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
3650         (WebCore::WEBPImageDecoder::decodeFrame):
3651         * platform/network/curl/SocketStreamHandleImpl.h:
3652         (WebCore::SocketStreamHandleImpl::SocketData::SocketData):
3653         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
3654         (WebCore::createCopy):
3655         (WebCore::SocketStreamHandleImpl::readData):
3656         (): Deleted.
3657         * platform/network/soup/SocketStreamHandleImpl.h:
3658         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
3659         (WebCore::SocketStreamHandleImpl::connected):
3660         * platform/win/LoggingWin.cpp:
3661         (WebCore::logLevelString):
3662
3663 2018-03-05  Yoav Weiss  <yoav@yoav.ws>
3664
3665         Support for preconnect Link headers
3666         https://bugs.webkit.org/show_bug.cgi?id=181657
3667
3668         Reviewed by Darin Adler.
3669
3670         Move the preconnect functionality into its own function, and
3671         also call this function when Link headers are processed.
3672
3673         Test: http/tests/preconnect/link-header-rel-preconnect-http.php
3674
3675         * loader/LinkLoader.cpp:
3676         (WebCore::LinkLoader::loadLinksFromHeader): Call preconnectIfNeeded.
3677         (WebCore::LinkLoader::preconnectIfNeeded): Preconnect to a host functionality moved here.
3678         (WebCore::LinkLoader::loadLink): Call preconnectIfNeeded.
3679         * loader/LinkLoader.h:
3680
3681 2018-03-05  Antti Koivisto  <antti@apple.com>
3682
3683         Add ChildrenAffectedByForwardPositionalRules bit for nth-child pseudo class marking
3684         https://bugs.webkit.org/show_bug.cgi?id=183341
3685         <rdar://problem/38151470>
3686
3687         Reviewed by Zalan Bujtas.
3688
3689         Use it instead of AffectsNextSibling/AffectedByPreviousSibling bits, similar to ChildrenAffectedByBackwardPositionalRules bit.
3690         This is more efficient and requires way less marking.
3691
3692         * css/SelectorChecker.cpp:
3693         (WebCore::countElementsBefore):
3694         (WebCore::countElementsOfTypeBefore):
3695         (WebCore::SelectorChecker::checkOne const):
3696
3697             Mark with ChildrenAffectedByForwardPositionalRules.
3698
3699         * cssjit/SelectorCompiler.cpp:
3700         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
3701         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
3702
3703              Mark with ChildrenAffectedByForwardPositionalRules.
3704
3705         * dom/Element.cpp:
3706         (WebCore::checkForSiblingStyleChanges):
3707
3708             Invalidate siblings after added/removed element.
3709
3710         (WebCore::Element::setChildrenAffectedByForwardPositionalRules):
3711         (WebCore::Element::hasFlagsSetDuringStylingOfChildren const):
3712         (WebCore::Element::rareDataChildrenAffectedByForwardPositionalRules const):
3713
3714             Add the new marking bit.
3715
3716         * dom/Element.h:
3717         (WebCore::Element::childrenAffectedByForwardPositionalRules const):
3718         (WebCore::Element::attributeWithoutSynchronization const):
3719
3720             Remove assert so we can use this to get the current unresolved lazy value of style attrbute.
3721
3722         * dom/ElementRareData.h:
3723         (WebCore::ElementRareData::childrenAffectedByForwardPositionalRules const):
3724         (WebCore::ElementRareData::setChildrenAffectedByForwardPositionalRules):
3725         (WebCore::ElementRareData::ElementRareData):
3726         (WebCore::ElementRareData::resetStyleRelations):
3727
3728              Add the new marking bit.
3729
3730         * dom/StyledElement.cpp:
3731         (WebCore::StyledElement::invalidateStyleAttribute):
3732
3733             In special case where we have attribute selectors for style attribute, synchronize the attribute immediately so we get invalidation right.
3734             Tested by fast/css/style-attribute-invalidation-propagates-to-counted-siblings.html    
3735
3736         * style/StyleRelations.cpp:
3737         (WebCore::Style::commitRelationsToRenderStyle):
3738         (WebCore::Style::commitRelations):
3739
3740             Commit the new bit.
3741
3742         * style/StyleRelations.h:
3743
3744 2018-03-05  Ryan Haddad  <ryanhaddad@apple.com>
3745
3746         Unreviewed build fix, remove unused variables.
3747
3748         * css/parser/CSSPropertyParser.cpp:
3749         (WebCore::consumeSpeakAs):
3750         (WebCore::consumeHangingPunctuation):
3751
3752 2018-03-05  Chris Dumez  <cdumez@apple.com>
3753
3754         fast/loader/onload-policy-ignore-for-frame.html is timing out with async policy delegates
3755         https://bugs.webkit.org/show_bug.cgi?id=183337
3756
3757         Reviewed by Ryosuke Niwa.
3758
3759         Make sure we call checkCompleted() before calling checkLoadComplete() in
3760         FrameLoader::continueLoadAfterNavigationPolicy() when the client tells us
3761         to ignore the navigation, so that we properly recognize that the load is
3762         done. This matches what is already done in FrameLoader::receivedMainResourceError().
3763
3764         Test: fast/loader/onload-policy-ignore-for-frame-async-delegates.html
3765
3766         * loader/FrameLoader.cpp:
3767         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
3768
3769 2018-03-05  Myles C. Maxfield  <mmaxfield@apple.com>
3770
3771         [Cocoa] Allow user-installed fonts to be disabled
3772         https://bugs.webkit.org/show_bug.cgi?id=183349
3773
3774         Rubber stamped by Brent Fulgham.
3775
3776         Tests: fast/text/user-installed-font.html
3777                fast/text/user-installed-fonts/disable.html
3778                fast/text/user-installed-fonts/shadow-disable.html
3779                fast/text/user-installed-fonts/shadow-family-disable.html
3780                fast/text/user-installed-fonts/shadow-family.html
3781                fast/text/user-installed-fonts/shadow-postscript-disable.html
3782                fast/text/user-installed-fonts/shadow-postscript-family-disable.html
3783                fast/text/user-installed-fonts/shadow-postscript-family.html
3784                fast/text/user-installed-fonts/shadow-postscript.html
3785                fast/text/user-installed-fonts/shadow.html
3786                fast/text/user-installed-fonts/system-ui.html
3787
3788         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3789
3790 2018-03-05  Myles C. Maxfield  <mmaxfield@apple.com>
3791
3792         Silence OpenGL and OpenGL ES deprecation warnings in newer SDKs
3793         https://bugs.webkit.org/show_bug.cgi?id=183350
3794
3795         Unreviewed.
3796
3797         * Configurations/WebCore.xcconfig:
3798
3799 2018-03-05  Andy Estes  <aestes@apple.com>
3800
3801         [Mac] Teach WebCore::Pasteboard about file promise drags
3802         https://bugs.webkit.org/show_bug.cgi?id=183314
3803         <rdar://problem/38105493>
3804
3805         Reviewed by Darin Adler.
3806
3807         While WebKit does support receiving file promise drags (since r210360), WebCore::Pasteboard
3808         has not been instructed on how to read their file paths. When the various pasteboard readers
3809         ask for file paths after a file promise drop, they receive an empty vector. This impacts
3810         various features, most notably the DataTransfer API.
3811
3812         Pasteboard actually cannot learn about promised file paths from the pasteboard itself, as
3813         the pasteboard only contains the dragged files' UTIs. Promised file paths aren't known until
3814         the WebKits call -[NSFilePromiseReceiver receivePromisedFilesAtDestination:...], at which
3815         point the file paths are passed to WebCore as part of WebCore::DragData.
3816
3817         When we construct new Pasteboards for drag and drop, we need to store any promised file
3818         paths from the DragData. Then, when the various pasteboard readers ask for file paths and
3819         NSFilesPromisePboardType is on the pasteboard, we can return these promised file paths.
3820
3821         Tests: editing/pasteboard/data-transfer-items-drag-drop-file-promise.html
3822                editing/pasteboard/data-transfer-items-drop-file-promise.html
3823                editing/pasteboard/datatransfer-items-drop-plaintext-file-promise.html
3824                editing/pasteboard/datatransfer-types-dropping-text-file-promise.html
3825                editing/pasteboard/drag-file-promises-to-editable-element-as-URLs.html
3826                editing/pasteboard/drag-file-promises-to-editable-element-as-attachment.html
3827                editing/pasteboard/file-input-files-access-promise.html
3828
3829         * platform/FileSystem.h:
3830         * platform/Pasteboard.h:
3831         (WebCore::Pasteboard::Pasteboard):
3832         * platform/mac/DragDataMac.mm:
3833         (WebCore::DragData::containsPromise const):
3834         * platform/mac/PasteboardMac.mm:
3835         (WebCore::Pasteboard::Pasteboard):
3836         (WebCore::Pasteboard::createForDragAndDrop):
3837         (WebCore::toString):
3838         (WebCore::Pasteboard::read):
3839         (WebCore::Pasteboard::readFilePaths):
3840         (WebCore::absoluteURLsFromPasteboardFilenames): Deleted.
3841         * platform/mac/PlatformPasteboardMac.mm:
3842         (WebCore::PlatformPasteboard::numberOfFiles const):
3843
3844 2018-03-05  Andy Estes  <aestes@apple.com>
3845
3846         [Mac] Fix the build
3847
3848         * Modules/applepay/ApplePaySession.cpp:
3849         (WebCore::convertAndValidate): Removed unused variables.
3850
3851 2018-03-05  Antti Koivisto  <antti@apple.com>
3852
3853         Don't invalidate all children when doing insertion/deletion in presence of backward positional selectors
3854         https://bugs.webkit.org/show_bug.cgi?id=183325
3855         <rdar://problem/38134480>
3856
3857         Reviewed by Zalan Bujtas.
3858
3859         It is sufficient to invalidate siblings before the mutation point.
3860
3861         * dom/Element.cpp:
3862         (WebCore::checkForSiblingStyleChanges):
3863
3864         We already do sibling walk in the case of forwards positional rules and sibling combinators. The work
3865         done here is insignifant compared to cost of overinvalidating.
3866
3867 2018-03-05  Ali Juma  <ajuma@chromium.org>
3868
3869         imported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html times out with async policy delegates
3870         https://bugs.webkit.org/show_bug.cgi?id=183297
3871
3872         Reviewed by Chris Dumez.
3873
3874         When a FrameLoader's policy document loader is cleared after receiving a navigation policy decision
3875         to not continue loading, we still need to trigger a check for load completion, since this loader or
3876         an ancestor loader may have been in state isLoadingInAPISense only because of the existence of
3877         the just-cleared policy document loader. Without triggering this check, these loaders may never
3878         call WebFrameLoaderClient::dispatchDidFinishLoad.
3879
3880         Test: http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html
3881
3882         * loader/FrameLoader.cpp:
3883         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
3884
3885 2018-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>
3886
3887         [WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
3888         https://bugs.webkit.org/show_bug.cgi?id=183312
3889
3890         Reviewed by Mark Lam.
3891
3892         Remove wtf/CurrentTime.h include pragma.
3893
3894         * Modules/geolocation/Geolocation.cpp:
3895         * Modules/mediasource/SourceBuffer.cpp:
3896         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3897         * Modules/speech/SpeechSynthesis.cpp:
3898         * contentextensions/ContentExtensionCompiler.cpp:
3899         * contentextensions/ContentExtensionParser.cpp:
3900         * dom/Document.cpp:
3901         * dom/Element.cpp:
3902         * dom/Event.cpp:
3903         * dom/ScriptedAnimationController.cpp:
3904         * dom/SimulatedClick.cpp:
3905         * fileapi/File.cpp:
3906         * fileapi/FileReader.cpp:
3907         * history/CachedPage.cpp:
3908         * html/BaseDateAndTimeInputType.cpp:
3909         * html/DateTimeInputType.cpp:
3910         * html/HTMLMediaElement.cpp:
3911         * html/MediaController.cpp:
3912         * html/MediaElementSession.cpp:
3913         * html/MonthInputType.cpp:
3914         * html/TimeInputType.cpp:
3915         * html/parser/HTMLParserScheduler.h:
3916         * inspector/InspectorCanvas.cpp:
3917         * loader/FrameLoader.cpp:
3918         * loader/LoadTiming.cpp:
3919         * loader/NavigationScheduler.cpp:
3920         * loader/ProgressTracker.cpp:
3921         * loader/cache/CachedCSSStyleSheet.cpp:
3922         * loader/cache/CachedImage.cpp:
3923         * loader/cache/CachedResource.cpp:
3924         * loader/cache/MemoryCache.cpp:
3925         * page/DOMTimer.cpp:
3926         * page/DOMWindow.cpp:
3927         * page/DragController.cpp:
3928         * page/EventHandler.cpp:
3929         * page/FocusController.cpp:
3930         * page/FrameView.cpp:
3931         * page/Page.cpp: