cfd6e02872e523f64bfe17ba9f763de900457a15
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-11-02  Zalan Bujtas  <zalan@apple.com>
2
3         LayoutState::m_next is really the ancestor state.
4         https://bugs.webkit.org/show_bug.cgi?id=179187
5         <rdar://problem/35319525>
6
7         Reviewed by Simon Fraser.
8
9         No change in functionality.
10
11         * rendering/LayoutState.cpp:
12         (WebCore::LayoutState::LayoutState):
13         (WebCore::LayoutState::clearPaginationInformation):
14         (WebCore::LayoutState::propagateLineGridInfo):
15         (WebCore::LayoutState::establishLineGrid):
16         * rendering/LayoutState.h:
17         * rendering/RenderView.h:
18
19 2017-11-02  Alex Christensen  <achristensen@webkit.org>
20
21         Fix iOS WebKitLegacy after r224267
22         https://bugs.webkit.org/show_bug.cgi?id=179189
23
24         Reviewed by Tim Horton.
25
26         Use callOnMainThread instead of dispatch_async to work correctly on the web thread.
27
28         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
29         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
30         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
31         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
32         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
33         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
34         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
35         (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
36         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
37         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
38
39 2017-11-02  Adrian Perez de Castro  <aperez@igalia.com>
40
41         [WPE] Add some error reporting during EGL display/context creation
42         https://bugs.webkit.org/show_bug.cgi?id=178937
43
44         Reviewed by Carlos Alberto Lopez Perez.
45
46         Unconditionally log errors using WTFLogAlways during EGL context creation. This
47         provides a small degree of help for troubleshooting, and while eglGetError() only
48         returns numeric error codes, it's better than nothing.
49
50         No new tests needed.
51
52         * platform/graphics/PlatformDisplay.cpp:
53         (WebCore::PlatformDisplay::initializeEGLDisplay):
54         * platform/graphics/egl/GLContextEGL.cpp:
55         (WebCore::GLContextEGL::errorString):
56         (WebCore::GLContextEGL::lastErrorString):
57         (WebCore::GLContextEGL::createWindowContext):
58         (WebCore::GLContextEGL::createPbufferContext):
59         (WebCore::GLContextEGL::createSurfacelessContext):
60         (WebCore::GLContextEGL::createContext):
61         (WebCore::GLContextEGL::createSharingContext):
62         (WebCore::GLContextEGL::GLContextEGL):
63         * platform/graphics/egl/GLContextEGL.h:
64         * platform/graphics/egl/GLContextEGLWPE.cpp:
65         (WebCore::GLContextEGL::createWPEContext):
66         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
67         (WebCore::PlatformDisplayWPE::initialize):
68
69 2017-11-02  Joseph Pecoraro  <pecoraro@apple.com>
70
71         Web Inspector: Move InspectorAgents into a folder
72         https://bugs.webkit.org/show_bug.cgi?id=179132
73
74         Reviewed by Devin Rousso.
75
76         * CMakeLists.txt:
77         * Sources.txt:
78         * WebCore.xcodeproj/project.pbxproj:
79         Move files around.
80
81         * inspector/agents/InspectorApplicationCacheAgent.cpp: Renamed from Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp.
82         * inspector/agents/InspectorApplicationCacheAgent.h: Renamed from Source/WebCore/inspector/InspectorApplicationCacheAgent.h.
83         * inspector/agents/InspectorCSSAgent.cpp: Renamed from Source/WebCore/inspector/InspectorCSSAgent.cpp.
84         * inspector/agents/InspectorCSSAgent.h: Renamed from Source/WebCore/inspector/InspectorCSSAgent.h.
85         * inspector/agents/InspectorCanvasAgent.cpp: Renamed from Source/WebCore/inspector/InspectorCanvasAgent.cpp.
86         * inspector/agents/InspectorCanvasAgent.h: Renamed from Source/WebCore/inspector/InspectorCanvasAgent.h.
87         * inspector/agents/InspectorDOMAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMAgent.cpp.
88         * inspector/agents/InspectorDOMAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMAgent.h.
89         * inspector/agents/InspectorDOMDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp.
90         * inspector/agents/InspectorDOMDebuggerAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMDebuggerAgent.h.
91         * inspector/agents/InspectorDOMStorageAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMStorageAgent.cpp.
92         * inspector/agents/InspectorDOMStorageAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMStorageAgent.h.
93         * inspector/agents/InspectorDatabaseAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDatabaseAgent.cpp.
94         * inspector/agents/InspectorDatabaseAgent.h: Renamed from Source/WebCore/inspector/InspectorDatabaseAgent.h.
95         * inspector/agents/InspectorIndexedDBAgent.cpp: Renamed from Source/WebCore/inspector/InspectorIndexedDBAgent.cpp.
96         * inspector/agents/InspectorIndexedDBAgent.h: Renamed from Source/WebCore/inspector/InspectorIndexedDBAgent.h.
97         * inspector/agents/InspectorLayerTreeAgent.cpp: Renamed from Source/WebCore/inspector/InspectorLayerTreeAgent.cpp.
98         * inspector/agents/InspectorLayerTreeAgent.h: Renamed from Source/WebCore/inspector/InspectorLayerTreeAgent.h.
99         * inspector/agents/InspectorMemoryAgent.cpp: Renamed from Source/WebCore/inspector/InspectorMemoryAgent.cpp.
100         * inspector/agents/InspectorMemoryAgent.h: Renamed from Source/WebCore/inspector/InspectorMemoryAgent.h.
101         * inspector/agents/InspectorNetworkAgent.cpp: Renamed from Source/WebCore/inspector/InspectorNetworkAgent.cpp.
102         * inspector/agents/InspectorNetworkAgent.h: Renamed from Source/WebCore/inspector/InspectorNetworkAgent.h.
103         * inspector/agents/InspectorPageAgent.cpp: Renamed from Source/WebCore/inspector/InspectorPageAgent.cpp.
104         * inspector/agents/InspectorPageAgent.h: Renamed from Source/WebCore/inspector/InspectorPageAgent.h.
105         * inspector/agents/InspectorTimelineAgent.cpp: Renamed from Source/WebCore/inspector/InspectorTimelineAgent.cpp.
106         * inspector/agents/InspectorTimelineAgent.h: Renamed from Source/WebCore/inspector/InspectorTimelineAgent.h.
107         * inspector/agents/InspectorWorkerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorWorkerAgent.cpp.
108         * inspector/agents/InspectorWorkerAgent.h: Renamed from Source/WebCore/inspector/InspectorWorkerAgent.h.
109         * inspector/agents/WebConsoleAgent.cpp: Renamed from Source/WebCore/inspector/WebConsoleAgent.cpp.
110         * inspector/agents/WebConsoleAgent.h: Renamed from Source/WebCore/inspector/WebConsoleAgent.h.
111         * inspector/agents/WebDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/WebDebuggerAgent.cpp.
112         * inspector/agents/WebDebuggerAgent.h: Renamed from Source/WebCore/inspector/WebDebuggerAgent.h.
113         * inspector/agents/WebHeapAgent.cpp: Renamed from Source/WebCore/inspector/WebHeapAgent.cpp.
114         * inspector/agents/WebHeapAgent.h: Renamed from Source/WebCore/inspector/WebHeapAgent.h.
115         * inspector/agents/page/PageConsoleAgent.cpp: Renamed from Source/WebCore/inspector/PageConsoleAgent.cpp.
116         * inspector/agents/page/PageConsoleAgent.h: Renamed from Source/WebCore/inspector/PageConsoleAgent.h.
117         * inspector/agents/page/PageDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/PageDebuggerAgent.cpp.
118         * inspector/agents/page/PageDebuggerAgent.h: Renamed from Source/WebCore/inspector/PageDebuggerAgent.h.
119         * inspector/agents/page/PageHeapAgent.cpp: Renamed from Source/WebCore/inspector/PageHeapAgent.cpp.
120         * inspector/agents/page/PageHeapAgent.h: Renamed from Source/WebCore/inspector/PageHeapAgent.h.
121         * inspector/agents/page/PageRuntimeAgent.cpp: Renamed from Source/WebCore/inspector/PageRuntimeAgent.cpp.
122         * inspector/agents/page/PageRuntimeAgent.h: Renamed from Source/WebCore/inspector/PageRuntimeAgent.h.
123         * inspector/agents/worker/WorkerConsoleAgent.cpp: Renamed from Source/WebCore/inspector/WorkerConsoleAgent.cpp.
124         * inspector/agents/worker/WorkerConsoleAgent.h: Renamed from Source/WebCore/inspector/WorkerConsoleAgent.h.
125         * inspector/agents/worker/WorkerDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/WorkerDebuggerAgent.cpp.
126         * inspector/agents/worker/WorkerDebuggerAgent.h: Renamed from Source/WebCore/inspector/WorkerDebuggerAgent.h.
127         * inspector/agents/worker/WorkerRuntimeAgent.cpp: Renamed from Source/WebCore/inspector/WorkerRuntimeAgent.cpp.
128         * inspector/agents/worker/WorkerRuntimeAgent.h: Renamed from Source/WebCore/inspector/WorkerRuntimeAgent.h.
129         Move agents into folders.
130
131 2017-11-02  Youenn Fablet  <youenn@apple.com>
132
133         Service Worker fetch should transmit headers to its client
134         https://bugs.webkit.org/show_bug.cgi?id=179156
135
136         Reviewed by Chris Dumez.
137
138         Covered by updated tests.
139
140         Making resourceResponse getter return a ResourceResponse with the headers of the FetchResponse Headers object.
141
142         * Modules/cache/DOMCache.cpp:
143         (WebCore::DOMCache::toConnectionRecord):
144         * Modules/fetch/FetchResponse.cpp:
145         (WebCore::FetchResponse::resourceResponse const):
146         * Modules/fetch/FetchResponse.h:
147
148 2017-11-02  Chris Dumez  <cdumez@apple.com>
149
150         Update SWServerJobQueue to follow the Service Worker specification more closely
151         https://bugs.webkit.org/show_bug.cgi?id=179147
152
153         Reviewed by Youenn Fablet.
154
155         Align naming with the specification.
156
157         Get rid of unnecessary m_currentJob as the current job is always the first
158         job in the queue.
159
160         Inline some of the tiny methods to simplify code. Those were leftovers from when
161         we used to have a background thread.
162
163         * workers/service/server/SWServer.cpp:
164         (WebCore::SWServer::scheduleJob):
165         * workers/service/server/SWServerJobQueue.cpp:
166         (WebCore::SWServerJobQueue::SWServerJobQueue):
167         (WebCore::SWServerJobQueue::scriptFetchFinished):
168         (WebCore::SWServerJobQueue::scriptContextStarted):
169         (WebCore::SWServerJobQueue::runNextJob):
170         (WebCore::SWServerJobQueue::runNextJobSynchronously):
171         (WebCore::SWServerJobQueue::runRegisterJob):
172         (WebCore::SWServerJobQueue::runUnregisterJob):
173         (WebCore::SWServerJobQueue::runUpdateJob):
174         (WebCore::SWServerJobQueue::rejectCurrentJob):
175         (WebCore::SWServerJobQueue::finishCurrentJob):
176         * workers/service/server/SWServerJobQueue.h:
177         (WebCore::SWServerJobQueue::firstJob const):
178         (WebCore::SWServerJobQueue::lastJob const):
179         (WebCore::SWServerJobQueue::enqueueJob):
180         (WebCore::SWServerJobQueue::size const):
181
182 2017-11-02  Konstantin Tokarev  <annulen@yandex.ru>
183
184         Unreviewed, removed useless semicolon at the end of namespace
185
186         * platform/graphics/texmap/BitmapTextureGL.cpp:
187
188 2017-11-02  Michael Catanzaro  <mcatanzaro@igalia.com>
189
190         WPE does not build with DragImage.cpp in unified sources.
191         https://bugs.webkit.org/show_bug.cgi?id=178844
192
193         Reviewed by Keith Miller.
194
195         Add a stub implementation of DragImage for WPE so that we can drop the @no-unify.
196
197         * Sources.txt:
198         * SourcesWPE.txt:
199         * WebCore.xcodeproj/project.pbxproj:
200         * platform/wpe/DragImageWPE.cpp: Added.
201         (WebCore::dragImageSize):
202         (WebCore::deleteDragImage):
203         (WebCore::scaleDragImage):
204         (WebCore::dissolveDragImageToFraction):
205         (WebCore::createDragImageFromImage):
206         (WebCore::createDragImageIconForCachedImageFilename):
207         (WebCore::createDragImageForLink):
208
209 2017-11-02  Eric Carlson  <eric.carlson@apple.com>
210
211         [MediaStream] audioTrack.label is always empty on macOS
212         https://bugs.webkit.org/show_bug.cgi?id=179175
213         <rdar://problem/35315438>
214
215         Reviewed by Youenn Fablet.
216
217         * platform/mediastream/RealtimeMediaSourceSettings.h:
218         (WebCore::RealtimeMediaSourceSettings::label const): New.
219         (WebCore::RealtimeMediaSourceSettings::setLabel): Ditto.
220         (WebCore::RealtimeMediaSourceSettings::encode const): Encode label.
221         (WebCore::RealtimeMediaSourceSettings::decode): Decode label.
222
223         * platform/mediastream/mac/AVMediaCaptureSource.mm:
224         (WebCore::AVMediaCaptureSource::initializeSettings): Set label.
225
226         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
227         (WebCore::CoreAudioCaptureSource::settings const): Ditto.
228
229         * platform/mock/MockRealtimeMediaSource.cpp:
230         (WebCore::MockRealtimeMediaSource::initializeSettings): Ditto.
231
232 2017-11-02  Chris Dumez  <cdumez@apple.com>
233
234         [Service Workers] Add initial implementation for try Clear Registration / Clear Registration algorithms
235         https://bugs.webkit.org/show_bug.cgi?id=179151
236
237         Reviewed by Youenn Fablet.
238
239         [Service Workers] Add initial implementation for try Clear Registration / Clear Registration algorithms:
240         - https://w3c.github.io/ServiceWorker/#try-clear-registration
241         - https://w3c.github.io/ServiceWorker/#clear-registration
242
243         * workers/service/server/SWServerJobQueue.cpp:
244         (WebCore::SWServerJobQueue::scriptFetchFinished):
245         (WebCore::SWServerJobQueue::runUnregisterJob):
246         (WebCore::SWServerJobQueue::tryClearRegistration):
247         (WebCore::SWServerJobQueue::clearRegistration):
248         * workers/service/server/SWServerJobQueue.h:
249
250 2017-11-02  Antti Koivisto  <antti@apple.com>
251
252         Clear Node renderer pointer when destroying RenderObject
253         https://bugs.webkit.org/show_bug.cgi?id=179112
254
255         Reviewed by Zalan Bujtas.
256
257         Make sure we don't leave renderer pointers behind in Nodes.
258         This could be done with WeakPtr but that would add extra indirection between DOM and render tree.
259
260         * rendering/RenderObject.cpp:
261         (WebCore::RenderObject::willBeDestroyed):
262
263             Null the node renderer pointer.
264             With continuations we have a case where renderer points to a node that has a different renderer.
265             This is is ok as we know no node points to a continuation (they should really be anonymous renderers).
266
267 2017-11-02  Antti Koivisto  <antti@apple.com>
268
269         Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers
270         https://bugs.webkit.org/show_bug.cgi?id=179014
271
272         Remove overly optimistic non-critical assertion that is hit on WK1 debug.
273
274         * rendering/RenderBoxModelObject.cpp:
275         (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):
276
277 2017-11-02  Frederic Wang  <fwang@igalia.com>
278
279         Add references to bug 179167 in FIXME comments
280         https://bugs.webkit.org/show_bug.cgi?id=179168
281
282         Reviewed by Daniel Bates.
283
284         * Configurations/FeatureDefines.xcconfig:
285
286 2017-11-02  Antti Koivisto  <antti@apple.com>
287
288         Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers
289         https://bugs.webkit.org/show_bug.cgi?id=179014
290
291         Reviewed by Geoff Garen.
292
293         Treat continuation similarly to other anonymous wrappers. This makes things more understandable
294         and allows removal of some questionable code in RenderBlock::takeChild.
295
296         The patch also makes continuation chain a double linked so we can efficiently remove single
297         continuations from the chain. It also gets rid of algorithms that recurse in continuation chain.
298
299         * accessibility/AccessibilityRenderObject.cpp:
300         (WebCore::firstChildInContinuation):
301         * rendering/RenderBlock.cpp:
302         (WebCore::RenderBlock::styleDidChange):
303
304             Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
305             the chain only in the (non-continuation) head renderer.
306
307         (WebCore::RenderBlock::dropAnonymousBoxChild):
308
309             Make a member function.
310
311         (WebCore::RenderBlock::takeChild):
312
313             Remove code that destroyed empty continuations and caused the parent to destroy itself.
314             Empty continuations are now removed by RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers.
315
316         * rendering/RenderBlock.h:
317         * rendering/RenderBoxModelObject.cpp:
318         (WebCore::RenderBoxModelObject::ContinuationChainNode::ContinuationChainNode):
319         (WebCore::RenderBoxModelObject::ContinuationChainNode::~ContinuationChainNode):
320         (WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):
321
322             Track continuations with double linked lists.
323
324         (WebCore::continuationChainNodeMap):
325         (WebCore::RenderBoxModelObject::willBeDestroyed):
326
327             Don't recurse to destroy continuation chain. 
328             Destroy all continuations iteratively if this is the head of the chain.
329             When destroying a continuation renderer simply remove it from the chain.
330
331         (WebCore::RenderBoxModelObject::continuation const):
332         (WebCore::RenderBoxModelObject::insertIntoContinuationChainAfter):
333         (WebCore::RenderBoxModelObject::removeFromContinuationChain):
334         (WebCore::RenderBoxModelObject::ensureContinuationChainNode):
335         (WebCore::continuationMap): Deleted.
336         (WebCore::RenderBoxModelObject::setContinuation): Deleted.
337         * rendering/RenderBoxModelObject.h:
338         * rendering/RenderElement.cpp:
339         (WebCore::RenderElement::RenderElement):
340         (WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary):
341
342             Make this a function of the parent renderer itself instead of getting 'parent()' as first operation and
343             then using it.
344             Don't remove continuations (isAnonymousBlockContinuation() test gives wrong result for the last continuation of the chain).
345
346         (WebCore::RenderElement::styleDidChange):
347
348             removeAnonymousWrappersForInlinesIfNecessary is no function of the parent.
349
350         (WebCore::RenderElement::updateOutlineAutoAncestor):
351         * rendering/RenderElement.h:
352         (WebCore::RenderElement::hasContinuationChainNode const):
353         (WebCore::RenderElement::setHasContinuationChainNode):
354         (WebCore::RenderElement::hasContinuation const): Deleted.
355         (WebCore::RenderElement::setHasContinuation): Deleted.
356         * rendering/RenderInline.cpp:
357         (WebCore::RenderInline::styleDidChange):
358
359             Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
360             the chain only in the (non-continuation) head renderer.
361
362         (WebCore::RenderInline::addChildIgnoringContinuation):
363
364             Remove the old continuation from the chain. splitFlow() will add it back into the right place.
365
366         (WebCore::RenderInline::splitInlines):
367         (WebCore::RenderInline::addChildToContinuation):
368         (WebCore::RenderInline::childBecameNonInline):
369
370             Remove the old continuation from the chain. splitFlow() will add it back into the right place.
371
372         * rendering/RenderInline.h:
373         * rendering/RenderObject.cpp:
374         (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const):
375         (WebCore::RenderObject::outputRenderObject const):
376         (WebCore::findDestroyRootIncludingAnonymous):
377
378             Allow anonymous continuations as destroy roots.
379
380         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
381
382             Removing a continuation may leave behind unnecessary anonymous sibling wrappers.
383             Call removeAnonymousWrappersForInlinesIfNecessary() on parent after removal to get rid of them.
384             If takeChild/removeAnonymousWrappersForInlinesIfNecessary leaves us with empty anonymous parent destroy that too.
385
386         * rendering/RenderRubyRun.cpp:
387         (WebCore::RenderRubyRun::takeChild):
388
389             Similar to RenderBlock::takeChild, remove the code that would make the renderer destroy itself.
390             Cleaning up RenderRubyRuns is now handled by removeFromParentAndDestroyCleaningUpAnonymousWrappers.
391
392 2017-11-02  Ryosuke Niwa  <rniwa@webkit.org>
393
394         REGRESSION(r224053): Crash in WebCore::Node::moveTreeToNewScope
395         https://bugs.webkit.org/show_bug.cgi?id=179158
396
397         Reviewed by Antti Koivisto.
398
399         Call decrementReferencingNodeCount after checking the release assertion
400         since that could delete oldDocument.
401
402         * dom/Node.cpp:
403         (WebCore::Node::moveTreeToNewScope):
404
405 2017-11-02  Antti Koivisto  <antti@apple.com>
406
407         First letter text renderer should be anonymous
408         https://bugs.webkit.org/show_bug.cgi?id=179114
409
410         Reviewed by Darin Adler.
411
412         Currently both RenderTextFragment and RenderText for first letter point to the same Text node.
413         There should only be one non-anonymous renderer per node.
414
415         * accessibility/AccessibilityRenderObject.cpp:
416         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
417
418             Skip the first letter text renderer instead of the fragment.
419
420         * rendering/RenderBoxModelObject.cpp:
421         (WebCore::firstLetterRemainingTextMap):
422
423             Use WeakPtr.
424             Modernize.
425
426         (WebCore::RenderBoxModelObject::willBeDestroyed):
427         (WebCore::RenderBoxModelObject::firstLetterRemainingText const):
428
429             Avoid hash lookup with the new isFirstLetter bit.
430
431         (WebCore::RenderBoxModelObject::setFirstLetterRemainingText):
432
433         * rendering/RenderElement.cpp:
434         (WebCore::RenderElement::RenderElement):
435         * rendering/RenderElement.h:
436         (WebCore::RenderElement::isFirstLetter const):
437         (WebCore::RenderElement::setIsFirstLetter):
438
439             Add a bit for more explicit code.
440
441         * rendering/RenderTextFragment.cpp:
442         (WebCore::RenderTextFragment::setText):
443
444             Assert that RenderTextFragment is always the non-anonymous renderer.
445
446         * style/RenderTreeUpdaterFirstLetter.cpp:
447         (WebCore::updateFirstLetterStyle):
448
449             Set the isFirstLetter bit.
450
451         (WebCore::createFirstLetterRenderer):
452
453             Set the isFirstLetter bit.
454             Remove the old text renderer before adding a new one.
455
456 2017-11-01  Frederic Wang  <fwang@igalia.com>
457
458         Remove ScrollableArea::isTouchScrollable and ScrollableArea::isOverflowScroll
459         https://bugs.webkit.org/show_bug.cgi?id=179121
460
461         Reviewed by Alex Christensen.
462
463         These functions were introduced in r161589 and r160236 but it seems that they have never
464         been used.
465
466         No new tests, behavior unchanged.
467
468         * platform/ScrollableArea.h:
469         (WebCore::ScrollableArea::isTouchScrollable const): Deleted.
470         (WebCore::ScrollableArea::isOverflowScroll const): Deleted.
471         * rendering/RenderLayer.h:
472
473 2017-11-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>
474
475         [Curl] Make the order of scheduler job handling sequential 
476         https://bugs.webkit.org/show_bug.cgi?id=179127
477
478         Reviewed by Alex Christensen.
479
480         * platform/network/curl/CurlRequestScheduler.cpp:
481         (WebCore::CurlRequestScheduler::add):
482         (WebCore::CurlRequestScheduler::cancel):
483         (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
484         (WebCore::CurlRequestScheduler::executeTasks):
485         (WebCore::CurlRequestScheduler::workerThread):
486         (WebCore::CurlRequestScheduler::startTransfer):
487         (WebCore::CurlRequestScheduler::completeTransfer):
488         (WebCore::CurlRequestScheduler::cancelTransfer):
489         (WebCore::CurlRequestScheduler::finalizeTransfer):
490         (WebCore::CurlJobList::isEmpty const): Deleted.
491         (WebCore::CurlJobList::startJobs): Deleted.
492         (WebCore::CurlJobList::finishJobs): Deleted.
493         (WebCore::CurlRequestScheduler::updateJobList): Deleted.
494         * platform/network/curl/CurlRequestScheduler.h:
495
496 2017-11-01  Ryosuke Niwa  <rniwa@webkit.org>
497
498         NavigatorBase::onLine() accesses NetworkStateNotifier's singleton in a worker thread
499         https://bugs.webkit.org/show_bug.cgi?id=179149
500         <rdar://problem/35307552>
501
502         Reviewed by Jiewen Tan.
503
504         Fixed the bug making NavigatorBase::onLine a pure virtual function, and having two separate
505         implementations for Navigator and WorkerNavigator. The former uses the singleton directly,
506         and the latter returns the boolean stored in its instance. The boolean value is updated
507         via WorkerMessagingProxy when the online status changes.
508
509         No new tests.
510
511         * page/Navigator.cpp:
512         (WebCore::Navigator::onLine const):
513         * page/Navigator.h:
514         * page/NavigatorBase.cpp:
515         (WebCore::NavigatorBase::onLine): Deleted.
516         * page/NavigatorBase.h:
517         * page/WorkerNavigator.cpp:
518         (WebCore::WorkerNavigator::WorkerNavigator):
519         (WebCore::WorkerNavigator::onLine const):
520         * page/WorkerNavigator.h:
521         * platform/network/NetworkStateNotifier.cpp:
522         (WebCore::NetworkStateNotifier::singleton):
523         * workers/DedicatedWorkerGlobalScope.cpp:
524         (WebCore::DedicatedWorkerGlobalScope::create):
525         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
526         * workers/DedicatedWorkerGlobalScope.h:
527         * workers/DedicatedWorkerThread.cpp:
528         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
529         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
530         * workers/DedicatedWorkerThread.h:
531         * workers/Worker.cpp:
532         (WebCore::Worker::notifyFinished):
533         * workers/WorkerGlobalScope.cpp:
534         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
535         (WebCore::WorkerGlobalScope::navigator):
536         (WebCore::WorkerGlobalScope::setIsOnline):
537         * workers/WorkerGlobalScope.h:
538         * workers/WorkerGlobalScopeProxy.h:
539         * workers/WorkerMessagingProxy.cpp:
540         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
541         (WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
542         * workers/WorkerMessagingProxy.h:
543         * workers/WorkerThread.cpp:
544         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
545         (WebCore::WorkerThread::WorkerThread):
546         (WebCore::WorkerThread::workerThread):
547         * workers/WorkerThread.h:
548         * workers/service/ServiceWorkerGlobalScope.cpp:
549         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
550         * workers/service/ServiceWorkerGlobalScope.h:
551         * workers/service/context/ServiceWorkerThread.cpp:
552         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
553         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
554         * workers/service/context/ServiceWorkerThread.h:
555
556 2017-11-01  Jiewen Tan  <jiewen_tan@apple.com>
557
558         Let is<T>() accept RefPtrs
559         https://bugs.webkit.org/show_bug.cgi?id=178612
560         <rdar://problem/35102004>
561
562         Reviewed by Ryosuke Niwa.
563
564         Get rid of .get() for all is<T>() calls.
565
566         No changes in behaviors.
567
568         * bindings/js/JSElementCustom.cpp:
569         (WebCore::createNewElementWrapper):
570         * bindings/js/JSMediaStreamTrackCustom.cpp:
571         (WebCore::toJSNewlyCreated):
572         * bindings/js/JSNodeCustom.cpp:
573         (WebCore::createWrapperInline):
574         * bindings/js/JSTextCustom.cpp:
575         (WebCore::toJSNewlyCreated):
576         * css/CSSFilterImageValue.cpp:
577         (WebCore::CSSFilterImageValue::loadSubimages):
578         * css/CSSFontFaceSet.cpp:
579         (WebCore::CSSFontFaceSet::matchingFaces):
580         * css/CSSFontSelector.cpp:
581         (WebCore::CSSFontSelector::addFontFaceRule):
582         * css/CSSToStyleMap.cpp:
583         (WebCore::CSSToStyleMap::mapNinePieceImage):
584         * css/FontFace.cpp:
585         (WebCore::FontFace::create):
586         * css/StyleBuilderConverter.h:
587         (WebCore::StyleBuilderConverter::createGridTrackList):
588         * css/StyleBuilderCustom.h:
589         (WebCore::StyleBuilderCustom::applyValueCursor):
590         (WebCore::StyleBuilderCustom::applyValueContent):
591         (WebCore::StyleBuilderCustom::applyValueWillChange):
592         * css/StyleProperties.cpp:
593         (WebCore::StyleProperties::propertyAsColor const):
594         (WebCore::StyleProperties::propertyAsValueID const):
595         * css/StyleResolver.cpp:
596         (WebCore::StyleResolver::createFilterOperations):
597         * css/TransformFunctions.cpp:
598         (WebCore::transformsForValue):
599         * css/ViewportStyleResolver.cpp:
600         (WebCore::ViewportStyleResolver::getViewportArgumentValue const):
601         * dom/Document.cpp:
602         (WebCore::Document::setBodyOrFrameset):
603         (WebCore::Document::setFocusedElement):
604         (WebCore::Document::updateHoverActiveState):
605         * dom/Element.cpp:
606         (WebCore::Element::setOuterHTML):
607         * dom/Range.cpp:
608         (WebCore::Range::insertNode):
609         * editing/ApplyStyleCommand.cpp:
610         (WebCore::toIdentifier):
611         (WebCore::ApplyStyleCommand::applyBlockStyle):
612         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
613         * editing/EditingStyle.cpp:
614         (WebCore::identifierForStyleProperty):
615         (WebCore::HTMLElementEquivalent::valueIsPresentInStyle const):
616         (WebCore::EditingStyle::extractFontSizeDelta):
617         (WebCore::EditingStyle::textDirection const):
618         (WebCore::textDecorationValueList):
619         (WebCore::EditingStyle::prepareToApplyAt):
620         (WebCore::EditingStyle::legacyFontSize const):
621         (WebCore::EditingStyle::textDirectionForSelection):
622         (WebCore::StyleChange::StyleChange):
623         (WebCore::StyleChange::extractTextStyles):
624         (WebCore::diffTextDecorations):
625         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
626         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
627         * html/FormAssociatedElement.cpp:
628         (WebCore::FormAssociatedElement::findAssociatedForm):
629         * html/HTMLAreaElement.cpp:
630         (WebCore::HTMLAreaElement::imageElement const):
631         * html/HTMLElement.cpp:
632         (WebCore::HTMLElement::setOuterText):
633         (WebCore::HTMLElement::dirAttributeChanged):
634         * html/HTMLEmbedElement.cpp:
635         (WebCore::HTMLEmbedElement::rendererIsNeeded):
636         * html/HTMLFormControlElement.cpp:
637         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
638         * html/HTMLInputElement.cpp:
639         (WebCore::HTMLInputElement::dataList const):
640         * html/HTMLOptionElement.cpp:
641         (WebCore::HTMLOptionElement::setText):
642         (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const):
643         * html/HTMLPlugInElement.cpp:
644         (WebCore::HTMLPlugInElement::isKeyboardFocusable const):
645         (WebCore::HTMLPlugInElement::isUserObservable const):
646         * html/HTMLSelectElement.cpp:
647         (WebCore::HTMLSelectElement::selectOption):
648         * html/HTMLSummaryElement.cpp:
649         (WebCore::isClickableControl):
650         * html/HTMLTextFormControlElement.cpp:
651         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
652         * html/RadioInputType.cpp:
653         (WebCore::RadioInputType::isKeyboardFocusable const):
654         * html/parser/HTMLConstructionSite.cpp:
655         (WebCore::HTMLConstructionSite::attachLater):
656         (WebCore::HTMLConstructionSite::insertTextNode):
657         * html/shadow/MediaControlElements.cpp:
658         (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
659         * html/track/TextTrackList.cpp:
660         (TextTrackList::append):
661         * inspector/InspectorDOMAgent.cpp:
662         (WebCore::InspectorDOMAgent::setNodeName):
663         * inspector/PageScriptDebugServer.cpp:
664         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
665         * page/FocusController.cpp:
666         (WebCore::shouldClearSelectionWhenChangingFocusedElement):
667         * page/FrameView.cpp:
668         (WebCore::FrameView::hasCustomScrollbars const):
669         * page/Page.cpp:
670         (WebCore::Page::pluginViews):
671         * page/mac/EventHandlerMac.mm:
672         (WebCore::EventHandler::platformPrepareForWheelEvents):
673         * rendering/RenderBoxModelObject.cpp:
674         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
675         * testing/Internals.cpp:
676         (WebCore::deferredStyleRulesCountForList):
677         (WebCore::deferredGroupRulesCountForList):
678         (WebCore::deferredKeyframesRulesCountForList):
679
680 2017-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
681
682         [curl] Fix build after r224299
683         https://bugs.webkit.org/show_bug.cgi?id=179155
684
685         Unreviewed.
686
687         Bug 175597 added the 6th argument of ResourceHandle constructor.
688         Apply the same change of ResourceHandleCFNet.cpp to
689         platformLoadResourceSynchronously of ResourceHandleCurl.cpp.
690
691         No new tests since there should be no behavioral change other
692
693         * platform/network/curl/ResourceHandleCurl.cpp:
694         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
695         Added the 6th arguemnt shouldContentEncodingSniff.
696
697 2017-11-01  Simon Fraser  <simon.fraser@apple.com>
698
699         Fix iOS build after r224312.
700
701         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
702         (WebCore::GraphicsContext::drawFocusRing):
703
704 2017-11-01  Daniel Bates  <dabates@apple.com>
705
706         Change Element::didAddUserAgentShadowRoot() to take a reference instead of a pointer
707         https://bugs.webkit.org/show_bug.cgi?id=179153
708
709         Reviewed by Ryosuke Niwa.
710
711         Element::didAddUserAgentShadowRoot() is always passed a non-null pointer to the added
712         ShadowRoot. Therefore we should have didAddUserAgentShadowRoot() take a lvalue reference
713         to a ShadowRoot.
714
715         No functionality changed. So, no new tests.
716
717         * dom/Element.cpp:
718         (WebCore::Element::addShadowRoot):
719         * dom/Element.h:
720         (WebCore::Element::didAddUserAgentShadowRoot):
721         * html/HTMLDetailsElement.cpp:
722         (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
723         * html/HTMLDetailsElement.h:
724         * html/HTMLInputElement.cpp:
725         (WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
726         * html/HTMLInputElement.h:
727         * html/HTMLMediaElement.cpp:
728         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
729         * html/HTMLMediaElement.h:
730         * html/HTMLMeterElement.cpp:
731         (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
732         * html/HTMLMeterElement.h:
733         * html/HTMLPlugInElement.cpp:
734         (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
735         * html/HTMLPlugInElement.h:
736         * html/HTMLPlugInImageElement.cpp:
737         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
738         * html/HTMLPlugInImageElement.h:
739         * html/HTMLProgressElement.cpp:
740         (WebCore::HTMLProgressElement::didAddUserAgentShadowRoot):
741         * html/HTMLProgressElement.h:
742         * html/HTMLSummaryElement.cpp:
743         (WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot):
744         * html/HTMLSummaryElement.h:
745         * html/HTMLTextAreaElement.cpp:
746         (WebCore::HTMLTextAreaElement::didAddUserAgentShadowRoot):
747         * html/HTMLTextAreaElement.h:
748
749 2017-11-01  Jeremy Jones  <jeremyj@apple.com>
750
751         Implement WKFullscreenWindowController for iOS.
752         https://bugs.webkit.org/show_bug.cgi?id=178924
753         rdar://problem/34697120
754
755         Reviewed by Simon Fraser.
756
757         Enable ENABLE_FULLSCREEN_API for iOS.
758
759         * Configurations/FeatureDefines.xcconfig:
760
761 2017-11-01  Simon Fraser  <simon.fraser@apple.com>
762
763         Misc display list and other cleanup
764         https://bugs.webkit.org/show_bug.cgi?id=179150
765
766         Reviewed by Tim Horton.
767
768         A few functions in GraphicsContext would assert when using display lists, because they
769         had no recording clause. Fix them (ellipse drawing, and focus ring drawing).
770         
771         Use #pragma once in more places.
772
773         Add system trace points for display list recording.
774
775         No behavior change for non-display list code.
776
777         * platform/graphics/GraphicsContext.cpp:
778         (WebCore::GraphicsContext::fillEllipse):
779         (WebCore::GraphicsContext::strokeEllipse):
780         * platform/graphics/PlatformLayer.h:
781         * platform/graphics/ca/GraphicsLayerCA.cpp:
782         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
783         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.h:
784         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
785         * platform/graphics/cg/GraphicsContextCG.h:
786         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
787         (WebCore::GraphicsContext::drawFocusRing):
788         * platform/graphics/displaylists/DisplayList.h:
789         * platform/graphics/displaylists/DisplayListItems.h:
790         (WebCore::DisplayList::DrawFocusRingPath::create):
791         (WebCore::DisplayList::DrawFocusRingPath::width const):
792         (WebCore::DisplayList::DrawFocusRingPath::offset const):
793         (WebCore::DisplayList::DrawFocusRingPath::DrawFocusRingPath):
794         (WebCore::DisplayList::DrawFocusRingRects::create):
795         (WebCore::DisplayList::DrawFocusRingRects::width const):
796         (WebCore::DisplayList::DrawFocusRingRects::offset const):
797         (WebCore::DisplayList::DrawFocusRingRects::DrawFocusRingRects):
798         * platform/graphics/displaylists/DisplayListRecorder.cpp:
799         (WebCore::DisplayList::Recorder::restore):
800         (WebCore::DisplayList::Recorder::drawFocusRing):
801         * platform/graphics/displaylists/DisplayListRecorder.h:
802         * platform/graphics/displaylists/DisplayListReplayer.h:
803         * platform/graphics/mac/WebLayer.h:
804
805 2017-11-01  Per Arne Vollan  <pvollan@apple.com>
806
807         [Win] Fix compile errors in MediaPlayerPrivateAVFoundationCF.cpp
808         https://bugs.webkit.org/show_bug.cgi?id=179148
809
810         Reviewed by Ryosuke Niwa.
811
812         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
813         (WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURLChanged):
814
815 2017-11-01  Tim Horton  <timothy_horton@apple.com>
816
817         Adjust RenderElement size assertion to be more accurate
818         https://bugs.webkit.org/show_bug.cgi?id=179146
819
820         Reviewed by Simon Fraser.
821
822         * rendering/RenderElement.cpp:
823         Alignment rules for bitfields differ on different platforms. If we're
824         more truthful in our mimicing the layout of RenderElement, we can avoid
825         the assertion firing on more configurations.
826
827 2017-11-01  Mark Lam  <mark.lam@apple.com>
828
829         Add support to throw OOM if MarkedArgumentBuffer may overflow.
830         https://bugs.webkit.org/show_bug.cgi?id=179092
831         <rdar://problem/35116160>
832
833         Reviewed by Saam Barati.
834
835         No new tests.  The test for overflowing a MarkedArgumentBuffer will run for a
836         ridiculously long time, which renders it unsuitable for automated tests.
837
838         * Modules/plugins/QuickTimePluginReplacement.mm:
839         (WebCore::QuickTimePluginReplacement::installReplacement):
840         * bindings/js/JSCustomElementInterface.cpp:
841         (WebCore::constructCustomElementSynchronously):
842         (WebCore::JSCustomElementInterface::upgradeElement):
843         (WebCore::JSCustomElementInterface::invokeCallback):
844         * bindings/js/JSCustomXPathNSResolver.cpp:
845         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
846         * bindings/js/JSDOMBuiltinConstructorBase.cpp:
847         (WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments):
848         * bindings/js/JSDOMConvertSequences.h:
849         (WebCore::JSConverter<IDLSequence<T>>::convert):
850         (WebCore::JSConverter<IDLFrozenArray<T>>::convert):
851         * bindings/js/JSDOMConvertWebGL.cpp:
852         (WebCore::convertToJSValue):
853         * bindings/js/JSDOMIterator.h:
854         (WebCore::jsPair):
855         (WebCore::iteratorForEach):
856         * bindings/js/JSDOMMapLike.cpp:
857         (WebCore::forwardFunctionCallToBackingMap):
858         (WebCore::forwardForEachCallToBackingMap):
859         * bindings/js/JSDOMPromiseDeferred.cpp:
860         (WebCore::DeferredPromise::callFunction):
861         (WebCore::createRejectedPromiseWithTypeError):
862         * bindings/js/JSErrorHandler.cpp:
863         (WebCore::JSErrorHandler::handleEvent):
864         * bindings/js/JSEventListener.cpp:
865         (WebCore::JSEventListener::handleEvent):
866         * bindings/js/JSLazyEventListener.cpp:
867         (WebCore::JSLazyEventListener::initializeJSFunction const):
868         * bindings/js/JSPluginElementFunctions.cpp:
869         (WebCore::callPlugin):
870         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
871         (WebCore::constructJSReadableStreamReaderGeneric):
872         * bindings/js/ReadableStream.cpp:
873         (WebCore::ReadableStream::create):
874         (WebCore::ReadableStream::pipeTo):
875         (WebCore::ReadableStream::tee):
876         (WebCore::ReadableStream::lock):
877         (WebCore::checkReadableStream):
878         * bindings/js/ReadableStreamDefaultController.cpp:
879         (WebCore::ReadableStreamDefaultController::invoke):
880         * bindings/js/ScheduledAction.cpp:
881         (WebCore::ScheduledAction::executeFunctionInContext):
882         * bindings/js/SerializedScriptValue.cpp:
883         (WebCore::CloneSerializer::recordObject):
884         (WebCore::CloneSerializer::serialize):
885         (WebCore::CloneDeserializer::readTerminal):
886         (WebCore::CloneDeserializer::deserialize):
887         * bindings/scripts/CodeGeneratorJS.pm:
888         (GenerateCallbackImplementationContent):
889         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
890         (WebCore::JSTestCallbackFunction::handleEvent):
891         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
892         (WebCore::JSTestCallbackFunctionRethrow::handleEvent):
893         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
894         (WebCore::JSTestCallbackFunctionWithThisObject::handleEvent):
895         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
896         (WebCore::JSTestCallbackFunctionWithTypedefs::handleEvent):
897         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
898         (WebCore::JSTestCallbackInterface::callbackWithNoParam):
899         (WebCore::JSTestCallbackInterface::callbackWithArrayParam):
900         (WebCore::JSTestCallbackInterface::callbackWithSerializedScriptValueParam):
901         (WebCore::JSTestCallbackInterface::callbackWithStringList):
902         (WebCore::JSTestCallbackInterface::callbackWithBoolean):
903         (WebCore::JSTestCallbackInterface::callbackRequiresThisToPass):
904         (WebCore::JSTestCallbackInterface::callbackWithAReturnValue):
905         (WebCore::JSTestCallbackInterface::callbackThatRethrowsExceptions):
906         (WebCore::JSTestCallbackInterface::callbackThatSkipsInvokeCheck):
907         (WebCore::JSTestCallbackInterface::callbackWithThisObject):
908         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
909         (WebCore::JSTestVoidCallbackFunction::handleEvent):
910         * bridge/NP_jsobject.cpp:
911         * bridge/objc/WebScriptObject.mm:
912         (-[WebScriptObject callWebScriptMethod:withArguments:]):
913         * html/HTMLMediaElement.cpp:
914         (WebCore::HTMLMediaElement::updateCaptionContainer):
915         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
916         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
917         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
918         * html/HTMLPlugInImageElement.cpp:
919         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
920         * testing/Internals.cpp:
921         (WebCore::Internals::cloneArrayBuffer):
922
923 2017-11-01  Andy Estes  <aestes@apple.com>
924
925         [Apple Pay] Update the enum traits for PaymentError::ContactField
926         https://bugs.webkit.org/show_bug.cgi?id=179145
927         <rdar://problem/35303108>
928
929         Reviewed by Tim Horton.
930
931         Account for the values added to PaymentError::ContactField in r220718 and r223580.
932
933         * Modules/applepay/ApplePaySessionPaymentRequest.h:
934
935 2017-11-01  Daniel Bates  <dabates@apple.com>
936
937         Remove unused Element::alwaysCreateUserAgentShadowRoot()
938         https://bugs.webkit.org/show_bug.cgi?id=179141
939
940         Reviewed by Ryosuke Niwa.
941
942         In changeset r208135 Element::createShadowRoot() was removed. And Element::createShadowRoot()
943         was the only caller of Element::alwaysCreateUserAgentShadowRoot(). We should remove
944         Element::alwaysCreateUserAgentShadowRoot() as it is unused.
945
946         * dom/Element.h:
947         (WebCore::Element::didAddUserAgentShadowRoot):
948         (WebCore::Element::alwaysCreateUserAgentShadowRoot const): Deleted.
949         * html/HTMLButtonElement.h:
950         * html/HTMLFormControlElement.h:
951         * html/HTMLMediaElement.h:
952
953 2017-11-01  Chris Dumez  <cdumez@apple.com>
954
955         Drop running Service Worker Jobs on a background thread
956         https://bugs.webkit.org/show_bug.cgi?id=179142
957
958         Reviewed by Youenn Fablet.
959
960         Drop running Service Worker Jobs on a background thread. We don't really need to
961         and this simplifies the logic a lot.
962
963         * workers/service/server/SWServer.cpp:
964         (WebCore::SWServer::getRegistration):
965         (WebCore::SWServer::addRegistration):
966         (WebCore::SWServer::removeRegistration):
967         * workers/service/server/SWServerJobQueue.cpp:
968         (WebCore::SWServerJobQueue::scriptContextStarted):
969         (WebCore::SWServerJobQueue::startNextJob):
970         (WebCore::SWServerJobQueue::runRegisterJob):
971         (WebCore::SWServerJobQueue::runUnregisterJob):
972         (WebCore::SWServerJobQueue::runUpdateJob):
973         (WebCore::SWServerJobQueue::finishCurrentJob):
974         * workers/service/server/SWServerJobQueue.h:
975
976 2017-11-01  Per Arne Vollan  <pvollan@apple.com>
977
978         Unreviewed, try to fix Windows build.
979
980         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
981         (WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL):
982
983 2017-11-01  Chris Dumez  <cdumez@apple.com>
984
985         Split JobQueue logic out of SWServerRegistration
986         https://bugs.webkit.org/show_bug.cgi?id=179126
987
988         Reviewed by Brady Eidson.
989
990         Split JobQueue logic out of SWServerRegistration and into a SWServerJobQueue class to match the Service Workers
991         specification more closely.
992
993         * Sources.txt:
994         * WebCore.xcodeproj/project.pbxproj:
995         * workers/service/ServiceWorkerContainer.cpp:
996         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
997         * workers/service/ServiceWorkerRegistrationData.cpp:
998         (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
999         * workers/service/ServiceWorkerRegistrationData.h:
1000         (WebCore::ServiceWorkerRegistrationData::encode const):
1001         (WebCore::ServiceWorkerRegistrationData::decode):
1002         * workers/service/server/SWServer.cpp:
1003         (WebCore::SWServer::~SWServer):
1004         (WebCore::SWServer::getRegistration):
1005         (WebCore::SWServer::addRegistration):
1006         (WebCore::SWServer::removeRegistration):
1007         (WebCore::SWServer::Connection::scriptContextStarted):
1008         (WebCore::SWServer::scheduleJob):
1009         (WebCore::SWServer::scriptFetchFinished):
1010         (WebCore::SWServer::scriptContextFailedToStart):
1011         (WebCore::SWServer::scriptContextStarted):
1012         * workers/service/server/SWServer.h:
1013         * workers/service/server/SWServerJobQueue.cpp: Added.
1014         (WebCore::SWServerJobQueue::SWServerJobQueue):
1015         (WebCore::SWServerJobQueue::~SWServerJobQueue):
1016         (WebCore::SWServerJobQueue::enqueueJob):
1017         (WebCore::SWServerJobQueue::scriptFetchFinished):
1018         (WebCore::SWServerJobQueue::scriptContextFailedToStart):
1019         (WebCore::SWServerJobQueue::scriptContextStarted):
1020         (WebCore::SWServerJobQueue::startNextJob):
1021         (WebCore::SWServerJobQueue::runRegisterJob):
1022         (WebCore::SWServerJobQueue::runUnregisterJob):
1023         (WebCore::SWServerJobQueue::runUpdateJob):
1024         (WebCore::SWServerJobQueue::rejectWithExceptionOnMainThread):
1025         (WebCore::SWServerJobQueue::resolveWithRegistrationOnMainThread):
1026         (WebCore::SWServerJobQueue::resolveCurrentRegistrationJobOnMainThead):
1027         (WebCore::SWServerJobQueue::resolveWithUnregistrationResultOnMainThread):
1028         (WebCore::SWServerJobQueue::startScriptFetchFromMainThread):
1029         (WebCore::SWServerJobQueue::rejectCurrentJob):
1030         (WebCore::SWServerJobQueue::resolveCurrentRegistrationJob):
1031         (WebCore::SWServerJobQueue::resolveCurrentUnregistrationJob):
1032         (WebCore::SWServerJobQueue::startScriptFetchForCurrentJob):
1033         (WebCore::SWServerJobQueue::finishCurrentJob):
1034         * workers/service/server/SWServerJobQueue.h: Added.
1035         * workers/service/server/SWServerRegistration.cpp:
1036         (WebCore::SWServerRegistration::SWServerRegistration):
1037         (WebCore::SWServerRegistration::~SWServerRegistration):
1038         (WebCore::SWServerRegistration::data const):
1039         * workers/service/server/SWServerRegistration.h:
1040         (WebCore::SWServerRegistration::key const):
1041         (WebCore::SWServerRegistration::isUninstalling const):
1042         (WebCore::SWServerRegistration::setIsUninstalling):
1043         (WebCore::SWServerRegistration::setLastUpdateTime):
1044         (WebCore::SWServerRegistration::updateViaCache const):
1045         (WebCore::SWServerRegistration::setActiveServiceWorkerIdentifier):
1046
1047 2017-11-01  Daniel Bates  <dabates@apple.com>
1048
1049         XMLHttpRequest should not sniff content encoding
1050         https://bugs.webkit.org/show_bug.cgi?id=175597
1051         <rdar://problem/34912624>
1052
1053         Reviewed by Alex Christensen.
1054
1055         Fixes an issue where the body of an HTTP response with headers "Content-Type: application/octet-stream" and
1056         "Content-Encoding: gzip" associated with an XHR request to a .gz file would not be automatically gzipped
1057         decompressed. Specifically, such a response would be treated analogous to a response with headers
1058         "Content-Type: application/gzip" and "Content-Encoding: identity". This behavior does not conform to the
1059         behavior of the Content-Encoding header as defined in the HTTP 1.1 and later specs. Moreover this behavior
1060         breaks the Epic Zen Garden demo: <https://s3.amazonaws.com/mozilla-games/ZenGarden/EpicZenGarden.html>.
1061
1062         On macOS 10.13.2 opt out of content encoding sniffing when making an XHR request. We likely can
1063         selectively opt out of content encoding sniffing for other network requests. This will be done
1064         in subsequent commits to make it straightforward to identify site breakage (if any).
1065
1066         * loader/ResourceLoader.cpp:
1067         (WebCore::ResourceLoader::start): Pass content encoding policy.
1068         * loader/ResourceLoader.h:
1069         (WebCore::ResourceLoader::shouldSniffContentEncoding const): Added.
1070         * loader/ResourceLoaderOptions.h:
1071         * loader/appcache/ApplicationCacheGroup.cpp:
1072         (WebCore::ApplicationCacheGroup::createResourceHandle): Enable content encoding sniff to match existing behavior.
1073         * platform/network/BlobResourceHandle.cpp:
1074         (WebCore::BlobResourceHandle::BlobResourceHandle): Ditto. We should look to disable content encoding sniffing in
1075         a subsequent change.
1076         * platform/network/PingHandle.h: Ditto.
1077         * platform/network/ResourceHandle.cpp:
1078         (WebCore::ResourceHandle::ResourceHandle): Modified to take a boolean as to whether to enable content encoding sniffing.
1079         (WebCore::ResourceHandle::create): Ditto.
1080         (WebCore::ResourceHandle::shouldContentEncodingSniff const): Added.
1081         * platform/network/ResourceHandle.h:
1082         * platform/network/ResourceHandleInternal.h:
1083         (WebCore::ResourceHandleInternal::ResourceHandleInternal): Modified to take a boolean as to whether to enable content
1084         encoding sniffing.
1085         * platform/network/cf/ResourceHandleCFNet.cpp:
1086         (WebCore::ResourceHandle::createCFURLConnection): Modified to take a boolean as to whether to enable content encoding
1087         sniffing and apply this policy to the CFMutableURLRequestRef object when building on macOS 10.13.2.
1088         (WebCore::ResourceHandle::start):
1089         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Enable content encoding sniff to match existing behavior.
1090         * platform/network/mac/ResourceHandleMac.mm:
1091         (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded): Added helper function to apply sniffing policies
1092         and storage partition, if applicable. 
1093         (WebCore::ResourceHandle::createNSURLConnection): Modified to take a boolean as to whether to enable content encoding
1094         sniffing. Calls adjustNSRequestApplyingPolicies() to apply this policy.
1095         (WebCore::ResourceHandle::start):
1096         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Enable content encoding sniff to match existing behavior.
1097         * platform/network/soup/ResourceHandleSoup.cpp:
1098         (WebCore::ResourceHandle::create): Modified to take a boolean as to whether to enable content encoding sniffing.
1099         (WebCore::ResourceHandle::ResourceHandle): Ditto.
1100         (WebCore::ResourceHandle::releaseForDownload): Pass content encoding policy.
1101         * xml/XMLHttpRequest.cpp:
1102         (WebCore::XMLHttpRequest::createRequest): Do not enable content encoding sniffing for the request.
1103
1104 2017-11-01  Jer Noble  <jer.noble@apple.com>
1105
1106         [Performance] Painting <video> to canvas spends a lot of time in URL getting and parsing
1107         https://bugs.webkit.org/show_bug.cgi?id=179131
1108
1109         Reviewed by Eric Carlson.
1110
1111         Every time a <video> backed by MediaPlayerPrivateAVFoundation is asked to paint, it is first
1112         queried whether it has a single security origin. To do this, the media player asks
1113         AVFoundation what the "resolvedURL" of the asset is. This answer never changes after
1114         metadata is first fetched, so the answer should be cached. To do so, add a m_resolvedURL
1115         ivar to MediaPlayerPrivateAVFoundation, and add a setResolvedURL() and resolvedURLChanged()
1116         method to re-query the value. Also create ivars for the security origin rather than re-
1117         parsing them every time.
1118
1119         Drive-by fix: clean up all the instances where we pass a String rather than a URL (and thus
1120         have to re-parse the URL at each point).
1121
1122         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1123         (WebCore::MediaPlayerPrivateAVFoundation::load):
1124         (WebCore::MediaPlayerPrivateAVFoundation::hasSingleSecurityOrigin const):
1125         (WebCore::MediaPlayerPrivateAVFoundation::setResolvedURL):
1126         (WebCore::MediaPlayerPrivateAVFoundation::metadataLoaded):
1127         (WebCore::MediaPlayerPrivateAVFoundation::setPreload):
1128         (WebCore::MediaPlayerPrivateAVFoundation::resolvedURL const): Deleted.
1129         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1130         (WebCore::MediaPlayerPrivateAVFoundation::resolvedURL const):
1131         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1132         (WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURLChanged):
1133         (WebCore::AVFWrapper::createAssetForURL):
1134         (WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURL const): Deleted.
1135         (WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin const): Deleted.
1136         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1137         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1138         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1139         (WebCore::canonicalURL):
1140         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1141         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
1142         (WebCore::canonicalURL):
1143         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin const): Deleted.
1144
1145 2017-11-01  Ryosuke Niwa  <rniwa@webkit.org>
1146
1147         innerText->renderBox() can be null in HTMLTextFormControlElement::setSelectionRange
1148         https://bugs.webkit.org/show_bug.cgi?id=179103
1149
1150         Reviewed by Antti Koivisto.
1151
1152         Added a missing null check.
1153
1154         Unfortunately, no new tests since we don't have a working reproduction for trunk code.
1155
1156         * html/HTMLTextFormControlElement.cpp:
1157         (WebCore::HTMLTextFormControlElement::setSelectionRange): Added a null check.
1158
1159 2017-11-01  Brady Eidson  <beidson@apple.com>
1160
1161         Plumbing for handling SW scripts failing to evaluate
1162         https://bugs.webkit.org/show_bug.cgi?id=178926
1163
1164         Reviewed by Chris Dumez.
1165
1166         No new tests (Currently no observable behavior change).
1167
1168         In an upcoming patch we'll actually run the appropriate observable steps for when
1169         a ServiceWorker script fails to evaluate.
1170
1171         This is a standalone refactoring + plumbing patch that will make the observable changes
1172         easier to review.
1173
1174         * bindings/js/WorkerScriptController.cpp:
1175         (WebCore::WorkerScriptController::evaluate):
1176         * bindings/js/WorkerScriptController.h:
1177         (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
1178         (WebCore::WorkerScriptController::vm):
1179         (WebCore::WorkerScriptController::initScriptIfNeeded):
1180
1181         * workers/WorkerMessagingProxy.cpp:
1182         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1183
1184         * workers/WorkerThread.cpp:
1185         (WebCore::WorkerThread::start):
1186         (WebCore::WorkerThread::workerThread):
1187         * workers/WorkerThread.h:
1188
1189         * workers/service/context/SWContextManager.cpp:
1190         (WebCore::SWContextManager::registerServiceWorkerThreadForUpdate):
1191         (WebCore::SWContextManager::registerServiceWorkerThread): Deleted.
1192         * workers/service/context/SWContextManager.h:
1193
1194         * workers/service/context/ServiceWorkerThread.h:
1195         (WebCore::ServiceWorkerThread::serverConnectionIdentifier const):
1196         (WebCore::ServiceWorkerThread::contextData const):
1197
1198         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1199         (WebCore::ServiceWorkerThreadProxy::create):
1200         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
1201
1202         * workers/service/server/SWServer.cpp:
1203         (WebCore::SWServer::updateWorker):
1204         (WebCore::SWServer::createWorker): Deleted.
1205         * workers/service/server/SWServer.h:
1206
1207         * workers/service/server/SWServerRegistration.cpp:
1208         (WebCore::SWServerRegistration::scriptFetchFinished):
1209         (WebCore::SWServerRegistration::scriptContextFailedToStart):
1210
1211 2017-11-01  Ryosuke Niwa  <rniwa@webkit.org>
1212
1213         Assert that NoEventDispatchAssertion is not in the stack when executing a script
1214         https://bugs.webkit.org/show_bug.cgi?id=179107
1215
1216         Reviewed by Simon Fraser.
1217
1218         Assert that NoEventDispatchAssertion::isEventAllowedInMainThread() is true when we're about to execute a script
1219         by adding the assertion in ScriptController::canExecuteScripts which gets called with AboutToExecuteScript
1220         whenever we're about to run scripts in event handlers, etc...
1221
1222         We don't assert the construction of event handlers in JSLazyEventListener since this happens while copying
1223         the DOM tree inside a SVG use element and creating a event handler's JS function won't execute arbitrary scripts.
1224
1225         No new tests since there should be no behavioral change other 
1226
1227         * bindings/js/JSLazyEventListener.cpp:
1228         (WebCore::JSLazyEventListener::initializeJSFunction const): Use newly added AboutToCreateEventListener.
1229         (WebCore::JSLazyEventListener::create): Ditto.
1230         * bindings/js/ScriptController.cpp:
1231         (WebCore::ScriptController::canExecuteScripts): Added the assertion.
1232         * bindings/js/ScriptController.h:
1233
1234 2017-11-01  Chris Dumez  <cdumez@apple.com>
1235
1236         Regression(r219659): Can no longer log into ifttt.com using Google account
1237         https://bugs.webkit.org/show_bug.cgi?id=179117
1238
1239         Reviewed by Geoffrey Garen.
1240
1241         After r219659, it is no longer possible to log into ifttt.com using a Google
1242         account:
1243         - Signed into a Google account already
1244         - Visit https://ifttt.com/login
1245         - Click "Continue with Google"
1246         - Select the signed in account
1247
1248         It turns out that this change to the HTML specification was not Web-compatible:
1249         See https://bugzilla.mozilla.org/show_bug.cgi?id=1412741 & https://github.com/whatwg/html/issues/3183
1250
1251         This patch reverts r219659 for now until we agree on what behavior should get
1252         specified.
1253
1254         No new tests, rebaselined existing tests.
1255
1256         * bindings/js/JSDOMWindowCustom.cpp:
1257         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1258         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1259         (WebCore::JSDOMWindow::getOwnPropertyNames):
1260         * bindings/js/JSLocationCustom.cpp:
1261         (WebCore::getOwnPropertySlotCommon):
1262         (WebCore::JSLocation::getOwnPropertyNames):
1263
1264 2017-10-31  Dean Jackson  <dino@apple.com>
1265
1266         transferFromImageBitmap should update canvas dimensions
1267         https://bugs.webkit.org/show_bug.cgi?id=179096
1268         <rdar://problem/35285218>
1269
1270         Reviewed by Sam Weinig.
1271
1272         When transferFromImageBitmap is called, the dimensions of the HTMLCanvasElement
1273         should be updated to reflect the size of the passed ImageBitmap.
1274
1275         Update an existing WPT result.
1276
1277         * html/HTMLCanvasElement.cpp:
1278         (WebCore::HTMLCanvasElement::setImageBuffer const): Update the
1279         size of the element based on the incoming buffer.
1280         * html/HTMLCanvasElement.h: Mark m_size as mutable so we can
1281         call it from the const function setImageBuffer.
1282
1283 2017-11-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1284
1285         [JSC] Introduce @toObject
1286         https://bugs.webkit.org/show_bug.cgi?id=178726
1287
1288         Reviewed by Saam Barati.
1289
1290         Use @isObject instead. It is more efficient.
1291
1292         * Modules/mediastream/NavigatorUserMedia.js:
1293         (getUserMedia):
1294
1295 2017-11-01  Commit Queue  <commit-queue@webkit.org>
1296
1297         Unreviewed, rolling out r224273 and r224278.
1298         https://bugs.webkit.org/show_bug.cgi?id=179120
1299
1300         Some crashes under guard malloc (Requested by anttik on
1301         #webkit).
1302
1303         Reverted changesets:
1304
1305         "Remove empty continuations in
1306         RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers"
1307         https://bugs.webkit.org/show_bug.cgi?id=179014
1308         https://trac.webkit.org/changeset/224273
1309
1310         "Fix ContinuationChainNode::insertAfter assertion."
1311         https://bugs.webkit.org/show_bug.cgi?id=179115
1312         https://trac.webkit.org/changeset/224278
1313
1314 2017-11-01  Emilio Cobos Álvarez  <emilio@crisal.io>
1315
1316         Fix ContinuationChainNode::insertAfter assertion.
1317         https://bugs.webkit.org/show_bug.cgi?id=179115
1318
1319         Reviewed by Antti Koivisto.
1320
1321         The assertion was writing instead of reading next->previous.
1322
1323         Hopefully it's harmless because it was clobbered on the same line, but
1324         it's worth asserting what it was intending to assert.
1325
1326         No new tests (no behaviour change).
1327
1328         * rendering/RenderBoxModelObject.cpp:
1329         (WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):
1330
1331 2017-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
1332
1333         Use LazyNeverDestroyed instead of DEFINE_GLOBAL
1334         https://bugs.webkit.org/show_bug.cgi?id=174979
1335
1336         Reviewed by Yusuke Suzuki.
1337
1338         No new tests since there should be no behavioral change.
1339
1340         * DerivedSources.cpp: Remove the warning of StaticConstructors.h.
1341         * WebCore.order: Removed
1342         * config.h: Removed definitions of SKIP_STATIC_CONSTRUCTORS_ON_MSVC and SKIP_STATIC_CONSTRUCTORS_ON_GCC.
1343         * dom/QualifiedName.cpp:
1344         (WebCore::createQualifiedName): Deleted.
1345         * dom/QualifiedName.h: Removed createQualifiedName.
1346         * dom/make_names.pl:
1347         (printCppHead): Do not include StaticConstructors.h.
1348
1349 2017-11-01  Michael Catanzaro  <mcatanzaro@igalia.com>
1350
1351         [GTK] Always include TextureMapper.cmake
1352         https://bugs.webkit.org/show_bug.cgi?id=179060
1353
1354         Reviewed by Carlos Garcia Campos.
1355
1356         * PlatformGTK.cmake:
1357
1358 2017-11-01  Antti Koivisto  <antti@apple.com>
1359
1360         Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers
1361         https://bugs.webkit.org/show_bug.cgi?id=179014
1362
1363         Reviewed by Geoff Garen.
1364
1365         Treat continuation similarly to other anonymous wrappers. This makes things more understandable
1366         and allows removal of some questionable code in RenderBlock::takeChild.
1367
1368         The patch also makes continuation chain a double linked so we can efficiently remove single
1369         continuations from the chain. It also gets rid of algorithms that recurse in continuation chain.
1370
1371         * accessibility/AccessibilityRenderObject.cpp:
1372         (WebCore::firstChildInContinuation):
1373         * rendering/RenderBlock.cpp:
1374         (WebCore::RenderBlock::styleDidChange):
1375
1376             Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
1377             the chain only in the (non-continuation) head renderer.
1378
1379         (WebCore::RenderBlock::dropAnonymousBoxChild):
1380
1381             Make a member function.
1382
1383         (WebCore::RenderBlock::takeChild):
1384
1385             Remove code that destroyed empty continuations and caused the parent to destroy itself.
1386             Empty continuations are now removed by RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers.
1387
1388         * rendering/RenderBlock.h:
1389         * rendering/RenderBoxModelObject.cpp:
1390         (WebCore::RenderBoxModelObject::ContinuationChainNode::ContinuationChainNode):
1391         (WebCore::RenderBoxModelObject::ContinuationChainNode::~ContinuationChainNode):
1392         (WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):
1393
1394             Track continuations with double linked lists.
1395
1396         (WebCore::continuationChainNodeMap):
1397         (WebCore::RenderBoxModelObject::willBeDestroyed):
1398
1399             Don't recurse to destroy continuation chain. 
1400             Destroy all continuations iteratively if this is the head of the chain.
1401             When destroying a continuation renderer simply remove it from the chain.
1402
1403         (WebCore::RenderBoxModelObject::continuation const):
1404         (WebCore::RenderBoxModelObject::insertIntoContinuationChainAfter):
1405         (WebCore::RenderBoxModelObject::removeFromContinuationChain):
1406         (WebCore::RenderBoxModelObject::ensureContinuationChainNode):
1407         (WebCore::continuationMap): Deleted.
1408         (WebCore::RenderBoxModelObject::setContinuation): Deleted.
1409         * rendering/RenderBoxModelObject.h:
1410         * rendering/RenderElement.cpp:
1411         (WebCore::RenderElement::RenderElement):
1412         (WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary):
1413
1414             Make this a function of the parent renderer itself instead of getting 'parent()' as first operation and
1415             then using it.
1416             Don't remove continuations (isAnonymousBlockContinuation() test gives wrong result for the last continuation of the chain).
1417
1418         (WebCore::RenderElement::styleDidChange):
1419
1420             removeAnonymousWrappersForInlinesIfNecessary is no function of the parent.
1421
1422         (WebCore::RenderElement::updateOutlineAutoAncestor):
1423         * rendering/RenderElement.h:
1424         (WebCore::RenderElement::hasContinuationChainNode const):
1425         (WebCore::RenderElement::setHasContinuationChainNode):
1426         (WebCore::RenderElement::hasContinuation const): Deleted.
1427         (WebCore::RenderElement::setHasContinuation): Deleted.
1428         * rendering/RenderInline.cpp:
1429         (WebCore::RenderInline::styleDidChange):
1430
1431             Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
1432             the chain only in the (non-continuation) head renderer.
1433
1434         (WebCore::RenderInline::addChildIgnoringContinuation):
1435
1436             Remove the old continuation from the chain. splitFlow() will add it back into the right place.
1437
1438         (WebCore::RenderInline::splitInlines):
1439         (WebCore::RenderInline::addChildToContinuation):
1440         (WebCore::RenderInline::childBecameNonInline):
1441
1442             Remove the old continuation from the chain. splitFlow() will add it back into the right place.
1443
1444         * rendering/RenderInline.h:
1445         * rendering/RenderObject.cpp:
1446         (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const):
1447         (WebCore::RenderObject::outputRenderObject const):
1448         (WebCore::findDestroyRootIncludingAnonymous):
1449
1450             Allow anonymous continuations as destroy roots.
1451
1452         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
1453
1454             Removing a continuation may leave behind unnecessary anonymous sibling wrappers.
1455             Call removeAnonymousWrappersForInlinesIfNecessary() on parent after removal to get rid of them.
1456
1457 2017-10-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
1458
1459         updateMaskedAncestorShouldIsolateBlending() should check the Nullability of the computedStyle() of the element's ancestors
1460         https://bugs.webkit.org/show_bug.cgi?id=179085
1461         <rdar://problem/30888101>
1462
1463         Reviewed by Ryosuke Niwa.
1464
1465         This is a defensive change. The Element::computedStyle() can be null only
1466         if the element is not a connected to the DOM tree. This may happen if
1467         while the DOM tree is being changed, a different event is handled such
1468         that it requires styleReclac()/layout() to happen. In this case, the render
1469         tree will be in an incorrect state.
1470
1471         * rendering/svg/SVGRenderSupport.cpp:
1472         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
1473
1474 2017-10-31  Alex Christensen  <achristensen@webkit.org>
1475
1476         Use asynchronous ResourceHandleClient calls for WebKit1
1477         https://bugs.webkit.org/show_bug.cgi?id=160677
1478
1479         Reviewed by Brady Eidson.
1480
1481         Covered by existing tests.
1482
1483         * PlatformAppleWin.cmake:
1484         * PlatformMac.cmake:
1485         * WebCore.xcodeproj/project.pbxproj:
1486         * loader/ResourceLoader.cpp:
1487         (WebCore::ResourceLoader::willSendRequestAsync):
1488         (WebCore::ResourceLoader::didReceiveResponseAsync):
1489         (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
1490         * loader/ResourceLoader.h:
1491         * loader/appcache/ApplicationCacheGroup.cpp:
1492         (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
1493         (WebCore::ApplicationCacheGroup::willSendRequestAsync):
1494         (WebCore::ApplicationCacheGroup::canAuthenticateAgainstProtectionSpaceAsync):
1495         (WebCore::ApplicationCacheGroup::didReceiveResponse): Deleted.
1496         * loader/appcache/ApplicationCacheGroup.h:
1497         * platform/network/BlobResourceHandle.cpp:
1498         (WebCore::BlobResourceHandle::continueDidReceiveResponse):
1499         (WebCore::BlobResourceHandle::getSizeForNext):
1500         (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
1501         (WebCore::BlobResourceHandle::notifyResponseOnError):
1502         * platform/network/PingHandle.h:
1503         * platform/network/ResourceHandle.cpp:
1504         (WebCore::ResourceHandle::didReceiveResponse):
1505         (WebCore::ResourceHandle::usesAsyncCallbacks): Deleted.
1506         * platform/network/ResourceHandle.h:
1507         * platform/network/ResourceHandleClient.cpp:
1508         (WebCore::ResourceHandleClient::~ResourceHandleClient):
1509         (WebCore::ResourceHandleClient::willSendRequest): Deleted.
1510         (WebCore::ResourceHandleClient::willSendRequestAsync): Deleted.
1511         (WebCore::ResourceHandleClient::didReceiveResponseAsync): Deleted.
1512         (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
1513         * platform/network/ResourceHandleClient.h:
1514         (WebCore::ResourceHandleClient::didReceiveAuthenticationChallenge):
1515         (WebCore::ResourceHandleClient::didReceiveResponse): Deleted.
1516         (WebCore::ResourceHandleClient::usesAsyncCallbacks): Deleted.
1517         (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpace): Deleted.
1518         * platform/network/ResourceHandleInternal.h:
1519         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
1520         * platform/network/SynchronousLoaderClient.cpp:
1521         (WebCore::SynchronousLoaderClient::willSendRequestAsync):
1522         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
1523         (WebCore::SynchronousLoaderClient::didReceiveResponseAsync):
1524         (WebCore::SynchronousLoaderClient::didFinishLoading):
1525         (WebCore::SynchronousLoaderClient::didFail):
1526         (WebCore::SynchronousLoaderClient::willSendRequest): Deleted.
1527         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace): Deleted.
1528         (WebCore::SynchronousLoaderClient::didReceiveResponse): Deleted.
1529         * platform/network/SynchronousLoaderClient.h:
1530         * platform/network/cf/ResourceHandleCFNet.cpp:
1531         (WebCore::ResourceHandle::createCFURLConnection):
1532         (WebCore::ResourceHandle::start):
1533         (WebCore::ResourceHandle::willSendRequest):
1534         (WebCore::ResourceHandle::shouldUseCredentialStorage):
1535         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
1536         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1537         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1538         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::ResourceHandleCFURLConnectionDelegateWithOperationQueue):
1539         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle):
1540         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
1541         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1542         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
1543         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
1544         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
1545         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1546         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
1547         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
1548         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::shouldUseCredentialStorage):
1549         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1550         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueCanAuthenticateAgainstProtectionSpace):
1551         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
1552         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Removed.
1553         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: Removed.
1554         * platform/network/mac/ResourceHandleMac.mm:
1555         (WebCore::ResourceHandle::start):
1556         (WebCore::ResourceHandle::schedule):
1557         (WebCore::ResourceHandle::makeDelegate):
1558         (WebCore::ResourceHandle::delegate):
1559         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1560         (WebCore::ResourceHandle::willSendRequest):
1561         (WebCore::ResourceHandle::continueWillSendRequest):
1562         (WebCore::ResourceHandle::continueDidReceiveResponse):
1563         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
1564         (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace):
1565         (WebCore::ResourceHandle::continueWillCacheResponse):
1566         (WebCore::ResourceHandle::shouldUseCredentialStorage): Deleted.
1567         * platform/network/mac/WebCoreResourceHandleAsDelegate.h: Removed.
1568         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Removed.
1569         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
1570         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1571         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
1572         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
1573         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
1574         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
1575         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
1576         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
1577         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
1578         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
1579
1580 2017-10-31  Simon Fraser  <simon.fraser@apple.com>
1581
1582         Rubber-banding overflow-scrolling-touch shows black
1583         https://bugs.webkit.org/show_bug.cgi?id=179087
1584         rdar://problem/35260253
1585
1586         Reviewed by Sam Weinig.
1587
1588         The "backgroundIsKnownToBeObscured" optimization was kicking in for an overflow:scroll
1589         whose area was completely covered by its contents, which happens with overlay scrollbars.
1590
1591         However, this ignored the fact that you can rubber-band to reveal the background, and,
1592         on iOS, composited scrolling requires that the scroller background is painted since it goes
1593         into its own layer.
1594
1595         Fix by turning off the optimization for layers that scroll overflow, including those
1596         using composited scrolling.
1597
1598         Test: fast/scrolling/rubber-band-shows-background.html
1599
1600         * rendering/RenderBox.cpp:
1601         (WebCore::RenderBox::foregroundIsKnownToBeOpaqueInRect const):
1602         (WebCore::RenderBox::computeBackgroundIsKnownToBeObscured):
1603         * rendering/RenderLayer.cpp:
1604         (WebCore::RenderLayer::scrollTo):
1605         (WebCore::RenderLayer::calculateClipRects const):
1606         * rendering/RenderLayer.h:
1607
1608 2017-10-31  Tim Horton  <timothy_horton@apple.com>
1609
1610         Clean up some drag and drop feature flags
1611         https://bugs.webkit.org/show_bug.cgi?id=179082
1612
1613         Reviewed by Simon Fraser.
1614
1615         * Configurations/FeatureDefines.xcconfig:
1616
1617 2017-10-31  Simon Fraser  <simon.fraser@apple.com>
1618
1619         Make it possible to test rubber-banding in overflow scroll
1620         https://bugs.webkit.org/show_bug.cgi?id=179078
1621
1622         Reviewed by Sam Weinig.
1623
1624         Test: fast/scrolling/unconstrained-scrollto.html
1625         
1626         Add internals.unconstrainedScrollTo(element, x, y) and plumb through ScrollClamping
1627         (which replaces RenderLayer::ScrollOffsetClamping) to support it.
1628
1629         Flip the default from unclamped to clamped for various RenderLayer scrolling-related
1630         functions, since most callers want clamped.
1631
1632         * accessibility/AccessibilityRenderObject.cpp:
1633         (WebCore::AccessibilityRenderObject::scrollTo const):
1634         * dom/Element.cpp:
1635         (WebCore::Element::scrollTo):
1636         * dom/Element.h:
1637         * html/HTMLBodyElement.cpp:
1638         (WebCore::HTMLBodyElement::scrollTo):
1639         * html/HTMLBodyElement.h:
1640         * html/TextFieldInputType.cpp:
1641         (WebCore::TextFieldInputType::elementDidBlur):
1642         * page/DOMWindow.cpp:
1643         (WebCore::DOMWindow::scrollTo const):
1644         * page/DOMWindow.h:
1645         * page/Frame.cpp:
1646         (WebCore::Frame::scrollOverflowLayer):
1647         (WebCore::Frame::checkOverflowScroll):
1648         * platform/ScrollAnimator.cpp:
1649         (WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation):
1650         * platform/ScrollAnimator.h:
1651         * platform/ScrollTypes.h:
1652         * platform/ScrollableArea.cpp:
1653         (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
1654         * platform/ScrollableArea.h:
1655         * platform/cocoa/ScrollController.h:
1656         * platform/mac/ScrollAnimatorMac.h:
1657         * platform/mac/ScrollAnimatorMac.mm:
1658         (WebCore::ScrollAnimatorMac::scrollToOffsetWithoutAnimation):
1659         (WebCore::ScrollAnimatorMac::immediateScrollToPosition):
1660         * platform/mock/ScrollAnimatorMock.h:
1661         * rendering/RenderBox.cpp:
1662         (WebCore::RenderBox::setScrollLeft):
1663         (WebCore::RenderBox::setScrollTop):
1664         * rendering/RenderBox.h:
1665         * rendering/RenderLayer.cpp:
1666         (WebCore::RenderLayer::panScrollFromPoint):
1667         (WebCore::RenderLayer::scrollByRecursively):
1668         (WebCore::RenderLayer::applyPostLayoutScrollPositionIfNeeded):
1669         (WebCore::RenderLayer::scrollToXPosition):
1670         (WebCore::RenderLayer::scrollToYPosition):
1671         (WebCore::RenderLayer::scrollToOffset):
1672         * rendering/RenderLayer.h:
1673         * rendering/RenderListBox.cpp:
1674         (WebCore::RenderListBox::setScrollLeft):
1675         (WebCore::RenderListBox::setScrollTop):
1676         * rendering/RenderListBox.h:
1677         * rendering/RenderTextControlSingleLine.cpp:
1678         (WebCore::RenderTextControlSingleLine::setScrollLeft):
1679         (WebCore::RenderTextControlSingleLine::setScrollTop):
1680         * rendering/RenderTextControlSingleLine.h:
1681         * testing/Internals.cpp:
1682         (WebCore::Internals::unconstrainedScrollTo):
1683         * testing/Internals.h:
1684         * testing/Internals.idl:
1685
1686 2017-10-31  Dean Jackson  <dino@apple.com>
1687
1688         Accept Settings object in ImageBitmapRenderingContext constructor and getContext
1689         https://bugs.webkit.org/show_bug.cgi?id=179075
1690         <rdar://problem/35279965>
1691
1692         Reviewed by Sam Weinig.
1693
1694         Allow getContext("bitmaprenderer") to take a dictionary as another argument, and
1695         pass that on to the ImageBitmapRenderingContext constructor.
1696
1697         Unfortunately this meant having to move ImageBitmapRenderingContext::Settings out into
1698         a stand-alone struct, since it needs to be defined in HTMLCanvasElement, which itself
1699         needs to be defined for ImageBitmapRenderingContext.
1700
1701         * DerivedSources.make: Add new IDL.
1702         * WebCore.xcodeproj/project.pbxproj: New files.
1703
1704         * html/HTMLCanvasElement.cpp:
1705         (WebCore::HTMLCanvasElement::createContextBitmapRenderer):
1706         (WebCore::HTMLCanvasElement::getContextBitmapRenderer):
1707
1708             Accept the ImageBitmapRenderingContextSettings object, and pass it on.
1709
1710         * html/HTMLCanvasElement.h:
1711         * html/canvas/ImageBitmapRenderingContext.cpp:
1712         (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
1713         * html/canvas/ImageBitmapRenderingContext.h:
1714         * html/canvas/ImageBitmapRenderingContext.idl:
1715         * html/canvas/ImageBitmapRenderingContextSettings.h: Copied from Source/WebCore/html/canvas/ImageBitmapRenderingContext.idl.
1716         * html/canvas/ImageBitmapRenderingContextSettings.idl: Added.
1717
1718 2017-10-31  Tim Horton  <timothy_horton@apple.com>
1719
1720         Fix up some content filtering feature flags
1721         https://bugs.webkit.org/show_bug.cgi?id=179079
1722
1723         Reviewed by Simon Fraser.
1724
1725         * Configurations/FeatureDefines.xcconfig:
1726
1727 2017-10-31  Chris Dumez  <cdumez@apple.com>
1728
1729         navigator.serviceWorker should always return the same object
1730         https://bugs.webkit.org/show_bug.cgi?id=179067
1731
1732         Reviewed by Youenn Fablet.
1733
1734         navigator.serviceWorker should always return the same object:
1735         - https://www.w3.org/TR/service-workers-1/#navigator-service-worker
1736
1737         Add visitor to make sure we don't gc() the ServiceWorkerContainer wrapper too early.
1738
1739         Test: http/tests/workers/service/navigator-serviceWorker-same-object.html
1740
1741         * Sources.txt:
1742         * WebCore.xcodeproj/project.pbxproj:
1743         * bindings/js/JSNavigatorCustom.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerContainer.idl.
1744         (WebCore::JSNavigator::visitAdditionalChildren):
1745         * page/Navigator.idl:
1746         * workers/service/ServiceWorkerContainer.idl:
1747
1748 2017-10-31  Antoine Quint  <graouts@apple.com>
1749
1750         [Web Animations] Support AnimationEffect parameter in Animation constructor and read-write timeline property
1751         https://bugs.webkit.org/show_bug.cgi?id=179066
1752
1753         Reviewed by Dean Jackson.
1754
1755         We update the Animation constructor signature and behavior to allow for an AnimationEffect as its first,
1756         null by default, parameter and implement the spec behavior where an omitted AnimationTimeline parameter
1757         should default to the document timeline. We also make the timeline property read-write.
1758
1759         Existing tests are rebaselined and amended for this new behavior.
1760
1761         * animation/WebAnimation.cpp:
1762         (WebCore::WebAnimation::create):
1763         (WebCore::WebAnimation::WebAnimation):
1764         (WebCore::WebAnimation::setEffect):
1765         (WebCore::WebAnimation::setTimeline):
1766         * animation/WebAnimation.h:
1767         * animation/WebAnimation.idl:
1768
1769 2017-10-31  Ali Juma  <ajuma@chromium.org>
1770
1771         Layout viewport rect is too wide after window resize
1772         https://bugs.webkit.org/show_bug.cgi?id=175235
1773
1774         Reviewed by Dave Hyatt.
1775
1776         After a window resize, ScrollView::updateScrollbars adds/removes scrollbars and triggers
1777         layout. Each addition or removal triggers another pass, but at most 2 additional passes
1778         are allowed. If a scrollbar is added or removed in the final allowed pass, layout is
1779         left in an inconsistent state wrt the presence of scrollbars.
1780
1781         To avoid unnecessary passes, don't remove both scrollbars when only one needs to be
1782         removed. This saves the extra pass needed to add the scrollbar back.
1783
1784         Test: fast/dom/Window/window-resize-update-scrollbars.html
1785
1786         * platform/ScrollView.cpp:
1787         (WebCore::ScrollView::updateScrollbars):
1788
1789 2017-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1790
1791         [Attachment Support] Implement WKWebView SPI for inserting attachment elements
1792         https://bugs.webkit.org/show_bug.cgi?id=179013
1793         <rdar://problem/35249668>
1794
1795         Reviewed by Tim Horton.
1796
1797         Adds Editor helper methods to insert an attachment element at the current selection.
1798
1799         Test: WKAttachmentTests.AttachmentElementInsertion
1800
1801         * editing/Editor.cpp:
1802         (WebCore::Editor::insertAttachment):
1803         (WebCore::Editor::insertAttachmentFromFile):
1804         * editing/Editor.h:
1805
1806         Add two new helpers for inserting attachment elements, either from a filename or a data blob. This is a wrapper
1807         around Editor::replaceSelectionWithFragment.
1808
1809         * html/HTMLAttachmentElement.cpp:
1810         (WebCore::HTMLAttachmentElement::HTMLAttachmentElement):
1811         (WebCore::HTMLAttachmentElement::create):
1812         * html/HTMLAttachmentElement.h:
1813
1814         Add a unique identifier string to HTMLAttachmentElement. This unique identifier allows the UI process to
1815         reference and indirectly manipulate attachment elements.
1816
1817 2017-10-31  Alex Christensen  <achristensen@webkit.org>
1818
1819         Fix custom header field setting with reloads and asynchronous navigation action policy decisions
1820         https://bugs.webkit.org/show_bug.cgi?id=179064
1821
1822         Reviewed by Tim Horton.
1823
1824         r223909 had two problems:
1825         1. It called addHTTPHeaderField instead of setHTTPHeaderField, so when a page is reloaded the header field
1826         is added to the resource request to be reloaded, which already had the headers added.
1827         2. It only worked in the synchronous decidePolicyForNavigationAction code path, not for asynchronous completion handlers.
1828
1829         These are both fixed, and both cases are covered with new API tests.
1830
1831         * loader/cache/CachedResourceLoader.cpp:
1832         (WebCore::CachedResourceLoader::requestResource):
1833
1834 2017-10-31  Devin Rousso  <webkit@devinrousso.com>
1835
1836         Web Inspector: make ScriptCallStack::maxCallStackSizeToCapture the default value when capturing backtraces
1837         https://bugs.webkit.org/show_bug.cgi?id=179048
1838
1839         Reviewed by Mark Lam.
1840
1841         No change in functionality.
1842
1843         * bindings/js/JSDOMExceptionHandling.cpp:
1844         (WebCore::reportException):
1845         * dom/RejectedPromiseTracker.cpp:
1846         (WebCore::createScriptCallStackFromReason):
1847         * html/canvas/WebGLRenderingContextBase.cpp:
1848         (WebCore::WebGLRenderingContextBase::compileShader):
1849         (WebCore::WebGLRenderingContextBase::printToConsole):
1850         * inspector/InspectorNetworkAgent.cpp:
1851         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
1852         * inspector/PageDebuggerAgent.cpp:
1853         (WebCore::PageDebuggerAgent::breakpointActionLog):
1854         * inspector/WorkerDebuggerAgent.cpp:
1855         (WebCore::WorkerDebuggerAgent::breakpointActionLog):
1856         * page/DOMWindow.cpp:
1857         (WebCore::DOMWindow::postMessage):
1858
1859 2017-10-31  Michael Catanzaro  <mcatanzaro@igalia.com>
1860
1861         [GTK] Build more files under WebCore as unified sources
1862         https://bugs.webkit.org/show_bug.cgi?id=178968
1863
1864         Reviewed by Keith Miller.
1865
1866         * PlatformGTK.cmake:
1867         * PlatformWPE.cmake:
1868         * SourcesGTK.txt: Added.
1869         * SourcesWPE.txt:
1870
1871 2017-10-30  Ryosuke Niwa  <rniwa@webkit.org>
1872
1873         Assert that no script is executed during LayoutPhase::InRenderTreeLayout
1874         https://bugs.webkit.org/show_bug.cgi?id=179046
1875
1876         Reviewed by Antti Koivisto.
1877
1878         Added NoEventDispatchAssertion to LayoutPhase::InRenderTreeLayout.
1879
1880         * page/LayoutContext.cpp:
1881         (WebCore::LayoutContext::layout):
1882
1883 2017-10-31  Devin Rousso  <webkit@devinrousso.com>
1884
1885         Web Inspector: replace Canvas stack iteration with createScriptCallStack
1886         https://bugs.webkit.org/show_bug.cgi?id=178980
1887
1888         Reviewed by Joseph Pecoraro.
1889
1890         No new tests, updated existing tests.
1891
1892         * inspector/InspectorCanvas.cpp:
1893         (WebCore::InspectorCanvas::buildObjectForCanvas):
1894         (WebCore::InspectorCanvas::buildAction):
1895         (WebCore::iterateCallFrames): Deleted.
1896
1897 2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1898
1899         [FreeType] Simple and complex paths are not applied consistently
1900         https://bugs.webkit.org/show_bug.cgi?id=177601
1901
1902         Reviewed by Michael Catanzaro.
1903
1904         Due to bug #100050, when rendering text, the complex path is forced in case kerning or shaping is enabled and
1905         only part of the run is going to be rendered. This happens in the GTK+ port when selecting text (except when
1906         selecting the whole run, of course). The text is initially rendered using the simple path as returned by
1907         FontCascade::codePath() and then the selection is rendered using the complex path, overriding what
1908         FontCascade::codePath() returned in that case. This doesn't happen in mac, because the selection is rendered
1909         differently, so FontCascade::drawText always renders the full run (simple path) when selecting text. Selecting
1910         text is the most noticeable inconsistency, but it's not the only one. Similar exceptions are applied when
1911         calculating the text width, or getting the offset of a given position. The rendered text is the simple one, but
1912         the calculations are performed using the complex path, so depending on the kerning and ligatures we might end up
1913         with wrong results. If the text has been rendered using the simple path, the selections and all other
1914         calculations should be performed with the simple path too. This patch moves the condition to force complex text
1915         to FontCascade::codePath(), and only for non Freetype ports. This ensures that all callers to
1916         FontCascade::codePath() will get a consistent result.
1917
1918         * platform/graphics/FontCascade.cpp:
1919         (WebCore::FontCascade::drawText const): Use the mode returned by codePath().
1920         (WebCore::FontCascade::drawEmphasisMarks const): Ditto.
1921         (WebCore::FontCascade::adjustSelectionRectForText const): Use the mode returned by codePath().
1922         (WebCore::FontCascade::offsetForPosition const): Ditto.
1923         (WebCore::FontCascade::codePath const): Force complex text for partial runs for ports not enabling advance text
1924         rendering mode by default.
1925         * platform/graphics/FontCascade.h: Add to and from optional parameters to codePath().
1926
1927 2017-10-30  Chris Dumez  <cdumez@apple.com>
1928
1929         Fire updatefound event after resolving the registration promise
1930         https://bugs.webkit.org/show_bug.cgi?id=178985
1931
1932         Reviewed by Youenn Fablet.
1933
1934         Fake series of events that are supposed to happen after registering a service worker
1935         that notify the page of the service worker's installation and activation.
1936
1937         Also make sure that registration.installing / waiting / active return proper values.
1938         Make sure that serviceWorker.scriptURL returns a proper value.
1939
1940         This unblocks a lot of web-platform-tests since they were blocked shortly after
1941         registration due to missing events or registration.installing being null.
1942
1943         * dom/ScriptExecutionContext.cpp:
1944         (WebCore::ScriptExecutionContext::activeServiceWorker const):
1945         (WebCore::ScriptExecutionContext::setActiveServiceWorker):
1946         * dom/ScriptExecutionContext.h:
1947         * loader/WorkerThreadableLoader.cpp:
1948         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1949         * loader/cache/CachedResourceLoader.cpp:
1950         (WebCore::CachedResourceLoader::prepareFetch):
1951         * workers/WorkerScriptLoader.cpp:
1952         (WebCore::WorkerScriptLoader::loadSynchronously):
1953         (WebCore::WorkerScriptLoader::loadAsynchronously):
1954         * workers/service/ServiceWorker.cpp:
1955         (WebCore::ServiceWorker::ServiceWorker):
1956         (WebCore::ServiceWorker::setState):
1957         * workers/service/ServiceWorker.h:
1958         * workers/service/ServiceWorkerContainer.cpp:
1959         (WebCore::ServiceWorkerContainer::controller const):
1960         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1961         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
1962         * workers/service/ServiceWorkerContainer.h:
1963         * workers/service/ServiceWorkerRegistration.cpp:
1964         (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
1965         (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
1966         (WebCore::ServiceWorkerRegistration::installing):
1967         (WebCore::ServiceWorkerRegistration::waiting):
1968         (WebCore::ServiceWorkerRegistration::active):
1969         * workers/service/ServiceWorkerRegistration.h:
1970         * workers/service/ServiceWorkerRegistrationData.cpp:
1971         (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
1972         * workers/service/ServiceWorkerRegistrationData.h:
1973         (WebCore::ServiceWorkerRegistrationData::encode const):
1974         (WebCore::ServiceWorkerRegistrationData::decode):
1975         * workers/service/server/SWClientConnection.cpp:
1976         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
1977         * workers/service/server/SWServerRegistration.cpp:
1978         (WebCore::SWServerRegistration::scriptContextStarted):
1979         (WebCore::SWServerRegistration::runRegisterJob):
1980         (WebCore::SWServerRegistration::data const):
1981         * workers/service/server/SWServerRegistration.h:
1982
1983 2017-10-30  Fujii Hironori  <Hironori.Fujii@sony.com>
1984
1985         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames
1986         https://bugs.webkit.org/show_bug.cgi?id=175118
1987
1988         Reviewed by Alex Christensen.
1989
1990         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
1991
1992         No new tests since there should be no behavioral change.
1993
1994         * dom/make_names.pl:
1995         (printConstructors):
1996         (printNamesHeaderFile):
1997         (printNamesCppFile):
1998         (printDefinitions):
1999         * accessibility/AccessibilityRenderObject.cpp:
2000         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
2001         * css/StyleResolver.cpp:
2002         (WebCore::hasEffectiveDisplayNoneForDisplayContents):
2003         * dom/CustomElementReactionQueue.cpp:
2004         (WebCore::CustomElementReactionQueue::observesStyleAttribute const):
2005         * dom/Document.cpp:
2006         (WebCore::Document::validateCustomElementName):
2007         * dom/Element.cpp:
2008         (WebCore::isStyleAttribute):
2009         (WebCore::canAttachAuthorShadowRoot):
2010         * dom/ElementData.cpp:
2011         (WebCore::ElementData::findLanguageAttribute const):
2012         * domjit/JSDocumentDOMJIT.cpp:
2013         (WebCore::compileDocumentBodyAttribute):
2014         * editing/Editor.cpp:
2015         (WebCore::Editor::applyEditingStyleToBodyElement const):
2016         * editing/EditorCommand.cpp:
2017         (WebCore::valueDefaultParagraphSeparator):
2018         * editing/MarkupAccumulator.cpp:
2019         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
2020         (WebCore::MarkupAccumulator::appendNamespace):
2021         (WebCore::MarkupAccumulator::elementCannotHaveEndTag):
2022         * editing/ReplaceSelectionCommand.cpp:
2023         (WebCore::isProhibitedParagraphChild):
2024         * html/HTMLBodyElement.cpp:
2025         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
2026         * html/HTMLDocument.cpp:
2027         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
2028         * html/HTMLElement.cpp:
2029         (WebCore::HTMLElement::createEventHandlerNameMap):
2030         * html/parser/HTMLConstructionSite.cpp:
2031         (WebCore::HTMLConstructionSite::findFosterSite):
2032         * html/parser/HTMLElementStack.cpp:
2033         (WebCore::HTMLElementStack::hasTemplateInHTMLScope const):
2034         * html/parser/HTMLPreloadScanner.cpp:
2035         (WebCore::TokenPreloadScanner::updatePredictedBaseURL):
2036         * html/parser/HTMLTreeBuilder.cpp:
2037         (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
2038         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
2039         (WebCore::HTMLTreeBuilder::processTemplateEndTag):
2040         (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
2041         (WebCore::HTMLTreeBuilder::processStartTag):
2042         (WebCore::HTMLTreeBuilder::processBodyEndTagForInBody):
2043         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
2044         (WebCore::HTMLTreeBuilder::processCaptionEndTagForInCaption):
2045         (WebCore::HTMLTreeBuilder::processTableEndTagForInTable):
2046         (WebCore::HTMLTreeBuilder::processEndTag):
2047         (WebCore::HTMLTreeBuilder::insertPhoneNumberLink):
2048         (WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
2049         (WebCore::HTMLTreeBuilder::defaultForBeforeHead):
2050         (WebCore::HTMLTreeBuilder::defaultForInHead):
2051         (WebCore::HTMLTreeBuilder::defaultForInHeadNoscript):
2052         (WebCore::HTMLTreeBuilder::defaultForAfterHead):
2053         * html/parser/TextDocumentParser.cpp:
2054         (WebCore::TextDocumentParser::insertFakePreElement):
2055         * rendering/svg/SVGPathData.cpp:
2056         (WebCore::pathFromGraphicsElement):
2057         * rendering/svg/SVGResources.cpp:
2058         (WebCore::clipperFilterMaskerTags):
2059         (WebCore::markerTags):
2060         (WebCore::fillAndStrokeTags):
2061         (WebCore::chainableResourceTags):
2062         * svg/SVGAnimatedBoolean.h:
2063         * svg/SVGAnimatedEnumeration.h:
2064         * svg/SVGAnimatedInteger.h:
2065         * svg/SVGAnimatedLength.h:
2066         * svg/SVGAnimatedLengthList.h:
2067         * svg/SVGAnimatedNumber.h:
2068         * svg/SVGAnimatedNumberList.h:
2069         * svg/SVGAnimatedPreserveAspectRatio.h:
2070         * svg/SVGAnimatedRect.h:
2071         * svg/SVGAnimatedString.h:
2072         * svg/SVGAnimatedTransformList.h:
2073         * svg/SVGAnimationElement.cpp:
2074         (WebCore::SVGAnimationElement::isSupportedAttribute):
2075         * svg/SVGCursorElement.cpp:
2076         (WebCore::SVGCursorElement::isSupportedAttribute):
2077         * svg/SVGElement.cpp:
2078         (WebCore::createAttributeNameToCSSPropertyIDMap):
2079         (WebCore::SVGElement::childShouldCreateRenderer const):
2080         (WebCore::SVGElement::animatableAttributeForName):
2081         * svg/SVGFilterElement.cpp:
2082         (WebCore::SVGFilterElement::isSupportedAttribute):
2083         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
2084         (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute):
2085         * svg/SVGForeignObjectElement.cpp:
2086         (WebCore::SVGForeignObjectElement::isSupportedAttribute):
2087         * svg/SVGGradientElement.cpp:
2088         (WebCore::SVGGradientElement::isSupportedAttribute):
2089         * svg/SVGImageElement.cpp:
2090         (WebCore::SVGImageElement::isSupportedAttribute):
2091         * svg/SVGLineElement.cpp:
2092         (WebCore::SVGLineElement::isSupportedAttribute):
2093         * svg/SVGMarkerElement.cpp:
2094         (WebCore::SVGMarkerElement::isSupportedAttribute):
2095         * svg/SVGMaskElement.cpp:
2096         (WebCore::SVGMaskElement::isSupportedAttribute):
2097         * svg/SVGPathElement.cpp:
2098         (WebCore::SVGPathElement::dPropertyInfo):
2099         (WebCore::SVGPathElement::isSupportedAttribute):
2100         * svg/SVGPatternElement.cpp:
2101         (WebCore::SVGPatternElement::isSupportedAttribute):
2102         * svg/SVGPolyElement.cpp:
2103         (WebCore::SVGPolyElement::pointsPropertyInfo):
2104         * svg/SVGRadialGradientElement.cpp:
2105         (WebCore::SVGRadialGradientElement::isSupportedAttribute):
2106         * svg/SVGTextContentElement.cpp:
2107         (WebCore::SVGTextContentElement::textLengthPropertyInfo):
2108         (WebCore::SVGTextContentElement::isSupportedAttribute):
2109         * svg/SVGTextPathElement.cpp:
2110         (WebCore::SVGTextPathElement::isSupportedAttribute):
2111         * svg/SVGUseElement.cpp:
2112         (WebCore::createAllowedElementSet):
2113         * xml/NativeXPathNSResolver.cpp:
2114         (WebCore::NativeXPathNSResolver::lookupNamespaceURI):
2115         * xml/parser/XMLDocumentParser.cpp:
2116         (WebCore::XMLDocumentParser::parseDocumentFragment):
2117
2118 2017-10-30  Jer Noble  <jer.noble@apple.com>
2119
2120         [WebGL] Optimization to skip painting if texture and source surface hasn't changed isn't working; re-optimize.
2121         https://bugs.webkit.org/show_bug.cgi?id=178953
2122
2123         Reviewed by Dean Jackson.
2124
2125         The "seed" value of the current bound texture never matches the last saved value in
2126         VideoTextureCopierCV::copyImageToPlatformTexture(). The value is modified by the function
2127         itself, so a fresh value needs to be re-queried after the image's surface is attached to the
2128         texture.
2129
2130         Once this fix is in, however, the <canvas> being painted will flash when no new image is
2131         available. This is because the wrong texture target is being restored by the GC3DStateSaver
2132         at the end of copyImageToPlatformTexture(). While we're fixing that, we may as well use the
2133         texture state saved by the GraphicsContext3D itself to restore the correct texture unit,
2134         texture target, and texture.
2135
2136         * platform/graphics/GraphicsContext3D.h:
2137         (WebCore::GraphicsContext3D::activeTextureUnit const):
2138         (WebCore::GraphicsContext3D::currentBoundTexture const):
2139         (WebCore::GraphicsContext3D::currentBoundTarget const):
2140         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture const):
2141         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture const):
2142         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTarget const):
2143         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTarget const):
2144         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture): Deleted.
2145         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture): Deleted.
2146         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTarget): Deleted.
2147         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2148         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
2149         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
2150         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
2151         * platform/graphics/cv/VideoTextureCopierCV.h:
2152         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2153         (WebCore::GraphicsContext3D::prepareTexture):
2154         (WebCore::GraphicsContext3D::activeTexture):
2155         (WebCore::GraphicsContext3D::bindTexture):
2156
2157 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2158
2159         WKBundlePageWillSendSubmitEventCallback is called with incorrect frame parameter
2160         https://bugs.webkit.org/show_bug.cgi?id=176719
2161
2162         Reviewed by Chris Dumez.
2163
2164         WKBundlePageWillSendSubmitEventCallback is clearly intended to parallel
2165         WKBundlePageWillSubmitFormCallback, since almost all the parameters are the same. Now, in
2166         WKBundlePageWillSubmitFormCallback, the first WKBundleFrameRef, "frame", is the frame of the
2167         form target, and the second WKBundleFrameRef, sourceFrame, is the frame containing the form.
2168         That's correct. But in WKBundlePageWillSendSubmitEventCallback, both frame and sourceFrame
2169         are always identical. The problem is that the FrameLoaderClient delegate is called on the
2170         wrong FrameLoaderClient. It should be called on the FrameLoaderClient of the target frame,
2171         but HTMLFormElement calls it on the FrameLoaderClient of the source frame instead.
2172
2173         Fix this by factoring the target frame computation out of FormSubmission into some helpers.
2174
2175         * html/HTMLFormElement.cpp:
2176         (WebCore::HTMLFormElement::prepareForSubmission):
2177         (WebCore::HTMLFormElement::effectiveTarget const):
2178         (WebCore::HTMLFormElement::findSubmitButton const):
2179         * html/HTMLFormElement.h:
2180         * loader/FormSubmission.cpp:
2181         (WebCore::FormSubmission::create):
2182
2183 2017-10-30  Alex Christensen  <achristensen@webkit.org>
2184
2185         ASSERTION FAILED: internalValuesConsistent(m_url) in WebCore::URLParser::URLParser
2186         https://bugs.webkit.org/show_bug.cgi?id=178861
2187
2188         Reviewed by Tim Horton.
2189
2190         This is a dark corner of the URL spec that has wildly different behavior in different browsers.
2191         The assertion fired when we have a file URL with a ? or a # after file:// and it was because
2192         m_pathAfterLastSlash was still 0. We definitely shouldn't assert. I'm making us consistent with
2193         other cases where we have nothing there and add an implied missing slash.
2194         
2195         Covered by new API tests.
2196
2197         * platform/URLParser.cpp:
2198         (WebCore::URLParser::parse):
2199
2200 2017-10-27  Megan Gardner  <megan_gardner@apple.com>
2201
2202         Correctly determine affinity when inserting text via Keyboard Suggestions
2203         https://bugs.webkit.org/show_bug.cgi?id=178969
2204
2205         Reviewed by Ryosuke Niwa.
2206
2207         There has been talk about renaming these enums, but in the meantime we should at least have a comment 
2208         clarifying what they actually mean.
2209
2210         No new tests only adding a comment, no tests needed.
2211
2212         * editing/TextAffinity.h:
2213
2214 2017-10-27  Ryosuke Niwa  <rniwa@webkit.org>
2215
2216         Crash in addChildNodesToDeletionQueue
2217         https://bugs.webkit.org/show_bug.cgi?id=178974
2218         <rdar://problem/35234372>
2219
2220         Reviewed by Brent Fulgham.
2221
2222         The bug was caused by HTMLConstructionSite::insertTextNode constructing an ill-formed tree
2223         when fostering parent under a template element by adjusting HTMLConstructionSiteTask's parent
2224         without clearing nextChild. Fixed the crash by simply removing this code since executeTask
2225         already takes care of fostering the parent in static inline insert(HTMLConstructionSiteTask&).
2226
2227         Test: fast/parser/foster-parent-under-template.html
2228
2229         * html/parser/HTMLConstructionSite.cpp:
2230         (WebCore::HTMLConstructionSite::insertTextNode):
2231
2232 2017-10-30  Commit Queue  <commit-queue@webkit.org>
2233
2234         Unreviewed, rolling out r224078.
2235         https://bugs.webkit.org/show_bug.cgi?id=179026
2236
2237         MotionMark regression (Requested by shallawa on #webkit).
2238
2239         Reverted changeset:
2240
2241         "When navigating back to a page, compositing layers may not
2242         use accelerated drawing"
2243         https://bugs.webkit.org/show_bug.cgi?id=178749
2244         https://trac.webkit.org/changeset/224078
2245
2246 2017-10-30  Dean Jackson  <dino@apple.com>
2247
2248         Implement "bitmaprenderer" CanvasRenderingContext
2249         https://bugs.webkit.org/show_bug.cgi?id=178992
2250         <rdar://problem/34147157>
2251
2252         Reviewed by Sam Weinig.
2253
2254         Implement the "bitmaprenderer" context for HTMLCanvasElement.
2255         Use as much of the existing 2d context code as possible, which
2256         means that we are painting the ImageBitmap into the backing
2257         store. This isn't optimal, but it is good enough to get
2258         going while we move buffer ownership from the canvas object
2259         into the rendering contexts.
2260
2261         This patch raised a few issues on the HTML specification:
2262         https://github.com/whatwg/html/issues/3164
2263         https://github.com/whatwg/html/issues/3165
2264         https://github.com/whatwg/html/issues/3166
2265         https://github.com/whatwg/html/issues/3167
2266
2267         Update existing Web Platform Test results.
2268
2269         * html/HTMLCanvasElement.cpp:
2270         (WebCore::HTMLCanvasElement::createContext2d): Drive-by comment fix.
2271         (WebCore::HTMLCanvasElement::createContextWebGL): Ditto.
2272         (WebCore::HTMLCanvasElement::createContextWebGPU): Ditto.
2273         (WebCore::HTMLCanvasElement::createContextBitmapRenderer): We now require
2274         a layer/backing store for a bitmap context.
2275         (WebCore::HTMLCanvasElement::paintsIntoCanvasBuffer const): Add bitmap-renderer
2276         to the type of context that uses the canvas's backing store.
2277         (WebCore::HTMLCanvasElement::createImageBuffer const): Comment fix.
2278         (WebCore::HTMLCanvasElement::setImageBuffer const): Change parameter to a &&.
2279         (WebCore::HTMLCanvasElement::setImageBufferAndMarkDirty): New function to set
2280         the backing store efficiently, as well as make it look like we need to repaint
2281         the entire canvas.
2282         (WebCore::HTMLCanvasElement::drawingContext const): The buffer doesn't actually
2283         need to provide a GraphicsContext if we're a bitmap renderer.
2284         * html/HTMLCanvasElement.h:
2285
2286         * html/ImageBitmap.cpp:
2287         (WebCore::ImageBitmap::transferOwnershipAndClose): New helper to give the ownership
2288         of the ImageBuffer away, and look like close() was called.
2289         * html/ImageBitmap.h:
2290
2291         * html/canvas/ImageBitmapRenderingContext.cpp: Implement the algorithm from the HTML
2292         specification.
2293         (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
2294         (WebCore::ImageBitmapRenderingContext::isAccelerated const):
2295         (WebCore::ImageBitmapRenderingContext::setOutputBitmap):
2296         (WebCore::ImageBitmapRenderingContext::transferFromImageBitmap):
2297         * html/canvas/ImageBitmapRenderingContext.h:
2298         * html/canvas/ImageBitmapRenderingContext.idl:
2299
2300 2017-10-30  Simon Fraser  <simon.fraser@apple.com>
2301
2302         tab-size: 0px asserts
2303         https://bugs.webkit.org/show_bug.cgi?id=176198
2304
2305         Reviewed by Antti Koivisto.
2306
2307         Don't claim to support tab-size values with units. We don't, and they would become 0, rather
2308         than fall back to the default as should happen.
2309
2310         Enhanced fast/css/tab-size.html to test.
2311
2312         * css/parser/CSSPropertyParser.cpp:
2313         (WebCore::consumeTabSize):
2314
2315 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2316
2317         [WPE] Fix build warnings
2318         https://bugs.webkit.org/show_bug.cgi?id=178899
2319
2320         Reviewed by Carlos Alberto Lopez Perez.
2321
2322         These are actually mostly cross-platform issues.
2323
2324         * html/canvas/WebGL2RenderingContext.cpp:
2325         (WebCore::arrayBufferViewElementSize):
2326         * platform/Cairo.cmake:
2327         * platform/Curl.cmake:
2328         * platform/FreeType.cmake:
2329         * platform/GCrypt.cmake:
2330         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
2331         (WebCore::TextureMapperShaderProgram::create):
2332         * platform/network/soup/SoupNetworkSession.cpp:
2333         (WebCore::SoupNetworkSession::SoupNetworkSession):
2334
2335 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2336
2337         [WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatformWPE build target
2338         https://bugs.webkit.org/show_bug.cgi?id=178964
2339
2340         Reviewed by Carlos Alberto Lopez Perez.
2341
2342         This also gets rid of the WebCorePlatformWPE build target to simplify the build. It links to
2343         all the same libraries as the WebCore target, so it doesn't seem to have any purpose. Bye.
2344
2345         Some CMake files under platform are not unified, either because there is not much to gain
2346         (e.g. ImageDecoders, where everything is in a separate directory), or because it is complex
2347         (e.g. GStreamer, where GObject implementations would be tricky to build unified), and
2348         because we're limited to using only features declared in WebKitFeatures.cmake inside the
2349         unified sources lists, which makes some of the platform files a bit tricky (notably,
2350         anything that needs to go into WebCorePlatformGTK for the GTK port). So it's not perfect.
2351
2352         * PlatformWPE.cmake:
2353         * SourcesWPE.txt: Added.
2354         * crypto/gcrypt/GCryptUtilities.h:
2355         * platform/Cairo.cmake:
2356         * platform/GCrypt.cmake:
2357         * platform/SourcesCairo.txt: Added.
2358         * platform/SourcesGCrypt.txt: Added.
2359         * platform/SourcesGLib.txt: Added.
2360         * platform/SourcesSoup.txt: Added.
2361
2362 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2363
2364         Remove more unused ENABLE(GAMEPAD_DEPRECATED) code
2365         https://bugs.webkit.org/show_bug.cgi?id=178364
2366
2367         Reviewed by Carlos Alberto Lopez Perez.
2368
2369         * Modules/gamepad/deprecated/Gamepad.cpp: Removed.
2370         * Modules/gamepad/deprecated/Gamepad.h: Removed.
2371         * Modules/gamepad/deprecated/Gamepad.idl: Removed.
2372         * Modules/gamepad/deprecated/GamepadList.cpp: Removed.
2373         * Modules/gamepad/deprecated/GamepadList.h: Removed.
2374         * Modules/gamepad/deprecated/GamepadList.idl: Removed.
2375         * Modules/gamepad/deprecated/NavigatorGamepad.cpp: Removed.
2376         * Modules/gamepad/deprecated/NavigatorGamepad.h: Removed.
2377         * Modules/gamepad/deprecated/NavigatorGamepad.idl: Removed.
2378
2379 2017-10-30  Daniel Bates  <dabates@apple.com>
2380
2381         Use if conditional function in DerivedSources.make to reduce duplication
2382         https://bugs.webkit.org/show_bug.cgi?id=178989
2383
2384         Reviewed by Darin Adler.
2385
2386         In DerivedSources.make we currently duplicate most of the Makefile recipe for generating HTML/SVG
2387         tags and attributes to support passing the optional command line option --extraDefines when one
2388         or more HTML/SVG compile-time features are enabled. Instead we can make use of a Makefile
2389         conditional function in the recipe itself to avoid code duplication.
2390
2391         * DerivedSources.make:
2392
2393 2017-10-30  Antoine Quint  <graouts@apple.com>
2394
2395         [Web Animations] Expose the playbackRate property on Animation
2396         https://bugs.webkit.org/show_bug.cgi?id=178931
2397
2398         Reviewed by Sam Weinig.
2399
2400         Account for the playback rate when computing and setting an animation's
2401         current time, ensuring that we adjust the start time to preserve the
2402         current time when setting a new playback rate.
2403
2404         Test: http/wpt/wk-web-animations/timing-model/animation-playback-rate.html
2405
2406         * animation/WebAnimation.cpp:
2407         (WebCore::WebAnimation::WebAnimation):
2408         (WebCore::WebAnimation::currentTime const):
2409         (WebCore::WebAnimation::setCurrentTime):
2410         (WebCore::WebAnimation::setPlaybackRate):
2411         * animation/WebAnimation.h:
2412         * animation/WebAnimation.idl:
2413
2414 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2415
2416         [WPE][GTK] Expose availability of certain editing commands in WebKitEditorState
2417         https://bugs.webkit.org/show_bug.cgi?id=168219
2418
2419         Reviewed by Ryosuke Niwa.
2420
2421         Make Editor::canUndo and Editor::canRedo const.
2422
2423         Also, remove unused allowsCopy from HitTestResult.
2424
2425         * editing/Editor.cpp:
2426         (WebCore::Editor::canUndo const):
2427         (WebCore::Editor::canRedo const):
2428         (WebCore::Editor::canUndo): Deleted.
2429         (WebCore::Editor::canRedo): Deleted.
2430         * editing/Editor.h:
2431         * rendering/HitTestResult.cpp:
2432         (WebCore::HitTestResult::allowsCopy const): Deleted.
2433         * rendering/HitTestResult.h:
2434         * rendering/SelectionRangeData.cpp:
2435
2436 2017-10-27  Antti Koivisto  <antti@apple.com>
2437
2438         Destroy all unneeded anonymous wrappers in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers()
2439         https://bugs.webkit.org/show_bug.cgi?id=178933
2440
2441         Reviewed by Zalan Bujtas.
2442
2443         Currently it just cleans up table related wrappers.
2444
2445         * rendering/RenderObject.cpp:
2446         (WebCore::findDestroyRootIncludingAnonymous):
2447
2448         Continuations are left as future work.
2449
2450 2017-10-30  Zalan Bujtas  <zalan@apple.com>
2451
2452         Remove reference to RenderTreeInternalMutationScope
2453         https://bugs.webkit.org/show_bug.cgi?id=178998
2454         <rdar://problem/35246464>
2455
2456         Reviewed by Antti Koivisto.
2457
2458         We don't have such class anymore.
2459
2460         No change in functionality.
2461
2462         * rendering/RenderView.h:
2463
2464 2017-10-30  Zan Dobersek  <zdobersek@igalia.com>
2465
2466         [GCrypt] Add support for P-521 EC curves
2467         https://bugs.webkit.org/show_bug.cgi?id=175199
2468
2469         Reviewed by Jiewen Tan.
2470
2471         Add support for 521-bit elliptic curves in the libgcrypt-based
2472         implementation of WebCrypto API.
2473
2474         In the CryptoAlgorithmECDH implementation, the bit-size of the key is now
2475         rounded up to the next byte boundary and passed to the helper
2476         gcryptDerive() function. There the size in bytes is used to zero-pad the
2477         derived key data. This is done to properly handle derivation results for
2478         the P-521 curves, where the leading zero bit could get clipped, resulting
2479         in a derived key that is only 65 byes in length when it is expected to be
2480         66 bytes. Further cleanups are done in gcryptDerive() to use the mpiData()
2481         function where possible.
2482
2483         In the CryptoAlgorithmECDSA implementation, the bit-size of the key is
2484         again rounded up to the nearest byte boundary before being passed to the
2485         helper gcryptSign() and gcryptVerify() functions. This again properly
2486         enforces the requirement of 66 bytes to handle P-521 elliptic curves.
2487
2488         In the CryptoKeyEC implementation, NamedCurve::P521 cases in helper
2489         functions operating on NamedCurve values are now implemented to return
2490         appropriate values. platformSupportedCurve() now returns true for the
2491         NamedCurve::P521 value. Zero-padding of the private key data is used
2492         wherever it is necessary to avoid clipping any leading zero bit in the
2493         P-521 EC key.
2494
2495         No new tests -- affected tests have their baselines updated.
2496
2497         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
2498         (WebCore::gcryptDerive):
2499         (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
2500         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
2501         (WebCore::CryptoAlgorithmECDSA::platformSign):
2502         (WebCore::CryptoAlgorithmECDSA::platformVerify):
2503         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
2504         (WebCore::curveName):
2505         (WebCore::curveIdentifier):
2506         (WebCore::curveSize):
2507         (WebCore::curveUncompressedFieldElementSize):
2508         (WebCore::CryptoKeyEC::platformSupportedCurve):
2509         (WebCore::curveForIdentifier):
2510         (WebCore::CryptoKeyEC::platformImportPkcs8):
2511         (WebCore::CryptoKeyEC::platformAddFieldElements const):
2512         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
2513
2514 2017-10-29  Fujii Hironori  <Hironori.Fujii@sony.com>
2515
2516         Use of uninitialized value $targetIdlFile in hash element at preprocess-idls.pl line 165.
2517         https://bugs.webkit.org/show_bug.cgi?id=177743
2518
2519         Reviewed by Darin Adler.
2520
2521         GamepadWebVR.idl supplements Gamepad.idl. But, Gamepad.idl is not
2522         processed because ENABLE_GAMEPAD is OFF.
2523
2524         No new tests since there should be no behavioral change.
2525
2526         * CMakeLists.txt: Include GamepadWebVR.idl only if ENABLE_GAMEPAD.
2527         * Sources.txt: Ditto.
2528         * bindings/scripts/preprocess-idls.pl: Die if a supplemented IDL file is not found.
2529
2530 2017-10-29  Sam Weinig  <sam@webkit.org>
2531
2532         [Conic Gradients] Add support for parsing conic gradients
2533         https://bugs.webkit.org/show_bug.cgi?id=178987
2534
2535         Reviewed by Dean Jackson.
2536
2537         Adds initial support, disabled by default, for parsing conic gradients as per
2538         CSS 4 Images - https://www.w3.org/TR/css-images-4/#conic-gradients.
2539
2540         Test: fast/gradients/conic-gradient-parsing.html
2541
2542         * css/CSSGradientValue.cpp:
2543         (WebCore::clone):
2544         (WebCore::CSSGradientValue::isCacheable const):
2545         (WebCore::CSSConicGradientValue::customCSSText const):
2546         (WebCore::CSSConicGradientValue::createGradient):
2547         (WebCore::CSSConicGradientValue::equals const):
2548         * css/CSSGradientValue.h:
2549         
2550             Add CSSConicGradientValue as a subclass of CSSGradientValue and implement
2551             customCSSText() and equals(). Stub out createGradient() as painting is not
2552             yet implemented.
2553         
2554         * css/CSSImageGeneratorValue.cpp:
2555         (WebCore::CSSImageGeneratorValue::image):
2556         (WebCore::CSSImageGeneratorValue::isFixedSize const):
2557         (WebCore::CSSImageGeneratorValue::fixedSize):
2558         (WebCore::CSSImageGeneratorValue::isPending const):
2559         (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
2560         (WebCore::CSSImageGeneratorValue::loadSubimages):
2561         * css/CSSValue.cpp:
2562         (WebCore::CSSValue::equals const):
2563         (WebCore::CSSValue::cssText const):
2564         (WebCore::CSSValue::destroy):
2565         
2566             Dispatch to CSSConicGradientValue as needed.
2567         
2568         * css/CSSValue.h:
2569         (WebCore::CSSValue::isImageGeneratorValue const):
2570         (WebCore::CSSValue::isGradientValue const):
2571         (WebCore::CSSValue::isConicGradientValue const):
2572         
2573             Add conic gradient predicate support and update isImageGeneratorValue and 
2574             isGradientValue to include conic gradient.
2575         
2576         * css/CSSValueKeywords.in:
2577         
2578             Add conic-gradient and repeating-conic-gradient.
2579         
2580         * css/parser/CSSParser.cpp:
2581         (WebCore::CSSParserContext::CSSParserContext):
2582         (WebCore::operator==):
2583         * css/parser/CSSParserMode.h:
2584         (WebCore::CSSParserContextHash::hash):
2585         
2586             Add runtime flags to enable conic gradients.
2587         
2588         * css/parser/CSSPropertyParserHelpers.cpp:
2589         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
2590         
2591             Helper, similar to consumeLengthOrPercent, for consumeGradientColorStops. 
2592             Corresponds to https://drafts.csswg.org/css-values-4/#typedef-angle-percentage
2593         
2594         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
2595         
2596             Convert to take CSSGradientValue by reference.
2597         
2598         (WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops):
2599         
2600             Helper, similar to consumeGradientColorStops, but for angular color stops
2601             used in conic gradients. Corresponds to https://www.w3.org/TR/css-images-4/#typedef-angular-color-stop-list
2602             but does not yet support double position syntax.
2603         
2604         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
2605         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
2606         (WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
2607         
2608             Pass CSSGradientValue by reference.
2609         
2610         (WebCore::CSSPropertyParserHelpers::consumeConicGradient):
2611         
2612             Parse conic gradient.
2613         
2614         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
2615         
2616             Dispatch to consumeConicGradient for repeating and non-repeating
2617             conic gradients.
2618         
2619         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
2620         
2621             Put each value on its own line to make it more readable and add CSSValueConicGradient
2622             and CSSValueRepeatingConicGradient.
2623         
2624         * page/Settings.yaml:
2625         
2626             Add a setting to enable conic gradients. Disabled by default.
2627
2628         * features.json:
2629         
2630             Move conic gradients to "In Development".
2631
2632 2017-10-29  Antoine Quint  <graouts@apple.com>
2633
2634         [Web Animations] Expose the currentTime property on Animation
2635         https://bugs.webkit.org/show_bug.cgi?id=178988
2636
2637         Unreviewed.
2638
2639         Style fixes missed in previous patch.
2640
2641         * animation/WebAnimation.cpp:
2642         (WebCore::WebAnimation::setCurrentTime):
2643
2644 2017-10-29  Antoine Quint  <graouts@apple.com>
2645
2646         [Web Animations] Expose the currentTime property on Animation
2647         https://bugs.webkit.org/show_bug.cgi?id=178988
2648
2649         Reviewed by Dean Jackson.
2650
2651         We now expose the currentTime property on Animation objects, our first
2652         step in implementing the Web Animations timing model, specifically section
2653         3.5.4. "The current time of an animation" and section 3.5.5. "Setting the
2654         current time of an animation". Setting the startTime has implications on
2655         currentTime and vice-versa.
2656
2657         Test: webanimations/animation-current-time.html
2658
2659         * animation/WebAnimation.cpp:
2660         (WebCore::WebAnimation::setBindingsStartTime):
2661         (WebCore::WebAnimation::startTime const):
2662         (WebCore::WebAnimation::setStartTime):
2663         (WebCore::WebAnimation::bindingsCurrentTime const):
2664         (WebCore::WebAnimation::setBindingsCurrentTime):
2665         (WebCore::WebAnimation::currentTime const):
2666         (WebCore::WebAnimation::setCurrentTime):
2667         * animation/WebAnimation.h:
2668         * animation/WebAnimation.idl:
2669
2670 2017-10-29  Ryosuke Niwa  <rniwa@webkit.org>
2671
2672         Assert that no script is executed during style recalc
2673         https://bugs.webkit.org/show_bug.cgi?id=178845
2674         <rdar://problem/35106129>
2675
2676         Reviewed by Antti Koivisto.
2677
2678         This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
2679         to make sure we don't start mutating DOM in the middle of a style update.
2680
2681         Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
2682         shadow tree since that happens while updating the style.
2683
2684         No new tests since there should be no behavioral change.
2685
2686         * dom/Document.cpp:
2687         (WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
2688         and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
2689         the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
2690         Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
2691         scripts which in turn trigger another (recursive) style recalc.
2692         (WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
2693         NoEventDispatchAssertion.
2694         * dom/Element.cpp:
2695         (WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
2696         newly cloned element for SVG use element's shadow tree.
2697         (WebCore::Element::cloneElementWithoutChildren): Ditto.
2698         * dom/EventDispatcher.cpp:
2699         (WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
2700         use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
2701         since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
2702         pushing or popoing the stack frame.
2703         * svg/SVGUseElement.cpp:
2704         (WebCore::SVGUseElement::clearShadowTree):
2705         (WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
2706         of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
2707         scripts, it's safe to mutate them during the style recalc even though it's not the best design.
2708         (WebCore::SVGUseElement::cloneTarget const): Ditto.
2709         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
2710         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
2711         (WebCore::SVGUseElement::transferEventListenersToShadowTree const):
2712
2713 2017-10-28  Dean Jackson  <dino@apple.com>
2714
2715         createImageBitmap with HTMLCanvasElement
2716         https://bugs.webkit.org/show_bug.cgi?id=178984
2717         <rdar://problem/35238440>
2718
2719         Reviewed by Sam Weinig.
2720
2721         Implement createImageBitmap(HTMLCanvasElement).
2722
2723         While here, explicitly reject the promises for the
2724         methods we haven't yet implemented. I was hoping this
2725         would avoid a lengthy timeout in one of the imported
2726         WPT tests but, alas, it doesn't. However, it's still
2727         a good idea.
2728
2729         Extend internal WPT proposals to cover canvas creation.
2730
2731         * html/ImageBitmap.cpp:
2732         (WebCore::ImageBitmap::createPromise): Get the image from
2733         the canvas and draw it into a new ImageBitmap buffer.
2734
2735 2017-10-28  Myles C. Maxfield  <mmaxfield@apple.com>
2736
2737         [iOS] Unify Font::platformCharWidthInit() with macOS
2738         https://bugs.webkit.org/show_bug.cgi?id=178951
2739         <rdar://problem/7848198>
2740
2741         Reviewed by Zalan Bujtas.
2742
2743         The only reason these codepaths are different is because historically this codepath
2744         didn't work with GS fonts (which we don't use anymore).
2745
2746         Tests: fast/forms/search-styled.html
2747                fast/forms/text-control-intrinsic-widths.html
2748                fast/forms/textarea-width.html
2749
2750         * platform/graphics/cocoa/FontCocoa.mm:
2751         (WebCore::Font::platformCharWidthInit):
2752
2753 2017-10-28  Chris Dumez  <cdumez@apple.com>
2754
2755         self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
2756         https://bugs.webkit.org/show_bug.cgi?id=178976
2757
2758         Reviewed by Sam Weinig.
2759
2760         Test: http/tests/workers/service/ServiceWorkerGlobalScope-properties.html
2761
2762         * workers/service/ExtendableEvent.idl:
2763         * workers/service/FetchEvent.idl:
2764         Drop [Exposed=Worker] as there is already [Exposed=ServiceWorker] and
2765         ServiceWorkerGlobalScope inherits from WorkerGlobalScope. This is redundant
2766         and we would hit assertions and adding the global constructors at runtime
2767         when the feature is enabled, because the property already exists.
2768
2769 2017-10-28  Zalan Bujtas  <zalan@apple.com>
2770
2771         [FrameView::layout cleanup] Move core layout logic to a separate class.
2772         https://bugs.webkit.org/show_bug.cgi?id=178771
2773         <rdar://problem/35166542>
2774
2775         Reviewed by Simon Fraser.
2776
2777         Move layout code out from FrameView to LayoutContext.
2778
2779         LayoutContext holds all the layout related logic (scheduling, needsLayout, handling layout states),
2780         while scrolling, view sizing methods stay in FrameView.
2781         Having a dedicated LayoutContext allows to structure the code better.   
2782
2783         Covered by existing tests.
2784
2785         * Sources.txt:
2786         * WebCore.xcodeproj/project.pbxproj:
2787         * accessibility/AXObjectCache.cpp:
2788         (WebCore::rendererNeedsDeferredUpdate):
2789         * accessibility/AccessibilityObject.cpp:
2790         (WebCore::AccessibilityObject::updateBackingStore):
2791         * accessibility/AccessibilityRenderObject.cpp:
2792         (WebCore::AccessibilityRenderObject::textUnderElement const):
2793         (WebCore::AccessibilityRenderObject::layoutCount const):
2794         * dom/Document.cpp:
2795         (WebCore::Document::setVisualUpdatesAllowed):
2796         (WebCore::Document::resolveStyle):
2797         (WebCore::Document::updateStyleIfNeeded):
2798         (WebCore::Document::updateLayout):
2799         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
2800         (WebCore::Document::implicitClose):
2801         (WebCore::Document::isLayoutTimerActive):
2802         * dom/Element.cpp:
2803         (WebCore::Element::absoluteEventHandlerBounds):
2804         * editing/FrameSelection.cpp:
2805         (WebCore::FrameSelection::setSelection):
2806         * html/HTMLEmbedElement.cpp:
2807         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
2808         * html/HTMLFormControlElement.cpp:
2809         (WebCore::HTMLFormControlElement::didAttachRenderers):
2810         * inspector/InspectorOverlay.cpp:
2811         (WebCore::InspectorOverlay::update):
2812         * loader/FrameLoader.cpp:
2813         (WebCore::FrameLoader::stopForUserCancel):
2814         * page/Frame.cpp:
2815         (WebCore::Frame::setView):
2816         (WebCore::Frame::clearTimers):
2817         (WebCore::Frame::setPageAndTextZoomFactors):
2818         (WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
2819         * page/FrameView.cpp:
2820         (WebCore::FrameView::FrameView):
2821         (WebCore::FrameView::~FrameView):
2822         (WebCore::FrameView::reset):
2823         (WebCore::FrameView::resetScrollbars):
2824         (WebCore::FrameView::didFirstLayout const):
2825         (WebCore::FrameView::willDestroyRenderTree):
2826         (WebCore::FrameView::didDestroyRenderTree):
2827         (WebCore::FrameView::setContentsSize):
2828         (WebCore::FrameView::calculateScrollbarModesForLayout):
2829         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
2830         (WebCore::FrameView::topContentInsetDidChange):
2831         (WebCore::FrameView::forceLayoutParentViewIfNeeded):
2832         (WebCore::FrameView::adjustScrollbarsForLayout):
2833         (WebCore::FrameView::willDoLayout): This takes care of the view related task right before entering render tree layout.
2834         (WebCore::FrameView::didLayout): post layout tasks.
2835         (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
2836         (WebCore::FrameView::updateLayoutViewport):
2837         (WebCore::FrameView::maintainScrollPositionAtAnchor):
2838         (WebCore::FrameView::updateLayerPositionsAfterScrolling):
2839         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
2840         (WebCore::FrameView::availableContentSizeChanged):
2841         (WebCore::FrameView::updateContentsSize):
2842         (WebCore::FrameView::needsLayout const):
2843         (WebCore::FrameView::setNeedsLayout):
2844         (WebCore::FrameView::scheduleSelectionUpdate):
2845         (WebCore::FrameView::updateEmbeddedObjects):
2846         (WebCore::FrameView::flushAnyPendingPostLayoutTasks):
2847         (WebCore::FrameView::flushPostLayoutTasksQueue):
2848         (WebCore::FrameView::performPostLayoutTasks):
2849         (WebCore::FrameView::sendResizeEventIfNeeded):
2850         (WebCore::FrameView::autoSizeIfEnabled):
2851         (WebCore::FrameView::paintControlTints):
2852         (WebCore::FrameView::paintContents):
2853         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
2854         (WebCore::FrameView::enableAutoSizeMode):
2855         (WebCore::FrameView::forceLayout):
2856         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer): Deleted.
2857         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer): Deleted.
2858         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree): Deleted.
2859         (): Deleted.
2860         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker): Deleted.
2861         (WebCore::applyTextSizingIfNeeded): Deleted.
2862         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded): Deleted.
2863         (WebCore::FrameView::updateStyleForLayout): Deleted.
2864         (WebCore::FrameView::canPerformLayout const): Deleted.
2865         (WebCore::FrameView::layout): Deleted.
2866         (WebCore::FrameView::runOrSchedulePostLayoutTasks): Deleted.
2867         (WebCore::FrameView::convertSubtreeLayoutToFullLayout): Deleted.
2868         (WebCore::FrameView::layoutTimerFired): Deleted.
2869         (WebCore::FrameView::scheduleRelayout): Deleted.
2870         (WebCore::isObjectAncestorContainerOf): Deleted.
2871         (WebCore::FrameView::scheduleRelayoutOfSubtree): Deleted.
2872         (WebCore::FrameView::layoutPending const): Deleted.
2873         (WebCore::FrameView::unscheduleRelayout): Deleted.
2874         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded): Deleted.
2875         * page/FrameView.h:
2876         * page/LayoutContext.cpp: Added.
2877         (WebCore::isObjectAncestorContainerOf):
2878         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
2879         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
2880         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree):
2881         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
2882         (WebCore::LayoutScope::LayoutScope):
2883         (WebCore::LayoutScope::~LayoutScope):
2884         (WebCore::LayoutContext::LayoutContext):
2885         (WebCore::LayoutContext::layout):
2886         (WebCore::LayoutContext::runOrScheduleAsynchronousTasks):
2887         (WebCore::LayoutContext::runAsynchronousTasks):
2888         (WebCore::LayoutContext::flushAsynchronousTasks):
2889         (WebCore::LayoutContext::reset):
2890         (WebCore::LayoutContext::needsLayout const):
2891         (WebCore::LayoutContext::setNeedsLayout):
2892         (WebCore::LayoutContext::enableSetNeedsLayout):
2893         (WebCore::LayoutContext::disableSetNeedsLayout):
2894         (WebCore::LayoutContext::scheduleLayout):
2895         (WebCore::LayoutContext::unscheduleLayout):
2896         (WebCore::LayoutContext::scheduleSubtreeLayout):
2897         (WebCore::LayoutContext::layoutTimerFired):
2898         (WebCore::LayoutContext::convertSubtreeLayoutToFullLayout):
2899         (WebCore::LayoutContext::setSubtreeLayoutRoot):
2900         (WebCore::LayoutContext::canPerformLayout const):
2901         (WebCore::LayoutContext::applyTextSizingIfNeeded):
2902         (WebCore::LayoutContext::updateStyleForLayout):
2903         (WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
2904         (WebCore::LayoutContext::startLayoutAtMainFrameViewIfNeeded):
2905         (WebCore::LayoutContext::frame const):
2906         (WebCore::LayoutContext::view const):
2907         (WebCore::LayoutContext::renderView const):
2908         (WebCore::LayoutContext::document const):
2909         * page/LayoutContext.h: Added.
2910         (WebCore::LayoutContext::startDisallowingLayout):
2911         (WebCore::LayoutContext::endDisallowingLayout):
2912         (WebCore::LayoutContext::layoutPhase const):
2913         (WebCore::LayoutContext::isLayoutNested const):
2914         (WebCore::LayoutContext::layoutCount const):
2915         (WebCore::LayoutContext::isLayoutPending const):
2916         (WebCore::LayoutContext::isInLayout const):
2917         (WebCore::LayoutContext::isInRenderTreeLayout const):
2918         (WebCore::LayoutContext::inPaintableState const):
2919         (WebCore::LayoutContext::subtreeLayoutRoot const):
2920         (WebCore::LayoutContext::clearSubtreeLayoutRoot):
2921         (WebCore::LayoutContext::resetFirstLayoutFlag):
2922         (WebCore::LayoutContext::didFirstLayout const):
2923         (WebCore::LayoutContext::setNeedsFullRepaint):
2924         (WebCore::LayoutContext::needsFullRepaint const):
2925         (WebCore::LayoutContext::layoutDisallowed const):
2926         (WebCore::LayoutContext::isLayoutSchedulingEnabled const):
2927         (WebCore::LayoutContext::inAsynchronousTasks const):
2928         * page/Page.cpp:
2929         (WebCore::Page::setPageScaleFactor):
2930         * rendering/RenderBlock.cpp:
2931         (WebCore::RenderBlock::insertPositionedObject):
2932         * rendering/RenderBox.cpp:
2933         (WebCore::RenderBox::imageChanged):
2934         (WebCore::RenderBox::computeLogicalWidthInFragment const):
2935         * rendering/RenderElement.cpp:
2936         (WebCore::RenderElement::clearSubtreeLayoutRootIfNeeded const):
2937         (WebCore::RenderElement::checkForRepaintDuringLayout const):
2938         * rendering/RenderFrameBase.cpp:
2939         (WebCore::RenderFrameBase::performLayoutWithFlattening):
2940         * rendering/RenderLayer.cpp:
2941         (WebCore::RenderLayer::scrollTo):
2942         * rendering/RenderObject.cpp:
2943         (WebCore::scheduleRelayoutForSubtree):
2944         * rendering/RenderTreeAsText.cpp:
2945         (WebCore::write):
2946         * rendering/RenderVideo.cpp:
2947         (WebCore::RenderVideo::updatePlayer):
2948         * rendering/RenderView.h:
2949         * rendering/RenderWidget.cpp:
2950         (WebCore::RenderWidget::updateWidgetPosition):
2951         * svg/graphics/SVGImage.cpp:
2952         (WebCore::SVGImage::draw):
2953         * testing/Internals.cpp:
2954         (WebCore::Internals::layoutCount const):
2955         
2956 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
2957
2958         Cleanup PageDebuggable
2959         https://bugs.webkit.org/show_bug.cgi?id=178972
2960
2961         Reviewed by Sam Weinig.
2962
2963         * page/PageDebuggable.cpp:
2964         (WebCore::PageDebuggable::PageDebuggable):
2965         * page/PageDebuggable.h:
2966
2967 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
2968
2969         Extract a WorkerDebuggerProxy interface out of WorkerReportingProxy
2970         https://bugs.webkit.org/show_bug.cgi?id=178975
2971
2972         Reviewed by Sam Weinig.
2973
2974         No new tests, just refactoring.
2975
2976         * workers/WorkerDebuggerProxy.h:
2977         * workers/WorkerReportingProxy.h:
2978         * WebCore.xcodeproj/project.pbxproj:
2979         Extract a method from WorkerReportingProxy to WorkerDebuggerProxy and
2980         rename it to be more general.
2981
2982         * inspector/WorkerToPageFrontendChannel.h:
2983         (WebCore::WorkerToPageFrontendChannel::sendMessageToFrontend):
2984         * workers/DedicatedWorkerThread.cpp:
2985         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
2986         * workers/DedicatedWorkerThread.h:
2987         * workers/WorkerMessagingProxy.cpp:
2988         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2989         (WebCore::WorkerMessagingProxy::postMessageToDebugger):
2990         (WebCore::WorkerMessagingProxy::postMessageToPageInspector): Deleted.
2991         * workers/WorkerMessagingProxy.h:
2992         * workers/WorkerThread.cpp:
2993         (WebCore::WorkerThread::WorkerThread):
2994         * workers/WorkerThread.h:
2995         (WebCore::WorkerThread::workerDebuggerProxy const):
2996         * workers/service/context/ServiceWorkerThread.cpp:
2997         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
2998         * workers/service/context/ServiceWorkerThread.h:
2999         * workers/service/context/ServiceWorkerThreadProxy.cpp:
3000         (WebCore::ServiceWorkerThreadProxy::create):
3001         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
3002         Include a WorkerDebuggerProxy alongside the other proxies.
3003         Use the renamed debugger proxy method.
3004
3005 2017-10-28  Ryosuke Niwa  <rniwa@webkit.org>
3006
3007         Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
3008         https://bugs.webkit.org/show_bug.cgi?id=178715
3009         <rdar://problem/35144665>
3010
3011         Reviewed by Brent Fulgham.
3012
3013         Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
3014         instead of in the middle of collecting a list of stylesheets.
3015
3016         * dom/Document.cpp:
3017         (WebCore::Document::Document): Initialize the newly added timer.
3018         (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
3019         handlers may be expecting to see the document after XSLT had been applied.
3020         (WebCore::Document::scheduleToApplyXSLTransforms): Added.
3021         (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
3022         (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
3023         Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
3024         (WebCore::Document::applyXSLTransform): Deleted.
3025         (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
3026         inline XSLT and it happens much earlier than implicitClose.
3027         (WebCore::Document::suspendScheduledTasks): Suspend the XSLT timer.
3028         (WebCore::Document::resumeScheduledTasks): Reschedule the XSLT timer if m_hasPendingXSLTransforms is set.
3029         * dom/Document.h:
3030         * dom/ProcessingInstruction.cpp:
3031         (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
3032         stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
3033         function can be called from a non-script-resilient call stack.
3034         (WebCore::ProcessingInstruction::sheetLoaded): Ditto.
3035         * style/StyleScope.cpp:
3036         (WebCore::Style::Scope::collectXSLTransforms): Added.
3037         (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
3038         that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
3039         * style/StyleScope.h:
3040         * xml/parser/XMLDocumentParserLibxml2.cpp:
3041         (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.
3042
3043 2017-10-27  Devin Rousso  <webkit@devinrousso.com>
3044
3045         Web Inspector: Canvas Tab: no way to see backtrace of where a canvas context was created
3046         https://bugs.webkit.org/show_bug.cgi?id=178799
3047         <rdar://problem/35175805>
3048
3049         Reviewed by Brian Burg.
3050
3051         No new tests, updated existing tests.
3052
3053         * inspector/InspectorCanvas.h:
3054         * inspector/InspectorCanvas.cpp:
3055         (iterateCallFrames):
3056         (WebCore::InspectorCanvas::buildObjectForCanvas):
3057         (WebCore::InspectorCanvas::buildAction):
3058
3059         * inspector/InspectorCanvasAgent.cpp:
3060         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
3061         If the Canvas agent is enabled, generate a backtrace and send it to the frontend with the canvas.
3062         We do not do this for canvases created before the agent is enabled for performance reasons.
3063
3064 2017-10-27  Keith Miller  <keith_miller@apple.com>
3065
3066         Add unified source list files and build scripts to Xcode project navigator
3067         https://bugs.webkit.org/show_bug.cgi?id=178959
3068
3069         Reviewed by Andy Estes.
3070
3071         * WebCore.xcodeproj/project.pbxproj:
3072
3073 2017-10-27  Daniel Bates  <dabates@apple.com>
3074
3075         Only allow non-mixed content protected subresources to ask for credentials
3076         https://bugs.webkit.org/show_bug.cgi?id=178919
3077         <rdar://problem/35015245>
3078
3079         Reviewed by Alex Christensen.
3080
3081         Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful
3082         to allow protected mixed-content subresources to ask for credentials.
3083
3084         Tests: http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image.html
3085                http/tests/security/mixedContent/insecure-script-redirects-to-basic-auth-secure-script.html
3086                http/tests/security/mixedContent/insecure-stylesheet-redirects-to-basic-auth-secure-stylesheet.html
3087                http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https.html
3088                http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https.html
3089                http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html
3090
3091         * loader/ResourceLoader.cpp:
3092         (WebCore::ResourceLoader::ResourceLoader): Initialize m_canAskClientForCredentials based on the
3093         specified resource loader options.
3094         (WebCore::ResourceLoader::init): Update m_canAskClientForCredentials based on the URL of the initial
3095         request.
3096         (WebCore::ResourceLoader::isMixedContent const): Helper function to check if the specified URL
3097         represents a mixed content resource.
3098         (WebCore::ResourceLoader::willSendRequestInternal): If the original request or the redirect request
3099         is mixed content then update state such that we will disallow asking for credentials.
3100         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Modified to use m_canAskClientForCredentials
3101         when determining whether the request is allowed to ask for credentials.
3102         * loader/ResourceLoader.h:
3103
3104 2017-10-27  Chris Dumez  <cdumez@apple.com>
3105
3106         Unskip more Service Workers tests
3107         https://bugs.webkit.org/show_bug.cgi?id=178944
3108
3109         Reviewed by Sam Weinig.
3110
3111         Drop bad assertion that was causing the Service Worker WebProcess to crash and causing
3112         tests to fail as a result.
3113
3114         * workers/service/ServiceWorkerGlobalScope.cpp:
3115         (WebCore::ServiceWorkerGlobalScope::registration):
3116         * workers/service/ServiceWorkerGlobalScope.h:
3117
3118 2017-10-27  Ryan Haddad  <ryanhaddad@apple.com>
3119
3120         Unreviewed, rolling out r224011.
3121
3122         xsl LayoutTests hit an assertion added with this change since
3123         r223999 was rolled out.
3124
3125         Reverted changeset:
3126
3127         "Assert that no script is executed during style recalc"
3128         https://bugs.webkit.org/show_bug.cgi?id=178845
3129         https://trac.webkit.org/changeset/224011
3130
3131 2017-10-27  Antoine Quint  <graouts@apple.com>
3132
3133         [Web Animations] Expose the currentTime property on AnimationTimeline
3134         https://bugs.webkit.org/show_bug.cgi?id=178928
3135
3136         Reviewed by Dean Jackson.
3137
3138         We add the currentTime property on AnimationTimeline and add an internals method
3139         to set it in a test which will allow us to validate the timing model state for
3140         a given time.
3141
3142         Test: webanimations/timeline-current-time.html
3143
3144         * animation/AnimationTimeline.cpp:
3145         (WebCore::AnimationTimeline::bindingsCurrentTime const):
3146         (WebCore::AnimationTimeline::setCurrentTime):
3147         * animation/AnimationTimeline.h:
3148         (WebCore::AnimationTimeline::currentTime const):
3149         * animation/AnimationTimeline.idl:
3150         * testing/Internals.cpp:
3151         (WebCore::Internals::setTimelineCurrentTime):
3152         * testing/Internals.h:
3153         * testing/Internals.idl:
3154
3155 2017-10-27  Antoine Quint  <graouts@apple.com>
3156
3157         [Web Animations] Use Seconds vs. MonotonicTime to represent times
3158         https://bugs.webkit.org/show_bug.cgi?id=178950
3159
3160         Reviewed by Dean Jackson.
3161
3162         Animation start times, all expressed in seconds, in the Web Animations API are relative to the timeline
3163         originTime, itself relative to the page's nagigation time (Performance.navigationTime), so it makes more
3164         sense to use Seconds to represent them as opposed to a MonotonicTime.
3165
3166         * animation/WebAnimation.cpp:
3167         (WebCore::WebAnimation::bindingsStartTime const):
3168         (WebCore::WebAnimation::setBindingsStartTime):
3169         * animation/WebAnimation.h:
3170
3171 2017-10-27  Chris Dumez  <cdumez@apple.com>
3172
3173         DOMWindow::dispatchEvent() does not reset the event's dispatch flag
3174         https://bugs.webkit.org/show_bug.cgi?id=178897
3175
3176         Reviewed by Darin Adler.
3177
3178         Make sure we reset the currentTarget, dispatch flag, phase and propagation flags
3179         after dispatching an event on a Window, as per:
3180         - https://dom.spec.whatwg.org/#concept-event-dispatch
3181
3182         This behavior is consistent with Firefox.
3183
3184         Test: fast/events/window-load-initEvent.html
3185
3186         * page/DOMWindow.cpp:
3187         (WebCore::DOMWindow::dispatchEvent):
3188
3189 2017-10-27  Keith Miller  <keith_miller@apple.com>
3190
3191         Move iOS specific sources to unified sources
3192         https://bugs.webkit.org/show_bug.cgi?id=178915
3193
3194         Rubber-stamped by Tim Horton.
3195
3196         * SourcesCocoa.txt:
3197         * SourcesIOS.txt:
3198         * SourcesMac.txt:
3199         * WebCore.xcodeproj/project.pbxproj:
3200
3201 2017-10-27  Eric Carlson  <eric.carlson@apple.com>
3202
3203         NowPlayingInfo should contain a unique identifier
3204         https://bugs.webkit.org/show_bug.cgi?id=178872
3205         <rdar://problem/34924012>
3206
3207         Unreviewed, build fix.
3208
3209         * platform/audio/ios/MediaSessionManagerIOS.mm:
3210         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Call string.impl().hash() instead of
3211         string.existingHash() because the later will assert in a debug build if the hash hasn't
3212         been calculated yet.
3213         * platform/audio/mac/MediaSessionManagerMac.mm:
3214         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto.
3215
3216 2017-10-27  Alex Christensen  <achristensen@webkit.org>
3217
3218         Fix accessibility/mac/aria-label-on-label-element.html after r224074
3219         https://bugs.webkit.org/show_bug.cgi?id=178892
3220
3221         * accessibility/AccessibilityNodeObject.cpp:
3222         (WebCore::AccessibilityNodeObject::titleElementText const):
3223         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
3224         * accessibility/AccessibilityObject.h:
3225         (WebCore::AccessibilityText::AccessibilityText):
3226         Turns out my null checks changed behavior.  This undoes them.
3227
3228 2017-10-27  Ryan Haddad  <ryanhaddad@apple.com>
3229
3230         Unreviewed, rolling out r223999.
3231
3232         Caused xsl LayoutTest flakiness.
3233
3234         Reverted changeset:
3235
3236         "Style::Scope::flushPendingUpdate() can replace the entire
3237         document in XSLTProcessor::createDocumentFromSource"
3238         https://bugs.webkit.org/show_bug.cgi?id=178715
3239         https://trac.webkit.org/changeset/223999
3240
3241 2017-10-27  Chris Dumez  <cdumez@apple.com>
3242
3243         Audit init*Event() method to make sure they reset internal data members
3244         https://bugs.webkit.org/show_bug.cgi?id=178886
3245
3246         Reviewed by Ryosuke Niwa.
3247
3248         Audit init*Event() method to make sure they reset internal data members.
3249
3250         * dom/Event.cpp:
3251         (WebCore::Event::initEvent):
3252         * dom/KeyboardEvent.cpp:
3253         (WebCore::KeyboardEvent::initKeyboardEvent):
3254         * dom/MessageEvent.cpp:
3255         (WebCore::MessageEvent::initMessageEvent):
3256         * dom/MouseEvent.cpp:
3257         (WebCore::MouseEvent::initMouseEvent):
3258         * dom/MouseRelatedEvent.h:
3259         (WebCore::MouseRelatedEvent::setIsSimulated):
3260         * dom/TextEvent.cpp:
3261         (WebCore::TextEvent::initTextEvent):
3262         * dom/WheelEvent.cpp:
3263         (WebCore::WheelEvent::initWheelEvent):
3264
3265 2017-10-27  Chris Dumez  <cdumez@apple.com>
3266
3267         Add initial support for serviceWorkerClient.postMessage()
3268         https://bugs.webkit.org/show_bug.cgi?id=178794
3269
3270         Reviewed by Youenn Fablet.
3271
3272         Add initial support for serviceWorkerClient.postMessage():
3273         - https://w3c.github.io/ServiceWorker/#client-postmessage
3274
3275         It is now possible to do bi-directional communication with a service worker
3276         via postMessage().
3277
3278         No new tests, updated existing test.
3279
3280         * WebCore.xcodeproj/project.pbxproj:
3281         * dom/Document.cpp:
3282         (WebCore::generateDocumentIdentifier):
3283         (WebCore::Document::allDocumentsMap):
3284         (WebCore::Document::allDocuments):
3285         (WebCore::m_identifier):
3286         (WebCore::Document::~Document):
3287         * dom/Document.h:
3288         (WebCore::Document::identifier const):
3289         * dom/ScriptExecutionContext.cpp:
3290         (WebCore::ScriptExecutionContext::serviceWorkerContainer):
3291         * dom/ScriptExecutionContext.h:
3292         * workers/service/ServiceWorker.cpp:
3293         (WebCore::ServiceWorker::postMessage):
3294         * workers/service/ServiceWorkerClient.cpp:
3295         (WebCore::ServiceWorkerClient::ServiceWorkerClient):
3296         (WebCore::ServiceWorkerClient::~ServiceWorkerClient):
3297         (WebCore::ServiceWorkerClient::id const):
3298         (WebCore::ServiceWorkerClient::postMessage):
3299         * workers/service/ServiceWorkerClient.h:
3300         (WebCore::ServiceWorkerClient::create):
3301         * workers/service/ServiceWorkerClient.idl:
3302         * workers/service/ServiceWorkerClientIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
3303         (WebCore::ServiceWorkerClientIdentifier::toString const):
3304         * workers/service/ServiceWorkerRegistration.cpp:
3305         (WebCore::ServiceWorkerRegistration::unregister):
3306         * workers/service/ServiceWorkerWindowClient.cpp:
3307         (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
3308         * workers/service/ServiceWorkerWindowClient.h:
3309         * workers/service/context/SWContextManager.cpp:
3310         (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
3311         * workers/service/context/SWContextManager.h:
3312         * workers/service/context/ServiceWorkerThread.cpp:
3313         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
3314         * workers/service/context/ServiceWorkerThread.h:
3315         * workers/service/server/SWClientConnection.cpp:
3316         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
3317         * workers/service/server/SWClientConnection.h:
3318
3319 2017-10-27  Frederic Wang  <fwang@igalia.com>
3320
3321         Use auto for some variables in RenderLayerCompositor/Backing
3322         https://bugs.webkit.org/show_bug.cgi?id=178570
3323
3324         Reviewed by Darin Adler.
3325
3326         No new tests, behavior unchanged.
3327
3328         * rendering/RenderLayerBacking.cpp:
3329         (WebCore::canvasCompositingStrategy):
3330         (WebCore::RenderLayerBacking::RenderLayerBacking):
3331         (WebCore::computePageTiledBackingCoverage):
3332         (WebCore::RenderLayerBacking::layerWillBeDestroyed):
3333         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
3334         (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
3335         (WebCore::RenderLayerBacking::updateCompositedBounds):
3336         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
3337         (WebCore::RenderLayerBacking::updateAfterLayout):
3338         (WebCore::RenderLayerBacking::updateConfiguration):
3339         (WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
3340         (WebCore::RenderLayerBacking::updateGeometry):
3341         (WebCore::RenderLayerBacking::updateInternalHierarchy):
3342         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
3343         (WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers const):
3344         (WebCore::RenderLayerBacking::compositingOpacity const):
3345         (WebCore::isRestartedPlugin):
3346         (WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
3347         (WebCore::RenderLayerBacking::updateImageContents):
3348         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
3349         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
3350         (WebCore::RenderLayerBacking::getCurrentTransform const):
3351         (WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
3352         (WebCore::RenderLayerBacking::startAnimation):
3353         (WebCore::RenderLayerBacking::compositedBoundsIncludingMargin const):
3354         * rendering/RenderLayerCompositor.cpp:
3355         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
3356         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubframes):
3357         (WebCore::updateScrollingLayerWithClient):
3358         (WebCore::RenderLayerCompositor::didFlushChangesForLayer):
3359         (WebCore::RenderLayerCompositor::didPaintBacking):
3360         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
3361         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const):
3362         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3363         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
3364         (WebCore::RenderLayerCompositor::logLayerInfo):
3365         (WebCore::checkIfDescendantClippingContextNeedsUpdate):
3366         (WebCore::styleChangeRequiresLayerRebuild):
3367         (WebCore::RenderLayerCompositor::canCompositeClipPath):
3368         (WebCore::rendererForCompositingTests):
3369         (WebCore::RenderLayerCompositor::updateBacking):
3370         (WebCore::RenderLayerCompositor::repaintOnCompositingChange):
3371         (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
3372         (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
3373         (WebCore::RenderLayerCompositor::setCompositingParent):
3374         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
3375         (WebCore::RenderLayerCompositor::hasCoordinatedScrolling const):
3376         (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
3377         (WebCore::RenderLayerCompositor::positionForClipLayer const):
3378         (WebCore::RenderLayerCompositor::frameViewDidLayout):
3379         (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged):
3380         (WebCore::RenderLayerCompositor::scrollingLayerDidChange):
3381         (WebCore::RenderLayerCompositor::frameContentsCompositor):
3382         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
3383         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
3384         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
3385         (WebCore::RenderLayerCompositor::setIsInWindow):
3386         (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
3387         (WebCore::RenderLayerCompositor::clippedByAncestor const):
3388         (WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const):
3389         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
3390         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
3391         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
3392         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
3393         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
3394         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
3395         (WebCore::RenderLayerCompositor::requiresScrollLayer const):
3396         (WebCore::RenderLayerCompositor::supportsFixedRootBackgroundCompositing const):
3397         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayer const):
3398         (WebCore::RenderLayerCompositor::resetTrackedRepaintRects):
3399         (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles const):
3400         (WebCore::RenderLayerCompositor::documentUsesTiledBacking const):
3401         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
3402         (WebCore::RenderLayerCompositor::updateLayerForHeader):
3403         (WebCore::RenderLayerCompositor::updateLayerForFooter):
3404         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
3405         (WebCore::RenderLayerCompositor::ensureRootLayer):
3406         (WebCore::RenderLayerCompositor::destroyRootLayer):
3407         (WebCore::RenderLayerCompositor::attachRootLayer):
3408         (WebCore::RenderLayerCompositor::detachRootLayer):
3409         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
3410         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
3411         (WebCore::RenderLayerCompositor::deviceOrPageScaleFactorChanged):
3412         (WebCore::RenderLayerCompositor::computeFixedViewportConstraints const):
3413         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
3414         (WebCore::enclosingScrollingNodeID):
3415         (WebCore::scrollCoordinatedAncestorInParentOfFrame):
3416         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
3417         (WebCore::RenderLayerCompositor::attachScrollingNode):
3418         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
3419         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
3420         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
3421         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):
3422         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
3423         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
3424         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView):
3425
3426 2017-10-27  Alicia Boya García  <aboya@igalia.com>
3427
3428         [GStreamer][MSE] Trim space between codecs
3429         https://bugs.webkit.org/show_bug.cgi?id=178160
3430
3431         Reviewed by Xabier Rodriguez-Calvar.
3432
3433         Modify supportsCodecs() to accept a Vector<String> instead of
3434         receiving a string and parsing itself.
3435
3436         This improves passrate for `mediasource-is-type-supported` as it
3437         ensures that whitespace between codecs is now trimmed and codec
3438         strings such as `video/webm;codecs="opus, vp9"` are matched as a valid
3439         type, as required by the spec.
3440
3441         This patch also renames supportCodecs() to supportAllCodecs() and adds
3442         a new variant, supportCodec(), that checks for support of an
3443         individual codec.
3444
3445         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3446         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
3447         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3448         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodec):
3449         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsAllCodecs):
3450         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
3451         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
3452
3453 2017-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>
3454
3455         [GTK] Crash in WebCore::SelectionRangeData::apply
3456         https://bugs.webkit.org/show_bug.cgi?id=177808
3457
3458         Reviewed by Carlos Garcia Campos.
3459
3460         The problem appears to be a name collision between WebCore::SelectionData and
3461         WebCore::SelectionData. Yes, those are the same names. It seems the destructor for a
3462         Source/WebCore/platform/gtk/SelectionData.h SelectionData is being called on a
3463         Source/WebCore/rendering/SelectionRangeData.cpp SelectionData. Yikes. Can you forgive the
3464         poor linker for not being magic?
3465
3466         This fixes crashes in approximately one bajillion tests.
3467
3468         * rendering/SelectionRangeData.cpp: Move SelectionData into an anonymous namespace.
3469
3470 2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3471
3472         [WinCairo] Fix build after WebCore moves to unified source.
3473         https://bugs.webkit.org/show_bug.cgi?id=178920
3474
3475         Added empty implementations to fix link error.
3476
3477         Reviewed by Ryosuke Niwa.
3478
3479         * platform/network/curl/DNSCurl.cpp:
3480         (WebCore::DNSResolveQueue::updateIsUsingProxy):
3481         (WebCore::DNSResolveQueue::platformResolve):
3482
3483 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
3484
3485         Implement seek tolerance methods in WebAVPlayerController.
3486         https://bugs.webkit.org/show_bug.cgi?id=178838
3487         rdar://problem/33781777
3488
3489         Reviewed by Eric Carlson.
3490
3491         No new tests because this doesn't change any behavior in the page, but exposes seek tolerance to fullscreen platform UI.
3492
3493         * html/HTMLMediaElement.cpp:
3494         (WebCore::HTMLMediaElement::setCurrentTimeWithTolerance):
3495         * html/HTMLMediaElement.h:
3496         * platform/cocoa/PlaybackSessionModel.h:
3497         * platform/cocoa/PlaybackSessionModelMediaElement.h:
3498         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
3499         (WebCore::PlaybackSessionModelMediaElement::seekToTime):
3500         * platform/ios/WebAVPlayerController.mm:
3501         (-[WebAVPlayerController seekToTime:]):
3502         (-[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:]):
3503         (-[WebAVPlayerController seekByTimeInterval:]):
3504         (-[WebAVPlayerController seekByTimeInterval:toleranceBefore:toleranceAfter:]):
3505         (-[WebAVPlayerController seekToBeginning:]):
3506         (-[WebAVPlayerController seekToEnd:]):
3507         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3508         (VideoFullscreenControllerContext::seekToTime):
3509
3510 2017-10-26  Michael Catanzaro  <mcatanzaro@igalia.com>
3511
3512         Unreviewed, fix WPE build after r224074
3513         https://bugs.webkit.org/show_bug.cgi?id=178892
3514
3515         * accessibility/wpe/AccessibilityObjectWPE.cpp:
3516         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
3517
3518 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
3519
3520         When navigating back to a page, compositing layers may not use accelerated drawing
3521         https://bugs.webkit.org/show_bug.cgi?id=178749
3522         rdar://problem/35158946
3523
3524         Reviewed by Dean Jackson.
3525
3526         There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
3527         occurred on back navigation, related to the ordering of style recalcs and layout.
3528
3529         First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
3530         its cacheAcceleratedCompositingFlags(), so any layers created during style update
3531         didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
3532         to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().
3533
3534         Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
3535         before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
3536         the TileController.
3537
3538         Test: compositing/accelerated-layers-after-back.html
3539
3540         * page/FrameView.cpp:
3541         (WebCore::FrameView::updateCompositingLayersAfterLayout):
3542         * platform/graphics/ca/GraphicsLayerCA.cpp:
3543         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
3544         * rendering/RenderLayerCompositor.cpp:
3545         (WebCore::RenderLayerCompositor::willRecalcStyle):
3546         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
3547         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3548         * rendering/RenderLayerCompositor.h:
3549
3550 2017-10-26  Alex Christensen  <achristensen@webkit.org>
3551
3552         Fix Windows build
3553         https://bugs.webkit.org/show_bug.cgi?id=178892
3554
3555         * accessibility/win/AccessibilityObjectWin.cpp:
3556         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
3557
3558 2017-10-26  Alex Christensen  <achristensen@webkit.org>
3559
3560         Modernize AccessibilityObject.h
3561         https://bugs.webkit.org/show_bug.cgi?id=178892
3562
3563         Reviewed by Tim Horton.
3564
3565         The enums in AccessibilityObject.h are causing naming collisions with unified builds.
3566         This is what enum classes are for.
3567         HashMaps of enum classes still need a few casts to/from int.
3568         
3569         I also made some RefPtr's Ref's, use some initializer lists instead of values in the constructor implementation, and indentation fixing.
3570         
3571         No change in behavior.
3572
3573         * accessibility/AXObjectCache.cpp:
3574         (WebCore::AXComputedObjectAttributeCache::getIgnored const):
3575         (WebCore::AXObjectCache::~AXObjectCache):
3576         (WebCore::AXObjectCache::getOrCreate):
3577         (WebCore::AXObjectCache::remove):
3578         (WebCore::AXObjectCache::notificationPostTimerFired):
3579         * accessibility/AXObjectCache.h:
3580         (WebCore::AXComputedObjectAttributeCache::CachedAXObjectAttributes::CachedAXObjectAttributes):
3581         (WebCore::AXComputedObjectAttributeCache::getIgnored const):
3582         * accessibility/AccessibilityARIAGrid.cpp:
3583         (WebCore::AccessibilityARIAGrid::addChildren):
3584         * accessibility/AccessibilityARIAGridCell.cpp:
3585         (WebCore::AccessibilityARIAGridCell::parentRowGroup const):
3586         * accessibility/AccessibilityARIAGridRow.cpp:
3587         (WebCore::AccessibilityARIAGridRow::headerObject):
3588         * accessibility/AccessibilityAttachment.cpp:
3589         (WebCore::AccessibilityAttachment::accessibilityText):
3590         * accessibility/AccessibilityAttachment.h:
3591         * accessibility/AccessibilityImageMapLink.cpp:
3592         (WebCore::AccessibilityImageMapLink::roleValue const):
3593         (WebCore::AccessibilityImageMapLink::accessibilityText):
3594         * accessibility/AccessibilityLabel.cpp:
3595         (WebCore::childrenContainOnlyStaticText):
3596         * accessibility/AccessibilityLabel.h:
3597         * accessibility/AccessibilityList.cpp:
3598         (WebCore::AccessibilityList::isUnorderedList const):
3599         (WebCore::AccessibilityList::isOrderedList const):
3600         (WebCore::AccessibilityList::determineAccessibilityRole):
3601         (WebCore::AccessibilityList::roleValue const):
3602         * accessibility/AccessibilityListBox.cpp:
3603         (WebCore::AccessibilityListBox::setSelectedChildren):
3604         (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject const):
3605         * accessibility/AccessibilityListBox.h:
3606         * accessibility/AccessibilityListBoxOption.h:
3607         * accessibility/AccessibilityMathMLElement.cpp:
3608         (WebCore::AccessibilityMathMLElement::determineAccessibilityRole):
3609         (WebCore::AccessibilityMathMLElement::isMathScriptObject const):
3610         (WebCore::AccessibilityMathMLElement::isMathMultiscriptObject const):
3611         * accessibility/AccessibilityMediaControls.cpp:
3612         (WebCore::AccessibilityMediaControl::accessibilityText):
3613         (WebCore::AccessibilityMediaControl::roleValue const):
3614         * accessibility/AccessibilityMediaControls.h:
3615         * accessibility/AccessibilityMenuList.cpp:
3616         (WebCore::AccessibilityMenuList::addChildren):
3617         * accessibility/AccessibilityMenuList.h:
3618         * accessibility/AccessibilityMenuListOption.h:
3619         * accessibility/AccessibilityMenuListPopup.cpp:
3620         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject const):
3621         * accessibility/AccessibilityMenuListPopup.h:
3622         * accessibility/AccessibilityNodeObject.cpp:
3623         (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
3624         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
3625         (WebCore::AccessibilityNodeObject::canHaveChildren const):
3626         (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored const):
3627         (WebCore::AccessibilityNodeObject::isSearchField const):
3628         (WebCore::AccessibilityNodeObject::isImage const):
3629         (WebCore::AccessibilityNodeObject::isPasswordField const):
3630         (WebCore::AccessibilityNodeObject::isInputImage const):
3631         (WebCore::AccessibilityNodeObject::isProgressIndicator const):
3632         (WebCore::AccessibilityNodeObject::isSlider const):
3633         (WebCore::AccessibilityNodeObject::isMenuRelated const):
3634         (WebCore::AccessibilityNodeObject::isMenu const):
3635         (WebCore::AccessibilityNodeObject::isMenuBar const):
3636         (WebCore::AccessibilityNodeObject::isMenuButton const):
3637         (WebCore::AccessibilityNodeObject::isMenuItem const):
3638         (WebCore::AccessibilityNodeObject::isEnabled const):
3639         (WebCore::AccessibilityNodeObject::isChecked const):
3640         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute const):
3641         (WebCore::AccessibilityNodeObject::headingLevel const):
3642         (WebCore::AccessibilityNodeObject::isHeading const):
3643         (WebCore::AccessibilityNodeObject::isLink const):
3644         (WebCore::AccessibilityNodeObject::isGroup const):
3645         (WebCore::AccessibilityNodeObject::selectedRadioButton):
3646         (WebCore::AccessibilityNodeObject::checkboxOrRadioValue const):
3647         (WebCore::AccessibilityNodeObject::actionElement const):
3648         (WebCore::AccessibilityNodeObject::alterSliderValue):
3649         (WebCore::AccessibilityNodeObject::isGenericFocusableElement const):
3650         (WebCore::AccessibilityNodeObject::menuElementForMenuButton const):
3651         (WebCore::AccessibilityNodeObject::menuItemElementForMenu const):
3652         (WebCore::AccessibilityNodeObject::titleElementText const):
3653         (WebCore::AccessibilityNodeObject::alternativeText const):
3654         (WebCore::AccessibilityNodeObject::visibleText const):
3655         (WebCore::AccessibilityNodeObject::helpText const):
3656         (WebCore::AccessibilityNodeObject::accessibilityText):
3657         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
3658         (WebCore::AccessibilityNodeObject::accessibilityDescription const):
3659         (WebCore::AccessibilityNodeObject::roleIgnoresTitle const):
3660         (WebCore::AccessibilityNodeObject::hierarchicalLevel const):
3661         (WebCore::AccessibilityNodeObject::title const):
3662         (WebCore::AccessibilityNodeObject::text const):
3663         (WebCore::AccessibilityNodeObject::stringValue const):
3664         (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
3665         (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent const):
3666         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
3667         * accessibility/AccessibilityNodeObject.h:
3668         * accessibility/AccessibilityObject.cpp:
3669         (WebCore::AccessibilityObject::detach):
3670         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
3671         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
3672         (WebCore::AccessibilityObject::isBlockquote const):
3673         (WebCore::AccessibilityObject::isTextControl const):
3674         (WebCore::AccessibilityObject::isARIATextControl const):
3675         (WebCore::AccessibilityObject::isLandmark const):
3676         (WebCore::AccessibilityObject::findMatchingObjects):
3677         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
3678         (WebCore::AccessibilityObject::selectText):
3679         (WebCore::AccessibilityObject::isARIAInput):
3680         (WebCore::AccessibilityObject::isARIAControl):
3681         (WebCore::AccessibilityObject::isRangeControl const):
3682         (WebCore::AccessibilityObject::visiblePositionForBounds const):
3683         (WebCore::AccessibilityObject::supportsARIAReadOnly const):
3684         (WebCore::AccessibilityObject::ariaReadOnlyValue const):
3685         (WebCore::AccessibilityObject::headingElementForNode):
3686         (WebCore::AccessibilityObject::ariaTreeRows):
3687         (WebCore::AccessibilityObject::ariaTreeItemContent):
3688         (WebCore::AccessibilityObject::ariaTreeItemDisclosedRows):
3689         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
3690         (WebCore::AccessibilityObject::actionVerb const):
3691         (WebCore::AccessibilityObject::ariaCurrentState const):
3692         (WebCore::AccessibilityObject::ariaCurrentValue const):
3693         (WebCore::AccessibilityObject::orientation const):
3694         (WebCore::initializeRoleMap):
3695         (WebCore::AccessibilityObject::ariaRoleToWebCoreRole):
3696         (WebCore::AccessibilityObject::computedRoleString const):
3697         (WebCore::AccessibilityObject::supportsPressAction const):
3698         (WebCore::AccessibilityObject::sortDirection const):
3699         (WebCore::AccessibilityObject::supportsExpanded const):
3700         (WebCore::AccessibilityObject::isExpanded const):
3701         (WebCore::AccessibilityObject::supportsChecked const):
3702         (WebCore::AccessibilityObject::checkboxOrRadioValue const):
3703         (WebCore::AccessibilityObject::scrollByPage const):
3704         (WebCore::AccessibilityObject::lastKnownIsIgnoredValue):
3705         (WebCore::AccessibilityObject::setLastKnownIsIgnoredValue):
3706         (WebCore::AccessibilityObject::buttonRoleType const):
3707         (WebCore::AccessibilityObject::isButton const):
3708         (WebCore::AccessibilityObject::accessibilityIsIgnoredByDefault const):
3709         (WebCore::AccessibilityObject::defaultObjectInclusion const):
3710         (WebCore::AccessibilityObject::accessibilityIsIgnored const):
3711         (WebCore::AccessibilityObject::isContainedByPasswordField const):
3712         (WebCore::AccessibilityObject::AccessibilityObject): Deleted.
3713         * accessibility/AccessibilityObject.h:
3714         (WebCore::AccessibilityText::AccessibilityText):
3715         (WebCore::AccessibilityIsIgnoredFromParentData::AccessibilityIsIgnoredFromParentData):
3716         (WebCore::AccessibilityObject::isImageMap const):
3717         (WebCore::AccessibilityObject::isWebArea const):
3718         (WebCore::AccessibilityObject::isCheckbox const):
3719         (WebCore::AccessibilityObject::isRadioButton const):
3720         (WebCore::AccessibilityObject::isListBox const):
3721         (WebCore::AccessibilityObject::isSpinButton const):
3722         (WebCore::AccessibilityObject::isSwitch const):
3723         (WebCore::AccessibilityObject::isToggleButton const):
3724         (WebCore::AccessibilityObject::isTabList const):
3725         (WebCore::AccessibilityObject::isTabItem const):
3726         (WebCore::AccessibilityObject::isRadioGroup const):
3727         (WebCore::AccessibilityObject::isComboBox const):
3728         (WebCore::AccessibilityObject::isTree const):
3729         (WebCore::AccessibilityObject::isTreeGrid const):
3730         (WebCore::AccessibilityObject::isTreeItem const):
3731         (WebCore::AccessibilityObject::isScrollbar const):
3732         (WebCore::AccessibilityObject::isListItem const):
3733         (WebCore::AccessibilityObject::isScrollView const):
3734         (WebCore::AccessibilityObject::isCanvas const):
3735         (WebCore::AccessibilityObject::isPopUpButton const):
3736         (WebCore::AccessibilityObject::isColorWell const):
3737         (WebCore::AccessibilityObject::isSplitter const):
3738         (WebCore::AccessibilityObject::isToolbar const):
3739         (WebCore::AccessibilityObject::isSummary const):
3740         (WebCore::AccessibilityObject::isStaticText const):
3741         (WebCore::AccessibilityObject::ariaRoleAttribute const):
3742         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
3743         * accessibility/AccessibilityProgressIndicator.h:
3744         * accessibility/AccessibilityRenderObject.cpp:
3745         (WebCore::AccessibilityRenderObject::parentObject const):
3746         (WebCore::AccessibilityRenderObject::isAttachment const):
3747         (WebCore::AccessibilityRenderObject::helpText const):
3748         (WebCore::AccessibilityRenderObject::stringValue const):
3749         (WebCore::AccessibilityRenderObject::addRadioButtonGroupChildren const):
3750         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers const):
3751         (WebCore::AccessibilityRenderObject::linkedUIElements const):
3752         (WebCore::AccessibilityRenderObject::isAllowedChildOfTree const):
3753         (WebCore::objectInclusionFromAltText):
3754         (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
3755         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
3756         (WebCore::AccessibilityRenderObject::selectedTextRange const):
3757         (WebCore::AccessibilityRenderObject::isTabItemSelected const):
3758         (WebCore::AccessibilityRenderObject::isFocused const):
3759         (WebCore::AccessibilityRenderObject::setSelectedRows):
3760         (WebCore::AccessibilityRenderObject::getDocumentLinks):
3761         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
3762         (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
3763         (WebCore::AccessibilityRenderObject::supportsExpandedTextValue const):
3764         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3765         (WebCore::AccessibilityRenderObject::orientation const):
3766         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
3767         (WebCore::AccessibilityRenderObject::ariaRoleHasPresentationalChildren const):
3768         (WebCore::AccessibilityRenderObject::canSetExpandedAttribute const):
3769         (WebCore::AccessibilityRenderObject::addImageMapChildren):
3770         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
3771         (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
3772         (WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic const):
3773         (WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
3774         (WebCore::AccessibilityRenderObject::ariaListboxSelectedChildren):
3775         (WebCore::AccessibilityRenderObject::selectedChildren):
3776         (WebCore::AccessibilityRenderObject::visibleChildren):
3777         (WebCore::AccessibilityRenderObject::tabChildren):
3778         (WebCore::AccessibilityRenderObject::actionVerb const):
3779         (WebCore::msaaRoleForRenderer):
3780         (WebCore::AccessibilityRenderObject::roleValueForMSAA const):
3781         * accessibility/AccessibilitySVGElement.cpp:
3782         (WebCore::AccessibilitySVGElement::accessibilityText):
3783         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
3784         (WebCore::AccessibilitySVGElement::inheritsPresentationalRole const):
3785         (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute const):
3786         (WebCore::AccessibilitySVGElement::determineAccessibilityRole):
3787         * accessibility/AccessibilitySVGRoot.h:
3788         * accessibility/AccessibilityScrollView.cpp:
3789         (WebCore::AccessibilityScrollView::scrollBar):
3790         * accessibility/AccessibilityScrollView.h:
3791         * accessibility/AccessibilityScrollbar.cpp:
3792         (WebCore::AccessibilityScrollbar::orientation const):
3793         * accessibility/AccessibilityScrollbar.h:
3794         * accessibility/AccessibilitySlider.cpp:
3795         (WebCore::AccessibilitySlider::orientation const):
3796         (WebCore::AccessibilitySlider::addChildren):
3797         * accessibility/AccessibilitySlider.h:
3798         * accessibility/AccessibilitySpinButton.cpp:
3799         (WebCore::AccessibilitySpinButton::addChildren):
3800         * accessibility/AccessibilitySpinButton.h:
3801         * accessibility/AccessibilityTable.cpp:
3802         (WebCore::AccessibilityTable::hasARIARole const):
3803         (WebCore::AccessibilityTable::addChildren):
3804         (WebCore::AccessibilityTable::headerContainer):
3805         (WebCore::AccessibilityTable::roleValue const):
3806         (WebCore::AccessibilityTable::computeAccessibilityIsIgnored const):
3807         (WebCore::AccessibilityTable::titleElementText const):
3808         * accessibility/AccessibilityTableCell.cpp:
3809         (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored const):
3810         (WebCore::AccessibilityTableCell::determineAccessibilityRole):
3811         * accessibility/AccessibilityTableColumn.cpp:
3812         (WebCore::AccessibilityTableColumn::headerObject):
3813         * accessibility/AccessibilityTableColumn.h:
3814         * accessibility/AccessibilityTableHeaderContainer.h:
3815         * accessibility/AccessibilityTableRow.cpp:
3816         (WebCore::AccessibilityTableRow::determineAccessibilityRole):
3817         (WebCore::AccessibilityTableRow::computeAccessibilityIsIgnored const):
3818         * accessibility/AccessibilityTree.cpp:
3819         (WebCore::AccessibilityTree::determineAccessibilityRole):
3820         * accessibility/ios/AccessibilityObjectIOS.mm:
3821         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
3822         (WebCore::AccessibilityObject::isInputTypePopupButton const):
3823         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3824         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
3825         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
3826         (-[WebAccessibilityObjectWrapper _accessibilityTreeAncestor]):
3827         (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
3828         (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
3829         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
3830         (-[WebAccessibilityObjectWrapper _accessibilityTextEntryTraits]):
3831         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
3832         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3833         (-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
3834         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
3835         (-[WebAccessibilityObjectWrapper accessibilityValue]):
3836         (-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):
3837         (-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]):
3838         (-[WebAccessibilityObjectWrapper accessibilityLinkedElement]):
3839         (-[WebAccessibilityObjectWrapper treeItemParentForObject:]):
3840         (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):
3841         (-[WebAccessibilityObjectWrapper accessibilitySortDirection]):
3842         * accessibility/mac/AccessibilityObjectMac.mm:
3843         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
3844         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3845         (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
3846         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
3847         (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
3848         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
3849         (createAccessibilitySearchKeyMap):
3850         (accessibilitySearchKeyForString):
3851         (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
3852         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3853         (accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute):
3854         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
3855         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
3856         (createAccessibilityRoleMap):
3857         (roleValueToNSString):
3858         (-[WebAccessibilityObjectWrapper role]):
3859         (-[WebAccessibilityObjectWrapper subrole]):
3860         (-[WebAccessibilityObjectWrapper roleDescription]):
3861         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3862         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
3863         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
3864         * inspector/InspectorDOMAgent.cpp:
3865         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
3866
3867 2017-10-26  Youenn Fablet  <youenn@apple.com>
3868
3869         importScripts in service worker should use ServiceWorkersMode::None
3870         https://bugs.webkit.org/show_bug.cgi?id=178888
3871
3872         Reviewed by Chris Dumez.
3873
3874         Test: http/tests/workers/service/service-worker-importScript.html
3875
3876         Made sure ServiceWorkersMode::None is used for loading scripts in service workers as we do not support foreign fetch.
3877
3878         * workers/WorkerScriptLoader.cpp:
3879         (WebCore::WorkerScriptLoader::loadSynchronously):
3880
3881 2017-10-26  Keith Miller  <keith_miller@apple.com>
3882
3883         Unreviewed, cleanup changelogs.
3884
3885 2017-10-26  Keith Miller  <keith_miller@apple.com>
3886
3887         Unreviewed, add deprecated declarations pragma to fix macosx.
3888
3889         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3890
3891 2017-10-26  Andy Estes  <aestes@apple.com>
3892
3893         [Payment Request] Restrict API use to secure, same-origin frames
3894         https://bugs.webkit.org/show_bug.cgi?id=178887
3895
3896         Reviewed by Tim Horton.
3897
3898         Reuse the access checks from Apple Pay to restrict PaymentRequest API usage to secure frames
3899         in the same origin as the main frame.
3900
3901         Progresses active-document-cross-origin.https.sub.html and
3902         active-document-same-origin.https.html from web-platform-tests. Regresses basic.https.html
3903         since the allowpaymentrequest <iframe> attribute is not yet implemented.
3904
3905         * Modules/applepay/ApplePaySession.cpp:
3906         (WebCore::ApplePaySession::create):
3907         (WebCore::ApplePaySession::supportsVersion):
3908         (WebCore::ApplePaySession::canMakePayments):
3909         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
3910         (WebCore::ApplePaySession::openPaymentSetup):
3911         (WebCore::isSecure): Deleted.
3912         (WebCore::canCallApplePaySessionAPIs): Deleted.
3913         * Modules/applepay/PaymentSession.cpp: Added.
3914         (WebCore::isSecure):
3915         (WebCore::PaymentSession::canCreateSession):
3916         * Modules/applepay/PaymentSession.h:
3917         * Modules/paymentrequest/PaymentHandler.cpp:
3918         (WebCore::PaymentHandler::canCreateSession):
3919         * Modules/paymentrequest/PaymentHandler.h:
3920         * Modules/paymentrequest/PaymentRequest.cpp:
3921         (WebCore::PaymentRequest::create):
3922         * WebCore.xcodeproj/project.pbxproj:
3923
3924 2017-10-26  Youenn Fablet  <youenn@apple.com>
3925
3926         Add service worker handle fetch support for all subresource requests
3927         https://bugs.webkit.org/show_bug.cgi?id=178769
3928
3929         Reviewed by Chris Dumez.
3930
3931         Test: http/tests/workers/service/image-fetch.html
3932
3933         Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
3934         Setting the selected service worker identifier for subresource only at the moment.
3935
3936         Testing is limited to images, future wpt tests should cover other subresource cases.
3937
3938         * loader/DocumentThreadableLoader.cpp:
3939         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
3940         * loader/cache/CachedResourceLoader.cpp:
3941         (WebCore::CachedResourceLoader::prepareFetch):
3942         * loader/cache/CachedResourceRequest.cpp:
3943         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
3944         * loader/cache/CachedResourceRequest.h:
3945
3946 2017-10-26  Eric Carlson  <eric.carlson@apple.com>
3947
3948         NowPlayingInfo should contain a unique identifier
3949         https://bugs.webkit.org/show_bug.cgi?id=178872
3950
3951         Reviewed by Jer Noble.
3952
3953         Updated TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm.
3954
3955         * platform/audio/PlatformMediaSessionManager.h:
3956         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const): New.
3957
3958         * platform/audio/ios/MediaSessionManagerIOS.h:
3959         * platform/audio/ios/MediaSessionManagerIOS.mm:
3960         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Ditto.
3961
3962         * platform/audio/mac/MediaSessionManagerMac.h:
3963         * platform/audio/mac/MediaSessionManagerMac.mm:
3964         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto. Don't leak CFString.
3965
3966         * platform/mac/MediaRemoteSoftLink.cpp: Softlink kMRMediaRemoteNowPlayingInfoUniqueIdentifier.
3967         * platform/mac/MediaRemoteSoftLink.h:
3968
3969 2017-10-26  Keith Miller  <keith_miller@apple.com>
3970
3971         Unreviewed, iOS build fix.
3972
3973         * SourcesMac.txt:
3974         * WebCore.xcodeproj/project.pbxproj:
3975
3976 2017-10-26  Keith Miller  <keith_miller@apple.com>
3977
3978         Move Mac specific files to unified sources
3979         https://bugs.webkit.org/show_bug.cgi?id=178883
3980
3981         Rubber-stamped by Tim Horton.
3982
3983         * SourcesCocoa.txt:
3984         * SourcesMac.txt:
3985         * WebCore.xcodeproj/project.pbxproj:
3986
3987 2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>
3988
3989         DidMoveToNewDocumentAssertionScope shouldn't be necessary
3990         https://bugs.webkit.org/show_bug.cgi?id=178836