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