Unreviewed, rolling out r246616.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-07-03  Ryan Haddad  <ryanhaddad@apple.com>
2
3         Unreviewed, rolling out r246616.
4
5         Caused http/tests/inspector/network/har/har-page.html to fail
6         on Catalina.
7
8         Reverted changeset:
9
10         "Web Inspector: Network: replace CFNetwork SPI with new API
11         where able"
12         https://bugs.webkit.org/show_bug.cgi?id=198762
13         https://trac.webkit.org/changeset/246616
14
15 2019-07-03  Andres Gonzalez  <andresg_22@apple.com>
16
17         Safari hanging while loading pages - WebCore::AccessibilityRenderObject::visiblePositionRangeForLine.
18         https://bugs.webkit.org/show_bug.cgi?id=199434
19         <rdar://problem/52475140>
20
21         Reviewed by Chris Fleizach.
22
23         Tests were disabled until underlying bug is fixed.
24
25         Rolling out a workaround for CharacterIterator::advance bug because it
26         seems to be causing a hang in Safari.
27         * editing/Editing.cpp:
28         (WebCore::visiblePositionForIndexUsingCharacterIterator):
29
30 2019-07-02  Simon Fraser  <simon.fraser@apple.com>
31
32         REGRESSION (r246723): ScrollingTreeOverflowScrollProxyNode::m_overflowScrollingNodeID is uninitialized sometimes
33         https://bugs.webkit.org/show_bug.cgi?id=199432
34
35         Reviewed by Antti Koivisto.
36         
37         I noticed while debugging rdar://problem/52291642 that m_overflowScrollingNodeID was uninitialized in
38         ScrollingTreeOverflowScrollProxyNode. This could lead to the wrong node being found by m_scrollingTree->nodeForID(),
39         which could result in type confusion bugs.
40         
41         This can happen with negative z-order layers when we fail to find their related scrolling tree node
42         on the first pass.
43
44         * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.h:
45
46 2019-07-02  Zan Dobersek  <zdobersek@igalia.com>
47
48         FetchResponse::BodyLoader should not be movable
49         https://bugs.webkit.org/show_bug.cgi?id=199380
50
51         Reviewed by Youenn Fablet.
52
53         The FetchResponse::BodyLoader class has a FetchLoader member that is
54         initialized in the start() method with the reference of the owning
55         FetchResponse::BodyLoader object. This reference doesn't change when
56         the FetchResponse::BodyLoader object is moved into a different object
57         and the FetchLoader unique_ptr along with it, leading to problems when
58         that FetchLoader tries to invoke the FetchLoaderClient methods on the
59         FetchResponse::BodyLoader object that's been moved from and is possibly
60         already destroyed.
61
62         To avoid this, the FetchResponse::BodyLoader has the move constructor
63         removed and is now managed through std::unique_ptr instead of Optional,
64         ensuring the FetchResponse::BodyLoader object itself isn't moved around.
65
66         * Modules/fetch/FetchResponse.cpp:
67         (WebCore::FetchResponse::fetch):
68         (WebCore::FetchResponse::BodyLoader::didSucceed):
69         (WebCore::FetchResponse::BodyLoader::didFail):
70         * Modules/fetch/FetchResponse.h:
71
72 2019-07-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
73
74         Assertion fires when animating the 'class' attribute of an SVG element
75         https://bugs.webkit.org/show_bug.cgi?id=197372
76
77         Reviewed by Ryosuke Niwa.
78
79         All instances of SVG animated properties have to share a single animVal
80         such that once its value is progressed, all the instances will see the
81         change. This was not happening for SVGAnimatedPrimitiveProperty. To do
82         that we need to:
83
84         -- Introduce the new template class SVGSharedPrimitiveProperty which is
85            derived from SVGProperty. This class manages a single primitive value.
86         -- Change the type of SVGAnimatedPrimitiveProperty::m_animVal to
87            RefPtr<SVGSharedPrimitiveProperty<PropertyType>>. The master property
88            creates it and all the instances hold references to the same pointer.
89         -- Change the type of SVGAnimatedPrimitiveProperty::m_baseVal to
90            Ref<SVGSharedPrimitiveProperty<PropertyType>> for simplicity and get
91            rid of SVGAnimatedPrimitiveProperty::m_state.
92         -- Override the virtual methods instanceStartAnimation() and
93            instanceStopAnimation() of SVGAnimatedPrimitiveProperty.
94         -- SVGAnimatedStringAnimator should invalidate the style of the target
95            element if attribute name is 'class' and when its animVal changes.
96
97         * WebCore.xcodeproj/project.pbxproj:
98         * svg/properties/SVGAnimatedPrimitiveProperty.h:
99         (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
100         (WebCore::SVGAnimatedPrimitiveProperty::setBaseValInternal):
101         (WebCore::SVGAnimatedPrimitiveProperty::baseVal const):
102         (WebCore::SVGAnimatedPrimitiveProperty::setAnimVal):
103         (WebCore::SVGAnimatedPrimitiveProperty::animVal const):
104         (WebCore::SVGAnimatedPrimitiveProperty::animVal):
105         (WebCore::SVGAnimatedPrimitiveProperty::currentValue const):
106         (WebCore::SVGAnimatedPrimitiveProperty::SVGAnimatedPrimitiveProperty):
107         (WebCore::SVGAnimatedPrimitiveProperty::ensureAnimVal):
108         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
109         * svg/properties/SVGAttributeAnimator.cpp:
110         (WebCore::SVGAttributeAnimator::invalidateStyle):
111         (WebCore::SVGAttributeAnimator::applyAnimatedStylePropertyChange):
112         (WebCore::SVGAttributeAnimator::removeAnimatedStyleProperty):
113         * svg/properties/SVGAttributeAnimator.h:
114         * svg/properties/SVGSharedPrimitiveProperty.h: Added.
115         (WebCore::SVGSharedPrimitiveProperty::create):
116         (WebCore::SVGSharedPrimitiveProperty::value const):
117         (WebCore::SVGSharedPrimitiveProperty::value):
118         (WebCore::SVGSharedPrimitiveProperty::setValue):
119         (WebCore::SVGSharedPrimitiveProperty::SVGSharedPrimitiveProperty):
120
121 2019-07-02  Andres Gonzalez  <andresg_22@apple.com>
122
123         Enhance support of aria-haspopup per ARIA 1.1 specification.
124         https://bugs.webkit.org/show_bug.cgi?id=199216
125         <rdar://problem/46221342>
126
127         Reviewed by Chris Fleizach.
128
129         Test button-with-aria-haspopup-role.html was expanded to cover testing
130         of new functionality.
131
132         * accessibility/AccessibilityObject.cpp:
133         (WebCore::AccessibilityObject::popupValue const): replaces hasPopupValue.
134         (WebCore::AccessibilityObject::hasPopupValue const): Deleted.
135         * accessibility/AccessibilityObject.h:
136         * accessibility/AccessibilityRenderObject.cpp:
137         (WebCore::AccessibilityRenderObject::hasPopup const): method rename.
138         * accessibility/atk/WebKitAccessible.cpp:
139         (webkitAccessibleGetAttributes): method rename.
140         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
141         (-[WebAccessibilityObjectWrapper accessibilityPopupValue]):
142         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
143         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
144
145 2019-07-02  Saam Barati  <sbarati@apple.com>
146
147         [WHLSL] Import bitwise bool tests
148         https://bugs.webkit.org/show_bug.cgi?id=199093
149
150         Reviewed by Myles C. Maxfield.
151
152         Add standard library functions for:
153         - bool bit ops
154         - converting from bool to number
155         - converting from number to bool
156
157         Test: webgpu/whlsl-bitwise-bool-ops.html
158
159         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
160
161 2019-07-02  Takashi Komori  <Takashi.Komori@sony.com>
162
163         [Curl] Fix CookieJarCurl::getRawCookie.
164         https://bugs.webkit.org/show_bug.cgi?id=199300
165
166         Reviewed by Fujii Hironori.
167
168         On wincairo some cookie information was not displayed in WebInspector's storage tab as
169         CookieJarCurl::getRawCookies was calling CookieJarDB::searchCookies with wrong arguments.
170         This patch fixes it.
171
172         Test: http/tests/inspector/page/get-cookies.html
173
174         * platform/network/curl/CookieJarCurl.cpp:
175         (WebCore::CookieJarCurl::getRawCookies const):
176
177 2019-07-02  Robin Morisset  <rmorisset@apple.com>
178
179         [WHLSL] the initializer in VariableDeclaration should be a std::unique_ptr, not Optional<UniqueRef<..>>
180         https://bugs.webkit.org/show_bug.cgi?id=199389
181
182         Reviewed by Sam Weinig.
183
184         Optional<UniqueRef<..>> is not only semantically weird (UniqueRef is basically a unique_ptr that promises not to be null), but also inefficient, wasting 8 bytes for the boolean in Optional.
185         It is a pattern that appears throughout the AST. In this patch I start by removing it in a fairly simple spot: the initializer for VariableDeclaration.
186
187         No test because there is no intended functional change.
188
189         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
190         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
191         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
192         (WebCore::WHLSL::AST::VariableDeclaration::VariableDeclaration):
193         (WebCore::WHLSL::AST::VariableDeclaration::initializer):
194         (WebCore::WHLSL::AST::VariableDeclaration::takeInitializer):
195         (WebCore::WHLSL::AST::VariableDeclaration::setInitializer):
196         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
197         (WebCore::WHLSL::AutoInitialize::visit):
198         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
199         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
200         (WebCore::WHLSL::resolveWithOperatorLength):
201         (WebCore::WHLSL::resolveWithReferenceComparator):
202         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
203         (WebCore::WHLSL::Parser::parseParameter):
204         (WebCore::WHLSL::Parser::parseVariableDeclaration):
205         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
206         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
207         (WebCore::WHLSL::wrapAnderCallArgument):
208         (WebCore::WHLSL::modify):
209         (WebCore::WHLSL::PropertyResolver::visit):
210         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
211         (WebCore::WHLSL::synthesizeArrayOperatorLength):
212         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
213         (WebCore::WHLSL::synthesizeConstructors):
214         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
215         (WebCore::WHLSL::synthesizeEnumerationFunctions):
216         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
217         (WebCore::WHLSL::synthesizeStructureAccessors):
218
219 2019-07-02  Jer Noble  <jer.noble@apple.com>
220
221         Pipe suport for 'cenc' init data type into CDMFairPlayStreaming
222         https://bugs.webkit.org/show_bug.cgi?id=199381
223
224         Reviewed by Eric Carlson.
225
226         Expose the parsing of 'cenc' init data from InitDataRegistry, so it can be used in the
227         evaluation steps inside CDMFairPlayStreaming.
228
229         + Add a new method, extractPsshBoxesFromCenc() which returns an optional array of
230           unique_ptrs to different types of ISOPSSHBoxes.
231         + Add a peekScheme() method to ISOPSSHBox so that we can create the correct subclass
232           of ISOPSSHBox from the above method.
233         + Remove an extra definition of fairPlaySystemID() from CDMFairPlayStreaming.
234         + Add 'cenc' to the list of supported types in CDMPrivateFairPlayStreaming::vaildInitDataTypes().
235         + Add support for 'cenc' in CDMPrivateFairPlayStreaming::supportsInitData().
236         + Format the 'cenc' init data as an encodec-JSON structure for AVContentKeySession.
237         + Update the ISOFairPlayStreamingKeyRequestInfoBox to be a ISOFullBox.
238         + Update the box name of ISOFairPlayStreamingInitDataBox.
239
240         * Modules/encryptedmedia/InitDataRegistry.cpp:
241         (WebCore::InitDataRegistry::extractPsshBoxesFromCenc):
242         (WebCore::InitDataRegistry::extractKeyIDsCenc):
243         (WebCore::InitDataRegistry::sanitizeCenc):
244         (WebCore::InitDataRegistry::cencName):
245         (WebCore::InitDataRegistry::keyidsName):
246         (WebCore::InitDataRegistry::webmName):
247         (WebCore::extractKeyIDsCenc): Deleted.
248         (WebCore::sanitizeCenc): Deleted.
249         * Modules/encryptedmedia/InitDataRegistry.h:
250         (WebCore::SourceBuffer::changeType):
251         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
252         (WebCore::validInitDataTypes):
253         (WebCore::CDMPrivateFairPlayStreaming::supportsInitData const):
254         (WebCore::CDMPrivateFairPlayStreaming::fairPlaySystemID): Deleted.
255         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
256         * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:
257         (isType):
258         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
259         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
260         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
261         (WebCore::ISOProtectionSystemSpecificHeaderBox::peekSystemID):
262         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
263
264 2019-07-02  Daniel Bates  <dabates@apple.com>
265
266         [iOS] Cannot tab cycle through credit card fields on antonsvpatisserie.com checkout page
267         https://bugs.webkit.org/show_bug.cgi?id=196053
268         <rdar://problem/49093034>
269
270         Reviewed by Wenson Hsieh.
271
272         Remove the iOS override for isKeyboardFocusable() so that the focus controller allows
273         iframes to be keyboard focusable.
274
275         Tests: fast/events/ios/tab-cycle.html
276                fast/events/ios/tab-into-text-field-inside-iframe.html
277
278         * html/HTMLIFrameElement.h:
279
280 2019-07-02  Daniel Bates  <dabates@apple.com>
281
282         Left and right option key has Unidentified key identifier
283         https://bugs.webkit.org/show_bug.cgi?id=199392
284         <rdar://problem/52497604>
285
286         Reviewed by Wenson Hsieh.
287
288         Fix up switch case for left Option key and add a case statement for the right Option key.
289
290         * platform/ios/PlatformEventFactoryIOS.mm:
291         (WebCore::codeForKeyEvent):
292
293 2019-07-02  Antti Koivisto  <antti@apple.com>
294
295         Crash when adding inline stylesheet to shadow tree in document with null base URL
296         https://bugs.webkit.org/show_bug.cgi?id=199400
297
298         Reviewed by Zalan Bujtas.
299
300         We compute CSSParserContextHash for the inline stylesheet cache but that hits a nullptr crash
301         if the document happens to have null base URL (which is uncommon but possible).
302
303         Test: fast/shadow-dom/stylesheet-in-shadow-without-base-url-crash.html
304
305         * css/parser/CSSParserContext.h:
306         (WebCore::CSSParserContextHash::hash):
307
308         Null check the base URL (like other strings), it is a valid case.
309
310 2019-07-02  Devin Rousso  <drousso@apple.com>
311
312         Web Inspector: Debug: "Reset Web Inspector" should also clear the saved window size and attachment side
313         https://bugs.webkit.org/show_bug.cgi?id=198956
314
315         Reviewed by Matt Baker.
316
317         * inspector/InspectorFrontendClient.h:
318
319         * inspector/InspectorFrontendClientLocal.h:
320         * inspector/InspectorFrontendClientLocal.cpp:
321         (WebCore::InspectorFrontendClientLocal::Settings::deleteProperty): Added.
322         (WebCore::InspectorFrontendClientLocal::resetWindowState): Added.
323
324         * inspector/InspectorFrontendHost.idl:
325         * inspector/InspectorFrontendHost.h:
326         * inspector/InspectorFrontendHost.cpp:
327         (WebCore::InspectorFrontendHost::reset): Added.
328
329 2019-07-01  Zalan Bujtas  <zalan@apple.com>
330
331         [Text autosizing] [iPadOS] AutosizeStatus::idempotentTextSize returns the computed font size in certain cases.
332         https://bugs.webkit.org/show_bug.cgi?id=199382
333         <rdar://problem/52483097>
334
335         Reviewed by Wenson Hsieh.
336
337         Adjust the font size on the style only when the autosized value is different from the computed value. 
338
339         * css/StyleResolver.cpp:
340         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
341
342 2019-07-01  Chris Dumez  <cdumez@apple.com>
343
344         It should not be possible to trigger a load while in the middle of restoring a page in PageCache
345         https://bugs.webkit.org/show_bug.cgi?id=199190
346         <rdar://problem/52114552>
347
348         Reviewed by Brady Eidson.
349
350         Test: http/tests/security/navigate-when-restoring-cached-page.html
351
352         * history/CachedFrame.cpp:
353         (WebCore::CachedFrame::open):
354         Stop attaching the cached document before calling FrameLoader::open() given that the previous document
355         is still attached to the frame at this point. This avoids having 2 documents attached to the same frame
356         during a short period of time.
357
358         * loader/FrameLoader.cpp:
359         (WebCore::FrameLoader::open):
360         We now attach the cached document to the frame *after* calling FrameLoader::clear(), which means that
361         the previous document now has been detached from this frame.
362
363         (WebCore::FrameLoader::detachChildren):
364         As per the HTML specification [1], an attempt to navigate should fail if the prompt to unload algorithm
365         is being run for the active document of browsingContext. Note that the "prompt to unload" algorithm [2]
366         includes firing the 'unload' event in the current document and in all the documents in the subframes.
367         As a result, FrameLoader::detachChildren() is the right prevent such navigations. We were actually trying
368         to do this via the SubframeLoadingDisabler stack variable inside detachChildren(). The issue is that this
369         only prevents navigation in the subframes (i.e. <iframe> elements), not the main frame. As a result,
370         script would be able to navigate the top-frame even though detachChildren() is being called on the top
371         frame. To address the issue, I now create a NavigationDisabler variable in the scope of detachChildren()
372         when detachChildren() is called on the top frame. NavigationDisabler prevents all navigations within the
373         page, including navigations on the main/top frame.
374
375         [1] https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate
376         [2] https://html.spec.whatwg.org/multipage/browsing-the-web.html#prompt-to-unload-a-document
377
378 2019-07-01  Truitt Savell  <tsavell@apple.com>
379
380         Unreviewed, rolling out r246844.
381
382         Broke 12 tests in imported/w3c/web-platform-
383         tests/pointerevents/
384
385         Reverted changeset:
386
387         "[Pointer Events] Respect pointer capture when dispatching
388         mouse boundary events and updating :hover"
389         https://bugs.webkit.org/show_bug.cgi?id=198999
390         https://trac.webkit.org/changeset/246844
391
392 2019-07-01  Truitt Savell  <tsavell@apple.com>
393
394         Unreviewed, rolling out r246849.
395
396         12 tests broken in r246844 require this to be rolled out.
397
398         Reverted changeset:
399
400         "[Pointer Events] Respect pointer capture when dispatching
401         mouse boundary events and updating :hover"
402         https://bugs.webkit.org/show_bug.cgi?id=198999
403         https://trac.webkit.org/changeset/246849
404
405 2019-07-01  Alex Christensen  <achristensen@webkit.org>
406
407         Null check provisionalItem in FrameLoader::continueLoadAfterNavigationPolicy
408         https://bugs.webkit.org/show_bug.cgi?id=199327
409         <rdar://problem/48262384>
410
411         Reviewed by Darin Adler.
412
413         * loader/FrameLoader.cpp:
414         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
415         Sometimes provisionalItem is null.  Let's not crash.
416
417 2019-07-01  Truitt Savell  <tsavell@apple.com>
418
419         Unreviewed, rolling out r246958.
420
421         Broke inspector/dom/getAccessibilityPropertiesForNode.html
422
423         Reverted changeset:
424
425         "Enhance support of aria-haspopup per ARIA 1.1 specification."
426         https://bugs.webkit.org/show_bug.cgi?id=199216
427         https://trac.webkit.org/changeset/246958
428
429 2019-07-01  Brady Eidson  <beidson@apple.com>
430
431         More judiciously handle clearing/creation of DOMWindows for new Documents.
432         <rdar://problem/51665406> and https://bugs.webkit.org/show_bug.cgi?id=198786
433
434         Reviewed by Chris Dumez.
435
436         * bindings/js/ScriptController.cpp:
437         (WebCore::ScriptController::executeIfJavaScriptURL):
438
439         * loader/DocumentWriter.cpp:
440         (WebCore::DocumentWriter::replaceDocumentWithResultOfExecutingJavascriptURL): Rename for clarity.
441         (WebCore::DocumentWriter::begin): Handle DOMWindow taking/creation inside FrameLoader::clear via a lambda. 
442         (WebCore::DocumentWriter::replaceDocument): Deleted.
443         * loader/DocumentWriter.h:
444
445         * loader/FrameLoader.cpp:
446         (WebCore::FrameLoader::clear): Take a "handleDOMWindowCreation" lambda to run after clearing the previous document.
447         * loader/FrameLoader.h:
448
449 2019-07-01  Zalan Bujtas  <zalan@apple.com>
450
451         [iPadOS] Tapping on the bottom part of youtube video behaves as if controls were visible
452         https://bugs.webkit.org/show_bug.cgi?id=199349
453         <rdar://problem/51955744>
454
455         Reviewed by Simon Fraser.
456
457         Synthetic click event should not be dispatched to a node that is initially hidden (by opacity: 0) and becomes visible by the touchStart event.
458         While this behaves different from macOS where opacity: 0; content is "clickable", it impoves usability on certain sites like YouTube.com. 
459
460         Test: fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition2.html
461
462         * dom/Node.cpp:
463         (WebCore::Node::defaultEventHandler):
464         * page/ios/ContentChangeObserver.cpp:
465         (WebCore::ContentChangeObserver::isConsideredHidden):
466         (WebCore::ContentChangeObserver::reset):
467         (WebCore::isConsideredHidden): Deleted.
468         * page/ios/ContentChangeObserver.h:
469         (WebCore::ContentChangeObserver::setHiddenTouchTarget):
470         (WebCore::ContentChangeObserver::resetHiddenTouchTarget):
471         (WebCore::ContentChangeObserver::hiddenTouchTarget const):
472
473 2019-06-28  Brent Fulgham  <bfulgham@apple.com>
474
475         [FTW] Build WebCore
476         https://bugs.webkit.org/show_bug.cgi?id=199199
477
478         Reviewed by Don Olmstead.
479
480         Make some minor corrections needed to get FTW WebCore to build and link.
481
482         * PlatformFTW.cmake: Added.
483         * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
484         (WebCore::GlyphPage::fill):
485         * platform/graphics/win/GraphicsContextDirect2D.cpp:
486         (WebCore::GraphicsContext::setURLForRect):
487         * platform/graphics/win/PatternDirect2D.cpp:
488         * platform/graphics/win/SimpleFontDataDirect2D.cpp:
489         * platform/image-decoders/ScalableImageDecoder.cpp:
490         (WebCore::ScalableImageDecoder::setTargetContext): Added stub.
491         * platform/image-decoders/ScalableImageDecoder.h:
492         * platform/network/curl/CookieJarDB.cpp:
493         (WebCore::CookieJarDB::hasCookies):
494         (WebCore::CookieJarDB::canAcceptCookie):
495
496 2019-07-01  Wenson Hsieh  <wenson_hsieh@apple.com>
497
498         iOS: REGRESSION(async scroll): Caret doesn't scroll when scrolling textarea
499         https://bugs.webkit.org/show_bug.cgi?id=198217
500         <rdar://problem/51097296>
501
502         Reviewed by Simon Fraser.
503
504         Add a ScrollingLayerPositionAction argument to ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling, and
505         avoid bailing early in the case where ScrollingLayerPositionAction::Set is used. See the WebKit ChangeLog for
506         more detail.
507
508         Test: editing/selection/ios/update-selection-after-overflow-scroll.html
509
510         * page/scrolling/ScrollingTreeScrollingNode.cpp:
511         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
512         * page/scrolling/ScrollingTreeScrollingNode.h:
513
514 2019-07-01  Antti Koivisto  <antti@apple.com>
515
516         REGRESSION(r240047): Overflow scrollers on WK1 fail to update their content size when it changes
517         https://bugs.webkit.org/show_bug.cgi?id=199360
518         <rdar://problem/51643386>
519
520         Reviewed by Simon Fraser.
521
522         r240047 replaced didCommitChangesForLayer() mechanism by a more narrow didChangePlatformLayerForLayer.
523         Unfortunately on WK1 we relied on scroll layers being invalidated after every size (and scrollbar) change.
524         Without this invalidation we don't call WebChromeClientIOS::addOrUpdateScrollingLayer and the UIKit delegate
525         that resizes the UIScrollView content.
526
527         Fix by removing the scroll layer invalidation mechanism from LegacyWebKitScrollingLayerCoordinator completely and instead
528         simply update all scroll layers after commit. The UIKit delegate doesn't do any significant work if nothing changes,
529         this was not a very meaninful optimization.
530
531         * rendering/RenderLayerCompositor.cpp:
532         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
533
534         Update all scroll layers after flush (similar to viewport constrained layers).
535
536         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
537         (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
538         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
539         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
540         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate): Deleted.
541         (WebCore::LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer): Deleted.
542         * rendering/RenderLayerCompositor.h:
543
544 2019-07-01  Philippe Normand  <pnormand@igalia.com>
545
546         [GStreamer] Cannot play Bert's Bytes radio stream from http://radio.dos.nl/
547         https://bugs.webkit.org/show_bug.cgi?id=198376
548
549         Reviewed by Xabier Rodriguez-Calvar.
550
551         The delayed startup was due to a mix of buffering feedback
552         messages not handled correctly by the player. We were handling
553         download and streaming buffering metrics without distinction.
554         Range requests (used for seeking) were also triggering on-disk
555         buffering in some cases. The buffering percentage estimation based
556         on network read position was not working either because uint64_t
557         division doesn't return a floating point value.
558
559         No new tests, existing media tests cover this patch.
560
561         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
562         (WebCore::MediaPlayerPrivateGStreamer::commitLoad):
563         (WebCore::MediaPlayerPrivateGStreamer::play):
564         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
565         (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
566         (WebCore::MediaPlayerPrivateGStreamer::updateBufferingStatus):
567         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
568         (WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded const):
569         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
570         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
571         (WebCore::MediaPlayerPrivateGStreamer::updateDownloadBufferingFlag):
572         (WebCore::MediaPlayerPrivateGStreamer::setPreload):
573         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
574         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
575         (webkitWebSrcReset):
576         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
577
578 2019-07-01  Miguel Gomez  <magomez@igalia.com>
579
580         REGRESSION(r246963) GTK's debug build is broken
581         https://bugs.webkit.org/show_bug.cgi?id=199358
582
583         Reviewed by Michael Catanzaro.
584
585         Add traits to be able to downcast AnimatedBackingStoreClient.
586
587         * platform/graphics/nicosia/NicosiaAnimatedBackingStoreClient.h:
588         (Nicosia::AnimatedBackingStoreClient::AnimatedBackingStoreClient):
589         (Nicosia::AnimatedBackingStoreClient::type const):
590         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
591         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
592
593 2019-07-01  Carlos Garcia Campos  <cgarcia@igalia.com>
594
595         Unreviewed. Fix GTK build with GSTREAMER_GL disabled after r246710
596
597         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
598
599 2019-07-01  Carlos Garcia Campos  <cgarcia@igalia.com>
600
601         WebSockets: add support for sending blob messages when using web sockets platform APIs
602         https://bugs.webkit.org/show_bug.cgi?id=199189
603
604         Reviewed by Youenn Fablet.
605
606         * Headers.cmake: Add missing headers.
607
608 2019-07-01  Miguel Gomez  <magomez@igalia.com>
609
610         [WPE][GTK] Content disappearing when using CSS transforms
611         https://bugs.webkit.org/show_bug.cgi?id=181757
612
613         Reviewed by Žan Doberšek.
614
615         During each layer flush, create an AnimatedBackingStoreClient instance for each layer that
616         has a backingStore and is to be animated, and send that client to the appropriate
617         TextureMapperLayer on the compositor thread. During each frame rendering, the client will
618         use the future layer position (currently 50ms in the future) to check whether new tiles are
619         required to keep the animation ongoing, and notify the appropriate CoordinatedGraphicsLayer so
620         it can perform a layer flush and provide new tiles.
621
622         * platform/TextureMapper.cmake:
623         * platform/graphics/nicosia/NicosiaAnimatedBackingStoreClient.h: Added.
624         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
625         (Nicosia::CompositionLayer::flushState):
626         * platform/graphics/texmap/TextureMapperAnimation.cpp:
627         (WebCore::TextureMapperAnimation::applyKeepingInternalState):
628         (WebCore::TextureMapperAnimations::applyKeepingInternalState):
629         * platform/graphics/texmap/TextureMapperAnimation.h:
630         * platform/graphics/texmap/TextureMapperLayer.cpp:
631         (WebCore::TextureMapperLayer::computeTransformsRecursive):
632         (WebCore::TextureMapperLayer::setAnimatedBackingStoreClient):
633         (WebCore::TextureMapperLayer::syncAnimations):
634         * platform/graphics/texmap/TextureMapperLayer.h:
635         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
636         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
637         (WebCore::clampToContentsRectIfRectIsInfinite):
638         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
639         (WebCore::CoordinatedGraphicsLayer::requestBackingStoreUpdate):
640         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
641         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
642
643 2019-06-30  Antti Koivisto  <antti@apple.com>
644
645         Use separate variables for moving and stationary scrolling relationships in RemoteLayerTreeNode
646         https://bugs.webkit.org/show_bug.cgi?id=199348
647
648         Reviewed by Darin Adler.
649
650         * page/scrolling/ScrollingStateStickyNode.cpp:
651         * page/scrolling/ScrollingTree.cpp:
652         (WebCore::ScrollingTree::commitTreeState):
653         * page/scrolling/ScrollingTree.h:
654         (WebCore::ScrollingTree::activeOverflowScrollProxyNodes):
655         (WebCore::ScrollingTree::activePositionedNodes):
656         (WebCore::ScrollingTree::nodesWithRelatedOverflow): Deleted.
657
658         Use separate sets for overflow proxies and positioned nodes.
659         Use Refs to nodes instead of ids to simplify client code. This doesn't affect lifetimes, these sets are cleared
660         at the beginning of each commit.
661
662         * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
663         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
664         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
665         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
666
667 2019-06-30  Andres Gonzalez  <andresg_22@apple.com>
668
669         Enhance support of aria-haspopup per ARIA 1.1 specification.
670         https://bugs.webkit.org/show_bug.cgi?id=199216
671         <rdar://problem/46221342>
672
673         Reviewed by Chris Fleizach.
674
675         Test button-with-aria-haspopup-role.html was expanded to cover testing
676         of new functionality.
677
678         * accessibility/AccessibilityObject.cpp:
679         (WebCore::AccessibilityObject::popupValue const): replaces hasPopupValue.
680         (WebCore::AccessibilityObject::hasPopupValue const): Deleted.
681         * accessibility/AccessibilityObject.h:
682         * accessibility/AccessibilityRenderObject.cpp:
683         (WebCore::AccessibilityRenderObject::hasPopup const): method rename.
684         * accessibility/atk/WebKitAccessible.cpp:
685         (webkitAccessibleGetAttributes): method rename.
686         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
687         (-[WebAccessibilityObjectWrapper accessibilityPopupValue]):
688         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
689         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
690
691 2019-06-30  Zalan Bujtas  <zalan@apple.com>
692
693         [LFC] Implement Layout::printLayoutTreeForLiveDocuments
694         https://bugs.webkit.org/show_bug.cgi?id=199343
695         <rdar://problem/52393047>
696
697         Reviewed by Antti Koivisto.
698
699         * layout/layouttree/LayoutTreeBuilder.cpp:
700         (WebCore::Layout::printLayoutTreeForLiveDocuments):
701         * page/FrameViewLayoutContext.cpp:
702         (WebCore::layoutUsingFormattingContext):
703
704 2019-06-22  Darin Adler  <darin@apple.com>
705
706         Streamline some string code, focusing on functions that were using substringSharingImpl
707         https://bugs.webkit.org/show_bug.cgi?id=198898
708
709         Reviewed by Daniel Bates.
710
711         * css/CSSComputedStyleDeclaration.cpp:
712         (WebCore::CSSComputedStyleDeclaration::CSSComputedStyleDeclaration): Take a StringView
713         instead of a String argument for the pseudo-element name. This prevents us from having
714         to use substringSharingImpl to strip off leading colons.
715         (WebCore::CSSComputedStyleDeclaration::create): Moved this function in here since it's
716         no longer being inlined.
717
718         * css/CSSComputedStyleDeclaration.h: Moved the create function to no longer be inlined,
719         since it's better to have the constructor be inlined in the create function instead.
720         Changed the pseudo-element name argument to be a StringView rather than a String.
721         Also initialize m_refCount in the class definition.
722
723         * css/CSSSelector.cpp:
724         (WebCore::CSSSelector::parsePseudoElementType): Take a StringView instead of a String.
725         * css/CSSSelector.h: Updated for the above change.
726
727         * css/SelectorPseudoTypeMap.h: Change both parse functions to take StringView. Before
728         one took a StringImpl and the other used const StringView&, which is not as good as
729         StringView.
730
731         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py: Use StringView, not
732         const StringView&.
733
734         * css/makeSelectorPseudoElementsMap.py: Use StringView rather than StringImpl.
735
736         * css/parser/CSSParserImpl.cpp:
737         (WebCore::CSSParserImpl::parsePageSelector): Use a StringView for the pseudo-element
738         name. It was already computed as a StringView, but the old code converted it to
739         an AtomicString.
740
741         * css/parser/CSSParserSelector.cpp:
742         (WebCore::CSSParserSelector::parsePagePseudoSelector): Take a StringView, and
743         return a std::unique_ptr.
744         (WebCore::CSSParserSelector::parsePseudoElementSelector): Renamed to not mention
745         StringView in function name. Take a StringView, not a StringView&. Do the lowercasing
746         inside this function rather than having it be a caller responsibility. Don't convert
747         from a StringView to an AtomicString before starting to parse; only do it in the
748         "unknown/custom" case. Return a std::unique_ptr.
749         (WebCore::CSSParserSelector::parsePseudoClassSelector): Ditto.
750         * css/parser/CSSParserSelector.h: Make the three parse functions all take a StringView
751         and all return a std::unique_ptr. They were already creating objects, but before
752         callers just had to know to adopt.
753         * css/parser/CSSSelectorParser.cpp:
754         (WebCore::CSSSelectorParser::consumePseudo): Updated to use improved parse
755         functions above.
756
757         * page/DOMWindow.cpp:
758         (WebCore::DOMWindow::getMatchedCSSRules const): Updated to use the new
759         parsePseudoElementType above and use StringView::substring instead of
760         String::substringSharingImpl.
761
762         * platform/Length.cpp:
763         (WebCore::newCoordsArray): Local string that is "spacified" can't have any non-Latin-1
764         characters, so use LChar instead of UChar.
765
766         * rendering/RenderText.cpp:
767         (WebCore::convertNoBreakSpaceToSpace): Renamed for clarity. Also use constexpr
768         instead of inline since this is a pure function.
769         (WebCore::capitalize): Tighten up logic a bit.
770
771 2019-06-29  Simon Fraser  <simon.fraser@apple.com>
772
773         Remove a PLATFORM(IOS_FAMILY) related to repaint offsets in composited scrolling layers
774         https://bugs.webkit.org/show_bug.cgi?id=199342
775
776         Reviewed by Zalan Bujtas.
777
778         Code in RenderObject::shouldApplyCompositedContainerScrollsForRepaint() adds VisibleRectContextOption::ApplyCompositedContainerScrolls
779         only for iOS, and RenderLayerBacking::setContentsNeedDisplayInRect() subtracts out scroll position for only iOS,
780         so remove this iOS-specific code.
781
782         Blame for this code mentions touch event regions, so I tested these but they use absoluteBoundingBoxRect()
783         which doesn't hit this code. Still, I added a layout test for touch regions inside scrolled overflow.
784
785         Existing tests exist for repaint inside scrolled overflow.
786
787         Test: fast/events/touch/ios/touch-event-regions/scrolled-overflow.html
788
789         * rendering/RenderLayerBacking.cpp:
790         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
791         * rendering/RenderObject.cpp:
792         (WebCore::RenderObject::shouldApplyCompositedContainerScrollsForRepaint): Deleted.
793         (WebCore::RenderObject::visibleRectContextForRepaint): Deleted.
794         * rendering/RenderObject.h:
795         (WebCore::RenderObject::visibleRectContextForRepaint):
796
797 2019-06-28  Tim Horton  <timothy_horton@apple.com>
798
799         iOS WebKit2 find-in-page indicator doesn't move with 'overflow: scroll'
800         https://bugs.webkit.org/show_bug.cgi?id=175032
801         <rdar://problem/29346482>
802
803         Reviewed by Wenson Hsieh.
804
805         * editing/FrameSelection.cpp:
806         (WebCore::FrameSelection::selectionBounds const):
807         (WebCore::FrameSelection::revealSelection):
808         * editing/FrameSelection.h:
809         Make selectionBounds' clipToVisibleContent param an enum class.
810
811         * page/TextIndicator.cpp:
812         (WebCore::initializeIndicator):
813         Save the un-clipped selection rect; otherwise we'll frequently save 0, 0
814         here when finding a match that is off-screen.
815
816 2019-06-28  Zalan Bujtas  <zalan@apple.com>
817
818         [Text autosizing][iPadOS] bing.com is hard to read even with boosted text because of the line height
819         https://bugs.webkit.org/show_bug.cgi?id=199318
820         <rdar://problem/51826096>
821
822         Reviewed by Wenson Hsieh.
823
824         Initial implementation of line height boosting on iPadOs. It enlarges line height in certain cases to improve readability when the text content feels too dense.
825         It kicks in only for relatively small text (12px) where it slightly (1.25x) changes the line height to widen the gap between lines.
826
827         * css/StyleResolver.cpp:
828         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
829
830 2019-06-28  Alex Christensen  <achristensen@webkit.org>
831
832         Make getHostnamesWithCookies more robust
833         https://bugs.webkit.org/show_bug.cgi?id=199334
834         <rdar://problem/51860593>
835
836         Reviewed by Brent Fulgham.
837
838         Crash logs suggest either httpCookies is returning a nil cookie or a cookie without a domain.
839         This should not happen, but if it does we shouldn't crash.
840
841         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
842         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
843
844 2019-06-28  chris fleizach  <cfleizach@apple.com>
845
846         AX: Both convertToNSArray() functions in WebAccessibilityObjectWrapperBase.mm leak every NSMutableArray returned
847         https://bugs.webkit.org/show_bug.cgi?id=199306
848
849         Reviewed by David Kilzer.
850
851         Stop leaking every instance of convertToNSArray and return an autoreleased version.
852         Remove unneeded casts.
853
854         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
855         (-[WebAccessibilityObjectWrapper accessibilityFindMatchingObjects:]):
856         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
857         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
858         (convertToNSArray):
859         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
860         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
861         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
862         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
863
864 2019-06-28  Wenson Hsieh  <wenson_hsieh@apple.com>
865
866         Followup to r246931
867         https://bugs.webkit.org/show_bug.cgi?id=199331
868
869         Reviewed by Tim Horton.
870
871         Extend the site-specific quirk added in r246931 to *.sharepoint.com, so that it fixes Word for enterprise
872         customers as well.
873
874         * page/Quirks.cpp:
875         (WebCore::Quirks::shouldAvoidResizingWhenInputViewBoundsChange const):
876
877 2019-06-28  Timothy Hatcher  <timothy@apple.com>
878
879         Rename effectiveAppearanceIsInactive and useInactiveAppearance to better match UIUserInterfaceLevel.
880         https://bugs.webkit.org/show_bug.cgi?id=199336
881         rdar://problem/52348938
882
883         Reviewed by Tim Horton.
884
885         * css/StyleColor.h:
886         * dom/Document.cpp:
887         (WebCore::Document::useElevatedUserInterfaceLevel const):
888         (WebCore::Document::styleColorOptions const):
889         (WebCore::Document::useInactiveAppearance const): Deleted.
890         * dom/Document.h:
891         * page/Page.cpp:
892         (WebCore::Page::effectiveAppearanceDidChange):
893         * page/Page.h:
894         (WebCore::Page::useElevatedUserInterfaceLevel const):
895         (WebCore::Page::useInactiveAppearance const): Deleted.
896         * platform/ios/LocalCurrentTraitCollection.h:
897         (WebCore::LocalCurrentTraitCollection::usingElevatedUserInterfaceLevel const):
898         (WebCore::LocalCurrentTraitCollection::usingBaseLevelAppearance const): Deleted.
899         * platform/ios/LocalCurrentTraitCollection.mm:
900         (WebCore::LocalCurrentTraitCollection::LocalCurrentTraitCollection):
901         * rendering/RenderThemeIOS.mm:
902         (WebCore::RenderThemeIOS::systemColor const):
903         * testing/InternalSettings.cpp:
904         (WebCore::InternalSettings::setUseDarkAppearanceInternal):
905
906 2019-06-28  Simon Fraser  <simon.fraser@apple.com>
907
908         REGRESSION (r239984): pages with custom scrollbars also show normal scrollbars
909         https://bugs.webkit.org/show_bug.cgi?id=199321
910         <rdar://problem/52308095>
911
912         Reviewed by Timothy Hatcher.
913
914         Revert the part of r239984 that made isCustomScrollbar() virtual, since theme().registerScrollbar()
915         calls it from the base class constructor.
916
917         I wasn't able to make a test that tests rendering of overlay scrollbars (webkit.org/b/199323).
918
919         * platform/Scrollbar.cpp:
920         (WebCore::Scrollbar::Scrollbar):
921         * platform/Scrollbar.h:
922         (WebCore::Scrollbar::isCustomScrollbar const):
923         * rendering/RenderScrollbar.cpp:
924         (WebCore::RenderScrollbar::RenderScrollbar):
925         * rendering/RenderScrollbar.h:
926
927 2019-06-28  Wenson Hsieh  <wenson_hsieh@apple.com>
928
929         Need a way for SPI clients to know when to avoid resizing to accommodate for the input view bounds
930         https://bugs.webkit.org/show_bug.cgi?id=199331
931         <rdar://problem/52116170>
932
933         Reviewed by Tim Horton.
934
935         Add a new quirk to avoid resizing the web view when input view bounds change.
936
937         * page/Quirks.cpp:
938         (WebCore::Quirks::shouldAvoidResizingWhenInputViewBoundsChange const):
939         * page/Quirks.h:
940
941 2019-06-28  Konstantin Tokarev  <annulen@yandex.ru>
942
943         Remove traces of ENABLE_ICONDATABASE remaining after its removal in 219733
944         https://bugs.webkit.org/show_bug.cgi?id=199317
945
946         Reviewed by Michael Catanzaro.
947
948         While IconDatabase and all code using it was removed,
949         ENABLE_ICONDATABASE still exists as build option and C++ macro.
950
951         * Configurations/FeatureDefines.xcconfig:
952         * Resources/urlIcon.png: Removed file which was only used in
953         IconDatabase.cpp.
954
955 2019-06-28  Fujii Hironori  <Hironori.Fujii@sony.com>
956
957         [Win] unresolved external symbol "JSC::JSObject::didBecomePrototype(void)" referenced in function "JSC::Structure::create(...)"
958         https://bugs.webkit.org/show_bug.cgi?id=199312
959
960         Reviewed by Keith Miller.
961
962         WinCairo port, clang-cl Release builds reported a following linkage error:
963
964         > WebCore.lib(UnifiedSource-4babe430-10.cpp.obj) : error LNK2019: unresolved external symbol "public: void __cdecl JSC::JSObject::didBecomePrototype(void)" (?didBecomePrototype@JSObject@JSC@@QEAAXXZ) referenced in function "public: static class JSC::Structure * __cdecl JSC::Structure::create(class JSC::VM &,class JSC::JSGlobalObject *,class JSC::JSValue,class JSC::TypeInfo const &,struct JSC::ClassInfo const *,unsigned char,unsigned int)" (?create@Structure@JSC@@SAPEAV12@AEAVVM@2@PEAVJSGlobalObject@2@VJSValue@2@AEBVTypeInfo@2@PEBUClassInfo@2@EI@Z)
965
966         No new tests because there is no behavior change.
967
968         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Include <JavaScriptCore/JSCInlines.h>,
969         and do not include headers which is included by it.
970
971 2019-06-27  Zalan Bujtas  <zalan@apple.com>
972
973         REGRESSION(r244633): e-mail with "height: 100%" causes unstable layout.
974         https://bugs.webkit.org/show_bug.cgi?id=199303
975         <rdar://problem/51340927>
976
977         Reviewed by Tim Horton.
978
979         This patch restores the previous behavior (pre r244633) where we intentionally reported stale content size value to
980         avoid unstable layout for content like height: 100px.
981
982         * page/FrameView.cpp:
983         (WebCore::FrameView::autoSizeIfEnabled):
984
985 2019-06-27  Fujii Hironori  <Hironori.Fujii@sony.com>
986
987         [WinCairo][MediaFoundation] Stop using soft linking for Media Foundation
988         https://bugs.webkit.org/show_bug.cgi?id=198783
989         <rdar://problem/52301843>
990
991         Unreviewed compilation warning fix. clang-cl reports:
992
993         ..\..\Source\WebCore\platform\graphics\win\MediaPlayerPrivateMediaFoundation.cpp(526,10): warning: address of function 'MFCreateTopology' will always evaluate to 'true' [-Wpointer-bool-conversion]
994             if (!MFCreateTopology)
995                 ~^~~~~~~~~~~~~~~~
996         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
997         (WebCore::MediaPlayerPrivateMediaFoundation::createTopologyFromSource): Removed the pointer check of MFCreateTopology.
998
999 2019-06-27  Fujii Hironori  <Hironori.Fujii@sony.com>
1000
1001         [WinCairo][MediaFoundation] Stop using soft linking for Media Foundation
1002         https://bugs.webkit.org/show_bug.cgi?id=198783
1003
1004         Reviewed by Alex Christensen.
1005
1006         WinCairo is supporting Windows 7 or newer. It doesn't need soft
1007         linking anymore.
1008
1009         No new tests because there is no behavior change.
1010
1011         * PlatformWinCairo.cmake: Added libraries to WebCore_LIBRARIES.
1012         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1013         (WebCore::mimeTypeCache):
1014         (WebCore::MediaPlayerPrivateMediaFoundation::setRate):
1015         (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes):
1016         (WebCore::MediaPlayerPrivateMediaFoundation::createSession):
1017         (WebCore::MediaPlayerPrivateMediaFoundation::endSession):
1018         (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
1019         (WebCore::MediaPlayerPrivateMediaFoundation::createTopologyFromSource):
1020         (WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode):
1021         (WebCore::MediaPlayerPrivateMediaFoundation::createSourceStreamNode):
1022         (WebCore::MediaPlayerPrivateMediaFoundation::updateReadyState):
1023         (WebCore::MediaPlayerPrivateMediaFoundation::videoDisplay):
1024         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::createOptimalVideoType):
1025         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::setFrameRate):
1026         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
1027         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::initializeD3D):
1028         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DSample):
1029
1030 2019-06-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1031
1032          Fix build error on WebCore when disabling ENABLE_INDEXED_DATABASE.
1033         https://bugs.webkit.org/show_bug.cgi?id=199286
1034
1035          Unreviewed build fix.
1036
1037          * testing/Internals.cpp: Make method conditional.
1038          * testing/Internals.h: Ditto.
1039          * testing/Internals.idl: Ditto.
1040
1041 2019-06-27  Simon Fraser  <simon.fraser@apple.com>
1042
1043         Fix crash in ScrollingStateNode::insertChild()
1044         https://bugs.webkit.org/show_bug.cgi?id=199297
1045         rdar://problem/49415136
1046
1047         Reviewed by Tim Horton.
1048
1049         Crash data suggest that 'parent' can be deleted in ScrollingStateTree::insertNode(). To avoid this,
1050         have ScrollingStateTree::m_stateNodeMap store RefPts, and do the same for ScrollingTree::m_nodeMap.
1051
1052         * page/scrolling/ScrollingStateNode.cpp:
1053         (WebCore::ScrollingStateNode::ScrollingStateNode): The relaxAdoptionRequirement() is required
1054         to avoid ASSERT(!m_adoptionIsRequired) when the node is added to the tree in its constructor.
1055         * page/scrolling/ScrollingStateTree.cpp:
1056         (WebCore::ScrollingStateTree::unparentNode):
1057         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
1058         (WebCore::ScrollingStateTree::detachAndDestroySubtree):
1059         (WebCore::ScrollingStateTree::stateNodeForID const):
1060         * page/scrolling/ScrollingStateTree.h:
1061         * page/scrolling/ScrollingTree.cpp:
1062         (WebCore::ScrollingTree::updateTreeFromStateNode):
1063         * page/scrolling/ScrollingTree.h:
1064
1065 2019-06-27  Simon Fraser  <simon.fraser@apple.com>
1066
1067         REGRESSION (r246869): ASSERTION FAILED: !renderer().hasRepaintLayoutRects() || renderer().repaintLayoutRects().m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint())
1068         https://bugs.webkit.org/show_bug.cgi?id=199274
1069
1070         Reviewed by Zalan Bujtas.
1071
1072         When layer backing sharing changes, we need to clear cached repaint rects, since they
1073         painting root changes.
1074
1075         * rendering/RenderLayer.cpp:
1076         (WebCore::RenderLayer::setBackingProviderLayer):
1077
1078 2019-06-27  Beth Dakin  <bdakin@apple.com>
1079
1080         Upstream use of MACCATALYST
1081         https://bugs.webkit.org/show_bug.cgi?id=199245
1082         rdar://problem/51687723
1083
1084         Reviewed by Tim Horton.
1085
1086         * Configurations/Base.xcconfig:
1087         * Configurations/FeatureDefines.xcconfig:
1088         * Configurations/SDKVariant.xcconfig:
1089         * Configurations/WebCore.xcconfig:
1090         * Modules/geolocation/ios/GeolocationPositionIOS.mm:
1091         (WebCore::GeolocationPosition::GeolocationPosition):
1092         * editing/cocoa/DictionaryLookup.mm:
1093         (-[WebRevealHighlight drawHighlightContentForItem:context:]):
1094         (WebCore::showPopupOrCreateAnimationController):
1095         * editing/cocoa/WebContentReaderCocoa.mm:
1096         * page/Navigator.h:
1097         * page/SettingsBase.cpp:
1098         (WebCore::SettingsBase::defaultContentChangeObserverEnabled):
1099         * page/cocoa/MemoryReleaseCocoa.mm:
1100         (WebCore::platformReleaseMemory):
1101         * platform/audio/ios/AudioSessionIOS.mm:
1102         (WebCore::AudioSession::setCategory):
1103         (WebCore::AudioSession::routingContextUID const):
1104         * platform/cocoa/ParentalControlsContentFilter.mm:
1105         (WebCore::canHandleResponse):
1106         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:
1107         (WebCore::AVAssetMIMETypeCache::isAvailable const):
1108         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm:
1109         (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const):
1110         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1111         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1112         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
1113         * platform/graphics/cv/ImageTransferSessionVT.h:
1114         * platform/graphics/cv/ImageTransferSessionVT.mm:
1115         (WebCore::cvPixelFormatOpenGLKey):
1116         (WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
1117         * platform/ios/PasteboardIOS.mm:
1118         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
1119         (WebCore::Pasteboard::supportedWebContentPasteboardTypes):
1120         * platform/ios/PlatformPasteboardIOS.mm:
1121         (WebCore::registerItemToPasteboard):
1122         (WebCore::PlatformPasteboard::write):
1123         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1124         (-[WebAVPlayerLayer setVideoGravity:]):
1125         * platform/ios/WebItemProviderPasteboard.mm:
1126         (-[WebItemProviderRegistrationInfoList itemProvider]):
1127         (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
1128         (-[WebItemProviderPasteboard numberOfFiles]):
1129         * platform/network/cf/CertificateInfoCFNet.cpp:
1130         (WebCore::CertificateInfo::summaryInfo const):
1131
1132 2019-06-27  Brent Fulgham  <bfulgham@apple.com>
1133
1134         Correct document lifecycle while processing commands
1135         https://bugs.webkit.org/show_bug.cgi?id=199146
1136         <rdar://problem/52047462>
1137
1138         Reviewed by Darin Adler.
1139
1140         Protect the document while commands are being processed since script may run
1141         during the style resolution. We should protect against this.
1142
1143         * dom/Document.cpp:
1144         (WebCore::command):
1145
1146 2019-06-27  Jon Davis  <jond@apple.com>
1147
1148         Add status for Web Bluetooth Scanning standards specification.
1149         https://bugs.webkit.org/show_bug.cgi?id=199235
1150
1151         Reviewed by Joseph Pecoraro.
1152
1153         * features.json:
1154
1155 2019-06-27  Saam Barati  <sbarati@apple.com>
1156
1157         Make WEBGPU enabled only on Mojave and later.
1158
1159         Rubber-stamped by Myles C. Maxfield.
1160
1161         We're going to look into re-enabling it on High Sierra in:
1162         https://bugs.webkit.org/show_bug.cgi?id=199275
1163
1164         * Configurations/FeatureDefines.xcconfig:
1165
1166 2019-06-27  Antti Koivisto  <antti@apple.com>
1167
1168         REGRESSION (touch-action): Can't scroll vertically when touching a horizontally-scrollable element on instagram.com
1169         https://bugs.webkit.org/show_bug.cgi?id=199268
1170         <rdar://problem/52246473>
1171
1172         Reviewed by Antoine Quint.
1173
1174         Test: pointerevents/ios/touch-action-region-manipulation.html
1175
1176         Having a restrictive touch-action value like 'pan-y' on on element and then having a descendant with
1177         'touch-action: manipulation' computes to 'none'.
1178
1179         * css/StyleResolver.cpp:
1180         (WebCore::computeEffectiveTouchActions):
1181
1182         For value 'manipulation' return the current effective value, similar to the reverse case above.
1183         Set intersection should only be computed out of restrictive values (pan-x/pan-y/pinch-zoom/none).
1184
1185 2019-06-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1186
1187         [SOUP] Use libsoup WebSockets API
1188         https://bugs.webkit.org/show_bug.cgi?id=199151
1189
1190         Reviewed by Michael Catanzaro.
1191
1192         Use createWebSocketChannel() from the provider also for libsoup when WEBKIT_USE_SOUP_WEBSOCKETS env var is set.
1193
1194         * Modules/websockets/ThreadableWebSocketChannel.cpp:
1195         (WebCore::ThreadableWebSocketChannel::create):
1196
1197 2019-06-27  Devin Rousso  <drousso@apple.com>
1198
1199         Web Inspector: throw an error if console.count/console.countReset is called with an object that throws an error from toString
1200         https://bugs.webkit.org/show_bug.cgi?id=199252
1201
1202         Reviewed by Joseph Pecoraro.
1203
1204         Parse the arguments passed to `console.count` and `console.countReset` before sending it to
1205         the `ConsoleClient` so that an error can be thrown if the first argument doesn't `toString`
1206         nicely (e.g. without throwing an error).
1207
1208         Generate call stacks for `console.countReset` to match other `console` methods. Also do this
1209         for `console.time`, `console.timeLog`, and `console.timeEnd`. Limit the call stack to only
1210         have the top frame, so no unnecessary/extra data is sent to the frontend (right now, only
1211         the call location is displayed).
1212
1213         Rename `title` to `label` for `console.time`, `console.timeLog`, and `console.timeEnd` to
1214         better match the spec.
1215
1216         Updated existing LayoutTests:
1217          - inspector/console/console-count.html
1218          - inspector/console/console-api.html
1219
1220         Also covered by existing WPT tests.
1221
1222         * inspector/InspectorInstrumentation.h:
1223         (WebCore::InspectorInstrumentation::consoleCount):
1224         (WebCore::InspectorInstrumentation::consoleCountReset):
1225         (WebCore::InspectorInstrumentation::startConsoleTiming):
1226         (WebCore::InspectorInstrumentation::logConsoleTiming):
1227         (WebCore::InspectorInstrumentation::stopConsoleTiming):
1228         * inspector/InspectorInstrumentation.cpp:
1229         (WebCore::InspectorInstrumentation::consoleCountImpl):
1230         (WebCore::InspectorInstrumentation::consoleCountResetImpl):
1231         (WebCore::InspectorInstrumentation::startConsoleTimingImpl):
1232         (WebCore::InspectorInstrumentation::logConsoleTimingImpl):
1233         (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
1234
1235         * page/PageConsoleClient.h:
1236         * page/PageConsoleClient.cpp:
1237         (WebCore::PageConsoleClient::count):
1238         (WebCore::PageConsoleClient::countReset):
1239         (WebCore::PageConsoleClient::time):
1240         (WebCore::PageConsoleClient::timeLog):
1241         (WebCore::PageConsoleClient::timeEnd):
1242
1243         * workers/WorkerConsoleClient.h:
1244         * workers/WorkerConsoleClient.cpp:
1245         (WebCore::WorkerConsoleClient::count):
1246         (WebCore::WorkerConsoleClient::countReset):
1247         (WebCore::WorkerConsoleClient::time):
1248         (WebCore::WorkerConsoleClient::timeLog):
1249         (WebCore::WorkerConsoleClient::timeEnd):
1250
1251         * worklets/WorkletConsoleClient.h:
1252         * worklets/WorkletConsoleClient.cpp:
1253         (WebCore::WorkletConsoleClient::count):
1254         (WebCore::WorkletConsoleClient::countReset):
1255
1256 2019-06-27  Saam Barati  <sbarati@apple.com>
1257
1258         [WHLSL] Implement arrays and MakeArrayReference
1259         https://bugs.webkit.org/show_bug.cgi?id=198414
1260
1261         Reviewed by Myles C. Maxfield.
1262
1263         This patch implements WHLSL arrays. The main implementation detail is that
1264         arrays get compiled to use Metal's array type. To make everything work, this
1265         patch also fixes a few bugs:
1266         - The checker now allows "operator.length" to be called on arrays. Prior to
1267         this patch, it was just allowed on array references.
1268         
1269         - The preserve variable lifetimes pass now looks at MakeArrayReference nodes.
1270         Prior to this patch, it just looked at MakePointerExpression.
1271         
1272         - We were producing the wrong type for ander arguments for indexed accesses
1273         on array types. We were saying the argument that was produced was a reference
1274         to an array instead of an array reference to the element type.
1275         
1276         - The trie we compose for the reverse type hierarchy was inserting elements
1277         into the wrong "children" vector. We were always inserting things into the
1278         top level vector. This is wrong when we have a nesting of types > 1.
1279         
1280         I also found a bug with having arrays of pointers when writing this patch.
1281         Work on this will take place in a follow up: https://bugs.webkit.org/show_bug.cgi?id=199197
1282
1283         Tests: webgpu/whlsl-huge-array.html
1284                webgpu/whlsl-make-array-reference.html
1285                webgpu/whlsl-simple-arrays.html
1286                webgpu/whlsl-two-dimensional-array.html
1287
1288         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1289         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1290         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
1291         (WebCore::WHLSL::Metal::writeNativeFunction):
1292         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
1293         (WebCore::WHLSL::Metal::TypeNamer::insert):
1294         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
1295         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
1296         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1297         (WebCore::WHLSL::resolveByInstantiation):
1298         (WebCore::WHLSL::Checker::visit):
1299         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
1300         (WebCore::WHLSL::EscapedVariableCollector::escapeVariableUse):
1301         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
1302         (WebCore::WHLSL::wrapAnderCallArgument):
1303         (WebCore::WHLSL::anderCallArgument):
1304         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
1305
1306 2019-06-27  Fujii Hironori  <Hironori.Fujii@sony.com>
1307
1308         [CMake] Bump cmake_minimum_required version to 3.10
1309         https://bugs.webkit.org/show_bug.cgi?id=199181
1310
1311         Reviewed by Don Olmstead.
1312
1313         No new tests because there is no behavior change.
1314
1315         * CMakeLists.txt:
1316
1317 2019-06-26  Simon Fraser  <simon.fraser@apple.com>
1318
1319         [Async overflow scrolling] Fix missing or misplaced content inside overflow:scroll
1320         https://bugs.webkit.org/show_bug.cgi?id=199253
1321         rdar://problem/51855156, rdar://problem/51934514
1322
1323         Reviewed by Zalan Bujtas.
1324
1325         This patch fixes a couple of related issues triggered by failing to composite layers inside non-stacking-context
1326         overflow scroll.
1327
1328         First, we relied on overlap testing to composite position:relative layers inside overflow:scroll, but this only
1329         worked when they came later in z-order, so didn't work for layers with negative z-index.
1330         RenderLayerCompositor::requiresCompositingForIndirectReason() was intended to trigger compositing in such cases,
1331         but it only did so for position:absolute inside stacking-context scroller, because
1332         isNonScrolledLayerInsideScrolledCompositedAncestor() tested ancestorMovedByScroller && !layerMovedByScroller.
1333
1334         I fixed this by sharing code between the three places that ask whether compositing crosses a containing-block
1335         boundary to call a single function, RenderLayerCompositor::layerScrollBehahaviorRelativeToCompositedAncestor(),
1336         that returns a ScrollPositioningBehavior. We now do compositing for both "moves" and "stationary" behaviors (but
1337         not "none"), ensuring that position:relative inside non-stacking scroller is always composited.
1338
1339         However, this would trigger compositing on layers that should be using backing sharing; if they were outside the
1340         visible part of the scroller, the overlap code would not trigger, but the
1341         "IndirectCompositingReason::OverflowScrollPositioning" code would. This is undesirable; any layer that can use
1342         backing sharing should, because that's fewer composited layers, so smaller layer trees and less backing store.
1343         To fix this, I moved the backing-sharing check before the overlap check in
1344         RenderLayerCompositor::computeCompositingRequirements().
1345
1346         The "layer.setHasCompositingDescendant(currentState.subtreeIsCompositing)" line was in the wrong place,
1347         triggering assertions on some content; "subtreeIsCompositing" only refers to child layers, so this bit needs to
1348         be set right after we've traversed the z-order lists.
1349
1350         Tests: compositing/scrolling/async-overflow-scrolling/hidden-relative-layer-content-in-scroller.html
1351                compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller.html
1352                compositing/scrolling/async-overflow-scrolling/negative-z-in-scroller.html
1353
1354         * rendering/RenderLayerCompositor.cpp:
1355         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1356         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1357         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
1358         (WebCore::isScrolledByOverflowScrollLayer):
1359         (WebCore::enclosingCompositedScrollingLayer):
1360         (WebCore::RenderLayerCompositor::layerScrollBehahaviorRelativeToCompositedAncestor):
1361         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
1362         (WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor): Deleted.
1363         (WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary): Deleted.
1364         * rendering/RenderLayerCompositor.h:
1365
1366 2019-06-26  Ryosuke Niwa  <rniwa@webkit.org>
1367
1368         ReplacementFragment should not have script observable side effects
1369         https://bugs.webkit.org/show_bug.cgi?id=199147
1370
1371         Reviewed by Wenson Hsieh.
1372
1373         Fixed the bug that ReplacementFragment has script observable side effects.
1374
1375         Use a brand new document for sanitization where the script is disabled for test rendering,
1376         and remove style and script elements as well as event handlers before the test rendering
1377         and the actual pasting.
1378
1379         Test: editing/pasteboard/paste-contents-with-side-effects.html
1380
1381         * editing/ReplaceSelectionCommand.cpp:
1382         (WebCore::ReplacementFragment::document): Deleted.
1383         (WebCore::ReplacementFragment::ReplacementFragment): Use createPageForSanitizingWebContent
1384         to create our own document for test rendering. We need to copy over the computed style
1385         from the root editable element (editing host) to respect whitespace treatment, etc...
1386         (WebCore::ReplacementFragment::removeContentsWithSideEffects): Moved from removeHeadContents.
1387         Now removes event handlers and JavaScript URLs.
1388         (WebCore::ReplacementFragment::insertFragmentForTestRendering): Renamed variable names.
1389         (WebCore::ReplaceSelectionCommand::willApplyCommand): Create the plain text and HTML markup
1390         for beforeinput and input events before ReplacementFragment removes contents with side effects.
1391         (WebCore::ReplaceSelectionCommand::ensureReplacementFragment): The removal of head elements
1392         is now done in ReplacementFragment's constructor.
1393
1394 2019-06-26  Andy Estes  <aestes@apple.com>
1395
1396         [Payment Request] Set state to Closed when show() is called during an active session
1397         https://bugs.webkit.org/show_bug.cgi?id=199239
1398
1399         Reviewed by Alex Christensen.
1400
1401         According to step 7 of https://w3c.github.io/payment-request/#show-method (as of 26 June
1402         2019), when another payment request is showing, calling show() should set the [[state]]
1403         internal slot to Closed in addition to rejecting the show promise with an AbortError. WebKit
1404         was only doing the latter. Let's do both.
1405
1406         Test: http/tests/paymentrequest/payment-is-showing.https.html
1407
1408         * Modules/paymentrequest/PaymentRequest.cpp:
1409         (WebCore::PaymentRequest::show):
1410
1411 2019-06-26  Joseph Pecoraro  <pecoraro@apple.com>
1412
1413         Web Inspector: Implement console.countReset
1414         https://bugs.webkit.org/show_bug.cgi?id=199200
1415
1416         Reviewed by Devin Rousso.
1417
1418         Updated existing tests.
1419
1420         * inspector/InspectorInstrumentation.cpp:
1421         (WebCore::InspectorInstrumentation::consoleCountImpl):
1422         (WebCore::InspectorInstrumentation::consoleCountResetImpl):
1423         * inspector/InspectorInstrumentation.h:
1424         (WebCore::InspectorInstrumentation::consoleCountReset):
1425         * page/PageConsoleClient.cpp:
1426         (WebCore::PageConsoleClient::countReset):
1427         * page/PageConsoleClient.h:
1428         * workers/WorkerConsoleClient.cpp:
1429         (WebCore::WorkerConsoleClient::countReset):
1430         * workers/WorkerConsoleClient.h:
1431         * worklets/WorkletConsoleClient.cpp:
1432         (WebCore::WorkletConsoleClient::countReset):
1433         * worklets/WorkletConsoleClient.h:
1434
1435 2019-06-26  Antoine Quint  <graouts@apple.com>
1436
1437         [Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
1438         https://bugs.webkit.org/show_bug.cgi?id=198999
1439         <rdar://problem/51979477>
1440
1441         Reviewed by Dean Jackson.
1442
1443         Make sure we don't return early prior to setting the flag that prevents re-entrancy, or else we would never
1444         enter this function again. No new tests, this was caught because Pointer Events WPT tests on iOS tests regressed.
1445
1446         * page/PointerCaptureController.cpp:
1447         (WebCore::PointerCaptureController::processPendingPointerCapture):
1448
1449 2019-06-26  Myles C. Maxfield  <mmaxfield@apple.com>
1450
1451         REGRESSION: ( r246394 ) webgpu/whlsl-buffer-fragment.html and webgpu/whlsl-buffer-vertex.html are failing
1452         https://bugs.webkit.org/show_bug.cgi?id=199012
1453
1454         Reviewed by Saam Barati.
1455
1456         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
1457         (WebCore::isAcceptableDevice):
1458         (WebCore::GPUDevice::tryCreate):
1459
1460 2019-06-26  Simon Fraser  <simon.fraser@apple.com>
1461
1462         Incorrect clippping with overflow:scroll inside oveflow:hidden with border-radius
1463         https://bugs.webkit.org/show_bug.cgi?id=199135
1464         rdar://problem/51882383
1465
1466         Reviewed by Zalan Bujtas.
1467         
1468         In some cases the geometry of the shape mask layer added to m_childContainmentLayer, for
1469         border-radius, was incorrect. GraphicsLayerCA::updateClippingStrategy() treated
1470         the rounded rect as if it were in renderer coordinates, but to match the other geometry
1471         on GraphicsLayer, it should in GraphicsLayer coordinates, so we need to offset by
1472         clipLayer->offsetFromRenderer().
1473         
1474         In addition, RenderLayerBacking::updateChildClippingStrategy() is called from
1475         the updateConfiguration(), which is before we've set offsetFromRenderer() on the clipLayer.
1476         This first call is really to find out whether the platform supports this rounded rect
1477         as a shape mask.
1478         
1479         So we need to call setMasksToBoundsRect() a second time in RenderLayerBacking::updateGeometry()
1480         after clipLayers's offsetFromRenderer() has been computed.
1481
1482         Test: compositing/scrolling/async-overflow-scrolling/border-radius-on-scroll-container.html
1483
1484         * platform/graphics/ca/GraphicsLayerCA.cpp:
1485         (WebCore::GraphicsLayerCA::updateClippingStrategy):
1486         * rendering/RenderLayerBacking.cpp:
1487         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
1488         (WebCore::RenderLayerBacking::updateDescendantClippingLayer):
1489         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
1490
1491 2019-06-26  Antoine Quint  <graouts@apple.com>
1492
1493         [Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
1494         https://bugs.webkit.org/show_bug.cgi?id=198999
1495         <rdar://problem/51979477>
1496
1497         Reviewed by Dean Jackson.
1498
1499         Up until now, we would not account for pointer capture (see ​https://w3c.github.io/pointerevents/#pointer-capture) when dispatching
1500         mouse boundary events (mouseover, mouseout, mouseenter, mouseleave) and their counterpart pointer events. We would also not account
1501         for it when updating :hover styles.
1502
1503         Now, when pointer capture changes for an element, we call setCapturingMouseEventsElement() on the EventHandler such that the element
1504         that would naturally hit-test is overridden by the pointer capture element when identifying which target to use for the dispatch of
1505         boundary mouse events. Additionally, when calling Document::prepareMouseEvent(), we also use the pointer capture element to
1506         pass down to Document::updateHoverActiveState() such that :hover styles are applied to the correct element.
1507
1508         * dom/Document.cpp:
1509         (WebCore::Document::prepareMouseEvent): When a new event is going to be dispatched, we must run the Process Pending Capture Element
1510         steps as mandated by the Pointer Events spec. Calling this will dispatch the appropriate pointer capture change events and also
1511         required boundary events since EventHandler::setCapturingMouseEventsElement() calls into EventHandler::updateMouseEventTargetNode().
1512         Since this may update the capturing mouse events element, we ensure that we call updateHoverActiveState() with a flag that indicates that.
1513         Finally, we use the capturing mouse events element instead of the hit-testing element to pass to updateHoverActiveState() to ensure
1514         that is has :hover styles applied.
1515         (WebCore::Document::updateHoverActiveState): Account for the new CaptureChange flag to force the invalidation of the :hover and :active
1516         elements chain at all times when the capturing mouse events element changed.
1517         * dom/Document.h:
1518         * dom/PointerEvent.h: Update PointerEvent::createForPointerCapture() to take specific parameters rather than a single PointerEvent to
1519         set the pointerId, isPrimary and pointerType properties of the generated event. This is required to call processPendingPointerCapture()
1520         outside of PointerEvent dispatch logic since we now call it from Document::prepareMouseEvent() where we haven't yet generated such an
1521         event.
1522         * page/EventHandler.cpp:
1523         (WebCore::EventHandler::pointerCaptureElementDidChange): When a new pointer capture element is set, call updateMouseEventTargetNode()
1524         to ensure that boundary events are fired to indicate the pointer capture state change.
1525         (WebCore::EventHandler::prepareMouseEvent): Keep track of the last PlatformMouseEvent used to prepare a mouse event so that we can use
1526         it when setCapturingMouseEventsElement() is called.
1527         * page/EventHandler.h:
1528         * page/PointerCaptureController.cpp:
1529         (WebCore::PointerCaptureController::pointerCaptureElement): Since Document::prepareMouseEvent() needs to know the current pointer capture
1530         element, add a new public method that indicates the pointer capture element if that element is contained in the provided document. We need
1531         to provide the document since PointerCaptureController is owned by the Page and may manage several documents.
1532         (WebCore::PointerCaptureController::dispatchEvent): Only run the Process Pending Capture Element steps when dealing with a touch or pen
1533         event since those steps are already ran for mouse events in Document::prepareMouseEvent(). Additionally, since the element target is already
1534         set to be the pointer capture element with the changes made to processPendingPointerCapture(), and because on iOS pointer capture is always
1535         active, we can remove the code that would retarget the event to the pointer capture element.
1536         (WebCore::PointerCaptureController::pointerEventWasDispatched):
1537         (WebCore::PointerCaptureController::cancelPointer):
1538         (WebCore::PointerCaptureController::processPendingPointerCapture): We now call into EventHandler::setCapturingMouseEventsElement() when the
1539         capture target element changes. We must be careful to call this method prior to dispatching the "gotpointercapture" event and after dispatching
1540         the "lostpointercapture" event so that boundary events are fired at the right time.
1541         * page/PointerCaptureController.h:
1542
1543 2019-06-25  Fujii Hironori  <Hironori.Fujii@sony.com>
1544
1545         [WinCairo] incorrect font height for 'Google Sans Display' font
1546         https://bugs.webkit.org/show_bug.cgi?id=198909
1547
1548         Reviewed by Frédéric Wang.
1549
1550         r191893 changed to use OS/2 typo metrics, but its calculation
1551         wasn't correct. And, there is no reliable way to get OS/2 table by
1552         using Windows API. Revert the part of r191893 change at the
1553         moment.
1554
1555         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
1556         (WebCore::Font::platformInit):
1557         * platform/graphics/win/SimpleFontDataWin.cpp:
1558         (WebCore::Font::initGDIFont):
1559         Reverted the part of r191893 change, and added FIXME comments.
1560
1561 2019-06-25  Timothy Hatcher  <timothy@apple.com>
1562
1563         Clicking the up/down spin buttons for a number input increments/decrements by 2.
1564         https://bugs.webkit.org/show_bug.cgi?id=198809
1565
1566         Reviewed by Tim Horton.
1567
1568         AppKit no longer registers NSScrollerButtonDelay and NSScrollerButtonPeriod in the base
1569         NSUserDefaults for an app. This caused our use to always get 0s when setting the click
1570         and hold timer, causing the value to increment quickly for a single press.
1571
1572         * platform/mac/ScrollbarThemeMac.h:
1573         (WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay): Added. Hardcode 500ms.
1574         (WebCore::ScrollbarThemeMac::autoscrollTimerDelay): Added. Hardcode 50ms.
1575         * platform/mac/ScrollbarThemeMac.mm:
1576         (WebCore::ScrollbarThemeMac::preferencesChanged): Removed use of old user defaults.
1577         (WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay): Deleted.
1578         (WebCore::ScrollbarThemeMac::autoscrollTimerDelay): Deleted.
1579
1580 2019-06-25  Keith Miller  <keith_miller@apple.com>
1581
1582         Unreviewed, windows build fix.
1583
1584         * bindings/js/JSDOMGlobalObject.h:
1585
1586 2019-06-25  Keith Miller  <keith_miller@apple.com>
1587
1588         Add didBecomePrototype() calls to global context prototypes
1589         https://bugs.webkit.org/show_bug.cgi?id=199202
1590
1591         Reviewed by Mark Lam.
1592
1593         This fixes some crashes related to asserting that all prototypes
1594         have been marked as such in JSC from
1595         https://trac.webkit.org/changeset/246801. It's ok to call
1596         didBecomePrototype here as we setting up the world state right now
1597         so we won't be having a bad time.
1598
1599         We don't automatically call didBecomePrototype() for
1600         setPrototypeWithoutTransition because existing objects may already
1601         have this structure so it seems more reasonable to be explicit
1602         there.
1603
1604         * bindings/js/JSWindowProxy.cpp:
1605         (WebCore::JSWindowProxy::setWindow):
1606         * bindings/js/WorkerScriptController.cpp:
1607         (WebCore::WorkerScriptController::initScript):
1608         * worklets/WorkletScriptController.cpp:
1609         (WebCore::WorkletScriptController::initScriptWithSubclass):
1610
1611 2019-06-25  Joseph Pecoraro  <pecoraro@apple.com>
1612
1613         Web Inspector: Implement console.timeLog
1614         https://bugs.webkit.org/show_bug.cgi?id=199184
1615
1616         Reviewed by Devin Rousso.
1617
1618         Updated existing tests.
1619
1620         * inspector/InspectorInstrumentation.cpp:
1621         (WebCore::InspectorInstrumentation::logConsoleTimingImpl):
1622         * inspector/InspectorInstrumentation.h:
1623         (WebCore::InspectorInstrumentation::logConsoleTiming):
1624         * page/PageConsoleClient.cpp:
1625         (WebCore::PageConsoleClient::timeLog):
1626         * page/PageConsoleClient.h:
1627         * workers/WorkerConsoleClient.cpp:
1628         (WebCore::WorkerConsoleClient::timeLog):
1629         * workers/WorkerConsoleClient.h:
1630         * worklets/WorkletConsoleClient.cpp:
1631         (WebCore::WorkletConsoleClient::timeLog):
1632         * worklets/WorkletConsoleClient.h:
1633
1634 2019-06-25  Michael Catanzaro  <mcatanzaro@igalia.com>
1635
1636         Add user agent quirk for bankofamerica.com
1637         https://bugs.webkit.org/show_bug.cgi?id=199154
1638
1639         Reviewed by Carlos Garcia Campos.
1640
1641         This suppresses an unsupported browser warning.
1642
1643         * platform/UserAgentQuirks.cpp:
1644         (WebCore::urlRequiresMacintoshPlatform):
1645
1646 2019-06-25  Michael Catanzaro  <mcatanzaro@igalia.com>
1647
1648         Fully rename WebKitGTK+ -> WebKitGTK everywhere
1649         https://bugs.webkit.org/show_bug.cgi?id=199159
1650
1651         Reviewed by Carlos Garcia Campos.
1652
1653         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1654         (webkitAccessibleTextGetStringAtOffset):
1655         * platform/UserAgentQuirks.cpp:
1656         (WebCore::urlRequiresMacintoshPlatform):
1657         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1658         (WebCore::NetworkStorageSession::saveCredentialToPersistentStorage):
1659         * rendering/RenderThemeGtk.cpp:
1660         (WebCore::RenderThemeGtk::adjustTextFieldStyle const):
1661
1662 2019-06-25  Rob Buis  <rbuis@igalia.com>
1663
1664         Introduce LinkLoadParameters
1665         https://bugs.webkit.org/show_bug.cgi?id=198960
1666
1667         Reviewed by Frédéric Wang.
1668
1669         Avoid the long parameters lists in LinkLoader by moving them
1670         to LinkLoadParameters.
1671
1672         No new tests because there is no behavior change.
1673
1674         * html/HTMLLinkElement.cpp:
1675         (WebCore::HTMLLinkElement::process):
1676         * loader/LinkLoader.cpp:
1677         (WebCore::LinkLoader::loadLinksFromHeader):
1678         (WebCore::LinkLoader::preconnectIfNeeded):
1679         (WebCore::LinkLoader::preloadIfNeeded):
1680         (WebCore::LinkLoader::prefetchIfNeeded):
1681         (WebCore::LinkLoader::loadLink):
1682         * loader/LinkLoader.h:
1683
1684 2019-06-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1685
1686         [Text autosizing] [iPadOS] Revise our heuristics to determine idempotent text autosizing candidates
1687         https://bugs.webkit.org/show_bug.cgi?id=198763
1688         <rdar://problem/51826266>
1689
1690         Reviewed by Simon Fraser.
1691
1692         This patch adjusts existing text autosizing heuristics, based on a survey of text on websites in the Alexa top
1693         500 that shrink down to fit the viewport when requesting the desktop version of the site. The new heuristic is
1694         derived from training decision trees against the dataset obtained from this survey, and balances false positives
1695         (cases where layout is broken due to autosizing) against overall accuracy (measured using cross-validation).
1696
1697         See below for more details. Additionally, please refer to the link in the radar for more details, as well as
1698         resources used to generate, validate, and analyze these decision trees.
1699
1700         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
1701
1702         * css/StyleResolver.cpp:
1703         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
1704         * rendering/style/RenderStyle.cpp:
1705         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
1706
1707         Rename AutosizeStatus::shouldSkipSubtree to RenderStyle::isIdempotentTextAutosizingCandidate. We relocate this
1708         logic to RenderStyle, such that we're able to ask the element's RenderStyle questions when determining whether
1709         the element should be autosized.
1710
1711         Of course, this patch additionally revamps the heuristic used to determine whether it is safe to autosize an
1712         element. Our current heuristic in trunk simply checks for the presence of inline block display, out of flow
1713         positioning and a fixed height ancestor; if any of these conditions are satisfied, we opt the element out of
1714         text autosizing. This is an excellent strategy for boosting some runs of text while avoiding autosizing in the
1715         vast majority of cases where increasing font size may lead to layout breakage (e.g. overlapping or clipped text,
1716         content unexpectedly flowing to the next line, etc.). However, it also avoids boosting font sizes in many
1717         scenarios where boosting font sizes is desired; for concrete examples, see the (currently 24) radars about small
1718         font sizes that are duped to <rdar://problem/51826266>.
1719
1720         To help analyze and identify trends in autosizable and non-autosizable text, we assembled a dataset of elements
1721         with text from the Alexa top 500 that either: (1) were too small and could be boosted safely, or (2) would break
1722         layout if boosted. With this labeled dataset, we then trained binary decision trees to classify the data. Each
1723         decision tree was trained with a number of hyperparameters: namely, maximum depth, minimum leaf size, and the
1724         amount of bias towards negative samples (i.e. the ratio of the weight of a non-autosizable sample relative to
1725         the weight of an autosizable sample).
1726
1727         For each 3-tuple of these hyperparameters (800 in total: max depth between 3 and 10, min leaf size between 1 and
1728         10 and bias between 1 and 10), for 5000 iterations each, we split the full dataset into a training dataset and
1729         a cross-validation dataset, trained a decision tree using the training set, and tested against the cross-
1730         validation set to compute average precision, recall, and overall accuracy for each tuple of hyperparameters.
1731
1732         The decision tree introduced in this patch was generated using a hand-picked set of hyperparameters (max depth
1733         10, min leaf size 4, and negative bias 2) to provide a balance between precision scores (limiting layout
1734         breakage) and recall score (ensuring that small text is mostly autosized), while optimizing for overall
1735         accuracy. Cross-validation scores predict that the overall accuracy of this classifier is approximately 70%, up
1736         from the current accuracy in trunk (~53%).
1737
1738         * rendering/style/RenderStyle.h:
1739
1740         Grow the width of `autosizeStatus` from 4 to 8 (notably, this does not increase the size of RenderStyle).
1741
1742         * rendering/style/TextSizeAdjustment.cpp:
1743         (WebCore::AutosizeStatus::updateStatus):
1744         (WebCore::AutosizeStatus::shouldSkipSubtree const): Deleted.
1745         * rendering/style/TextSizeAdjustment.h:
1746
1747         Introduce new text autosizing state flags, and remove some existing ones.
1748
1749 2019-06-24  Commit Queue  <commit-queue@webkit.org>
1750
1751         Unreviewed, rolling out r246714.
1752         https://bugs.webkit.org/show_bug.cgi?id=199179
1753
1754         revert to do patch in a different way. (Requested by keith_mi_
1755         on #webkit).
1756
1757         Reverted changeset:
1758
1759         "All prototypes should call didBecomePrototype()"
1760         https://bugs.webkit.org/show_bug.cgi?id=196315
1761         https://trac.webkit.org/changeset/246714
1762
1763 2019-06-24  Sihui Liu  <sihui_liu@apple.com>
1764
1765         REGRESSION (r244436): IndexedDB Uint8Array returned as ArrayBuffer
1766         https://bugs.webkit.org/show_bug.cgi?id=198738
1767         <rdar://problem/51614053>
1768
1769         Reviewed by Brady Eidson.
1770
1771         In InexedDB, two binary keys are the same as long as their data is the same.
1772
1773         Modified tests: storage/indexeddb/key-type-binary.html
1774                         storage/indexeddb/key-type-binary-private.html
1775
1776         * bindings/js/IDBBindingUtilities.cpp:
1777         (WebCore::injectIDBKeyIntoScriptValue):
1778         * bindings/js/SerializedScriptValue.cpp:
1779         (WebCore::CloneDeserializer::readArrayBufferView):
1780
1781 2019-06-24  Sihui Liu  <sihui_liu@apple.com>
1782
1783         Remove WebSQL quirk for nytimes.com
1784         https://bugs.webkit.org/show_bug.cgi?id=199175
1785
1786         Reviewed by Geoffrey Garen.
1787
1788         Removed unused code.
1789
1790         * bindings/scripts/CodeGeneratorJS.pm:
1791         (GenerateRuntimeEnableConditionalString):
1792         * bindings/scripts/IDLAttributes.json:
1793         * page/Quirks.cpp:
1794         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
1795         (WebCore::Quirks::hasWebSQLSupportQuirk const): Deleted.
1796         * page/Quirks.h:
1797
1798 2019-06-24  Brady Eidson  <beidson@apple.com>
1799
1800         Null deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
1801         <rdar://problem/51535942> and https://bugs.webkit.org/show_bug.cgi?id=199123
1802
1803         Reviewed by Andy Estes.
1804
1805         * loader/FrameLoaderStateMachine.h:
1806         (WebCore::FrameLoaderStateMachine::stateForDebugging const):
1807
1808 2019-06-24  Simon Fraser  <simon.fraser@apple.com>
1809
1810         REGRESSION (r246725 ): Crashes on twitch.tv
1811         https://bugs.webkit.org/show_bug.cgi?id=199176
1812         rdar://problem/52071249
1813
1814         Reviewed by Zalan Bujtas.
1815         
1816         With a composited negative z-index child inside a scroller, we can register the overflow scroll
1817         proxy node before we've traversed the overflow layer, so it that layer hasn't got its OverflowScrollingNode
1818         yet. Thus, AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes() can be called with an empty vector.
1819         Avoid crashing when this happens.
1820
1821         Test: scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child.html
1822
1823         * page/scrolling/AsyncScrollingCoordinator.cpp:
1824         (WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):
1825         * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
1826         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
1827
1828 2019-06-24  Chris Dumez  <cdumez@apple.com>
1829
1830         Pages using Google's anti-flicker optimization may take ~5 seconds to do initial paint
1831         https://bugs.webkit.org/show_bug.cgi?id=199173
1832         <rdar://problem/45968770>
1833
1834         Reviewed by Geoffrey Garen.
1835
1836         Pages using Google's anti-flicker optimization [1] take ~5 seconds to do initial paint when
1837         analytics.js load is blocked by a content blocker.
1838
1839         To address the issue, this patch introduces a quirk behind an experimental feature flag that
1840         calls window.dataLayer.hide.end() on the page when the load of https://www.google-analytics.com/analytics.js
1841         is blocked by a content blocker. Note that this is more robust than dropping the 'async-hide'
1842         class from document.documentElement since the class name is customizable by the caller.
1843         A message is logged in the console when the quirk causes window.dataLayer.hide.end() to get called
1844         early.
1845
1846         [1] https://developers.google.com/optimize/
1847
1848         * contentextensions/ContentExtensionsBackend.cpp:
1849         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
1850         * page/Settings.yaml:
1851
1852 2019-06-24  John Wilander  <wilander@apple.com>
1853
1854         Remove IsITPFirstPartyWebsiteDataRemovalEnabled as runtime check
1855         https://bugs.webkit.org/show_bug.cgi?id=199164
1856         <rdar://problem/52061147>
1857
1858         Reviewed by Brent Fulgham.
1859
1860         No new tests. Just a removal of a runtime feature check. The functionality
1861         already has a layout test.
1862
1863         We've had this toggle as a safety thing since mid-March. No need for it any longer.
1864
1865         * page/RuntimeEnabledFeatures.h:
1866         (WebCore::RuntimeEnabledFeatures::isITPDatabaseEnabled const):
1867         (WebCore::RuntimeEnabledFeatures::setIsITPFirstPartyWebsiteDataRemovalEnabled): Deleted.
1868         (WebCore::RuntimeEnabledFeatures::isITPFirstPartyWebsiteDataRemovalEnabled const): Deleted.
1869
1870 2019-06-24  Jer Noble  <jer.noble@apple.com>
1871
1872         iOS 12.2 Drawing portrait video to canvas is sideways
1873         https://bugs.webkit.org/show_bug.cgi?id=196772
1874         <rdar://problem/49781802>
1875
1876         Reviewed by Eric Carlson.
1877
1878         Test: media/video-orientation-canvas.html
1879
1880         Move rotation code into its own ImageRotationSessionVT class for re-use across
1881         all existing classes with rotation operations. Should slightly increase performance
1882         for painting rotated media files, as the rotation only occurs once per frame, rather
1883         than once per drawing operation.
1884
1885         * WebCore.xcodeproj/project.pbxproj:
1886         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
1887         (WebCore::ImageDecoderAVFObjC::RotationProperties::isIdentity const): Deleted.
1888         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1889         (WebCore::ImageDecoderAVFObjC::readTrackMetadata):
1890         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
1891         (WebCore::ImageDecoderAVFObjC::setTrack):
1892         (WebCore::transformToRotationProperties): Deleted.
1893         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1894         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1895         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1896         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
1897         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1898         * platform/graphics/cv/ImageRotationSessionVT.h: Added.
1899         (WebCore::ImageRotationSessionVT::RotationProperties::isIdentity const):
1900         (WebCore::ImageRotationSessionVT::rotationProperties const):
1901         (WebCore::ImageRotationSessionVT::rotatedSize):
1902         * platform/graphics/cv/ImageRotationSessionVT.mm: Added.
1903         (WebCore::transformToRotationProperties):
1904         (WebCore::ImageRotationSessionVT::ImageRotationSessionVT):
1905         (WebCore::ImageRotationSessionVT::rotate):
1906         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
1907         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
1908         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
1909         (WebCore::rotationToAngle):
1910         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
1911         (WebCore::computeRotatedWidthAndHeight): Deleted.
1912
1913 2019-06-24  Zalan Bujtas  <zalan@apple.com>
1914
1915         [StyleResolver] Pass RenderStyle& instead of RenderStyle* to updateFont() related functions.
1916         https://bugs.webkit.org/show_bug.cgi?id=199167
1917         <rdar://problem/52062669>
1918
1919         Reviewed by Antti Koivisto.
1920
1921         It is expected to have a valid RenderStyle object here (and existing code relies on it).
1922
1923         * css/StyleResolver.cpp:
1924         (WebCore::checkForOrientationChange):
1925         (WebCore::StyleResolver::updateFont):
1926         (WebCore::StyleResolver::checkForTextSizeAdjust):
1927         (WebCore::StyleResolver::checkForZoomChange):
1928         (WebCore::StyleResolver::checkForGenericFamilyChange):
1929         * css/StyleResolver.h:
1930
1931 2019-06-24  Antoine Quint  <graouts@apple.com>
1932
1933         [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html
1934         https://bugs.webkit.org/show_bug.cgi?id=197005
1935
1936         Reviewed by Dean Jackson.
1937
1938         We were calling processPendingPointerCapture() at the wrong time, calling in after dispatching a PointerEvent rather than before.
1939         We now do this correctly in the consolidated PointerCaptureController::dispatchEvent() method, which we call for dispatching all
1940         PointerEvents, save for gotpointercapture and lostpointercapture since these should not yield the processing of the pending pointer
1941         capture per the spec.
1942
1943         This uncovered a couple of new issues. First, since we would now call processPendingPointerCapture() and dispatch a lostpointercapture
1944         event earlier, the alternative lostpointercapture dispatch when an element is removed (which is dispatched asynchronously on the
1945         document) would be dispatched *after* dispatching the event in processPendingPointerCapture(). We now check in processPendingPointerCapture()
1946         whether the event target is connected to fix this. This makes sure pointerevent_lostpointercapture_for_disconnected_node.html doesn't regress.
1947
1948         Finally, we must also call processPendingPointerCapture() when implicitly releasing pointer capture during handling of a "pointerup" event.
1949         This ensures that pointerevent_releasepointercapture_invalid_pointerid.html doesn't regress.
1950
1951         As a result of all these changes, we now pass imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html reliably.
1952
1953         * page/PointerCaptureController.cpp:
1954         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
1955         (WebCore::PointerCaptureController::dispatchEvent): We now more closely adhere to the spec when determining what the pointer capture target is by
1956         only checking for the target override. We can now do this safely since we call processPendingPointerCapture() before and not after event dispatch.
1957         (WebCore::PointerCaptureController::pointerEventWasDispatched):
1958         (WebCore::PointerCaptureController::processPendingPointerCapture): Cache the pending target override to make sure that dispatching a "gotpointercapture"
1959         or "lostpointercapture" event during this function does not alter it until the next call is made when the next event is dispatched.
1960
1961 2019-06-24  Greg Doolittle  <gr3g@apple.com>
1962
1963         Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt>
1964         https://bugs.webkit.org/show_bug.cgi?id=194754
1965
1966         Reviewed by Chris Fleizach.
1967
1968         Test: accessibility/img-alt-attribute-unassigned-value.html
1969
1970         * accessibility/AccessibilityObject.cpp:
1971         (WebCore::AccessibilityObject::computedRoleString const):
1972
1973 2019-06-24  Adrian Perez de Castro  <aperez@igalia.com>
1974
1975         [WPE][GTK] Fixes for compilation with unified builds disabled
1976         https://bugs.webkit.org/show_bug.cgi?id=199155
1977
1978         Reviewed by Michael Catanzaro.
1979
1980         No new tests needed.
1981
1982         * rendering/LayerAncestorClippingStack.h: Add missing inclusion of RenderLayer.h
1983
1984 2019-06-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1985
1986         Add user agent quirk for Google Drive
1987         https://bugs.webkit.org/show_bug.cgi?id=199153
1988
1989         Reviewed by Carlos Garcia Campos.
1990
1991         This suppresses an unsupported browser warning.
1992
1993         * platform/UserAgentQuirks.cpp:
1994         (WebCore::urlRequiresMacintoshPlatform):
1995         (WebCore::urlRequiresLinuxDesktopPlatform):
1996
1997 2019-06-24  Charlie Turner  <cturner@igalia.com>
1998
1999         [GStreamer][MSE] Pausing video sometimes causes skip to finish
2000         https://bugs.webkit.org/show_bug.cgi?id=197355
2001
2002         Reviewed by Philippe Normand.
2003
2004         Covered by existing tests.
2005
2006         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2007         (WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const):
2008         Assuming that when m_eosPending is on and we're paused() that the
2009         network resource is fully loaded and the end is reached is clearly
2010         wrong. Whether this is now correct is unclear...
2011
2012 2019-06-24  Charlie Turner  <cturner@igalia.com>
2013
2014         [GStreamer] Volume level sometimes changes inappropriately
2015         https://bugs.webkit.org/show_bug.cgi?id=197358
2016
2017         Reviewed by Xabier Rodriguez-Calvar.
2018
2019         Be consistent with our application of volume scaling. We were
2020         setting volumes using cubic interpolation in setVolume() and using
2021         the inverse in volume(); however setting initial volumes was done
2022         linearly in setStreamVolumeElement, which was causing strange
2023         jumps in the volume level at non-deterministic times. The fix
2024         looks to be that we should use linear interpolation consistently,
2025         since PulseAudio already applies cubic scaling to software
2026         volumes.
2027
2028         Covered by existing tests.
2029
2030         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2031         (WebCore::MediaPlayerPrivateGStreamer::paused const): Bump the
2032         logging here to LOG level, it's very spammy at DEBUG.
2033         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2034         (WebCore::MediaPlayerPrivateGStreamerBase::setVolume): Switch to
2035         linear interpolation.
2036         (WebCore::MediaPlayerPrivateGStreamerBase::volume const): Ditto.
2037         (WebCore::MediaPlayerPrivateGStreamerBase::notifyPlayerOfVolumeChange):
2038         Ditto.
2039         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
2040         Ditto, and be consistent here with the API, do not set the raw
2041         volume managed by MediaElement.
2042
2043 2019-06-24  Antoine Quint  <graouts@apple.com>
2044
2045         [Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
2046         https://bugs.webkit.org/show_bug.cgi?id=198999
2047         <rdar://problem/51979477>
2048
2049         Unreviewed.
2050
2051         Rolling back all changes made for this bug (r246728 + r246716 + r246674) as it regressed one test
2052         (imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame.html).
2053
2054         * dom/Document.cpp:
2055         (WebCore::Document::prepareMouseEvent):
2056         (WebCore::Document::updateHoverActiveState):
2057         * page/EventHandler.cpp:
2058         (WebCore::EventHandler::handleMousePressEvent):
2059         (WebCore::EventHandler::handleMouseMoveEvent):
2060         (WebCore::EventHandler::handleMouseReleaseEvent):
2061         (WebCore::EventHandler::setCapturingMouseEventsElement):
2062         * page/EventHandler.h:
2063         * page/PointerCaptureController.cpp:
2064         (WebCore::PointerCaptureController::releasePointerCapture):
2065         (WebCore::PointerCaptureController::hasPointerCapture):
2066         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
2067         (WebCore::PointerCaptureController::dispatchEvent):
2068         (WebCore::PointerCaptureController::processPendingPointerCapture):
2069         (WebCore::PointerCaptureController::pointerCaptureElement): Deleted.
2070         * page/PointerCaptureController.h:
2071         * rendering/HitTestRequest.h:
2072         (WebCore::HitTestRequest::includesAllElementsUnderPoint const):
2073         (WebCore::HitTestRequest::pointerCaptureElementChanged const): Deleted.
2074
2075 2019-06-23  Antoine Quint  <graouts@apple.com>
2076
2077         [Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
2078         https://bugs.webkit.org/show_bug.cgi?id=198999
2079         <rdar://problem/52005663>
2080
2081         Reviewed by Dean Jackson.
2082
2083         We should only set the mouse events capturing element in EventHandler if we're dealing with mouse-originated Pointer Events (part 2).
2084
2085         * page/PointerCaptureController.cpp:
2086         (WebCore::PointerCaptureController::releasePointerCapture):
2087
2088 2019-06-23  Simon Fraser  <simon.fraser@apple.com>
2089
2090         [Async overflow scroll] Clipped composited layers inside overflow scroll jitter and get incorrectly clipped
2091         https://bugs.webkit.org/show_bug.cgi?id=199133
2092         rdar://problem/43614439
2093
2094         Reviewed by Antti Koivisto.
2095
2096         Currently a composited layer with an overflow:scroll ancestor (which is not a paint-order
2097         ancestor) gets a single "ancestor clip layer" that represents the intersection of all the
2098         clips provided by its containing-block ancestors with non-visible overflow (both scrolling
2099         and non-scrolling ones).
2100
2101         To correctly update clips with async overflow scroll, this single clip layer needs to be
2102         broken up into multiple clipping ancestors. We need a separate layer, and scrolling tree
2103         node for each ancestor that is an overflow scroll, and layers that represent non-moving
2104         clips (i.e. overflow:hidden and 'clip') between them. This patch adds
2105         LayerAncestorClippingStack to represent this stack of clipping layers. For example with the
2106         following content:
2107         
2108         <div style="overflow:hidden"> <--- A
2109             <div style="overflow:scroll"> <--- B
2110                 <div style="overflow:hidden"> <--- C
2111                     <div style="overflow:hidden"> <--- D
2112                         <div style="overflow:scroll">  <--- E
2113                             <div style="overflow:hidden"> <--- F
2114                                 <div style="overflow:hidden"> <--- G
2115                                     <div></div> <--- H
2116                                 <div>
2117                             <div>
2118                         <div>
2119                     <div>
2120                 <div>
2121             <div>
2122         <div>
2123         
2124         the composited RenderLayer for H owns a LayerAncestorClippingStack with the following contents:
2125             [clip - A]
2126             [scroller - B]
2127             [clip - intersection of C and D]
2128             [scroller - E]
2129             [clip - intersection of F and G]
2130
2131         Each stack entry has a 'masksToBounds' GraphicsLayer for clipping. Entries representing
2132         overflow:scroll clips have a ScrollingNodeID for their OverflowScrollProxy scrolling tree
2133         node (which references the actual OverflowScrollingNode). The non-scroller clips in this
2134         stack are computed unconstrained by the enclosing overflow:scroll.
2135
2136         When the OverflowScrollingNode is scrolled, the boundsOrigin of related OverflowScrollProxy nodes
2137         is adjusted to move the descendant layers (other clipping layers, or composited layers).
2138
2139         OverflowScrollProxy nodes thus take over the role that "Moves" ScrollingTreePositionedNode had.
2140         With this patch, ScrollingTreePositionedNode are purely for absolute position inside non-containing-block
2141         stacking context overflow scroll. LayoutConstraints is renamed to AbsolutePositionConstraints accordingly.
2142
2143         Tests: compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll.html
2144                compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested.html
2145                compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow.html
2146                compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden.html
2147                compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible.html
2148                compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer.html
2149                compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped.html
2150                compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer.html
2151                compositing/scrolling/async-overflow-scrolling/layer-in-overflow.html
2152                scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested.html
2153                scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow.html
2154
2155         * Sources.txt:
2156         * WebCore.xcodeproj/project.pbxproj:
2157         * page/scrolling/AsyncScrollingCoordinator.cpp:
2158         (WebCore::AsyncScrollingCoordinator::setPositionedNodeConstraints):
2159         (WebCore::AsyncScrollingCoordinator::setPositionedNodeGeometry): Deleted.
2160         * page/scrolling/AsyncScrollingCoordinator.h:
2161         * page/scrolling/ScrollingConstraints.cpp:
2162         (WebCore::operator<<):
2163         * page/scrolling/ScrollingConstraints.h:
2164         (WebCore::AbsolutePositionConstraints::operator== const):
2165         (WebCore::AbsolutePositionConstraints::operator!= const):
2166         (WebCore::LayoutConstraints::operator== const): Deleted.
2167         (WebCore::LayoutConstraints::operator!= const): Deleted.
2168         (WebCore::LayoutConstraints::alignmentOffset const): Deleted.
2169         (WebCore::LayoutConstraints::setAlignmentOffset): Deleted.
2170         (WebCore::LayoutConstraints::layerPositionAtLastLayout const): Deleted.
2171         (WebCore::LayoutConstraints::setLayerPositionAtLastLayout): Deleted.
2172         (WebCore::LayoutConstraints::scrollPositioningBehavior const): Deleted.
2173         (WebCore::LayoutConstraints::setScrollPositioningBehavior): Deleted.
2174         * page/scrolling/ScrollingCoordinator.h:
2175         (WebCore::ScrollingCoordinator::setPositionedNodeConstraints):
2176         (WebCore::ScrollingCoordinator::setPositionedNodeGeometry): Deleted.
2177         * page/scrolling/ScrollingStatePositionedNode.cpp:
2178         (WebCore::ScrollingStatePositionedNode::updateConstraints):
2179         * page/scrolling/ScrollingStatePositionedNode.h:
2180         * page/scrolling/ScrollingTree.cpp:
2181         (WebCore::ScrollingTree::commitTreeState):
2182         * page/scrolling/ScrollingTree.h:
2183         (WebCore::ScrollingTree::nodesWithRelatedOverflow):
2184         (WebCore::ScrollingTree::positionedNodesWithRelatedOverflow): Deleted.
2185         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
2186         (WebCore::ScrollingTreeFixedNode::applyLayerPositions):
2187         * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
2188         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
2189         * page/scrolling/cocoa/ScrollingTreePositionedNode.h:
2190         (WebCore::ScrollingTreePositionedNode::scrollPositioningBehavior const): Deleted.
2191         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
2192         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
2193         (WebCore::ScrollingTreePositionedNode::scrollDeltaSinceLastCommit const):
2194         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
2195         (WebCore::ScrollingTreeStickyNode::computeLayerPosition const):
2196         * rendering/LayerAncestorClippingStack.cpp: Added.
2197         (WebCore::LayerAncestorClippingStack::LayerAncestorClippingStack):
2198         (WebCore::LayerAncestorClippingStack::equalToClipData const):
2199         (WebCore::LayerAncestorClippingStack::hasAnyScrollingLayers const):
2200         (WebCore::LayerAncestorClippingStack::clear):
2201         (WebCore::LayerAncestorClippingStack::detachFromScrollingCoordinator):
2202         (WebCore::LayerAncestorClippingStack::firstClippingLayer const):
2203         (WebCore::LayerAncestorClippingStack::lastClippingLayer const):
2204         (WebCore::LayerAncestorClippingStack::lastOverflowScrollProxyNodeID const):
2205         (WebCore::LayerAncestorClippingStack::updateScrollingNodeLayers):
2206         (WebCore::LayerAncestorClippingStack::updateWithClipData):
2207         (WebCore::operator<<):
2208         * rendering/LayerAncestorClippingStack.h: Added.
2209         (WebCore::CompositedClipData::CompositedClipData):
2210         (WebCore::CompositedClipData::operator== const):
2211         (WebCore::CompositedClipData::operator!= const):
2212         (WebCore::LayerAncestorClippingStack::stack):
2213         (WebCore::LayerAncestorClippingStack::stack const):
2214         * rendering/RenderLayerBacking.cpp:
2215         (WebCore::RenderLayerBacking::~RenderLayerBacking):
2216         (WebCore::RenderLayerBacking::updateDebugIndicators):
2217         (WebCore::RenderLayerBacking::destroyGraphicsLayers):
2218         (WebCore::RenderLayerBacking::updateTransform):
2219         (WebCore::RenderLayerBacking::updateBlendMode):
2220         (WebCore::RenderLayerBacking::updateAfterLayout):
2221         (WebCore::RenderLayerBacking::updateConfiguration):
2222         (WebCore::computeOffsetFromAncestorGraphicsLayer):
2223         (WebCore::RenderLayerBacking::computePrimaryGraphicsLayerRect const):
2224         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
2225         (WebCore::RenderLayerBacking::updateGeometry):
2226         (WebCore::RenderLayerBacking::updateInternalHierarchy):
2227         (WebCore::RenderLayerBacking::updateAncestorClippingStack):
2228         (WebCore::RenderLayerBacking::updateAncestorClipping):
2229         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
2230         (WebCore::RenderLayerBacking::scrollingNodeIDForChildren const):
2231         (WebCore::RenderLayerBacking::childForSuperlayers const):
2232         (WebCore::RenderLayerBacking::backingStoreMemoryEstimate const):
2233         (WebCore::operator<<):
2234         (WebCore::RenderLayerBacking::updateAncestorClippingLayer): Deleted.
2235         (WebCore::RenderLayerBacking::coordinatedScrollingRoles const): Deleted.
2236         * rendering/RenderLayerBacking.h:
2237         * rendering/RenderLayerCompositor.cpp:
2238         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
2239         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2240         (WebCore::RenderLayerCompositor::layerStyleChanged): We need to run the checks for changed
2241         clipping whether or not this layer has backing, because a non-composited layer with clipping can be
2242         represented in the clipping stack of some other layer.
2243         (WebCore::RenderLayerCompositor::clippedByAncestor const):
2244         (WebCore::RenderLayerCompositor::updateAncestorClippingStack const):
2245         (WebCore::RenderLayerCompositor::computeAncestorClippingStack const): The output of this function
2246         is a Vector<CompositedClipData> which represents the ancestor clipping stack, but without the proxy node
2247         and GraphicsLayer information. It's input to LayerAncestorClippingStack::updateWithClipData() which does
2248         the merging of old and new states.
2249         (WebCore::collectRelatedCoordinatedScrollingNodes):
2250         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
2251         (WebCore::scrollCoordinationRoleForNodeType):
2252         (WebCore::RenderLayerCompositor::attachScrollingNode):
2253         (WebCore::RenderLayerCompositor::registerScrollingNodeID):
2254         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
2255         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
2256         (WebCore::RenderLayerCompositor::coordinatedScrollingRolesForLayer const): Code moved from RenderLayerBacking.
2257         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
2258         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingProxyRole):
2259         (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
2260         * rendering/RenderLayerCompositor.h:
2261         (WebCore::allScrollCoordinationRoles):
2262
2263 2019-06-23  Simon Fraser  <simon.fraser@apple.com>
2264
2265         Add OverflowScrollProxyNodes to the scrolling tree
2266         https://bugs.webkit.org/show_bug.cgi?id=199132
2267
2268         Reviewed by Antti Koivisto.
2269
2270         Add ScrollingStateOverflowScrollProxyNode and ScrollingTreeOverflowScrollProxyNode. These
2271         nodes represent clip and scroll position for an overflow:scroll in the containing block chain,
2272         but not the paint ancestor chain of a layer. They will be used to correctly manipulate clip
2273         rects for composited layers in non-stacking-context scrollers, and in a future patch will
2274         replace the functionality of "Moves" positioned nodes.
2275
2276         An OverflowScrollProxyNode has the ScrollingNodeID of the scrolling node that it relates to,
2277         and we use the existing "related overflow nodes" to create the back references in the scrolling tree.
2278
2279         These nodes are not instantiated yet; a future patch will hook them up.
2280
2281         * Sources.txt:
2282         * SourcesCocoa.txt:
2283         * WebCore.xcodeproj/project.pbxproj:
2284         * page/scrolling/AsyncScrollingCoordinator.cpp:
2285         (WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):
2286         * page/scrolling/ScrollingCoordinator.cpp:
2287         (WebCore::operator<<):
2288         * page/scrolling/ScrollingCoordinatorTypes.h:
2289         * page/scrolling/ScrollingStateNode.h:
2290         (WebCore::ScrollingStateNode::isOverflowScrollProxyNode const):
2291         * page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp: Added.
2292         (WebCore::ScrollingStateOverflowScrollProxyNode::create):
2293         (WebCore::ScrollingStateOverflowScrollProxyNode::ScrollingStateOverflowScrollProxyNode):
2294         (WebCore::ScrollingStateOverflowScrollProxyNode::clone):
2295         (WebCore::ScrollingStateOverflowScrollProxyNode::setOverflowScrollingNode):
2296         (WebCore::ScrollingStateOverflowScrollProxyNode::dumpProperties const):
2297         * page/scrolling/ScrollingStateOverflowScrollProxyNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp.
2298         (WebCore::ScrollingStateOverflowScrollProxyNode::overflowScrollingNode const):
2299         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
2300         * page/scrolling/ScrollingStateTree.cpp:
2301         (WebCore::ScrollingStateTree::createNode):
2302         * page/scrolling/ScrollingTreeNode.h:
2303         (WebCore::ScrollingTreeNode::isOverflowScrollProxyNode const):
2304         * page/scrolling/ScrollingTreeOverflowScrollProxyNode.cpp: Added.
2305         (WebCore::ScrollingTreeOverflowScrollProxyNode::create):
2306         (WebCore::ScrollingTreeOverflowScrollProxyNode::ScrollingTreeOverflowScrollProxyNode):
2307         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
2308         (WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions):
2309         (WebCore::ScrollingTreeOverflowScrollProxyNode::dumpProperties const):
2310         * page/scrolling/ScrollingTreeOverflowScrollProxyNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp.
2311         * page/scrolling/ScrollingTreeScrollingNode.h:
2312         * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp.
2313         (WebCore::ScrollingTreeOverflowScrollProxyNode::overflowScrollingNodeID const):
2314         (WebCore::ScrollingTreeOverflowScrollProxyNode::layer const):
2315         * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm: Added.
2316         (WebCore::ScrollingTreeOverflowScrollProxyNode::create):
2317         (WebCore::ScrollingTreeOverflowScrollProxyNode::ScrollingTreeOverflowScrollProxyNode):
2318         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
2319         (WebCore::ScrollingTreeOverflowScrollProxyNode::scrollDeltaSinceLastCommit const):
2320         (WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions):
2321         (WebCore::ScrollingTreeOverflowScrollProxyNode::dumpProperties const):
2322         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
2323         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2324         * page/scrolling/mac/ScrollingTreeMac.cpp:
2325         (ScrollingTreeMac::createScrollingTreeNode):
2326         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2327         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
2328         * rendering/RenderLayerCompositor.cpp:
2329         (WebCore::scrollCoordinationRoleForNodeType):
2330
2331 2019-06-23  Zalan Bujtas  <zalan@apple.com>
2332
2333         [LFC][IFC] Non-baseline aligned inline container should not mutate the baseline
2334         https://bugs.webkit.org/show_bug.cgi?id=199129
2335         <rdar://problem/52022533>
2336
2337         Reviewed by Antti Koivisto.
2338
2339         Only baseline aligned inline container (<span style="vertical-aligned: baseline">) should adjust line's baseline.
2340         This patch also fixes m_baselineTop's value when we apply the initial strut.
2341
2342         * layout/inlineformatting/InlineLine.cpp:
2343         (WebCore::Layout::isInlineContainerConsideredEmpty):
2344         (WebCore::Layout::Line::isVisuallyEmpty const):
2345         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2346
2347 2019-06-22  Zalan Bujtas  <zalan@apple.com>
2348
2349         [LFC][IFC] The anonymous InlineBox wrapper for the text node should take the parent style.
2350         https://bugs.webkit.org/show_bug.cgi?id=199127
2351         <rdar://problem/52017744>
2352
2353         Reviewed by Antti Koivisto.
2354
2355         <span style="vertical-align: bottom">bottom aligned text</span>
2356         The InlineBox wrapper for the "bottom aligned text" content should take the parent span's style.
2357
2358         * layout/layouttree/LayoutTreeBuilder.cpp:
2359         (WebCore::Layout::TreeBuilder::createSubTree):
2360
2361 2019-06-22  Antoine Quint  <graouts@apple.com>
2362
2363         [Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
2364         https://bugs.webkit.org/show_bug.cgi?id=198999
2365         <rdar://problem/52005663>
2366
2367         Reviewed by Dean Jackson.
2368
2369         We should only set the mouse events capturing element in EventHandler if we're dealing with mouse-originated Pointer Events.
2370
2371         * page/PointerCaptureController.cpp:
2372         (WebCore::PointerCaptureController::processPendingPointerCapture):
2373
2374 2019-06-22  Andres Gonzalez  <andresg_22@apple.com>
2375
2376         Accessibility objects contained in links should honor the aria-haspopup attribute in the ancestor link.
2377         https://bugs.webkit.org/show_bug.cgi?id=199107
2378         <rdar://problem/43663611>
2379
2380         Reviewed by Chris Fleizach.
2381
2382         Tests: accessibility/ios-simulator/button-with-aria-haspopup-role.html
2383                accessibility/ios-simulator/element-haspopup.html
2384
2385         If an accessibility object is contained within an <a>, we should check
2386         the aria-haspopup attribute on the ancestor <a> element. This was done
2387         before in the iOS WebKit accessibility bunddle override.
2388         * accessibility/AccessibilityRenderObject.cpp:
2389         (WebCore::AccessibilityRenderObject::hasPopup const):
2390
2391 2019-06-22  Robin Morisset  <rmorisset@apple.com> and Yusuke Suzuki  <ysuzuki@apple.com>
2392
2393         All prototypes should call didBecomePrototype()
2394         https://bugs.webkit.org/show_bug.cgi?id=196315
2395
2396         Reviewed by Saam Barati.
2397
2398         * bindings/js/JSDOMIterator.h:
2399         (WebCore::IteratorTraits>::finishCreation):
2400         * bindings/js/JSDOMWindowProperties.h:
2401         (WebCore::JSDOMWindowProperties::create): Deleted.
2402         (WebCore::JSDOMWindowProperties::createStructure): Deleted.
2403         (WebCore::JSDOMWindowProperties::JSDOMWindowProperties): Deleted.
2404         * bindings/js/JSWindowProxy.cpp:
2405         (WebCore::JSWindowProxy::setWindow):
2406         * bindings/scripts/CodeGeneratorJS.pm:
2407         (GeneratePrototypeDeclaration):
2408         (GenerateConstructorHelperMethods):
2409         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2410         (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype):
2411         * bindings/scripts/test/JS/JSMapLike.cpp:
2412         (WebCore::JSMapLikePrototype::JSMapLikePrototype):
2413         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2414         (WebCore::JSReadOnlyMapLikePrototype::JSReadOnlyMapLikePrototype):
2415         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2416         (WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype):
2417         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2418         (WebCore::JSTestCEReactionsPrototype::JSTestCEReactionsPrototype):
2419         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2420         (WebCore::JSTestCEReactionsStringifierPrototype::JSTestCEReactionsStringifierPrototype):
2421         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2422         (WebCore::JSTestCallTracerPrototype::JSTestCallTracerPrototype):
2423         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2424         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::JSTestClassWithJSBuiltinConstructorPrototype):
2425         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2426         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
2427         (WebCore::JSTestDOMJITConstructor::prototypeForStructure):
2428         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2429         (WebCore::JSTestEnabledBySettingPrototype::JSTestEnabledBySettingPrototype):
2430         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
2431         (WebCore::JSTestEnabledForContextPrototype::JSTestEnabledForContextPrototype):
2432         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2433         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype):
2434         (WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
2435         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2436         (WebCore::JSTestEventTargetPrototype::JSTestEventTargetPrototype):
2437         (WebCore::JSTestEventTargetConstructor::prototypeForStructure):
2438         * bindings/scripts/test/JS/JSTestException.cpp:
2439         (WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype):
2440         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2441         (WebCore::JSTestGenerateIsReachablePrototype::JSTestGenerateIsReachablePrototype):
2442         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2443         (WebCore::JSTestGlobalObjectPrototype::JSTestGlobalObjectPrototype):
2444         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2445         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::JSTestIndexedSetterNoIdentifierPrototype):
2446         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2447         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::JSTestIndexedSetterThrowingExceptionPrototype):
2448         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2449         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::JSTestIndexedSetterWithIdentifierPrototype):
2450         * bindings/scripts/test/JS/JSTestInterface.cpp:
2451         (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
2452         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2453         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
2454         * bindings/scripts/test/JS/JSTestIterable.cpp:
2455         (WebCore::JSTestIterablePrototype::JSTestIterablePrototype):
2456         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2457         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype):
2458         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2459         (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
2460         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2461         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::JSTestNamedAndIndexedSetterNoIdentifierPrototype):
2462         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2463         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::JSTestNamedAndIndexedSetterThrowingExceptionPrototype):
2464         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2465         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::JSTestNamedAndIndexedSetterWithIdentifierPrototype):
2466         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2467         (WebCore::JSTestNamedConstructorPrototype::JSTestNamedConstructorPrototype):
2468         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2469         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::JSTestNamedDeleterNoIdentifierPrototype):
2470         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2471         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::JSTestNamedDeleterThrowingExceptionPrototype):
2472         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2473         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::JSTestNamedDeleterWithIdentifierPrototype):
2474         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2475         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::JSTestNamedDeleterWithIndexedGetterPrototype):
2476         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2477         (WebCore::JSTestNamedGetterCallWithPrototype::JSTestNamedGetterCallWithPrototype):
2478         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2479         (WebCore::JSTestNamedGetterNoIdentifierPrototype::JSTestNamedGetterNoIdentifierPrototype):
2480         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2481         (WebCore::JSTestNamedGetterWithIdentifierPrototype::JSTestNamedGetterWithIdentifierPrototype):
2482         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2483         (WebCore::JSTestNamedSetterNoIdentifierPrototype::JSTestNamedSetterNoIdentifierPrototype):
2484         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2485         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::JSTestNamedSetterThrowingExceptionPrototype):
2486         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2487         (WebCore::JSTestNamedSetterWithIdentifierPrototype::JSTestNamedSetterWithIdentifierPrototype):
2488         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2489         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::JSTestNamedSetterWithIndexedGetterPrototype):
2490         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2491         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::JSTestNamedSetterWithIndexedGetterAndSetterPrototype):
2492         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2493         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::JSTestNamedSetterWithOverrideBuiltinsPrototype):
2494         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2495         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::JSTestNamedSetterWithUnforgablePropertiesPrototype):
2496         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2497         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype):
2498         * bindings/scripts/test/JS/JSTestNode.cpp:
2499         (WebCore::JSTestNodePrototype::JSTestNodePrototype):
2500         (WebCore::JSTestNodeConstructor::prototypeForStructure):
2501         * bindings/scripts/test/JS/JSTestObj.cpp:
2502         (WebCore::JSTestObjPrototype::JSTestObjPrototype):
2503         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2504         (WebCore::JSTestOverloadedConstructorsPrototype::JSTestOverloadedConstructorsPrototype):
2505         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2506         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::JSTestOverloadedConstructorsWithSequencePrototype):
2507         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2508         (WebCore::JSTestOverrideBuiltinsPrototype::JSTestOverrideBuiltinsPrototype):
2509         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2510         (WebCore::JSTestPluginInterfacePrototype::JSTestPluginInterfacePrototype):
2511         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2512         (WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype):
2513         (WebCore::JSTestPromiseRejectionEventConstructor::prototypeForStructure):
2514         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2515         (WebCore::JSTestSerializationPrototype::JSTestSerializationPrototype):
2516         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2517         (WebCore::JSTestSerializationIndirectInheritancePrototype::JSTestSerializationIndirectInheritancePrototype):
2518         (WebCore::JSTestSerializationIndirectInheritanceConstructor::prototypeForStructure):
2519         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2520         (WebCore::JSTestSerializationInheritPrototype::JSTestSerializationInheritPrototype):
2521         (WebCore::JSTestSerializationInheritConstructor::prototypeForStructure):
2522         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2523         (WebCore::JSTestSerializationInheritFinalPrototype::JSTestSerializationInheritFinalPrototype):
2524         (WebCore::JSTestSerializationInheritFinalConstructor::prototypeForStructure):
2525         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2526         (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
2527         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2528         (WebCore::JSTestStringifierPrototype::JSTestStringifierPrototype):
2529         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2530         (WebCore::JSTestStringifierAnonymousOperationPrototype::JSTestStringifierAnonymousOperationPrototype):
2531         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2532         (WebCore::JSTestStringifierNamedOperationPrototype::JSTestStringifierNamedOperationPrototype):
2533         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2534         (WebCore::JSTestStringifierOperationImplementedAsPrototype::JSTestStringifierOperationImplementedAsPrototype):
2535         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2536         (WebCore::JSTestStringifierOperationNamedToStringPrototype::JSTestStringifierOperationNamedToStringPrototype):
2537         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2538         (WebCore::JSTestStringifierReadOnlyAttributePrototype::JSTestStringifierReadOnlyAttributePrototype):
2539         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2540         (WebCore::JSTestStringifierReadWriteAttributePrototype::JSTestStringifierReadWriteAttributePrototype):
2541         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2542         (WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype):
2543
2544 2019-06-22  Mike Gorse  <mgorse@suse.com>
2545
2546         webkitgtk 2.24.2 fails to build w/gstreamer 1.12.5
2547         https://bugs.webkit.org/show_bug.cgi?id=198080
2548
2549         Reviewed by Philippe Normand.
2550
2551         No new tests (build fix only).
2552
2553         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2554         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2555         Move includes of gst/gl/gl.h and epoxy/gl.h into
2556         MediaPlayerPrivateGStreamerBase.h.
2557
2558 2019-06-21  Sihui Liu  <sihui_liu@apple.com>
2559
2560         openDatabase should return an empty object when WebSQL is disabled
2561         https://bugs.webkit.org/show_bug.cgi?id=198805
2562
2563         Reviewed by Geoffrey Garen.
2564
2565         Some websites rely on calling openDatabase with null parameters to check for private browsing. To not break 
2566         those sites, we now expose openDatabase interface even if Web SQL is disabled. When Web SQL is disabled, 
2567         window.openDatabase returns false, but it is callable and returns empty object.
2568
2569         Test: WebSQL.OpenDatabaseAlwaysExists
2570
2571         * Modules/webdatabase/DOMWindowWebDatabase.idl:
2572         * bindings/js/JSDOMWindowCustom.cpp:
2573         (WebCore::jsDOMWindowInstanceFunctionOpenDatabaseBody):
2574         (WebCore::IDLOperation<JSDOMWindow>::cast):
2575         (WebCore::jsDOMWindowInstanceFunctionOpenDatabase):
2576         (WebCore::JSDOMWindow::openDatabase const):
2577
2578 2019-06-21  Ryosuke Niwa  <rniwa@webkit.org>
2579
2580         Nullptr crash in DeleteSelectionCommand::handleGeneralDelete
2581         https://bugs.webkit.org/show_bug.cgi?id=199126
2582
2583         Reviewed by Wenson Hsieh.
2584
2585         Added null checks to handleGeneralDelete as well as mergeParagraphs which runs after handleGeneralDelete to be defensive.
2586
2587         Unfortunately no new tests since there is no reproducible test case.
2588
2589         * editing/DeleteSelectionCommand.cpp:
2590         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
2591         (WebCore::DeleteSelectionCommand::mergeParagraphs):
2592
2593 2019-06-21  Youenn Fablet  <youenn@apple.com>
2594
2595         ResourceLoadNotifier should check whether its frame document loader is null
2596         https://bugs.webkit.org/show_bug.cgi?id=199118
2597
2598         Reviewed by Geoffrey Garen.
2599
2600         * loader/ResourceLoadNotifier.cpp:
2601         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
2602
2603 2019-06-21  Jiewen Tan  <jiewen_tan@apple.com>
2604
2605         WebPageProxy::loadData should accept ShouldOpenExternalURLsPolicy
2606         https://bugs.webkit.org/show_bug.cgi?id=199114
2607         <rdar://problem/51671674>
2608
2609         Reviewed by Youenn Fablet.
2610
2611         Covered by new test content within existing tests.
2612
2613         * loader/FrameLoaderTypes.h:
2614         Adds an EnumTraits for ShouldOpenExternalURLsPolicy.
2615
2616 2019-06-21  Saam Barati  <sbarati@apple.com>
2617
2618         [WHLSL] Code that accesses an undefined variable crashes
2619         https://bugs.webkit.org/show_bug.cgi?id=198775
2620
2621         Reviewed by Myles C. Maxfield.
2622
2623         Myles mostly fixed this in r246631 when he made NameResolver propagate
2624         its error to its parent NameResolver. However, there was still one bug
2625         where we ended up calling setError twice for an if statement. This patch
2626         fixes that and adds tests.
2627
2628         Tests: webgpu/whlsl-use-undefined-variable-2.html
2629                webgpu/whlsl-use-undefined-variable.html
2630
2631         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
2632         (WebCore::WHLSL::NameResolver::visit):
2633
2634 2019-06-21  Truitt Savell  <tsavell@apple.com>
2635
2636         Unreviewed, rolling out r246611.
2637
2638         Introduced a flakey test.
2639
2640         Reverted changeset:
2641
2642         "iOS 12.2 Drawing portrait video to canvas is sideways"
2643         https://bugs.webkit.org/show_bug.cgi?id=196772
2644         https://trac.webkit.org/changeset/246611
2645
2646 2019-06-21  Tim Horton  <timothy_horton@apple.com>
2647
2648         Preview of <picture> element doesn't match element bounds
2649         https://bugs.webkit.org/show_bug.cgi?id=199049
2650         <rdar://problem/51474402>
2651
2652         Reviewed by Simon Fraser.
2653
2654         Test: fast/text-indicator/text-indicator-uses-img-size-inside-picture.html
2655
2656         * dom/DOMRectReadOnly.idl:
2657         * dom/Range.cpp:
2658         (WebCore::Range::absoluteRectsForRangeInText const):
2659         (WebCore::Range::absoluteTextRects const):
2660         (WebCore::Range::borderAndTextRects const):
2661         (WebCore::Range::boundingRect const):
2662         (WebCore::Range::absoluteBoundingRect const):
2663         * dom/Range.h:
2664         (WebCore::Range::absoluteTextRects):
2665         (WebCore::Range::absoluteBoundingRect):
2666         (WebCore::Range::borderAndTextRects):
2667         (WebCore::Range::boundingRect):
2668         * page/TextIndicator.cpp:
2669         (WebCore::absoluteBoundingRectForRange):
2670         (WebCore::estimatedBackgroundColorForRange):
2671         (WebCore::initializeIndicator):
2672         * rendering/RenderBlock.h:
2673         * testing/Internals.cpp:
2674         (WebCore::Internals::TextIndicatorData::TextIndicatorData):
2675         (WebCore::Internals::TextIndicatorData::~TextIndicatorData):
2676         (WebCore::Internals::textIndicatorForRange):
2677         * testing/Internals.h:
2678         * testing/Internals.idl:
2679
2680 2019-06-21  Youenn Fablet  <youenn@apple.com>
2681
2682         Safari crashes after ~2028 OfflineAudioContext objects are created (they never get garbage collected, consuming a thread each)
2683         https://bugs.webkit.org/show_bug.cgi?id=198964
2684         <rdar://problem/51891520>
2685
2686         Reviewed by Jer Noble.
2687
2688         Move from setPendingActivity/unsetPendingActivity to an
2689         m_pendingActivity member which is easier to manage.
2690
2691         Keep setting a pending activity for AudioContext at construction time
2692         but do not do that for Offline contexts.
2693         Instead, set the pending activity when startRendering is called.
2694         Unset the pending activity when the rendering activity is finished.
2695
2696         Make m_audioDecoder a unique pointer so that it can lazily be initialized.
2697         This removes the burden of creating an audio decoder thread for each context.
2698
2699         Test: webaudio/offlineaudiocontext-gc.html
2700
2701         * Modules/webaudio/AudioContext.cpp:
2702         (WebCore::AudioContext::AudioContext):
2703         (WebCore::AudioContext::constructCommon):
2704         (WebCore::AudioContext::clear):
2705         (WebCore::AudioContext::decodeAudioData):
2706         (WebCore::AudioContext::startRendering):
2707         (WebCore::AudioContext::finishedRendering):
2708         (WebCore::AudioContext::dispatchEvent):
2709         (WebCore::AudioContext::clearPendingActivity):
2710         (WebCore::AudioContext::makePendingActivity):
2711         To keep it consistent with setPendingActivity/unsetPendingActivity, we
2712         explicitly ref/unref the AudioContext. We should try to remove this ref/unref.
2713         * Modules/webaudio/AudioContext.h:
2714         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
2715         (WebCore::OfflineAudioDestinationNode::startRendering):
2716
2717 2019-06-21  Truitt Savell  <tsavell@apple.com>
2718
2719         Unreviewed, rolling out r246655.
2720
2721         Introduced a failing test
2722
2723         Reverted changeset:
2724
2725         "Web Inspector: AXI: Audit: image label test is throwing
2726         spurious errors on elements with existing alt attr, but no
2727         value: <img alt>"
2728         https://bugs.webkit.org/show_bug.cgi?id=194754
2729         https://trac.webkit.org/changeset/246655
2730
2731 2019-06-21  Myles C. Maxfield  <mmaxfield@apple.com>
2732
2733         [WHLSL] read modify write expressions do no work as expected
2734         https://bugs.webkit.org/show_bug.cgi?id=195864
2735
2736         Reviewed by Saam Barati.
2737
2738         Turns out https://bugs.webkit.org/show_bug.cgi?id=199037 already fixed everything.
2739         This patch just adds a test.
2740
2741         Test: webgpu/whlsl-read-modify-write.html
2742
2743         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
2744
2745 2019-06-21  Zalan Bujtas  <zalan@apple.com>
2746
2747         [LFC][IFC] Adjust baseline top when the baseline moves.
2748         https://bugs.webkit.org/show_bug.cgi?id=199091
2749         <rdar://problem/51966257>
2750
2751         Reviewed by Antti Koivisto.
2752
2753         Currently only "text-align: bottom" adjusts the baseline top. This patch fixes the "text-align: baseline" case when
2754         the growing ascent pushes the baseline top closer to the line top.
2755
2756         * layout/inlineformatting/InlineLine.cpp:
2757         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2758
2759 2019-06-21  Zalan Bujtas  <zalan@apple.com>
2760
2761         [LFC][IFC] Rename Line::m_contentLogicalHeight to m_lineLogicalHeight
2762         https://bugs.webkit.org/show_bug.cgi?id=199100
2763         <rdar://problem/51973614>
2764
2765         Reviewed by Antti Koivisto.
2766
2767         m_logicalLineHeight name seems more appropriate at this point (though the line heigh is driven by the content height).
2768
2769         * layout/inlineformatting/InlineLine.cpp:
2770         (WebCore::Layout::Line::close):
2771         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2772         * layout/inlineformatting/InlineLine.h:
2773         (WebCore::Layout::Line::logicalHeight const):
2774
2775 2019-06-21  Zalan Bujtas  <zalan@apple.com>
2776
2777         [LFC][IFC] LineBox::Baseline should have a height getter.
2778         https://bugs.webkit.org/show_bug.cgi?id=199092
2779         <rdar://problem/51966958>
2780
2781         Reviewed by Antti Koivisto.
2782
2783         The baseline height does not need to be a getter on the Line (no one calls it).
2784
2785         * layout/inlineformatting/InlineLine.cpp:
2786         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2787         * layout/inlineformatting/InlineLine.h:
2788         (WebCore::Layout::Line::contentLogicalWidth const):
2789         (WebCore::Layout::Line::baselineAlignedContentHeight const): Deleted.
2790         * layout/inlineformatting/InlineLineBox.h:
2791         (WebCore::Layout::LineBox::Baseline::height const):
2792
2793 2019-06-21  Michael Catanzaro  <mcatanzaro@igalia.com>
2794
2795         [WPE][GTK] Bump minimum versions of GLib, GTK, libsoup, ATK, GStreamer, and Cairo
2796         https://bugs.webkit.org/show_bug.cgi?id=199094
2797
2798         Reviewed by Carlos Garcia Campos.
2799
2800         * accessibility/atk/AXObjectCacheAtk.cpp:
2801         (WebCore::AXObjectCache::postPlatformNotification):
2802         * accessibility/atk/WebKitAccessible.cpp:
2803         (atkRole):
2804         (setAtkStateSetFromCoreObject):
2805         (interfaceMaskFromObject):
2806         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
2807         * accessibility/atk/WebKitAccessibleInterfaceTableCell.h:
2808         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2809         (webkitAccessibleTextGetStringAtOffset):
2810         (webkitAccessibleTextInterfaceInit):
2811         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
2812         (webkitAccessibleValueInterfaceInit):
2813         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
2814         (WebCore::AudioTrackPrivateGStreamer::kind const):
2815         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
2816         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
2817         (WTF::derefGPtr<GstStreamCollection>):
2818         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
2819         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2820         (WebCore::initializeGStreamerAndRegisterWebKitElements):
2821         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
2822         (WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer):
2823         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
2824         (WebCore::InbandTextTrackPrivateGStreamer::create):
2825         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2826         (WebCore::MediaPlayerPrivateGStreamer::load):
2827         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
2828         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
2829         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2830         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
2831         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
2832         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
2833         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2834         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2835         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2836         (WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext):
2837         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
2838         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
2839         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2840         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
2841         (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer):
2842         (WebCore::TrackPrivateBaseGStreamer::disconnect):
2843         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
2844         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2845         (WebCore::TrackPrivateBaseGStreamer::stream):
2846         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
2847         (WebCore::VideoTrackPrivateGStreamer::kind const):
2848         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2849         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2850         (WebCore::eventTypeForGdkKeyEvent):
2851         * platform/gtk/PlatformMouseEventGtk.cpp:
2852         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2853         * platform/gtk/PlatformScreenGtk.cpp:
2854         (WebCore::screenRect):
2855         (WebCore::screenAvailableRect):
2856         (WebCore::screenHasTouchDevice):
2857         (WebCore::screenIsTouchPrimaryInputDevice):
2858         (): Deleted.
2859         (WebCore::isTouchDevice): Deleted.
2860         (WebCore::deviceAddedCallback): Deleted.
2861         (WebCore::deviceRemovedCallback): Deleted.
2862         * platform/gtk/PlatformWheelEventGtk.cpp:
2863         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2864         * platform/gtk/RenderThemeGadget.cpp:
2865         * platform/gtk/RenderThemeGadget.h:
2866         * platform/gtk/RenderThemeWidget.cpp:
2867         * platform/gtk/RenderThemeWidget.h:
2868         * platform/gtk/ScrollbarThemeGtk.cpp:
2869         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
2870         (WebCore::ScrollbarThemeGtk::themeChanged):
2871         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
2872         (WebCore::ScrollbarThemeGtk::trackRect):
2873         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
2874         (WebCore::ScrollbarThemeGtk::paint):
2875         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
2876         (WebCore::createStyleContext): Deleted.
2877         (WebCore::createChildStyleContext): Deleted.
2878         (WebCore::paintStepper): Deleted.
2879         (WebCore::adjustRectAccordingToMargin): Deleted.
2880         * platform/mediastream/gstreamer/GStreamerCapturer.cpp:
2881         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
2882         * platform/network/soup/ResourceRequest.h:
2883         (WebCore::toSoupMessagePriority):
2884         * platform/network/soup/SoupNetworkSession.cpp:
2885         (WebCore::SoupNetworkSession::SoupNetworkSession):
2886         * rendering/RenderThemeGtk.cpp:
2887         (WebCore::themePartStateFlags):
2888         (WebCore::paintToggle):
2889         (WebCore::RenderThemeGtk::paintButton):
2890         (WebCore::menuListColor):
2891         (WebCore::RenderThemeGtk::paintMenuList):
2892         (WebCore::RenderThemeGtk::paintTextField):
2893         (WebCore::adjustSearchFieldIconStyle):
2894         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
2895         (WebCore::RenderThemeGtk::paintSliderThumb):
2896         (WebCore::RenderThemeGtk::paintProgressBar):
2897         (WebCore::RenderThemeGtk::paintInnerSpinButton):
2898         (WebCore::styleColor):
2899         (WebCore::RenderThemeGtk::systemColor const):
2900         (WebCore::RenderThemeGtk::paintMediaButton):
2901         (WebCore::createStyleContext): Deleted.
2902         (WebCore::loadThemedIcon): Deleted.
2903         (WebCore::gtkTextDirection): Deleted.
2904         (WebCore::gtkIconStateFlags): Deleted.
2905         (WebCore::adjustRectForFocus): Deleted.
2906         (WebCore::renderButton): Deleted.
2907         (WebCore::getIconSizeForPixelSize): Deleted.
2908         (WebCore::paintIcon): Deleted.
2909         (WebCore::paintEntryIcon): Deleted.
2910         (WebCore::centerRectVerticallyInParentInputElement): Deleted.
2911         (WebCore::spinButtonArrowSize): Deleted.
2912         (WebCore::paintSpinArrowButton): Deleted.
2913
2914 2019-06-20  Antoine Quint  <graouts@apple.com>
2915
2916         [Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
2917         https://bugs.webkit.org/show_bug.cgi?id=198999
2918
2919         Reviewed by Dean Jackson.
2920
2921         Up until now, we would not account for pointer capture (see https://w3c.github.io/pointerevents/#pointer-capture) when dispatching
2922         mouse boundary events (mouseover, mouseout, mouseenter, mouseleave) and their counterpart pointer events. We would also not account
2923         for it when updating :hover styles.
2924
2925         Now, when pointer capture changes for an element, we call setCapturingMouseEventsElement() on the EventHandler such that the element
2926         that would naturally hit-test is overridden by the pointer capture element when identifying which target to use for the dispatch of
2927         boundary mouse events. Additionally, when calling EventHandler::prepareMouseEvent(), we also use the pointer capture element to
2928         eventually pass down to Document::updateHoverActiveState() such that :hover styles are applied to the correct element.
2929
2930         This also means that we need to re-run EventHandler::prepareMouseEvent() during mouse state changes to ensure that the :hover styles
2931         are applied correctly should the pointer capture element change during dispatch of boundary mouse events.
2932
2933         * dom/Document.cpp:
2934         (WebCore::Document::prepareMouseEvent): If there is one, use the pointer capture element instead of the hit-test target.
2935         (WebCore::Document::updateHoverActiveState): Relax the mustBeInActiveChain condition in case the pointer capture element changed when
2936         updating the :hover/:active chains.
2937         * page/EventHandler.cpp:
2938         (WebCore::EventHandler::handleMousePressEvent): Re-process the mouse event if the pointer capture element changed during event dispatch.
2939         (WebCore::EventHandler::handleMouseMoveEvent): Re-process the mouse event if the pointer capture element changed during event dispatch.
2940         (WebCore::EventHandler::handleMouseReleaseEvent): As we know the pointer capture element will be reset as part of the mouse being
2941         released, we reset the pointer capture element and EventHandler's capture element prior to invalidating hover styles and boundary events.
2942         (WebCore::EventHandler::setCapturingMouseEventsElement): Dispatch boundary events when a new element is set.
2943         (WebCore::EventHandler::dispatchMouseEvent): New dispatchMouseEvent() variant that re-processes the provided MouseEventWithHitTestResults
2944         in case the pointer capture element changes during event dispatch, as called by handleMousePressEvent() and handleMouseMoveEvent().
2945         * page/EventHandler.h:
2946         * page/PointerCaptureController.cpp:
2947         (WebCore::PointerCaptureController::pointerCaptureElement): We now need to query whay the pointer capture element might be from EventHandler,
2948         so expose a new method to access it.
2949         (WebCore::PointerCaptureController::releasePointerCapture): Since we may not call processPendingPointerCapture() until the dispatch of the
2950         next event, we must reset EventHandler's capturing mouse element right now so that the next event processed does not use it as an overriding target.
2951         (WebCore::PointerCaptureController::hasPointerCapture): We would mistakenly return true if the provided element was null, which could be the
2952         case of EventHandler's capturing element. Rather than changing call sites to check that the provided value exists, we change the method to
2953         return false when the provided element is null. Note that this does not affect the API since it's exposed on Element itself.
2954         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): Call dispatchEvent() instead of calling pointerEventWillBeDispatched() and
2955         pointerEventWasDispatched().
2956         (WebCore::PointerCaptureController::dispatchEvent): Remove all code specific to pointer capture since now the events will be dispatched on the
2957         pointer capture element by EventHandler.
2958         (WebCore::PointerCaptureController::processPendingPointerCapture): Make sure this method is not re-entrant since it dispatches events.
2959         * page/PointerCaptureController.h:
2960         * rendering/HitTestRequest.h:
2961         (WebCore::HitTestRequest::pointerCaptureElementChanged const): Add a new HitTestRequestType bit such that we can indicate to Document::updateHoverActiveState()
2962         that it must be update the :hover/:active chains when the pointer capture element has just changed.
2963
2964 2019-06-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2965
2966         [GTK] Stop pretending WebCore::Widget can have a platform widget
2967         https://bugs.webkit.org/show_bug.cgi?id=199066
2968
2969         Reviewed by Michael Catanzaro.
2970
2971         That was only possible in legacy WebKit that we no longer support. The code can be simplified a bit.
2972
2973         * platform/Widget.cpp:
2974         (WebCore::Widget::init):
2975         * platform/Widget.h:
2976         (WebCore::Widget::setPlatformWidget):
2977         (WebCore::Widget::releasePlatformWidget): Deleted.
2978         (WebCore::Widget::retainPlatformWidget): Deleted.
2979         * platform/gtk/PlatformScreenGtk.cpp:
2980         (WebCore::systemVisual):
2981         (WebCore::screenDepth):
2982         (WebCore::screenDepthPerComponent):
2983         (WebCore::screenRect):
2984         (WebCore::screenAvailableRect):
2985         (WebCore::getToplevel): Deleted.
2986         (WebCore::getVisual): Deleted.
2987         (WebCore::getScreen): Deleted.
2988         * platform/gtk/WidgetGtk.cpp:
2989         (WebCore::Widget::~Widget):
2990         (WebCore::Widget::show):
2991         (WebCore::Widget::hide):
2992         (WebCore::Widget::setIsSelected):
2993         (WebCore::Widget::setFrameRect):
2994         (WebCore::Widget::releasePlatformWidget): Deleted.
2995         (WebCore::Widget::retainPlatformWidget): Deleted.
2996         * platform/ios/WidgetIOS.mm:
2997         (WebCore::Widget::~Widget):
2998
2999 2019-06-20  Simon Fraser  <simon.fraser@apple.com>
3000
3001         Make it possible to include clipping in GraphicsLayer tree dumps
3002         https://bugs.webkit.org/show_bug.cgi?id=199096
3003
3004         Reviewed by Zalan Bujtas.
3005
3006         Add LAYER_TREE_INCLUDES_CLIPPING and plumb it down to GraphicsLayers, turning
3007         it on for a couple of tests.
3008
3009         * page/Frame.h:
3010         * platform/graphics/GraphicsLayer.cpp:
3011         (WebCore::GraphicsLayer::dumpProperties const):
3012         * platform/graphics/GraphicsLayerClient.h:
3013         * rendering/RenderLayerCompositor.cpp:
3014         (WebCore::RenderLayerCompositor::layerTreeAsText):
3015         * testing/Internals.cpp:
3016         (WebCore::toLayerTreeFlags):
3017         * testing/Internals.h:
3018         * testing/Internals.idl:
3019
3020 2019-06-20  Daniel Bates  <dabates@apple.com>
3021
3022         [iOS] Evernote crashes when creating a note
3023         https://bugs.webkit.org/show_bug.cgi?id=199083
3024         <rdar://problem/51759247>
3025
3026         Reviewed by Brent Fulgham.
3027
3028         Add runtime check whether WebKit is being used in Evernote. Evernote's bundle ID
3029         references iPhone, but they use the same ID for their iPad app as well.
3030
3031         * platform/RuntimeApplicationChecks.h:
3032         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3033         (WebCore::IOSApplication::isEvernote): Added.
3034
3035 2019-06-20  Greg Doolittle  <gr3g@apple.com>
3036
3037         Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt>
3038         https://bugs.webkit.org/show_bug.cgi?id=194754
3039
3040         Reviewed by Chris Fleizach.
3041
3042         Test: accessibility/img-alt-attribute-unassigned-value.html
3043
3044         * accessibility/AccessibilityObject.cpp:
3045         (WebCore::AccessibilityObject::computedRoleString const):
3046
3047 2019-06-20  Ryosuke Niwa  <rniwa@webkit.org>
3048
3049         REGRESSION(r245912): Crash in TextIterator::range via visiblePositionForIndexUsingCharacterIterator
3050         https://bugs.webkit.org/show_bug.cgi?id=199061
3051
3052         Reviewed by Wenson Hsieh.
3053
3054         Avoid calling CharacterIterator::range when it's at the end. Otherwise, we'd crash with null pointer dereferencing.
3055
3056         Unfortunately no new tests since we don't have any reproducible test case.
3057
3058         * editing/Editing.cpp:
3059         (WebCore::visiblePositionForIndexUsingCharacterIterator):
3060
3061 2019-06-20  Brent Fulgham  <bfulgham@apple.com>
3062
3063         Resolve frequent crashes in topPrivatelyControlledDomain
3064         https://bugs.webkit.org/show_bug.cgi?id=199072
3065         <rdar://problem/51428162>
3066
3067         Reviewed by Youenn Fablet.
3068
3069         Crash data indicates that we are frequently crashing when multiple threads call
3070         WebCore::topPrivatelyControlledDomain. 
3071
3072         Code review showed the potential for a thread contention issue, since WebKit builds
3073         with '--fno-threadsafe-statics'.
3074
3075         This patch corrects the thread safety issue in WebCore::topPrivatelyControlledDomain.
3076
3077         * platform/mac/PublicSuffixMac.mm:
3078         (WebCore::topPrivatelyControlledDomain): Only instantiate the static cache after the
3079         current thread has achieved its lock.
3080
3081 2019-06-20  Saam Barati  <sbarati@apple.com>
3082
3083         [WHLSL] Property resolver needs to recurse on newValueExpression for RMW operations
3084         https://bugs.webkit.org/show_bug.cgi?id=199037
3085
3086         Reviewed by Myles C. Maxfield.
3087
3088         When we had an expression like `<e1> += <e2>`, we weren't running the property
3089         resolver on <e2>. If <e2> was something like `mat[1][2]`, we wouldn't end up
3090         simplifying that into the needed getter calls. This patch fixes this by having
3091         the property resolver recurse on <e2>.
3092         
3093         This patch also fixes a bug in the property resolver where we weren't marking some
3094         dereference expressions as LValues. This was causing bugs in the metal code generator.
3095         
3096         This patch also adds a way to dump the AST between passes that are
3097         guaranteed to not fail.
3098
3099         Test: webgpu/whlsl-read-modify-write-high-zombies.html
3100
3101         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
3102         (WebCore::WHLSL::prepareShared):
3103         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
3104         (WebCore::WHLSL::PropertyResolver::visit):
3105         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
3106
3107 2019-06-20  John Wilander  <wilander@apple.com>
3108
3109         Storage Access API: Cap the number of times an iframe document can request access
3110         https://bugs.webkit.org/show_bug.cgi?id=199074
3111         <rdar://problem/51857195>
3112
3113         Reviewed by Brent Fulgham.
3114
3115         Tested manually.
3116
3117         This change just adds a counter to the number of times the user explicitly
3118         denies storage access and returns early if the counter has reached the limit
3119         of 2.
3120
3121         We hoped that iframes that request storage access would count the number
3122         of times the user has been asked and not repeat the request over and over.
3123         However, we're seeing pretty aggressive use of the API and users are
3124         complaining. Therefore, we need a cap on how many times an iframed
3125         document can ask if it is explicitly denied access by the user.
3126
3127         This is a first measure. If we see continued aggressive use of the API,
3128         we'll have to consider more drastic measures.
3129
3130         * dom/DocumentStorageAccess.cpp:
3131         (WebCore::DocumentStorageAccess::requestStorageAccess):
3132         * dom/DocumentStorageAccess.h:
3133
3134 2019-06-20  Youenn Fablet  <youenn@apple.com>
3135
3136         Changing settings of a MediaStreamTrack clone should not alter the settings of the original track
3137         https://bugs.webkit.org/show_bug.cgi?id=198840
3138
3139         Reviewed by Eric Carlson.
3140
3141         Rename RealtimeVideoSource in RealtimeVideoCaptureSource.
3142         Introduce RealtimeVideoSource as a class wrapping RealtimeVideoCaptureSource.
3143         Its goal is to be able to have independent settings from its underlying RealtimeVideoCaptureSource.
3144         It can also adapt size based on its settings if different than its RealtimeVideoCaptureSource.
3145         Apply this wrapping for AV video sources as well as mock video sources.
3146         Test: fast/mediastream/mediastreamtrack-video-clone.html
3147
3148         * Sources.txt:
3149         * WebCore.xcodeproj/project.pbxproj:
3150         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3151         (WebCore::MediaStreamTrackPrivate::clone):
3152         * platform/mediastream/RealtimeMediaSource.h:
3153         * platform/mediastream/RealtimeVideoCaptureSource.cpp: Added.
3154         (WebCore::RealtimeVideoCaptureSource::RealtimeVideoCaptureSource):
3155         (WebCore::RealtimeVideoCaptureSource::~RealtimeVideoCaptureSource):
3156         (WebCore::RealtimeVideoCaptureSource::prepareToProduceData):
3157         (WebCore::RealtimeVideoCaptureSource::presets):
3158         (WebCore::RealtimeVideoCaptureSource::setSupportedPresets):
3159         (WebCore::RealtimeVideoCaptureSource::standardVideoSizes):
3160         (WebCore::updateMinMax):
3161         (WebCore::RealtimeVideoCaptureSource::updateCapabilities):
3162         (WebCore::RealtimeVideoCaptureSource::supportsSizeAndFrameRate):
3163         (WebCore::RealtimeVideoCaptureSource::frameRateRangeIncludesRate):
3164         (WebCore::RealtimeVideoCaptureSource::presetSupportsFrameRate):
3165         (WebCore::RealtimeVideoCaptureSource::supportsCaptureSize):
3166         (WebCore::RealtimeVideoCaptureSource::shouldUsePreset):
3167         (WebCore::RealtimeVideoCaptureSource::bestSupportedSizeAndFrameRate):
3168         (WebCore::RealtimeVideoCaptureSource::setSizeAndFrameRate):
3169         (WebCore::RealtimeVideoCaptureSource::adaptVideoSample):
3170         (WebCore::RealtimeVideoCaptureSource::dispatchMediaSampleToObservers):
3171         (WebCore::RealtimeVideoCaptureSource::clientUpdatedSizeAndFrameRate):
3172         (WebCore::SizeAndFrameRate::toJSONObject const):
3173         (WebCore::SizeAndFrameRate::toJSONString const):
3174         * platform/mediastream/RealtimeVideoCaptureSource.h: Added.
3175         (WebCore::RealtimeVideoCaptureSource::sampleRotation const):
3176         (WebCore::RealtimeVideoCaptureSource::prefersPreset):
3177         (WebCore::RealtimeVideoCaptureSource::setFrameRateWithPreset):
3178         (WebCore::RealtimeVideoCaptureSource::canResizeVideoFrames const):
3179         (WebCore::RealtimeVideoCaptureSource::setDefaultSize):
3180         (WebCore::RealtimeVideoCaptureSource::observedFrameRate const):
3181         (WTF::LogArgument<WebCore::SizeAndFrameRate>::toString):
3182         * platform/mediastream/RealtimeVideoSource.cpp:
3183         (WebCore::RealtimeVideoSource::RealtimeVideoSource):
3184         (WebCore::m_source):
3185         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
3186         (WebCore::RealtimeVideoSource::startProducingData):
3187         (WebCore::RealtimeVideoSource::stopProducingData):
3188         (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate):
3189         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
3190         (WebCore::RealtimeVideoSource::sourceMutedChanged):
3191         (WebCore::RealtimeVideoSource::sourceSettingsChanged):
3192         (WebCore::RealtimeVideoSource::preventSourceFromStopping):
3193         (WebCore::RealtimeVideoSource::sourceStopped):
3194         (WebCore::RealtimeVideoSource::videoSampleAvailable):
3195         (WebCore::RealtimeVideoSource::clone):
3196         * platform/mediastream/RealtimeVideoSource.h:
3197         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
3198         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource):
3199         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
3200         * platform/mediastream/mac/AVVideoCaptureSource.h:
3201         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3202         (WebCore::AVVideoCaptureSource::create):
3203         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
3204         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
3205         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3206         (WebCore::MockRealtimeVideoSource::create):
3207         * platform/mock/MockRealtimeVideoSource.cpp:
3208         (WebCore::MockRealtimeVideoSource::create):
3209         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
3210         (WebCore::MockRealtimeVideoSource::supportsSizeAndFrameRate):
3211         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRate):
3212         * platform/mock/MockRealtimeVideoSource.h:
3213
3214 2019-06-20  Saam Barati  <sbarati@apple.com>
3215
3216         Unreviewed. More speculative build fixing for watchOS after r246631.
3217
3218         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
3219
3220 2019-06-20  Saam Barati  <sbarati@apple.com>
3221
3222         Unreviewed. Speculative build fix for watchOS after r246631.
3223
3224         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
3225
3226 2019-06-18  Darin Adler  <darin@apple.com>
3227
3228         Tidy up the remaining bits of the AtomicString to AtomString rename
3229         https://bugs.webkit.org/show_bug.cgi?id=198990
3230
3231         Reviewed by Michael Catanzaro.
3232
3233         * bindings/scripts/test/JS/JSTestObj.cpp: Updated names.
3234         * bindings/scripts/test/TestObj.idl: Ditto.
3235
3236         * css/makeprop.pl: Updated comment.
3237         * css/makevalues.pl: Ditto.
3238         * html/FormController.cpp:
3239         (WebCore::FormKeyGenerator::formKey): Ditto.
3240
3241 2019-06-20  Zalan Bujtas  <zalan@apple.com>
3242
3243         [LFC][IFC] Make the initial strut explicit
3244         https://bugs.webkit.org/show_bug.cgi?id=199057
3245         <rdar://problem/51927864>
3246
3247         Reviewed by Antti Koivisto.
3248
3249         The strut always sets the initial vertical constraints on the new line in strict mode. However in quirks mode
3250         we can ignore it as long as there's no baseline type content on the line.  
3251
3252         * layout/inlineformatting/InlineFormattingContext.h:
3253         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3254         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
3255         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3256         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints):
3257         * layout/inlineformatting/InlineLine.cpp:
3258         (WebCore::Layout::Line::appendTextContent):
3259         (WebCore::Layout::Line::appendHardLineBreak):
3260         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
3261         * layout/inlineformatting/InlineLine.h:
3262
3263 2019-06-20  Zalan Bujtas  <zalan@apple.com>
3264
3265         [LFC][IFC] Introduce Line::InitialConstraints
3266         https://bugs.webkit.org/show_bug.cgi?id=199056
3267         <rdar://problem/51927597>
3268
3269         Reviewed by Antti Koivisto.
3270
3271         Line::InitialConstraints, as the name suggests, holds the initial constraint values for the new line. 
3272
3273         * layout/inlineformatting/InlineFormattingContext.h:
3274         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3275         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput):
3276         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
3277         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
3278         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
3279         * layout/inlineformatting/InlineLine.cpp:
3280         (WebCore::Layout::Line::Line):
3281         (WebCore::Layout::m_skipVerticalAligment):
3282         (WebCore::Layout::m_lineLogicalWidth): Deleted.
3283         * layout/inlineformatting/InlineLine.h:
3284
3285 2019-06-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3286
3287         [GTK] Remove support for GTK2 plugins
3288         https://bugs.webkit.org/show_bug.cgi?id=199065
3289
3290         Reviewed by Sergio Villar Senin.
3291
3292         * PlatformGTK.cmake:
3293         * SourcesGTK.txt:
3294         * SourcesWPE.txt:
3295         * platform/FreeType.cmake:
3296         * platform/SourcesGLib.txt:
3297         * platform/graphics/Color.h:
3298         * platform/graphics/PlatformDisplay.cpp:
3299         (WebCore::PlatformDisplay::createPlatformDisplay):
3300         * platform/graphics/gtk/ColorGtk.cpp:
3301         (WebCore::Color::operator GdkRGBA const):
3302         * platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp:
3303         (WebCore::onFrameClockUpdate):
3304         (WebCore::DisplayRefreshMonitorGtk::requestRefreshCallback):
3305         * platform/graphics/gtk/DisplayRefreshMonitorGtk.h:
3306         (WebCore::DisplayRefreshMonitorGtk::create):
3307         * platform/graphics/gtk/GdkCairoUtilities.cpp:
3308         * platform/gtk/GRefPtrGtk.cpp:
3309         * platform/gtk/GRefPtrGtk.h:
3310         * platform/gtk/GtkVersioning.c: Removed.
3311         * platform/gtk/GtkVersioning.h: Removed.
3312         * platform/gtk/PasteboardHelper.cpp:
3313         (WebCore::PasteboardHelper::getClipboardContents):
3314         * platform/gtk/PlatformKeyboardEventGtk.cpp:
3315         (WebCore::modifiersForGdkKeyEvent):
3316         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3317         * platform/gtk/PlatformMouseEventGtk.cpp:
3318         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
3319         * platform/gtk/PlatformScreenGtk.cpp:
3320         (WebCore::screenIsTouchPrimaryInputDevice):
3321         * platform/gtk/PlatformWheelEventGtk.cpp:
3322         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3323         * platform/gtk/ScrollbarThemeGtk.cpp:
3324         * platform/gtk/ScrollbarThemeGtk.h:
3325         * platform/gtk/WidgetGtk.cpp:
3326         * rendering/RenderThemeGtk.cpp:
3327         * rendering/RenderThemeGtk.h:
3328
3329 2019-06-19  Myles C. Maxfield  <mmaxfield@apple.com>
3330
3331         [WHLSL] Hook up common texture functions
3332         https://bugs.webkit.org/show_bug.cgi?id=198704
3333         <rdar://problem/51668841>
3334
3335         Reviewed by Saam Barati.
3336
3337         This patch adds the Metal implementation of the Sample(), Load(), and GetDimensions()
3338         texture functions. The implementation simply performs string concatenation to produce the 
3339         correct results, and adds many new native functions to the standard library.
3340
3341         We can't zero-fill texture types or sampler types, so this patch forbids default
3342         constructors for those types. It also forbids those types to exist within arrays, array
3343         references, or pointers, becuase an out-of-bounds access may cause us to try to zero-fill
3344         them.
3345
3346         Tests: webgpu/whlsl-textures-getdimensions.html
3347                webgpu/whlsl-textures-load.html
3348                webgpu/whlsl-textures-sample.html
3349
3350         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h: Add some more introspection functions
3351         so we can generate the necessary Metal functions for the appropriate texture types.
3352         (WebCore::WHLSL::AST::NativeTypeDeclaration::isAtomic const):
3353         (WebCore::WHLSL::AST::NativeTypeDeclaration::isTextureArray const):
3354         (WebCore::WHLSL::AST::NativeTypeDeclaration::isDepthTexture const):
3355         (WebCore::WHLSL::AST::NativeTypeDeclaration::isWritableTexture const):
3356         (WebCore::WHLSL::AST::NativeTypeDeclaration::textureDimension const):
3357         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsTextureArray):
3358         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsDepthTexture):
3359         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsWritableTexture):
3360         (WebCore::WHLSL::AST::NativeTypeDeclaration::setTextureDimension):
3361         (WebCore::WHLSL::AST::NativeTypeDeclaration::isAtom const): Deleted.
3362         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Native types can be passed into 
3363         entry points, too.
3364         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):