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