Add support for using the current text selection as the find string on iOS
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Add support for using the current text selection as the find string on iOS
4         https://bugs.webkit.org/show_bug.cgi?id=193034
5         <rdar://problem/45138739>
6
7         Reviewed by Tim Horton.
8
9         Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find
10         pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI
11         process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are
12         able to trigger find-in-page with this string.
13
14         Test: WebKit.UseSelectionAsFindString
15
16         * editing/Editor.cpp:
17         (WebCore::Editor::canCopyExcludingStandaloneImages const):
18
19         Make this helper function cross-platform.
20
21         * editing/Editor.h:
22         * editing/EditorCommand.cpp:
23         (WebCore::createCommandMap):
24         * editing/cocoa/EditorCocoa.mm:
25         (WebCore::Editor::takeFindStringFromSelection):
26
27         Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the
28         find string (see WebKit/ChangeLog for more details).
29
30         * editing/mac/EditorMac.mm:
31         (WebCore::Editor::canCopyExcludingStandaloneImages): Deleted.
32         (WebCore::Editor::takeFindStringFromSelection): Deleted.
33         * loader/EmptyClients.cpp:
34         * page/EditorClient.h:
35
36         Add a new editor client method to send the string for find-in-page to the UI process.
37
38 2019-01-02  Devin Rousso  <webkit@devinrousso.com>
39
40         Web Inspector: Implement `queryObjects` Command Line API
41         https://bugs.webkit.org/show_bug.cgi?id=176766
42         <rdar://problem/34890689>
43
44         Reviewed by Joseph Pecoraro.
45
46         Test: inspector/console/queryObjects.html
47
48         * inspector/CommandLineAPIModuleSource.js:
49         (CommandLineAPI):
50         (CommandLineAPIImpl.prototype.queryObjects): Added.
51
52 2019-01-02  Charles Vazac  <cvazac@gmail.com>
53
54         Fix resourcetimingbufferfull bubbles attribute
55         https://bugs.webkit.org/show_bug.cgi?id=193087
56
57         Reviewed by Chris Dumez.
58
59         This change is covered by web-platform-tests [1].
60
61         [1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20
62
63         * page/Performance.cpp:
64         (WebCore::Performance::resourceTimingBufferFullTimerFired):
65
66 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
67
68         Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
69         https://bugs.webkit.org/show_bug.cgi?id=193010
70
71         Reviewed by Zalan Bujtas.
72
73         Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h,
74         and make it an enum class.
75
76         * page/FrameView.cpp:
77         (WebCore::FrameView::scrollLayerID const):
78         * rendering/RenderLayer.h:
79         * rendering/RenderLayerBacking.cpp:
80         (WebCore::RenderLayerBacking::~RenderLayerBacking):
81         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
82         (WebCore::operator<<):
83         * rendering/RenderLayerBacking.h:
84         * rendering/RenderLayerCompositor.cpp:
85         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
86         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
87         (WebCore::scrollCoordinationRoleForNodeType):
88         (WebCore::RenderLayerCompositor::attachScrollingNode):
89         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
90         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
91         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
92         * rendering/RenderLayerCompositor.h:
93
94 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
95
96         Don't spin up a CalcParser if the current token is not a function token
97         https://bugs.webkit.org/show_bug.cgi?id=193067
98
99         Reviewed by Zalan Bujtas.
100
101         Various functions in CSSPropertyParserHelpers fall back to trying to parse
102         a calc expression if the normal parsing fails. Don't do this unless the
103         current token is a function token, which should be slightly more efficient.
104
105         * css/parser/CSSPropertyParserHelpers.cpp:
106         (WebCore::CSSPropertyParserHelpers::consumeInteger):
107         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
108         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
109         (WebCore::CSSPropertyParserHelpers::consumeNumber):
110         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
111         (WebCore::CSSPropertyParserHelpers::consumeLength):
112         (WebCore::CSSPropertyParserHelpers::consumePercent):
113         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
114         (WebCore::CSSPropertyParserHelpers::consumeAngle):
115         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
116         (WebCore::CSSPropertyParserHelpers::consumeTime):
117
118 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
119
120         Support css-color-4 rgb functions
121         https://bugs.webkit.org/show_bug.cgi?id=192321
122
123         Reviewed by Zalan Bujtas.
124         
125         Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions.
126         The differences are:
127         1. There is a new comma-free syntax, where the optional alpha is separated by a slash:
128             rgb(128 34 56)
129             rgb(128 34 56 / 50%)
130         2. Floating point values are allowed, and rounded:
131             rgb(128.5 34.2 56.5) becomes rgb(129 34 57)
132         3. rgba() is a pure alias for rgb(), so these are equivalent:
133             rgb(128 34 56 / 50%)
134             rgba(128 34 56 / 50%)
135             
136         hsl()/hsla() parsing was already updated to this new syntax in r230861.
137
138         Tested by tests in imported/w3c/web-platform-tests/css/css-color/
139
140         * css/parser/CSSPropertyParserHelpers.cpp:
141         (WebCore::CSSPropertyParserHelpers::clampRGBComponent):
142         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
143         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
144
145 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
146
147         Handle calc() expressions in gradient color stops
148         https://bugs.webkit.org/show_bug.cgi?id=193066
149         rdar://problem/46961985
150
151         Reviewed by Sam Weinig.
152         
153         Fix two issues that prevented calc() expressions from working in conic-gradient color stops,
154         for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent
155         calc values as well as angle ones.
156
157         Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account),
158         just as isPx() etc do.
159
160         Test: fast/gradients/conic-calc-stop-position.html
161
162         * css/CSSPrimitiveValue.h:
163         (WebCore::CSSPrimitiveValue::isAngle const):
164         * css/parser/CSSPropertyParserHelpers.cpp:
165         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
166         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
167
168 2018-12-31  Keith Miller  <keith_miller@apple.com>
169
170         SourceProviders should use an actual URL instead of a string
171         https://bugs.webkit.org/show_bug.cgi?id=192734
172
173         Reviewed by Yusuke Suzuki.
174
175         Remove ScriptSourceCode's URL member and make the url() method
176         reference the URL on the SourceProvider. Also, avoid some
177         ref count churn.
178
179         Additionally, this patch fixes an existing bug in
180         WorkletGlobalScope() that would use a ScriptSourceCode after
181         WTFMoving it.
182
183         * bindings/js/CachedScriptSourceProvider.h:
184         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
185         * bindings/js/ScheduledAction.cpp:
186         (WebCore::ScheduledAction::execute):
187         * bindings/js/ScriptController.cpp:
188         (WebCore::ScriptController::executeScriptInWorld):
189         (WebCore::ScriptController::executeScript):
190         * bindings/js/ScriptSourceCode.h:
191         (WebCore::ScriptSourceCode::ScriptSourceCode):
192         (WebCore::ScriptSourceCode::m_code):
193         (WebCore::ScriptSourceCode::url const):
194         (WebCore::ScriptSourceCode::m_url): Deleted.
195         * dom/ScriptElement.cpp:
196         (WebCore::ScriptElement::prepareScript):
197         (WebCore::ScriptElement::requestModuleScript):
198         (WebCore::ScriptElement::executePendingScript):
199         * html/HTMLMediaElement.cpp:
200         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
201         * page/Frame.cpp:
202         (WebCore::Frame::injectUserScriptImmediately):
203         * workers/WorkerGlobalScope.cpp:
204         (WebCore::WorkerGlobalScope::importScripts):
205         * workers/WorkerThread.cpp:
206         (WebCore::WorkerThread::workerThread):
207         * worklets/WorkletGlobalScope.cpp:
208         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
209         * xml/parser/XMLDocumentParserLibxml2.cpp:
210         (WebCore::XMLDocumentParser::endElementNs):
211
212 2019-01-01  Jeff Miller  <jeffm@apple.com>
213
214         Update user-visible copyright strings to include 2019
215         https://bugs.webkit.org/show_bug.cgi?id=192811
216
217         Reviewed by Mark Lam.
218
219         * Info.plist:
220
221 2018-12-30  David Kilzer  <ddkilzer@apple.com>
222
223         clang-tidy: Save 8 padding bytes on WebCore::BorderEdge
224         <https://webkit.org/b/193058>
225         <rdar://problem/46979275>
226
227         Reviewed by Yusuke Suzuki.
228
229         * rendering/BorderEdge.cpp:
230         (WebCore::BorderEdge::BorderEdge): Reorder initialization to
231         match new instance variable order.
232         * rendering/BorderEdge.h: Reorder instance variables to save
233         8 padding bytes.
234
235 2018-12-28  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
236
237         [JSC] Remove one indirection in JSObject::toStringName
238         https://bugs.webkit.org/show_bug.cgi?id=193037
239
240         Reviewed by Keith Miller.
241
242         Use old JSObject::toStringName function here.
243
244         * bindings/js/JSDOMConstructorBase.cpp:
245         (WebCore::JSDOMConstructorBase::className):
246         (WebCore::JSDOMConstructorBase::toStringName):
247         * bindings/js/JSDOMConstructorBase.h:
248         (WebCore::JSDOMConstructorBase::className): Deleted.
249
250 2018-12-27  Alex Christensen  <achristensen@webkit.org>
251
252         Resurrect Mac CMake build
253         https://bugs.webkit.org/show_bug.cgi?id=192658
254
255         Reviewed by Yusuke Suzuki.
256
257         This makes it so JSC and most of WebCore builds.
258         WebCore's use of ARC seems inconsistent, so I'll fix that later.
259
260         * PlatformMac.cmake:
261         * config.h:
262
263 2018-12-26  Jim Mason  <jmason@ibinx.com>
264
265         [FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
266         https://bugs.webkit.org/show_bug.cgi?id=193036
267
268         Reviewed by Michael Catanzaro.
269
270         * platform/graphics/FontPlatformData.h:
271         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
272
273 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
274
275         Remove "using namespace std;"
276         https://bugs.webkit.org/show_bug.cgi?id=192973
277         <rdar://problem/46937309>
278
279         Unreviewed Windows port Debug builds fix.
280
281         No new tests since no behavior changes.
282
283         * accessibility/win/AXObjectCacheWin.cpp:
284         (WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro.
285
286 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
287
288         Remove "using namespace std;"
289         https://bugs.webkit.org/show_bug.cgi?id=192973
290
291         Reviewed by Alex Christensen.
292
293         Removed "using namespace std" statement, and use std:: prefix.
294
295         No new tests since no behavior changes.
296
297         * accessibility/win/AXObjectCacheWin.cpp:
298         * platform/graphics/GraphicsContext3DPrivate.cpp:
299         * platform/graphics/cairo/ImageBufferCairo.cpp:
300         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
301         * platform/graphics/win/FontWin.cpp:
302         (WebCore::FontCascade::floatWidthForComplexText const):
303         * platform/graphics/win/GraphicsContextCGWin.cpp:
304         * platform/graphics/win/GraphicsContextCairoWin.cpp:
305         * platform/graphics/win/GraphicsContextDirect2D.cpp:
306         * platform/graphics/win/GraphicsContextWin.cpp:
307         * platform/graphics/win/SimpleFontDataCGWin.cpp:
308         * platform/graphics/win/UniscribeController.cpp:
309         (WebCore::UniscribeController::UniscribeController):
310         (WebCore::UniscribeController::shapeAndPlaceItem):
311         * platform/image-decoders/ScalableImageDecoder.cpp:
312         * platform/text/LocaleICU.cpp:
313         * platform/text/win/LocaleWin.cpp:
314         * platform/win/ScrollbarThemeWin.cpp:
315         * rendering/RenderRubyRun.cpp:
316         (WebCore::RenderRubyRun::layoutBlock):
317         * rendering/RenderThemeWin.cpp:
318         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
319         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
320         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const):
321         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const):
322         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
323         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const):
324         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
325
326 2018-12-24  Simon Fraser  <simon.fraser@apple.com>
327
328         Change ScrollingNodeType to an enum class
329         https://bugs.webkit.org/show_bug.cgi?id=193009
330
331         Reviewed by Zalan Bujtas.
332
333         Change the ScrollingNodeType enum to an enum class.
334         
335         No behavior change.
336
337         * page/scrolling/AsyncScrollingCoordinator.cpp:
338         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
339         * page/scrolling/ScrollingCoordinator.cpp:
340         (WebCore::operator<<):
341         * page/scrolling/ScrollingCoordinator.h:
342         * page/scrolling/ScrollingStateFixedNode.cpp:
343         (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
344         * page/scrolling/ScrollingStateNode.h:
345         (WebCore::ScrollingStateNode::isFixedNode const):
346         (WebCore::ScrollingStateNode::isStickyNode const):
347         (WebCore::ScrollingStateNode::isFrameScrollingNode const):
348         (WebCore::ScrollingStateNode::isOverflowScrollingNode const):
349         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
350         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
351         * page/scrolling/ScrollingStateStickyNode.cpp:
352         (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
353         * page/scrolling/ScrollingStateTree.cpp:
354         (WebCore::ScrollingStateTree::createNode):
355         (WebCore::ScrollingStateTree::attachNode):
356         * page/scrolling/ScrollingTreeNode.h:
357         (WebCore::ScrollingTreeNode::isFixedNode const):
358         (WebCore::ScrollingTreeNode::isStickyNode const):
359         (WebCore::ScrollingTreeNode::isFrameScrollingNode const):
360         (WebCore::ScrollingTreeNode::isOverflowScrollingNode const):
361         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
362         (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
363         * page/scrolling/ios/ScrollingTreeIOS.cpp:
364         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
365         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
366         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
367         * page/scrolling/mac/ScrollingTreeMac.cpp:
368         (ScrollingTreeMac::createScrollingTreeNode):
369         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
370         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
371         * platform/graphics/GraphicsLayerClient.h:
372         * rendering/RenderLayerCompositor.cpp:
373         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
374         (WebCore::scrollCoordinationRoleForNodeType):
375         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
376         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
377
378 2018-12-22  Carlos Garcia Campos  <cgarcia@igalia.com>
379
380         [HarfBuzz] Width not correctly reported as 0 for zero font size
381         https://bugs.webkit.org/show_bug.cgi?id=192986
382
383         Reviewed by Michael Catanzaro.
384
385         Fixes test fast/text/font-size-zero.html
386
387         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
388         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
389         size is zero.
390
391 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
392
393         Use Ref<> as much as possible
394         https://bugs.webkit.org/show_bug.cgi?id=192808
395
396         Reviewed by Alex Christensen.
397
398         * Modules/encryptedmedia/NavigatorEME.cpp:
399         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
400         * Modules/fetch/FetchBody.cpp:
401         (WebCore::FetchBody::bodyAsFormData const):
402         * Modules/geolocation/Geolocation.cpp:
403         (WebCore::Geolocation::getCurrentPosition):
404         (WebCore::Geolocation::watchPosition):
405         * Modules/indexeddb/IDBDatabase.cpp:
406         (WebCore::IDBDatabase::objectStoreNames const):
407         * Modules/indexeddb/IDBDatabase.h:
408         * Modules/indexeddb/IDBObjectStore.cpp:
409         (WebCore::IDBObjectStore::indexNames const):
410         * Modules/indexeddb/IDBObjectStore.h:
411         * Modules/indexeddb/IDBTransaction.cpp:
412         (WebCore::IDBTransaction::scheduleOperation):
413         * Modules/indexeddb/IDBTransaction.h:
414         * Modules/indexeddb/client/TransactionOperation.h:
415         (WebCore::IDBClient::createTransactionOperation):
416         * Modules/mediastream/MediaDevices.cpp:
417         (WebCore::MediaDevices::getUserMedia const):
418         (WebCore::MediaDevices::getDisplayMedia const):
419         * Modules/mediastream/UserMediaRequest.cpp:
420         (WebCore::UserMediaRequest::create):
421         * Modules/mediastream/UserMediaRequest.h:
422         * Modules/webaudio/AudioParam.cpp:
423         (WebCore::AudioParam::calculateFinalValues):
424         * Modules/webaudio/ScriptProcessorNode.cpp:
425         (WebCore::ScriptProcessorNode::initialize):
426         * Modules/webdatabase/SQLStatement.cpp:
427         (WebCore::SQLStatement::execute):
428         * Modules/webgpu/WebGPU.cpp:
429         (WebCore::WebGPU::requestAdapter const):
430         * Modules/webgpu/WebGPUAdapter.cpp:
431         (WebCore::WebGPUAdapter::create):
432         * Modules/webgpu/WebGPUAdapter.h:
433         * Modules/webgpu/WebGPUBuffer.cpp:
434         (WebCore::WebGPUBuffer::create):
435         * Modules/webgpu/WebGPUBuffer.h:
436         * Modules/webgpu/WebGPUCommandBuffer.cpp:
437         (WebCore::WebGPUCommandBuffer::create):
438         (WebCore::WebGPUCommandBuffer::beginRenderPass):
439         * Modules/webgpu/WebGPUCommandBuffer.h:
440         * Modules/webgpu/WebGPUDevice.cpp:
441         (WebCore::WebGPUDevice::create):
442         (WebCore::WebGPUDevice::createBuffer const):
443         (WebCore::WebGPUDevice::createShaderModule const):
444         (WebCore::WebGPUDevice::createRenderPipeline const):
445         (WebCore::WebGPUDevice::createCommandBuffer const):
446         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
447         (WebCore::WebGPURenderPassEncoder::create):
448         * Modules/webgpu/WebGPURenderPassEncoder.h:
449         * Modules/webgpu/WebGPURenderPipeline.cpp:
450         (WebCore::WebGPURenderPipeline::create):
451         * Modules/webgpu/WebGPURenderPipeline.h:
452         * Modules/webgpu/WebGPUShaderModule.cpp:
453         (WebCore::WebGPUShaderModule::create):
454         * Modules/webgpu/WebGPUShaderModule.h:
455         * Modules/webgpu/WebGPUTexture.cpp:
456         (WebCore::WebGPUTexture::createDefaultTextureView):
457         * Modules/webgpu/WebGPUTextureView.cpp:
458         (WebCore::WebGPUTextureView::create):
459         * Modules/webgpu/WebGPUTextureView.h:
460         * accessibility/AXObjectCache.cpp:
461         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
462         * accessibility/atk/AXObjectCacheAtk.cpp:
463         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
464         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
465         (webkitAccessibleHyperlinkGetStartIndex):
466         (webkitAccessibleHyperlinkGetEndIndex):
467         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
468         (getSelectionOffsetsForObject):
469         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
470         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
471         * bindings/js/JSDOMGlobalObjectTask.cpp:
472         * bindings/js/JSDOMWindowBase.cpp:
473         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
474         * bindings/js/JSWorkerGlobalScopeBase.cpp:
475         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
476         * bindings/js/ScriptControllerMac.mm:
477         (WebCore::ScriptController::createScriptInstanceForWidget):
478         * bindings/js/SerializedScriptValue.cpp:
479         (WebCore::CloneDeserializer::readTerminal):
480         (WebCore::SerializedScriptValue::create):
481         * bridge/objc/objc_instance.h:
482         * bridge/objc/objc_instance.mm:
483         (ObjcInstance::create):
484         * css/CSSComputedStyleDeclaration.cpp:
485         (WebCore::ComputedStyleExtractor::currentColorOrValidColor const):
486         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
487         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
488         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
489         * css/CSSComputedStyleDeclaration.h:
490         * css/CSSFontFaceSource.cpp:
491         (WebCore::CSSFontFaceSource::load):
492         * css/CSSStyleSheet.cpp:
493         (WebCore::CSSStyleSheet::rules):
494         * css/FontFace.cpp:
495         (WebCore::FontFace::unicodeRange const):
496         (WebCore::FontFace::featureSettings const):
497         * css/InspectorCSSOMWrappers.cpp:
498         (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
499         * css/SVGCSSComputedStyleDeclaration.cpp:
500         (WebCore::strokeDashArrayToCSSValueList):
501         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
502         * css/StyleResolver.cpp:
503         (WebCore::StyleResolver::createFilterOperations):
504         * css/StyleRule.cpp:
505         (WebCore::StyleRuleBase::createCSSOMWrapper const):
506         * css/StyleRule.h:
507         * dom/ChildListMutationScope.cpp:
508         (WebCore::ChildListMutationAccumulator::getOrCreate):
509         * dom/ChildListMutationScope.h:
510         * dom/DocumentMarkerController.cpp:
511         (WebCore::updateRenderedRectsForMarker):
512         * dom/InlineStyleSheetOwner.cpp:
513         (WebCore::InlineStyleSheetOwner::createSheet):
514         * dom/PointerEvent.h:
515         * dom/UserGestureIndicator.h:
516         (WebCore::UserGestureToken::create):
517         * editing/AlternativeTextController.cpp:
518         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
519         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
520         (WebCore::AlternativeTextController::respondToUnappliedEditing):
521         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
522         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
523         * editing/ApplyStyleCommand.cpp:
524         (WebCore::ApplyStyleCommand::applyBlockStyle):
525         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
526         * editing/CompositeEditCommand.cpp:
527         (WebCore::CompositeEditCommand::targetRanges const):
528         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
529         (WebCore::CompositeEditCommand::moveParagraphs):
530         * editing/DeleteSelectionCommand.cpp:
531         (WebCore::DeleteSelectionCommand::mergeParagraphs):
532         * editing/Editing.cpp:
533         (WebCore::visiblePositionForIndexUsingCharacterIterator):
534         * editing/EditingStyle.cpp:
535         (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
536         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
537         (WebCore::EditingStyle::prepareToApplyAt):
538         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
539         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
540         (WebCore::EditingStyle::removeStyleFromRulesAndContext):
541         (WebCore::extractPropertiesNotIn):
542         * editing/Editor.cpp:
543         (WebCore::Editor::setBaseWritingDirection):
544         (WebCore::Editor::setComposition):
545         * editing/EditorCommand.cpp:
546         (WebCore::executeApplyParagraphStyle):
547         (WebCore::executeMakeTextWritingDirectionLeftToRight):
548         (WebCore::executeMakeTextWritingDirectionNatural):
549         (WebCore::executeMakeTextWritingDirectionRightToLeft):
550         * editing/FormatBlockCommand.cpp:
551         (WebCore::FormatBlockCommand::formatRange):
552         * editing/RemoveFormatCommand.cpp:
553         (WebCore::RemoveFormatCommand::doApply):
554         * editing/ReplaceRangeWithTextCommand.cpp:
555         (WebCore::ReplaceRangeWithTextCommand::targetRanges const):
556         * editing/ReplaceSelectionCommand.cpp:
557         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
558         (WebCore::handleStyleSpansBeforeInsertion):
559         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
560         * editing/SpellingCorrectionCommand.cpp:
561         (WebCore::SpellingCorrectionCommand::targetRanges const):
562         * editing/TextCheckingHelper.cpp:
563         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
564         * editing/TypingCommand.cpp:
565         (WebCore::TypingCommand::insertText):
566         (WebCore::TypingCommand::willAddTypingToOpenCommand):
567         * editing/VisibleUnits.cpp:
568         (WebCore::distanceBetweenPositions):
569         * editing/cocoa/EditorCocoa.mm:
570         (WebCore::Editor::selectionInWebArchiveFormat):
571         * editing/ios/DictationCommandIOS.cpp:
572         (WebCore::DictationCommandIOS::doApply):
573         * editing/ios/EditorIOS.mm:
574         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
575         (WebCore::Editor::removeUnchangeableStyles):
576         (WebCore::Editor::writeImageToPasteboard):
577         * editing/mac/EditorMac.mm:
578         (WebCore::Editor::replaceNodeFromPasteboard):
579         (WebCore::Editor::imageInWebArchiveFormat):
580         * editing/markup.cpp:
581         (WebCore::styleFromMatchedRulesAndInlineDecl):
582         (WebCore::createFragmentForTransformToFragment):
583         * fileapi/FileReaderLoader.cpp:
584         (WebCore::FileReaderLoader::didFinishLoading):
585         * html/FTPDirectoryDocument.cpp:
586         (WebCore::createTemplateDocumentData):
587         * html/HTMLMediaElement.cpp:
588         (WebCore::HTMLMediaElement::scheduleEvent):
589         (WebCore::HTMLMediaElement::createMediaControls):
590         * html/HTMLTableElement.cpp:
591         (WebCore::HTMLTableElement::createSharedCellStyle):
592         * html/HTMLTableElement.h:
593         * html/URLUtils.h:
594         (WebCore::URLUtils<T>::origin const):
595         * html/parser/HTMLConstructionSite.cpp:
596         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
597         * html/shadow/TextControlInnerElements.cpp:
598         (WebCore::TextControlInnerElement::resolveCustomStyle):
599         * html/track/WebVTTParser.cpp:
600         (WebCore::WebVTTParser::createNewCue):
601         * inspector/DOMPatchSupport.cpp:
602         * inspector/InspectorCanvas.cpp:
603         (WebCore::InspectorCanvas::buildInitialState):
604         (WebCore::InspectorCanvas::buildAction):
605         * inspector/InspectorFrontendClientLocal.cpp:
606         (WebCore::InspectorFrontendClientLocal::openInNewTab):
607         * inspector/InspectorStyleSheet.cpp:
608         (WebCore::asCSSRuleList):
609         (WebCore::InspectorStyle::styleWithProperties const):
610         (WebCore::InspectorStyleSheet::ensureSourceData):
611         * inspector/agents/InspectorCanvasAgent.cpp:
612         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
613         * inspector/agents/InspectorIndexedDBAgent.cpp:
614         (WebCore::Inspector::keyPathFromIDBKeyPath):
615         * inspector/agents/InspectorPageAgent.cpp:
616         (WebCore::InspectorPageAgent::archive):
617         * loader/EmptyClients.cpp:
618         (WebCore::EmptyStorageNamespaceProvider::createSessionStorageNamespace):
619         (WebCore::EmptyStorageNamespaceProvider::createLocalStorageNamespace):
620         (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
621         (WebCore::EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace):
622         * loader/FrameLoader.cpp:
623         (WebCore::FrameLoader::loadURL):
624         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
625         (WebCore::FrameLoader::loadDifferentDocumentItem):
626         * loader/WorkerThreadableLoader.cpp:
627         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
628         * loader/archive/mhtml/MHTMLParser.cpp:
629         (WebCore::MHTMLParser::addResourceToArchive):
630         (WebCore::MHTMLParser::parseNextPart):
631         * loader/cache/MemoryCache.cpp:
632         (WebCore::MemoryCache::addImageToCache):
633         (WebCore::MemoryCache::removeResourcesWithOrigin):
634         * page/DOMWindow.cpp:
635         (WebCore::DOMWindow::getMatchedCSSRules const):
636         (WebCore::DOMWindow::createWindow):
637         * page/EventHandler.cpp:
638         (WebCore::textDistance):
639         * page/Page.cpp:
640         (WebCore::Page::userStyleSheet const):
641         * page/animation/CSSPropertyAnimation.cpp:
642         (WebCore::blendFilterOperations):
643         * page/ios/FrameIOS.mm:
644         (WebCore::Frame::initWithSimpleHTMLDocument):
645         (WebCore::Frame::interpretationsForCurrentRoot const):
646         * page/mac/ServicesOverlayController.mm:
647         (WebCore::ServicesOverlayController::Highlight::fadeIn):
648         (WebCore::ServicesOverlayController::Highlight::fadeOut):
649         * platform/SharedBuffer.cpp:
650         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
651         * platform/audio/HRTFElevation.cpp:
652         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
653         * platform/audio/SincResampler.cpp:
654         (WebCore::SincResampler::consumeSource):
655         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
656         (WebCore::AudioFileReader::createBus):
657         * platform/audio/mac/AudioFileReaderMac.cpp:
658         (WebCore::AudioFileReader::createBus):
659         * platform/graphics/Icon.h:
660         (WebCore::Icon::create):
661         * platform/graphics/InbandTextTrackPrivate.h:
662         (WebCore::InbandTextTrackPrivate::create):
663         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
664         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
665         * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
666         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
667         (WebCore::fulfillRequestWithKeyData):
668         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
669         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
670         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
671         (WebCore::MediaSourcePrivateAVFObjC::create):
672         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
673         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
674         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
675         (WebCore::SourceBufferPrivateAVFObjC::create):
676         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
677         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
678         * platform/graphics/ca/TileController.cpp:
679         (WebCore::TileController::createTileLayer):
680         * platform/graphics/ca/TileController.h:
681         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
682         (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
683         (WebCore::CACFLayerTreeHost::create):
684         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
685         (WebCore::GPUBuffer::create):
686         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
687         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
688         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
689         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
690         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
691         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
692         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
693         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
694         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
695         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
696         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
697         (WebCore::AppendPipeline::appsinkNewSample):
698         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
699         (WebCore::ISOProtectionSystemSpecificHeaderBox::parse):
700         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
701         (WebCore::ISOTrackEncryptionBox::parse):
702         * platform/graphics/texmap/TextureMapperAnimation.cpp:
703         (WebCore::applyFilterAnimation):
704         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
705         (WebCore::TextureMapperPlatformLayerBuffer::clone):
706         * platform/graphics/transforms/TransformOperations.cpp:
707         (WebCore::TransformOperations::blendByMatchingOperations const):
708         * platform/image-decoders/ico/ICOImageDecoder.cpp:
709         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
710         * platform/mock/mediasource/MockBox.cpp:
711         (WebCore::MockInitializationBox::MockInitializationBox):
712         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
713         (WebCore::MockSourceBufferPrivate::create):
714         (WebCore::MockSourceBufferPrivate::append):
715         * platform/mock/mediasource/MockSourceBufferPrivate.h:
716         * platform/mock/mediasource/MockTracks.h:
717         (WebCore::MockTextTrackPrivate::create):
718         (WebCore::MockVideoTrackPrivate::create):
719         * platform/network/FormData.h:
720         (WebCore::FormData::decode):
721         * platform/network/cocoa/CookieStorageObserver.h:
722         * platform/network/cocoa/CookieStorageObserver.mm:
723         (WebCore::CookieStorageObserver::create):
724         * platform/network/soup/ResourceRequestSoup.cpp:
725         (WebCore::appendEncodedBlobItemToSoupMessageBody):
726         (WebCore::ResourceRequest::updateSoupMessageBody const):
727         * platform/text/hyphen/HyphenationLibHyphen.cpp:
728         (WebCore::HyphenationDictionary::createNull):
729         (WebCore::HyphenationDictionary::create):
730         * platform/win/SearchPopupMenuWin.cpp:
731         (WebCore::SearchPopupMenuWin::SearchPopupMenuWin):
732         (WebCore::SearchPopupMenuWin::popupMenu):
733         * platform/win/SearchPopupMenuWin.h:
734         * rendering/RenderThemeIOS.mm:
735         (WebCore::applyCommonButtonPaddingToStyle):
736         (WebCore::RenderThemeIOS::paintProgressBar):
737         (WebCore::RenderThemeIOS::adjustButtonStyle const):
738         (WebCore::paintAttachmentIcon):
739         * rendering/svg/SVGRenderTreeAsText.cpp:
740         (WebCore::writeSVGResourceContainer):
741         * storage/Storage.cpp:
742         (WebCore::Storage::create):
743         (WebCore::Storage::Storage):
744         * storage/Storage.h:
745         (WebCore::Storage::area const):
746         * storage/StorageNamespace.h:
747         * storage/StorageNamespaceProvider.cpp:
748         (WebCore::StorageNamespaceProvider::localStorageArea):
749         * storage/StorageNamespaceProvider.h:
750         * svg/SVGElement.cpp:
751         (WebCore::SVGElement::getPresentationAttribute):
752         * svg/SVGFEBlendElement.cpp:
753         (WebCore::SVGFEBlendElement::build):
754         * svg/SVGFEColorMatrixElement.cpp:
755         (WebCore::SVGFEColorMatrixElement::build):
756         * svg/SVGFEComponentTransferElement.cpp:
757         (WebCore::SVGFEComponentTransferElement::build):
758         * svg/SVGFECompositeElement.cpp:
759         (WebCore::SVGFECompositeElement::build):
760         * svg/SVGFEDiffuseLightingElement.cpp:
761         (WebCore::SVGFEDiffuseLightingElement::build):
762         * svg/SVGFEDisplacementMapElement.cpp:
763         (WebCore::SVGFEDisplacementMapElement::build):
764         * svg/SVGFEDropShadowElement.cpp:
765         (WebCore::SVGFEDropShadowElement::build):
766         * svg/SVGFEGaussianBlurElement.cpp:
767         (WebCore::SVGFEGaussianBlurElement::build):
768         * svg/SVGFEMergeElement.cpp:
769         (WebCore::SVGFEMergeElement::build):
770         * svg/SVGFEMorphologyElement.cpp:
771         (WebCore::SVGFEMorphologyElement::build):
772         * svg/SVGFEOffsetElement.cpp:
773         (WebCore::SVGFEOffsetElement::build):
774         * svg/SVGFESpecularLightingElement.cpp:
775         (WebCore::SVGFESpecularLightingElement::build):
776         * svg/SVGFETileElement.cpp:
777         (WebCore::SVGFETileElement::build):
778         * testing/GCObservation.h:
779         * xml/XSLTProcessor.cpp:
780         (WebCore::XSLTProcessor::createDocumentFromSource):
781         * xml/parser/XMLDocumentParser.cpp:
782         (WebCore::XMLDocumentParser::parseDocumentFragment):
783
784 2018-12-21  Chris Dumez  <cdumez@apple.com>
785
786         navigator.userAgent in service workers does not reflect customUserAgent set by client
787         https://bugs.webkit.org/show_bug.cgi?id=192951
788
789         Reviewed by Youenn Fablet.
790
791         Whenever a service worker client registers itself, also pass its effective user agent.
792         In the network process, for each origin, we store the latest client's user agent and
793         use it when starting the service worker.
794
795         * dom/Document.cpp:
796         (WebCore::Document::setServiceWorkerConnection):
797         * loader/DocumentLoader.cpp:
798         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
799         * workers/service/SWClientConnection.h:
800         * workers/service/server/SWServer.cpp:
801         (WebCore::SWServer::serviceWorkerClientUserAgent const):
802         (WebCore::SWServer::installContextData):
803         (WebCore::SWServer::runServiceWorker):
804         (WebCore::SWServer::registerServiceWorkerClient):
805         * workers/service/server/SWServer.h:
806         * workers/service/server/SWServerToContextConnection.h:
807         * workers/service/server/SWServerWorker.cpp:
808         (WebCore::SWServerWorker::userAgent const):
809         * workers/service/server/SWServerWorker.h:
810
811 2018-12-21  Youenn Fablet  <youenn@apple.com>
812
813         RTCRtpSender.setParameters() does set active parameter
814         https://bugs.webkit.org/show_bug.cgi?id=192848
815
816         Reviewed by Eric Carlson.
817
818         Covered by updated test.
819
820         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
821         (WebCore::updateRTCRtpSendParameters):
822         The routine was updating the local value, not the out parameter.
823
824 2018-12-21  Eric Carlson  <eric.carlson@apple.com>
825
826         'ended' Event doesn't fire on MediaStreamTrack when a USB camera is unplugged
827         https://bugs.webkit.org/show_bug.cgi?id=187896
828         <rdar://problem/42681445>
829
830         Reviewed by Jer Noble.
831
832         No new tests, tested manually.
833
834         * platform/mediastream/mac/AVVideoCaptureSource.h:
835         * platform/mediastream/mac/AVVideoCaptureSource.mm:
836         (WebCore::AVVideoCaptureSource::deviceDisconnected):
837         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
838         (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
839         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
840         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
841         (WebCore::deviceHasInputStreams):
842         (WebCore::isValidCaptureDevice):
843         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
844         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
845         (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Deleted.
846         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
847         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
848         (WebCore::CoreAudioSharedUnit::setCaptureDevice):
849         (WebCore::CoreAudioSharedUnit::devicesChanged):
850         (WebCore::CoreAudioSharedUnit::startProducingData):
851         (WebCore::CoreAudioSharedUnit::startInternal):
852         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
853         (WebCore::CoreAudioSharedUnit::captureFailed):
854         (WebCore::CoreAudioCaptureSourceFactory::devicesChanged):
855         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
856         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID): Deleted.
857         * platform/mediastream/mac/CoreAudioCaptureSource.h:
858
859 2018-12-20  Ryosuke Niwa  <rniwa@webkit.org>
860
861         REGRESSION(r239353): iOS WK1 Assertion failure in notifyChildNodeRemoved while running
862         TestWebKitAPI.QuickLook.LegacyQuickLookContent
863         https://bugs.webkit.org/show_bug.cgi?id=192859
864         <rdar://problem/46887237>
865
866         Reviewed by Antti Koivisto.
867
868         After r239353, ScriptDisallowedScope::InMainThread::isScriptAllowed() may return false when the web thread
869         is inside a delegate callback even when there is a ScriptDisallowedScope defined.
870
871         Replace the existign debug assertions which assert !ScriptDisallowedScope::InMainThread::isScriptAllowed()
872         by a newly added ScriptDisallowedScope::InMainThread::hasDisallowedScope to avoid hitting this assertion.
873
874         Tests: TestWebKitAPI.QuickLook.LegacyQuickLookContent
875
876         * dom/ContainerNodeAlgorithms.cpp:
877         (WebCore::notifyChildNodeInserted):
878         (WebCore::notifyChildNodeRemoved):
879         * dom/Document.cpp:
880         (WebCore::Document::nodeChildrenWillBeRemoved):
881         (WebCore::Document::nodeWillBeRemoved):
882         * dom/ScriptDisallowedScope.h:
883         (WebCore::ScriptDisallowedScope::InMainThread::hasDisallowedScope):
884         * html/HTMLFormElement.cpp:
885         (WebCore:: const):
886
887 2018-12-21  Joseph Pecoraro  <pecoraro@apple.com>
888
889         Update status of some WebCore features in features.json
890         https://bugs.webkit.org/show_bug.cgi?id=192998
891
892         Reviewed by Tim Horton.
893
894         * features.json:
895         - Variation Fonts: Supported
896         - Conic Gradients: Supported in Preview
897         - Web Share: Supported in Preview
898         - <datalist>: Supported in Preview
899         - Intersection Observers: Supported in Preview
900
901 2018-12-21  Zalan Bujtas  <zalan@apple.com>
902
903         [iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIconDecorations()
904         https://bugs.webkit.org/show_bug.cgi?id=192357
905         <rdar://problem/42852260>
906
907         Reviewed by Simon Fraser.
908
909         Do not try to paint the file picker when painting is disabled.
910
911         * rendering/RenderFileUploadControl.cpp:
912         (WebCore::RenderFileUploadControl::paintObject):
913
914 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
915
916         [WebAuthN] userPresence should always be true
917         https://bugs.webkit.org/show_bug.cgi?id=192835
918         <rdar://problem/46538788>
919
920         Reviewed by Brent Fulgham.
921
922         In the current spec as of 7 August 2018, userPresence is suggested to set to the inverse of userVerification.
923         This doesn't comply with the CTAP spec. Details in: https://github.com/w3c/webauthn/issues/1123.
924         After discussing with other members of the working group, we decided to make userPresence always default to true.
925
926         Covered by exisiting tests.
927
928         * Modules/webauthn/fido/DeviceRequestConverter.cpp:
929         (fido::encodeGetAssertionRequestAsCBOR):
930
931 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
932
933         [WebAuthN] Import an APDU coder from Chromium
934         https://bugs.webkit.org/show_bug.cgi?id=192949
935         <rdar://problem/46879933>
936
937         Reviewed by Brent Fulgham.
938
939         This patch imports an APDU coder from Chromium. Here is the documentation:
940         https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing
941         APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2.
942
943         Here is a list of files that are imported from Chromium:
944         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090
945         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
946         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
947         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
948         https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
949
950         Covered by API tests.
951
952         * Modules/webauthn/apdu/ApduCommand.cpp: Added.
953         (apdu::ApduCommand::createFromMessage):
954         (apdu::ApduCommand::ApduCommand):
955         (apdu::ApduCommand::getEncodedCommand const):
956         * Modules/webauthn/apdu/ApduCommand.h: Added.
957         * Modules/webauthn/apdu/ApduResponse.cpp: Added.
958         (apdu::ApduResponse::createFromMessage):
959         (apdu::ApduResponse::ApduResponse):
960         (apdu::ApduResponse::getEncodedResponse const):
961         * Modules/webauthn/apdu/ApduResponse.h: Added.
962         * Sources.txt:
963         * WebCore.xcodeproj/project.pbxproj:
964
965 2018-12-21  Jer Noble  <jer.noble@apple.com>
966
967         Convert raw CDMSessionMediaSourceAVFObjC pointer in MediaPlayerPrivateMediaSourceAVFObjC
968         https://bugs.webkit.org/show_bug.cgi?id=192985
969         <rdar://problem/46750743>
970
971         Reviewed by Eric Carlson.
972
973         Make m_session a RefPtr; drive-by fix: make m_mediaElement in WebKitMediaKeys a WeakPtr.
974
975         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
976         (WebCore::WebKitMediaKeys::setMediaElement):
977         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
978         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
979         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
980         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
981         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
982         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
983
984 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
985
986         CSS variables don't work for colors in "border" property
987         https://bugs.webkit.org/show_bug.cgi?id=192922
988
989         Reviewed by Simon Fraser.
990
991         ParseColorFunction no longer consumes anything if the color was not valid.
992
993         Test: css-custom-properties-api/border-variable-parsing.html
994
995         * css/parser/CSSPropertyParserHelpers.cpp:
996         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
997
998 2018-12-21  Justin Fan  <justin_fan@apple.com>
999
1000         [WebGPU] GPUBindGroupLayout refactoring: no HashMap, and failure logging
1001         https://bugs.webkit.org/show_bug.cgi?id=192990
1002
1003         Reviewed by Myles C. Maxfield.
1004
1005         Refactor away the unnecessary HashMaps when creating MTLArgumentEncoders in GPUBindGroupLayout creation.
1006         Also update GPUBindGroupLayout::create -> tryCreate, in order to better handle Objective-C exceptions.
1007
1008         No new tests; no change in behavior.
1009
1010         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
1011         (WebCore::WebGPUBindGroupLayout::create):
1012         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
1013         * Modules/webgpu/WebGPUBindGroupLayout.h:
1014         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const):
1015         * Modules/webgpu/WebGPUDevice.cpp:
1016         (WebCore::WebGPUDevice::createBindGroupLayout const):
1017         * platform/graphics/gpu/GPUBindGroupLayout.h:
1018         * platform/graphics/gpu/GPUDevice.cpp:
1019         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Renamed from ::create*. Now returning a RefPtr. 
1020         (WebCore::GPUDevice::createBindGroupLayout const): Deleted.
1021         * platform/graphics/gpu/GPUDevice.h:
1022         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1023         (WebCore::appendArgumentToArray):
1024         (WebCore::newEncoder):
1025         (WebCore::GPUBindGroupLayout::tryCreate): Renamed from ::create. Now returning a RefPtr.
1026         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
1027         (WebCore::appendArgumentToArrayInMap): Deleted.
1028         (WebCore::GPUBindGroupLayout::create): Deleted.
1029
1030         Deleted unneeded GPUBindGroupLayout.cpp:
1031         * Sources.txt:
1032         * WebCore.xcodeproj/project.pbxproj:
1033         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Removed.
1034
1035 2018-12-21  Alejandro G. Castro  <alex@igalia.com>
1036
1037         [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
1038         https://bugs.webkit.org/show_bug.cgi?id=190466
1039
1040         Reviewed by Youenn Fablet.
1041
1042         Added persistency to the DeviceIdHashSaltStorage.
1043
1044         * platform/glib/FileSystemGlib.cpp:
1045         (WebCore::FileSystem::getFileSize): Implemented this function to
1046         allow sharing code with the statistics storage class.
1047         * platform/glib/KeyedDecoderGlib.cpp:
1048         (WebCore::KeyedDecoderGlib::dictionaryFromGVariant): Added a
1049         condition to control situations where the key is empty, it can
1050         happen if the user modifies the file in the disk.
1051         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: Add include
1052         to make work compilation with debug, unified builds.
1053
1054 2018-12-21  Zalan Bujtas  <zalan@apple.com>
1055
1056         Synchronous media query evaluation could destroy current Frame/FrameView.
1057         https://bugs.webkit.org/show_bug.cgi?id=192781
1058         <rdar://problem/34416793>
1059
1060         Reviewed by Chris Dumez.
1061
1062         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
1063
1064         Test: printing/print-with-media-query-destory.html
1065
1066         * loader/DocumentLoader.cpp:
1067         (WebCore::DocumentLoader::finishedLoading):
1068         * page/Frame.cpp:
1069         (WebCore::Frame::setPrinting):
1070         * page/FrameView.cpp:
1071         (WebCore::FrameView::forceLayoutForPagination):
1072         * page/PrintContext.cpp:
1073         (WebCore::PrintContext::PrintContext):
1074         (WebCore::PrintContext::computePageRects):
1075         (WebCore::PrintContext::computePageRectsWithPageSizeInternal):
1076         (WebCore::PrintContext::begin):
1077         (WebCore::PrintContext::computeAutomaticScaleFactor):
1078         (WebCore::PrintContext::spoolPage):
1079         (WebCore::PrintContext::spoolRect):
1080         (WebCore::PrintContext::end):
1081         * page/PrintContext.h:
1082         (WebCore::PrintContext::frame const): Deleted.
1083
1084 2018-12-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1085
1086         Setting the file wrapper and content type of an attachment to a PDF should update its image
1087         https://bugs.webkit.org/show_bug.cgi?id=192984
1088         <rdar://problem/46798028>
1089
1090         Reviewed by Tim Horton.
1091
1092         Allow PDF data to be used to update enclosing image elements when setting the file wrapper for an attachment.
1093         Covered by a new API test: WKAttachmentTests.SetFileWrapperForPDFImageAttachment.
1094
1095         * html/HTMLAttachmentElement.cpp:
1096         (WebCore::mimeTypeIsSuitableForInlineImageAttachment):
1097         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
1098
1099 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
1100
1101         Repeated background images with zero size should display the background color
1102         https://bugs.webkit.org/show_bug.cgi?id=192962
1103
1104         Reviewed by Antti Koivisto.
1105
1106         Test: fast/backgrounds/background-repeat-with-zero-size.html
1107
1108         * platform/LengthSize.h:
1109         (WebCore::LengthSize::isEmpty const):
1110         * rendering/RenderBoxModelObject.cpp:
1111         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1112         * rendering/style/FillLayer.h:
1113         (WebCore::FillLayer::isEmpty const):
1114
1115 2018-12-21  Manuel Rego Casasnovas  <rego@igalia.com>
1116
1117         [css-grid] Fix percentages in relative offsets for grid items
1118         https://bugs.webkit.org/show_bug.cgi?id=190492
1119
1120         Reviewed by Sergio Villar Senin.
1121
1122         The method RenderBoxModelObject::relativePositionOffset() was not considering the case of grid items,
1123         where the containing block is the grid area.
1124         The patch modifies the method so the new code uses overrideContainingBlockContentWidth|Height when required.
1125
1126         Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html
1127
1128         * rendering/RenderBox.cpp: Implement the physical versions of the already existent methods.
1129         (WebCore::RenderBox::overrideContainingBlockContentWidth const):
1130         (WebCore::RenderBox::overrideContainingBlockContentHeight const):
1131         (WebCore::RenderBox::hasOverrideContainingBlockContentWidth const):
1132         (WebCore::RenderBox::hasOverrideContainingBlockContentHeight const):
1133         * rendering/RenderBox.h:
1134         * rendering/RenderBoxModelObject.cpp:
1135         (WebCore::RenderBoxModelObject::relativePositionOffset const): Modified method
1136         to take into account overrideContainingBlockContentWidth|Height for grid items.
1137         * rendering/RenderBoxModelObject.h: Added new headers for physical virtual methods
1138         that will be overridden in RenderBox.
1139         (WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const):
1140         (WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const):
1141         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const):
1142         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const):
1143
1144 2018-12-20  Justin Fan  <justin_fan@apple.com>
1145
1146         [WebGPU] Convert WebGPUBindGroups into MTLArgumentEncoders
1147         https://bugs.webkit.org/show_bug.cgi?id=192956
1148
1149         Reviewed by Myles Maxfield.
1150
1151         No testable behavior change. Existing tests cover possible crashing.
1152
1153         Add GPUBindGroupLayoutMetal.mm:
1154         * SourcesCocoa.txt:
1155         * WebCore.xcodeproj/project.pbxproj:
1156
1157         Flesh out GPUBindGroupLayout::create:
1158         * platform/graphics/gpu/GPUBindGroupLayout.cpp:
1159         * platform/graphics/gpu/GPUBindGroupLayout.h:
1160         * platform/graphics/gpu/GPUDevice.cpp:
1161         (WebCore::GPUDevice::createBindGroupLayout const):
1162         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Added.
1163         (WebCore::appendArgumentToArrayInMap): Added.
1164         (WebCore::GPUBindGroupLayout::create):
1165         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
1166         (WebCore::MTLDataTypeForBindingType): Added.
1167
1168 2018-12-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1169
1170         Unreviewed, remove stray #pragma once added to .cpp file
1171
1172         * svg/properties/SVGAttributeOwnerProxy.cpp:
1173
1174 2018-12-20  Justin Michaud  <justin_michaud@apple.com>
1175
1176         Adding runtime-enabled attribute to Element prevents inlining property access
1177         https://bugs.webkit.org/show_bug.cgi?id=192901
1178
1179         Add a call to flattenDictionaryObject after disabling runtime-enabled attributes.
1180
1181         Reviewed by Ryosuke Niwa.
1182
1183         * bindings/scripts/CodeGeneratorJS.pm:
1184         (GenerateImplementation):
1185         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1186         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
1187         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1188         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
1189         * bindings/scripts/test/JS/JSTestNode.cpp:
1190         (WebCore::JSTestNodePrototype::finishCreation):
1191         * bindings/scripts/test/JS/JSTestObj.cpp:
1192         (WebCore::JSTestObjPrototype::finishCreation):
1193
1194 2018-12-20  Chris Dumez  <cdumez@apple.com>
1195
1196         Use Optional::hasValue() instead of Optional::has_value()
1197         https://bugs.webkit.org/show_bug.cgi?id=192948
1198
1199         Reviewed by Tim Horton.
1200
1201         * bindings/js/DOMPromiseProxy.h:
1202         (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const):
1203         (WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const):
1204         (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const):
1205         * dom/DataTransferItemList.h:
1206         (WebCore::DataTransferItemList::hasItems const):
1207         * dom/EventTarget.cpp:
1208         (WebCore::EventTarget::addEventListener):
1209         * html/HTMLMediaElement.cpp:
1210         (WebCore::HTMLMediaElement::captionDisplayMode):
1211         * platform/graphics/MediaPlayer.cpp:
1212         (WebCore::MediaPlayer::wouldTaintOrigin const):
1213         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1214         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1215         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1216         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
1217         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1218         (webKitMediaSrcUpdatePresentationSize):
1219         * platform/mac/NSScrollerImpDetails.mm:
1220         (WebCore::ScrollerStyle::recommendedScrollerStyle):
1221         * rendering/RenderListItem.cpp:
1222         (WebCore::RenderListItem::setExplicitValue):
1223
1224 2018-12-20  Chris Dumez  <cdumez@apple.com>
1225
1226         Move HTTPS_UPGRADE code behind a runtime flag, off by default
1227         https://bugs.webkit.org/show_bug.cgi?id=192937
1228
1229         Reviewed by Youenn Fablet.
1230
1231         Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
1232
1233         * page/Settings.yaml:
1234
1235 2018-12-20  Youenn Fablet  <youenn@apple.com>
1236
1237         Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader
1238         https://bugs.webkit.org/show_bug.cgi?id=192838
1239
1240         Reviewed by Chris Dumez.
1241
1242         Generate constructor code in case of a Private but not Public constructor.
1243         Make sure this is correctly exposed in global objects.
1244         Add JS built-in constructor implementations for those two objects.
1245
1246         Also add JS built-in constructors for controller and byob request.
1247         To keep existing behavior, JS built-ins calling these constructors need to pass
1248         an additional parameter that allows making the difference between a JS builtin caller or a JS caller.
1249         In the latter case, the constructor will throw.
1250
1251         Covered by existing tests, no observable change of behavior.
1252
1253         * Modules/streams/ReadableByteStreamController.idl:
1254         * Modules/streams/ReadableByteStreamController.js:
1255         (initializeReadableByteStreamController):
1256         (getter.byobRequest):
1257         * Modules/streams/ReadableByteStreamInternals.js:
1258         (privateInitializeReadableByteStreamController): Deleted.
1259         (privateInitializeReadableStreamBYOBRequest): Deleted.
1260         * Modules/streams/ReadableStream.js:
1261         (initializeReadableStream):
1262         * Modules/streams/ReadableStreamBYOBReader.js:
1263         (initializeReadableStreamBYOBReader):
1264         * Modules/streams/ReadableStreamBYOBRequest.idl:
1265         * Modules/streams/ReadableStreamBYOBRequest.js:
1266         (initializeReadableStreamBYOBRequest):
1267         * Modules/streams/ReadableStreamDefaultController.idl:
1268         * Modules/streams/ReadableStreamDefaultController.js:
1269         (initializeReadableStreamDefaultController):
1270         (enqueue):
1271         * Modules/streams/ReadableStreamDefaultReader.js:
1272         (initializeReadableStreamDefaultReader):
1273         * Modules/streams/ReadableStreamInternals.js:
1274         (readableStreamDefaultControllerError): Deleted.
1275         * Sources.txt:
1276         * UnifiedSources-input.xcfilelist:
1277         * WebCore.xcodeproj/project.pbxproj:
1278         * bindings/js/JSDOMBuiltinConstructor.h:
1279         * bindings/js/JSDOMGlobalObject.cpp:
1280         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1281         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Removed.
1282         * bindings/js/JSReadableStreamPrivateConstructors.h: Removed.
1283         * bindings/scripts/CodeGeneratorJS.pm:
1284         (GeneratePropertiesHashTable):
1285         * bindings/scripts/preprocess-idls.pl:
1286         (shouldExposeInterface):
1287
1288 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
1289
1290         [WebAuthN] Remove hash from Client Data
1291         https://bugs.webkit.org/show_bug.cgi?id=192727
1292         <rdar://problem/46746673>
1293
1294         Reviewed by Brent Fulgham.
1295
1296         The hash algorithm for hashing the client data is enforced to SHA_256 in the latest spec:
1297         https://www.w3.org/TR/webauthn/#sec-client-data. Therefore, we should remove it.
1298
1299         Covered by existing tests.
1300
1301         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1302         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson):
1303
1304 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
1305
1306         [WebAuthN] Add a runtime flag for local authenticator
1307         https://bugs.webkit.org/show_bug.cgi?id=192792
1308         <rdar://problem/46798738>
1309
1310         Reviewed by Brent Fulgham.
1311
1312         No tests.
1313
1314         This patch adds a runtime flag for local authenticator and removes ways to
1315         set the runtime flag for web authentication in LegacyWebKit.
1316
1317         * page/RuntimeEnabledFeatures.h:
1318         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled):
1319         (WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const):
1320
1321 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
1322
1323         Pointer lock causes abandoned documents
1324         https://bugs.webkit.org/show_bug.cgi?id=188727
1325         rdar://problem/44248197
1326         
1327         Reviewed by Simon Fraser.
1328
1329         Fixes --world-leaks in these tests:
1330
1331         pointer-lock/locked-element-removed-from-dom.html
1332         pointer-lock/mouse-event-delivery.html
1333         fast/shadow-dom/pointerlockelement-in-slot.html
1334
1335         PointerLockController now uses WeakPtr instead of RefPtr because it has no need to extend the lifetime of a document.
1336
1337         * page/PointerLockController.cpp:
1338         (WebCore::PointerLockController::elementRemoved):
1339         (WebCore::PointerLockController::documentDetached):
1340         (WebCore::PointerLockController::didAcquirePointerLock):
1341         * page/PointerLockController.h:
1342
1343 2018-12-20  Chris Dumez  <cdumez@apple.com>
1344
1345         Use Optional::valueOr() instead of Optional::value_or()
1346         https://bugs.webkit.org/show_bug.cgi?id=192933
1347
1348         Reviewed by Geoffrey Garen.
1349
1350         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1351         (WebCore::convert):
1352         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
1353         * Modules/encryptedmedia/MediaKeySession.cpp:
1354         (WebCore::MediaKeySession::load):
1355         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1356         (WebCore::IDBDatabaseIdentifier::hash const):
1357         * Modules/indexeddb/IDBFactory.cpp:
1358         (WebCore::IDBFactory::open):
1359         * Modules/mediastream/MediaStreamTrack.cpp:
1360         (WebCore::MediaStreamTrack::applyConstraints):
1361         * Modules/mediastream/RTCDTMFSender.cpp:
1362         (WebCore::RTCDTMFSender::insertDTMF):
1363         * Modules/webdatabase/SQLTransaction.cpp:
1364         (WebCore::SQLTransaction::executeSql):
1365         * Modules/webvr/VRFrameData.cpp:
1366         (WebCore::VRFrameData::update):
1367         * animation/AnimationTimeline.cpp:
1368         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
1369         * animation/DeclarativeAnimation.cpp:
1370         (WebCore::DeclarativeAnimation::cancel):
1371         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
1372         * animation/KeyframeEffect.cpp:
1373         (WebCore::computeMissingKeyframeOffsets):
1374         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
1375         * animation/WebAnimation.cpp:
1376         (WebCore::WebAnimation::runPendingPlayTask):
1377         (WebCore::WebAnimation::runPendingPauseTask):
1378         * bindings/js/SerializedScriptValue.cpp:
1379         (WebCore::CloneSerializer::write):
1380         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1381         (WebCore::CryptoAlgorithmHMAC::generateKey):
1382         (WebCore::CryptoAlgorithmHMAC::importKey):
1383         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
1384         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1385         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1386         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1387         (WebCore::CryptoKeyRSA::importSpki):
1388         (WebCore::CryptoKeyRSA::importPkcs8):
1389         * crypto/keys/CryptoKeyRSA.cpp:
1390         (WebCore::CryptoKeyRSA::importJwk):
1391         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
1392         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1393         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1394         * crypto/mac/CryptoKeyRSAMac.cpp:
1395         (WebCore::CryptoKeyRSA::importSpki):
1396         (WebCore::CryptoKeyRSA::importPkcs8):
1397         * css/CSSComputedStyleDeclaration.cpp:
1398         (WebCore::counterToCSSValue):
1399         * css/CSSFontFace.cpp:
1400         (WebCore::calculateItalicRange):
1401         * css/CSSPrimitiveValue.cpp:
1402         (WebCore::CSSPrimitiveValue::doubleValue const):
1403         * css/CSSStyleSheet.cpp:
1404         (WebCore::CSSStyleSheet::addRule):
1405         * css/DOMMatrix.cpp:
1406         (WebCore::DOMMatrix::rotateSelf):
1407         * css/DOMMatrixReadOnly.cpp:
1408         (WebCore::DOMMatrixReadOnly::validateAndFixup):
1409         * css/StyleBuilderCustom.h:
1410         (WebCore::StyleBuilderCustom::applyValueCounter):
1411         * css/parser/MediaQueryParser.cpp:
1412         (WebCore::MediaQueryParser::commitMediaQuery):
1413         * dom/Document.h:
1414         (WebCore::Document::referrerPolicy const):
1415         * dom/Element.cpp:
1416         (WebCore::toScrollAlignment):
1417         * dom/EventTarget.cpp:
1418         (WebCore::EventTarget::addEventListener):
1419         * dom/MutationObserver.cpp:
1420         (WebCore::MutationObserver::observe):
1421         * editing/cocoa/FontAttributeChangesCocoa.mm:
1422         (WebCore::FontChanges::platformFontFamilyNameForCSS const):
1423         * fileapi/File.cpp:
1424         (WebCore::File::File):
1425         * html/DOMTokenList.cpp:
1426         (WebCore::DOMTokenList::toggle):
1427         * html/HTMLOListElement.h:
1428         * html/ImageBitmap.cpp:
1429         (WebCore::croppedSourceRectangleWithFormatting):
1430         * html/canvas/CanvasPattern.cpp:
1431         (WebCore::CanvasPattern::setTransform):
1432         * html/canvas/CanvasRenderingContext2DBase.cpp:
1433         (WebCore::CanvasRenderingContext2DBase::setTransform):
1434         (WebCore::CanvasRenderingContext2DBase::isPointInPathInternal):
1435         (WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal):
1436         * html/canvas/Path2D.cpp:
1437         (WebCore::Path2D::addPath):
1438         * inspector/InspectorCanvas.cpp:
1439         (WebCore::InspectorCanvas::buildAction):
1440         * inspector/InspectorFrontendHost.cpp:
1441         (WebCore::populateContextMenu):
1442         * layout/FormattingContext.cpp:
1443         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1444         * layout/FormattingContextGeometry.cpp:
1445         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1446         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1447         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1448         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1449         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1450         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1451         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
1452         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1453         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1454         * layout/FormattingContextQuirks.cpp:
1455         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1456         * layout/MarginTypes.h:
1457         (WebCore::Layout::VerticalMargin::usedValues const):
1458         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1459         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1460         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1461         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
1462         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1463         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1464         * layout/displaytree/DisplayBox.h:
1465         (WebCore::Display::Box::width const):
1466         (WebCore::Display::Box::height const):
1467         (WebCore::Display::Box::contentBoxTop const):
1468         (WebCore::Display::Box::contentBoxLeft const):
1469         * layout/floats/FloatingContext.cpp:
1470         (WebCore::Layout::Iterator::set):
1471         * layout/inlineformatting/InlineFormattingContext.cpp:
1472         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
1473         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
1474         * loader/FrameLoader.cpp:
1475         (WebCore::FrameLoader::urlSelected):
1476         * loader/NavigationAction.cpp:
1477         * page/FrameView.cpp:
1478         (WebCore::FrameView::setLayoutViewportOverrideRect):
1479         (WebCore::FrameView::documentToAbsoluteScaleFactor const):
1480         (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
1481         * page/Page.cpp:
1482         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
1483         * page/SecurityOriginData.cpp:
1484         (WebCore::SecurityOriginData::databaseIdentifier const):
1485         * page/SecurityOriginData.h:
1486         (WebCore::SecurityOriginDataHash::hash):
1487         * page/SecurityOriginHash.h:
1488         (WebCore::SecurityOriginHash::hash):
1489         * page/ViewportConfiguration.cpp:
1490         (WebCore::ViewportConfiguration::setViewLayoutSize):
1491         * page/WindowFeatures.cpp:
1492         (WebCore::parseDialogFeatures):
1493         * page/animation/AnimationBase.cpp:
1494         (WebCore::AnimationBase::updateStateMachine):
1495         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
1496         (WebCore::AnimationBase::getTimeToNextEvent const):
1497         (WebCore::AnimationBase::freezeAtTime):
1498         (WebCore::AnimationBase::getElapsedTime const):
1499         * page/animation/CSSAnimationController.cpp:
1500         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
1501         * page/cocoa/ResourceUsageThreadCocoa.mm:
1502         (WebCore::ResourceUsageThread::platformThreadBody):
1503         * page/linux/ResourceUsageThreadLinux.cpp:
1504         (WebCore::ResourceUsageThread::platformThreadBody):
1505         * platform/graphics/ComplexTextController.cpp:
1506         (WebCore::ComplexTextController::offsetForPosition):
1507         * platform/graphics/FontCache.h:
1508         (WebCore::FontDescriptionKey::computeHash const):
1509         * platform/graphics/FontCascade.cpp:
1510         (WebCore::FontCascade::drawText const):
1511         (WebCore::FontCascade::drawEmphasisMarks const):
1512         (WebCore::FontCascade::displayListForTextRun const):
1513         (WebCore::FontCascade::adjustSelectionRectForText const):
1514         (WebCore::FontCascade::codePath const):
1515         * platform/graphics/FontSelectionAlgorithm.cpp:
1516         (WebCore::FontSelectionAlgorithm::styleDistance const):
1517         * platform/graphics/FontSelectionAlgorithm.h:
1518         (WebCore::operator<<):
1519         (WebCore::FontSelectionSpecifiedCapabilities::computeWeight const):
1520         (WebCore::FontSelectionSpecifiedCapabilities::computeWidth const):
1521         (WebCore::FontSelectionSpecifiedCapabilities::computeSlope const):
1522         * platform/graphics/ShadowBlur.cpp:
1523         (WebCore::ShadowBlur::calculateLayerBoundingRect):
1524         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1525         (WebCore::WebCoreAVCFResourceLoader::startLoading):
1526         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1527         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1528         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1529         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
1530         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1531         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
1532         * platform/graphics/ca/GraphicsLayerCA.cpp:
1533         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
1534         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1535         (WebCore::preparePlatformFont):
1536         * platform/graphics/filters/FETurbulence.cpp:
1537         (WebCore::FETurbulence::fillRegion const):
1538         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1539         (WebCore::initializeGStreamer):
1540         * platform/graphics/texmap/TextureMapperLayer.cpp:
1541         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
1542         (WebCore::TextureMapperLayer::replicaTransform):
1543         (WebCore::TextureMapperLayer::syncAnimations):
1544         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1545         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
1546         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
1547         * platform/graphics/transforms/TransformState.cpp:
1548         (WebCore::TransformState::mappedPoint const):
1549         (WebCore::TransformState::mapQuad const):
1550         (WebCore::TransformState::flattenWithTransform):
1551         * platform/network/CacheValidation.cpp:
1552         (WebCore::computeCurrentAge):
1553         (WebCore::computeFreshnessLifetimeForHTTPFamily):
1554         * platform/network/NetworkStateNotifier.cpp:
1555         (WebCore::NetworkStateNotifier::onLine):
1556         * rendering/FloatingObjects.cpp:
1557         (WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom const):
1558         (WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom const):
1559         * rendering/GridBaselineAlignment.cpp:
1560         (WebCore::GridBaselineAlignment::ascentForChild const):
1561         * rendering/GridTrackSizingAlgorithm.cpp:
1562         (WebCore::GridTrack::setGrowthLimit):
1563         (WebCore::GridTrackSizingAlgorithm::initialBaseSize const):
1564         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit const):
1565         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
1566         (WebCore::sortByGridTrackGrowthPotential):
1567         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
1568         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1569         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
1570         * rendering/PaintInfo.h:
1571         (WebCore::PaintInfo::applyTransform):
1572         * rendering/RenderBox.cpp:
1573         (WebCore::RenderBox::computeLogicalHeight const):
1574         * rendering/RenderCounter.cpp:
1575         (WebCore::planCounter):
1576         * rendering/RenderDeprecatedFlexibleBox.cpp:
1577         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1578         * rendering/RenderFlexibleBox.cpp:
1579         (WebCore::RenderFlexibleBox::baselinePosition const):
1580         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
1581         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
1582         * rendering/RenderGrid.cpp:
1583         (WebCore::RenderGrid::gridGap const):
1584         (WebCore::RenderGrid::baselinePosition const):
1585         * rendering/RenderLayer.cpp:
1586         (WebCore::RenderLayer::paintLayerByApplyingTransform):
1587         * rendering/RenderListBox.cpp:
1588         (WebCore::RenderListBox::paintItem):
1589         (WebCore::RenderListBox::listIndexIsVisible):
1590         * rendering/RenderMultiColumnSet.cpp:
1591         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight const):
1592         * rendering/RenderTable.cpp:
1593         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
1594         * rendering/RenderTableCell.cpp:
1595         (WebCore::RenderTableCell::cellBaselinePosition const):
1596         * rendering/RenderTableSection.cpp:
1597         (WebCore::RenderTableSection::firstLineBaseline const):
1598         * rendering/RenderText.cpp:
1599         (WebCore::RenderText::computePreferredLogicalWidths):
1600         (WebCore::RenderText::previousOffset const):
1601         (WebCore::RenderText::previousOffsetForBackwardDeletion const):
1602         (WebCore::RenderText::nextOffset const):
1603         (WebCore::RenderText::stringView const):
1604         * rendering/RenderView.cpp:
1605         (WebCore::RenderView::layout):
1606         * rendering/mathml/RenderMathMLBlock.cpp:
1607         (WebCore::RenderMathMLBlock::baselinePosition const):
1608         * rendering/mathml/RenderMathMLBlock.h:
1609         (WebCore::RenderMathMLBlock::ascentForChild):
1610         * rendering/style/GridPosition.cpp:
1611         (WebCore::GridPosition::max):
1612         * rendering/style/TextUnderlineOffset.h:
1613         (WebCore::TextUnderlineOffset::lengthOr const):
1614         * rendering/svg/RenderSVGContainer.cpp:
1615         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
1616         * rendering/svg/RenderSVGForeignObject.cpp:
1617         (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
1618         * rendering/svg/RenderSVGImage.cpp:
1619         (WebCore::RenderSVGImage::nodeAtFloatPoint):
1620         * rendering/svg/RenderSVGResourceClipper.cpp:
1621         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
1622         * rendering/svg/RenderSVGResourceFilter.cpp:
1623         (WebCore::RenderSVGResourceFilter::postApplyResource):
1624         * rendering/svg/RenderSVGRoot.cpp:
1625         (WebCore::RenderSVGRoot::nodeAtPoint):
1626         * rendering/svg/RenderSVGShape.cpp:
1627         (WebCore::RenderSVGShape::nodeAtFloatPoint):
1628         * rendering/svg/RenderSVGText.cpp:
1629         (WebCore::RenderSVGText::nodeAtFloatPoint):
1630         * rendering/svg/SVGRenderingContext.cpp:
1631         (WebCore::SVGRenderingContext::clipToImageBuffer):
1632         * svg/SVGToOTFFontConversion.cpp:
1633         (WebCore::SVGToOTFFontConverter::processGlyphElement):
1634         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
1635
1636 2018-12-20  Jer Noble  <jer.noble@apple.com>
1637
1638         REGRESSION (r239419): heap-use-after-free in AudioSourceProviderAVFObjC::finalizeCallback()
1639         https://bugs.webkit.org/show_bug.cgi?id=192941
1640         <rdar://problem/46874096>
1641
1642         Reviewed by Brent Fulgham.
1643
1644         Don't delete the locked lock before unlocking the lock. 
1645
1646         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1647         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
1648
1649 2018-12-20  Keith Rollin  <krollin@apple.com>
1650
1651         Improve release-level page-load logging
1652         https://bugs.webkit.org/show_bug.cgi?id=192872
1653         <rdar://problem/46850309>
1654
1655         Reviewed by Chris Dumez.
1656
1657         There are a number of reported bugs that are difficult or impossible
1658         to track down with our current level of logging. Additionally, some
1659         software groups lower in the page-loading stack have requested logging
1660         sufficient for tracking a user-visible error message down to the
1661         requested resource that caused the message. Add more-comprehensive
1662         logging to address these issues/requests.
1663
1664         No new tests -- no changed functionality.
1665
1666         * loader/DocumentLoader.cpp:
1667         (WebCore::DocumentLoader::setMainDocumentError):
1668         (WebCore::DocumentLoader::mainReceivedError):
1669         (WebCore::DocumentLoader::stopLoading):
1670         (WebCore::DocumentLoader::notifyFinished):
1671         (WebCore::DocumentLoader::willSendRequest):
1672         (WebCore::DocumentLoader::continueAfterContentPolicy):
1673         (WebCore::DocumentLoader::startLoadingMainResource):
1674         (WebCore::DocumentLoader::loadMainResource):
1675         (WebCore::DocumentLoader::cancelMainResourceLoad):
1676         * loader/FrameLoader.cpp:
1677         (WebCore::FrameLoader::urlSelected):
1678         (WebCore::FrameLoader::loadURLIntoChildFrame):
1679         (WebCore::FrameLoader::loadArchive):
1680         (WebCore::FrameLoader::loadInSameDocument):
1681         (WebCore::FrameLoader::loadFrameRequest):
1682         (WebCore::FrameLoader::loadURL):
1683         (WebCore::FrameLoader::load):
1684         (WebCore::FrameLoader::loadWithNavigationAction):
1685         (WebCore::FrameLoader::loadWithDocumentLoader):
1686         (WebCore::FrameLoader::reloadWithOverrideEncoding):
1687         (WebCore::FrameLoader::reload):
1688         (WebCore::FrameLoader::setState):
1689         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1690         (WebCore::FrameLoader::loadPostRequest):
1691         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1692         (WebCore::FrameLoader::loadDifferentDocumentItem):
1693         * loader/ProgressTracker.cpp:
1694         (WebCore::ProgressItem::ProgressItem):
1695         (WebCore::ProgressTracker::reset):
1696         (WebCore::ProgressTracker::progressStarted):
1697         (WebCore::ProgressTracker::progressCompleted):
1698         (WebCore::ProgressTracker::finalProgressComplete):
1699         (WebCore::ProgressTracker::incrementProgress):
1700         (WebCore::ProgressTracker::completeProgress):
1701         (WebCore::ProgressTracker::isAlwaysOnLoggingAllowed const):
1702         * loader/ProgressTracker.h:
1703         * loader/ResourceLoader.cpp:
1704         (WebCore::ResourceLoader::loadDataURL):
1705         (WebCore::ResourceLoader::willSendRequestInternal):
1706         (WebCore::ResourceLoader::didFinishLoading):
1707         (WebCore::ResourceLoader::didFail):
1708         (WebCore::ResourceLoader::willSendRequestAsync):
1709         (WebCore::ResourceLoader::wasBlocked):
1710         (WebCore::ResourceLoader::cannotShowURL):
1711         * loader/SubresourceLoader.cpp:
1712         (WebCore::SubresourceLoader::willSendRequestInternal):
1713         (WebCore::=):
1714         (WebCore::SubresourceLoader::didReceiveResponse):
1715         (WebCore::SubresourceLoader::didFinishLoading):
1716         (WebCore::SubresourceLoader::didFail):
1717         (WebCore::SubresourceLoader::willCancel):
1718         * loader/cache/CachedResource.cpp:
1719         (WebCore::CachedResource::load):
1720
1721 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
1722
1723         Switch tabs before retuning PiP video to inline.
1724         https://bugs.webkit.org/show_bug.cgi?id=192767
1725         rdar://problem/46006046
1726
1727         Reviewed by Jer Noble.
1728
1729         No new tests because this code path only happens with a user action on system UI.
1730
1731         When exiting PiP, notify the fullscreen change observer so it can restore client UI state before exiting.
1732
1733         * platform/mac/VideoFullscreenInterfaceMac.mm:
1734         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
1735
1736 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
1737
1738         Unreviewed, fix GTK build after r239410
1739
1740         It added a new file to the build, breaking the unified sources magic that obscured a bug in
1741         URLSoup.h. It forward-declares URL, but this never worked unless the URL.h header was
1742         included via another source file in the unified source bundle.
1743
1744         * platform/network/soup/URLSoup.h:
1745
1746 2018-12-19  Chris Dumez  <cdumez@apple.com>
1747
1748         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
1749         https://bugs.webkit.org/show_bug.cgi?id=192728
1750         <rdar://problem/46746779>
1751
1752         Reviewed by Geoff Garen.
1753
1754         * Modules/*:
1755         * animation/*:
1756         * bindings/*:
1757         * crypto/*:
1758         * css/*:
1759         * dom/*:
1760         * editing/*:
1761         * fileapi/*:
1762         * html/*:
1763         * inspector/*:
1764         * layout/*:
1765         * loader/*:
1766         * mathml/*:
1767         * page/*:
1768         * platform/*:
1769         * plugins/*:
1770         * rendering/*:
1771         * testing/*:
1772         * workers/*:
1773         * xml/*:
1774
1775 2018-12-19  Jer Noble  <jer.noble@apple.com>
1776
1777         Leak of MTAudioProcessingTap (304 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
1778         https://bugs.webkit.org/show_bug.cgi?id=192896
1779         <rdar://46732186>
1780
1781         Reviewed by Eric Carlson.
1782
1783         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1784         (WebCore::AudioSourceProviderAVFObjC::initCallback):
1785
1786 2018-12-19  Timothy Hatcher  <timothy@apple.com>
1787
1788         REGRESSION (r232991): Switching to dark mode in Mail does not update the message view to be transparent
1789         https://bugs.webkit.org/show_bug.cgi?id=188891
1790         rdar://problem/42344352
1791
1792         Reviewed by Simon Fraser.
1793
1794         * rendering/RenderLayerCompositor.cpp:
1795         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
1796         Don't return early when m_layerForOverhangAreas is null to avoid skipping
1797         setRootLayerConfigurationNeedsUpdate() and scheduleCompositingLayerUpdate().
1798
1799 2018-12-19  Justin Fan  <justin_fan@apple.com>
1800
1801         [WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
1802         https://bugs.webkit.org/show_bug.cgi?id=192843
1803         <rdar://problem/46820395>
1804
1805         Reviewed by Myles Maxfield.
1806
1807         Test: webgpu/pipeline-layouts.html
1808
1809         Implement the emtpy WebGPUPipelineLayout interface, and enable creation via WebGPUDevice::createPipelineLayout:
1810         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
1811         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
1812         * Modules/webgpu/WebGPUBindGroupLayout.h:
1813         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const): Added getter.
1814         * Modules/webgpu/WebGPUDevice.cpp:
1815         (WebCore::WebGPUDevice::createPipelineLayout const): Added.
1816         * Modules/webgpu/WebGPUDevice.h:
1817         * Modules/webgpu/WebGPUDevice.idl: Enable createPipelineLayout.
1818         * Modules/webgpu/WebGPUPipelineLayout.cpp: Added.
1819         (WebCore::WebGPUPipelineLayout::create):
1820         (WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout):
1821         * Modules/webgpu/WebGPUPipelineLayout.h: Added.
1822         * Modules/webgpu/WebGPUPipelineLayout.idl: Added.
1823         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Added.
1824         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Added.
1825         * platform/graphics/gpu/GPUDevice.cpp:
1826         (WebCore::GPUDevice::createPipelineLayout const): Added.
1827         * platform/graphics/gpu/GPUDevice.h:
1828         * platform/graphics/gpu/GPUPipelineLayout.cpp: Added.
1829         (WebCore::GPUPipelineLayout::create):
1830         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
1831         * platform/graphics/gpu/GPUPipelineLayout.h: Added.
1832         * platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Added.
1833
1834         Add files and symbols to project:
1835         * CMakeLists.txt:
1836         * DerivedSources.make:
1837         * Sources.txt:
1838         * WebCore.xcodeproj/project.pbxproj:
1839         * bindings/js/WebCoreBuiltinNames.h:
1840
1841         Add missing include:
1842         * Modules/webgpu/WebGPUQueue.h:
1843
1844 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
1845
1846         SVGUseElement::findTarget should return nullptr when there is a cycle
1847         https://bugs.webkit.org/show_bug.cgi?id=192840
1848
1849         Reviewed by Tim Horton.
1850
1851         r233366 added an early return to updateShadowTree() when there is a cycle between an use element and its target.
1852         Consolidate this cycle detection code with the one in SVGUseElement::findTarget which detected cycles when
1853         the SVG use element itself had a corresponding element.
1854
1855         No new tests since there should be no behavioral change.
1856
1857         * svg/SVGUseElement.cpp:
1858         (WebCore::SVGUseElement::updateShadowTree):
1859         (WebCore::SVGUseElement::findTarget const):
1860
1861 2018-12-19  Myles C. Maxfield  <mmaxfield@apple.com>
1862
1863         [WHLSL] Add a handwritten lexer
1864         https://bugs.webkit.org/show_bug.cgi?id=192294
1865
1866         Reviewed by Jon Lee.
1867
1868         This is infrastructure necessary for https://bugs.webkit.org/show_bug.cgi?id=192355. The
1869         implementation matches the lexing rules in the spec (specifically, the rules that start
1870         with an uppercase letter). The spec is at
1871         https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4.
1872
1873         This patch also modifies the lexer according to https://github.com/gpuweb/WHLSL/pull/283.
1874
1875         No new tests because the lexer isn't hooked up yet; there are tests in the parser,
1876         once that gets committed.
1877
1878         * Modules/webgpu/WHLSL/WHLSLLexer.cpp: Added.
1879         (WebCore::WHLSL::Lexer::Token::typeName):
1880         (WebCore::WHLSL::Lexer::recognizeKeyword):
1881         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
1882         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
1883         (WebCore::WHLSL::isWhitespace):
1884         (WebCore::WHLSL::isNewline):
1885         (WebCore::WHLSL::Lexer::skipWhitespace):
1886         (WebCore::WHLSL::Lexer::skipLineComment):
1887         (WebCore::WHLSL::Lexer::skipLongComment):
1888         (WebCore::WHLSL::Lexer::coreDecimalIntLiteral const):
1889         (WebCore::WHLSL::Lexer::decimalIntLiteral const):
1890         (WebCore::WHLSL::Lexer::decimalUintLiteral const):
1891         (WebCore::WHLSL::isHexadecimalCharacter):
1892         (WebCore::WHLSL::Lexer::coreHexadecimalIntLiteral const):
1893         (WebCore::WHLSL::Lexer::hexadecimalIntLiteral const):
1894         (WebCore::WHLSL::Lexer::hexadecimalUintLiteral const):
1895         (WebCore::WHLSL::Lexer::intLiteral const):
1896         (WebCore::WHLSL::Lexer::uintLiteral const):
1897         (WebCore::WHLSL::Lexer::digit const):
1898         (WebCore::WHLSL::Lexer::digitStar const):
1899         (WebCore::WHLSL::Lexer::character const):
1900         (WebCore::WHLSL::Lexer::coreFloatLiteralType1 const):
1901         (WebCore::WHLSL::Lexer::coreFloatLiteral const):
1902         (WebCore::WHLSL::Lexer::floatLiteral const):
1903         (WebCore::WHLSL::Lexer::validIdentifier const):
1904         (WebCore::WHLSL::Lexer::identifier const):
1905         (WebCore::WHLSL::Lexer::operatorName const):
1906         * Modules/webgpu/WHLSL/WHLSLLexer.h: Added.
1907         (WebCore::WHLSL::Lexer::Lexer):
1908         (WebCore::WHLSL::Lexer::consumeToken):
1909         (WebCore::WHLSL::Lexer::unconsumeToken):
1910         (WebCore::WHLSL::Lexer::state const):
1911         (WebCore::WHLSL::Lexer::setState):
1912         (WebCore::WHLSL::Lexer::isFullyConsumed const):
1913         (WebCore::WHLSL::Lexer::errorString):
1914         (WebCore::WHLSL::Lexer::string const):
1915         (WebCore::WHLSL::Lexer::anyCharacter const):
1916         * Sources.txt:
1917         * WebCore.xcodeproj/project.pbxproj:
1918
1919 2018-12-18  Simon Fraser  <simon.fraser@apple.com>
1920
1921         Web Inspector: Timelines: correctly label Intersection Observer callbacks
1922         https://bugs.webkit.org/show_bug.cgi?id=192669
1923         <rdar://problem/46702490>
1924
1925         Reviewed by Joseph Pecoraro.
1926
1927         Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls
1928         to Intersection Observer, Performance Observer and Mutation Observer callbacks so 
1929         that they get correctly labeled in the Inspector timeline.
1930
1931         * dom/MutationObserver.cpp:
1932         (WebCore::MutationObserver::deliver):
1933         * en.lproj/Localizable.strings:
1934         * inspector/InspectorInstrumentation.cpp:
1935         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
1936         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
1937         * inspector/InspectorInstrumentation.h:
1938         (WebCore::InspectorInstrumentation::willFireObserverCallback):
1939         (WebCore::InspectorInstrumentation::didFireObserverCallback):
1940         * inspector/TimelineRecordFactory.cpp:
1941         (WebCore::TimelineRecordFactory::createObserverCallbackData):
1942         * inspector/TimelineRecordFactory.h:
1943         * inspector/agents/InspectorTimelineAgent.cpp:
1944         (WebCore::InspectorTimelineAgent::willFireObserverCallback):
1945         (WebCore::InspectorTimelineAgent::didFireObserverCallback):
1946         (WebCore::toProtocol):
1947         * inspector/agents/InspectorTimelineAgent.h:
1948         * page/IntersectionObserver.cpp:
1949         (WebCore::IntersectionObserver::notify):
1950         * page/PerformanceObserver.cpp:
1951         (WebCore::PerformanceObserver::deliver):
1952
1953 2018-12-19  Claudio Saavedra  <csaavedra@igalia.com>
1954
1955         ContentExtensions: DFANode.cpp:66:44: error: narrowing conversion of '-1' from 'int' to 'char' inside { }
1956         https://bugs.webkit.org/show_bug.cgi?id=192854
1957
1958         Reviewed by Alex Christensen.
1959
1960         * contentextensions/DFANode.h: Define CharRange's chars as signed
1961
1962 2018-12-19  Youenn Fablet  <youenn@apple.com>
1963
1964         Remove RTCRtpTransceiver.setDirection
1965         https://bugs.webkit.org/show_bug.cgi?id=192869
1966
1967         Reviewed by Alex Christensen.
1968
1969         Covered by rebased test.
1970
1971         * Modules/mediastream/RTCRtpTransceiver.idl:
1972
1973 2018-12-19  Jer Noble  <jer.noble@apple.com>
1974
1975         Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync()
1976         https://bugs.webkit.org/show_bug.cgi?id=192856
1977         <rdar://problem/46843245>
1978
1979         Reviewed by Alex Christensen.
1980
1981         Some decoders exposed through VideoToolbox will decode asynchronously even when 
1982         kVTDecodeInfo_Asynchronous is not set. Force synchronous behavior with a Semaphore.
1983
1984         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
1985         (WebCore::WebCoreDecompressionSession::decodeSampleSync):
1986
1987 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
1988
1989         Allow clients to set the navigator platform
1990         https://bugs.webkit.org/show_bug.cgi?id=192735
1991
1992         Reviewed by Tim Horton.
1993
1994         Expanded TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm.
1995
1996         Lots of piping to allow the setting of a custom navigator platform.
1997
1998         * loader/DocumentLoader.h:
1999         (WebCore::DocumentLoader::setCustomNavigatorPlatform):
2000         (WebCore::DocumentLoader::customNavigatorPlatform const):
2001         * loader/FrameLoader.cpp:
2002         (WebCore::FrameLoader::navigatorPlatform const):
2003         * loader/FrameLoader.h:
2004         * page/Navigator.cpp:
2005         (WebCore::Navigator::platform const):
2006         * page/Navigator.h:
2007         * page/NavigatorBase.cpp:
2008         (WebCore::NavigatorBase::platform const):
2009         (WebCore::NavigatorBase::platform): Deleted.
2010         * page/NavigatorBase.h:
2011
2012 2018-12-19  Ryan Haddad  <ryanhaddad@apple.com>
2013
2014         Unreviewed, rolling out r239347.
2015
2016         Caused the leaks bot to hit an exception and the new test
2017         crashes on certain configurations.
2018
2019         Reverted changeset:
2020
2021         "Synchronous media query evaluation could destroy current
2022         Frame/FrameView."
2023         https://bugs.webkit.org/show_bug.cgi?id=192781
2024         https://trac.webkit.org/changeset/239347
2025
2026 2018-12-19  Truitt Savell  <tsavell@apple.com>
2027
2028         Unreviewed, rolling out r239358.
2029
2030         Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
2031         crash on Debug bots
2032
2033         Reverted changeset:
2034
2035         "Clean up IndexedDB files between tests"
2036         https://bugs.webkit.org/show_bug.cgi?id=192796
2037         https://trac.webkit.org/changeset/239358
2038
2039 2018-12-19  Don Olmstead  <don.olmstead@sony.com>
2040
2041         Sync some include directories in WebCore
2042         https://bugs.webkit.org/show_bug.cgi?id=192819
2043
2044         Reviewed by Michael Catanzaro.
2045
2046         Added missing include directories around features that have only been enabled on
2047         Apple ports. Removes obsolete directories from list and moves harfbuzz directories
2048         into the freetype cmake file.
2049
2050         * CMakeLists.txt:
2051         * platform/FreeType.cmake:
2052
2053 2018-12-19  Alicia Boya García  <aboya@igalia.com>
2054
2055         [MSE] Remove unused method: stopAskingForMoreSamples()
2056         https://bugs.webkit.org/show_bug.cgi?id=192754
2057
2058         Reviewed by Xabier Rodriguez-Calvar.
2059
2060         The stopAskingForMoreSamples() method from SourceBufferPrivate is not
2061         being used by anyone. SourceBuffer is not calling it and no
2062         SourceBufferPrivate is implementing it. Let's remove that noise.
2063
2064         * platform/graphics/SourceBufferPrivate.h:
2065         (WebCore::SourceBufferPrivate::setActive):
2066         (WebCore::SourceBufferPrivate::stopAskingForMoreSamples): Deleted.
2067         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
2068         (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Deleted.
2069         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
2070
2071 2018-12-19  Alicia Boya García  <aboya@igalia.com>
2072
2073         [MSE] Remove dead code: sourceBufferPrivateSeekToTime()
2074         https://bugs.webkit.org/show_bug.cgi?id=192827
2075
2076         Reviewed by Xabier Rodriguez-Calvar.
2077
2078         This patch makes two dead code removal changes in
2079         SourceBufferPrivateClient:
2080
2081         First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
2082         virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
2083         is only inherited by SourceBuffer, it makes no sense to have default
2084         implementations there (they will never be used), moreso it being a
2085         client interface.
2086
2087         Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
2088         to had an empty implementation, which SourceBuffer did not overwrite,
2089         therefore making any calls to it useless.
2090
2091         All calls to sourceBufferPrivateSeekToTime() have been removed:
2092
2093         SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
2094         itself, used to call this method. This patch deletes it completely.
2095
2096         MockSourceBufferPrivate::seekToTime(), which only called this empty
2097         method, has also been removed along with its only usage in
2098         MockMediaSourcePrivate::seekToTime().
2099
2100         * platform/graphics/SourceBufferPrivateClient.h:
2101         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
2102         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.
2103         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2104         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2105         (WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.
2106         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
2107         (WebCore::MockMediaSourcePrivate::seekToTime):
2108         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2109         (WebCore::MockSourceBufferPrivate::seekToTime): Deleted.
2110         * platform/mock/mediasource/MockSourceBufferPrivate.h:
2111
2112 2018-12-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2113
2114         [EME] MediaKeySystemConfiguration distinctiveIdentifier and persistentState should default to optional
2115         https://bugs.webkit.org/show_bug.cgi?id=192815
2116
2117         Reviewed by Jer Noble.
2118
2119         https://www.w3.org/TR/encrypted-media/#dom-mediakeysystemconfiguration
2120         says that distinctiveIdentifier and persistentState default to
2121         optional. Our implementation does not define a default leaving it
2122         to the first option of the enum, which currently is Required.
2123
2124         * platform/encryptedmedia/CDMKeySystemConfiguration.h:
2125
2126 2018-12-19  Rob Buis  <rbuis@igalia.com>
2127
2128         Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
2129         https://bugs.webkit.org/show_bug.cgi?id=192288
2130
2131         Reviewed by Frédéric Wang.
2132
2133         Prefer return value to out parameter for parseAccessControlAllowList.
2134
2135         * loader/CrossOriginPreflightResultCache.cpp:
2136         (WebCore::CrossOriginPreflightResultCacheItem::parse):
2137         * platform/network/HTTPParsers.h:
2138         (WebCore::parseAccessControlAllowList):
2139         * platform/network/ResourceResponseBase.cpp:
2140         (WebCore::ResourceResponseBase::filter):
2141         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
2142
2143 2018-12-18  Zan Dobersek  <zdobersek@igalia.com>
2144
2145         REGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab
2146         https://bugs.webkit.org/show_bug.cgi?id=192230
2147
2148         Reviewed by Carlos Garcia Campos.
2149
2150         Single tile can after r235165 be assigned multiple content updates
2151         without a commit occurring between each update, whereas before these
2152         commits were done for each update.
2153
2154         To avoid repeating updates for a single tile purging information about
2155         the previous update, these updates are now accumulated inside a Vector
2156         and then iterated over during the commit phase.
2157
2158         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
2159         (WebCore::CoordinatedBackingStoreTile::addUpdate):
2160         (WebCore::CoordinatedBackingStoreTile::swapBuffers):
2161         (WebCore::CoordinatedBackingStore::updateTile):
2162         (WebCore::CoordinatedBackingStoreTile::setBackBuffer): Deleted.
2163         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
2164         (WebCore::CoordinatedBackingStoreTile::scale const):
2165
2166 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2167
2168         [iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
2169         https://bugs.webkit.org/show_bug.cgi?id=192842
2170         <rdar://problem/46823586>
2171
2172         Reviewed by Tim Horton.
2173
2174         Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a
2175         registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently
2176         inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for
2177         this is internally tracked in <rdar://problem/46830277>.
2178
2179         * platform/ios/PlatformPasteboardIOS.mm:
2180         (WebCore::PlatformPasteboard::write):
2181
2182 2018-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2183
2184         Unreviewed, add a missing UNUSED_PARAM()
2185
2186         * Modules/mediarecorder/MediaRecorder.cpp:
2187         (WebCore::MediaRecorder::getPrivateImpl):
2188
2189 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
2190
2191         Update CSS Properties and Values API to use new cycle fallback behaviour
2192         https://bugs.webkit.org/show_bug.cgi?id=192800
2193
2194         Reviewed by Antti Koivisto.
2195
2196         Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the
2197         wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. 
2198
2199         * css/CSSCustomPropertyValue.h:
2200         * css/CSSVariableReferenceValue.cpp:
2201         (WebCore::resolveVariableReference):
2202         * css/DOMCSSRegisterCustomProperty.cpp:
2203         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2204         * css/StyleResolver.cpp:
2205         (WebCore::StyleResolver::applyCascadedCustomProperty):
2206         * css/parser/CSSPropertyParser.cpp:
2207         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
2208
2209 2018-12-18  Daniel Bates  <dabates@apple.com>
2210
2211         Wrong value for key property in keydown and keyup events generated holding Control key
2212         https://bugs.webkit.org/show_bug.cgi?id=192788
2213         <rdar://problem/46795214>
2214
2215         Reviewed by Wenson Hsieh.
2216
2217         Similar to what we do on Mac, compute the DOM key property from the characters ignoring
2218         modifier keys input string when the Control key is held down.
2219
2220         * platform/ios/PlatformEventFactoryIOS.mm:
2221         (WebCore::keyForKeyEvent):
2222         * platform/mac/PlatformEventFactoryMac.mm:
2223         (WebCore::keyForKeyEvent):
2224
2225 2018-12-18  Sihui Liu  <sihui_liu@apple.com>
2226
2227         Clean up IndexedDB files between tests
2228         https://bugs.webkit.org/show_bug.cgi?id=192796
2229
2230         Reviewed by Geoffrey Garen.
2231
2232         We should clean up the IndexedDB files between tests to make sure each test is independent of others.
2233
2234         This patch also fixes some issues in IDB.
2235
2236         Covered by existing tests.
2237
2238         * Modules/indexeddb/server/IDBServer.cpp:
2239         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
2240         We should shut down all open databases instead of databases from open database connections before deleting 
2241         files, because database starts accessing files before connection to database is established.
2242
2243         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2244         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
2245         We should shutdown database after tasks in queue are completed, because tasks have pointer of UniqueIDBDatabase 
2246         and UniqueIDBDatabase can be destructed after shutdown.
2247
2248         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2249         didDeleteBackingStore can be posted to main thread after immediateCloseForUserDelete, and timer should not be 
2250         invoked during the hard close.
2251
2252         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
2253         Tasks like didOpenBackingStore could be posted from database thread to main thread after 
2254         immediateCloseForUserDelete, but we know the backing store will be deleted soon, so no need to handle any 
2255         database operation. 
2256
2257         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
2258         performPrefetchCursor needs to be aware of whether UniqueIDBDatabase is being closed, so that it will not access 
2259         m_backingStore when m_backingStore may already be deleted. 
2260
2261         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2262         immediateCloseForUserDelete does not handle transactions that are in the process of commit or abort. 
2263         m_objectStoreTransactionCounts and m_objectStoreWriteTransactions may be used by those transactions in 
2264         transactionCompleted, so they do not need to be cleared here.
2265
2266 2018-12-18  Myles C. Maxfield  <mmaxfield@apple.com>
2267
2268         Thick overlines and line-throughs grow in the wrong direction
2269         https://bugs.webkit.org/show_bug.cgi?id=192264
2270
2271         Reviewed by Dean Jackson.
2272
2273         Overlines should grow upward, and line-throughs should stay centered.
2274
2275         Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
2276
2277         * rendering/TextDecorationPainter.cpp:
2278         (WebCore::TextDecorationPainter::paintTextDecoration):
2279         * style/InlineTextBoxStyle.cpp:
2280         (WebCore::visualOverflowForDecorations):
2281
2282 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
2283
2284         Some iOS app crash in FrameLoader::checkCompleted
2285         https://bugs.webkit.org/show_bug.cgi?id=192804
2286         <rdar://problem/44240573>
2287
2288         Reviewed by Tim Horton.
2289
2290         It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread
2291         is trying to send a delegate message. Disable the release assertion while this is happening
2292         so that iOS app would not crash.
2293
2294         Unfortunately no new test as there is no way to easily test UIWebView in iOS,
2295         and this requires a race between the web thread & the main thread.
2296
2297         * dom/ScriptDisallowedScope.h:
2298         (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
2299         * platform/ios/wak/WebCoreThread.h:
2300         * platform/ios/wak/WebCoreThread.mm:
2301         (WebThreadDelegateMessageScope::WebThreadDelegateMessageScope):
2302         (WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope):
2303         (SendDelegateMessage):
2304
2305 2018-12-18  David Kilzer  <ddkilzer@apple.com>
2306
2307         clang-tidy: Use const reference for MediaTime parameter to prevent object copy
2308         <https://webkit.org/b/192814>
2309
2310         Reviewed by Mark Lam.
2311
2312         * bindings/js/JSDOMConvertNumbers.h:
2313         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
2314
2315 2018-12-18  Justin Fan  <justin_fan@apple.com>
2316
2317         [WebGPU] BindGroupLayout and Device::createBindGroupLayout
2318         https://bugs.webkit.org/show_bug.cgi?id=192817
2319
2320         Reviewed by Dean Jackson.
2321
2322         Update bind-group-layouts to test new functionality.
2323
2324         Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout:
2325         * Modules/webgpu/WebGPUBindGroupLayout.cpp: Added.
2326         (WebCore::WebGPUBindGroupLayout::create):
2327         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
2328         * Modules/webgpu/WebGPUBindGroupLayout.h: Added.
2329         * Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now.
2330         * Modules/webgpu/WebGPUDevice.cpp:
2331         (WebCore::WebGPUDevice::createBindGroupLayout const): Added.
2332         * Modules/webgpu/WebGPUDevice.h:
2333         * Modules/webgpu/WebGPUDevice.idl:
2334         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Added.
2335         (WebCore::GPUBindGroupLayout::tryCreate):
2336         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2337         * platform/graphics/gpu/GPUBindGroupLayout.h: Added.
2338         * platform/graphics/gpu/GPUDevice.cpp:
2339         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Added.
2340         * platform/graphics/gpu/GPUDevice.h:
2341
2342         Add files and symbols to project:
2343         * CMakeLists.txt:
2344         * DerivedSources.make:
2345         * Sources.txt:
2346         * WebCore.xcodeproj/project.pbxproj:
2347         * bindings/js/WebCoreBuiltinNames.h:
2348
2349         Missing includes that were previously provided via UnifiedSources:
2350         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
2351         * platform/sql/SQLiteFileSystem.h:
2352
2353 2018-12-18  Youenn Fablet  <youenn@apple.com>
2354
2355         Make ReadableStreamXX constructs use PrivateIdentifier
2356         https://bugs.webkit.org/show_bug.cgi?id=192771
2357
2358         Reviewed by Chris Dumez.
2359
2360         PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
2361         Covered by existing binding tests.
2362
2363         * Modules/streams/ReadableByteStreamController.idl:
2364         * Modules/streams/ReadableStreamBYOBReader.idl:
2365         * Modules/streams/ReadableStreamBYOBRequest.idl:
2366         * Modules/streams/ReadableStreamDefaultController.idl:
2367         * Modules/streams/ReadableStreamDefaultReader.idl:
2368         * bindings/scripts/CodeGeneratorJS.pm:
2369         (NeedsConstructorProperty):
2370         * bindings/scripts/preprocess-idls.pl:
2371         (shouldExposeInterface):
2372         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
2373         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
2374         * bindings/scripts/test/TestCustomConstructor.idl: Removed.
2375
2376 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2377
2378         Synchronous media query evaluation could destroy current Frame/FrameView.
2379         https://bugs.webkit.org/show_bug.cgi?id=192781
2380         <rdar://problem/34416793>
2381
2382         Reviewed by Chris Dumez.
2383
2384         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
2385
2386         Test: printing/print-with-media-query-destory.html
2387
2388         * loader/DocumentLoader.cpp:
2389         (WebCore::DocumentLoader::finishedLoading):
2390         * page/Frame.cpp:
2391         (WebCore::Frame::setPrinting):
2392         * page/FrameView.cpp:
2393         (WebCore::FrameView::forceLayoutForPagination):
2394
2395 2018-12-18  Joseph Pecoraro  <pecoraro@apple.com>
2396
2397         Web Inspector: m3u8 content not shown, it should be text
2398         https://bugs.webkit.org/show_bug.cgi?id=192731
2399         <rdar://problem/46747728>
2400
2401         Reviewed by Devin Rousso.
2402
2403         * inspector/NetworkResourcesData.cpp:
2404         (WebCore::NetworkResourcesData::setResourceContent):
2405         Don't clobber data if setting empty content on a resource that has content.
2406
2407         * inspector/agents/InspectorNetworkAgent.cpp:
2408         (WebCore::InspectorNetworkAgent::shouldTreatAsText):
2409         Additional non-"text/" mime types that can be treated as text.
2410
2411         * platform/MIMETypeRegistry.cpp:
2412         (WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
2413         * platform/MIMETypeRegistry.h:
2414         Detect media playlist mime types that are text (m3u8/m3u).
2415
2416 2018-12-18  Daniel Bates  <dabates@apple.com>
2417
2418         Remove <meta http-equiv=set-cookie> support
2419         https://bugs.webkit.org/show_bug.cgi?id=185077
2420         <rdar://problem/41791397>
2421
2422         Reviewed by Brent Fulgham.
2423
2424         Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649>
2425         the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also
2426         removed support for this pragma and Firefox has an open bug to remove it.
2427
2428         * dom/Document.cpp:
2429         (WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and
2430         was ignored instead of setting the cookie.
2431         * html/parser/XSSAuditor.cpp:
2432         (WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma
2433         as dangerous and erase attribute http-equiv when we find it because we no longer honor
2434         this pragma.
2435
2436 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
2437
2438         CSS Typed OM should expose attributeStyleMap
2439         https://bugs.webkit.org/show_bug.cgi?id=192671
2440
2441         Reviewed by Ryosuke Niwa.
2442
2443         Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing
2444         TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap.
2445
2446         Test: css-typedom/attributeStyleMap.html
2447
2448         * CMakeLists.txt:
2449         * DerivedSources.make:
2450         * Sources.txt:
2451         * WebCore.xcodeproj/project.pbxproj:
2452         * bindings/js/WebCoreBuiltinNames.h:
2453         * css/ElementCSSInlineStyle.idl:
2454         * css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h.
2455         * css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl.
2456         * css/typedom/StylePropertyMapReadOnly.cpp: Added.
2457         (WebCore::StylePropertyMapReadOnly::reifyValue):
2458         (WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
2459         * css/typedom/StylePropertyMapReadOnly.h:
2460         (WebCore::StylePropertyMapReadOnly::create): Deleted.
2461         (WebCore::StylePropertyMapReadOnly::get const): Deleted.
2462         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted.
2463         * css/typedom/StylePropertyMapReadOnly.idl:
2464         * css/typedom/TypedOMCSSImageValue.h:
2465         * dom/Element.cpp:
2466         (WebCore::Element::attributeStyleMap):
2467         (WebCore::Element::setAttributeStyleMap):
2468         * dom/Element.h:
2469         * dom/ElementRareData.cpp:
2470         * dom/ElementRareData.h:
2471         (WebCore::ElementRareData::attributeStyleMap):
2472         (WebCore::ElementRareData::setAttributeStyleMap):
2473         * dom/StyledElement.cpp:
2474         (WebCore::StyledElement::ensureAttributeStyleMap):
2475         * dom/StyledElement.h:
2476         * html/canvas/CanvasRenderingContext2DBase.cpp:
2477         (WebCore::size):
2478         (WebCore::CanvasRenderingContext2DBase::drawImage):
2479         * platform/graphics/CustomPaintImage.cpp:
2480         (WebCore::extractComputedProperty):
2481         (WebCore::CustomPaintImage::doCustomPaint):
2482
2483 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2484
2485         Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
2486         https://bugs.webkit.org/show_bug.cgi?id=192785
2487         <rdar://problem/45321184>
2488
2489         Reviewed by Tim Horton.
2490
2491         Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're
2492         currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that
2493         need to know when the user is typing in a text form control, but the page is preventing default text insertion
2494         behavior and instead updating values programmatically.
2495
2496         Test: fast/forms/call-text-did-change-in-text-field-when-typing.html
2497
2498         * html/TextFieldInputType.cpp:
2499         (WebCore::TextFieldInputType::setValue):
2500
2501 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2502
2503         [LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
2504         https://bugs.webkit.org/show_bug.cgi?id=192801
2505
2506         Reviewed by Antti Koivisto.
2507
2508         * layout/blockformatting/BlockFormattingContext.h:
2509         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2510         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2511         * layout/blockformatting/BlockMarginCollapse.cpp:
2512         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
2513
2514 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2515
2516         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
2517         https://bugs.webkit.org/show_bug.cgi?id=192799
2518
2519         Reviewed by Antti Koivisto.
2520
2521         * layout/blockformatting/BlockFormattingContext.h:
2522         * layout/blockformatting/BlockMarginCollapse.cpp:
2523         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
2524         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2525
2526 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2527
2528         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
2529         https://bugs.webkit.org/show_bug.cgi?id=192798
2530
2531         Reviewed by Antti Koivisto.
2532
2533         * layout/blockformatting/BlockFormattingContext.h:
2534         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2535         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2536         * layout/blockformatting/BlockMarginCollapse.cpp:
2537         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
2538         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
2539         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2540         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
2541
2542 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2543
2544         [LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
2545         https://bugs.webkit.org/show_bug.cgi?id=192794
2546
2547         Reviewed by Antti Koivisto.
2548
2549         * layout/blockformatting/BlockFormattingContext.h:
2550         * layout/blockformatting/BlockMarginCollapse.cpp:
2551         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
2552         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
2553         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
2554
2555 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2556
2557         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
2558         https://bugs.webkit.org/show_bug.cgi?id=192791
2559
2560         Reviewed by Antti Koivisto.
2561
2562         * layout/blockformatting/BlockMarginCollapse.cpp:
2563         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
2564         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
2565
2566 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2567
2568         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic
2569         https://bugs.webkit.org/show_bug.cgi?id=192787
2570
2571         Reviewed by Antti Koivisto.
2572
2573         * layout/blockformatting/BlockFormattingContext.h:
2574         * layout/blockformatting/BlockMarginCollapse.cpp:
2575         (WebCore::Layout::hasClearance):
2576         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
2577         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
2578         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
2579         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2580
2581 2018-12-17  Fujii Hironori  <Hironori.Fujii@sony.com>
2582
2583         [Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
2584         https://bugs.webkit.org/show_bug.cgi?id=192752
2585
2586         Reviewed by Don Olmstead.
2587
2588         No new tests, no behavior changes.
2589
2590         * platform/graphics/win/DIBPixelData.cpp:
2591         Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG.
2592         * platform/graphics/win/FontPlatformDataWin.cpp:
2593         (WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT.
2594         * platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'.
2595         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2596         Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample.
2597         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
2598         Reorder the initializer list.
2599         (WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT.
2600         (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto.
2601         (WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto.
2602         (WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto.
2603         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto.
2604         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case.
2605         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
2606         (WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2.
2607         * platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'.
2608         (WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2.
2609         (WebCore::Font::boundsForGDIGlyph const): Ditto.
2610         (WebCore::Font::widthForGDIGlyph const): Ditto.
2611         * platform/graphics/win/UniscribeController.cpp:
2612         (WebCore::UniscribeController::UniscribeController):
2613         Reorder the initializer list.
2614         (WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||.
2615         (WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'.
2616
2617 2018-12-17  Eric Carlson  <eric.carlson@apple.com>
2618
2619         [MediaStream] A stream's first video frame should be rendered
2620         https://bugs.webkit.org/show_bug.cgi?id=192629
2621         <rdar://problem/46664353>
2622
2623         Reviewed by Youenn Fablet.
2624
2625         Test: fast/mediastream/media-stream-renders-first-frame.html
2626
2627         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2628         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2629         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
2630         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
2631         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
2632         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
2633         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
2634         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
2635         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
2636         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
2637         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
2638         * platform/mediastream/RealtimeMediaSource.cpp:
2639         (WebCore::RealtimeMediaSource::size const):
2640         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2641         (WebCore::AVVideoCaptureSource::processNewFrame):
2642         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2643         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
2644
2645 2018-12-17  Justin Michaud  <justin_michaud@apple.com>
2646
2647         Bindings generator should support Conditional= along with CachedAttribute
2648         https://bugs.webkit.org/show_bug.cgi?id=192721
2649
2650         Reviewed by Ryosuke Niwa.
2651
2652         Fix a bug where specifying both attributes causes compilation errors because the compile-time
2653         condition is not included in the derived code.
2654
2655         * bindings/scripts/CodeGeneratorJS.pm:
2656         (GenerateImplementation):
2657         * bindings/scripts/test/JS/JSTestObj.cpp:
2658         (WebCore::jsTestObjCachedAttribute3Getter):
2659         (WebCore::jsTestObjCachedAttribute3):
2660         (WebCore::JSTestObj::visitChildren):
2661         * bindings/scripts/test/JS/JSTestObj.h:
2662         * bindings/scripts/test/TestObj.idl:
2663
2664 2018-12-17  David Kilzer  <ddkilzer@apple.com>
2665
2666         clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
2667         <https://webkit.org/b/192707>
2668         <rdar://problem/46734926>
2669
2670         Reviewed by Daniel Bates.
2671
2672         * platform/CPUMonitor.cpp:
2673         (WebCore::CPUMonitor::setCPULimit):
2674         * platform/CPUMonitor.h:
2675         (WebCore::CPUMonitor::setCPULimit):
2676         - Change parameter to const reference to fix unnecessary copies.
2677
2678 2018-12-17  Ryosuke Niwa  <rniwa@webkit.org>
2679
2680         offsetLeft and offsetParent should adjust across shadow boundaries
2681         https://bugs.webkit.org/show_bug.cgi?id=157437
2682         <rdar://problem/26154021>
2683
2684         Reviewed by Simon Fraser.
2685
2686         Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match
2687         the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497
2688         and https://github.com/w3c/webcomponents/issues/763
2689
2690         The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget).
2691         In practice, this would mean that we need to keep walking up the offset parent ancestors until we find
2692         the one which is in the same tree as a shadow-inclusive ancestor of the context object.
2693
2694         For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot
2695         inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent,
2696         then its offset parent, etc... until we find the offset parent in the same tree as the context object.
2697
2698         Note it's possible that the context object is inside a shadow tree which does not have its own offset parent.
2699         (e.g. all elements have position: static) For this reason, we need to consider not just offset parent in
2700         the same tree as the context object but as well as any offset parent which is in its ancestor trees.
2701
2702         Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html
2703
2704         * dom/Element.cpp:
2705         (WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop.
2706         (WebCore::collectAncestorTreeScopeAsHashSet): Added.
2707         (WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent
2708         which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor).
2709         (WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout.
2710         (WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's
2711         until it finds the first offset parent which is a shadow-including ancestor.
2712         (WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout.
2713         (WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other
2714         functions meant to be used for bindings code.
2715         * dom/Element.h:
2716         * html/HTMLElement.idl:
2717
2718 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
2719
2720         Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled
2721         https://bugs.webkit.org/show_bug.cgi?id=192780
2722         rdar://problem/43394387
2723
2724         Reviewed by Tim Horton.
2725         
2726         macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the
2727         memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them.
2728         
2729         Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available,
2730         and consult it when making decisions that affect layer backing store format.
2731
2732         Tested by new results for existing tests.
2733
2734         * platform/graphics/FontCascade.cpp:
2735         (WebCore::FontCascade::isSubpixelAntialiasingAvailable):
2736         * platform/graphics/FontCascade.h:
2737         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2738         (WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch
2739         it once.
2740         * rendering/RenderLayerBacking.cpp:
2741         (WebCore::RenderLayerBacking::updateAfterDescendants):
2742         * testing/Internals.cpp:
2743         (WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore::
2744
2745 2018-12-17  Daniel Bates  <dabates@apple.com>
2746
2747         Make DocumentMarker::allMarkers() constexpr
2748         https://bugs.webkit.org/show_bug.cgi?id=192634
2749
2750         Reviewed by Simon Fraser.
2751
2752         The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
2753         it constexpr to do just that.
2754
2755         * dom/DocumentMarker.h:
2756         (WebCore::DocumentMarker::allMarkers):
2757
2758 2018-12-17  Justin Fan  <justin_fan@apple.com>
2759
2760         [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
2761         https://bugs.webkit.org/show_bug.cgi?id=192726
2762
2763         Reviewed by Myles C. Maxfield.
2764
2765         Test: webgpu/bind-group-layouts.html
2766         Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs:
2767         * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added.
2768         * Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added.
2769         * Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added.
2770         * Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added.
2771         * Modules/webgpu/WebGPUShaderStageBit.h: Added.
2772         * Modules/webgpu/WebGPUShaderStageBit.idl: Added.
2773         * platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added.
2774         * platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added.
2775
2776         Add the new symbols and files to the project:
2777         * CMakeLists.txt:
2778         * DerivedSources.make:
2779         * Sources.txt:
2780         * WebCore.xcodeproj/project.pbxproj:
2781         * bindings/js/WebCoreBuiltinNames.h:
2782
2783         Small FIXME update for later:
2784         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2785         (WebCore::GPURenderPassEncoder::setVertexBuffers):
2786
2787 2018-12-17  Zalan Bujtas  <zalan@apple.com>
2788
2789         Unreviewed build fix.
2790
2791         * page/ios/FrameIOS.mm:
2792         (WebCore::Frame::interpretationsForCurrentRoot const):
2793
2794 2018-12-17  Zalan Bujtas  <zalan@apple.com>
2795
2796         Reproducible ASSERTion failure when toggling layer borders with find-in-page up
2797         https://bugs.webkit.org/show_bug.cgi?id=192762
2798         <rdar://problem/46676873>
2799
2800         Reviewed by Simon Fraser.
2801
2802         DocumentMarkerController::markersFor() should take a reference instead of a Node*.
2803
2804         Test: editing/document-marker-null-check.html
2805
2806         * dom/DocumentMarkerController.cpp:
2807         (DocumentMarkerController::hasMarkers):
2808         * dom/DocumentMarkerController.h:
2809         * editing/AlternativeTextController.cpp:
2810         (WebCore::AlternativeTextController::respondToChangedSelection):
2811         * editing/Editor.cpp:
2812         (WebCore::Editor::selectionStartHasMarkerFor const):
2813         * rendering/InlineTextBox.cpp:
2814         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
2815         * rendering/RenderReplaced.cpp:
2816         (WebCore::RenderReplaced::paint):
2817         * rendering/RenderText.cpp:
2818         (WebCore::RenderText::draggedContentRangesBetweenOffsets const):
2819         * rendering/SimpleLineLayout.cpp:
2820         (WebCore::SimpleLineLayout::canUseForWithReason):
2821         * testing/Internals.cpp:
2822         (WebCore::Internals::markerCountForNode):
2823
2824 2018-12-17  Commit Queue  <commit-queue@webkit.org>
2825
2826         Unreviewed, rolling out r239265 and r239274.
2827         https://bugs.webkit.org/show_bug.cgi?id=192765
2828
2829         unorm_normalize is deprecated, and broke an internal build
2830         (Requested by Truitt on #webkit).
2831
2832         Reverted changesets:
2833
2834         "[GTK][WPE] Need a function to convert internal URI to display
2835         ("pretty") URI"
2836         https://bugs.webkit.org/show_bug.cgi?id=174816
2837         https://trac.webkit.org/changeset/239265
2838
2839         "Fix the Apple Internal Mac build with a newer SDK"
2840         https://trac.webkit.org/changeset/239274
2841
2842 2018-12-17  Daniel Bates  <dabates@apple.com>
2843
2844         [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
2845         https://bugs.webkit.org/show_bug.cgi?id=192633
2846
2847         Reviewed by Wenson Hsieh.
2848
2849         UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
2850         input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
2851         for binary compatibility.
2852
2853         * platform/ios/WebEvent.h:
2854         * platform/ios/WebEvent.mm:
2855         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.
2856
2857 2018-12-17  Matt Lewis  <jlewis3@apple.com>
2858
2859         Unreviewed, rolling out r239254.
2860
2861         This broke the Windows 10 Debug build
2862
2863         Reverted changeset:
2864
2865         "Replace many uses of String::format with more type-safe
2866         alternatives"
2867         https://bugs.webkit.org/show_bug.cgi?id=192742
2868         https://trac.webkit.org/changeset/239254
2869
2870 2018-12-17  Antoine Quint  <graouts@apple.com>
2871
2872         [Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
2873         https://bugs.webkit.org/show_bug.cgi?id=192758
2874
2875         Reviewed by Dean Jackson.
2876
2877         We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending
2878         gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is
2879         less bookkeeping to perform.
2880
2881         No new test since there is no user-observable change.
2882
2883         * animation/WebAnimation.cpp:
2884         (WebCore::WebAnimation::updateFinishedState):
2885         (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted.
2886         (WebCore::WebAnimation::performMicrotask): Deleted.
2887         * animation/WebAnimation.h:
2888
2889 2018-12-17  Antoine Quint  <graouts@apple.com>
2890
2891         [Web Animations] Ensure we don't update an animation's finished state twice when updating animations
2892         https://bugs.webkit.org/show_bug.cgi?id=192757
2893
2894         Reviewed by Dean Jackson.
2895
2896         When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state
2897         twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of
2898         whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate
2899         next call to resolve(), unless any of the timing properties have changed in the meantime.
2900
2901         No new test since there is no user-observable change.
2902
2903         * animation/WebAnimation.cpp:
2904         (WebCore::WebAnimation::timingDidChange):
2905         (WebCore::WebAnimation::tick):
2906         (WebCore::WebAnimation::resolve):
2907         * animation/WebAnimation.h:
2908
2909 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
2910
2911         REGRESSION (r233268): Elements animated in from offscreen sometimes don't display
2912         https://bugs.webkit.org/show_bug.cgi?id=192725
2913         rdar://problem/46011418
2914
2915         Reviewed by Antoine Quint.
2916
2917         There were two problems with backing store attachment and animation.
2918         
2919         First, animations are an input into the "backing store attached" logic, so when they change
2920         we should set the CoverageRectChanged bit on GraphicsLayerCA.
2921         
2922         Secondly, when an ancestor has unknown animation extent, all its descendants need to
2923         get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when
2924         the current layer has no animation extent.
2925
2926         Tests: compositing/backing/animate-into-view-with-descendant.html
2927                compositing/backing/animate-into-view.html
2928
2929         * platform/graphics/ca/GraphicsLayerCA.cpp:
2930         (WebCore::GraphicsLayerCA::addAnimation):
2931         (WebCore::GraphicsLayerCA::removeAnimation):
2932         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2933
2934 2018-12-17  Zalan Bujtas  <zalan@apple.com>
2935
2936         [LFC][BFC][MarginCollapsing] Unify margin collapse function naming
2937         https://bugs.webkit.org/show_bug.cgi?id=192747
2938
2939         Reviewed by Antti Koivisto.
2940
2941         Rename some margin collapse getters.
2942
2943         * layout/blockformatting/BlockFormattingContext.h:
2944         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2945         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2946         * layout/blockformatting/BlockMarginCollapse.cpp:
2947         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
2948         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
2949         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
2950         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
2951         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
2952         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
2953         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
2954         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
2955         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2956         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
2957         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
2958         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
2959         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
2960         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
2961         (WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted.
2962         (WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted.
2963         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted.
2964         (WebCore::Layout::isMarginAfterCollapsedThrough): Deleted.
2965         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted.
2966         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted.
2967
2968 2018-12-17  David Kilzer  <ddkilzer@apple.com>
2969
2970         clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
2971         <https://webkit.org/b/192751>
2972         <rdar://problem/46771623>
2973
2974         Reviewed by Daniel Bates.
2975
2976         Change loop variables to const references to avoid unnecessary
2977         copies.
2978
2979         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
2980         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
2981         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2982         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
2983         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2984         (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
2985         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2986         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
2987         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
2988         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
2989         (WebCore::IDBDatabaseInfo::loggingString const):
2990         * Modules/mediasource/SourceBuffer.cpp:
2991         (WebCore::removeSamplesFromTrackBuffer):
2992         * accessibility/AccessibilityRenderObject.cpp:
2993         (WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
2994         * accessibility/AccessibilityTableRow.cpp:
2995         (WebCore::AccessibilityTableRow::headerObject):
2996         * animation/KeyframeEffect.cpp:
2997         (WebCore::KeyframeEffect::computedNeedsForcedLayout):
2998         * crypto/keys/CryptoKeyRSA.cpp:
2999         (WebCore::CryptoKeyRSA::importJwk):
3000         (WebCore::CryptoKeyRSA::exportJwk const):
3001         * css/CSSComputedStyleDeclaration.cpp:
3002         (WebCore::OrderedNamedLinesCollector::appendLines const):
3003         * dom/DataTransfer.cpp:
3004         (WebCore::readURLsFromPasteboardAsString):
3005         * dom/TreeScope.cpp:
3006         (WebCore::TreeScope::elementsFromPoint):
3007         * html/track/WebVTTParser.cpp:
3008         (WebCore::WebVTTParser::checkAndStoreRegion):
3009         * inspector/agents/InspectorTimelineAgent.cpp:
3010         (WebCore::InspectorTimelineAgent::setInstruments):
3011         * page/Page.cpp:
3012         (WebCore::Page::updateIntersectionObservations):
3013         * page/TextIndicator.cpp:
3014         (WebCore::estimatedBackgroundColorForRange):
3015         * page/animation/KeyframeAnimation.cpp:
3016         (WebCore::KeyframeAnimation::computeLayoutDependency):
3017         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3018         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
3019         * platform/graphics/ca/GraphicsLayerCA.cpp:
3020         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
3021         (WebCore::GraphicsLayerCA::updateAnimations):
3022         (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
3023         * platform/graphics/mac/ImageMac.mm:
3024         (WebCore::BitmapImage::tiffRepresentation):
3025         * rendering/HitTestResult.cpp:
3026         (WebCore::HitTestResult::append):
3027         * testing/Internals.cpp:
3028         (WebCore::Internals::acceleratedAnimationsForElement):
3029
3030 2018-12-17  Ms2ger  <Ms2ger@igalia.com>
3031
3032         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
3033         https://bugs.webkit.org/show_bug.cgi?id=174816
3034
3035         Reviewed by Michael Catanzaro.
3036
3037         Tests: enabled fast/url/user-visible/.
3038
3039         * testing/Internals.cpp:
3040         (WebCore::Internals::userVisibleString): Enable method on all platforms.
3041
3042 2018-12-15  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3043
3044         Null pointer dereference in JSC::WriteBarrierBase()
3045         https://bugs.webkit.org/show_bug.cgi?id=191252
3046
3047         Reviewed by Keith Miller.
3048
3049         * bindings/js/JSCustomElementRegistryCustom.cpp:
3050         (WebCore::JSCustomElementRegistry::whenDefined):
3051         * bindings/js/JSDOMPromiseDeferred.cpp:
3052         (WebCore::createDeferredPromise):
3053         * bindings/js/JSDOMPromiseDeferred.h:
3054         (WebCore::DeferredPromise::create):
3055         (WebCore::callPromiseFunction):
3056         * bindings/js/JSDOMWindowBase.cpp:
3057         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
3058         (WebCore::JSDOMWindowBase::moduleLoaderImportModule):
3059         * bindings/js/ScriptModuleLoader.cpp:
3060         (WebCore::ScriptModuleLoader::fetch):
3061         (WebCore::rejectPromise):
3062
3063 2018-12-15  Darin Adler  <darin@apple.com>
3064
3065         Use warning-ignoring macros more consistently and simply
3066         https://bugs.webkit.org/show_bug.cgi?id=192743
3067
3068         Reviewed by Mark Lam.
3069
3070         * bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
3071         IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
3072         files like this one with non-clang compilers, and no need to worry about
3073         them when choosing the macro.
3074
3075         * crypto/mac/CryptoKeyRSAMac.cpp:
3076         (WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
3077
3078         * css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
3079         the "unknown-pragmas" trick, which the macro should take care of.
3080         * css/makevalues.pl: Ditto.
3081         * platform/ColorData.gperf: Ditto.
3082
3083         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3084         (WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
3085         (see rationale above for Objective-C++).
3086
3087         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3088         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
3089         ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
3090         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3091         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.
3092
3093         * platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
3094         (see rationale above for Objective-C++).
3095
3096         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3097         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
3098         Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
3099
3100         * platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
3101         (see rationale above for Objective-C++).
3102
3103         * platform/network/cocoa/ResourceResponseCocoa.mm:
3104         (WebCore::ResourceResponse::platformCertificateInfo const): Use
3105         ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
3106
3107 2018-12-15  Darin Adler  <darin@apple.com>
3108
3109         Replace many uses of String::format with more type-safe alternatives
3110         https://bugs.webkit.org/show_bug.cgi?id=192742
3111
3112         Reviewed by Mark Lam.
3113
3114         A while back, String::format was more efficient than string concatenation,
3115         but that is no longer true, and we should prefer String::number, makeString,
3116         or concatenation with the "+" operator to String::format for new code.
3117
3118         This is not as good for programmers who are fond of printf formatting
3119         style, and in some cases it's a little harder to read the strings
3120         interspersed with variables rather than a format string, but it's better
3121         in a few ways:
3122
3123         - more efficient (I didn't measure the difference, but it's definitely
3124           slower to use String::Format which calls vsnprintf twice than to use
3125           the WTF code)
3126         - works in a type-safe way without a need to use a format specifier such
3127           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
3128           subtle differences between platforms
3129         - allows us to use StringView in some cases to sidestep the need to
3130           allocate temporary WTF::String objects
3131         - does not require converting each WTF::String to a C string, allowing
3132           us to remove many cases of ".utf8().data()" and similar expressions,
3133           eliminating the allocation of temporary WTF::CString objects
3134
3135         This patch covers a batch of easiest-to-convert call sites.
3136         Later patches will allow us to deprecate or remove String::format.
3137
3138         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3139         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
3140         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
3141         (WebCore::IDBCursorInfo::loggingString const): Ditto.
3142         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
3143         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
3144         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
3145         (WebCore::IDBGetRecordData::loggingString const): Ditto.
3146         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
3147         (WebCore::IDBIndexInfo::loggingString const): Ditto.
3148         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
3149         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
3150         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
3151         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
3152         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
3153         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3154         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
3155         * Modules/webdatabase/Database.cpp:
3156         (WebCore::formatErrorMessage): Ditto.
3157         * Modules/webdatabase/SQLError.h:
3158         (WebCore::SQLError::create): Ditto.
3159
3160         * bindings/scripts/CodeGeneratorJS.pm:
3161         (GenerateImplementation): Use makeString.
3162
3163         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3164         * bindings/scripts/test/JS/JSMapLike.cpp:
3165         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3166         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3167         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3168         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3169         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3170         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3171         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3172         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3173         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3174         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3175         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3176         * bindings/scripts/test/JS/JSTestException.cpp:
3177         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3178         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3179         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3180         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3181         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3182         * bindings/scripts/test/JS/JSTestInterface.cpp:
3183         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3184         * bindings/scripts/test/JS/JSTestIterable.cpp:
3185         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3186         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3187         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3188         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3189         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3190         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3191         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3192         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3193         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3194         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3195         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3196         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3197         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3198         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3199         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3200         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3201         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3202         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3203         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3204         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3205         * bindings/scripts/test/JS/JSTestNode.cpp:
3206         * bindings/scripts/test/JS/JSTestObj.cpp:
3207         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3208         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3209         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3210         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3211         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3212         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3213         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
3214         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
3215         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
3216         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3217         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3218         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3219         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3220         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3221         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3222         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3223         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3224         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3225         Updated expected results.
3226 :
3227         * css/parser/CSSPropertyParserHelpers.cpp:
3228         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
3229         and makeString.
3230
3231         * html/HTMLSelectElement.cpp:
3232         (WebCore::HTMLSelectElement::setLength): Use makeString.
3233         * html/ImageDocument.cpp:
3234         (WebCore::ImageDocument::imageUpdated): Ditto.
3235         * html/parser/XSSAuditor.cpp:
3236         (WebCore::XSSAuditor::init): Ditto.
3237         * inspector/InspectorFrontendClientLocal.cpp:
3238         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
3239         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
3240         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
3241         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
3242         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
3243         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
3244         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
3245         * page/MemoryRelease.cpp:
3246         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
3247
3248         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3249         (WebCore::formatByteNumber): Use String::number.
3250         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
3251
3252         * page/cocoa/ResourceUsageThreadCocoa.mm:
3253         (WebCore::logFootprintComparison): Use makeString.
3254         * platform/animation/TimingFunction.cpp:
3255         (WebCore::TimingFunction::cssText const): Ditto.
3256
3257         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3258         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
3259         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
3260         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
3261
3262         * platform/graphics/ca/GraphicsLayerCA.cpp:
3263         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
3264         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
3265         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
3266         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
3267         * platform/mock/MockRealtimeVideoSource.cpp:
3268         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
3269
3270         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
3271
3272         * platform/network/ParsedContentRange.cpp:
3273         (WebCore::ParsedContentRange::headerValue const): Use makeString.
3274
3275         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
3276         compiler conditionals and reorganized the start/stop of namespaces.
3277         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
3278
3279         * platform/sql/SQLiteDatabase.cpp:
3280         (WebCore::unauthorizedSQLFunction): Use makeString.
3281         * rendering/RenderLayerCompositor.cpp:
3282         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
3283         * workers/service/server/RegistrationDatabase.cpp:
3284         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
3285         (WebCore::RegistrationDatabase::importRecords): Ditto.
3286
3287 2018-12-15  Youenn Fablet  <youenn@apple.com>
3288
3289         Make RTCRtpSender.setParameters to activate specific encodings
3290         https://bugs.webkit.org/show_bug.cgi?id=192732
3291
3292         Reviewed by Eric Carlson.
3293
3294         The conversion between libwebrtc and WebCore is lossy for send parameters.
3295         Libwebrtc checking the differences of values, call to setParameters will often fail.
3296
3297         Given some parameters cannot be exposed, the sender backend keeps the
3298         current set of parameters when gathered and reuses them when parameters are set.
3299
3300         For encodings, we only change activate/maxBitRate/maxFrameRate as
3301         these are the most important parameters to be able to modify.
3302
3303         Covered by added tests in webrtc/video.html.
3304
3305         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
3306         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
3307         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
3308         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
3309         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
3310         (WebCore::fromRTCRtpSendParameters):
3311         (WebCore::fromRTCEncodingParameters): Deleted.
3312         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
3313
3314 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
3315
3316         Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused
3317         https://bugs.webkit.org/show_bug.cgi?id=192724
3318         <rdar://problem/46745911>
3319
3320         Reviewed by Devin Rousso.
3321
3322         iOS never installs the InspectorOverlay page as a page overlay.
3323         It also uses its own node highlighting painting. Avoid any work
3324         and resources associated with the overlay page for iOS.
3325
3326         * inspector/InspectorOverlay.cpp:
3327         (WebCore::InspectorOverlay::paint):
3328         (WebCore::InspectorOverlay::update):
3329         (WebCore::InspectorOverlay::overlayPage):
3330         (WebCore::evaluateCommandInOverlay):
3331
3332 2018-12-14  Youenn Fablet  <youenn@apple.com>
3333
3334         MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
3335         https://bugs.webkit.org/show_bug.cgi?id=192720
3336
3337         Reviewed by Eric Carlson.
3338
3339         Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member,
3340         as the latter is a ref counted object.
3341         Made some refactoring to return early in case of error.
3342
3343         Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream
3344         the MediaRecorder will stop listening for its tracks.
3345         Otherwise, the tracks will continue calling the MediaRecorder even after it is dead.
3346
3347         Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html
3348
3349         * Modules/mediarecorder/MediaRecorder.cpp:
3350         (WebCore::MediaRecorder::didAddOrRemoveTrack):
3351         (WebCore::MediaRecorder::setNewRecordingState): Deleted.
3352         * Modules/mediarecorder/MediaRecorder.h:
3353         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
3354         (WebCore::MediaRecorderPrivateAVFImpl::create):
3355         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
3356         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
3357         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
3358         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
3359         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
3360         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
3361         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
3362         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
3363         (WebCore::MediaRecorderPrivateWriter::create):
3364         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
3365         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
3366         (WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted.
3367
3368 2018-12-14  Youenn Fablet  <youenn@apple.com>
3369
3370         getSenders/getReceivers() should not return closed transceiver senders/receivers
3371         https://bugs.webkit.org/show_bug.cgi?id=192706
3372
3373         Reviewed by Eric Carlson.
3374
3375         Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a
3376         This forces us to compute the sender/receiver list at getter call time.
3377         Updated the internal call sites of senders to use the list of transceivers instead.
3378
3379         Covered by updated WPT tests.
3380
3381         * Modules/mediastream/RTCPeerConnection.cpp:
3382         (WebCore::RTCPeerConnection::addTrack):
3383         (WebCore::RTCPeerConnection::getSenders const):
3384         (WebCore::RTCPeerConnection::getReceivers const):
3385         * Modules/mediastream/RTCPeerConnection.h:
3386         * Modules/mediastream/RTCRtpTransceiver.cpp:
3387         (WebCore::RTCRtpTransceiver::stopped const):
3388         (WebCore::RtpTransceiverSet::append):
3389         (WebCore::RtpTransceiverSet::senders const):
3390         (WebCore::RtpTransceiverSet::receivers const):
3391         * Modules/mediastream/RTCRtpTransceiver.h:
3392         (WebCore::RtpTransceiverSet::senders const): Deleted.
3393         (WebCore::RtpTransceiverSet::receivers const): Deleted.
3394         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3395         (WebCore::findExistingSender):
3396         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
3397
3398 2018-12-14  David Kilzer  <ddkilzer@apple.com>
3399
3400         clang-tidy: Fix unnecessary copy of objects for operator==() methods
3401         <https://webkit.org/b/192712>
3402         <rdar://problem/46739332>
3403
3404         Reviewed by Andy Estes.
3405
3406         * contentextensions/HashableActionList.h:
3407         (WebCore::ContentExtensions::HashableActionList::operator== const):
3408         (WebCore::ContentExtensions::HashableActionList::operator!= const):
3409         * platform/network/FormData.h:
3410         (WebCore::FormDataElement::EncodedFileData::operator== const):
3411         (WebCore::FormDataElement::EncodedBlobData::operator== const):
3412         - Change arguments from const to const reference to avoid
3413           copies.
3414
3415 2018-12-14  Jer Noble  <jer.noble@apple.com>
3416
3417         CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function<void ()>&&)
3418         https://bugs.webkit.org/show_bug.cgi?id=192713
3419         <rdar://problem/46739706>
3420
3421         Reviewed by Eric Carlson.
3422
3423         A callback is being called twice, and the second time has a null Promise. Instead of these
3424         callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and
3425         have ASSERTS() that they are called once-and-only-once.
3426
3427         * platform/encryptedmedia/CDMInstanceSession.h:
3428         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3429         (WebCore::CDMInstanceSessionClearKey::closeSession):
3430         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3431         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
3432         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
3433         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
3434         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
3435         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
3436
3437 2018-12-14  David Kilzer  <ddkilzer@apple.com>
3438
3439         clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/
3440         <https://webkit.org/b/192708>