Unreviewed, rolling out r224273 and r224278.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-11-01  Commit Queue  <commit-queue@webkit.org>
2
3         Unreviewed, rolling out r224273 and r224278.
4         https://bugs.webkit.org/show_bug.cgi?id=179120
5
6         Some crashes under guard malloc (Requested by anttik on
7         #webkit).
8
9         Reverted changesets:
10
11         "Remove empty continuations in
12         RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers"
13         https://bugs.webkit.org/show_bug.cgi?id=179014
14         https://trac.webkit.org/changeset/224273
15
16         "Fix ContinuationChainNode::insertAfter assertion."
17         https://bugs.webkit.org/show_bug.cgi?id=179115
18         https://trac.webkit.org/changeset/224278
19
20 2017-11-01  Emilio Cobos Álvarez  <emilio@crisal.io>
21
22         Fix ContinuationChainNode::insertAfter assertion.
23         https://bugs.webkit.org/show_bug.cgi?id=179115
24
25         Reviewed by Antti Koivisto.
26
27         The assertion was writing instead of reading next->previous.
28
29         Hopefully it's harmless because it was clobbered on the same line, but
30         it's worth asserting what it was intending to assert.
31
32         No new tests (no behaviour change).
33
34         * rendering/RenderBoxModelObject.cpp:
35         (WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):
36
37 2017-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
38
39         Use LazyNeverDestroyed instead of DEFINE_GLOBAL
40         https://bugs.webkit.org/show_bug.cgi?id=174979
41
42         Reviewed by Yusuke Suzuki.
43
44         No new tests since there should be no behavioral change.
45
46         * DerivedSources.cpp: Remove the warning of StaticConstructors.h.
47         * WebCore.order: Removed
48         * config.h: Removed definitions of SKIP_STATIC_CONSTRUCTORS_ON_MSVC and SKIP_STATIC_CONSTRUCTORS_ON_GCC.
49         * dom/QualifiedName.cpp:
50         (WebCore::createQualifiedName): Deleted.
51         * dom/QualifiedName.h: Removed createQualifiedName.
52         * dom/make_names.pl:
53         (printCppHead): Do not include StaticConstructors.h.
54
55 2017-11-01  Michael Catanzaro  <mcatanzaro@igalia.com>
56
57         [GTK] Always include TextureMapper.cmake
58         https://bugs.webkit.org/show_bug.cgi?id=179060
59
60         Reviewed by Carlos Garcia Campos.
61
62         * PlatformGTK.cmake:
63
64 2017-11-01  Antti Koivisto  <antti@apple.com>
65
66         Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers
67         https://bugs.webkit.org/show_bug.cgi?id=179014
68
69         Reviewed by Geoff Garen.
70
71         Treat continuation similarly to other anonymous wrappers. This makes things more understandable
72         and allows removal of some questionable code in RenderBlock::takeChild.
73
74         The patch also makes continuation chain a double linked so we can efficiently remove single
75         continuations from the chain. It also gets rid of algorithms that recurse in continuation chain.
76
77         * accessibility/AccessibilityRenderObject.cpp:
78         (WebCore::firstChildInContinuation):
79         * rendering/RenderBlock.cpp:
80         (WebCore::RenderBlock::styleDidChange):
81
82             Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
83             the chain only in the (non-continuation) head renderer.
84
85         (WebCore::RenderBlock::dropAnonymousBoxChild):
86
87             Make a member function.
88
89         (WebCore::RenderBlock::takeChild):
90
91             Remove code that destroyed empty continuations and caused the parent to destroy itself.
92             Empty continuations are now removed by RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers.
93
94         * rendering/RenderBlock.h:
95         * rendering/RenderBoxModelObject.cpp:
96         (WebCore::RenderBoxModelObject::ContinuationChainNode::ContinuationChainNode):
97         (WebCore::RenderBoxModelObject::ContinuationChainNode::~ContinuationChainNode):
98         (WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):
99
100             Track continuations with double linked lists.
101
102         (WebCore::continuationChainNodeMap):
103         (WebCore::RenderBoxModelObject::willBeDestroyed):
104
105             Don't recurse to destroy continuation chain. 
106             Destroy all continuations iteratively if this is the head of the chain.
107             When destroying a continuation renderer simply remove it from the chain.
108
109         (WebCore::RenderBoxModelObject::continuation const):
110         (WebCore::RenderBoxModelObject::insertIntoContinuationChainAfter):
111         (WebCore::RenderBoxModelObject::removeFromContinuationChain):
112         (WebCore::RenderBoxModelObject::ensureContinuationChainNode):
113         (WebCore::continuationMap): Deleted.
114         (WebCore::RenderBoxModelObject::setContinuation): Deleted.
115         * rendering/RenderBoxModelObject.h:
116         * rendering/RenderElement.cpp:
117         (WebCore::RenderElement::RenderElement):
118         (WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary):
119
120             Make this a function of the parent renderer itself instead of getting 'parent()' as first operation and
121             then using it.
122             Don't remove continuations (isAnonymousBlockContinuation() test gives wrong result for the last continuation of the chain).
123
124         (WebCore::RenderElement::styleDidChange):
125
126             removeAnonymousWrappersForInlinesIfNecessary is no function of the parent.
127
128         (WebCore::RenderElement::updateOutlineAutoAncestor):
129         * rendering/RenderElement.h:
130         (WebCore::RenderElement::hasContinuationChainNode const):
131         (WebCore::RenderElement::setHasContinuationChainNode):
132         (WebCore::RenderElement::hasContinuation const): Deleted.
133         (WebCore::RenderElement::setHasContinuation): Deleted.
134         * rendering/RenderInline.cpp:
135         (WebCore::RenderInline::styleDidChange):
136
137             Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
138             the chain only in the (non-continuation) head renderer.
139
140         (WebCore::RenderInline::addChildIgnoringContinuation):
141
142             Remove the old continuation from the chain. splitFlow() will add it back into the right place.
143
144         (WebCore::RenderInline::splitInlines):
145         (WebCore::RenderInline::addChildToContinuation):
146         (WebCore::RenderInline::childBecameNonInline):
147
148             Remove the old continuation from the chain. splitFlow() will add it back into the right place.
149
150         * rendering/RenderInline.h:
151         * rendering/RenderObject.cpp:
152         (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const):
153         (WebCore::RenderObject::outputRenderObject const):
154         (WebCore::findDestroyRootIncludingAnonymous):
155
156             Allow anonymous continuations as destroy roots.
157
158         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
159
160             Removing a continuation may leave behind unnecessary anonymous sibling wrappers.
161             Call removeAnonymousWrappersForInlinesIfNecessary() on parent after removal to get rid of them.
162
163 2017-10-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
164
165         updateMaskedAncestorShouldIsolateBlending() should check the Nullability of the computedStyle() of the element's ancestors
166         https://bugs.webkit.org/show_bug.cgi?id=179085
167         <rdar://problem/30888101>
168
169         Reviewed by Ryosuke Niwa.
170
171         This is a defensive change. The Element::computedStyle() can be null only
172         if the element is not a connected to the DOM tree. This may happen if
173         while the DOM tree is being changed, a different event is handled such
174         that it requires styleReclac()/layout() to happen. In this case, the render
175         tree will be in an incorrect state.
176
177         * rendering/svg/SVGRenderSupport.cpp:
178         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
179
180 2017-10-31  Alex Christensen  <achristensen@webkit.org>
181
182         Use asynchronous ResourceHandleClient calls for WebKit1
183         https://bugs.webkit.org/show_bug.cgi?id=160677
184
185         Reviewed by Brady Eidson.
186
187         Covered by existing tests.
188
189         * PlatformAppleWin.cmake:
190         * PlatformMac.cmake:
191         * WebCore.xcodeproj/project.pbxproj:
192         * loader/ResourceLoader.cpp:
193         (WebCore::ResourceLoader::willSendRequestAsync):
194         (WebCore::ResourceLoader::didReceiveResponseAsync):
195         (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
196         * loader/ResourceLoader.h:
197         * loader/appcache/ApplicationCacheGroup.cpp:
198         (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
199         (WebCore::ApplicationCacheGroup::willSendRequestAsync):
200         (WebCore::ApplicationCacheGroup::canAuthenticateAgainstProtectionSpaceAsync):
201         (WebCore::ApplicationCacheGroup::didReceiveResponse): Deleted.
202         * loader/appcache/ApplicationCacheGroup.h:
203         * platform/network/BlobResourceHandle.cpp:
204         (WebCore::BlobResourceHandle::continueDidReceiveResponse):
205         (WebCore::BlobResourceHandle::getSizeForNext):
206         (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
207         (WebCore::BlobResourceHandle::notifyResponseOnError):
208         * platform/network/PingHandle.h:
209         * platform/network/ResourceHandle.cpp:
210         (WebCore::ResourceHandle::didReceiveResponse):
211         (WebCore::ResourceHandle::usesAsyncCallbacks): Deleted.
212         * platform/network/ResourceHandle.h:
213         * platform/network/ResourceHandleClient.cpp:
214         (WebCore::ResourceHandleClient::~ResourceHandleClient):
215         (WebCore::ResourceHandleClient::willSendRequest): Deleted.
216         (WebCore::ResourceHandleClient::willSendRequestAsync): Deleted.
217         (WebCore::ResourceHandleClient::didReceiveResponseAsync): Deleted.
218         (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
219         * platform/network/ResourceHandleClient.h:
220         (WebCore::ResourceHandleClient::didReceiveAuthenticationChallenge):
221         (WebCore::ResourceHandleClient::didReceiveResponse): Deleted.
222         (WebCore::ResourceHandleClient::usesAsyncCallbacks): Deleted.
223         (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpace): Deleted.
224         * platform/network/ResourceHandleInternal.h:
225         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
226         * platform/network/SynchronousLoaderClient.cpp:
227         (WebCore::SynchronousLoaderClient::willSendRequestAsync):
228         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
229         (WebCore::SynchronousLoaderClient::didReceiveResponseAsync):
230         (WebCore::SynchronousLoaderClient::didFinishLoading):
231         (WebCore::SynchronousLoaderClient::didFail):
232         (WebCore::SynchronousLoaderClient::willSendRequest): Deleted.
233         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace): Deleted.
234         (WebCore::SynchronousLoaderClient::didReceiveResponse): Deleted.
235         * platform/network/SynchronousLoaderClient.h:
236         * platform/network/cf/ResourceHandleCFNet.cpp:
237         (WebCore::ResourceHandle::createCFURLConnection):
238         (WebCore::ResourceHandle::start):
239         (WebCore::ResourceHandle::willSendRequest):
240         (WebCore::ResourceHandle::shouldUseCredentialStorage):
241         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
242         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
243         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
244         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::ResourceHandleCFURLConnectionDelegateWithOperationQueue):
245         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle):
246         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
247         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
248         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
249         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
250         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
251         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
252         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
253         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
254         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::shouldUseCredentialStorage):
255         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
256         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueCanAuthenticateAgainstProtectionSpace):
257         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
258         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Removed.
259         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: Removed.
260         * platform/network/mac/ResourceHandleMac.mm:
261         (WebCore::ResourceHandle::start):
262         (WebCore::ResourceHandle::schedule):
263         (WebCore::ResourceHandle::makeDelegate):
264         (WebCore::ResourceHandle::delegate):
265         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
266         (WebCore::ResourceHandle::willSendRequest):
267         (WebCore::ResourceHandle::continueWillSendRequest):
268         (WebCore::ResourceHandle::continueDidReceiveResponse):
269         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
270         (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace):
271         (WebCore::ResourceHandle::continueWillCacheResponse):
272         (WebCore::ResourceHandle::shouldUseCredentialStorage): Deleted.
273         * platform/network/mac/WebCoreResourceHandleAsDelegate.h: Removed.
274         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Removed.
275         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
276         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
277         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
278         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
279         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
280         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
281         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
282         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
283         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
284         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
285
286 2017-10-31  Simon Fraser  <simon.fraser@apple.com>
287
288         Rubber-banding overflow-scrolling-touch shows black
289         https://bugs.webkit.org/show_bug.cgi?id=179087
290         rdar://problem/35260253
291
292         Reviewed by Sam Weinig.
293
294         The "backgroundIsKnownToBeObscured" optimization was kicking in for an overflow:scroll
295         whose area was completely covered by its contents, which happens with overlay scrollbars.
296
297         However, this ignored the fact that you can rubber-band to reveal the background, and,
298         on iOS, composited scrolling requires that the scroller background is painted since it goes
299         into its own layer.
300
301         Fix by turning off the optimization for layers that scroll overflow, including those
302         using composited scrolling.
303
304         Test: fast/scrolling/rubber-band-shows-background.html
305
306         * rendering/RenderBox.cpp:
307         (WebCore::RenderBox::foregroundIsKnownToBeOpaqueInRect const):
308         (WebCore::RenderBox::computeBackgroundIsKnownToBeObscured):
309         * rendering/RenderLayer.cpp:
310         (WebCore::RenderLayer::scrollTo):
311         (WebCore::RenderLayer::calculateClipRects const):
312         * rendering/RenderLayer.h:
313
314 2017-10-31  Tim Horton  <timothy_horton@apple.com>
315
316         Clean up some drag and drop feature flags
317         https://bugs.webkit.org/show_bug.cgi?id=179082
318
319         Reviewed by Simon Fraser.
320
321         * Configurations/FeatureDefines.xcconfig:
322
323 2017-10-31  Simon Fraser  <simon.fraser@apple.com>
324
325         Make it possible to test rubber-banding in overflow scroll
326         https://bugs.webkit.org/show_bug.cgi?id=179078
327
328         Reviewed by Sam Weinig.
329
330         Test: fast/scrolling/unconstrained-scrollto.html
331         
332         Add internals.unconstrainedScrollTo(element, x, y) and plumb through ScrollClamping
333         (which replaces RenderLayer::ScrollOffsetClamping) to support it.
334
335         Flip the default from unclamped to clamped for various RenderLayer scrolling-related
336         functions, since most callers want clamped.
337
338         * accessibility/AccessibilityRenderObject.cpp:
339         (WebCore::AccessibilityRenderObject::scrollTo const):
340         * dom/Element.cpp:
341         (WebCore::Element::scrollTo):
342         * dom/Element.h:
343         * html/HTMLBodyElement.cpp:
344         (WebCore::HTMLBodyElement::scrollTo):
345         * html/HTMLBodyElement.h:
346         * html/TextFieldInputType.cpp:
347         (WebCore::TextFieldInputType::elementDidBlur):
348         * page/DOMWindow.cpp:
349         (WebCore::DOMWindow::scrollTo const):
350         * page/DOMWindow.h:
351         * page/Frame.cpp:
352         (WebCore::Frame::scrollOverflowLayer):
353         (WebCore::Frame::checkOverflowScroll):
354         * platform/ScrollAnimator.cpp:
355         (WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation):
356         * platform/ScrollAnimator.h:
357         * platform/ScrollTypes.h:
358         * platform/ScrollableArea.cpp:
359         (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
360         * platform/ScrollableArea.h:
361         * platform/cocoa/ScrollController.h:
362         * platform/mac/ScrollAnimatorMac.h:
363         * platform/mac/ScrollAnimatorMac.mm:
364         (WebCore::ScrollAnimatorMac::scrollToOffsetWithoutAnimation):
365         (WebCore::ScrollAnimatorMac::immediateScrollToPosition):
366         * platform/mock/ScrollAnimatorMock.h:
367         * rendering/RenderBox.cpp:
368         (WebCore::RenderBox::setScrollLeft):
369         (WebCore::RenderBox::setScrollTop):
370         * rendering/RenderBox.h:
371         * rendering/RenderLayer.cpp:
372         (WebCore::RenderLayer::panScrollFromPoint):
373         (WebCore::RenderLayer::scrollByRecursively):
374         (WebCore::RenderLayer::applyPostLayoutScrollPositionIfNeeded):
375         (WebCore::RenderLayer::scrollToXPosition):
376         (WebCore::RenderLayer::scrollToYPosition):
377         (WebCore::RenderLayer::scrollToOffset):
378         * rendering/RenderLayer.h:
379         * rendering/RenderListBox.cpp:
380         (WebCore::RenderListBox::setScrollLeft):
381         (WebCore::RenderListBox::setScrollTop):
382         * rendering/RenderListBox.h:
383         * rendering/RenderTextControlSingleLine.cpp:
384         (WebCore::RenderTextControlSingleLine::setScrollLeft):
385         (WebCore::RenderTextControlSingleLine::setScrollTop):
386         * rendering/RenderTextControlSingleLine.h:
387         * testing/Internals.cpp:
388         (WebCore::Internals::unconstrainedScrollTo):
389         * testing/Internals.h:
390         * testing/Internals.idl:
391
392 2017-10-31  Dean Jackson  <dino@apple.com>
393
394         Accept Settings object in ImageBitmapRenderingContext constructor and getContext
395         https://bugs.webkit.org/show_bug.cgi?id=179075
396         <rdar://problem/35279965>
397
398         Reviewed by Sam Weinig.
399
400         Allow getContext("bitmaprenderer") to take a dictionary as another argument, and
401         pass that on to the ImageBitmapRenderingContext constructor.
402
403         Unfortunately this meant having to move ImageBitmapRenderingContext::Settings out into
404         a stand-alone struct, since it needs to be defined in HTMLCanvasElement, which itself
405         needs to be defined for ImageBitmapRenderingContext.
406
407         * DerivedSources.make: Add new IDL.
408         * WebCore.xcodeproj/project.pbxproj: New files.
409
410         * html/HTMLCanvasElement.cpp:
411         (WebCore::HTMLCanvasElement::createContextBitmapRenderer):
412         (WebCore::HTMLCanvasElement::getContextBitmapRenderer):
413
414             Accept the ImageBitmapRenderingContextSettings object, and pass it on.
415
416         * html/HTMLCanvasElement.h:
417         * html/canvas/ImageBitmapRenderingContext.cpp:
418         (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
419         * html/canvas/ImageBitmapRenderingContext.h:
420         * html/canvas/ImageBitmapRenderingContext.idl:
421         * html/canvas/ImageBitmapRenderingContextSettings.h: Copied from Source/WebCore/html/canvas/ImageBitmapRenderingContext.idl.
422         * html/canvas/ImageBitmapRenderingContextSettings.idl: Added.
423
424 2017-10-31  Tim Horton  <timothy_horton@apple.com>
425
426         Fix up some content filtering feature flags
427         https://bugs.webkit.org/show_bug.cgi?id=179079
428
429         Reviewed by Simon Fraser.
430
431         * Configurations/FeatureDefines.xcconfig:
432
433 2017-10-31  Chris Dumez  <cdumez@apple.com>
434
435         navigator.serviceWorker should always return the same object
436         https://bugs.webkit.org/show_bug.cgi?id=179067
437
438         Reviewed by Youenn Fablet.
439
440         navigator.serviceWorker should always return the same object:
441         - https://www.w3.org/TR/service-workers-1/#navigator-service-worker
442
443         Add visitor to make sure we don't gc() the ServiceWorkerContainer wrapper too early.
444
445         Test: http/tests/workers/service/navigator-serviceWorker-same-object.html
446
447         * Sources.txt:
448         * WebCore.xcodeproj/project.pbxproj:
449         * bindings/js/JSNavigatorCustom.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerContainer.idl.
450         (WebCore::JSNavigator::visitAdditionalChildren):
451         * page/Navigator.idl:
452         * workers/service/ServiceWorkerContainer.idl:
453
454 2017-10-31  Antoine Quint  <graouts@apple.com>
455
456         [Web Animations] Support AnimationEffect parameter in Animation constructor and read-write timeline property
457         https://bugs.webkit.org/show_bug.cgi?id=179066
458
459         Reviewed by Dean Jackson.
460
461         We update the Animation constructor signature and behavior to allow for an AnimationEffect as its first,
462         null by default, parameter and implement the spec behavior where an omitted AnimationTimeline parameter
463         should default to the document timeline. We also make the timeline property read-write.
464
465         Existing tests are rebaselined and amended for this new behavior.
466
467         * animation/WebAnimation.cpp:
468         (WebCore::WebAnimation::create):
469         (WebCore::WebAnimation::WebAnimation):
470         (WebCore::WebAnimation::setEffect):
471         (WebCore::WebAnimation::setTimeline):
472         * animation/WebAnimation.h:
473         * animation/WebAnimation.idl:
474
475 2017-10-31  Ali Juma  <ajuma@chromium.org>
476
477         Layout viewport rect is too wide after window resize
478         https://bugs.webkit.org/show_bug.cgi?id=175235
479
480         Reviewed by Dave Hyatt.
481
482         After a window resize, ScrollView::updateScrollbars adds/removes scrollbars and triggers
483         layout. Each addition or removal triggers another pass, but at most 2 additional passes
484         are allowed. If a scrollbar is added or removed in the final allowed pass, layout is
485         left in an inconsistent state wrt the presence of scrollbars.
486
487         To avoid unnecessary passes, don't remove both scrollbars when only one needs to be
488         removed. This saves the extra pass needed to add the scrollbar back.
489
490         Test: fast/dom/Window/window-resize-update-scrollbars.html
491
492         * platform/ScrollView.cpp:
493         (WebCore::ScrollView::updateScrollbars):
494
495 2017-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
496
497         [Attachment Support] Implement WKWebView SPI for inserting attachment elements
498         https://bugs.webkit.org/show_bug.cgi?id=179013
499         <rdar://problem/35249668>
500
501         Reviewed by Tim Horton.
502
503         Adds Editor helper methods to insert an attachment element at the current selection.
504
505         Test: WKAttachmentTests.AttachmentElementInsertion
506
507         * editing/Editor.cpp:
508         (WebCore::Editor::insertAttachment):
509         (WebCore::Editor::insertAttachmentFromFile):
510         * editing/Editor.h:
511
512         Add two new helpers for inserting attachment elements, either from a filename or a data blob. This is a wrapper
513         around Editor::replaceSelectionWithFragment.
514
515         * html/HTMLAttachmentElement.cpp:
516         (WebCore::HTMLAttachmentElement::HTMLAttachmentElement):
517         (WebCore::HTMLAttachmentElement::create):
518         * html/HTMLAttachmentElement.h:
519
520         Add a unique identifier string to HTMLAttachmentElement. This unique identifier allows the UI process to
521         reference and indirectly manipulate attachment elements.
522
523 2017-10-31  Alex Christensen  <achristensen@webkit.org>
524
525         Fix custom header field setting with reloads and asynchronous navigation action policy decisions
526         https://bugs.webkit.org/show_bug.cgi?id=179064
527
528         Reviewed by Tim Horton.
529
530         r223909 had two problems:
531         1. It called addHTTPHeaderField instead of setHTTPHeaderField, so when a page is reloaded the header field
532         is added to the resource request to be reloaded, which already had the headers added.
533         2. It only worked in the synchronous decidePolicyForNavigationAction code path, not for asynchronous completion handlers.
534
535         These are both fixed, and both cases are covered with new API tests.
536
537         * loader/cache/CachedResourceLoader.cpp:
538         (WebCore::CachedResourceLoader::requestResource):
539
540 2017-10-31  Devin Rousso  <webkit@devinrousso.com>
541
542         Web Inspector: make ScriptCallStack::maxCallStackSizeToCapture the default value when capturing backtraces
543         https://bugs.webkit.org/show_bug.cgi?id=179048
544
545         Reviewed by Mark Lam.
546
547         No change in functionality.
548
549         * bindings/js/JSDOMExceptionHandling.cpp:
550         (WebCore::reportException):
551         * dom/RejectedPromiseTracker.cpp:
552         (WebCore::createScriptCallStackFromReason):
553         * html/canvas/WebGLRenderingContextBase.cpp:
554         (WebCore::WebGLRenderingContextBase::compileShader):
555         (WebCore::WebGLRenderingContextBase::printToConsole):
556         * inspector/InspectorNetworkAgent.cpp:
557         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
558         * inspector/PageDebuggerAgent.cpp:
559         (WebCore::PageDebuggerAgent::breakpointActionLog):
560         * inspector/WorkerDebuggerAgent.cpp:
561         (WebCore::WorkerDebuggerAgent::breakpointActionLog):
562         * page/DOMWindow.cpp:
563         (WebCore::DOMWindow::postMessage):
564
565 2017-10-31  Michael Catanzaro  <mcatanzaro@igalia.com>
566
567         [GTK] Build more files under WebCore as unified sources
568         https://bugs.webkit.org/show_bug.cgi?id=178968
569
570         Reviewed by Keith Miller.
571
572         * PlatformGTK.cmake:
573         * PlatformWPE.cmake:
574         * SourcesGTK.txt: Added.
575         * SourcesWPE.txt:
576
577 2017-10-30  Ryosuke Niwa  <rniwa@webkit.org>
578
579         Assert that no script is executed during LayoutPhase::InRenderTreeLayout
580         https://bugs.webkit.org/show_bug.cgi?id=179046
581
582         Reviewed by Antti Koivisto.
583
584         Added NoEventDispatchAssertion to LayoutPhase::InRenderTreeLayout.
585
586         * page/LayoutContext.cpp:
587         (WebCore::LayoutContext::layout):
588
589 2017-10-31  Devin Rousso  <webkit@devinrousso.com>
590
591         Web Inspector: replace Canvas stack iteration with createScriptCallStack
592         https://bugs.webkit.org/show_bug.cgi?id=178980
593
594         Reviewed by Joseph Pecoraro.
595
596         No new tests, updated existing tests.
597
598         * inspector/InspectorCanvas.cpp:
599         (WebCore::InspectorCanvas::buildObjectForCanvas):
600         (WebCore::InspectorCanvas::buildAction):
601         (WebCore::iterateCallFrames): Deleted.
602
603 2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
604
605         [FreeType] Simple and complex paths are not applied consistently
606         https://bugs.webkit.org/show_bug.cgi?id=177601
607
608         Reviewed by Michael Catanzaro.
609
610         Due to bug #100050, when rendering text, the complex path is forced in case kerning or shaping is enabled and
611         only part of the run is going to be rendered. This happens in the GTK+ port when selecting text (except when
612         selecting the whole run, of course). The text is initially rendered using the simple path as returned by
613         FontCascade::codePath() and then the selection is rendered using the complex path, overriding what
614         FontCascade::codePath() returned in that case. This doesn't happen in mac, because the selection is rendered
615         differently, so FontCascade::drawText always renders the full run (simple path) when selecting text. Selecting
616         text is the most noticeable inconsistency, but it's not the only one. Similar exceptions are applied when
617         calculating the text width, or getting the offset of a given position. The rendered text is the simple one, but
618         the calculations are performed using the complex path, so depending on the kerning and ligatures we might end up
619         with wrong results. If the text has been rendered using the simple path, the selections and all other
620         calculations should be performed with the simple path too. This patch moves the condition to force complex text
621         to FontCascade::codePath(), and only for non Freetype ports. This ensures that all callers to
622         FontCascade::codePath() will get a consistent result.
623
624         * platform/graphics/FontCascade.cpp:
625         (WebCore::FontCascade::drawText const): Use the mode returned by codePath().
626         (WebCore::FontCascade::drawEmphasisMarks const): Ditto.
627         (WebCore::FontCascade::adjustSelectionRectForText const): Use the mode returned by codePath().
628         (WebCore::FontCascade::offsetForPosition const): Ditto.
629         (WebCore::FontCascade::codePath const): Force complex text for partial runs for ports not enabling advance text
630         rendering mode by default.
631         * platform/graphics/FontCascade.h: Add to and from optional parameters to codePath().
632
633 2017-10-30  Chris Dumez  <cdumez@apple.com>
634
635         Fire updatefound event after resolving the registration promise
636         https://bugs.webkit.org/show_bug.cgi?id=178985
637
638         Reviewed by Youenn Fablet.
639
640         Fake series of events that are supposed to happen after registering a service worker
641         that notify the page of the service worker's installation and activation.
642
643         Also make sure that registration.installing / waiting / active return proper values.
644         Make sure that serviceWorker.scriptURL returns a proper value.
645
646         This unblocks a lot of web-platform-tests since they were blocked shortly after
647         registration due to missing events or registration.installing being null.
648
649         * dom/ScriptExecutionContext.cpp:
650         (WebCore::ScriptExecutionContext::activeServiceWorker const):
651         (WebCore::ScriptExecutionContext::setActiveServiceWorker):
652         * dom/ScriptExecutionContext.h:
653         * loader/WorkerThreadableLoader.cpp:
654         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
655         * loader/cache/CachedResourceLoader.cpp:
656         (WebCore::CachedResourceLoader::prepareFetch):
657         * workers/WorkerScriptLoader.cpp:
658         (WebCore::WorkerScriptLoader::loadSynchronously):
659         (WebCore::WorkerScriptLoader::loadAsynchronously):
660         * workers/service/ServiceWorker.cpp:
661         (WebCore::ServiceWorker::ServiceWorker):
662         (WebCore::ServiceWorker::setState):
663         * workers/service/ServiceWorker.h:
664         * workers/service/ServiceWorkerContainer.cpp:
665         (WebCore::ServiceWorkerContainer::controller const):
666         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
667         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
668         * workers/service/ServiceWorkerContainer.h:
669         * workers/service/ServiceWorkerRegistration.cpp:
670         (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
671         (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
672         (WebCore::ServiceWorkerRegistration::installing):
673         (WebCore::ServiceWorkerRegistration::waiting):
674         (WebCore::ServiceWorkerRegistration::active):
675         * workers/service/ServiceWorkerRegistration.h:
676         * workers/service/ServiceWorkerRegistrationData.cpp:
677         (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
678         * workers/service/ServiceWorkerRegistrationData.h:
679         (WebCore::ServiceWorkerRegistrationData::encode const):
680         (WebCore::ServiceWorkerRegistrationData::decode):
681         * workers/service/server/SWClientConnection.cpp:
682         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
683         * workers/service/server/SWServerRegistration.cpp:
684         (WebCore::SWServerRegistration::scriptContextStarted):
685         (WebCore::SWServerRegistration::runRegisterJob):
686         (WebCore::SWServerRegistration::data const):
687         * workers/service/server/SWServerRegistration.h:
688
689 2017-10-30  Fujii Hironori  <Hironori.Fujii@sony.com>
690
691         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames
692         https://bugs.webkit.org/show_bug.cgi?id=175118
693
694         Reviewed by Alex Christensen.
695
696         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
697
698         No new tests since there should be no behavioral change.
699
700         * dom/make_names.pl:
701         (printConstructors):
702         (printNamesHeaderFile):
703         (printNamesCppFile):
704         (printDefinitions):
705         * accessibility/AccessibilityRenderObject.cpp:
706         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
707         * css/StyleResolver.cpp:
708         (WebCore::hasEffectiveDisplayNoneForDisplayContents):
709         * dom/CustomElementReactionQueue.cpp:
710         (WebCore::CustomElementReactionQueue::observesStyleAttribute const):
711         * dom/Document.cpp:
712         (WebCore::Document::validateCustomElementName):
713         * dom/Element.cpp:
714         (WebCore::isStyleAttribute):
715         (WebCore::canAttachAuthorShadowRoot):
716         * dom/ElementData.cpp:
717         (WebCore::ElementData::findLanguageAttribute const):
718         * domjit/JSDocumentDOMJIT.cpp:
719         (WebCore::compileDocumentBodyAttribute):
720         * editing/Editor.cpp:
721         (WebCore::Editor::applyEditingStyleToBodyElement const):
722         * editing/EditorCommand.cpp:
723         (WebCore::valueDefaultParagraphSeparator):
724         * editing/MarkupAccumulator.cpp:
725         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
726         (WebCore::MarkupAccumulator::appendNamespace):
727         (WebCore::MarkupAccumulator::elementCannotHaveEndTag):
728         * editing/ReplaceSelectionCommand.cpp:
729         (WebCore::isProhibitedParagraphChild):
730         * html/HTMLBodyElement.cpp:
731         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
732         * html/HTMLDocument.cpp:
733         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
734         * html/HTMLElement.cpp:
735         (WebCore::HTMLElement::createEventHandlerNameMap):
736         * html/parser/HTMLConstructionSite.cpp:
737         (WebCore::HTMLConstructionSite::findFosterSite):
738         * html/parser/HTMLElementStack.cpp:
739         (WebCore::HTMLElementStack::hasTemplateInHTMLScope const):
740         * html/parser/HTMLPreloadScanner.cpp:
741         (WebCore::TokenPreloadScanner::updatePredictedBaseURL):
742         * html/parser/HTMLTreeBuilder.cpp:
743         (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
744         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
745         (WebCore::HTMLTreeBuilder::processTemplateEndTag):
746         (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
747         (WebCore::HTMLTreeBuilder::processStartTag):
748         (WebCore::HTMLTreeBuilder::processBodyEndTagForInBody):
749         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
750         (WebCore::HTMLTreeBuilder::processCaptionEndTagForInCaption):
751         (WebCore::HTMLTreeBuilder::processTableEndTagForInTable):
752         (WebCore::HTMLTreeBuilder::processEndTag):
753         (WebCore::HTMLTreeBuilder::insertPhoneNumberLink):
754         (WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
755         (WebCore::HTMLTreeBuilder::defaultForBeforeHead):
756         (WebCore::HTMLTreeBuilder::defaultForInHead):
757         (WebCore::HTMLTreeBuilder::defaultForInHeadNoscript):
758         (WebCore::HTMLTreeBuilder::defaultForAfterHead):
759         * html/parser/TextDocumentParser.cpp:
760         (WebCore::TextDocumentParser::insertFakePreElement):
761         * rendering/svg/SVGPathData.cpp:
762         (WebCore::pathFromGraphicsElement):
763         * rendering/svg/SVGResources.cpp:
764         (WebCore::clipperFilterMaskerTags):
765         (WebCore::markerTags):
766         (WebCore::fillAndStrokeTags):
767         (WebCore::chainableResourceTags):
768         * svg/SVGAnimatedBoolean.h:
769         * svg/SVGAnimatedEnumeration.h:
770         * svg/SVGAnimatedInteger.h:
771         * svg/SVGAnimatedLength.h:
772         * svg/SVGAnimatedLengthList.h:
773         * svg/SVGAnimatedNumber.h:
774         * svg/SVGAnimatedNumberList.h:
775         * svg/SVGAnimatedPreserveAspectRatio.h:
776         * svg/SVGAnimatedRect.h:
777         * svg/SVGAnimatedString.h:
778         * svg/SVGAnimatedTransformList.h:
779         * svg/SVGAnimationElement.cpp:
780         (WebCore::SVGAnimationElement::isSupportedAttribute):
781         * svg/SVGCursorElement.cpp:
782         (WebCore::SVGCursorElement::isSupportedAttribute):
783         * svg/SVGElement.cpp:
784         (WebCore::createAttributeNameToCSSPropertyIDMap):
785         (WebCore::SVGElement::childShouldCreateRenderer const):
786         (WebCore::SVGElement::animatableAttributeForName):
787         * svg/SVGFilterElement.cpp:
788         (WebCore::SVGFilterElement::isSupportedAttribute):
789         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
790         (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute):
791         * svg/SVGForeignObjectElement.cpp:
792         (WebCore::SVGForeignObjectElement::isSupportedAttribute):
793         * svg/SVGGradientElement.cpp:
794         (WebCore::SVGGradientElement::isSupportedAttribute):
795         * svg/SVGImageElement.cpp:
796         (WebCore::SVGImageElement::isSupportedAttribute):
797         * svg/SVGLineElement.cpp:
798         (WebCore::SVGLineElement::isSupportedAttribute):
799         * svg/SVGMarkerElement.cpp:
800         (WebCore::SVGMarkerElement::isSupportedAttribute):
801         * svg/SVGMaskElement.cpp:
802         (WebCore::SVGMaskElement::isSupportedAttribute):
803         * svg/SVGPathElement.cpp:
804         (WebCore::SVGPathElement::dPropertyInfo):
805         (WebCore::SVGPathElement::isSupportedAttribute):
806         * svg/SVGPatternElement.cpp:
807         (WebCore::SVGPatternElement::isSupportedAttribute):
808         * svg/SVGPolyElement.cpp:
809         (WebCore::SVGPolyElement::pointsPropertyInfo):
810         * svg/SVGRadialGradientElement.cpp:
811         (WebCore::SVGRadialGradientElement::isSupportedAttribute):
812         * svg/SVGTextContentElement.cpp:
813         (WebCore::SVGTextContentElement::textLengthPropertyInfo):
814         (WebCore::SVGTextContentElement::isSupportedAttribute):
815         * svg/SVGTextPathElement.cpp:
816         (WebCore::SVGTextPathElement::isSupportedAttribute):
817         * svg/SVGUseElement.cpp:
818         (WebCore::createAllowedElementSet):
819         * xml/NativeXPathNSResolver.cpp:
820         (WebCore::NativeXPathNSResolver::lookupNamespaceURI):
821         * xml/parser/XMLDocumentParser.cpp:
822         (WebCore::XMLDocumentParser::parseDocumentFragment):
823
824 2017-10-30  Jer Noble  <jer.noble@apple.com>
825
826         [WebGL] Optimization to skip painting if texture and source surface hasn't changed isn't working; re-optimize.
827         https://bugs.webkit.org/show_bug.cgi?id=178953
828
829         Reviewed by Dean Jackson.
830
831         The "seed" value of the current bound texture never matches the last saved value in
832         VideoTextureCopierCV::copyImageToPlatformTexture(). The value is modified by the function
833         itself, so a fresh value needs to be re-queried after the image's surface is attached to the
834         texture.
835
836         Once this fix is in, however, the <canvas> being painted will flash when no new image is
837         available. This is because the wrong texture target is being restored by the GC3DStateSaver
838         at the end of copyImageToPlatformTexture(). While we're fixing that, we may as well use the
839         texture state saved by the GraphicsContext3D itself to restore the correct texture unit,
840         texture target, and texture.
841
842         * platform/graphics/GraphicsContext3D.h:
843         (WebCore::GraphicsContext3D::activeTextureUnit const):
844         (WebCore::GraphicsContext3D::currentBoundTexture const):
845         (WebCore::GraphicsContext3D::currentBoundTarget const):
846         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture const):
847         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture const):
848         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTarget const):
849         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTarget const):
850         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture): Deleted.
851         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture): Deleted.
852         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTarget): Deleted.
853         * platform/graphics/cv/VideoTextureCopierCV.cpp:
854         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
855         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
856         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
857         * platform/graphics/cv/VideoTextureCopierCV.h:
858         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
859         (WebCore::GraphicsContext3D::prepareTexture):
860         (WebCore::GraphicsContext3D::activeTexture):
861         (WebCore::GraphicsContext3D::bindTexture):
862
863 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
864
865         WKBundlePageWillSendSubmitEventCallback is called with incorrect frame parameter
866         https://bugs.webkit.org/show_bug.cgi?id=176719
867
868         Reviewed by Chris Dumez.
869
870         WKBundlePageWillSendSubmitEventCallback is clearly intended to parallel
871         WKBundlePageWillSubmitFormCallback, since almost all the parameters are the same. Now, in
872         WKBundlePageWillSubmitFormCallback, the first WKBundleFrameRef, "frame", is the frame of the
873         form target, and the second WKBundleFrameRef, sourceFrame, is the frame containing the form.
874         That's correct. But in WKBundlePageWillSendSubmitEventCallback, both frame and sourceFrame
875         are always identical. The problem is that the FrameLoaderClient delegate is called on the
876         wrong FrameLoaderClient. It should be called on the FrameLoaderClient of the target frame,
877         but HTMLFormElement calls it on the FrameLoaderClient of the source frame instead.
878
879         Fix this by factoring the target frame computation out of FormSubmission into some helpers.
880
881         * html/HTMLFormElement.cpp:
882         (WebCore::HTMLFormElement::prepareForSubmission):
883         (WebCore::HTMLFormElement::effectiveTarget const):
884         (WebCore::HTMLFormElement::findSubmitButton const):
885         * html/HTMLFormElement.h:
886         * loader/FormSubmission.cpp:
887         (WebCore::FormSubmission::create):
888
889 2017-10-30  Alex Christensen  <achristensen@webkit.org>
890
891         ASSERTION FAILED: internalValuesConsistent(m_url) in WebCore::URLParser::URLParser
892         https://bugs.webkit.org/show_bug.cgi?id=178861
893
894         Reviewed by Tim Horton.
895
896         This is a dark corner of the URL spec that has wildly different behavior in different browsers.
897         The assertion fired when we have a file URL with a ? or a # after file:// and it was because
898         m_pathAfterLastSlash was still 0. We definitely shouldn't assert. I'm making us consistent with
899         other cases where we have nothing there and add an implied missing slash.
900         
901         Covered by new API tests.
902
903         * platform/URLParser.cpp:
904         (WebCore::URLParser::parse):
905
906 2017-10-27  Megan Gardner  <megan_gardner@apple.com>
907
908         Correctly determine affinity when inserting text via Keyboard Suggestions
909         https://bugs.webkit.org/show_bug.cgi?id=178969
910
911         Reviewed by Ryosuke Niwa.
912
913         There has been talk about renaming these enums, but in the meantime we should at least have a comment 
914         clarifying what they actually mean.
915
916         No new tests only adding a comment, no tests needed.
917
918         * editing/TextAffinity.h:
919
920 2017-10-27  Ryosuke Niwa  <rniwa@webkit.org>
921
922         Crash in addChildNodesToDeletionQueue
923         https://bugs.webkit.org/show_bug.cgi?id=178974
924         <rdar://problem/35234372>
925
926         Reviewed by Brent Fulgham.
927
928         The bug was caused by HTMLConstructionSite::insertTextNode constructing an ill-formed tree
929         when fostering parent under a template element by adjusting HTMLConstructionSiteTask's parent
930         without clearing nextChild. Fixed the crash by simply removing this code since executeTask
931         already takes care of fostering the parent in static inline insert(HTMLConstructionSiteTask&).
932
933         Test: fast/parser/foster-parent-under-template.html
934
935         * html/parser/HTMLConstructionSite.cpp:
936         (WebCore::HTMLConstructionSite::insertTextNode):
937
938 2017-10-30  Commit Queue  <commit-queue@webkit.org>
939
940         Unreviewed, rolling out r224078.
941         https://bugs.webkit.org/show_bug.cgi?id=179026
942
943         MotionMark regression (Requested by shallawa on #webkit).
944
945         Reverted changeset:
946
947         "When navigating back to a page, compositing layers may not
948         use accelerated drawing"
949         https://bugs.webkit.org/show_bug.cgi?id=178749
950         https://trac.webkit.org/changeset/224078
951
952 2017-10-30  Dean Jackson  <dino@apple.com>
953
954         Implement "bitmaprenderer" CanvasRenderingContext
955         https://bugs.webkit.org/show_bug.cgi?id=178992
956         <rdar://problem/34147157>
957
958         Reviewed by Sam Weinig.
959
960         Implement the "bitmaprenderer" context for HTMLCanvasElement.
961         Use as much of the existing 2d context code as possible, which
962         means that we are painting the ImageBitmap into the backing
963         store. This isn't optimal, but it is good enough to get
964         going while we move buffer ownership from the canvas object
965         into the rendering contexts.
966
967         This patch raised a few issues on the HTML specification:
968         https://github.com/whatwg/html/issues/3164
969         https://github.com/whatwg/html/issues/3165
970         https://github.com/whatwg/html/issues/3166
971         https://github.com/whatwg/html/issues/3167
972
973         Update existing Web Platform Test results.
974
975         * html/HTMLCanvasElement.cpp:
976         (WebCore::HTMLCanvasElement::createContext2d): Drive-by comment fix.
977         (WebCore::HTMLCanvasElement::createContextWebGL): Ditto.
978         (WebCore::HTMLCanvasElement::createContextWebGPU): Ditto.
979         (WebCore::HTMLCanvasElement::createContextBitmapRenderer): We now require
980         a layer/backing store for a bitmap context.
981         (WebCore::HTMLCanvasElement::paintsIntoCanvasBuffer const): Add bitmap-renderer
982         to the type of context that uses the canvas's backing store.
983         (WebCore::HTMLCanvasElement::createImageBuffer const): Comment fix.
984         (WebCore::HTMLCanvasElement::setImageBuffer const): Change parameter to a &&.
985         (WebCore::HTMLCanvasElement::setImageBufferAndMarkDirty): New function to set
986         the backing store efficiently, as well as make it look like we need to repaint
987         the entire canvas.
988         (WebCore::HTMLCanvasElement::drawingContext const): The buffer doesn't actually
989         need to provide a GraphicsContext if we're a bitmap renderer.
990         * html/HTMLCanvasElement.h:
991
992         * html/ImageBitmap.cpp:
993         (WebCore::ImageBitmap::transferOwnershipAndClose): New helper to give the ownership
994         of the ImageBuffer away, and look like close() was called.
995         * html/ImageBitmap.h:
996
997         * html/canvas/ImageBitmapRenderingContext.cpp: Implement the algorithm from the HTML
998         specification.
999         (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
1000         (WebCore::ImageBitmapRenderingContext::isAccelerated const):
1001         (WebCore::ImageBitmapRenderingContext::setOutputBitmap):
1002         (WebCore::ImageBitmapRenderingContext::transferFromImageBitmap):
1003         * html/canvas/ImageBitmapRenderingContext.h:
1004         * html/canvas/ImageBitmapRenderingContext.idl:
1005
1006 2017-10-30  Simon Fraser  <simon.fraser@apple.com>
1007
1008         tab-size: 0px asserts
1009         https://bugs.webkit.org/show_bug.cgi?id=176198
1010
1011         Reviewed by Antti Koivisto.
1012
1013         Don't claim to support tab-size values with units. We don't, and they would become 0, rather
1014         than fall back to the default as should happen.
1015
1016         Enhanced fast/css/tab-size.html to test.
1017
1018         * css/parser/CSSPropertyParser.cpp:
1019         (WebCore::consumeTabSize):
1020
1021 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1022
1023         [WPE] Fix build warnings
1024         https://bugs.webkit.org/show_bug.cgi?id=178899
1025
1026         Reviewed by Carlos Alberto Lopez Perez.
1027
1028         These are actually mostly cross-platform issues.
1029
1030         * html/canvas/WebGL2RenderingContext.cpp:
1031         (WebCore::arrayBufferViewElementSize):
1032         * platform/Cairo.cmake:
1033         * platform/Curl.cmake:
1034         * platform/FreeType.cmake:
1035         * platform/GCrypt.cmake:
1036         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
1037         (WebCore::TextureMapperShaderProgram::create):
1038         * platform/network/soup/SoupNetworkSession.cpp:
1039         (WebCore::SoupNetworkSession::SoupNetworkSession):
1040
1041 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1042
1043         [WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatformWPE build target
1044         https://bugs.webkit.org/show_bug.cgi?id=178964
1045
1046         Reviewed by Carlos Alberto Lopez Perez.
1047
1048         This also gets rid of the WebCorePlatformWPE build target to simplify the build. It links to
1049         all the same libraries as the WebCore target, so it doesn't seem to have any purpose. Bye.
1050
1051         Some CMake files under platform are not unified, either because there is not much to gain
1052         (e.g. ImageDecoders, where everything is in a separate directory), or because it is complex
1053         (e.g. GStreamer, where GObject implementations would be tricky to build unified), and
1054         because we're limited to using only features declared in WebKitFeatures.cmake inside the
1055         unified sources lists, which makes some of the platform files a bit tricky (notably,
1056         anything that needs to go into WebCorePlatformGTK for the GTK port). So it's not perfect.
1057
1058         * PlatformWPE.cmake:
1059         * SourcesWPE.txt: Added.
1060         * crypto/gcrypt/GCryptUtilities.h:
1061         * platform/Cairo.cmake:
1062         * platform/GCrypt.cmake:
1063         * platform/SourcesCairo.txt: Added.
1064         * platform/SourcesGCrypt.txt: Added.
1065         * platform/SourcesGLib.txt: Added.
1066         * platform/SourcesSoup.txt: Added.
1067
1068 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1069
1070         Remove more unused ENABLE(GAMEPAD_DEPRECATED) code
1071         https://bugs.webkit.org/show_bug.cgi?id=178364
1072
1073         Reviewed by Carlos Alberto Lopez Perez.
1074
1075         * Modules/gamepad/deprecated/Gamepad.cpp: Removed.
1076         * Modules/gamepad/deprecated/Gamepad.h: Removed.
1077         * Modules/gamepad/deprecated/Gamepad.idl: Removed.
1078         * Modules/gamepad/deprecated/GamepadList.cpp: Removed.
1079         * Modules/gamepad/deprecated/GamepadList.h: Removed.
1080         * Modules/gamepad/deprecated/GamepadList.idl: Removed.
1081         * Modules/gamepad/deprecated/NavigatorGamepad.cpp: Removed.
1082         * Modules/gamepad/deprecated/NavigatorGamepad.h: Removed.
1083         * Modules/gamepad/deprecated/NavigatorGamepad.idl: Removed.
1084
1085 2017-10-30  Daniel Bates  <dabates@apple.com>
1086
1087         Use if conditional function in DerivedSources.make to reduce duplication
1088         https://bugs.webkit.org/show_bug.cgi?id=178989
1089
1090         Reviewed by Darin Adler.
1091
1092         In DerivedSources.make we currently duplicate most of the Makefile recipe for generating HTML/SVG
1093         tags and attributes to support passing the optional command line option --extraDefines when one
1094         or more HTML/SVG compile-time features are enabled. Instead we can make use of a Makefile
1095         conditional function in the recipe itself to avoid code duplication.
1096
1097         * DerivedSources.make:
1098
1099 2017-10-30  Antoine Quint  <graouts@apple.com>
1100
1101         [Web Animations] Expose the playbackRate property on Animation
1102         https://bugs.webkit.org/show_bug.cgi?id=178931
1103
1104         Reviewed by Sam Weinig.
1105
1106         Account for the playback rate when computing and setting an animation's
1107         current time, ensuring that we adjust the start time to preserve the
1108         current time when setting a new playback rate.
1109
1110         Test: http/wpt/wk-web-animations/timing-model/animation-playback-rate.html
1111
1112         * animation/WebAnimation.cpp:
1113         (WebCore::WebAnimation::WebAnimation):
1114         (WebCore::WebAnimation::currentTime const):
1115         (WebCore::WebAnimation::setCurrentTime):
1116         (WebCore::WebAnimation::setPlaybackRate):
1117         * animation/WebAnimation.h:
1118         * animation/WebAnimation.idl:
1119
1120 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1121
1122         [WPE][GTK] Expose availability of certain editing commands in WebKitEditorState
1123         https://bugs.webkit.org/show_bug.cgi?id=168219
1124
1125         Reviewed by Ryosuke Niwa.
1126
1127         Make Editor::canUndo and Editor::canRedo const.
1128
1129         Also, remove unused allowsCopy from HitTestResult.
1130
1131         * editing/Editor.cpp:
1132         (WebCore::Editor::canUndo const):
1133         (WebCore::Editor::canRedo const):
1134         (WebCore::Editor::canUndo): Deleted.
1135         (WebCore::Editor::canRedo): Deleted.
1136         * editing/Editor.h:
1137         * rendering/HitTestResult.cpp:
1138         (WebCore::HitTestResult::allowsCopy const): Deleted.
1139         * rendering/HitTestResult.h:
1140         * rendering/SelectionRangeData.cpp:
1141
1142 2017-10-27  Antti Koivisto  <antti@apple.com>
1143
1144         Destroy all unneeded anonymous wrappers in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers()
1145         https://bugs.webkit.org/show_bug.cgi?id=178933
1146
1147         Reviewed by Zalan Bujtas.
1148
1149         Currently it just cleans up table related wrappers.
1150
1151         * rendering/RenderObject.cpp:
1152         (WebCore::findDestroyRootIncludingAnonymous):
1153
1154         Continuations are left as future work.
1155
1156 2017-10-30  Zalan Bujtas  <zalan@apple.com>
1157
1158         Remove reference to RenderTreeInternalMutationScope
1159         https://bugs.webkit.org/show_bug.cgi?id=178998
1160         <rdar://problem/35246464>
1161
1162         Reviewed by Antti Koivisto.
1163
1164         We don't have such class anymore.
1165
1166         No change in functionality.
1167
1168         * rendering/RenderView.h:
1169
1170 2017-10-30  Zan Dobersek  <zdobersek@igalia.com>
1171
1172         [GCrypt] Add support for P-521 EC curves
1173         https://bugs.webkit.org/show_bug.cgi?id=175199
1174
1175         Reviewed by Jiewen Tan.
1176
1177         Add support for 521-bit elliptic curves in the libgcrypt-based
1178         implementation of WebCrypto API.
1179
1180         In the CryptoAlgorithmECDH implementation, the bit-size of the key is now
1181         rounded up to the next byte boundary and passed to the helper
1182         gcryptDerive() function. There the size in bytes is used to zero-pad the
1183         derived key data. This is done to properly handle derivation results for
1184         the P-521 curves, where the leading zero bit could get clipped, resulting
1185         in a derived key that is only 65 byes in length when it is expected to be
1186         66 bytes. Further cleanups are done in gcryptDerive() to use the mpiData()
1187         function where possible.
1188
1189         In the CryptoAlgorithmECDSA implementation, the bit-size of the key is
1190         again rounded up to the nearest byte boundary before being passed to the
1191         helper gcryptSign() and gcryptVerify() functions. This again properly
1192         enforces the requirement of 66 bytes to handle P-521 elliptic curves.
1193
1194         In the CryptoKeyEC implementation, NamedCurve::P521 cases in helper
1195         functions operating on NamedCurve values are now implemented to return
1196         appropriate values. platformSupportedCurve() now returns true for the
1197         NamedCurve::P521 value. Zero-padding of the private key data is used
1198         wherever it is necessary to avoid clipping any leading zero bit in the
1199         P-521 EC key.
1200
1201         No new tests -- affected tests have their baselines updated.
1202
1203         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
1204         (WebCore::gcryptDerive):
1205         (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
1206         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
1207         (WebCore::CryptoAlgorithmECDSA::platformSign):
1208         (WebCore::CryptoAlgorithmECDSA::platformVerify):
1209         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1210         (WebCore::curveName):
1211         (WebCore::curveIdentifier):
1212         (WebCore::curveSize):
1213         (WebCore::curveUncompressedFieldElementSize):
1214         (WebCore::CryptoKeyEC::platformSupportedCurve):
1215         (WebCore::curveForIdentifier):
1216         (WebCore::CryptoKeyEC::platformImportPkcs8):
1217         (WebCore::CryptoKeyEC::platformAddFieldElements const):
1218         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
1219
1220 2017-10-29  Fujii Hironori  <Hironori.Fujii@sony.com>
1221
1222         Use of uninitialized value $targetIdlFile in hash element at preprocess-idls.pl line 165.
1223         https://bugs.webkit.org/show_bug.cgi?id=177743
1224
1225         Reviewed by Darin Adler.
1226
1227         GamepadWebVR.idl supplements Gamepad.idl. But, Gamepad.idl is not
1228         processed because ENABLE_GAMEPAD is OFF.
1229
1230         No new tests since there should be no behavioral change.
1231
1232         * CMakeLists.txt: Include GamepadWebVR.idl only if ENABLE_GAMEPAD.
1233         * Sources.txt: Ditto.
1234         * bindings/scripts/preprocess-idls.pl: Die if a supplemented IDL file is not found.
1235
1236 2017-10-29  Sam Weinig  <sam@webkit.org>
1237
1238         [Conic Gradients] Add support for parsing conic gradients
1239         https://bugs.webkit.org/show_bug.cgi?id=178987
1240
1241         Reviewed by Dean Jackson.
1242
1243         Adds initial support, disabled by default, for parsing conic gradients as per
1244         CSS 4 Images - https://www.w3.org/TR/css-images-4/#conic-gradients.
1245
1246         Test: fast/gradients/conic-gradient-parsing.html
1247
1248         * css/CSSGradientValue.cpp:
1249         (WebCore::clone):
1250         (WebCore::CSSGradientValue::isCacheable const):
1251         (WebCore::CSSConicGradientValue::customCSSText const):
1252         (WebCore::CSSConicGradientValue::createGradient):
1253         (WebCore::CSSConicGradientValue::equals const):
1254         * css/CSSGradientValue.h:
1255         
1256             Add CSSConicGradientValue as a subclass of CSSGradientValue and implement
1257             customCSSText() and equals(). Stub out createGradient() as painting is not
1258             yet implemented.
1259         
1260         * css/CSSImageGeneratorValue.cpp:
1261         (WebCore::CSSImageGeneratorValue::image):
1262         (WebCore::CSSImageGeneratorValue::isFixedSize const):
1263         (WebCore::CSSImageGeneratorValue::fixedSize):
1264         (WebCore::CSSImageGeneratorValue::isPending const):
1265         (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
1266         (WebCore::CSSImageGeneratorValue::loadSubimages):
1267         * css/CSSValue.cpp:
1268         (WebCore::CSSValue::equals const):
1269         (WebCore::CSSValue::cssText const):
1270         (WebCore::CSSValue::destroy):
1271         
1272             Dispatch to CSSConicGradientValue as needed.
1273         
1274         * css/CSSValue.h:
1275         (WebCore::CSSValue::isImageGeneratorValue const):
1276         (WebCore::CSSValue::isGradientValue const):
1277         (WebCore::CSSValue::isConicGradientValue const):
1278         
1279             Add conic gradient predicate support and update isImageGeneratorValue and 
1280             isGradientValue to include conic gradient.
1281         
1282         * css/CSSValueKeywords.in:
1283         
1284             Add conic-gradient and repeating-conic-gradient.
1285         
1286         * css/parser/CSSParser.cpp:
1287         (WebCore::CSSParserContext::CSSParserContext):
1288         (WebCore::operator==):
1289         * css/parser/CSSParserMode.h:
1290         (WebCore::CSSParserContextHash::hash):
1291         
1292             Add runtime flags to enable conic gradients.
1293         
1294         * css/parser/CSSPropertyParserHelpers.cpp:
1295         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
1296         
1297             Helper, similar to consumeLengthOrPercent, for consumeGradientColorStops. 
1298             Corresponds to https://drafts.csswg.org/css-values-4/#typedef-angle-percentage
1299         
1300         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
1301         
1302             Convert to take CSSGradientValue by reference.
1303         
1304         (WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops):
1305         
1306             Helper, similar to consumeGradientColorStops, but for angular color stops
1307             used in conic gradients. Corresponds to https://www.w3.org/TR/css-images-4/#typedef-angular-color-stop-list
1308             but does not yet support double position syntax.
1309         
1310         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
1311         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
1312         (WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
1313         
1314             Pass CSSGradientValue by reference.
1315         
1316         (WebCore::CSSPropertyParserHelpers::consumeConicGradient):
1317         
1318             Parse conic gradient.
1319         
1320         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
1321         
1322             Dispatch to consumeConicGradient for repeating and non-repeating
1323             conic gradients.
1324         
1325         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
1326         
1327             Put each value on its own line to make it more readable and add CSSValueConicGradient
1328             and CSSValueRepeatingConicGradient.
1329         
1330         * page/Settings.yaml:
1331         
1332             Add a setting to enable conic gradients. Disabled by default.
1333
1334         * features.json:
1335         
1336             Move conic gradients to "In Development".
1337
1338 2017-10-29  Antoine Quint  <graouts@apple.com>
1339
1340         [Web Animations] Expose the currentTime property on Animation
1341         https://bugs.webkit.org/show_bug.cgi?id=178988
1342
1343         Unreviewed.
1344
1345         Style fixes missed in previous patch.
1346
1347         * animation/WebAnimation.cpp:
1348         (WebCore::WebAnimation::setCurrentTime):
1349
1350 2017-10-29  Antoine Quint  <graouts@apple.com>
1351
1352         [Web Animations] Expose the currentTime property on Animation
1353         https://bugs.webkit.org/show_bug.cgi?id=178988
1354
1355         Reviewed by Dean Jackson.
1356
1357         We now expose the currentTime property on Animation objects, our first
1358         step in implementing the Web Animations timing model, specifically section
1359         3.5.4. "The current time of an animation" and section 3.5.5. "Setting the
1360         current time of an animation". Setting the startTime has implications on
1361         currentTime and vice-versa.
1362
1363         Test: webanimations/animation-current-time.html
1364
1365         * animation/WebAnimation.cpp:
1366         (WebCore::WebAnimation::setBindingsStartTime):
1367         (WebCore::WebAnimation::startTime const):
1368         (WebCore::WebAnimation::setStartTime):
1369         (WebCore::WebAnimation::bindingsCurrentTime const):
1370         (WebCore::WebAnimation::setBindingsCurrentTime):
1371         (WebCore::WebAnimation::currentTime const):
1372         (WebCore::WebAnimation::setCurrentTime):
1373         * animation/WebAnimation.h:
1374         * animation/WebAnimation.idl:
1375
1376 2017-10-29  Ryosuke Niwa  <rniwa@webkit.org>
1377
1378         Assert that no script is executed during style recalc
1379         https://bugs.webkit.org/show_bug.cgi?id=178845
1380         <rdar://problem/35106129>
1381
1382         Reviewed by Antti Koivisto.
1383
1384         This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
1385         to make sure we don't start mutating DOM in the middle of a style update.
1386
1387         Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
1388         shadow tree since that happens while updating the style.
1389
1390         No new tests since there should be no behavioral change.
1391
1392         * dom/Document.cpp:
1393         (WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
1394         and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
1395         the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
1396         Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
1397         scripts which in turn trigger another (recursive) style recalc.
1398         (WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
1399         NoEventDispatchAssertion.
1400         * dom/Element.cpp:
1401         (WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
1402         newly cloned element for SVG use element's shadow tree.
1403         (WebCore::Element::cloneElementWithoutChildren): Ditto.
1404         * dom/EventDispatcher.cpp:
1405         (WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
1406         use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
1407         since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
1408         pushing or popoing the stack frame.
1409         * svg/SVGUseElement.cpp:
1410         (WebCore::SVGUseElement::clearShadowTree):
1411         (WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
1412         of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
1413         scripts, it's safe to mutate them during the style recalc even though it's not the best design.
1414         (WebCore::SVGUseElement::cloneTarget const): Ditto.
1415         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
1416         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
1417         (WebCore::SVGUseElement::transferEventListenersToShadowTree const):
1418
1419 2017-10-28  Dean Jackson  <dino@apple.com>
1420
1421         createImageBitmap with HTMLCanvasElement
1422         https://bugs.webkit.org/show_bug.cgi?id=178984
1423         <rdar://problem/35238440>
1424
1425         Reviewed by Sam Weinig.
1426
1427         Implement createImageBitmap(HTMLCanvasElement).
1428
1429         While here, explicitly reject the promises for the
1430         methods we haven't yet implemented. I was hoping this
1431         would avoid a lengthy timeout in one of the imported
1432         WPT tests but, alas, it doesn't. However, it's still
1433         a good idea.
1434
1435         Extend internal WPT proposals to cover canvas creation.
1436
1437         * html/ImageBitmap.cpp:
1438         (WebCore::ImageBitmap::createPromise): Get the image from
1439         the canvas and draw it into a new ImageBitmap buffer.
1440
1441 2017-10-28  Myles C. Maxfield  <mmaxfield@apple.com>
1442
1443         [iOS] Unify Font::platformCharWidthInit() with macOS
1444         https://bugs.webkit.org/show_bug.cgi?id=178951
1445         <rdar://problem/7848198>
1446
1447         Reviewed by Zalan Bujtas.
1448
1449         The only reason these codepaths are different is because historically this codepath
1450         didn't work with GS fonts (which we don't use anymore).
1451
1452         Tests: fast/forms/search-styled.html
1453                fast/forms/text-control-intrinsic-widths.html
1454                fast/forms/textarea-width.html
1455
1456         * platform/graphics/cocoa/FontCocoa.mm:
1457         (WebCore::Font::platformCharWidthInit):
1458
1459 2017-10-28  Chris Dumez  <cdumez@apple.com>
1460
1461         self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
1462         https://bugs.webkit.org/show_bug.cgi?id=178976
1463
1464         Reviewed by Sam Weinig.
1465
1466         Test: http/tests/workers/service/ServiceWorkerGlobalScope-properties.html
1467
1468         * workers/service/ExtendableEvent.idl:
1469         * workers/service/FetchEvent.idl:
1470         Drop [Exposed=Worker] as there is already [Exposed=ServiceWorker] and
1471         ServiceWorkerGlobalScope inherits from WorkerGlobalScope. This is redundant
1472         and we would hit assertions and adding the global constructors at runtime
1473         when the feature is enabled, because the property already exists.
1474
1475 2017-10-28  Zalan Bujtas  <zalan@apple.com>
1476
1477         [FrameView::layout cleanup] Move core layout logic to a separate class.
1478         https://bugs.webkit.org/show_bug.cgi?id=178771
1479         <rdar://problem/35166542>
1480
1481         Reviewed by Simon Fraser.
1482
1483         Move layout code out from FrameView to LayoutContext.
1484
1485         LayoutContext holds all the layout related logic (scheduling, needsLayout, handling layout states),
1486         while scrolling, view sizing methods stay in FrameView.
1487         Having a dedicated LayoutContext allows to structure the code better.   
1488
1489         Covered by existing tests.
1490
1491         * Sources.txt:
1492         * WebCore.xcodeproj/project.pbxproj:
1493         * accessibility/AXObjectCache.cpp:
1494         (WebCore::rendererNeedsDeferredUpdate):
1495         * accessibility/AccessibilityObject.cpp:
1496         (WebCore::AccessibilityObject::updateBackingStore):
1497         * accessibility/AccessibilityRenderObject.cpp:
1498         (WebCore::AccessibilityRenderObject::textUnderElement const):
1499         (WebCore::AccessibilityRenderObject::layoutCount const):
1500         * dom/Document.cpp:
1501         (WebCore::Document::setVisualUpdatesAllowed):
1502         (WebCore::Document::resolveStyle):
1503         (WebCore::Document::updateStyleIfNeeded):
1504         (WebCore::Document::updateLayout):
1505         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1506         (WebCore::Document::implicitClose):
1507         (WebCore::Document::isLayoutTimerActive):
1508         * dom/Element.cpp:
1509         (WebCore::Element::absoluteEventHandlerBounds):
1510         * editing/FrameSelection.cpp:
1511         (WebCore::FrameSelection::setSelection):
1512         * html/HTMLEmbedElement.cpp:
1513         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
1514         * html/HTMLFormControlElement.cpp:
1515         (WebCore::HTMLFormControlElement::didAttachRenderers):
1516         * inspector/InspectorOverlay.cpp:
1517         (WebCore::InspectorOverlay::update):
1518         * loader/FrameLoader.cpp:
1519         (WebCore::FrameLoader::stopForUserCancel):
1520         * page/Frame.cpp:
1521         (WebCore::Frame::setView):
1522         (WebCore::Frame::clearTimers):
1523         (WebCore::Frame::setPageAndTextZoomFactors):
1524         (WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
1525         * page/FrameView.cpp:
1526         (WebCore::FrameView::FrameView):
1527         (WebCore::FrameView::~FrameView):
1528         (WebCore::FrameView::reset):
1529         (WebCore::FrameView::resetScrollbars):
1530         (WebCore::FrameView::didFirstLayout const):
1531         (WebCore::FrameView::willDestroyRenderTree):
1532         (WebCore::FrameView::didDestroyRenderTree):
1533         (WebCore::FrameView::setContentsSize):
1534         (WebCore::FrameView::calculateScrollbarModesForLayout):
1535         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
1536         (WebCore::FrameView::topContentInsetDidChange):
1537         (WebCore::FrameView::forceLayoutParentViewIfNeeded):
1538         (WebCore::FrameView::adjustScrollbarsForLayout):
1539         (WebCore::FrameView::willDoLayout): This takes care of the view related task right before entering render tree layout.
1540         (WebCore::FrameView::didLayout): post layout tasks.
1541         (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
1542         (WebCore::FrameView::updateLayoutViewport):
1543         (WebCore::FrameView::maintainScrollPositionAtAnchor):
1544         (WebCore::FrameView::updateLayerPositionsAfterScrolling):
1545         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
1546         (WebCore::FrameView::availableContentSizeChanged):
1547         (WebCore::FrameView::updateContentsSize):
1548         (WebCore::FrameView::needsLayout const):
1549         (WebCore::FrameView::setNeedsLayout):
1550         (WebCore::FrameView::scheduleSelectionUpdate):
1551         (WebCore::FrameView::updateEmbeddedObjects):
1552         (WebCore::FrameView::flushAnyPendingPostLayoutTasks):
1553         (WebCore::FrameView::flushPostLayoutTasksQueue):
1554         (WebCore::FrameView::performPostLayoutTasks):
1555         (WebCore::FrameView::sendResizeEventIfNeeded):
1556         (WebCore::FrameView::autoSizeIfEnabled):
1557         (WebCore::FrameView::paintControlTints):
1558         (WebCore::FrameView::paintContents):
1559         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
1560         (WebCore::FrameView::enableAutoSizeMode):
1561         (WebCore::FrameView::forceLayout):
1562         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer): Deleted.
1563         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer): Deleted.
1564         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree): Deleted.
1565         (): Deleted.
1566         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker): Deleted.
1567         (WebCore::applyTextSizingIfNeeded): Deleted.
1568         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded): Deleted.
1569         (WebCore::FrameView::updateStyleForLayout): Deleted.
1570         (WebCore::FrameView::canPerformLayout const): Deleted.
1571         (WebCore::FrameView::layout): Deleted.
1572         (WebCore::FrameView::runOrSchedulePostLayoutTasks): Deleted.
1573         (WebCore::FrameView::convertSubtreeLayoutToFullLayout): Deleted.
1574         (WebCore::FrameView::layoutTimerFired): Deleted.
1575         (WebCore::FrameView::scheduleRelayout): Deleted.
1576         (WebCore::isObjectAncestorContainerOf): Deleted.
1577         (WebCore::FrameView::scheduleRelayoutOfSubtree): Deleted.
1578         (WebCore::FrameView::layoutPending const): Deleted.
1579         (WebCore::FrameView::unscheduleRelayout): Deleted.
1580         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded): Deleted.
1581         * page/FrameView.h:
1582         * page/LayoutContext.cpp: Added.
1583         (WebCore::isObjectAncestorContainerOf):
1584         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
1585         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
1586         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree):
1587         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
1588         (WebCore::LayoutScope::LayoutScope):
1589         (WebCore::LayoutScope::~LayoutScope):
1590         (WebCore::LayoutContext::LayoutContext):
1591         (WebCore::LayoutContext::layout):
1592         (WebCore::LayoutContext::runOrScheduleAsynchronousTasks):
1593         (WebCore::LayoutContext::runAsynchronousTasks):
1594         (WebCore::LayoutContext::flushAsynchronousTasks):
1595         (WebCore::LayoutContext::reset):
1596         (WebCore::LayoutContext::needsLayout const):
1597         (WebCore::LayoutContext::setNeedsLayout):
1598         (WebCore::LayoutContext::enableSetNeedsLayout):
1599         (WebCore::LayoutContext::disableSetNeedsLayout):
1600         (WebCore::LayoutContext::scheduleLayout):
1601         (WebCore::LayoutContext::unscheduleLayout):
1602         (WebCore::LayoutContext::scheduleSubtreeLayout):
1603         (WebCore::LayoutContext::layoutTimerFired):
1604         (WebCore::LayoutContext::convertSubtreeLayoutToFullLayout):
1605         (WebCore::LayoutContext::setSubtreeLayoutRoot):
1606         (WebCore::LayoutContext::canPerformLayout const):
1607         (WebCore::LayoutContext::applyTextSizingIfNeeded):
1608         (WebCore::LayoutContext::updateStyleForLayout):
1609         (WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
1610         (WebCore::LayoutContext::startLayoutAtMainFrameViewIfNeeded):
1611         (WebCore::LayoutContext::frame const):
1612         (WebCore::LayoutContext::view const):
1613         (WebCore::LayoutContext::renderView const):
1614         (WebCore::LayoutContext::document const):
1615         * page/LayoutContext.h: Added.
1616         (WebCore::LayoutContext::startDisallowingLayout):
1617         (WebCore::LayoutContext::endDisallowingLayout):
1618         (WebCore::LayoutContext::layoutPhase const):
1619         (WebCore::LayoutContext::isLayoutNested const):
1620         (WebCore::LayoutContext::layoutCount const):
1621         (WebCore::LayoutContext::isLayoutPending const):
1622         (WebCore::LayoutContext::isInLayout const):
1623         (WebCore::LayoutContext::isInRenderTreeLayout const):
1624         (WebCore::LayoutContext::inPaintableState const):
1625         (WebCore::LayoutContext::subtreeLayoutRoot const):
1626         (WebCore::LayoutContext::clearSubtreeLayoutRoot):
1627         (WebCore::LayoutContext::resetFirstLayoutFlag):
1628         (WebCore::LayoutContext::didFirstLayout const):
1629         (WebCore::LayoutContext::setNeedsFullRepaint):
1630         (WebCore::LayoutContext::needsFullRepaint const):
1631         (WebCore::LayoutContext::layoutDisallowed const):
1632         (WebCore::LayoutContext::isLayoutSchedulingEnabled const):
1633         (WebCore::LayoutContext::inAsynchronousTasks const):
1634         * page/Page.cpp:
1635         (WebCore::Page::setPageScaleFactor):
1636         * rendering/RenderBlock.cpp:
1637         (WebCore::RenderBlock::insertPositionedObject):
1638         * rendering/RenderBox.cpp:
1639         (WebCore::RenderBox::imageChanged):
1640         (WebCore::RenderBox::computeLogicalWidthInFragment const):
1641         * rendering/RenderElement.cpp:
1642         (WebCore::RenderElement::clearSubtreeLayoutRootIfNeeded const):
1643         (WebCore::RenderElement::checkForRepaintDuringLayout const):
1644         * rendering/RenderFrameBase.cpp:
1645         (WebCore::RenderFrameBase::performLayoutWithFlattening):
1646         * rendering/RenderLayer.cpp:
1647         (WebCore::RenderLayer::scrollTo):
1648         * rendering/RenderObject.cpp:
1649         (WebCore::scheduleRelayoutForSubtree):
1650         * rendering/RenderTreeAsText.cpp:
1651         (WebCore::write):
1652         * rendering/RenderVideo.cpp:
1653         (WebCore::RenderVideo::updatePlayer):
1654         * rendering/RenderView.h:
1655         * rendering/RenderWidget.cpp:
1656         (WebCore::RenderWidget::updateWidgetPosition):
1657         * svg/graphics/SVGImage.cpp:
1658         (WebCore::SVGImage::draw):
1659         * testing/Internals.cpp:
1660         (WebCore::Internals::layoutCount const):
1661         
1662 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
1663
1664         Cleanup PageDebuggable
1665         https://bugs.webkit.org/show_bug.cgi?id=178972
1666
1667         Reviewed by Sam Weinig.
1668
1669         * page/PageDebuggable.cpp:
1670         (WebCore::PageDebuggable::PageDebuggable):
1671         * page/PageDebuggable.h:
1672
1673 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
1674
1675         Extract a WorkerDebuggerProxy interface out of WorkerReportingProxy
1676         https://bugs.webkit.org/show_bug.cgi?id=178975
1677
1678         Reviewed by Sam Weinig.
1679
1680         No new tests, just refactoring.
1681
1682         * workers/WorkerDebuggerProxy.h:
1683         * workers/WorkerReportingProxy.h:
1684         * WebCore.xcodeproj/project.pbxproj:
1685         Extract a method from WorkerReportingProxy to WorkerDebuggerProxy and
1686         rename it to be more general.
1687
1688         * inspector/WorkerToPageFrontendChannel.h:
1689         (WebCore::WorkerToPageFrontendChannel::sendMessageToFrontend):
1690         * workers/DedicatedWorkerThread.cpp:
1691         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1692         * workers/DedicatedWorkerThread.h:
1693         * workers/WorkerMessagingProxy.cpp:
1694         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1695         (WebCore::WorkerMessagingProxy::postMessageToDebugger):
1696         (WebCore::WorkerMessagingProxy::postMessageToPageInspector): Deleted.
1697         * workers/WorkerMessagingProxy.h:
1698         * workers/WorkerThread.cpp:
1699         (WebCore::WorkerThread::WorkerThread):
1700         * workers/WorkerThread.h:
1701         (WebCore::WorkerThread::workerDebuggerProxy const):
1702         * workers/service/context/ServiceWorkerThread.cpp:
1703         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1704         * workers/service/context/ServiceWorkerThread.h:
1705         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1706         (WebCore::ServiceWorkerThreadProxy::create):
1707         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
1708         Include a WorkerDebuggerProxy alongside the other proxies.
1709         Use the renamed debugger proxy method.
1710
1711 2017-10-28  Ryosuke Niwa  <rniwa@webkit.org>
1712
1713         Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
1714         https://bugs.webkit.org/show_bug.cgi?id=178715
1715         <rdar://problem/35144665>
1716
1717         Reviewed by Brent Fulgham.
1718
1719         Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
1720         instead of in the middle of collecting a list of stylesheets.
1721
1722         * dom/Document.cpp:
1723         (WebCore::Document::Document): Initialize the newly added timer.
1724         (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
1725         handlers may be expecting to see the document after XSLT had been applied.
1726         (WebCore::Document::scheduleToApplyXSLTransforms): Added.
1727         (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
1728         (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
1729         Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
1730         (WebCore::Document::applyXSLTransform): Deleted.
1731         (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
1732         inline XSLT and it happens much earlier than implicitClose.
1733         (WebCore::Document::suspendScheduledTasks): Suspend the XSLT timer.
1734         (WebCore::Document::resumeScheduledTasks): Reschedule the XSLT timer if m_hasPendingXSLTransforms is set.
1735         * dom/Document.h:
1736         * dom/ProcessingInstruction.cpp:
1737         (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
1738         stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
1739         function can be called from a non-script-resilient call stack.
1740         (WebCore::ProcessingInstruction::sheetLoaded): Ditto.
1741         * style/StyleScope.cpp:
1742         (WebCore::Style::Scope::collectXSLTransforms): Added.
1743         (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
1744         that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
1745         * style/StyleScope.h:
1746         * xml/parser/XMLDocumentParserLibxml2.cpp:
1747         (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.
1748
1749 2017-10-27  Devin Rousso  <webkit@devinrousso.com>
1750
1751         Web Inspector: Canvas Tab: no way to see backtrace of where a canvas context was created
1752         https://bugs.webkit.org/show_bug.cgi?id=178799
1753         <rdar://problem/35175805>
1754
1755         Reviewed by Brian Burg.
1756
1757         No new tests, updated existing tests.
1758
1759         * inspector/InspectorCanvas.h:
1760         * inspector/InspectorCanvas.cpp:
1761         (iterateCallFrames):
1762         (WebCore::InspectorCanvas::buildObjectForCanvas):
1763         (WebCore::InspectorCanvas::buildAction):
1764
1765         * inspector/InspectorCanvasAgent.cpp:
1766         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
1767         If the Canvas agent is enabled, generate a backtrace and send it to the frontend with the canvas.
1768         We do not do this for canvases created before the agent is enabled for performance reasons.
1769
1770 2017-10-27  Keith Miller  <keith_miller@apple.com>
1771
1772         Add unified source list files and build scripts to Xcode project navigator
1773         https://bugs.webkit.org/show_bug.cgi?id=178959
1774
1775         Reviewed by Andy Estes.
1776
1777         * WebCore.xcodeproj/project.pbxproj:
1778
1779 2017-10-27  Daniel Bates  <dabates@apple.com>
1780
1781         Only allow non-mixed content protected subresources to ask for credentials
1782         https://bugs.webkit.org/show_bug.cgi?id=178919
1783         <rdar://problem/35015245>
1784
1785         Reviewed by Alex Christensen.
1786
1787         Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful
1788         to allow protected mixed-content subresources to ask for credentials.
1789
1790         Tests: http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image.html
1791                http/tests/security/mixedContent/insecure-script-redirects-to-basic-auth-secure-script.html
1792                http/tests/security/mixedContent/insecure-stylesheet-redirects-to-basic-auth-secure-stylesheet.html
1793                http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https.html
1794                http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https.html
1795                http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html
1796
1797         * loader/ResourceLoader.cpp:
1798         (WebCore::ResourceLoader::ResourceLoader): Initialize m_canAskClientForCredentials based on the
1799         specified resource loader options.
1800         (WebCore::ResourceLoader::init): Update m_canAskClientForCredentials based on the URL of the initial
1801         request.
1802         (WebCore::ResourceLoader::isMixedContent const): Helper function to check if the specified URL
1803         represents a mixed content resource.
1804         (WebCore::ResourceLoader::willSendRequestInternal): If the original request or the redirect request
1805         is mixed content then update state such that we will disallow asking for credentials.
1806         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Modified to use m_canAskClientForCredentials
1807         when determining whether the request is allowed to ask for credentials.
1808         * loader/ResourceLoader.h:
1809
1810 2017-10-27  Chris Dumez  <cdumez@apple.com>
1811
1812         Unskip more Service Workers tests
1813         https://bugs.webkit.org/show_bug.cgi?id=178944
1814
1815         Reviewed by Sam Weinig.
1816
1817         Drop bad assertion that was causing the Service Worker WebProcess to crash and causing
1818         tests to fail as a result.
1819
1820         * workers/service/ServiceWorkerGlobalScope.cpp:
1821         (WebCore::ServiceWorkerGlobalScope::registration):
1822         * workers/service/ServiceWorkerGlobalScope.h:
1823
1824 2017-10-27  Ryan Haddad  <ryanhaddad@apple.com>
1825
1826         Unreviewed, rolling out r224011.
1827
1828         xsl LayoutTests hit an assertion added with this change since
1829         r223999 was rolled out.
1830
1831         Reverted changeset:
1832
1833         "Assert that no script is executed during style recalc"
1834         https://bugs.webkit.org/show_bug.cgi?id=178845
1835         https://trac.webkit.org/changeset/224011
1836
1837 2017-10-27  Antoine Quint  <graouts@apple.com>
1838
1839         [Web Animations] Expose the currentTime property on AnimationTimeline
1840         https://bugs.webkit.org/show_bug.cgi?id=178928
1841
1842         Reviewed by Dean Jackson.
1843
1844         We add the currentTime property on AnimationTimeline and add an internals method
1845         to set it in a test which will allow us to validate the timing model state for
1846         a given time.
1847
1848         Test: webanimations/timeline-current-time.html
1849
1850         * animation/AnimationTimeline.cpp:
1851         (WebCore::AnimationTimeline::bindingsCurrentTime const):
1852         (WebCore::AnimationTimeline::setCurrentTime):
1853         * animation/AnimationTimeline.h:
1854         (WebCore::AnimationTimeline::currentTime const):
1855         * animation/AnimationTimeline.idl:
1856         * testing/Internals.cpp:
1857         (WebCore::Internals::setTimelineCurrentTime):
1858         * testing/Internals.h:
1859         * testing/Internals.idl:
1860
1861 2017-10-27  Antoine Quint  <graouts@apple.com>
1862
1863         [Web Animations] Use Seconds vs. MonotonicTime to represent times
1864         https://bugs.webkit.org/show_bug.cgi?id=178950
1865
1866         Reviewed by Dean Jackson.
1867
1868         Animation start times, all expressed in seconds, in the Web Animations API are relative to the timeline
1869         originTime, itself relative to the page's nagigation time (Performance.navigationTime), so it makes more
1870         sense to use Seconds to represent them as opposed to a MonotonicTime.
1871
1872         * animation/WebAnimation.cpp:
1873         (WebCore::WebAnimation::bindingsStartTime const):
1874         (WebCore::WebAnimation::setBindingsStartTime):
1875         * animation/WebAnimation.h:
1876
1877 2017-10-27  Chris Dumez  <cdumez@apple.com>
1878
1879         DOMWindow::dispatchEvent() does not reset the event's dispatch flag
1880         https://bugs.webkit.org/show_bug.cgi?id=178897
1881
1882         Reviewed by Darin Adler.
1883
1884         Make sure we reset the currentTarget, dispatch flag, phase and propagation flags
1885         after dispatching an event on a Window, as per:
1886         - https://dom.spec.whatwg.org/#concept-event-dispatch
1887
1888         This behavior is consistent with Firefox.
1889
1890         Test: fast/events/window-load-initEvent.html
1891
1892         * page/DOMWindow.cpp:
1893         (WebCore::DOMWindow::dispatchEvent):
1894
1895 2017-10-27  Keith Miller  <keith_miller@apple.com>
1896
1897         Move iOS specific sources to unified sources
1898         https://bugs.webkit.org/show_bug.cgi?id=178915
1899
1900         Rubber-stamped by Tim Horton.
1901
1902         * SourcesCocoa.txt:
1903         * SourcesIOS.txt:
1904         * SourcesMac.txt:
1905         * WebCore.xcodeproj/project.pbxproj:
1906
1907 2017-10-27  Eric Carlson  <eric.carlson@apple.com>
1908
1909         NowPlayingInfo should contain a unique identifier
1910         https://bugs.webkit.org/show_bug.cgi?id=178872
1911         <rdar://problem/34924012>
1912
1913         Unreviewed, build fix.
1914
1915         * platform/audio/ios/MediaSessionManagerIOS.mm:
1916         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Call string.impl().hash() instead of
1917         string.existingHash() because the later will assert in a debug build if the hash hasn't
1918         been calculated yet.
1919         * platform/audio/mac/MediaSessionManagerMac.mm:
1920         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto.
1921
1922 2017-10-27  Alex Christensen  <achristensen@webkit.org>
1923
1924         Fix accessibility/mac/aria-label-on-label-element.html after r224074
1925         https://bugs.webkit.org/show_bug.cgi?id=178892
1926
1927         * accessibility/AccessibilityNodeObject.cpp:
1928         (WebCore::AccessibilityNodeObject::titleElementText const):
1929         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
1930         * accessibility/AccessibilityObject.h:
1931         (WebCore::AccessibilityText::AccessibilityText):
1932         Turns out my null checks changed behavior.  This undoes them.
1933
1934 2017-10-27  Ryan Haddad  <ryanhaddad@apple.com>
1935
1936         Unreviewed, rolling out r223999.
1937
1938         Caused xsl LayoutTest flakiness.
1939
1940         Reverted changeset:
1941
1942         "Style::Scope::flushPendingUpdate() can replace the entire
1943         document in XSLTProcessor::createDocumentFromSource"
1944         https://bugs.webkit.org/show_bug.cgi?id=178715
1945         https://trac.webkit.org/changeset/223999
1946
1947 2017-10-27  Chris Dumez  <cdumez@apple.com>
1948
1949         Audit init*Event() method to make sure they reset internal data members
1950         https://bugs.webkit.org/show_bug.cgi?id=178886
1951
1952         Reviewed by Ryosuke Niwa.
1953
1954         Audit init*Event() method to make sure they reset internal data members.
1955
1956         * dom/Event.cpp:
1957         (WebCore::Event::initEvent):
1958         * dom/KeyboardEvent.cpp:
1959         (WebCore::KeyboardEvent::initKeyboardEvent):
1960         * dom/MessageEvent.cpp:
1961         (WebCore::MessageEvent::initMessageEvent):
1962         * dom/MouseEvent.cpp:
1963         (WebCore::MouseEvent::initMouseEvent):
1964         * dom/MouseRelatedEvent.h:
1965         (WebCore::MouseRelatedEvent::setIsSimulated):
1966         * dom/TextEvent.cpp:
1967         (WebCore::TextEvent::initTextEvent):
1968         * dom/WheelEvent.cpp:
1969         (WebCore::WheelEvent::initWheelEvent):
1970
1971 2017-10-27  Chris Dumez  <cdumez@apple.com>
1972
1973         Add initial support for serviceWorkerClient.postMessage()
1974         https://bugs.webkit.org/show_bug.cgi?id=178794
1975
1976         Reviewed by Youenn Fablet.
1977
1978         Add initial support for serviceWorkerClient.postMessage():
1979         - https://w3c.github.io/ServiceWorker/#client-postmessage
1980
1981         It is now possible to do bi-directional communication with a service worker
1982         via postMessage().
1983
1984         No new tests, updated existing test.
1985
1986         * WebCore.xcodeproj/project.pbxproj:
1987         * dom/Document.cpp:
1988         (WebCore::generateDocumentIdentifier):
1989         (WebCore::Document::allDocumentsMap):
1990         (WebCore::Document::allDocuments):
1991         (WebCore::m_identifier):
1992         (WebCore::Document::~Document):
1993         * dom/Document.h:
1994         (WebCore::Document::identifier const):
1995         * dom/ScriptExecutionContext.cpp:
1996         (WebCore::ScriptExecutionContext::serviceWorkerContainer):
1997         * dom/ScriptExecutionContext.h:
1998         * workers/service/ServiceWorker.cpp:
1999         (WebCore::ServiceWorker::postMessage):
2000         * workers/service/ServiceWorkerClient.cpp:
2001         (WebCore::ServiceWorkerClient::ServiceWorkerClient):
2002         (WebCore::ServiceWorkerClient::~ServiceWorkerClient):
2003         (WebCore::ServiceWorkerClient::id const):
2004         (WebCore::ServiceWorkerClient::postMessage):
2005         * workers/service/ServiceWorkerClient.h:
2006         (WebCore::ServiceWorkerClient::create):
2007         * workers/service/ServiceWorkerClient.idl:
2008         * workers/service/ServiceWorkerClientIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
2009         (WebCore::ServiceWorkerClientIdentifier::toString const):
2010         * workers/service/ServiceWorkerRegistration.cpp:
2011         (WebCore::ServiceWorkerRegistration::unregister):
2012         * workers/service/ServiceWorkerWindowClient.cpp:
2013         (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
2014         * workers/service/ServiceWorkerWindowClient.h:
2015         * workers/service/context/SWContextManager.cpp:
2016         (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
2017         * workers/service/context/SWContextManager.h:
2018         * workers/service/context/ServiceWorkerThread.cpp:
2019         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
2020         * workers/service/context/ServiceWorkerThread.h:
2021         * workers/service/server/SWClientConnection.cpp:
2022         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
2023         * workers/service/server/SWClientConnection.h:
2024
2025 2017-10-27  Frederic Wang  <fwang@igalia.com>
2026
2027         Use auto for some variables in RenderLayerCompositor/Backing
2028         https://bugs.webkit.org/show_bug.cgi?id=178570
2029
2030         Reviewed by Darin Adler.
2031
2032         No new tests, behavior unchanged.
2033
2034         * rendering/RenderLayerBacking.cpp:
2035         (WebCore::canvasCompositingStrategy):
2036         (WebCore::RenderLayerBacking::RenderLayerBacking):
2037         (WebCore::computePageTiledBackingCoverage):
2038         (WebCore::RenderLayerBacking::layerWillBeDestroyed):
2039         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
2040         (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
2041         (WebCore::RenderLayerBacking::updateCompositedBounds):
2042         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
2043         (WebCore::RenderLayerBacking::updateAfterLayout):
2044         (WebCore::RenderLayerBacking::updateConfiguration):
2045         (WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
2046         (WebCore::RenderLayerBacking::updateGeometry):
2047         (WebCore::RenderLayerBacking::updateInternalHierarchy):
2048         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
2049         (WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers const):
2050         (WebCore::RenderLayerBacking::compositingOpacity const):
2051         (WebCore::isRestartedPlugin):
2052         (WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
2053         (WebCore::RenderLayerBacking::updateImageContents):
2054         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
2055         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
2056         (WebCore::RenderLayerBacking::getCurrentTransform const):
2057         (WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
2058         (WebCore::RenderLayerBacking::startAnimation):
2059         (WebCore::RenderLayerBacking::compositedBoundsIncludingMargin const):
2060         * rendering/RenderLayerCompositor.cpp:
2061         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2062         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubframes):
2063         (WebCore::updateScrollingLayerWithClient):
2064         (WebCore::RenderLayerCompositor::didFlushChangesForLayer):
2065         (WebCore::RenderLayerCompositor::didPaintBacking):
2066         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
2067         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const):
2068         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2069         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
2070         (WebCore::RenderLayerCompositor::logLayerInfo):
2071         (WebCore::checkIfDescendantClippingContextNeedsUpdate):
2072         (WebCore::styleChangeRequiresLayerRebuild):
2073         (WebCore::RenderLayerCompositor::canCompositeClipPath):
2074         (WebCore::rendererForCompositingTests):
2075         (WebCore::RenderLayerCompositor::updateBacking):
2076         (WebCore::RenderLayerCompositor::repaintOnCompositingChange):
2077         (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
2078         (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
2079         (WebCore::RenderLayerCompositor::setCompositingParent):
2080         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
2081         (WebCore::RenderLayerCompositor::hasCoordinatedScrolling const):
2082         (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
2083         (WebCore::RenderLayerCompositor::positionForClipLayer const):
2084         (WebCore::RenderLayerCompositor::frameViewDidLayout):
2085         (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged):
2086         (WebCore::RenderLayerCompositor::scrollingLayerDidChange):
2087         (WebCore::RenderLayerCompositor::frameContentsCompositor):
2088         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
2089         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
2090         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
2091         (WebCore::RenderLayerCompositor::setIsInWindow):
2092         (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
2093         (WebCore::RenderLayerCompositor::clippedByAncestor const):
2094         (WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const):
2095         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
2096         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
2097         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
2098         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
2099         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
2100         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
2101         (WebCore::RenderLayerCompositor::requiresScrollLayer const):
2102         (WebCore::RenderLayerCompositor::supportsFixedRootBackgroundCompositing const):
2103         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayer const):
2104         (WebCore::RenderLayerCompositor::resetTrackedRepaintRects):
2105         (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles const):
2106         (WebCore::RenderLayerCompositor::documentUsesTiledBacking const):
2107         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
2108         (WebCore::RenderLayerCompositor::updateLayerForHeader):
2109         (WebCore::RenderLayerCompositor::updateLayerForFooter):
2110         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2111         (WebCore::RenderLayerCompositor::ensureRootLayer):
2112         (WebCore::RenderLayerCompositor::destroyRootLayer):
2113         (WebCore::RenderLayerCompositor::attachRootLayer):
2114         (WebCore::RenderLayerCompositor::detachRootLayer):
2115         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
2116         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
2117         (WebCore::RenderLayerCompositor::deviceOrPageScaleFactorChanged):
2118         (WebCore::RenderLayerCompositor::computeFixedViewportConstraints const):
2119         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
2120         (WebCore::enclosingScrollingNodeID):
2121         (WebCore::scrollCoordinatedAncestorInParentOfFrame):
2122         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
2123         (WebCore::RenderLayerCompositor::attachScrollingNode):
2124         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
2125         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
2126         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2127         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):
2128         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
2129         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
2130         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView):
2131
2132 2017-10-27  Alicia Boya García  <aboya@igalia.com>
2133
2134         [GStreamer][MSE] Trim space between codecs
2135         https://bugs.webkit.org/show_bug.cgi?id=178160
2136
2137         Reviewed by Xabier Rodriguez-Calvar.
2138
2139         Modify supportsCodecs() to accept a Vector<String> instead of
2140         receiving a string and parsing itself.
2141
2142         This improves passrate for `mediasource-is-type-supported` as it
2143         ensures that whitespace between codecs is now trimmed and codec
2144         strings such as `video/webm;codecs="opus, vp9"` are matched as a valid
2145         type, as required by the spec.
2146
2147         This patch also renames supportCodecs() to supportAllCodecs() and adds
2148         a new variant, supportCodec(), that checks for support of an
2149         individual codec.
2150
2151         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2152         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
2153         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2154         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodec):
2155         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsAllCodecs):
2156         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
2157         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2158
2159 2017-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2160
2161         [GTK] Crash in WebCore::SelectionRangeData::apply
2162         https://bugs.webkit.org/show_bug.cgi?id=177808
2163
2164         Reviewed by Carlos Garcia Campos.
2165
2166         The problem appears to be a name collision between WebCore::SelectionData and
2167         WebCore::SelectionData. Yes, those are the same names. It seems the destructor for a
2168         Source/WebCore/platform/gtk/SelectionData.h SelectionData is being called on a
2169         Source/WebCore/rendering/SelectionRangeData.cpp SelectionData. Yikes. Can you forgive the
2170         poor linker for not being magic?
2171
2172         This fixes crashes in approximately one bajillion tests.
2173
2174         * rendering/SelectionRangeData.cpp: Move SelectionData into an anonymous namespace.
2175
2176 2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2177
2178         [WinCairo] Fix build after WebCore moves to unified source.
2179         https://bugs.webkit.org/show_bug.cgi?id=178920
2180
2181         Added empty implementations to fix link error.
2182
2183         Reviewed by Ryosuke Niwa.
2184
2185         * platform/network/curl/DNSCurl.cpp:
2186         (WebCore::DNSResolveQueue::updateIsUsingProxy):
2187         (WebCore::DNSResolveQueue::platformResolve):
2188
2189 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
2190
2191         Implement seek tolerance methods in WebAVPlayerController.
2192         https://bugs.webkit.org/show_bug.cgi?id=178838
2193         rdar://problem/33781777
2194
2195         Reviewed by Eric Carlson.
2196
2197         No new tests because this doesn't change any behavior in the page, but exposes seek tolerance to fullscreen platform UI.
2198
2199         * html/HTMLMediaElement.cpp:
2200         (WebCore::HTMLMediaElement::setCurrentTimeWithTolerance):
2201         * html/HTMLMediaElement.h:
2202         * platform/cocoa/PlaybackSessionModel.h:
2203         * platform/cocoa/PlaybackSessionModelMediaElement.h:
2204         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
2205         (WebCore::PlaybackSessionModelMediaElement::seekToTime):
2206         * platform/ios/WebAVPlayerController.mm:
2207         (-[WebAVPlayerController seekToTime:]):
2208         (-[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:]):
2209         (-[WebAVPlayerController seekByTimeInterval:]):
2210         (-[WebAVPlayerController seekByTimeInterval:toleranceBefore:toleranceAfter:]):
2211         (-[WebAVPlayerController seekToBeginning:]):
2212         (-[WebAVPlayerController seekToEnd:]):
2213         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2214         (VideoFullscreenControllerContext::seekToTime):
2215
2216 2017-10-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2217
2218         Unreviewed, fix WPE build after r224074
2219         https://bugs.webkit.org/show_bug.cgi?id=178892
2220
2221         * accessibility/wpe/AccessibilityObjectWPE.cpp:
2222         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
2223
2224 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
2225
2226         When navigating back to a page, compositing layers may not use accelerated drawing
2227         https://bugs.webkit.org/show_bug.cgi?id=178749
2228         rdar://problem/35158946
2229
2230         Reviewed by Dean Jackson.
2231
2232         There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
2233         occurred on back navigation, related to the ordering of style recalcs and layout.
2234
2235         First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
2236         its cacheAcceleratedCompositingFlags(), so any layers created during style update
2237         didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
2238         to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().
2239
2240         Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
2241         before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
2242         the TileController.
2243
2244         Test: compositing/accelerated-layers-after-back.html
2245
2246         * page/FrameView.cpp:
2247         (WebCore::FrameView::updateCompositingLayersAfterLayout):
2248         * platform/graphics/ca/GraphicsLayerCA.cpp:
2249         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2250         * rendering/RenderLayerCompositor.cpp:
2251         (WebCore::RenderLayerCompositor::willRecalcStyle):
2252         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
2253         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2254         * rendering/RenderLayerCompositor.h:
2255
2256 2017-10-26  Alex Christensen  <achristensen@webkit.org>
2257
2258         Fix Windows build
2259         https://bugs.webkit.org/show_bug.cgi?id=178892
2260
2261         * accessibility/win/AccessibilityObjectWin.cpp:
2262         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
2263
2264 2017-10-26  Alex Christensen  <achristensen@webkit.org>
2265
2266         Modernize AccessibilityObject.h
2267         https://bugs.webkit.org/show_bug.cgi?id=178892
2268
2269         Reviewed by Tim Horton.
2270
2271         The enums in AccessibilityObject.h are causing naming collisions with unified builds.
2272         This is what enum classes are for.
2273         HashMaps of enum classes still need a few casts to/from int.
2274         
2275         I also made some RefPtr's Ref's, use some initializer lists instead of values in the constructor implementation, and indentation fixing.
2276         
2277         No change in behavior.
2278
2279         * accessibility/AXObjectCache.cpp:
2280         (WebCore::AXComputedObjectAttributeCache::getIgnored const):
2281         (WebCore::AXObjectCache::~AXObjectCache):
2282         (WebCore::AXObjectCache::getOrCreate):
2283         (WebCore::AXObjectCache::remove):
2284         (WebCore::AXObjectCache::notificationPostTimerFired):
2285         * accessibility/AXObjectCache.h:
2286         (WebCore::AXComputedObjectAttributeCache::CachedAXObjectAttributes::CachedAXObjectAttributes):
2287         (WebCore::AXComputedObjectAttributeCache::getIgnored const):
2288         * accessibility/AccessibilityARIAGrid.cpp:
2289         (WebCore::AccessibilityARIAGrid::addChildren):
2290         * accessibility/AccessibilityARIAGridCell.cpp:
2291         (WebCore::AccessibilityARIAGridCell::parentRowGroup const):
2292         * accessibility/AccessibilityARIAGridRow.cpp:
2293         (WebCore::AccessibilityARIAGridRow::headerObject):
2294         * accessibility/AccessibilityAttachment.cpp:
2295         (WebCore::AccessibilityAttachment::accessibilityText):
2296         * accessibility/AccessibilityAttachment.h:
2297         * accessibility/AccessibilityImageMapLink.cpp:
2298         (WebCore::AccessibilityImageMapLink::roleValue const):
2299         (WebCore::AccessibilityImageMapLink::accessibilityText):
2300         * accessibility/AccessibilityLabel.cpp:
2301         (WebCore::childrenContainOnlyStaticText):
2302         * accessibility/AccessibilityLabel.h:
2303         * accessibility/AccessibilityList.cpp:
2304         (WebCore::AccessibilityList::isUnorderedList const):
2305         (WebCore::AccessibilityList::isOrderedList const):
2306         (WebCore::AccessibilityList::determineAccessibilityRole):
2307         (WebCore::AccessibilityList::roleValue const):
2308         * accessibility/AccessibilityListBox.cpp:
2309         (WebCore::AccessibilityListBox::setSelectedChildren):
2310         (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject const):
2311         * accessibility/AccessibilityListBox.h:
2312         * accessibility/AccessibilityListBoxOption.h:
2313         * accessibility/AccessibilityMathMLElement.cpp:
2314         (WebCore::AccessibilityMathMLElement::determineAccessibilityRole):
2315         (WebCore::AccessibilityMathMLElement::isMathScriptObject const):
2316         (WebCore::AccessibilityMathMLElement::isMathMultiscriptObject const):
2317         * accessibility/AccessibilityMediaControls.cpp:
2318         (WebCore::AccessibilityMediaControl::accessibilityText):
2319         (WebCore::AccessibilityMediaControl::roleValue const):
2320         * accessibility/AccessibilityMediaControls.h:
2321         * accessibility/AccessibilityMenuList.cpp:
2322         (WebCore::AccessibilityMenuList::addChildren):
2323         * accessibility/AccessibilityMenuList.h:
2324         * accessibility/AccessibilityMenuListOption.h:
2325         * accessibility/AccessibilityMenuListPopup.cpp:
2326         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject const):
2327         * accessibility/AccessibilityMenuListPopup.h:
2328         * accessibility/AccessibilityNodeObject.cpp:
2329         (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
2330         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
2331         (WebCore::AccessibilityNodeObject::canHaveChildren const):
2332         (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored const):
2333         (WebCore::AccessibilityNodeObject::isSearchField const):
2334         (WebCore::AccessibilityNodeObject::isImage const):
2335         (WebCore::AccessibilityNodeObject::isPasswordField const):
2336         (WebCore::AccessibilityNodeObject::isInputImage const):
2337         (WebCore::AccessibilityNodeObject::isProgressIndicator const):
2338         (WebCore::AccessibilityNodeObject::isSlider const):
2339         (WebCore::AccessibilityNodeObject::isMenuRelated const):
2340         (WebCore::AccessibilityNodeObject::isMenu const):
2341         (WebCore::AccessibilityNodeObject::isMenuBar const):
2342         (WebCore::AccessibilityNodeObject::isMenuButton const):
2343         (WebCore::AccessibilityNodeObject::isMenuItem const):
2344         (WebCore::AccessibilityNodeObject::isEnabled const):
2345         (WebCore::AccessibilityNodeObject::isChecked const):
2346         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute const):
2347         (WebCore::AccessibilityNodeObject::headingLevel const):
2348         (WebCore::AccessibilityNodeObject::isHeading const):
2349         (WebCore::AccessibilityNodeObject::isLink const):
2350         (WebCore::AccessibilityNodeObject::isGroup const):
2351         (WebCore::AccessibilityNodeObject::selectedRadioButton):
2352         (WebCore::AccessibilityNodeObject::checkboxOrRadioValue const):
2353         (WebCore::AccessibilityNodeObject::actionElement const):
2354         (WebCore::AccessibilityNodeObject::alterSliderValue):
2355         (WebCore::AccessibilityNodeObject::isGenericFocusableElement const):
2356         (WebCore::AccessibilityNodeObject::menuElementForMenuButton const):
2357         (WebCore::AccessibilityNodeObject::menuItemElementForMenu const):
2358         (WebCore::AccessibilityNodeObject::titleElementText const):
2359         (WebCore::AccessibilityNodeObject::alternativeText const):
2360         (WebCore::AccessibilityNodeObject::visibleText const):
2361         (WebCore::AccessibilityNodeObject::helpText const):
2362         (WebCore::AccessibilityNodeObject::accessibilityText):
2363         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
2364         (WebCore::AccessibilityNodeObject::accessibilityDescription const):
2365         (WebCore::AccessibilityNodeObject::roleIgnoresTitle const):
2366         (WebCore::AccessibilityNodeObject::hierarchicalLevel const):
2367         (WebCore::AccessibilityNodeObject::title const):
2368         (WebCore::AccessibilityNodeObject::text const):
2369         (WebCore::AccessibilityNodeObject::stringValue const):
2370         (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
2371         (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent const):
2372         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
2373         * accessibility/AccessibilityNodeObject.h:
2374         * accessibility/AccessibilityObject.cpp:
2375         (WebCore::AccessibilityObject::detach):
2376         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
2377         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
2378         (WebCore::AccessibilityObject::isBlockquote const):
2379         (WebCore::AccessibilityObject::isTextControl const):
2380         (WebCore::AccessibilityObject::isARIATextControl const):
2381         (WebCore::AccessibilityObject::isLandmark const):
2382         (WebCore::AccessibilityObject::findMatchingObjects):
2383         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
2384         (WebCore::AccessibilityObject::selectText):
2385         (WebCore::AccessibilityObject::isARIAInput):
2386         (WebCore::AccessibilityObject::isARIAControl):
2387         (WebCore::AccessibilityObject::isRangeControl const):
2388         (WebCore::AccessibilityObject::visiblePositionForBounds const):
2389         (WebCore::AccessibilityObject::supportsARIAReadOnly const):
2390         (WebCore::AccessibilityObject::ariaReadOnlyValue const):
2391         (WebCore::AccessibilityObject::headingElementForNode):
2392         (WebCore::AccessibilityObject::ariaTreeRows):
2393         (WebCore::AccessibilityObject::ariaTreeItemContent):
2394         (WebCore::AccessibilityObject::ariaTreeItemDisclosedRows):
2395         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
2396         (WebCore::AccessibilityObject::actionVerb const):
2397         (WebCore::AccessibilityObject::ariaCurrentState const):
2398         (WebCore::AccessibilityObject::ariaCurrentValue const):
2399         (WebCore::AccessibilityObject::orientation const):
2400         (WebCore::initializeRoleMap):
2401         (WebCore::AccessibilityObject::ariaRoleToWebCoreRole):
2402         (WebCore::AccessibilityObject::computedRoleString const):
2403         (WebCore::AccessibilityObject::supportsPressAction const):
2404         (WebCore::AccessibilityObject::sortDirection const):
2405         (WebCore::AccessibilityObject::supportsExpanded const):
2406         (WebCore::AccessibilityObject::isExpanded const):
2407         (WebCore::AccessibilityObject::supportsChecked const):
2408         (WebCore::AccessibilityObject::checkboxOrRadioValue const):
2409         (WebCore::AccessibilityObject::scrollByPage const):
2410         (WebCore::AccessibilityObject::lastKnownIsIgnoredValue):
2411         (WebCore::AccessibilityObject::setLastKnownIsIgnoredValue):
2412         (WebCore::AccessibilityObject::buttonRoleType const):
2413         (WebCore::AccessibilityObject::isButton const):
2414         (WebCore::AccessibilityObject::accessibilityIsIgnoredByDefault const):
2415         (WebCore::AccessibilityObject::defaultObjectInclusion const):
2416         (WebCore::AccessibilityObject::accessibilityIsIgnored const):
2417         (WebCore::AccessibilityObject::isContainedByPasswordField const):
2418         (WebCore::AccessibilityObject::AccessibilityObject): Deleted.
2419         * accessibility/AccessibilityObject.h:
2420         (WebCore::AccessibilityText::AccessibilityText):
2421         (WebCore::AccessibilityIsIgnoredFromParentData::AccessibilityIsIgnoredFromParentData):
2422         (WebCore::AccessibilityObject::isImageMap const):
2423         (WebCore::AccessibilityObject::isWebArea const):
2424         (WebCore::AccessibilityObject::isCheckbox const):
2425         (WebCore::AccessibilityObject::isRadioButton const):
2426         (WebCore::AccessibilityObject::isListBox const):
2427         (WebCore::AccessibilityObject::isSpinButton const):
2428         (WebCore::AccessibilityObject::isSwitch const):
2429         (WebCore::AccessibilityObject::isToggleButton const):
2430         (WebCore::AccessibilityObject::isTabList const):
2431         (WebCore::AccessibilityObject::isTabItem const):
2432         (WebCore::AccessibilityObject::isRadioGroup const):
2433         (WebCore::AccessibilityObject::isComboBox const):
2434         (WebCore::AccessibilityObject::isTree const):
2435         (WebCore::AccessibilityObject::isTreeGrid const):
2436         (WebCore::AccessibilityObject::isTreeItem const):
2437         (WebCore::AccessibilityObject::isScrollbar const):
2438         (WebCore::AccessibilityObject::isListItem const):
2439         (WebCore::AccessibilityObject::isScrollView const):
2440         (WebCore::AccessibilityObject::isCanvas const):
2441         (WebCore::AccessibilityObject::isPopUpButton const):
2442         (WebCore::AccessibilityObject::isColorWell const):
2443         (WebCore::AccessibilityObject::isSplitter const):
2444         (WebCore::AccessibilityObject::isToolbar const):
2445         (WebCore::AccessibilityObject::isSummary const):
2446         (WebCore::AccessibilityObject::isStaticText const):
2447         (WebCore::AccessibilityObject::ariaRoleAttribute const):
2448         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
2449         * accessibility/AccessibilityProgressIndicator.h:
2450         * accessibility/AccessibilityRenderObject.cpp:
2451         (WebCore::AccessibilityRenderObject::parentObject const):
2452         (WebCore::AccessibilityRenderObject::isAttachment const):
2453         (WebCore::AccessibilityRenderObject::helpText const):
2454         (WebCore::AccessibilityRenderObject::stringValue const):
2455         (WebCore::AccessibilityRenderObject::addRadioButtonGroupChildren const):
2456         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers const):
2457         (WebCore::AccessibilityRenderObject::linkedUIElements const):
2458         (WebCore::AccessibilityRenderObject::isAllowedChildOfTree const):
2459         (WebCore::objectInclusionFromAltText):
2460         (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
2461         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
2462         (WebCore::AccessibilityRenderObject::selectedTextRange const):
2463         (WebCore::AccessibilityRenderObject::isTabItemSelected const):
2464         (WebCore::AccessibilityRenderObject::isFocused const):
2465         (WebCore::AccessibilityRenderObject::setSelectedRows):
2466         (WebCore::AccessibilityRenderObject::getDocumentLinks):
2467         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
2468         (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
2469         (WebCore::AccessibilityRenderObject::supportsExpandedTextValue const):
2470         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2471         (WebCore::AccessibilityRenderObject::orientation const):
2472         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
2473         (WebCore::AccessibilityRenderObject::ariaRoleHasPresentationalChildren const):
2474         (WebCore::AccessibilityRenderObject::canSetExpandedAttribute const):
2475         (WebCore::AccessibilityRenderObject::addImageMapChildren):
2476         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
2477         (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
2478         (WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic const):
2479         (WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
2480         (WebCore::AccessibilityRenderObject::ariaListboxSelectedChildren):
2481         (WebCore::AccessibilityRenderObject::selectedChildren):
2482         (WebCore::AccessibilityRenderObject::visibleChildren):
2483         (WebCore::AccessibilityRenderObject::tabChildren):
2484         (WebCore::AccessibilityRenderObject::actionVerb const):
2485         (WebCore::msaaRoleForRenderer):
2486         (WebCore::AccessibilityRenderObject::roleValueForMSAA const):
2487         * accessibility/AccessibilitySVGElement.cpp:
2488         (WebCore::AccessibilitySVGElement::accessibilityText):
2489         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
2490         (WebCore::AccessibilitySVGElement::inheritsPresentationalRole const):
2491         (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute const):
2492         (WebCore::AccessibilitySVGElement::determineAccessibilityRole):
2493         * accessibility/AccessibilitySVGRoot.h:
2494         * accessibility/AccessibilityScrollView.cpp:
2495         (WebCore::AccessibilityScrollView::scrollBar):
2496         * accessibility/AccessibilityScrollView.h:
2497         * accessibility/AccessibilityScrollbar.cpp:
2498         (WebCore::AccessibilityScrollbar::orientation const):
2499         * accessibility/AccessibilityScrollbar.h:
2500         * accessibility/AccessibilitySlider.cpp:
2501         (WebCore::AccessibilitySlider::orientation const):
2502         (WebCore::AccessibilitySlider::addChildren):
2503         * accessibility/AccessibilitySlider.h:
2504         * accessibility/AccessibilitySpinButton.cpp:
2505         (WebCore::AccessibilitySpinButton::addChildren):
2506         * accessibility/AccessibilitySpinButton.h:
2507         * accessibility/AccessibilityTable.cpp:
2508         (WebCore::AccessibilityTable::hasARIARole const):
2509         (WebCore::AccessibilityTable::addChildren):
2510         (WebCore::AccessibilityTable::headerContainer):
2511         (WebCore::AccessibilityTable::roleValue const):
2512         (WebCore::AccessibilityTable::computeAccessibilityIsIgnored const):
2513         (WebCore::AccessibilityTable::titleElementText const):
2514         * accessibility/AccessibilityTableCell.cpp:
2515         (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored const):
2516         (WebCore::AccessibilityTableCell::determineAccessibilityRole):
2517         * accessibility/AccessibilityTableColumn.cpp:
2518         (WebCore::AccessibilityTableColumn::headerObject):
2519         * accessibility/AccessibilityTableColumn.h:
2520         * accessibility/AccessibilityTableHeaderContainer.h:
2521         * accessibility/AccessibilityTableRow.cpp:
2522         (WebCore::AccessibilityTableRow::determineAccessibilityRole):
2523         (WebCore::AccessibilityTableRow::computeAccessibilityIsIgnored const):
2524         * accessibility/AccessibilityTree.cpp:
2525         (WebCore::AccessibilityTree::determineAccessibilityRole):
2526         * accessibility/ios/AccessibilityObjectIOS.mm:
2527         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
2528         (WebCore::AccessibilityObject::isInputTypePopupButton const):
2529         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2530         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
2531         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
2532         (-[WebAccessibilityObjectWrapper _accessibilityTreeAncestor]):
2533         (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
2534         (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
2535         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
2536         (-[WebAccessibilityObjectWrapper _accessibilityTextEntryTraits]):
2537         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
2538         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2539         (-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
2540         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
2541         (-[WebAccessibilityObjectWrapper accessibilityValue]):
2542         (-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):
2543         (-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]):
2544         (-[WebAccessibilityObjectWrapper accessibilityLinkedElement]):
2545         (-[WebAccessibilityObjectWrapper treeItemParentForObject:]):
2546         (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):
2547         (-[WebAccessibilityObjectWrapper accessibilitySortDirection]):
2548         * accessibility/mac/AccessibilityObjectMac.mm:
2549         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
2550         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2551         (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
2552         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
2553         (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
2554         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
2555         (createAccessibilitySearchKeyMap):
2556         (accessibilitySearchKeyForString):
2557         (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
2558         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2559         (accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute):
2560         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
2561         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
2562         (createAccessibilityRoleMap):
2563         (roleValueToNSString):
2564         (-[WebAccessibilityObjectWrapper role]):
2565         (-[WebAccessibilityObjectWrapper subrole]):
2566         (-[WebAccessibilityObjectWrapper roleDescription]):
2567         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2568         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
2569         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2570         * inspector/InspectorDOMAgent.cpp:
2571         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2572
2573 2017-10-26  Youenn Fablet  <youenn@apple.com>
2574
2575         importScripts in service worker should use ServiceWorkersMode::None
2576         https://bugs.webkit.org/show_bug.cgi?id=178888
2577
2578         Reviewed by Chris Dumez.
2579
2580         Test: http/tests/workers/service/service-worker-importScript.html
2581
2582         Made sure ServiceWorkersMode::None is used for loading scripts in service workers as we do not support foreign fetch.
2583
2584         * workers/WorkerScriptLoader.cpp:
2585         (WebCore::WorkerScriptLoader::loadSynchronously):
2586
2587 2017-10-26  Keith Miller  <keith_miller@apple.com>
2588
2589         Unreviewed, cleanup changelogs.
2590
2591 2017-10-26  Keith Miller  <keith_miller@apple.com>
2592
2593         Unreviewed, add deprecated declarations pragma to fix macosx.
2594
2595         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2596
2597 2017-10-26  Andy Estes  <aestes@apple.com>
2598
2599         [Payment Request] Restrict API use to secure, same-origin frames
2600         https://bugs.webkit.org/show_bug.cgi?id=178887
2601
2602         Reviewed by Tim Horton.
2603
2604         Reuse the access checks from Apple Pay to restrict PaymentRequest API usage to secure frames
2605         in the same origin as the main frame.
2606
2607         Progresses active-document-cross-origin.https.sub.html and
2608         active-document-same-origin.https.html from web-platform-tests. Regresses basic.https.html
2609         since the allowpaymentrequest <iframe> attribute is not yet implemented.
2610
2611         * Modules/applepay/ApplePaySession.cpp:
2612         (WebCore::ApplePaySession::create):
2613         (WebCore::ApplePaySession::supportsVersion):
2614         (WebCore::ApplePaySession::canMakePayments):
2615         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
2616         (WebCore::ApplePaySession::openPaymentSetup):
2617         (WebCore::isSecure): Deleted.
2618         (WebCore::canCallApplePaySessionAPIs): Deleted.
2619         * Modules/applepay/PaymentSession.cpp: Added.
2620         (WebCore::isSecure):
2621         (WebCore::PaymentSession::canCreateSession):
2622         * Modules/applepay/PaymentSession.h:
2623         * Modules/paymentrequest/PaymentHandler.cpp:
2624         (WebCore::PaymentHandler::canCreateSession):
2625         * Modules/paymentrequest/PaymentHandler.h:
2626         * Modules/paymentrequest/PaymentRequest.cpp:
2627         (WebCore::PaymentRequest::create):
2628         * WebCore.xcodeproj/project.pbxproj:
2629
2630 2017-10-26  Youenn Fablet  <youenn@apple.com>
2631
2632         Add service worker handle fetch support for all subresource requests
2633         https://bugs.webkit.org/show_bug.cgi?id=178769
2634
2635         Reviewed by Chris Dumez.
2636
2637         Test: http/tests/workers/service/image-fetch.html
2638
2639         Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
2640         Setting the selected service worker identifier for subresource only at the moment.
2641
2642         Testing is limited to images, future wpt tests should cover other subresource cases.
2643
2644         * loader/DocumentThreadableLoader.cpp:
2645         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2646         * loader/cache/CachedResourceLoader.cpp:
2647         (WebCore::CachedResourceLoader::prepareFetch):
2648         * loader/cache/CachedResourceRequest.cpp:
2649         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
2650         * loader/cache/CachedResourceRequest.h:
2651
2652 2017-10-26  Eric Carlson  <eric.carlson@apple.com>
2653
2654         NowPlayingInfo should contain a unique identifier
2655         https://bugs.webkit.org/show_bug.cgi?id=178872
2656
2657         Reviewed by Jer Noble.
2658
2659         Updated TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm.
2660
2661         * platform/audio/PlatformMediaSessionManager.h:
2662         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const): New.
2663
2664         * platform/audio/ios/MediaSessionManagerIOS.h:
2665         * platform/audio/ios/MediaSessionManagerIOS.mm:
2666         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Ditto.
2667
2668         * platform/audio/mac/MediaSessionManagerMac.h:
2669         * platform/audio/mac/MediaSessionManagerMac.mm:
2670         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto. Don't leak CFString.
2671
2672         * platform/mac/MediaRemoteSoftLink.cpp: Softlink kMRMediaRemoteNowPlayingInfoUniqueIdentifier.
2673         * platform/mac/MediaRemoteSoftLink.h:
2674
2675 2017-10-26  Keith Miller  <keith_miller@apple.com>
2676
2677         Unreviewed, iOS build fix.
2678
2679         * SourcesMac.txt:
2680         * WebCore.xcodeproj/project.pbxproj:
2681
2682 2017-10-26  Keith Miller  <keith_miller@apple.com>
2683
2684         Move Mac specific files to unified sources
2685         https://bugs.webkit.org/show_bug.cgi?id=178883
2686
2687         Rubber-stamped by Tim Horton.
2688
2689         * SourcesCocoa.txt:
2690         * SourcesMac.txt:
2691         * WebCore.xcodeproj/project.pbxproj:
2692
2693 2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>
2694
2695         DidMoveToNewDocumentAssertionScope shouldn't be necessary
2696         https://bugs.webkit.org/show_bug.cgi?id=178836
2697         <rdar://problem/35008876>
2698
2699         Reviewed by Antti Koivisto.
2700
2701         DidMoveToNewDocumentAssertionScope was introduced in r217972 to replace an existing assertion to make sure
2702         Node::didMoveToNewDocument is always called by its overrides in Node's subclasses. However, we can ensure
2703         better Node::didMoveToNewDocument is always called if we called it directly in Node::moveTreeToNewScope.
2704
2705         Because only subclasses of Element and ShadowRoot override Node::didMoveToNewDocument and we already have
2706         a specialized code path to adopt a ShadowRoot to a new document, this refactoring eliminates the need for
2707         having a virtual function on Node at all.
2708
2709         Hence this patch names Node::didMoveToNewDocument to Node::moveToNewDocument and makes it non-virtual,
2710         splits ShadowRoot::didMoveToNewDocument into moveShadowRootToNewParentScope and moveShadowRootToNewDocument,
2711         and removes DidMoveToNewDocumentAssertionScope completely.
2712
2713         No new tests since there should be no behavioral change.
2714
2715         * dom/Document.cpp:
2716         (WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Renamed from moveNodeIteratorsToNewDocument.
2717         * dom/Document.h:
2718         (WebCore::Document::moveNodeIteratorsToNewDocument): Inlined the check for emptiness of m_nodeIterators to
2719         avoid keep calling moveNodeIteratorsToNewDocumentSlowCase on every single node getting moved.
2720         * dom/Element.cpp:
2721         (WebCore::Element::didMoveToNewDocument): Removed the call to Node::didMoveToNewDocument since this is the
2722         base virtual function now.
2723         * dom/Element.h:
2724         * dom/Node.cpp:
2725         (WebCore::DidMoveToNewDocumentAssertionScope::DidMoveToNewDocumentAssertionScope): Deleted.
2726         (WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope): Deleted.
2727         (WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall): Deleted.
2728         (WebCore::moveNodeToNewDocument): Deleted.
2729         (WebCore::Node::moveShadowTreeToNewDocument): Made this a member function of Node since it needs to call
2730         moveNodeToNewDocument, which is private to Node.
2731         (WebCore::Node::moveTreeToNewScope): Removed the release assert for the root node since  the same check
2732         exists inside traverseSubtreeToUpdateTreeScope. Also removed the release assertion for checking that
2733         node's old document matches the old document since document() simply calls treeScope().documentScope()
2734         and we're already release-asserting that the old scope of a node matches the old scope we know of.
2735         We release-assert that the old tree scope's document didn't change after the traversal instead. Finally,
2736         replaced a bunch of RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
2737         (WebCore::Node::moveNodeToNewDocument): Renamed from didMoveToNewDocument. Moved the code related to
2738         mutation observers inside hasRareData() check, and moved the the code to move event listeners inside
2739         eventTargetData() check both for clarity, and avoid doing the work for every single node being moved.
2740         Finally, call the old didMoveToNewDocument when "this" is an Element.
2741         * dom/Node.h:
2742         * dom/ShadowRoot.cpp:
2743         (WebCore::ShadowRoot::moveShadowRootToNewParentScope): Added. Extracted from didMoveToNewDocument.
2744         (WebCore::ShadowRoot::moveShadowRootToNewDocument): Renamed from didMoveToNewDocument. We now
2745         release-assert that parent tree scope's document matches the new document if any.
2746         * dom/ShadowRoot.h:
2747
2748 2017-10-26  Youenn Fablet  <youenn@apple.com>
2749
2750         Implement ServiceWorkerContainer getRegistration
2751         https://bugs.webkit.org/show_bug.cgi?id=178882
2752
2753         Reviewed by Chris Dumez.
2754
2755         Replace rejection promise by resolving the promise with a null value.
2756         This helps in running WPT tests as WPT tests usually check for registered service workers before running tests.
2757         For WTR, there should be no registered service worker anyway.
2758
2759         * workers/service/ServiceWorkerContainer.cpp:
2760         (WebCore::ServiceWorkerContainer::getRegistration):
2761         * workers/service/ServiceWorkerContainer.h:
2762
2763 2017-10-26  Dan Bernstein  <mitz@apple.com>
2764
2765         Account for Mail’s WebMessageDocument class being renamed
2766         https://bugs.webkit.org/show_bug.cgi?id=178881
2767
2768         Reviewed by Sam Weinig.
2769
2770         * editing/cocoa/HTMLConverter.mm:
2771         (_WebMessageDocumentClass): Look up the class by its new name. No longer look it up by the
2772           old old name, because TOT WebKit isn’t going to be used by versions of Mail that have that name.
2773
2774 2017-10-26  Antoine Quint  <graouts@apple.com>
2775
2776         Remove FrameView::serviceScriptedAnimations and Document::serviceScriptedAnimations
2777         https://bugs.webkit.org/show_bug.cgi?id=178879
2778
2779         Reviewed by Dean Jackson.
2780
2781         There are no call sites for FrameView::serviceScriptedAnimations() and that method is the
2782         only call site for Document::serviceScriptedAnimations(), so both can go.
2783
2784         * dom/Document.cpp:
2785         (WebCore::Document::serviceScriptedAnimations): Deleted.
2786         * dom/Document.h:
2787         * page/FrameView.cpp:
2788         (WebCore::FrameView::serviceScriptedAnimations): Deleted.
2789         * page/FrameView.h:
2790
2791 2017-10-26  Chris Dumez  <cdumez@apple.com>
2792
2793         Bring back SWContextManager abstraction in WebCore
2794         https://bugs.webkit.org/show_bug.cgi?id=178876
2795
2796         Reviewed by Geoffrey Garen.
2797
2798         Bring back SWContextManager abstraction in WebCore. It was killed in <https://trac.webkit.org/changeset/223718> but
2799         is actually useful when the ServiceWorker wants to message the storage process.
2800
2801         * Sources.txt:
2802         * WebCore.xcodeproj/project.pbxproj:
2803         * workers/service/context/SWContextManager.cpp: Added.
2804         (WebCore::SWContextManager::singleton):
2805         (WebCore::SWContextManager::setConnection):
2806         (WebCore::SWContextManager::connection const):
2807         (WebCore::SWContextManager::registerServiceWorkerThread):
2808         (WebCore::SWContextManager::serviceWorkerThreadProxy const):
2809         (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
2810         * workers/service/context/SWContextManager.h: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
2811         (WebCore::SWContextManager::Connection::~Connection):
2812
2813 2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2814
2815         [Curl] Rename CurlJobManager to CurlRequestScheduler
2816         https://bugs.webkit.org/show_bug.cgi?id=178775
2817
2818         To match the meaning of the class.
2819         It was originally meant to be more generic purpose, but as
2820         other classes was introduced, the objective of the class is
2821         now only to handle the life cycle of curl requests.
2822
2823         The delegate is also renamed to CurlRequestSchedulerClient.
2824
2825         Reviewed by Alex Christensen.
2826
2827         * platform/Curl.cmake:
2828         * platform/network/curl/CurlDownload.cpp:
2829         (WebCore::CurlDownload::~CurlDownload):
2830         (WebCore::CurlDownload::willSendRequest):
2831         * platform/network/curl/CurlDownload.h:
2832         * platform/network/curl/CurlRequest.cpp:
2833         (WebCore::CurlRequest::CurlRequest):
2834         (WebCore::CurlRequest::start):
2835         (WebCore::CurlRequest::startWithJobManager):
2836         (WebCore::CurlRequest::cancel):
2837         (WebCore::CurlRequest::callClient):
2838         (WebCore::CurlRequest::didReceiveData):
2839         (WebCore::CurlRequest::didCompleteTransfer):
2840         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
2841         (WebCore::CurlRequest::invokeDidReceiveResponse):
2842         (WebCore::CurlRequest::completeDidReceiveResponse):
2843         (WebCore::CurlRequest::pausedStatusChanged):
2844         (WebCore::CurlRequest::callDelegate): Deleted.
2845         * platform/network/curl/CurlRequest.h:
2846         (WebCore::CurlRequest::create):
2847         (WebCore::CurlRequest::setClient):
2848         (WebCore::CurlRequest::setDelegate): Deleted.
2849         * platform/network/curl/CurlRequestClient.h: Renamed from Source/WebCore/platform/network/curl/CurlRequestDelegate.h.
2850         * platform/network/curl/CurlRequestScheduler.cpp: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.cpp.
2851         (WebCore::CurlJobList::startJobs):
2852         (WebCore::CurlJobList::finishJobs):
2853         (WebCore::CurlRequestScheduler::singleton):
2854         (WebCore::CurlRequestScheduler::add):
2855         (WebCore::CurlRequestScheduler::cancel):
2856         (WebCore::CurlRequestScheduler::callOnWorkerThread):
2857         (WebCore::CurlRequestScheduler::startThreadIfNeeded):
2858         (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
2859         (WebCore::CurlRequestScheduler::stopThread):
2860         (WebCore::CurlRequestScheduler::updateJobList):
2861         (WebCore::CurlRequestScheduler::workerThread):
2862         * platform/network/curl/CurlRequestScheduler.h: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.h.
2863         (WebCore::CurlRequestScheduler::~CurlRequestScheduler):
2864         * platform/network/curl/CurlRequestSchedulerClient.h: Added.
2865         (WebCore::CurlRequestSchedulerClient::~CurlRequestSchedulerClient):
2866         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2867         (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
2868         (WebCore::ResourceHandleCurlDelegate::setAuthentication):
2869         (WebCore::ResourceHandleCurlDelegate::continueAfterWillSendRequest):
2870         * platform/network/curl/ResourceHandleCurlDelegate.h:
2871
2872 2017-10-26  Antti Koivisto  <antti@apple.com>
2873
2874         Remove unnecessary whitespace invalidation logic from RenderTreeUpdater
2875         https://bugs.webkit.org/show_bug.cgi?id=178786
2876
2877         Reviewed by Zalan Bujtas.
2878
2879         RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded is a somewhat complex
2880         and confusing function for figuring out if some whitespace-only text node might need to have its
2881         rendering status recomputed. However actually computing if a text renderer is needed is not expensive.
2882         We can simply do it for all whitespace nodes after a sibling mutation.
2883
2884         This also removes a set that could have stale renderer pointers in it (they were never dereferenced).
2885
2886         * rendering/RenderBlock.cpp:
2887         (WebCore::RenderBlock::addChildIgnoringContinuation):
2888
2889             Fix a display:contents bug exposed by this change. With display:contents a text renderer may have an anonymous
2890             inline wrapper and we need to take it into account when the text renderer is the beforeChild.
2891
2892             Tested by imported/w3c/web-platform-tests/css/css-display-3/display-contents-state-change-001.html
2893
2894         * style/RenderTreeUpdater.cpp:
2895         (WebCore::RenderTreeUpdater::updateRenderTree):
2896
2897             Call updateTextRenderer() for all whitespace-only text nodes after a change in siblings.
2898             In normal update case it just figures out quickly (by calling textRendererIsNeeded)
2899             that there are no changes and bails out.
2900
2901         (WebCore::RenderTreeUpdater::updateElementRenderer):
2902         (WebCore::RenderTreeUpdater::updateTextRenderer):
2903         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): Deleted.
2904
2905             No longer needed. Just mark that there have been changes to siblings instead.
2906
2907         * style/RenderTreeUpdater.h:
2908
2909 2017-10-26  Myles C. Maxfield  <mmaxfield@apple.com>
2910
2911         Mark font palettes as in development
2912         https://bugs.webkit.org/show_bug.cgi?id=178590
2913
2914         Unreviewed.
2915
2916         * features.json:
2917
2918 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2919
2920         Unreviewed, rolling out r223984.
2921
2922         Caused LayoutTest assertion failures.
2923
2924         Reverted changeset:
2925
2926         "When navigating back to a page, compositing layers may not
2927         use accelerated drawing"
2928         https://bugs.webkit.org/show_bug.cgi?id=178749
2929         https://trac.webkit.org/changeset/223984
2930
2931 2017-10-26  Youenn Fablet  <youenn@apple.com>
2932
2933         Add inspector logging for MediaElementSession autoplay
2934         https://bugs.webkit.org/show_bug.cgi?id=178846
2935
2936         Reviewed by Eric Carlson.
2937
2938         No change of behavior.
2939         Making use of pal Logger in MediaElementSession.
2940         This new logging is limited to autoplay/playback for now.
2941
2942         * html/MediaElementSession.cpp:
2943         (WebCore::MediaElementSession::MediaElementSession):
2944         (WebCore::MediaElementSession::playbackPermitted const):
2945         (WebCore::MediaElementSession::autoplayPermitted const):
2946         (WebCore::MediaElementSession::willLog const):
2947         (WebCore::MediaElementSession::logChannel const):
2948         * html/MediaElementSession.h:
2949
2950 2017-10-26  Keith Miller  <keith_miller@apple.com>
2951
2952         Move ApplePay to unified sources
2953         https://bugs.webkit.org/show_bug.cgi?id=178871
2954
2955         Rubber-stamped by Tim Horton.
2956
2957         Also, add some other missing files.
2958
2959         * SourcesCocoa.txt:
2960         * WebCore.xcodeproj/project.pbxproj:
2961
2962 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2963
2964         Unreviewed, rolling out r224019.
2965
2966         This change caused API test WebKit.MSEIsPlayingAudio to time
2967         out.
2968
2969         Reverted changeset:
2970
2971         "XMLHttpRequest should not treat file URLs as same origin"
2972         https://bugs.webkit.org/show_bug.cgi?id=178565
2973         https://trac.webkit.org/changeset/224019
2974
2975 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2976
2977         Unreviewed, rolling out r223994.
2978
2979         The LayoutTest for this change is failing.
2980
2981         Reverted changeset:
2982
2983         "Add service worker handle fetch support for all subresource
2984         requests"
2985         https://bugs.webkit.org/show_bug.cgi?id=178769
2986         https://trac.webkit.org/changeset/223994
2987
2988 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2989
2990         Unreviewed, rolling out r223908.
2991
2992         Causes LayoutTest crashes with newer SDKs.
2993
2994         Reverted changeset:
2995
2996         "Adopt new secure coding APIs"
2997         https://bugs.webkit.org/show_bug.cgi?id=178484
2998         https://trac.webkit.org/changeset/223908
2999
3000 2017-10-25  Brent Fulgham  <bfulgham@apple.com>
3001
3002         XMLHttpRequest should not treat file URLs as same origin
3003         https://bugs.webkit.org/show_bug.cgi?id=178565
3004         <rdar://problem/11115901>
3005
3006         Reviewed by Ryosuke Niwa.
3007
3008         Do not treat file URLs as same-origin for XHR requests.
3009
3010         Test: fast/xmlhttprequest/xmlhttprequest-access-self-as-file.html
3011
3012         * loader/DocumentThreadableLoader.cpp:
3013         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Use new helper method.
3014         * page/SecurityOrigin.cpp:
3015         (WebCore::SecurityOrigin::requestIsSameOrigin): New method to recognize same-origin
3016         requests, with special handling for XHR.
3017         * page/SecurityOrigin.h:
3018
3019 2017-10-26  Christopher Reid  <chris.reid@sony.com>
3020
3021         Remove scopeguard from platform
3022         https://bugs.webkit.org/show_bug.cgi?id=178681
3023
3024         Reviewed by Brady Eidson.
3025
3026         Replacing platform/ScopeGuard with WTF::ScopeExit.
3027         No new tests, no change in behavior.
3028
3029         * Modules/indexeddb/IDBRequest.cpp:
3030         * Modules/indexeddb/IDBRequest.h:
3031         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3032         * WebCore.xcodeproj/project.pbxproj:
3033         * platform/FileSystem.cpp:
3034         * platform/ScopeGuard.h: Removed.
3035         * platform/network/BlobRegistryImpl.cpp:
3036         * workers/service/ServiceWorkerContainer.cpp:
3037
3038 2017-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3039
3040         REGRESSION(r222090): [HarfBuzz] Arabic shaping is broken except for first word in line
3041         https://bugs.webkit.org/show_bug.cgi?id=178625
3042
3043         Reviewed by Michael Catanzaro.
3044
3045         Once we find the first space, which has the COMMON script, we split the run, and the next ones keep using
3046         COMMON instead of ARABIC because we don't update the current script on every loop iteration. This patch
3047         simplifies the script handling by moving the code back to the loop and always breaking in case of different
3048         scripts, correctly handling INHERITED and COMMON cases and updating the current script when needed.
3049
3050         Covered by existing tests. This improves several tests that have been rebaselined.
3051
3052         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
3053         (WebCore::findNextRun):
3054         (WebCore::scriptsAreCompatibleForCharacters): Deleted.
3055
3056 2017-10-26  Enrique Ocaña González  <eocanha@igalia.com>
3057
3058         [MSE][GStreamer] Fix hang on clearing/destroying AppendPipeline
3059         https://bugs.webkit.org/show_bug.cgi?id=178819
3060
3061         Reviewed by Xabier Rodriguez-Calvar.
3062
3063         The deadlock may occur when UI thread tries to clear pipeline in
3064         AppendPipeline::clearPlayerPrivate() while parser thread tries to change
3065         pipeline state to pause holding the stream lock in
3066         AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread()
3067
3068         This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
3069
3070         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3071         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
3072         Return if there's no player private.
3073
3074 2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>
3075
3076         Assert that no script is executed during style recalc
3077         https://bugs.webkit.org/show_bug.cgi?id=178845
3078         <rdar://problem/35106129>
3079
3080         Reviewed by Antti Koivisto.
3081
3082         This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
3083         to make sure we don't start mutating DOM in the middle of a style update.
3084
3085         Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
3086         shadow tree since that happens while updating the style.
3087
3088         No new tests since there should be no behavioral change.
3089
3090         * dom/Document.cpp:
3091         (WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
3092         and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
3093         the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
3094         Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
3095         scripts which in turn trigger another (recursive) style recalc.
3096         (WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
3097         NoEventDispatchAssertion.
3098         * dom/Element.cpp:
3099         (WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
3100         newly cloned element for SVG use element's shadow tree.
3101         (WebCore::Element::cloneElementWithoutChildren): Ditto.
3102         * dom/EventDispatcher.cpp:
3103         (WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
3104         use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
3105         since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
3106         pushing or popoing the stack frame.
3107         * svg/SVGUseElement.cpp:
3108         (WebCore::SVGUseElement::clearShadowTree):
3109         (WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
3110         of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
3111         scripts, it's safe to mutate them during the style recalc even though it's not the best design.
3112         (WebCore::SVGUseElement::cloneTarget const): Ditto.
3113         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
3114         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
3115         (WebCore::SVGUseElement::transferEventListenersToShadowTree const):
3116
3117 2017-10-25  Keith Miller  <keith_miller@apple.com>
3118
3119         Move platform Cocoa sources to unified sources
3120         https://bugs.webkit.org/show_bug.cgi?id=178851
3121
3122         Rubber-stamped by Tim Horton.
3123
3124         * SourcesCocoa.txt:
3125         * WebCore.xcodeproj/project.pbxproj:
3126
3127 2017-10-25  Keith Miller  <keith_miller@apple.com>
3128
3129         Start moving Cocoa specific unified sources
3130         https://bugs.webkit.org/show_bug.cgi?id=178850
3131
3132         Rubber-stamped by Tim Horton.
3133
3134         * PlatformMac.cmake:
3135         * SourcesCocoa.txt:
3136         * WebCore.xcodeproj/project.pbxproj:
3137
3138 2017-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3139
3140         [HarfBuzz] ComplexTextRun should initialize direction from the harfbuzz buffer
3141         https://bugs.webkit.org/show_bug.cgi?id=178788
3142
3143         Reviewed by Michael Catanzaro.
3144
3145         Instead of using the TextRun direction. If the TextRun is ltr, but the harfbuzz buffer is rtl, the character
3146         indexes will be swapped in m_coreTextIndices.
3147
3148         * platform/graphics/ComplexTextController.h:
3149         (WebCore::ComplexTextController::ComplexTextRun::create): Remove the ltr parameter.
3150         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
3151         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Initialize m_isLTR using hb_buffer_get_direction().
3152         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Do not pass ltr to ComplexTextRun::create().
3153
3154 2017-10-25  Keith Miller  <keith_miller@apple.com>
3155
3156         Move remaining platform independent sources to unified sources
3157         https://bugs.webkit.org/show_bug.cgi?id=178849
3158
3159         Rubber-stamped by Tim Horton.
3160
3161         * CMakeLists.txt:
3162         * Sources.txt:
3163         * WebCore.xcodeproj/project.pbxproj:
3164
3165 2017-10-25  Keith Miller  <keith_miller@apple.com>
3166
3167         Move plugins and rendering to unified sources
3168         https://bugs.webkit.org/show_bug.cgi?id=178848
3169
3170         Rubber-stamped by Tim Horton.
3171
3172         * CMakeLists.txt:
3173         * Sources.txt:
3174         * WebCore.xcodeproj/project.pbxproj:
3175
3176 2017-10-25  Keith Miller  <keith_miller@apple.com>
3177
3178         Unreviewed, add FEMorphology.cpp back to the regular build after r224003.
3179
3180         * WebCore.xcodeproj/project.pbxproj:
3181
3182 2017-10-25  Keith Miller  <keith_miller@apple.com>
3183
3184         Unreviewed, Windows build fix.
3185
3186         * Sources.txt:
3187
3188 2017-10-25  Devin Rousso  <webkit@devinrousso.com>
3189
3190         Web Inspector: provide a way to enable/disable event listeners
3191         https://bugs.webkit.org/show_bug.cgi?id=177451
3192         <rdar://problem/34994925>
3193
3194         Reviewed by Joseph Pecoraro.
3195
3196         Test: inspector/dom/setEventListenerDisabled.html
3197
3198         * dom/EventTarget.cpp:
3199         (WebCore::EventTarget::fireEventListeners):
3200         Add InspectorInstrumentation call to isEventListenerDisabled. If true, the event listener's
3201         callback will not be called.
3202
3203         * inspector/InspectorDOMAgent.h:
3204         * inspector/InspectorDOMAgent.cpp:
3205         (WebCore::InspectorDOMAgent::discardBindings):
3206         (WebCore::InspectorDOMAgent::getEventListenersForNode):
3207         (WebCore::InspectorDOMAgent::setEventListenerDisabled):
3208         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
3209         (WebCore::InspectorDOMAgent::willRemoveEventListener):
3210         (WebCore::InspectorDOMAgent::isEventListenerDisabled):
3211         Introduce a mapping of `EventListener*` to `InspectorEventListener`, a struct for uniquely
3212         identifying event listeners so they can be referenced from the frontend. We only add items
3213         to this mapping when `getEventListenersForNode` is called, as that is when EventListener
3214         data is sent to the frontend. This allows us to defer creating an Inspector "mirror" object
3215         for each EventListener until it is needed. Items are removed whenever an event listener is
3216         removed or when the document changes.
3217
3218         * inspector/InspectorInstrumentation.h:
3219         (WebCore::InspectorInstrumentation::isEventListenerDisabled):
3220         * inspector/InspectorInstrumentation.cpp:
3221         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
3222         (WebCore::InspectorInstrumentation::isEventListenerDisabledImpl):
3223         Pass additional parameters to InspectorDOMAgent so it can determine if the event listener
3224         actually exists. If not, don't dispatch an event to the frontend as nothing will change.
3225
3226 2017-10-25  Keith Miller  <keith_miller@apple.com>
3227
3228         Move Platform to unified sources.
3229         https://bugs.webkit.org/show_bug.cgi?id=178829
3230
3231         Rubber-stamped by Tim Horton.
3232
3233         * CMakeLists.txt:
3234         * Sources.txt:
3235         * WebCore.xcodeproj/project.pbxproj:
3236         * platform/Cursor.cpp:
3237         * platform/sql/SQLiteDatabase.h:
3238
3239 2017-10-25  Chris Dumez  <cdumez@apple.com>
3240
3241         messageEvent.source can also be a ServiceWorker
3242         https://bugs.webkit.org/show_bug.cgi?id=178839
3243
3244         Reviewed by Brady Eidson.
3245
3246         messageEvent.source can also be a ServiceWorker:
3247         - https://html.spec.whatwg.org/multipage/comms.html#messageeventsource
3248
3249         This enables calling postMessage() from a ServiceWorker via Bug 178794.
3250
3251         * dom/MessageEvent.cpp:
3252         (WebCore::MessageEvent::source const): Deleted.
3253         * dom/MessageEvent.h:
3254         * dom/MessageEvent.idl:
3255
3256 2017-10-25  Ryosuke Niwa  <rniwa@webkit.org>
3257
3258         Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
3259         https://bugs.webkit.org/show_bug.cgi?id=178715
3260         <rdar://problem/35144665>
3261
3262         Reviewed by Brent Fulgham.
3263
3264         Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
3265         instead of in the middle of collecting a list of stylesheets.
3266
3267         * dom/Document.cpp:
3268         (WebCore::Document::Document): Initialize the newly added timer.
3269         (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
3270         handlers may be expecting to see the document after XSLT had been applied.
3271         (WebCore::Document::scheduleToApplyXSLTransforms): Added.
3272         (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
3273         (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
3274         Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
3275         (WebCore::Document::applyXSLTransform): Deleted.
3276         (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
3277         inline XSLT and it happens much earlier than implicitClose.
3278         * dom/Document.h:
3279         * dom/ProcessingInstruction.cpp:
3280         (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
3281         stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
3282         function can be called from a non-script-resilient call stack.
3283         (WebCore::ProcessingInstruction::sheetLoaded): Ditto.
3284         * style/StyleScope.cpp:
3285         (WebCore::Style::Scope::collectXSLTransforms): Added.
3286         (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
3287         that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
3288         * style/StyleScope.h:
3289         * xml/parser/XMLDocumentParserLibxml2.cpp:
3290         (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.
3291
3292 2017-10-25  Devin Rousso  <webkit@devinrousso.com>
3293
3294         Web Inspector: Canvas Tab: starting a second recording doesn't show red titlebar if the first recording was empty
3295         https://bugs.webkit.org/show_bug.cgi?id=178805
3296         <rdar://problem/35176303>
3297
3298         Reviewed by Brian Burg.
3299
3300         No new tests, updated existing tests.
3301
3302         * inspector/InspectorCanvasAgent.cpp:
3303         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
3304         If the recording was stopped and had no data, reset the CallTracingActive flag to false.
3305
3306 2017-10-25  Keith Miller  <keith_miller@apple.com>
3307
3308         Move html to unified sources
3309         https://bugs.webkit.org/show_bug.cgi?id=178709
3310
3311         Reviewed by Alex Christensen.
3312
3313         * CMakeLists.txt:
3314         * Sources.txt:
3315         * WebCore.xcodeproj/project.pbxproj:
3316
3317 2017-10-25  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3318
3319         [Curl] Delete temporally downloaded file when it cancelled
3320         https://bugs.webkit.org/show_bug.cgi?id=134393
3321
3322         Reviewed by Alex Christensen.
3323
3324         * platform/network/curl/CurlRequest.cpp:
3325         (WebCore::CurlRequest::didCancelTransfer):
3326         (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
3327         (WebCore::CurlRequest::closeDownloadFile):
3328         (WebCore::CurlRequest::cleanupDownloadFile):
3329         * platform/network/curl/CurlRequest.h:
3330
3331 2017-10-25  Youenn Fablet  <youenn@apple.com>
3332
3333         Add service worker handle fetch support for all subresource requests
3334         https://bugs.webkit.org/show_bug.cgi?id=178769
3335
3336         Reviewed by Chris Dumez.
3337
3338         Test: http/tests/workers/service/image-fetch.https.html
3339
3340         Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
3341         Setting the selected service worker identifier for subresource only at the moment.
3342
3343         Testing is limited to images, future wpt tests should cover other subresource cases.
3344
3345         * loader/DocumentThreadableLoader.cpp:
3346         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
3347         * loader/cache/CachedResourceLoader.cpp:
3348         (WebCore::CachedResourceLoader::prepareFetch):
3349         * loader/cache/CachedResourceRequest.cpp:
3350         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
3351         * loader/cache/CachedResourceRequest.h:
3352
3353 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
3354
3355         Aliasing of text in CSS specs is blocky and ugly
3356         https://bugs.webkit.org/show_bug.cgi?id=174946
3357         rdar://problem/33594542
3358
3359         Reviewed by Dean Jackson.
3360
3361         The PaintedContentRequest relating to subpixel-antialiased text was failing to be
3362         satisfied if the text content in a composited layer was nested inside descendant
3363         RenderLayers, because RenderLayer::isVisuallyNonEmpty() returned early. If this
3364         function is passed a request, we can't return until we've satisfied the request
3365         (which triggers the checking of descendant layers).
3366
3367         Test: compositing/contents-format/subpixel-antialiased-nested-layer.html
3368
3369         * rendering/RenderLayer.cpp:
3370         (WebCore::RenderLayer::calculateClipRects const):
3371
3372 2017-10-25  Chris Dumez  <cdumez@apple.com>
3373
3374         Unreviewed, add missing copyright header to ServiceWorkerClientType.idl.
3375
3376         * workers/service/ServiceWorkerClientType.idl:
3377 =======
3378         * platform/Cursor.cpp: Previously, excluded on iOS now wrapped in #if
3379         * platform/sql/SQLiteDatabase.h: remove debugging data member from release builds.
3380 >>>>>>> build fixes
3381
3382 2017-10-25  Chris Dumez  <cdumez@apple.com>
3383
3384         Make toJS() do the right thing for ServiceWorkerClient
3385         https://bugs.webkit.org/show_bug.cgi?id=178816
3386
3387         Reviewed by Youenn Fablet.
3388
3389         Make toJS() do the right thing for ServiceWorkerClient. In particular,
3390         it needs to construct a JSServiceWorkerWindowClient wrapper if the
3391         implementation object is a ServiceWorkerWindowClient.
3392
3393         Also, ServiceWorkerClient does not need to be an ActiveDOMObject as
3394         it does not have any long-running tasks. Make it a ContextDestructionObject
3395         instead for now.
3396
3397         * CMakeLists.txt:
3398         * DerivedSources.make:
3399         * Sources.txt:
3400         * WebCore.xcodeproj/project.pbxproj:
3401         * workers/service/ServiceWorkerClient.cpp:
3402         (WebCore::ServiceWorkerClient::postMessage):
3403         * workers/service/ServiceWorkerClient.h:
3404         (WebCore::ServiceWorkerClient::create):
3405         * workers/service/ServiceWorkerClient.idl:
3406         * workers/service/ServiceWorkerClientType.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
3407         * workers/service/ServiceWorkerClientType.idl: Added.
3408         * workers/service/ServiceWorkerClients.h:
3409         * workers/service/ServiceWorkerClients.idl:
3410
3411 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
3412
3413         When navigating back to a page, compositing layers may not use accelerated drawing
3414         https://bugs.webkit.org/show_bug.cgi?id=178749