6515e70cd8b2c0eea852f1fae377b7606465f985
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-05-25  Simon Fraser  <simon.fraser@apple.com>
2
3         [macOS] Fix programmatic scroll in RTL overflow with async scrolling enabled
4         https://bugs.webkit.org/show_bug.cgi?id=198226
5
6         Reviewed by Antti Koivisto.
7
8         On macOS we need to use a scroll offset to set the layer position, not
9         a scroll position.
10
11         Test: scrollingcoordinator/mac/rtl-programmatic-overflow-scroll.html
12
13         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
14         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
15
16 2019-05-24  Joonghun Park  <jh718.park@samsung.com>
17
18         Make computed width of non-replaced inline return computed style.
19         https://bugs.webkit.org/show_bug.cgi?id=197814
20
21         Reviewed by Antti Koivisto.
22
23         Currently, Computed width of non-replaced inline incorrectly returns "auto"
24         instead of the computed value.
25         This patch changes the behavior according to
26         https://drafts.csswg.org/cssom/#resolved-value as below.
27
28         'If the property applies to the element or pseudo-element
29         and the resolved value of the display property is not none or contents,
30         then the resolved value is the used value.
31         Otherwise the resolved value is the computed value.'
32
33         * css/CSSComputedStyleDeclaration.cpp:
34         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
35
36 2019-05-24  Myles C. Maxfield  <mmaxfield@apple.com>
37
38         [WHLSL] Allow vertex attributes to have arbitrary names in the shader
39         https://bugs.webkit.org/show_bug.cgi?id=198235
40
41         Reviewed by Dean Jackson and Justin Fan.
42
43         Metal doesn't allow arbitrary vertex attribute IDs. If you try to create a vertex attribute > 16,
44         the Metal validation layer will assert. So, we need to have a mapping from whatever the WebGPU
45         API says the vertex attribute IDs should be to the internally-used vertex attribute IDs.
46
47         Test: webgpu/whlsl-arbitrary-vertex-attribute-locations.html
48
49         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
50         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding):
51         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
52         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
53         (WebCore::WHLSL::matchVertexAttributes):
54         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
55         (WebCore::convertRenderPipelineDescriptor):
56         (WebCore::trySetInputStateForPipelineDescriptor):
57
58 2019-05-24  Timothy Hatcher  <timothy@apple.com>
59
60         Refactor how showLetterpressedGlyphsWithAdvances gets the graphics context.
61         https://bugs.webkit.org/show_bug.cgi?id=198225
62
63         Reviewed by Dean Jackson.
64
65         * platform/graphics/cocoa/FontCascadeCocoa.mm:
66         (WebCore::showLetterpressedGlyphsWithAdvances):
67         (WebCore::FontCascade::drawGlyphs):
68
69 2019-05-24  Timothy Hatcher  <timothy@apple.com>
70
71         Plumb dark appearance down to GraphicsContext.
72         https://bugs.webkit.org/show_bug.cgi?id=198224
73         rdar://problem/51068494
74
75         Reviewed by Dean Jackson.
76
77         No test yet, as it is not testable until this gets used.
78
79         * platform/graphics/GraphicsContext.cpp:
80         (WebCore::GraphicsContextStateChange::changesFromState const):
81         (WebCore::GraphicsContextStateChange::accumulate):
82         (WebCore::GraphicsContextStateChange::apply const):
83         (WebCore::GraphicsContextStateChange::dump const):
84         (WebCore::GraphicsContext::setUseDarkAppearance):
85         * platform/graphics/GraphicsContext.h:
86         (WebCore::GraphicsContext::useDarkAppearance const):
87         * rendering/TextPaintStyle.cpp:
88         (WebCore::TextPaintStyle::operator== const):
89         (WebCore::computeTextPaintStyle):
90         (WebCore::updateGraphicsContext):
91         * rendering/TextPaintStyle.h:
92
93 2019-05-24  Youenn Fablet  <youenn@apple.com>
94
95         Make sure completion handler is always called in SWServer::startSuspension
96         https://bugs.webkit.org/show_bug.cgi?id=198215
97
98         Reviewed by Alex Christensen.
99
100         * workers/service/server/SWServer.cpp:
101         (WebCore::SWServer::startSuspension):
102         Make sure completion handler is called in case of no registration store.
103
104 2019-05-24  Ryosuke Niwa  <rniwa@webkit.org>
105
106         Asssertion failure in dispatchSubtreeModifiedEvent due to TextFieldInputType updating UA shadow tree inside Element::removedFromAncestor
107         https://bugs.webkit.org/show_bug.cgi?id=198216
108
109         Reviewed by Brent Fulgham.
110
111         The bug was caused by ListAttributeTargetObserver::idTargetChanged() updating the shadow tree of an input element
112         within Element::removedFromAncestor via TextFieldInputType::createDataListDropdownIndicator(). Fixed it by
113         supressing the assertions with ScriptDisallowedScope::EventAllowedScope since it's always safe to update
114         UA shadow trees of input elements as it's not exposed to author scripts.
115
116         Avoiding the creation of dropdown indicator in this particular scenario is a lot more involved and it's not
117         particularly correct because there could be another datalist element which matches the ID specified in list
118         content attribute after the removal of the old datalist element.
119
120         Test: fast/forms/datalist/datalist-removal-assertion.html
121
122         * html/TextFieldInputType.cpp:
123         (WebCore::TextFieldInputType::createDataListDropdownIndicator):
124         (WebCore::TextFieldInputType::createContainer):
125         * html/shadow/DataListButtonElement.cpp:
126         (WebCore::DataListButtonElement::DataListButtonElement):
127
128 2019-05-24  Saam barati  <sbarati@apple.com>
129
130         [WHLSL] ReadModifyWriteExpression always has a result and new value expression
131         https://bugs.webkit.org/show_bug.cgi?id=198079
132
133         Reviewed by Myles Maxfield.
134
135         Let's not pretend it might not.
136
137         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
138         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
139         (WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
140         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValueExpression):
141         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeResultExpression):
142         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
143         (WebCore::WHLSL::ASTDumper::visit):
144         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
145         (WebCore::WHLSL::Checker::visit):
146         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
147         (WebCore::WHLSL::PropertyResolver::visit):
148         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
149         (WebCore::WHLSL::Visitor::visit):
150
151 2019-05-23  Simon Fraser  <simon.fraser@apple.com>
152
153         With async overflow scrolling, programmatic scroll to a negative offset fails to clamp the scroll offset
154         https://bugs.webkit.org/show_bug.cgi?id=198208
155         <rdar://problem/49720087>
156
157         Reviewed by Zalan Bujtas.
158
159         RenderLayer::scrollToOffset() needs to pass the clamped offset to scrollingCoordinator->requestScrollPositionUpdate(),
160         otherwise the scrolling tree will round-trip a negative value and scrollLeft will end up negative.
161
162         Test: fast/scrolling/programmatic-scroll-to-negative-offset.html
163
164         * rendering/RenderLayer.cpp:
165         (WebCore::RenderLayer::scrollToOffset):
166
167 2019-05-23  Devin Rousso  <drousso@apple.com>
168
169         Web Inspector: Overlay: rulers/guides should be shown whenever element selection is enabled
170         https://bugs.webkit.org/show_bug.cgi?id=198088
171
172         Reviewed by Timothy Hatcher.
173
174         When trying to "measure" the absolute position (to the viewport) or relative position (to
175         another element) of a given element, often the easiest way is to enable Element Selection
176         and Show Rulers at the same time.
177
178         This can have the undesired "side-effect" of having the rulers be always present, even when
179         not highlighting any nodes.
180
181         The ideal functionality is to allow the rulers/guides to be shown when element selection is
182         active and a node is hovered, regardless of whether "Show Rulers" is enabled.
183
184         * inspector/InspectorOverlay.h:
185         (WebCore::InspectorOverlay::setShowRulersDuringElementSelection): Added.
186         * inspector/InspectorOverlay.cpp:
187         (WebCore::InspectorOverlay::paint):
188         (WebCore::InspectorOverlay::shouldShowOverlay):
189         (WebCore::InspectorOverlay::drawNodeHighlight):
190         (WebCore::InspectorOverlay::drawQuadHighlight):
191         (WebCore::InspectorOverlay::drawElementTitle):
192         If `showRulersDuringElementSelection` is enabled, draw rulers whenever any highlight bounds
193         are calculated, but don't update the overlay if it's the only thing enabled (e.g. if there's
194         no currently hovered node, the overlay will disappear).
195
196         * inspector/agents/InspectorDOMAgent.cpp:
197         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
198         (WebCore::InspectorDOMAgent::inspect):
199         (WebCore::InspectorDOMAgent::setInspectModeEnabled):
200         (WebCore::InspectorDOMAgent::setSearchingForNode):
201         Add an optional `showRulers` parameter to `DOM.setInspectModeEnabled` that supersedes the
202         current value of `Page.setShowRulers` as to whether rulers/guides are shown.
203
204 2019-05-23  Devin Rousso  <drousso@apple.com>
205
206         Web Inspector: Overlay: rulers should switch sides if they intersect the highlighted node(s) so they don't obstruct any content
207         https://bugs.webkit.org/show_bug.cgi?id=198165
208
209         Reviewed by Timothy Hatcher.
210
211         If the highlighted node is against the top edge of the screen, the top ruler should shift to
212         the bottom, unless the highlighted node is also against the bottom edge of the screen.
213
214         If the highlighted node is against the left edge of the screen, the left ruler should shift
215         to the right, unless the highlighted node is also against the right edge of the screen.
216
217         This way, unless the node is very wide/tall, the rulers won't be drawn on top of anything
218         being highlighted.
219
220         * inspector/InspectorOverlay.h:
221         * inspector/InspectorOverlay.cpp:
222         (WebCore::InspectorOverlay::paint):
223         (WebCore::InspectorOverlay::drawNodeHighlight):
224         (WebCore::InspectorOverlay::drawQuadHighlight):
225         (WebCore::InspectorOverlay::drawBounds):
226         (WebCore::InspectorOverlay::drawRulers):
227         Drive-by: create an alias for the type (`FloatRect`) used when calculating the bounds of
228                   everything that's highlighted.
229
230 2019-05-23  Saam barati  <sbarati@apple.com>
231
232         [WHLSL] Make the AST dumper disambiguate expressions using parenthesis to represent AST construction
233         https://bugs.webkit.org/show_bug.cgi?id=198199
234
235         Reviewed by Myles C. Maxfield.
236
237         We would dump "*foo.bar" for "(*foo).bar", which is super confusing.
238         We now dump "(*foo).bar".
239
240         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
241         (WebCore::WHLSL::ASTDumper::visit):
242
243 2019-05-23  Saam barati  <sbarati@apple.com>
244
245         [WHLSL] Don't wrap anonymous variables in parens in the AST dumper
246         https://bugs.webkit.org/show_bug.cgi?id=198196
247
248         Reviewed by Myles C. Maxfield.
249
250         This makes the dump of 'foo.bar.x = 42' go from
251         ($(0x7f86d9d94440) = &foo, $(0x7f86d9d944e0) = operator.bar(*$(0x7f86d9d94440)), $(0x7f86d9d944e0) = operator.x=($(0x7f86d9d944e0), 42), *$(0x7f86d9d94440) = operator.bar=(*$(0x7f86d9d94440), $(0x7f86d9d944e0)));
252         
253         to:
254         ($0x7f86d9d94440 = &foo, $0x7f86d9d944e0 = operator.bar(*$0x7f86d9d94440), $0x7f86d9d944e0 = operator.x=($0x7f86d9d944e0, 42), *$0x7f86d9d94440 = operator.bar=(*$0x7f86d9d94440, $0x7f86d9d944e0));
255
256         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
257         (WebCore::WHLSL::ASTDumper::visit):
258
259 2019-05-23  Myles C. Maxfield  <mmaxfield@apple.com>
260
261         [WHLSL] Implement property resolver
262         https://bugs.webkit.org/show_bug.cgi?id=195925
263         <rdar://problem/48219643>
264
265         Unreviewed watchOS build fix.
266
267         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
268         (WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
269
270 2019-05-23  Saam barati  <sbarati@apple.com>
271
272         [WHLSL] Property resolver needs to recurse to handle the base when simplifying rvalues
273         https://bugs.webkit.org/show_bug.cgi?id=198193
274
275         Reviewed by Myles Maxfield.
276
277         We were only transforming the top most node in the AST. So things like
278         'x = foo.bar' would work, but 'x = foo.bar.baz' would not.
279
280         Test: webgpu/whlsl-nested-dot-expression-rvalue.html
281
282         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
283         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
284
285 2019-05-22  Stephanie Lewis  <slewis@apple.com>
286
287         release builds of webkit cannot be used to generate a dyld shared cache
288         https://bugs.webkit.org/show_bug.cgi?id=198150
289         <rdar://problem/50675982>
290
291         Reviewed by Dan Bernstein.
292
293         Restrict the -not_for_dyld_shared_cache linker flag to macosx
294
295         * Configurations/WebCore.xcconfig:
296
297 2019-05-23  Zalan Bujtas  <zalan@apple.com>
298
299         [Hittest] Move hittesting from RenderView to Document
300         https://bugs.webkit.org/show_bug.cgi?id=198192
301         <rdar://problem/51077762>
302
303         Reviewed by Antti Koivisto.
304
305         RenderView is not refcounted and may be destroyed in updateLayout(), so enter hit-testing from Document.
306
307         * accessibility/AccessibilityObject.cpp:
308         (WebCore::AccessibilityObject::press):
309         * accessibility/AccessibilityRenderObject.cpp:
310         (WebCore::AccessibilityRenderObject::visiblePositionForPoint const):
311         * dom/Document.cpp:
312         (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower):
313         (WebCore::FrameFlatteningLayoutDisallower::~FrameFlatteningLayoutDisallower):
314         (WebCore::Document::scheduleStyleRecalc):
315         (WebCore::Document::prepareMouseEvent):
316         (WebCore::Document::hitTest):
317         * dom/Document.h:
318         (WebCore::Document::inHitTesting const):
319         * dom/TreeScope.cpp:
320         (WebCore::TreeScope::nodeFromPoint):
321         (WebCore::TreeScope::elementsFromPoint):
322         * editing/FrameSelection.cpp:
323         (WebCore::FrameSelection::contains const):
324         * html/HTMLPlugInElement.cpp:
325         (WebCore::HTMLPlugInElement::isReplacementObscured):
326         * html/MediaElementSession.cpp:
327         (WebCore::isElementMainContentForPurposesOfAutoplay):
328         * page/DragController.cpp:
329         (WebCore::elementUnderMouse):
330         * page/EventHandler.cpp:
331         (WebCore::EventHandler::handleMouseDraggedEvent):
332         (WebCore::EventHandler::eventMayStartDrag const):
333         (WebCore::EventHandler::updateSelectionForMouseDrag):
334         (WebCore::EventHandler::hitTestResultAtPoint const):
335         (WebCore::EventHandler::updateCursor):
336         (WebCore::EventHandler::isInsideScrollbar const):
337         (WebCore::EventHandler::handleWheelEvent):
338         (WebCore::EventHandler::hoverTimerFired):
339         (WebCore::EventHandler::handleDrag):
340         (WebCore::hitTestResultInFrame):
341         * page/FrameViewLayoutContext.cpp:
342         (WebCore::FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange):
343         * rendering/RenderView.cpp:
344         (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): Deleted.
345         (WebCore::FrameFlatteningLayoutDisallower::~FrameFlatteningLayoutDisallower): Deleted.
346         (): Deleted.
347         (WebCore::RenderView::hitTest): Deleted.
348         * rendering/RenderView.h:
349         * rendering/RenderWidget.cpp:
350         (WebCore::RenderWidget::nodeAtPoint):
351         * testing/Internals.cpp:
352         (WebCore::Internals::nodesFromRect const):
353
354 2019-05-23  Youenn Fablet  <youenn@apple.com>
355
356         CacheStorageConnection callbacks should be completed on network connection close
357         https://bugs.webkit.org/show_bug.cgi?id=195757
358
359         Reviewed by Alex Christensen.
360
361         Move HashMap-based callbacks to WorkerCacheStorageConnection.
362         Make CacheStorageConnection default API to implement use callbacks.
363         This is used by WebKit layer to do AsyncReply IPC.
364
365         Move DOMCacheEngine callbacks to CompletionHandler.
366
367         Test: http/wpt/cache-storage/cache-storage-networkprocess-crash.html
368
369         * Modules/cache/CacheStorageConnection.cpp:
370         * Modules/cache/CacheStorageConnection.h:
371         (WebCore::CacheStorageConnection::engineRepresentation):
372         * Modules/cache/DOMCacheEngine.h:
373         * Modules/cache/WorkerCacheStorageConnection.cpp:
374         (WebCore::recordsDataFromRecords):
375         (WebCore::recordsDataOrErrorFromRecords):
376         (WebCore::recordsFromRecordsData):
377         (WebCore::recordsOrErrorFromRecordsData):
378         (WebCore::WorkerCacheStorageConnection::open):
379         (WebCore::WorkerCacheStorageConnection::openOrRemoveCompleted):
380         (WebCore::WorkerCacheStorageConnection::remove):
381         (WebCore::WorkerCacheStorageConnection::retrieveCaches):
382         (WebCore::WorkerCacheStorageConnection::retrieveCachesCompleted):
383         (WebCore::WorkerCacheStorageConnection::retrieveRecords):
384         (WebCore::WorkerCacheStorageConnection::retrieveRecordsCompleted):
385         (WebCore::WorkerCacheStorageConnection::batchDeleteOperation):
386         (WebCore::WorkerCacheStorageConnection::deleteRecordsCompleted):
387         (WebCore::WorkerCacheStorageConnection::batchPutOperation):
388         (WebCore::WorkerCacheStorageConnection::putRecordsCompleted):
389         (WebCore::WorkerCacheStorageConnection::reference):
390         (WebCore::WorkerCacheStorageConnection::dereference):
391         (WebCore::WorkerCacheStorageConnection::clearPendingRequests):
392         * Modules/cache/WorkerCacheStorageConnection.h:
393         * page/CacheStorageProvider.h:
394         (WebCore::CacheStorageProvider::createCacheStorageConnection):
395
396 2019-05-23  Youenn Fablet  <youenn@apple.com>
397
398         Multiple videos (with audios) with autoplay & playinline not working. Only one video play at a time.
399         https://bugs.webkit.org/show_bug.cgi?id=193312
400         <rdar://problem/47189864>
401
402         Reviewed by Jer Noble.
403
404         Allow all MediaStream backed video elements to play together.
405         Any non MediaStream backed video will stop all MediaStream backed video elements.
406         Conversely, all non MediaStream backed videos will stop when playing one MediaStream backed video.
407
408         Refactor PlatformMediaSessionManager as the way to iterate through sessions
409         is not safe when pausing a session: if playing, the session will be moved in the array of sessions.
410
411         To handle this, copy the list of sessions before iterating through them.
412         For extra safety, make sessions WeakPtr.
413
414         Add routines for the case of filtering with a predicate taking a const session.
415         In that case, we do not copy the vector but iterate through it as a small optimization.
416
417         Test: webrtc/concurrentVideoPlayback.html
418
419         * html/HTMLMediaElement.cpp:
420         (WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager):
421         (WebCore::HTMLMediaElement::hasMediaStreamSource const):
422         * html/HTMLMediaElement.h:
423         * platform/audio/PlatformMediaSession.cpp:
424         (WebCore::PlatformMediaSession::activeAudioSessionRequired const):
425         (WebCore::PlatformMediaSession::canPlayConcurrently const):
426         (WebCore::PlatformMediaSession::activeAudioSessionRequired): Deleted.
427         * platform/audio/PlatformMediaSession.h:
428         (WebCore::PlatformMediaSessionClient::hasMediaStreamSource const):
429         * platform/audio/PlatformMediaSessionManager.cpp:
430         (WebCore::PlatformMediaSessionManager::has const):
431         (WebCore::PlatformMediaSessionManager::activeAudioSessionRequired const):
432         (WebCore::PlatformMediaSessionManager::canProduceAudio const):
433         (WebCore::PlatformMediaSessionManager::count const):
434         (WebCore::PlatformMediaSessionManager::beginInterruption):
435         (WebCore::PlatformMediaSessionManager::endInterruption):
436         (WebCore::PlatformMediaSessionManager::addSession):
437         (WebCore::PlatformMediaSessionManager::removeSession):
438         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
439         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
440         (WebCore::PlatformMediaSessionManager::setCurrentSession):
441         (WebCore::PlatformMediaSessionManager::currentSession const):
442         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive):
443         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive):
444         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground):
445         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground):
446         (WebCore::PlatformMediaSessionManager::systemWillSleep):
447         (WebCore::PlatformMediaSessionManager::systemDidWake):
448         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument):
449         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess):
450         (WebCore::PlatformMediaSessionManager::suspendAllMediaPlaybackForDocument):
451         (WebCore::PlatformMediaSessionManager::resumeAllMediaPlaybackForDocument):
452         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
453         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
454         (WebCore::PlatformMediaSessionManager::currentSessionsMatching const):
455         (WebCore::PlatformMediaSessionManager::forEachMatchingSession):
456         (WebCore::PlatformMediaSessionManager::forEachMatchingSession const):
457         (WebCore::PlatformMediaSessionManager::forEachSession):
458         (WebCore::PlatformMediaSessionManager::anyOfSessions const):
459         (): Deleted.
460         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const): Deleted.
461         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const): Deleted.
462         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const): Deleted.
463         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const): Deleted.
464         (WebCore::PlatformMediaSessionManager::forEachSession const): Deleted.
465         (WebCore::PlatformMediaSessionManager::findSession const): Deleted.
466         * platform/audio/PlatformMediaSessionManager.h:
467         (WebCore::PlatformMediaSessionManager::anyOfSessions const): Deleted.
468         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
469         (MediaSessionManagerCocoa::updateSessionState):
470         (MediaSessionManagerCocoa::beginInterruption):
471         * platform/audio/ios/MediaSessionManagerIOS.mm:
472         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
473         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
474
475 2019-05-23  Saam barati  <sbarati@apple.com>
476
477         [WHLSL] Add a helper for in-place AST mutation
478         https://bugs.webkit.org/show_bug.cgi?id=198175
479
480         Reviewed by Myles Maxfield.
481
482         This makes WHLSL AST mutation code a bit easier to read and write.
483         
484         Code that looked like:
485         ```
486         static_assert(sizeof(AST::DereferenceExpression) <= sizeof(AST::DotExpression), "Dot expressions need to be able to become dereference expressions without updating backreferences");
487         void* location = &dotExpression;
488         dotExpression.~DotExpression();
489         auto* dereferenceExpression = new (location) AST::DereferenceExpression(WTFMove(origin), WTFMove(callExpression));
490         ```
491         
492         Can now be:
493         ```
494         auto* dereferenceExpression = AST::replaceWith<AST::DereferenceExpression>(dotExpression, WTFMove(origin), WTFMove(callExpression));
495         ```
496
497         * Modules/webgpu/WHLSL/AST/WHLSLNode.h:
498         (WebCore::WHLSL::AST::replaceWith):
499         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
500         (WebCore::WHLSL::NameResolver::visit):
501         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
502         (WebCore::WHLSL::PropertyResolver::visit):
503         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
504         (WebCore::WHLSL::LeftValueSimplifier::visit):
505
506 2019-05-23  Eric Carlson  <eric.carlson@apple.com>
507
508         [macOS,iOS] Add always-on logging for AVPlayerTimeControlStatus changes
509         https://bugs.webkit.org/show_bug.cgi?id=197946
510         <rdar://problem/50627457>
511
512         Reviewed by Jon Lee.
513
514         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
515         (WebCore::convertEnumerationToString):
516         (WTF::LogArgument<AVPlayerTimeControlStatus>::toString):
517         (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
518
519 2019-05-23  Antoine Quint  <graouts@apple.com>
520
521         [Pointer Events] Compatibility mouse events can only be prevented while the pointer is pressed
522         https://bugs.webkit.org/show_bug.cgi?id=198178
523
524         Reviewed by Dean Jackson.
525
526         Test: pointerevents/mouse/compatibility-mouse-events-prevention-mouse-released.html
527
528         The Pointer Events spec, in https://www.w3.org/TR/pointerevents/#compatibility-mapping-with-mouse-events, says that "Mouse events
529         can only be prevented when the pointer is down. Hovering pointers (e.g. a mouse with no buttons pressed) cannot have their mouse
530         events prevented." We now track whether the pointer is pressed and clear the preventsCompatibilityMouseEvents when the pointer is
531         moved and it is not pressed.
532
533         * page/PointerCaptureController.cpp:
534         (WebCore::PointerCaptureController::pointerEventWasDispatched):
535         * page/PointerCaptureController.h:
536
537 2019-05-23  Simon Fraser  <simon.fraser@apple.com>
538
539         Build fix after r245695.
540
541         * dom/Element.cpp:
542
543 2019-05-23  Antoine Quint  <graouts@apple.com>
544
545         [Pointer Events] The mouseover, mouseout, mouseenter, and mouseleave events should not be prevented while the pointer is down
546         https://bugs.webkit.org/show_bug.cgi?id=198177
547
548         Reviewed by Dean Jackson.
549
550         Test: pointerevents/mouse/compatibility-mouse-events-prevention-mouse-pressed.html
551
552         The Pointer Event spec, in https://www.w3.org/TR/pointerevents/#compatibility-mapping-with-mouse-events, says that "the mouseover,
553         mouseout, mouseenter, and mouseleave events are never prevented (even if the pointer is down)." We add a new static function which
554         indicates what is "compatibility" mouse event since those should be excluded, along with "click", which we already excluded.
555
556         * dom/Element.cpp:
557         (WebCore::isCompatibilityMouseEvent):
558         (WebCore::Element::dispatchMouseEvent):
559
560 2019-05-23  Jon Davis  <jond@apple.com>
561
562         Update feature status for shipped features
563         https://bugs.webkit.org/show_bug.cgi?id=196783
564
565         Reviewed by Timothy Hatcher.
566         
567         Updated feature status for Beacon API, CSS Text Decoration Level 4, Intersection Observer,
568         Conic Gradients, Datalist Element, and Web Share.
569
570         * features.json:
571
572 2019-05-23  Simon Fraser  <simon.fraser@apple.com>
573
574         Create scrolling tree nodes for descendants of position:absolute inside stacking-context overflow
575         https://bugs.webkit.org/show_bug.cgi?id=198154
576
577         Reviewed by Antti Koivisto.
578         
579         There exists code that creates scrolling tree nodes for position:absolute when the containing block
580         chain skips an enclosing scroller, but the compositing ancestor tree includes the scroller. However
581         this code explicitly checked that the layer was position:absolute.
582
583         This needed to be generalized for any layer whose containing block ancestor chain includes
584         a position:absolute that skips the scroller, for example a transformed inside a position:absolute,
585         so remove an explicit isAbsolutelyPositioned() check and some similar assertions.
586
587         Test: scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html
588
589         * rendering/RenderLayerCompositor.cpp:
590         (WebCore::collectStationaryLayerRelatedOverflowNodes):
591         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
592         (WebCore::collectRelatedCoordinatedScrollingNodes):
593
594 2019-05-23  Adrian Perez de Castro  <aperez@igalia.com>
595
596         Fix a few missing header inclusions often masked by by unified sources
597         https://bugs.webkit.org/show_bug.cgi?id=198180
598
599         Reviewed by Eric Carlson.
600
601         * editing/markup.h: Add missing "FloatSize.h" inclusion.
602         * html/FeaturePolicy.cpp: Add missing "HTMLParserIdioms.h" inclusion.
603         * platform/text/TextCodec.cpp: Add missing <cstdio> inclusion.
604
605 2019-05-23  Myles C. Maxfield  <mmaxfield@apple.com>
606
607         [WHLSL] Implement property resolver
608         https://bugs.webkit.org/show_bug.cgi?id=195925
609         <rdar://problem/48219643>
610
611         Reviewed by Saam Barati and Robin Morisset.
612
613         The property resolver is the thing that replaces dot expressions, index expressions, and
614         read-modify-write expressions with calls to getters, setters, and anders. This patch doesn't
615         fully implement the property resolver, but implements enough for simple dot expressions to
616         work. This is enough for us to be able to test most of the rest of the compiler. Index
617         expressions and read-modify-write expressions are not fully included in this patch, and will
618         be finished in a follow-up patch.
619
620         The property resolver may introduce anonymous variables in various places. In order to do
621         this, after the property resolver runs, it will insert all these anonymous variables in the
622         beginning of the function. However, this means that entries in the VariableDeclarations
623         vector will all shift, which means VariableDeclarations have to be allocated on the heap so
624         backreferences to them stay valid. This patch moves the storage associated with these values
625         to living directly in the vector's storage to living in heap storage (via filling the vector
626         with UniqueRefs).
627
628         This patch also adds the third concept of value-ness. We now have right values, left values,
629         and abstract left values (for things which have setters but have no address). This addition
630         is required for the analysis the property resolver performs. This concept is also present in
631         the spec.
632
633         Test: webgpu/whlsl-dot-expressions.html
634
635         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
636         (WebCore::WHLSL::AST::TypeAnnotation::TypeAnnotation):
637         (WebCore::WHLSL::AST::TypeAnnotation::leftAddressSpace const):
638         (WebCore::WHLSL::AST::TypeAnnotation::isRightValue const):
639         (WebCore::WHLSL::AST::TypeAnnotation::visit):
640         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
641         (WebCore::WHLSL::AST::AssignmentExpression::takeRight):
642         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
643         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
644         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
645         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
646         (WebCore::WHLSL::AST::Expression::maybeResolvedType):
647         (WebCore::WHLSL::AST::Expression::resolvedType):
648         (WebCore::WHLSL::AST::Expression::maybeTypeAnnotation const):
649         (WebCore::WHLSL::AST::Expression::typeAnnotation const):
650         (WebCore::WHLSL::AST::Expression::setTypeAnnotation):
651         (WebCore::WHLSL::AST::Expression::addressSpace const): Deleted.
652         (WebCore::WHLSL::AST::Expression::setAddressSpace): Deleted.
653         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
654         (WebCore::WHLSL::AST::FloatLiteral::clone const):
655         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
656         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp:
657         (WebCore::WHLSL::AST::IntegerLiteral::valueForSelectedType const):
658         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
659         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
660         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
661         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
662         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::leftValue):
663         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue): Deleted.
664         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
665         (WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
666         (WebCore::WHLSL::AST::MakePointerExpression::leftValue):
667         (WebCore::WHLSL::AST::MakePointerExpression::lValue): Deleted.
668         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
669         (WebCore::WHLSL::AST::NullLiteral::clone const):
670         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
671         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetterOverloads):
672         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetterOverloads):
673         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleAnderOverloads):
674         (WebCore::WHLSL::AST::PropertyAccessExpression::getterFunction):
675         (WebCore::WHLSL::AST::PropertyAccessExpression::anderFunction):
676         (WebCore::WHLSL::AST::PropertyAccessExpression::threadAnderFunction):
677         (WebCore::WHLSL::AST::PropertyAccessExpression::setterFunction):
678         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetterOverloads):
679         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAnderOverloads):
680         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetterOverloads):
681         (WebCore::WHLSL::AST::PropertyAccessExpression::setGetterFunction):
682         (WebCore::WHLSL::AST::PropertyAccessExpression::setAnderFunction):
683         (WebCore::WHLSL::AST::PropertyAccessExpression::setThreadAnderFunction):
684         (WebCore::WHLSL::AST::PropertyAccessExpression::setSetterFunction):
685         (WebCore::WHLSL::AST::PropertyAccessExpression::takeBase):
686         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetOverloads): Deleted.
687         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetOverloads): Deleted.
688         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleAndOverloads): Deleted.
689         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetOverloads): Deleted.
690         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetOverloads): Deleted.
691         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAndOverloads): Deleted.
692         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
693         (WebCore::WHLSL::AST::ReadModifyWriteExpression::oldVariableReference):
694         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newVariableReference):
695         (WebCore::WHLSL::AST::ReadModifyWriteExpression::leftValue):
696         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeLeftValue):
697         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeOldValue):
698         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValue):
699         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValueExpression):
700         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeResultExpression):
701         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
702         (WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue): Deleted.
703         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
704         (WebCore::WHLSL::AST::ResolvableType::maybeResolvedType const):
705         (WebCore::WHLSL::AST::ResolvableType::resolvedType const):
706         (WebCore::WHLSL::AST::ResolvableType::maybeResolvedType):
707         (WebCore::WHLSL::AST::ResolvableType::resolvedType):
708         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
709         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
710         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
711         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
712         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
713         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
714         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
715         (WebCore::WHLSL::AST::StructureDefinition::find):
716         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
717         (WebCore::WHLSL::AST::TypeReference::maybeResolvedType const):
718         (WebCore::WHLSL::AST::TypeReference::resolvedType const):
719         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp:
720         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::valueForSelectedType const):
721         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
722         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
723         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
724         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
725         (WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
726         (WebCore::WHLSL::AST::VariableDeclarationsStatement::variableDeclarations):
727         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
728         (WebCore::WHLSL::Metal::attributeForSemantic):
729         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath):
730         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
731         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
732         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack):
733         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
734         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::visit):
735         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
736         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
737         (WebCore::WHLSL::Metal::writeNativeFunction):
738         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
739         (WebCore::WHLSL::Metal::writeNativeType):
740         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
741         (WebCore::WHLSL::Metal::findInVector):
742         (WebCore::WHLSL::Metal::TypeNamer::visit):
743         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
744         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
745         (WebCore::WHLSL::ASTDumper::visit):
746         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
747         (WebCore::WHLSL::checkDuplicateFunctions):
748         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
749         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
750         (WebCore::WHLSL::resolveWithOperatorLength):
751         (WebCore::WHLSL::resolveWithReferenceComparator):
752         (WebCore::WHLSL::resolveByInstantiation):
753         (WebCore::WHLSL::checkOperatorOverload):
754         (WebCore::WHLSL::Checker::assignTypes):
755         (WebCore::WHLSL::commit):
756         (WebCore::WHLSL::Checker::visit):
757         (WebCore::WHLSL::Checker::recurseAndGetInfo):
758         (WebCore::WHLSL::Checker::getInfo):
759         (WebCore::WHLSL::Checker::assignType):
760         (WebCore::WHLSL::Checker::forwardType):
761         (WebCore::WHLSL::getUnnamedType):
762         (WebCore::WHLSL::Checker::finishVisitingPropertyAccess): Deleted.
763         (WebCore::WHLSL::Checker::recurseAndWrapBaseType): Deleted.
764         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
765         (WebCore::WHLSL::Gatherer::takeEntryPointItems):
766         (WebCore::WHLSL::Gatherer::visit):
767         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
768         (WebCore::WHLSL::matchAndCommit):
769         (WebCore::WHLSL::commit):
770         (WebCore::WHLSL::inferTypesForCall):
771         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:
772         (WebCore::WHLSL::getNativeTypeDeclaration):
773         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
774         (WebCore::WHLSL::NameResolver::visit):
775         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
776         (WebCore::WHLSL::Parser::parseParameters):
777         (WebCore::WHLSL::Parser::parseVariableDeclarations):
778         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
779         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
780         (WebCore::WHLSL::prepareShared):
781         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
782         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: Added.
783         (WebCore::WHLSL::PropertyResolver::visit):
784         (WebCore::WHLSL::setterCall):
785         (WebCore::WHLSL::getterCall):
786         (WebCore::WHLSL::modify):
787         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
788         (WebCore::WHLSL::LeftValueSimplifier::visit):
789         (WebCore::WHLSL::PropertyResolver::simplifyLeftValue):
790         (WebCore::WHLSL::resolveProperties):
791         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h.
792         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
793         (WebCore::WHLSL::RecursiveTypeChecker::visit):
794         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
795         (WebCore::WHLSL::conversionCost):
796         * Modules/webgpu/WHLSL/WHLSLResolvingType.h:
797         (WebCore::WHLSL::ResolvingType::getUnnamedType):
798         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
799         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
800         (WebCore::WHLSL::FindArrayTypes::takeArrayTypes):
801         (WebCore::WHLSL::synthesizeArrayOperatorLength):
802         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
803         (WebCore::WHLSL::FindAllTypes::takeUnnamedTypes):
804         (WebCore::WHLSL::FindAllTypes::takeNamedTypes):
805         (WebCore::WHLSL::synthesizeConstructors):
806         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
807         (WebCore::WHLSL::synthesizeEnumerationFunctions):
808         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
809         (WebCore::WHLSL::synthesizeStructureAccessors):
810         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
811         (WebCore::WHLSL::Visitor::visit):
812         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
813         * Sources.txt:
814         * WebCore.xcodeproj/project.pbxproj:
815         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
816         (WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
817
818 2019-05-22  Myles C. Maxfield  <mmaxfield@apple.com>
819
820         font-optical-sizing applies the wrong variation value
821         https://bugs.webkit.org/show_bug.cgi?id=197528
822         <rdar://problem/50152854>
823
824         Reviewed by Antti Koivisto.
825
826         The OpenType spec says in
827         https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_opsz
828
829         "Scale interpretation: Values can be interpreted as text size, in points."
830
831         It turns out that it means "typographic point size" which is equal to CSS pixels, not
832         CSS points.
833
834         There are two parts of the font that are sensitive to optical sizing: variation values and
835         the trak table. We don't want to set the variation value directly because then the trak table
836         won't be affected. Instead, we can use kCTFontOpticalSizeAttribute to set both of them together.
837         We will only do this when the CSS says text-rendering:optimizeLegibility or when the font has
838         an opsz axis but no STAT table. Otherwise, we won't do anything special, which lets CoreText
839         handle the default behavior for us. This gives us the same default behavior as the rest of the
840         system.
841
842         Tests: fast/text/variations/optical-sizing-trak-2.html
843                fast/text/variations/optical-sizing-trak.html
844                fast/text/variations/optical-sizing-units-2.html
845                fast/text/variations/optical-sizing-units.html
846
847         * platform/graphics/cocoa/FontCacheCoreText.cpp:
848         (WebCore::FontType::FontType):
849         (WebCore::preparePlatformFont):
850         (WebCore::fontWithFamily):
851         (WebCore::FontCache::systemFallbackForCharacters):
852         * platform/graphics/cocoa/FontCacheCoreText.h:
853         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
854         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
855         * platform/graphics/mac/FontCustomPlatformData.cpp:
856         (WebCore::FontCustomPlatformData::fontPlatformData):
857
858 2019-05-22  Antti Koivisto  <antti@apple.com>
859
860         Subselectors not searched when determining property whitelist for selector
861         https://bugs.webkit.org/show_bug.cgi?id=198147
862         <rdar://problem/50405208>
863
864         Reviewed by Zalan Bujtas.
865
866         This can cause marker elements get style they shouldn't.
867
868         Test: fast/lists/marker-style-subselector-whitelist.html
869
870         * css/RuleSet.cpp:
871         (WebCore::determinePropertyWhitelistType):
872
873         Check subselectors too.
874
875 2019-05-22  Saam barati  <sbarati@apple.com>
876
877         WHLSL: fix enum parsing
878         https://bugs.webkit.org/show_bug.cgi?id=198087
879
880         Reviewed by Myles Maxfield.
881
882         This fixes two bugs:
883         
884         1. We were using a String by reference after moving the underlying owner of
885         the string. This would lead to the String becoming the empty value, and
886         crashing when used as a key in a hash map.
887         2. We were incorrectly producing a syntax error for enum declarations by
888         saying it's invalid if an enum value was added to a hash map for the first
889         time. This logic should be negated. We need to error when it's added for
890         the second time and onwards.
891
892         Test: webgpu/whlsl-dont-crash-parsing-enum.html
893
894         * Modules/webgpu/WHLSL/AST/WHLSLAST.h: Replaced.
895         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
896         (WebCore::WHLSL::AST::EnumerationDefinition::add):
897         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
898         (WebCore::WHLSL::AST::EnumerationMember::name):
899         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Replaced.
900         (WebCore::WHLSL::ASTDumper::visit):
901         * Modules/webgpu/WHLSL/WHLSLASTDumper.h: Replaced.
902
903 2019-05-22  Simon Fraser  <simon.fraser@apple.com>
904
905         Fix scrolling tree state for more obscure combinations of positioning and paint order
906         https://bugs.webkit.org/show_bug.cgi?id=198139
907
908         Reviewed by Antti Koivisto.
909
910         There were three places in RenderLayerCompositor that used a version of ancestor
911         layer traversal looking at containing blocks, and all three had issues. So make a
912         shared function to do the ancestor walk, and use it thrice.
913
914         isScrolledByOverflowScrollLayer() fumbled containingBlockCanSkipLayers, so failed
915         to create a scrolling tree node for a composited layer inside position:fixed in
916         overflow (tested by composited-in-absolute-in-overflow.html).
917
918         collectStationaryLayerRelatedOverflowNodes() failed to handle nested
919         overflow:scroll; it needs to find all the composited scrollers that affect the
920         position of the given layer relative to its compositing ancestor, which may be the
921         scroller, or a descendant of the scroller. However, it didn't walk up far enough
922         and find more that one ancestor. Tested by absolute-in-nested-sc-scrollers.html.
923
924         enclosingClippingScopes() was OK but now uses the share function.
925
926         Tests: scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers.html
927                scrollingcoordinator/scrolling-tree/composited-in-absolute-in-overflow.html
928
929         * rendering/RenderLayerCompositor.cpp:
930         (WebCore::traverseAncestorLayers):
931         (WebCore::enclosingClippingScopes):
932         (WebCore::isScrolledByOverflowScrollLayer):
933         (WebCore::collectStationaryLayerRelatedOverflowNodes):
934         (WebCore::collectRelatedCoordinatedScrollingNodes):
935
936 2019-05-22  Simon Fraser  <simon.fraser@apple.com>
937
938         Inner scroller of nested overflow:scrolls jitters when scrolling
939         https://bugs.webkit.org/show_bug.cgi?id=198131
940
941         Reviewed by Antti Koivisto.
942
943         enclosingCompositedScrollingLayer(layer) would return the layer itself, rather than
944         its scrolling ancestor, which meant that a composited scroller nested inside another
945         scroller would fail to get a "Moves" scrolling tree node, and therefore jitter
946         when scrolling.
947
948         Test: scrollingcoordinator/scrolling-tree/nested-overflow-scroll.html
949
950         * rendering/RenderLayerCompositor.cpp:
951         (WebCore::enclosingCompositedScrollingLayer):
952
953 2019-05-22  Ryan Haddad  <ryanhaddad@apple.com>
954
955         Unreviewed, rolling out r245598.
956
957         Breaks watchOS build.
958
959         Reverted changeset:
960
961         "font-optical-sizing applies the wrong variation value"
962         https://bugs.webkit.org/show_bug.cgi?id=197528
963         https://trac.webkit.org/changeset/245598
964
965 2019-05-22  Daniel Bates  <dabates@apple.com>
966
967         WebKit does not generate an ESC key event for CMD+.
968         https://bugs.webkit.org/show_bug.cgi?id=198137
969         <rdar://problem/51038641>
970
971         Reviewed by Brent Fulgham.
972
973         This patch maps the Command + '.' keystroke to the 'Escape'. This also requires a change to UIKit to properly pass
974         the key state to WebKit (see <rdar://problem/46431552>).
975
976         * platform/ios/WebEvent.mm:
977         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
978
979 2019-05-22  Ali Juma  <ajuma@chromium.org>
980
981         Intersection Observer: bounding client rect is wrong for an inline element
982         https://bugs.webkit.org/show_bug.cgi?id=198009
983
984         Reviewed by Simon Fraser.
985
986         Make target rect computation for inline elements share logic with the computation
987         of bounding client rects.
988
989         Test: imported/w3c/web-platform-tests/intersection-observer/inline-with-block-child-client-rect.html
990
991         * dom/Document.cpp:
992         (WebCore::computeIntersectionState):
993         * dom/Element.cpp:
994         (WebCore::Element::boundingAbsoluteRectWithoutLayout):
995         (WebCore::Element::boundingClientRect):
996         * dom/Element.h:
997
998 2019-05-22  Antoine Quint  <graouts@apple.com>
999
1000         [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
1001         https://bugs.webkit.org/show_bug.cgi?id=198124
1002         <rdar://problem/50410863>
1003
1004         Reviewed by Tim Horton.
1005
1006         This fix builds atop the one made for wkb.ug/198072 which fixes this bug on macOS alone.
1007
1008         In order to correctly prevent "compatibility" mouse events from being dispatched when the initial "pointerdown" event had preventDefault()
1009         called while handled, we need to pass the PointerID for the touch that triggered a tap gesture in the UI process down in the Web process
1010         and into the resulting PlatformMouseEvent. This will allow upon dispatch of a PlatformMouseEvent to call into PointerCaptureController
1011         to identify if the dispatch of mouse events is allowed for the event's PointerID.
1012
1013         To support this, some refactoring was required. The PointerID header is now under platform/ such that PlatformMouseEvent may safely use it.
1014         Additionally, PointerEvent::defaultMousePointerIdentifier() is now a global mousePointerID defined in PointerID.h.
1015
1016         Finally, PointerCaptureController::touchEndedOrWasCancelledForIdentifier() has been renamed to PointerCaptureController::touchWithIdentifierWasRemoved() and
1017         has WEBCORE_EXPORT such that it may be called from WebKit as the indication that a pointer is no longer active will now be initiated in WebKit
1018         on the UI process side.
1019
1020         Testing is covered by the pre-existing imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click.html
1021         which will now run on iOS through a change to WebKitAdditions.
1022
1023         * Headers.cmake:
1024         * WebCore.xcodeproj/project.pbxproj:
1025         * dom/Element.cpp:
1026         (WebCore::Element::dispatchMouseEvent): When dealing with a mouse event on iOS, check whether the mouse event's PointerID allows for compatibility
1027         mouse events to be dispatched using PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(). The "click" event is not a compatibility
1028         mouse event.
1029         * dom/PointerEvent.h:
1030         * page/PointerCaptureController.cpp:
1031         (WebCore::PointerCaptureController::PointerCaptureController):
1032         (WebCore::PointerCaptureController::touchWithIdentifierWasRemoved):
1033         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier): Deleted.
1034         * page/PointerCaptureController.h:
1035         * platform/PlatformMouseEvent.h:
1036         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1037         (WebCore::PlatformMouseEvent::pointerId const):
1038         * platform/PointerID.h: Renamed from Source/WebCore/dom/PointerID.h.
1039         (WebCore::mousePointerID):
1040
1041 2019-05-22  Jiewen Tan  <jiewen_tan@apple.com>
1042
1043         [WebAuthN] Support Attestation Conveyance Preference
1044         https://bugs.webkit.org/show_bug.cgi?id=192722
1045         <rdar://problem/49939647>
1046
1047         Reviewed by Brent Fulgham.
1048
1049         This patch implements https://www.w3.org/TR/webauthn/#enumdef-attestationconveyancepreference, together with
1050         Step 20 with regard to AttestationConveyancePreference of https://www.w3.org/TR/webauthn/#createCredential.
1051         Few notes with regard to Step 20: 1) We treat indirect attestation as direct attestation as we don't MITM
1052         the attestation process; 2) We won't distinguish self attestation and return it to keep consistency between
1053         the response and the request. If callers want none attestation, they will very likely ignore fmt and attStmt
1054         of the attestation object, and therefore it is meaningless to return self attestation.
1055
1056         Covered by new tests within existing files.
1057
1058         * CMakeLists.txt:
1059         * DerivedSources-input.xcfilelist:
1060         * DerivedSources-output.xcfilelist:
1061         * DerivedSources.make:
1062         * Headers.cmake:
1063         * Modules/webauthn/AttestationConveyancePreference.h: Copied from Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h.
1064         * Modules/webauthn/AttestationConveyancePreference.idl: Copied from Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h.
1065         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1066         (WebCore::PublicKeyCredentialCreationOptions::encode const):
1067         (WebCore::PublicKeyCredentialCreationOptions::decode):
1068         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
1069         * Modules/webauthn/WebAuthenticationConstants.h:
1070         * Modules/webauthn/WebAuthenticationUtils.cpp:
1071         (WebCore::buildAttestationObject):
1072         * Modules/webauthn/WebAuthenticationUtils.h:
1073         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
1074         (fido::readCTAPMakeCredentialResponse):
1075         * Modules/webauthn/fido/DeviceResponseConverter.h:
1076         * Modules/webauthn/fido/FidoConstants.h:
1077         noneAttestationValue is moved to WebAuthenticationConstants.h.
1078         * Modules/webauthn/fido/U2fResponseConverter.cpp:
1079         (fido::readU2fRegisterResponse):
1080         * Modules/webauthn/fido/U2fResponseConverter.h:
1081         * Sources.txt:
1082         * WebCore.xcodeproj/project.pbxproj:
1083
1084 2019-05-22  Zalan Bujtas  <zalan@apple.com>
1085
1086         [Paste] Add support for preferred presentation size when pasting an image
1087         https://bugs.webkit.org/show_bug.cgi?id=198132
1088         <rdar://problem/50886917>
1089
1090         Reviewed by Wenson Hsieh.
1091
1092         Set the pasted <img> width/height attributes when the preferred presentation size is available.
1093
1094         * editing/WebContentReader.h:
1095         * editing/cocoa/WebContentReaderCocoa.mm:
1096         (WebCore::createFragmentForImageAttachment):
1097         (WebCore::WebContentReader::readImage):
1098         * editing/markup.cpp:
1099         (WebCore::createFragmentForImageAndURL):
1100         * editing/markup.h:
1101         * platform/Pasteboard.h:
1102         (WebCore::PasteboardWebContentReader::readImage):
1103         * platform/PasteboardItemInfo.h:
1104         (WebCore::PasteboardItemInfo::encode const):
1105         (WebCore::PasteboardItemInfo::decode):
1106         * platform/ios/PasteboardIOS.mm:
1107         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
1108         (WebCore::Pasteboard::read):
1109         (WebCore::Pasteboard::readRespectingUTIFidelities):
1110         * platform/ios/PlatformPasteboardIOS.mm:
1111         (WebCore::PlatformPasteboard::informationForItemAtIndex):
1112
1113 2019-05-22  Jer Noble  <jer.noble@apple.com>
1114
1115         Hide MediaCapabilities.encodingInfo() when the platform does not support it.
1116         https://bugs.webkit.org/show_bug.cgi?id=197476
1117
1118         Reviewed by Eric Carlson.
1119
1120         Test: platform/mac/media/mediacapabilities/mediacapabilities-encodingInfo-undefined.html
1121
1122         Add a new IDL attribute, CustomEnabled, which allows non Settings-based enabling of attributes and objects.
1123
1124         * Modules/mediacapabilities/MediaCapabilities.idl:
1125         * WebCore.xcodeproj/project.pbxproj:
1126         * bindings/js/JSMediaCapabilitiesCustom.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaCapabilities.idl.
1127         (WebCore::JSMediaCapabilitiesEncodingInfoIsEnabled):
1128         * bindings/scripts/CodeGeneratorJS.pm:
1129         (NeedsRuntimeCheck):
1130         (GenerateRuntimeEnableConditionalString):
1131         * bindings/scripts/IDLAttributes.json:
1132         * bindings/scripts/preprocess-idls.pl:
1133         (GenerateConstructorAttributes):
1134         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
1135         (WebCore::MediaEngineConfigurationFactory::hasDecodingConfigurationFactory):
1136         (WebCore::MediaEngineConfigurationFactory::hasEncodingConfigurationFactory):
1137         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
1138
1139 2019-05-22  Youenn Fablet  <youenn@apple.com>
1140
1141         Implement Feature policy self/none/* parsing
1142         https://bugs.webkit.org/show_bug.cgi?id=198078
1143
1144         Reviewed by Eric Carlson.
1145
1146         Start to implement https://w3c.github.io/webappsec-feature-policy/#algo-parse-policy-directive
1147         'src' is not supported yet.
1148         Apply the rules to getUserMedia.
1149         Update getDisplayMedia keyword from 'display' to 'display-capture' as per spec.
1150
1151         Test: imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-feature-policy-none.https.html
1152
1153         * Headers.cmake:
1154         * Modules/mediastream/UserMediaController.cpp:
1155         (WebCore::isSecure):
1156         (WebCore::isAllowedByFeaturePolicy):
1157         (WebCore::isAllowedToUse):
1158         * Sources.txt:
1159         * WebCore.xcodeproj/project.pbxproj:
1160         * html/FeaturePolicy.cpp: Added.
1161         (WebCore::isAllowedByFeaturePolicy):
1162         (WebCore::processOriginItem):
1163         (WebCore::updateList):
1164         (WebCore::FeaturePolicy::parse):
1165         (WebCore::FeaturePolicy::allows const):
1166         * html/FeaturePolicy.h: Added.
1167         * html/HTMLIFrameElement.cpp:
1168         (WebCore::HTMLIFrameElement::featurePolicy const):
1169         * html/HTMLIFrameElement.h:
1170
1171 2019-05-21  Jer Noble  <jer.noble@apple.com>
1172
1173         Media controls don't show in WK2 video fullscreen sometimes
1174         https://bugs.webkit.org/show_bug.cgi?id=198094
1175         <rdar://problem/50970661>
1176
1177         Reviewed by Tim Horton.
1178
1179         Ensure that the WebAVPlayerLayer never allows hit testing, as this keeps touches from reaching
1180         AVKit's controls.
1181
1182         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1183         (-[WebAVPlayerLayer init]):
1184
1185 2019-05-21  Saam barati  <sbarati@apple.com>
1186
1187         WHLSL: Add an AST dumper
1188         https://bugs.webkit.org/show_bug.cgi?id=198059
1189
1190         Reviewed by Myles Maxfield.
1191
1192         This patch makes it so we can dump the WHLSL program's AST.
1193         This will become useful when we're debugging passes that
1194         transform the AST.
1195         
1196         The dumper mostly prints in a style where the dump is almost
1197         valid WHLSL code. E.g, this WHLSL program:
1198         ```
1199         int foo(int arg) {
1200             return arg + 1;
1201         }
1202         ```
1203         
1204         gets dumped as:
1205         ```
1206         int foo(int arg) {
1207            return operator+(arg, 1);
1208         }
1209         ```
1210         
1211         This patch also adds a way to dump between each pass, after
1212         parsing, or at the end of all passes. Currently, this is controlled
1213         by a static variable. I'll make these runtime configurable in a follow
1214         up: https://bugs.webkit.org/show_bug.cgi?id=198097
1215
1216         No new tests because this is used for logging.
1217
1218         * Modules/webgpu/WHLSL/AST/WHLSLAST.h: Added.
1219         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
1220         (WebCore::WHLSL::AST::toString):
1221         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
1222         (WebCore::WHLSL::AST::BuiltInSemantic::toString const):
1223         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
1224         (WebCore::WHLSL::AST::toString):
1225         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
1226         (WebCore::WHLSL::AST::ResourceSemantic::toString):
1227         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
1228         (WebCore::WHLSL::Metal::toString): Deleted.
1229         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Added.
1230         (WebCore::WHLSL::ASTDumper::visit):
1231         * Modules/webgpu/WHLSL/WHLSLASTDumper.h: Added.
1232         (WebCore::WHLSL::ASTDumper::toString):
1233         (WebCore::WHLSL::ASTDumper::Indent::Indent):
1234         (WebCore::WHLSL::ASTDumper::bumpIndent):
1235         (WebCore::WHLSL::toString):
1236         (WebCore::WHLSL::dumpAST):
1237         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
1238         (WebCore::WHLSL::dumpASTIfNeeded):
1239         (WebCore::WHLSL::dumpASTAfterParsingIfNeeded):
1240         (WebCore::WHLSL::dumpASTBetweenEachPassIfNeeded):
1241         (WebCore::WHLSL::dumpASTAtEndIfNeeded):
1242         (WebCore::WHLSL::prepareShared):
1243         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1244         * Sources.txt:
1245         * WebCore.xcodeproj/project.pbxproj:
1246
1247 2019-05-21  Saam barati  <sbarati@apple.com>
1248
1249         WHLSL: Parsing negative int literals parses the positive value instead
1250         https://bugs.webkit.org/show_bug.cgi?id=198096
1251
1252         Reviewed by Dean Jackson.
1253
1254         I also made the code around < INT_MIN a bit easier to follow along with.
1255
1256         No new tests because we haven't imported WHLSL test suite yet.
1257         Verified this works using the AST dumper.
1258
1259         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1260         (WebCore::WHLSL::intLiteralToInt):
1261
1262 2019-05-21  Myles C. Maxfield  <mmaxfield@apple.com>
1263
1264         font-optical-sizing applies the wrong variation value
1265         https://bugs.webkit.org/show_bug.cgi?id=197528
1266         <rdar://problem/50152854>
1267
1268         Reviewed by Antti Koivisto.
1269
1270         The OpenType spec says in
1271         https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_opsz
1272
1273         "Scale interpretation: Values can be interpreted as text size, in points."
1274
1275         It turns out that it means "typographic point size" which is equal to CSS pixels, not
1276         CSS points.
1277
1278         There are two parts of the font that are sensitive to optical sizing: variation values and
1279         the trak table. We don't want to set the variation value directly because then the trak table
1280         won't be affected. Instead, we can use kCTFontOpticalSizeAttribute to set both of them together.
1281         We will only do this when the CSS says text-rendering:optimizeLegibility or when the font has
1282         an opsz axis but no STAT table. Otherwise, we won't do anything special, which lets CoreText
1283         handle the default behavior for us. This gives us the same default behavior as the rest of the
1284         system.
1285
1286         Tests: fast/text/variations/optical-sizing-trak-2.html
1287                fast/text/variations/optical-sizing-trak.html
1288                fast/text/variations/optical-sizing-units.html
1289                fast/text/variations/optical-sizing-units-2.html
1290
1291         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1292         (WebCore::FontType::FontType):
1293         (WebCore::preparePlatformFont):
1294         (WebCore::fontWithFamily):
1295         (WebCore::FontCache::systemFallbackForCharacters):
1296         * platform/graphics/cocoa/FontCacheCoreText.h:
1297         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
1298         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
1299         * platform/graphics/mac/FontCustomPlatformData.cpp:
1300         (WebCore::FontCustomPlatformData::fontPlatformData):
1301
1302 2019-05-21  Simon Fraser  <simon.fraser@apple.com>
1303
1304         Layer flashing and poor perf during scrolling of message list on gmail.com and hotmail.com - overlap testing needs to constrained to clipping scopes
1305         https://bugs.webkit.org/show_bug.cgi?id=198091
1306         <rdar://problem/49403082>
1307
1308         Reviewed by Antti Koivisto.
1309         
1310         When overflow:scroll is scrolled asynchronously, we need to have already created compositing layers where necessary
1311         for clipped-out layers in the scrolled content so that we have something to reveal. We also have ensure
1312         that layers inside the scroller (but scrolled out of view) don't trigger overlap with layers outside the scroller.
1313         All this has to work when the containing block hierarchy (clipping/scrolling) doesn't match the paint order hierarchy (structure
1314         of the z-order and compositing trees).
1315
1316         Overlap testing previously simply used a list of rectangles per compositing container (OverlapMapContainer). This is
1317         a series of layer bounds, built up as we traver the layer tree in z-order. Layers contribute to container N-2, and test
1318         against container N-1.
1319         
1320         To handle overlap with non-stacking-context scrollers, introduce the concept of a ClippingScope, which encompasses
1321         a set of layers sharing the same composited-scrolling containing-block ancestor. Within a ClippingScope, layer bounds
1322         are computed unclipped. Between them, bounds are tested clipped.
1323         
1324         Conceptually, each OverlapMapContainer has a tree of ClippingScopes (reflecting the containing-block order tree of
1325         composited overflow scroll), and rects are added to the appropriate ClippingScope. This tree is currently always
1326         root-relative; the root node is the RenderView's RenderLayer, and will accumulate the bounds of layers not inside
1327         composited overflow scroll (just like the old code).
1328         
1329         When a OverlapMapContainer is popped, the list of rectangles in its ClippingScope tree is merged with that of the previous
1330         container.
1331
1332         Tests: compositing/layer-creation/clipping-scope/nested-scroller-overlap.html
1333                compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller.html
1334                compositing/layer-creation/clipping-scope/overlap-constrained-inside-stacking-context-scroller.html
1335                compositing/layer-creation/clipping-scope/scroller-with-negative-z-children.html
1336                compositing/layer-creation/clipping-scope/shared-layers-in-scroller.html
1337
1338         * rendering/LayerOverlapMap.cpp:
1339         (WebCore::operator<<):
1340         (WebCore::OverlapMapContainer::OverlapMapContainer):
1341         (WebCore::OverlapMapContainer::ClippingScope::ClippingScope):
1342         (WebCore::OverlapMapContainer::ClippingScope::childWithLayer const):
1343         (WebCore::OverlapMapContainer::ClippingScope::addChildWithLayerAndBounds):
1344         (WebCore::OverlapMapContainer::ClippingScope::addChild):
1345         (WebCore::OverlapMapContainer::ClippingScope::appendRect):
1346         (WebCore::OverlapMapContainer::clippingScopeContainingLayerChildRecursive):
1347         (WebCore::OverlapMapContainer::scopeContainingLayer const):
1348         (WebCore::OverlapMapContainer::rootScope const):
1349         (WebCore::OverlapMapContainer::rootScope):
1350         (WebCore::OverlapMapContainer::add):
1351         (WebCore::OverlapMapContainer::overlapsLayers const):
1352         (WebCore::OverlapMapContainer::mergeClippingScopesRecursive):
1353         (WebCore::OverlapMapContainer::append):
1354         (WebCore::OverlapMapContainer::ensureClippingScopeForLayers):
1355         (WebCore::OverlapMapContainer::findClippingScopeForLayers const):
1356         (WebCore::OverlapMapContainer::recursiveOutputToStream const):
1357         (WebCore::OverlapMapContainer::dump const):
1358         (WebCore::LayerOverlapMap::LayerOverlapMap):
1359         (WebCore::LayerOverlapMap::add):
1360         (WebCore::LayerOverlapMap::overlapsLayers const):
1361         (WebCore::LayerOverlapMap::pushCompositingContainer):
1362         (WebCore::LayerOverlapMap::popCompositingContainer):
1363         (WebCore::OverlapMapContainer::unite): Deleted.
1364         (WebCore::OverlapMapContainer::rectList const): Deleted.
1365         * rendering/LayerOverlapMap.h:
1366         * rendering/RenderLayerCompositor.cpp:
1367         (WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer):
1368         (WebCore::RenderLayerCompositor::BackingSharingState::updateBeforeDescendantTraversal):
1369         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1370         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1371         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1372         (WebCore::RenderLayerCompositor::computeExtent const):
1373         (WebCore::createsClippingScope):
1374         (WebCore::enclosingClippingScopes):
1375         (WebCore::RenderLayerCompositor::addToOverlapMap const):
1376         (WebCore::RenderLayerCompositor::updateOverlapMap const):
1377         (WebCore::RenderLayerCompositor::layerOverlaps const):
1378         * rendering/RenderLayerCompositor.h:
1379
1380 2019-05-21  Antoine Quint  <graouts@apple.com>
1381
1382         [macOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
1383         https://bugs.webkit.org/show_bug.cgi?id=198072
1384         <rdar://problem/50983361>
1385
1386         Reviewed by Dean Jackson.
1387
1388         The Pointer Events spec says that "compatibility" mouse events, which means all mouse events save for "click",
1389         should not be dispatched for a given pointer if preventDefault() was called during the dispatch of the "pointerdown"
1390         event. Additionally, calling preventDefault() during the dispatch of "pointerup" has no effect.
1391
1392         * dom/Element.cpp:
1393         (WebCore::Element::dispatchMouseEvent):
1394         * page/PointerCaptureController.cpp:
1395         (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier):
1396         (WebCore::PointerCaptureController::pointerEventWasDispatched):
1397         * page/PointerCaptureController.h:
1398
1399 2019-05-21  Antti Koivisto  <antti@apple.com>
1400
1401         RTL/overflow scroll tests fail with async overflow enabled
1402         https://bugs.webkit.org/show_bug.cgi?id=196013
1403         <rdar://problem/49066649>
1404
1405         Reviewed by Simon Fraser.
1406
1407         Test: compositing/ios/rtl-overflow-scrolling-2.html
1408
1409         This patch makes the basic RTL cases work in the scrolling tree.
1410
1411         * page/scrolling/AsyncScrollingCoordinator.cpp:
1412         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
1413         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1414         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
1415         (WebCore::ScrollingTreeScrollingNode::maximumScrollPosition const):
1416
1417         Add missing scroll offset <-> scroll position conversions.
1418
1419 2019-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1420
1421         [WPE] Add initial accessibility support using ATK
1422         https://bugs.webkit.org/show_bug.cgi?id=197413
1423
1424         Reviewed by Michael Catanzaro.
1425
1426         Use USE(ATK) instead of PLATFORM(GTK) for ATK related code and use ATK when available for WPE port too.
1427
1428         * PlatformWPE.cmake:
1429         * SourcesWPE.txt:
1430         * accessibility/AXObjectCache.h:
1431         * accessibility/AccessibilityList.cpp:
1432         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
1433         * accessibility/AccessibilityNodeObject.cpp:
1434         (WebCore::AccessibilityNodeObject::canSetValueAttribute const):
1435         * accessibility/AccessibilityObject.cpp:
1436         (WebCore::AccessibilityObject::textIteratorBehaviorForTextRange const):
1437         * accessibility/AccessibilityObject.h:
1438         * accessibility/AccessibilityObjectInterface.h:
1439         * accessibility/AccessibilityRenderObject.cpp:
1440         (WebCore::AccessibilityRenderObject::indexForVisiblePosition const):
1441         (WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const):
1442         * accessibility/AccessibilityTableColumn.cpp:
1443         (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored const):
1444         * accessibility/AccessibilityTableHeaderContainer.cpp:
1445         (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored const):
1446         * accessibility/atk/WebKitAccessible.cpp:
1447         (webkitAccessibleGetAttributes):
1448         * accessibility/wpe/AXObjectCacheWPE.cpp: Removed.
1449         * accessibility/wpe/AccessibilityObjectWPE.cpp: Removed.
1450         * editing/FrameSelection.h:
1451
1452 2019-05-20  Ross Kirsling  <ross.kirsling@sony.com>
1453
1454         Make lossy LayoutUnit constructors explicit
1455         https://bugs.webkit.org/show_bug.cgi?id=191811
1456
1457         Reviewed by Antti Koivisto.
1458
1459         * platform/LayoutUnit.h:
1460         Make lossy unary constructors explicit.
1461         For ergonomics, give float overloads to copy constructor and round/floor/ceil functions.
1462
1463         * css/LengthFunctions.h:
1464         * platform/graphics/LayoutPoint.h:
1465         * platform/graphics/LayoutRect.h:
1466         * platform/graphics/LayoutSize.h:
1467         * rendering/RenderBox.h:
1468         * rendering/RenderElement.h:
1469         Templatize common functions to allow LayoutUnit itself to dictate which types it allows.
1470
1471         * html/shadow/SliderThumbElement.cpp:
1472         * page/FrameView.cpp:
1473         * page/Page.cpp:
1474         * page/SpatialNavigation.cpp:
1475         * page/scrolling/AxisScrollSnapOffsets.cpp:
1476         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1477         * layout/FormattingContextGeometry.cpp:
1478         * layout/FormattingContextQuirks.cpp:
1479         * layout/LayoutState.cpp:
1480         * layout/displaytree/DisplayBox.h:
1481         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1482         * layout/layouttree/LayoutReplaced.cpp:
1483         * platform/animation/AnimationUtilities.h:
1484         * platform/cocoa/ScrollSnapAnimatorState.mm:
1485         * rendering/BorderEdge.cpp:
1486         * rendering/EllipsisBox.cpp:
1487         * rendering/FixedTableLayout.cpp:
1488         * rendering/InlineBox.cpp:
1489         * rendering/InlineFlowBox.cpp:
1490         * rendering/InlineFlowBox.h:
1491         * rendering/InlineTextBox.cpp:
1492         * rendering/RenderBlock.cpp:
1493         * rendering/RenderBlockFlow.cpp:
1494         * rendering/RenderBlockLineLayout.cpp:
1495         * rendering/RenderBox.cpp:
1496         * rendering/RenderBoxModelObject.cpp:
1497         * rendering/RenderBoxModelObject.h:
1498         * rendering/RenderDeprecatedFlexibleBox.cpp:
1499         * rendering/RenderElement.cpp:
1500         * rendering/RenderImage.cpp:
1501         * rendering/RenderInline.cpp:
1502         * rendering/RenderLineBreak.cpp:
1503         * rendering/RenderListMarker.cpp:
1504         * rendering/RenderMultiColumnSet.cpp:
1505         * rendering/RenderMultiColumnSet.h:
1506         * rendering/RenderObject.cpp:
1507         * rendering/RenderReplaced.cpp:
1508         * rendering/RenderTable.cpp:
1509         * rendering/RenderTableCell.cpp:
1510         * rendering/RenderTableSection.cpp:
1511         * rendering/RenderText.cpp:
1512         * rendering/RenderTextControlMultiLine.cpp:
1513         * rendering/RenderThemeMac.mm:
1514         * rendering/RenderVTTCue.cpp:
1515         * rendering/RenderView.cpp:
1516         * rendering/RootInlineBox.cpp:
1517         * rendering/SimpleLineLayoutFunctions.cpp:
1518         * rendering/SimpleLineLayoutPagination.cpp:
1519         * rendering/SimpleLineLayoutResolver.cpp:
1520         * rendering/line/LineWidth.cpp:
1521         * rendering/mathml/MathOperator.cpp:
1522         * rendering/mathml/RenderMathMLBlock.cpp:
1523         * rendering/mathml/RenderMathMLBlock.h:
1524         * rendering/mathml/RenderMathMLFencedOperator.h:
1525         * rendering/mathml/RenderMathMLFraction.cpp:
1526         * rendering/mathml/RenderMathMLMenclose.cpp:
1527         * rendering/mathml/RenderMathMLOperator.cpp:
1528         * rendering/mathml/RenderMathMLRoot.cpp:
1529         * rendering/mathml/RenderMathMLScripts.cpp:
1530         * rendering/mathml/RenderMathMLToken.cpp:
1531         * rendering/shapes/BoxShape.cpp:
1532         * rendering/shapes/ShapeOutsideInfo.cpp:
1533         * rendering/style/CollapsedBorderValue.h:
1534         * rendering/style/NinePieceImage.cpp:
1535         * rendering/style/NinePieceImage.h:
1536         * rendering/style/RenderStyle.cpp:
1537         * rendering/style/RenderStyle.h:
1538         * rendering/svg/RenderSVGText.cpp:
1539         * rendering/svg/SVGInlineTextBox.cpp:
1540         Make usage of LayoutUnit(float) and LayoutUnit(double) explicit where needed.
1541
1542 2019-05-20  Jer Noble  <jer.noble@apple.com>
1543
1544         Provide an explicit UIModalPresentation style when creating an AVPlayerViewController for fullscreen.
1545         https://bugs.webkit.org/show_bug.cgi?id=198052
1546
1547         Reviewed by Tim Horton.
1548
1549         Make sure AVPlayerViewController has an "overFullScreen" modal style.
1550
1551         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1552         (-[WebAVPlayerViewController initWithFullscreenInterface:]):
1553
1554 2019-05-20  Chris Dumez  <cdumez@apple.com>
1555
1556         Fix security check in ScriptController::canAccessFromCurrentOrigin()
1557         https://bugs.webkit.org/show_bug.cgi?id=196730
1558         <rdar://problem/49731231>
1559
1560         Reviewed by Ryosuke Niwa.
1561
1562         Fix security check in ScriptController::canAccessFromCurrentOrigin() when there is no
1563         current JS exec state. Instead of returning true unconditionally, we now fall back to
1564         using the accessing document's origin for the security check. The new behavior is
1565         aligned with Blink:
1566         https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_frame_element_base.cc?rcl=d3f22423d512b45466f1694020e20da9e0c6ee6a&l=62
1567
1568         This fix is based on a patch from Sergei Glazunov <glazunov@google.com>.
1569
1570         Test: http/tests/security/showModalDialog-sync-cross-origin-page-load2.html
1571
1572         * bindings/js/ScriptController.cpp:
1573         (WebCore::ScriptController::canAccessFromCurrentOrigin):
1574         * bindings/js/ScriptController.h:
1575         * html/HTMLFrameElementBase.cpp:
1576         (WebCore::HTMLFrameElementBase::isURLAllowed const):
1577
1578 2019-05-20  Gabe Giosia  <giosia@google.com>
1579
1580         Range getBoundingClientRect returning zero rect on simple text node with <br> before it
1581         https://bugs.webkit.org/show_bug.cgi?id=182181
1582
1583         Reviewed by Antti Koivisto.
1584         
1585         Correct rect of RenderText in a block element when used in a Range
1586         over a line break element. The end offset was miscalculated.
1587
1588         Addded line-break case to fast/dom/Range/getBoundingClientRect.html
1589
1590         * rendering/SimpleLineLayoutFunctions.cpp:
1591         (WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange):
1592         * rendering/SimpleLineLayoutResolver.cpp:
1593         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets const):
1594
1595 2019-05-19  Brent Fulgham  <bfulgham@apple.com>
1596
1597         Unreviewed build fix after r245508.
1598
1599         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: Don't use
1600         an 'import' directive in a C++ file.
1601
1602 2019-05-19  Brent Fulgham  <bfulgham@apple.com>
1603
1604         Wait to get frame until after layout has been run
1605         https://bugs.webkit.org/show_bug.cgi?id=197999
1606         <rdar://problem/50800345>
1607
1608         Reviewed by Alex Christensen.
1609
1610         The current frame can change when layout runs, so don't bother retrieving
1611         the frame until the final layout pass is complete.
1612
1613         Test: fast/dom/window-inner-width-crash.html
1614
1615         * page/DOMWindow.cpp:
1616         (WebCore::DOMWindow::innerHeight const): Move frame access past the
1617         layout operation.
1618         (WebCore::DOMWindow::innerWidth const): Ditto.
1619         (WebCore::DOMWindow::scrollX const): Ditto.
1620         (WebCore::DOMWindow::scrollY const): Ditto.
1621
1622 2019-05-19  Brent Fulgham  <bfulgham@apple.com>
1623
1624         Unreviewed build fix
1625
1626         Attempting to build with only Open Source sources on shipping software with
1627         ASan enabled triggers build failures due to missing includes. This patch adds
1628         the necessary includes to cleanly build WebCore.
1629
1630         * Modules/applepay/ApplePaySession.cpp:
1631         * Modules/applepay/PaymentSession.cpp:
1632         * Modules/mediastream/UserMediaController.cpp:
1633         * bindings/js/ScriptController.cpp:
1634         * contentextensions/ContentExtensionsBackend.cpp:
1635         * dom/Document.cpp:
1636         * dom/ScriptedAnimationController.cpp:
1637         * editing/cocoa/EditorCocoa.mm:
1638         * editing/cocoa/HTMLConverter.mm:
1639         * editing/cocoa/WebContentReaderCocoa.mm:
1640         * editing/markup.cpp:
1641         * history/CachedFrame.cpp:
1642         * html/HTMLDocument.cpp:
1643         * html/HTMLHtmlElement.cpp:
1644         * html/HTMLMediaElement.cpp:
1645         * html/ImageDocument.cpp:
1646         * html/MediaDocument.cpp:
1647         * html/PluginDocument.cpp:
1648         * html/parser/HTMLDocumentParser.cpp:
1649         * html/parser/XSSAuditor.cpp:
1650         * inspector/InspectorInstrumentation.cpp:
1651         * inspector/agents/InspectorApplicationCacheAgent.cpp:
1652         * inspector/agents/InspectorNetworkAgent.cpp:
1653         * inspector/agents/InspectorPageAgent.cpp:
1654         * inspector/agents/page/PageNetworkAgent.cpp:
1655         * loader/ApplicationManifestLoader.cpp:
1656         * loader/FrameLoader.cpp:
1657         * loader/LoadTiming.cpp:
1658         * loader/NetscapePlugInStreamLoader.cpp:
1659         * loader/ResourceLoader.cpp:
1660         * loader/SubresourceLoader.cpp:
1661         * loader/appcache/ApplicationCacheHost.cpp:
1662         * loader/archive/cf/LegacyWebArchive.cpp:
1663         * loader/icon/IconLoader.cpp:
1664         * page/ContextMenuController.cpp:
1665         * page/FrameView.cpp:
1666         * page/Page.cpp:
1667         * page/Performance.cpp:
1668         * page/PerformanceNavigation.cpp:
1669         * page/Quirks.cpp:
1670         * page/UserContentProvider.cpp:
1671         * page/csp/ContentSecurityPolicy.cpp:
1672         * page/mac/PageMac.mm:
1673         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1674         * svg/graphics/SVGImage.cpp:
1675         * testing/Internals.cpp:
1676
1677 2019-05-19  Antoine Quint  <graouts@apple.com>
1678
1679         [Pointer Events] Listening to a "pointerover", "pointerenter", "pointerout" or "pointerleave" event alone does not fire the event on iOS
1680         https://bugs.webkit.org/show_bug.cgi?id=197882
1681         <rdar://problem/50769116>
1682
1683         Reviewed by Dean Jackson.
1684
1685         Tests: pointerevents/ios/pointerenter-alone.html
1686                pointerevents/ios/pointerleave-alone.html
1687                pointerevents/ios/pointerout-alone.html
1688                pointerevents/ios/pointerover-alone.html
1689
1690         * dom/EventNames.h:
1691         (WebCore::EventNames::isTouchRelatedEventType const):
1692         (WebCore::EventNames::touchRelatedEventNames const):
1693         (WebCore::EventNames::extendedTouchRelatedEventNames const):
1694
1695 2019-05-19  Antoine Quint  <graouts@apple.com>
1696
1697         [Pointer Events] A pointer should be marked as primary for all of its events
1698         https://bugs.webkit.org/show_bug.cgi?id=197909
1699         <rdar://problem/50801608>
1700
1701         Reviewed by Dean Jackson.
1702
1703         Add an ivar for EventHandler which we'll use in WebKitAdditions code to track the touch identifier
1704         of the very first touch to start in a given sequence.
1705
1706         * page/EventHandler.h:
1707
1708 2019-05-19  Darin Adler  <darin@apple.com>
1709
1710         Change String::number to use "shortest" instead of "fixed precision 6 digits"
1711         https://bugs.webkit.org/show_bug.cgi?id=178319
1712
1713         Reviewed by Sam Weinig.
1714
1715         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
1716         (webkitAccessibleSetNewValue): Use String::numberToStringFixedPrecision
1717         instead of String::number to be explicit about the fact that it's fixed precision.
1718         * page/linux/ResourceUsageOverlayLinux.cpp:
1719         (gcTimerString): Ditto.
1720
1721         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1722         (printTransform): Use appendFixedPrecisionNumber instead of appendNumber
1723         to be explicit about the fact that it's fixed precision.
1724         (printLayer): Ditto.
1725         (WebCore::PlatformCALayerWin::layerTreeAsString const): Ditto.
1726         * platform/graphics/freetype/FontCacheFreeType.cpp:
1727         (buildVariationSettings): Ditto.
1728
1729         * svg/SVGNumberList.h: Use appendFixedPrecisionNumber instead of appendNumber
1730         to be explicit about the fact that it's fixed precision. We'll consider moving
1731         to shortest later.
1732
1733         * svg/SVGPathUtilities.cpp:
1734         (WebCore::buildStringFromPath): Use appendNumberShortest instead of
1735         appendNumberECMAScript since these are single-precision.
1736
1737         * svg/SVGPointList.h: Use appendFixedPrecisionNumber instead of appendNumber
1738         to be explicit about the fact that it's fixed precision. We'll consider moving
1739         to shortest later.
1740         * svg/SVGTransformValue.h: Ditto.
1741
1742 2019-05-19  Simon Fraser  <simon.fraser@apple.com>
1743
1744         Layers painting into shared backing need to contribute to overlap
1745         https://bugs.webkit.org/show_bug.cgi?id=198021
1746
1747         Reviewed by Zalan Bujtas.
1748         
1749         Layers that paint into a composited (non-root) layer get added to the overlap map so
1750         that later layers correct overlap them; this is done via the test against currentState.compositingAncestor.
1751
1752         We need the same logic for layers that paint into shared backing; they need to behave
1753         the same way in terms of how they contribute to overlap. We already had currentState.backingSharingAncestor
1754         which was unused, but now use it for this, and correctly null it out when a layer composites.
1755
1756         Bug was noticed during testing, and not known to affect any websites (though it probably does).
1757         
1758         Also move the overlap container popping into updateOverlapMap() so the two callers can
1759         share the code, and more explicitly track whether a container was pushed.
1760
1761         Test: compositing/shared-backing/sharing-child-contributes-to-overlap.html
1762
1763         * rendering/RenderLayerCompositor.cpp:
1764         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1765         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1766         (WebCore::RenderLayerCompositor::updateOverlapMap const):
1767         * rendering/RenderLayerCompositor.h:
1768
1769 2019-05-17  Joonghun Park  <pjh0718@gmail.com>
1770
1771         Implement CSS `display: flow-root` (modern clearfix)
1772         https://bugs.webkit.org/show_bug.cgi?id=165603
1773
1774         Reviewed by Zalan Bujtas.
1775
1776         This change follows https://drafts.csswg.org/css-display-3/#valdef-display-flow-root as below.
1777
1778         'display: flow-root' generates a block container box, and lays out its contents using flow layout.
1779         It always establishes a new block formatting context for its contents.
1780
1781         * css/CSSPrimitiveValueMappings.h:
1782         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1783         * css/CSSValueKeywords.in:
1784         * css/StyleResolver.cpp:
1785         (WebCore::equivalentBlockDisplay):
1786         * css/parser/CSSParserFastPaths.cpp:
1787         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1788         * rendering/RenderBox.cpp:
1789         (WebCore::RenderBox::createsNewFormattingContext const):
1790         * rendering/RenderElement.cpp:
1791         (WebCore::RenderElement::createFor):
1792         * rendering/style/RenderStyleConstants.h:
1793
1794 2019-05-17  Don Olmstead  <don.olmstead@sony.com>
1795
1796         [CMake] Use builtin FindICU
1797         https://bugs.webkit.org/show_bug.cgi?id=197934
1798
1799         Reviewed by Michael Catanzaro.
1800
1801         Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.
1802
1803         * CMakeLists.txt:
1804         * PlatformPlayStation.cmake:
1805         * PlatformWPE.cmake:
1806
1807 2019-05-17  Alex Christensen  <achristensen@webkit.org>
1808
1809         Enable legacy EME for iOS WKWebView
1810         https://bugs.webkit.org/show_bug.cgi?id=197964
1811         <rdar://problem/50625666>
1812
1813         Reviewed by Wenson Hsieh.
1814
1815         This was attempted unsuccessfully in r230169.
1816         Verified manually that it works as desired.
1817
1818         * page/RuntimeEnabledFeatures.h:
1819
1820 2019-05-17  Sihui Liu  <sihui_liu@apple.com>
1821
1822         ASSERTION FAILED: !m_backingStore in WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore(uint64_t)
1823         https://bugs.webkit.org/show_bug.cgi?id=197741
1824         <rdar://problem/50625006>
1825
1826         Reviewed by Youenn Fablet.
1827
1828         If an open request is made before a delete request, open task should be performed before delete task on the
1829         database thread. After r242911, open request needs to wait decision of StorageQuotaManager before posting task
1830         to database thread, while delete request needs not. This makes deletion happen before open.
1831
1832         We need to make sure tasks are in correct order by not starting next open or delete request when database is in 
1833         the middle of open or deletion.
1834
1835         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1836         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
1837         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
1838
1839 2019-05-17  Antoine Quint  <graouts@apple.com>
1840
1841         Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
1842         https://bugs.webkit.org/show_bug.cgi?id=197943
1843         <rdar://problem/49078202>
1844
1845         Reviewed by Brent Fulgham.
1846
1847         Tests: fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html
1848                platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html
1849
1850         * css/parser/CSSParserContext.cpp:
1851         (WebCore::CSSParserContext::CSSParserContext):
1852         * loader/DocumentLoader.h:
1853         (WebCore::DocumentLoader::legacyOverflowScrollingTouchPolicy const):
1854         (WebCore::DocumentLoader::setLegacyOverflowScrollingTouchPolicy):
1855
1856 2019-05-17  Alex Christensen  <achristensen@webkit.org>
1857
1858         Add SPI to set a list of hosts to which to send custom header fields cross-origin
1859         https://bugs.webkit.org/show_bug.cgi?id=197397
1860
1861         Reviewed by Geoff Garen.
1862
1863         In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
1864         We need the ability to specify what origins to send these headers to even if they are not first party requests.
1865         We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
1866         indicating that the headers are to be sent to all subdomains.
1867
1868         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
1869         I also added some new API tests for the new behavior.
1870
1871         * Sources.txt:
1872         * WebCore.xcodeproj/project.pbxproj:
1873         * loader/CustomHeaderFields.cpp: Added.
1874         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
1875         * loader/CustomHeaderFields.h: Added.
1876         (WebCore::CustomHeaderFields::encode const):
1877         (WebCore::CustomHeaderFields::decode):
1878         * loader/DocumentLoader.cpp:
1879         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
1880         * loader/DocumentLoader.h:
1881         (WebCore::DocumentLoader::setCustomHeaderFields):
1882         (WebCore::DocumentLoader::customHeaderFields const):
1883         (WebCore::DocumentLoader::customHeaderFields): Deleted.
1884         * loader/cache/CachedResourceLoader.cpp:
1885         (WebCore::CachedResourceLoader::requestResource):
1886
1887 2019-05-17  Youenn Fablet  <youenn@apple.com>
1888
1889         Make AVVideoCaptureSource more robust to configuration failures
1890         https://bugs.webkit.org/show_bug.cgi?id=197997
1891         rdar://problem/50875662
1892
1893         Reviewed by Eric Carlson.
1894
1895         Covered by manual testing.
1896
1897         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1898         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
1899         Make sure to commit configuration once calling beginConfiguration.
1900         In case of error in setting frame rate, log the error but continue capturing.
1901
1902 2019-05-17  Rob Buis  <rbuis@igalia.com>
1903
1904         Implement imagesrcset and imagesizes attributes on link rel=preload
1905         https://bugs.webkit.org/show_bug.cgi?id=192950
1906
1907         Reviewed by Youenn Fablet.
1908
1909         Implement imagesrcset and imagesizes attributes for both Link header
1910         and link element.
1911
1912         Tests: imported/w3c/web-platform-tests/preload/dynamic-adding-preload-imagesrcset.html
1913                imported/w3c/web-platform-tests/preload/link-header-preload-delay-onload.html
1914                imported/w3c/web-platform-tests/preload/link-header-preload-imagesrcset.html
1915                imported/w3c/web-platform-tests/preload/link-header-preload-nonce.html
1916                imported/w3c/web-platform-tests/preload/link-header-preload.html
1917                imported/w3c/web-platform-tests/preload/onload-event.html
1918                imported/w3c/web-platform-tests/preload/preload-with-type.html
1919
1920         * html/HTMLAttributeNames.in:
1921         * html/HTMLLinkElement.cpp:
1922         (WebCore::HTMLLinkElement::process):
1923         * html/HTMLLinkElement.idl:
1924         * loader/LinkHeader.cpp:
1925         (WebCore::paramterNameFromString):
1926         (WebCore::LinkHeader::setValue):
1927         (WebCore::LinkHeader::LinkHeader):
1928         * loader/LinkHeader.h:
1929         (WebCore::LinkHeader::imageSrcSet const):
1930         (WebCore::LinkHeader::imageSizes const):
1931         (WebCore::LinkHeader::isViewportDependent const):
1932         * loader/LinkLoader.cpp:
1933         (WebCore::LinkLoader::loadLinksFromHeader):
1934         (WebCore::LinkLoader::preloadIfNeeded):
1935         (WebCore::LinkLoader::loadLink):
1936         * loader/LinkLoader.h:
1937
1938 2019-05-17  Keith Rollin  <krollin@apple.com>
1939
1940         Re-enable generate-xcfilelists
1941         https://bugs.webkit.org/show_bug.cgi?id=197933
1942         <rdar://problem/50831677>
1943
1944         Reviewed by Jonathan Bedard.
1945
1946         The following two tasks have been completed, and we can re-enable
1947         generate-xcfilelists:
1948
1949         Bug 197619 <rdar://problem/50507392> Temporarily disable generate-xcfilelists (197619)
1950         Bug 197622 <rdar://problem/50508222> Rewrite generate-xcfilelists in Python (197622)
1951
1952         No new tests -- no change in user-visible functionality.
1953
1954         * Scripts/check-xcfilelists.sh:
1955
1956 2019-05-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1957
1958         Fix a typo in some user agent string logic
1959         https://bugs.webkit.org/show_bug.cgi?id=197992
1960         <rdar://problem/50895962>
1961
1962         Reviewed by Brent Fulgham.
1963
1964         Adjust the major version number for the desktop user agent string.
1965
1966         * platform/ios/UserAgentIOS.mm:
1967         (WebCore::standardUserAgentWithApplicationName):
1968
1969 2019-05-17  Simon Fraser  <simon.fraser@apple.com>
1970
1971         REGRESSION (r245170): gmail.com inbox table header flickers
1972         https://bugs.webkit.org/show_bug.cgi?id=198005
1973         <rdar://problem/50907718>
1974
1975         Reviewed by Antti Koivisto.
1976
1977         When a layer started as painting into shared backing, but then became independently
1978         composited (e.g. by having to clip composited children), it wouldn't have the "overlap"
1979         indirect compositing reason. This allowed requiresOwnBackingStore() to say that it
1980         could paint into some ancestor, but this breaks overlap. So in this code path,
1981         put IndirectCompositingReason::Overlap back on the layer which restores the previous
1982         behavior.
1983
1984         Make some logging changes to help diagnose things like this.
1985
1986         Test: compositing/shared-backing/overlap-after-end-sharing.html
1987
1988         * rendering/RenderLayer.cpp:
1989         (WebCore::RenderLayer::calculateClipRects const):
1990         (WebCore::outputPaintOrderTreeLegend):
1991         (WebCore::outputPaintOrderTreeRecursive):
1992         * rendering/RenderLayer.h:
1993         * rendering/RenderLayerCompositor.cpp:
1994         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1995         (WebCore::RenderLayerCompositor::updateBacking):
1996         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
1997         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1998         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
1999         * rendering/RenderLayerCompositor.h:
2000
2001 2019-05-17  Simon Fraser  <simon.fraser@apple.com>
2002
2003         REGRESSION (r245170): gmail.com header flickers when hovering over the animating buttons
2004         https://bugs.webkit.org/show_bug.cgi?id=197975
2005         <rdar://problem/50865946>
2006
2007         Reviewed by Antti Koivisto.
2008
2009         When computeCompositingRequirements() determined that a layer could paint into shared backing, it
2010         pushed an overlap container. If that layer then converted to normal composting, we'd push a second
2011         overlap container, which left the overlap map in a bad state for the rest of the compositing
2012         traversal, causing layers to not get composited when necessary.
2013
2014         Test: compositing/shared-backing/overlap-after-shared-to-composited.html
2015
2016         * rendering/RenderLayerCompositor.cpp:
2017         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2018
2019 2019-05-17  Commit Queue  <commit-queue@webkit.org>
2020
2021         Unreviewed, rolling out r245401.
2022         https://bugs.webkit.org/show_bug.cgi?id=197990
2023
2024         Causing internal build failures (Requested by ShawnRoberts on
2025         #webkit).
2026
2027         Reverted changeset:
2028
2029         "Add SPI to set a list of hosts to which to send custom header
2030         fields cross-origin"
2031         https://bugs.webkit.org/show_bug.cgi?id=197397
2032         https://trac.webkit.org/changeset/245401
2033
2034 2019-05-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2035
2036         SVGElement should detach itself from all its properties before it is deleted
2037         https://bugs.webkit.org/show_bug.cgi?id=197954
2038
2039         Reviewed by Simon Fraser.
2040
2041         Before deleting the SVGElement node, SVGElement::detachAllProperties()
2042         needs to be called. This will make the properties be detached objects
2043         which means no change will be committed unless these properties are
2044         attached to another owner.
2045
2046         Test: svg/dom/svg-properties-detach-change.html
2047
2048         * dom/Node.cpp:
2049         (WebCore::Node::removedLastRef):
2050         * svg/SVGElement.h:
2051         (WebCore::SVGElement::detachAllProperties):
2052
2053 2019-05-17  Eric Carlson  <eric.carlson@apple.com>
2054
2055         Allow sequential playback of media files when initial playback started with a user gesture
2056         https://bugs.webkit.org/show_bug.cgi?id=197959
2057         <rdar://problem/50655207>
2058
2059         Reviewed by Youenn Fablet.
2060
2061         Test: media/playlist-inherits-user-gesture.html
2062
2063         * dom/Document.cpp:
2064         (WebCore::Document::processingUserGestureForMedia const): Return true if it is within
2065         one second of the last HTMLMediaElement 'ended' event.
2066         * dom/Document.h:
2067         (WebCore::Document::mediaFinishedPlaying):
2068
2069         * html/HTMLMediaElement.cpp:
2070         (WebCore::HTMLMediaElement::parseAttribute): removeBehaviorsRestrictionsAfterFirstUserGesture -> 
2071         removeBehaviorRestrictionsAfterFirstUserGesture.
2072         (WebCore::HTMLMediaElement::load): Ditto. Don't call removeBehaviorsRestrictionsAfterFirstUserGesture,
2073         it will be done in prepareForLoad.
2074         (WebCore::HTMLMediaElement::prepareForLoad): removeBehaviorsRestrictionsAfterFirstUserGesture -> 
2075         removeBehaviorRestrictionsAfterFirstUserGesture.
2076         (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Ditto.
2077         (WebCore::HTMLMediaElement::play): Ditto.
2078         (WebCore::HTMLMediaElement::pause): Ditto.
2079         (WebCore::HTMLMediaElement::setVolume): Ditto.
2080         (WebCore::HTMLMediaElement::setMuted): Ditto.
2081         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Ditto.
2082         (WebCore::HTMLMediaElement::dispatchEvent): Call document().mediaFinishedPlaying()
2083         when dispatching the 'ended' event.
2084         (WebCore::HTMLMediaElement::removeBehaviorRestrictionsAfterFirstUserGesture): Rename. Set
2085         m_removedBehaviorRestrictionsAfterFirstUserGesture.
2086         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Deleted.
2087         * html/HTMLMediaElement.h:
2088         
2089         * html/HTMLVideoElement.cpp:
2090         (WebCore:HTMLVideoElement::nativeImageForCurrentTime): Convert to runtime logging.
2091         (WebCore:HTMLVideoElement::webkitEnterFullscreen): Ditto.
2092         (WebCore:HTMLVideoElement::webkitSetPresentationMode): Ditto.
2093         (WebCore:HTMLVideoElement::fullscreenModeChanged): Ditto.
2094
2095         * html/MediaElementSession.cpp:
2096         (WebCore::MediaElementSession::removeBehaviorRestriction): Update log message.
2097
2098 2019-05-17  Brent Fulgham  <bfulgham@apple.com>
2099
2100         Hardening: Prevent FrameLoader crash due to SetForScope
2101         https://bugs.webkit.org/show_bug.cgi?id=197458
2102         <rdar://problem/50368338>
2103
2104         Reviewed by Chris Dumez.
2105
2106         Since SetForScope takes action during a function returns, it might cause
2107         a crash if its scope is broader than the value it is resetting.
2108
2109         * loader/FrameLoader.cpp:
2110         (WebCore::FrameLoader::loadDifferentDocumentItem):
2111
2112 2019-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2113
2114         [GTK] Need WebKitContextMenuItemType to open emoji picker
2115         https://bugs.webkit.org/show_bug.cgi?id=176760
2116
2117         Reviewed by Michael Catanzaro.
2118
2119         Add a new context menu item to insert an emoji.
2120
2121         * loader/EmptyClients.cpp: Empty implementation of ContextMenuClient::insertEmoji().
2122         * page/ContextMenuClient.h: Add insertEmoji for GTK port.
2123         * page/ContextMenuController.cpp:
2124         (WebCore::ContextMenuController::contextMenuItemSelected): Handle insert emoji action.
2125         (WebCore::ContextMenuController::populate): Add insert emoji item after select all.
2126         (WebCore::ContextMenuController::checkOrEnableIfNeeded const): Handle insert emoji action.
2127         * platform/ContextMenuItem.h: Add insert emoji action.
2128         * platform/LocalizedStrings.h:
2129         * platform/gtk/LocalizedStringsGtk.cpp:
2130         (WebCore::contextMenuItemTagInsertEmoji):
2131
2132 2019-05-16  Greg Doolittle  <gr3g@apple.com>
2133
2134         AX: Unship some ARIA string reflectors that are to-be-replaced by element reflection
2135         https://bugs.webkit.org/show_bug.cgi?id=197764
2136         <rdar://problem/50649689>
2137
2138         Reviewed by Chris Fleizach.
2139
2140         Specifically these:
2141         - ariaActiveDescendant
2142         - ariaControls
2143         - ariaDescribedBy
2144         - ariaDetails
2145         - ariaErrorMessage
2146         - ariaFlowTo
2147         - ariaLabelledBy
2148         - ariaOwns
2149
2150         Test: LayoutTests/accessibility/ARIA-reflections.html (updated)
2151
2152         * accessibility/AriaAttributes.idl:
2153
2154 2019-05-16  Youenn Fablet  <youenn@apple.com>
2155
2156         CoreAudioCaptureSource should be marked as an audio capture track
2157         https://bugs.webkit.org/show_bug.cgi?id=197953
2158         <rdar://problem/50552007>
2159
2160         Reviewed by Eric Carlson.
2161
2162         Manually tested.
2163
2164         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2165         Mark it as microphone so that it can get muted properly.
2166
2167 2019-05-16  Alex Christensen  <achristensen@webkit.org>
2168
2169         Add SPI to set a list of hosts to which to send custom header fields cross-origin
2170         https://bugs.webkit.org/show_bug.cgi?id=197397
2171
2172         Reviewed by Geoff Garen.
2173
2174         In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
2175         We need the ability to specify what origins to send these headers to even if they are not first party requests.
2176         We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
2177         indicating that the headers are to be sent to all subdomains.
2178
2179         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
2180         I also added some new API tests for the new behavior.
2181
2182         * Sources.txt:
2183         * WebCore.xcodeproj/project.pbxproj:
2184         * loader/CustomHeaderFields.cpp: Added.
2185         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
2186         * loader/CustomHeaderFields.h: Added.
2187         (WebCore::CustomHeaderFields::encode const):
2188         (WebCore::CustomHeaderFields::decode):
2189         * loader/DocumentLoader.cpp:
2190         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
2191         * loader/DocumentLoader.h:
2192         (WebCore::DocumentLoader::setCustomHeaderFields):
2193         (WebCore::DocumentLoader::customHeaderFields const):
2194         (WebCore::DocumentLoader::customHeaderFields): Deleted.
2195         * loader/cache/CachedResourceLoader.cpp:
2196         (WebCore::CachedResourceLoader::requestResource):
2197
2198 2019-05-16  Ali Juma  <ajuma@chromium.org>
2199
2200         [IntersectionObserver] Regression: No initial observation when nothing else triggers rendering
2201         https://bugs.webkit.org/show_bug.cgi?id=197891
2202
2203         Reviewed by Simon Fraser.
2204
2205         Schedule a rendering update whenever a new IntersectionObserver target is added.
2206
2207         Test: intersection-observer/initial-observation.html
2208
2209         * page/IntersectionObserver.cpp:
2210         (WebCore::IntersectionObserver::observe):
2211
2212 2019-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2213
2214         [FreeType] Some character sequences with a variation selector are not rendered
2215         https://bugs.webkit.org/show_bug.cgi?id=197838
2216
2217         Reviewed by Michael Catanzaro.
2218
2219         We get the invalid glyph instead. See http://mts.io/2015/04/21/unicode-symbol-render-text-emoji/. In the table at
2220         the end the Emoji and Text columns are not correctly rendered. It happens also when copying an emoji from
2221         GtkEmojiChooser and pasting in WebKit text field, because GTK appends U+FE0F to all emojis to force the emoji
2222         style. We need to take into account the variation selector when checking if a font can render a combining
2223         sequence, using FT_Face_GetCharVariantIndex to get the right glyph in case of variation character present.
2224
2225         * platform/graphics/Font.cpp:
2226         (WebCore::Font::platformSupportsCodePoint const): Add optional variation parameter.
2227         (WebCore::Font::canRenderCombiningCharacterSequence const): Take into account variation selector characters
2228         * platform/graphics/Font.h:
2229         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2230         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Check variation selectors 0xFE0E and 0xFE0F to
2231         decide whether to use the emoji or text style.
2232         * platform/graphics/cocoa/FontCocoa.mm:
2233         (WebCore::Font::platformSupportsCodePoint const): Return false when a variation character is passed so that
2234         characters are checked individually.
2235         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2236         (WebCore::Font::platformSupportsCodePoint const): Use FT_Face_GetCharVariantIndex when a variation character is
2237         passed.
2238         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2239         (WebCore::harfBuzzFontFunctions): Do not return true when FT_Face_GetCharVariantIndex returns 0.
2240
2241 2019-05-16  Greg Hughes  <ghughes@apple.com>
2242
2243         Updated screenHasInvertedColors to use AppKit when available
2244         https://bugs.webkit.org/show_bug.cgi?id=197935
2245         <rdar://problem/50834405>
2246
2247         Reviewed by Chris Fleizach.
2248
2249         * platform/mac/PlatformScreenMac.mm:
2250         (WebCore::collectScreenProperties):
2251         (WebCore::screenHasInvertedColors):
2252
2253 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
2254
2255         Avoid a recursive descendants layer walk sometimes
2256         https://bugs.webkit.org/show_bug.cgi?id=197939
2257
2258         Reviewed by Zalan Bujtas.
2259
2260         If a layer got composited post-descendants because it needs to clip, for example, we'd do a recursive
2261         descendant tree walk to add layers to the overlap map. However, all the descendants would already
2262         have contributed to the overlap map if some non-root ancestor was already composited. So we can
2263         skip the addDescendantsToOverlapMapRecursive() if we know, before descendants, whether there's
2264         a non-root composited ancestor.
2265
2266         * rendering/RenderLayerCompositor.cpp:
2267         (WebCore::RenderLayerCompositor::CompositingState::hasNonRootCompositedAncestor const):
2268         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2269
2270 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
2271
2272         Clean up code related to compositing overlap map maintenance
2273         https://bugs.webkit.org/show_bug.cgi?id=197936
2274
2275         Reviewed by Zalan Bujtas.
2276
2277         Clarify the logic around updating the overlap map:
2278
2279         When a layer becomes composited, or paints into a non-root composited layer, we add it to the overlap map
2280         after traversing descendants (since it only affets layers later in traversal).
2281
2282         If a layer became composited after traversing descendants, we need to go back and add all the descendants
2283         to the overlap map with a recursive traversal.
2284
2285         We can do all this near the end of computeCompositingRequirements/traverseUnchangedSubtree because
2286         we only check overlap when we enter this function on later layers.
2287
2288         Add a CompositingOverlap log channel and use it to log the state of the overlap map.
2289
2290         * platform/Logging.h:
2291         * rendering/RenderLayerCompositor.cpp:
2292         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2293         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2294         (WebCore::RenderLayerCompositor::addToOverlapMap const):
2295         (WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const):
2296         (WebCore::RenderLayerCompositor::updateOverlapMap const):
2297         (WebCore::RenderLayerCompositor::addToOverlapMap): Deleted.
2298         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): Deleted.
2299         * rendering/RenderLayerCompositor.h:
2300
2301 2019-05-15  Timothy Hatcher  <timothy@apple.com>
2302
2303         REGRESSION (r245072): Missing code in Document::styleColorOptions to propagate StyleColor::Options::UseInactiveAppearance
2304         https://bugs.webkit.org/show_bug.cgi?id=197930
2305         rdar://problem/49833954
2306
2307         Reviewed by Wenson Hsieh and Megan Gardner.
2308
2309         Add some code that was missing from Document in my original patch for r245072.
2310
2311         * dom/Document.cpp:
2312         (WebCore::Document::useSystemAppearance const): Drive-by fix code style.
2313         (WebCore::Document::useInactiveAppearance const): Added.
2314         (WebCore::Document::styleColorOptions const): Add StyleColor::Options::UseInactiveAppearance.
2315         * dom/Document.h: Added useInactiveAppearance().
2316
2317 2019-05-15  Devin Rousso  <drousso@apple.com>
2318
2319         Web Inspector: user gesture toggle should also force user interaction flag
2320         https://bugs.webkit.org/show_bug.cgi?id=197269
2321
2322         Reviewed by Joseph Pecoraro.
2323
2324         Test: inspector/runtime/evaluate-userGestureEmulation-userIsInteracting.html
2325
2326         * inspector/agents/page/PageRuntimeAgent.cpp:
2327         (WebCore::PageRuntimeAgent::evaluate):
2328
2329         * page/ChromeClient.h:
2330         (WebCore::ChromeClient::userIsInteracting const): Added.
2331         (WebCore::ChromeClient::setUserIsInteracting): Added.
2332
2333         * testing/Internals.idl:
2334         * testing/Internals.h:
2335         * testing/Internals.cpp:
2336         (WebCore::Internals::userIsInteracting): Added.
2337
2338 2019-05-15  Zalan Bujtas  <zalan@apple.com>
2339
2340         Do not create a shape object outside of the layout context
2341         https://bugs.webkit.org/show_bug.cgi?id=197926
2342         <rdar://problem/50627858>
2343
2344         Reviewed by Simon Fraser.
2345
2346         ShapeOutside objects are used to compute line constrains during layout (in a strict sense, they are part of the layout context and should only be mutated during layout).
2347         If we don't create one during layout, we probably don't need to know its geometry during paint (or any other non-layout activity) either.
2348
2349         Test: fast/block/float/float-with-shape-outside-crash.html
2350
2351         * rendering/FloatingObjects.cpp:
2352         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
2353         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
2354         * rendering/shapes/ShapeOutsideInfo.cpp:
2355         (WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine):
2356
2357 2019-05-15  Youenn Fablet  <youenn@apple.com>
2358
2359         Mark beacon and ping loads as low priority
2360         https://bugs.webkit.org/show_bug.cgi?id=197919
2361         <rdar://problem/50818286>
2362
2363         Reviewed by Alex Christensen.
2364
2365         No JS observable change of behavior.
2366
2367         * Modules/beacon/NavigatorBeacon.cpp:
2368         (WebCore::NavigatorBeacon::sendBeacon):
2369         * loader/PingLoader.cpp:
2370         (WebCore::PingLoader::sendPing):
2371
2372 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
2373
2374         Clean up RenderLayerCompositor::computeCompositingRequirements() and traverseUnchangedSubtree()
2375         https://bugs.webkit.org/show_bug.cgi?id=197931
2376
2377         Reviewed by Zalan Bujtas.
2378
2379         These functions have grown and become hard to maintain, so try to undo some technical debt.
2380
2381         Rename "childState" to "currentState" since it's the state we pass to children, but also
2382         is state we change when the current layer becomes composited.
2383
2384         Separate the layerWillComposite() lambda from layerWillCompositePostDescendants().
2385
2386         Group the chunks of code at end of the functions into:
2387             - updating bits on RenderLayer
2388             - updating compositingState with changes from children and our state
2389             - doing post-traversal work on overlapMap and backingSharingState
2390
2391         Code shared between the two functions is pushed into CompositingState::updateWithDescendantStateAndLayer().
2392
2393         This moves code around but should not cause any behavior change.
2394
2395         * rendering/RenderLayerBacking.cpp:
2396         (WebCore::RenderLayerBacking::updateConfiguration):
2397         * rendering/RenderLayerCompositor.cpp:
2398         (WebCore::RenderLayerCompositor::OverlapExtent::knownToBeHaveExtentUncertainty const):
2399         (WebCore::RenderLayerCompositor::CompositingState::updateWithDescendantStateAndLayer):
2400         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2401         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2402         (WebCore::RenderLayerCompositor::clipsCompositingDescendants):
2403         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren): Deleted.
2404         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree): Deleted.
2405         (WebCore::RenderLayerCompositor::clipsCompositingDescendants const): Deleted.
2406         * rendering/RenderLayerCompositor.h:
2407
2408 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
2409
2410         Make LayerOverlapMap able to output to a TextStream
2411         https://bugs.webkit.org/show_bug.cgi?id=197923
2412
2413         Reviewed by Zalan Bujtas.
2414
2415         Make it possible output LayerOverlapMap to a TextStream for logging.
2416
2417         * rendering/LayerOverlapMap.cpp:
2418         (WebCore::OverlapMapContainer::rectList const):
2419         (WebCore::operator<<):
2420         * rendering/LayerOverlapMap.h:
2421         (WebCore::LayerOverlapMap::overlapStack const):
2422
2423 2019-05-15  Youenn Fablet  <youenn@apple.com>
2424
2425         getUserMedia sandbox extensions should not be revoked when a getUserMedia allowed request is being processed
2426         https://bugs.webkit.org/show_bug.cgi?id=197851
2427
2428         Reviewed by Alex Christensen.
2429
2430         Add a completion handler to create a new capture stream.
2431         This is used by WK2 layer to acknowledge the pending capture request is completed.
2432         Just after the completion handler, make sure to update the document media state.
2433         This is done to ensure that, should capture failing, the UIProcess
2434         knows about it and can manage proper sandbox extension revocation.
2435
2436         Test: fast/mediastream/gum-stop-track.html
2437
2438         * Modules/mediastream/UserMediaRequest.cpp:
2439         (WebCore::UserMediaRequest::allow):
2440         (WebCore::UserMediaRequest::PendingActivationMediaStream::PendingActivationMediaStream):
2441         (WebCore::UserMediaRequest::PendingActivationMediaStream::~PendingActivationMediaStream):
2442         * Modules/mediastream/UserMediaRequest.h:
2443         (WebCore::UserMediaRequest::PendingActivationMediaStream::create):
2444         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2445         (WebCore::MockRealtimeMediaSourceCenter::mockRealtimeMediaSourceCenterEnabled):
2446         * platform/mock/MockRealtimeMediaSourceCenter.h:
2447
2448 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
2449
2450         Make LOG_WITH_STREAM more efficient
2451         https://bugs.webkit.org/show_bug.cgi?id=197905
2452
2453         Reviewed by Alex Christensen.
2454
2455         No longer need to conditionalize ClipRects logging on the channel being enabled
2456         since LOG_WITH_STREAM fix the performance problem.
2457
2458         Convert some RenderLayerCompositor logging to use LOG_WITH_STREAM.
2459
2460         * rendering/RenderLayer.cpp:
2461         (WebCore::RenderLayer::calculateClipRects const):
2462         (WebCore::clipRectsLogEnabled): Deleted.
2463         * rendering/RenderLayerCompositor.cpp:
2464         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2465         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2466
2467 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
2468
2469         Move RenderLayerCompositor's OverlapMap to its own file
2470         https://bugs.webkit.org/show_bug.cgi?id=197915
2471
2472         Reviewed by Alex Christensen.
2473
2474         Move OverlapMap to its own file.
2475         Make use of RectList, which was in the file but unused!
2476         Allocate OverlapMapContainer on the heap both to avoid header pollution of internals,
2477         and because they will get bigger in future.
2478
2479         No behavior change.
2480
2481         * Sources.txt:
2482         * WebCore.xcodeproj/project.pbxproj:
2483         * rendering/LayerOverlapMap.cpp: Added.
2484         (WebCore::RectList::append):
2485         (WebCore::RectList::intersects const):
2486         (WebCore::OverlapMapContainer::add):
2487         (WebCore::OverlapMapContainer::overlapsLayers const):
2488         (WebCore::OverlapMapContainer::unite):
2489         (WebCore::LayerOverlapMap::LayerOverlapMap):
2490         (WebCore::LayerOverlapMap::add):
2491         (WebCore::LayerOverlapMap::overlapsLayers const):
2492         (WebCore::LayerOverlapMap::pushCompositingContainer):
2493         (WebCore::LayerOverlapMap::popCompositingContainer):
2494         * rendering/LayerOverlapMap.h: Added.
2495         (WebCore::LayerOverlapMap::isEmpty const):
2496         (WebCore::LayerOverlapMap::geometryMap const):
2497         (WebCore::LayerOverlapMap::geometryMap):
2498         * rendering/RenderLayerCompositor.cpp:
2499         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2500         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2501         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2502         (WebCore::RenderLayerCompositor::computeExtent const):
2503         (WebCore::RenderLayerCompositor::addToOverlapMap):
2504         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
2505         (WebCore::OverlapMapContainer::add): Deleted.
2506         (WebCore::OverlapMapContainer::overlapsLayers const): Deleted.
2507         (WebCore::OverlapMapContainer::unite): Deleted.
2508         (WebCore::RenderLayerCompositor::OverlapMap::OverlapMap): Deleted.
2509         (WebCore::RenderLayerCompositor::OverlapMap::add): Deleted.
2510         (WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers const): Deleted.
2511         (WebCore::RenderLayerCompositor::OverlapMap::isEmpty const): Deleted.
2512         (WebCore::RenderLayerCompositor::OverlapMap::pushCompositingContainer): Deleted.
2513         (WebCore::RenderLayerCompositor::OverlapMap::popCompositingContainer): Deleted.
2514         (WebCore::RenderLayerCompositor::OverlapMap::geometryMap const): Deleted.
2515         (WebCore::RenderLayerCompositor::OverlapMap::geometryMap): Deleted.
2516         (WebCore::RenderLayerCompositor::OverlapMap::RectList::append): Deleted.
2517         (WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects const): Deleted.
2518         * rendering/RenderLayerCompositor.h:
2519
2520 2019-05-15  Devin Rousso  <drousso@apple.com>
2521
2522         Web Automation: elements larger than the viewport have incorrect in-view center point
2523         https://bugs.webkit.org/show_bug.cgi?id=195696
2524         <rdar://problem/48737122>
2525
2526         Reviewed by Simon Fraser.
2527
2528         Original patch by Brian Burg <bburg@apple.com>.
2529
2530         Some conversion methods do not exist for `FloatRect`/`FloatPoint`. Fill them in as needed,
2531         and export some symbols used by WebDriver code to compute an element's in-view center point
2532         in various coordinate systems.
2533
2534         * dom/TreeScope.h:
2535         * dom/TreeScope.cpp:
2536         (WebCore::TreeScope::elementsFromPoint): Added.
2537         * page/FrameView.h:
2538         * page/FrameView.cpp:
2539         (WebCore::FrameView::absoluteToLayoutViewportPoint const): Added.
2540         (WebCore::FrameView::layoutViewportToAbsoluteRect const): Added.
2541         (WebCore::FrameView::absoluteToLayoutViewportRect const): Added.
2542         * platform/ScrollView.h:
2543         * platform/ScrollView.cpp:
2544         (WebCore::ScrollView::viewToContents const): Added.
2545         (WebCore::ScrollView::contentsToView const): Added.
2546         (WebCore::ScrollView::contentsToRootView const): Added.
2547         * platform/Widget.h:
2548         * platform/Widget.cpp:
2549         (WebCore::Widget::convertToRootView const): Added.
2550         (WebCore::Widget::convertFromRootView const): Added.
2551         (WebCore::Widget::convertToContainingView const): Added.
2552         (WebCore::Widget::convertFromContainingView const): Added.
2553
2554 2019-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2555
2556         Missing cursor/caret showing in search field on google.com
2557         https://bugs.webkit.org/show_bug.cgi?id=197862
2558         <rdar://problem/50291989>
2559
2560         Reviewed by Simon Fraser.
2561
2562         In this bug, the search field is inside of a fixed position container, which is inside of an empty "overflow:
2563         hidden" form element (the new layout test demonstrates a simple version of this). The layer of the fixed
2564         position container's renderer has an overflow clipping layer of itself, and its clipping rect is non-empty, so
2565         the heuristic initially identifies the layer as not fully clipped. However, as the heuristic ascends the
2566         RenderLayer tree, it then finds the layer for the "overflow: hidden" form element's renderer; this layer is
2567         completely clipped, which causes the heuristic to incorrectly believe that the editable element is completely
2568         clipped.
2569
2570         To fix the bug, this patch reworks the clipping portion of the heuristic, such that we no longer need to ascend
2571         the layer tree. Instead of computing the clip rect relative to the nearest ancestor that has an overflow clip
2572         and then walking up the layer tree repeating this process, simply compute the clip rect relative to RenderView's
2573         layer, and then walk up to the parent frame and repeat if necessary.
2574
2575         Test: editing/selection/ios/do-not-hide-selection-in-visible-field.html
2576
2577         * rendering/RenderLayer.cpp:
2578         (WebCore::RenderLayer::isTransparentOrFullyClippedRespectingParentFrames const):
2579
2580 2019-05-14  Andy Estes  <aestes@apple.com>
2581
2582         [Apple Pay] Payment APIs should be completely disabled in web views into which clients have injected user scripts
2583         https://bugs.webkit.org/show_bug.cgi?id=197751
2584         <rdar://problem/50631563>
2585
2586         Reviewed by Alex Christensen.
2587
2588         In r243324, when a document has had user agent scripts injected into it, payment APIs were
2589         disabled at runtime by having all entry points return falsy values or throw exceptions
2590         (e.g., ApplePaySession.canMakePayments() returns false).
2591
2592         In the case of user scripts in particular (e.g., WKUserScript), since we know whether these
2593         exist at the time we create a document's DOMWindow, we can do better than r243324 by
2594         completely disabling the payment APIs in the presence of user scripts.
2595
2596         To achieve this, this change introduces the 'EnabledByContext' extended attribute for
2597         interfaces, which instructs the bindings generator to add a conjunct to the payment API
2598         constructors that asks the interface's implementation class whether it should be enabled for
2599         a given ScriptExecutionContext. The PaymentRequest and ApplePaySession interfaces adopt this
2600         new extended attribute to implement the new user script check.
2601
2602         Added new API tests.
2603
2604         * Modules/applepay/ApplePaySession.idl:
2605         * Modules/applepay/PaymentCoordinator.cpp:
2606         (WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):
2607         * Modules/applepay/PaymentCoordinator.h:
2608         * Modules/applepay/PaymentSession.cpp:
2609         (WebCore::PaymentSession::enabledForContext):
2610         * Modules/applepay/PaymentSession.h:
2611         * Modules/paymentrequest/PaymentHandler.cpp:
2612         (WebCore::PaymentHandler::enabledForContext):
2613         * Modules/paymentrequest/PaymentHandler.h:
2614         * Modules/paymentrequest/PaymentRequest.cpp:
2615         (WebCore::PaymentRequest::enabledForContext):
2616         * Modules/paymentrequest/PaymentRequest.h:
2617         * Modules/paymentrequest/PaymentRequest.idl:
2618         * bindings/scripts/CodeGeneratorJS.pm:
2619         (NeedsRuntimeCheck):
2620         (GenerateRuntimeEnableConditionalString):
2621         * bindings/scripts/IDLAttributes.json:
2622         * bindings/scripts/preprocess-idls.pl:
2623         (GenerateConstructorAttributes):
2624         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp: Added.
2625         * bindings/scripts/test/JS/JSTestEnabledForContext.h: Added.
2626         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2627         (WebCore::JSTestGlobalObject::finishCreation):
2628         (WebCore::jsTestGlobalObjectTestEnabledForContextConstructorGetter):
2629         (WebCore::jsTestGlobalObjectTestEnabledForContextConstructor):
2630         (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructorSetter):
2631         (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructor):
2632         * bindings/scripts/test/TestEnabledForContext.idl: Added.
2633
2634 2019-05-14  Robin Morisset  <rmorisset@apple.com>
2635
2636         [WHLSL] parseEffectfulSuffix() is never called
2637         https://bugs.webkit.org/show_bug.cgi?id=195864
2638         <rdar://problem/50746278>
2639
2640         Reviewed by Myles C. Maxfield.
2641
2642         The fix is trivial: when parseEffectfulPrefix does not see a ++ or --, it must call parseEffectfulSuffix.
2643
2644         No test yet, as it is not testable until the property resolver is finished.
2645         It will be tested with the rest of the compiler, when we port the testsuite from the js implementation (it already covers this case).
2646
2647         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2648         (WebCore::WHLSL::Parser::parseEffectfulPrefix):
2649
2650 2019-05-14  Robin Morisset  <rmorisset@apple.com>
2651
2652         [WHLSL] parseEffectfulAssignment should not call parseCallExpression directly
2653         https://bugs.webkit.org/show_bug.cgi?id=197890
2654
2655         Reviewed by Myles Maxfield.
2656
2657         callExpression already appears in effSuffix which is in effPrefix which is in effAssignment, so having it directly in effAssignment as well is useless (and ambiguous).
2658         I've already fixed the grammar (https://github.com/gpuweb/WHLSL/commit/a07005f4d692fe3370618dca5db218992b362049), the grammar was always good, this patch is fixing the parser.
2659
2660         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2661         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
2662
2663 2019-05-14  Ross Kirsling  <ross.kirsling@sony.com>
2664
2665         Unreviewed restoration of non-unified build.
2666
2667         * Modules/cache/DOMCache.cpp:
2668         * bindings/js/JSLazyEventListener.h:
2669         * loader/NavigationScheduler.h:
2670         * page/Quirks.cpp:
2671         * page/Quirks.h:
2672         * rendering/ClipRect.cpp:
2673
2674 2019-05-14  Zalan Bujtas  <zalan@apple.com>
2675
2676         Do not try to issue repaint while the render tree is being destroyed.
2677         https://bugs.webkit.org/show_bug.cgi?id=197461
2678         <rdar://problem/50368992>
2679
2680         Reviewed by Simon Fraser.
2681
2682         Test: http/tests/svg/crash-on-reload-with-filter.html
2683
2684         We don't need to compute repaint rects when the render tree is getting torn down. We'll issue a full repaint at some point.
2685         Also during full render tree destruction the inline tree state is undefined. We should avoid accessing it.
2686
2687         * rendering/svg/RenderSVGResourceContainer.cpp:
2688         (WebCore::RenderSVGResourceContainer::markAllClientLayersForInvalidation):
2689
2690 2019-05-14  Youenn Fablet  <youenn@apple.com>
2691
2692         A service worker process should app nap when all its clients app nap
2693         https://bugs.webkit.org/show_bug.cgi?id=185626
2694         <rdar://problem/46785908>
2695
2696         Reviewed by Alex Christensen.
2697
2698         Update RegistrableDomain to work with SecurityOriginData.
2699         Add internal API to enable accessing to service worker process throttle state.
2700
2701         Test: http/wpt/service-workers/mac/processSuppression.https.html
2702
2703         * platform/RegistrableDomain.h:
2704         (WebCore::RegistrableDomain::RegistrableDomain):
2705         (WebCore::RegistrableDomain::matches const):
2706         (WebCore::RegistrableDomain::registrableDomainFromHost):
2707         * testing/ServiceWorkerInternals.cpp:
2708         (WebCore::ServiceWorkerInternals::isThrottleable const):
2709         * testing/ServiceWorkerInternals.h:
2710         * testing/ServiceWorkerInternals.idl:
2711         * workers/service/SWClientConnection.h:
2712         * workers/service/context/SWContextManager.cpp:
2713         * workers/service/context/SWContextManager.h:
2714         * workers/service/server/SWServer.cpp:
2715         (WebCore::SWServer::serverToContextConnectionCreated):
2716         * workers/service/server/SWServer.h:
2717         (WebCore::SWServer::Connection::server const):
2718         (WebCore::SWServer::connections const):
2719         * workers/service/server/SWServerToContextConnection.h:
2720
2721 2019-05-14  Youenn Fablet  <youenn@apple.com>
2722
2723         getUserMedia capture changes on iOS after homing out
2724         https://bugs.webkit.org/show_bug.cgi?id=197707
2725
2726         Reviewed by Eric Carlson.
2727
2728         In case of muting an AVVideoCaptureSource on iOS, the session is cleared.
2729         We need to store the preset information, to setup the new session on unnmuting correctly.
2730         Manually tested.
2731
2732         * platform/mediastream/mac/AVVideoCaptureSource.h:
2733         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2734         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
2735         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
2736         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2737
2738 2019-05-14  Oriol Brufau  <obrufau@igalia.com>
2739
2740         [css-grid] Update grid when changing auto repeat type
2741         https://bugs.webkit.org/show_bug.cgi?id=197849
2742
2743         Reviewed by Javier Fernandez.
2744
2745         Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-change-auto-repeat-tracks.html
2746
2747         This patch makes two 'repeat()' values for 'grid-template' be considered
2748         to be different if one uses 'auto-fill' and the other 'auto-fit'.
2749
2750         Previously, they were considered to be equal if the repeated values
2751         were the same, without comparing the repeat type. Therefore, the grid
2752         was not updated when setting both values one after the other.
2753
2754         * css/CSSGridAutoRepeatValue.cpp:
2755         (WebCore::CSSGridAutoRepeatValue::equals const):
2756         * css/CSSGridAutoRepeatValue.h:
2757
2758 2019-05-14  Antti Koivisto  <antti@apple.com>
2759
2760         Event region computation should respect transforms
2761         https://bugs.webkit.org/show_bug.cgi?id=197836
2762         <rdar://problem/50762971>
2763
2764         Reviewed by Darin Adler.
2765
2766         * platform/graphics/transforms/AffineTransform.cpp:
2767         (WebCore::AffineTransform::mapRegion const):
2768
2769         Add support for transforming regions. Non-rectlinear results use enclosing rects.
2770
2771         * platform/graphics/transforms/AffineTransform.h:
2772         * rendering/EventRegion.cpp:
2773         (WebCore::EventRegionContext::EventRegionContext):
2774         (WebCore::EventRegionContext::pushTransform):
2775         (WebCore::EventRegionContext::popTransform):
2776         (WebCore::EventRegionContext::unite):
2777         (WebCore::EventRegionContext::contains const):
2778
2779         Add a context object that holds the current transform.
2780
2781         * rendering/EventRegion.h:
2782         (WebCore::EventRegion::makeContext):
2783         * rendering/InlineTextBox.cpp:
2784         (WebCore::InlineTextBox::paint):
2785         * rendering/PaintInfo.h:
2786
2787         Replace the region object with the context.
2788
2789         * rendering/RenderBlock.cpp:
2790         (WebCore::RenderBlock::paintObject):
2791         * rendering/RenderLayer.cpp:
2792         (WebCore::RenderLayer::paintLayerByApplyingTransform):
2793
2794         Apply transforms to regions if needed.
2795
2796         (WebCore::RenderLayer::collectEventRegionForFragments):
2797         * rendering/RenderLayer.h:
2798         * rendering/RenderLayerBacking.cpp:
2799         (WebCore::RenderLayerBacking::updateEventRegion):
2800         * rendering/SimpleLineLayoutFunctions.cpp:
2801         (WebCore::SimpleLineLayout::paintFlow):
2802
2803 2019-05-14  Youenn Fablet  <youenn@apple.com>
2804
2805         Video frame resizing should be using Trim
2806         https://bugs.webkit.org/show_bug.cgi?id=197722
2807         <rdar://problem/50602188>
2808
2809         Reviewed by Eric Carlson.
2810
2811         Move from letter box to trim mode for resizing.
2812         This ensures no black stripes are present when rendering the stream.
2813
2814         Test: fast/mediastream/resize-trim.html
2815
2816         * platform/cocoa/VideoToolboxSoftLink.cpp:
2817         * platform/cocoa/VideoToolboxSoftLink.h:
2818         * platform/graphics/cv/ImageTransferSessionVT.mm:
2819         (WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
2820
2821 2019-05-14  Yusuke Suzuki  <ysuzuki@apple.com>
2822
2823         [JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
2824         https://bugs.webkit.org/show_bug.cgi?id=197833
2825
2826         Reviewed by Darin Adler.
2827
2828         * testing/Internals.cpp:
2829         (WebCore::Internals::parserMetaData):
2830
2831 2019-05-14  Antoine Quint  <graouts@apple.com>
2832
2833         [Pointer Events] The pointerenter and pointerleave events target the wrong element on iOS
2834         https://bugs.webkit.org/show_bug.cgi?id=197881
2835         <rdar://problem/50187657>
2836
2837         Reviewed by Dean Jackson.
2838
2839         Test: pointerevents/ios/enter-leave-target.html
2840
2841         The "pointerenter" and "pointerleave" should target the element on which the event listener was added and not
2842         the element that would otherwise hit test. This matches the behavior of "mouseenter" and "mouseleave" on macOS.
2843
2844         * page/PointerCaptureController.cpp:
2845         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
2846
2847 2019-05-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
2848
2849         [CG] Adding support for HEIF-sequence ('public.heics') images
2850         https://bugs.webkit.org/show_bug.cgi?id=197384
2851
2852         Reviewed by Simon Fraser.
2853
2854         -- Get the image repetitionCount and the frame duration.
2855         -- Add a new function setAdditionalSupportedImageTypesForTesting() which
2856            takes a delimited String.
2857         -- Add internal APIs to retrive the image frame count and the frame
2858            duration.
2859
2860         Tests: fast/images/animated-heics-draw.html
2861                fast/images/animated-heics-verify.html
2862
2863         * platform/graphics/ImageSource.h:
2864         * platform/graphics/cg/ImageDecoderCG.cpp:
2865         (WebCore::animationPropertiesFromProperties):
2866         (WebCore::animationHEICSPropertiesFromProperties):
2867         (WebCore::ImageDecoderCG::repetitionCount const):
2868         (WebCore::ImageDecoderCG::frameDurationAtIndex const):
2869         * platform/graphics/cg/UTIRegistry.cpp:
2870         (WebCore::setAdditionalSupportedImageTypesForTesting):
2871         * platform/graphics/cg/UTIRegistry.h:
2872         * testing/Internals.cpp:
2873         (WebCore::Internals::imageFrameCount):
2874         (WebCore::Internals::imageFrameDurationAtIndex):
2875         * testing/Internals.h:
2876         * testing/Internals.idl:
2877         * testing/js/WebCoreTestSupport.cpp:
2878         (WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting):
2879         * testing/js/WebCoreTestSupport.h:
2880
2881 2019-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
2882
2883         [css-grid] Use max size to compute auto repeat tracks
2884         https://bugs.webkit.org/show_bug.cgi?id=197854
2885
2886         Reviewed by Javier Fernandez.
2887
2888         When available size is indefinite we should use max size to compute the number of auto repeat tracks.
2889
2890         The spec text is very clear (https://drafts.csswg.org/css-grid/#auto-repeat):
2891         > When auto-fill is given as the repetition number, if the grid container
2892         > has a definite size or **max size** in the relevant axis...
2893
2894         So far we were not doing that for widths, in this patch we modify RenderGrid::computeAutoRepeatTracksCount()
2895         to do the same than for heights.
2896
2897         We also take advantage to fix problems related to min|max sizes and box-sizing property,
2898         that were inconsistent for columns and rows.
2899
2900         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html
2901                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html
2902                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html
2903                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html
2904                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html
2905
2906         * rendering/RenderGrid.cpp:
2907         (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
2908
2909 2019-05-14  Joonghun Park  <pjh0718@gmail.com>
2910
2911         Implement page-break-* and -webkit-column-break-* as legacy-shorthands.
2912         https://bugs.webkit.org/show_bug.cgi?id=197656
2913
2914         Reviewed by Darin Adler.
2915
2916         According to https://drafts.csswg.org/css-cascade-4/#legacy-shorthand,
2917         implement page-break-* and -webkit-column-break-* as legacy-shorthands for break-*.
2918
2919         This change also serialize page-break-* properties
2920         to CSSStyleDeclaration,
2921         per https://drafts.csswg.org/css-break/#page-break-properties.
2922
2923         * css/CSSProperties.json:
2924         * css/StyleBuilderConverter.h:
2925         (WebCore::StyleBuilderConverter::convertFontSynthesis):
2926         (WebCore::StyleBuilderConverter::convertPageBreakBetween): Deleted.
2927         (WebCore::StyleBuilderConverter::convertPageBreakInside): Deleted.
2928         (WebCore::StyleBuilderConverter::convertColumnBreakBetween): Deleted.
2929         (WebCore::StyleBuilderConverter::convertColumnBreakInside): Deleted.
2930         * css/StyleProperties.cpp:
2931         (WebCore::StyleProperties::getPropertyValue const):
2932         (WebCore::StyleProperties::pageBreakPropertyValue const):
2933         * css/StyleProperties.h:
2934         * css/parser/CSSPropertyParser.cpp:
2935         (WebCore::CSSPropertyParser::parseValueStart):
2936         (WebCore::mapFromPageBreakBetween):
2937         (WebCore::CSSPropertyParser::parseShorthand):
2938         (WebCore::isLegacyBreakProperty): Deleted.
2939
2940 2019-05-14  Javier Fernandez  <jfernandez@igalia.com>
2941
2942         Implement "line-break: anywhere"
2943         https://bugs.webkit.org/show_bug.cgi?id=181169
2944         <rdar://problem/48507088>
2945
2946         Reviewed by Myles C. Maxfield.
2947
2948         The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
2949         CSS property in order to allow additional breaking opportunities not
2950         considered in the definition of the 'word-break: break-all'.
2951
2952         [1] https://github.com/w3c/csswg-drafts/issues/1171
2953
2954         Tests: imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html
2955                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html
2956                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html
2957                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html
2958                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html
2959                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html
2960                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html
2961                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html
2962                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html
2963                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html
2964                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html
2965                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html
2966                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html
2967                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html
2968                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html
2969                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html
2970                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html
2971                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html
2972
2973         * css/CSSPrimitiveValueMappings.h:
2974         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2975         (WebCore::CSSPrimitiveValue::operator LineBreak const):
2976         * css/CSSProperties.json:
2977         * css/CSSValueKeywords.in:
2978         * css/parser/CSSParserFastPaths.cpp:
2979         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2980         * rendering/BreakLines.h:
2981         (WebCore::nextBreakablePositionBreakCharacter):
2982         (WebCore::isBreakable):
2983         * rendering/RenderText.cpp:
2984         (WebCore::mapLineBreakToIteratorMode):
2985         (WebCore::RenderText::computePreferredLogicalWidths):
2986         * rendering/line/BreakingContext.h:
2987         (WebCore::BreakingContext::handleText):
2988         * rendering/style/RenderStyleConstants.h:
2989
2990 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
2991
2992         Unreviewed, build fix after 245258, missing ThreadSpecific.h include
2993         https://bugs.webkit.org/show_bug.cgi?id=197146
2994
2995         * platform/ios/wak/WebCoreThread.mm:
2996
2997 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
2998
2999         [WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
3000         https://bugs.webkit.org/show_bug.cgi?id=197146
3001
3002         Reviewed by Saam Barati.
3003
3004         * Modules/indexeddb/IDBDatabase.cpp:
3005         (WebCore::IDBDatabase::hasPendingActivity const):
3006         * Modules/indexeddb/IDBRequest.cpp:
3007         (WebCore::IDBRequest::hasPendingActivity const):
3008         * Modules/indexeddb/IDBTransaction.cpp:
3009         (WebCore::IDBTransaction::hasPendingActivity const):
3010
3011 2019-05-13  Geoffrey Garen  <ggaren@apple.com>
3012
3013         Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files
3014         https://bugs.webkit.org/show_bug.cgi?id=197760
3015
3016         Reviewed by Jer Noble.
3017
3018         Only makeSafeToUseMemoryMapForPath() if needed. (Fixed missing brace.)
3019
3020         * platform/sql/SQLiteDatabase.cpp:
3021         (WebCore::SQLiteDatabase::open):
3022
3023 2019-05-13  Tadeu Zagallo  <tzagallo@apple.com>
3024
3025         JSObject::getOwnPropertyDescriptor is missing an exception check
3026         https://bugs.webkit.org/show_bug.cgi?id=197693
3027
3028         Reviewed by Saam Barati.
3029
3030         JSObject::getOwnPropertyDescriptor assumes that getOwnPropertySlot returns false
3031         if an exception is thrown, but that was not true for JSLocation::getOwnPropertySlotCommon.
3032
3033         This is already covered by http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html
3034
3035         * bindings/js/JSLocationCustom.cpp:
3036         (WebCore::getOwnPropertySlotCommon):
3037         (WebCore::JSLocation::getOwnPropertySlot):
3038         (WebCore::JSLocation::getOwnPropertySlotByIndex):
3039
3040 2019-05-13  Antti Koivisto  <antti@apple.com>
3041
3042         REGRESSION (r245208): compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html asserts
3043         https://bugs.webkit.org/show_bug.cgi?id=197818
3044         <rdar://problem/50705762>
3045
3046         Reviewed by Simon Fraser.
3047
3048         Tests: fast/scrolling/ios/event-region-scale-transform-shared.html
3049                fast/scrolling/ios/event-region-translate-transform-shared.html
3050
3051         This fixes the assert. However the added tests demonstrate that transform is not taken into account
3052         when computing the event region, https://bugs.webkit.org/show_bug.cgi?id=197836.
3053
3054         * rendering/RenderLayerBacking.cpp:
3055         (WebCore::RenderLayerBacking::updateEventRegion):
3056
3057 2019-05-13  Wenson Hsieh  <wenson_hsieh@apple.com>
3058
3059         [macOS] Font formatting options don't work when composing a message in Yahoo mail
3060         https://bugs.webkit.org/show_bug.cgi?id=197813
3061         <rdar://problem/49382250>
3062
3063         Reviewed by Darin Adler.
3064
3065         The bug happens because on mousedown, the "Aa Font" menu item's event handler hides itself before changing the
3066         font at the text selection. This causes us to clear the selection in FocusController::setFocusedElement.
3067
3068         There is existing logic in clearSelectionIfNeeded that would normally prevent us from clearing the selection due
3069         to the mousePressNode not being able to start a selection. However, since the clickable element in this case is
3070         hidden during mousedown, it is missing a renderer, and we bail from the `mousePressNode->renderer() &&
3071         !mousePressNode->canStartSelection()` check as a result.
3072
3073         This check was orginally added in https://trac.webkit.org/r24334 to avoid clearing the selection when clicking
3074         a button; the intention appears to have been making it so that clicking on something that could not start a
3075         selection (back then, synonymous with -webkit-user-select: ignore;) would not clear the current selection; to
3076         this end, it seems odd to additionally require that the thing being clicked should still have a renderer, so
3077         it seems safe to remove this requirement.
3078
3079         Test: editing/selection/preserve-selection-when-clicking-button.html
3080
3081         * page/FocusController.cpp:
3082         (WebCore::clearSelectionIfNeeded):
3083
3084 2019-05-13  Eric Carlson  <eric.carlson@apple.com>
3085
3086         https://bugs.webkit.org/show_bug.cgi?id=197793
3087         <rdar://problem/46429187>
3088
3089         Unreviewed, build fix after r245199.
3090
3091         * platform/audio/ios/MediaSessionManagerIOS.mm:
3092         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
3093
3094 2019-05-13  Darin Adler  <darin@apple.com>
3095
3096         WHLSLPrepare.cpp always recompiles, even if nothing was changed
3097         https://bugs.webkit.org/show_bug.cgi?id=197151
3098
3099         Reviewed by Dan Bernstein and Keith Rollin.
3100
3101         * DerivedSources-input.xcfilelist: Script updated this automatically after
3102         DerivedSources.make was corrected.
3103         * DerivedSources-output.xcfilelist: Ditto, although I had to manually remove
3104         one bogus leftover reference to WHLSLStandardLibrary.cpp.
3105
3106         * DerivedSources.make: Updated the rule that builds WHSLStandardLibrary.h to
3107         no longer refer to nonexistent WHLSLStandardLibrary.cpp. Because the dependency
3108         was on a file that was never created, the rule to regenerate WHSLStandardLibrary.h
3109         was running on every build, instead of only when one of the dependencies changed.
3110
3111 2019-05-12  Simon Fraser  <simon.fraser@apple.com>
3112
3113         When the set of backing-sharing layers changes, we need to issue a repaint
3114         https://bugs.webkit.org/show_bug.cgi?id=197825
3115
3116         Reviewed by Zalan Bujtas.
3117
3118         If the set of layers painting into a shared backing store changes, we need
3119         to repaint that backing store. This happens when scrolling as shared layers
3120         enter the visible area.
3121
3122         Test: compositing/shared-backing/overflow-scroll/repaint-shared-on-scroll.html
3123
3124         * rendering/RenderLayerBacking.cpp:
3125         (WebCore::RenderLayerBacking::setBackingSharingLayers):
3126
3127 2019-05-02  Simon Fraser  <simon.fraser@apple.com>
3128
3129         Add logging for RenderLayer clip rects
3130         https://bugs.webkit.org/show_bug.cgi?id=197547
3131
3132         Reviewed by Zalan Bujtas.
3133
3134         Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
3135
3136         The ClipRect code is performance sensitive, even in debug, so guard the log sites
3137         with clipRectsLogEnabled() because the macro still evaluates its arguments even if
3138         the channel is disabled (we need some better way to log that doesn't do this).
3139
3140         * platform/Logging.h:
3141         * rendering/ClipRect.cpp:
3142         (WebCore::operator<<):
3143         * rendering/ClipRect.h:
3144         * rendering/RenderLayer.cpp:
3145         (WebCore::operator<<):
3146         (WebCore::RenderLayer::calculateClipRects const):
3147         * rendering/RenderLayer.h:
3148
3149 2019-05-12  Simon Fraser  <simon.fraser@apple.com>
3150
3151         Refactor composited backing-sharing code
3152         https://bugs.webkit.org/show_bug.cgi?id=197824
3153
3154         Reviewed by Zalan Bujtas.
3155
3156         Clean up the backing-sharing code to share more code, and make it easier to understand.
3157         
3158         Moves more logic into member functions on BackingSharingState, which are named to make
3159         their functions clearer: startBackingSharingSequence/endBackingSharingSequence.
3160         
3161         computeCompositingRequirements() and traverseUnchangedSubtree() now just call
3162         updateBeforeDescendantTraversal/updateAfterDescendantTraversal.
3163
3164         No behavior change.
3165
3166         * rendering/RenderLayerBacking.cpp:
3167         (WebCore::RenderLayerBacking::willBeDestroyed):
3168         (WebCore::RenderLayerBacking::setBackingSharingLayers): Remove the early return, since
3169         we need to call setBackingProviderLayer() on the sharing layers in both code paths.
3170         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
3171         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
3172         * rendering/RenderLayerCompositor.cpp:
3173         (WebCore::RenderLayerCompositor::BackingSharingState::backingProviderCandidate const):
3174         (WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer):
3175         (WebCore::RenderLayerCompositor::BackingSharingState::startBackingSharingSequence):
3176         (WebCore::RenderLayerCompositor::BackingSharingState::endBackingSharingSequence):
3177         (WebCore::RenderLayerCompositor::BackingSharingState::updateBeforeDescendantTraversal):
3178         (WebCore::RenderLayerCompositor::BackingSharingState::updateAfterDescendantTraversal):
3179         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3180         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
3181         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate): Deleted.
3182         * rendering/RenderLayerCompositor.h:
3183
3184 2019-05-12  Youenn Fablet  <youenn@apple.com>
3185
3186         Use clampTo in AVVideoCaptureSource::setSizeAndFrameRateWithPreset
3187         https://bugs.webkit.org/show_bug.cgi?id=197704
3188
3189         Reviewed by Alex Christensen.
3190
3191         Use clampTo as suggested in bug 196214 review.
3192         No change of behavior.
3193
3194         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3195         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
3196
3197 2019-05-12  Youenn Fablet  <youenn@apple.com>
3198
3199         Use the main screen for screen capture
3200         https://bugs.webkit.org/show_bug.cgi?id=197804
3201         <rdar://problem/47671383>
3202
3203         Reviewed by Eric Carlson.
3204
3205         If the main screen, i.e. the screen that has focus at the time of
3206         selection of the screen to capture, is capturable, add it to the list
3207         of screen devices, but do not add any other screen.
3208         This will make sure the main screen is selected.
3209         Manually tested.
3210
3211         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
3212         (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices):
3213
3214 2019-05-12  Takashi Komori  <Takashi.Komori@sony.com>
3215
3216         [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
3217         https://bugs.webkit.org/show_bug.cgi?id=197650
3218
3219         Reviewed by Fujii Hironori.
3220
3221         When Curl port accesses a page which checks Basic Authentication credential and server trust challenge occurs,
3222         Curl port calls extra didReceiveAuthenticationChallenge unnecessarily.
3223         This is because Curl port discards information about allowed server trust challenge before in NetworkDataTaskCurl::restartWithCredential.
3224
3225         Test: http/tests/ssl/curl/certificate-and-authentication.html
3226
3227         * platform/network/curl/CurlRequest.h:
3228         (WebCore::CurlRequest::isServerTrustEvaluationDisabled):
3229
3230 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
3231
3232         Overflow scroll that becomes non-scrollable should stop being composited
3233         https://bugs.webkit.org/show_bug.cgi?id=197817
3234         <rdar://problem/50697290>
3235
3236         Reviewed by Antti Koivisto.
3237
3238         Remove the iOS-specific #ifdef around code that triggers a compositing re-evaluation
3239         when scrolling state changes.
3240
3241         Test: compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html
3242
3243         * rendering/RenderLayer.cpp:
3244         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
3245
3246 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
3247
3248         Layer bounds are incorrect for sharing layers that paint with transforms
3249         https://bugs.webkit.org/show_bug.cgi?id=197768
3250         <rdar://problem/50695493>
3251
3252         Reviewed by Zalan Bujtas.
3253
3254         We don't need to traverse shared layers if the backing-provider has overflow clip,
3255         because we know they are containing-block descendants and therefore clipped.
3256
3257         Note tha the CSS "clip" property doesn't guarantee this, because the clip rect
3258         can be larger than the element, so in that case we just traverse shared layers.
3259
3260         Tests: compositing/shared-backing/sharing-bounds-clip.html
3261                compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html
3262                compositing/shared-backing/sharing-bounds-transformed-sharing-layer.html
3263                compositing/shared-backing/sharing-bounds.html
3264
3265         * rendering/RenderLayerBacking.cpp:
3266         (WebCore::RenderLayerBacking::updateCompositedBounds):
3267
3268 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
3269
3270         Translucent gradient rendering bug due to will-change transform
3271         https://bugs.webkit.org/show_bug.cgi?id=197654
3272         <rdar://problem/50547664>
3273
3274         Reviewed by Dean Jackson.
3275         
3276         We failed to re-evaluate 'contentsOpaque' when a background changed, because this
3277         happened in updateGeometry() and that doesn't run for background changes.
3278         
3279         However, 'contentsOpaque' also requires knowing about geometry because we have to
3280         turn it off when there's subpixel positioning, and updateConfiguration()
3281         runs before updateGeometry().
3282         
3283         So compute m_hasSubpixelRounding in updateGeometry() and set contentsOpaque in
3284         updateAfterDescendants().
3285
3286         Test: compositing/contents-opaque/background-change-to-transparent.html
3287
3288         * rendering/RenderLayerBacking.cpp:
3289         (WebCore::RenderLayerBacking::updateConfiguration):
3290         (WebCore::RenderLayerBacking::updateGeometry):
3291         (WebCore::RenderLayerBacking::updateAfterDescendants):
3292         * rendering/RenderLayerBacking.h:
3293
3294 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
3295
3296         When the scroller hosting a shared layer becomes non-scrollable, content disappears
3297         https://bugs.webkit.org/show_bug.cgi?id=197766
3298         <rdar://problem/50695808>
3299
3300         Reviewed by Zalan Bujtas.
3301
3302         RenderLayerCompositor::requiresOwnBackingStore() should return true for a layer that shares
3303         its backing store. We always made backing for overlap layers, so even  if the sharing layers
3304         have no painted content, this should rarely be a backing store memory regression.
3305
3306         Test: compositing/shared-backing/overflow-scroll/sharing-layer-becomes-non-scrollable.html
3307
3308         * rendering/RenderLayerCompositor.cpp:
3309         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
3310
3311 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
3312
3313         Backing-sharing layers with transforms render incorrectly
3314         https://bugs.webkit.org/show_bug.cgi?id=197692
3315         <rdar://problem/50652127>
3316
3317         Reviewed by Antti Koivisto.
3318
3319         Layers that paint into shared backing need to enter the RenderLayer painting code
3320         in a way that paints the filters, transforms, opacity and blending.
3321         
3322         RenderLayerBacking::paintIntoLayer() normally enters at paintLayerContents(), because
3323         the effects are rendered via the GraphicsLayer, but shared layers will paint effects.
3324         Note that if the backing-provider has effects, it will be the stacking context
3325         for the shared layers, so it's correct that sharing layers are impacted by effects
3326         on the backing-provider.
3327
3328         In addition, we have to ensure that we don't over-eagerly make layers shared.
3329         Consider:
3330         
3331         <div class="clipping">
3332             <div class="sharing">
3333                 <div class="inner">
3334                 </div>
3335             </div>
3336         </div>
3337         
3338         Here "clipping" is the provider layer, "sharing" paints into shared backing, but
3339         we don't want to also mark "inner" as sharing, since "sharing" will just paint it.
3340         This is akin to avoiding unnecessary compositing of z-order descendants when they can just
3341         paint.
3342         
3343         To do this we need to ensure that sharing layers are treated like compositing layers
3344         in the overlap map, i.e. when a layer is sharing, we call overlapMap.pushCompositingContainer(),
3345         and later overlapMap.popCompositingContainer().
3346
3347         Tests: compositing/shared-backing/nested-shared-layers-with-opacity.html
3348                compositing/shared-backing/shared-layer-has-blending.html
3349                compositing/shared-backing/shared-layer-has-filter.html
3350                compositing/shared-backing/shared-layer-has-opacity.html
3351                compositing/shared-backing/shared-layer-has-reflection.html
3352                compositing/shared-backing/shared-layer-has-transform.html
3353                compositing/shared-backing/shared-layer-isolates-blending.html
3354                compositing/shared-backing/shared-transformed-layer-bounds.html
3355                compositing/shared-backing/sharing-layer-becomes-non-scrollable.html
3356                compositing/shared-backing/sharing-layer-has-effect.html
3357
3358         * rendering/RenderLayer.cpp:
3359         (WebCore::RenderLayer::paintLayer):
3360         (WebCore::RenderLayer::paintLayerWithEffects):
3361         * rendering/RenderLayer.h:
3362         * rendering/RenderLayerBacking.cpp:
3363         (WebCore::RenderLayerBacking::paintIntoLayer):
3364         * rendering/RenderLayerCompositor.cpp:
3365         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
3366         (WebCore::backingProviderLayerCanIncludeLayer):
3367         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3368         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
3369
3370 2019-05-10  Youenn Fablet  <youenn@apple.com>
3371
3372         A service worker instance should be terminated when its SWServer is destroyed
3373         https://bugs.webkit.org/show_bug.cgi?id=197801
3374         <rdar://problem/50587270>
3375
3376         Reviewed by Chris Dumez.
3377
3378         On session destruction, the SWServer is destroyed.
3379         At that time, it should terminate all its running service workers.
3380         Covered by updated API test.
3381
3382         * workers/service/server/SWServer.cpp:
3383         (WebCore::SWServer::~SWServer):
3384
3385 2019-05-10  Eric Carlson  <eric.carlson@apple.com>
3386
3387         [iOS] HTMLMediaElement sometimes doesn't send 'webkitplaybacktargetavailabilitychanged' event
3388         https://bugs.webkit.org/show_bug.cgi?id=197793
3389         <rdar://problem/46429187>
3390
3391         Reviewed by Jer Noble.
3392
3393         * html/MediaElementSession.cpp:
3394         (WebCore::MediaElementSession::MediaElementSession): Initialize m_hasPlaybackTargets.
3395
3396         * platform/audio/ios/MediaSessionManagerIOS.mm:
3397         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange): Log
3398         target availability.
3399         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Call the client 
3400         externalOutputDeviceAvailableDidChange method after the AVRouteDetector is available.
3401
3402 2019-05-09  Geoffrey Garen  <ggaren@apple.com>
3403
3404         Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files
3405         https://bugs.webkit.org/show_bug.cgi?id=197760
3406
3407         Reviewed by Jer Noble.
3408
3409         We have all the data we need, and this crash is happening more than
3410         expected.
3411
3412         * platform/sql/SQLiteDatabase.cpp:
3413         (WebCore::SQLiteDatabase::open):
3414
3415 2019-05-10  Zalan Bujtas  <zalan@apple.com>
3416
3417         [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled.
3418         https://bugs.webkit.org/show_bug.cgi?id=197781
3419         <rdar://problem/48027412>
3420
3421         Reviewed by Simon Fraser.
3422
3423         Synthetic bold is essentially two regular glyphs painted with an offset. While on macOS this offset is always 1px (CSS), on iOS larger font produces higher offset value. At paint time, this offset value (in CSS px unit) get converted
3424         to a device pixel value taking context scale into account. This conversion ensures that the gap between the 2 regular glyphs won't get wider (in device pixels) as the user pinch zooms in.
3425         This works as long as the scale on the context is >= 1. This patch ensures that a scaled down context won't blow up this gap.
3426
3427         Test: fast/text/large-synthetic-bold-with-scale-transform.html
3428
3429         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3430         (WebCore::FontCascade::drawGlyphs):
3431
3432 2019-05-10  Brent Fulgham  <bfulgham@apple.com>
3433
3434         Gracefully handle inaccessible font face data
3435         https://bugs.webkit.org/show_bug.cgi?id=197762
3436         <rdar://problem/50433861>
3437
3438         Reviewed by Per Arne Vollan.
3439
3440         Make sure CSS Font Face handling gracefully recovers from
3441         missing font data.
3442
3443         Test: fast/text/missing-font-crash.html
3444
3445         * css/CSSFontFace.cpp:
3446         (WebCore::CSSFontFace::fontLoadEventOccurred):
3447         (WebCore::CSSFontFace::timeoutFired):
3448         (WebCore::CSSFontFace::fontLoaded):
3449         (WebCore::CSSFontFace::font):
3450
3451 2019-05-10  Simon Fraser  <simon.fraser@apple.com>
3452
3453         ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()) on nytimes.com after r245170
3454         https://bugs.webkit.org/show_bug.cgi?id=197776
3455
3456         Reviewed by Zalan Bujtas.
3457
3458         Only try to paint into shared backing for layers that are able to be composited. This
3459         avoids trying to do sharing for non-self-painting layers, which doesn't make sense.
3460
3461         Test: compositing/shared-backing/overflow-scroll/non-self-painting-layer-should-not-share.html
3462
3463         * rendering/RenderLayerCompositor.cpp:
3464         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3465
3466 2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
3467
3468         Fix a bunch of compiler warnings
3469         https://bugs.webkit.org/show_bug.cgi?id=197785
3470
3471         Reviewed by Don Olmstead.
3472
3473         * CMakeLists.txt: WebCoreTestSupport should accept extra SYSTEM includes.
3474         * PlatformGTK.cmake: GTK includes should be added to SYSTEM headers to avoid warnings.
3475         * inspector/InspectorCanvas.cpp: Add preprocessor guards to fix unused function warning.
3476         * rendering/RenderLayer.cpp: Fix unused variable warning.
3477         (WebCore::RenderLayer::updateClipRects):
3478
3479 2019-05-10  Antti Koivisto  <antti@apple.com>
3480
3481         Event region generation needs to know about backing-sharing
3482         https://bugs.webkit.org/show_bug.cgi?id=197694
3483         <rdar://problem/50584991>
3484
3485         Reviewed by Simon Fraser.
3486
3487         Test: pointerevents/ios/touch-action-region-backing-sharing.html
3488
3489         * rendering/RenderLayerBacking.cpp:
3490         (WebCore::RenderLayerBacking::updateEventRegion):
3491
3492         Gather event region from backing sharing layers too.
3493
3494 2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
3495
3496         [WPE][GTK] Add WebKitWebPage::did-associate-form-controls-for-frame and deprecate original did-associate-form-controls
3497         https://bugs.webkit.org/show_bug.cgi?id=197271
3498
3499         Reviewed by Youenn Fablet.
3500
3501         * dom/Document.cpp:
3502         (WebCore::Document::didAssociateFormControlsTimerFired):
3503         * loader/EmptyClients.h:
3504         * page/ChromeClient.h:
3505
3506 2019-05-09  Simon Fraser  <simon.fraser@apple.com>
3507
3508         Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
3509         https://bugs.webkit.org/show_bug.cgi?id=197561
3510         <rdar://problem/50445998>
3511
3512         Reviewed by Antti Koivisto.
3513
3514         This change introduces the concept of layers that share backing store for compositing. A layer
3515         which is sharing its backing store first paints itself, and then some set of layers which come
3516         later in paint order in the same stacking context. This reduces the composited layer count in
3517         some overflow scrolling scenarios, thereby also simplifying the scrolling tree.
3518         
3519         A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At
3520         paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the
3521         painting root so that positioning and clipping just work.
3522         
3523         Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements().
3524         We track the last layer which was composited in paint order as a shared candidate. If a later layer
3525         would composite for overlap (and no other reasons), then we allow it to share with the candidate
3526         if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers
3527         in the same stacking context.
3528         
3529         isComposited() returns false for sharing layers, but they are like composited layers in that
3530         they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them,
3531         and repaints in shared layers have to be directed to their shared layer, hence
3532         changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint().
3533         
3534         The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that
3535         all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use
3536         TemporaryClipRects in that case.
3537
3538         Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html
3539                compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html
3540                compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
3541                compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html
3542                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html
3543                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html
3544                compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html
3545                compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html
3546                compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html
3547                compositing/shared-backing/overflow-scroll/shared-layer-clipping.html
3548                compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html
3549                compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html
3550                compositing/shared-backing/overflow-scroll/shared-layer-repaint.html
3551                compositing/shared-backing/partial-compositing-update.html
3552                compositing/shared-backing/partial-compositing-update2.html
3553                compositing/shared-backing/remove-sharing-layer.html
3554                compositing/shared-backing/sharing-cached-clip-rects.html
3555
3556         * rendering/RenderLayer.cpp:
3557         (WebCore::RenderLayer::~RenderLayer):
3558         (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const):
3559         (WebCore::RenderLayer::setBackingProviderLayer):
3560         (WebCore::RenderLayer::disconnectFromBackingProviderLayer):
3561         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
3562         (WebCore::RenderLayer::clippingRootForPainting const):
3563         (WebCore::RenderLayer::clipToRect):
3564         (WebCore::RenderLayer::paintLayer):
3565         (WebCore::RenderLayer::updateClipRects):
3566         (WebCore::RenderLayer::clipCrossesPaintingBoundary const):
3567         (WebCore::RenderLayer::calculateClipRects const):
3568         (WebCore::outputPaintOrderTreeLegend):
3569         (WebCore::outputPaintOrderTreeRecursive):
3570         (WebCore::inContainingBlockChain): Deleted.
3571         * rendering/RenderLayer.h:
3572         * rendering/RenderLayerBacking.cpp:
3573         (WebCore::RenderLayerBacking::willBeDestroyed):
3574         (WebCore::clearBackingSharingLayerProviders):
3575         (WebCore::RenderLayerBacking::setBackingSharingLayers):
3576         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
3577         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
3578         (WebCore::RenderLayerBacking::updateCompositedBounds):
3579         (WebCore::RenderLayerBacking::updateDrawsContent):
3580         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
3581         (WebCore::RenderLayerBacking::paintIntoLayer):
3582         (WebCore::RenderLayerBacking::paintContents):
3583         * rendering/RenderLayerBacking.h:
3584         * rendering/RenderLayerCompositor.cpp:
3585         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
3586         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren):
3587         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree):
3588         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate):
3589         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3590         (WebCore::backingProviderLayerCanIncludeLayer):
3591         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3592         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
3593         (WebCore::RenderLayerCompositor::updateBacking):
3594         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
3595         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
3596         * rendering/RenderLayerCompositor.h:
3597         * rendering/RenderTreeAsText.cpp:
3598
3599 2019-05-09  Daniel Bates  <dabates@apple.com>
3600
3601         [iOS] Right command key has wrong value for property code
3602         https://bugs.webkit.org/show_bug.cgi?id=193876
3603         <rdar://problem/47577308>
3604
3605         Reviewed by Brent Fulgham.
3606
3607         We're looking for the wrong Windows virtual key code for the right command key.
3608         Substitute VK_APPS for VK_RWIN so we can identify the right command key and return
3609         the correct value for the code property of the DOM key event.
3610
3611         * platform/ios/PlatformEventFactoryIOS.mm:
3612         (WebCore::codeForKeyEvent):
3613
3614 2019-05-09  Daniel Bates  <dabates@apple.com>
3615
3616         [iOS] Numpad comma key has incorrect keyIdentifier property
3617         https://bugs.webkit.org/show_bug.cgi?id=197753
3618         <rdar://problem/50636274>
3619
3620         Reviewed by Brent Fulgham.
3621
3622         Map the Numpad Comma HID usage code to its Window virtual key code, VK_SEPARATOR,
3623         so that can compute the keyIdentifier property for the Numpad Comma key. Also
3624         consider this key as a keypad key just like we do on Mac. There is no discernable
3625         difference for doing so on iOS because the non-keypad code path computes the same result
3626         due to GraphicsServices having fixed up the input string for the Numpad Comma to be
3627         ",", which is want.
3628
3629         * platform/ios/KeyEventIOS.mm:
3630         (WebCore::windowsKeyCodeForKeyCode): Map kHIDUsage_KeypadComma to VK_SEPARATOR.
3631         * platform/ios/PlatformEventFactoryIOS.mm:
3632         (WebCore::codeForKeyEvent): Add a comment to explain that this key is only on
3633         JIS keyboards.
3634         (WebCore::isKeypadEvent): Return true for the Numpad Comma key.
3635
3636 2019-05-09  Zalan Bujtas  <zalan@apple.com>
3637
3638         Do not mix inline and block level boxes.
3639         https://bugs.webkit.org/show_bug.cgi?id=197462
3640         <rdar://problem/50369362>
3641
3642         Reviewed by Antti Koivisto.
3643
3644         This patch tightens the remove-anonymous-wrappers logic by checking if the removal would
3645         produce an inline-block sibling mix.
3646         When a block level box is removed from the tree, we check if after the removal the anonymous sibling block
3647         boxes are still needed or whether we can removed them as well (and have only inline level child boxes).
3648         In addition to checking if the container is anonymous and is part of a continuation, we also need to check
3649         if collapsing it (and by that moving its children one level up) would cause a inline-block box mix.
3650
3651         Test: fast/ruby/continuation-and-column-spanner-crash.html
3652
3653         * rendering/updating/RenderTreeBuilder.cpp:
3654         (WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded):
3655         * rendering/updating/RenderTreeBuilderContinuation.cpp:
3656         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
3657
3658 2019-05-09  Eric Carlson  <eric.carlson@apple.com>
3659
3660         Refine AudioSession route sharing policy
3661         https://bugs.webkit.org/show_bug.cgi?id=197742
3662         <rdar://problem/50590818>
3663
3664         Reviewed by Darin Adler.
3665
3666         No new tests, updated AVAudioSessionRouteSharingPolicy API test.
3667
3668         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
3669         (MediaSessionManagerCocoa::updateSessionState):
3670
3671 2019-05-09  Simon Fraser  <simon.fraser@apple.com>
3672
3673         fast/hidpi/video-controls-in-hidpi.html sometimes asserts in WK1
3674         https://bugs.webkit.org/show_bug.cgi?id=197695
3675
3676         Reviewed by Zalan Bujtas.
3677
3678         With the backing-sharing changes that landed in r245058, some WebKit1 tests with media controls asserted in
3679         RenderLayerBacking::computeParentGraphicsLayerRect() because a layer would have a m_ancestorClippingLayer,
3680         but backgroundClipRect() would return an infinite rect.
3681         
3682         This happened when a layer tree change caused the layer's compositing ancestor to no longer isolate
3683         composited blending (which affects the behavior of RenderLayerCompositor:clippedByAncestor()), but we failed
3684         to mark its composited children as needing the configuration update which would eliminate their m_ancestorClippingLayers.
3685         
3686         The fix is to call setChildrenNeedCompositingGeometryUpdate() when isolatesCompositedBlending changes. We don't haev
3687         setChildrenNeedCompositingConfigurationUpdate(), but setChildrenNeedCompositingGeometryUpdate() has the desired side-effect.
3688
3689         I was unable to make a standalone test case for this, but the code is exercised by media control tests.
3690
3691         * rendering/RenderLayerCompositor.cpp:
3692         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3693
3694 2019-05-09  Brent Fulgham  <bfulgham@apple.com>
3695
3696         Correct delayed load event handling
3697         https://bugs.webkit.org/show_bug.cgi?id=197679
3698         <rdar://problem/50423334>
3699
3700         Reviewed by Alex Christensen.
3701
3702         We need to properly account for the fact that JavaScript might run
3703         while performing loads.
3704
3705         * dom/Document.cpp:
3706         (WebCore::Document::loadEventDelayTimerFired):
3707
3708 2019-05-09  Antti Koivisto  <antti@apple.com>
3709
3710         Elements with "display: inline-block" don't have a touch-action region
3711         https://bugs.webkit.org/show_bug.cgi?id=197281
3712         <rdar://problem/50535081>
3713
3714         Reviewed by Antoine Quint.
3715
3716         Test: pointerevents/ios/touch-action-region-inline-block.html
3717
3718         PaintPhase::EventRegion failed to traverse into inline boxes.
3719
3720         * rendering/InlineElementBox.cpp:
3721         (WebCore::InlineElementBox::paint):
3722         * rendering/RenderElement.cpp:
3723         (WebCore::RenderElement::paintAsInlineBlock):
3724
3725 2019-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3726
3727         REGRESSION(r239915): [FreeType] White space skipped when rendering plain text with noto CJK font
3728         https://bugs.webkit.org/show_bug.cgi?id=197658
3729
3730         Reviewed by Michael Catanzaro.
3731
3732         Since r239915 we no longer overwrite control characters with zero width space, they are handled later when
3733         filling the glyph pages. In Font::platformGlyphInit() there's an optimization to get the glyph of zero with
3734         space character that assumes that control characters are always overwritten. Since the glyph for character at 0
3735         index is always overwritten with zero width space, we can avoid loading the page for the actual zero width space
3736         character and use the first page instead. In the particular case of noto CJK font, character at 0 is mapped to
3737         the same glyph as space character, so space and zero width space end up being the same glyph. That breaks the
3738         space width calculation, that returns 0 when isZeroWidthSpaceGlyph() is true. That's why spaces are no
3739         longer rendered, ComplexTextController::adjustGlyphsAndAdvances() is setting the x advance for the space glyphs
3740         to 0.
3741
3742         * platform/graphics/Font.cpp:
3743         (WebCore::Font::platformGlyphInit): Use the actual zero width space page to get the glyph instead of 0 when
3744         using FreeType.
3745
3746 2019-05-08  Alex Christensen  <achristensen@webkit.org>
3747
3748         Fix WPE build.
3749
3750         * CMakeLists.txt:
3751         Bots wanted a "PUBLIC" or "PRIVATE" keyword here.
3752
3753 2019-05-08  Alex Christensen  <achristensen@webkit.org>
3754
3755         Try to fix Linux build
3756
3757         * platform/graphics/ANGLEWebKitBridge.h:
3758         Include headers consistently on all platforms.
3759
3760 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
3761
3762         Update ANGLE
3763         https://bugs.webkit.org/show_bug.cgi?id=197676
3764
3765         Reviewed by Alex Christensen.
3766
3767         * CMakeLists.txt:
3768         * PlatformGTK.cmake:
3769         * PlatformMac.cmake:
3770         * PlatformPlayStation.cmake:
3771         * PlatformWPE.cmake:
3772         * PlatformWin.cmake:
3773         * platform/graphics/GLContext.cpp:
3774         * platform/graphics/egl/GLContextEGL.cpp:
3775         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
3776         * platform/graphics/opengl/Extensions3DOpenGLES.h:
3777         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
3778         * platform/graphics/texmap/TextureMapperGLHeaders.h:
3779
3780 2019-05-08  Chris Dumez  <cdumez@apple.com>
3781
3782         [iOS Debug] ASSERTION FAILED: !m_originalNode in WebCore::JSLazyEventListener::checkValidityForEventTarget(WebCore::EventTarget &)
3783         https://bugs.webkit.org/show_bug.cgi?id=197696
3784         <rdar://problem/50586956>
3785
3786         Reviewed by Simon Fraser.
3787
3788         Setting the onorientationchange / onresize event handler on the body should set the event handler on the
3789         window object, as per the HTML specification. However, calling body.addEventListener() with 'orientationchange'
3790         or 'resize' should not set the event listener on the window object, only the body. Blink and Gecko seem to
3791         behave as per specification but WebKit had a quirk for the addEventListener case. The quirk's implementation
3792         is slightly wrong (because it is unsafe to take a JSLazyEventListener from a body element and add it to the
3793         window, given that the JSLazyEventListener keeps a raw pointer to its element) and was causing crashes such
3794         as <rdar://problem/24314027>. As a result, this patch simply drops the WebKit quirk, which will align our
3795         behavior with other browsers and fix the crashes altogether.
3796
3797         Test: fast/events/ios/rotation/orientationchange-event-listener-on.body.html
3798
3799         * dom/Node.cpp:
3800         (WebCore::tryAddEventListener):
3801         (WebCore::tryRemoveEventListener):
3802
3803 2019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
3804
3805         Unreviewed, rolling out r245058.
3806
3807         Causes crashes under ASan / GuardMalloc
3808
3809         Reverted changeset:
3810
3811         "Implement backing-sharing in compositing layers, allowing
3812         overlap layers to paint into the backing store of another
3813         layer"
3814         https://bugs.webkit.org/show_bug.cgi?id=197561
3815         https://trac.webkit.org/changeset/245058
3816
3817 2019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
3818
3819         Unreviewed, rolling out r245068.
3820
3821         Caused debug layout tests to exit early due to an assertion
3822         failure.
3823
3824         Reverted changeset:
3825
3826         "All prototypes should call didBecomePrototype()"
3827         https://bugs.webkit.org/show_bug.cgi?id=196315
3828         https://trac.webkit.org/changeset/245068
3829
3830 2019-05-08  Megan Gardner  <megan_gardner@apple.com>
3831
3832         Add quirks to emulate undo and redo in hidden editable areas on some websites
3833         https://bugs.webkit.org/show_bug.cgi?id=197452
3834
3835         Reviewed by Alex Christensen.
3836
3837         UI change, not testable.
3838
3839         We need to send synthetic keyboard events to the web process to emulate undo and redo
3840         key combinations for when we are trying to get our undo and redo UI to work
3841         on rich editing websites that only listen to keystrokes, and don't let us use our
3842         undo manager to help manage the input content.
3843
3844         * page/EventHandler.cpp:
3845         (WebCore::EventHandler::keyEvent):
3846         * platform/PlatformKeyboardEvent.h:
3847         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3848         (WebCore::PlatformKeyboardEvent::isSyntheticEvent):
3849         (WebCore::PlatformKeyboardEvent::setSyntheticEvent):
3850         * platform/ios/KeyEventIOS.mm:
3851         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
3852         * platform/ios/PlatformEventFactoryIOS.mm:
3853         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
3854         * platform/mac/PlatformEventFactoryMac.mm:
3855         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
3856
3857 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
3858
3859         CSSFontFaceSource fails to compile when !ENABLE(SVG_FONTS)
3860         https://bugs.webkit.org/show_bug.cgi?id=197720
3861
3862         Unreviewed build fix.
3863
3864         Add usesInDocumentSVGFont to the !ENABLE(SVG_FONT) path.
3865
3866         * css/CSSFontFaceSource.cpp:
3867         (WebCore::CSSFontFaceSource::font):
3868
3869 2019-05-08  Timothy Hatcher  <timothy@apple.com>
3870
3871         Add plumbing for inactive system colors in RenderTheme cache.
3872         https://bugs.webkit.org/show_bug.cgi?id=197699
3873         rdar://problem/49406936
3874
3875         Reviewed by Tim Horton.
3876
3877         * css/StyleColor.h:
3878         * page/Page.cpp:
3879         (WebCore::Page::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
3880         * page/Page.h:
3881         (WebCore::Page::useInactiveAppearance const):
3882         * rendering/RenderTheme.cpp:
3883         (WebCore::RenderTheme::purgeCaches):
3884         (WebCore::RenderTheme::platformColorsDidChange):
3885         (WebCore::RenderTheme::colorCache const):
3886         * rendering/RenderTheme.h:
3887         * testing/InternalSettings.cpp:
3888         (WebCore::InternalSettings::setUseDarkAppearanceInternal):
3889
3890 2019-05-08  Robin Morisset  <rmorisset@apple.com>
3891
3892         All prototypes should call didBecomePrototype()
3893         https://bugs.webkit.org/show_bug.cgi?id=196315
3894
3895         Reviewed by Saam Barati.
3896
3897         This changelog already landed, but the commit was missing the actual changes.
3898
3899         It was found by existing tests, with the new assert in JSC::Structure
3900
3901         * bindings/js/JSWindowProxy.cpp:
3902         (WebCore::JSWindowProxy::setWindow):
3903         * bindings/scripts/CodeGeneratorJS.pm:
3904         (GeneratePrototypeDeclaration):
3905         (GenerateConstructorHelperMethods):
3906         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3907         (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype):
3908         * bindings/scripts/test/JS/JSMapLike.cpp:
3909         (WebCore::JSMapLikePrototype::JSMapLikePrototype):
3910         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3911         (WebCore::JSReadOnlyMapLikePrototype::JSReadOnlyMapLikePrototype):
3912         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3913         (WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype):
3914         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3915         (WebCore::JSTestCEReactionsPrototype::JSTestCEReactionsPrototype):
3916         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3917         (WebCore::JSTestCEReactionsStringifierPrototype::JSTestCEReactionsStringifierPrototype):
3918         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3919         (WebCore::JSTestCallTracerPrototype::JSTestCallTracerPrototype):
3920         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3921         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::JSTestClassWithJSBuiltinConstructorPrototype):
3922         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3923         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
3924         (WebCore::JSTestDOMJITConstructor::prototypeForStructure):
3925         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3926         (WebCore::JSTestEnabledBySettingPrototype::JSTestEnabledBySettingPrototype):
3927         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3928         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype):
3929         (WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
3930         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3931         (WebCore::JSTestEventTargetPrototype::JSTestEventTargetPrototype):
3932         (WebCore::JSTestEventTargetConstructor::prototypeForStructure):
3933         * bindings/scripts/test/JS/JSTestException.cpp:
3934         (WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype):
3935         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3936         (WebCore::JSTestGenerateIsReachablePrototype::JSTestGenerateIsReachablePrototype):
3937         * bindings/scripts/test/JS/JSTestGlobalObject.h:
3938         (WebCore::JSTestGlobalObjectPrototype::JSTestGlobalObjectPrototype):
3939         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3940         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::JSTestIndexedSetterNoIdentifierPrototype):
3941         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3942         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::JSTestIndexedSetterThrowingExceptionPrototype):
3943         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3944         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::JSTestIndexedSetterWithIdentifierPrototype):
3945         * bindings/scripts/test/JS/JSTestInterface.cpp:
3946         (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
3947         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3948         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
3949         * bindings/scripts/test/JS/JSTestIterable.cpp:
3950         (WebCore::JSTestIterablePrototype::JSTestIterablePrototype):
3951         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3952         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype):
3953         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3954         (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
3955         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3956         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::JSTestNamedAndIndexedSetterNoIdentifierPrototype):
3957         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3958         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::JSTestNamedAndIndexedSetterThrowingExceptionPrototype):
3959         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3960         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::JSTestNamedAndIndexedSetterWithIdentifierPrototype):
3961         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3962         (WebCore::JSTestNamedConstructorPrototype::JSTestNamedConstructorPrototype):
3963         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3964         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::JSTestNamedDeleterNoIdentifierPrototype):
3965         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3966         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::JSTestNamedDeleterThrowingExceptionPrototype):
3967         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3968         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::JSTestNamedDeleterWithIdentifierPrototype):
3969         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3970         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::JSTestNamedDeleterWithIndexedGetterPrototype):
3971         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3972         (WebCore::JSTestNamedGetterCallWithPrototype::JSTestNamedGetterCallWithPrototype):
3973         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3974         (WebCore::JSTestNamedGetterNoIdentifierPrototype::JSTestNamedGetterNoIdentifierPrototype):
3975         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3976         (WebCore::JSTestNamedGetterWithIdentifierPrototype::JSTestNamedGetterWithIdentifierPrototype):
3977         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3978         (WebCore::JSTestNamedSetterNoIdentifierPrototype::JSTes