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