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