Add a storage limit for IndexedDB
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-01  Sihui Liu  <sihui_liu@apple.com>
2
3         Add a storage limit for IndexedDB
4         https://bugs.webkit.org/show_bug.cgi?id=190598
5         <rdar://problem/44654715>
6
7         Reviewed by Chris Dumez.
8
9         Set a storage limit in IndexedDB for each pair of mainFrameOrigin and openingOrigin. 
10         IndexedDB will return a QuotaExceededError if limit is reached.
11
12         If the size of free disk space is over 1 GB, the default limit is 500 MB; otherwise it is 
13         half the free disk space.
14
15         Test: storage/indexeddb/storage-limit.html
16
17         * Modules/indexeddb/server/IDBBackingStore.h:
18         * Modules/indexeddb/server/IDBServer.cpp:
19         (WebCore::IDBServer::IDBServer::createBackingStore):
20         (WebCore::IDBServer::IDBServer::setPerOriginQuota):
21         * Modules/indexeddb/server/IDBServer.h:
22         (WebCore::IDBServer::IDBServer::perOriginQuota const):
23         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
24         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
25         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
26         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
27         (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
28         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
29         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
30         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
31         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
32         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
33         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
34         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
35         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
36         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
37         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
38         (WebCore::IDBServer::UniqueIDBDatabase::setQuota):
39         * Modules/indexeddb/server/UniqueIDBDatabase.h:
40
41 2018-11-01  Justin Michaud  <justin_michaud@apple.com>
42
43         CSS Custom Properties API Should Support syntax="*" and "<length>", and handle cycles properly
44         https://bugs.webkit.org/show_bug.cgi?id=191042
45
46         Reviewed by Antti Koivisto.
47
48         Refactor code so that:
49         - All properties applied in StyleResolver::applyMatchedProperties are only applied once. 
50         - Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved
51           every time they were referenced, and again in RenderStyle.
52         - The font-size property is applied after its variable references, but before custom properties that depend on it.
53         - Cycles are detected at the same time as resolution.
54         - MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type.
55           If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty.
56           This behaviour matches chrome, but is not documented in the spec. 
57         - Custom property values have more explicit resolved/unresolved state.
58         - RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties.
59
60         Tests: css-custom-properties-api/crash.html
61                css-custom-properties-api/cycles.html
62                css-custom-properties-api/inline.html
63
64         * css/CSSComputedStyleDeclaration.cpp:
65         (WebCore::ComputedStyleExtractor::customPropertyValue):
66         * css/CSSCustomPropertyValue.cpp:
67         (WebCore::CSSCustomPropertyValue::equals const):
68         (WebCore::CSSCustomPropertyValue::customCSSText const):
69         (WebCore::CSSCustomPropertyValue::tokens const):
70         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted.
71         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted.
72         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted.
73         * css/CSSCustomPropertyValue.h:
74         * css/CSSRegisteredCustomProperty.cpp:
75         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
76         * css/CSSRegisteredCustomProperty.h:
77         * css/CSSVariableData.cpp:
78         (WebCore::CSSVariableData::CSSVariableData):
79         (WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted.
80         (WebCore::CSSVariableData::checkVariablesForCycles const): Deleted.
81         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted.
82         (WebCore::CSSVariableData::resolveVariableFallback const): Deleted.
83         (WebCore::CSSVariableData::resolveVariableReference const): Deleted.
84         (WebCore::CSSVariableData::resolveVariableReferences const): Deleted.
85         (WebCore::CSSVariableData::resolveTokenRange const): Deleted.
86         * css/CSSVariableData.h:
87         (WebCore::CSSVariableData::create):
88         (WebCore::CSSVariableData::createResolved): Deleted.
89         (WebCore::CSSVariableData::needsVariableResolution const): Deleted.
90         (WebCore::CSSVariableData::CSSVariableData): Deleted.
91         * css/CSSVariableReferenceValue.cpp:
92         (WebCore::resolveVariableFallback):
93         (WebCore::resolveVariableReference):
94         (WebCore::resolveTokenRange):
95         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const):
96         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted.
97         * css/CSSVariableReferenceValue.h:
98         (WebCore::CSSVariableReferenceValue::create):
99         (WebCore::CSSVariableReferenceValue::equals const):
100         (WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted.
101         * css/DOMCSSRegisterCustomProperty.cpp:
102         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
103         * css/PropertySetCSSStyleDeclaration.cpp:
104         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
105         * css/StyleBuilderCustom.h:
106         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
107         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
108         * css/StyleProperties.cpp:
109         (WebCore::MutableStyleProperties::setCustomProperty):
110         * css/StyleProperties.h:
111         * css/StyleResolver.cpp:
112         (WebCore::StyleResolver::State::setStyle):
113         (WebCore::StyleResolver::styleForKeyframe):
114         (WebCore::StyleResolver::styleForPage):
115         (WebCore::StyleResolver::applyMatchedProperties):
116         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
117         (WebCore::StyleResolver::applyProperty):
118         (WebCore::StyleResolver::resolvedVariableValue const):
119         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
120         (WebCore::StyleResolver::CascadedProperties::Property::apply):
121         (WebCore::StyleResolver::applyCascadedCustomProperty):
122         (WebCore::StyleResolver::applyCascadedProperties):
123         * css/StyleResolver.h:
124         * css/parser/CSSParser.cpp:
125         (WebCore::CSSParser::parseValueWithVariableReferences):
126         * css/parser/CSSParser.h:
127         * css/parser/CSSPropertyParser.cpp:
128         (WebCore::CSSPropertyParser::CSSPropertyParser):
129         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue):
130         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
131         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
132         (WebCore::CSSPropertyParser::parseValueStart):
133         (WebCore::CSSPropertyParser::parseSingleValue):
134         * css/parser/CSSPropertyParser.h:
135         * css/parser/CSSVariableParser.cpp:
136         (WebCore::CSSVariableParser::parseDeclarationValue):
137         * dom/ConstantPropertyMap.cpp:
138         (WebCore::ConstantPropertyMap::setValueForProperty):
139         (WebCore::variableDataForPositivePixelLength):
140         (WebCore::variableDataForPositiveDuration):
141         * rendering/style/RenderStyle.cpp:
142         (WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted.
143         * rendering/style/RenderStyle.h:
144         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
145         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
146         * rendering/style/StyleCustomPropertyData.h:
147         (WebCore::StyleCustomPropertyData::operator== const):
148         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
149         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
150         (): Deleted.
151
152 2018-11-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
153
154         [CG] Adopt CG SPI for non-even cornered rounded rects
155         https://bugs.webkit.org/show_bug.cgi?id=190155
156
157         Reviewed by Simon Fraser.
158
159         Instead of creating bezier curves for the non-even corners of the rounded
160         rects, we should use the optimized SPI provided by CG.
161
162         * platform/graphics/cg/PathCG.cpp:
163         (WebCore::Path::platformAddPathForRoundedRect):
164
165 2018-11-01  Youenn Fablet  <youenn@apple.com>
166
167         RTCTrackEvent.streams should be SameObject
168         https://bugs.webkit.org/show_bug.cgi?id=191130
169
170         Reviewed by Eric Carlson.
171
172         Mimick SameObject using CachedAttribute.
173         Covered by rebased test.
174
175         * Modules/mediastream/RTCTrackEvent.idl:
176
177 2018-10-31  Zalan Bujtas  <zalan@apple.com>
178
179         [LFC][IFC] Add support for inline-block elements.
180         https://bugs.webkit.org/show_bug.cgi?id=191143
181
182         Reviewed by Antti Koivisto.
183
184         This patch add support for laying out non-shrink-to-width inline-block elements.
185
186         Test: fast/inline/simple-inline-block.html
187
188         * layout/FormattingContext.h:
189         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
190         * layout/FormattingContextGeometry.cpp:
191         (WebCore::Layout::contentHeightForFormattingContextRoot):
192         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
193         * layout/inlineformatting/InlineFormattingContext.cpp:
194         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
195         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
196         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
197         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
198         * layout/layouttree/LayoutInlineContainer.cpp:
199         (WebCore::Layout::InlineContainer::establishesInlineFormattingContext const):
200         * layout/layouttree/LayoutInlineContainer.h:
201         * layout/layouttree/LayoutTreeBuilder.cpp:
202         (WebCore::Layout::TreeBuilder::createSubTree):
203
204 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
205
206         Fix build with VIDEO and WEB_AUDIO disabled
207         https://bugs.webkit.org/show_bug.cgi?id=191147
208
209         Reviewed by Philippe Normand.
210
211         Supported or not, there were a few build fixes needed
212         to be able to build WebKit with media disabled. Mostly
213         low-hanging fruits.
214
215         * Modules/mediasource/VideoPlaybackQuality.cpp:
216         * Modules/mediasource/VideoPlaybackQuality.h:
217         * Modules/mediasource/VideoPlaybackQuality.idl:
218         * dom/Document.cpp:
219         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
220         * inspector/agents/InspectorDOMAgent.cpp:
221         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
222         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
223         * inspector/agents/InspectorDOMAgent.h:
224         * rendering/RenderThemeGtk.cpp:
225
226 2018-10-31  Devin Rousso  <drousso@apple.com>
227
228         Web Inspector: Canvas: create a setting for auto-recording newly created contexts
229         https://bugs.webkit.org/show_bug.cgi?id=190856
230
231         Reviewed by Brian Burg.
232
233         Test: inspector/canvas/setRecordingAutoCaptureFrameCount.html
234
235         * inspector/agents/InspectorCanvasAgent.h:
236         (WebCore::InspectorCanvasAgent::RecordingOptions): Added.
237         * inspector/agents/InspectorCanvasAgent.cpp:
238         (WebCore::InspectorCanvasAgent::enable):
239         (WebCore::InspectorCanvasAgent::disable):
240         (WebCore::InspectorCanvasAgent::setRecordingAutoCaptureFrameCount): Added.
241         (WebCore::InspectorCanvasAgent::startRecording):
242         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
243         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
244         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
245         (WebCore::InspectorCanvasAgent::startRecording): Added.
246         Unify the different functions that are able to start a recording to use a single path.
247
248         * inspector/InspectorCanvas.h:
249         * inspector/InspectorCanvas.cpp:
250         (WebCore::InspectorCanvas::resetRecordingData):
251         (WebCore::InspectorCanvas::recordAction):
252         (WebCore::InspectorCanvas::setFrameCount): Added.
253         (WebCore::InspectorCanvas::overFrameCount const): Added.
254
255 2018-10-31  Devin Rousso  <drousso@apple.com>
256
257         Web Inspector: display low-power enter/exit events in Timelines and Network node waterfalls
258         https://bugs.webkit.org/show_bug.cgi?id=190641
259         <rdar://problem/45319049>
260
261         Reviewed by Joseph Pecoraro.
262
263         No new tests, as low power mode is indeterminate. Should not affect functionality.
264
265         * inspector/agents/InspectorDOMAgent.h:
266         * inspector/agents/InspectorDOMAgent.cpp:
267         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
268         (WebCore::InspectorDOMAgent::addEventListenersToNode):
269         (WebCore::InspectorDOMAgent::mediaMetricsTimerFired): Added.
270
271 2018-10-31  Alicia Boya GarcĂ­a  <aboya@igalia.com>
272
273         [MSE] Use tolerance when growing the coded frame group
274         https://bugs.webkit.org/show_bug.cgi?id=190085
275
276         Reviewed by Jer Noble.
277
278         Test: media/media-source/media-source-append-acb-tolerance.html
279
280         This patch introduces a millisecond tolerance in the range of
281         potential frames that should be erased frame from the track buffer
282         when the coded frame group is growing.
283
284         This is necessary because some files have imprecise overlapping
285         timestamps (especially WebM files).
286
287         This fixes a stall when seeking back and forth in YouTube with WebM
288         video.
289
290         A test case simulating the problem with video/mock using timestamps
291         similar to those of a typical 30 fps WebM video is also added.
292
293         * Modules/mediasource/SourceBuffer.cpp:
294         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
295
296 2018-10-31  Jer Noble  <jer.noble@apple.com>
297
298         MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.B0') is inproperly rejected
299         https://bugs.webkit.org/show_bug.cgi?id=191129
300
301         Reviewed by Eric Carlson.
302
303         Test: media/media-source/media-source-istypesupported-case-sensitive.html
304
305         According to RFC 2045: "All media type values, subtype values, and parameter names as
306         defined are case-insensitive. However, parameter values are case-sensitive unless otherwise
307         specified for the specific parameter." So rather than fold the entire ContentType into lower-
308         case, leave the original string intact and require clients to enforce case-insensitivity.
309
310         * Modules/mediasource/MediaSource.cpp:
311         (WebCore::MediaSource::isTypeSupported):
312
313 2018-10-31  Jer Noble  <jer.noble@apple.com>
314
315         Unreivewed build fix; fix the non-HAVE_AVCONTENTKEYSESSION builds by adding guards around
316         access of m_cdmInstance.
317
318         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
319         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
320
321 2018-10-31  YUHAN WU  <yuhan_wu@apple.com>
322
323         MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
324         https://bugs.webkit.org/show_bug.cgi?id=190778
325         <rdar://problem/45703574>
326
327         Reviewed by Youenn Fablet.
328
329         Add a include to fix the unified build error.
330
331         No tests since no new functionality.
332
333         * Modules/webgpu/WebGPUDevice.cpp:
334
335 2018-10-26  Jer Noble  <jer.noble@apple.com>
336
337         [EME][Cocoa] Cannot play unmuxed video and audio fMP4 streams encrypted with different keys via MSE
338         https://bugs.webkit.org/show_bug.cgi?id=190946
339
340         Reviewed by Eric Carlson.
341
342         Use separate AVContentKeySessions per CDMInstanceSession (rather than one AVContentKeySession per
343         CDMInstance).
344
345         - Add a mechanism for sending a message out from platform/CDMInstance to MediaKeySession without
346           requiring MediaKeySession to send a callback first.
347
348         - Move all the AVContentKeySession delegate methods from CDMInstanceFairPlayStreamingAVFObjC to
349           CDMInstanceSessionFairPlayStreamingAVFObjC.
350
351         - Add a mechanism for requesting the correct CDMInstanceSession for a given KeyID.
352
353         - Support key renewal through a "renew" message.
354
355         - Remember the keyID in SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID()
356           and ask for the correct CDMInstanceSession for that keyID in attemptToDecrypt().
357
358         - Pass the CDMInstance down from MediaPlayerPrivateMediaSourceAVFObjC -> SourceBufferPrivateAVFObjC.
359
360         * Modules/encryptedmedia/MediaKeySession.cpp:
361         (WebCore::MediaKeySession::sendMessage):
362         * Modules/encryptedmedia/MediaKeySession.h:
363         * platform/encryptedmedia/CDMInstanceSession.h:
364         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
365         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
366         (-[WebCoreFPSContentKeySessionDelegate initWithParent:]):
367         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
368         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession):
369         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
370         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionForKeyIDs const):
371         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC):
372         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::~CDMInstanceSessionFairPlayStreamingAVFObjC):
373         (WebCore::keyIDsForRequest):
374         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs):
375         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
376         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
377         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
378         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
379         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
380         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
381         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
382         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
383         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
384         (WebCore::requestStatusToCDMStatus):
385         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const):
386         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
387         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
388         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
389         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
390         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
391         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceAttached):
392         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceDetached):
393         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
394         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
395         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
396         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
397         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
398         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
399         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
400         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const):
401         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
402         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
403         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
404         (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceAttached):
405         (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceDetached):
406         (WebCore::MediaSourcePrivateAVFObjC::attemptToDecryptWithInstance):
407         (WebCore::MediaSourcePrivateAVFObjC::waitingForKey const):
408         (WebCore::MediaSourcePrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
409         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
410         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
411         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
412         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
413         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
414         (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt):
415         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
416
417 2018-10-31  Zach Li  <zacharyli323@gmail.com>
418
419         Add credit card autofill button
420         https://bugs.webkit.org/show_bug.cgi?id=191051
421         <rdar://problem/45657011>
422
423         Reviewed by Wenson Hsieh.
424
425         Test: fast/forms/auto-fill-button/input-credit-card-auto-fill-button.html
426
427         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
428         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
429         * css/html.css:
430         (input::-webkit-credit-card-auto-fill-button):
431         Add credit card autofill button.
432         (input::-webkit-credit-card-auto-fill-button:hover):
433         (input::-webkit-credit-card-auto-fill-button:active):
434         * html/HTMLTextFormControlElement.h:
435         * html/TextFieldInputType.cpp:
436         (WebCore::autoFillButtonTypeToAccessibilityLabel):
437         (WebCore::autoFillButtonTypeToAutoFillButtonText):
438         (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
439         (WebCore::isAutoFillButtonTypeChanged):
440         * platform/LocalizedStrings.cpp:
441         (WebCore::AXAutoFillCreditCardLabel):
442         * platform/LocalizedStrings.h:
443         * testing/Internals.cpp:
444         (WebCore::toAutoFillButtonType):
445         (WebCore::toInternalsAutoFillButtonType):
446         * testing/Internals.h:
447         * testing/Internals.idl:
448
449 2018-10-31  Eric Carlson  <eric.carlson@apple.com>
450
451         [MediaStream] Don't reveal device IDs until the user has granted permission to capture
452         https://bugs.webkit.org/show_bug.cgi?id=191112
453         <rdar://problem/45699932>
454
455         Reviewed by Youenn Fablet.
456
457         No new tests, existing tests updated.
458
459         * Modules/mediastream/MediaDevicesRequest.cpp:
460         (WebCore::MediaDevicesRequest::start): Don't reveal device ID or group ID until the user 
461         has granted permssion to capture.
462
463 2018-10-31  YUHAN WU  <yuhan_wu@apple.com>
464
465         MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
466         https://bugs.webkit.org/show_bug.cgi?id=190778
467
468         Reviewed by Youenn Fablet.
469
470         Implement JavaScript dispatch event dataavailable and JavaScript exposed method stop().
471         Implement a mock string as the output buffer of MediaRecorder.
472         Remove the declaration of timecode in BlobEvent since it has not been implemented in MediaRecorder and MediaRecorderPrivate. 
473
474         Tests: http/wpt/mediarecorder/MediaRecorder-dataavailable.html
475                http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html
476                imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution.html
477                imported/w3c/web-platform-tests/mediacapture-record/support/MediaRecorder-iframe.html
478
479         * CMakeLists.txt:
480         * Modules/mediarecorder/BlobEvent.cpp: Added.
481         (WebCore::BlobEvent::create):
482         (WebCore::BlobEvent::BlobEvent):
483         (WebCore::BlobEvent::eventInterface const):
484         * Modules/mediarecorder/BlobEvent.h:
485         * Modules/mediarecorder/BlobEvent.idl:
486         * Modules/mediarecorder/MediaRecorder.cpp:
487         (WebCore::MediaRecorder::MediaRecorder):
488         (WebCore::MediaRecorder::~MediaRecorder):
489         (WebCore::MediaRecorder::stop):
490         (WebCore::MediaRecorder::startRecording):
491         (WebCore::MediaRecorder::stopRecording):
492         (WebCore::MediaRecorder::stopRecordingInternal):
493         (WebCore::MediaRecorder::didAddOrRemoveTrack):
494         (WebCore::MediaRecorder::trackEnded):
495         (WebCore::MediaRecorder::sampleBufferUpdated):
496         (WebCore::MediaRecorder::audioSamplesAvailable):
497         (WebCore::MediaRecorder::scheduleDeferredTask):
498         * Modules/mediarecorder/MediaRecorder.h:
499         * Modules/mediarecorder/MediaRecorder.idl:
500         * Sources.txt:
501         * WebCore.xcodeproj/project.pbxproj:
502         * dom/EventNames.h:
503         * dom/EventNames.in:
504         * platform/mediarecorder/MediaRecorderPrivate.h: Added.
505         * platform/mediarecorder/MediaRecorderPrivateMock.cpp: Added.
506         (WebCore::MediaRecorderPrivateMock::sampleBufferUpdated):
507         (WebCore::MediaRecorderPrivateMock::audioSamplesAvailable):
508         (WebCore::MediaRecorderPrivateMock::generateMockString):
509         (WebCore::MediaRecorderPrivateMock::fetchData):
510         * platform/mediarecorder/MediaRecorderPrivateMock.h: Added.
511
512 2018-10-31  Claudio Saavedra  <csaavedra@igalia.com>
513
514         [GTK][WPE] Remaining topPrivatelyControlledDomain() fixes
515         https://bugs.webkit.org/show_bug.cgi?id=191110
516
517         Reviewed by Michael Catanzaro.
518
519         Covered by existing tests.
520
521         Turns out that this method is expected to reject domains that
522         are not registrable. Also sync with the Mac implementation in
523         that given domains that are not all ASCII should be returned
524         back as is. This fixes the remaining Public Suffix API tests.
525
526         * platform/soup/PublicSuffixSoup.cpp:
527         (WebCore::topPrivatelyControlledDomain):
528
529 2018-10-31  Antti Koivisto  <antti@apple.com>
530
531         Remove LayerFlushScheduler
532         https://bugs.webkit.org/show_bug.cgi?id=191103
533
534         Reviewed by Anders Carlsson.
535
536         It is only used in WK1.
537
538         * SourcesCocoa.txt:
539         * WebCore.xcodeproj/project.pbxproj:
540         * platform/graphics/ca/LayerFlushScheduler.cpp: Removed.
541         * platform/graphics/ca/LayerFlushScheduler.h: Removed.
542         * platform/graphics/ca/LayerFlushSchedulerClient.h: Removed.
543         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Removed.
544
545 2018-10-31  Zalan Bujtas  <zalan@apple.com>
546
547         Missing from r237634
548
549         * layout/inlineformatting/InlineFormattingState.cpp:
550         (WebCore::Layout::InlineFormattingState::formattingContext):
551
552 2018-10-31  Zalan Bujtas  <zalan@apple.com>
553
554         [LFC] Do not pass LayoutState& to compute* and layout* functions
555         https://bugs.webkit.org/show_bug.cgi?id=191100
556
557         Reviewed by Antti Koivisto.
558
559         Reduce noise by removing LayoutState& parameter where possible.
560
561         * layout/FormattingContext.cpp:
562         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
563         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
564         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
565         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
566         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
567         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
568         * layout/FormattingContext.h:
569         * layout/FormattingContextGeometry.cpp:
570         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
571         * layout/LayoutFormattingState.cpp:
572         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
573         * layout/blockformatting/BlockFormattingContext.cpp:
574         (WebCore::Layout::BlockFormattingContext::layout const):
575         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
576         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
577         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
578         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
579         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
580         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
581         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
582         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
583         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
584         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
585         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
586         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
587         * layout/blockformatting/BlockFormattingContext.h:
588         * layout/inlineformatting/InlineFormattingContext.cpp:
589         (WebCore::Layout::InlineFormattingContext::layout const):
590         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
591         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
592         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
593         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
594         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
595         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
596         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
597         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
598         * layout/inlineformatting/InlineFormattingContext.h:
599
600 2018-10-31  Zalan Bujtas  <zalan@apple.com>
601
602         [LFC] FormattingContext class should take FormattingState&
603         https://bugs.webkit.org/show_bug.cgi?id=191099
604
605         Reviewed by Antti Koivisto.
606
607         This is in preparation for not passing LayoutState& into every layout functions.
608         FormattingContext has FormattingState now and LayoutState can be acquired through FormattingState.
609         LayoutState <- FormattingState <- FormattingContext
610
611         * layout/FormattingContext.cpp:
612         (WebCore::Layout::FormattingContext::FormattingContext):
613         (WebCore::Layout::FormattingContext::formattingState const):
614         (WebCore::Layout::FormattingContext::layoutState const):
615         * layout/FormattingContext.h:
616         * layout/FormattingState.cpp:
617         (WebCore::Layout::FormattingState::FormattingState):
618         * layout/FormattingState.h:
619         (WebCore::Layout::FormattingState::layoutState const):
620         * layout/LayoutFormattingState.h:
621         * layout/blockformatting/BlockFormattingContext.cpp:
622         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
623         * layout/blockformatting/BlockFormattingContext.h:
624         * layout/blockformatting/BlockFormattingState.cpp:
625         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
626         (WebCore::Layout::BlockFormattingState::formattingContext):
627         (WebCore::Layout::BlockFormattingState::formattingContext const): Deleted.
628         * layout/blockformatting/BlockFormattingState.h:
629         * layout/inlineformatting/InlineFormattingContext.cpp:
630         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
631         * layout/inlineformatting/InlineFormattingContext.h:
632         * layout/inlineformatting/InlineFormattingState.cpp:
633         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
634         (WebCore::Layout::InlineFormattingState::formattingContext):
635         (WebCore::Layout::InlineFormattingState::formattingContext const): Deleted.
636         * layout/inlineformatting/InlineFormattingState.h:
637
638 2018-10-31  Zalan Bujtas  <zalan@apple.com>
639
640         [LFC] The *FormattingState class should provide the *FormattingContext.
641         https://bugs.webkit.org/show_bug.cgi?id=191089
642
643         Reviewed by Antti Koivisto.
644
645         BlockFormattingState provides the BlockFormattingContext object, while InlineFormattingState provides the InlineFormattingContext.
646
647         * layout/FormattingContext.cpp:
648         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
649         * layout/FormattingState.h:
650         * layout/LayoutFormattingState.cpp:
651         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
652         (WebCore::Layout::LayoutState::formattingContext const): Deleted.
653         * layout/LayoutFormattingState.h:
654         * layout/blockformatting/BlockFormattingContext.cpp:
655         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
656         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
657         * layout/blockformatting/BlockFormattingState.cpp:
658         (WebCore::Layout::BlockFormattingState::formattingContext const):
659         * layout/blockformatting/BlockFormattingState.h:
660         * layout/inlineformatting/InlineFormattingContext.cpp:
661         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
662         * layout/inlineformatting/InlineFormattingState.cpp:
663         (WebCore::Layout::InlineFormattingState::formattingContext const):
664         * layout/inlineformatting/InlineFormattingState.h:
665
666 2018-10-31  Zalan Bujtas  <zalan@apple.com>
667
668         [LFC] Rename LayoutContext to LayoutState
669         https://bugs.webkit.org/show_bug.cgi?id=191080
670
671         Reviewed by Antti Koivisto.
672
673         LayoutContext naming was a bit misleading since none of the other *FormattingContext classes (BlockFormattingContext etc) hold states.
674         (LayoutContext.cpp -> LayoutFormattingState.cpp because LayoutState.cpp name is already taken.)
675
676         Now the current state is as follows:
677
678         LayoutState has
679         1. Layout tree
680         2. State content for each formatting subtrees
681         3. Display tree
682
683         * Sources.txt:
684         * WebCore.xcodeproj/project.pbxproj:
685         * layout/FormattingContext.cpp:
686         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
687         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
688         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
689         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
690         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
691         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
692         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
693         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
694         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
695         * layout/FormattingContext.h:
696         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
697         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
698         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
699         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
700         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
701         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
702         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
703         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
704         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
705         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
706         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
707         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
708         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
709         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
710         * layout/FormattingContextGeometry.cpp:
711         (WebCore::Layout::contentHeightForFormattingContextRoot):
712         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
713         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
714         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
715         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
716         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
717         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
718         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
719         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
720         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
721         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
722         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
723         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
724         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
725         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
726         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
727         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
728         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
729         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
730         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
731         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
732         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
733         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
734         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
735         * layout/FormattingState.cpp:
736         (WebCore::Layout::FormattingState::FormattingState):
737         * layout/FormattingState.h:
738         (WebCore::Layout::FormattingState::setInstrinsicWidthConstraints):
739         (WebCore::Layout::FormattingState::instrinsicWidthConstraints const):
740         * layout/LayoutFormattingState.cpp: Renamed from Source/WebCore/layout/LayoutContext.cpp.
741         (WebCore::Layout::LayoutState::LayoutState):
742         (WebCore::Layout::LayoutState::initializeRoot):
743         (WebCore::Layout::LayoutState::updateLayout):
744         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
745         (WebCore::Layout::LayoutState::displayBoxForLayoutBox const):
746         (WebCore::Layout::LayoutState::styleChanged):
747         (WebCore::Layout::LayoutState::markNeedsUpdate):
748         (WebCore::Layout::LayoutState::formattingStateForBox const):
749         (WebCore::Layout::LayoutState::establishedFormattingState const):
750         (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
751         (WebCore::Layout::LayoutState::formattingContext const):
752         * layout/LayoutFormattingState.h: Renamed from Source/WebCore/layout/LayoutContext.h.
753         (WebCore::Layout::LayoutState::setInQuirksMode):
754         (WebCore::Layout::LayoutState::hasDisplayBox const):
755         (WebCore::Layout::LayoutState::inQuirksMode const):
756         * layout/Verification.cpp:
757         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
758         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
759         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
760         (WebCore::Layout::verifyAndOutputSubtree):
761         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
762         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): Deleted.
763         * layout/blockformatting/BlockFormattingContext.cpp:
764         (WebCore::Layout::BlockFormattingContext::layout const):
765         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
766         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
767         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
768         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
769         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
770         (WebCore::Layout::hasPrecomputedMarginTop):
771         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
772         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
773         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
774         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
775         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
776         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
777         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
778         * layout/blockformatting/BlockFormattingContext.h:
779         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
780         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
781         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
782         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
783         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
784         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
785         (WebCore::Layout::isStretchedToInitialContainingBlock):
786         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
787         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
788         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
789         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
790         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
791         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
792         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
793         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
794         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop):
795         * layout/blockformatting/BlockFormattingState.cpp:
796         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
797         * layout/blockformatting/BlockFormattingState.h:
798         * layout/blockformatting/BlockInvalidation.cpp:
799         (WebCore::Layout::computeUpdateType):
800         (WebCore::Layout::computeUpdateTypeForAncestor):
801         (WebCore::Layout::BlockInvalidation::invalidate):
802         * layout/blockformatting/BlockInvalidation.h:
803         * layout/blockformatting/BlockMarginCollapse.cpp:
804         (WebCore::Layout::isMarginTopCollapsedWithParent):
805         (WebCore::Layout::isMarginBottomCollapsedThrough):
806         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild):
807         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop):
808         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop):
809         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom):
810         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
811         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom):
812         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
813         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild):
814         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom):
815         * layout/displaytree/DisplayBox.h:
816         * layout/floats/FloatAvoider.cpp:
817         (WebCore::Layout::FloatAvoider::FloatAvoider):
818         * layout/floats/FloatAvoider.h:
819         * layout/floats/FloatBox.cpp:
820         (WebCore::Layout::FloatBox::FloatBox):
821         * layout/floats/FloatBox.h:
822         * layout/floats/FloatingContext.cpp:
823         (WebCore::Layout::FloatingContext::positionForFloat const):
824         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
825         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
826         * layout/floats/FloatingContext.h:
827         (WebCore::Layout::FloatingContext::layoutState const):
828         (WebCore::Layout::FloatingContext::layoutContext const): Deleted.
829         * layout/floats/FloatingState.cpp:
830         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
831         (WebCore::Layout::FloatingState::FloatingState):
832         (WebCore::Layout::FloatingState::constraints const):
833         * layout/floats/FloatingState.h:
834         (WebCore::Layout::FloatingState::create):
835         (WebCore::Layout::FloatingState::layoutState const):
836         (WebCore::Layout::FloatingState::layoutContext const): Deleted.
837         * layout/inlineformatting/InlineFormattingContext.cpp:
838         (WebCore::Layout::InlineFormattingContext::layout const):
839         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
840         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
841         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
842         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
843         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
844         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
845         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
846         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
847         * layout/inlineformatting/InlineFormattingContext.h:
848         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
849         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
850         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
851         * layout/inlineformatting/InlineFormattingState.cpp:
852         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
853         * layout/inlineformatting/InlineFormattingState.h:
854         * layout/inlineformatting/InlineInvalidation.cpp:
855         (WebCore::Layout::InlineInvalidation::invalidate):
856         * layout/inlineformatting/InlineInvalidation.h:
857         * layout/inlineformatting/InlineLineBreaker.cpp:
858         (WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
859         (WebCore::Layout::InlineLineBreaker::runWidth const):
860         * layout/inlineformatting/InlineLineBreaker.h:
861         * layout/layouttree/LayoutTreeBuilder.cpp:
862         (WebCore::Layout::outputInlineRuns):
863         (WebCore::Layout::outputLayoutTree):
864         (WebCore::Layout::showLayoutTree):
865         * layout/layouttree/LayoutTreeBuilder.h:
866         * page/FrameViewLayoutContext.cpp:
867         (WebCore::layoutUsingFormattingContext):
868
869 2018-10-30  Wenson Hsieh  <wenson_hsieh@apple.com>
870
871         [Cocoa] Attachment dropped from one web view to another is missing its file wrapper
872         https://bugs.webkit.org/show_bug.cgi?id=190530
873         <rdar://problem/45232149>
874
875         Reviewed by Tim Horton.
876
877         Add support for copying and pasting attachment elements across web views by encoding and adding file wrapper
878         data as subresources in the web archive when writing selected web content to the pasteboard, and then decoding
879         and creating NSFileWrappers upon reading web content.
880
881         Test: WKAttachmentTests.CopyAndPasteBetweenWebViews
882
883         * WebCore.xcodeproj/project.pbxproj:
884         * editing/Editor.cpp:
885         (WebCore::Editor::registerAttachments):
886         * editing/Editor.h:
887
888         Add registerAttachments(), which registers _WKAttachments in the UI process given a list of
889         SerializedAttachmentData. This behaves similarly to registerAttachmentIdentifiers(), but differs in that (1) it
890         sends serialized file wrapper data, and (2) it sends a list of serialized attachments, rather than information
891         about just a single attachment.
892
893         * editing/SerializedAttachmentData.h:
894
895         Introduce SerializedAttachmentData, a struct containing information needed to serialize and deserialize an
896         attachment. These are used both when writing attachment data to the pasteboard, and when consuming attachment
897         data upon paste.
898
899         * editing/cocoa/WebContentReaderCocoa.mm:
900         (WebCore::replaceRichContentWithAttachments):
901
902         Add a step when pasting rich content with attachments, to collect and send serialized attachments to the client.
903         Also, drive-by fix: don't WTFMove() the Ref here if it's still going to be used below.
904
905         * html/HTMLAttachmentElement.cpp:
906         (WebCore::HTMLAttachmentElement::archiveResourceURL):
907         * html/HTMLAttachmentElement.h:
908
909         Add a static helper function to compute a URL that represents the data for the given attachment identifier, for
910         use in a web archive resource.
911
912         * loader/archive/cf/LegacyWebArchive.cpp:
913         (WebCore::addSubresourcesForAttachmentElementsIfNecessary):
914
915         Add a helper function to create and append ArchiveResources representing attachment element data when writing
916         attachments to the pasteboard via web archive data.
917
918         (WebCore::LegacyWebArchive::create):
919         * page/EditorClient.h:
920         (WebCore::EditorClient::registerAttachments):
921         (WebCore::EditorClient::serializedAttachmentDataForIdentifiers):
922
923 2018-10-30  David Kilzer  <ddkilzer@apple.com>
924
925         XSLTProcessor should limit max transform depth
926         <https://webkit.org/b/191075>
927         <rdar://problem/45531453>
928
929         Reviewed by Alex Christensen.
930
931         Test: fast/xsl/xslt-max-depth.html
932
933         * xml/SoftLinkLibxslt.cpp: Add macro for `xsltMaxDepth` global.
934         * xml/SoftLinkLibxslt.h: Ditto.
935         * xml/XSLTProcessorLibxslt.cpp:
936         (WebCore::XSLTProcessor::transformToString): Set `xsltMaxDepth`
937         to 1000.  Default in libxslt.dylib is 3000.
938
939 2018-10-30  Jim Mason  <jmason@ibinx.com>
940
941         [GTK] Scrollbars not following gtk-primary-button-warps-slider setting
942         https://bugs.webkit.org/show_bug.cgi?id=191067
943
944         Reviewed by Michael Catanzaro.
945
946         * platform/gtk/ScrollbarThemeGtk.cpp:
947         (WebCore::ScrollbarThemeGtk::handleMousePressEvent):
948
949 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
950
951         Clean up some obsolete MAX_ALLOWED macros
952         https://bugs.webkit.org/show_bug.cgi?id=190916
953
954         Reviewed by Tim Horton.
955
956         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
957         (WebCore::exernalDeviceDisplayNameForPlayer):
958         * platform/mac/PlatformEventFactoryMac.mm:
959         (WebCore::globalPointForEvent):
960         (WebCore::pointForEvent):
961         (WebCore::mouseButtonForEvent):
962         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
963
964 2018-10-30  Ali Juma  <ajuma@chromium.org>
965
966         Calling window.open("", "_self") allows working around restrictions on window.close()
967         https://bugs.webkit.org/show_bug.cgi?id=191073
968
969         Reviewed by Chris Dumez.
970
971         Do not treat a re-used frame in DOMWindow::createWindow as having been opened by DOM.
972
973         Test: fast/dom/Window/window-open-self-disallow-close.html
974
975         * page/DOMWindow.cpp:
976         (WebCore::DOMWindow::createWindow):
977
978 2018-10-30  Andy Estes  <aestes@apple.com>
979
980         [Payment Request] Implement PaymentResponse.retry()
981         https://bugs.webkit.org/show_bug.cgi?id=190985
982
983         Reviewed by Daniel Bates.
984
985         Implemented the retry() method on PaymentResponse as specified in the Payment Request API
986         W3C Editor's Draft of 24 October 2018.
987
988         See https://w3c.github.io/payment-request/#retry-method for details.
989
990         Tests: http/tests/paymentrequest/payment-response-rejects-if-not-active.https.html
991                http/tests/paymentrequest/payment-response-retry-method.https.html
992
993         * Modules/applepay/PaymentCoordinator.h:
994         (WebCore::PaymentCoordinator::client): Added. Returns m_client.
995         * Modules/applepay/PaymentCoordinatorClient.h:
996         (WebCore::PaymentCoordinatorClient::isMockPaymentCoordinator const): Added. Used to downcast
997         a PaymentCoordinatorClient to a MockPaymentCoordinator.
998         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
999         (WebCore::ApplePayPaymentHandler::computeTotalAndLineItems const): Made const.
1000         (WebCore::ApplePayPaymentHandler::computeErrors const): Broke this function into
1001         computeAddressErrors, computePayerErrors, and computePaymentMethodErrors, then modified this
1002         function to call those functions. Exceptions thrown by computePaymentMethodErrors are ignored.
1003         (WebCore::ApplePayPaymentHandler::computeAddressErrors const): Added.
1004         (WebCore::ApplePayPaymentHandler::computePayerErrors const): Added.
1005         (WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const): Added.
1006         (WebCore::ApplePayPaymentHandler::complete): Added ASSERTs to verify whether result is a
1007         final result.
1008         (WebCore::ApplePayPaymentHandler::retry): Computed PaymentErrors from PaymentValidationErrors,
1009         ensured the PaymentAuthorizationResult was non-final by adding an unknown error if necessary,
1010         and called PaymentCoordinator::completePaymentSession.
1011         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1012         * Modules/paymentrequest/PaymentHandler.h:
1013         * Modules/paymentrequest/PaymentRequest.cpp:
1014         (WebCore::PaymentRequest::show): Changed to call settleShowPromise.
1015         (WebCore::PaymentRequest::abortWithException): Changed to abort PaymentResponse's retry
1016         promise, if present, instead of PaymentResponse's show promise.
1017         (WebCore::PaymentRequest::settleShowPromise): Added. Settles m_showPromise then sets it to
1018         std::nullopt.
1019         (WebCore::PaymentRequest::closeActivePaymentHandler): Added. Hides the active payment
1020         handler then sets it to std::nullopt.
1021         (WebCore::PaymentRequest::stop): Stopped calling abortWithException, since that function
1022         might settle PaymentResponse's retry promise. PaymentResponse is now an ActiveDOMObject and
1023         will settle its own promise in its implementation of stop.
1024         (WebCore::PaymentRequest::abort): Changed to throw an InvalidStateError if there is a
1025         pending retry promise and to call abortWithException instead of stop.
1026         (WebCore::PaymentRequest::completeMerchantValidation): Changed to call abortWithException
1027         instead of stop.
1028         (WebCore::PaymentRequest::settleDetailsPromise): Ditto.
1029         (WebCore::PaymentRequest::accept): Updated the existing PaymentResponse, if present, rather
1030         than creating a new one. Settled the existing PaymentResponse's retry promise, if present,
1031         rather than the show promise.
1032         (WebCore::PaymentRequest::complete): Changed to throw an AbortError if there is no longer an
1033         active payment handler.
1034         (WebCore::PaymentRequest::retry): Changed to throw an AbortError if there is no longer an
1035         active payment handler, and to call PaymentHandler::retry if there is.
1036         (WebCore::PaymentRequest::cancel): Changed to call abortWithException instead of stop.
1037         * Modules/paymentrequest/PaymentRequest.h:
1038         * Modules/paymentrequest/PaymentRequest.idl:
1039         * Modules/paymentrequest/PaymentResponse.cpp:
1040         (WebCore::PaymentResponse::PaymentResponse):
1041         (WebCore::PaymentResponse::finishConstruction): Pending activities create strong references
1042         to |this|, so they cannot be created in constructors without relaxing adoption requirements.
1043         Added this function so that the pending activity can be created after the PaymentResponse is
1044         created and adopted.
1045         (WebCore::PaymentResponse::~PaymentResponse):
1046         (WebCore::PaymentResponse::complete): Updated to throw an AbortError or InvalidStateError
1047         when necessary.
1048         (WebCore::PaymentResponse::retry): Implemented. Throws an AbortError or InvalidStateError
1049         when necessary, otherwise calls PaymentRequest::retry and stores the retry promise in
1050         m_retryPromise.
1051         (WebCore::PaymentResponse::abortWithException): Added. Rejects the retry promise with
1052         |exception|, clears the pending activity, and sets m_state to Completed.
1053         (WebCore::PaymentResponse::settleRetryPromise): Added. Settles the retry promise and sets it
1054         to std::nullopt.
1055         (WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Added. Returns true if
1056         there is no pending activity.
1057         (WebCore::PaymentResponse::stop): Added. Rejects the retry promise with AbortError, clears
1058         the pending activity, and sets m_state to Stopped.
1059         * Modules/paymentrequest/PaymentResponse.h: Changed create to call finishConstruction and
1060         made PaymentResponse an ActiveDOMObject instead of a ContextDestructionObserver.
1061         * testing/Internals.cpp:
1062         (WebCore::Internals::Internals): Changed to only create a MockPaymentCoordinator for main frames.
1063         (WebCore::Internals::mockPaymentCoordinator): Changed to get the MockPaymentCoordinator by
1064         downcasting the page's payment coordinator client.
1065         * testing/Internals.h:
1066         * testing/Internals.idl:
1067         * testing/MockPaymentCoordinator.cpp:
1068         (WebCore::MockPaymentCoordinator::completePaymentSession): Changed to only increment
1069         hideCount for final results.
1070         * testing/MockPaymentCoordinator.h:
1071         (isType): Added so that PaymentCoordinatorClients can be downcasted to MockPaymentCoordinators.
1072
1073 2018-10-30  Zalan Bujtas  <zalan@apple.com>
1074
1075         [iOS] Use the mainframe view size to compute window.outerWidth/height.
1076         https://bugs.webkit.org/show_bug.cgi?id=191070
1077         <rdar://problem/42368377>
1078
1079         Reviewed by Tim Horton.
1080
1081         Use a more reasonable value for window.outerWidth and height.
1082         (WKWebView's frame rect -> drawing area sizing -> WebPage's view size -> FrameView size)
1083
1084         * page/DOMWindow.cpp:
1085         (WebCore::DOMWindow::outerHeight const):
1086         (WebCore::DOMWindow::outerWidth const):
1087
1088 2018-10-30  Andy Estes  <aestes@apple.com>
1089
1090         [Apple Pay] PaymentRequest.canMakePayment() should resolve to true whenever Apple Pay is available
1091         https://bugs.webkit.org/show_bug.cgi?id=191039
1092
1093         Reviewed by Megan Gardner.
1094
1095         During a recent Web Payments WG F2F, we decided that canMakePayment() should return true
1096         whenever the user agent supports one or more of the specified payment methods, even if those
1097         payment methods do not have active instruments.
1098
1099         Change WebKit's implementation of canMakePayment() for Apple Pay to resolve with the value
1100         of ApplePaySession.canMakePayments() rather than ApplePaySession.canMakePaymentsWithActiveCard().
1101
1102         Added a test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
1103
1104         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1105         (WebCore::ApplePayPaymentHandler::canMakePayment):
1106         (WebCore::shouldDiscloseApplePayCapability): Deleted.
1107         * testing/MockPaymentCoordinator.cpp:
1108         (WebCore::MockPaymentCoordinator::canMakePayments):
1109         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
1110         * testing/MockPaymentCoordinator.h:
1111         * testing/MockPaymentCoordinator.idl:
1112
1113 2018-10-30  Sihui Liu  <sihui_liu@apple.com>
1114
1115         Add a deprecation warning to console for Web SQL
1116         https://bugs.webkit.org/show_bug.cgi?id=190936
1117
1118         Reviewed by Ryosuke Niwa.
1119
1120         No new tests. Just adding a console message.
1121
1122         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
1123         (WebCore::DOMWindowWebDatabase::openDatabase):
1124
1125 2018-10-30  Sihui Liu  <sihui_liu@apple.com>
1126
1127         IndexedDB: iteration of cursors skip records if updated or deleted
1128         https://bugs.webkit.org/show_bug.cgi?id=190917
1129         <rdar://problem/35250410>
1130
1131         Reviewed by Chris Dumez.
1132
1133         When object store has changes, we cleared cached records and reset the SQLite statement, 
1134         updating the boundary to the next key in cursor's direction. Therefore, the cursor could 
1135         jump to the next key after update or deletion.
1136         We should cache those records before changing the statement.
1137
1138         Test: storage/indexeddb/cursor-update-while-iterating.html
1139
1140         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1141         (WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
1142         (WebCore::IDBServer::SQLiteIDBCursor::fetch):
1143         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1144
1145 2018-10-29  Zalan Bujtas  <zalan@apple.com>
1146
1147         [LFC][IFC] Introduce InlineFormattingContextGeometry class
1148         https://bugs.webkit.org/show_bug.cgi?id=191054
1149
1150         Reviewed by Antti Koivisto.
1151
1152         This is in preparation for inline-block support.
1153
1154         Move float and inline-block elements layout to layoutFormattingContextRoot().
1155         computeWidthAndHeightForInlineBox takes care of replaced elements.
1156
1157         * Sources.txt:
1158         * WebCore.xcodeproj/project.pbxproj:
1159         * layout/inlineformatting/InlineFormattingContext.cpp:
1160         (WebCore::Layout::InlineFormattingContext::layout const):
1161         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1162         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
1163         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const): Deleted.
1164         * layout/inlineformatting/InlineFormattingContext.h:
1165         * layout/inlineformatting/InlineFormattingContextGeometry.cpp: Added.
1166         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1167         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
1168
1169 2018-10-28  Antoine Quint  <graouts@apple.com>
1170
1171         [Web Animations] Implement the update animations and send events procedure
1172         https://bugs.webkit.org/show_bug.cgi?id=191013
1173         <rdar://problem/45620495>
1174
1175         Reviewed by Dean Jackson.
1176
1177         While we implemented the various parts of what the Web Animations specification refers to as the "update animations and send events"
1178         procedure, we did not implement it as one function and in the correct order, specifically updating animations and sending events in
1179         two separate tasks. We now have a single method on DocumentTimeline which runs as the DisplayRefreshMonitor fires to update each
1180         "relevant" animation with the current time, perform a microtask checkpoint and dispatch events.
1181
1182         Implementing this procedure allowed us to make several enhancements:
1183
1184         1. We introduce the concept of a "relevant" animation, which is essentially an animation that is either pending or playing. All animations
1185         in a different state are no longer owned by the DocumentTimeline and can thus be destroyed if the developer doesn't hold references in JS.
1186         Maintaining such a list guarantees that we're only updating animations that would have changed state since the last time the "update animations
1187         and send events" procedure was run. Note that DeclarativeAnimation instances are also considered to be relevant if they have queued DOM events
1188         to dispatch as they could otherwise be destroyed before they can fully dispatch them.
1189
1190         2. We no longer conflate the timing model and effects. Until now the way we would update animations was to go through all elements for which
1191         we had a registered animation, invalidate their style and finally forcing a style update on the document. We had a separate data structure where
1192         we help animations without targets so we update these as well in a separate pass, in order to make sure that promises and events would fire for
1193         them as expected. We now let the "update animations and send events" procedure update the timing of all relevant animations and let individual
1194         animation effects invalidate their style as needed, the document style invalidation happening naturally without DocumentTimeline forcing it. 
1195
1196         3. We use a single step to schedule the update of animations, which is to register for a display refresh monitor update provided a "relevant"
1197         animation is known since the previous update. Until now we first had an "timing model invalidation" task scheduled upon any change of an animation's
1198         timing model, which would then create a timer to the earliest moment any listed animation would require an update, finally registering a display
1199         refresh monitor update, which used at least GenericTaskQueue<Timer> and potentially two, whereas we use none right now.
1200
1201         4. We allow for a display refresh monitor update to be canceled should the number of "relevant" animations since the last update goes back to 0.
1202
1203         To facilitate all of this, we have changed the m_animations ListHashSet to contain only the "relevant" animations, and no longer every animation created
1204         that has this DocumentTimeline set as their "timeline" property. To keep this list current, every single change that changes a given animation's timing
1205         ends up calling AnimationTimeline::animationTimingDidChange() passing the animation as the sole parameter and adding this animation to m_animations. We
1206         immediately schedule a display refresh monitor update if one wasn't already scheduled. Then, when running the "update animations and send events"
1207         procedure, we call a new WebAnimation::tick() method on each of those animations, which updates this animation's effect and relevance, using the newly
1208         computed relevance to identify whether this animation should be kept in the m_animations ListHashSet.
1209
1210         This is only the first step towards a more efficient update and ownership model of animations by the document timeline since animations created as CSS
1211         Animations and CSS Transitions are committed through CSS have dedicated data structures that are not updated in this particular patch, but this will be
1212         addressed in a followup to keep this already significant patch smaller. Another issue that will be addressed later is the ability to not schedule display
1213         refresh monitor udpates when only accelerated animations are running.
1214
1215         * animation/AnimationTimeline.cpp:
1216         (WebCore::AnimationTimeline::animationTimingDidChange): Called by animations when any aspect of their timing model changes. The provided animation is then
1217         added to the m_animations list unless its timeline is no longer this timeline.
1218         (WebCore::AnimationTimeline::removeAnimation): Remove the provided animation from m_animations and remove any animation registered on the element-specific
1219         animation lists if this animation has an effect with a target.
1220         (WebCore::AnimationTimeline::animationWasAddedToElement): We no longer need to worry about the m_animationsWithoutTarget data structure since we removed it.
1221         (WebCore::removeCSSTransitionFromMap): Fix a bug where we would remove any CSSTransition in the provided map that had a matching transition-property instead
1222         of checking the CSSTransition registered for this transition-property was indeed the provided CSSTransition. The other code changes in this patch made this
1223         code now cause regressions in the Web Platform Tests.
1224         (WebCore::AnimationTimeline::animationWasRemovedFromElement): Stop updating m_animationsWithoutTarget since it no longer exists.
1225         (WebCore::AnimationTimeline::elementWasRemoved):
1226         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Fix a small error that caused a regression in the Web Platform Tests where we could attempt to
1227         call setBackingAnimation() on a nullptr instead of a valid CSSAnimation.
1228         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
1229         (WebCore::AnimationTimeline::addAnimation): Deleted.
1230         * animation/AnimationTimeline.h:
1231         (WebCore::AnimationTimeline::hasElementAnimations const): Deleted.
1232         (WebCore::AnimationTimeline:: const): Deleted.
1233         (WebCore::AnimationTimeline::elementToAnimationsMap): Deleted.
1234         (WebCore::AnimationTimeline::elementToCSSAnimationsMap): Deleted.
1235         (WebCore::AnimationTimeline::elementToCSSTransitionsMap): Deleted.
1236         * animation/CSSTransition.cpp:
1237         (WebCore::CSSTransition::canBeListed const): Deleted.
1238         * animation/CSSTransition.h:
1239         * animation/DeclarativeAnimation.cpp:
1240         (WebCore::DeclarativeAnimation::tick): Call the superclass's method and queue any necessary DOM events reflecting the timing model changes.
1241         (WebCore::DeclarativeAnimation::needsTick const): Call the superclass's method and return true also if we have pending events since otherwise this animation
1242         could be removed from m_animations on its AnimationTimeline and potentially destroyed before the GenericEventQueue had a chance to dispatch all events.
1243         (WebCore::DeclarativeAnimation::startTime const): We removed the custom binding for this IDL property and renamed the method from bindingsStartTime to startTime.
1244         (WebCore::DeclarativeAnimation::setStartTime): We removed the custom binding for this IDL property and renamed the method from setBindingsStartTime to setStartTime.
1245         (WebCore::DeclarativeAnimation::bindingsStartTime const): Deleted.
1246         (WebCore::DeclarativeAnimation::setBindingsStartTime): Deleted.
1247         * animation/DeclarativeAnimation.h:
1248         * animation/DocumentAnimationScheduler.cpp:
1249         (WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution): Add a method to mark that we no longer need a display refresh monitor update for this
1250         document's animation timeline. This is called when m_animations becomes empty.
1251         * animation/DocumentAnimationScheduler.h:
1252         * animation/DocumentTimeline.cpp:
1253         (WebCore::DocumentTimeline::DocumentTimeline):
1254         (WebCore::DocumentTimeline::detachFromDocument): Stop clearing two task queues and a timer that no longer exist and instead only clear the task queue to clear
1255         the cached current time, which we queue any time we generate a new one (see DocumentTimeline::currentTime).
1256         (WebCore::DocumentTimeline::getAnimations const): Use isRelevant() instead of canBeListed().
1257         (WebCore::DocumentTimeline::updateThrottlingState):
1258         (WebCore::DocumentTimeline::suspendAnimations):
1259         (WebCore::DocumentTimeline::resumeAnimations):
1260         (WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const):
1261         (WebCore::DocumentTimeline::currentTime): Queue a task in the new m_currentTimeClearingTaskQueue task queue to clear the current time that we've generated and cached
1262         in the next run loop (provided all pending JS execution has also completed). 
1263         (WebCore::DocumentTimeline::maybeClearCachedCurrentTime):
1264         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Schedule a display refresh monitor update if we are not suspended and have "relevant" animations.
1265         (WebCore::DocumentTimeline::animationTimingDidChange): Call scheduleAnimationResolutionIfNeeded() after calling the superclass's implementation.
1266         (WebCore::DocumentTimeline::removeAnimation): Call unscheduleAnimationResolution() if the list of "relevant" animations is now empty.
1267         (WebCore::DocumentTimeline::unscheduleAnimationResolution): Unschedule a pending display refresh monitor update.
1268         (WebCore::DocumentTimeline::animationResolutionTimerFired):
1269         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Implement the "update animations and send events" procedure as specified by the Web Animations spec.
1270         During this procedure, we call tick() on all animations listed in m_animations and create a list of animations to remove from that list if this animation is no
1271         longer relevant following the call to tick().
1272         (WebCore::DocumentTimeline::enqueueAnimationPlaybackEvent):
1273         (WebCore::DocumentTimeline::timingModelDidChange): Deleted.
1274         (WebCore::DocumentTimeline::scheduleInvalidationTaskIfNeeded): Deleted.
1275         (WebCore::DocumentTimeline::performInvalidationTask): Deleted.
1276         (WebCore::DocumentTimeline::updateAnimationSchedule): Deleted.
1277         (WebCore::DocumentTimeline::animationScheduleTimerFired): Deleted.
1278         (WebCore::DocumentTimeline::updateAnimations): Deleted.
1279         (WebCore::compareAnimationPlaybackEvents): Deleted.
1280         (WebCore::DocumentTimeline::performEventDispatchTask): Deleted.
1281         * animation/DocumentTimeline.h:
1282         * animation/WebAnimation.cpp: The majority of the changes to this class is that we call the new timingDidChange() method when any code that modifies the timing model
1283         is run. We also remove methods to set the pending play and pause tasks as well as the animation's start time and hold time since any time we're changing these instance
1284         variables, we later already have a call to update the timing model and we were doing more work than needed. As a result we no longer need an internal method to set the
1285         start time and can stop requiring a custom IDL binding for the "startTime" property.
1286         (WebCore::WebAnimation::effectTimingPropertiesDidChange):
1287         (WebCore::WebAnimation::setEffect):
1288         (WebCore::WebAnimation::setEffectInternal):
1289         (WebCore::WebAnimation::setTimeline):
1290         (WebCore::WebAnimation::setTimelineInternal):
1291         (WebCore::WebAnimation::startTime const):
1292         (WebCore::WebAnimation::setStartTime):
1293         (WebCore::WebAnimation::silentlySetCurrentTime):
1294         (WebCore::WebAnimation::setCurrentTime):
1295         (WebCore::WebAnimation::setPlaybackRate):
1296         (WebCore::WebAnimation::cancel):
1297         (WebCore::WebAnimation::resetPendingTasks):
1298         (WebCore::WebAnimation::finish):
1299         (WebCore::WebAnimation::timingDidChange): New method called any time a timing property changed where we run the "update the finished state" procedure and notify the
1300         animation's timeline that its timing changed so that it can be considered the next time the "update animations and send events" procedure runs.
1301         (WebCore::WebAnimation::invalidateEffect):
1302         (WebCore::WebAnimation::updateFinishedState): Update the animation's relevance after running the procedure as specified.
1303         (WebCore::WebAnimation::play):
1304         (WebCore::WebAnimation::runPendingPlayTask):
1305         (WebCore::WebAnimation::pause):
1306         (WebCore::WebAnimation::runPendingPauseTask):
1307         (WebCore::WebAnimation::needsTick const):
1308         (WebCore::WebAnimation::tick): New method called during the "update animations and send events" procedure where we run the "update the finished state" procedure and run
1309         the pending play and pause tasks.
1310         (WebCore::WebAnimation::resolve):
1311         (WebCore::WebAnimation::updateRelevance):
1312         (WebCore::WebAnimation::computeRelevance):
1313         (WebCore::WebAnimation::timingModelDidChange): Deleted.
1314         (WebCore::WebAnimation::setHoldTime): Deleted.
1315         (WebCore::WebAnimation::bindingsStartTime const): Deleted.
1316         (WebCore::WebAnimation::setBindingsStartTime): Deleted.
1317         (WebCore::WebAnimation::setTimeToRunPendingPlayTask): Deleted.
1318         (WebCore::WebAnimation::setTimeToRunPendingPauseTask): Deleted.
1319         (WebCore::WebAnimation::updatePendingTasks): Deleted.
1320         (WebCore::WebAnimation::timeToNextRequiredTick const): Deleted.
1321         (WebCore::WebAnimation::runPendingTasks): Deleted.
1322         (WebCore::WebAnimation::canBeListed const): Deleted.
1323         * animation/WebAnimation.h:
1324         (WebCore::WebAnimation::isRelevant const):
1325         (WebCore::WebAnimation::hasPendingPlayTask const):
1326         (WebCore::WebAnimation::isEffectInvalidationSuspended):
1327         * animation/WebAnimation.idl:
1328         * dom/Element.cpp:
1329         (WebCore::Element::getAnimations): Use isRelevant() instead of canBeListed().
1330
1331 2018-10-30  Youenn Fablet  <youenn@apple.com>
1332
1333         LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append
1334         https://bugs.webkit.org/show_bug.cgi?id=191026
1335
1336         Reviewed by Eric Carlson.
1337
1338         Covered by updated test.
1339
1340         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
1341         (WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):
1342
1343 2018-10-30  Claudio Saavedra  <csaavedra@igalia.com>
1344
1345         [GTK][WPE] Fixes to the PublicSuffix implementation
1346         https://bugs.webkit.org/show_bug.cgi?id=191031
1347
1348         Reviewed by Michael Catanzaro.
1349
1350         Covered by existing tests.
1351
1352         Downcase hostnames before passing it on to the underlying
1353         libsoup API. Special case localhost and fix a mixed-up
1354         libsoup GError checks. This fixes most of the failures.
1355
1356         * platform/soup/PublicSuffixSoup.cpp:
1357         (WebCore::isPublicSuffix):
1358         (WebCore::topPrivatelyControlledDomain):
1359
1360 2018-10-29  Zalan Bujtas  <zalan@apple.com>
1361
1362         Missing from r237549
1363
1364         * layout/blockformatting/BlockFormattingContext.cpp:
1365         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
1366         (WebCore::Layout::hasPrecomputedMarginTop):
1367
1368 2018-10-29  Ross Kirsling  <ross.kirsling@sony.com>
1369
1370         Unreviewed speculative build fix for AppleWin after r237559.
1371
1372         * PlatformAppleWin.cmake:
1373
1374 2018-10-29  Justin Michaud  <justin_michaud@apple.com>
1375
1376         Revert r237347 registered custom properties... https://bugs.webkit.org/show_bug.cgi?id=190039
1377         https://bugs.webkit.org/show_bug.cgi?id=190919
1378
1379         Reviewed by Michael Saboff.
1380
1381         * css/CSSComputedStyleDeclaration.cpp:
1382         (WebCore::ComputedStyleExtractor::customPropertyValue):
1383         * css/CSSCustomPropertyValue.cpp:
1384         (WebCore::CSSCustomPropertyValue::customCSSText const):
1385         (WebCore::CSSCustomPropertyValue::tokens const):
1386         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
1387         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
1388         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
1389         (WebCore::CSSCustomPropertyValue::equals const): Deleted.
1390         * css/CSSCustomPropertyValue.h:
1391         * css/CSSRegisteredCustomProperty.cpp:
1392         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
1393         * css/CSSRegisteredCustomProperty.h:
1394         * css/CSSVariableData.cpp:
1395         (WebCore::CSSVariableData::consumeAndUpdateTokens):
1396         (WebCore::CSSVariableData::CSSVariableData):
1397         (WebCore::CSSVariableData::checkVariablesForCycles const):
1398         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
1399         (WebCore::CSSVariableData::resolveVariableFallback const):
1400         (WebCore::CSSVariableData::resolveVariableReference const):
1401         (WebCore::CSSVariableData::resolveVariableReferences const):
1402         (WebCore::CSSVariableData::resolveTokenRange const):
1403         * css/CSSVariableData.h:
1404         (WebCore::CSSVariableData::create):
1405         (WebCore::CSSVariableData::createResolved):
1406         (WebCore::CSSVariableData::needsVariableResolution const):
1407         (WebCore::CSSVariableData::CSSVariableData):
1408         * css/CSSVariableReferenceValue.cpp:
1409         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
1410         (WebCore::resolveVariableFallback): Deleted.
1411         (WebCore::resolveVariableReference): Deleted.
1412         (WebCore::resolveTokenRange): Deleted.
1413         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const): Deleted.
1414         * css/CSSVariableReferenceValue.h:
1415         (WebCore::CSSVariableReferenceValue::create):
1416         (WebCore::CSSVariableReferenceValue::variableDataValue const):
1417         (WebCore::CSSVariableReferenceValue::equals const):
1418         * css/DOMCSSRegisterCustomProperty.cpp:
1419         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
1420         * css/PropertySetCSSStyleDeclaration.cpp:
1421         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
1422         * css/StyleBuilderCustom.h:
1423         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
1424         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
1425         * css/StyleProperties.cpp:
1426         (WebCore::MutableStyleProperties::setCustomProperty):
1427         * css/StyleProperties.h:
1428         * css/StyleResolver.cpp:
1429         (WebCore::StyleResolver::State::setStyle):
1430         (WebCore::StyleResolver::styleForKeyframe):
1431         (WebCore::StyleResolver::styleForPage):
1432         (WebCore::StyleResolver::applyMatchedProperties):
1433         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
1434         (WebCore::StyleResolver::applyProperty):
1435         (WebCore::StyleResolver::resolvedVariableValue const):
1436         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
1437         (WebCore::StyleResolver::CascadedProperties::Property::apply):
1438         (WebCore::StyleResolver::applyCascadedProperties):
1439         (WebCore::StyleResolver::applyCascadedCustomProperty): Deleted.
1440         * css/StyleResolver.h:
1441         * css/parser/CSSParser.cpp:
1442         (WebCore::CSSParser::parseValueWithVariableReferences):
1443         * css/parser/CSSParser.h:
1444         * css/parser/CSSPropertyParser.cpp:
1445         (WebCore::CSSPropertyParser::CSSPropertyParser):
1446         (WebCore::CSSPropertyParser::parseValueStart):
1447         (WebCore::CSSPropertyParser::parseSingleValue):
1448         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue): Deleted.
1449         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): Deleted.
1450         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies): Deleted.
1451         * css/parser/CSSPropertyParser.h:
1452         * css/parser/CSSVariableParser.cpp:
1453         (WebCore::CSSVariableParser::parseDeclarationValue):
1454         * dom/ConstantPropertyMap.cpp:
1455         (WebCore::ConstantPropertyMap::setValueForProperty):
1456         (WebCore::variableDataForPositivePixelLength):
1457         (WebCore::variableDataForPositiveDuration):
1458         * rendering/style/RenderStyle.cpp:
1459         (WebCore::RenderStyle::checkVariablesInCustomProperties):
1460         * rendering/style/RenderStyle.h:
1461         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
1462         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
1463         * rendering/style/StyleCustomPropertyData.h:
1464         (WebCore::StyleCustomPropertyData::operator== const):
1465         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
1466         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
1467
1468 2018-10-29  Youenn Fablet  <youenn@apple.com>
1469
1470         Handle MDNS resolution of candidates through libwebrtc directly
1471         https://bugs.webkit.org/show_bug.cgi?id=190681
1472
1473         Reviewed by Eric Carlson.
1474
1475         Remove the previous MDNS resolution mechanism.
1476         Instead, add support for the AsyncResolver mechanism added to libwebrtc.
1477         Covered by current mdns webrtc test that is unflaked.
1478
1479         * Modules/mediastream/PeerConnectionBackend.cpp:
1480         (WebCore::PeerConnectionBackend::addIceCandidate):
1481         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1482         (WebCore::LibWebRTCProvider::createPeerConnection):
1483         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1484         * testing/MockLibWebRTCPeerConnection.cpp:
1485         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
1486         * testing/MockLibWebRTCPeerConnection.h:
1487
1488 2018-10-29  Devin Rousso  <drousso@apple.com>
1489
1490         Web Inspector: increase size limits for NetworkResourceData
1491         https://bugs.webkit.org/show_bug.cgi?id=191034
1492         <rdar://problem/45529852>
1493
1494         Reviewed by Joseph Pecoraro.
1495
1496         No tests since no new functionality.
1497
1498         * inspector/NetworkResourcesData.cpp:
1499         All resources: 100MB => 200MB
1500         Each resource:  10MB =>  50MB
1501
1502 2018-10-29  Tim Horton  <timothy_horton@apple.com>
1503
1504         Modernize WebKit nibs and lprojs for localization's sake
1505         https://bugs.webkit.org/show_bug.cgi?id=190911
1506         <rdar://problem/45349466>
1507
1508         Reviewed by Dan Bernstein.
1509
1510         * PlatformGTK.cmake:
1511         * PlatformWPE.cmake:
1512         * PlatformWin.cmake:
1513         * WebCore.xcodeproj/project.pbxproj:
1514         * en.lproj/Localizable.strings: Renamed from Source/WebCore/English.lproj/Localizable.strings.
1515         * en.lproj/Localizable.stringsdict: Renamed from Source/WebCore/English.lproj/Localizable.stringsdict.
1516         * en.lproj/mediaControlsLocalizedStrings.js: Renamed from Source/WebCore/English.lproj/mediaControlsLocalizedStrings.js.
1517         * en.lproj/modern-media-controls-localized-strings.js: Renamed from Source/WebCore/English.lproj/modern-media-controls-localized-strings.js.
1518         English->en
1519
1520 2018-10-29  Tim Horton  <timothy_horton@apple.com>
1521
1522         Make FindOptionsShowOverlay work on iOS
1523         https://bugs.webkit.org/show_bug.cgi?id=190551
1524
1525         Reviewed by Andy Estes.
1526
1527         * platform/graphics/GraphicsContext.h:
1528         Export some more GraphicsContext methods.
1529
1530 2018-10-29  Youenn Fablet  <youenn@apple.com>
1531
1532         Invalid ssrc value in the stats of type 'inbound-rtp'
1533         https://bugs.webkit.org/show_bug.cgi?id=190826
1534         <rdar://problem/45487435>
1535
1536         Reviewed by Eric Carlson.
1537
1538         Value was not initialized in WebCore if missing from libwebrtc.
1539         Change value to an optional so that it will not appear if libwebrtc does not expose it.
1540         Move integer/boolean values from being initialized to be optional so
1541         that we do not expose them to JS if not exposed by libwebrtc.
1542
1543         Covered by updated tests.
1544
1545         * Modules/mediastream/RTCStatsReport.h:
1546
1547 2018-10-29  Jer Noble  <jer.noble@apple.com>
1548
1549         CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough
1550         https://bugs.webkit.org/show_bug.cgi?id=190954
1551
1552         Reviewed by Simon Fraser.
1553
1554         Crash analyitics show that WebProcess will crash in ERROR_CGDataProvider_BufferIsNotBigEnough,
1555         which attempts to fetch the last byte in the image buffer in order to verify that the entire
1556         buffer is readable. Unfortunately, the stack trace generated by this crash does not identify
1557         what CGDataProvider is responsible for the not-big-enough buffer. In order to identify which
1558         CGDataProvider created by WebKit is responsible (if any), we will add our own version of
1559         ERROR_CGDataProvider_BufferIsNotBigEnough, called at CGDataProvider creation time, which should
1560         generate a crash within the responsible stack frame.
1561
1562         (This assumes that the issue is the wrong sized buffer at CGDataProvider creation time, and not
1563         that the buffer itself is reclaimed between creation time and access.)
1564
1565         * WebCore.xcodeproj/project.pbxproj:
1566         * platform/graphics/cg/GraphicsContext3DCG.cpp:
1567         (WebCore::GraphicsContext3D::paintToCanvas):
1568         * platform/graphics/cg/ImageBufferCG.cpp:
1569         (WebCore::ImageBuffer::ImageBuffer):
1570         (WebCore::ImageBuffer::toCFData const):
1571         (WebCore::cfData):
1572         * platform/graphics/cocoa/WebGLLayer.mm:
1573         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
1574         * platform/graphics/cv/PixelBufferConformerCV.cpp:
1575         (WebCore::CVPixelBufferGetBytePointerCallback):
1576         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
1577         * platform/graphics/cg/ImageUtilitiesCG.h: Added.
1578         (WebCore::verifyImageBufferIsBigEnough):
1579
1580 2018-10-29  David Kilzer  <ddkilzer@apple.com>
1581
1582         Fix clang static analyzer warning in StyleBuilderConverter.h
1583         <https://webkit.org/b/190907>
1584
1585         Reviewed by Antti Koivisto.
1586
1587         Fix the following clang static warning in StyleBuilderConverter.h:
1588             Value stored to 'autoFlow' during its initialization is never read
1589
1590         * css/StyleBuilderConverter.h:
1591         (WebCore::StyleBuilderConverter::convertGridAutoFlow): Move
1592         assignment of RenderStyle::initialGridAutoFlow() to `default`
1593         case.  Make `CSSValueDense` consistent with other cases by
1594         assigning value to `autoFlow` instead of returning early.
1595
1596 2018-10-29  Youenn Fablet  <youenn@apple.com>
1597
1598         Guard H264 simulcast with a runtime flag
1599         https://bugs.webkit.org/show_bug.cgi?id=191025
1600
1601         Reviewed by Eric Carlson.
1602
1603         Add a runtime flag for H264 simulcast and enable libwebrtc field trial based on it.
1604         Covered by existing test.
1605
1606         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1607         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
1608         * page/RuntimeEnabledFeatures.h:
1609         (WebCore::RuntimeEnabledFeatures::webRTCH264SimulcastEnabled const):
1610         (WebCore::RuntimeEnabledFeatures::setWebRTCH264SimulcastEnabled):
1611
1612 2018-10-29  Zalan Bujtas  <zalan@apple.com>
1613
1614         [LFC][IFC] Compute estimated margin top for inline formatting root's ancestors
1615         https://bugs.webkit.org/show_bug.cgi?id=191018
1616
1617         Reviewed by Antti Koivisto.
1618
1619         <div><img style="float: left"></div>
1620         This inline formatting context (root -> div) inherits the floating context from the parent block formatting context.
1621         Floats are added to the floating context relative to the floating context's root. In order to position this float properly we
1622         need to precompute the ancestor's margin top (stop at the block formatting root boundary).
1623
1624         Test: fast/inline/simple-intruding-floats3.html
1625
1626         * layout/blockformatting/BlockFormattingContext.cpp:
1627         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
1628
1629 2018-10-29  Zalan Bujtas  <zalan@apple.com>
1630
1631         [LFC] Add support for inflow non replaced content height when the box is an inline formatting root.
1632         https://bugs.webkit.org/show_bug.cgi?id=191011
1633
1634         Reviewed by Antti Koivisto.
1635
1636         // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
1637         // Height is the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines
1638
1639         This is temporary until after inline runs transition to the display tree.
1640
1641         Test: fast/inline/simple-intruding-floats2.html
1642
1643         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1644         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1645         * layout/inlineformatting/InlineRun.h:
1646         (WebCore::Layout::InlineRun::logicalLeft const):
1647         (WebCore::Layout::InlineRun::logicalRight const):
1648         (WebCore::Layout::InlineRun::logicalTop const):
1649         (WebCore::Layout::InlineRun::logicalBottom const):
1650         (WebCore::Layout::InlineRun::width const):
1651         (WebCore::Layout::InlineRun::height const):
1652         (WebCore::Layout::InlineRun::setWidth):
1653         (WebCore::Layout::InlineRun::setLogicalLeft):
1654         (WebCore::Layout::InlineRun::setLogicalRight):
1655         (WebCore::Layout::InlineRun::moveHorizontally):
1656         (WebCore::Layout::InlineRun::InlineRun):
1657         * layout/inlineformatting/Line.cpp:
1658         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
1659
1660 2018-10-29  Zalan Bujtas  <zalan@apple.com>
1661
1662         [LFC][IFC] Add support for simple intruding floats.
1663         https://bugs.webkit.org/show_bug.cgi?id=190998
1664
1665         Reviewed by Antti Koivisto.
1666
1667         In order to be able to figure out whether a float is intruding on a line, we need to provide the line's final vertical position.
1668         This vertical position must be in the same coordinate system as the float's position is. In case of intruding float,
1669         it is the parent block formatting root's coordinate system (that's where the float lives.)
1670
1671         Test: fast/inline/simple-intruding-float1.html
1672
1673         * layout/blockformatting/BlockFormattingContext.cpp:
1674         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1675         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
1676         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
1677         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1678         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1679         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1680         * layout/blockformatting/BlockFormattingContext.h:
1681         * layout/floats/FloatingState.cpp:
1682         (WebCore::Layout::FloatingState::constraints const):
1683
1684 2018-10-29  Zalan Bujtas  <zalan@apple.com>
1685
1686         [LFC][IFC] Inline layout produces separate runs when float is present.
1687         https://bugs.webkit.org/show_bug.cgi?id=190980
1688
1689         Reviewed by Antti Koivisto.
1690
1691         <div>foo<img src="foobar.jpg" style="float: left">bar</div> produces 2 inline boxes (foo) and (bar) -> current inline code
1692         while it is really just one continuous run (foobar) -> LFC
1693         Adjust verification code to check for such runs.
1694
1695         * layout/Verification.cpp:
1696         (WebCore::Layout::checkForMatchingNonTextRuns):
1697         (WebCore::Layout::checkForMatchingTextRuns):
1698         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
1699         * layout/inlineformatting/InlineRun.h:
1700         (WebCore::Layout::InlineRun::textContext const):
1701
1702 2018-10-29  Youenn Fablet  <youenn@apple.com>
1703
1704         [WebRTC] Enable VP8 by default
1705         https://bugs.webkit.org/show_bug.cgi?id=190672
1706         <rdar://problem/43663785>
1707
1708         Reviewed by Eric Carlson.
1709
1710         No change of behavior.
1711
1712         * page/RuntimeEnabledFeatures.h: Set default value to true.
1713
1714 2018-10-28  Andy Estes  <aestes@apple.com>
1715
1716         [Payment Request] Implement MerchantValidationEvent.methodName
1717         https://bugs.webkit.org/show_bug.cgi?id=190058
1718
1719         Reviewed by Darin Adler.
1720
1721         Implemented MerchantValidationEvent's methodName attribute and MerchantValidationEventInit's
1722         methodName property as specified in the Payment Request API W3C Editor's Draft of
1723         27 September 2018.
1724
1725         Covered by web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html.
1726
1727         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1728         (WebCore::ApplePayPaymentHandler::validateMerchant): Passed the payment method identifier
1729         (as a string) to MerchantValidationEvent::create()
1730         * Modules/paymentrequest/MerchantValidationEvent.cpp:
1731         (WebCore::MerchantValidationEvent::create): Validated the methodName before constructing the
1732         event, throwing a RangeError on failure.
1733         (WebCore::MerchantValidationEvent::MerchantValidationEvent):
1734         * Modules/paymentrequest/MerchantValidationEvent.h:
1735         * Modules/paymentrequest/MerchantValidationEvent.idl:
1736
1737 2018-10-27  Antoine Quint  <graouts@apple.com>
1738
1739         [Web Animations] Remove WebAnimation::description()
1740         https://bugs.webkit.org/show_bug.cgi?id=190995
1741
1742         Reviewed by Dean Jackson.
1743
1744         This method is never used.
1745
1746         * animation/WebAnimation.cpp:
1747         (WebCore::WebAnimation::description): Deleted.
1748         * animation/WebAnimation.h:
1749
1750 2018-10-27  Antoine Quint  <graouts@apple.com>
1751
1752         [Web Animations] Move the logic of Document::getAnimations() to DocumentTimeline
1753         https://bugs.webkit.org/show_bug.cgi?id=190994
1754
1755         Reviewed by Dean Jackson.
1756
1757         It would be cleaner to have the logic of document.getAnimations() on the DocumentTimeline instead of the Document, keep more
1758         animation-related code compartmentalized in the animation directory. No change in behavior, so no test update.
1759
1760         * animation/DocumentTimeline.cpp:
1761         (WebCore::DocumentTimeline::getAnimations const):
1762         * animation/DocumentTimeline.h:
1763         * dom/Document.cpp:
1764         (WebCore::Document::getAnimations):
1765
1766 2018-10-27  Antoine Quint  <graouts@apple.com>
1767
1768         [Web Animations] Move bindings methods requiring style flush from CSSAnimation to DeclarativeAnimation
1769         https://bugs.webkit.org/show_bug.cgi?id=190996
1770
1771         Reviewed by Dean Jackson.
1772
1773         Moving all of the IDL bindings methods that require flushing style from CSSAnimation to its superclass
1774         DeclarativeAnimation so we follow the same route in CSSTransition. Note that there was code in
1775         CSSAnimation::bindingsCurrentTime() that was not moved as it proved to not be necessary.
1776
1777         * animation/CSSAnimation.cpp:
1778         (WebCore::CSSAnimation::bindingsPlay):
1779         (WebCore::CSSAnimation::bindingsPause):
1780         (WebCore::CSSAnimation::bindingsStartTime const): Deleted.
1781         (WebCore::CSSAnimation::setBindingsStartTime): Deleted.
1782         (WebCore::CSSAnimation::bindingsCurrentTime const): Deleted.
1783         (WebCore::CSSAnimation::setBindingsCurrentTime): Deleted.
1784         (WebCore::CSSAnimation::bindingsPlayState const): Deleted.
1785         (WebCore::CSSAnimation::bindingsPending const): Deleted.
1786         (WebCore::CSSAnimation::bindingsReady): Deleted.
1787         (WebCore::CSSAnimation::bindingsFinished): Deleted.
1788         (WebCore::CSSAnimation::flushPendingStyleChanges const): Deleted.
1789         * animation/CSSAnimation.h:
1790         * animation/DeclarativeAnimation.cpp:
1791         (WebCore::DeclarativeAnimation::bindingsStartTime const):
1792         (WebCore::DeclarativeAnimation::setBindingsStartTime):
1793         (WebCore::DeclarativeAnimation::bindingsCurrentTime const):
1794         (WebCore::DeclarativeAnimation::setBindingsCurrentTime):
1795         (WebCore::DeclarativeAnimation::bindingsPlayState const):
1796         (WebCore::DeclarativeAnimation::bindingsPending const):
1797         (WebCore::DeclarativeAnimation::bindingsReady):
1798         (WebCore::DeclarativeAnimation::bindingsFinished):
1799         (WebCore::DeclarativeAnimation::bindingsPlay):
1800         (WebCore::DeclarativeAnimation::bindingsPause):
1801         (WebCore::DeclarativeAnimation::flushPendingStyleChanges const):
1802         * animation/DeclarativeAnimation.h:
1803
1804 2018-10-27  Charlie Turner  <cturner@igalia.com>
1805
1806         [EME] Add a logging macro
1807         https://bugs.webkit.org/show_bug.cgi?id=190984
1808
1809         Reviewed by Xabier Rodriguez-Calvar.
1810
1811         No tests since no new functionality.
1812
1813         * Modules/encryptedmedia/MediaKeySession.cpp:
1814         (WebCore::MediaKeySession::MediaKeySession):
1815         (WebCore::MediaKeySession::generateRequest):
1816         (WebCore::MediaKeySession::update):
1817         (WebCore::MediaKeySession::close):
1818         (WebCore::MediaKeySession::remove):
1819         (WebCore::MediaKeySession::sessionClosed):
1820         * Modules/encryptedmedia/MediaKeys.cpp:
1821         (WebCore::MediaKeys::createSession):
1822         * Modules/encryptedmedia/NavigatorEME.cpp:
1823         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
1824         * platform/Logging.h:
1825
1826 2018-10-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1827
1828         [GStreamer][EME] Post key received to bus should be done before waking up other threads
1829         https://bugs.webkit.org/show_bug.cgi?id=190822
1830
1831         Reviewed by Philippe Normand.
1832
1833         Notify after posting message to bus.
1834
1835         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1836         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
1837
1838 2018-10-27  Charlie Turner  <cturner@igalia.com>
1839
1840         Fix release build with -DLOG_DISABLED=0
1841         https://bugs.webkit.org/show_bug.cgi?id=190866
1842
1843         Reviewed by Xabier Rodriguez-Calvar.
1844
1845         No new tests since no functionality changed.
1846
1847         * platform/graphics/Font.cpp:
1848         * platform/graphics/Font.h:
1849         * platform/graphics/FontPlatformData.h:
1850         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1851         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1852         * platform/graphics/win/FontPlatformDataWin.cpp:
1853
1854 2018-10-26  Commit Queue  <commit-queue@webkit.org>
1855
1856         Unreviewed, rolling out r237458.
1857         https://bugs.webkit.org/show_bug.cgi?id=190973
1858
1859         broke internal iOS builds (Requested by zalan on #webkit).
1860
1861         Reverted changeset:
1862
1863         "Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI"
1864         https://bugs.webkit.org/show_bug.cgi?id=190951
1865         https://trac.webkit.org/changeset/237458
1866
1867 2018-10-26  Antoine Quint  <graouts@apple.com>
1868
1869         [Web Animations] Remove useless internals methods
1870         https://bugs.webkit.org/show_bug.cgi?id=190968
1871
1872         Reviewed by Dean Jackson.
1873
1874         We had a few internals methods added early on in the Web Animations implementation that are no longer
1875         relevant now that the full API is implemented. We can safely remove them now.
1876
1877         * animation/AnimationTimeline.cpp:
1878         (WebCore::AnimationTimeline::setCurrentTime): Deleted.
1879         (WebCore::AnimationTimeline::description): Deleted.
1880         * animation/AnimationTimeline.h:
1881         (WebCore::AnimationTimeline::currentTime):
1882         (WebCore::AnimationTimeline::pause): Deleted.
1883         * animation/DocumentTimeline.cpp:
1884         (WebCore::DocumentTimeline::currentTime):
1885         (WebCore::DocumentTimeline::pause): Deleted.
1886         * animation/DocumentTimeline.h:
1887         * testing/Internals.cpp:
1888         (WebCore::Internals::timelineDescription): Deleted.
1889         (WebCore::Internals::pauseTimeline): Deleted.
1890         (WebCore::Internals::setTimelineCurrentTime): Deleted.
1891         * testing/Internals.h:
1892         * testing/Internals.idl:
1893
1894 2018-10-26  Antoine Quint  <graouts@apple.com>
1895
1896         Web Inspector: Crash in http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html
1897         https://bugs.webkit.org/show_bug.cgi?id=190955
1898
1899         Reviewed by Dean Jackson.
1900
1901         We can get in situations when running tests where runtime flags are not consistent throughout the time a test is run since
1902         showing the Web Inspector can cause flags to be re-set after the initial test was loaded. As such, to avoid crashes due to
1903         the ASSERT(!frame().animation().hasAnimations()) in FrameView::didDestroyRenderTree(), we now cancel animations upon teardown
1904         no matter what the value of the runtime flag for the Web Animations CSS Integration on both the DocumentTimeline (if it exists)
1905         and the CSSAnimationController.
1906
1907         * dom/Element.cpp:
1908         (WebCore::Element::removedFromAncestor):
1909         * dom/PseudoElement.cpp:
1910         (WebCore::PseudoElement::clearHostElement):
1911         * page/FrameView.cpp:
1912         (WebCore::FrameView::didDestroyRenderTree):
1913         * rendering/updating/RenderTreeUpdater.cpp:
1914         (WebCore::RenderTreeUpdater::tearDownRenderers):
1915
1916 2018-10-26  Timothy Hatcher  <timothy@apple.com>
1917
1918         Use dark appearance scrollbar when page background is dark or document supports dark mode.
1919         https://bugs.webkit.org/show_bug.cgi?id=190937
1920         rdar://problem/41225839
1921
1922         Reviewed by Beth Dakin.
1923
1924         * page/FrameView.cpp:
1925         (WebCore::FrameView::useDarkAppearance const): Added. Ask the document.
1926         (WebCore::FrameView::paintScrollCorner): Set LocalDefaultSystemAppearance based
1927         on the scrollbar overlay style too.
1928         * page/FrameView.h:
1929         * platform/ScrollableArea.h:
1930         (WebCore::ScrollableArea::useDarkAppearance const): Added. Default to false.
1931         * platform/mac/ScrollAnimatorMac.mm:
1932         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Added.
1933         Ask the ScrollableArea if a dark appearance is desired.
1934
1935 2018-10-26  Antti Koivisto  <antti@apple.com>
1936
1937         Use random() instead of begin() to limit cache sizes
1938         https://bugs.webkit.org/show_bug.cgi?id=190957
1939
1940         Reviewed by Chris Dumez.
1941
1942         We currently use cache.remove(cache.begin()) pattern to limit sized of various caches.
1943         This is a bad pattern for tables that never rehash (because they have fixed maximum size) as most of the
1944         keys get permanently stuck in the table.
1945
1946         * css/CSSValuePool.cpp:
1947         (WebCore::CSSValuePool::createColorValue):
1948         (WebCore::CSSValuePool::createFontFamilyValue):
1949         (WebCore::CSSValuePool::createFontFaceValue):
1950         * dom/InlineStyleSheetOwner.cpp:
1951         (WebCore::InlineStyleSheetOwner::createSheet):
1952         * dom/SelectorQuery.cpp:
1953         * platform/graphics/FontCascade.cpp:
1954         (WebCore::retrieveOrAddCachedFonts):
1955         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1956         (WebCore::shouldAutoActivateFontIfNeeded):
1957         * platform/mac/PublicSuffixMac.mm:
1958         (WebCore::topPrivatelyControlledDomain):
1959
1960 2018-10-26  Jer Noble  <jer.noble@apple.com>
1961
1962         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
1963         https://bugs.webkit.org/show_bug.cgi?id=190951
1964         <rdar://problem/45213065>
1965
1966         Reviewed by Alex Christensen.
1967
1968         Request the correct route policy and context from the VideoFullscreenModel.
1969
1970         * platform/cocoa/VideoFullscreenModel.h:
1971         (WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID):
1972         * platform/cocoa/VideoFullscreenModelVideoElement.h:
1973         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
1974         (WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID):
1975         * platform/ios/VideoFullscreenInterfaceAVKit.h:
1976         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1977         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
1978         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
1979         (VideoFullscreenInterfaceAVKit::doSetup):
1980
1981 2018-10-26  Zalan Bujtas  <zalan@apple.com>
1982
1983         [LFC][IFC] Add more inline information to outputLayoutTree
1984         https://bugs.webkit.org/show_bug.cgi?id=190945
1985
1986         Reviewed by Antti Koivisto.
1987
1988         * layout/layouttree/LayoutTreeBuilder.cpp:
1989         (WebCore::Layout::outputInlineRuns):
1990         (WebCore::Layout::outputLayoutBox):
1991
1992 2018-10-26  Zalan Bujtas  <zalan@apple.com>
1993
1994         [LFC][IFC] Layout floats as part of the inline content
1995         https://bugs.webkit.org/show_bug.cgi?id=190942
1996
1997         Reviewed by Antti Koivisto.
1998
1999         Add float handling to InlineFormattingContext::layoutInlineContent.
2000         Note that floats don't actually generate inline runs.
2001
2002         Test: fast/block/basic/inline-content-with-floating-image.html
2003
2004         * layout/blockformatting/BlockFormattingContext.cpp:
2005         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2006         * layout/floats/FloatAvoider.cpp:
2007         (WebCore::Layout::FloatAvoider::FloatAvoider): Check if any mapping is needed.
2008         * layout/inlineformatting/InlineFormattingContext.cpp:
2009         (WebCore::Layout::isTrimmableContent):
2010         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2011         (WebCore::Layout::trimLeadingRun): Deleted.
2012         * layout/inlineformatting/InlineFormattingContext.h:
2013         (WebCore::Layout::InlineFormattingContext::Line::isClosed const):
2014         * layout/inlineformatting/Line.cpp:
2015         (WebCore::Layout::InlineFormattingContext::Line::init):
2016         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
2017         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
2018         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
2019         (WebCore::Layout::InlineFormattingContext::Line::close):
2020
2021 2018-10-26  Zalan Bujtas  <zalan@apple.com>
2022
2023         [LFC][IFC] Adjust current line with float constraints.
2024         https://bugs.webkit.org/show_bug.cgi?id=190940
2025
2026         Reviewed by Antti Koivisto.
2027
2028         * layout/inlineformatting/InlineFormattingContext.cpp:
2029         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
2030         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2031         * layout/inlineformatting/InlineFormattingContext.h:
2032         * layout/inlineformatting/InlineRun.h:
2033         (WebCore::Layout::InlineRun::moveHorizontally):
2034         * layout/inlineformatting/Line.cpp:
2035         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
2036         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
2037
2038 2018-10-26  Zalan Bujtas  <zalan@apple.com>
2039
2040         [LFC][IFC] Compute float box size and position
2041         https://bugs.webkit.org/show_bug.cgi?id=190938
2042
2043         Reviewed by Antti Koivisto.
2044
2045         * layout/inlineformatting/InlineFormattingContext.cpp:
2046         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const):
2047         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
2048         * layout/inlineformatting/InlineFormattingContext.h:
2049
2050 2018-10-26  Zalan Bujtas  <zalan@apple.com>
2051
2052         [LFC][IFC] Add line logical top and bottom
2053         https://bugs.webkit.org/show_bug.cgi?id=190934
2054
2055         Reviewed by Antti Koivisto.
2056
2057         * layout/inlineformatting/InlineFormattingContext.cpp:
2058         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
2059         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2060         * layout/inlineformatting/InlineFormattingContext.h:
2061         (WebCore::Layout::InlineFormattingContext::Line::isFirstLine const):
2062         (WebCore::Layout::InlineFormattingContext::Line::logicalTop const):
2063         (WebCore::Layout::InlineFormattingContext::Line::logicalBottom const):
2064         * layout/inlineformatting/Line.cpp:
2065         (WebCore::Layout::InlineFormattingContext::Line::init):
2066         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight):
2067         (WebCore::Layout::InlineFormattingContext::Line::close):
2068
2069 2018-10-26  Zalan Bujtas  <zalan@apple.com>
2070
2071         [LFC][IFC] Find floating constraints for a given vertical position
2072         https://bugs.webkit.org/show_bug.cgi?id=190928
2073
2074         Reviewed by Antti Koivisto.
2075
2076         https://www.w3.org/TR/CSS22/visuren.html#inline-formatting
2077
2078         "In general, the left edge of a line box touches the left edge of its containing block and the right edge touches the right edge of its containing block.
2079         However, floating boxes may come between the containing block edge and the line box edge.
2080         Thus, although line boxes in the same inline formatting context generally have the same width
2081         (that of the containing block), they may vary in width if available horizontal space is reduced due to floats."
2082
2083         This patch adds support for retrieving left/right constraints for a given line (vertical position).
2084
2085         * layout/floats/FloatingState.cpp:
2086         (WebCore::Layout::FloatingState::constraints const):
2087         * layout/floats/FloatingState.h:
2088
2089 2018-10-26  Zalan Bujtas  <zalan@apple.com>
2090
2091         [LFC] Inline formatting context has higher priority than block
2092         https://bugs.webkit.org/show_bug.cgi?id=190924
2093
2094         Reviewed by Antti Koivisto.
2095
2096         When an element establishes both inline and block formatting contexts, we need to pick one to
2097         create (and we choose the content driven formatting type (inline)). See example below:
2098
2099         <div style="overflow: hidden">This text should be inside an inlines formatting context.</div>
2100
2101         * layout/LayoutContext.cpp:
2102         (WebCore::Layout::LayoutContext::formattingContext const):
2103
2104 2018-10-26  Ali Juma  <ajuma@chromium.org>
2105
2106         REGRESSION (r237255): Text selection is broken in form fields
2107         https://bugs.webkit.org/show_bug.cgi?id=190899
2108
2109         Reviewed by Ryosuke Niwa.
2110
2111         Fix missing negation when checking for a fully-clipped-out rect. This was causing
2112         RenderObject::computeVisibleRectInContainer to incorrectly early-out.
2113
2114         Test: fast/repaint/text-selection-overflow-hidden.html
2115
2116         * rendering/RenderObject.cpp:
2117         (WebCore::RenderObject::computeVisibleRectInContainer const):
2118
2119 2018-10-25  Chris Dumez  <cdumez@apple.com>
2120
2121         [PSON] Navigating cross-site with locked history but unlocked back/forward list fails to create a new BackForwardListItem
2122         https://bugs.webkit.org/show_bug.cgi?id=190915
2123         <rdar://problem/45059069>
2124
2125         Reviewed by Geoffrey Garen.
2126
2127         * history/PageCache.cpp:
2128         (WebCore::canCacheFrame):
2129         Make sure we do not put into PageCache a page whose main frame is showing the initial empty document.
2130         We usually do not try to put those into PageCache because we do not have a HistoryItem to save the
2131         PageCache entry on. However, when we process-swap on a navigation with the history locked, the new
2132         process has a HistoryItem and is initially showing the initial empty document before continuing
2133         the load from the previous process. Note that saving the initial empty document in PageCache would
2134         lead to crashes later on previous the initial empty document's Window is taken and reused for the
2135         next load.
2136
2137         * loader/FrameLoader.cpp:
2138         (WebCore::FrameLoader::load):
2139         Stop assuming that we're continuing a client-side redirect when lockHistory is Yes. It is
2140         lockBackForwardList that is actually Yes when we're doing a client-side redirect.
2141
2142         * loader/PolicyChecker.cpp:
2143         (WebCore::PolicyChecker::checkNavigationPolicy):
2144         Stop using calling the completion handler with an invalid URL when the policy decision is 'Suspend' and
2145         use 'about:blank' instead. Without this change, FrameLoader::continueLoadAfterNavigationPolicy() would
2146         not load 'about:blank' when its AllowNavigationToInvalidURL parameter is No.
2147
2148 2018-10-25  Devin Rousso  <drousso@apple.com>
2149
2150         Fix build after r237431 for platforms that don't support FULLSCREEN_API
2151
2152         Reviewed by Joseph Pecoraro.
2153
2154         No new tests. No change in behavior.
2155
2156         * inspector/agents/InspectorDOMAgent.cpp:
2157         (WebCore::InspectorDOMAgent::addEventListenersToNode):
2158
2159 2018-10-25  Devin Rousso  <drousso@apple.com>
2160
2161         Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls
2162         https://bugs.webkit.org/show_bug.cgi?id=189874
2163         <rdar://problem/44700000>
2164
2165         Reviewed by Joseph Pecoraro.
2166
2167         Updated existing test: http/tests/inspector/dom/didFireEvent.html
2168
2169         * inspector/agents/InspectorDOMAgent.h:
2170         * inspector/agents/InspectorDOMAgent.cpp:
2171         (WebCore::EventFiredCallback::handleEvent):
2172         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
2173         (WebCore::InspectorDOMAgent::addEventListenersToNode):
2174         (WebCore::InspectorDOMAgent::discardBindings):
2175         (WebCore::InspectorDOMAgent::eventDidResetAfterDispatch): Added.
2176         Prevent the same event from being sent to the frontend more than once.
2177
2178         * dom/Event.cpp:
2179         (WebCore::Event::resetAfterDispatch):
2180
2181         * dom/Document.cpp:
2182         (WebCore::Document::Document):
2183
2184         * inspector/InspectorInstrumentation.h:
2185         (WebCore::InspectorInstrumentation::eventDidResetAfterDispatch): Added.
2186         * inspector/InspectorInstrumentation.cpp:
2187         (WebCore::InspectorInstrumentation::eventDidResetAfterDispatchImpl): Added.
2188
2189 2018-10-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2190
2191         Unreviewed, silence a -Wreturn-type warning
2192
2193         When every return is supposed to be covered by a switch statement, a release assert or CRASH
2194         is required by GCC.
2195
2196         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
2197         (WebCore::LibWebRTCCertificateGenerator::keyParamsFromCertificateType):
2198
2199 2018-10-25  Antoine Quint  <graouts@apple.com>
2200
2201         [Web Animations] Turn Web Animations CSS Integration off by default
2202         https://bugs.webkit.org/show_bug.cgi?id=190901
2203
2204         Reviewed by Dean Jackson.
2205
2206         * page/RuntimeEnabledFeatures.h:
2207
2208 2018-10-25  Jon Davis  <jond@apple.com>
2209
2210         Changed "Under Development" status to use "In Development" instead
2211         https://bugs.webkit.org/show_bug.cgi?id=187615
2212
2213         Reviewed by Joseph Pecoraro.
2214
2215         * features.json: Updated CSS Painting API Level 1 and CSS Properties and Values API Level 1.
2216
2217 2018-10-25  Chris Dumez  <cdumez@apple.com>
2218
2219         REGRESSION (236779) scandinaviandesigns.com product pages auto redirect to product image
2220         https://bugs.webkit.org/show_bug.cgi?id=190891
2221         <rdar://problem/45296796>
2222
2223         Reviewed by Antti Koivisto.
2224
2225         When a radio element gets clicked, we should only fire the 'input' and 'change' if the checked state
2226         of the radio element has changed.
2227
2228         Test: fast/dom/HTMLInputElement/radio-element-fires-change-event-only-when-checked-state-changes.html
2229
2230         * html/RadioInputType.cpp:
2231         (WebCore::RadioInputType::didDispatchClick):
2232
2233 2018-10-25  Joseph Pecoraro  <pecoraro@apple.com>
2234
2235         InspectorCanvas is not getting cleared properly for OffscreenCanvas
2236         https://bugs.webkit.org/show_bug.cgi?id=190894
2237         <rdar://problem/45498435>
2238
2239         Reviewed by Simon Fraser.
2240
2241         Covered by existing tests not crashing with guard malloc.
2242
2243         InspectorCanvasAgents tracks all CanvasRenderingContexts and needs to
2244         remove its reference when the containing CanvasBase goes away. It does
2245         this by registering as a notification observer, but if it can't map
2246         from the CanvasBase back to the rendering context we were failing to
2247         remove our reference. Enforce CanvasBase classes to notify observers
2248         of destruction while they still have their CanvasRenderingContext.
2249
2250         * html/CanvasBase.cpp:
2251         (WebCore::CanvasBase::~CanvasBase):
2252         (WebCore::CanvasBase::notifyObserversCanvasDestroyed):
2253         * html/CanvasBase.h:
2254         Assert that subclasses notify observers of the canvas being destroyed,
2255         since they will need to do this before m_context is cleared.
2256
2257         * html/CustomPaintCanvas.cpp:
2258         (WebCore::CustomPaintCanvas::~CustomPaintCanvas):
2259         * html/OffscreenCanvas.cpp:
2260         (WebCore::OffscreenCanvas::~OffscreenCanvas):
2261         Follow the new expected pattern of notifying observers before clearing
2262         the context. HTMLCanvasElement already followed this pattern.
2263
2264         * inspector/agents/InspectorCanvasAgent.cpp:
2265         (WebCore::InspectorCanvasAgent::canvasDestroyed):
2266         Add an assertion that would catch this earlier.
2267
2268 2018-10-24  Alexey Proskuryakov  <ap@apple.com>
2269
2270         Clean up some obsolete macOS version guards
2271         https://bugs.webkit.org/show_bug.cgi?id=190887
2272
2273         Reviewed by Dan Bernstein.
2274
2275         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2276         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2277         (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime const):
2278         (WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const):
2279         (WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
2280
2281 2018-10-24  Tim Horton  <timothy_horton@apple.com>
2282
2283         Attachment filenames with RTL characters should format similar to Finder
2284         https://bugs.webkit.org/show_bug.cgi?id=190736
2285         <rdar://problem/44735946>
2286
2287         Reviewed by Dan Bernstein.
2288
2289         Test: fast/attachment/attachment-title-with-rtl.html
2290
2291         * html/HTMLAttachmentElement.cpp:
2292         (WebCore::HTMLAttachmentElement::attachmentTitleForDisplay const):
2293         * html/HTMLAttachmentElement.h:
2294         Add attachmentTitleForDisplay(), which wraps the non-extension part of
2295         attachmentTitle in BiDi isolates, matching Finder's behavior.
2296
2297         * rendering/RenderThemeIOS.mm:
2298         (WebCore::RenderAttachmentInfo::buildWrappedLines):
2299         (WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
2300         * rendering/RenderThemeMac.mm:
2301         (WebCore::AttachmentLayout::layOutTitle):
2302         Adopt attachmentTitleForDisplay, and ask CoreText to use a subrange of
2303         the original string for the last line, instead of splitting the string
2304         ourselves. This ensures that BiDi control characters are respected
2305         even in the last line of the string.
2306
2307 2018-10-24  Megan Gardner  <megan_gardner@apple.com>
2308
2309         Turn on Conic Gradients
2310         https://bugs.webkit.org/show_bug.cgi?id=190810
2311
2312         Reviewed by Tim Horton.
2313
2314         Added tests previously, only switching feature from experimental to always avaiable.
2315
2316         * Configurations/FeatureDefines.xcconfig:
2317         * css/parser/CSSParserContext.cpp:
2318         (WebCore::CSSParserContext::CSSParserContext):
2319         (WebCore::operator==):
2320         * css/parser/CSSParserContext.h:
2321         (WebCore::CSSParserContextHash::hash):
2322         * css/parser/CSSPropertyParserHelpers.cpp:
2323         (WebCore::CSSPropertyParserHelpers::consumeConicGradient):
2324         * page/Settings.yaml:
2325
2326 2018-10-11  Jiewen Tan  <jiewen_tan@apple.com>
2327
2328         Only report resource timing to parent frame for the first iframe load
2329         https://bugs.webkit.org/show_bug.cgi?id=190498
2330         <rdar://problem/44347398>
2331
2332         Reviewed by Youenn Fablet.
2333
2334         Only the first iframe navigation or the first iframe navigation after about:blank should be reported.
2335         https://www.w3.org/TR/resource-timing-2/#resources-included-in-the-performanceresourcetiming-interface
2336
2337         Test: http/tests/misc/resource-timing-navigation-in-restored-iframe.html
2338
2339         * loader/FrameLoader.cpp:
2340         (WebCore::FrameLoader::loadWithDocumentLoader):
2341         * loader/FrameLoader.h:
2342         (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
2343         (WebCore::FrameLoader::setShouldReportResourceTimingToParentFrame): Deleted.
2344         * loader/ResourceTimingInformation.cpp:
2345         (WebCore::ResourceTimingInformation::addResourceTiming):
2346
2347 2018-10-24  Brent Fulgham  <bfulgham@apple.com>
2348
2349         Cure Windows Direct2D Backend of a nasty case of bitrot
2350         https://bugs.webkit.org/show_bug.cgi?id=190875
2351         <rdar://problem/45523268>
2352         
2353         Reviewed by Zalan Bujtas.
2354
2355         The Direct2D backend has drifted out of date with the rest of WebKit.
2356         This patch updates things so we can get a runnable build.
2357         
2358         * platform/graphics/FontPlatformData.h:
2359         * platform/graphics/ImageBuffer.cpp:
2360         (WebCore::ImageBuffer::create):
2361         * platform/graphics/ImageBuffer.h:
2362         * platform/graphics/ImageDecoder.h:
2363         * platform/graphics/ImageSource.cpp:
2364         (WebCore::ImageSource::setTargetContext):
2365         * platform/graphics/opentype/OpenTypeMathData.cpp:
2366         (WebCore::OpenTypeMathData::OpenTypeMathData): Need non-default constructor to make Visual
2367         Studio happy.
2368         * platform/graphics/win/GradientDirect2D.cpp:
2369         (WebCore::Gradient::generateGradient):
2370         * platform/graphics/win/GraphicsContextDirect2D.cpp: Update for new display list implementation.
2371         (WebCore::GraphicsContextPlatformPrivate::setAlpha):
2372         (WebCore::GraphicsContext::savePlatformState):
2373         (WebCore::GraphicsContext::restorePlatformState):
2374         (WebCore::GraphicsContext::drawNativeImage):
2375         (WebCore::GraphicsContext::drawPattern):
2376         (WebCore::GraphicsContext::drawRect):
2377         (WebCore::GraphicsContext::drawLine):
2378         (WebCore::GraphicsContext::drawEllipse):
2379         (WebCore::GraphicsContext::drawPath):
2380         (WebCore::GraphicsContext::fillPath):
2381         (WebCore::GraphicsContext::strokePath):
2382         (WebCore::GraphicsContext::fillRect):
2383         (WebCore::GraphicsContext::platformFillRoundedRect):
2384         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2385         (WebCore::GraphicsContext::clip):
2386         (WebCore::GraphicsContext::clipOut):
2387         (WebCore::GraphicsContext::clipPath):
2388         (WebCore::GraphicsContext::clipBounds const):
2389         (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
2390         (WebCore::GraphicsContext::endPlatformTransparencyLayer):
2391         (WebCore::GraphicsContext::setMiterLimit):
2392         (WebCore::GraphicsContext::clearRect):
2393         (WebCore::GraphicsContext::strokeRect):
2394         (WebCore::GraphicsContext::setLineCap):
2395         (WebCore::GraphicsContext::setLineDash):
2396         (WebCore::GraphicsContext::setLineJoin):
2397         (WebCore::GraphicsContext::scale):
2398         (WebCore::GraphicsContext::rotate):
2399         (WebCore::GraphicsContext::translate):
2400         (WebCore::GraphicsContext::concatCTM):
2401         (WebCore::GraphicsContext::setCTM):
2402         (WebCore::GraphicsContext::getCTM const):
2403         (WebCore::GraphicsContext::roundToDevicePixels):
2404         (WebCore::GraphicsContext::drawLinesForText):
2405         (WebCore::GraphicsContext::setURLForRect):
2406         (WebCore::GraphicsContext::setIsCALayerContext):
2407         (WebCore::GraphicsContext::isCALayerContext const):
2408         (WebCore::GraphicsContext::setIsAcceleratedContext):
2409         (WebCore::GraphicsContext::isAcceleratedContext const):
2410         (WebCore::GraphicsContext::setPlatformShouldAntialias):
2411         (WebCore::GraphicsContext::setPlatformShouldSmoothFonts):
2412         (WebCore::GraphicsContext::setPlatformCompositeOperation):
2413         (WebCore::GraphicsContext::platformFillEllipse):
2414         (WebCore::GraphicsContext::platformStrokeEllipse):
2415         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
2416         (WebCore::GraphicsLayer::create):
2417         (): Deleted.
2418         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2419         (WebCore::ImageBufferData::putData):
2420         * platform/graphics/win/ImageBufferDataDirect2D.h:
2421         * platform/graphics/win/ImageBufferDirect2D.cpp:
2422         (WebCore::ImageBuffer::createCompatibleBuffer):
2423         (WebCore::ImageBuffer::ImageBuffer):
2424         * platform/graphics/win/ImageDecoderDirect2D.cpp:
2425         (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties const):
2426         (WebCore::ImageDecoderDirect2D::encodedDataStatus const):
2427         (WebCore::ImageDecoderDirect2D::repetitionCount const):
2428         (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
2429         (WebCore::ImageDecoderDirect2D::frameDurationAtIndex const):
2430         (WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const):
2431         (WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const):
2432         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex):
2433         (WebCore::ImageDecoderDirect2D::setData):
2434         (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties): Deleted.
2435         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const): Deleted.
2436         * platform/graphics/win/ImageDecoderDirect2D.h:
2437         * platform/graphics/win/ImageDirect2D.cpp:
2438         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
2439         * platform/graphics/win/PatternDirect2D.cpp:
2440         (WebCore::Pattern::createPlatformPattern const):
2441
2442 2018-10-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
2443
2444         Cleanup: MIMETypeRegistry functions
2445         https://bugs.webkit.org/show_bug.cgi?id=190838
2446
2447         Reviewed by Simon Fraser.
2448
2449         Modernize the initialization of the lists in MIMETypeRegistry. Make the
2450         functions that return these list be self-contained. Use NeverDestroy<> to
2451         allocate the local static variable. Use std::initializer_list() and
2452         makeNeverDestroyed() to initialize NeverDestroy<> variables only once.
2453
2454         supportedImageResourceMIMETypes will be deleted and all the calls to it 
2455         will be replaced by supportedImageMIMETypes because they are identical.
2456
2457         * loader/archive/ArchiveFactory.cpp:
2458         (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): This function
2459         is called while initializing the supportedNonImageMIMETypes(). So it
2460         should not have a direct call to it. Instead, supportedNonImageMIMETypes
2461         is passed to it.
2462         * loader/archive/ArchiveFactory.h:
2463         * platform/MIMETypeRegistry.cpp:
2464         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
2465         (WebCore::supportedImageMIMETypesForEncoding):
2466         (WebCore::supportedJavaScriptMIMETypes):
2467         (WebCore::MIMETypeRegistry::supportedNonImageMIMETypes):
2468         (WebCore::MIMETypeRegistry::supportedMediaMIMETypes):
2469         (WebCore::pdfMIMETypes):
2470         (WebCore::MIMETypeRegistry::unsupportedTextMIMETypes):
2471         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
2472         (WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding):
2473         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
2474         (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
2475         (WebCore::MIMETypeRegistry::isSupportedMediaMIMEType):
2476         (WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
2477         (WebCore::MIMETypeRegistry::isPDFMIMEType):
2478         (WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
2479         (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType):
2480         (WebCore::initializeSupportedImageMIMETypes): Deleted.
2481         (WebCore::initializeSupportedImageMIMETypesForEncoding): Deleted.
2482         (WebCore::initializeSupportedJavaScriptMIMETypes): Deleted.
2483         (WebCore::initializePDFMIMETypes): Deleted.
2484         (WebCore::initializeSupportedNonImageMimeTypes): Deleted.
2485         (WebCore::initializeSupportedMediaMIMETypes): Deleted.
2486         (WebCore::initializeUnsupportedTextMIMETypes): Deleted.
2487         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Deleted.
2488         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Deleted.
2489         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted.
2490         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Deleted.
2491         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes): Deleted.
2492         (WebCore::MIMETypeRegistry::getPDFMIMETypes): Deleted.
2493         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes): Deleted.
2494         (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes): Deleted.
2495         * platform/MIMETypeRegistry.h:
2496         * platform/graphics/Image.cpp:
2497         (WebCore::Image::supportsType):
2498         * platform/graphics/cg/ImageDecoderCG.cpp:
2499         (WebCore::ImageDecoderCG::encodedDataStatus const):
2500         * platform/graphics/cg/UTIRegistry.cpp:
2501         (WebCore::supportedDefaultImageSourceTypes):
2502         (WebCore::isSupportImageSourceType):
2503         (WebCore::allowedImageUTIs): Deleted.
2504         (WebCore::isAllowedImageUTI): Deleted.
2505         * platform/graphics/cg/UTIRegistry.h:
2506         * platform/mac/PasteboardMac.mm:
2507         (WebCore::Pasteboard::write):
2508
2509 2018-10-24  Chris Dumez  <cdumez@apple.com>
2510
2511         [PSON] When navigating back and forth, 'about:blank' shows up in the back/forward list
2512         https://bugs.webkit.org/show_bug.cgi?id=190846
2513         <rdar://problem/45058938>
2514
2515         Reviewed by Antti Koivisto.
2516
2517         When a page gets suspended after a process-swap, we navigate it to about:blank from inside the navigation
2518         policy handler, by overriding the request URL. This normally works fine because we usually process-swap
2519         on standard navigation. However, when we would process-swap on a back/forward navigation, we would end
2520         up using the back/forward navigation load type to do the about:blank load. This would have repercussions
2521         because history navigations update the current history item with the new URL (in this case 'about:blank').
2522         To avoid the issue, switch to a standard load type whenever the client asks us to suspend and we load
2523         'about:blank' as a result.
2524
2525         * loader/FrameLoader.cpp:
2526         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2527
2528 2018-10-24  Andy Estes  <aestes@apple.com>
2529
2530         [macOS Debug WK2] Layout Test http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html is a flaky failure
2531         https://bugs.webkit.org/show_bug.cgi?id=190650
2532         <rdar://problem/45341914>
2533
2534         Reviewed by Alex Christensen.
2535
2536         In computeErrors, we intend to ignore errors when computing paymentMethodErrors. But we
2537         weren't clearing exceptions generated from calling convert(), so they would end up being
2538         logged as unhandled promise rejections.
2539
2540         Changed ApplePayPaymentHandler::computeErrors() to use a CatchScope to clear exceptions when
2541         decoding paymentMethodErrors.
2542
2543         Also changed ApplePayShippingAddressChangeEventErrorsV3.https.html to catch promise
2544         rejections from calling PaymentRequest.abort().
2545
2546         Covered by existing test.
2547
2548         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2549         (WebCore::ApplePayPaymentHandler::computeErrors const):
2550
2551 2018-10-22  Antti Koivisto  <antti@apple.com>
2552
2553         topPrivatelyControlledDomain is slow
2554         https://bugs.webkit.org/show_bug.cgi?id=190792
2555
2556         Reviewed by Alex Christensen and Chris Dumez.
2557
2558         It calls into some slowish CFNetwork code and ends up showing up in profiles.
2559
2560         * platform/mac/PublicSuffixMac.mm:
2561         (WebCore::topPrivatelyControlledDomain):
2562
2563         Add a cache that avoids calls into frameworks.
2564
2565 2018-10-22  Jer Noble  <jer.noble@apple.com>
2566
2567         Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC
2568         https://bugs.webkit.org/show_bug.cgi?id=190790
2569
2570         Reviewed by Alex Christensen.
2571
2572         Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by
2573         MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created
2574         the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make 
2575         GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making 
2576         incrementing the pending task count atomic.
2577
2578         * platform/GenericTaskQueue.cpp:
2579         (WebCore::TaskDispatcher<Timer>::postTask):
2580         (WebCore::TaskDispatcher<Timer>::sharedLock):
2581         (WebCore::TaskDispatcher<Timer>::sharedTimerFired):
2582         (WebCore::TaskDispatcher<Timer>::dispatchOneTask):
2583         (WebCore::TaskDispatcher<Timer>::pendingDispatchers):
2584         * platform/GenericTaskQueue.h:
2585         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2586         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2587         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2588         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
2589         (-[WebCoreAVFMovieObserver initWithPlayer:]):
2590         (-[WebCoreAVFMovieObserver disconnect]):
2591         (-[WebCoreAVFMovieObserver metadataLoaded]):
2592         (-[WebCoreAVFMovieObserver didEnd:]):
2593         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2594         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
2595         (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
2596         (-[WebCoreAVFLoaderDelegate initWithPlayer:]):
2597         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
2598         (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
2599         (-[WebCoreAVFPullDelegate initWithPlayer:]):
2600         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
2601         (-[WebCoreAVFMovieObserver initWithCallback:]): Deleted.
2602         (-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted.
2603         (-[WebCoreAVFLoaderDelegate setCallback:]): Deleted.
2604         (-[WebCoreAVFPullDelegate initWithCallback:]): Deleted.
2605         (-[WebCoreAVFPullDelegate setCallback:]): Deleted.
2606
2607 2018-10-23  Jer Noble  <jer.noble@apple.com>
2608
2609         TextTrack cues should be updated more often than every 250ms.
2610         https://bugs.webkit.org/show_bug.cgi?id=190827
2611
2612         Reviewed by Eric Carlson.
2613
2614         Test: media/track/track-cue-timing.html
2615
2616         TextTracks cues are recalculated on the playback timer, which fires at least every 250ms.
2617         In addition to this timer, add a method to MediaPlayer to provide a task which will be
2618         performed at a particular media time, and use this new method to request cues be updated
2619         at the next interesting media time. The next interesting time would be either when the
2620         soonest current cue will end, or when the next non-current cue will start, whichever is
2621         earlier.
2622
2623         (Determining the "next non-current cue" requires new API on PODIntervalTree, as that class
2624         does not have iterators per-se.)
2625
2626         * html/HTMLMediaElement.cpp:
2627         (WebCore::compareCueIntervalEndTime):
2628         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2629         * platform/PODIntervalTree.h:
2630         * platform/graphics/MediaPlayer.cpp:
2631         (WebCore::MediaPlayer::performTaskAtMediaTime):
2632         * platform/graphics/MediaPlayer.h:
2633         * platform/graphics/MediaPlayerPrivate.h:
2634         (WebCore::MediaPlayerPrivateInterface::performTaskAtMediaTime):
2635         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2636         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2637         (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):
2638         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2639         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2640         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
2641
2642 2018-10-23  Fujii Hironori  <Hironori.Fujii@sony.com>
2643
2644         [Win] Assertion fails while destructing local static AtomicString of FontCache::lastResortFallbackFont
2645         https://bugs.webkit.org/show_bug.cgi?id=190748
2646
2647         Reviewed by Myles C. Maxfield.
2648
2649         FontCache::lastResortFallbackFont had local static AtomicString
2650         variables which are not capsuled by NeverDestroyed. Hence, those
2651         variables are destructed on IPC thread when WebProcess exits.
2652
2653         Changed those AtomicString to NeverDestroyed<AtomicString> not to
2654         be destructed on exit.
2655
2656         This change can't be tested automatically because WebKitTestRunner
2657         doesn't support Windows port yet.
2658
2659         * platform/graphics/win/FontCacheWin.cpp:
2660         (WebCore::FontCache::lastResortFallbackFont): Changed
2661         fallbackFonts's type from AtomicString array to
2662         NeverDestroyed<AtomicString> array.
2663
2664 2018-10-23  Justin Fan  <justin_fan@apple.com>
2665
2666         [WebGPU] Rename old GPU* implementation files to GPULegacy* for WebMetal
2667         https://bugs.webkit.org/show_bug.cgi?id=190817
2668
2669         Reviewed by Dean Jackson.
2670
2671         No new tests. No change in behavior.
2672
2673         * [Large list of refactored classes and renamed files]: GPU* is now GPULegacy*
2674
2675 2018-10-23  Ryan Haddad  <ryanhaddad@apple.com>
2676
2677         Unreviewed, rolling out r237261.
2678
2679         The layout test for this change crashes under GuardMalloc.
2680
2681         Reverted changeset:
2682
2683         "Handle MDNS resolution of candidates through libwebrtc
2684         directly"
2685         https://bugs.webkit.org/show_bug.cgi?id=190681
2686         https://trac.webkit.org/changeset/237261
2687
2688 2018-10-23  Truitt Savell  <tsavell@apple.com>
2689
2690         Unreviewed, rolling out r237357.
2691
2692         API test is now failing on all platforms.
2693
2694         Reverted changeset:
2695
2696         "topPrivatelyControlledDomain is slow"
2697         https://bugs.webkit.org/show_bug.cgi?id=190792
2698         https://trac.webkit.org/changeset/237357
2699
2700 2018-10-23  Truitt Savell  <tsavell@apple.com>
2701
2702         Unreviewed, rolling out r237350.
2703
2704         Caused several Crashes cross multiple tests and platforms.
2705
2706         Reverted changeset:
2707
2708         "Use WeakPtr and GenericTaskQueue within ObjC classes used by
2709         MediaPlayerPrivateAVFoundationObjC"
2710         https://bugs.webkit.org/show_bug.cgi?id=190790
2711         https://trac.webkit.org/changeset/237350
2712
2713 2018-10-23  Ryan Haddad  <ryanhaddad@apple.com>
2714
2715         Unreviewed, rolling out r237280.
2716
2717         Causes fast/box-shadow/box-shadow-with-zero-radius.html to
2718         fail on iOS Simulator.
2719
2720         Reverted changeset:
2721
2722         "[CG] Adopt CG SPI for non-even cornered rounded rects"
2723         https://bugs.webkit.org/show_bug.cgi?id=190155
2724         https://trac.webkit.org/changeset/237280
2725
2726 2018-10-23  Antti Koivisto  <antti@apple.com>
2727
2728         topPrivatelyControlledDomain is slow
2729         https://bugs.webkit.org/show_bug.cgi?id=190792
2730
2731         Reviewed by Alex Christensen.
2732
2733         It calls into some slowish CFNetwork code and ends up showing up in profiles.
2734
2735         * platform/mac/PublicSuffixMac.mm:
2736         (WebCore::topPrivatelyControlledDomain):
2737
2738         Add a cache that avoids calls into frameworks.
2739
2740 2018-10-23  Chris Dumez  <cdumez@apple.com>
2741
2742         [PSON] Add support for cross-site client-side redirects
2743         https://bugs.webkit.org/show_bug.cgi?id=190806
2744         <rdar://problem/45047344>
2745
2746         Reviewed by Geoffrey Garen.
2747
2748         Add support for cross-site client-side redirects so that it swaps process and so that the back
2749         forward list looks as expected. To support this, the following changes had to be done:
2750         - The NavigationAction now provides additional information so that the WebProcess can communicate
2751           things about the client-side redirect to the UIProcess: lockHistory / lockBackForwardList and
2752           clientRedirectSourceForHistory.
2753         - If the UIProcess decides to process-swap on a client-side redirect, we pass the client-side
2754           redirect information to the new WebContent process via LoadRequest struct. WebCore then takes
2755           care of setting things up using this information so that it recognizes that it is continuing
2756           a load that is a client side redirect.
2757         - We also need to pass the current BackForwardListItem / HistoryItem to the new WebContent
2758           process so that the new process can truly lock history and keep updating the *current*
2759           HistoryItem, instead of creating a new HistoryItem.
2760         - After a process swap, when we re-construct the WebFrameProxy for the main frame in the new
2761           process, we now set the frame's URL in the UIProcess to the URL it had before we swapped.
2762           Clients such as Safari, rely on the main frame's URL being the expected value (the last
2763           committed load URL) until the next load is committed when receiving didPerformRedirect
2764           calls. Because we are destroying the main frame on process-swapping, we were losing the
2765           last committed URL and Safari would hit assertions.
2766
2767         With this model, the willPerformClientRedirect IPC is still sent from the previous WebProcess
2768         and the didPerformClientRedirect IPC is now sent by the new WebProcess. No change should be
2769         observable from the client's point of view.
2770
2771         * loader/FrameLoadRequest.h:
2772         (WebCore::FrameLoadRequest::setLockHistory):
2773         (WebCore::FrameLoadRequest::setlockBackForwardList):
2774         (WebCore::FrameLoadRequest::clientRedirectSourceForHistory const):
2775         (WebCore::FrameLoadRequest::setClientRedirectSourceForHistory):
2776         * loader/FrameLoader.cpp:
2777         (WebCore::FrameLoader::loadURL):
2778         (WebCore::FrameLoader::load):
2779         * loader/HistoryController.cpp:
2780         (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
2781         * loader/HistoryController.h:
2782         * loader/NavigationAction.h:
2783         (WebCore::NavigationAction::lockHistory const):
2784         (WebCore::NavigationAction::setLockHistory):
2785         (WebCore::NavigationAction::lockBackForwardList const):
2786         (WebCore::NavigationAction::setLockBackForwardList):
2787
2788 2018-10-23  Jer Noble  <jer.noble@apple.com>
2789
2790         Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC
2791         https://bugs.webkit.org/show_bug.cgi?id=190790
2792
2793         Reviewed by Alex Christensen.
2794
2795         Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by
2796         MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created
2797         the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make 
2798         GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making 
2799         incrementing the pending task count atomic.
2800
2801         * platform/GenericTaskQueue.cpp:
2802         (WebCore::TaskDispatcher<Timer>::postTask):
2803         (WebCore::TaskDispatcher<Timer>::sharedLock):
2804         (WebCore::TaskDispatcher<Timer>::sharedTimerFired):
2805         (WebCore::TaskDispatcher<Timer>::dispatchOneTask):
2806         (WebCore::TaskDispatcher<Timer>::pendingDispatchers):
2807         * platform/GenericTaskQueue.h:
2808         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2809         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2810         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2811         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
2812         (-[WebCoreAVFMovieObserver initWithPlayer:]):
2813         (-[WebCoreAVFMovieObserver disconnect]):
2814         (-[WebCoreAVFMovieObserver metadataLoaded]):
2815         (-[WebCoreAVFMovieObserver didEnd:]):
2816         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2817         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
2818         (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
2819         (-[WebCoreAVFLoaderDelegate initWithPlayer:]):
2820         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
2821         (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
2822         (-[WebCoreAVFPullDelegate initWithPlayer:]):
2823         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
2824         (-[WebCoreAVFMovieObserver initWithCallback:]): Deleted.
2825         (-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted.
2826         (-[WebCoreAVFLoaderDelegate setCallback:]): Deleted.
2827         (-[WebCoreAVFPullDelegate initWithCallback:]): Deleted.
2828         (-[WebCoreAVFPullDelegate setCallback:]): Deleted.
2829
2830 2018-10-22  Justin Michaud  <justin_michaud@apple.com>
2831
2832         Registered custom properties should support syntax parameter for <length> and *
2833         https://bugs.webkit.org/show_bug.cgi?id=190039
2834
2835         Reviewed by Antti Koivisto.
2836
2837         Refactor code so that:
2838         - All properties applied in StyleResolver::applyMatchedProperties are only applied once. 
2839         - Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved
2840           every time they were referenced, and again in RenderStyle.
2841         - The font-size property is applied after its variable references, but before custom properties that depend on it.
2842         - Cycles are detected at the same time as resolution.
2843         - MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type.
2844           If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty.
2845           This behaviour matches chrome, but is not documented in the spec. 
2846         - Custom property values have more explicit resolved/unresolved state.
2847         - RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties.
2848
2849         Tests: css-custom-properties-api/crash.html
2850                css-custom-properties-api/cycles.html
2851                css-custom-properties-api/inline.html
2852
2853         * css/CSSComputedStyleDeclaration.cpp:
2854         (WebCore::ComputedStyleExtractor::customPropertyValue):
2855         * css/CSSCustomPropertyValue.cpp:
2856         (WebCore::CSSCustomPropertyValue::equals const):
2857         (WebCore::CSSCustomPropertyValue::customCSSText const):
2858         (WebCore::CSSCustomPropertyValue::tokens const):
2859         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted.
2860         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted.
2861         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted.
2862         * css/CSSCustomPropertyValue.h:
2863         * css/CSSRegisteredCustomProperty.cpp:
2864         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
2865         * css/CSSRegisteredCustomProperty.h:
2866         * css/CSSStyleSheet.h:
2867         * css/CSSVariableData.cpp:
2868         (WebCore::CSSVariableData::CSSVariableData):
2869         (WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted.
2870         (WebCore::CSSVariableData::checkVariablesForCycles const): Deleted.
2871         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted.
2872         (WebCore::CSSVariableData::resolveVariableFallback const): Deleted.
2873         (WebCore::CSSVariableData::resolveVariableReference const): Deleted.
2874         (WebCore::CSSVariableData::resolveVariableReferences const): Deleted.
2875         (WebCore::CSSVariableData::resolveTokenRange const): Deleted.
2876         * css/CSSVariableData.h:
2877         (WebCore::CSSVariableData::create):
2878         (WebCore::CSSVariableData::createResolved): Deleted.
2879         (WebCore::CSSVariableData::needsVariableResolution const): Deleted.
2880         (WebCore::CSSVariableData::CSSVariableData): Deleted.
2881         * css/CSSVariableReferenceValue.cpp:
2882         (WebCore::resolveVariableFallback):
2883         (WebCore::resolveVariableReference):
2884         (WebCore::resolveTokenRange):
2885         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const):
2886         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted.
2887         * css/CSSVariableReferenceValue.h:
2888         (WebCore::CSSVariableReferenceValue::create):
2889         (WebCore::CSSVariableReferenceValue::equals const):
2890         (WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted.
2891         * css/DOMCSSRegisterCustomProperty.cpp:
2892         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2893         * css/PropertySetCSSStyleDeclaration.cpp:
2894         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
2895         * css/StyleBuilderCustom.h:
2896         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
2897         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
2898         * css/StyleProperties.cpp:
2899         (WebCore::MutableStyleProperties::setCustomProperty):
2900         * css/StyleProperties.h:
2901         * css/StyleResolver.cpp:
2902         (WebCore::StyleResolver::State::setStyle):
2903         (WebCore::StyleResolver::styleForKeyframe):
2904         (WebCore::StyleResolver::styleForPage):
2905         (WebCore::StyleResolver::applyMatchedProperties):
2906         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
2907         (WebCore::StyleResolver::applyProperty):
2908         (WebCore::StyleResolver::resolvedVariableValue const):
2909         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
2910         (WebCore::StyleResolver::CascadedProperties::Property::apply):
2911         (WebCore::StyleResolver::applyCascadedCustomProperty):
2912         (WebCore::StyleResolver::applyCascadedProperties):
2913         * css/StyleResolver.h:
2914         * css/parser/CSSParser.cpp:
2915         (WebCore::CSSParser::parseValueWithVariableReferences):
2916         * css/parser/CSSParser.h:
2917         * css/parser/CSSPropertyParser.cpp:
2918         (WebCore::CSSPropertyParser::CSSPropertyParser):
2919         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue):
2920         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
2921         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
2922         (WebCore::CSSPropertyParser::parseValueStart):
2923         (WebCore::CSSPropertyParser::parseSingleValue):
2924         * css/parser/CSSPropertyParser.h:
2925         * css/parser/CSSVariableParser.cpp:
2926         (WebCore::CSSVariableParser::parseDeclarationValue):
2927         * dom/ConstantPropertyMap.cpp:
2928         (WebCore::ConstantPropertyMap::setValueForProperty):
2929         (WebCore::variableDataForPositivePixelLength):
2930         (WebCore::variableDataForPositiveDuration):
2931         * rendering/style/RenderStyle.cpp:
2932         (WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted.
2933         * rendering/style/RenderStyle.h:
2934         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
2935         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
2936         * rendering/style/StyleCustomPropertyData.h:
2937         (WebCore::StyleCustomPropertyData::operator== const):
2938         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
2939         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
2940         (): Deleted.
2941
2942 2018-10-22  Justin Michaud  <justin_michaud@apple.com>
2943
2944         CSS Paint API should give a 2d rendering context
2945         https://bugs.webkit.org/show_bug.cgi?id=190762
2946
2947         Reviewed by Dean Jackson.
2948
2949         Add a new type of canvas and 2d rendering context to support the CSS Painting API.
2950         Make many of the methods from HTMLCanvasElement virtual functions on CanvasBase, and
2951         remove many of the downcasts in CanvasRenderingContext2DBase as a result.
2952
2953         * CMakeLists.txt:
2954         * DerivedSources.make:
2955         * Sources.txt:
2956         * WebCore.xcodeproj/project.pbxproj:
2957         * bindings/js/JSPaintRenderingContext2DCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
2958         (WebCore::root):
2959         (WebCore::JSPaintRenderingContext2DOwner::isReachableFromOpaqueRoots):
2960         (WebCore::JSPaintRenderingContext2D::visitAdditionalChildren):
2961         * bindings/js/WebCoreBuiltinNames.h:
2962         * css/CSSPaintCallback.h:
2963         * css/CSSPaintCallback.idl:
2964         * html/CanvasBase.cpp:
2965         (WebCore::CanvasBase::~CanvasBase):
2966         * html/CanvasBase.h:
2967         (WebCore::CanvasBase::isCustomPaintCanvas const):
2968         * html/CustomPaintCanvas.cpp: Added.
2969         (WebCore::CustomPaintCanvas::create):
2970         (WebCore::CustomPaintCanvas::CustomPaintCanvas):
2971         (WebCore::CustomPaintCanvas::~CustomPaintCanvas):
2972         (WebCore::CustomPaintCanvas::width const):
2973         (WebCore::CustomPaintCanvas::setWidth):
2974         (WebCore::CustomPaintCanvas::height const):
2975         (WebCore::CustomPaintCanvas::setHeight):
2976         (WebCore::CustomPaintCanvas::size const):
2977         (WebCore::CustomPaintCanvas::setSize):
2978         (WebCore::CustomPaintCanvas::getContext):
2979         (WebCore::CustomPaintCanvas::copiedImage const):
2980         (WebCore::CustomPaintCanvas::drawingContext const):
2981         (WebCore::CustomPaintCanvas::existingDrawingContext const):
2982         (WebCore::CustomPaintCanvas::makeRenderingResultsAvailable):
2983         * html/CustomPaintCanvas.h: Copied from Source/WebCore/html/OffscreenCanvas.h.
2984         * html/HTMLCanvasElement.h:
2985         * html/OffscreenCanvas.h:
2986         * html/canvas/CanvasRenderingContext.cpp:
2987         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
2988         * html/canvas/CanvasRenderingContext.h:
2989         (WebCore::CanvasRenderingContext::isPaint const):
2990         * html/canvas/CanvasRenderingContext2DBase.cpp:
2991         (WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
2992         (WebCore::CanvasRenderingContext2DBase::unwindStateStack):
2993         (WebCore::CanvasRenderingContext2DBase::isAccelerated const):
2994         (WebCore::CanvasRenderingContext2DBase::setStrokeStyle):
2995         (WebCore::CanvasRenderingContext2DBase::setFillStyle):
2996         (WebCore::CanvasRenderingContext2DBase::resetTransform):
2997         (WebCore::CanvasRenderingContext2DBase::clearCanvas):
2998         (WebCore::CanvasRenderingContext2DBase::transformAreaToDevice const):
2999         (WebCore::CanvasRenderingContext2DBase::rectContainsCanvas const):
3000         (WebCore::CanvasRenderingContext2DBase::calculateCompositingBufferRect):
3001         (WebCore::CanvasRenderingContext2DBase::compositeBuffer):
3002         (WebCore::CanvasRenderingContext2DBase::createPattern):
3003         (WebCore::CanvasRenderingContext2DBase::didDrawEntireCanvas):
3004         (WebCore::CanvasRenderingContext2DBase::didDraw):
3005         (WebCore::CanvasRenderingContext2DBase::paintRenderingResultsToCanvas):
3006         (WebCore::CanvasRenderingContext2DBase::drawingContext const):
3007         * html/canvas/CanvasRenderingContext2DBase.h:
3008         * html/canvas/PaintRenderingContext2D.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
3009         (WebCore::PaintRenderingContext2D::create):
3010         (WebCore::PaintRenderingContext2D::PaintRenderingContext2D):
3011         * html/canvas/PaintRenderingContext2D.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
3012         * html/canvas/PaintRenderingContext2D.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
3013         * html/canvas/WebMetalRenderPassAttachmentDescriptor.h:
3014         * platform/graphics/CustomPaintImage.cpp:
3015         (WebCore::CustomPaintImage::doCustomPaint):
3016
3017 2018-10-22  Keith Rollin  <krollin@apple.com>
3018
3019         Use Location = "Relative to Build Products" rather than "Relative to Group"
3020         https://bugs.webkit.org/show_bug.cgi?id=190781
3021
3022         Reviewed by Alexey Proskuryakov.
3023
3024         Almost all Derived Files are included in Xcode projects with the
3025         Location attribute set to "Relative to Group". While this currently
3026         works, the Derived Files can no longer be found when enabling XCBuild
3027         (which has stricter requirements). Fix this by setting the Location
3028         attribute to "Relative to Build Products".
3029
3030         No new tests -- no changed functionality.
3031
3032         * WebCore.xcodeproj/project.pbxproj:
3033
3034 2018-10-22  Zalan Bujtas  <zalan@apple.com>
3035
3036         [LFC][IFC] Add justify text-align support.
3037         https://bugs.webkit.org/show_bug.cgi?id=190779
3038
3039         Reviewed by Antti Koivisto.
3040
3041         Collect expansion opportunities and adjust runs accordingly.
3042
3043         * layout/inlineformatting/InlineFormattingContext.cpp:
3044         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3045         * layout/inlineformatting/InlineFormattingContext.h:
3046         * layout/inlineformatting/InlineRun.h:
3047         (WebCore::Layout::InlineRun::expansionOpportunity):
3048         (WebCore::Layout::InlineRun::TextContext::setStart):
3049         (WebCore::Layout::InlineRun::TextContext::setLength):
3050         (WebCore::Layout::InlineRun::setTextContext):
3051         (WebCore::Layout::InlineRun::createRun): Deleted.
3052         (WebCore::Layout::InlineRun::createTextRun): Deleted.
3053         * layout/inlineformatting/Line.cpp:
3054         (WebCore::Layout::InlineFormattingContext::Line::Line):
3055         (WebCore::Layout::InlineFormattingContext::Line::init):
3056         (WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities):
3057         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
3058         (WebCore::Layout::InlineFormattingContext::Line::justifyRuns):
3059         (WebCore::Layout::InlineFormattingContext::Line::close):
3060         (WebCore::Layout::isNonCollapsedText): Deleted.
3061
3062 2018-10-22  Zalan Bujtas  <zalan@apple.com>
3063
3064         [LFC][IFC] Add (right, center)text-align support.
3065         https://bugs.webkit.org/show_bug.cgi?id=190745
3066
3067         Reviewed by Antti Koivisto.
3068
3069         Adjust the logical left of each run while closing the line.
3070
3071         * layout/Verification.cpp:
3072         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
3073         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
3074         * layout/inlineformatting/InlineFormattingContext.cpp:
3075         (WebCore::Layout::trimLeadingRun):
3076         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3077         * layout/inlineformatting/InlineFormattingContext.h:
3078         (WebCore::Layout::InlineFormattingContext::Line::hasContent const):
3079         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
3080         * layout/inlineformatting/InlineLineBreaker.cpp:
3081         (WebCore::Layout::InlineLineBreaker::nextRun):
3082         (WebCore::Layout::InlineLineBreaker::splitRun):
3083         * layout/inlineformatting/InlineLineBreaker.h:
3084         * layout/inlineformatting/InlineRun.h:
3085         (WebCore::Layout::InlineRun::setLogicalLeft):
3086         (WebCore::Layout::InlineRun::TextContext::start const):
3087         (WebCore::Layout::InlineRun::createRun):
3088         (WebCore::Layout::InlineRun::createTextRun):
3089         (WebCore::Layout::InlineRun::InlineRun):
3090         (WebCore::Layout::InlineRun::TextContext::TextContext):
3091         (WebCore::Layout::InlineRun::TextContext::position const): Deleted.
3092         * layout/inlineformatting/Line.cpp:
3093         (WebCore::Layout::InlineFormattingContext::Line::Line):
3094         (WebCore::Layout::InlineFormattingContext::Line::init):
3095         (WebCore::Layout::adjustedLineLogicalLeft):
3096         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight):
3097         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
3098         (WebCore::Layout::InlineFormattingContext::Line::close):
3099         (WebCore::Layout::InlineFormattingContext::Line::setConstraints): Deleted.
3100         * layout/layouttree/LayoutTreeBuilder.cpp:
3101         (WebCore::Layout::outputInlineRuns):
3102
3103 2018-10-22  Zalan Bujtas  <zalan@apple.com>
3104
3105         [LFC][IFC] Implement Replaced helper class.
3106         https://bugs.webkit.org/show_bug.cgi?id=190719
3107
3108         Reviewed by Antti Koivisto.
3109
3110         * layout/layouttree/LayoutBox.cpp:
3111         (WebCore::Layout::Box::Box):
3112         * layout/layouttree/LayoutBox.h:
3113         (WebCore::Layout::Box::replaced const):
3114         * layout/layouttree/LayoutReplaced.cpp:
3115         (WebCore::Layout::Replaced::Replaced):
3116         (WebCore::Layout::Replaced::hasIntrinsicWidth const):
3117         (WebCore::Layout::Replaced::hasIntrinsicHeight const):
3118         (WebCore::Layout::Replaced::hasIntrinsicRatio const):
3119         (WebCore::Layout::Replaced::intrinsicWidth const):
3120         (WebCore::Layout::Replaced::intrinsicHeight const):
3121         (WebCore::Layout::Replaced::intrinsicRatio const):
3122         * layout/layouttree/LayoutReplaced.h:
3123         (WebCore::Layout::Replaced::hasIntrinsicWidth const): Deleted.
3124         (WebCore::Layout::Replaced::hasIntrinsicHeight const): Deleted.
3125         (WebCore::Layout::Replaced::hasIntrinsicRatio const): Deleted.
3126         (WebCore::Layout::Replaced::intrinsicWidth const): Deleted.
3127         (WebCore::Layout::Replaced::intrinsicHeight const): Deleted.
3128         (WebCore::Layout::Replaced::intrinsicRatio const): Deleted.
3129         * layout/layouttree/LayoutTreeBuilder.cpp:
3130         (WebCore::Layout::TreeBuilder::createSubTree):
3131
3132 2018-10-22  Zalan Bujtas  <zalan@apple.com>
3133
3134         [LFC][IFC] Block formatting context roots avoid floats.
3135         https://bugs.webkit.org/show_bug.cgi?id=190723
3136
3137         Reviewed by Antti Koivisto.
3138
3139         Inline formatting context roots don't avoid floats (unless they also establish block formatting context).
3140
3141         * layout/blockformatting/BlockFormattingContext.cpp:
3142         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3143
3144 2018-10-20  YUHAN WU  <yuhan_wu@apple.com>
3145
3146         MediaRecorder should fire a stop event when all tracks are ended
3147         https://bugs.webkit.org/show_bug.cgi?id=190642
3148
3149         Reviewed by Youenn Fablet.
3150
3151         This patch only implements to fire the stop event when all tracks are ended.
3152         We will need to fire a dataavailable event when all tracks are ended.
3153
3154         Test: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-stop.html
3155
3156         * Modules/mediarecorder/MediaRecorder.cpp:
3157         (WebCore::MediaRecorder::MediaRecorder):
3158         (WebCore::MediaRecorder::~MediaRecorder):
3159         (WebCore::MediaRecorder::trackEnded):
3160         * Modules/mediarecorder/MediaRecorder.h:
3161         * Modules/mediarecorder/MediaRecorder.idl:
3162         * WebCore.xcodeproj/project.pbxproj:
3163         * dom/EventNames.h:
3164
3165 2018-10-19  Stephan Szabo  <stephan.szabo@sony.com>
3166
3167         [WinCairo] Search terms are not saved for <input type="search">
3168         https://bugs.webkit.org/show_bug.cgi?id=188174
3169
3170         Reviewed by Fujii Hironori.
3171
3172         No new tests, should be covered by existing tests of search 
3173         inputs.
3174
3175         Add support for saving the search terms for <input
3176         type="search"> to a SQLite database, replacing the
3177         CF-based implementation for Windows and adding support
3178         for non-legacy WebKit.
3179
3180         * PlatformWin.cmake:
3181         * platform/win/SearchPopupMenuDB.cpp: Added.
3182         (WebCore::SearchPopupMenuDB::singleton):
3183         (WebCore::SearchPopupMenuDB::SearchPopupMenuDB):
3184         (WebCore::SearchPopupMenuDB::~SearchPopupMenuDB):
3185         (WebCore::SearchPopupMenuDB::saveRecentSearches):
3186         (WebCore::SearchPopupMenuDB::loadRecentSearches):
3187         (WebCore::SearchPopupMenuDB::checkDatabaseValidity): Use
3188         quick_check pragma to test database status.
3189         (WebCore::SearchPopupMenuDB::deleteAllDatabaseFiles):
3190         (WebCore::SearchPopupMenuDB::openDatabase):
3191         (WebCore::SearchPopupMenuDB::closeDatabase):
3192         (WebCore::SearchPopupMenuDB::verifySchemaVersion): Check
3193         schema version and update for schema changes.
3194         (WebCore::SearchPopupMenuDB::checkSQLiteReturnCode): Check
3195         for error codes that indicate database errors and remove and
3196         recreate the database.
3197         (WebCore::SearchPopupMenuDB::executeSimpleSql):
3198         (WebCore::SearchPopupMenuDB::createPreparedStatement):
3199         * platform/win/SearchPopupMenuDB.h: Added.
3200         * platform/win/SearchPopupMenuWin.cpp:
3201         (WebCore::SearchPopupMenuWin::enabled): Always enable support
3202         for search term popup
3203         (WebCore::SearchPopupMenuWin::saveRecentSearches): Switch from
3204         CF implementation to SQLite database implementation
3205         (WebCore::SearchPopupMenuWin::loadRecentSearches): Switch from
3206         CF implementation to SQLite database implementation
3207         (WebCore::autosaveKey): Deleted.
3208
3209 2018-10-19  Justin Fan  <justin_fan@apple.com>
3210
3211         [WebGPU] Add stubs for WebGPUSwapChain and WebGPURenderingContext
3212         https://bugs.webkit.org/show_bug.cgi?id=190742
3213
3214         Reviewed by Dean Jackson.
3215
3216         Test: updated webgpu-enabled.html to check for WebGPURenderingContext.
3217
3218         Implement support for creating a "webgpu" context from an HTML canvas.
3219
3220         * CMakeLists.txt:
3221         * DerivedSources.make:
3222         * Modules/webgpu/WebGPURenderingContext.cpp: Added.
3223         (WebCore::WebGPURenderingContext::create):
3224         (WebCore::WebGPURenderingContext::WebGPURenderingContext):
3225         * Modules/webgpu/WebGPURenderingContext.h: Added.
3226         * Modules/webgpu/WebGPURenderingContext.idl: Added.
3227         * Modules/webgpu/WebGPUSwapChain.cpp: Added.
3228         (WebCore::WebGPUSwapChain::configure):
3229         (WebCore::WebGPUSwapChain::present):
3230         (WebCore::WebGPUSwapChain::reshape):
3231         (WebCore::WebGPUSwapChain::markLayerComposited):
3232         * Modules/webgpu/WebGPUSwapChain.h: Added.
3233         (WebCore::WebGPUSwapChain::WebGPUSwapChain):
3234         * Modules/webgpu/WebGPUSwapChain.idl: Added.
3235         * Modules/webgpu/WebGPUSwapChainDescriptor.h: Added.
3236         * Modules/webgpu/WebGPUSwapChainDescriptor.idl: Added.
3237         * Sources.txt:
3238         * WebCore.xcodeproj/project.pbxproj:
3239         * bindings/js/WebCoreBuiltinNames.h:
3240         * dom/Document.cpp:
3241         (WebCore::Document::getCSSCanvasContext):
3242         * dom/Document.h:
3243         * dom/Document.idl:
3244         * html/HTMLCanvasElement.cpp:
3245         (WebCore::HTMLCanvasElement::getContext):
3246         (WebCore::HTMLCanvasElement::isWebGPUType):
3247         (WebCore::HTMLCanvasElement::createContextWebGPU):
3248         (WebCore::HTMLCanvasElement::getContextWebGPU):
3249         * html/HTMLCanvasElement.h:
3250         * html/HTMLCanvasElement.idl:
3251         * html/canvas/CanvasRenderingContext.h:
3252         (WebCore::CanvasRenderingContext::isWebGPU const):
3253
3254 2018-10-19  John Wilander  <wilander@apple.com>
3255
3256         Only cap lifetime of persistent cookies created client-side through document.cookie when resource load statistics is enabled
3257         https://bugs.webkit.org/show_bug.cgi?id=190687
3258         <rdar://problem/45349024>
3259
3260         Reviewed by Alex Christensen.
3261
3262         Test: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js.html
3263
3264         NetworkStorageSession::setCookiesFromDOM() now consults the new
3265         m_shouldCapLifetimeForClientSideCookies member variable before
3266         capping the lifetime of cookies.
3267
3268         * loader/ResourceLoadStatistics.cpp:
3269         (WebCore::ResourceLoadStatistics::toString const):
3270         (WebCore::ResourceLoadStatistics::merge):
3271             Removal of the isMarkedForCookieBlocking member.
3272         * loader/ResourceLoadStatistics.h:
3273             Removal of the isMarkedForCookieBlocking member.
3274         * platform/network/NetworkStorageSession.h:
3275         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3276         (WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies):
3277         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
3278             No longer takes the boolean clearFirst parameter and now always clears first.
3279         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
3280         (WebCore::filterCookies):
3281         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
3282
3283 2018-10-19  Zalan Bujtas  <zalan@apple.com>
3284
3285         [LFC][IFC] RenderReplaced renderer should create InlineBox
3286         https://bugs.webkit.org/show_bug.cgi?id=190720
3287
3288         Reviewed by Antti Koivisto.
3289
3290         * layout/layouttree/LayoutTreeBuilder.cpp:
3291         (WebCore::Layout::TreeBuilder::createSubTree):
3292
3293 2018-10-19  Zalan Bujtas  <zalan@apple.com>
3294
3295         [LFC][IFC] Inline replaced width should default to 300px only if width is auto.
3296         https://bugs.webkit.org/show_bug.cgi?id=190722
3297
3298         Reviewed by Antti Koivisto.
3299
3300         See #5
3301
3302         // 5. Otherwise, if 'width' has a computed value of 'auto', but none of the conditions above are met, then the used value of 'width' becomes 300px.
3303
3304         * layout/FormattingContextGeometry.cpp:
3305         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3306
3307 2018-10-19  Zalan Bujtas  <zalan@apple.com>
3308
3309         [LFC][IFC] Add inline runs to showLayoutTree
3310         https://bugs.webkit.org/show_bug.cgi?id=190718
3311
3312         Reviewed by Antti Koivisto.
3313
3314         * layout/layouttree/LayoutTreeBuilder.cpp:
3315         (WebCore::Layout::outputInlineRuns):
3316         (WebCore::Layout::outputLayoutBox):
3317         (WebCore::Layout::outputLayoutTree):
3318
3319 2018-10-19  Zalan Bujtas  <zalan@apple.com>
3320
3321         [LFC][IFC] Remove the previous version of inline content handling.
3322         https://bugs.webkit.org/show_bug.cgi?id=190716
3323
3324         Reviewed by Antti Koivisto.
3325
3326         * Sources.txt:
3327         * WebCore.xcodeproj/project.pbxproj:
3328         * layout/Verification.cpp:
3329         (WebCore::Layout::areEssentiallyEqual):
3330         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
3331         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
3332         * layout/inlineformatting/InlineFormattingState.h:
3333         (WebCore::Layout::InlineFormattingState::inlineContent):
3334         (WebCore::Layout::InlineFormattingState::addLayoutRuns): Deleted.
3335         (WebCore::Layout::InlineFormattingState::layoutRuns const): Deleted.
3336         * layout/inlineformatting/text/TextUtil.cpp: Renamed from Source/WebCore/layout/inlineformatting/textlayout/TextUtil.cpp.
3337         (WebCore::Layout::TextUtil::TextUtil):
3338         (WebCore::Layout::TextUtil::width const):
3339         (WebCore::Layout::TextUtil::hyphenPositionBefore const):
3340         (WebCore::Layout::TextUtil::textWidth const):
3341         (WebCore::Layout::TextUtil::fixedPitchWidth const):
3342         * layout/inlineformatting/text/TextUtil.h: Renamed from Source/WebCore/layout/inlineformatting/textlayout/TextUtil.h.
3343         * layout/inlineformatting/textlayout/Runs.h: Removed.
3344         * layout/inlineformatting/textlayout/TextContentProvider.cpp: Removed.
3345         * layout/inlineformatting/textlayout/TextContentProvider.h: Removed.
3346         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp: Removed.
3347         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h: Removed.
3348         * layout/inlineformatting/textlayout/simple/SimpleTextRunGenerator.cpp: Removed.
3349         * layout/inlineformatting/textlayout/simple/SimpleTextRunGenerator.h: Removed.
3350
3351 2018-10-19  Zalan Bujtas  <zalan@apple.com>
3352
3353         [LFC][IFC] Add generic inline content handling.
3354         https://bugs.webkit.org/show_bug.cgi?id=190713
3355
3356         Reviewed by Antti Koivisto.
3357
3358         layoutInlineContent turns InlineLineBreaker::Run objects into final inline runs by
3359         resolving heading/trailing whitespace, aligment, expansion opportunities etc.
3360         These inline run