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