Web Automation: elements larger than the viewport have incorrect in-view center point
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-05-15  Devin Rousso  <drousso@apple.com>
2
3         Web Automation: elements larger than the viewport have incorrect in-view center point
4         https://bugs.webkit.org/show_bug.cgi?id=195696
5         <rdar://problem/48737122>
6
7         Reviewed by Simon Fraser.
8
9         Original patch by Brian Burg <bburg@apple.com>.
10
11         Some conversion methods do not exist for `FloatRect`/`FloatPoint`. Fill them in as needed,
12         and export some symbols used by WebDriver code to compute an element's in-view center point
13         in various coordinate systems.
14
15         * dom/TreeScope.h:
16         * dom/TreeScope.cpp:
17         (WebCore::TreeScope::elementsFromPoint): Added.
18         * page/FrameView.h:
19         * page/FrameView.cpp:
20         (WebCore::FrameView::absoluteToLayoutViewportPoint const): Added.
21         (WebCore::FrameView::layoutViewportToAbsoluteRect const): Added.
22         (WebCore::FrameView::absoluteToLayoutViewportRect const): Added.
23         * platform/ScrollView.h:
24         * platform/ScrollView.cpp:
25         (WebCore::ScrollView::viewToContents const): Added.
26         (WebCore::ScrollView::contentsToView const): Added.
27         (WebCore::ScrollView::contentsToRootView const): Added.
28         * platform/Widget.h:
29         * platform/Widget.cpp:
30         (WebCore::Widget::convertToRootView const): Added.
31         (WebCore::Widget::convertFromRootView const): Added.
32         (WebCore::Widget::convertToContainingView const): Added.
33         (WebCore::Widget::convertFromContainingView const): Added.
34
35 2019-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
36
37         Missing cursor/caret showing in search field on google.com
38         https://bugs.webkit.org/show_bug.cgi?id=197862
39         <rdar://problem/50291989>
40
41         Reviewed by Simon Fraser.
42
43         In this bug, the search field is inside of a fixed position container, which is inside of an empty "overflow:
44         hidden" form element (the new layout test demonstrates a simple version of this). The layer of the fixed
45         position container's renderer has an overflow clipping layer of itself, and its clipping rect is non-empty, so
46         the heuristic initially identifies the layer as not fully clipped. However, as the heuristic ascends the
47         RenderLayer tree, it then finds the layer for the "overflow: hidden" form element's renderer; this layer is
48         completely clipped, which causes the heuristic to incorrectly believe that the editable element is completely
49         clipped.
50
51         To fix the bug, this patch reworks the clipping portion of the heuristic, such that we no longer need to ascend
52         the layer tree. Instead of computing the clip rect relative to the nearest ancestor that has an overflow clip
53         and then walking up the layer tree repeating this process, simply compute the clip rect relative to RenderView's
54         layer, and then walk up to the parent frame and repeat if necessary.
55
56         Test: editing/selection/ios/do-not-hide-selection-in-visible-field.html
57
58         * rendering/RenderLayer.cpp:
59         (WebCore::RenderLayer::isTransparentOrFullyClippedRespectingParentFrames const):
60
61 2019-05-14  Andy Estes  <aestes@apple.com>
62
63         [Apple Pay] Payment APIs should be completely disabled in web views into which clients have injected user scripts
64         https://bugs.webkit.org/show_bug.cgi?id=197751
65         <rdar://problem/50631563>
66
67         Reviewed by Alex Christensen.
68
69         In r243324, when a document has had user agent scripts injected into it, payment APIs were
70         disabled at runtime by having all entry points return falsy values or throw exceptions
71         (e.g., ApplePaySession.canMakePayments() returns false).
72
73         In the case of user scripts in particular (e.g., WKUserScript), since we know whether these
74         exist at the time we create a document's DOMWindow, we can do better than r243324 by
75         completely disabling the payment APIs in the presence of user scripts.
76
77         To achieve this, this change introduces the 'EnabledByContext' extended attribute for
78         interfaces, which instructs the bindings generator to add a conjunct to the payment API
79         constructors that asks the interface's implementation class whether it should be enabled for
80         a given ScriptExecutionContext. The PaymentRequest and ApplePaySession interfaces adopt this
81         new extended attribute to implement the new user script check.
82
83         Added new API tests.
84
85         * Modules/applepay/ApplePaySession.idl:
86         * Modules/applepay/PaymentCoordinator.cpp:
87         (WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):
88         * Modules/applepay/PaymentCoordinator.h:
89         * Modules/applepay/PaymentSession.cpp:
90         (WebCore::PaymentSession::enabledForContext):
91         * Modules/applepay/PaymentSession.h:
92         * Modules/paymentrequest/PaymentHandler.cpp:
93         (WebCore::PaymentHandler::enabledForContext):
94         * Modules/paymentrequest/PaymentHandler.h:
95         * Modules/paymentrequest/PaymentRequest.cpp:
96         (WebCore::PaymentRequest::enabledForContext):
97         * Modules/paymentrequest/PaymentRequest.h:
98         * Modules/paymentrequest/PaymentRequest.idl:
99         * bindings/scripts/CodeGeneratorJS.pm:
100         (NeedsRuntimeCheck):
101         (GenerateRuntimeEnableConditionalString):
102         * bindings/scripts/IDLAttributes.json:
103         * bindings/scripts/preprocess-idls.pl:
104         (GenerateConstructorAttributes):
105         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp: Added.
106         * bindings/scripts/test/JS/JSTestEnabledForContext.h: Added.
107         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
108         (WebCore::JSTestGlobalObject::finishCreation):
109         (WebCore::jsTestGlobalObjectTestEnabledForContextConstructorGetter):
110         (WebCore::jsTestGlobalObjectTestEnabledForContextConstructor):
111         (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructorSetter):
112         (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructor):
113         * bindings/scripts/test/TestEnabledForContext.idl: Added.
114
115 2019-05-14  Robin Morisset  <rmorisset@apple.com>
116
117         [WHLSL] parseEffectfulSuffix() is never called
118         https://bugs.webkit.org/show_bug.cgi?id=195864
119         <rdar://problem/50746278>
120
121         Reviewed by Myles C. Maxfield.
122
123         The fix is trivial: when parseEffectfulPrefix does not see a ++ or --, it must call parseEffectfulSuffix.
124
125         No test yet, as it is not testable until the property resolver is finished.
126         It will be tested with the rest of the compiler, when we port the testsuite from the js implementation (it already covers this case).
127
128         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
129         (WebCore::WHLSL::Parser::parseEffectfulPrefix):
130
131 2019-05-14  Robin Morisset  <rmorisset@apple.com>
132
133         [WHLSL] parseEffectfulAssignment should not call parseCallExpression directly
134         https://bugs.webkit.org/show_bug.cgi?id=197890
135
136         Reviewed by Myles Maxfield.
137
138         callExpression already appears in effSuffix which is in effPrefix which is in effAssignment, so having it directly in effAssignment as well is useless (and ambiguous).
139         I've already fixed the grammar (https://github.com/gpuweb/WHLSL/commit/a07005f4d692fe3370618dca5db218992b362049), the grammar was always good, this patch is fixing the parser.
140
141         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
142         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
143
144 2019-05-14  Ross Kirsling  <ross.kirsling@sony.com>
145
146         Unreviewed restoration of non-unified build.
147
148         * Modules/cache/DOMCache.cpp:
149         * bindings/js/JSLazyEventListener.h:
150         * loader/NavigationScheduler.h:
151         * page/Quirks.cpp:
152         * page/Quirks.h:
153         * rendering/ClipRect.cpp:
154
155 2019-05-14  Zalan Bujtas  <zalan@apple.com>
156
157         Do not try to issue repaint while the render tree is being destroyed.
158         https://bugs.webkit.org/show_bug.cgi?id=197461
159         <rdar://problem/50368992>
160
161         Reviewed by Simon Fraser.
162
163         Test: http/tests/svg/crash-on-reload-with-filter.html
164
165         We don't need to compute repaint rects when the render tree is getting torn down. We'll issue a full repaint at some point.
166         Also during full render tree destruction the inline tree state is undefined. We should avoid accessing it.
167
168         * rendering/svg/RenderSVGResourceContainer.cpp:
169         (WebCore::RenderSVGResourceContainer::markAllClientLayersForInvalidation):
170
171 2019-05-14  Youenn Fablet  <youenn@apple.com>
172
173         A service worker process should app nap when all its clients app nap
174         https://bugs.webkit.org/show_bug.cgi?id=185626
175         <rdar://problem/46785908>
176
177         Reviewed by Alex Christensen.
178
179         Update RegistrableDomain to work with SecurityOriginData.
180         Add internal API to enable accessing to service worker process throttle state.
181
182         Test: http/wpt/service-workers/mac/processSuppression.https.html
183
184         * platform/RegistrableDomain.h:
185         (WebCore::RegistrableDomain::RegistrableDomain):
186         (WebCore::RegistrableDomain::matches const):
187         (WebCore::RegistrableDomain::registrableDomainFromHost):
188         * testing/ServiceWorkerInternals.cpp:
189         (WebCore::ServiceWorkerInternals::isThrottleable const):
190         * testing/ServiceWorkerInternals.h:
191         * testing/ServiceWorkerInternals.idl:
192         * workers/service/SWClientConnection.h:
193         * workers/service/context/SWContextManager.cpp:
194         * workers/service/context/SWContextManager.h:
195         * workers/service/server/SWServer.cpp:
196         (WebCore::SWServer::serverToContextConnectionCreated):
197         * workers/service/server/SWServer.h:
198         (WebCore::SWServer::Connection::server const):
199         (WebCore::SWServer::connections const):
200         * workers/service/server/SWServerToContextConnection.h:
201
202 2019-05-14  Youenn Fablet  <youenn@apple.com>
203
204         getUserMedia capture changes on iOS after homing out
205         https://bugs.webkit.org/show_bug.cgi?id=197707
206
207         Reviewed by Eric Carlson.
208
209         In case of muting an AVVideoCaptureSource on iOS, the session is cleared.
210         We need to store the preset information, to setup the new session on unnmuting correctly.
211         Manually tested.
212
213         * platform/mediastream/mac/AVVideoCaptureSource.h:
214         * platform/mediastream/mac/AVVideoCaptureSource.mm:
215         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
216         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
217         (WebCore::AVVideoCaptureSource::setupCaptureSession):
218
219 2019-05-14  Oriol Brufau  <obrufau@igalia.com>
220
221         [css-grid] Update grid when changing auto repeat type
222         https://bugs.webkit.org/show_bug.cgi?id=197849
223
224         Reviewed by Javier Fernandez.
225
226         Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-change-auto-repeat-tracks.html
227
228         This patch makes two 'repeat()' values for 'grid-template' be considered
229         to be different if one uses 'auto-fill' and the other 'auto-fit'.
230
231         Previously, they were considered to be equal if the repeated values
232         were the same, without comparing the repeat type. Therefore, the grid
233         was not updated when setting both values one after the other.
234
235         * css/CSSGridAutoRepeatValue.cpp:
236         (WebCore::CSSGridAutoRepeatValue::equals const):
237         * css/CSSGridAutoRepeatValue.h:
238
239 2019-05-14  Antti Koivisto  <antti@apple.com>
240
241         Event region computation should respect transforms
242         https://bugs.webkit.org/show_bug.cgi?id=197836
243         <rdar://problem/50762971>
244
245         Reviewed by Darin Adler.
246
247         * platform/graphics/transforms/AffineTransform.cpp:
248         (WebCore::AffineTransform::mapRegion const):
249
250         Add support for transforming regions. Non-rectlinear results use enclosing rects.
251
252         * platform/graphics/transforms/AffineTransform.h:
253         * rendering/EventRegion.cpp:
254         (WebCore::EventRegionContext::EventRegionContext):
255         (WebCore::EventRegionContext::pushTransform):
256         (WebCore::EventRegionContext::popTransform):
257         (WebCore::EventRegionContext::unite):
258         (WebCore::EventRegionContext::contains const):
259
260         Add a context object that holds the current transform.
261
262         * rendering/EventRegion.h:
263         (WebCore::EventRegion::makeContext):
264         * rendering/InlineTextBox.cpp:
265         (WebCore::InlineTextBox::paint):
266         * rendering/PaintInfo.h:
267
268         Replace the region object with the context.
269
270         * rendering/RenderBlock.cpp:
271         (WebCore::RenderBlock::paintObject):
272         * rendering/RenderLayer.cpp:
273         (WebCore::RenderLayer::paintLayerByApplyingTransform):
274
275         Apply transforms to regions if needed.
276
277         (WebCore::RenderLayer::collectEventRegionForFragments):
278         * rendering/RenderLayer.h:
279         * rendering/RenderLayerBacking.cpp:
280         (WebCore::RenderLayerBacking::updateEventRegion):
281         * rendering/SimpleLineLayoutFunctions.cpp:
282         (WebCore::SimpleLineLayout::paintFlow):
283
284 2019-05-14  Youenn Fablet  <youenn@apple.com>
285
286         Video frame resizing should be using Trim
287         https://bugs.webkit.org/show_bug.cgi?id=197722
288         <rdar://problem/50602188>
289
290         Reviewed by Eric Carlson.
291
292         Move from letter box to trim mode for resizing.
293         This ensures no black stripes are present when rendering the stream.
294
295         Test: fast/mediastream/resize-trim.html
296
297         * platform/cocoa/VideoToolboxSoftLink.cpp:
298         * platform/cocoa/VideoToolboxSoftLink.h:
299         * platform/graphics/cv/ImageTransferSessionVT.mm:
300         (WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
301
302 2019-05-14  Yusuke Suzuki  <ysuzuki@apple.com>
303
304         [JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
305         https://bugs.webkit.org/show_bug.cgi?id=197833
306
307         Reviewed by Darin Adler.
308
309         * testing/Internals.cpp:
310         (WebCore::Internals::parserMetaData):
311
312 2019-05-14  Antoine Quint  <graouts@apple.com>
313
314         [Pointer Events] The pointerenter and pointerleave events target the wrong element on iOS
315         https://bugs.webkit.org/show_bug.cgi?id=197881
316         <rdar://problem/50187657>
317
318         Reviewed by Dean Jackson.
319
320         Test: pointerevents/ios/enter-leave-target.html
321
322         The "pointerenter" and "pointerleave" should target the element on which the event listener was added and not
323         the element that would otherwise hit test. This matches the behavior of "mouseenter" and "mouseleave" on macOS.
324
325         * page/PointerCaptureController.cpp:
326         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
327
328 2019-05-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
329
330         [CG] Adding support for HEIF-sequence ('public.heics') images
331         https://bugs.webkit.org/show_bug.cgi?id=197384
332
333         Reviewed by Simon Fraser.
334
335         -- Get the image repetitionCount and the frame duration.
336         -- Add a new function setAdditionalSupportedImageTypesForTesting() which
337            takes a delimited String.
338         -- Add internal APIs to retrive the image frame count and the frame
339            duration.
340
341         Tests: fast/images/animated-heics-draw.html
342                fast/images/animated-heics-verify.html
343
344         * platform/graphics/ImageSource.h:
345         * platform/graphics/cg/ImageDecoderCG.cpp:
346         (WebCore::animationPropertiesFromProperties):
347         (WebCore::animationHEICSPropertiesFromProperties):
348         (WebCore::ImageDecoderCG::repetitionCount const):
349         (WebCore::ImageDecoderCG::frameDurationAtIndex const):
350         * platform/graphics/cg/UTIRegistry.cpp:
351         (WebCore::setAdditionalSupportedImageTypesForTesting):
352         * platform/graphics/cg/UTIRegistry.h:
353         * testing/Internals.cpp:
354         (WebCore::Internals::imageFrameCount):
355         (WebCore::Internals::imageFrameDurationAtIndex):
356         * testing/Internals.h:
357         * testing/Internals.idl:
358         * testing/js/WebCoreTestSupport.cpp:
359         (WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting):
360         * testing/js/WebCoreTestSupport.h:
361
362 2019-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
363
364         [css-grid] Use max size to compute auto repeat tracks
365         https://bugs.webkit.org/show_bug.cgi?id=197854
366
367         Reviewed by Javier Fernandez.
368
369         When available size is indefinite we should use max size to compute the number of auto repeat tracks.
370
371         The spec text is very clear (https://drafts.csswg.org/css-grid/#auto-repeat):
372         > When auto-fill is given as the repetition number, if the grid container
373         > has a definite size or **max size** in the relevant axis...
374
375         So far we were not doing that for widths, in this patch we modify RenderGrid::computeAutoRepeatTracksCount()
376         to do the same than for heights.
377
378         We also take advantage to fix problems related to min|max sizes and box-sizing property,
379         that were inconsistent for columns and rows.
380
381         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html
382                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html
383                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html
384                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html
385                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html
386
387         * rendering/RenderGrid.cpp:
388         (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
389
390 2019-05-14  Joonghun Park  <pjh0718@gmail.com>
391
392         Implement page-break-* and -webkit-column-break-* as legacy-shorthands.
393         https://bugs.webkit.org/show_bug.cgi?id=197656
394
395         Reviewed by Darin Adler.
396
397         According to https://drafts.csswg.org/css-cascade-4/#legacy-shorthand,
398         implement page-break-* and -webkit-column-break-* as legacy-shorthands for break-*.
399
400         This change also serialize page-break-* properties
401         to CSSStyleDeclaration,
402         per https://drafts.csswg.org/css-break/#page-break-properties.
403
404         * css/CSSProperties.json:
405         * css/StyleBuilderConverter.h:
406         (WebCore::StyleBuilderConverter::convertFontSynthesis):
407         (WebCore::StyleBuilderConverter::convertPageBreakBetween): Deleted.
408         (WebCore::StyleBuilderConverter::convertPageBreakInside): Deleted.
409         (WebCore::StyleBuilderConverter::convertColumnBreakBetween): Deleted.
410         (WebCore::StyleBuilderConverter::convertColumnBreakInside): Deleted.
411         * css/StyleProperties.cpp:
412         (WebCore::StyleProperties::getPropertyValue const):
413         (WebCore::StyleProperties::pageBreakPropertyValue const):
414         * css/StyleProperties.h:
415         * css/parser/CSSPropertyParser.cpp:
416         (WebCore::CSSPropertyParser::parseValueStart):
417         (WebCore::mapFromPageBreakBetween):
418         (WebCore::CSSPropertyParser::parseShorthand):
419         (WebCore::isLegacyBreakProperty): Deleted.
420
421 2019-05-14  Javier Fernandez  <jfernandez@igalia.com>
422
423         Implement "line-break: anywhere"
424         https://bugs.webkit.org/show_bug.cgi?id=181169
425         <rdar://problem/48507088>
426
427         Reviewed by Myles C. Maxfield.
428
429         The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
430         CSS property in order to allow additional breaking opportunities not
431         considered in the definition of the 'word-break: break-all'.
432
433         [1] https://github.com/w3c/csswg-drafts/issues/1171
434
435         Tests: imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html
436                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html
437                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html
438                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html
439                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html
440                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html
441                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html
442                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html
443                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html
444                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html
445                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html
446                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html
447                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html
448                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html
449                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html
450                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html
451                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html
452                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html
453
454         * css/CSSPrimitiveValueMappings.h:
455         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
456         (WebCore::CSSPrimitiveValue::operator LineBreak const):
457         * css/CSSProperties.json:
458         * css/CSSValueKeywords.in:
459         * css/parser/CSSParserFastPaths.cpp:
460         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
461         * rendering/BreakLines.h:
462         (WebCore::nextBreakablePositionBreakCharacter):
463         (WebCore::isBreakable):
464         * rendering/RenderText.cpp:
465         (WebCore::mapLineBreakToIteratorMode):
466         (WebCore::RenderText::computePreferredLogicalWidths):
467         * rendering/line/BreakingContext.h:
468         (WebCore::BreakingContext::handleText):
469         * rendering/style/RenderStyleConstants.h:
470
471 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
472
473         Unreviewed, build fix after 245258, missing ThreadSpecific.h include
474         https://bugs.webkit.org/show_bug.cgi?id=197146
475
476         * platform/ios/wak/WebCoreThread.mm:
477
478 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
479
480         [WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
481         https://bugs.webkit.org/show_bug.cgi?id=197146
482
483         Reviewed by Saam Barati.
484
485         * Modules/indexeddb/IDBDatabase.cpp:
486         (WebCore::IDBDatabase::hasPendingActivity const):
487         * Modules/indexeddb/IDBRequest.cpp:
488         (WebCore::IDBRequest::hasPendingActivity const):
489         * Modules/indexeddb/IDBTransaction.cpp:
490         (WebCore::IDBTransaction::hasPendingActivity const):
491
492 2019-05-13  Geoffrey Garen  <ggaren@apple.com>
493
494         Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files
495         https://bugs.webkit.org/show_bug.cgi?id=197760
496
497         Reviewed by Jer Noble.
498
499         Only makeSafeToUseMemoryMapForPath() if needed. (Fixed missing brace.)
500
501         * platform/sql/SQLiteDatabase.cpp:
502         (WebCore::SQLiteDatabase::open):
503
504 2019-05-13  Tadeu Zagallo  <tzagallo@apple.com>
505
506         JSObject::getOwnPropertyDescriptor is missing an exception check
507         https://bugs.webkit.org/show_bug.cgi?id=197693
508
509         Reviewed by Saam Barati.
510
511         JSObject::getOwnPropertyDescriptor assumes that getOwnPropertySlot returns false
512         if an exception is thrown, but that was not true for JSLocation::getOwnPropertySlotCommon.
513
514         This is already covered by http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html
515
516         * bindings/js/JSLocationCustom.cpp:
517         (WebCore::getOwnPropertySlotCommon):
518         (WebCore::JSLocation::getOwnPropertySlot):
519         (WebCore::JSLocation::getOwnPropertySlotByIndex):
520
521 2019-05-13  Antti Koivisto  <antti@apple.com>
522
523         REGRESSION (r245208): compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html asserts
524         https://bugs.webkit.org/show_bug.cgi?id=197818
525         <rdar://problem/50705762>
526
527         Reviewed by Simon Fraser.
528
529         Tests: fast/scrolling/ios/event-region-scale-transform-shared.html
530                fast/scrolling/ios/event-region-translate-transform-shared.html
531
532         This fixes the assert. However the added tests demonstrate that transform is not taken into account
533         when computing the event region, https://bugs.webkit.org/show_bug.cgi?id=197836.
534
535         * rendering/RenderLayerBacking.cpp:
536         (WebCore::RenderLayerBacking::updateEventRegion):
537
538 2019-05-13  Wenson Hsieh  <wenson_hsieh@apple.com>
539
540         [macOS] Font formatting options don't work when composing a message in Yahoo mail
541         https://bugs.webkit.org/show_bug.cgi?id=197813
542         <rdar://problem/49382250>
543
544         Reviewed by Darin Adler.
545
546         The bug happens because on mousedown, the "Aa Font" menu item's event handler hides itself before changing the
547         font at the text selection. This causes us to clear the selection in FocusController::setFocusedElement.
548
549         There is existing logic in clearSelectionIfNeeded that would normally prevent us from clearing the selection due
550         to the mousePressNode not being able to start a selection. However, since the clickable element in this case is
551         hidden during mousedown, it is missing a renderer, and we bail from the `mousePressNode->renderer() &&
552         !mousePressNode->canStartSelection()` check as a result.
553
554         This check was orginally added in https://trac.webkit.org/r24334 to avoid clearing the selection when clicking
555         a button; the intention appears to have been making it so that clicking on something that could not start a
556         selection (back then, synonymous with -webkit-user-select: ignore;) would not clear the current selection; to
557         this end, it seems odd to additionally require that the thing being clicked should still have a renderer, so
558         it seems safe to remove this requirement.
559
560         Test: editing/selection/preserve-selection-when-clicking-button.html
561
562         * page/FocusController.cpp:
563         (WebCore::clearSelectionIfNeeded):
564
565 2019-05-13  Eric Carlson  <eric.carlson@apple.com>
566
567         https://bugs.webkit.org/show_bug.cgi?id=197793
568         <rdar://problem/46429187>
569
570         Unreviewed, build fix after r245199.
571
572         * platform/audio/ios/MediaSessionManagerIOS.mm:
573         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
574
575 2019-05-13  Darin Adler  <darin@apple.com>
576
577         WHLSLPrepare.cpp always recompiles, even if nothing was changed
578         https://bugs.webkit.org/show_bug.cgi?id=197151
579
580         Reviewed by Dan Bernstein and Keith Rollin.
581
582         * DerivedSources-input.xcfilelist: Script updated this automatically after
583         DerivedSources.make was corrected.
584         * DerivedSources-output.xcfilelist: Ditto, although I had to manually remove
585         one bogus leftover reference to WHLSLStandardLibrary.cpp.
586
587         * DerivedSources.make: Updated the rule that builds WHSLStandardLibrary.h to
588         no longer refer to nonexistent WHLSLStandardLibrary.cpp. Because the dependency
589         was on a file that was never created, the rule to regenerate WHSLStandardLibrary.h
590         was running on every build, instead of only when one of the dependencies changed.
591
592 2019-05-12  Simon Fraser  <simon.fraser@apple.com>
593
594         When the set of backing-sharing layers changes, we need to issue a repaint
595         https://bugs.webkit.org/show_bug.cgi?id=197825
596
597         Reviewed by Zalan Bujtas.
598
599         If the set of layers painting into a shared backing store changes, we need
600         to repaint that backing store. This happens when scrolling as shared layers
601         enter the visible area.
602
603         Test: compositing/shared-backing/overflow-scroll/repaint-shared-on-scroll.html
604
605         * rendering/RenderLayerBacking.cpp:
606         (WebCore::RenderLayerBacking::setBackingSharingLayers):
607
608 2019-05-02  Simon Fraser  <simon.fraser@apple.com>
609
610         Add logging for RenderLayer clip rects
611         https://bugs.webkit.org/show_bug.cgi?id=197547
612
613         Reviewed by Zalan Bujtas.
614
615         Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
616
617         The ClipRect code is performance sensitive, even in debug, so guard the log sites
618         with clipRectsLogEnabled() because the macro still evaluates its arguments even if
619         the channel is disabled (we need some better way to log that doesn't do this).
620
621         * platform/Logging.h:
622         * rendering/ClipRect.cpp:
623         (WebCore::operator<<):
624         * rendering/ClipRect.h:
625         * rendering/RenderLayer.cpp:
626         (WebCore::operator<<):
627         (WebCore::RenderLayer::calculateClipRects const):
628         * rendering/RenderLayer.h:
629
630 2019-05-12  Simon Fraser  <simon.fraser@apple.com>
631
632         Refactor composited backing-sharing code
633         https://bugs.webkit.org/show_bug.cgi?id=197824
634
635         Reviewed by Zalan Bujtas.
636
637         Clean up the backing-sharing code to share more code, and make it easier to understand.
638         
639         Moves more logic into member functions on BackingSharingState, which are named to make
640         their functions clearer: startBackingSharingSequence/endBackingSharingSequence.
641         
642         computeCompositingRequirements() and traverseUnchangedSubtree() now just call
643         updateBeforeDescendantTraversal/updateAfterDescendantTraversal.
644
645         No behavior change.
646
647         * rendering/RenderLayerBacking.cpp:
648         (WebCore::RenderLayerBacking::willBeDestroyed):
649         (WebCore::RenderLayerBacking::setBackingSharingLayers): Remove the early return, since
650         we need to call setBackingProviderLayer() on the sharing layers in both code paths.
651         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
652         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
653         * rendering/RenderLayerCompositor.cpp:
654         (WebCore::RenderLayerCompositor::BackingSharingState::backingProviderCandidate const):
655         (WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer):
656         (WebCore::RenderLayerCompositor::BackingSharingState::startBackingSharingSequence):
657         (WebCore::RenderLayerCompositor::BackingSharingState::endBackingSharingSequence):
658         (WebCore::RenderLayerCompositor::BackingSharingState::updateBeforeDescendantTraversal):
659         (WebCore::RenderLayerCompositor::BackingSharingState::updateAfterDescendantTraversal):
660         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
661         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
662         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate): Deleted.
663         * rendering/RenderLayerCompositor.h:
664
665 2019-05-12  Youenn Fablet  <youenn@apple.com>
666
667         Use clampTo in AVVideoCaptureSource::setSizeAndFrameRateWithPreset
668         https://bugs.webkit.org/show_bug.cgi?id=197704
669
670         Reviewed by Alex Christensen.
671
672         Use clampTo as suggested in bug 196214 review.
673         No change of behavior.
674
675         * platform/mediastream/mac/AVVideoCaptureSource.mm:
676         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
677
678 2019-05-12  Youenn Fablet  <youenn@apple.com>
679
680         Use the main screen for screen capture
681         https://bugs.webkit.org/show_bug.cgi?id=197804
682         <rdar://problem/47671383>
683
684         Reviewed by Eric Carlson.
685
686         If the main screen, i.e. the screen that has focus at the time of
687         selection of the screen to capture, is capturable, add it to the list
688         of screen devices, but do not add any other screen.
689         This will make sure the main screen is selected.
690         Manually tested.
691
692         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
693         (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices):
694
695 2019-05-12  Takashi Komori  <Takashi.Komori@sony.com>
696
697         [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
698         https://bugs.webkit.org/show_bug.cgi?id=197650
699
700         Reviewed by Fujii Hironori.
701
702         When Curl port accesses a page which checks Basic Authentication credential and server trust challenge occurs,
703         Curl port calls extra didReceiveAuthenticationChallenge unnecessarily.
704         This is because Curl port discards information about allowed server trust challenge before in NetworkDataTaskCurl::restartWithCredential.
705
706         Test: http/tests/ssl/curl/certificate-and-authentication.html
707
708         * platform/network/curl/CurlRequest.h:
709         (WebCore::CurlRequest::isServerTrustEvaluationDisabled):
710
711 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
712
713         Overflow scroll that becomes non-scrollable should stop being composited
714         https://bugs.webkit.org/show_bug.cgi?id=197817
715         <rdar://problem/50697290>
716
717         Reviewed by Antti Koivisto.
718
719         Remove the iOS-specific #ifdef around code that triggers a compositing re-evaluation
720         when scrolling state changes.
721
722         Test: compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html
723
724         * rendering/RenderLayer.cpp:
725         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
726
727 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
728
729         Layer bounds are incorrect for sharing layers that paint with transforms
730         https://bugs.webkit.org/show_bug.cgi?id=197768
731         <rdar://problem/50695493>
732
733         Reviewed by Zalan Bujtas.
734
735         We don't need to traverse shared layers if the backing-provider has overflow clip,
736         because we know they are containing-block descendants and therefore clipped.
737
738         Note tha the CSS "clip" property doesn't guarantee this, because the clip rect
739         can be larger than the element, so in that case we just traverse shared layers.
740
741         Tests: compositing/shared-backing/sharing-bounds-clip.html
742                compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html
743                compositing/shared-backing/sharing-bounds-transformed-sharing-layer.html
744                compositing/shared-backing/sharing-bounds.html
745
746         * rendering/RenderLayerBacking.cpp:
747         (WebCore::RenderLayerBacking::updateCompositedBounds):
748
749 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
750
751         Translucent gradient rendering bug due to will-change transform
752         https://bugs.webkit.org/show_bug.cgi?id=197654
753         <rdar://problem/50547664>
754
755         Reviewed by Dean Jackson.
756         
757         We failed to re-evaluate 'contentsOpaque' when a background changed, because this
758         happened in updateGeometry() and that doesn't run for background changes.
759         
760         However, 'contentsOpaque' also requires knowing about geometry because we have to
761         turn it off when there's subpixel positioning, and updateConfiguration()
762         runs before updateGeometry().
763         
764         So compute m_hasSubpixelRounding in updateGeometry() and set contentsOpaque in
765         updateAfterDescendants().
766
767         Test: compositing/contents-opaque/background-change-to-transparent.html
768
769         * rendering/RenderLayerBacking.cpp:
770         (WebCore::RenderLayerBacking::updateConfiguration):
771         (WebCore::RenderLayerBacking::updateGeometry):
772         (WebCore::RenderLayerBacking::updateAfterDescendants):
773         * rendering/RenderLayerBacking.h:
774
775 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
776
777         When the scroller hosting a shared layer becomes non-scrollable, content disappears
778         https://bugs.webkit.org/show_bug.cgi?id=197766
779         <rdar://problem/50695808>
780
781         Reviewed by Zalan Bujtas.
782
783         RenderLayerCompositor::requiresOwnBackingStore() should return true for a layer that shares
784         its backing store. We always made backing for overlap layers, so even  if the sharing layers
785         have no painted content, this should rarely be a backing store memory regression.
786
787         Test: compositing/shared-backing/overflow-scroll/sharing-layer-becomes-non-scrollable.html
788
789         * rendering/RenderLayerCompositor.cpp:
790         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
791
792 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
793
794         Backing-sharing layers with transforms render incorrectly
795         https://bugs.webkit.org/show_bug.cgi?id=197692
796         <rdar://problem/50652127>
797
798         Reviewed by Antti Koivisto.
799
800         Layers that paint into shared backing need to enter the RenderLayer painting code
801         in a way that paints the filters, transforms, opacity and blending.
802         
803         RenderLayerBacking::paintIntoLayer() normally enters at paintLayerContents(), because
804         the effects are rendered via the GraphicsLayer, but shared layers will paint effects.
805         Note that if the backing-provider has effects, it will be the stacking context
806         for the shared layers, so it's correct that sharing layers are impacted by effects
807         on the backing-provider.
808
809         In addition, we have to ensure that we don't over-eagerly make layers shared.
810         Consider:
811         
812         <div class="clipping">
813             <div class="sharing">
814                 <div class="inner">
815                 </div>
816             </div>
817         </div>
818         
819         Here "clipping" is the provider layer, "sharing" paints into shared backing, but
820         we don't want to also mark "inner" as sharing, since "sharing" will just paint it.
821         This is akin to avoiding unnecessary compositing of z-order descendants when they can just
822         paint.
823         
824         To do this we need to ensure that sharing layers are treated like compositing layers
825         in the overlap map, i.e. when a layer is sharing, we call overlapMap.pushCompositingContainer(),
826         and later overlapMap.popCompositingContainer().
827
828         Tests: compositing/shared-backing/nested-shared-layers-with-opacity.html
829                compositing/shared-backing/shared-layer-has-blending.html
830                compositing/shared-backing/shared-layer-has-filter.html
831                compositing/shared-backing/shared-layer-has-opacity.html
832                compositing/shared-backing/shared-layer-has-reflection.html
833                compositing/shared-backing/shared-layer-has-transform.html
834                compositing/shared-backing/shared-layer-isolates-blending.html
835                compositing/shared-backing/shared-transformed-layer-bounds.html
836                compositing/shared-backing/sharing-layer-becomes-non-scrollable.html
837                compositing/shared-backing/sharing-layer-has-effect.html
838
839         * rendering/RenderLayer.cpp:
840         (WebCore::RenderLayer::paintLayer):
841         (WebCore::RenderLayer::paintLayerWithEffects):
842         * rendering/RenderLayer.h:
843         * rendering/RenderLayerBacking.cpp:
844         (WebCore::RenderLayerBacking::paintIntoLayer):
845         * rendering/RenderLayerCompositor.cpp:
846         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
847         (WebCore::backingProviderLayerCanIncludeLayer):
848         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
849         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
850
851 2019-05-10  Youenn Fablet  <youenn@apple.com>
852
853         A service worker instance should be terminated when its SWServer is destroyed
854         https://bugs.webkit.org/show_bug.cgi?id=197801
855         <rdar://problem/50587270>
856
857         Reviewed by Chris Dumez.
858
859         On session destruction, the SWServer is destroyed.
860         At that time, it should terminate all its running service workers.
861         Covered by updated API test.
862
863         * workers/service/server/SWServer.cpp:
864         (WebCore::SWServer::~SWServer):
865
866 2019-05-10  Eric Carlson  <eric.carlson@apple.com>
867
868         [iOS] HTMLMediaElement sometimes doesn't send 'webkitplaybacktargetavailabilitychanged' event
869         https://bugs.webkit.org/show_bug.cgi?id=197793
870         <rdar://problem/46429187>
871
872         Reviewed by Jer Noble.
873
874         * html/MediaElementSession.cpp:
875         (WebCore::MediaElementSession::MediaElementSession): Initialize m_hasPlaybackTargets.
876
877         * platform/audio/ios/MediaSessionManagerIOS.mm:
878         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange): Log
879         target availability.
880         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Call the client 
881         externalOutputDeviceAvailableDidChange method after the AVRouteDetector is available.
882
883 2019-05-09  Geoffrey Garen  <ggaren@apple.com>
884
885         Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files
886         https://bugs.webkit.org/show_bug.cgi?id=197760
887
888         Reviewed by Jer Noble.
889
890         We have all the data we need, and this crash is happening more than
891         expected.
892
893         * platform/sql/SQLiteDatabase.cpp:
894         (WebCore::SQLiteDatabase::open):
895
896 2019-05-10  Zalan Bujtas  <zalan@apple.com>
897
898         [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled.
899         https://bugs.webkit.org/show_bug.cgi?id=197781
900         <rdar://problem/48027412>
901
902         Reviewed by Simon Fraser.
903
904         Synthetic bold is essentially two regular glyphs painted with an offset. While on macOS this offset is always 1px (CSS), on iOS larger font produces higher offset value. At paint time, this offset value (in CSS px unit) get converted
905         to a device pixel value taking context scale into account. This conversion ensures that the gap between the 2 regular glyphs won't get wider (in device pixels) as the user pinch zooms in.
906         This works as long as the scale on the context is >= 1. This patch ensures that a scaled down context won't blow up this gap.
907
908         Test: fast/text/large-synthetic-bold-with-scale-transform.html
909
910         * platform/graphics/cocoa/FontCascadeCocoa.mm:
911         (WebCore::FontCascade::drawGlyphs):
912
913 2019-05-10  Brent Fulgham  <bfulgham@apple.com>
914
915         Gracefully handle inaccessible font face data
916         https://bugs.webkit.org/show_bug.cgi?id=197762
917         <rdar://problem/50433861>
918
919         Reviewed by Per Arne Vollan.
920
921         Make sure CSS Font Face handling gracefully recovers from
922         missing font data.
923
924         Test: fast/text/missing-font-crash.html
925
926         * css/CSSFontFace.cpp:
927         (WebCore::CSSFontFace::fontLoadEventOccurred):
928         (WebCore::CSSFontFace::timeoutFired):
929         (WebCore::CSSFontFace::fontLoaded):
930         (WebCore::CSSFontFace::font):
931
932 2019-05-10  Simon Fraser  <simon.fraser@apple.com>
933
934         ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()) on nytimes.com after r245170
935         https://bugs.webkit.org/show_bug.cgi?id=197776
936
937         Reviewed by Zalan Bujtas.
938
939         Only try to paint into shared backing for layers that are able to be composited. This
940         avoids trying to do sharing for non-self-painting layers, which doesn't make sense.
941
942         Test: compositing/shared-backing/overflow-scroll/non-self-painting-layer-should-not-share.html
943
944         * rendering/RenderLayerCompositor.cpp:
945         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
946
947 2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
948
949         Fix a bunch of compiler warnings
950         https://bugs.webkit.org/show_bug.cgi?id=197785
951
952         Reviewed by Don Olmstead.
953
954         * CMakeLists.txt: WebCoreTestSupport should accept extra SYSTEM includes.
955         * PlatformGTK.cmake: GTK includes should be added to SYSTEM headers to avoid warnings.
956         * inspector/InspectorCanvas.cpp: Add preprocessor guards to fix unused function warning.
957         * rendering/RenderLayer.cpp: Fix unused variable warning.
958         (WebCore::RenderLayer::updateClipRects):
959
960 2019-05-10  Antti Koivisto  <antti@apple.com>
961
962         Event region generation needs to know about backing-sharing
963         https://bugs.webkit.org/show_bug.cgi?id=197694
964         <rdar://problem/50584991>
965
966         Reviewed by Simon Fraser.
967
968         Test: pointerevents/ios/touch-action-region-backing-sharing.html
969
970         * rendering/RenderLayerBacking.cpp:
971         (WebCore::RenderLayerBacking::updateEventRegion):
972
973         Gather event region from backing sharing layers too.
974
975 2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
976
977         [WPE][GTK] Add WebKitWebPage::did-associate-form-controls-for-frame and deprecate original did-associate-form-controls
978         https://bugs.webkit.org/show_bug.cgi?id=197271
979
980         Reviewed by Youenn Fablet.
981
982         * dom/Document.cpp:
983         (WebCore::Document::didAssociateFormControlsTimerFired):
984         * loader/EmptyClients.h:
985         * page/ChromeClient.h:
986
987 2019-05-09  Simon Fraser  <simon.fraser@apple.com>
988
989         Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
990         https://bugs.webkit.org/show_bug.cgi?id=197561
991         <rdar://problem/50445998>
992
993         Reviewed by Antti Koivisto.
994
995         This change introduces the concept of layers that share backing store for compositing. A layer
996         which is sharing its backing store first paints itself, and then some set of layers which come
997         later in paint order in the same stacking context. This reduces the composited layer count in
998         some overflow scrolling scenarios, thereby also simplifying the scrolling tree.
999         
1000         A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At
1001         paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the
1002         painting root so that positioning and clipping just work.
1003         
1004         Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements().
1005         We track the last layer which was composited in paint order as a shared candidate. If a later layer
1006         would composite for overlap (and no other reasons), then we allow it to share with the candidate
1007         if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers
1008         in the same stacking context.
1009         
1010         isComposited() returns false for sharing layers, but they are like composited layers in that
1011         they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them,
1012         and repaints in shared layers have to be directed to their shared layer, hence
1013         changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint().
1014         
1015         The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that
1016         all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use
1017         TemporaryClipRects in that case.
1018
1019         Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html
1020                compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html
1021                compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
1022                compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html
1023                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html
1024                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html
1025                compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html
1026                compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html
1027                compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html
1028                compositing/shared-backing/overflow-scroll/shared-layer-clipping.html
1029                compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html
1030                compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html
1031                compositing/shared-backing/overflow-scroll/shared-layer-repaint.html
1032                compositing/shared-backing/partial-compositing-update.html
1033                compositing/shared-backing/partial-compositing-update2.html
1034                compositing/shared-backing/remove-sharing-layer.html
1035                compositing/shared-backing/sharing-cached-clip-rects.html
1036
1037         * rendering/RenderLayer.cpp:
1038         (WebCore::RenderLayer::~RenderLayer):
1039         (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const):
1040         (WebCore::RenderLayer::setBackingProviderLayer):
1041         (WebCore::RenderLayer::disconnectFromBackingProviderLayer):
1042         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
1043         (WebCore::RenderLayer::clippingRootForPainting const):
1044         (WebCore::RenderLayer::clipToRect):
1045         (WebCore::RenderLayer::paintLayer):
1046         (WebCore::RenderLayer::updateClipRects):
1047         (WebCore::RenderLayer::clipCrossesPaintingBoundary const):
1048         (WebCore::RenderLayer::calculateClipRects const):
1049         (WebCore::outputPaintOrderTreeLegend):
1050         (WebCore::outputPaintOrderTreeRecursive):
1051         (WebCore::inContainingBlockChain): Deleted.
1052         * rendering/RenderLayer.h:
1053         * rendering/RenderLayerBacking.cpp:
1054         (WebCore::RenderLayerBacking::willBeDestroyed):
1055         (WebCore::clearBackingSharingLayerProviders):
1056         (WebCore::RenderLayerBacking::setBackingSharingLayers):
1057         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
1058         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
1059         (WebCore::RenderLayerBacking::updateCompositedBounds):
1060         (WebCore::RenderLayerBacking::updateDrawsContent):
1061         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
1062         (WebCore::RenderLayerBacking::paintIntoLayer):
1063         (WebCore::RenderLayerBacking::paintContents):
1064         * rendering/RenderLayerBacking.h:
1065         * rendering/RenderLayerCompositor.cpp:
1066         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
1067         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren):
1068         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree):
1069         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate):
1070         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1071         (WebCore::backingProviderLayerCanIncludeLayer):
1072         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1073         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1074         (WebCore::RenderLayerCompositor::updateBacking):
1075         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
1076         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
1077         * rendering/RenderLayerCompositor.h:
1078         * rendering/RenderTreeAsText.cpp:
1079
1080 2019-05-09  Daniel Bates  <dabates@apple.com>
1081
1082         [iOS] Right command key has wrong value for property code
1083         https://bugs.webkit.org/show_bug.cgi?id=193876
1084         <rdar://problem/47577308>
1085
1086         Reviewed by Brent Fulgham.
1087
1088         We're looking for the wrong Windows virtual key code for the right command key.
1089         Substitute VK_APPS for VK_RWIN so we can identify the right command key and return
1090         the correct value for the code property of the DOM key event.
1091
1092         * platform/ios/PlatformEventFactoryIOS.mm:
1093         (WebCore::codeForKeyEvent):
1094
1095 2019-05-09  Daniel Bates  <dabates@apple.com>
1096
1097         [iOS] Numpad comma key has incorrect keyIdentifier property
1098         https://bugs.webkit.org/show_bug.cgi?id=197753
1099         <rdar://problem/50636274>
1100
1101         Reviewed by Brent Fulgham.
1102
1103         Map the Numpad Comma HID usage code to its Window virtual key code, VK_SEPARATOR,
1104         so that can compute the keyIdentifier property for the Numpad Comma key. Also
1105         consider this key as a keypad key just like we do on Mac. There is no discernable
1106         difference for doing so on iOS because the non-keypad code path computes the same result
1107         due to GraphicsServices having fixed up the input string for the Numpad Comma to be
1108         ",", which is want.
1109
1110         * platform/ios/KeyEventIOS.mm:
1111         (WebCore::windowsKeyCodeForKeyCode): Map kHIDUsage_KeypadComma to VK_SEPARATOR.
1112         * platform/ios/PlatformEventFactoryIOS.mm:
1113         (WebCore::codeForKeyEvent): Add a comment to explain that this key is only on
1114         JIS keyboards.
1115         (WebCore::isKeypadEvent): Return true for the Numpad Comma key.
1116
1117 2019-05-09  Zalan Bujtas  <zalan@apple.com>
1118
1119         Do not mix inline and block level boxes.
1120         https://bugs.webkit.org/show_bug.cgi?id=197462
1121         <rdar://problem/50369362>
1122
1123         Reviewed by Antti Koivisto.
1124
1125         This patch tightens the remove-anonymous-wrappers logic by checking if the removal would
1126         produce an inline-block sibling mix.
1127         When a block level box is removed from the tree, we check if after the removal the anonymous sibling block
1128         boxes are still needed or whether we can removed them as well (and have only inline level child boxes).
1129         In addition to checking if the container is anonymous and is part of a continuation, we also need to check
1130         if collapsing it (and by that moving its children one level up) would cause a inline-block box mix.
1131
1132         Test: fast/ruby/continuation-and-column-spanner-crash.html
1133
1134         * rendering/updating/RenderTreeBuilder.cpp:
1135         (WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded):
1136         * rendering/updating/RenderTreeBuilderContinuation.cpp:
1137         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
1138
1139 2019-05-09  Eric Carlson  <eric.carlson@apple.com>
1140
1141         Refine AudioSession route sharing policy
1142         https://bugs.webkit.org/show_bug.cgi?id=197742
1143         <rdar://problem/50590818>
1144
1145         Reviewed by Darin Adler.
1146
1147         No new tests, updated AVAudioSessionRouteSharingPolicy API test.
1148
1149         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1150         (MediaSessionManagerCocoa::updateSessionState):
1151
1152 2019-05-09  Simon Fraser  <simon.fraser@apple.com>
1153
1154         fast/hidpi/video-controls-in-hidpi.html sometimes asserts in WK1
1155         https://bugs.webkit.org/show_bug.cgi?id=197695
1156
1157         Reviewed by Zalan Bujtas.
1158
1159         With the backing-sharing changes that landed in r245058, some WebKit1 tests with media controls asserted in
1160         RenderLayerBacking::computeParentGraphicsLayerRect() because a layer would have a m_ancestorClippingLayer,
1161         but backgroundClipRect() would return an infinite rect.
1162         
1163         This happened when a layer tree change caused the layer's compositing ancestor to no longer isolate
1164         composited blending (which affects the behavior of RenderLayerCompositor:clippedByAncestor()), but we failed
1165         to mark its composited children as needing the configuration update which would eliminate their m_ancestorClippingLayers.
1166         
1167         The fix is to call setChildrenNeedCompositingGeometryUpdate() when isolatesCompositedBlending changes. We don't haev
1168         setChildrenNeedCompositingConfigurationUpdate(), but setChildrenNeedCompositingGeometryUpdate() has the desired side-effect.
1169
1170         I was unable to make a standalone test case for this, but the code is exercised by media control tests.
1171
1172         * rendering/RenderLayerCompositor.cpp:
1173         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1174
1175 2019-05-09  Brent Fulgham  <bfulgham@apple.com>
1176
1177         Correct delayed load event handling
1178         https://bugs.webkit.org/show_bug.cgi?id=197679
1179         <rdar://problem/50423334>
1180
1181         Reviewed by Alex Christensen.
1182
1183         We need to properly account for the fact that JavaScript might run
1184         while performing loads.
1185
1186         * dom/Document.cpp:
1187         (WebCore::Document::loadEventDelayTimerFired):
1188
1189 2019-05-09  Antti Koivisto  <antti@apple.com>
1190
1191         Elements with "display: inline-block" don't have a touch-action region
1192         https://bugs.webkit.org/show_bug.cgi?id=197281
1193         <rdar://problem/50535081>
1194
1195         Reviewed by Antoine Quint.
1196
1197         Test: pointerevents/ios/touch-action-region-inline-block.html
1198
1199         PaintPhase::EventRegion failed to traverse into inline boxes.
1200
1201         * rendering/InlineElementBox.cpp:
1202         (WebCore::InlineElementBox::paint):
1203         * rendering/RenderElement.cpp:
1204         (WebCore::RenderElement::paintAsInlineBlock):
1205
1206 2019-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1207
1208         REGRESSION(r239915): [FreeType] White space skipped when rendering plain text with noto CJK font
1209         https://bugs.webkit.org/show_bug.cgi?id=197658
1210
1211         Reviewed by Michael Catanzaro.
1212
1213         Since r239915 we no longer overwrite control characters with zero width space, they are handled later when
1214         filling the glyph pages. In Font::platformGlyphInit() there's an optimization to get the glyph of zero with
1215         space character that assumes that control characters are always overwritten. Since the glyph for character at 0
1216         index is always overwritten with zero width space, we can avoid loading the page for the actual zero width space
1217         character and use the first page instead. In the particular case of noto CJK font, character at 0 is mapped to
1218         the same glyph as space character, so space and zero width space end up being the same glyph. That breaks the
1219         space width calculation, that returns 0 when isZeroWidthSpaceGlyph() is true. That's why spaces are no
1220         longer rendered, ComplexTextController::adjustGlyphsAndAdvances() is setting the x advance for the space glyphs
1221         to 0.
1222
1223         * platform/graphics/Font.cpp:
1224         (WebCore::Font::platformGlyphInit): Use the actual zero width space page to get the glyph instead of 0 when
1225         using FreeType.
1226
1227 2019-05-08  Alex Christensen  <achristensen@webkit.org>
1228
1229         Fix WPE build.
1230
1231         * CMakeLists.txt:
1232         Bots wanted a "PUBLIC" or "PRIVATE" keyword here.
1233
1234 2019-05-08  Alex Christensen  <achristensen@webkit.org>
1235
1236         Try to fix Linux build
1237
1238         * platform/graphics/ANGLEWebKitBridge.h:
1239         Include headers consistently on all platforms.
1240
1241 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
1242
1243         Update ANGLE
1244         https://bugs.webkit.org/show_bug.cgi?id=197676
1245
1246         Reviewed by Alex Christensen.
1247
1248         * CMakeLists.txt:
1249         * PlatformGTK.cmake:
1250         * PlatformMac.cmake:
1251         * PlatformPlayStation.cmake:
1252         * PlatformWPE.cmake:
1253         * PlatformWin.cmake:
1254         * platform/graphics/GLContext.cpp:
1255         * platform/graphics/egl/GLContextEGL.cpp:
1256         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1257         * platform/graphics/opengl/Extensions3DOpenGLES.h:
1258         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
1259         * platform/graphics/texmap/TextureMapperGLHeaders.h:
1260
1261 2019-05-08  Chris Dumez  <cdumez@apple.com>
1262
1263         [iOS Debug] ASSERTION FAILED: !m_originalNode in WebCore::JSLazyEventListener::checkValidityForEventTarget(WebCore::EventTarget &)
1264         https://bugs.webkit.org/show_bug.cgi?id=197696
1265         <rdar://problem/50586956>
1266
1267         Reviewed by Simon Fraser.
1268
1269         Setting the onorientationchange / onresize event handler on the body should set the event handler on the
1270         window object, as per the HTML specification. However, calling body.addEventListener() with 'orientationchange'
1271         or 'resize' should not set the event listener on the window object, only the body. Blink and Gecko seem to
1272         behave as per specification but WebKit had a quirk for the addEventListener case. The quirk's implementation
1273         is slightly wrong (because it is unsafe to take a JSLazyEventListener from a body element and add it to the
1274         window, given that the JSLazyEventListener keeps a raw pointer to its element) and was causing crashes such
1275         as <rdar://problem/24314027>. As a result, this patch simply drops the WebKit quirk, which will align our
1276         behavior with other browsers and fix the crashes altogether.
1277
1278         Test: fast/events/ios/rotation/orientationchange-event-listener-on.body.html
1279
1280         * dom/Node.cpp:
1281         (WebCore::tryAddEventListener):
1282         (WebCore::tryRemoveEventListener):
1283
1284 2019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
1285
1286         Unreviewed, rolling out r245058.
1287
1288         Causes crashes under ASan / GuardMalloc
1289
1290         Reverted changeset:
1291
1292         "Implement backing-sharing in compositing layers, allowing
1293         overlap layers to paint into the backing store of another
1294         layer"
1295         https://bugs.webkit.org/show_bug.cgi?id=197561
1296         https://trac.webkit.org/changeset/245058
1297
1298 2019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
1299
1300         Unreviewed, rolling out r245068.
1301
1302         Caused debug layout tests to exit early due to an assertion
1303         failure.
1304
1305         Reverted changeset:
1306
1307         "All prototypes should call didBecomePrototype()"
1308         https://bugs.webkit.org/show_bug.cgi?id=196315
1309         https://trac.webkit.org/changeset/245068
1310
1311 2019-05-08  Megan Gardner  <megan_gardner@apple.com>
1312
1313         Add quirks to emulate undo and redo in hidden editable areas on some websites
1314         https://bugs.webkit.org/show_bug.cgi?id=197452
1315
1316         Reviewed by Alex Christensen.
1317
1318         UI change, not testable.
1319
1320         We need to send synthetic keyboard events to the web process to emulate undo and redo
1321         key combinations for when we are trying to get our undo and redo UI to work
1322         on rich editing websites that only listen to keystrokes, and don't let us use our
1323         undo manager to help manage the input content.
1324
1325         * page/EventHandler.cpp:
1326         (WebCore::EventHandler::keyEvent):
1327         * platform/PlatformKeyboardEvent.h:
1328         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1329         (WebCore::PlatformKeyboardEvent::isSyntheticEvent):
1330         (WebCore::PlatformKeyboardEvent::setSyntheticEvent):
1331         * platform/ios/KeyEventIOS.mm:
1332         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
1333         * platform/ios/PlatformEventFactoryIOS.mm:
1334         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
1335         * platform/mac/PlatformEventFactoryMac.mm:
1336         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
1337
1338 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
1339
1340         CSSFontFaceSource fails to compile when !ENABLE(SVG_FONTS)
1341         https://bugs.webkit.org/show_bug.cgi?id=197720
1342
1343         Unreviewed build fix.
1344
1345         Add usesInDocumentSVGFont to the !ENABLE(SVG_FONT) path.
1346
1347         * css/CSSFontFaceSource.cpp:
1348         (WebCore::CSSFontFaceSource::font):
1349
1350 2019-05-08  Timothy Hatcher  <timothy@apple.com>
1351
1352         Add plumbing for inactive system colors in RenderTheme cache.
1353         https://bugs.webkit.org/show_bug.cgi?id=197699
1354         rdar://problem/49406936
1355
1356         Reviewed by Tim Horton.
1357
1358         * css/StyleColor.h:
1359         * page/Page.cpp:
1360         (WebCore::Page::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
1361         * page/Page.h:
1362         (WebCore::Page::useInactiveAppearance const):
1363         * rendering/RenderTheme.cpp:
1364         (WebCore::RenderTheme::purgeCaches):
1365         (WebCore::RenderTheme::platformColorsDidChange):
1366         (WebCore::RenderTheme::colorCache const):
1367         * rendering/RenderTheme.h:
1368         * testing/InternalSettings.cpp:
1369         (WebCore::InternalSettings::setUseDarkAppearanceInternal):
1370
1371 2019-05-08  Robin Morisset  <rmorisset@apple.com>
1372
1373         All prototypes should call didBecomePrototype()
1374         https://bugs.webkit.org/show_bug.cgi?id=196315
1375
1376         Reviewed by Saam Barati.
1377
1378         This changelog already landed, but the commit was missing the actual changes.
1379
1380         It was found by existing tests, with the new assert in JSC::Structure
1381
1382         * bindings/js/JSWindowProxy.cpp:
1383         (WebCore::JSWindowProxy::setWindow):
1384         * bindings/scripts/CodeGeneratorJS.pm:
1385         (GeneratePrototypeDeclaration):
1386         (GenerateConstructorHelperMethods):
1387         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1388         (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype):
1389         * bindings/scripts/test/JS/JSMapLike.cpp:
1390         (WebCore::JSMapLikePrototype::JSMapLikePrototype):
1391         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1392         (WebCore::JSReadOnlyMapLikePrototype::JSReadOnlyMapLikePrototype):
1393         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1394         (WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype):
1395         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1396         (WebCore::JSTestCEReactionsPrototype::JSTestCEReactionsPrototype):
1397         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1398         (WebCore::JSTestCEReactionsStringifierPrototype::JSTestCEReactionsStringifierPrototype):
1399         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1400         (WebCore::JSTestCallTracerPrototype::JSTestCallTracerPrototype):
1401         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1402         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::JSTestClassWithJSBuiltinConstructorPrototype):
1403         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1404         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
1405         (WebCore::JSTestDOMJITConstructor::prototypeForStructure):
1406         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1407         (WebCore::JSTestEnabledBySettingPrototype::JSTestEnabledBySettingPrototype):
1408         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1409         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype):
1410         (WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
1411         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1412         (WebCore::JSTestEventTargetPrototype::JSTestEventTargetPrototype):
1413         (WebCore::JSTestEventTargetConstructor::prototypeForStructure):
1414         * bindings/scripts/test/JS/JSTestException.cpp:
1415         (WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype):
1416         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1417         (WebCore::JSTestGenerateIsReachablePrototype::JSTestGenerateIsReachablePrototype):
1418         * bindings/scripts/test/JS/JSTestGlobalObject.h:
1419         (WebCore::JSTestGlobalObjectPrototype::JSTestGlobalObjectPrototype):
1420         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1421         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::JSTestIndexedSetterNoIdentifierPrototype):
1422         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1423         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::JSTestIndexedSetterThrowingExceptionPrototype):
1424         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1425         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::JSTestIndexedSetterWithIdentifierPrototype):
1426         * bindings/scripts/test/JS/JSTestInterface.cpp:
1427         (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
1428         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1429         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
1430         * bindings/scripts/test/JS/JSTestIterable.cpp:
1431         (WebCore::JSTestIterablePrototype::JSTestIterablePrototype):
1432         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1433         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype):
1434         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1435         (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
1436         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1437         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::JSTestNamedAndIndexedSetterNoIdentifierPrototype):
1438         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1439         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::JSTestNamedAndIndexedSetterThrowingExceptionPrototype):
1440         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1441         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::JSTestNamedAndIndexedSetterWithIdentifierPrototype):
1442         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1443         (WebCore::JSTestNamedConstructorPrototype::JSTestNamedConstructorPrototype):
1444         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1445         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::JSTestNamedDeleterNoIdentifierPrototype):
1446         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1447         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::JSTestNamedDeleterThrowingExceptionPrototype):
1448         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1449         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::JSTestNamedDeleterWithIdentifierPrototype):
1450         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1451         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::JSTestNamedDeleterWithIndexedGetterPrototype):
1452         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1453         (WebCore::JSTestNamedGetterCallWithPrototype::JSTestNamedGetterCallWithPrototype):
1454         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1455         (WebCore::JSTestNamedGetterNoIdentifierPrototype::JSTestNamedGetterNoIdentifierPrototype):
1456         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1457         (WebCore::JSTestNamedGetterWithIdentifierPrototype::JSTestNamedGetterWithIdentifierPrototype):
1458         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1459         (WebCore::JSTestNamedSetterNoIdentifierPrototype::JSTestNamedSetterNoIdentifierPrototype):
1460         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1461         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::JSTestNamedSetterThrowingExceptionPrototype):
1462         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1463         (WebCore::JSTestNamedSetterWithIdentifierPrototype::JSTestNamedSetterWithIdentifierPrototype):
1464         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1465         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::JSTestNamedSetterWithIndexedGetterPrototype):
1466         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1467         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::JSTestNamedSetterWithIndexedGetterAndSetterPrototype):
1468         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1469         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::JSTestNamedSetterWithOverrideBuiltinsPrototype):
1470         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1471         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::JSTestNamedSetterWithUnforgablePropertiesPrototype):
1472         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1473         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype):
1474         * bindings/scripts/test/JS/JSTestNode.cpp:
1475         (WebCore::JSTestNodePrototype::JSTestNodePrototype):
1476         (WebCore::JSTestNodeConstructor::prototypeForStructure):
1477         * bindings/scripts/test/JS/JSTestObj.cpp:
1478         (WebCore::JSTestObjPrototype::JSTestObjPrototype):
1479         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1480         (WebCore::JSTestOverloadedConstructorsPrototype::JSTestOverloadedConstructorsPrototype):
1481         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1482         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::JSTestOverloadedConstructorsWithSequencePrototype):
1483         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1484         (WebCore::JSTestOverrideBuiltinsPrototype::JSTestOverrideBuiltinsPrototype):
1485         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1486         (WebCore::JSTestPluginInterfacePrototype::JSTestPluginInterfacePrototype):
1487         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1488         (WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype):
1489         (WebCore::JSTestPromiseRejectionEventConstructor::prototypeForStructure):
1490         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1491         (WebCore::JSTestSerializationPrototype::JSTestSerializationPrototype):
1492         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1493         (WebCore::JSTestSerializationIndirectInheritancePrototype::JSTestSerializationIndirectInheritancePrototype):
1494         (WebCore::JSTestSerializationIndirectInheritanceConstructor::prototypeForStructure):
1495         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1496         (WebCore::JSTestSerializationInheritPrototype::JSTestSerializationInheritPrototype):
1497         (WebCore::JSTestSerializationInheritConstructor::prototypeForStructure):
1498         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1499         (WebCore::JSTestSerializationInheritFinalPrototype::JSTestSerializationInheritFinalPrototype):
1500         (WebCore::JSTestSerializationInheritFinalConstructor::prototypeForStructure):
1501         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1502         (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
1503         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1504         (WebCore::JSTestStringifierPrototype::JSTestStringifierPrototype):
1505         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1506         (WebCore::JSTestStringifierAnonymousOperationPrototype::JSTestStringifierAnonymousOperationPrototype):
1507         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1508         (WebCore::JSTestStringifierNamedOperationPrototype::JSTestStringifierNamedOperationPrototype):
1509         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1510         (WebCore::JSTestStringifierOperationImplementedAsPrototype::JSTestStringifierOperationImplementedAsPrototype):
1511         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1512         (WebCore::JSTestStringifierOperationNamedToStringPrototype::JSTestStringifierOperationNamedToStringPrototype):
1513         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1514         (WebCore::JSTestStringifierReadOnlyAttributePrototype::JSTestStringifierReadOnlyAttributePrototype):
1515         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1516         (WebCore::JSTestStringifierReadWriteAttributePrototype::JSTestStringifierReadWriteAttributePrototype):
1517         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1518         (WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype):
1519
1520 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
1521
1522         WEBCORE_EXPORT shouldn't be on the class and its methods
1523         https://bugs.webkit.org/show_bug.cgi?id=197681
1524
1525         Reviewed by Simon Fraser.
1526
1527         Remove WEBCORE_EXPORT from the methods.
1528
1529         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1530         * page/scrolling/ScrollingTreeScrollingNode.h:
1531
1532 2019-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1533
1534         [iOS] Add a quirk to synthesize mouse events when modifying the selection
1535         https://bugs.webkit.org/show_bug.cgi?id=197683
1536         <rdar://problem/48003980>
1537
1538         Reviewed by Tim Horton.
1539
1540         See WebKit ChangeLog for more details.
1541
1542         Test: editing/selection/ios/dispatch-mouse-events-when-modifying-selection-quirk.html
1543
1544         * page/EventHandler.cpp:
1545         (WebCore::EventHandler::handleMousePressEvent):
1546         (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const):
1547
1548         Add some platform hooks to prevent mousemove events from updating the selection on iOS.
1549
1550         (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const):
1551
1552         Add some platform hooks to prevent drag and drop from kicking in when sending synthetic mousemove events to the
1553         page on iOS (drag and drop is instead triggered by EventHandler::tryToBeginDragAtPoint).
1554
1555         (WebCore::EventHandler::updateSelectionForMouseDrag):
1556         * page/EventHandler.h:
1557         * page/Quirks.cpp:
1558         (WebCore::Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection const):
1559         * page/Quirks.h:
1560
1561         Add the new site-specific quirk.
1562
1563         * page/Settings.yaml:
1564         * page/ios/EventHandlerIOS.mm:
1565         (WebCore::EventHandler::tryToBeginDragAtPoint):
1566         (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const):
1567         (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const):
1568         * testing/InternalSettings.cpp:
1569         (WebCore::InternalSettings::Backup::Backup):
1570         (WebCore::InternalSettings::Backup::restoreTo):
1571         (WebCore::InternalSettings::setShouldDispatchSyntheticMouseEventsWhenModifyingSelection):
1572         * testing/InternalSettings.h:
1573         * testing/InternalSettings.idl:
1574
1575         Add an internal settings hook to opt into this quirk, for use in layout tests.
1576
1577 2019-05-08  Simon Fraser  <simon.fraser@apple.com>
1578
1579         Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
1580         https://bugs.webkit.org/show_bug.cgi?id=197561
1581         <rdar://problem/50445998>
1582
1583         Reviewed by Antti Koivisto.
1584
1585         This change introduces the concept of layers that share backing store for compositing. A layer
1586         which is sharing its backing store first paints itself, and then some set of layers which come
1587         later in paint order in the same stacking context. This reduces the composited layer count in
1588         some overflow scrolling scenarios, thereby also simplifying the scrolling tree.
1589         
1590         A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At
1591         paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the
1592         painting root so that positioning and clipping just work.
1593         
1594         Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements().
1595         We track the last layer which was composited in paint order as a shared candidate. If a later layer
1596         would composite for overlap (and no other reasons), then we allow it to share with the candidate
1597         if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers
1598         in the same stacking context.
1599         
1600         isComposited() returns false for sharing layers, but they are like composited layers in that
1601         they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them,
1602         and repaints in shared layers have to be directed to their shared layer, hence
1603         changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint().
1604         
1605         The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that
1606         all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use
1607         TemporaryClipRects in that case.
1608
1609         Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html
1610                compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html
1611                compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
1612                compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html
1613                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html
1614                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html
1615                compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html
1616                compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html
1617                compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html
1618                compositing/shared-backing/overflow-scroll/shared-layer-clipping.html
1619                compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html
1620                compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html
1621                compositing/shared-backing/overflow-scroll/shared-layer-repaint.html
1622                compositing/shared-backing/partial-compositing-update.html
1623                compositing/shared-backing/partial-compositing-update2.html
1624                compositing/shared-backing/remove-sharing-layer.html
1625                compositing/shared-backing/sharing-cached-clip-rects.html
1626
1627         * rendering/RenderLayer.cpp:
1628         (WebCore::RenderLayer::~RenderLayer):
1629         (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const):
1630         (WebCore::RenderLayer::setBackingProviderLayer):
1631         (WebCore::RenderLayer::disconnectFromBackingProviderLayer):
1632         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
1633         (WebCore::RenderLayer::clippingRootForPainting const):
1634         (WebCore::RenderLayer::clipToRect):
1635         (WebCore::RenderLayer::paintLayer):
1636         (WebCore::RenderLayer::updateClipRects):
1637         (WebCore::RenderLayer::clipCrossesPaintingBoundary const):
1638         (WebCore::RenderLayer::calculateClipRects const):
1639         (WebCore::outputPaintOrderTreeLegend):
1640         (WebCore::outputPaintOrderTreeRecursive):
1641         (WebCore::inContainingBlockChain): Deleted.
1642         * rendering/RenderLayer.h:
1643         * rendering/RenderLayerBacking.cpp:
1644         (WebCore::RenderLayerBacking::willBeDestroyed):
1645         (WebCore::clearBackingSharingLayerProviders):
1646         (WebCore::RenderLayerBacking::setBackingSharingLayers):
1647         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
1648         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
1649         (WebCore::RenderLayerBacking::updateCompositedBounds):
1650         (WebCore::RenderLayerBacking::updateDrawsContent):
1651         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
1652         (WebCore::RenderLayerBacking::paintIntoLayer):
1653         (WebCore::RenderLayerBacking::paintContents):
1654         * rendering/RenderLayerBacking.h:
1655         * rendering/RenderLayerCompositor.cpp:
1656         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
1657         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren):
1658         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree):
1659         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate):
1660         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1661         (WebCore::backingProviderLayerCanIncludeLayer):
1662         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1663         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1664         (WebCore::RenderLayerCompositor::updateBacking):
1665         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
1666         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
1667         * rendering/RenderLayerCompositor.h:
1668         * rendering/RenderTreeAsText.cpp:
1669
1670 2019-05-08  Brent Fulgham  <bfulgham@apple.com>
1671
1672         Correct delayed load event handling
1673         https://bugs.webkit.org/show_bug.cgi?id=197679
1674         <rdar://problem/50423334>
1675
1676         Reviewed by Alex Christensen.
1677
1678         We need to properly account for the fact that JavaScript might run
1679         while performing loads.
1680
1681         * dom/Document.cpp:
1682         (WebCore::Document::loadEventDelayTimerFired):
1683
1684 2019-05-08  Philippe Normand  <pnormand@igalia.com>
1685
1686         REGRESSION(r243197): [GStreamer] Error playing redirected streams
1687         https://bugs.webkit.org/show_bug.cgi?id=197410
1688
1689         Reviewed by Carlos Garcia Campos.
1690
1691         Revert the change introduced in r243197 that was checking the
1692         redirected URI instead of the original URI. Non-main URIs should
1693         be ignored only when they are HLS (or similar) fragments.
1694
1695         Test http/tests/security/canvas-remote-read-remote-video-hls.html still passes.
1696
1697         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1698         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1699
1700 2019-05-08  Rob Buis  <rbuis@igalia.com>
1701
1702         Link prefetch not useful for top-level navigation
1703         https://bugs.webkit.org/show_bug.cgi?id=195623
1704
1705         Reviewed by Youenn Fablet.
1706
1707         Cache cross-domain top-level prefetches in a dedicated cache and not in the
1708         memory cache.
1709
1710         Tests: http/tests/cache/link-prefetch-main-resource-iframe.html
1711                http/tests/cache/link-prefetch-main-resource.html
1712                http/tests/contentextensions/prefetch-blocked.html
1713
1714         * loader/LinkLoader.cpp:
1715         (WebCore::LinkLoader::prefetchIfNeeded):
1716         * loader/ResourceLoadInfo.cpp:
1717         (WebCore::toResourceType):
1718
1719 2019-05-07  Don Olmstead  <don.olmstead@sony.com>
1720
1721         Fix !HAVE(ACCESSIBILITY) build
1722         https://bugs.webkit.org/show_bug.cgi?id=197680
1723
1724         Reviewed by Fujii Hironori.
1725
1726         * accessibility/AXObjectCache.h:
1727         (WebCore::AXObjectCache::focusedUIElementForPage):
1728         Update declaration for !HAVE(ACCESSIBILITY)
1729         * accessibility/AccessibilityObject.h:
1730         Add wrapper implementation for !HAVE(ACCESSIBILITY)
1731         * accessibility/AccessibilityProgressIndicator.cpp:
1732         (WebCore::AccessibilityProgressIndicator::roleValue const):
1733         Add ENABLE(METER_ELEMENT) guard.
1734
1735 2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
1736
1737         Unreviewed, rolling out r245038.
1738
1739         Breaks internal builds.
1740
1741         Reverted changeset:
1742
1743         "Add SPI to set a list of hosts to which to send custom header
1744         fields cross-origin"
1745         https://bugs.webkit.org/show_bug.cgi?id=197397
1746         https://trac.webkit.org/changeset/245038
1747
1748 2019-05-07  Jiewen Tan  <jiewen_tan@apple.com>
1749
1750         [WebAuthN] A new request should always suppress the pending request if any
1751         https://bugs.webkit.org/show_bug.cgi?id=191517
1752         <rdar://problem/46888222>
1753
1754         Reviewed by Brent Fulgham.
1755
1756         Blocking new requests from the same page when there is a pending request could DoS the
1757         WebAuthN API in the period between [the page is refreshed, the pending request is
1758         hanedled/timeout]. Therefore, the policy will be to always cancel any pending requests
1759         whenever a new request is made. This will enforce the policy of handling only one
1760         request at a time.
1761
1762         Covered by new tests in existing files.
1763
1764         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
1765         (WebCore::AuthenticatorCoordinatorClient::requestReply):
1766         (WebCore::AuthenticatorCoordinatorClient::setRequestCompletionHandler):
1767         (WebCore::AuthenticatorCoordinatorClient::addQueryCompletionHandler):
1768         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
1769
1770 2019-05-07  Eric Carlson  <eric.carlson@apple.com>
1771
1772         Define media buffering policy
1773         https://bugs.webkit.org/show_bug.cgi?id=196979
1774         <rdar://problem/28383861>
1775
1776         Reviewed by Jer Noble.
1777
1778         Test: MediaBufferingPolicy API test.
1779
1780         * html/HTMLMediaElement.cpp:
1781         (WebCore::HTMLMediaElement::HTMLMediaElement):
1782         (WebCore::HTMLMediaElement::suspend):
1783         (WebCore::HTMLMediaElement::resume):
1784         (WebCore::HTMLMediaElement::createMediaPlayer):
1785         (WebCore::HTMLMediaElement::setBufferingPolicy):
1786         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
1787         (WebCore::HTMLMediaElement::bufferingPolicy const):
1788         (WebCore::HTMLMediaElement::setShouldBufferData): Deleted.
1789         * html/HTMLMediaElement.h:
1790         (WebCore::HTMLMediaElement::shouldBufferData const): Deleted.
1791         * html/MediaElementSession.cpp:
1792         (WebCore::MediaElementSession::updateClientDataBuffering):
1793         (WebCore::MediaElementSession::preferredBufferingPolicy const):
1794         (WebCore::MediaElementSession::dataBufferingPermitted const): Deleted.
1795         * html/MediaElementSession.h:
1796         * platform/graphics/MediaPlayer.cpp:
1797         (WebCore::MediaPlayer::setBufferingPolicy):
1798         (WebCore::convertEnumerationToString):
1799         (WebCore::MediaPlayer::setShouldBufferData): Deleted.
1800         * platform/graphics/MediaPlayer.h:
1801         * platform/graphics/MediaPlayerEnums.h:
1802         (WTF::LogArgument<WebCore::MediaPlayerEnums::BufferingPolicy>::toString):
1803         * platform/graphics/MediaPlayerPrivate.h:
1804         (WebCore::MediaPlayerPrivateInterface::setBufferingPolicy):
1805         (WebCore::MediaPlayerPrivateInterface::setShouldBufferData): Deleted.
1806         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1807         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1808         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
1809         (WebCore::MediaPlayerPrivateAVFoundationObjC::setBufferingPolicy):
1810         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): Deleted.
1811         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1812         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1813         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setBufferingPolicy):
1814         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Deleted.
1815         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setShouldBufferData): Deleted.
1816         * testing/Internals.cpp:
1817         (WebCore::Internals::elementShouldBufferData):
1818         (WebCore::Internals::elementBufferingPolicy):
1819         * testing/Internals.h:
1820         * testing/Internals.idl:
1821
1822 2019-05-07  Alex Christensen  <achristensen@webkit.org>
1823
1824         Add SPI to set a list of hosts to which to send custom header fields cross-origin
1825         https://bugs.webkit.org/show_bug.cgi?id=197397
1826
1827         Reviewed by Geoff Garen.
1828
1829         In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
1830         We need the ability to specify what origins to send these headers to even if they are not first party requests.
1831         We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
1832         indicating that the headers are to be sent to all subdomains.
1833
1834         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
1835         I also added some new API tests for the new behavior.
1836
1837         * Sources.txt:
1838         * WebCore.xcodeproj/project.pbxproj:
1839         * loader/CustomHeaderFields.cpp: Added.
1840         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
1841         * loader/CustomHeaderFields.h: Added.
1842         (WebCore::CustomHeaderFields::encode const):
1843         (WebCore::CustomHeaderFields::decode):
1844         * loader/DocumentLoader.cpp:
1845         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
1846         * loader/DocumentLoader.h:
1847         (WebCore::DocumentLoader::setCustomHeaderFields):
1848         (WebCore::DocumentLoader::customHeaderFields const):
1849         (WebCore::DocumentLoader::customHeaderFields): Deleted.
1850         * loader/cache/CachedResourceLoader.cpp:
1851         (WebCore::CachedResourceLoader::requestResource):
1852
1853 2019-05-07  Andy Estes  <aestes@apple.com>
1854
1855         run-bindings-tests should test global scope constructor generation
1856         https://bugs.webkit.org/show_bug.cgi?id=197669
1857
1858         Reviewed by Alex Christensen.
1859
1860         For interfaces that are exposed on a global object, preprocess-idls.pl generates a partial
1861         interface for the global object defining attributes for the interfaces' constructors. Most
1862         interfaces don't specify a global object, so preprocess-idls.pl defaults to DOMWindow.
1863         Since there is no DOMWindow.idl test case, we never generate the code for exposed interface
1864         constructors when running bindings tests. This means that we can't test changes to how these
1865         constructors are generated.
1866
1867         To fix this, teach preprocess-idls.pl to treat 'TestGlobalObject' as the default global
1868         object when running bindings tests. This means that all exposed interface test cases will
1869         generate their constructors as part of JSTestGlobalObject (unless otherwise specified
1870         by the 'Exposed' extended attribute).
1871
1872         * bindings/scripts/preprocess-idls.pl:
1873         Added --testGlobalContextName and --testGlobalScopeConstructorsFile arguments for use by
1874         run-bindings-tests.
1875
1876         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1877         Updated expected results.
1878
1879 2019-05-07  Youenn Fablet  <youenn@apple.com>
1880
1881         Video stream freeze on front camera orientation changing
1882         https://bugs.webkit.org/show_bug.cgi?id=197227
1883         <rdar://problem/50175498>
1884
1885         Reviewed by Eric Carlson.
1886
1887         Use m_currentRotationSessionAngle instead of m_currentRotation to create or not a new rotation session.
1888         Covered by updated test.
1889
1890         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
1891         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
1892         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
1893
1894 2019-05-07  Youenn Fablet  <youenn@apple.com>
1895
1896         getUserMedia framerate unusable under low light in iOS 12.2
1897         https://bugs.webkit.org/show_bug.cgi?id=196214
1898         <rdar://problem/49232193>
1899
1900         Reviewed by Geoffrey Garen.
1901
1902         When setting the frame rate, set it to the exact value instead of a range.
1903         Otherwise, the capture device might use the lowest frame rate according the light conditions
1904         for best picture quality which is not what is expected by most web pages.
1905
1906         Move frame rate range computation to closer where actually used.
1907         Since frame rate matching is fuzzy, add some checks in case the expected frame rate is slightly out of min/max range.
1908
1909         Manually tested on a real device.
1910
1911         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1912         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
1913
1914 2019-05-07  Robin Morisset  <rmorisset@apple.com>
1915
1916         All prototypes should call didBecomePrototype()
1917         https://bugs.webkit.org/show_bug.cgi?id=196315
1918
1919         Reviewed by Saam Barati.
1920
1921         It was found by existing tests, with the new assert in JSC::Structure
1922
1923         * bindings/js/JSWindowProxy.cpp:
1924         (WebCore::JSWindowProxy::setWindow):
1925         * bindings/scripts/CodeGeneratorJS.pm:
1926         (GeneratePrototypeDeclaration):
1927         (GenerateConstructorHelperMethods):
1928
1929 2019-05-07  John Wilander  <wilander@apple.com>
1930
1931         Storage Access API: Make two changes requested by developers and complete refactoring and cleanup
1932         https://bugs.webkit.org/show_bug.cgi?id=197648
1933         <rdar://problem/50527493>
1934
1935         Reviewed by Chris Dumez.
1936
1937         Developers have requested two minor changes to the Storage Access API:
1938         - Only consume the user gesture when the user explicitly denies access.
1939         - Make document.hasStorageAccess() return true instead of false when the feature is off.
1940
1941         In addition to this, we have refactoring and cleanup to do. Namely:
1942         - Make use of WebCore::RegistrableDomain all the way.
1943         - Remove dead code in WebKit::NetworkProcess since the calls now go through NetworkConnectionToWebProcess.
1944         - Introduce boolean enums for state handling.
1945         - Break out the Storage Access API functionality into a supplement of WebCore::Document.
1946
1947         Reviewed by Chris Dumez.
1948
1949         Tests: http/tests/storageAccess/deny-with-prompt-does-not-preserve-gesture.html
1950                http/tests/storageAccess/deny-without-prompt-preserves-gesture.html
1951                http/tests/storageAccess/grant-with-prompt-preserves-gesture.html
1952                http/tests/storageAccess/has-storage-access-true-if-feature-off.html
1953
1954         * DerivedSources-input.xcfilelist:
1955         * DerivedSources-output.xcfilelist:
1956         * DerivedSources.make:
1957         * Headers.cmake:
1958         * Sources.txt:
1959         * WebCore.xcodeproj/project.pbxproj:
1960         * dom/Document.cpp:
1961         (WebCore::Document::hasStorageAccess): Deleted.
1962         (WebCore::Document::requestStorageAccess): Deleted.
1963         (WebCore::Document::enableTemporaryTimeUserGesture): Deleted.
1964         (WebCore::Document::consumeTemporaryTimeUserGesture): Deleted.
1965         (WebCore::Document::hasFrameSpecificStorageAccess const): Deleted.
1966         (WebCore::Document::setHasFrameSpecificStorageAccess): Deleted.
1967         * dom/Document.h:
1968         (WebCore::Document::setUserGrantsStorageAccessOverride): Deleted.
1969             All of this has been moved to the supplement WebCore::DocumentStorageAccess.
1970         * dom/Document.idl:
1971             The Storage Access API has been moved to DocumentStorageAccess.idl.
1972         * dom/DocumentStorageAccess.cpp: Added.
1973         (WebCore::DocumentStorageAccess::from):
1974         (WebCore::DocumentStorageAccess::supplementName):
1975         (WebCore::DocumentStorageAccess::hasStorageAccess):
1976         (WebCore::DocumentStorageAccess::requestStorageAccess):
1977         (WebCore::DocumentStorageAccess::enableTemporaryTimeUserGesture):
1978         (WebCore::DocumentStorageAccess::consumeTemporaryTimeUserGesture):
1979         (WebCore::DocumentStorageAccess::hasFrameSpecificStorageAccess const):
1980         (WebCore::DocumentStorageAccess::setHasFrameSpecificStorageAccess):
1981         * dom/DocumentStorageAccess.h: Added.
1982         * dom/DocumentStorageAccess.idl: Added.
1983         * page/ChromeClient.h:
1984         * testing/Internals.cpp:
1985         (WebCore::Internals::setUserGrantsStorageAccess): Deleted.
1986             This was dead code.
1987         * testing/Internals.h:
1988         * testing/Internals.idl:
1989
1990 2019-05-07  Antoine Quint  <graouts@apple.com>
1991
1992         [Pointer Events] isPrimary property of pointercancel events should match previous events for that pointer
1993         https://bugs.webkit.org/show_bug.cgi?id=197665
1994
1995         Reviewed by Dean Jackson.
1996
1997         The test at web-platform-tests/pointerevents/pointerevent_pointercancel_touch.html would fail early because one of the first assertions
1998         would check that isPrimary for a pointercancel event would match the isPrimary property of the previous pointer event dispatched for that
1999         pointer id. This prevented many further assertions from passing and also was the cause of flakiness for the next test since this test was
2000         ended early and the state of touches created using UIScriptController were not in a clean state.
2001
2002         We now track the isPrimary state for a given pointer using the CapturingData and use that value when dispatching a pointercancel event.
2003
2004         * dom/PointerEvent.cpp:
2005         (WebCore::PointerEvent::create):
2006         (WebCore::PointerEvent::PointerEvent):
2007         * dom/PointerEvent.h:
2008         * page/PointerCaptureController.cpp:
2009         (WebCore::PointerCaptureController::pointerEventWasDispatched):
2010         (WebCore::PointerCaptureController::cancelPointer):
2011         * page/PointerCaptureController.h:
2012
2013 2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
2014
2015         Unreviewed, rolling out r244900.
2016
2017         Caused media/track/track-cue-missing.html to fail on debug
2018         queues
2019
2020         Reverted changeset:
2021
2022         "Add logging for RenderLayer clip rects"
2023         https://bugs.webkit.org/show_bug.cgi?id=197547
2024         https://trac.webkit.org/changeset/244900
2025
2026 2019-05-07  Antti Koivisto  <antti@apple.com>
2027
2028         <body> with overflow:hidden CSS is scrollable on iOS
2029         https://bugs.webkit.org/show_bug.cgi?id=153852
2030         <rdar://problem/38715356>
2031
2032         Reviewed by Antoine Quint.
2033
2034         Tests: fast/scrolling/ios/body-overflow-hidden-frame.html
2035                fast/scrolling/ios/body-overflow-hidden.html
2036
2037         * page/scrolling/ScrollingTreeScrollingNode.h:
2038
2039 2019-05-07  Antoine Quint  <graouts@apple.com>
2040
2041         Mouse event simulation should be limited to the graphing calculator on Desmos.com
2042         https://bugs.webkit.org/show_bug.cgi?id=197652
2043         <rdar://problem/47068176>
2044
2045         Reviewed by Antti Koivisto.
2046
2047         * page/Quirks.cpp:
2048         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2049
2050 2019-05-06  James Savage  <james.savage@apple.com>
2051
2052         Improve coordination for creating UIWindow instances.
2053         https://bugs.webkit.org/show_bug.cgi?id=197578.
2054         <rdar://problem/50456965>.
2055
2056         Reviewed by Wenson Hsieh.
2057
2058         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2059         (makeWindowFromView): Pull out window creation.
2060         (VideoFullscreenInterfaceAVKit::doSetup): Call new helper function.
2061
2062 2019-05-06  Tim Horton  <timothy_horton@apple.com>
2063
2064         _overrideViewportWithArguments does not work when called before loading
2065         https://bugs.webkit.org/show_bug.cgi?id=197638
2066         <rdar://problem/50505111>
2067
2068         Reviewed by Wenson Hsieh.
2069
2070         * dom/Document.cpp:
2071         (WebCore::Document::viewportArguments const):
2072         (WebCore::Document::updateViewportArguments):
2073         (WebCore::Document::setOverrideViewportArguments): Deleted.
2074         * dom/Document.h:
2075         (WebCore::Document::viewportArguments const): Deleted.
2076         * page/Page.cpp:
2077         (WebCore::Page::setOverrideViewportArguments):
2078         * page/Page.h:
2079         (WebCore::Page::overrideViewportArguments const):
2080         * page/ViewportConfiguration.cpp:
2081         (WebCore::ViewportConfiguration::setViewportArguments):
2082         Move overrideViewportArguments to Page, since it is view-global in the API.
2083
2084 2019-05-06  Chris Dumez  <cdumez@apple.com>
2085
2086         Add assertions to JSLazyEventListener to help catch the cause of a crash
2087         https://bugs.webkit.org/show_bug.cgi?id=197617
2088
2089         Reviewed by Alexey Proskuryakov.
2090
2091         Add assertions to JSLazyEventListener to help catch the cause of <rdar://problem/24314027>.
2092
2093         * bindings/js/JSLazyEventListener.cpp:
2094         (WebCore::JSLazyEventListener::checkValidityForEventTarget):
2095         * bindings/js/JSLazyEventListener.h:
2096         * dom/EventListener.h:
2097         (WebCore::EventListener::checkValidityForEventTarget):
2098         * dom/EventTarget.cpp:
2099         (WebCore::EventTarget::addEventListener):
2100         (WebCore::EventTarget::setAttributeEventListener):
2101         (WebCore::EventTarget::innerInvokeEventListeners):
2102
2103 2019-05-04  Per Arne Vollan  <pvollan@apple.com>
2104
2105         -[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
2106         https://bugs.webkit.org/show_bug.cgi?id=197510
2107         <rdar://problem/50372338>
2108
2109         Reviewed by Alex Christensen.
2110
2111         This patch implements deletion of non persistent credentials for a set of origins. In order for this to work, fetching
2112         credentials from the credential storage needs to return a set of SecurityOriginData objects, instead of a set of origin
2113         strings. This is implemented by iterating over all the elements in the credential map, and creating a SecurityOriginData
2114         object for each credential based on the protection space.
2115
2116         API test: WKWebsiteDataStore.RemoveNonPersistentCredentials
2117
2118         * platform/network/CredentialStorage.cpp:
2119         (WebCore::CredentialStorage::removeCredentialsWithOrigin):
2120         (WebCore::CredentialStorage::originsWithCredentials const):
2121         * platform/network/CredentialStorage.h:
2122         (WebCore::CredentialStorage::originsWithCredentials const): Deleted.
2123
2124 2019-05-06  Keith Rollin  <krollin@apple.com>
2125
2126         Temporarily disable generate-xcfilelists
2127         https://bugs.webkit.org/show_bug.cgi?id=197619
2128         <rdar://problem/50507392>
2129
2130         Reviewed by Alex Christensen.
2131
2132         We need to perform a significant update to the generate-xcfilelist
2133         scripts. This work involves coordinated work with another facility. If
2134         the work does not occur in tandem, the build will be broken. To avoid
2135         this, disable the invoking of the scripts during the transition. The
2136         checking will be restored once the new scripts are in place.
2137
2138         No new tests -- no change in user-visible functionality.
2139
2140         * Scripts/check-xcfilelists.sh:
2141
2142 2019-05-06  Andres Gonzalez  <andresg_22@apple.com>
2143
2144         Hitpoint for link which spans two lines in web content is incorrect
2145         https://bugs.webkit.org/show_bug.cgi?id=197511
2146         <rdar://problem/49971483>
2147
2148         Reviewed by Chris Fleizach.
2149
2150         - Special case for links to return first char location as clickPoint instead of middle point of bounding rect.
2151         - Modified iOS ActivationPoint to use clickPoint. This way all code paths go through the same function.
2152         - Made boundsForRects to return content coordinates in all platforms. Adjusted all callers, directly or indirectly, appropriately.
2153
2154         Tests: accessibility/ios-simulator/links-activation.html
2155                accessibility/links-activation.html
2156
2157         * accessibility/AccessibilityRenderObject.cpp:
2158         (WebCore::AccessibilityRenderObject::clickPoint):
2159         (WebCore::AccessibilityRenderObject::boundsForRects):
2160         (WebCore::AccessibilityRenderObject::boundsForRects const): Deleted.
2161         * accessibility/AccessibilityRenderObject.h:
2162         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2163         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
2164         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2165         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2166
2167 2019-05-06  Jer Noble  <jer.noble@apple.com>
2168
2169         Adopt AVStreamDataParser.audiovisualMIMETypes
2170         https://bugs.webkit.org/show_bug.cgi?id=197581
2171         <rdar://problem/50458981>
2172
2173         Reviewed by Eric Carlson.
2174
2175         Add a new singleton class, AVStreamDataParserMIMETypeCache, and rename AVFoundationMIMETypeCache to the more precise
2176         AVAssetMIMETypeCache.  Update all the old AVFoundationMIMETypeCache with the new name.
2177
2178         * SourcesCocoa.txt:
2179         * WebCore.xcodeproj/project.pbxproj:
2180         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h.
2181         (WebCore::AVAssetMIMETypeCache::setCacheMIMETypesCallback):
2182         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm.
2183         (WebCore::AVAssetMIMETypeCache::singleton):
2184         (WebCore::AVAssetMIMETypeCache::setSupportedTypes):
2185         (WebCore::AVAssetMIMETypeCache::types):
2186         (WebCore::AVAssetMIMETypeCache::supportsContentType):
2187         (WebCore::AVAssetMIMETypeCache::canDecodeType):
2188         (WebCore::AVAssetMIMETypeCache::isAvailable const):
2189         (WebCore::AVAssetMIMETypeCache::loadMIMETypes):
2190         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h: Added.
2191         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: Added.
2192         (WebCore::AVStreamDataParserMIMETypeCache::singleton):
2193         (WebCore::AVStreamDataParserMIMETypeCache::types):
2194         (WebCore::AVStreamDataParserMIMETypeCache::supportsContentType):
2195         (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType):
2196         (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const):
2197         (WebCore::AVStreamDataParserMIMETypeCache::loadMIMETypes):
2198         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2199         (WebCore::ImageDecoderAVFObjC::create):
2200         (WebCore::ImageDecoderAVFObjC::supportsMediaType):
2201         (WebCore::ImageDecoderAVFObjC::supportsContentType):
2202         (WebCore::ImageDecoderAVFObjC::canDecodeType):
2203         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2204         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
2205         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
2206         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
2207         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
2208         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2209         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
2210         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes):
2211         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
2212
2213 2019-05-06  Youenn Fablet  <youenn@apple.com>
2214
2215         WebAudio Node JS wrappers should not be collected if events can be fired
2216         https://bugs.webkit.org/show_bug.cgi?id=197533
2217
2218         Reviewed by Jer Noble.
2219
2220         Before the patch, some web audio nodes could fire event listeners, but were not protected from GC.
2221         Use CustomIsReachable to ensure theses nodes can be collected if:
2222         - their AudioContext is stopped (typically due to document being navigated away).
2223         - their AudioContext is closed.
2224         - nodes do not have event listeners.
2225
2226         Covered by WPT mediacapture-streams/MediaStreamTrack-MediaElement-disabled-audio-is-silence.https.html and
2227         WPT webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html
2228         and web audio WebRTC tests.
2229         Specific newly added test: webaudio/webaudio-gc.html
2230
2231         * Modules/webaudio/AudioContext.h:
2232         (WebCore::AudioContext::isClosed const):
2233         * Modules/webaudio/AudioNode.idl:
2234         * Sources.txt:
2235         * WebCore.xcodeproj/project.pbxproj:
2236         * bindings/js/JSAudioNodeCustom.cpp: Added.
2237         (WebCore::JSAudioNodeOwner::isReachableFromOpaqueRoots):
2238
2239 2019-05-06  Daniel Bates  <dabates@apple.com>
2240
2241         Google Docs & Yahoo! Japan: Can’t compose characters with Chinese or Japanese keyboard
2242         https://bugs.webkit.org/show_bug.cgi?id=197474
2243         <rdar://problem/47219324>
2244
2245         Reviewed by Ryosuke Niwa.
2246
2247         Fix up some #if defs to compile more Mac code when building on iOS.
2248
2249         * dom/KeyboardEvent.cpp:
2250         (WebCore::KeyboardEvent::KeyboardEvent):
2251         * platform/PlatformKeyboardEvent.h:
2252         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2253
2254 2019-05-06  Chris Dumez  <cdumez@apple.com>
2255
2256         Add assertions to CachedFrame to help figure out crash in CachedFrame constructor
2257         https://bugs.webkit.org/show_bug.cgi?id=197621
2258
2259         Reviewed by Geoffrey Garen.
2260
2261         Add release assertions to try and figure out who is sometimes detaching the document from its
2262         frame while constructing CachedFrames for its descendants.
2263
2264         * dom/Document.cpp:
2265         (WebCore::Document::detachFromFrame):
2266         * dom/Document.h:
2267         (WebCore::Document::setMayBeDetachedFromFrame):
2268         * history/CachedFrame.cpp:
2269         (WebCore::CachedFrame::CachedFrame):
2270
2271 2019-05-06  Zan Dobersek  <zdobersek@igalia.com>
2272
2273         [GLib] WebCore::MainThreadSharedTimer should use the appropriate GSource priority, name
2274         https://bugs.webkit.org/show_bug.cgi?id=197606
2275
2276         Reviewed by Carlos Garcia Campos.
2277
2278         * platform/MainThreadSharedTimer.cpp:
2279         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
2280         Use the MainThreadSharedTimer GLib priority for this timer. The name is
2281         also adjusted accordingly.
2282
2283 2019-05-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2284
2285         fast/attachment/attachment-folder-icon.html is an Image Only failure on recent macOS builds
2286         https://bugs.webkit.org/show_bug.cgi?id=197593
2287         <rdar://problem/50379267>
2288
2289         Reviewed by Tim Horton.
2290
2291         On recent versions of macOS, -[NSWorkspace iconForFileType:] returns the generic document icon for
2292         "public.directory". Instead of using this UTI to generate attachment icons for "multipart/x-folder" and
2293         "application/vnd.apple.folder", we should instead be using "public.folder", which has a folder icon. This fixes
2294         the existing test fast/attachment/attachment-folder-icon.html, which currently results in an image diff on these
2295         builds of macOS.
2296
2297         * rendering/RenderThemeMac.mm:
2298         (WebCore::iconForAttachment):
2299
2300 2019-05-04  Alex Christensen  <achristensen@webkit.org>
2301
2302         Revert r244953 and r244954 because they broke internal builds.
2303         https://bugs.webkit.org/show_bug.cgi?id=197534
2304
2305         * platform/ios/PlatformPasteboardIOS.mm:
2306         (WebCore::PlatformPasteboard::changeCount const):
2307         (WebCore::PlatformPasteboard::write):
2308
2309 2019-05-04  Alex Christensen  <achristensen@webkit.org>
2310
2311         Merge the three UIKitSPI.h files into a single one in PAL
2312         https://bugs.webkit.org/show_bug.cgi?id=197534
2313
2314         Reviewed by Darin Adler.
2315
2316         * platform/ios/PlatformPasteboardIOS.mm:
2317         (WebCore::PlatformPasteboard::changeCount const):
2318         (WebCore::PlatformPasteboard::write):
2319
2320 2019-05-04  Youenn Fablet  <youenn@apple.com>
2321
2322         Convert some RealtimeOutgoingVideoSourceCocoa logging to ERROR_LOG
2323         https://bugs.webkit.org/show_bug.cgi?id=197549
2324
2325         Reviewed by Eric Carlson.
2326
2327         No change of behavior.
2328
2329         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
2330         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
2331
2332 2019-05-03  Simon Fraser  <simon.fraser@apple.com>
2333
2334         [macOS] Fix programmatic scrolling with async overflow scroll
2335         https://bugs.webkit.org/show_bug.cgi?id=197590
2336
2337         Reviewed by Sam Weinig.
2338         
2339         ScrollingTreeOverflowScrollingNodeMac needs to handle RequestedScrollPosition.
2340
2341         Tests: scrollingcoordinator/mac/programmatic-frame-scroll.html
2342                scrollingcoordinator/mac/programmatic-overflow-scroll.html
2343
2344         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2345         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
2346
2347 2019-05-03  Zalan Bujtas  <zalan@apple.com>
2348
2349         [iOS] outlook.live.com: Compose email frame not fully visible and not scrollable
2350         https://bugs.webkit.org/show_bug.cgi?id=197573
2351         <rdar://problem/48008441>
2352
2353         Reviewed by Wenson Hsieh.
2354
2355         The outlook mail view's flex column setup produces a somewhat unfortunate layout at certain viewport widths.
2356         This patch addresses the issue by ensuring that we never fall into that range.
2357
2358         * page/Quirks.cpp:
2359         (WebCore::Quirks::shouldIgnoreShrinkToFitContent const):
2360         (WebCore::Quirks::overriddenViewportLayoutWidth const):
2361         * page/Quirks.h:
2362
2363 2019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
2364
2365         [WebAuthN] A focused document should be required
2366         https://bugs.webkit.org/show_bug.cgi?id=197543
2367         <rdar://problem/50430989>
2368
2369         Reviewed by Brent Fulgham.
2370
2371         This patch adds a check to see if the invoking document is focused before
2372         calling into WebAuthN. This patch also removes some out-to-dated comments.
2373
2374         Test: http/wpt/webauthn/public-key-credential-unfocused-document.https.html
2375
2376         * Modules/credentialmanagement/CredentialsContainer.cpp:
2377         (WebCore::CredentialsContainer::get):
2378         (WebCore::CredentialsContainer::isCreate):
2379         * Modules/webauthn/AuthenticatorCoordinator.cpp:
2380         (WebCore::AuthenticatorCoordinator::create const):
2381         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
2382
2383 2019-05-03  Devin Rousso  <drousso@apple.com>
2384
2385         Web Inspector: DOM: rename "low power" to "display composited"
2386         https://bugs.webkit.org/show_bug.cgi?id=197296
2387
2388         Reviewed by Joseph Pecoraro.
2389
2390         Removed specific ChangeLog entries since it is almost entirely mechanical changes.
2391
2392         * inspector/agents/InspectorDOMAgent.h:
2393         * inspector/agents/InspectorDOMAgent.cpp:
2394
2395 2019-05-03  Daniel Bates  <dabates@apple.com>
2396
2397         Pass KeyboardEvent by reference in more places
2398         https://bugs.webkit.org/show_bug.cgi?id=197480
2399
2400         Reviewed by Wenson Hsieh.
2401
2402         * editing/Editor.cpp:
2403         (WebCore::Editor::handleKeyboardEvent):
2404         (WebCore::Editor::handleInputMethodKeydown):
2405         * loader/EmptyClients.cpp:
2406         * page/EditorClient.h:
2407
2408 2019-05-03  Chris Dumez  <cdumez@apple.com>
2409
2410         [iOS Sim Debug] ASSERTION FAILED The atomic string comes from an other thread! Layout Test imported/w3c/web-platform-tests/workers/WorkerNavigator_appName.htm is a flaky crash
2411         https://bugs.webkit.org/show_bug.cgi?id=197530
2412         <rdar://problem/50448285>
2413
2414         Reviewed by Geoffrey Garen.
2415
2416         The issue is that NavigatorBase::platform() was not thread safe but was called by both Navigator on
2417         the main thread and WorkerNavigator on worker threads.
2418
2419         No new tests, covered by existing tests.
2420
2421         * page/Navigator.cpp:
2422         (WebCore::Navigator::platform const):
2423         * page/Navigator.h:
2424
2425         * page/NavigatorBase.cpp:
2426         (WebCore::NavigatorBase::platform const):
2427         * page/NavigatorBase.h:
2428         Make NavigatorBase::platform() thread safe.
2429
2430         * platform/ios/Device.cpp:
2431         (WebCore::deviceName):
2432         * platform/ios/Device.h:
2433         Make WebCore::deviceName() thread safe.
2434
2435         * platform/ios/UserAgentIOS.mm:
2436         (WebCore::deviceNameForUserAgent):
2437         Cache value returned by WebCore::deviceName() for performance.
2438
2439 2019-05-03  Chris Dumez  <cdumez@apple.com>
2440
2441         Use WeakPtr for JSLazyEventListener::m_originalNode for safety
2442         https://bugs.webkit.org/show_bug.cgi?id=197576
2443         <rdar://problem/24314027>
2444
2445         Reviewed by Alex Christensen.
2446
2447         * bindings/js/JSLazyEventListener.cpp:
2448         (WebCore::JSLazyEventListener::JSLazyEventListener):
2449         (WebCore::JSLazyEventListener::create):
2450         * bindings/js/JSLazyEventListener.h:
2451
2452 2019-05-03  Eric Carlson  <eric.carlson@apple.com>
2453
2454         AVFoundation framework isn't always installed
2455         https://bugs.webkit.org/show_bug.cgi?id=197577
2456         <rdar://problem/50447841>
2457
2458         Reviewed by Jer Noble.
2459         
2460         Use PAL::isAVFoundationFrameworkAvailable() to check to see if AVFoundation is
2461         installed, not PAL::AVFoundationLibrary().
2462
2463         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
2464         (WebCore::AVFoundationMIMETypeCache::isAvailable const):
2465         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
2466         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2467         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
2468         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
2469         (WebCore::exernalDeviceDisplayNameForPlayer):
2470         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2471         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
2472         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2473         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
2474         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
2475         (WebCore::validateHEVCParameters):
2476         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2477         (WebCore::AVCaptureDeviceManager::isAvailable):
2478
2479 2019-05-03  Sihui Liu  <sihui_liu@apple.com>
2480
2481         Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
2482         https://bugs.webkit.org/show_bug.cgi?id=197390
2483         <rdar://problem/42685773>
2484
2485         Reviewed by Geoffrey Garen.
2486
2487         We have seen crashes about accessing database files after device is locked. We are suspecting this is because 
2488         shm files have wrong data protection class, but shm files should not have Complete class protection when it 
2489         is created. It is likely the protection class is changed later. Add an assertion to verify our guess. If the 
2490         crash signature changes after this patch, we probably need to change database implementation. If it is not, we
2491         have other problem than data protection.
2492
2493         * platform/sql/SQLiteDatabase.cpp:
2494         (WebCore::SQLiteDatabase::open):
2495
2496 2019-05-03  Youenn Fablet  <youenn@apple.com>
2497
2498         Cache.add and Cache.addAll should compute a correct response body size
2499         https://bugs.webkit.org/show_bug.cgi?id=197464
2500
2501         Reviewed by Chris Dumez.
2502
2503         Compute the response body size as we do for regular Cache.put
2504
2505         Test: http/wpt/cache-storage/cache-quota-add.any.html
2506
2507         * Modules/cache/CacheStorageConnection.cpp:
2508         (WebCore::CacheStorageConnection::computeRecordBodySize):
2509         * Modules/cache/CacheStorageConnection.h:
2510         * Modules/cache/DOMCache.cpp:
2511         (WebCore::FetchTasksHandler::addResponseBody):
2512         (WebCore::DOMCache::addAll):
2513         Compute the response body size requires getting access to the connection.
2514         'this' is added to the lambda which is fine since taskHandler keeps a
2515         Ref to 'this' in its completion handler.
2516         (WebCore::DOMCache::toConnectionRecord):
2517         * Modules/fetch/FetchResponse.h:
2518
2519 2019-05-03  Tomoki Imai  <Tomoki.Imai@sony.com>
2520
2521         [Cairo] Improve ShadowBlur performance using tiling optimization
2522         https://bugs.webkit.org/show_bug.cgi?id=197308
2523         Reviewed by Žan Doberšek.
2524
2525         Enable tiling tiling-based optimization for drawRectShadow() and drawInsetShadow().
2526         Since r228776, cairo ports doesn't have tiling-based optimization.
2527
2528         For AppleWin, this patch refactors code and it shares almost same code as cairo port.
2529         Only the difference is that AppleWin uses ScratchBuffer, but cairo ports doesn't.
2530         This should avoid a performance regression for AppleWin.
2531
2532         No new tests, covered by existing tests.
2533
2534         * platform/graphics/ShadowBlur.cpp:
2535         (WebCore::calculateLobes):
2536         Fix stylecheck errors
2537
2538         (WebCore::ShadowBlur::blurLayerImage):
2539         Fix stylecheck errors
2540
2541         (WebCore::ShadowBlur::calculateLayerBoundingRect):
2542         We don't use position of m_sourceRect, so change the type to FloatSize.
2543
2544         (WebCore::ShadowBlur::drawShadowBuffer):
2545         Use m_layerSize instead of m_shadowedResultSize to fillRect, as m_layerSize is always smaller than m_shadowedResultSize.
2546         It's because in m_layerSize is equal to m_shadowedResultSize if it's not clipped.
2547         Clipping doesn't increase size of m_layerSize, so m_layerSize is always smaller than or equal to m_shadowedResultSize.
2548
2549         (WebCore::ShadowBlur::templateSize const):
2550         Fix stylecheck errors
2551
2552         (WebCore::ShadowBlur::drawRectShadow):
2553         (WebCore::ShadowBlur::drawInsetShadow):
2554         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
2555         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
2556         (WebCore::ShadowBlur::drawRectShadowWithTiling):
2557         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
2558         Incorporate tile-based drawing.
2559         To accomplish it, this patch abstracts GraphicsContext::drawImageBuffer to ShadowBlur::DrawImageCallback,
2560         GraphicsContext::fillRect to ShadowBlur::FillRectCallback, drawing rect with hole to  ShadowBlur::FillRectWithHoleCallback.
2561
2562         Variants which takes GraphicsContext as parameter now just calls another drawRectShadow.
2563
2564         (WebCore::ShadowBlur::drawLayerPieces):
2565         Instead of graphicsContext.drawImageBuffer, call corresponding callback.
2566
2567         (WebCore::ShadowBlur::drawLayerPiecesAndFillCenter):
2568         This function calls drawLayerPieces and fill center for outer shadow.
2569         Drawing outer shadow requires another callback for graphicsContext.fillRect.
2570
2571         (WebCore::ShadowBlur::drawShadowLayer):
2572         Use m_layerSize instead of m_shadowedResultSize to fillRect,
2573         as m_layerSize is always smaller than m_shadowedResultSize.
2574
2575         * platform/graphics/ShadowBlur.h:
2576         Rename m_sourceRect to m_shadowedResultSize, and change it to FloatSize from FloatRect.
2577         Remove GraphicsContext usage as much as possible and replace them by corresponding callbacks.
2578
2579         * platform/graphics/cairo/CairoOperations.cpp:
2580         (WebCore::Cairo::drawShadowImage):
2581         This function corresponds to ShadowBlur::DrawImageCallback.
2582
2583         (WebCore::Cairo::fillShadowBuffer):
2584         Erase sourceRect, as it's always bigger than layerSize.
2585
2586         (WebCore::Cairo::drawPathShadow):
2587         (WebCore::Cairo::drawGlyphsShadow):
2588         Erase unused parameter.
2589
2590         (WebCore::Cairo::fillRect):
2591         (WebCore::Cairo::fillRoundedRect):
2592         (WebCore::Cairo::fillRectWithRoundedHole):
2593         For tile-based optimization, add extra arguments to drawRectShadow.
2594
2595         (WebCore::Cairo::drawSurface):
2596         Erase unused parameter.
2597
2598 2019-05-03  Antti Koivisto  <antti@apple.com>
2599
2600         Add a quirk to make youtube navigation bar scrollable without mouse hover on iOS
2601         https://bugs.webkit.org/show_bug.cgi?id=197555
2602         <rdar://problem/49582231>
2603
2604         Reviewed by Brent Fulgham.
2605
2606         * css/StyleResolver.cpp:
2607         (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):
2608
2609         Turn 'overflow:hidden' into 'overflow:auto' on element with id="guide-inner-content".
2610
2611         * page/Quirks.cpp:
2612         (WebCore::Quirks::needsYouTubeOverflowScrollQuirk const):
2613         * page/Quirks.h:
2614
2615 2019-05-03  Devin Rousso  <drousso@apple.com>
2616
2617         Web Inspector: Record actions performed on WebGL2RenderingContext
2618         https://bugs.webkit.org/show_bug.cgi?id=176008
2619         <rdar://problem/34213884>
2620
2621         Reviewed by Joseph Pecoraro.
2622
2623         Tests: inspector/canvas/recording-webgl2.html
2624                inspector/canvas/recording-webgl2-snapshots.html
2625
2626         * html/canvas/WebGL2RenderingContext.idl:
2627
2628         * bindings/js/CallTracerTypes.h:
2629         * inspector/RecordingSwizzleTypes.h:
2630
2631         * inspector/InspectorCanvas.h:
2632         * inspector/InspectorCanvas.cpp:
2633         (WebCore::InspectorCanvas::canvasChanged): Added.
2634         (WebCore::InspectorCanvas::resetRecordingData):
2635         (WebCore::shouldSnapshotWebGL2Action): Added.
2636         (WebCore::InspectorCanvas::recordAction):
2637         (WebCore::InspectorCanvas::releaseObjectForRecording):
2638         (WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
2639         (WebCore::InspectorCanvas::buildAction):
2640         * inspector/agents/InspectorCanvasAgent.h:
2641         * inspector/agents/InspectorCanvasAgent.cpp:
2642         (WebCore::InspectorCanvasAgent::canvasChanged): Added.
2643         (WebCore::InspectorCanvasAgent::startRecording):
2644         Provide an actual implementation of `CanvasObserver::canvasChanged` since it can be used to
2645         determine whether or not an action needs a snapshot.
2646
2647         * page/PageConsoleClient.cpp:
2648         (WebCore::canvasRenderingContext):
2649
2650 2019-05-03  Commit Queue  <commit-queue@webkit.org>
2651
2652         Unreviewed, rolling out r244881.
2653         https://bugs.webkit.org/show_bug.cgi?id=197559
2654
2655         Breaks compilation of jsconly on linux, breaking compilation
2656         for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
2657         guijemont on #webkit).
2658
2659         Reverted changeset:
2660
2661         "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
2662         WEBKIT_COPY_FILES"
2663         https://bugs.webkit.org/show_bug.cgi?id=197174
2664         https://trac.webkit.org/changeset/244881
2665
2666 2019-05-03  Joonghun Park  <jh718.park@samsung.com>
2667
2668         Resolve the percentage values of inset properties against proper box.
2669         https://bugs.webkit.org/show_bug.cgi?id=189549
2670
2671         Reviewed by Antti Koivisto.
2672
2673         Before this CL, sticky element's layout was executed relative to
2674         a box's overflow container,
2675         but the value returned by getComputedStyle was resolved against
2676         its containing block.
2677
2678         So, the computed value and the actual value used in layout
2679         was different before this change.
2680
2681         Tests: imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-sticky-container-for-abspos.html
2682                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-sticky-pos-percent.html
2683
2684         * css/CSSComputedStyleDeclaration.cpp:
2685         (WebCore::positionOffsetValue):
2686         * rendering/RenderBox.cpp:
2687         (WebCore::RenderBox::enclosingScrollportBox const):
2688         * rendering/RenderBox.h:
2689
2690 2019-05-02  Antti Koivisto  <antti@apple.com>
2691
2692         Add a quirk to make gmail navigation bar scrollable without mouse hover on iOS
2693         https://bugs.webkit.org/show_bug.cgi?id=197529
2694         <rdar://problem/49403416>
2695
2696         Reviewed by Simon Fraser.
2697
2698         * css/StyleResolver.cpp:
2699         (WebCore::StyleResolver::adjustRenderStyle):
2700         (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):
2701
2702         Turn 'overflow:hidden' to 'overflow:auto' on element with role="navigation".
2703         This should be both reasonably targeted and robust.
2704
2705         * css/StyleResolver.h:
2706         * page/Quirks.cpp:
2707         (WebCore::Quirks::needsGMailOverflowScrollQuirk const):
2708         * page/Quirks.h:
2709
2710 2019-05-02  Simon Fraser  <simon.fraser@apple.com>
2711
2712         Add logging for RenderLayer clip rects
2713         https://bugs.webkit.org/show_bug.cgi?id=197547
2714
2715         Reviewed by Zalan Bujtas.
2716
2717         Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
2718
2719         * platform/Logging.h:
2720         * rendering/ClipRect.cpp:
2721         (WebCore::operator<<):
2722         * rendering/ClipRect.h:
2723         * rendering/RenderLayer.cpp:
2724         (WebCore::operator<<):
2725         (WebCore::RenderLayer::calculateClipRects const):
2726         * rendering/RenderLayer.h:
2727
2728 2019-05-02  Youenn Fablet  <youenn@apple.com>
2729
2730         Make AudioContext::scriptExecutionContext() private
2731         https://bugs.webkit.org/show_bug.cgi?id=197512
2732
2733         Reviewed by Eric Carlson.
2734
2735         Refactor code to make audio nodes not rely on AudioContext::scriptExecutionContext.
2736         Instead, let AudioContext provide the necessary API for its nodes.
2737         Covered by existing tests.
2738
2739         * Modules/webaudio/AudioBufferSourceNode.cpp:
2740         (WebCore::AudioBufferSourceNode::looping):
2741         (WebCore::AudioBufferSourceNode::setLooping):
2742         * Modules/webaudio/AudioContext.cpp:
2743         (WebCore::AudioContext::postTask):
2744         (WebCore::AudioContext::origin const):
2745         (WebCore::AudioContext::addConsoleMessage):
2746         * Modules/webaudio/AudioContext.h:
2747         (WebCore::AudioContext::isStopped const):
2748         * Modules/webaudio/AudioNode.cpp:
2749         (WebCore::AudioNode::scriptExecutionContext const):
2750         * Modules/webaudio/AudioNode.h:
2751         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2752         (WebCore::AudioScheduledSourceNode::finish):
2753         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
2754         (WebCore::DefaultAudioDestinationNode::resume):
2755         (WebCore::DefaultAudioDestinationNode::suspend):
2756         (WebCore::DefaultAudioDestinationNode::close):
2757         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
2758         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
2759         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
2760         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
2761         * Modules/webaudio/ScriptProcessorNode.cpp:
2762         (WebCore::ScriptProcessorNode::fireProcessEvent):
2763
2764 2019-05-02  Ryosuke Niwa  <rniwa@webkit.org>
2765
2766         Disable software keyboard for a math field textarea on desmos.com
2767         https://bugs.webkit.org/show_bug.cgi?id=197488
2768
2769         Reviewed by Wenson Hsieh.
2770
2771         Treat a textarea inside a math field span as if it had inputmode content attribute set to none to suppress
2772         the software keyboard on desmos.com as it interferes with website's own UI.
2773
2774         * html/HTMLElement.cpp:
2775         (WebCore::HTMLElement::canonicalInputMode const):
2776         * page/Quirks.cpp:
2777         (WebCore::Quirks::needsInputModeNoneImplicitly const):
2778         * page/Quirks.h:
2779
2780 2019-05-02  Timothy Hatcher  <timothy@apple.com>
2781
2782         NSAttributedString conversion in a loop returns nil and WKUnknownError every other time.
2783         https://bugs.webkit.org/show_bug.cgi?id=197523
2784
2785         Reviewed by Darin Adler.
2786
2787         * editing/cocoa/HTMLConverter.mm:
2788         (HTMLConverter::convert): Don't return early if m_dataSource is nil. This is already null
2789         checked later and only needed in specific cases, it shouldn't fail the whole conversion.
2790
2791 2019-05-02  Chris Dumez  <cdumez@apple.com>
2792
2793         Setting a frame's src to a javascript URL should not run it synchronously
2794         https://bugs.webkit.org/show_bug.cgi?id=197466
2795
2796         Reviewed by Darin Adler.
2797
2798         When an iframe's src attribute is set to a javascript URL, whether when parsing
2799         or later on via JS, we now execute the URL's JavaScript asynchronously. We used
2800         to execute it synchronously, which was a source of bugs and also did not match
2801         other browsers.
2802
2803         I have verified that our new behavior is aligned with both Firefox and Chrome.
2804
2805         Note that for backward-compatibility and interoperability with Blink
2806         (https://bugs.chromium.org/p/chromium/issues/detail?id=923585), the
2807         "javascript:''" URL will still run synchronously. We should consider dropping
2808         this quirk at some point.
2809
2810         Test: fast/dom/frame-src-javascript-url-async.html
2811
2812         * loader/NavigationScheduler.cpp:
2813         (WebCore::ScheduledLocationChange::ScheduledLocationChange):
2814         (WebCore::ScheduledLocationChange::~ScheduledLocationChange):
2815         (WebCore::NavigationScheduler::scheduleLocationChange):
2816         * loader/NavigationScheduler.h:
2817         (WebCore::NavigationScheduler::scheduleLocationChange):
2818         * loader/SubframeLoader.cpp:
2819         (WebCore::SubframeLoader::requestFrame):
2820
2821 2019-05-02  Gary Katsevman  <git@gkatsev.com>
2822
2823         WebVTT: fix vertical cue alignment.
2824         https://bugs.webkit.org/show_bug.cgi?id=136627.
2825         <rdar://problem/49725538>
2826
2827         Reviewed by Eric Carlson.
2828
2829         Updated existing test results.
2830
2831         * html/track/VTTCue.cpp:
2832         (WebCore::VTTCueBox::applyCSSProperties):
2833
2834 2019-05-02  Don Olmstead  <don.olmstead@sony.com>
2835
2836         [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
2837         https://bugs.webkit.org/show_bug.cgi?id=197174
2838
2839         Reviewed by Alex Christensen.
2840
2841         Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
2842         for framework headers explicit.
2843
2844         * CMakeLists.txt:
2845
2846 2019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
2847
2848         [WebAuthN] Add a quirk for google.com when processing AppID extension
2849         https://bugs.webkit.org/show_bug.cgi?id=196046
2850         <rdar://problem/49088479>
2851
2852         Reviewed by Brent Fulgham.
2853
2854         Relaxing the same site restriction on AppID while in google.com and any
2855         of its subdomains to allow two www.gstatic.com AppIDs to slip in.
2856
2857         Covered by manual tests on Google.com.
2858
2859         * Modules/webauthn/AuthenticatorCoordinator.cpp:
2860         (WebCore::AuthenticatorCoordinatorInternal::needsAppIdQuirks):
2861         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
2862
2863 2019-05-02  Ross Kirsling  <ross.kirsling@sony.com>
2864
2865         Unreviewed fix for non-unified build after r244853.
2866
2867         * page/SecurityOrigin.cpp:
2868
2869 2019-05-02  Frederic Wang  <fwang@igalia.com>
2870
2871         [GTK][WPE] Disable "thin", "thick", "medium" values of mfrac@linethickness at runtime
2872         https://bugs.webkit.org/show_bug.cgi?id=196142
2873
2874         This patch introduces some experimental runtime flag to let users
2875         disable MathML features that are removed from MathML Core [1]. For now,
2876         these features are only disabled on GTK and WPE ports. This patch also
2877         adds a condition to disable "thin", "thick", "medium" values of
2878         mfrac@linethickness at runtime as agreed in [2].
2879
2880         [1] https://mathml-refresh.github.io/mathml-core/
2881         [2] https://github.com/mathml-refresh/mathml/issues/4
2882
2883         Reviewed by Rob Buis.
2884
2885         No new tests, covered by frac-linethickness-0001.html
2886
2887         * mathml/MathMLFractionElement.cpp:
2888         (WebCore::MathMLFractionElement::lineThickness): Just do standard
2889         parsing for MathML lengths when non-core MathML features are disabled.
2890         * page/Settings.yaml: Add WebCore setting.
2891
2892 2019-05-01  Jiewen Tan  <jiewen_tan@apple.com>
2893
2894         [WebAuthN] Adopt SecurityOrigin::isMatchingRegistrableDomainSuffix()
2895         https://bugs.webkit.org/show_bug.cgi?id=197481
2896
2897         Reviewed by Brent Fulgham.
2898
2899         This patch implements Step 6-7 from:
2900         https://www.w3.org/TR/webauthn/#createCredential,
2901         https://www.w3.org/TR/webauthn/#discover-from-external-source.
2902
2903         Test: http/wpt/webauthn/public-key-credential-ip-address.html
2904
2905         * Modules/webauthn/AuthenticatorCoordinator.cpp:
2906         (WebCore::AuthenticatorCoordinator::create const):
2907         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
2908
2909 2019-05-01  Youenn Fablet  <youenn@apple.com>
2910
2911         Add back hasNullReferences() assert in Document::updateIsPlayingMedia
2912         https://bugs.webkit.org/show_bug.cgi?id=197477
2913
2914         Reviewed by Eric Carlson.
2915
2916         AudioContext had a special scriptExecutionContext() getter
2917         that was returning nullptr when AudioContext is stopped.
2918         Instead, make this getter behave as all other scriptExecutionContext() getters
2919         and make sure existing call sites of the getter are fine with the change.
2920
2921         Covered by existing tests.
2922
2923         * Modules/webaudio/AudioContext.cpp:
2924         (WebCore::AudioContext::AudioContext):
2925         No need to check whether offline since this constructor is for non offline AudioContext.
2926         (WebCore::AudioContext::scriptExecutionContext const):
2927         (WebCore::AudioContext::fireCompletionEvent):
2928         * dom/Document.cpp:
2929         (WebCore::Document::updateIsPlayingMedia):
2930
2931 2019-05-01  Justin Fan  <justin_fan@apple.com>
2932
2933         Update WebGPU class names based on sketch.idl
2934         https://bugs.webkit.org/show_bug.cgi?id=194260
2935
2936         Reviewed by Dean Jackson.
2937
2938         Update all exposed Web GPU interface names to GPU* prefix.
2939
2940         Existing Web GPU tests updated to expect new names.
2941
2942         * Modules/webgpu/WebGPU.idl:
2943         * Modules/webgpu/WebGPUAdapter.idl:
2944         * Modules/webgpu/WebGPUBindGroup.idl:
2945         * Modules/webgpu/WebGPUBindGroupLayout.idl:
2946         * Modules/webgpu/WebGPUBuffer.idl:
2947         * Modules/webgpu/WebGPUDevice.idl:
2948         * Modules/webgpu/WebGPUInputStepMode.h: Removed.
2949         * Modules/webgpu/WebGPUPipelineLayout.idl:
2950         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
2951         * Modules/webgpu/WebGPUQueue.idl:
2952         * Modules/webgpu/WebGPURenderPassEncoder.idl:
2953         * Modules/webgpu/WebGPURenderPipeline.idl:
2954         * Modules/webgpu/WebGPUSampler.idl:
2955         * Modules/webgpu/WebGPUTexture.idl:
2956         * Modules/webgpu/WebGPUTextureView.idl:
2957         * WebCore.xcodeproj/project.pbxproj:
2958         * bindings/js/WebCoreBuiltinNames.h:
2959
2960 2019-05-01  Jiewen Tan  <jiewen_tan@apple.com>
2961
2962         Move Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
2963         https://bugs.webkit.org/show_bug.cgi?id=181950
2964         <rdar://problem/43357371>
2965
2966         Reviewed by Brent Fulgham.
2967
2968         This patch moves Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
2969         to be more aligned with the HTML standard:
2970         https://html.spec.whatwg.org/multipage/origin.html#is-a-registrable-domain-suffix-of-or-is-equal-to.
2971         Besides that, it also removes redundant codes within the original method that is also done in
2972         OriginAccessEntry::matchesOrigin.
2973
2974         Covered by new API tests.
2975
2976         * dom/Document.cpp:
2977         (WebCore::Document::setDomain):
2978         (WebCore::Document::domainIsRegisterable const): Deleted.
2979         * dom/Document.h:
2980         * page/SecurityOrigin.cpp:
2981         (WebCore::SecurityOrigin::isMatchingRegistrableDomainSuffix const):
2982         * page/SecurityOrigin.h:
2983
2984 2019-05-01  Ryosuke Niwa  <rniwa@webkit.org>
2985
2986         [iOS] Element::focus and Element::scrollIntoView do not clamp scroll positions
2987         https://bugs.webkit.org/show_bug.cgi?id=197211
2988
2989         Reviewed by Simon Fraser.
2990
2991         Fixed the bug that Element::focus and Element::scrollIntoView were not clamping scroll offsets,
2992         which causes scrollTop etc... to return a bogus negative scrolling offset.
2993
2994         Unfortunately, we can't just use FrameView's ScrollableArea::constrainScrollPosition since
2995         scrollRectToVisible relies on the visible rect being expanded by the content insets in order to scroll to
2996         a position within the content insets of UIScrollView; e.g. revealing the top of the page as the center.
2997         We manually expand minimumScrollPosition() and maximumScrollPosition() by the content insets instead.
2998
2999         Tests: fast/scrolling/ios/programmatic-scroll-via-focus-should-clamp-top.html
3000                fast/scrolling/ios/programmatic-scroll-via-scrollIntoView-inside-iframe-should-clamp-top.html
3001                fast/scrolling/ios/programmatic-scroll-via-scrollIntoView-should-clamp-top.html
3002
3003         * rendering/RenderLayer.cpp:
3004         (WebCore::RenderLayer::scrollRectToVisible):
3005
3006 2019-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>
3007
3008         [iOS] Add a version of viewport shrink-to-fit heuristics that preserves page layout
3009         https://bugs.webkit.org/show_bug.cgi?id=197342
3010         <rdar://problem/50063091>
3011
3012         Reviewed by Tim Horton.
3013
3014         Adds support for a new shrink-to-fit heuristic that attempts to lay out the contents of the page at a larger
3015         width in order to shrink content to fit the viewport. See WebKit ChangeLog for more details.
3016
3017         Tests: fast/viewport/ios/shrink-to-fit-content-constant-width.html
3018                fast/viewport/ios/shrink-to-fit-content-large-width-breakpoint.html
3019                fast/viewport/ios/shrink-to-fit-content-no-viewport.html
3020                fast/viewport/ios/shrink-to-fit-content-responsive-viewport-with-horizontal-overflow.html
3021                fast/viewport/ios/shrink-to-fit-content-temporary-overflow.html
3022
3023         * page/ViewportConfiguration.cpp:
3024         (WebCore::ViewportConfiguration::setMinimumEffectiveDeviceWidth):
3025         (WebCore::ViewportConfiguration::setIsKnownToLayOutWiderThanViewport):
3026         (WebCore::ViewportConfiguration::description const):
3027         * page/ViewportConfiguration.h:
3028         (WebCore::ViewportConfiguration::canIgnoreScalingConstraints const):
3029         (WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const):
3030
3031         Add several new getters and setters in ViewportConfiguration.
3032
3033         (WebCore::ViewportConfiguration::isKnownToLayOutWiderThanViewport const):
3034         (WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const):
3035
3036         Importantly, only allow ignoring the minimum effective device width in webpages with responsive viewports, if
3037         they also have *not* laid out wider than the viewport.
3038
3039         (WebCore::ViewportConfiguration::setForceAlwaysUserScalable):
3040
3041 2019-05-01  Zalan Bujtas  <zalan@apple.com>
3042
3043         [iOS] Star rating is covered with a black circle when writing a review on Yelp
3044         https://bugs.webkit.org/show_bug.cgi?id=197469
3045         <rdar://problem/48094446>
3046
3047         Reviewed by Dean Jackson.
3048
3049         This patch moves the background painting of the radio/checkbox form controls in checked state to RenderTheme.
3050         It enables content authors to disable default appearance using -webkit-appearance: none (it is also inline with what we do on macOS).
3051
3052         Test: fast/forms/radio-and-checkbox-checked-with-no-appearance.html
3053
3054         * css/html.css:
3055         (input:matches([type="checkbox"], [type="radio"]):checked):
3056         * rendering/RenderThemeIOS.mm:
3057         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
3058         (WebCore::RenderThemeIOS::paintRadioDecorations):
3059
3060 2019-05-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
3061
3062         REGRESSION (r244182): RenderingUpdate should not be scheduled for invisible pages
3063         https://bugs.webkit.org/show_bug.cgi?id=197451
3064
3065         Reviewed by Simon Fraser.
3066
3067         Before r244182, some web pages never need to schedule a RenderingUpdate.
3068         Only pages with rAF callbacks, web animations, intersection and resize 
3069         observers needed to do so. After r244182, all pages have to schedule a
3070         RenderingUpdate when a page rendering update is required.
3071
3072         When Safari opens, it create a 'blank' web page. The blank page will not
3073         be visible unless the user selects to show the 'Empty page' in the new
3074         tab. Although the blank page is not visible, the loader needs to resolveStyle()
3075         which requires to scheduleLayerFlushNow(). 
3076
3077         We need to optimize this case: calling scheduleLayerFlushNow() for invisible
3078         pages. We do that by checking if the page is visible before scheduling
3079         the RenderingUpdate.
3080
3081         Also we need to change or get rid of scheduleLayerFlushNow() since its name
3082         has become confusing. It suggests that it is going to schedule flushing
3083         the layer 'now'. But after r244182, it does scheduleRenderingUpdate() first.
3084         And when it fires, scheduleCompositingLayerFlush() will be called.
3085
3086         * page/RenderingUpdateScheduler.cpp:
3087         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
3088         * rendering/RenderLayerCompositor.cpp:
3089         (WebCore::RenderLayerCompositor::scheduleLayerFlush):
3090         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
3091         (WebCore::RenderLayerCompositor::frameViewDidScroll):
3092         (WebCore::RenderLayerCompositor::attachRootLayer):
3093         (WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled):
3094         (WebCore::RenderLayerCompositor::layerFlushTimerFired):
3095         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow): Deleted.
3096         * rendering/RenderLayerCompositor.h:
3097
3098 2019-05-01  Darin Adler  <darin@apple.com>
3099
3100         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
3101         https://bugs.webkit.org/show_bug.cgi?id=195535
3102
3103         Reviewed by Alexey Proskuryakov.
3104
3105         * platform/SharedBuffer.cpp:
3106         (WebCore::utf8Buffer): Removed unnecessary "strict" argument to convertUTF16ToUTF8 since
3107         that is the default behavior. Also updated for changes to return values.
3108
3109         * xml/XSLTProcessorLibxslt.cpp:
3110         (WebCore::writeToStringBuilder): Removed unnecessary use of StringBuffer for a temporary
3111         buffer for characters. Rewrote to use U8_NEXT and U16_APPEND directly.
3112
3113         * xml/parser/XMLDocumentParserLibxml2.cpp:
3114         (WebCore::convertUTF16EntityToUTF8): Updated for changes to CompletionResult.
3115
3116 2019-05-01  Shawn Roberts  <sroberts@apple.com>
3117
3118         Unreviewed, rolling out r244821.
3119
3120         Causing
3121
3122         Reverted changeset:
3123
3124         "WebKit has too much of its own UTF-8 code and should rely
3125         more on ICU's UTF-8 support"
3126         https://bugs.webkit.org/show_bug.cgi?id=195535
3127         https://trac.webkit.org/changeset/244821
3128
3129 2019-05-01  Shawn Roberts  <sroberts@apple.com>
3130
3131         Unreviewed, rolling out r244822.
3132
3133         Causing
3134
3135         Reverted changeset:
3136
3137         https://trac.webkit.org/changeset/244822
3138
3139 2019-05-01  Youenn Fablet  <youenn@apple.com>
3140
3141         Reject/throw when calling AudioContext methods on a stopped AudioContext
3142         https://bugs.webkit.org/show_bug.cgi?id=197391
3143
3144         Reviewed by Eric Carlson.
3145
3146         Return InvalidStateError in that case.
3147         ASSERT that we do not call lazyInitialize after being stopped
3148         since this would mean we are doing unneeded processing.
3149
3150         Test: http/wpt/webaudio/audiocontext-stopped.html
3151
3152         * Modules/webaudio/AudioContext.cpp:
3153         (WebCore::AudioContext::lazyInitialize):
3154         (WebCore::AudioContext::createBufferSource):
3155         (WebCore::AudioContext::createMediaElementSource):
3156         (WebCore::AudioContext::createMediaStreamSource):
3157         (WebCore::AudioContext::createMediaStreamDestination):
3158         (WebCore::AudioContext::createScriptProcessor):
3159         (WebCore::AudioContext::createBiquadFilter):
3160         (WebCore::AudioContext::createWaveShaper):
3161         (WebCore::AudioContext::createPanner):
3162         (WebCore::AudioContext::createConvolver):
3163         (WebCore::AudioContext::createDynamicsCompressor):
3164         (WebCore::AudioContext::createAnalyser):
3165         (WebCore::AudioContext::createGain):
3166         (WebCore::AudioContext::createDelay):
3167         (WebCore::AudioContext::createChannelSplitter):
3168         (WebCore::AudioContext::createChannelMerger):
3169         (WebCore::AudioContext::createOscillator):
3170         (WebCore::AudioContext::createPeriodicWave):
3171         (WebCore::AudioContext::startRendering):
3172         (WebCore::AudioContext::suspend):
3173         (WebCore::AudioContext::resume):
3174         (WebCore::AudioContext::close):
3175         * Modules/webaudio/AudioContext.h:
3176         * Modules/webaudio/AudioContext.idl:
3177
3178 2019-05-01  Eric Carlson  <eric.carlson@apple.com>
3179
3180         XMLHttpRequest should propagate user gestures for media playback
3181         https://bugs.webkit.org/show_bug.cgi?id=197428
3182         <rdar://problem/46677392>
3183
3184         Reviewed by Jer Noble.
3185
3186         A user gesture the would allow media state change in effect when XMLHttpRequest.send is 
3187         called should be active when the event handlers fire after the transaction completes successfully.
3188
3189         Test: http/tests/media/user-gesture-preserved-across-xmlhttprequest.html
3190
3191         * dom/UserGestureIndicator.cpp:
3192         (WebCore::UserGestureIndicator::UserGestureIndicator): Add a 'scope' parameter to potentially
3193         limit the scope of the gesture to just media.
3194         (WebCore::UserGestureIndicator::~UserGestureIndicator): Clear the scope.
3195         * dom/UserGestureIndicator.h:
3196         (WebCore::UserGestureToken::processingUserGesture const):
3197         (WebCore::UserGestureToken::setScope):
3198         (WebCore::UserGestureToken::resetScope):
3199         (WebCore::UserGestureToken::hasExpired const):
3200
3201         * page/DOMTimer.cpp:
3202         (WebCore::DOMTimerFireState::DOMTimerFireState): Don't need to store the nested timer interval,
3203         UserGestureIndicator knows when it started.
3204         (WebCore::DOMTimer::DOMTimer): Ditto.
3205         (WebCore::DOMTimer::fired): Ditto.
3206         (WebCore::DOMTimerFireState::nestedTimerInterval const): Deleted.
3207         (WebCore::shouldForwardUserGesture): Deleted.
3208         (WebCore::userGestureTokenToForward): Deleted.
3209         (WebCore::currentNestedTimerInterval): Deleted.
3210         * page/DOMTimer.h:
3211
3212         * testing/Internals.cpp:
3213         (WebCore::Internals::setXHRMaximumIntervalForUserGestureForwarding): Override the maximum
3214         user gesture interval for testing.
3215         * testing/Internals.h:
3216         * testing/Internals.idl:
3217
3218         * xml/XMLHttpRequest.cpp:
3219         (WebCore::XMLHttpRequest::XMLHttpRequest): 
3220         (WebCore::XMLHttpRequest::send): Stash the user gesture token.
3221         (WebCore::XMLHttpRequest::dispatchEvent): Clear user gesture token if it has expired. If still
3222         valid, activate it.
3223         * xml/XMLHttpRequest.h:
3224
3225 2019-04-29  Darin Adler  <darin@apple.com>
3226
3227         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
3228         https://bugs.webkit.org/show_bug.cgi?id=195535
3229
3230         Reviewed by Alexey Proskuryakov.
3231
3232         * platform/SharedBuffer.cpp:
3233         (WebCore::utf8Buffer): Removed unnecessary "strict" argument to convertUTF16ToUTF8 since
3234         that is the default behavior. Also updated for changes to return values.
3235
3236         * xml/XSLTProcessorLibxslt.cpp:
3237         (WebCore::writeToStringBuilder): Removed unnecessary use of StringBuffer for a temporary
3238         buffer for characters. Rewrote to use U8_NEXT and U16_APPEND directly.
3239
3240         * xml/parser/XMLDocumentParserLibxml2.cpp:
3241         (WebCore::convertUTF16EntityToUTF8): Updated for changes to CompletionResult.
3242
3243 2019-04-30  John Wilander  <wilander@apple.com>
3244
3245         Add logging of Ad Click Attribution errors and events to a dedicated channel
3246         https://bugs.webkit.org/show_bug.cgi?id=197332
3247         <rdar://problem/49918800>
3248
3249         Reviewed by Youenn Fablet.
3250
3251         This patch adds an experimental Ad Click Attribution debug mode which
3252         logs information.
3253
3254         No new tests.
3255
3256         * loader/AdClickAttribution.cpp:
3257         (WebCore::AdClickAttribution::parseConversionRequest):
3258         (WebCore::AdClickAttribution::debugModeEnabled):
3259         * loader/AdClickAttribution.h:
3260         * page/RuntimeEnabledFeatures.h:
3261         (WebCore::RuntimeEnabledFeatures::adClickAttributionDebugModeEnabled const):
3262         (WebCore::RuntimeEnabledFeatures::setAdClickAttributionDebugModeEnabled):
3263         * platform/Logging.h:
3264
3265 2019-04-30  Myles C. Maxfield  <mmaxfield@apple.com>
3266
3267         font-weight: 1000 is not parsed successfully
3268         https://bugs.webkit.org/show_bug.cgi?id=197427
3269
3270         Reviewed by Dean Jackson.
3271
3272         The spec says:
3273         "Only values greater than or equal to 1, and less than or equal to 1000, are valid"
3274
3275         This change brings us in-line with all the other browsers.
3276
3277         Test: fast/text/font-weight-1-1000.html
3278
3279         * css/parser/CSSPropertyParserHelpers.cpp:
3280         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
3281
3282 2019-04-30  Youenn Fablet  <youenn@apple.com>
3283
3284         Make Document audio producers use WeakPtr
3285         https://bugs.webkit.org/show_bug.cgi?id=197382
3286
3287         Reviewed by Eric Carlson.
3288
3289         Move from a hash set of raw pointers to a hash set of weak pointers.
3290         This helps make the code cleaner.
3291         No observable change of behavior.
3292
3293         * Modules/mediastream/MediaStreamTrack.h:
3294         * dom/Document.cpp:
3295         (WebCore::Document::addAudioProducer):
3296         (WebCore::Document::removeAudioProducer):
3297         (WebCore::Document::updateIsPlayingMedia):
3298         (WebCore::Document::pageMutedStateDidChange):
3299         * dom/Document.h:
3300         * html/HTMLMediaElement.cpp:
3301         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
3302         * html/HTMLMediaElement.h:
3303         * page/MediaProducer.h:
3304
3305 2019-04-30  Youenn Fablet  <youenn@apple.com>
3306
3307         [macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
3308         https://bugs.webkit.org/show_bug.cgi?id=196864
3309         <rdar://problem/49854497>
3310
3311         Reviewed by Alex Christensen.
3312
3313         In case of redirection, it is sometimes not possible to retrieve the form data
3314         from its NSInputStream in case of redirections.
3315         To handle this case, reuse the first request form data if the new request has a body.
3316         We also clear the HTTP content type in such a case if the original request has no content type.
3317
3318         Covered by re-enabled tests.
3319
3320         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3321         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
3322
3323 2019-04-30  Commit Queue  <commit-queue@webkit.org>
3324
3325         Unreviewed, rolling out r244773.
3326         https://bugs.webkit.org/show_bug.cgi?id=197436
3327
3328         Causing assertion failures on debug queues (Requested by
3329         ShawnRoberts on #webkit).
3330
3331         Reverted changeset:
3332
3333         "Make Document audio producers use WeakPtr"
3334         https://bugs.webkit.org/show_bug.cgi?id=197382
3335         https://trac.webkit.org/changeset/244773
3336
3337 2019-04-30  Commit Queue  <commit-queue@webkit.org>
3338
3339         Unreviewed, rolling out r244774.
3340         https://bugs.webkit.org/show_bug.cgi?id=197431
3341
3342         Causing assertion failures on debug queues (Requested by
3343         ShawnRoberts on #webkit).
3344
3345         Reverted changeset:
3346
3347         "Reject/throw when calling AudioContext methods on a stopped
3348         AudioContext"
3349         https://bugs.webkit.org/show_bug.cgi?id=197391
3350         https://trac.webkit.org/changeset/244774
3351
3352 2019-04-30  Alex Christensen  <achristensen@webkit.org>
3353
3354         Add WKContentRuleList ping resource-type
3355         https://bugs.webkit.org/show_bug.cgi?id=197325
3356         <rdar://problem/49841404>
3357
3358         Reviewed by Geoff Garen.
3359
3360         Tests: http/tests/contentextensions/block-ping-resource-type-ping.html and http/tests/contentextensions/block-ping-resource-type-raw.html
3361
3362         * contentextensions/ContentExtensionsBackend.cpp:
3363         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
3364         * contentextensions/ContentExtensionsBackend.h:
3365         * loader/PingLoader.cpp:
3366         (WebCore::processContentRuleListsForLoad):
3367         (WebCore::PingLoader::sendPing):
3368         * loader/ResourceLoadInfo.cpp:
3369         (WebCore::ContentExtensions::readResourceType):
3370         (WebCore::ContentExtensions::ResourceLoadInfo::getResourceFlags const):
3371         * loader/ResourceLoadInfo.h:
3372         * page/UserContentProvider.cpp:
3373         (WebCore::UserContentProvider::processContentRuleListsForLoad):
3374         * page/UserContentProvider.h:
3375
3376 2019-04-30  Justin Fan  <justin_fan@apple.com>
3377
3378         [WebGPU] Move 'gpu' API entry point from DOMWindow to Navigator
3379         https://bugs.webkit.org/show_bug.cgi?id=197348
3380
3381         Reviewed by Myles C. Maxfield.
3382
3383         Latest API provides 'gpu' through Navigator instead of DOMWindow. Replace DOMWindowWebGPU with NavigatorGPU.
3384
3385         Existing tests updated to match. Add test: webgpu-enabled-in-worker.html to ensure workers can access WebGPU.
3386
3387         * CMakeLists.txt:
3388         * DerivedSources.make:
3389         * Modules/webgpu/NavigatorGPU.cpp:
3390         (WebCore::NavigatorGPU::from):
3391         (WebCore::NavigatorGPU::supplementName):
3392         (WebCore::NavigatorGPU::gpu):
3393         (WebCore::NavigatorGPU::gpu const):
3394         * Modules/webgpu/NavigatorGPU.h:
3395         * Modules/webgpu/NavigatorGPU.idl:
3396         * Modules/webgpu/WorkerNavigatorGPU.cpp:
3397         (WebCore::WorkerNavigatorGPU::from):
3398         (WebCore::WorkerNavigatorGPU::supplementName):
3399         (WebCore::WorkerNavigatorGPU::gpu):
3400         (WebCore::WorkerNavigatorGPU::gpu const):
3401         * Modules/webgpu/WorkerNavigatorGPU.h:
3402         * Modules/webgpu/WorkerNavigatorGPU.idl:
3403         * Sources.txt:
3404         * WebCore.xcodeproj/project.pbxproj:
3405
3406 2019-04-30  Zalan Bujtas  <zalan@apple.com>
3407
3408         Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
3409         https://bugs.webkit.org/show_bug.cgi?id=197347
3410         <rdar://problem/49393423>
3411
3412         Reviewed by Wenson Hsieh.
3413
3414         Tests: fast/events/touch/ios/double-tap-for-double-click1.html
3415                fast/events/touch/ios/double-tap-for-double-click2.html
3416
3417         * page/Frame.h:
3418         * page/ios/FrameIOS.mm:
3419         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
3420
3421 2019-04-30  Youenn Fablet  <youenn@apple.com>
3422
3423         Reject/throw when calling AudioContext methods on a stopped AudioContext
3424         https://bugs.webkit.org/show_bug.cgi?id=197391
3425
3426         Reviewed by Eric Carlson.
3427
3428         Return InvalidStateError in that case.
3429         ASSERT that we do not call lazyInitialize after being stopped
3430         since this would mean we are doing unneeded processing.
3431
3432         Test: http/wpt/webaudio/audiocontext-stopped.html
3433
3434         * Modules/webaudio/AudioContext.cpp:
3435         (WebCore::AudioContext::lazyInitialize):
3436         (WebCore::AudioContext::createBufferSource):
3437         (WebCore::AudioContext::createMediaElementSource):
3438         (WebCore::AudioContext::createMediaStreamSource):
3439         (WebCore::AudioContext::createMediaStreamDestination):
3440         (WebCore::AudioContext::createScriptProcessor):
3441         (WebCore::AudioContext::createBiquadFilter):
3442         (WebCore::AudioContext::createWaveShaper):
3443         (WebCore::AudioContext::createPanner):
3444         (WebCore::AudioContext::createConvolver):
3445         (WebCore::AudioContext::createDynamicsCompressor):
3446         (WebCore::AudioContext::createAnalyser):
3447         (WebCore::AudioContext::createGain):
3448         (WebCore::AudioContext::createDelay):
3449         (WebCore::AudioContext::createChannelSplitter):
3450         (WebCore::AudioContext::createChannelMerger):
3451         (WebCore::AudioContext::createOscillator):
3452         (WebCore::AudioContext::createPeriodicWave):
3453         (WebCore::AudioContext::startRendering):
3454         (WebCore::AudioContext::suspend):
3455         (WebCore::AudioContext::resume):
3456         (WebCore::AudioContext::close):
3457         * Modules/webaudio/AudioContext.h:
3458         * Modules/webaudio/AudioContext.idl:
3459
3460 2019-04-30  Youenn Fablet  <youenn@apple.com>
3461
3462         Make Document audio producers use WeakPtr
3463         https://bugs.webkit.org/show_bug.cgi?id=197382
3464
3465         Reviewed by Eric Carlson.
3466
3467         Move from a hash set of raw pointers to a hash set of weak pointers.
3468         This helps make the code cleaner.
3469         No observable change of behavior.
3470
3471         * Modules/mediastream/MediaStreamTrack.h:
3472         * dom/Document.cpp:
3473         (WebCore::Document::addAudioProducer):
3474         (WebCore::Document::removeAudioProducer):
3475         (WebCore::Document::updateIsPlayingMedia):
3476         (WebCore::Document::pageMutedStateDidChange):
3477         * dom/Document.h:
3478         * html/HTMLMediaElement.cpp:
3479         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
3480         * html/HTMLMediaElement.h:
3481         * page/MediaProducer.h:
3482
3483 2019-04-30  Antti Koivisto  <antti@apple.com>
3484
3485         Tighten type of ScrollingTree:rootNode() to ScrollingTreeFrameScrollingNode
3486         https://bugs.webkit.org/show_bug.cgi?id=197414
3487
3488         Reviewed by Frédéric Wang.
3489
3490         * page/scrolling/ScrollingTree.cpp:
3491         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
3492         (WebCore::ScrollingTree::handleWheelEvent):
3493         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
3494         (WebCore::ScrollingTree::updateTreeFromStateNode):
3495         * page/scrolling/ScrollingTree.h:
3496         (WebCore::ScrollingTree::rootNode const):
3497
3498 2019-04-30  Youenn Fablet  <youenn@apple.com>
3499
3500         Refactor AudioContext to register/unregister itself at construction/destruction time
3501         https://bugs.webkit.org/show_bug.cgi?id=197383
3502
3503         Reviewed by Eric Carlson.
3504
3505         Registering/Unregistering is cheap.
3506         Instead of registering/unregistering in initialize/uninitialize,
3507         move this code to constructor/destructor.
3508         No observable change of behavior.
3509
3510         * Modules/webaudio/AudioContext.cpp:
3511         (WebCore::AudioContext::AudioContext):
3512         (WebCore::AudioContext::~AudioContext):
3513         (WebCore::AudioContext::lazyInitialize):
3514         (WebCore::AudioContext::uninitialize):
3515         (WebCore::AudioContext::visibilityStateChanged):
3516
3517 2019-04-30  Michael Catanzaro  <mcatanzaro@igalia.com>
3518
3519         WebCore::StyleColorScheme should not have explicitly-declared copy constructor
3520         https://bugs.webkit.org/show_bug.cgi?id=197412
3521
3522         Reviewed by Don Olmstead.
3523
3524         Either we need to explicitly declare a copy assignment operator here, or the copy
3525         constructor needs to be removed. Having one without the other causes a huge warning spam
3526         with GCC 9. In this case, the copy constructor is redundant because it's identical to an
3527         implicitly-declared copy constructor, so let's just remove it.
3528
3529         * rendering/style/StyleColorScheme.h:
3530
3531 2019-04-30  Carlos Garcia Campos  <cgarcia@igalia.com>
3532
3533         [GTK] Support prefers-color-scheme media query
3534         https://bugs.webkit.org/show_bug.cgi?id=196685
3535
3536         Reviewed by Michael Catanzaro.
3537
3538         Change the gtk-application-prefer-dark-theme setting when tests change the useDarkModeAppearance setting.
3539
3540         * PlatformGTK.cmake:
3541         * testing/InternalSettings.cpp:
3542         (WebCore::InternalSettings::resetToConsistentState):
3543         (WebCore::InternalSettings::setUseDarkAppearanceInternal):
3544         (WebCore::InternalSettings::setUseDarkAppearance):
3545         * testing/InternalSettings.h:
3546
3547 2019-04-29  Truitt Savell  <tsavell@apple.com>
3548
3549         Unreviewed, rolling out r244755.
3550
3551         Casued several test failures on iOS
3552
3553         Reverted changeset:
3554
3555         "Double-tapping a post to like doesn't work on Instagram.com
3556         (needs 'dblclick' event)"
3557         https://bugs.webkit.org/show_bug.cgi?id=197347
3558         https://trac.webkit.org/changeset/244755
3559
3560 2019-04-29  Alex Christensen  <achristensen@webkit.org>
3561
3562         <rdar://problem/50299396> Fix internal High Sierra build
3563         https://bugs.webkit.org/show_bug.cgi?id=197388
3564
3565         * Configurations/Base.xcconfig:
3566
3567 2019-04-29  Zalan Bujtas  <zalan@apple.com>
3568
3569         Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
3570         https://bugs.webkit.org/show_bug.cgi?id=197347
3571         <rdar://problem/49393423>
3572
3573         Reviewed by Wenson Hsieh.
3574
3575         Tests: fast/events/touch/ios/double-tap-for-double-click1.html
3576                fast/events/touch/ios/double-tap-for-double-click2.html
3577
3578         * page/Frame.h:
3579         * page/ios/FrameIOS.mm:
3580         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
3581
3582 2019-04-30  Simon Fraser  <simon.fraser@apple.com>
3583
3584         Transform is sometimes left in a bad state after an animation
3585         https://bugs.webkit.org/show_bug.cgi?id=197401
3586         rdar://problem/48179186
3587
3588         Reviewed by Dean Jackson.
3589         
3590         In some more complex compositing scenarios, at the end of an animation we'd
3591         fail to push a new transform onto a layer, because updateGeometry() would
3592         think there's an animation running (which there is, but in the "Ending" state).
3593
3594         It's simpler in this code to just always push transform and opacity to the layer;
3595         they will get overridden by the animation while it's running. The current code
3596         dates from the first landing of the file, and the reason for the if (!isRunningAcceleratedTransformAnimation)
3597         check is lost in the sands of time.
3598
3599         I was not able to get a reliable ref or layer tree test for this, because the next compositing update
3600         fixes it, and WTR seems to trigger one.  But the added test does show the bug
3601         in Safari, and is a good test to have.
3602
3603         Test: compositing/animation/transform-after-animation.html
3604
3605         * rendering/RenderLayerBacking.cpp:
3606         (WebCore::RenderLayerBacking::updateGeometry):
3607
3608 2019-04-29  Youenn Fablet  <youenn@apple.com>
3609
3610         getDisplayMedia should be called on user gesture
3611         https://bugs.webkit.org/show_bug.cgi?id=197356
3612
3613         Reviewed by Eric Carlson.
3614
3615         Allow getDisplayMedia on user gesture only.
3616         Otherwise reject the promise.
3617         Minor refactoring to align getDisplayMedia, getUserMedia and
3618         enumerateDevices when called with no document.
3619
3620         Test: fast/mediastream/screencapture-user-gesture.html
3621
3622         * Modules/mediastream/MediaDevices.cpp:
3623         (WebCore::MediaDevices::getUserMedia const):
3624         * Modules/mediastream/MediaDevices.h:
3625         * Modules/mediastream/NavigatorMediaDevices.h:
3626         * page/DOMWindow.h:
3627         * testing/Internals.cpp:
3628         (WebCore::Internals::setDisableGetDisplayMediaUserGestureConstraint):
3629         * testing/Internals.h:
3630         * testing/Internals.idl:
3631
3632 2019-04-29  Javier Fernandez  <jfernandez@igalia.com>
3633
3634         line should not be broken before the first space after a word
3635         https://bugs.webkit.org/show_bug.cgi?id=197278
3636
3637         Reviewed by Myles C. Maxfield.
3638
3639         The 'white-space: break-spaces' only adds breaking opportunities after
3640         a white space character. However, it's possible to break before the
3641         first space after a word when the feature is used in combination with
3642         other properties, like overflow-wrap.
3643
3644         However, breaking before the first space should not be allowed if
3645         there are previous opportunities. We wrongly assumed that we had to
3646         consider these previous breaking opportunities if the proper combination
3647         of line breaking properties is being used, so that breaking before the
3648         first space after a word is allowed.
3649
3650         This wrong assumption caused several issues, like the one described in
3651         the bug, that lead to incorrectly break before the first space even
3652         though there are previous opportunities, either white spaces or between
3653         letters.
3654
3655         Theses issues have been analyzed [1] by the CSS WG and finally agreed on a
3656         expected behavior, represented in the Web Platform tests added in this
3657         patch.
3658
3659         For the later case, of considering previous opportunities between
3660         letters, we have a seperated issue #952254, so the tests covering such
3661         cases will be added to the TestExpecations as Failure entries.
3662
3663         [1] https://github.com/w3c/csswg-drafts/issues/3701
3664
3665         Tests: imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-001.html
3666                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-002.html
3667                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-003.html
3668                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-004.html
3669                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-005.html
3670                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-006.html
3671                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-007.html
3672                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-008.html
3673                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-009.html
3674                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-010.html
3675                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-011.html
3676                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-012.html
3677                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-013.html
3678
3679         * rendering/line/BreakingContext.h:
3680         (WebCore::BreakingContext::handleText):
3681         (WebCore::BreakingContext::trailingSpacesHang):
3682
3683 2019-04-29  Simon Fraser  <simon.fraser@apple.com>
3684
3685         REGRESSION (r238090): animation on https://www.robotodyssey.online gets stuck; site broken
3686         https://bugs.webkit.org/show_bug.cgi?id=197381
3687
3688         Reviewed by Zalan Bujtas.
3689
3690         When -webkit-clip-path changes on a composited layer, we need to trigger a backing geometry update
3691         to push the changes to GraphicsLayers.
3692
3693         Test: compositing/style-change/clip-path-change.html
3694
3695         * rendering/RenderLayerCompositor.cpp:
3696         (WebCore::recompositeChangeRequiresGeometryUpdate):
3697
3698 2019-04-29  Chris Dumez  <cdumez@apple.com>
3699
3700         User-facing strings should use curly quotes instead of straight
3701         https://bugs.webkit.org/show_bug.cgi?id=197370
3702
3703         Reviewed by Geoffrey Garen.
3704
3705         Update localizable strings.
3706
3707         * en.lproj/Localizable.strings:
3708
3709 2019-04-29  Ross Kirsling  <ross.kirsling@sony.com>
3710
3711         Unreviewed fix for non-unified build after r244687.
3712
3713         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
3714
3715 2019-04-29  Youenn Fablet  <youenn@apple.com>
3716
3717         RTCTrackEvent should be delayed until the whole remote description is set
3718         https://bugs.webkit.org/show_bug.cgi?id=196808
3719         <rdar://problem/49802649>
3720
3721         Reviewed by Eric Carlson.
3722
3723         As per https://w3c.github.io/webrtc-pc/#set-description,
3724         fire events just before resolving the setRemoteDescription promise.
3725         This ensures that the exposed stream has all necessary tracks from the beginning.
3726         Pending track events are created in LibWebRTCMediaEndpoint and stored in PeerConnectionBackend.
3727
3728         Covered by updated test.
3729
3730         * Modules/mediastream/PeerConnectionBackend.cpp:
3731         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
3732         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
3733         (WebCore::PeerConnectionBackend::addPendingTrackEvent):
3734         (WebCore::PeerConnectionBackend::stop):
3735         * Modules/mediastream/PeerConnectionBackend.h:
3736         * Modules/mediastream/RTCPeerConnection.cpp:
3737         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3738         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
3739         (WebCore::LibWebRTCMediaEndpoint::addPendingTrackEvent):
3740         (WebCore::LibWebRTCMediaEndpoint::newTransceiver):
3741         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3742
3743 2019-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3744
3745         REGRESSION(r244635): [GTK] Wrong background color used in non-dark mode
3746         https://bugs.webkit.org/show_bug.cgi?id=197276
3747
3748         Reviewed by Michael Catanzaro.
3749
3750         Since r244635, we are now getting the frame view background color from the theme. That's correct for dark mode,
3751         but in non-dark mode we still want to use white backgrounds by default. This made a lot of tests to fail.
3752
3753         * css/CSSValueKeywords.in: Add -webkit-control-background when HAVE(OS_DARK_MODE_SUPPORT).
3754         * css/html.css: Use -webkit-control-background instead of -apple-system-control-background.
3755         * page/FrameView.cpp:
3756         (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindow instead of CSSValueWindowframe.
3757         * rendering/RenderThemeGtk.cpp:
3758         (WebCore::RenderThemeGtk::systemColor const): Only get the window background from the theme in dark mode. Handle
3759         also CSSValueWebkitControlBackground.
3760         * rendering/RenderThemeMac.mm:
3761         (WebCore::RenderThemeMac::systemColor const): Handle CSSValueWebkitControlBackground when HAVE(OS_DARK_MODE_SUPPORT).
3762
3763 2019-04-28  Andy Estes  <aestes@apple.com>
3764
3765         [Apple Pay] Increment the API version from 6 to 7
3766         https://bugs.webkit.org/show_bug.cgi?id=197041
3767         <rdar://problem/49986625>
3768
3769         Reviewed by Geoffrey Garen.
3770
3771         * Modules/applepay/PaymentCoordinatorClient.cpp:
3772         (WebCore::PaymentCoordinatorClient::supportsVersion):
3773
3774 2019-04-28  Andy Estes  <aestes@apple.com>
3775
3776         Fix the watchOS engineering build.
3777
3778         * Modules/webgpu/WebGPUComputePassEncoder.cpp: Included Logging.h.
3779
3780 2019-04-28  Youenn Fablet  <youenn@apple.com>
3781
3782         Remove no longer needed mDNS ICE candidate resolution code
3783         https://bugs.webkit.org/show_bug.cgi?id=197315
3784
3785         Reviewed by Eric Carlson.
3786
3787         No change of behavior.
3788         Removed code is no longer exercised as mDNS resolution happens inside libwebrtc
3789         using the same resolution mechanism as for TURN/STUN server names.
3790
3791         * Modules/mediastream/PeerConnectionBackend.cpp:
3792         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
3793         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
3794         * Modules/mediastream/PeerConnectionBackend.h:
3795
3796 2019-04-27  Simon Fraser  <simon.fraser@apple.com>
3797
3798         Move some Compositing logging to the Layers log channel
3799         https://bugs.webkit.org/show_bug.cgi?id=197345
3800
3801         Reviewed by Sam Weinig.
3802
3803         Make Compositing logging a bit less verbose by moving the GraphicsLayer tree dump
3804         to the Layers log channel. Also log GraphicsLayers after flushing, when we'll have
3805         accurate visible rects. 
3806
3807         * platform/graphics/ca/GraphicsLayerCA.cpp:
3808         (WebCore::GraphicsLayerCA::updateCoverage):
3809         * rendering/RenderLayerCompositor.cpp:
3810         (WebCore::layersLogEnabled):
3811         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
3812         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3813
3814 2019-04-27  Megan Gardner  <megan_gardner@apple.com>
3815
3816         Lookup only looking up the first word in selection
3817         https://bugs.webkit.org/show_bug.cgi?id=197341
3818         <rdar://problem/48221414>
3819
3820         Reviewed by Wenson Hsieh.
3821
3822         Lookup is not testable.
3823
3824         Reveal needs the full range in order to correctly create the item for the popover.
3825
3826         * editing/cocoa/DictionaryLookup.mm:
3827         (WebCore::showPopupOrCreateAnimationController):
3828
3829 2019-04-26  Jer Noble  <jer.noble@apple.com>
3830
3831         Reduce the number of copies made during SourceBufferPrivateAVFObjC::append() using SharedBuffer
3832         https://bugs.webkit.org/show_bug.cgi?id=197335
3833         <rdar://problem/49175604>
3834
3835         Rubber-stamped by Alex Christensen.
3836
3837         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3838         (WebCore::SourceBufferPrivateAVFObjC::append):
3839
3840 2019-04-26  Jessie Berlin  <jberlin@webkit.org>
3841
3842         Add new mac target numbers
3843         https://bugs.webkit.org/show_bug.cgi?id=197313
3844
3845         Reviewed by Alex Christensen.
3846
3847         * Configurations/Version.xcconfig:
3848         * Configurations/WebKitTargetConditionals.xcconfig:
3849
3850 2019-04-26  Commit Queue  <commit-queue@webkit.org>
3851
3852         Unreviewed, rolling out r244708.
3853         https://bugs.webkit.org/show_bug.cgi?id=197334
3854
3855         "Broke the debug build" (Requested by rmorisset on #webkit).
3856
3857         Reverted changeset:
3858
3859         "All prototypes should call didBecomePrototype()"
3860         https://bugs.webkit.org/show_bug.cgi?id=196315
3861         https://trac.webkit.org/changeset/244708
3862
3863 2019-04-26  Robin Morisset  <rmorisset@apple.com>
3864
3865         All prototypes should call didBecomePrototype()
3866         https://bugs.webkit.org/show_bug.cgi?id=196315
3867
3868         Reviewed by Saam Barati.
3869
3870         It was found by existing tests, with the new assert in JSC::Structure
3871
3872         * bindings/js/JSWindowProxy.cpp:
3873         (WebCore::JSWindowProxy::setWindow):
3874         * bindings/scripts/CodeGeneratorJS.pm:
3875         (GeneratePrototypeDeclaration):
3876         (GenerateConstructorHelperMethods):
3877
3878 2019-04-26  Eric Carlson  <eric.carlson@apple.com>
3879
3880         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
3881         https://bugs.webkit.org/show_bug.cgi?id=197171
3882         <rdar://problem/47454979>
3883
3884         Reviewed by Youenn Fablet.
3885
3886         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
3887
3888         * Modules/plugins/QuickTimePluginReplacement.mm:
3889         (WebCore::jsValueWithValueInContext):
3890         (WebCore::jsValueWithAVMetadataItemInContext):
3891         * WebCore.xcodeproj/project.pbxproj:
3892         * platform/audio/ios/AudioSessionIOS.mm:
3893         (WebCore::AudioSession::setCategory):
3894         (WebCore::AudioSession::category const):
3895         (WebCore::AudioSession::routeSharingPolicy const):
3896         (WebCore::AudioSession::routingContextUID const):
3897         (WebCore::AudioSession::sampleRate const):
3898         (WebCore::AudioSession::bufferSize const):
3899         (WebCore::AudioSession::numberOfOutputChannels const):
3900         (WebCore::AudioSession::tryToSetActiveInternal):
3901         (WebCore::AudioSession::preferredBufferSize const):
3902         (WebCore::AudioSession::setPreferredBufferSize):
3903         * platform/audio/ios/MediaSessionManagerIOS.mm:
3904         (-[WebMediaSessionHelper initWithCallback:]):
3905         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
3906         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3907         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
3908         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
3909         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
3910         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3911         (WebCore::AudioSourceProviderAVFObjC::createMix):
3912         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
3913         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
3914         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
3915         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
3916         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
3917         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
3918         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3919         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
3920         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
3921         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
3922         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
3923         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
3924         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
3925         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
3926         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
3927         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
3928         (WebCore::CDMSessionAVContentKeySession::isAvailable):
3929         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
3930         (WebCore::CDMSessionAVContentKeySession::update):
3931         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
3932         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
3933         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
3934         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3935         (WebCore::CDMSessionAVStreamSession::releaseKeys):
3936         (WebCore::CDMSessionAVStreamSession::update):
3937         (WebCore::CDMSessionAVStreamSession::setStreamSession):
3938         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
3939         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3940         (WebCore::imageDecoderAssetOptions):
3941         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
3942         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
3943         (WebCore::ImageDecoderAVFObjC::readSamples):
3944         (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
3945         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
3946         (WebCore::InbandTextTrackPrivateAVFObjC::label const):
3947         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
3948         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
3949         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3950         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
3951         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3952         (WebCore::assetCacheForPath):
3953         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
3954         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
3955         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
3956         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
3957         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
3958         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
3959         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
3960         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
3961         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
3962         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
3963         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
3964         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
3965         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
3966         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
3967         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
3968         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
3969         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
3970         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
3971         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
3972         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
3973         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
3974         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
3975         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
3976         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
3977         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
3978         (WebCore::exernalDeviceDisplayNameForPlayer):
3979         (WebCore::metadataType):
3980         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
3981         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3982         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
3983         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
3984         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
3985         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3986         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
3987         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
3988         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
3989         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
3990         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
3991         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3992         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
3993         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
3994         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
3995         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3996         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
3997         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
3998         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
3999