becfba66f5e117edbd44f38218c5a4c0a76d1a35
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-09  Ryosuke Niwa  <rniwa@webkit.org>
2
3         ThreadTimers should not store a raw pointer in its heap
4         https://bugs.webkit.org/show_bug.cgi?id=192975
5         <rdar://problem/46893946>
6
7         Reviewed by Geoffrey Garen.
8
9         Right now, ThreadTimers's heap data structure stores a raw pointer to TimerBase. In order to harden the timer code,
10         this patch replaces it with ThreadTimerHeapItem, a newly introduced struct, which effectively acks like
11         WeakReference<TimerBase*> as the timer heap and TimerBase both store RefPtr to it, and TimerBase's destructor clears
12         the raw pointer back to TimerBase*.
13
14         This approach was taken instead of an out-right adoptation of WeakPtr since the heap data structure requires each node
15         in the heap to have a fixed "priority" yet WeakPtr with no valid pointer back to TimerBase would effectively lose its
16         "priority" thereby corrupting the heap data structure. That is, each item in the heap must remember its fire time and
17         insertion order even when the underlying TimerBase had gone away (this should never happen but the whole point of this
18         hardening is to make it work even in the precense of such a bug).
19
20         This patch also moves the heap index in TimerBase to ThreadTimerHeapItem, and replaces the pointer to the heap vector
21         in TimerBase by a reference to ThreadTimers in ThreadTimerHeapItem. Note that ThreadTimers is a per-thread singleton.
22
23         The correctness of this hardening was tested by commenting out the call to stop() and !isInHeap() assertion in
24         TimerBase::~TimerBase() as well as the !isInHeap() assertion in ThreadTimerHeapItem::clearTimer() and observing that
25         layout tests run successfully without hitting any debug assertions.
26
27         No new tests since there should be no observable behavior difference.
28
29         * WebCore.xcodeproj/project.pbxproj: Export ThreadTimers.h as a private header since it's now included in Timer.h
30         * platform/ThreadTimers.cpp:
31         (WebCore::ThreadTimers::updateSharedTimer): Delete ThreadTimerHeapItem's with nullptr TimerBase* (TimerBase had
32         already been deleted). This should only happen when TimerBase's destructor failed to remove itself from the timer heap,
33         which should never happen.
34         (WebCore::ThreadTimers::sharedTimerFiredInternal): Ditto. Also removed the redundant code which had removed the timer
35         from the heap since setNextFireTime does the removal already.
36         * platform/ThreadTimers.h: Outdented the whole file.
37         (WebCore::ThreadTimers::timerHeap): We use Vector<RefPtr<ThreadTimerHeapItem>> instead of Vector<Ref<~>> since Ref<~>
38         doesn't have a copy constructor which is used by std::push_heap.
39         (WebCore::ThreadTimerHeapItem): Added.
40         (WebCore::ThreadTimerHeapItem::hasTimer const): Added.
41         (WebCore::ThreadTimerHeapItem::setNotInHeap): Added. ThreadTimerHeapItem uses unsigned -1 as the single value which
42         signifies the item not being in the heap instead of all negative values as in the old code in TimerBase.
43         (WebCore::ThreadTimerHeapItem::isInHeap const): Added.
44         (WebCore::ThreadTimerHeapItem::isFirstInHeap const): Added.
45         (WebCore::ThreadTimerHeapItem::timer): Added.
46         (WebCore::ThreadTimerHeapItem::clearTimer): Added.
47         (WebCore::ThreadTimerHeapItem::heapIndex const): Added.
48         (WebCore::ThreadTimerHeapItem::setHeapIndex): Added.
49         (WebCore::ThreadTimerHeapItem::timerHeap const): Added.
50         * platform/Timer.cpp:
51         (WebCore::threadGlobalTimerHeap): This function is now only used in assertions.
52         (WebCore::ThreadTimerHeapItem::ThreadTimerHeapItem): Added.
53         (WebCore::ThreadTimerHeapItem::create): Added.
54         (WebCore::TimerHeapPointer::TimerHeapPointer):
55         (WebCore::TimerHeapPointer::operator-> const):
56         (WebCore::TimerHeapReference::TimerHeapReference): Added a copy constructor.
57         (WebCore::TimerHeapReference::copyRef const): Added.
58         (WebCore::TimerHeapReference::operator RefPtr<ThreadTimerHeapItem>& const):
59         (WebCore::TimerHeapPointer::operator* const):
60         (WebCore::TimerHeapReference::operator=): Use move assignment operator.
61         (WebCore::TimerHeapReference::swapWith):
62         (WebCore::TimerHeapReference::updateHeapIndex): Extracted to share code between two verions of operator=.
63         (WebCore::swap):
64         (WebCore::TimerHeapIterator::TimerHeapIterator):
65         (WebCore::TimerHeapIterator::operator-> const):
66         (WebCore::TimerHeapLessThanFunction::compare): Added variants which take RefPtr<ThreadTimerHeapItem>.
67         (WebCore::TimerHeapLessThanFunction::operator() const):
68         (WebCore::TimerBase::TimerBase):
69         (WebCore::TimerBase::~TimerBase):Clear the raw pointer in ThreadTimerHeapItem.
70         (WebCore::TimerBase::stop):
71         (WebCore::TimerBase::nextFireInterval const):
72         (WebCore::TimerBase::checkHeapIndex const): Added the consistency check for other items in the heap.
73         (WebCore::TimerBase::checkConsistency const):
74         (WebCore::TimerBase::heapDecreaseKey):
75         (WebCore::TimerBase::heapDelete):
76         (WebCore::TimerBase::heapDeleteMin):
77         (WebCore::TimerBase::heapIncreaseKey):
78         (WebCore::TimerBase::heapInsert):
79         (WebCore::TimerBase::heapPop):
80         (WebCore::TimerBase::heapPopMin):
81         (WebCore::TimerBase::heapDeleteNullMin): Added. Used to delete ThreadTimerHeapItem which no longer has a valid TimerBase.
82         (WebCore::parentHeapPropertyHolds):
83         (WebCore::childHeapPropertyHolds):
84         (WebCore::TimerBase::hasValidHeapPosition const):
85         (WebCore::TimerBase::updateHeapIfNeeded): Tweaked the heap index assertion as heapIndex() itself would assert when called
86         on an item with an invalid (-1) heap index.
87         (WebCore::TimerBase::setNextFireTime): Create ThreadTimerHeapItem. Note m_heapItem is never cleared until this TimerBase
88         is deleted.
89         (WebCore::TimerHeapReference::operator TimerBase* const): Deleted.
90         * platform/Timer.h:
91         (WebCore::TimerBase): Replaced m_nextFireTime, m_heapIndex, m_heapInsertionOrder, and m_cachedThreadGlobalTimerHeap
92         by m_heapItem, RefPtr to an ThreadTimerHeapItem.
93         (WebCore::TimerBase::augmentFireInterval):
94         (WebCore::TimerBase::inHeap const):
95         (WebCore::TimerBase::nextFireTime const):
96         (WebCore::TimerBase::isActive const):
97         (WebCore::TimerBase:: const): Deleted.
98
99 2019-01-09  Alex Christensen  <achristensen@webkit.org>
100
101         REGRESSION(239737) iOS quicklook tests should not dereference null
102         https://bugs.webkit.org/show_bug.cgi?id=193307
103
104         Reviewed by Brent Fulgham.
105
106         The quicklook tests rely on ResourceHandle on iOS for some reason.
107         This is a problem we'll fix later, but for now keep them working by not crashing.
108
109         * platform/network/mac/ResourceHandleMac.mm:
110         (WebCore::ResourceHandle::createNSURLConnection):
111         (WebCore::ResourceHandle::start):
112         (WebCore::ResourceHandle::willSendRequest):
113         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
114         (WebCore::ResourceHandle::receivedCredential):
115
116 2019-01-09  Zalan Bujtas  <zalan@apple.com>
117
118         [Datalist] Crash when input with datalist is dynamically added.
119         https://bugs.webkit.org/show_bug.cgi?id=193012
120         <rdar://problem/45923457>
121
122         Reviewed by Brent Fulgham.
123
124         In certain cases (cloning, setAttribute), it's too early to check for the list attribute in createShadowSubtree
125         to see whether the input needs datalist related items. The list attribute is simply not set yet.
126         This patch only addresses the obvious crash. m_dataListDropdownIndicator clearly lacks proper lifecycle management (see webkit.org/b/193032). 
127
128         Test: fast/forms/datalist/datalist-crash-when-dynamic.html
129
130         * html/TextFieldInputType.cpp:
131         (WebCore::TextFieldInputType::createShadowSubtree):
132         (WebCore::TextFieldInputType::attributeChanged):
133         (WebCore::TextFieldInputType::createDataListDropdownIndicator):
134         * html/TextFieldInputType.h:
135
136 2019-01-09  Justin Fan  <justin_fan@apple.com>
137
138         [WebGPU] Fix vertex-buffer-triangle-strip test and small update to GPURenderPipeline
139         https://bugs.webkit.org/show_bug.cgi?id=193289
140
141         Reviewed by Dean Jackson.
142
143         Fix broken test after pipeline layouts were added, and a small refactoring to GPURenderPipeline to avoid
144         retaining its descriptor after creation.
145
146         * platform/graphics/gpu/GPURenderPipeline.h:
147         (WebCore::GPURenderPipeline::primitiveTopology const):
148         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
149         (WebCore::GPURenderPipeline::GPURenderPipeline):
150
151 2019-01-09  Devin Rousso  <drousso@apple.com>
152
153         Web Inspector: Protocol Logging: log messages as objects if inspector^2 is open
154         https://bugs.webkit.org/show_bug.cgi?id=193284
155
156         Reviewed by Joseph Pecoraro.
157
158         No newe tests, as this is simply exposes a value.
159
160         * inspector/InspectorFrontendHost.idl:
161         * inspector/InspectorFrontendHost.h:
162         * inspector/InspectorFrontendHost.cpp:
163         (WebCore::InspectorFrontendHost::isBeingInspected): Added.
164
165 2019-01-09  Zalan Bujtas  <zalan@apple.com>
166
167         [LFC][BFC][MarginCollapsing] Add support for peculiar cases.
168         https://bugs.webkit.org/show_bug.cgi?id=192625
169
170         Reviewed by Antti Koivisto.
171
172         Implement some of the more peculiar cases like margin collpasing through multiple boxes etc.
173         Add ~100 new passing cases.
174
175         * layout/FormattingContextGeometry.cpp:
176         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
177         * layout/LayoutState.h:
178         (WebCore::Layout::LayoutState::hasFormattingState const):
179         * layout/MarginTypes.h:
180         * layout/blockformatting/BlockFormattingContext.cpp:
181         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
182         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
183         (WebCore::Layout::hasPrecomputedMarginBefore):
184         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
185         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
186         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
187         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
188         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
189         * layout/blockformatting/BlockFormattingContext.h:
190         (WebCore::Layout::BlockFormattingContext::blockFormattingState const):
191         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
192         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
193         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
194         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore): Deleted.
195         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter): Deleted.
196         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
197         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
198         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter):
199         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): Deleted.
200         * layout/blockformatting/BlockFormattingState.h:
201         (WebCore::Layout::BlockFormattingState::setPositiveAndNegativeVerticalMargin):
202         (WebCore::Layout::BlockFormattingState::hasPositiveAndNegativeVerticalMargin const):
203         (WebCore::Layout::BlockFormattingState::positiveAndNegativeVerticalMargin const):
204         (WebCore::Layout::BlockFormattingState::setHasEstimatedMarginBefore):
205         (WebCore::Layout::BlockFormattingState::clearHasEstimatedMarginBefore):
206         (WebCore::Layout::BlockFormattingState::hasEstimatedMarginBefore const):
207         * layout/blockformatting/BlockMarginCollapse.cpp:
208         (WebCore::Layout::hasClearance):
209         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
210         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
211         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
212         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
213         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
214         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
215         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
216         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSiblingMarginBefore):
217         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
218         (WebCore::Layout::computedPositiveAndNegativeMargin):
219         (WebCore::Layout::marginValue):
220         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter):
221         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
222         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
223         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
224         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
225         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
226         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
227         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
228         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore): Deleted.
229         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter): Deleted.
230         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
231         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
232         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
233         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
234         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore): Deleted.
235         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter): Deleted.
236         * layout/displaytree/DisplayBox.cpp:
237         (WebCore::Display::Box::Box):
238         * layout/displaytree/DisplayBox.h:
239         (WebCore::Display::Box::hasClearance const):
240         (WebCore::Display::Box::setEstimatedMarginBefore):
241         (WebCore::Display::Box::estimatedMarginBefore const):
242         (WebCore::Display::Box::setHasClearance):
243         (WebCore::Display::Box::invalidateEstimatedMarginBefore):
244         (WebCore::Display::Box::setVerticalMargin):
245         (WebCore::Display::Box::rectWithMargin const):
246         * layout/floats/FloatingContext.cpp:
247         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
248         * layout/inlineformatting/InlineFormattingContext.cpp:
249         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
250
251 2019-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
252
253         REGRESSION(r239156): [FreeType] fixed width, and synthetic bold/italic not correctly applied since r239156
254         https://bugs.webkit.org/show_bug.cgi?id=193276
255
256         Reviewed by Žan Doberšek.
257
258         FontCache::createFontPlatformData() is calling getFontPropertiesFromPattern() with the configure pattern instead
259         of the result one after the match.
260
261         * platform/graphics/freetype/FontCacheFreeType.cpp:
262         (WebCore::FontCache::createFontPlatformData):
263
264 2019-01-08  Dean Jackson  <dino@apple.com>
265
266         Blob references for System Previews don't get a correct file extension
267         https://bugs.webkit.org/show_bug.cgi?id=193268
268         <rdar://problem/47133037>
269
270         Reviewed by Tim Horton.
271
272         Apple platforms don't yet have a mapping from the USD MIME type to
273         file extensions (and we support some non-standard MIME types), which
274         means that downloads from Blob references don't get correctly named.
275
276         Fix this by adding an explicit mapping between System Preview types
277         and ".usdz".
278
279         WebKit API test: _WKDownload.SystemPreviewUSDZBlobNaming
280
281         * platform/MIMETypeRegistry.cpp:
282         (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType): Remove USE(SYSTEM_PREVIEW) since
283         this applies to macOS and iOS now.
284         * platform/MIMETypeRegistry.h:
285         * platform/cocoa/MIMETypeRegistryCocoa.mm:
286         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Add a mapping
287         for USDZ.
288
289 2019-01-08  Tim Horton  <timothy_horton@apple.com>
290
291         Editable images sometimes don't become focused when tapped
292         https://bugs.webkit.org/show_bug.cgi?id=193259
293         <rdar://problem/47038424>
294
295         Reviewed by Wenson Hsieh.
296
297         Often when tapping an editable image inside an editable text area, the
298         text area's selection will change instead of focusing the editable image.
299
300         No new tests; I have had no luck writing a test that reliably failed 
301         beforehand (the "sometimes" is a problem).
302
303         * html/HTMLImageElement.cpp:
304         (WebCore::HTMLImageElement::defaultEventHandler):
305         * html/HTMLImageElement.h:
306         Override mousedown on editable images, focus the image, and prevent
307         the default behavior.
308
309 2019-01-08  Jiewen Tan  <jiewen_tan@apple.com>
310
311         [WebAuthN] Support U2F HID Authenticators on macOS
312         https://bugs.webkit.org/show_bug.cgi?id=191535
313         <rdar://problem/47102027>
314
315         Reviewed by Brent Fulgham.
316
317         This patch changes U2fCommandConstructor to produce register commands with
318         enforcing test of user presence. Otherwise, authenticators would silently
319         generate credentials. It also renames readFromU2fSignResponse to
320         readU2fSignResponse.
321
322         Tests: http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https.html
323                http/wpt/webauthn/public-key-credential-create-failure-u2f.https.html
324                http/wpt/webauthn/public-key-credential-create-success-u2f.https.html
325                http/wpt/webauthn/public-key-credential-get-failure-u2f-silent.https.html
326                http/wpt/webauthn/public-key-credential-get-failure-u2f.https.html
327                http/wpt/webauthn/public-key-credential-get-success-u2f.https.html
328
329         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
330         (fido::WebCore::constructU2fRegisterCommand):
331         * Modules/webauthn/fido/U2fResponseConverter.cpp:
332         (fido::readU2fSignResponse):
333         (fido::readFromU2fSignResponse): Deleted.
334         * Modules/webauthn/fido/U2fResponseConverter.h:
335
336 2019-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
337
338         [iOS] Dispatch a synthetic mousedown event prior to starting drags
339         https://bugs.webkit.org/show_bug.cgi?id=193229
340         <rdar://problem/46717097>
341
342         Reviewed by Tim Horton.
343
344         Tweaks some drag initiation logic on iOS to actually send a "mousedown" event to the page prior to drag start.
345         This improves drag and drop compatibility with web pages that expect a mousedown to always precede dragging.
346         Additionally, ensure that preventing the "mousedown" event also prevents "dragstart", which matches macOS
347         behavior.
348
349         Test: DragAndDropTests.PreventingMouseDownShouldPreventDragStart
350
351         * page/EventHandler.cpp:
352
353         Make the text drag delay 0 on iOS. This was introduced on iOS when originally bringing up drag and drop, and was
354         made to simply match macOS. However, it doesn't make sense to respect the delay here, since the purpose of this
355         delay is to disambiguate between making a text selection and starting a drag when pressing on text that is
356         already selected; on iOS (including iOSMac), this gesture conflict is already resolved by platform gesture
357         recognizers in the client layer, so there is always no delay between mouse down and drag here.
358
359         * page/ios/EventHandlerIOS.mm:
360
361         Dispatch a mousedown and inspect the value of `m_mouseDownMayStartDrag` when starting a drag on iOS. This brings
362         our behavior closer in line with macOS.
363
364         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
365
366 2019-01-08  Youenn Fablet  <youenn@apple.com>
367
368         service worker fetch handler results in bad referrer
369         https://bugs.webkit.org/show_bug.cgi?id=188248
370         <rdar://problem/47050478>
371
372         Reviewed by Alex Christensen.
373
374         Response sanitization was removing the ReferrerPolicy header from opaque redirect responses.
375         Reduce sanitization of opaque redirect responses to opaque responses and allow Location header.
376         Make sure referrer policy is updated for all load redirections, not only CORS loads.
377
378         Test: http/tests/security/referrer-policy-redirect-link-downgrade.html
379
380         * loader/SubresourceLoader.cpp:
381         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
382         * platform/network/ResourceResponseBase.cpp:
383         (WebCore::isSafeCrossOriginResponseHeader):
384         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
385
386 2019-01-08  Youenn Fablet  <youenn@apple.com>
387
388         IDB storage of Crypto keys does not work in private browsing mode
389         https://bugs.webkit.org/show_bug.cgi?id=193219
390
391         Reviewed by Brady Eidson.
392
393         https://trac.webkit.org/changeset/238677 moved from using a JSGlobalObject to a JSDOMGlobalObject for serialization/deserialization.
394         This does not work for crypto keys as they require not only a JSDOMGlobalObject but either a window or worker global object.
395
396         To fix the issue, revert 238677, and fix it by checking whether the dumping of an ArrayBuffer happens for a JSDOMGlobalObject or a JSGlobalObject.
397         If it is the latter, use JSC routines instead of toJS() which requires a JSDOMGlobalObject.
398
399         Covered by updated test.
400
401         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
402         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
403         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
404         * bindings/js/JSDOMGlobalObject.cpp:
405         * bindings/js/JSDOMGlobalObject.h:
406         * bindings/js/JSDOMWrapper.cpp:
407         (WebCore::JSDOMObject::JSDOMObject):
408         * bindings/js/SerializedScriptValue.cpp:
409         (WebCore::CloneSerializer::dumpArrayBufferView):
410         (WebCore::CloneSerializer::toJSArrayBuffer):
411
412 2019-01-08  Justin Fan  <justin_fan@apple.com>
413
414         [WebGPU] Update createRenderPipeline for WebGPUPipelineLayout
415         https://bugs.webkit.org/show_bug.cgi?id=193247
416
417         Reviewed by Dean Jackson.
418
419         Add WebGPUPipelineLayout to WebGPURenderPipeline via WebGPUPipelineDescriptorBase.
420
421         Test: Updated render-pipelines.html to test new functionality.
422
423         * Modules/webgpu/WebGPUDevice.cpp:
424         (WebCore::WebGPUDevice::createRenderPipeline const): Convert WebGPUPipelineLayout to GPUPipelineLayout.
425         * Modules/webgpu/WebGPUPipelineDescriptorBase.h:
426         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl: Add layout field.
427         * Modules/webgpu/WebGPUPipelineLayout.h: 
428         (WebCore::WebGPUPipelineLayout::pipelineLayout): Added. Getter.
429         * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Updated from out-of-date version.
430         * platform/graphics/gpu/GPUPipelineLayout.cpp:
431         (WebCore::GPUPipelineLayout::GPUPipelineLayout): Now retains bindGroupLayouts from descriptor.
432         * platform/graphics/gpu/GPUPipelineLayout.h:
433         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Now inherits from GPUPipelineDescriptorBase.
434         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Custom constructor for non-aggregate struct.
435
436 2019-01-08  Chris Dumez  <cdumez@apple.com>
437
438         Prevent cross-site top-level navigations from third-party iframes
439         https://bugs.webkit.org/show_bug.cgi?id=193076
440         <rdar://problem/36074736>
441
442         Reviewed by Alex Christensen.
443
444         Prevent cross-site top-level navigations from third-party iframes if the following conditions are met:
445         1. Its tries to navigate the top-level page cross-site (different eTDL+1)
446         2. The user has never interacted with the third-party iframe or any of its subframes
447
448         This experiment's intent is to block suspicious main-frame navigations by third-party content. The feature
449         is behind a runtime experimental feature flag, on by default.
450
451         Tests: http/tests/security/allow-top-level-navigations-by-third-party-iframes-to-same-origin.html
452                http/tests/security/allow-top-level-navigations-by-third-party-iframes-with-previous-user-activation.html
453                http/tests/security/allow-top-level-navigations-by-third-party-iframes-with-user-activation.html
454                http/tests/security/block-top-level-navigations-by-third-party-iframes.html
455
456         * dom/Document.cpp:
457         (WebCore::printNavigationErrorMessage):
458         (WebCore::Document::canNavigate):
459         (WebCore::Document::canNavigateInternal):
460         (WebCore::Document::isNavigationBlockedByThirdPartyIFrameRedirectBlocking):
461         * dom/Document.h:
462         * dom/UserGestureIndicator.cpp:
463         * page/DOMWindow.cpp:
464         (WebCore::DOMWindow::setLocation):
465         * page/DOMWindow.h:
466         * page/Frame.h:
467         * page/Location.cpp:
468         (WebCore::Location::replace):
469         (WebCore::Location::setLocation):
470         * page/Settings.yaml:
471
472 2019-01-08  Alex Christensen  <achristensen@webkit.org>
473
474         Stop using NetworkStorageSession in WebProcess
475         https://bugs.webkit.org/show_bug.cgi?id=193236
476
477         Reviewed by Don Olmstead.
478
479         No change in behavior.  Some code was only used for ResourceHandle, which isn't used in modern WebKit,
480         and for cookies, which are handled in the NetworkProcess in modern WebKit.
481
482         * loader/CookieJar.cpp:
483         (WebCore::storageSession):
484         * loader/EmptyClients.cpp:
485         * platform/network/NetworkingContext.h:
486         * platform/network/mac/ResourceHandleMac.mm:
487         (WebCore::ResourceHandle::createNSURLConnection):
488         (WebCore::ResourceHandle::start):
489         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
490         (WebCore::ResourceHandle::willSendRequest):
491         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
492         (WebCore::ResourceHandle::receivedCredential):
493
494 2019-01-08  Alex Christensen  <achristensen@webkit.org>
495
496         Unreviewed, rolling out r239727.
497
498         Broke API tests
499
500         Reverted changeset:
501
502         "Stop using NetworkStorageSession in WebProcess"
503         https://bugs.webkit.org/show_bug.cgi?id=193236
504         https://trac.webkit.org/changeset/239727
505
506 2019-01-08  Alex Christensen  <achristensen@webkit.org>
507
508         Stop using NetworkStorageSession in WebProcess
509         https://bugs.webkit.org/show_bug.cgi?id=193236
510
511         Reviewed by Don Olmstead.
512
513         No change in behavior.  Some code was only used for ResourceHandle, which isn't used in modern WebKit,
514         and for cookies, which are handled in the NetworkProcess in modern WebKit.
515
516         * loader/CookieJar.cpp:
517         (WebCore::storageSession):
518         * loader/EmptyClients.cpp:
519         * platform/network/NetworkingContext.h:
520         * platform/network/mac/ResourceHandleMac.mm:
521         (WebCore::ResourceHandle::createNSURLConnection):
522         (WebCore::ResourceHandle::start):
523         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
524         (WebCore::ResourceHandle::willSendRequest):
525         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
526         (WebCore::ResourceHandle::receivedCredential):
527
528 2019-01-08  Chris Dumez  <cdumez@apple.com>
529
530         Regression(PSON-r239182): Blank view when navigating back and forth between google.com and stack overflow
531         https://bugs.webkit.org/show_bug.cgi?id=193224
532         <rdar://problem/47097726>
533
534         Reviewed by Alex Christensen.
535
536         Since r239182, pages get suspended in-place when we suspend the old process after a process-swap on navigation.
537         When we return to a suspended page, we load the current history item again and it normally properly restores
538         the page from PageCache, even though we load the same history item and the current one and even though the
539         page is suspended in-place (i.e. we did not navigate away, which is the usual case for page cache).
540
541         The issue is that if the page URL contains a fragment, FrameLoader::shouldPerformFragmentNavigation() would
542         return true because both the source and destination URLs (which are the same) contains a fragment. To address
543         the issue, update FrameLoader::shouldPerformFragmentNavigation() to return false if the current page is
544         suspended.
545
546         * loader/FrameLoader.cpp:
547         (WebCore::FrameLoader::shouldPerformFragmentNavigation):
548
549 2019-01-08  Alex Christensen  <achristensen@webkit.org>
550
551         Move Windows-specific code from NetworkStorageSessionCFNet.cpp to its own file
552         https://bugs.webkit.org/show_bug.cgi?id=192958
553
554         Reviewed by Yusuke Suzuki.
555
556         This makes it easier to reason about what code is used where.
557
558         * PlatformAppleWin.cmake:
559         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
560         (WebCore::createPrivateStorageSession): Deleted.
561         (WebCore::cookieDomain): Deleted.
562         (WebCore::canonicalCookieTime): Deleted.
563         (WebCore::cookieCreatedTime): Deleted.
564         (WebCore::cookieExpirationTime): Deleted.
565         (WebCore::cookieName): Deleted.
566         (WebCore::cookiePath): Deleted.
567         (WebCore::cookieValue): Deleted.
568         (WebCore::filterCookies): Deleted.
569         (WebCore::copyCookiesForURLWithFirstPartyURL): Deleted.
570         (WebCore::createCookies): Deleted.
571         (WebCore::NetworkStorageSession::setCookiesFromDOM const): Deleted.
572         (WebCore::containsSecureCookies): Deleted.
573         (WebCore::NetworkStorageSession::cookiesForDOM const): Deleted.
574         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): Deleted.
575         (WebCore::NetworkStorageSession::cookiesEnabled const): Deleted.
576         (WebCore::NetworkStorageSession::getRawCookies const): Deleted.
577         (WebCore::NetworkStorageSession::deleteCookie const): Deleted.
578         (WebCore::NetworkStorageSession::getHostnamesWithCookies): Deleted.
579         (WebCore::NetworkStorageSession::deleteAllCookies): Deleted.
580         (WebCore::NetworkStorageSession::deleteCookiesForHostnames): Deleted.
581         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince): Deleted.
582         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp: Added.
583         (WebCore::createPrivateStorageSession):
584         (WebCore::NetworkStorageSession::setCookies):
585         (WebCore::cookieDomain):
586         (WebCore::canonicalCookieTime):
587         (WebCore::cookieCreatedTime):
588         (WebCore::cookieExpirationTime):
589         (WebCore::cookieName):
590         (WebCore::cookiePath):
591         (WebCore::cookieValue):
592         (WebCore::filterCookies):
593         (WebCore::copyCookiesForURLWithFirstPartyURL):
594         (WebCore::createCookies):
595         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
596         (WebCore::containsSecureCookies):
597         (WebCore::NetworkStorageSession::cookiesForDOM const):
598         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
599         (WebCore::NetworkStorageSession::cookiesEnabled const):
600         (WebCore::NetworkStorageSession::getRawCookies const):
601         (WebCore::NetworkStorageSession::deleteCookie const):
602         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
603         (WebCore::NetworkStorageSession::deleteAllCookies):
604         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
605         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
606
607 2018-12-19  Antoine Quint  <graouts@apple.com>
608
609         [Web Animations] Compute animation effect timing properties in batch
610         https://bugs.webkit.org/show_bug.cgi?id=192850
611
612         Reviewed by Dean Jackson.
613
614         We remove a host of functions from AnimationEffect that would allow the computation of various timing properties
615         defined by the Web Animations specification: phase, progress, current iteration, etc. Indeed, a lot of these functions
616         would call each other in a chain, and we would re-compute a lot of the earlier properties in those chains several times
617         when doing something like querying the animation progress. Additionally, some functions, such as WebAnimation::computeRelevance()
618         and WebAnimation::timeToNextTick() would yield the computation of several such properties numerous times. All of those
619         functions are called during each animation frame and are ripe for optimizations.
620
621         We now compute all timing properties across two functions:
622         
623         1. the new AnimationEffect::getBasicTiming() which computes the local time, end time, active duration, active time and phase,
624         2. the existing AnimationEffect::getComputedTiming() which now also exposes the phase and simple iteration progress.
625
626         To support this we introduce a new BasicEffectTiming struct to contain the values computed in AnimationEffect::getBasicTiming()
627         and spun the AnimationEffect::Phase struct as AnimationEffectPhase so that it may be used across BasicEffectTiming and
628         ComputedEffectTiming.
629
630         No new test since there is no user-observable change.
631
632         * WebCore.xcodeproj/project.pbxproj:
633         * animation/AnimationEffect.cpp:
634         (WebCore::AnimationEffect::getTiming const):
635         (WebCore::AnimationEffect::getBasicTiming const):
636         (WebCore::AnimationEffect::getComputedTiming const):
637         (WebCore::AnimationEffect::localTime const): Deleted.
638         (WebCore::AnimationEffect::phase const): Deleted.
639         (WebCore::AnimationEffect::activeTime const): Deleted.
640         (WebCore::AnimationEffect::overallProgress const): Deleted.
641         (WebCore::AnimationEffect::simpleIterationProgress const): Deleted.
642         (WebCore::AnimationEffect::currentIteration const): Deleted.
643         (WebCore::AnimationEffect::currentDirection const): Deleted.
644         (WebCore::AnimationEffect::directedProgress const): Deleted.
645         (WebCore::AnimationEffect::transformedProgress const): Deleted.
646         (WebCore::AnimationEffect::iterationProgress const): Deleted.
647         (WebCore::AnimationEffect::getTiming): Deleted.
648         (WebCore::AnimationEffect::getComputedTiming): Deleted.
649         (WebCore::AnimationEffect::endTime const): Deleted.
650         (WebCore::AnimationEffect::activeDuration const): Deleted.
651         * animation/AnimationEffect.h:
652         * animation/AnimationEffectPhase.h: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
653         * animation/AnimationTimeline.cpp:
654         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
655         * animation/AnimationTimeline.h:
656         * animation/BasicEffectTiming.h: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
657         * animation/ComputedEffectTiming.h:
658         * animation/DeclarativeAnimation.cpp:
659         (WebCore::DeclarativeAnimation::cancel):
660         (WebCore::DeclarativeAnimation::phaseWithoutEffect const):
661         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
662         * animation/DeclarativeAnimation.h:
663         * animation/KeyframeEffect.cpp:
664         (WebCore::KeyframeEffect::apply):
665         (WebCore::KeyframeEffect::getAnimatedStyle):
666         * animation/WebAnimation.cpp:
667         (WebCore::WebAnimation::effectEndTime const):
668         (WebCore::WebAnimation::computeRelevance):
669         (WebCore::WebAnimation::timeToNextTick const):
670
671 2019-01-07  Youenn Fablet  <youenn@apple.com>
672
673         Crash in SWServer::Connection::resolveRegistrationReadyRequests
674         https://bugs.webkit.org/show_bug.cgi?id=193217
675
676         Reviewed by Chris Dumez.
677
678         As can be seen from the traces, SWServer might clear its connections HashMap in its destructor.
679         This might then trigger calling SWServer::resolveRegistrationReadyRequests.
680         This method is iterating on the connections HashMap which is being cleared.
681         To remove this problem, move the HashMap in a temporary variable and clear the temporary variable.
682
683         * workers/service/server/SWServer.cpp:
684         (WebCore::SWServer::~SWServer):
685
686 2019-01-07  Jer Noble  <jer.noble@apple.com>
687
688         REGRESSION (r239519): ASSERTION FAILED: !m_adoptionIsRequired in com.apple.WebCore: void WTF::refIfNotNull<WebCore::CDMSessionMediaSourceAVFObjC> + 53
689         https://bugs.webkit.org/show_bug.cgi?id=193211
690         <rdar://problem/46937412>
691
692         Reviewed by Eric Carlson.
693
694         Make CDMSessionMediaSourceAVFObjC a CanMakeWeakPtr rather than RefCounted, as CDMSessions are stored in
695         std::unique_ptrs, and not in Ref or RefPtr.
696
697         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
698         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
699         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
700         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
701
702 2019-01-07  David Kilzer  <ddkilzer@apple.com>
703
704         Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>
705         <https://webkit.org/b/193056>
706
707         Reviewed by Alex Christensen.
708
709         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
710         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
711         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]):
712         * platform/network/cf/AuthenticationChallenge.h:
713         - Remove '*' from RetainPtr<> type.
714
715         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
716         (WebCore::cookiesForURL):
717         - Once retainPtr() was changed to return RetainPtr<NSArray>
718           instead of RetainPtr<NSArray *> here, that forced the type of
719           `cookiesPtr` to change as well since
720           Optional<RetainPtr<NSArray>> is not assignable to
721           Optional<RetainPtr<NSArray *>> without further template
722           specialization, which didn't seem useful since
723           Optional<RetainPtr<>> variable types are rarely used.
724
725 2019-01-07  Devin Rousso  <drousso@apple.com>
726
727         Web Inspector: extend XHR breakpoints to work with fetch
728         https://bugs.webkit.org/show_bug.cgi?id=185843
729         <rdar://problem/40431027>
730
731         Reviewed by Matt Baker.
732
733         Test: inspector/dom-debugger/url-breakpoints.html
734
735         * Modules/fetch/FetchResponse.cpp:
736         (WebCore::FetchResponse::fetch):
737
738         * inspector/InspectorInstrumentation.h:
739         (WebCore::InspectorInstrumentation::willFetch): Added.
740         * inspector/InspectorInstrumentation.cpp:
741         (WebCore::InspectorInstrumentation::willFetchImpl): Added.
742
743         * inspector/agents/InspectorDOMDebuggerAgent.h:
744         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
745         (WebCore::InspectorDOMDebuggerAgent::disable):
746         (WebCore::InspectorDOMDebuggerAgent::discardBindings):
747         (WebCore::InspectorDOMDebuggerAgent::setURLBreakpoint): Added.
748         (WebCore::InspectorDOMDebuggerAgent::removeURLBreakpoint): Added.
749         (WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded): Added.
750         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
751         (WebCore::InspectorDOMDebuggerAgent::willFetch): Added.
752         (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Deleted.
753         (WebCore::InspectorDOMDebuggerAgent::removeXHRBreakpoint): Deleted.
754
755 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
756
757         Cleanup AudioTrackPrivateMediaStreamCocoa
758         https://bugs.webkit.org/show_bug.cgi?id=193208
759         <rdar://problem/42225870>
760
761         Reviewed by Youenn Fablet.
762
763         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
764         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable): Clear input and
765         output format descriptions after stopping the audio unit.
766
767 2019-01-07  Devin Rousso  <drousso@apple.com>
768
769         Web Inspector: Network: show secure connection details per-request
770         https://bugs.webkit.org/show_bug.cgi?id=191539
771         <rdar://problem/45979891>
772
773         Reviewed by Joseph Pecoraro.
774
775         Test: http/tests/inspector/network/resource-security-connection.html
776
777         * platform/network/NetworkLoadMetrics.h:
778         (WebCore::NetworkLoadMetrics:isolatedCopy):
779         (WebCore::NetworkLoadMetrics:clearNonTimingData):
780         (WebCore::NetworkLoadMetrics:operator==):
781         (WebCore::NetworkLoadMetrics:encode):
782         (WebCore::NetworkLoadMetrics:decode):
783
784         * inspector/agents/InspectorNetworkAgent.cpp:
785         (WebCore::InspectorNetworkAgent::buildObjectForMetrics):
786
787 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
788
789         Deactivate audio session whenever possible
790         https://bugs.webkit.org/show_bug.cgi?id=193188
791         <rdar://problem/42678977>
792
793         Reviewed by Jer Noble.
794
795         Test: media/deactivate-audio-session.html
796
797         * platform/audio/AudioSession.cpp:
798         (WebCore::AudioSession::tryToSetActive):
799         (WebCore::AudioSession::tryToSetActiveInternal):
800         * platform/audio/AudioSession.h:
801         (WebCore::AudioSession::isActive const):
802
803         * platform/audio/PlatformMediaSessionManager.cpp:
804         (WebCore::PlatformMediaSessionManager::removeSession):
805         (WebCore::deactivateAudioSession):
806         (WebCore::PlatformMediaSessionManager::shouldDeactivateAudioSession):
807         (WebCore::PlatformMediaSessionManager::setShouldDeactivateAudioSession):
808         * platform/audio/PlatformMediaSessionManager.h:
809
810         * platform/audio/ios/AudioSessionIOS.mm:
811         (WebCore::AudioSession::tryToSetActiveInternal):
812         (WebCore::AudioSession::tryToSetActive): Deleted.
813
814         * platform/audio/mac/AudioSessionMac.cpp:
815         (WebCore::AudioSession::tryToSetActiveInternal):
816         (WebCore::AudioSession::tryToSetActive): Deleted.
817
818         * testing/Internals.cpp:
819         (WebCore::Internals::audioSessionActive const):
820         * testing/Internals.h:
821         * testing/Internals.idl:
822
823 2019-01-07  David Kilzer  <ddkilzer@apple.com>
824
825         PlatformECKey should use a std::unique_ptr
826         <https://webkit.org/b/193170>
827
828         Reviewed by Brent Fulgham.
829
830         Broadly:
831         - Switch from using raw pointers to using std::unique_ptr<> to
832           hold PlatformECKey.
833         - Introduce PlatformECKeyContainer type to handle different
834           std::unique_ptr<> types on each platform.
835         - Get rid of custom CryptoKeyEC destructors since the
836           std::unique_ptr<> handles that with a Deleter.
837         - Initialize stack variables to nullptr.
838
839         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
840         (WebCore::CryptoKeyEC::keySizeInBits const):
841         (WebCore::CryptoKeyEC::platformGeneratePair):
842         (WebCore::CryptoKeyEC::platformImportRaw):
843         (WebCore::CryptoKeyEC::platformImportJWKPublic):
844         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
845         (WebCore::CryptoKeyEC::platformImportSpki):
846         (WebCore::CryptoKeyEC::platformImportPkcs8):
847         (WebCore::CryptoKeyEC::platformExportRaw const):
848         (WebCore::CryptoKeyEC::platformAddFieldElements const):
849         (WebCore::CryptoKeyEC::platformExportSpki const):
850         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
851         (WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
852         * crypto/keys/CryptoKeyEC.cpp:
853         (WebCore::CryptoKeyEC::CryptoKeyEC):
854         * crypto/keys/CryptoKeyEC.h:
855         (WebCore::CCECCryptorRefDeleter::operator() const):
856         * crypto/mac/CryptoKeyECMac.cpp:
857         (WebCore::CryptoKeyEC::keySizeInBits const):
858         (WebCore::CryptoKeyEC::platformGeneratePair):
859         (WebCore::CryptoKeyEC::platformImportRaw):
860         (WebCore::CryptoKeyEC::platformExportRaw const):
861         (WebCore::CryptoKeyEC::platformImportJWKPublic):
862         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
863         (WebCore::CryptoKeyEC::platformAddFieldElements const):
864         (WebCore::CryptoKeyEC::platformImportSpki):
865         (WebCore::CryptoKeyEC::platformExportSpki const):
866         (WebCore::CryptoKeyEC::platformImportPkcs8):
867         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
868         (WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
869
870 2019-01-07  Antti Koivisto  <antti@apple.com>
871
872         UI process side scrollbars for UI side compositing on Mac
873         https://bugs.webkit.org/show_bug.cgi?id=193106
874
875         Reviewed by Tim Horton.
876
877         * page/FrameView.cpp:
878         (WebCore::FrameView::paintScrollCorner):
879         * page/scrolling/AsyncScrollingCoordinator.cpp:
880         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
881
882         Pass scrollbar host layers and the dark appearance bit to the scrolling tree.
883
884         * page/scrolling/ScrollingCoordinator.cpp:
885         (WebCore::ScrollingCoordinator::verticalScrollbarLayerForFrameView):
886         (WebCore::ScrollingCoordinator::horizontalScrollbarLayerForFrameView):
887         * page/scrolling/ScrollingCoordinator.h:
888         (WebCore::ScrollableAreaParameters::ScrollableAreaParameters):
889         (WebCore::ScrollableAreaParameters::operator== const):
890         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
891         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
892         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarLayers):
893         * page/scrolling/ScrollingStateFrameScrollingNode.h:
894         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
895         * page/scrolling/ScrollingTreeScrollingNode.h:
896         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const):
897         (WebCore::ScrollingTreeScrollingNode::totalContentsSize const):
898         (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const):
899         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const):
900         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
901         * platform/ScrollableArea.cpp:
902         (WebCore::ScrollableArea::useDarkAppearanceForScrollbars const):
903
904         Factor into a function as this is used in several places.
905
906         * platform/ScrollableArea.h:
907         * platform/mac/NSScrollerImpDetails.h:
908         * platform/mac/ScrollAnimatorMac.mm:
909         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]):
910         * platform/mac/ScrollbarThemeMac.h:
911
912 2019-01-07  Wenson Hsieh  <wenson_hsieh@apple.com>
913
914         Native caret shows up alongside the page's caret when requesting desktop site on jsfiddle.net
915         https://bugs.webkit.org/show_bug.cgi?id=193180
916         <rdar://problem/45971041>
917
918         Reviewed by Tim Horton.
919
920         Adjust a method on RenderObject to additionally detect when the RenderObject is inside of an `overflow: hidden`
921         container that is also empty. See WebKit ChangeLog for more details.
922
923         Test:   editing/selection/ios/hide-selection-in-empty-overflow-hidden-container.html
924                 editing/selection/ios/show-selection-in-empty-overflow-hidden-document.html
925
926         * rendering/RenderObject.cpp:
927         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
928         (WebCore::RenderObject::isTransparentRespectingParentFrames const): Deleted.
929         * rendering/RenderObject.h:
930
931 2019-01-07  Zalan Bujtas  <zalan@apple.com>
932
933         [LFC][BFC] Margin collapsing should not be limited to in-flow non-replaced boxes.
934         https://bugs.webkit.org/show_bug.cgi?id=193183
935
936         Reviewed by Antti Koivisto.
937
938         * layout/FormattingContext.cpp:
939         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
940         * layout/FormattingContextGeometry.cpp:
941         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
942         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
943         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
944         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
945         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
946         * layout/LayoutUnits.h:
947         * layout/blockformatting/BlockFormattingContext.cpp:
948         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
949         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
950         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
951         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
952         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
953         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
954         * layout/inlineformatting/InlineFormattingContext.cpp:
955         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
956
957 2019-01-07  Zalan Bujtas  <zalan@apple.com>
958
959         [LFC][BFC] Move MarginCollapse from BlockFormattingContext::Geometry to BlockFormattingContext
960         https://bugs.webkit.org/show_bug.cgi?id=193181
961
962         Reviewed by Antti Koivisto.
963
964         This is in preparation to share margin collapsing across all boxes in block formatting context.
965
966         * layout/blockformatting/BlockFormattingContext.h:
967         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
968         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
969         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
970         * layout/blockformatting/BlockMarginCollapse.cpp:
971         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore):
972         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter):
973         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore):
974         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter):
975         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild):
976         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild):
977         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
978         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
979         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
980         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
981         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
982         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
983         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling):
984         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
985         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore):
986         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter):
987         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
988         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
989         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): Deleted.
990         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): Deleted.
991         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
992         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
993         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): Deleted.
994         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): Deleted.
995         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): Deleted.
996         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): Deleted.
997         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): Deleted.
998         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
999         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
1000         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough): Deleted.
1001         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): Deleted.
1002         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): Deleted.
1003
1004 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
1005
1006         [WPE] Use Widget bounds for PlatformScreen rectangle information
1007         https://bugs.webkit.org/show_bug.cgi?id=193190
1008
1009         Reviewed by Philippe Normand.
1010
1011         Provide a better screen area estimate in screenRect() and
1012         screenAvailableRect() return values than the current 1240x640 value by
1013         using the Widget's bounds rectangle.
1014
1015         This approach is only factually correct when the Widget-associated view
1016         is displayed in fullscreen, but it provides a better estimate even when
1017         displayed in any other case as well. WPE doesn't provide specific API
1018         that could enable the embedding environment to provide this information.
1019
1020         * platform/wpe/PlatformScreenWPE.cpp:
1021         (WebCore::screenRect): Return bounds of the Widget object.
1022         (WebCore::screenAvailableRect): Relay the call to screenRect().
1023
1024 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
1025
1026         Make Gradient::gradientSpaceTransform(), Pattern::patternSpaceTransform() methods const
1027         https://bugs.webkit.org/show_bug.cgi?id=193189
1028
1029         Reviewed by Philippe Normand.
1030
1031         The transform getter methods on the Gradient and Pattern classes both
1032         return const references to the transform objects, and don't modify any
1033         internal state. They should be marked const accordingly, allowing
1034         invocations of these two methods through const references to Gradient
1035         and Pattern objects.
1036
1037         * platform/graphics/Gradient.h:
1038         (WebCore::Gradient::gradientSpaceTransform): Now const.
1039         * platform/graphics/Pattern.h:
1040         (WebCore::Pattern::patternSpaceTransform): Now const.
1041
1042 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
1043
1044         REGRESSION(r239636): ImageDecoder::setEncodedDataStatusChangeCallback() can be called on a null decoder
1045         https://bugs.webkit.org/show_bug.cgi?id=193187
1046
1047         Reviewed by Philippe Normand.
1048
1049         * platform/graphics/ImageSource.cpp:
1050         (WebCore::ImageSource::ensureDecoderAvailable): Bail before calling the
1051         setEncodedDataStatusChangeCallback() method when the returned
1052         ImageDecoder object is null.
1053
1054 2019-01-06  Zan Dobersek  <zdobersek@igalia.com>
1055
1056         [Nicosia] Take over CoordinatedGraphics-named implementation of async scrolling classes
1057         https://bugs.webkit.org/show_bug.cgi?id=193133
1058
1059         Reviewed by Michael Catanzaro.
1060
1061         Move the CoordinatedGraphics-specific files under
1062         page/scrolling/coordinatedgraphics/ to page/scrolling/nicosia/, along
1063         with renaming the files and classes accordingly. Implementation will
1064         only depend on the Nicosia-specific layer structure and is not specific
1065         to the CoordinatedGraphics system.
1066
1067         * PlatformPlayStation.cmake:
1068         * SourcesGTK.txt:
1069         * SourcesWPE.txt:
1070         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp.
1071         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h.
1072         * page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp.
1073         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp.
1074         * page/scrolling/nicosia/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h.
1075         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp.
1076         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h.
1077         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp.
1078         * page/scrolling/nicosia/ScrollingTreeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h.
1079         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp.
1080         * page/scrolling/nicosia/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h.
1081         * platform/TextureMapper.cmake:
1082
1083 2019-01-06  Jiewen Tan  <jiewen_tan@apple.com>
1084
1085         [WebAuthN] Import U2F command/response converters from Chromium
1086         https://bugs.webkit.org/show_bug.cgi?id=193150
1087         <rdar://problem/47054028>
1088
1089         Reviewed by Brent Fulgham.
1090
1091         This patch imports Chromium's U2F command/response converters:
1092         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability
1093         1. It directly imports the following files and suit them to WebKit's coding style:
1094         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.cc?l=1&rcl=db624110317d01efa78cd32e7be1524190e1beb0
1095         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.h?rcl=db624110317d01efa78cd32e7be1524190e1beb0
1096         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor_unittest.cc?rcl=db624110317d01efa78cd32e7be1524190e1beb0
1097         2. It gathers the following methods into U2fResponseConverter:
1098         AuthenticatorMakeCredentialResponse::CreateFromU2fRegisterResponse()
1099         AuthenticatorGetAssertionResponse::CreateFromU2fSignResponse()
1100         3. It also updates FidoConstants.h, FidoTestData.h and CtapResponseTest.cpp accordingly.
1101
1102         Besides importing stuff from Chroimum, it also gathers a bunch of constants and helper functions into WebAuthenticationConstants.h
1103         and WebAuthenticationUtils.h. It also fixes Bug 183534: 2) and 7).
1104
1105         Covered by API tests.
1106
1107         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1108         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJsonHash):
1109         * Modules/webauthn/WebAuthenticationConstants.h: Copied from Source/WebCore/Modules/webauthn/COSEConstants.h.
1110         * Modules/webauthn/WebAuthenticationUtils.cpp: Added.
1111         (WebCore::convertBytesToVector):
1112         (WebCore::produceRpIdHash):
1113         (WebCore::encodeES256PublicKeyAsCBOR):
1114         (WebCore::buildAttestedCredentialData):
1115         (WebCore::buildAuthData):
1116         (WebCore::buildAttestationObject):
1117         * Modules/webauthn/WebAuthenticationUtils.h: Renamed from Source/WebCore/Modules/webauthn/COSEConstants.h.
1118         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
1119         (fido::getCredentialId):
1120         (fido::readCTAPGetInfoResponse):
1121         * Modules/webauthn/fido/FidoConstants.h:
1122         * Modules/webauthn/fido/U2fCommandConstructor.cpp: Added.
1123         (fido::WebCore::constructU2fRegisterCommand):
1124         (fido::WebCore::constructU2fSignCommand):
1125         (fido::isConvertibleToU2fRegisterCommand):
1126         (fido::isConvertibleToU2fSignCommand):
1127         (fido::convertToU2fRegisterCommand):
1128         (fido::convertToU2fCheckOnlySignCommand):
1129         (fido::convertToU2fSignCommand):
1130         (fido::constructBogusU2fRegistrationCommand):
1131         * Modules/webauthn/fido/U2fCommandConstructor.h: Added.
1132         * Modules/webauthn/fido/U2fResponseConverter.cpp: Added.
1133         (fido::WebCore::extractECPublicKeyFromU2fRegistrationResponse):
1134         (fido::WebCore::extractCredentialIdFromU2fRegistrationResponse):
1135         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
1136         (fido::WebCore::parseX509Length):
1137         (fido::WebCore::createFidoAttestationStatementFromU2fRegisterResponse):
1138         (fido::readU2fRegisterResponse):
1139         (fido::readFromU2fSignResponse):
1140         * Modules/webauthn/fido/U2fResponseConverter.h: Added.
1141         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1142         * Sources.txt:
1143         * WebCore.xcodeproj/project.pbxproj:
1144
1145 2019-01-06  David Kilzer  <ddkilzer@apple.com>
1146
1147         Leak of WTF::Function objects in WebCore::CryptoKeyRSA::generatePair() (64-80 bytes each) in com.apple.WebKit.WebContent running WebKit layout tests
1148         <https://webkit.org/b/193177>
1149         <rdar://problem/47072196>
1150
1151         Reviewed by Saam Barati.
1152
1153         * crypto/mac/CryptoKeyRSAMac.cpp:
1154         (WebCore::CryptoKeyRSA::generatePair): Fix the leak by changing
1155         raw pointers to heap-allocated __block variables to hold the
1156         WTF::Function objects until they are consumed within the block
1157         passed to dispatch_async().  The __block variables act like
1158         captured variables in a C++ lambda and have the same lifetime as
1159         the block that they are captured in.  Note that we would have to
1160         convert the source file from C++ to Objective-C++ to use a C++
1161         lambda functor with dispatch_async(), which creates its own
1162         issue because the comipiler requires a copy constructor to
1163         convert the C++ lambda to a block functor, but the copy
1164         constructor for the C++ lambda is implicitly deleted because the
1165         WTF::Function copy constructor is explicitly deleted.  Whew!
1166
1167 2019-01-06  Pablo Saavedra  <psaavedra@igalia.com>
1168
1169         [WPE][GTK] Building with ENABLE_VIDEO=OFF fails trying to use Document MediaPlayback functions.
1170         https://bugs.webkit.org/show_bug.cgi?id=193174
1171
1172         Reviewed by Michael Catanzaro.
1173
1174         * page/Page.cpp:
1175         (WebCore::Page::stopAllMediaPlayback):
1176         (WebCore::Page::suspendAllMediaPlayback):
1177         (WebCore::Page::resumeAllMediaPlayback):
1178
1179 2019-01-05  David Kilzer  <ddkilzer@apple.com>
1180
1181         Leak of two CCRSACryptorRef (4.0 Kbytes/1 page each) in com.apple.WebKit.WebContent running WebKit layout tests
1182         <https://webkit.org/b/193154>
1183         <rdar://problem/47052993>
1184
1185         Reviewed by Brent Fulgham.
1186
1187         Broadly:
1188         - Fix leaks by switching from using raw pointers to using
1189           std::unique_ptr<>.
1190         - Introduce PlatformRSAKeyContainer type to handle different
1191           std::unique_ptr<> on each platform.
1192         - Get rid of custom CryptoKeyRSA destructors since the
1193           std::unique_ptr<> handles that with a Deleter.
1194         - Initialize stack variables to nullptr.
1195
1196         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1197         (WebCore::CryptoKeyRSA::create):
1198         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
1199         (WebCore::CryptoKeyRSA::keySizeInBits const):
1200         (WebCore::CryptoKeyRSA::generatePair):
1201         (WebCore::CryptoKeyRSA::importSpki):
1202         (WebCore::CryptoKeyRSA::importPkcs8):
1203         (WebCore::CryptoKeyRSA::exportSpki const):
1204         (WebCore::CryptoKeyRSA::exportPkcs8 const):
1205         (WebCore::CryptoKeyRSA::algorithm const):
1206         (WebCore::CryptoKeyRSA::exportData const):
1207         (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
1208         * crypto/keys/CryptoKeyRSA.h:
1209         (WebCore::CCRSACryptorRefDeleter::operator() const):
1210         * crypto/mac/CryptoKeyRSAMac.cpp:
1211         (WebCore::getPublicKeyComponents):
1212         (WebCore::getPrivateKeyComponents):
1213         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
1214         (WebCore::CryptoKeyRSA::create):
1215         (WebCore::CryptoKeyRSA::exportData const):
1216         (WebCore::CryptoKeyRSA::generatePair):
1217         (WebCore::CryptoKeyRSA::importSpki):
1218         (WebCore::CryptoKeyRSA::importPkcs8):
1219         (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
1220
1221 2019-01-05  Zalan Bujtas  <zalan@apple.com>
1222
1223         Incorrect clipping across compositing boundary.
1224         https://bugs.webkit.org/show_bug.cgi?id=193172
1225         <rdar://problem/44693008>
1226
1227         Reviewed by Simon Fraser.
1228
1229         Use temporary cliprect type when crossing compositing boundary to prevent cliprect caching.
1230
1231         The issue here is that RenderLayer::backgroundClipRect() could cross compositing boundary by calling parentClipRects() which triggers
1232         clip rect update using the wrong painting root. This happens when the layer hierarchy and the compositing context do not match.
1233         For clip rect computation, we need to climb up on the layer hierarchy (calling parent layer's cliprect functions)
1234         but we also need to make sure that the computed cliprects on any given layer are cached only when the painting root is correct.
1235         It ensures that when we paint a layer (with the painting root as entry point), the cached cliprects are always based on its onw painting root. 
1236
1237         Test: compositing/clipping/cached-cliprect-with-compositing-boundary.html
1238
1239         * rendering/RenderLayer.cpp:
1240         (WebCore::RenderLayer::calculateClipRects const):
1241
1242 2019-01-05  Youenn Fablet  <youenn@apple.com>
1243
1244         Service Worker fetch should obey its referrer policy
1245         https://bugs.webkit.org/show_bug.cgi?id=193152
1246
1247         Reviewed by Chris Dumez.
1248
1249         Pass referrer policy retrieved when fetching the service worker script to the SWServer.
1250         The SWServer then stores it persistently and sends it to the manager creating service workers.
1251         This manager will then set the referrer policy on the dummy Document of the corresponding service worker.
1252
1253         Covered by rebased test.
1254
1255         * workers/WorkerScriptLoader.cpp:
1256         (WebCore::WorkerScriptLoader::didReceiveResponse):
1257         * workers/WorkerScriptLoader.h:
1258         (WebCore::WorkerScriptLoader::referrerPolicy const):
1259         * workers/service/SWClientConnection.cpp:
1260         (WebCore::SWClientConnection::failedFetchingScript):
1261         * workers/service/ServiceWorkerContainer.cpp:
1262         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
1263         * workers/service/ServiceWorkerContainer.h:
1264         * workers/service/ServiceWorkerContextData.cpp:
1265         (WebCore::ServiceWorkerContextData::isolatedCopy const):
1266         * workers/service/ServiceWorkerContextData.h:
1267         (WebCore::ServiceWorkerContextData::encode const):
1268         (WebCore::ServiceWorkerContextData::decode):
1269         * workers/service/ServiceWorkerFetchResult.h:
1270         (WebCore::ServiceWorkerFetchResult::encode const):
1271         (WebCore::ServiceWorkerFetchResult::decode):
1272         * workers/service/ServiceWorkerJob.cpp:
1273         (WebCore::ServiceWorkerJob::notifyFinished):
1274         * workers/service/ServiceWorkerJobClient.h:
1275         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1276         (WebCore::createPageForServiceWorker):
1277         * workers/service/server/RegistrationDatabase.cpp:
1278         (WebCore::recordsTableSchema):
1279         (WebCore::RegistrationDatabase::doPushChanges):
1280         (WebCore::RegistrationDatabase::importRecords):
1281         * workers/service/server/SWServer.cpp:
1282         (WebCore::SWServer::addRegistrationFromStore):
1283         (WebCore::SWServer::updateWorker):
1284         (WebCore::SWServer::installContextData):
1285         * workers/service/server/SWServer.h:
1286         * workers/service/server/SWServerJobQueue.cpp:
1287         (WebCore::SWServerJobQueue::scriptFetchFinished):
1288         * workers/service/server/SWServerWorker.cpp:
1289         (WebCore::SWServerWorker::SWServerWorker):
1290         (WebCore::SWServerWorker::contextData const):
1291         * workers/service/server/SWServerWorker.h:
1292
1293 2019-01-04  Simon Fraser  <simon.fraser@apple.com>
1294
1295         Factor legacy WK1 code for fixed and scrolling layers into their own helper class
1296         https://bugs.webkit.org/show_bug.cgi?id=193165
1297
1298         Reviewed by Frédéric Wang.
1299
1300         RenderLayerCompositor has some code to handle registration of viewport-constrained
1301         and scrolling layers which is specific to iOS WK1. To reduce pollution, move this
1302         into its own helper class called LegacyWebKitScrollingLayerCoordinator, which is only
1303         allocated for iOS WK1.
1304         
1305         iOS WK1 never has a ScrollingCoordinator, so rather than the check for scrollingCoordinator(),
1306         we know that we only made a LegacyWebKitScrollingLayerCoordinator when there's a platform widget
1307         (i.e. WK1).
1308         
1309         * page/ChromeClient.h:
1310         * rendering/RenderLayerCompositor.cpp:
1311         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
1312         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
1313         (WebCore::RenderLayerCompositor::didFlushChangesForLayer):
1314         (WebCore::RenderLayerCompositor::setIsInWindow):
1315         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): No longer check the page cache state; now we
1316         destroy the render tree of pages in the page cache, so we should never hit this code path.
1317         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
1318         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
1319         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllViewportConstrainedLayers):
1320         (WebCore::scrollbarHasDisplayNone):
1321         (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
1322         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllScrollingLayers):
1323         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate):
1324         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
1325         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
1326         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
1327         (WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer):
1328         (WebCore::updateScrollingLayerWithClient): Deleted.
1329         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers): Deleted.
1330         (WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers): Deleted.
1331         (WebCore::RenderLayerCompositor::registerAllScrollingLayers): Deleted.
1332         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers): Deleted.
1333         * rendering/RenderLayerCompositor.h:
1334         (WebCore::LegacyWebKitScrollingLayerCoordinator::LegacyWebKitScrollingLayerCoordinator):
1335         * workers/service/ServiceWorkerContainer.cpp:
1336         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
1337
1338 2019-01-05  Zalan Bujtas  <zalan@apple.com>
1339
1340         [LFC] VerticalMargin should only have the used values.
1341         https://bugs.webkit.org/show_bug.cgi?id=193168
1342
1343         Reviewed by Antti Koivisto.
1344
1345         Split VerticalMargin into ComputedVerticalMargin and UsedVerticalMargin.
1346         ComputedVerticalMargin holds the computed (optional) values while UsedVerticalMargin holds both the
1347         collapsed (optional) and the non-collapsed values.
1348
1349         * layout/FormattingContext.cpp:
1350         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1351         * layout/FormattingContext.h:
1352         * layout/FormattingContextGeometry.cpp:
1353         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1354         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1355         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1356         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1357         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1358         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
1359         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): Deleted.
1360         * layout/FormattingContextQuirks.cpp:
1361         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1362         * layout/LayoutUnits.h:
1363         * layout/MarginTypes.h:
1364         (WebCore::Layout::UsedVerticalMargin::before const):
1365         (WebCore::Layout::UsedVerticalMargin::after const):
1366         (WebCore::Layout::UsedVerticalMargin::nonCollapsedValues const):
1367         (WebCore::Layout::UsedVerticalMargin::collapsedValues const):
1368         (WebCore::Layout::UsedVerticalMargin::hasCollapsedValues const):
1369         (WebCore::Layout::UsedVerticalMargin::setCollapsedValues):
1370         (WebCore::Layout::UsedVerticalMargin::UsedVerticalMargin):
1371         (WebCore::Layout::VerticalMargin::nonCollapsedValues const): Deleted.
1372         (WebCore::Layout::VerticalMargin::collapsedValues const): Deleted.
1373         (WebCore::Layout::VerticalMargin::setCollapsedValues): Deleted.
1374         (WebCore::Layout::VerticalMargin::VerticalMargin): Deleted.
1375         (WebCore::Layout::VerticalMargin::usedValues const): Deleted.
1376         * layout/blockformatting/BlockFormattingContext.cpp:
1377         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1378         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1379         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1380         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1381         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1382         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1383         * layout/blockformatting/BlockMarginCollapse.cpp:
1384         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
1385         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
1386         * layout/displaytree/DisplayBox.h:
1387         (WebCore::Display::Box::setVerticalMargin):
1388         (WebCore::Display::Box::verticalMargin const):
1389         (WebCore::Display::Box::marginBefore const):
1390         (WebCore::Display::Box::marginAfter const):
1391         * layout/floats/FloatingContext.cpp:
1392         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1393         * layout/inlineformatting/InlineFormattingContext.cpp:
1394         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
1395
1396 2019-01-04  Daniel Bates  <dabates@apple.com>
1397
1398         REGRESSION (r238522): Erratic scrolling on Google flights search result page and vrbo.com
1399         https://bugs.webkit.org/show_bug.cgi?id=192996
1400         <rdar://problem/46573552>
1401
1402         Reviewed by Simon Fraser.
1403
1404         Only scroll a text field if its inner text size changes and it is the currently active and
1405         focused element on the page.
1406
1407         Test: fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html
1408
1409         * rendering/RenderTextControlSingleLine.cpp:
1410         (WebCore::RenderTextControlSingleLine::layout):
1411
1412 2019-01-04  Alex Christensen  <achristensen@webkit.org>
1413
1414         Progress towards fixing Mac CMake build
1415         https://bugs.webkit.org/show_bug.cgi?id=193105
1416
1417         Reviewed by Don Olmstead.
1418
1419         * PlatformMac.cmake:
1420         * Sources.txt:
1421         * SourcesCocoa.txt:
1422         * WebCore.xcodeproj/project.pbxproj:
1423         * platform/graphics/gpu/GPURenderPassEncoder.h:
1424
1425 2019-01-04  Zalan Bujtas  <zalan@apple.com>
1426
1427         [iOS] ERROR: post-layout: dirty renderer(s) in WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker()
1428         https://bugs.webkit.org/show_bug.cgi?id=189608
1429         <rdar://problem/44473299>
1430
1431         Reviewed by Simon Fraser.
1432
1433         When a frameset/iframe is hidden and we skip layout, clear the dirty flag on its subtree as well.
1434
1435         Covered by fast/frames/invalid-frameset.html.
1436
1437         * rendering/RenderFrameSet.cpp:
1438         (WebCore::clearSiblingSubtrees):
1439         (WebCore::RenderFrameSet::positionFrames):
1440         (WebCore::RenderFrameSet::positionFramesWithFlattening):
1441
1442 2019-01-04  Youenn Fablet  <youenn@apple.com>
1443
1444         [Fetch API] Implement abortable fetch
1445         https://bugs.webkit.org/show_bug.cgi?id=174980
1446         <rdar://problem/46861402>
1447
1448         Reviewed by Chris Dumez.
1449
1450         Add an AbortSignal to FetchRequest.
1451
1452         Add support for AbortSignal algorithm.
1453         The fetch request signal is added an algorithm to abort the fetch.
1454         Update clone algorithm to let signal of the cloned request be following the origin request.
1455
1456         Update ReadableStream error handling to return an exception instead of a string.
1457         This allows passing an AbortError instead of a TypeError as previously done.
1458
1459         Update FetchBodyOwner to store a loading error either as an exception or as a resource error.
1460         The latter is used for passing the error from service worker back to the page.
1461         The former is used to pass it to ReadableStream or body accessors.
1462
1463         Covered by enabled tests.
1464
1465         * Modules/cache/DOMCache.cpp:
1466         (WebCore::DOMCache::put):
1467         * Modules/fetch/FetchBody.cpp:
1468         (WebCore::FetchBody::consumeAsStream):
1469         (WebCore::FetchBody::loadingFailed):
1470         * Modules/fetch/FetchBody.h:
1471         * Modules/fetch/FetchBodyConsumer.cpp:
1472         (WebCore::FetchBodyConsumer::loadingFailed):
1473         * Modules/fetch/FetchBodyConsumer.h:
1474         * Modules/fetch/FetchBodyOwner.cpp:
1475         (WebCore::FetchBodyOwner::arrayBuffer):
1476         (WebCore::FetchBodyOwner::blob):
1477         (WebCore::FetchBodyOwner::cloneBody):
1478         (WebCore::FetchBodyOwner::formData):
1479         (WebCore::FetchBodyOwner::json):
1480         (WebCore::FetchBodyOwner::text):
1481         (WebCore::FetchBodyOwner::loadBlob):
1482         (WebCore::FetchBodyOwner::blobLoadingFailed):
1483         (WebCore::FetchBodyOwner::consumeBodyAsStream):
1484         (WebCore::FetchBodyOwner::setLoadingError):
1485         * Modules/fetch/FetchBodyOwner.h:
1486         (WebCore::FetchBodyOwner::loadingError const):
1487         (WebCore::FetchBodyOwner::loadingException const):
1488         * Modules/fetch/FetchBodySource.cpp:
1489         (WebCore::FetchBodySource::error):
1490         * Modules/fetch/FetchBodySource.h:
1491         * Modules/fetch/FetchRequest.cpp:
1492         (WebCore::FetchRequest::initializeWith):
1493         (WebCore::FetchRequest::clone):
1494         * Modules/fetch/FetchRequest.h:
1495         (WebCore::FetchRequest::FetchRequest):
1496         * Modules/fetch/FetchRequest.idl:
1497         * Modules/fetch/FetchRequestInit.h:
1498         (WebCore::FetchRequestInit::hasMembers const):
1499         * Modules/fetch/FetchRequestInit.idl:
1500         * Modules/fetch/FetchResponse.cpp:
1501         (WebCore::FetchResponse::clone):
1502         (WebCore::FetchResponse::fetch):
1503         (WebCore::FetchResponse::BodyLoader::didFail):
1504         * Modules/fetch/FetchResponse.h:
1505         * bindings/js/ReadableStreamDefaultController.h:
1506         (WebCore::ReadableStreamDefaultController::error):
1507         * dom/AbortSignal.cpp:
1508         (WebCore::AbortSignal::abort):
1509         (WebCore::AbortSignal::follow):
1510         * dom/AbortSignal.h:
1511
1512 2019-01-04  Brent Fulgham  <bfulgham@apple.com>
1513
1514         Parsed protocol of javascript URLs with embedded newlines and carriage returns do not match parsed protocol in Chrome and Firefox
1515         https://bugs.webkit.org/show_bug.cgi?id=193155
1516         <rdar://problem/40230982>
1517
1518         Reviewed by Chris Dumez.
1519
1520         Test: fast/loader/comment-only-javascript-url.html
1521
1522         Make a special case for URLs beginning with 'javascript:'. We should always
1523         treat these as JS URLs, even if the content contained within the URL
1524         string might match other parts of the URL parsing spec.
1525
1526         * html/URLUtils.h:
1527         (WebCore::URLUtils<T>::protocol const):
1528
1529 2019-01-04  Jer Noble  <jer.noble@apple.com>
1530
1531         [WebKitLegacy] Media playback pauses on scroll
1532         https://bugs.webkit.org/show_bug.cgi?id=192829
1533
1534         Reviewed by Eric Carlson.
1535
1536         New API tests:
1537             WebKitLegacy.ScrollingDoesNotPauseMedia
1538             WKWebView.StopAllMediaPlayback
1539             WKWebView.SuspendResumeAllMediaPlayback
1540
1541         Do not use suspendActiveDOMObjects(ReasonForSuspension::PageWillBeSuspended) to pause
1542         video. Roll back the changes to HTMLMediaElement, and introduce a new set of Page calls
1543         suspendAllMediaPlayback() & resumeAllMediaPlayback() which replaces the removed bahavior.
1544
1545         * dom/Document.cpp:
1546         (WebCore::Document::~Document):
1547         (WebCore::Document::stopAllMediaPlayback):
1548         (WebCore::Document::suspendAllMediaPlayback):
1549         (WebCore::Document::resumeAllMediaPlayback):
1550         * dom/Document.h:
1551         * html/HTMLMediaElement.cpp:
1552         (WebCore::HTMLMediaElement::HTMLMediaElement):
1553         (WebCore::HTMLMediaElement::parseAttribute):
1554         (WebCore::HTMLMediaElement::didFinishInsertingNode):
1555         (WebCore::HTMLMediaElement::setSrcObject):
1556         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1557         (WebCore::HTMLMediaElement::suspend):
1558         (WebCore::HTMLMediaElement::resume):
1559         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
1560         * html/HTMLMediaElement.h:
1561         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
1562         * html/MediaElementSession.cpp:
1563         (WebCore::MediaElementSession::playbackPermitted const):
1564         * page/Page.cpp:
1565         (WebCore::Page::stopAllMediaPlayback):
1566         (WebCore::Page::suspendAllMediaPlayback):
1567         (WebCore::Page::resumeAllMediaPlayback):
1568         * page/Page.h:
1569         (WebCore::Page::mediaPlaybackIsSuspended):
1570         * platform/audio/PlatformMediaSession.h:
1571         * platform/audio/PlatformMediaSessionManager.cpp:
1572         (WebCore::PlatformMediaSessionManager::suspendAllMediaPlaybackForDocument):
1573         (WebCore::PlatformMediaSessionManager::resumeAllMediaPlaybackForDocument):
1574         * platform/audio/PlatformMediaSessionManager.h:
1575
1576 2019-01-04  Chris Dumez  <cdumez@apple.com>
1577
1578         Add support for toggling device orientation API support per site
1579         https://bugs.webkit.org/show_bug.cgi?id=193143
1580         <rdar://problem/46605724>
1581
1582         Reviewed by Alex Christensen.
1583
1584         Add support for toggling device orientation API support per site via _WKWebsitePolicies.
1585
1586         * dom/Document.cpp:
1587         (WebCore::Document::simulateDeviceOrientationChange):
1588         * dom/Document.h:
1589         * loader/DocumentLoader.h:
1590         (WebCore::DocumentLoader::deviceOrientationEventEnabled const):
1591         (WebCore::DocumentLoader::setDeviceOrientationEventEnabled):
1592         * page/DOMWindow.cpp:
1593         (WebCore::DOMWindow::addEventListener):
1594
1595 2019-01-04  Jer Noble  <jer.noble@apple.com>
1596
1597         Web Content process main thread blocked beneath ImageDecoderAVFObjC::readSamples for many seconds on imgur.com
1598         https://bugs.webkit.org/show_bug.cgi?id=191806
1599         <rdar://problem/46151477>
1600
1601         Reviewed by Dean Jackson.
1602
1603         Test: http/tests/images/mp4-partial-load.html
1604
1605         Rather than use an AVAssetReaderTrackOutput, which will load both sample metadata and sample data
1606         synchronously when a sample is requested, use AVAssetReaderSampleReferenceOutput, which only loads
1607         sample metadata, including the byte offset and byte length of the sample data. By waiting until the
1608         AVAsset signals that it's own metadata is loaded, we can safely parse all the sample metadata without
1609         blocking on network loads. Once enough data is loaded, we can replace the byte reference and offset
1610         attachements in the sample with actual data, and mark the sample as "complete".
1611
1612         Because the existing ImageSource assumes that image data parsing will occur synchronously, and that
1613         synchronous parsing could cause a hang if the metadata is not loaded, add a new callback method which
1614         allows the ImageSource to be notified when the encodedDataStatus changes. The ImageSource notifies the
1615         CacheImage, which notifies the RenderImage, and thus the asynchronous parsing will kick off the
1616         renderer's animation loop.
1617
1618         * loader/cache/CachedImage.cpp:
1619         (WebCore::CachedImage::CachedImageObserver::encodedDataStatusChanged):
1620         (WebCore::CachedImage::encodedDataStatusChanged):
1621         * loader/cache/CachedImage.h:
1622         * platform/graphics/ImageDecoder.h:
1623         (WebCore::ImageDecoder::setEncodedDataStatusChangeCallback):
1624         * platform/graphics/ImageObserver.h:
1625         (WebCore::ImageObserver::encodedDataStatusChanged):
1626         * platform/graphics/ImageSource.cpp:
1627         (WebCore::ImageSource::ensureDecoderAvailable):
1628         (WebCore::ImageSource::encodedDataStatusChanged):
1629         (WebCore::ImageSource::frameDecodingStatusAtIndex):
1630         * platform/graphics/ImageSource.h:
1631         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
1632         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1633         (-[WebCoreSharedBufferResourceLoaderDelegate data]):
1634         (WebCore::ImageDecoderAVFObjCSample::byteRange const):
1635         (WebCore::ImageDecoderAVFObjC::readSamples):
1636         (WebCore::ImageDecoderAVFObjC::setEncodedDataStatusChangeCallback):
1637         (WebCore::ImageDecoderAVFObjC::encodedDataStatus const):
1638         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
1639         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
1640         (WebCore::ImageDecoderAVFObjC::sampleIsComplete const):
1641
1642 2019-01-04  Youenn Fablet  <youenn@apple.com>
1643
1644         CSP violation reports should bypass CSP checks
1645         https://bugs.webkit.org/show_bug.cgi?id=192857
1646         <rdar://problem/46887236>
1647
1648         Reviewed by Chris Dumez.
1649
1650         For ping loads, pass the option to do CSP checks from PingLoader to LoaderStrategy.
1651         This new option is unused by WebKit Legacy.
1652         It is used by WebKit loader strategy to only send any CSP response header to network process
1653         in case CSP checks should be done.
1654
1655         This option is used to disable CSP checks for Ping Loads that report CSP violations.
1656
1657         Test: http/wpt/fetch/csp-reports-bypass-csp-checks.html
1658
1659         * loader/LoaderStrategy.h:
1660         * loader/PingLoader.cpp:
1661         (WebCore::PingLoader::loadImage):
1662         (WebCore::PingLoader::sendPing):
1663         (WebCore::PingLoader::sendViolationReport):
1664         (WebCore::PingLoader::startPingLoad):
1665         * loader/PingLoader.h:
1666         * loader/cache/CachedResource.cpp:
1667         (WebCore::CachedResource::load):
1668
1669 2019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1670
1671         [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
1672         https://bugs.webkit.org/show_bug.cgi?id=193129
1673
1674         Reviewed by Tim Horton.
1675
1676         Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior.
1677
1678         * Sources.txt:
1679         * WebCore.xcodeproj/project.pbxproj:
1680         * editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp.
1681         (WebCore::nameForUndoRedo):
1682         * editing/EditAction.h:
1683         * editing/Editor.cpp:
1684
1685 2019-01-03  Matt Rajca  <mrajca@apple.com>
1686
1687         Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
1688         https://bugs.webkit.org/show_bug.cgi?id=193128
1689         rdar://34554231
1690
1691         Reviewed by Jer Noble.
1692
1693         Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
1694         media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
1695         event along with a flag that indicates whether or not autoplay was actually prevented.
1696         Moreover, we can include a flag that indicates whether the media element in question
1697         is main content. Clients will then know in more cases when media was played with a user
1698         gesture, whether or not it has audio, as well as its main content status. While the main
1699         content heuristics may not be perfect, they covered the top 20 video-centric websites that
1700         this was tested with and are meant to be used by clients for data evaluation purposes.
1701
1702         As part of this, the PlaybackWithoutUserGesture enum was renamed to AutoplayEventPlaybackState
1703         since it now also applies to cases where there is a user gesture. The
1704         `m_playbackWithoutUserGestureStartedTime` member variable was also removed in favor of
1705         `playbackStartedTime` which also covers all the cases we care about.
1706
1707         Tests: existing API tests were updated to reflect the new names. New API tests
1708         were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.
1709
1710         * html/HTMLMediaElement.cpp:
1711         (WebCore::convertEnumerationToString): Update to new enum cases.
1712         (WebCore::HTMLMediaElement::setReadyState): Ditto.
1713         (WebCore::HTMLMediaElement::play): Ditto.
1714         (WebCore::HTMLMediaElement::playInternal): Also cover the case where
1715          playback was not prevented but there was a user gesture.
1716         (WebCore::HTMLMediaElement::pauseInternal): Use new name.
1717         (WebCore::HTMLMediaElement::setVolume): Use new name.
1718         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Dispatch the
1719          DidPlayMediaWithUserGesture event when playback was started with a user
1720          gesture as well.
1721         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Use new name.
1722         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
1723         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
1724         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
1725         (WebCore::HTMLMediaElement::handleAutoplayEvent): Pass along new media state.
1726         (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Use new name.
1727         (WebCore::HTMLMediaElement::setAutoplayEventPlaybackState): Stop setting
1728          m_playbackWithoutUserGestureStartedTime in favor of using playbackStartedTime.
1729         (WebCore::HTMLMediaElement::updateShouldPlay): Use new name.
1730         (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Renamed.
1731         * html/HTMLMediaElement.h:
1732         (WTF::LogArgument<WebCore::HTMLMediaElement::AutoplayEventPlaybackState>::toString): Renamed from...
1733         (WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString):
1734         * html/MediaElementSession.cpp:
1735         (WebCore::MediaElementSession::isMainContentForPurposesOfAutoplayEvents const): Don't
1736          do the hit testing check for the purposes of autoplay events. It seems to fail on the
1737          basic Vimeo player due to overlapping divs.
1738         (WebCore::isElementMainContentForPurposesOfAutoplay):
1739         (WebCore::MediaElementSession::updateIsMainContent const): Keep the existing behavior
1740          here of hit testing.
1741         (WebCore::isMainContentForPurposesOfAutoplay): Renamed.
1742         * html/MediaElementSession.h:
1743         * page/AutoplayEvent.h:
1744
1745 2019-01-04  Youenn Fablet  <youenn@apple.com>
1746
1747         Crash in WebCore::ServiceWorkerGlobalScope
1748         https://bugs.webkit.org/show_bug.cgi?id=192513
1749         <rdar://problem/46563880>
1750
1751         Reviewed by Alex Christensen.
1752
1753         Store the identifier in its own variable to make sure we do not use workerThread after being moved.
1754
1755         * workers/service/ServiceWorkerGlobalScope.cpp:
1756         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
1757
1758 2019-01-04  Chris Fleizach  <cfleizach@apple.com>
1759
1760         AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
1761         https://bugs.webkit.org/show_bug.cgi?id=193041
1762         <rdar://problem/46954090>
1763
1764         Reviewed by Zalan Bujtas.
1765
1766         * en.lproj/Localizable.strings:
1767         * platform/cocoa/LocalizedStringsCocoa.mm:
1768         (WebCore::AXHorizontalRuleDescriptionText):
1769
1770 2019-01-04  Zalan Bujtas  <zalan@apple.com>
1771
1772         [LFC] ComputedHorizontalMargin should have optional members
1773         https://bugs.webkit.org/show_bug.cgi?id=193131
1774
1775         Reviewed by Antti Koivisto.
1776
1777         Split HorizontalMargin into UsedHorizontalMargin and ComputedHorizontalMargin. ComputedHorizontalMargin's members are optional.
1778         (see computed vs used values)
1779
1780         * layout/FormattingContext.h:
1781         * layout/FormattingContextGeometry.cpp:
1782         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1783         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1784         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1785         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1786         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1787         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
1788         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): Deleted.
1789         * layout/LayoutUnits.h:
1790         * layout/MarginTypes.h:
1791         * layout/Verification.cpp:
1792         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1793         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1794         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1795         * layout/displaytree/DisplayBox.h:
1796         (WebCore::Display::Box::setHorizontalMargin):
1797         (WebCore::Display::Box::setHorizontalComputedMargin):
1798         (WebCore::Display::Box::computedMarginStart const):
1799         (WebCore::Display::Box::computedMarginEnd const):
1800         * layout/floats/FloatAvoider.h:
1801         (WebCore::Layout::FloatAvoider::marginStart const):
1802         (WebCore::Layout::FloatAvoider::marginEnd const):
1803         * layout/inlineformatting/InlineFormattingContext.cpp:
1804         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1805         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1806         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1807
1808 2019-01-04  Zalan Bujtas  <zalan@apple.com>
1809
1810         [LFC][BFC] Use computedValue and usedValue consistently
1811         https://bugs.webkit.org/show_bug.cgi?id=193059
1812
1813         Reviewed by Antti Koivisto.
1814
1815         https://www.w3.org/TR/CSS22/cascade.html#value-stages
1816
1817         6.1.2 Computed values
1818         Specified values are resolved to computed values during the cascade; for example URIs are made absolute and 'em' and 'ex' units
1819         are computed to pixel or absolute lengths. Computing a value never requires the user agent to render the document...
1820
1821         6.1.3 Used values
1822         Computed values are processed as far as possible without formatting the document. Some values, however, can only be determined when the document
1823         is being laid out. For example, if the width of an element is set to be a certain percentage of its containing block, the width cannot be determined
1824         until the width of the containing block has been determined. The used value is the result of taking the computed value and resolving any remaining
1825         dependencies into an absolute value.
1826
1827         * layout/FormattingContext.cpp:
1828         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1829         * layout/FormattingContextGeometry.cpp:
1830         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1831         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1832         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1833         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1834         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1835         * layout/LayoutState.cpp:
1836         (WebCore::Layout::LayoutState::LayoutState):
1837         * layout/LayoutUnits.h:
1838         * layout/Verification.cpp:
1839         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1840         * layout/blockformatting/BlockFormattingContext.cpp:
1841         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1842         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1843         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1844         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1845         * layout/displaytree/DisplayBox.cpp:
1846         (WebCore::Display::Box::Box):
1847         * layout/displaytree/DisplayBox.h:
1848         (WebCore::Display::Box::setHasValidHorizontalComputedMargin):
1849         (WebCore::Display::Box::setHorizontalComputedMargin):
1850         (WebCore::Display::Box::computedMarginStart const):
1851         (WebCore::Display::Box::computedMarginEnd const):
1852         (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin): Deleted.
1853         (WebCore::Display::Box::setHorizontalNonComputedMargin): Deleted.
1854         (WebCore::Display::Box::nonComputedMarginStart const): Deleted.
1855         (WebCore::Display::Box::nonComputedMarginEnd const): Deleted.
1856         * layout/floats/FloatAvoider.h:
1857         (WebCore::Layout::FloatAvoider::marginStart const):
1858         (WebCore::Layout::FloatAvoider::marginEnd const):
1859         * layout/inlineformatting/InlineFormattingContext.cpp:
1860         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
1861
1862 2019-01-03  Zalan Bujtas  <zalan@apple.com>
1863
1864         REGRESSION: -webkit-appearance test case crashes
1865         https://bugs.webkit.org/show_bug.cgi?id=189302
1866         <rdar://problem/44143049>
1867
1868         Reviewed by Wenson Hsieh.
1869
1870         The painting and the layout positions of the cancel button need to match in order to be able to interact with it.
1871         This patch removes the previous position inlining attempts.
1872
1873         Test: fast/forms/webkit-appearance-searchfield-cancel-button-crash.html
1874
1875         * rendering/RenderThemeMac.mm:
1876         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1877
1878 2019-01-03  David Kilzer  <ddkilzer@apple.com>
1879
1880         Leak of WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback (48 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
1881         <https://webkit.org/b/193122>
1882         <rdar://problem/47022987>
1883
1884         Reviewed by Youenn Fablet.
1885
1886         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
1887         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::AddRef const):
1888         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::Release const):
1889         - Remove `final` keyword so that
1890           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
1891           can be called.
1892         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
1893         - To fix the leak call
1894           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
1895           to create the object.
1896
1897 2019-01-03  Simon Fraser  <simon.fraser@apple.com>
1898
1899         REGRESSION (r238090): After showing the Find banner or tab bar, hit tests are vertically offset (or painting is not offset)
1900         https://bugs.webkit.org/show_bug.cgi?id=193124
1901         rdar://problem/46755409
1902
1903         Reviewed by Tim Horton.
1904
1905         Top content inset feeds into scrolling tree geometry, so when it changes we need to trigger
1906         an update of the root scrolling node, which happens via RenderLayerBacking::updateGeometry().
1907         So set a dirty bit on the root layer in frameViewDidChangeSize(), which is called from the code
1908         path that runs when top content inset changes.
1909
1910         Find banner behavior is not easily testable. platform/mac/fast/events/content-inset-hit-testing.html did not detect the regression.
1911
1912         * rendering/RenderLayerCompositor.cpp:
1913         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
1914
1915 2019-01-03  Chris Dumez  <cdumez@apple.com>
1916
1917         Potential infinite recursion in isFrameFamiliarWith(Frame&, Frame&)
1918         https://bugs.webkit.org/show_bug.cgi?id=192997
1919         <rdar://problem/46217271>
1920
1921         Reviewed by Antti Koivisto.
1922
1923         isFrameFamiliarWith(Frame&, Frame&) was called recursively using the passed frames' openers.
1924         The issue is that a Frame can be its opener. There could also be a cycle in the opener chain.
1925
1926         To address the issue, simplify isFrameFamiliarWith() so that it is no longer recursive. We now
1927         only check if the frames belong to the same pages or if their openers do. We no longer check
1928         openers' opener and up.
1929
1930         Note that this function is used to check if a frame is allowed to target another. In practice,
1931         it is unlikely to be useful to navigate an opener's opener and an openee's openee.
1932
1933         Tests: fast/dom/Window/window-open-opener-cycle.html
1934                fast/dom/Window/window-open-self-as-opener.html
1935
1936         * page/FrameTree.cpp:
1937         (WebCore::isFrameFamiliarWith):
1938
1939 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
1940
1941         REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
1942         https://bugs.webkit.org/show_bug.cgi?id=193095
1943         <rdar://problem/47014944>
1944
1945         Reviewed by Zalan Bujtas.
1946         
1947         In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
1948         and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
1949         which continues to affect the appearance of text.
1950         
1951         Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.
1952
1953         Test: compositing/contents-format/subpixel-antialiased-text.html
1954
1955         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1956         (WebCore::PlatformCALayer::drawLayerContents):
1957
1958 2019-01-02  David Kilzer  <ddkilzer@apple.com>
1959
1960         Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
1961         <https://webkit.org/b/193016>
1962         <rdar://problem/46925703>
1963
1964         Reviewed by Simon Fraser.
1965
1966         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1967         (WebCore::copySampleBufferWithCurrentTimeStamp):
1968         - Change to return RetainPtr<CMSampleBufferRef>.
1969         - Check return value of CMSampleBufferCreateCopyWithNewTiming().
1970         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
1971         - Check return value of copySampleBufferWithCurrentTimeStamp().
1972         - Fix leak by using RetainPtr<CMSampleBufferRef> returned from
1973           copySampleBufferWithCurrentTimeStamp() instead of leaking
1974           `bufferWithCurrentTime` by using retainPtr().
1975         (WebCore::createAudioFormatDescription):
1976         - Extract method from appendAudioSampleBuffer() to return
1977           RetainPtr<CMFormatDescriptionRef> after calling
1978           CMAudioFormatDescriptionCreate().
1979         - Check return value of CMAudioFormatDescriptionCreate().
1980         (WebCore::createAudioSampleBufferWithPacketDescriptions):
1981         - Extract method from appendAudioSampleBuffer() to return
1982           RetainPtr<CMSampleBufferRef> after calling
1983           CMAudioSampleBufferCreateWithPacketDescriptions().
1984         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
1985         - Check return values of createAudioFormatDescription() and
1986           createAudioSampleBufferWithPacketDescriptions().
1987         - Fix leaks by extracting code into helper methods that return
1988           RetainPtr<> objects instead of leaking CMFormatDescriptionRef
1989           directly or leaking `sampleBuffer` by using retainPtr().
1990
1991 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1992
1993         Add support for using the current text selection as the find string on iOS
1994         https://bugs.webkit.org/show_bug.cgi?id=193034
1995         <rdar://problem/45138739>
1996
1997         Reviewed by Tim Horton.
1998
1999         Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find
2000         pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI
2001         process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are
2002         able to trigger find-in-page with this string.
2003
2004         Test: WebKit.UseSelectionAsFindString
2005
2006         * editing/Editor.cpp:
2007         (WebCore::Editor::canCopyExcludingStandaloneImages const):
2008
2009         Make this helper function cross-platform.
2010
2011         * editing/Editor.h:
2012         * editing/EditorCommand.cpp:
2013         (WebCore::createCommandMap):
2014         * editing/cocoa/EditorCocoa.mm:
2015         (WebCore::Editor::takeFindStringFromSelection):
2016
2017         Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the
2018         find string (see WebKit/ChangeLog for more details).
2019
2020         * editing/mac/EditorMac.mm:
2021         (WebCore::Editor::canCopyExcludingStandaloneImages): Deleted.
2022         (WebCore::Editor::takeFindStringFromSelection): Deleted.
2023         * loader/EmptyClients.cpp:
2024         * page/EditorClient.h:
2025
2026         Add a new editor client method to send the string for find-in-page to the UI process.
2027
2028 2019-01-02  Devin Rousso  <webkit@devinrousso.com>
2029
2030         Web Inspector: Implement `queryObjects` Command Line API
2031         https://bugs.webkit.org/show_bug.cgi?id=176766
2032         <rdar://problem/34890689>
2033
2034         Reviewed by Joseph Pecoraro.
2035
2036         Test: inspector/console/queryObjects.html
2037
2038         * inspector/CommandLineAPIModuleSource.js:
2039         (CommandLineAPI):
2040         (CommandLineAPIImpl.prototype.queryObjects): Added.
2041
2042 2019-01-02  Charles Vazac  <cvazac@gmail.com>
2043
2044         Fix resourcetimingbufferfull bubbles attribute
2045         https://bugs.webkit.org/show_bug.cgi?id=193087
2046
2047         Reviewed by Chris Dumez.
2048
2049         This change is covered by web-platform-tests [1].
2050
2051         [1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20
2052
2053         * page/Performance.cpp:
2054         (WebCore::Performance::resourceTimingBufferFullTimerFired):
2055
2056 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
2057
2058         Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
2059         https://bugs.webkit.org/show_bug.cgi?id=193010
2060
2061         Reviewed by Zalan Bujtas.
2062
2063         Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h,
2064         and make it an enum class.
2065
2066         * page/FrameView.cpp:
2067         (WebCore::FrameView::scrollLayerID const):
2068         * rendering/RenderLayer.h:
2069         * rendering/RenderLayerBacking.cpp:
2070         (WebCore::RenderLayerBacking::~RenderLayerBacking):
2071         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
2072         (WebCore::operator<<):
2073         * rendering/RenderLayerBacking.h:
2074         * rendering/RenderLayerCompositor.cpp:
2075         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
2076         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
2077         (WebCore::scrollCoordinationRoleForNodeType):
2078         (WebCore::RenderLayerCompositor::attachScrollingNode):
2079         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
2080         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2081         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
2082         * rendering/RenderLayerCompositor.h:
2083
2084 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
2085
2086         Don't spin up a CalcParser if the current token is not a function token
2087         https://bugs.webkit.org/show_bug.cgi?id=193067
2088
2089         Reviewed by Zalan Bujtas.
2090
2091         Various functions in CSSPropertyParserHelpers fall back to trying to parse
2092         a calc expression if the normal parsing fails. Don't do this unless the
2093         current token is a function token, which should be slightly more efficient.
2094
2095         * css/parser/CSSPropertyParserHelpers.cpp:
2096         (WebCore::CSSPropertyParserHelpers::consumeInteger):
2097         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
2098         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
2099         (WebCore::CSSPropertyParserHelpers::consumeNumber):
2100         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
2101         (WebCore::CSSPropertyParserHelpers::consumeLength):
2102         (WebCore::CSSPropertyParserHelpers::consumePercent):
2103         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
2104         (WebCore::CSSPropertyParserHelpers::consumeAngle):
2105         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
2106         (WebCore::CSSPropertyParserHelpers::consumeTime):
2107
2108 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
2109
2110         Support css-color-4 rgb functions
2111         https://bugs.webkit.org/show_bug.cgi?id=192321
2112
2113         Reviewed by Zalan Bujtas.
2114         
2115         Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions.
2116         The differences are:
2117         1. There is a new comma-free syntax, where the optional alpha is separated by a slash:
2118             rgb(128 34 56)
2119             rgb(128 34 56 / 50%)
2120         2. Floating point values are allowed, and rounded:
2121             rgb(128.5 34.2 56.5) becomes rgb(129 34 57)
2122         3. rgba() is a pure alias for rgb(), so these are equivalent:
2123             rgb(128 34 56 / 50%)
2124             rgba(128 34 56 / 50%)
2125             
2126         hsl()/hsla() parsing was already updated to this new syntax in r230861.
2127
2128         Tested by tests in imported/w3c/web-platform-tests/css/css-color/
2129
2130         * css/parser/CSSPropertyParserHelpers.cpp:
2131         (WebCore::CSSPropertyParserHelpers::clampRGBComponent):
2132         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
2133         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
2134
2135 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
2136
2137         Handle calc() expressions in gradient color stops
2138         https://bugs.webkit.org/show_bug.cgi?id=193066
2139         rdar://problem/46961985
2140
2141         Reviewed by Sam Weinig.
2142         
2143         Fix two issues that prevented calc() expressions from working in conic-gradient color stops,
2144         for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent
2145         calc values as well as angle ones.
2146
2147         Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account),
2148         just as isPx() etc do.
2149
2150         Test: fast/gradients/conic-calc-stop-position.html
2151
2152         * css/CSSPrimitiveValue.h:
2153         (WebCore::CSSPrimitiveValue::isAngle const):
2154         * css/parser/CSSPropertyParserHelpers.cpp:
2155         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
2156         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
2157
2158 2018-12-31  Keith Miller  <keith_miller@apple.com>
2159
2160         SourceProviders should use an actual URL instead of a string
2161         https://bugs.webkit.org/show_bug.cgi?id=192734
2162
2163         Reviewed by Yusuke Suzuki.
2164
2165         Remove ScriptSourceCode's URL member and make the url() method
2166         reference the URL on the SourceProvider. Also, avoid some
2167         ref count churn.
2168
2169         Additionally, this patch fixes an existing bug in
2170         WorkletGlobalScope() that would use a ScriptSourceCode after
2171         WTFMoving it.
2172
2173         * bindings/js/CachedScriptSourceProvider.h:
2174         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
2175         * bindings/js/ScheduledAction.cpp:
2176         (WebCore::ScheduledAction::execute):
2177         * bindings/js/ScriptController.cpp:
2178         (WebCore::ScriptController::executeScriptInWorld):
2179         (WebCore::ScriptController::executeScript):
2180         * bindings/js/ScriptSourceCode.h:
2181         (WebCore::ScriptSourceCode::ScriptSourceCode):
2182         (WebCore::ScriptSourceCode::m_code):
2183         (WebCore::ScriptSourceCode::url const):
2184         (WebCore::ScriptSourceCode::m_url): Deleted.
2185         * dom/ScriptElement.cpp:
2186         (WebCore::ScriptElement::prepareScript):
2187         (WebCore::ScriptElement::requestModuleScript):
2188         (WebCore::ScriptElement::executePendingScript):
2189         * html/HTMLMediaElement.cpp:
2190         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
2191         * page/Frame.cpp:
2192         (WebCore::Frame::injectUserScriptImmediately):
2193         * workers/WorkerGlobalScope.cpp:
2194         (WebCore::WorkerGlobalScope::importScripts):
2195         * workers/WorkerThread.cpp:
2196         (WebCore::WorkerThread::workerThread):
2197         * worklets/WorkletGlobalScope.cpp:
2198         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
2199         * xml/parser/XMLDocumentParserLibxml2.cpp:
2200         (WebCore::XMLDocumentParser::endElementNs):
2201
2202 2019-01-01  Jeff Miller  <jeffm@apple.com>
2203
2204         Update user-visible copyright strings to include 2019
2205         https://bugs.webkit.org/show_bug.cgi?id=192811
2206
2207         Reviewed by Mark Lam.
2208
2209         * Info.plist:
2210
2211 2018-12-30  David Kilzer  <ddkilzer@apple.com>
2212
2213         clang-tidy: Save 8 padding bytes on WebCore::BorderEdge
2214         <https://webkit.org/b/193058>
2215         <rdar://problem/46979275>
2216
2217         Reviewed by Yusuke Suzuki.
2218
2219         * rendering/BorderEdge.cpp:
2220         (WebCore::BorderEdge::BorderEdge): Reorder initialization to
2221         match new instance variable order.
2222         * rendering/BorderEdge.h: Reorder instance variables to save
2223         8 padding bytes.
2224
2225 2018-12-28  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2226
2227         [JSC] Remove one indirection in JSObject::toStringName
2228         https://bugs.webkit.org/show_bug.cgi?id=193037
2229
2230         Reviewed by Keith Miller.
2231
2232         Use old JSObject::toStringName function here.
2233
2234         * bindings/js/JSDOMConstructorBase.cpp:
2235         (WebCore::JSDOMConstructorBase::className):
2236         (WebCore::JSDOMConstructorBase::toStringName):
2237         * bindings/js/JSDOMConstructorBase.h:
2238         (WebCore::JSDOMConstructorBase::className): Deleted.
2239
2240 2018-12-27  Alex Christensen  <achristensen@webkit.org>
2241
2242         Resurrect Mac CMake build
2243         https://bugs.webkit.org/show_bug.cgi?id=192658
2244
2245         Reviewed by Yusuke Suzuki.
2246
2247         This makes it so JSC and most of WebCore builds.
2248         WebCore's use of ARC seems inconsistent, so I'll fix that later.
2249
2250         * PlatformMac.cmake:
2251         * config.h:
2252
2253 2018-12-26  Jim Mason  <jmason@ibinx.com>
2254
2255         [FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
2256         https://bugs.webkit.org/show_bug.cgi?id=193036
2257
2258         Reviewed by Michael Catanzaro.
2259
2260         * platform/graphics/FontPlatformData.h:
2261         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2262
2263 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2264
2265         Remove "using namespace std;"
2266         https://bugs.webkit.org/show_bug.cgi?id=192973
2267         <rdar://problem/46937309>
2268
2269         Unreviewed Windows port Debug builds fix.
2270
2271         No new tests since no behavior changes.
2272
2273         * accessibility/win/AXObjectCacheWin.cpp:
2274         (WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro.
2275
2276 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2277
2278         Remove "using namespace std;"
2279         https://bugs.webkit.org/show_bug.cgi?id=192973
2280
2281         Reviewed by Alex Christensen.
2282
2283         Removed "using namespace std" statement, and use std:: prefix.
2284
2285         No new tests since no behavior changes.
2286
2287         * accessibility/win/AXObjectCacheWin.cpp:
2288         * platform/graphics/GraphicsContext3DPrivate.cpp:
2289         * platform/graphics/cairo/ImageBufferCairo.cpp:
2290         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
2291         * platform/graphics/win/FontWin.cpp:
2292         (WebCore::FontCascade::floatWidthForComplexText const):
2293         * platform/graphics/win/GraphicsContextCGWin.cpp:
2294         * platform/graphics/win/GraphicsContextCairoWin.cpp:
2295         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2296         * platform/graphics/win/GraphicsContextWin.cpp:
2297         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2298         * platform/graphics/win/UniscribeController.cpp:
2299         (WebCore::UniscribeController::UniscribeController):
2300         (WebCore::UniscribeController::shapeAndPlaceItem):
2301         * platform/image-decoders/ScalableImageDecoder.cpp:
2302         * platform/text/LocaleICU.cpp:
2303         * platform/text/win/LocaleWin.cpp:
2304         * platform/win/ScrollbarThemeWin.cpp:
2305         * rendering/RenderRubyRun.cpp:
2306         (WebCore::RenderRubyRun::layoutBlock):
2307         * rendering/RenderThemeWin.cpp:
2308         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
2309         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
2310         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const):
2311         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const):
2312         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
2313         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const):
2314         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
2315
2316 2018-12-24  Simon Fraser  <simon.fraser@apple.com>
2317
2318         Change ScrollingNodeType to an enum class
2319         https://bugs.webkit.org/show_bug.cgi?id=193009
2320
2321         Reviewed by Zalan Bujtas.
2322
2323         Change the ScrollingNodeType enum to an enum class.
2324         
2325         No behavior change.
2326
2327         * page/scrolling/AsyncScrollingCoordinator.cpp:
2328         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
2329         * page/scrolling/ScrollingCoordinator.cpp:
2330         (WebCore::operator<<):
2331         * page/scrolling/ScrollingCoordinator.h:
2332         * page/scrolling/ScrollingStateFixedNode.cpp:
2333         (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
2334         * page/scrolling/ScrollingStateNode.h:
2335         (WebCore::ScrollingStateNode::isFixedNode const):
2336         (WebCore::ScrollingStateNode::isStickyNode const):
2337         (WebCore::ScrollingStateNode::isFrameScrollingNode const):
2338         (WebCore::ScrollingStateNode::isOverflowScrollingNode const):
2339         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
2340         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
2341         * page/scrolling/ScrollingStateStickyNode.cpp:
2342         (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
2343         * page/scrolling/ScrollingStateTree.cpp:
2344         (WebCore::ScrollingStateTree::createNode):
2345         (WebCore::ScrollingStateTree::attachNode):
2346         * page/scrolling/ScrollingTreeNode.h:
2347         (WebCore::ScrollingTreeNode::isFixedNode const):
2348         (WebCore::ScrollingTreeNode::isStickyNode const):
2349         (WebCore::ScrollingTreeNode::isFrameScrollingNode const):
2350         (WebCore::ScrollingTreeNode::isOverflowScrollingNode const):
2351         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
2352         (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
2353         * page/scrolling/ios/ScrollingTreeIOS.cpp:
2354         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
2355         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
2356         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
2357         * page/scrolling/mac/ScrollingTreeMac.cpp:
2358         (ScrollingTreeMac::createScrollingTreeNode):
2359         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
2360         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
2361         * platform/graphics/GraphicsLayerClient.h:
2362         * rendering/RenderLayerCompositor.cpp:
2363         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
2364         (WebCore::scrollCoordinationRoleForNodeType):
2365         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
2366         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2367
2368 2018-12-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2369
2370         [HarfBuzz] Width not correctly reported as 0 for zero font size
2371         https://bugs.webkit.org/show_bug.cgi?id=192986
2372
2373         Reviewed by Michael Catanzaro.
2374
2375         Fixes test fast/text/font-size-zero.html
2376
2377         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2378         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
2379         size is zero.
2380
2381 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2382
2383         Use Ref<> as much as possible
2384         https://bugs.webkit.org/show_bug.cgi?id=192808
2385
2386         Reviewed by Alex Christensen.
2387
2388         * Modules/encryptedmedia/NavigatorEME.cpp:
2389         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
2390         * Modules/fetch/FetchBody.cpp:
2391         (WebCore::FetchBody::bodyAsFormData const):
2392         * Modules/geolocation/Geolocation.cpp:
2393         (WebCore::Geolocation::getCurrentPosition):
2394         (WebCore::Geolocation::watchPosition):
2395         * Modules/indexeddb/IDBDatabase.cpp:
2396         (WebCore::IDBDatabase::objectStoreNames const):
2397         * Modules/indexeddb/IDBDatabase.h:
2398         * Modules/indexeddb/IDBObjectStore.cpp:
2399         (WebCore::IDBObjectStore::indexNames const):
2400         * Modules/indexeddb/IDBObjectStore.h:
2401         * Modules/indexeddb/IDBTransaction.cpp:
2402         (WebCore::IDBTransaction::scheduleOperation):
2403         * Modules/indexeddb/IDBTransaction.h:
2404         * Modules/indexeddb/client/TransactionOperation.h:
2405         (WebCore::IDBClient::createTransactionOperation):
2406         * Modules/mediastream/MediaDevices.cpp:
2407         (WebCore::MediaDevices::getUserMedia const):
2408         (WebCore::MediaDevices::getDisplayMedia const):
2409         * Modules/mediastream/UserMediaRequest.cpp:
2410         (WebCore::UserMediaRequest::create):
2411         * Modules/mediastream/UserMediaRequest.h:
2412         * Modules/webaudio/AudioParam.cpp:
2413         (WebCore::AudioParam::calculateFinalValues):
2414         * Modules/webaudio/ScriptProcessorNode.cpp:
2415         (WebCore::ScriptProcessorNode::initialize):
2416         * Modules/webdatabase/SQLStatement.cpp:
2417         (WebCore::SQLStatement::execute):
2418         * Modules/webgpu/WebGPU.cpp:
2419         (WebCore::WebGPU::requestAdapter const):
2420         * Modules/webgpu/WebGPUAdapter.cpp:
2421         (WebCore::WebGPUAdapter::create):
2422         * Modules/webgpu/WebGPUAdapter.h:
2423         * Modules/webgpu/WebGPUBuffer.cpp:
2424         (WebCore::WebGPUBuffer::create):
2425         * Modules/webgpu/WebGPUBuffer.h:
2426         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2427         (WebCore::WebGPUCommandBuffer::create):
2428         (WebCore::WebGPUCommandBuffer::beginRenderPass):
2429         * Modules/webgpu/WebGPUCommandBuffer.h:
2430         * Modules/webgpu/WebGPUDevice.cpp:
2431         (WebCore::WebGPUDevice::create):
2432         (WebCore::WebGPUDevice::createBuffer const):
2433         (WebCore::WebGPUDevice::createShaderModule const):
2434         (WebCore::WebGPUDevice::createRenderPipeline const):
2435         (WebCore::WebGPUDevice::createCommandBuffer const):
2436         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2437         (WebCore::WebGPURenderPassEncoder::create):
2438         * Modules/webgpu/WebGPURenderPassEncoder.h:
2439         * Modules/webgpu/WebGPURenderPipeline.cpp:
2440         (WebCore::WebGPURenderPipeline::create):
2441         * Modules/webgpu/WebGPURenderPipeline.h:
2442         * Modules/webgpu/WebGPUShaderModule.cpp:
2443         (WebCore::WebGPUShaderModule::create):
2444         * Modules/webgpu/WebGPUShaderModule.h:
2445         * Modules/webgpu/WebGPUTexture.cpp:
2446         (WebCore::WebGPUTexture::createDefaultTextureView):
2447         * Modules/webgpu/WebGPUTextureView.cpp:
2448         (WebCore::WebGPUTextureView::create):
2449         * Modules/webgpu/WebGPUTextureView.h:
2450         * accessibility/AXObjectCache.cpp:
2451         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
2452         * accessibility/atk/AXObjectCacheAtk.cpp:
2453         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
2454         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
2455         (webkitAccessibleHyperlinkGetStartIndex):
2456         (webkitAccessibleHyperlinkGetEndIndex):
2457         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2458         (getSelectionOffsetsForObject):
2459         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2460         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
2461         * bindings/js/JSDOMGlobalObjectTask.cpp:
2462         * bindings/js/JSDOMWindowBase.cpp:
2463         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
2464         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2465         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
2466         * bindings/js/ScriptControllerMac.mm:
2467         (WebCore::ScriptController::createScriptInstanceForWidget):
2468         * bindings/js/SerializedScriptValue.cpp:
2469         (WebCore::CloneDeserializer::readTerminal):
2470         (WebCore::SerializedScriptValue::create):
2471         * bridge/objc/objc_instance.h:
2472         * bridge/objc/objc_instance.mm:
2473         (ObjcInstance::create):
2474         * css/CSSComputedStyleDeclaration.cpp:
2475         (WebCore::ComputedStyleExtractor::currentColorOrValidColor const):
2476         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
2477         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
2478         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
2479         * css/CSSComputedStyleDeclaration.h:
2480         * css/CSSFontFaceSource.cpp:
2481         (WebCore::CSSFontFaceSource::load):
2482         * css/CSSStyleSheet.cpp:
2483         (WebCore::CSSStyleSheet::rules):
2484         * css/FontFace.cpp:
2485         (WebCore::FontFace::unicodeRange const):
2486         (WebCore::FontFace::featureSettings const):
2487         * css/InspectorCSSOMWrappers.cpp:
2488         (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
2489         * css/SVGCSSComputedStyleDeclaration.cpp:
2490         (WebCore::strokeDashArrayToCSSValueList):
2491         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
2492         * css/StyleResolver.cpp:
2493         (WebCore::StyleResolver::createFilterOperations):
2494         * css/StyleRule.cpp:
2495         (WebCore::StyleRuleBase::createCSSOMWrapper const):
2496         * css/StyleRule.h:
2497         * dom/ChildListMutationScope.cpp:
2498         (WebCore::ChildListMutationAccumulator::getOrCreate):
2499         * dom/ChildListMutationScope.h:
2500         * dom/DocumentMarkerController.cpp:
2501         (WebCore::updateRenderedRectsForMarker):
2502         * dom/InlineStyleSheetOwner.cpp:
2503         (WebCore::InlineStyleSheetOwner::createSheet):
2504         * dom/PointerEvent.h:
2505         * dom/UserGestureIndicator.h:
2506         (WebCore::UserGestureToken::create):
2507         * editing/AlternativeTextController.cpp:
2508         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2509         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
2510         (WebCore::AlternativeTextController::respondToUnappliedEditing):
2511         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
2512         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
2513         * editing/ApplyStyleCommand.cpp:
2514         (WebCore::ApplyStyleCommand::applyBlockStyle):
2515         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
2516         * editing/CompositeEditCommand.cpp:
2517         (WebCore::CompositeEditCommand::targetRanges const):
2518         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
2519         (WebCore::CompositeEditCommand::moveParagraphs):
2520         * editing/DeleteSelectionCommand.cpp:
2521         (WebCore::DeleteSelectionCommand::mergeParagraphs):
2522         * editing/Editing.cpp:
2523         (WebCore::visiblePositionForIndexUsingCharacterIterator):
2524         * editing/EditingStyle.cpp:
2525         (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
2526         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
2527         (WebCore::EditingStyle::prepareToApplyAt):
2528         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
2529         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
2530         (WebCore::EditingStyle::removeStyleFromRulesAndContext):
2531         (WebCore::extractPropertiesNotIn):
2532         * editing/Editor.cpp:
2533         (WebCore::Editor::setBaseWritingDirection):
2534         (WebCore::Editor::setComposition):
2535         * editing/EditorCommand.cpp:
2536         (WebCore::executeApplyParagraphStyle):
2537         (WebCore::executeMakeTextWritingDirectionLeftToRight):
2538         (WebCore::executeMakeTextWritingDirectionNatural):
2539         (WebCore::executeMakeTextWritingDirectionRightToLeft):
2540         * editing/FormatBlockCommand.cpp:
2541         (WebCore::FormatBlockCommand::formatRange):
2542         * editing/RemoveFormatCommand.cpp:
2543         (WebCore::RemoveFormatCommand::doApply):
2544         * editing/ReplaceRangeWithTextCommand.cpp:
2545         (WebCore::ReplaceRangeWithTextCommand::targetRanges const):
2546         * editing/ReplaceSelectionCommand.cpp:
2547         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
2548         (WebCore::handleStyleSpansBeforeInsertion):
2549         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
2550         * editing/SpellingCorrectionCommand.cpp:
2551         (WebCore::SpellingCorrectionCommand::targetRanges const):
2552         * editing/TextCheckingHelper.cpp:
2553         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
2554         * editing/TypingCommand.cpp:
2555         (WebCore::TypingCommand::insertText):
2556         (WebCore::TypingCommand::willAddTypingToOpenCommand):
2557         * editing/VisibleUnits.cpp:
2558         (WebCore::distanceBetweenPositions):
2559         * editing/cocoa/EditorCocoa.mm:
2560         (WebCore::Editor::selectionInWebArchiveFormat):
2561         * editing/ios/DictationCommandIOS.cpp:
2562         (WebCore::DictationCommandIOS::doApply):
2563         * editing/ios/EditorIOS.mm:
2564         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
2565         (WebCore::Editor::removeUnchangeableStyles):
2566         (WebCore::Editor::writeImageToPasteboard):
2567         * editing/mac/EditorMac.mm:
2568         (WebCore::Editor::replaceNodeFromPasteboard):
2569         (WebCore::Editor::imageInWebArchiveFormat):
2570         * editing/markup.cpp:
2571         (WebCore::styleFromMatchedRulesAndInlineDecl):
2572         (WebCore::createFragmentForTransformToFragment):
2573         * fileapi/FileReaderLoader.cpp:
2574         (WebCore::FileReaderLoader::didFinishLoading):
2575         * html/FTPDirectoryDocument.cpp:
2576         (WebCore::createTemplateDocumentData):
2577         * html/HTMLMediaElement.cpp:
2578         (WebCore::HTMLMediaElement::scheduleEvent):
2579         (WebCore::HTMLMediaElement::createMediaControls):
2580         * html/HTMLTableElement.cpp:
2581         (WebCore::HTMLTableElement::createSharedCellStyle):
2582         * html/HTMLTableElement.h:
2583         * html/URLUtils.h:
2584         (WebCore::URLUtils<T>::origin const):
2585         * html/parser/HTMLConstructionSite.cpp:
2586         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
2587         * html/shadow/TextControlInnerElements.cpp:
2588         (WebCore::TextControlInnerElement::resolveCustomStyle):
2589         * html/track/WebVTTParser.cpp:
2590         (WebCore::WebVTTParser::createNewCue):
2591         * inspector/DOMPatchSupport.cpp:
2592         * inspector/InspectorCanvas.cpp:
2593         (WebCore::InspectorCanvas::buildInitialState):
2594         (WebCore::InspectorCanvas::buildAction):
2595         * inspector/InspectorFrontendClientLocal.cpp:
2596         (WebCore::InspectorFrontendClientLocal::openInNewTab):
2597         * inspector/InspectorStyleSheet.cpp:
2598         (WebCore::asCSSRuleList):
2599         (WebCore::InspectorStyle::styleWithProperties const):
2600         (WebCore::InspectorStyleSheet::ensureSourceData):
2601         * inspector/agents/InspectorCanvasAgent.cpp:
2602         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
2603         * inspector/agents/InspectorIndexedDBAgent.cpp:
2604         (WebCore::Inspector::keyPathFromIDBKeyPath):
2605         * inspector/agents/InspectorPageAgent.cpp:
2606         (WebCore::InspectorPageAgent::archive):
2607         * loader/EmptyClients.cpp:
2608         (WebCore::EmptyStorageNamespaceProvider::createSessionStorageNamespace):
2609         (WebCore::EmptyStorageNamespaceProvider::createLocalStorageNamespace):
2610         (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
2611         (WebCore::EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace):
2612         * loader/FrameLoader.cpp:
2613         (WebCore::FrameLoader::loadURL):
2614         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
2615         (WebCore::FrameLoader::loadDifferentDocumentItem):
2616         * loader/WorkerThreadableLoader.cpp:
2617         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
2618         * loader/archive/mhtml/MHTMLParser.cpp:
2619         (WebCore::MHTMLParser::addResourceToArchive):
2620         (WebCore::MHTMLParser::parseNextPart):
2621         * loader/cache/MemoryCache.cpp:
2622         (WebCore::MemoryCache::addImageToCache):
2623         (WebCore::MemoryCache::removeResourcesWithOrigin):
2624         * page/DOMWindow.cpp:
2625         (WebCore::DOMWindow::getMatchedCSSRules const):
2626         (WebCore::DOMWindow::createWindow):
2627         * page/EventHandler.cpp:
2628         (WebCore::textDistance):
2629         * page/Page.cpp:
2630         (WebCore::Page::userStyleSheet const):
2631         * page/animation/CSSPropertyAnimation.cpp:
2632         (WebCore::blendFilterOperations):
2633         * page/ios/FrameIOS.mm:
2634         (WebCore::Frame::initWithSimpleHTMLDocument):
2635         (WebCore::Frame::interpretationsForCurrentRoot const):
2636         * page/mac/ServicesOverlayController.mm:
2637         (WebCore::ServicesOverlayController::Highlight::fadeIn):
2638         (WebCore::ServicesOverlayController::Highlight::fadeOut):
2639         * platform/SharedBuffer.cpp:
2640         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
2641         * platform/audio/HRTFElevation.cpp:
2642         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
2643         * platform/audio/SincResampler.cpp:
2644         (WebCore::SincResampler::consumeSource):
2645         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
2646         (WebCore::AudioFileReader::createBus):
2647         * platform/audio/mac/AudioFileReaderMac.cpp:
2648         (WebCore::AudioFileReader::createBus):
2649         * platform/graphics/Icon.h:
2650         (WebCore::Icon::create):
2651         * platform/graphics/InbandTextTrackPrivate.h:
2652         (WebCore::InbandTextTrackPrivate::create):
2653         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2654         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
2655         * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
2656         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2657         (WebCore::fulfillRequestWithKeyData):
2658         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2659         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2660         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2661         (WebCore::MediaSourcePrivateAVFObjC::create):
2662         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
2663         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2664         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2665         (WebCore::SourceBufferPrivateAVFObjC::create):
2666         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
2667         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
2668         * platform/graphics/ca/TileController.cpp:
2669         (WebCore::TileController::createTileLayer):
2670         * platform/graphics/ca/TileController.h:
2671         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2672         (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
2673         (WebCore::CACFLayerTreeHost::create):
2674         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2675         (WebCore::GPUBuffer::create):
2676         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2677         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
2678         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
2679         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
2680         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
2681         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2682         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
2683         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
2684         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2685         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
2686         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2687         (WebCore::AppendPipeline::appsinkNewSample):
2688         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
2689         (WebCore::ISOProtectionSystemSpecificHeaderBox::parse):
2690         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
2691         (WebCore::ISOTrackEncryptionBox::parse):
2692         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2693         (WebCore::applyFilterAnimation):
2694         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2695         (WebCore::TextureMapperPlatformLayerBuffer::clone):
2696         * platform/graphics/transforms/TransformOperations.cpp:
2697         (WebCore::TransformOperations::blendByMatchingOperations const):
2698         * platform/image-decoders/ico/ICOImageDecoder.cpp:
2699         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
2700         * platform/mock/mediasource/MockBox.cpp:
2701         (WebCore::MockInitializationBox::MockInitializationBox):
2702         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2703         (WebCore::MockSourceBufferPrivate::create):
2704         (WebCore::MockSourceBufferPrivate::append):
2705         * platform/mock/mediasource/MockSourceBufferPrivate.h:
2706         * platform/mock/mediasource/MockTracks.h:
2707         (WebCore::MockTextTrackPrivate::create):
2708         (WebCore::MockVideoTrackPrivate::create):
2709         * platform/network/FormData.h:
2710         (WebCore::FormData::decode):
2711         * platform/network/cocoa/CookieStorageObserver.h:
2712         * platform/network/cocoa/CookieStorageObserver.mm:
2713         (WebCore::CookieStorageObserver::create):
2714         * platform/network/soup/ResourceRequestSoup.cpp:
2715         (WebCore::appendEncodedBlobItemToSoupMessageBody):
2716         (WebCore::ResourceRequest::updateSoupMessageBody const):
2717         * platform/text/hyphen/HyphenationLibHyphen.cpp:
2718         (WebCore::HyphenationDictionary::createNull):
2719         (WebCore::HyphenationDictionary::create):
2720         * platform/win/SearchPopupMenuWin.cpp:
2721         (WebCore::SearchPopupMenuWin::SearchPopupMenuWin):
2722         (WebCore::SearchPopupMenuWin::popupMenu):
2723         * platform/win/SearchPopupMenuWin.h:
2724         * rendering/RenderThemeIOS.mm:
2725         (WebCore::applyCommonButtonPaddingToStyle):
2726         (WebCore::RenderThemeIOS::paintProgressBar):
2727         (WebCore::RenderThemeIOS::adjustButtonStyle const):
2728         (WebCore::paintAttachmentIcon):
2729         * rendering/svg/SVGRenderTreeAsText.cpp:
2730         (WebCore::writeSVGResourceContainer):
2731         * storage/Storage.cpp:
2732         (WebCore::Storage::create):
2733         (WebCore::Storage::Storage):
2734         * storage/Storage.h:
2735         (WebCore::Storage::area const):
2736         * storage/StorageNamespace.h:
2737         * storage/StorageNamespaceProvider.cpp:
2738         (WebCore::StorageNamespaceProvider::localStorageArea):
2739         * storage/StorageNamespaceProvider.h:
2740         * svg/SVGElement.cpp:
2741         (WebCore::SVGElement::getPresentationAttribute):
2742         * svg/SVGFEBlendElement.cpp:
2743         (WebCore::SVGFEBlendElement::build):
2744         * svg/SVGFEColorMatrixElement.cpp:
2745         (WebCore::SVGFEColorMatrixElement::build):
2746         * svg/SVGFEComponentTransferElement.cpp:
2747         (WebCore::SVGFEComponentTransferElement::build):
2748         * svg/SVGFECompositeElement.cpp:
2749         (WebCore::SVGFECompositeElement::build):
2750         * svg/SVGFEDiffuseLightingElement.cpp:
2751         (WebCore::SVGFEDiffuseLightingElement::build):
2752         * svg/SVGFEDisplacementMapElement.cpp:
2753         (WebCore::SVGFEDisplacementMapElement::build):
2754         * svg/SVGFEDropShadowElement.cpp:
2755         (WebCore::SVGFEDropShadowElement::build):
2756         * svg/SVGFEGaussianBlurElement.cpp:
2757         (WebCore::SVGFEGaussianBlurElement::build):
2758         * svg/SVGFEMergeElement.cpp:
2759         (WebCore::SVGFEMergeElement::build):
2760         * svg/SVGFEMorphologyElement.cpp:
2761         (WebCore::SVGFEMorphologyElement::build):
2762         * svg/SVGFEOffsetElement.cpp:
2763         (WebCore::SVGFEOffsetElement::build):
2764         * svg/SVGFESpecularLightingElement.cpp:
2765         (WebCore::SVGFESpecularLightingElement::build):
2766         * svg/SVGFETileElement.cpp:
2767         (WebCore::SVGFETileElement::build):
2768         * testing/GCObservation.h:
2769         * xml/XSLTProcessor.cpp:
2770         (WebCore::XSLTProcessor::createDocumentFromSource):
2771         * xml/parser/XMLDocumentParser.cpp:
2772         (WebCore::XMLDocumentParser::parseDocumentFragment):
2773
2774 2018-12-21  Chris Dumez  <cdumez@apple.com>
2775
2776         navigator.userAgent in service workers does not reflect customUserAgent set by client
2777         https://bugs.webkit.org/show_bug.cgi?id=192951
2778
2779         Reviewed by Youenn Fablet.
2780
2781         Whenever a service worker client registers itself, also pass its effective user agent.
2782         In the network process, for each origin, we store the latest client's user agent and
2783         use it when starting the service worker.
2784
2785         * dom/Document.cpp:
2786         (WebCore::Document::setServiceWorkerConnection):
2787         * loader/DocumentLoader.cpp:
2788         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
2789         * workers/service/SWClientConnection.h:
2790         * workers/service/server/SWServer.cpp:
2791         (WebCore::SWServer::serviceWorkerClientUserAgent const):
2792         (WebCore::SWServer::installContextData):
2793         (WebCore::SWServer::runServiceWorker):
2794         (WebCore::SWServer::registerServiceWorkerClient):
2795         * workers/service/server/SWServer.h:
2796         * workers/service/server/SWServerToContextConnection.h:
2797         * workers/service/server/SWServerWorker.cpp:
2798         (WebCore::SWServerWorker::userAgent const):
2799         * workers/service/server/SWServerWorker.h:
2800
2801 2018-12-21  Youenn Fablet  <youenn@apple.com>
2802
2803         RTCRtpSender.setParameters() does set active parameter
2804         https://bugs.webkit.org/show_bug.cgi?id=192848
2805
2806         Reviewed by Eric Carlson.
2807
2808         Covered by updated test.
2809
2810         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
2811         (WebCore::updateRTCRtpSendParameters):
2812         The routine was updating the local value, not the out parameter.
2813
2814 2018-12-21  Eric Carlson  <eric.carlson@apple.com>
2815
2816         'ended' Event doesn't fire on MediaStreamTrack when a USB camera is unplugged
2817         https://bugs.webkit.org/show_bug.cgi?id=187896
2818         <rdar://problem/42681445>
2819
2820         Reviewed by Jer Noble.
2821
2822         No new tests, tested manually.
2823
2824         * platform/mediastream/mac/AVVideoCaptureSource.h:
2825         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2826         (WebCore::AVVideoCaptureSource::deviceDisconnected):
2827         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
2828         (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
2829         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
2830         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
2831         (WebCore::deviceHasInputStreams):
2832         (WebCore::isValidCaptureDevice):
2833         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
2834         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
2835         (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Deleted.
2836         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
2837         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2838         (WebCore::CoreAudioSharedUnit::setCaptureDevice):
2839         (WebCore::CoreAudioSharedUnit::devicesChanged):
2840         (WebCore::CoreAudioSharedUnit::startProducingData):
2841         (WebCore::CoreAudioSharedUnit::startInternal):
2842         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
2843         (WebCore::CoreAudioSharedUnit::captureFailed):
2844         (WebCore::CoreAudioCaptureSourceFactory::devicesChanged):
2845         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
2846         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID): Deleted.
2847         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2848
2849 2018-12-20  Ryosuke Niwa  <rniwa@webkit.org>
2850
2851         REGRESSION(r239353): iOS WK1 Assertion failure in notifyChildNodeRemoved while running
2852         TestWebKitAPI.QuickLook.LegacyQuickLookContent
2853         https://bugs.webkit.org/show_bug.cgi?id=192859
2854         <rdar://problem/46887237>
2855
2856         Reviewed by Antti Koivisto.
2857
2858         After r239353, ScriptDisallowedScope::InMainThread::isScriptAllowed() may return false when the web thread
2859         is inside a delegate callback even when there is a ScriptDisallowedScope defined.
2860
2861         Replace the existign debug assertions which assert !ScriptDisallowedScope::InMainThread::isScriptAllowed()
2862         by a newly added ScriptDisallowedScope::InMainThread::hasDisallowedScope to avoid hitting this assertion.
2863
2864         Tests: TestWebKitAPI.QuickLook.LegacyQuickLookContent
2865
2866         * dom/ContainerNodeAlgorithms.cpp:
2867         (WebCore::notifyChildNodeInserted):
2868         (WebCore::notifyChildNodeRemoved):
2869         * dom/Document.cpp:
2870         (WebCore::Document::nodeChildrenWillBeRemoved):
2871         (WebCore::Document::nodeWillBeRemoved):
2872         * dom/ScriptDisallowedScope.h:
2873         (WebCore::ScriptDisallowedScope::InMainThread::hasDisallowedScope):
2874         * html/HTMLFormElement.cpp:
2875         (WebCore:: const):
2876
2877 2018-12-21  Joseph Pecoraro  <pecoraro@apple.com>
2878
2879         Update status of some WebCore features in features.json
2880         https://bugs.webkit.org/show_bug.cgi?id=192998
2881
2882         Reviewed by Tim Horton.
2883
2884         * features.json:
2885         - Variation Fonts: Supported
2886         - Conic Gradients: Supported in Preview
2887         - Web Share: Supported in Preview
2888         - <datalist>: Supported in Preview
2889         - Intersection Observers: Supported in Preview
2890
2891 2018-12-21  Zalan Bujtas  <zalan@apple.com>
2892
2893         [iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIconDecorations()
2894         https://bugs.webkit.org/show_bug.cgi?id=192357
2895         <rdar://problem/42852260>
2896
2897         Reviewed by Simon Fraser.
2898
2899         Do not try to paint the file picker when painting is disabled.
2900
2901         * rendering/RenderFileUploadControl.cpp:
2902         (WebCore::RenderFileUploadControl::paintObject):
2903
2904 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
2905
2906         [WebAuthN] userPresence should always be true
2907         https://bugs.webkit.org/show_bug.cgi?id=192835
2908         <rdar://problem/46538788>
2909
2910         Reviewed by Brent Fulgham.
2911
2912         In the current spec as of 7 August 2018, userPresence is suggested to set to the inverse of userVerification.
2913         This doesn't comply with the CTAP spec. Details in: https://github.com/w3c/webauthn/issues/1123.
2914         After discussing with other members of the working group, we decided to make userPresence always default to true.
2915
2916         Covered by exisiting tests.
2917
2918         * Modules/webauthn/fido/DeviceRequestConverter.cpp:
2919         (fido::encodeGetAssertionRequestAsCBOR):
2920
2921 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
2922
2923         [WebAuthN] Import an APDU coder from Chromium
2924         https://bugs.webkit.org/show_bug.cgi?id=192949
2925         <rdar://problem/46879933>
2926
2927         Reviewed by Brent Fulgham.
2928
2929         This patch imports an APDU coder from Chromium. Here is the documentation:
2930         https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing
2931         APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2.
2932
2933         Here is a list of files that are imported from Chromium:
2934         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090
2935         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
2936         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
2937         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
2938         https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
2939
2940         Covered by API tests.
2941
2942         * Modules/webauthn/apdu/ApduCommand.cpp: Added.
2943         (apdu::ApduCommand::createFromMessage):
2944         (apdu::ApduCommand::ApduCommand):
2945         (apdu::ApduCommand::getEncodedCommand const):
2946         * Modules/webauthn/apdu/ApduCommand.h: Added.
2947         * Modules/webauthn/apdu/ApduResponse.cpp: Added.
2948         (apdu::ApduResponse::createFromMessage):
2949         (apdu::ApduResponse::ApduResponse):
2950         (apdu::ApduResponse::getEncodedResponse const):
2951         * Modules/webauthn/apdu/ApduResponse.h: Added.
2952         * Sources.txt:
2953         * WebCore.xcodeproj/project.pbxproj:
2954
2955 2018-12-21  Jer Noble  <jer.noble@apple.com>
2956
2957         Convert raw CDMSessionMediaSourceAVFObjC pointer in MediaPlayerPrivateMediaSourceAVFObjC
2958         https://bugs.webkit.org/show_bug.cgi?id=192985
2959         <rdar://problem/46750743>
2960
2961         Reviewed by Eric Carlson.
2962
2963         Make m_session a RefPtr; drive-by fix: make m_mediaElement in WebKitMediaKeys a WeakPtr.
2964
2965         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
2966         (WebCore::WebKitMediaKeys::setMediaElement):
2967         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
2968         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
2969         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2970         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2971         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2972         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
2973
2974 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
2975
2976         CSS variables don't work for colors in "border" property
2977         https://bugs.webkit.org/show_bug.cgi?id=192922
2978
2979         Reviewed by Simon Fraser.
2980
2981         ParseColorFunction no longer consumes anything if the color was not valid.
2982
2983         Test: css-custom-properties-api/border-variable-parsing.html
2984
2985         * css/parser/CSSPropertyParserHelpers.cpp:
2986         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
2987
2988 2018-12-21  Justin Fan  <justin_fan@apple.com>
2989
2990         [WebGPU] GPUBindGroupLayout refactoring: no HashMap, and failure logging
2991         https://bugs.webkit.org/show_bug.cgi?id=192990
2992
2993         Reviewed by Myles C. Maxfield.
2994
2995         Refactor away the unnecessary HashMaps when creating MTLArgumentEncoders in GPUBindGroupLayout creation.
2996         Also update GPUBindGroupLayout::create -> tryCreate, in order to better handle Objective-C exceptions.
2997
2998         No new tests; no change in behavior.
2999
3000         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
3001         (WebCore::WebGPUBindGroupLayout::create):
3002         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
3003         * Modules/webgpu/WebGPUBindGroupLayout.h:
3004         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const):
3005         * Modules/webgpu/WebGPUDevice.cpp:
3006         (WebCore::WebGPUDevice::createBindGroupLayout const):
3007         * platform/graphics/gpu/GPUBindGroupLayout.h:
3008         * platform/graphics/gpu/GPUDevice.cpp:
3009         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Renamed from ::create*. Now returning a RefPtr. 
3010         (WebCore::GPUDevice::createBindGroupLayout const): Deleted.
3011         * platform/graphics/gpu/GPUDevice.h:
3012         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
3013         (WebCore::appendArgumentToArray):
3014         (WebCore::newEncoder):
3015         (WebCore::GPUBindGroupLayout::tryCreate): Renamed from ::create. Now returning a RefPtr.
3016         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
3017         (WebCore::appendArgumentToArrayInMap): Deleted.
3018         (WebCore::GPUBindGroupLayout::create): Deleted.
3019
3020         Deleted unneeded GPUBindGroupLayout.cpp:
3021         * Sources.txt:
3022         * WebCore.xcodeproj/project.pbxproj:
3023         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Removed.
3024
3025 2018-12-21  Alejandro G. Castro  <alex@igalia.com>
3026
3027         [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
3028         https://bugs.webkit.org/show_bug.cgi?id=190466
3029
3030         Reviewed by Youenn Fablet.
3031
3032         Added persistency to the DeviceIdHashSaltStorage.
3033
3034         * platform/glib/FileSystemGlib.cpp:
3035         (WebCore::FileSystem::getFileSize): Implemented this function to
3036         allow sharing code with the statistics storage class.
3037         * platform/glib/KeyedDecoderGlib.cpp:
3038         (WebCore::KeyedDecoderGlib::dictionaryFromGVariant): Added a
3039         condition to control situations where the key is empty, it can
3040         happen if the user modifies the file in the disk.
3041         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: Add include
3042         to make work compilation with debug, unified builds.
3043
3044 2018-12-21  Zalan Bujtas  <zalan@apple.com>
3045
3046         Synchronous media query evaluation could destroy current Frame/FrameView.
3047         https://bugs.webkit.org/show_bug.cgi?id=192781
3048         <rdar://problem/34416793>
3049
3050         Reviewed by Chris Dumez.
3051
3052         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
3053
3054         Test: printing/print-with-media-query-destory.html
3055
3056         * loader/DocumentLoader.cpp:
3057         (WebCore::DocumentLoader::finishedLoading):
3058         * page/Frame.cpp:
3059         (WebCore::Frame::setPrinting):
3060         * page/FrameView.cpp:
3061         (WebCore::FrameView::forceLayoutForPagination):
3062         * page/PrintContext.cpp:
3063         (WebCore::PrintContext::PrintContext):
3064         (WebCore::PrintContext::computePageRects):
3065         (WebCore::PrintContext::computePageRectsWithPageSizeInternal):
3066         (WebCore::PrintContext::begin):
3067         (WebCore::PrintContext::computeAutomaticScaleFactor):
3068         (WebCore::PrintContext::spoolPage):
3069         (WebCore::PrintContext::spoolRect):
3070         (WebCore::PrintContext::end):
3071         * page/PrintContext.h:
3072         (WebCore::PrintContext::frame const): Deleted.
3073
3074 2018-12-21  Wenson Hsieh  <wenson_hsieh@apple.com>
3075
3076         Setting the file wrapper and content type of an attachment to a PDF should update its image
3077         https://bugs.webkit.org/show_bug.cgi?id=192984
3078         <rdar://problem/46798028>
3079
3080         Reviewed by Tim Horton.
3081
3082         Allow PDF data to be used to update enclosing image elements when setting the file wrapper for an attachment.
3083         Covered by a new API test: WKAttachmentTests.SetFileWrapperForPDFImageAttachment.
3084
3085         * html/HTMLAttachmentElement.cpp:
3086         (WebCore::mimeTypeIsSuitableForInlineImageAttachment):
3087         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
3088
3089 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
3090
3091         Repeated background images with zero size should display the background color
3092         https://bugs.webkit.org/show_bug.cgi?id=192962
3093
3094         Reviewed by Antti Koivisto.
3095
3096         Test: fast/backgrounds/background-repeat-with-zero-size.html
3097
3098         * platform/LengthSize.h:
3099         (WebCore::LengthSize::isEmpty const):
3100         * rendering/RenderBoxModelObject.cpp:
3101         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3102         * rendering/style/FillLayer.h:
3103         (WebCore::FillLayer::isEmpty const):
3104
3105 2018-12-21  Manuel Rego Casasnovas  <rego@igalia.com>
3106
3107         [css-grid] Fix percentages in relative offsets for grid items
3108         https://bugs.webkit.org/show_bug.cgi?id=190492
3109
3110         Reviewed by Sergio Villar Senin.
3111
3112         The method RenderBoxModelObject::relativePositionOffset() was not considering the case of grid items,
3113         where the containing block is the grid area.
3114         The patch modifies the method so the new code uses overrideContainingBlockContentWidth|Height when required.
3115
3116         Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html
3117
3118         * rendering/RenderBox.cpp: Implement the physical versions of the already existent methods.
3119         (WebCore::RenderBox::overrideContainingBlockContentWidth const):
3120         (WebCore::RenderBox::overrideContainingBlockContentHeight const):
3121         (WebCore::RenderBox::hasOverrideContainingBlockContentWidth const):
3122         (WebCore::RenderBox::hasOverrideContainingBlockContentHeight const):
3123         * rendering/RenderBox.h:
3124         * rendering/RenderBoxModelObject.cpp:
3125         (WebCore::RenderBoxModelObject::relativePositionOffset const): Modified method
3126         to take into account overrideContainingBlockContentWidth|Height for grid items.
3127         * rendering/RenderBoxModelObject.h: Added new headers for physical virtual methods
3128         that will be overridden in RenderBox.
3129         (WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const):
3130         (WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const):
3131         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const):
3132         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const):
3133
3134 2018-12-20  Justin Fan  <justin_fan@apple.com>
3135
3136         [WebGPU] Convert WebGPUBindGroups into MTLArgumentEncoders
3137         https://bugs.webkit.org/show_bug.cgi?id=192956
3138
3139         Reviewed by Myles Maxfield.
3140
3141         No testable behavior change. Existing tests cover possible crashing.
3142
3143         Add GPUBindGroupLayoutMetal.mm:
3144         * SourcesCocoa.txt:
3145         * WebCore.xcodeproj/project.pbxproj:
3146
3147         Flesh out GPUBindGroupLayout::create:
3148         * platform/graphics/gpu/GPUBindGroupLayout.cpp:
3149         * platform/graphics/gpu/GPUBindGroupLayout.h:
3150         * platform/graphics/gpu/GPUDevice.cpp:
3151         (WebCore::GPUDevice::createBindGroupLayout const):
3152         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Added.
3153         (WebCore::appendArgumentToArrayInMap): Added.
3154         (WebCore::GPUBindGroupLayout::create):
3155         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
3156         (WebCore::MTLDataTypeForBindingType): Added.
3157
3158 2018-12-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3159
3160         Unreviewed, remove stray #pragma once added to .cpp file
3161
3162         * svg/properties/SVGAttributeOwnerProxy.cpp:
3163
3164 2018-12-20  Justin Michaud  <justin_michaud@apple.com>
3165
3166         Adding runtime-enabled attribute to Element prevents inlining property access
3167         https://bugs.webkit.org/show_bug.cgi?id=192901
3168
3169         Add a call to flattenDictionaryObject after disabling runtime-enabled attributes.
3170
3171         Reviewed by Ryosuke Niwa.
3172
3173         * bindings/scripts/CodeGeneratorJS.pm:
3174         (GenerateImplementation):
3175         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3176         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
3177         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3178         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
3179         * bindings/scripts/test/JS/JSTestNode.cpp:
3180         (WebCore::JSTestNodePrototype::finishCreation):
3181         * bindings/scripts/test/JS/JSTestObj.cpp:
3182         (WebCore::JSTestObjPrototype::finishCreation):
3183
3184 2018-12-20  Chris Dumez  <cdumez@apple.com>
3185
3186         Use Optional::hasValue() instead of Optional::has_value()
3187         https://bugs.webkit.org/show_bug.cgi?id=192948
3188
3189         Reviewed by Tim Horton.
3190
3191         * bindings/js/DOMPromiseProxy.h:
3192         (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const):
3193         (WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const):
3194         (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const):
3195         * dom/DataTransferItemList.h:
3196         (WebCore::DataTransferItemList::hasItems const):
3197         * dom/EventTarget.cpp:
3198         (WebCore::EventTarget::addEventListener):
3199         * html/HTMLMediaElement.cpp:
3200         (WebCore::HTMLMediaElement::captionDisplayMode):
3201         * platform/graphics/MediaPlayer.cpp:
3202         (WebCore::MediaPlayer::wouldTaintOrigin const):
3203         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3204         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
3205         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3206         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
3207         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
3208         (webKitMediaSrcUpdatePresentationSize):
3209         * platform/mac/NSScrollerImpDetails.mm:
3210         (WebCore::ScrollerStyle::recommendedScrollerStyle):
3211         * rendering/RenderListItem.cpp:
3212         (WebCore::RenderListItem::setExplicitValue):
3213
3214 2018-12-20  Chris Dumez  <cdumez@apple.com>
3215
3216         Move HTTPS_UPGRADE code behind a runtime flag, off by default
3217         https://bugs.webkit.org/show_bug.cgi?id=192937
3218
3219         Reviewed by Youenn Fablet.
3220
3221         Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
3222
3223         * page/Settings.yaml:
3224
3225 2018-12-20  Youenn Fablet  <youenn@apple.com>
3226
3227         Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader
3228         https://bugs.webkit.org/show_bug.cgi?id=192838
3229
3230         Reviewed by Chris Dumez.
3231
3232         Generate constructor code in case of a Private but not Public constructor.
3233         Make sure this is correctly exposed in global objects.
3234         Add JS built-in constructor implementations for those two objects.
3235
3236         Also add JS built-in constructors for controller and byob request.
3237         To keep existing behavior, JS built-ins calling these constructors need to pass
3238         an additional parameter that allows making the difference between a JS builtin caller or a JS caller.
3239         In the latter case, the constructor will throw.
3240
3241         Covered by existing tests, no observable change of behavior.
3242
3243         * Modules/streams/ReadableByteStreamController.idl:
3244         * Modules/streams/ReadableByteStreamController.js:
3245         (initializeReadableByteStreamController):
3246         (getter.byobRequest):
3247         * Modules/streams/ReadableByteStreamInternals.js:
3248         (privateInitializeReadableByteStreamController): Deleted.
3249         (privateInitializeReadableStreamBYOBRequest): Deleted.
3250         * Modules/streams/ReadableStream.js:
3251         (initializeReadableStream):
3252         * Modules/streams/ReadableStreamBYOBReader.js:
3253         (initializeReadableStreamBYOBReader):
3254         * Modules/streams/ReadableStreamBYOBRequest.idl:
3255         * Modules/streams/ReadableStreamBYOBRequest.js:
3256         (initializeReadableStreamBYOBRequest):
3257         * Modules/streams/ReadableStreamDefaultController.idl:
3258         * Modules/streams/ReadableStreamDefaultController.js:
3259         (initializeReadableStreamDefaultController):
3260         (enqueue):
3261         * Modules/streams/ReadableStreamDefaultReader.js:
3262         (initializeReadableStreamDefaultReader):
3263         * Modules/streams/ReadableStreamInternals.js:
3264         (readableStreamDefaultControllerError): Deleted.
3265         * Sources.txt:
3266         * UnifiedSources-input.xcfilelist:
3267         * WebCore.xcodeproj/project.pbxproj:
3268         * bindings/js/JSDOMBuiltinConstructor.h:
3269         * bindings/js/JSDOMGlobalObject.cpp:
3270         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
3271         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Removed.
3272         * bindings/js/JSReadableStreamPrivateConstructors.h: Removed.
3273         * bindings/scripts/CodeGeneratorJS.pm:
3274         (GeneratePropertiesHashTable):
3275         * bindings/scripts/preprocess-idls.pl:
3276         (shouldExposeInterface):
3277
3278 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
3279
3280         [WebAuthN] Remove hash from Client Data
3281         https://bugs.webkit.org/show_bug.cgi?id=192727
3282         <rdar://problem/46746673>
3283
3284         Reviewed by Brent Fulgham.
3285
3286         The hash algorithm for hashing the client data is enforced to SHA_256 in the latest spec:
3287         https://www.w3.org/TR/webauthn/#sec-client-data. Therefore, we should remove it.
3288
3289         Covered by existing tests.
3290
3291         * Modules/webauthn/AuthenticatorCoordinator.cpp:
3292         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson):
3293
3294 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
3295
3296         [WebAuthN] Add a runtime flag for local authenticator
3297         https://bugs.webkit.org/show_bug.cgi?id=192792
3298         <rdar://problem/46798738>
3299
3300         Reviewed by Brent Fulgham.
3301
3302         No tests.
3303
3304         This patch adds a runtime flag for local authenticator and removes ways to
3305         set the runtime flag for web authentication in LegacyWebKit.
3306
3307         * page/RuntimeEnabledFeatures.h:
3308         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled):
3309         (WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const):
3310
3311 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
3312
3313         Pointer lock causes abandoned documents
3314         https://bugs.webkit.org/show_bug.cgi?id=188727
3315         rdar://problem/44248197
3316         
3317         Reviewed by Simon Fraser.
3318
3319         Fixes --world-leaks in these tests:
3320
3321         pointer-lock/locked-element-removed-from-dom.html
3322         pointer-lock/mouse-event-delivery.html
3323         fast/shadow-dom/pointerlockelement-in-slot.html
3324
3325         PointerLockController now uses WeakPtr instead of RefPtr because it has no need to extend the lifetime of a document.
3326
3327         * page/PointerLockController.cpp:
3328         (WebCore::PointerLockController::elementRemoved):
3329         (WebCore::PointerLockController::documentDetached):
3330         (WebCore::PointerLockController::didAcquirePointerLock):
3331         * page/PointerLockController.h:
3332
3333 2018-12-20  Chris Dumez  <cdumez@apple.com>
3334
3335         Use Optional::valueOr() instead of Optional::value_or()
3336         https://bugs.webkit.org/show_bug.cgi?id=192933
3337
3338         Reviewed by Geoffrey Garen.
3339
3340         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3341         (WebCore::convert):
3342         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
3343         * Modules/encryptedmedia/MediaKeySession.cpp:
3344         (WebCore::MediaKeySession::load):
3345         * Modules/indexeddb/IDBDatabaseIdentifier.h:
3346         (WebCore::IDBDatabaseIdentifier::hash const):
3347         * Modules/indexeddb/IDBFactory.cpp:
3348         (WebCore::IDBFactory::open):
3349         * Modules/mediastream/MediaStreamTrack.cpp:
3350         (WebCore::MediaStreamTrack::applyConstraints):
3351         * Modules/mediastream/RTCDTMFSender.cpp:
3352         (WebCore::RTCDTMFSender::insertDTMF):
3353         * Modules/webdatabase/SQLTransaction.cpp:
3354         (WebCore::SQLTransaction::executeSql):
3355         * Modules/webvr/VRFrameData.cpp:
3356         (WebCore::VRFrameData::update):
3357         * animation/AnimationTimeline.cpp:
3358         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
3359         * animation/DeclarativeAnimation.cpp:
3360         (WebCore::DeclarativeAnimation::cancel):
3361         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
3362         * animation/KeyframeEffect.cpp:
3363         (WebCore::computeMissingKeyframeOffsets):
3364         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
3365         * animation/WebAnimation.cpp:
3366         (WebCore::WebAnimation::runPendingPlayTask):
3367         (WebCore::WebAnimation::runPendingPauseTask):
3368         * bindings/js/SerializedScriptValue.cpp:
3369         (WebCore::CloneSerializer::write):
3370         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
3371         (WebCore::CryptoAlgorithmHMAC::generateKey):
3372         (WebCore::CryptoAlgorithmHMAC::importKey):
3373         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
3374         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
3375         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
3376         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
3377         (WebCore::CryptoKeyRSA::importSpki):
3378         (WebCore::CryptoKeyRSA::importPkcs8):
3379         * crypto/keys/CryptoKeyRSA.cpp:
3380         (WebCore::CryptoKeyRSA::importJwk):
3381         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
3382         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
3383         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
3384         * crypto/mac/CryptoKeyRSAMac.cpp:
3385         (WebCore::CryptoKeyRSA::importSpki):
3386         (WebCore::CryptoKeyRSA::importPkcs8):
3387         * css/CSSComputedStyleDeclaration.cpp:
3388         (WebCore::counterToCSSValue):
3389         * css/CSSFontFace.cpp:
3390         (WebCore::calculateItalicRange):
3391         * css/CSSPrimitiveValue.cpp:
3392         (WebCore::CSSPrimitiveValue::doubleValue const):
3393         * css/CSSStyleSheet.cpp:
3394         (WebCore::CSSStyleSheet::addRule):
3395         * css/DOMMatrix.cpp:
3396         (WebCore::DOMMatrix::rotateSelf):
3397         * css/DOMMatrixReadOnly.cpp:
3398         (WebCore::DOMMatrixReadOnly::validateAndFixup):
3399         * css/StyleBuilderCustom.h:
3400         (WebCore::StyleBuilderCustom::applyValueCounter):
3401         * css/parser/MediaQueryParser.cpp:
3402         (WebCore::MediaQueryParser::commitMediaQuery):
3403         * dom/Document.h:
3404         (WebCore::Document::referrerPolicy const):
3405         * dom/Element.cpp:
3406         (WebCore::toScrollAlignment):
3407         * dom/EventTarget.cpp:
3408         (WebCore::EventTarget::addEventListener):
3409         * dom/MutationObserver.cpp:
3410         (WebCore::MutationObserver::observe):
3411         * editing/cocoa/FontAttributeChangesCocoa.mm:
3412         (WebCore::FontChanges::platformFontFamilyNameForCSS const):
3413         * fileapi/File.cpp:
3414         (WebCore::File::File):
3415         * html/DOMTokenList.cpp:
3416         (WebCore::DOMTokenList::toggle):
3417         * html/HTMLOListElement.h:
3418         * html/ImageBitmap.cpp:
3419         (WebCore::croppedSourceRectangleWithFormatting):
3420         * html/canvas/CanvasPattern.cpp:
3421         (WebCore::CanvasPattern::setTransform):
3422         * html/canvas/CanvasRenderingContext2DBase.cpp:
3423         (WebCore::CanvasRenderingContext2DBase::setTransform):
3424         (WebCore::CanvasRenderingContext2DBase::isPointInPathInternal):
3425         (WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal):
3426         * html/canvas/Path2D.cpp:
3427         (WebCore::Path2D::addPath):
3428         * inspector/InspectorCanvas.cpp:
3429         (WebCore::InspectorCanvas::buildAction):
3430         * inspector/InspectorFrontendHost.cpp:
3431         (WebCore::populateContextMenu):
3432         * layout/FormattingContext.cpp:
3433         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
3434         * layout/FormattingContextGeometry.cpp:
3435         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3436         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3437         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3438         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3439         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
3440         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3441         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
3442         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
3443         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
3444         * layout/FormattingContextQuirks.cpp:
3445         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
3446         * layout/MarginTypes.h:
3447         (WebCore::Layout::VerticalMargin::usedValues const):
3448         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3449         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3450         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3451         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
3452         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3453         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
3454         * layout/displaytree/DisplayBox.h:
3455         (WebCore::Display::Box::width const):
3456         (WebCore::Display::Box::height const):
3457         (WebCore::Display::Box::contentBoxTop const):
3458         (WebCore::Display::Box::contentBoxLeft const):
3459         * layout/floats/FloatingContext.cpp:
3460         (WebCore::Layout::Iterator::set):
3461         * layout/inlineformatting/InlineFormattingContext.cpp:
3462         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
3463         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
3464         * loader/FrameLoader.cpp:
3465         (WebCore::FrameLoader::urlSelected):
3466         * loader/NavigationAction.cpp:
3467         * page/FrameView.cpp:
3468         (WebCore::FrameView::setLayoutViewportOverrideRect):
3469         (WebCore::FrameView::documentToAbsoluteScaleFactor const):
3470         (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
3471         * page/Page.cpp:
3472         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
3473         * page/SecurityOriginData.cpp:
3474         (WebCore::SecurityOriginData::databaseIdentifier const):
3475         * page/SecurityOriginData.h:
3476         (WebCore::SecurityOriginDataHash::hash):
3477         * page/SecurityOriginHash.h:
3478         (WebCore::SecurityOriginHash::hash):
3479         * page/ViewportConfiguration.cpp:
3480         (WebCore::ViewportConfiguration::setViewLayoutSize):
3481         * page/WindowFeatures.cpp:
3482         (WebCore::parseDialogFeatures):
3483         * page/animation/AnimationBase.cpp:
3484         (WebCore::AnimationBase::updateStateMachine):
3485         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
3486         (WebCore::AnimationBase::getTimeToNextEvent const):
3487         (WebCore::AnimationBase::freezeAtTime):
3488         (WebCore::AnimationBase::getElapsedTime const):
3489         * page/animation/CSSAnimationController.cpp:
3490         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
3491         * page/cocoa/ResourceUsageThreadCocoa.mm:
3492         (WebCore::ResourceUsageThread::platformThreadBody):
3493         * page/linux/ResourceUsageThreadLinux.cpp:
3494         (WebCore::ResourceUsageThread::platformThreadBody):
3495         * platform/graphics/ComplexTextController.cpp:
3496         (WebCore::ComplexTextController::offsetForPosition):
3497         * platform/graphics/FontCache.h:
3498         (WebCore::FontDescriptionKey::computeHash const):
3499         * platform/graphics/FontCascade.cpp:
3500         (WebCore::FontCascade::drawText const):
3501         (WebCore::FontCascade::drawEmphasisMarks const):
3502         (WebCore::FontCascade::displayListForTextRun const):
3503         (WebCore::FontCascade::adjustSelectionRectForText const):
3504         (WebCore::FontCascade::codePath const):
3505         * platform/graphics/FontSelectionAlgorithm.cpp:
3506         (WebCore::FontSelectionAlgorithm::styleDistance const):
3507         * platform/graphics/FontSelectionAlgorithm.h:
3508         (WebCore::operator<<):
3509         (WebCore::FontSelectionSpecifiedCapabilities::computeWeight const):
3510         (WebCore::FontSelectionSpecifiedCapabilities::computeWidth const):
3511         (WebCore::FontSelectionSpecifiedCapabilities::computeSlope const):
3512         * platform/graphics/ShadowBlur.cpp:
3513         (WebCore::ShadowBlur::calculateLayerBoundingRect):
3514         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
3515         (WebCore::WebCoreAVCFResourceLoader::startLoading):
3516         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3517         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
3518         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3519         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
3520         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3521         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
3522         * platform/graphics/ca/GraphicsLayerCA.cpp:
3523         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
3524         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3525         (WebCore::preparePlatformFont):
3526         * platform/graphics/filters/FETurbulence.cpp:
3527         (WebCore::FETurbulence::fillRegion const):
3528         * platform/graphics/gstreamer/GStreamerCommon.cpp:
3529         (WebCore::initializeGStreamer):
3530         * platform/graphics/texmap/TextureMapperLayer.cpp:
3531         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
3532         (WebCore::TextureMapperLayer::replicaTransform):
3533         (WebCore::TextureMapperLayer::syncAnimations):
3534         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3535         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
3536         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
3537         * platform/graphics/transforms/TransformState.cpp:
3538         (WebCore::TransformState::mappedPoint const):
3539         (WebCore::TransformState::mapQuad const):
3540         (WebCore::TransformState::flattenWithTransform):
3541         * platform/network/CacheValidation.cpp:
3542         (WebCore::computeCurrentAge):
3543         (WebCore::computeFreshnessLifetimeForHTTPFamily):
3544         * platform/network/NetworkStateNotifier.cpp:
3545         (WebCore::NetworkStateNotifier::onLine):
3546         * rendering/FloatingObjects.cpp:
3547         (WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom const):
3548         (WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom const):
3549         * rendering/GridBaselineAlignment.cpp:
3550         (WebCore::GridBaselineAlignment::ascentForChild const):
3551         * rendering/GridTrackSizingAlgorithm.cpp:
3552         (WebCore::GridTrack::setGrowthLimit):
3553         (WebCore::GridTrackSizingAlgorithm::initialBaseSize const):
3554         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit const):
3555         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
3556         (WebCore::sortByGridTrackGrowthPotential):
3557         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
3558         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
3559         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
3560         * rendering/PaintInfo.h:
3561         (WebCore::PaintInfo::applyTransform):
3562         * rendering/RenderBox.cpp:
3563         (WebCore::RenderBox::computeLogicalHeight const):
3564         * rendering/RenderCounter.cpp:
3565         (WebCore::planCounter):
3566         * rendering/RenderDeprecatedFlexibleBox.cpp:
3567         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
3568         * rendering/RenderFlexibleBox.cpp:
3569         (WebCore::RenderFlexibleBox::baselinePosition const):
3570         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
3571         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
3572         * rendering/RenderGrid.cpp:
3573         (WebCore::RenderGrid::gridGap const):
3574         (WebCore::RenderGrid::baselinePosition const):
3575         * rendering/RenderLayer.cpp:
3576         (WebCore::RenderLayer::paintLayerByApplyingTransform):
3577         * rendering/RenderListBox.cpp:
3578         (WebCore::RenderListBox::paintItem):
3579         (WebCore::RenderListBox::listIndexIsVisible):
3580         * rendering/RenderMultiColumnSet.cpp:
3581         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight const):
3582         * rendering/RenderTable.cpp:
3583         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
3584         * rendering/RenderTableCell.cpp:
3585         (WebCore::RenderTableCell::cellBaselinePosition const):
3586         * rendering/RenderTableSection.cpp:
3587         (WebCore::RenderTableSection::firstLineBaseline const):
3588         * rendering/RenderText.cpp:
3589         (WebCore::RenderText::computePreferredLogicalWidths):
3590         (WebCore::RenderText::previousOffset const):
3591         (WebCore::RenderText::previousOffsetForBackwardDeletion const):
3592         (WebCore::RenderText::nextOffset const):
3593         (WebCore::RenderText::stringView const):
3594         * rendering/RenderView.cpp:
3595         (WebCore::RenderView::layout):
3596         * rendering/mathml/RenderMathMLBlock.cpp:
3597         (WebCore::RenderMathMLBlock::baselinePosition const):
3598         * rendering/mathml/RenderMathMLBlock.h:
3599         (WebCore::RenderMathMLBlock::ascentForChild):
3600         * rendering/style/GridPosition.cpp:
3601         (WebCore::GridPosition::max):
3602         * rendering/style/TextUnderlineOffset.h:
3603         (WebCore::TextUnderlineOffset::lengthOr const):
3604         * rendering/svg/RenderSVGContainer.cpp:
3605         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
3606         * rendering/svg/RenderSVGForeignObject.cpp:
3607         (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
3608         * rendering/svg/RenderSVGImage.cpp:
3609         (WebCore::RenderSVGImage::nodeAtFloatPoint):
3610         * rendering/svg/RenderSVGResourceClipper.cpp:
3611         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
3612         * rendering/svg/RenderSVGResourceFilter.cpp:
3613         (WebCore::RenderSVGResourceFilter::postApplyResource):
3614         * rendering/svg/RenderSVGRoot.cpp:
3615         (WebCore::RenderSVGRoot::nodeAtPoint):
3616         * rendering/svg/RenderSVGShape.cpp:
3617         (WebCore::RenderSVGShape::nodeAtFloatPoint):
3618         * rendering/svg/RenderSVGText.cpp:
3619         (WebCore::RenderSVGText::nodeAtFloatPoint):
3620         * rendering/svg/SVGRenderingContext.cpp:
3621         (WebCore::SVGRenderingContext::clipToImageBuffer):
3622         * svg/SVGToOTFFontConversion.cpp:
3623         (WebCore::SVGToOTFFontConverter::processGlyphElement):
3624         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
3625
3626 2018-12-20  Jer Noble  <jer.noble@apple.com>
3627
3628         REGRESSION (r239419): heap-use-after-free in AudioSourceProviderAVFObjC::finalizeCallback()
3629         https://bugs.webkit.org/show_bug.cgi?id=192941
3630         <rdar://problem/46874096>
3631
3632         Reviewed by Brent Fulgham.
3633
3634         Don't delete the locked lock before unlocking the lock. 
3635
3636         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3637         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
3638
3639 2018-12-20  Keith Rollin  <krollin@apple.com>
3640
3641         Improve release-level page-load logging
3642         https://bugs.webkit.org/show_bug.cgi?id=192872
3643         <rdar://problem/46850309>
3644
3645         Reviewed by Chris Dumez.
3646
3647         There are a number of reported bugs that are difficult or impossible
3648         to track down with our current level of logging. Additionally, some
3649         software groups lower in the page-loading stack have requested logging
3650         sufficient for tracking a user-visible error message down to the
3651         requested resource that caused the message. Add more-comprehensive
3652         logging to address these issues/requests.
3653
3654         No new tests -- no changed functionality.
3655
3656         * loader/DocumentLoader.cpp:
3657         (WebCore::DocumentLoader::setMainDocumentError):
3658         (WebCore::DocumentLoader::mainReceivedError):
3659         (WebCore::DocumentLoader::stopLoading):
3660         (WebCore::DocumentLoader::notifyFinished):
3661         (WebCore::DocumentLoader::willSendRequest):
3662         (WebCore::DocumentLoader::continueAfterContentPolicy):
3663         (WebCore::DocumentLoader::startLoadingMainResource):
3664         (WebCore::DocumentLoader::loadMainResource):
3665         (WebCore::DocumentLoader::cancelMainResourceLoad):
3666         * loader/FrameLoader.cpp:
3667         (WebCore::FrameLoader::urlSelected):
3668         (WebCore::FrameLoader::loadURLIntoChildFrame):
3669         (WebCore::FrameLoader::loadArchive):
3670         (WebCore::FrameLoader::loadInSameDocument):
3671         (WebCore::FrameLoader::loadFrameRequest):
3672         (WebCore::FrameLoader::loadURL):
3673         (WebCore::FrameLoader::load):
3674         (WebCore::FrameLoader::loadWithNavigationAction):
3675         (WebCore::FrameLoader::loadWithDocumentLoader):
3676         (WebCore::FrameLoader::reloadWithOverrideEncoding):
3677         (WebCore::FrameLoader::reload):
3678         (WebCore::FrameLoader::setState):
3679         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
3680         (WebCore::FrameLoader::loadPostRequest):
3681         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
3682         (WebCore::FrameLoader::loadDifferentDocumentItem):
3683         * loader/ProgressTracker.cpp:
3684         (WebCore::ProgressItem::ProgressItem):
3685         (WebCore::ProgressTracker::reset):
3686         (WebCore::ProgressTracker::progressStarted):
3687         (WebCore::ProgressTracker::progressCompleted):
3688         (WebCore::ProgressTracker::finalProgressComplete):
3689         (WebCore::ProgressTracker::incrementProgress):
3690         (WebCore::ProgressTracker::completeProgress):
3691         (WebCore::ProgressTracker::isAlwaysOnLoggingAllowed const):
3692         * loader/ProgressTracker.h:
3693         * loader/ResourceLoader.cpp:
3694         (WebCore::ResourceLoader::loadDataURL):
3695         (WebCore::ResourceLoader::willSendRequestInternal):
3696         (WebCore::ResourceLoader::didFinishLoading):
3697         (WebCore::ResourceLoader::didFail):
3698         (WebCore::ResourceLoader::willSendRequestAsync):
3699         (WebCore::ResourceLoader::wasBlocked):
3700         (WebCore::ResourceLoader::cannotShowURL):
3701         * loader/SubresourceLoader.cpp:
3702         (WebCore::SubresourceLoader::willSendRequestInternal):
3703         (WebCore::=):
3704         (WebCore::SubresourceLoader::didReceiveResponse):
3705         (WebCore::SubresourceLoader::didFinishLoading):
3706         (WebCore::SubresourceLoader::didFail):
3707         (WebCore::SubresourceLoader::willCancel):
3708         * loader/cache/CachedResource.cpp:
3709         (WebCore::CachedResource::load):
3710
3711 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
3712
3713         Switch tabs before retuning PiP video to inline.
3714         https://bugs.webkit.org/show_bug.cgi?id=192767
3715         rdar://problem/46006046
3716
3717         Reviewed by Jer Noble.
3718
3719         No new tests because this code path only happens with a user action on system UI.
3720
3721         When exiting PiP, notify the fullscreen change observer so it can restore client UI state before exiting.
3722
3723         * platform/mac/VideoFullscreenInterfaceMac.mm:
3724         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
3725
3726 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3727
3728         Unreviewed, fix GTK build after r239410
3729
3730         It added a new file to the build, breaking the unified sources magic that obscured a bug in
3731         URLSoup.h. It forward-declares URL, but this never worked unless the URL.h header was
3732         included via another source file in the unified source bundle.
3733
3734         * platform/network/soup/URLSoup.h:
3735
3736 2018-12-19  Chris Dumez  <cdumez@apple.com>
3737
3738         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
3739         https://bugs.webkit.org/show_bug.cgi?id=192728
3740         <rdar://problem/46746779>
3741
3742         Reviewed by Geoff Garen.
3743
3744         * Modules/*:
3745         * animation/*:
3746         * bindings/*:
3747         * crypto/*:
3748         * css/*:
3749         * dom/*:
3750         * editing/*:
3751         * fileapi/*:
3752         * html/*:
3753         * inspector/*:
3754         * layout/*:
3755         * loader/*:
3756         * mathml/*:
3757         * page/*:
3758         * platform/*:
3759         * plugins/*:
3760         * rendering/*:
3761         * testing/*:
3762         * workers/*:
3763         * xml/*:
3764
3765 2018-12-19  Jer Noble  <jer.noble@apple.com>
3766
3767         Leak of MTAudioProcessingTap (304 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
3768         https://bugs.webkit.org/show_bug.cgi?id=192896
3769         <rdar://46732186>
3770
3771         Reviewed by Eric Carlson.
3772
3773         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3774         (WebCore::AudioSourceProviderAVFObjC::initCallback):
3775
3776 2018-12-19  Timothy Hatcher  <timothy@apple.com>
3777
3778         REGRESSION (r232991): Switching to dark mode in Mail does not update the message view to be transparent
3779         https://bugs.webkit.org/show_bug.cgi?id=188891
3780         rdar://problem/42344352
3781
3782         Reviewed by Simon Fraser.
3783
3784         * rendering/RenderLayerCompositor.cpp:
3785         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
3786         Don't return early when m_layerForOverhangAreas is null to avoid skipping
3787         setRootLayerConfigurationNeedsUpdate() and scheduleCompositingLayerUpdate().
3788
3789 2018-12-19  Justin Fan  <justin_fan@apple.com>
3790
3791         [WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
3792         https://bugs.webkit.org/show_bug.cgi?id=192843
3793         <rdar://problem/46820395>
3794
3795         Reviewed by Myles Maxfield.
3796
3797         Test: webgpu/pipeline-layouts.html
3798
3799         Implement the emtpy WebGPUPipelineLayout interface, and enable creation via WebGPUDevice::createPipelineLayout:
3800         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
3801         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
3802         * Modules/webgpu/WebGPUBindGroupLayout.h:
3803         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const): Added getter.
3804         * Modules/webgpu/WebGPUDevice.cpp:
3805         (WebCore::WebGPUDevice::createPipelineLayout const): Added.
3806         * Modules/webgpu/WebGPUDevice.h:
3807         * Modules/webgpu/WebGPUDevice.idl: Enable createPipelineLayout.
3808         * Modules/webgpu/WebGPUPipelineLayout.cpp: Added.
3809         (WebCore::WebGPUPipelineLayout::create):
3810         (WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout):
3811         * Modules/webgpu/WebGPUPipelineLayout.h: Added.
3812         * Modules/webgpu/WebGPUPipelineLayout.idl: Added.
3813         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Added.
3814         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Added.
3815         * platform/graphics/gpu/GPUDevice.cpp:
3816         (WebCore::GPUDevice::createPipelineLayout const): Added.
3817         * platform/graphics/gpu/GPUDevice.h:
3818         * platform/graphics/gpu/GPUPipelineLayout.cpp: Added.
3819         (WebCore::GPUPipelineLayout::create):
3820         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
3821         * platform/graphics/gpu/GPUPipelineLayout.h: Added.
3822         * platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Added.
3823
3824         Add files and symbols to project:
3825         * CMakeLists.txt:
3826         * DerivedSources.make:
3827         * Sources.txt:
3828         * WebCore.xcodeproj/project.pbxproj:
3829         * bindings/js/WebCoreBuiltinNames.h:
3830
3831         Add missing include:
3832         * Modules/webgpu/WebGPUQueue.h:
3833
3834 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
3835
3836         SVGUseElement::findTarget should return nullptr when there is a cycle
3837         https://bugs.webkit.org/show_bug.cgi?id=192840
3838
3839         Reviewed by Tim Horton.
3840
3841         r233366 added an early return to updateShadowTree() when there is a cycle between an use element and its target.
3842         Consolidate this cycle detection code with the one in SVGUseElement::findTarget which detected cycles when
3843         the SVG use element itself had a corresponding element.
3844
3845         No new tests since there should be no behavioral change.
3846
3847         * svg/SVGUseElement.cpp:
3848         (WebCore::SVGUseElement::updateShadowTree):
3849         (WebCore::SVGUseElement::findTarget const):
3850
3851 2018-12-19  Myles C. Maxfield  <mmaxfield@apple.com>
3852
3853         [WHLSL] Add a handwritten lexer
3854         https://bugs.webkit.org/show_bug.cgi?id=192294
3855
3856         Reviewed by Jon Lee.
3857
3858         This is infrastructure necessary for https://bugs.webkit.org/show_bug.cgi?id=192355. The
3859         implementation matches the lexing rules in the spec (specifically, the rules that start
3860         with an uppercase letter). The spec is at
3861         https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4.
3862
3863         This patch also modifies the lexer according to https://github.com/gpuweb/WHLSL/pull/283.
3864
3865         No new tests because the lexer isn't hooked up yet; there are tests in the parser,
3866         once that gets committed.
3867
3868         * Modules/webgpu/WHLSL/WHLSLLexer.cpp: Added.
3869         (WebCore::WHLSL::Lexer::Token::typeName):
3870         (WebCore::WHLSL::Lexer::recognizeKeyword):
3871         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
3872         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
3873         (WebCore::WHLSL::isWhitespace):
3874         (WebCore::WHLSL::isNewline):
3875         (WebCore::WHLSL::Lexer::skipWhitespace):
3876         (WebCore::WHLSL::Lexer::skipLineComment):
3877         (WebCore::WHLSL::Lexer::skipLongComment):
3878         (WebCore::WHLSL::Lexer::coreDecimalIntLiteral const):
3879         (WebCore::WHLSL::Lexer::decimalIntLiteral const):
3880         (WebCore::WHLSL::Lexer::decimalUintLiteral const):
3881         (WebCore::WHLSL::isHexadecimalCharacter):
3882         (WebCore::WHLSL::Lexer::coreHexadecimalIntLiteral const):
3883         (WebCore::WHLSL::Lexer::hexadecimalIntLiteral const):
3884         (WebCore::WHLSL::Lexer::hexadecimalUintLiteral const):
3885         (WebCore::WHLSL::Lexer::intLiteral const):
3886         (WebCore::WHLSL::Lexer::uintLiteral const):
3887         (WebCore::WHLSL::Lexer::digit const):
3888         (WebCore::WHLSL::Lexer::digitStar const):
3889         (WebCore::WHLSL::Lexer::character const):
3890         (WebCore::WHLSL::Lexer::coreFloatLiteralType1 const):
3891         (WebCore::WHLSL::Lexer::coreFloatLiteral const):
3892         (WebCore::WHLSL::Lexer::floatLiteral const):
3893         (WebCore::WHLSL::Lexer::validIdentifier const):
3894         (WebCore::WHLSL::Lexer::identifier const):
3895         (WebCore::WHLSL::Lexer::operatorName const):
3896         * Modules/webgpu/WHLSL/WHLSLLexer.h: Added.
3897         (WebCore::WHLSL::Lexer::Lexer):
3898         (WebCore::WHLSL::Lexer::consumeToken):
3899         (WebCore::WHLSL::Lexer::unconsumeToken):
3900         (WebCore::WHLSL::Lexer::state const):
3901         (WebCore::WHLSL::Lexer::setState):
3902         (WebCore::WHLSL::Lexer::isFullyConsumed const):
3903         (WebCore::WHLSL::Lexer::errorString):
3904         (WebCore::WHLSL::Lexer::string const):
3905         (WebCore::WHLSL::Lexer::anyCharacter const):
3906         * Sources.txt:
3907         * WebCore.xcodeproj/project.pbxproj:
3908
3909 2018-12-18  Simon Fraser  <simon.fraser@apple.com>
3910
3911         Web Inspector: Timelines: correctly label Intersection Observer callbacks
3912         https://bugs.webkit.org/show_bug.cgi?id=192669
3913         <rdar://problem/46702490>
3914
3915         Reviewed by Joseph Pecoraro.
3916
3917         Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls
3918         to Intersection Observer, Performance Observer and Mutation Observer callbacks so 
3919         that they get correctly labeled in the Inspector timeline.
3920
3921         * dom/MutationObserver.cpp:
3922         (WebCore::MutationObserver::deliver):
3923         * en.lproj/Localizable.strings:
3924         * inspector/InspectorInstrumentation.cpp:
3925         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
3926         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
3927         * inspector/InspectorInstrumentation.h:
3928         (WebCore::InspectorInstrumentation::willFireObserverCallback):
3929         (WebCore::InspectorInstrumentation::didFireObserverCallback):
3930         * inspector/TimelineRecordFactory.cpp:
3931         (WebCore::TimelineRecordFactory::createObserverCallbackData):
3932         * inspector/TimelineRecordFactory.h:
3933         * inspector/agents/InspectorTimelineAgent.cpp:
3934         (WebCore::InspectorTimelineAgent::willFireObserverCallback):
3935         (WebCore::InspectorTimelineAgent::didFireObserverCallback):
3936         (WebCore::toProtocol):
3937         * inspector/agents/InspectorTimelineAgent.h:
3938         * page/IntersectionObserver.cpp:
3939         (WebCore::IntersectionObserver::notify):
3940         * page/PerformanceObserver.cpp:
3941         (WebCore::PerformanceObserver::deliver):
3942
3943 2018-12-19  Claudio Saavedra  <csaavedra@igalia.com>
3944
3945         ContentExtensions: DFANode.cpp:66:44: error: narrowing conversion of '-1' from 'int' to 'char' inside { }
3946         https://bugs.webkit.org/show_bug.cgi?id=192854
3947
3948         Reviewed by Alex Christensen.
3949
3950         * contentextensions/DFANode.h: Define CharRange's chars as signed
3951
3952 2018-12-19  Youenn Fablet  <youenn@apple.com>
3953
3954         Remove RTCRtpTransceiver.setDirection
3955         https://bugs.webkit.org/show_bug.cgi?id=192869
3956
3957         Reviewed by Alex Christensen.
3958
3959         Covered by rebased test.
3960
3961         * Modules/mediastream/RTCRtpTransceiver.idl:
3962
3963 2018-12-19  Jer Noble  <jer.noble@apple.com>
3964
3965         Force synchronous decode in WebCoreDecompressionSession::decodeSample