38cbbd5150d42b23bd4413dc0c2bd6f7b20dfefb
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-03-30  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Copying a list from Microsoft Word to TinyMCE fails when mso-list is the first property
4         https://bugs.webkit.org/show_bug.cgi?id=182938
5         <rdar://problem/37683007>
6
7         Reviewed by Wenson Hsieh.
8
9         Made the logic to detect Microsoft Word's mso-list CSS property more generic by detecting
10         inline styles which start with "mso-list:" and one which line-break right before it: "\nmso-list:"
11
12         Tests: PasteHTML.PreservesMSOList
13
14         * editing/markup.cpp:
15         (WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement):
16
17 2018-03-30  Youenn Fablet  <youenn@apple.com>
18
19         NetworkLoadChecker should upgrade redirects if needed
20         https://bugs.webkit.org/show_bug.cgi?id=184098
21
22         Reviewed by Chris Dumez.
23
24         Test: imported/w3c/web-platform-tests/beacon/upgrade-beacon.https.html
25
26         * page/csp/ContentSecurityPolicy.h:
27
28 2018-03-30  Daniel Bates  <dabates@apple.com>
29
30         ASSERTION FAILED: ASSERT(!containsImage || MIMETypeRegistry::isSupportedImageResourceMIMEType([resource MIMEType])) in -[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:]
31         https://bugs.webkit.org/show_bug.cgi?id=184161
32
33         Reviewed by Per Arne Vollan.
34
35         Fixes an assertion failure when quiting an app that uses a Legacy WebKit web view
36         after dragging-and-dropping a PDF embedded using an HTML image element into the
37         same web view.
38
39         When performing a drag-and-drop of a PDF document image (WebCore::PDFDocumentImage) we create a WebArchive
40         from the main frame's WebHTMLView and promise AppKit that will provide a Rich Text Format (RTF) document
41         from this archive if needed. For some reason, on app termination AppKit requests that the WebHTMLView
42         fullfill its RTF document promise for the WebArchive created at the start of the drag operation. WebKit
43         expects that the created WebArchive is either for an inline image (e.g. <img>) or an image document that
44         has a supported image resource MIME type (by querying MIMETypeRegistry::isSupportedImageResourceMIMEType())
45         and checks for these cases in this order. PDF/PostScript are not listed in the set of supported image
46         resource MIME types. So, the first check fails and WebKit assumes that the WebArchive was created from
47         an image document of a supported image resource MIME type. However, the WebArchive was created from a
48         WebHTMLView and has MIME type text/html. Therefore the assertion fails. We need to add PDF and PostScript
49         to the set of supported image resource MIME types so that WebKit does not fall back to the WebHTMLView
50         code path. Historically, PDF and PostScript were in the set supported image resource MIME types. Over time
51         the set of MIME types for image resouces (images loaded as a document) became identical to the set of MIME
52         types for images loaded inline (e.g. <img>) and this set omitted the MIME types for PDF and PostScript.
53
54         Additionally it is sufficient to implement MIMETypeRegistry::isSupportedImageResourceMIMEType() in terms
55         of MIMETypeRegistry::isSupportedImageMIMEType() and MIMETypeRegistry::isPDFOrPostScriptMIMEType() instead
56         of allocating a dedicated HashSet for the supported image resource MIME types (as we currently do).
57
58         * dom/DOMImplementation.cpp:
59         (WebCore::DOMImplementation::createDocument): Assert that PDF is a supported image MIME type before
60         instantiating an ImageDocument.
61         * platform/MIMETypeRegistry.cpp:
62         (WebCore::initializeSupportedImageMIMETypes): Remove unnecessary allocation of a HashSet for the support
63         image resource MIME types.
64         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Write in terms of MIMETypeRegistry::isSupportedImageMIMEType()
65         and MIMETypeRegistry::isPDFOrPostScriptMIMEType().
66         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted.
67         * platform/MIMETypeRegistry.h:
68
69 2018-03-29  Antoine Quint  <graouts@apple.com>
70
71         [Web Animations] CSSTransition objects should have fill: backwards to allow seeking prior to start time
72         https://bugs.webkit.org/show_bug.cgi?id=184129
73
74         Reviewed by Dean Jackson.
75
76         In order to allow a CSS Transition to be seeked prior to its start time, it needs to have its fill mode set
77         to backwards. Adding code to set the fill mode in CSSTransition::initialize() yields early timing model
78         invalidation and we could get in a situation where stylesWouldYieldNewCSSTransitionsBlendingKeyframes()
79         was called before we had a chance to create blending keyframes for a CSS transitions, since the call
80         to create blending keyframes is made after the call to initialize(), so we now cater for this case.
81
82         * animation/CSSTransition.cpp:
83         (WebCore::CSSTransition::initialize):
84         * animation/CSSTransition.h:
85         * animation/KeyframeEffectReadOnly.cpp:
86         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const):
87
88 2018-03-30  Daniel Bates  <dabates@apple.com>
89
90         Remove unused MIMETypeRegistry::getSupportedImageMIMETypesForEncoding()
91         https://bugs.webkit.org/show_bug.cgi?id=184154
92
93         Reviewed by Per Arne Vollan.
94
95         * platform/MIMETypeRegistry.cpp:
96         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding): Deleted.
97         * platform/MIMETypeRegistry.h:
98
99 2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>
100
101         Unreviewed, rolling out r230102.
102
103         Caused assertion failures on JSC bots.
104
105         Reverted changeset:
106
107         "A stack overflow in the parsing of a builtin (called by
108         createExecutable) cause a crash instead of a catchable js
109         exception"
110         https://bugs.webkit.org/show_bug.cgi?id=184074
111         https://trac.webkit.org/changeset/230102
112
113 2018-03-30  Robin Morisset  <rmorisset@apple.com>
114
115         A stack overflow in the parsing of a builtin (called by createExecutable) cause a crash instead of a catchable js exception
116         https://bugs.webkit.org/show_bug.cgi?id=184074
117         <rdar://problem/37165897>
118
119         Reviewed by Keith Miller.
120
121         I had to slightly change the type of some bindings between JSC and WebCore. No functional change intended on the WebCore side.
122
123         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
124         (WebCore::JSBuiltinReadableStreamDefaultReaderPrivateConstructor::initializeExecutable):
125         (WebCore::JSBuiltinReadableStreamDefaultControllerPrivateConstructor::initializeExecutable):
126         (WebCore::JSBuiltinReadableByteStreamControllerPrivateConstructor::initializeExecutable):
127         (WebCore::JSBuiltinReadableStreamBYOBReaderPrivateConstructor::initializeExecutable):
128         (WebCore::JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable):
129         * bindings/scripts/CodeGeneratorJS.pm:
130         (GenerateConstructorHelperMethods):
131         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
132         (WebCore::JSTestClassWithJSBuiltinConstructorConstructor::initializeExecutable):
133         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
134         (WebCore::JSTestJSBuiltinConstructorConstructor::initializeExecutable):
135
136 2018-03-29  Antoine Quint  <graouts@apple.com>
137
138         [Web Animations] Correctly obtain the timing function for a given keyframe
139         https://bugs.webkit.org/show_bug.cgi?id=184146
140
141         Reviewed by Dean Jackson.
142
143         The way we would get the timing function for a given KeyframeValue stored in a KeyframeList was really suboptimal.
144         When keyframes were created, we would set the animated element's style on each keyframe, and set keyframe-specific
145         properties and values on top. When figuring out the timing function for a KeyframeValue, we would look at its render
146         style, go through its list of animations, which could include animations that are irrelevant to this specific keyframe
147         list since all animations from the animated element are referenced, and we would have to look up the correct animation
148         by name and get the timing function, even though the timing function stored on the animation was now specific to this
149         particular keyframe.
150
151         We now simply set a m_timingFunction member on a KeyframeValue, which is null if no explicit animation-timing-function
152         was provided for this keyframe in CSS, and otherwise set to a valid TimingFunction.
153
154         This fixes our behavior for a 4 existing animation tests when opted into the CSS Animations and CSS Transitions as
155         Web Animations feature.
156
157         * animation/KeyframeEffectReadOnly.cpp:
158         (WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
159         * css/StyleResolver.cpp:
160         (WebCore::StyleResolver::keyframeStylesForAnimation):
161         * page/animation/KeyframeAnimation.cpp:
162         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty const):
163         * platform/animation/TimingFunction.cpp:
164         (WebCore::TimingFunction::createFromCSSText):
165         (WebCore::TimingFunction::createFromCSSValue):
166         * platform/animation/TimingFunction.h:
167         * rendering/RenderLayerBacking.cpp:
168         (WebCore::RenderLayerBacking::startAnimation):
169         * rendering/style/KeyframeList.cpp:
170         (WebCore::KeyframeValue::timingFunction const): Deleted.
171         * rendering/style/KeyframeList.h:
172         (WebCore::KeyframeValue::timingFunction const):
173         (WebCore::KeyframeValue::setTimingFunction):
174
175 2018-03-29  Ryosuke Niwa  <rniwa@webkit.org>
176
177         Copying a list from Microsoft Word to TinyMCE fails when mso-list is on tags other than P
178         https://bugs.webkit.org/show_bug.cgi?id=182954
179         <rdar://problem/37713141>
180
181         Reviewed by Wenson Hsieh.
182
183         Fixed the bug by relaxing the restriction that we only preserve mso-list on p.
184
185         Tests: PasteHTML.PreservesMSOListOnH4
186
187         * editing/markup.cpp:
188         (WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement):
189
190 2018-03-29  JF Bastien  <jfbastien@apple.com>
191
192         Use Forward.h instead of forward-declaring WTF::String
193         https://bugs.webkit.org/show_bug.cgi?id=184172
194         <rdar://problem/39026146>
195
196         Reviewed by Yusuke Suzuki.
197
198         As part of #184164 I'm changing WTF::String, and the forward
199         declarations are just wrong because I'm making it templated. We
200         should use Forward.h anyways, so do that instead.
201
202         * css/makeprop.pl:
203         * platform/cocoa/PlaybackSessionInterface.h:
204         * platform/ios/Device.h:
205         * platform/ios/PlaybackSessionInterfaceAVKit.h:
206         * platform/ios/VideoFullscreenInterfaceAVKit.h:
207         * platform/win/PathWalker.h:
208         * testing/js/WebCoreTestSupport.h:
209
210 2018-03-29  Ross Kirsling  <ross.kirsling@sony.com>
211
212         MSVC __forceinline slows down JSC release build fivefold after r229391
213         https://bugs.webkit.org/show_bug.cgi?id=184062
214
215         Reviewed by Alex Christensen.
216
217         * platform/graphics/FormatConverter.cpp:
218         Factor ALWAYS_INLINE_EXCEPT_MSVC out to WTF.
219
220 2018-03-29  Ryan Haddad  <ryanhaddad@apple.com>
221
222         Unreviewed, rolling out r230087.
223
224         Introduced LayoutTest failures.
225
226         Reverted changeset:
227
228         "FrameSelection::appearanceUpdateTimerFired should be robust
229         against layout passes underneath it"
230         https://bugs.webkit.org/show_bug.cgi?id=183395
231         https://trac.webkit.org/changeset/230087
232
233 2018-03-29  Wenson Hsieh  <wenson_hsieh@apple.com>
234
235         FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it
236         https://bugs.webkit.org/show_bug.cgi?id=183395
237         <rdar://problem/38055732>
238
239         Reviewed by Zalan Bujtas.
240
241         In the case where a FrameSelection updates its appearance when m_appearanceUpdateTimer is fired, the
242         FrameSelection's Frame is unprotected, and can be removed by arbitrary script. This patch applies a simple
243         mitigation by wrapping the Frame in a Ref when firing the appearance update timer, and ensuring that layout is
244         really up to date before calling updateAppearanceAfterLayoutOrStyleChange() from the timer.
245
246         Test: editing/selection/iframe-update-selection-appearance.html
247
248         * editing/FrameSelection.cpp:
249         (WebCore::FrameSelection::appearanceUpdateTimerFired):
250
251 2018-03-29  Daniel Bates  <dabates@apple.com>
252
253         Substitute ArchiveFactory::isArchiveMIMEType() for ArchiveFactory::isArchiveMimeType().
254
255         * loader/DocumentLoader.cpp:
256         (WebCore::DocumentLoader::commitLoad):
257         * loader/archive/ArchiveFactory.cpp:
258         (WebCore::ArchiveFactory::isArchiveMIMEType):
259         (WebCore::ArchiveFactory::isArchiveMimeType): Deleted.
260         * loader/archive/ArchiveFactory.h:
261         * platform/MIMETypeRegistry.h:
262
263 2018-03-29  Daniel Bates  <dabates@apple.com>
264
265         MIMETypeRegistry should return const HashSets
266         https://bugs.webkit.org/show_bug.cgi?id=184150
267
268         Reviewed by Per Arne Vollan.
269
270         Only getSupportedNonImageMIMETypes() needs to return a non-const HashSet so that
271         LegacyWebKit can modify the set of non-image MIME types.
272
273         * platform/MIMETypeRegistry.cpp:
274         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
275         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
276         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding):
277         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes):
278         (WebCore::MIMETypeRegistry::getPDFMIMETypes):
279         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):
280         * platform/MIMETypeRegistry.h:
281
282 2018-03-29  Brady Eidson  <beidson@apple.com>
283
284         Update Service Worker feature status.
285         https://bugs.webkit.org/show_bug.cgi?id=184139
286
287         Reviewed by Chris Dumez.
288
289         * features.json:
290
291 2018-03-29  Chris Dumez  <cdumez@apple.com>
292
293         Drop DOMWindow::frames() / DOMWindow::window() methods
294         https://bugs.webkit.org/show_bug.cgi?id=184112
295
296         Reviewed by Daniel Bates.
297
298         Drop DOMWindow::frames() / DOMWindow::window() methods as they are just aliases for DOMWindow::self().
299
300         * page/DOMWindow.h:
301         * page/DOMWindow.idl:
302
303 2018-03-29  Commit Queue  <commit-queue@webkit.org>
304
305         Unreviewed, rolling out r230062.
306         https://bugs.webkit.org/show_bug.cgi?id=184128
307
308         Broke mac port. web content process crashes while loading any
309         web page (Requested by rniwa on #webkit).
310
311         Reverted changeset:
312
313         "MSVC __forceinline slows down JSC release build fivefold
314         after r229391"
315         https://bugs.webkit.org/show_bug.cgi?id=184062
316         https://trac.webkit.org/changeset/230062
317
318 2018-03-28  Antoine Quint  <graouts@apple.com>
319
320         [Web Animations] Implement more CSSPropertyBlendingClient methods
321         https://bugs.webkit.org/show_bug.cgi?id=184077
322
323         Reviewed by Dean Jackson.
324
325         We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
326         were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
327         the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
328         CSS Transitions as Web Animations feature.
329
330         We also ensure we only run a CSSAnimationController assertion in FrameView::didDestroyRenderTree() if
331         we're not using the CSS Animations and CSS Transitions as Web Animations feature.
332
333         * animation/KeyframeEffectReadOnly.cpp:
334         (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
335         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
336         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
337         (WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
338         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
339         (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
340         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
341         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
342         * animation/KeyframeEffectReadOnly.h:
343         * page/FrameView.cpp:
344         (WebCore::FrameView::didDestroyRenderTree):
345
346 2018-03-28  Chris Dumez  <cdumez@apple.com>
347
348         Align XMLHttpRequest's open() / send() / abort() with the latest specification
349         https://bugs.webkit.org/show_bug.cgi?id=184108
350
351         Reviewed by Youenn Fablet.
352
353         Align XMLHttpRequest's open() / send() / abort() with the latest specification:
354         - https://xhr.spec.whatwg.org
355
356         No new tests, rebaselined existing layout tests.
357
358         * xml/XMLHttpRequest.cpp:
359         (WebCore::XMLHttpRequest::open):
360         Align with https://xhr.spec.whatwg.org/#the-open()-method:
361         - Change the order of some steps to match the order in the spec. In particular,
362           open() no longer resets the state to UNSENT or abort any existing load when it
363           fails early due to being passed a bad method.
364
365         (WebCore::XMLHttpRequest::createRequest):
366         Align with https://xhr.spec.whatwg.org/#the-send()-method:
367         - Use the simpler "upload listener flag" logic from the spec instead of our more
368           complex m_uploadEventsAllowed flag. This avoids constructing a SecurityOrigin
369           objects on a background thread when XHR is used inside Web Workers, which was
370           not thread-safe.
371         - Set the upload complete flag when the request has no body as per step 9.
372         - After firing the loadstartEvent, return early if the state is no longer OPEN or
373           if the send flag is unset, as per step 11.3.
374
375         (WebCore::XMLHttpRequest::abort):
376         Align with https://xhr.spec.whatwg.org/#the-abort()-method:
377         - Only set the state to UNSENT if the state is still DONE after firing the error
378           events, as per step 3.
379
380         (WebCore::XMLHttpRequest::didSendData):
381         Use new "upload listener flag".
382
383         (WebCore::XMLHttpRequest::dispatchErrorEvents):
384         Align with https://xhr.spec.whatwg.org/#request-error-steps:
385         - Stop firing a progress event in case of error as this is not as per specification
386           and Firefox does not fire those either.
387
388         * xml/XMLHttpRequest.h:
389
390 2018-03-28  Timothy Hatcher  <timothy@apple.com>
391
392         Consolidate NSColor to WebCore::Color conversion and fix system colors.
393
394         https://bugs.webkit.org/show_bug.cgi?id=184096
395         rdar://problem/38918925
396
397         Reviewed by Tim Horton.
398
399         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
400         (CreateCGColorIfDifferent): Use CGColor property on NSColor, don't manually create new CGColor.
401         * platform/graphics/mac/ColorMac.h:
402         * platform/graphics/mac/ColorMac.mm:
403         (WebCore::makeRGBAFromNSColor): Move pattern code from RenderThemeMac's convertNSColorToColor.
404         Also use nextafter for proper RGBA float conversion.
405         * platform/mac/PlatformPasteboardMac.mm:
406         (WebCore::PlatformPasteboard::color): Use colorFromNSColor.
407         * rendering/RenderThemeMac.mm:
408         (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): Use colorFromNSColor.
409         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): Ditto.
410         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): Ditto.
411         (WebCore::RenderThemeMac::systemColor const): Ditto.
412         (WebCore::paintAttachmentTitleBackground): Ditto.
413         (WebCore::convertNSColorToColor): Deleted.
414
415 2018-03-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
416
417         The SVGAnimatedProperty wrappers have to be detached from the referenced values before the SVGAnimatedType is deleted
418         https://bugs.webkit.org/show_bug.cgi?id=183972
419
420         Reviewed by Daniel Bates.
421
422         If the SVGAnimatedType is a list type, e.g. SVGLengthListValues, the wrappers
423         of the animated properties have to be detached from the items in the list
424         before it's deleted.
425
426         * svg/SVGAnimateElementBase.cpp:
427         (WebCore::SVGAnimateElementBase::clearAnimatedType):
428
429 2018-03-28  Ross Kirsling  <ross.kirsling@sony.com>
430
431         MSVC __forceinline slows down JSC release build fivefold after r229391
432         https://bugs.webkit.org/show_bug.cgi?id=184062
433
434         Reviewed by Alex Christensen.
435
436         * platform/graphics/FormatConverter.cpp:
437         Factor ALWAYS_INLINE_EXCEPT_MSVC out to WTF.
438
439 2018-03-28  Zalan Bujtas  <zalan@apple.com>
440
441         Make it possible to override the screen size
442         https://bugs.webkit.org/show_bug.cgi?id=184111
443         <rdar://problem/38972181>
444
445         Reviewed by Tim Horton.
446
447         We just call screenSize() atm.
448
449         * page/Chrome.cpp:
450         (WebCore::Chrome::overrideScreenSize const):
451         * page/Chrome.h:
452         * page/ChromeClient.h:
453         * platform/HostWindow.h:
454         * platform/PlatformScreen.h:
455         * platform/ios/PlatformScreenIOS.mm:
456         (WebCore::screenRect):
457         (WebCore::overrideScreenSize):
458
459 2018-03-28  Timothy Hatcher  <timothy@apple.com>
460
461         Include the 'text' color keyword as a system color.
462
463         https://bugs.webkit.org/show_bug.cgi?id=184113
464         rdar://problem/38779267
465
466         Reviewed by Tim Horton.
467
468         * css/StyleColor.cpp:
469         (WebCore::StyleColor::isColorKeyword): Don't check CSSValueMenu, it is a system color and is included.
470         (WebCore::StyleColor::isSystemColor): Include CSSValueText. Check CSSValueWebkitFocusRingColor in the range,
471         since it is immediately after CSSValueAppleSystemYellow.
472
473 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
474
475         [iOS] Multiple select appearance doesn't update when selecting or deselecting rows in the picker view
476         https://bugs.webkit.org/show_bug.cgi?id=184110
477         <rdar://problem/38796648>
478
479         Reviewed by Tim Horton.
480
481         HTMLSelectElement::optionSelectedByUser is invoked upon user interaction with a select menu. This currently
482         takes two separate codepaths, depending on whether or not the menu list appearance is being used to render the
483         select. If a menu list appearance is used, we call selectOption(), which updates validity, updates the element
484         renderer, and then dispatches a `change` event if needed.
485
486         However, if updateSelectedState() is used, we only update form validity and then dispatch the `change` event
487         without updating the renderer, leaving it stale.
488
489         Test: fast/forms/ios/ipad/multiple-select-updates-renderer.html
490
491         * html/HTMLSelectElement.cpp:
492         (WebCore::HTMLSelectElement::optionSelectedByUser):
493
494         Update the renderer after updating the DOM to reflect the selected option.
495
496 2018-03-28  Daniel Bates  <dabates@apple.com>
497
498         Substitute "strong password confirmation auto fill" for "strong confirmation password auto fill"
499         <rdar://problem/36518856>
500
501         * English.lproj/Localizable.strings:
502         * platform/LocalizedStrings.cpp:
503         (WebCore::AXAutoFillStrongConfirmationPasswordLabel):
504
505 2018-03-28  Daniel Bates  <dabates@apple.com>
506
507         WebSocket cookie incorrectly stored
508         https://bugs.webkit.org/show_bug.cgi?id=184100
509         <rdar://problem/37928715>
510
511         Reviewed by Brent Fulgham.
512
513         A cookie received in a WebSocket response should be stored with respect to the
514         origin of the WebSocket server in order for it to be sent in a subsequent request.
515
516         Also removed a FIXME about implementing support for the long since
517         deprecated Set-Cookie2 header.
518
519         Test: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html
520
521         * Modules/websockets/WebSocketChannel.cpp:
522         (WebCore::WebSocketChannel::processBuffer):
523         * Modules/websockets/WebSocketHandshake.h:
524
525 2018-03-28  Chris Dumez  <cdumez@apple.com>
526
527         Do process swap when opening a cross-origin URL via window.open(url, '_blank', 'noopener')
528         https://bugs.webkit.org/show_bug.cgi?id=183962
529         <rdar://problem/38817833>
530
531         Reviewed by Brady Eidson.
532
533         Pass extra bits of information to the UIProcess via NavigationAction:
534         - Is it a cross origin navigation caused by window.open()
535         - Does the navigated frame have an opener
536
537         This information is useful to determine on UIProcess side if we want
538         to swap WebProcess.
539
540         * loader/FrameLoadRequest.h:
541         (WebCore::FrameLoadRequest::setIsCrossOriginWindowOpenNavigation):
542         (WebCore::FrameLoadRequest::isCrossOriginWindowOpenNavigation const):
543         * loader/FrameLoader.cpp:
544         (WebCore::FrameLoader::loadURL):
545         * loader/NavigationAction.h:
546         (WebCore::NavigationAction::setIsCrossOriginWindowOpenNavigation):
547         (WebCore::NavigationAction::isCrossOriginWindowOpenNavigation const):
548         (WebCore::NavigationAction::setOpener):
549         (WebCore::NavigationAction::opener const):
550         * page/DOMWindow.cpp:
551         (WebCore::DOMWindow::createWindow):
552
553 2018-03-28  Chris Dumez  <cdumez@apple.com>
554
555         Thread safety issue in IDBFactory' shouldThrowSecurityException()
556         https://bugs.webkit.org/show_bug.cgi?id=184064
557
558         Reviewed by Ryosuke Niwa.
559
560         shouldThrowSecurityException() gets called on a non-main thread but
561         it ended up using the SchemeRegistry via SecurityOrigin::canAccessDatabase()
562         which calls SecurityOrigin::isLocal().
563
564         Since using the SchemeRegistry from the background thread is not safe
565         (we recently added locks which we're trying to remove), and since SecurityOrigin
566         methods are often called from background threads, this patch make SecurityOrigin::isLocal()
567         safe to call from a background thread. To achieve this, we now query the SchemeRegistry
568         in the SecurityOrigin constructor instead as SecurityOrigin objects are expected to be
569         constructed on the main thread.
570
571         * page/SecurityOrigin.cpp:
572         (WebCore::SecurityOrigin::SecurityOrigin):
573         (WebCore::SecurityOrigin::isLocal const): Deleted.
574         * page/SecurityOrigin.h:
575         (WebCore::SecurityOrigin::isLocal const):
576
577 2018-03-28  Ryan Haddad  <ryanhaddad@apple.com>
578
579         Unreviewed, rolling out r230033.
580
581         The LayoutTests modified in this change fail an assertion on
582         WK1.
583
584         Reverted changeset:
585
586         "[Web Animations] Implement more CSSPropertyBlendingClient
587         methods"
588         https://bugs.webkit.org/show_bug.cgi?id=184077
589         https://trac.webkit.org/changeset/230033
590
591 2018-03-28  Chris Dumez  <cdumez@apple.com>
592
593         WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread
594         https://bugs.webkit.org/show_bug.cgi?id=184068
595
596         Reviewed by Youenn Fablet.
597
598         WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread,
599         which is not safe. We now use SecurityOriginData since we only need an origin String and
600         it is safe to construct a SecurityOriginData on any thread.
601
602         * Modules/websockets/WebSocket.cpp:
603         (WebCore::WebSocket::didReceiveMessage):
604
605 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
606
607         [Extra zoom mode] Make boosted text autosizing values switchable at runtime
608         https://bugs.webkit.org/show_bug.cgi?id=184092
609         <rdar://problem/38939917>
610
611         Reviewed by Tim Horton.
612
613         In r228697, we introduced a new set of boosted text autosizing constants tuned for extra zoom mode, which are
614         currently hard-coded as default values in SettingsBase. However, we've since identified cases where clients may
615         want to opt in or out of boosted text autosizing values and just use the existing values.
616
617         This replaces settings to adjust text autosizing constants with a flag to enable or disable boosted text
618         autosizing; when changed, we update all three text autosizing parameters to their default or boosted values, and
619         then trigger style recalculation.
620
621         Test: TextAutosizingBoost.ChangeAutosizingBoostAtRuntime
622
623         * page/Settings.yaml:
624         * page/SettingsBase.cpp:
625         (WebCore::SettingsBase::shouldEnableTextAutosizingBoostChanged):
626         (WebCore::SettingsBase::defaultOneLineTextMultiplierCoefficient): Deleted.
627         (WebCore::SettingsBase::defaultMultiLineTextMultiplierCoefficient): Deleted.
628         (WebCore::SettingsBase::defaultMaxTextAutosizingScaleIncrease): Deleted.
629
630         Changed these to constant values instead of helper functions, and also introduced boosted text autosizing
631         constants for use in extra zoom mode.
632
633         * page/SettingsBase.h:
634         (WebCore::SettingsBase::oneLineTextMultiplierCoefficient const):
635         (WebCore::SettingsBase::multiLineTextMultiplierCoefficient const):
636         (WebCore::SettingsBase::maxTextAutosizingScaleIncrease const):
637         * rendering/RenderThemeIOS.mm:
638         (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
639
640         Tweak the stylesheet to make `-webkit-text-size-adjust: auto` overridable by web content. Adding the !important
641         is breaking many websites that positioned text such that it is positioned within layout viewport bounds without
642         text autosizing.
643
644 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
645
646         Avoid uninitialized mach ports
647         https://bugs.webkit.org/show_bug.cgi?id=184090
648         <rdar://problem/37261129>
649
650         Reviewed by Chris Dumez.
651
652         It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value
653         of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so
654         there is a potential for us to try to use invalid ports.
655
656         We should always check return values, and ensure that the mach port variables we seek to initialize are
657         kept in a valid state.
658
659         No new tests, no Web-facing behavior change.
660
661         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
662         (WebCore::attachToAppleGraphicsControl): Initialize masterPort to a default value.
663
664 2018-03-28  Antoine Quint  <graouts@apple.com>
665
666         [Web Animations] Implement more CSSPropertyBlendingClient methods
667         https://bugs.webkit.org/show_bug.cgi?id=184077
668
669         Reviewed by Dean Jackson.
670
671         We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
672         were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
673         the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
674         CSS Transitions as Web Animations feature.
675
676         * animation/KeyframeEffectReadOnly.cpp:
677         (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
678         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
679         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
680         (WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
681         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
682         (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
683         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
684         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
685         * animation/KeyframeEffectReadOnly.h:
686
687 2018-03-28  Antoine Quint  <graouts@apple.com>
688
689         [Web Animations] Comparing two matching FramesTimingFunction objects fails
690         https://bugs.webkit.org/show_bug.cgi?id=184078
691
692         Reviewed by Jon Lee.
693
694         Fix a stupid mistake in the == operator for FramesTimingFunction. Without a correct check, we would mistakenly interrupt and
695         restart any transition with a frames() timing function when we check that the Animation objects are similar.
696
697         * platform/animation/TimingFunction.h:
698
699 2018-03-28  Miguel Gomez  <magomez@igalia.com>
700
701         [GTK][WPE] Remove UpdateAtlas
702         https://bugs.webkit.org/show_bug.cgi?id=184042
703
704         Reviewed by Žan Doberšek.
705
706         Remove UpdateAtlas and AreaAllocator classes. Instead of using UpdateAtlas as a cache
707         of buffers to render tiles with cairo, allocate a new buffer for each tile instead.
708
709         Covered by existent tests.
710
711         * loader/EmptyClients.h:
712         * page/ChromeClient.h:
713         * platform/TextureMapper.cmake:
714         * platform/graphics/texmap/coordinated/AreaAllocator.cpp: Removed.
715         * platform/graphics/texmap/coordinated/AreaAllocator.h: Removed.
716         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
717         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
718         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
719         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
720         * platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:
721         (): Deleted.
722         * platform/graphics/texmap/coordinated/UpdateAtlas.cpp: Removed.
723         * platform/graphics/texmap/coordinated/UpdateAtlas.h: Removed.
724         * testing/Internals.cpp:
725         (WebCore::Internals::resetToConsistentState):
726
727 2018-03-27  Michael Catanzaro  <mcatanzaro@igalia.com>
728
729         Unreviewed, rolling out r230008.
730
731         Lots of HTTP test failures
732
733         Reverted changeset:
734
735         "Remove unused libsoup ResourceHandle implementation"
736         https://bugs.webkit.org/show_bug.cgi?id=184048
737         https://trac.webkit.org/changeset/230008
738
739 2018-03-27  Chris Dumez  <cdumez@apple.com>
740
741         Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
742         https://bugs.webkit.org/show_bug.cgi?id=184029
743
744         Reviewed by Youenn Fablet.
745
746         Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
747         by having it use SecurityOriginData (which is safe to construct on non-main threads) instead of
748         SecurityOrigin (which isn't).
749
750         ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() is already called from non-main thread in
751         FetchLoader, XHR and WebSocket when used in workers. This wasn't safe.
752
753         * loader/DocumentWriter.cpp:
754         (WebCore::DocumentWriter::begin):
755         * page/csp/ContentSecurityPolicy.cpp:
756         (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):
757         (WebCore::ContentSecurityPolicy::setUpgradeInsecureRequests):
758         (WebCore::ContentSecurityPolicy::takeNavigationRequestsToUpgrade):
759         (WebCore::ContentSecurityPolicy::setInsecureNavigationRequestsToUpgrade):
760         * page/csp/ContentSecurityPolicy.h:
761
762 2018-03-27  Daniel Bates  <dabates@apple.com>
763
764         Attempt to fix media control layout tests after <https://trac.webkit.org/changeset/230006/>
765         (https://bugs.webkit.org/show_bug.cgi?id=179983)
766
767         Exempt elements in user agent shadow DOM from having to perform a potentially CORS-
768         enabled fetch for a mask image to try to fix the following tests from timing out:
769             media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html
770             media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html
771
772         * style/StylePendingResources.cpp:
773         (WebCore::Style::loadPendingImage):
774
775 2018-03-27  Per Arne Vollan  <pvollan@apple.com>
776
777         The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
778         https://bugs.webkit.org/show_bug.cgi?id=183923
779         <rdar://problem/38756869>
780
781         Reviewed by Brent Fulgham.
782
783         The test is timing out when we do not interact directly with the WindowServer, causing
784         OpenGL to fall back to software rendering. In this mode, any call to CGLChoosePixelFormat
785         requesting an accelerated pixel format will fail because it cannot determine which GPU is
786         connected to the display.
787
788         OpenGL treats all GPUs as if they were offline when used in a process (like the WebContent
789         process) that does not directly control the display.
790
791         We can get correct behavior if we tell OpenGL which GPU is currently connected to the
792         display, and if we instruct CGLChoosePixelFormat to create an offline renderer pixel format
793         by including the 'kCGLPFAAllowOfflineRenderers' flag in its arguments.
794
795         We can use CGLSetVirtualScreen with an OpenGL display mask that tells the OpenGL framework
796         which GPU it should use.
797
798         See https://developer.apple.com/library/content/technotes/tn2229/_index.html#//apple_ref/doc/uid/DTS40008924-CH1-SUBSECTION7
799         for details on how the virtual screen is found from the OpenGL display mask.
800
801         No new tests, covered by existing tests.
802
803         * WebCore.xcodeproj/project.pbxproj:
804         * platform/graphics/GraphicsContext3D.h:
805         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
806         (WebCore::setPixelFormat):
807         (WebCore::identifyAndSetCurrentGPU):
808         (WebCore::GraphicsContext3D::GraphicsContext3D):
809         (WebCore::GraphicsContext3D::setOpenGLDisplayMask):
810         (WebCore::GraphicsContext3D::allowOfflineRenderers):
811
812 2018-03-27  Jiewen Tan  <jiewen_tan@apple.com>
813
814         [WebAuthN] Implement authenticatorGetAssertion
815         https://bugs.webkit.org/show_bug.cgi?id=183881
816         <rdar://problem/37258628>
817
818         Reviewed by Brent Fulgham.
819
820         This patch does the following few things:
821         1) It implements the spec: https://www.w3.org/TR/webauthn/#op-get-assertion as of 5 December 2017.
822         2) It tweaks encoding/decoding of PublicKeyCredentialRequestOptions such that options can be passed
823         between UI and Web processes.
824         3) It refines the way how LocalAuthenticator::makeCredential find intersection between
825         excludeCredentialDescriptorList and existing credentials in the authenticator, such that it is faster.
826         Basically, it takes the CredentialID from the list and treat it as an ASCII string and put it into a
827         HashSet<String>. It should not matter if a duplicated CredentialID is added. If the hash set is not
828         empty, the algorithm then queries Keychain for all CredentialIDs related to the current RP ID once.
829         For every queried CredentialID, the algorithm then treats it as an ASCII string as well and look for
830         a match in the hash set to produce the intersetction. The new way is also employed in
831         LocalAuthenticator::getAssertion as well.
832         4) It abstracts the way to produce authData and thus reorders a bit of code in
833         LocalAuthenticator::makeCredential.
834
835         Covered by API tests.
836
837         * Modules/webauthn/AuthenticatorManager.cpp:
838         (WebCore::AuthenticatorManager::create const):
839         (WebCore::AuthenticatorManager::discoverFromExternalSource const):
840         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
841         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
842         (WebCore::PublicKeyCredentialRequestOptions::encode const):
843         (WebCore::PublicKeyCredentialRequestOptions::decode):
844         * Modules/webauthn/cocoa/LocalAuthenticator.h:
845         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
846         (WebCore::LocalAuthenticatorInternal::buildAuthData):
847         (WebCore::LocalAuthenticatorInternal::produceHashSet):
848         (WebCore::LocalAuthenticator::makeCredential):
849         (WebCore::LocalAuthenticator::getAssertion):
850         (WebCore::LocalAuthenticator::issueClientCertificate const):
851         * WebCore.xcodeproj/project.pbxproj:
852
853 2018-03-27  Chris Dumez  <cdumez@apple.com>
854
855         Avoid constructing SecurityOrigin objects from non-main threads
856         https://bugs.webkit.org/show_bug.cgi?id=184024
857
858         Reviewed by Youenn Fablet.
859
860         Avoid constructing SecurityOrigin objects from non-main threads as much as possible
861         as it is not safe. This patch gets rid of most offending cases but not all of them
862         yet, which is why I haven't added a ASSERT(isMainThread()) to the SecurityOrigin
863         constructor yet.
864
865         For example, ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() currently
866         gets called from non-main threads and construct a SecurityOrigin. Fixing this
867         will require some refactoring that would have made this patch much larger.
868
869         * loader/DocumentLoader.cpp:
870         (WebCore::DocumentLoader::matchRegistration):
871         * page/EventSource.cpp:
872         (WebCore::EventSource::didReceiveResponse):
873         * page/SecurityOrigin.cpp:
874         (WebCore::SecurityOrigin::SecurityOrigin):
875         * page/SecurityOrigin.h:
876         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
877         * testing/Internals.cpp:
878         (WebCore::Internals::hasServiceWorkerRegistration):
879         * workers/DedicatedWorkerGlobalScope.cpp:
880         (WebCore::DedicatedWorkerGlobalScope::create):
881         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
882         * workers/DedicatedWorkerGlobalScope.h:
883         * workers/DedicatedWorkerThread.cpp:
884         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
885         * workers/DedicatedWorkerThread.h:
886         * workers/WorkerGlobalScope.cpp:
887         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
888         * workers/WorkerGlobalScope.h:
889         * workers/WorkerLocation.cpp:
890         (WebCore::WorkerLocation::origin const):
891         * workers/WorkerThread.cpp:
892         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
893         (WebCore::WorkerThread::workerThread):
894         * workers/WorkerThread.h:
895         * workers/service/SWClientConnection.h:
896         * workers/service/ServiceWorkerContainer.cpp:
897         (WebCore::ServiceWorkerContainer::getRegistration):
898         (WebCore::ServiceWorkerContainer::getRegistrations):
899         * workers/service/ServiceWorkerGlobalScope.cpp:
900         (WebCore::ServiceWorkerGlobalScope::create):
901         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
902         * workers/service/ServiceWorkerGlobalScope.h:
903         * workers/service/ServiceWorkerProvider.cpp:
904         (WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
905         * workers/service/ServiceWorkerProvider.h:
906         * workers/service/context/ServiceWorkerThread.cpp:
907         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
908         (WebCore::fireMessageEvent):
909         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
910         * workers/service/context/ServiceWorkerThread.h:
911
912 2018-03-27  Alex Christensen  <achristensen@webkit.org>
913
914         Remove unused libsoup ResourceHandle implementation
915         https://bugs.webkit.org/show_bug.cgi?id=184048
916
917         Reviewed by Michael Catanzaro.
918
919         This code is unused since r228901 so let's remove it!
920
921         * platform/network/ResourceHandle.h:
922         * platform/network/ResourceHandleInternal.h:
923         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
924         * platform/network/soup/ResourceHandleSoup.cpp:
925         (WebCore::ResourceHandle::~ResourceHandle):
926         (WebCore::ResourceHandleInternal::soupSession):
927         (WebCore::ResourceHandle::cancelledOrClientless):
928         (WebCore::ResourceHandle::ensureReadBuffer):
929         (WebCore::ResourceHandle::currentStreamPosition const):
930         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
931         (WebCore::ResourceHandle::didStartRequest):
932         (WebCore::ResourceHandle::start):
933         (WebCore::ResourceHandle::releaseForDownload):
934         (WebCore::ResourceHandle::sendPendingRequest):
935         (WebCore::ResourceHandle::cancel):
936         (WebCore::ResourceHandle::shouldUseCredentialStorage):
937         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
938         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
939         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
940         (WebCore::ResourceHandle::receivedCredential):
941         (WebCore::ResourceHandle::receivedCancellation):
942         (WebCore::ResourceHandle::receivedChallengeRejection):
943         (WebCore::ResourceHandle::platformSetDefersLoading):
944         (WebCore::sessionFromContext): Deleted.
945         (WebCore::ResourceHandle::create): Deleted.
946         (WebCore::ResourceHandle::ResourceHandle): Deleted.
947         (WebCore::isAuthenticationFailureStatusCode): Deleted.
948         (WebCore::tlsErrorsChangedCallback): Deleted.
949         (WebCore::gotHeadersCallback): Deleted.
950         (WebCore::applyAuthenticationToRequest): Deleted.
951         (WebCore::restartedCallback): Deleted.
952         (WebCore::shouldRedirect): Deleted.
953         (WebCore::shouldRedirectAsGET): Deleted.
954         (WebCore::continueAfterWillSendRequest): Deleted.
955         (WebCore::doRedirect): Deleted.
956         (WebCore::redirectSkipCallback): Deleted.
957         (WebCore::wroteBodyDataCallback): Deleted.
958         (WebCore::cleanupSoupRequestOperation): Deleted.
959         (WebCore::nextMultipartResponsePartCallback): Deleted.
960         (WebCore::sendRequestCallback): Deleted.
961         (WebCore::continueAfterDidReceiveResponse): Deleted.
962         (WebCore::startingCallback): Deleted.
963         (WebCore::networkEventCallback): Deleted.
964         (WebCore::createSoupMessageForHandleAndRequest): Deleted.
965         (WebCore::createSoupRequestAndMessageForHandle): Deleted.
966         (WebCore::ResourceHandle::timeoutFired): Deleted.
967         (WebCore::waitingToSendRequest): Deleted.
968         (WebCore::readCallback): Deleted.
969
970 2018-03-27  Chris Dumez  <cdumez@apple.com>
971
972         Move online state detection from the WebProcess to the NetworkProcess
973         https://bugs.webkit.org/show_bug.cgi?id=183989
974         <rdar://problem/37093299>
975
976         Reviewed by Youenn Fablet.
977
978         Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
979         EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
980         and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
981         its connected WebProcesses via IPC.
982
983         * inspector/agents/InspectorApplicationCacheAgent.cpp:
984         (WebCore::InspectorApplicationCacheAgent::networkStateChanged):
985         * loader/LoaderStrategy.h:
986         * page/Navigator.cpp:
987         (WebCore::Navigator::onLine const):
988         * page/Page.cpp:
989         * platform/network/NetworkStateNotifier.h:
990         * workers/Worker.cpp:
991         (WebCore::Worker::Worker):
992         (WebCore::Worker::notifyFinished):
993         * workers/service/context/ServiceWorkerThread.cpp:
994         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
995         * workers/service/context/ServiceWorkerThreadProxy.cpp:
996         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
997
998 2018-03-27  Daniel Bates  <dabates@apple.com>
999
1000         CSS mask images should be retrieved using potentially CORS-enabled fetch
1001         https://bugs.webkit.org/show_bug.cgi?id=179983
1002         <rdar://problem/35678149>
1003
1004         Reviewed by Brent Fulgham.
1005
1006         As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor’s Draft, 23 December 2017)
1007         we should fetch CSS mask images using a potentially CORS-enabled fetch.
1008
1009         Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
1010         attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
1011         For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
1012         fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
1013         closely align with the behavior in the spec.
1014
1015         Test: http/tests/security/css-mask-image.html
1016
1017         * page/Settings.yaml: Add a setting for toggle "Anonymous" mode fetching of mask images (defaults: true).
1018         We need this setting to avoid breaking the developer convenience feature that some modern media controls
1019         layout tests employ to load assets from the filesystem as opposed to using the hardcoded data URLs baked
1020         into the WebKit binary.
1021         * style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
1022         LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
1023         in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
1024         (WebCore::Style::loadPendingImage): Ditto.
1025         (WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
1026         a mask image or shape-outside image.
1027
1028 2018-03-27  Zalan Bujtas  <zalan@apple.com>
1029
1030         RenderBox::parent/firstChild/nextSibling/previousSiblingBox() functions should type check.
1031         https://bugs.webkit.org/show_bug.cgi?id=184032
1032         <rdar://problem/38384984>
1033
1034         Reviewed by Antti Koivisto.
1035
1036         We cannot rely on the correctness of the render tree structure when querying for parent/child/next and previous
1037         sibling since some features (multicolumn/spanners) move subtrees out of their original position (which is highly
1038         undesired and should not be encouraged at all though).
1039         It should also be noted that these functions are not equivalent of typeOfChildren<RenderBox> and the following usage
1040             for (auto* boxChild = firstChildBox(); boxChild; boxChild = boxChild->nextSiblingBox())
1041         can lead to unexpected result.
1042  
1043         Test: fast/multicol/parent-box-when-spanner-is-present.html
1044
1045         * rendering/RenderBox.h:
1046         (WebCore::RenderBox::parentBox const):
1047         (WebCore::RenderBox::firstChildBox const):
1048         (WebCore::RenderBox::lastChildBox const):
1049         (WebCore::RenderBox::previousSiblingBox const):
1050         (WebCore::RenderBox::nextSiblingBox const):
1051         * rendering/RenderListItem.cpp:
1052         (WebCore::RenderListItem::positionListMarker):
1053         * rendering/RenderListMarker.cpp:
1054         (WebCore::RenderListMarker::layout):
1055         * rendering/RenderMultiColumnSet.cpp:
1056         (WebCore::RenderMultiColumnSet::updateLogicalWidth):
1057
1058 2018-03-27  Brent Fulgham  <bfulgham@apple.com>
1059
1060         Further refine cookie read/write logging
1061         https://bugs.webkit.org/show_bug.cgi?id=184044
1062         <rdar://problem/38915610>
1063
1064         Reviewed by Chris Dumez.
1065
1066         Export 'shouldBlockCookies' so that it can be accessed by the WebKit framework.
1067
1068         * platform/network/NetworkStorageSession.h:
1069
1070 2018-03-27  Antoine Quint  <graouts@apple.com>
1071
1072         [Web Animations] Stop using internals.pauseAnimationAtTimeOnElement() in favor of Web Animations API for animations tests
1073         https://bugs.webkit.org/show_bug.cgi?id=184038
1074
1075         Reviewed by Dean Jackson.
1076
1077         Expose a new method to indicate that the runtime flag for CSS Animations and CSS Transitions as Web Animations is enabled.
1078
1079         * testing/InternalSettings.cpp:
1080         (WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
1081         * testing/InternalSettings.h:
1082         * testing/InternalSettings.idl:
1083
1084 2018-03-27  Thibault Saunier  <tsaunier@igalia.com>
1085
1086         [GStreamer] Enhance debugging in the BasePlayer
1087         https://bugs.webkit.org/show_bug.cgi?id=184035
1088
1089         Reviewed by Philippe Normand.
1090
1091         No behaviour changes so no test were added/enabled.
1092
1093         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1094         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1095         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1096         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
1097         (WebCore::MediaPlayerPrivateGStreamerBase::setVolume):
1098         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
1099         (WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
1100         (WebCore::MediaPlayerPrivateGStreamerBase::muted const):
1101         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1102         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
1103         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
1104         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
1105         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
1106         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
1107         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
1108
1109 2018-03-27  Eric Carlson  <eric.carlson@apple.com>
1110
1111         Make AVFoundationEnabled preference available on iOS
1112         https://bugs.webkit.org/show_bug.cgi?id=183876
1113         <rdar://problem/38726459>
1114
1115         Reviewed by Youenn Fablet.
1116
1117         Test: AVFoundationPref API test.
1118
1119         * html/HTMLAudioElement.idl: There is no need for a runtime setting to enable/disable audio,
1120         there is already settings.mediaEnabled.
1121         * html/HTMLMediaElement.cpp:
1122         (WebCore::HTMLMediaElement::prepareForLoad): Fail if there are no media engines registered.
1123         (WebCore::HTMLMediaElement::noneSupported): Return early if m_error has already been set.
1124         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Remove a typo.
1125
1126         * page/RuntimeEnabledFeatures.cpp:
1127         (WebCore::RuntimeEnabledFeatures::audioEnabled const): Deleted.
1128         * page/RuntimeEnabledFeatures.h:
1129
1130 2018-03-27  Fujii Hironori  <Hironori.Fujii@sony.com>
1131
1132         [GTK] Layout test editing/deleting/delete-surrogatepair.html crashing with CRITICAL **: enchant_dict_check: assertion 'g_utf8_validate(word, len, NULL)' failed
1133         https://bugs.webkit.org/show_bug.cgi?id=176799
1134
1135         Reviewed by Carlos Garcia Campos.
1136
1137         The length of a surrogate-pair UTF-16 character is 2 even though
1138         the number of characters is 1. An incorrect string length was
1139         passed to enchant_dict_check if the string contains a
1140         surrogate-pair character because the length was calculated by
1141         applying UTF-16 character position to UTF-8 string.
1142
1143         No new tests (Covered by existing tests).
1144
1145         * platform/text/enchant/TextCheckerEnchant.cpp:
1146         (WebCore::TextCheckerEnchant::checkSpellingOfWord): Changed the
1147         type of an argument `word` from CString to String. Convert a
1148         substring of the argument into UTF-8.
1149         (WebCore::TextCheckerEnchant::checkSpellingOfString): Pass the
1150         original UTF-16 string to checkSpellingOfWord instead of a
1151         converted UTF-8 string.
1152         * platform/text/enchant/TextCheckerEnchant.h: Changed the type of
1153         an argument `word` from CString to String.
1154
1155 2018-03-26  Ms2ger  <Ms2ger@igalia.com>
1156
1157         Remove an unnecessary const_cast from BitmapTextureGL::updateContents().
1158         https://bugs.webkit.org/show_bug.cgi?id=184007
1159
1160         Reviewed by Žan Doberšek.
1161
1162         No new tests.
1163
1164         * platform/graphics/texmap/BitmapTextureGL.cpp:
1165         (WebCore::BitmapTextureGL::updateContents):
1166
1167 2018-03-23  Antoine Quint  <graouts@apple.com>
1168
1169         [Web Animations] Make imported/mozilla/css-animations/test_animation-currenttime.html pass reliably
1170         https://bugs.webkit.org/show_bug.cgi?id=183819
1171
1172         Reviewed by Dean Jackson.
1173
1174         The current time for a CSS Animation exposed via the API should be clamped between 0 and the animation duration.
1175
1176         * animation/CSSAnimation.cpp:
1177         (WebCore::CSSAnimation::bindingsCurrentTime const):
1178         * animation/CSSAnimation.h:
1179         * animation/WebAnimation.h:
1180
1181 2018-03-23  Antoine Quint  <graouts@apple.com>
1182
1183         [Web Animations] Correctly handle timing functions specified by CSS Animations and CSS Transitions
1184         https://bugs.webkit.org/show_bug.cgi?id=183935
1185
1186         Reviewed by Dean Jackson.
1187
1188         We were incorrectly reflecting the animation-timing-function and transition-timing-function values on the generated
1189         DeclarativeAnimation effect timing "easing" property. In fact, those values should only be represented on the keyframes.
1190
1191         In the case of a CSS Animation, the animation-timing-function property set on the element's style serves as the default
1192         value used for all keyframes, and individual keyframes can specify an overriding animation-timing-function. For a CSS
1193         Transition, the transition-timing-function property set on the element's style serves as the timing function of the
1194         from keyframe.
1195
1196         To correctly reflect this, we provide a new timingFunctionForKeyframeAtIndex() function on KeyframeEffectReadOnly
1197         which will return the right TimingFunction object at a given index, regardless of the animation type. In the case
1198         of getKeyframes(), we manually return "linear" for the "to" keyframe since timingFunctionForKeyframeAtIndex()
1199         would otherwise return the same timing function as the "from" keyframe. This avoids creating an extra
1200         LinearTimingFunction object.
1201
1202         As a result, a number of Mozilla imported tests progress since we have correct information on the "easing" property
1203         of objects returned by getKeyframes() and the "progress" reported by getComputedTiming() now always uses a linear
1204         timing function.
1205
1206         * animation/DeclarativeAnimation.cpp:
1207         (WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): The timing function of the backing Animation should
1208         not be reflected on the effect's timing object.
1209         * animation/KeyframeEffectReadOnly.cpp:
1210         (WebCore::KeyframeEffectReadOnly::getKeyframes): Return the correct timing function for a keyframe, and use a "linear"
1211         value for the "to" keyframe of a CSS Transition.
1212         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
1213         (WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
1214         * animation/KeyframeEffectReadOnly.h:
1215
1216 2018-03-26  Chris Dumez  <cdumez@apple.com>
1217
1218         Use SecurityOriginData more consistently in Service Worker code
1219         https://bugs.webkit.org/show_bug.cgi?id=183969
1220
1221         Reviewed by Darin Adler.
1222
1223         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
1224         SecurityOrigin objects unnecessarily.
1225
1226         I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
1227         code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
1228         in some cases as callers can now use SecurityOrigin::data() instead of
1229         SecurityOriginData::fromSecurityOrigin().
1230
1231         No new tests, no Web-facing behavior change.
1232
1233         * Modules/cache/DOMCacheStorage.cpp:
1234         (WebCore::DOMCacheStorage::origin const):
1235         * Modules/encryptedmedia/CDM.cpp:
1236         (WebCore::CDM::storageDirectory const):
1237         * Modules/encryptedmedia/MediaKeySession.cpp:
1238         (WebCore::MediaKeySession::mediaKeysStorageDirectory const):
1239         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1240         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
1241         * Modules/indexeddb/IDBFactory.cpp:
1242         (WebCore::IDBFactory::openInternal):
1243         (WebCore::IDBFactory::deleteDatabase):
1244         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1245         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
1246         * Modules/webdatabase/Database.cpp:
1247         (WebCore::Database::securityOrigin):
1248         * Modules/webdatabase/DatabaseContext.cpp:
1249         (WebCore::DatabaseContext::securityOrigin const):
1250         * Modules/webdatabase/DatabaseContext.h:
1251         * Modules/webdatabase/DatabaseManager.cpp:
1252         (WebCore::DatabaseManager::fullPathForDatabase):
1253         (WebCore::DatabaseManager::detailsForNameAndOrigin):
1254         * html/HTMLMediaElement.cpp:
1255         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
1256         * inspector/agents/InspectorDOMStorageAgent.cpp:
1257         (WebCore::InspectorDOMStorageAgent::findStorageArea):
1258         * loader/appcache/ApplicationCacheStorage.cpp:
1259         (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
1260         (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
1261         (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
1262         (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
1263         (WebCore::ApplicationCacheStorage::store):
1264         (WebCore::ApplicationCacheStorage::ensureOriginRecord):
1265         * page/DOMWindow.cpp:
1266         (WebCore:: const):
1267         * page/SecurityOrigin.cpp:
1268         (WebCore::SecurityOrigin::SecurityOrigin):
1269         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
1270         (WebCore::SecurityOrigin::canAccess const):
1271         (WebCore::SecurityOrigin::canDisplay const):
1272         (WebCore::SecurityOrigin::domainForCachePartition const):
1273         (WebCore::SecurityOrigin::isLocal const):
1274         (WebCore::SecurityOrigin::toString const):
1275         (WebCore::SecurityOrigin::toRawString const):
1276         (WebCore::SecurityOrigin::create):
1277         (WebCore::SecurityOrigin::isSameSchemeHostPort const):
1278         * page/SecurityOrigin.h:
1279         (WebCore::SecurityOrigin::protocol const):
1280         (WebCore::SecurityOrigin::host const):
1281         (WebCore::SecurityOrigin::port const):
1282         (WebCore::SecurityOrigin::data const):
1283         (WebCore::SecurityOrigin::isHTTPFamily const):
1284         * page/SecurityOriginData.cpp:
1285         (WebCore::SecurityOriginData::toString const):
1286         (WebCore::SecurityOriginData::fromFrame):
1287         * page/SecurityOriginData.h:
1288         (WebCore::SecurityOriginData::fromURL):
1289         * storage/StorageNamespaceProvider.cpp:
1290         (WebCore::StorageNamespaceProvider::localStorageArea):
1291         * testing/Internals.cpp:
1292         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
1293         * workers/service/ServiceWorkerContainer.cpp:
1294         (WebCore::ServiceWorkerContainer::addRegistration):
1295         (WebCore::ServiceWorkerContainer::removeRegistration):
1296         (WebCore::ServiceWorkerContainer::updateRegistration):
1297         * workers/service/ServiceWorkerRegistrationKey.cpp:
1298         (WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
1299         * workers/service/ServiceWorkerRegistrationKey.h:
1300         * workers/service/server/SWOriginStore.cpp:
1301         (WebCore::SWOriginStore::add):
1302         (WebCore::SWOriginStore::remove):
1303         (WebCore::SWOriginStore::clear):
1304         * workers/service/server/SWOriginStore.h:
1305         * workers/service/server/SWServer.cpp:
1306         (WebCore::SWServer::addRegistration):
1307         (WebCore::SWServer::removeRegistration):
1308         (WebCore::SWServer::clear):
1309         (WebCore::SWServer::tryInstallContextData):
1310         (WebCore::SWServer::serverToContextConnectionCreated):
1311         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
1312         (WebCore::SWServer::unregisterServiceWorkerClient):
1313         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
1314         * workers/service/server/SWServer.h:
1315         * workers/service/server/SWServerToContextConnection.cpp:
1316         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
1317         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
1318         (WebCore::SWServerToContextConnection::connectionForOrigin):
1319         * workers/service/server/SWServerToContextConnection.h:
1320         (WebCore::SWServerToContextConnection::securityOrigin const):
1321         * workers/service/server/SWServerWorker.cpp:
1322         (WebCore::SWServerWorker::origin const):
1323         (WebCore::SWServerWorker::securityOrigin const):
1324         * workers/service/server/SWServerWorker.h:
1325
1326 2018-03-26  Brent Fulgham  <bfulgham@apple.com>
1327
1328         Warn against cookie access in the WebContent process using ProcessPrivilege assertions
1329         https://bugs.webkit.org/show_bug.cgi?id=183911
1330         <rdar://problem/38762306>
1331
1332         Reviewed by Youenn Fablet.
1333
1334         Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
1335         should never call Cookie API directly. That should only happen in the Networking or
1336         UIProcess. 
1337
1338         Add a new static flag to NetworkStorageSession that indicates if the current process has
1339         permission to interact with the Cookie API.
1340
1341         No new tests since there is no change in behavior.
1342
1343         * platform/network/NetworkStorageSession.cpp:
1344         (WebCore::NetworkStorageSession::NetworkStorageSession):
1345         (WebCore::NetworkStorageSession::processMayUseCookieAPI): Added.
1346         (WebCore::NetworkStorageSession::permitProcessToUseCookieAPI): Added. This also adds
1347         the appropriate flag to the ProcessPrivileges data for the current process.
1348         * platform/network/NetworkStorageSession.h:
1349         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1350         (WebCore::createCFStorageSessionForIdentifier): Do not create cookie storage if the current
1351         process is prohibited from interacting with the Cookie API.
1352         (WebCore::NetworkStorageSession::NetworkStorageSession): Add assertions.
1353         (WebCore::NetworkStorageSession::switchToNewTestingSession): Do not create cookie storage if
1354         the current process is prohibited from interacting with the Cookie API.
1355         (WebCore::NetworkStorageSession::defaultStorageSession): Ditto.
1356         (WebCore::NetworkStorageSession::ensureSession): Ditto.
1357         (WebCore::NetworkStorageSession::cookieStorage const): Ditto.
1358         * platform/network/cocoa/CookieStorageObserver.mm:
1359         (WebCore::CookieStorageObserver::CookieStorageObserver): Assert if accessed from untrusted process.
1360         (WebCore::CookieStorageObserver::startObserving): Ditto.
1361         (WebCore::CookieStorageObserver::stopObserving): Ditto.
1362         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1363         (WebCore::NetworkStorageSession::setCookie):
1364         (WebCore::NetworkStorageSession::setCookies):
1365         (WebCore::NetworkStorageSession::deleteCookie):
1366         (WebCore::nsCookiesToCookieVector):
1367         (WebCore::NetworkStorageSession::getAllCookies):
1368         (WebCore::NetworkStorageSession::getCookies):
1369         (WebCore::NetworkStorageSession::flushCookieStore):
1370         (WebCore::NetworkStorageSession::nsCookieStorage const):
1371         (WebCore::createPrivateStorageSession):
1372         * platform/network/mac/CookieJarMac.mm:
1373         (WebCore::httpCookies):
1374         (WebCore::deleteHTTPCookie):
1375         (WebCore::httpCookiesForURL):
1376         (WebCore::filterCookies):
1377         (WebCore::applyPartitionToCookies):
1378         (WebCore::cookiesInPartitionForURL):
1379         (WebCore::cookiesForSession):
1380         (WebCore::setHTTPCookiesForURL):
1381         (WebCore::deleteAllHTTPCookies):
1382         (WebCore::setCookiesFromDOM):
1383         (WebCore::httpCookieAcceptPolicy):
1384         (WebCore::deleteCookie):
1385         (WebCore::deleteCookiesForHostnames):
1386         (WebCore::deleteAllCookiesModifiedSince):
1387
1388 2018-03-26  Alex Christensen  <achristensen@webkit.org>
1389
1390         Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
1391         https://bugs.webkit.org/show_bug.cgi?id=183965
1392
1393         Reviewed by Chris Dumez.
1394
1395         It turns out that ResourceHandleClient::willCacheResponseAsync didn't do anything and the logic in
1396         ResourceHandleClient::willCacheResponse was not being called.  This makes it so there is one code
1397         path and it executes the logic in ResourceHandleClient::willCacheResponse.
1398
1399         * loader/EmptyFrameLoaderClient.h:
1400         * loader/FrameLoaderClient.h:
1401         * loader/ResourceLoader.h:
1402         * loader/SubresourceLoader.h:
1403         * loader/cocoa/SubresourceLoaderCocoa.mm:
1404         (WebCore::SubresourceLoader::willCacheResponseAsync):
1405         (WebCore::SubresourceLoader::willCacheResponse): Deleted.
1406         * loader/mac/ResourceLoaderMac.mm:
1407         (WebCore::ResourceLoader::willCacheResponseAsync):
1408         (WebCore::ResourceLoader::willCacheResponse): Deleted.
1409         * platform/network/ResourceHandle.h:
1410         * platform/network/ResourceHandleClient.cpp:
1411         (WebCore::ResourceHandleClient::willCacheResponseAsync): Deleted.
1412         * platform/network/ResourceHandleClient.h:
1413         (WebCore::ResourceHandleClient::willCacheResponseAsync):
1414         (WebCore::ResourceHandleClient::shouldCacheResponse):
1415         (WebCore::ResourceHandleClient::willCacheResponse): Deleted.
1416         * platform/network/cf/ResourceHandleCFNet.cpp:
1417         (WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
1418         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1419         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1420         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1421         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueWillCacheResponse): Deleted.
1422         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
1423         * platform/network/mac/ResourceHandleMac.mm:
1424         (WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
1425         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
1426         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1427         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
1428         (-[WebCoreResourceHandleAsOperationQueueDelegate continueWillCacheResponse:]): Deleted.
1429
1430 2018-03-26  Miguel Gomez  <magomez@igalia.com>
1431
1432         [GTK][WPE] Upload correct buffer in BitmapTextureGL::updateContents()
1433         https://bugs.webkit.org/show_bug.cgi?id=184004
1434
1435         Reviewed by Žan Doberšek.
1436
1437         Do not upload the original buffer. Upload the result of creating a subImage buffer
1438         if it was required.
1439
1440         Covered by existent tests.
1441
1442         * platform/graphics/texmap/BitmapTextureGL.cpp:
1443         (WebCore::BitmapTextureGL::updateContents):
1444
1445 2018-03-25  Zan Dobersek  <zdobersek@igalia.com>
1446
1447         [TexMap] Clean up TextureMapperPlatformLayer, TextureMapperBackingStore code
1448         https://bugs.webkit.org/show_bug.cgi?id=183985
1449
1450         Reviewed by Michael Catanzaro.
1451
1452         Clean up TextureMapperPlatformLayer and TextureMapperBackingStore
1453         headers and implementation files. Remove dubious whitespace, use #pragma
1454         once, clean up constructors, destructors, method definitions and remove
1455         unnecessary includes in favor of forward declarations where possible.
1456
1457         The TextureMapperPlatformLayer::swapBuffers() method is removed as it
1458         wasn't called or overridden anywhere.
1459
1460         No new tests -- no change in functionality.
1461
1462         * platform/graphics/texmap/TextureMapperBackingStore.cpp:
1463         * platform/graphics/texmap/TextureMapperBackingStore.h:
1464         (WebCore::TextureMapperBackingStore::drawRepaintCounter):
1465         * platform/graphics/texmap/TextureMapperPlatformLayer.h:
1466         (WebCore::TextureMapperPlatformLayer::setClient):
1467         (WebCore::TextureMapperPlatformLayer::TextureMapperPlatformLayer): Deleted.
1468         (WebCore::TextureMapperPlatformLayer::swapBuffers): Deleted.
1469
1470 2018-03-25  Dan Bernstein  <mitz@apple.com>
1471
1472         [Xcode] Remove workaround only needed for deploying to iOS 10.0 and earlier
1473         https://bugs.webkit.org/show_bug.cgi?id=183999
1474
1475         Reviewed by Sam Weinig.
1476
1477         * Configurations/WebCore.xcconfig: Removed build settings.
1478         * Configurations/WebCoreTestSupport.xcconfig: Removed location of phony WebKitLegacy from
1479           frameworks search path.
1480         * Configurations/WebKitLegacyStub.iOS.tbd: Removed.
1481         * WebCore.xcodeproj/project.pbxproj: Removed script build phase from the Derived Sources target.
1482
1483 2018-03-25  Commit Queue  <commit-queue@webkit.org>
1484
1485         Unreviewed, rolling out r229954.
1486         https://bugs.webkit.org/show_bug.cgi?id=184000
1487
1488         Caused many layout tests to crash on Apple High Sierra,
1489         Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
1490         by dydz on #webkit).
1491
1492         Reverted changeset:
1493
1494         "Use SecurityOriginData more consistently in Service Worker
1495         code"
1496         https://bugs.webkit.org/show_bug.cgi?id=183969
1497         https://trac.webkit.org/changeset/229954
1498
1499 2018-03-23  Alex Christensen  <achristensen@webkit.org>
1500
1501         Use completion handlers for ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync
1502         https://bugs.webkit.org/show_bug.cgi?id=183966
1503
1504         Reviewed by Chris Dumez.
1505
1506         No change in behavior.
1507
1508         * loader/ResourceLoader.cpp:
1509         (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
1510         * loader/ResourceLoader.h:
1511         * platform/network/BlobResourceHandle.cpp:
1512         * platform/network/PingHandle.h:
1513         * platform/network/ResourceHandle.h:
1514         * platform/network/ResourceHandleClient.h:
1515         * platform/network/SynchronousLoaderClient.cpp:
1516         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
1517         * platform/network/SynchronousLoaderClient.h:
1518         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1519         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1520         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1521         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
1522         * platform/network/mac/ResourceHandleMac.mm:
1523         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
1524         (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace): Deleted.
1525         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
1526         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1527         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
1528         (-[WebCoreResourceHandleAsOperationQueueDelegate continueCanAuthenticateAgainstProtectionSpace:]): Deleted.
1529
1530 2018-03-24  Chris Dumez  <cdumez@apple.com>
1531
1532         Use SecurityOriginData more consistently in Service Worker code
1533         https://bugs.webkit.org/show_bug.cgi?id=183969
1534
1535         Reviewed by Darin Adler.
1536
1537         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
1538         SecurityOrigin objects unnecessarily.
1539
1540         I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
1541         code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
1542         in some cases as callers can now use SecurityOrigin::data() instead of
1543         SecurityOriginData::fromSecurityOrigin().
1544
1545         No new tests, no Web-facing behavior change.
1546
1547         * Modules/cache/DOMCacheStorage.cpp:
1548         (WebCore::DOMCacheStorage::origin const):
1549         * Modules/encryptedmedia/CDM.cpp:
1550         (WebCore::CDM::storageDirectory const):
1551         * Modules/encryptedmedia/MediaKeySession.cpp:
1552         (WebCore::MediaKeySession::mediaKeysStorageDirectory const):
1553         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1554         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
1555         * Modules/indexeddb/IDBFactory.cpp:
1556         (WebCore::IDBFactory::openInternal):
1557         (WebCore::IDBFactory::deleteDatabase):
1558         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1559         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
1560         * Modules/webdatabase/Database.cpp:
1561         (WebCore::Database::securityOrigin):
1562         * Modules/webdatabase/DatabaseContext.cpp:
1563         (WebCore::DatabaseContext::securityOrigin const):
1564         * Modules/webdatabase/DatabaseContext.h:
1565         * Modules/webdatabase/DatabaseManager.cpp:
1566         (WebCore::DatabaseManager::fullPathForDatabase):
1567         (WebCore::DatabaseManager::detailsForNameAndOrigin):
1568         * html/HTMLMediaElement.cpp:
1569         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
1570         * inspector/agents/InspectorDOMStorageAgent.cpp:
1571         (WebCore::InspectorDOMStorageAgent::findStorageArea):
1572         * loader/appcache/ApplicationCacheStorage.cpp:
1573         (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
1574         (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
1575         (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
1576         (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
1577         (WebCore::ApplicationCacheStorage::store):
1578         (WebCore::ApplicationCacheStorage::ensureOriginRecord):
1579         * page/DOMWindow.cpp:
1580         (WebCore:: const):
1581         * page/SecurityOrigin.cpp:
1582         (WebCore::SecurityOrigin::SecurityOrigin):
1583         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
1584         (WebCore::SecurityOrigin::canAccess const):
1585         (WebCore::SecurityOrigin::canDisplay const):
1586         (WebCore::SecurityOrigin::domainForCachePartition const):
1587         (WebCore::SecurityOrigin::isLocal const):
1588         (WebCore::SecurityOrigin::toString const):
1589         (WebCore::SecurityOrigin::toRawString const):
1590         (WebCore::SecurityOrigin::create):
1591         (WebCore::SecurityOrigin::isSameSchemeHostPort const):
1592         * page/SecurityOrigin.h:
1593         (WebCore::SecurityOrigin::protocol const):
1594         (WebCore::SecurityOrigin::host const):
1595         (WebCore::SecurityOrigin::port const):
1596         (WebCore::SecurityOrigin::data const):
1597         (WebCore::SecurityOrigin::isHTTPFamily const):
1598         * page/SecurityOriginData.cpp:
1599         (WebCore::SecurityOriginData::toString const):
1600         (WebCore::SecurityOriginData::fromFrame):
1601         * page/SecurityOriginData.h:
1602         (WebCore::SecurityOriginData::fromURL):
1603         * storage/StorageNamespaceProvider.cpp:
1604         (WebCore::StorageNamespaceProvider::localStorageArea):
1605         * testing/Internals.cpp:
1606         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
1607         * workers/service/ServiceWorkerContainer.cpp:
1608         (WebCore::ServiceWorkerContainer::addRegistration):
1609         (WebCore::ServiceWorkerContainer::removeRegistration):
1610         (WebCore::ServiceWorkerContainer::updateRegistration):
1611         * workers/service/ServiceWorkerRegistrationKey.cpp:
1612         (WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
1613         * workers/service/ServiceWorkerRegistrationKey.h:
1614         * workers/service/server/SWOriginStore.cpp:
1615         (WebCore::SWOriginStore::add):
1616         (WebCore::SWOriginStore::remove):
1617         (WebCore::SWOriginStore::clear):
1618         * workers/service/server/SWOriginStore.h:
1619         * workers/service/server/SWServer.cpp:
1620         (WebCore::SWServer::addRegistration):
1621         (WebCore::SWServer::removeRegistration):
1622         (WebCore::SWServer::clear):
1623         (WebCore::SWServer::tryInstallContextData):
1624         (WebCore::SWServer::serverToContextConnectionCreated):
1625         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
1626         (WebCore::SWServer::unregisterServiceWorkerClient):
1627         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
1628         * workers/service/server/SWServer.h:
1629         * workers/service/server/SWServerToContextConnection.cpp:
1630         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
1631         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
1632         (WebCore::SWServerToContextConnection::connectionForOrigin):
1633         * workers/service/server/SWServerToContextConnection.h:
1634         (WebCore::SWServerToContextConnection::securityOrigin const):
1635         * workers/service/server/SWServerWorker.cpp:
1636         (WebCore::SWServerWorker::origin const):
1637         (WebCore::SWServerWorker::securityOrigin const):
1638         * workers/service/server/SWServerWorker.h:
1639
1640 2018-03-24  Commit Queue  <commit-queue@webkit.org>
1641
1642         Unreviewed, rolling out r229792.
1643         https://bugs.webkit.org/show_bug.cgi?id=183980
1644
1645         not actually necessary (Requested by thorton on #webkit).
1646
1647         Reverted changeset:
1648
1649         "Fix the build"
1650         https://trac.webkit.org/changeset/229792
1651
1652 2018-03-23  Tim Horton  <timothy_horton@apple.com>
1653
1654         Fix the geolocation build
1655         https://bugs.webkit.org/show_bug.cgi?id=183975
1656
1657         * Modules/geolocation/ios/GeolocationPositionIOS.mm:
1658         (WebCore::GeolocationPosition::GeolocationPosition):
1659
1660 2018-03-23  Tim Horton  <timothy_horton@apple.com>
1661
1662         Fix the build with no pasteboard
1663         https://bugs.webkit.org/show_bug.cgi?id=183973
1664
1665         Reviewed by Dan Bernstein.
1666
1667         * Configurations/FeatureDefines.xcconfig:
1668         * platform/ios/PlatformPasteboardIOS.mm:
1669
1670 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1671
1672         [Extra zoom mode] Fix some localizable strings after r229878
1673         https://bugs.webkit.org/show_bug.cgi?id=183963
1674
1675         Reviewed by Tim Horton.
1676
1677         The WEB_UI_STRING macro was incorrectly used for certain localized strings pertaining to extra zoom mode. To
1678         correct this, make the "Done" string use WEB_UI_STRING with actual UI-facing text; since day, year and month
1679         labels in the date picker are less generalizable to other UI, leave these as unique keys, but change them to
1680         use WEB_UI_STRING_KEY instead.
1681
1682         Additionally, remove now-unused localizable strings for the text input view controller.
1683
1684         * English.lproj/Localizable.strings:
1685         * platform/LocalizedStrings.cpp:
1686         (WebCore::formControlDoneButtonTitle):
1687         (WebCore::datePickerDayLabelTitle):
1688         (WebCore::datePickerMonthLabelTitle):
1689         (WebCore::datePickerYearLabelTitle):
1690
1691 2018-03-23  Chris Dumez  <cdumez@apple.com>
1692
1693         NetworkStateNotifier::updateStateWithoutNotifying() is inefficient
1694         https://bugs.webkit.org/show_bug.cgi?id=183760
1695         <rdar://problem/37093299>
1696
1697         Reviewed by Ryosuke Niwa.
1698
1699         Update NetworkStateNotifier::updateStateWithoutNotifying() to stop calling
1700         SCDynamicStoreCopyKeyList(). SCDynamicStoreCopyKeyList() is expensive as it
1701         expects its key parameter to be a regular expression and it can match several
1702         keys. It is also unnecessary in our case since we already have an exact key.
1703         We now call the more efficient SCDynamicStoreCopyValue() instead, which is
1704         the right thing to call when we have an exact key.
1705
1706         This change was suggested by the SC team.
1707
1708         This was tested manually as there is no easy way to write an automated test
1709         for this.
1710
1711         In a follow-up, I also plan to call this code in the UIProcess (or NetworkProcess)
1712         to avoid calling it once per WebProcess.
1713
1714         * platform/network/mac/NetworkStateNotifierMac.cpp:
1715         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
1716
1717 2018-03-23  Daniel Bates  <dabates@apple.com>
1718
1719         Unreviewed, rolling out r229868.
1720
1721         Caused media controls tests to timeout. Will investigate
1722         offline.
1723
1724         Reverted changeset:
1725
1726         "CSS mask images should be retrieved using potentially CORS-
1727         enabled fetch"
1728         https://bugs.webkit.org/show_bug.cgi?id=179983
1729         https://trac.webkit.org/changeset/229868
1730
1731 2018-03-23  Mark Lam  <mark.lam@apple.com>
1732
1733         Add pointer profiling hooks to the CSS JIT.
1734         https://bugs.webkit.org/show_bug.cgi?id=183947
1735         <rdar://problem/38803593>
1736
1737         Reviewed by JF Bastien.
1738
1739         No new tests needed.  Covered by existing tests.
1740
1741         * bindings/scripts/CodeGeneratorJS.pm:
1742         (GenerateImplementation):
1743         - Added a missing application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION().
1744
1745         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1746         (WebCore::toJSNewlyCreated):
1747         * bindings/scripts/test/JS/JSMapLike.cpp:
1748         (WebCore::toJSNewlyCreated):
1749         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1750         (WebCore::toJSNewlyCreated):
1751         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1752         (WebCore::toJSNewlyCreated):
1753         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1754         (WebCore::toJSNewlyCreated):
1755         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1756         (WebCore::toJSNewlyCreated):
1757         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1758         (WebCore::toJSNewlyCreated):
1759         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1760         (WebCore::toJSNewlyCreated):
1761         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1762         (WebCore::toJSNewlyCreated):
1763         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1764         (WebCore::toJSNewlyCreated):
1765         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1766         (WebCore::toJSNewlyCreated):
1767         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1768         (WebCore::toJSNewlyCreated):
1769         * bindings/scripts/test/JS/JSTestException.cpp:
1770         (WebCore::toJSNewlyCreated):
1771         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1772         (WebCore::toJSNewlyCreated):
1773         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1774         (WebCore::toJSNewlyCreated):
1775         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1776         (WebCore::toJSNewlyCreated):
1777         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1778         (WebCore::toJSNewlyCreated):
1779         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1780         (WebCore::toJSNewlyCreated):
1781         * bindings/scripts/test/JS/JSTestIterable.cpp:
1782         (WebCore::toJSNewlyCreated):
1783         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1784         (WebCore::toJSNewlyCreated):
1785         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1786         (WebCore::toJSNewlyCreated):
1787         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1788         (WebCore::toJSNewlyCreated):
1789         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1790         (WebCore::toJSNewlyCreated):
1791         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1792         (WebCore::toJSNewlyCreated):
1793         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1794         (WebCore::toJSNewlyCreated):
1795         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1796         (WebCore::toJSNewlyCreated):
1797         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1798         (WebCore::toJSNewlyCreated):
1799         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1800         (WebCore::toJSNewlyCreated):
1801         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1802         (WebCore::toJSNewlyCreated):
1803         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1804         (WebCore::toJSNewlyCreated):
1805         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1806         (WebCore::toJSNewlyCreated):
1807         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1808         (WebCore::toJSNewlyCreated):
1809         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1810         (WebCore::toJSNewlyCreated):
1811         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1812         (WebCore::toJSNewlyCreated):
1813         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1814         (WebCore::toJSNewlyCreated):
1815         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1816         (WebCore::toJSNewlyCreated):
1817         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1818         (WebCore::toJSNewlyCreated):
1819         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1820         (WebCore::toJSNewlyCreated):
1821         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1822         (WebCore::toJSNewlyCreated):
1823         * bindings/scripts/test/JS/JSTestNode.cpp:
1824         (WebCore::toJSNewlyCreated):
1825         * bindings/scripts/test/JS/JSTestObj.cpp:
1826         (WebCore::toJSNewlyCreated):
1827         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1828         (WebCore::toJSNewlyCreated):
1829         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1830         (WebCore::toJSNewlyCreated):
1831         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1832         (WebCore::toJSNewlyCreated):
1833         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1834         (WebCore::toJSNewlyCreated):
1835         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1836         (WebCore::toJSNewlyCreated):
1837         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1838         (WebCore::toJSNewlyCreated):
1839         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1840         (WebCore::toJSNewlyCreated):
1841         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1842         (WebCore::toJSNewlyCreated):
1843         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1844         (WebCore::toJSNewlyCreated):
1845         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1846         (WebCore::toJSNewlyCreated):
1847         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1848         (WebCore::toJSNewlyCreated):
1849         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1850         (WebCore::toJSNewlyCreated):
1851         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1852         (WebCore::toJSNewlyCreated):
1853         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1854         (WebCore::toJSNewlyCreated):
1855         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1856         (WebCore::toJSNewlyCreated):
1857         * css/ElementRuleCollector.cpp:
1858         (WebCore::ElementRuleCollector::ruleMatches):
1859         * cssjit/SelectorCompiler.cpp:
1860         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
1861         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1862         * cssjit/SelectorCompiler.h:
1863         (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
1864         (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
1865         (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
1866         (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
1867         * dom/SelectorQuery.cpp:
1868         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
1869         (WebCore::SelectorDataList::execute const):
1870
1871 2018-03-23  Sihui Liu  <sihui_liu@apple.com>
1872
1873         Local storage getItem() for an empty string returned UNDEFINED value.
1874         https://bugs.webkit.org/show_bug.cgi?id=69138
1875         <rdar://problem/13410974>
1876
1877         Reviewed by Brady Eidson.
1878
1879         * platform/sql/SQLiteStatement.cpp:
1880         (WebCore::SQLiteStatement::getColumnBlobAsString):
1881
1882 2018-03-23  Chris Dumez  <cdumez@apple.com>
1883
1884         Promptly terminate service worker processes when they are no longer needed
1885         https://bugs.webkit.org/show_bug.cgi?id=183873
1886         <rdar://problem/38676995>
1887
1888         Reviewed by Youenn Fablet.
1889
1890         The StorageProcess now keeps track of service worker clients for each security
1891         origin. When there is no longer any clients for a given security origin, the
1892         StorageProcess asks the service worker process for the given origin to terminate
1893         and severs its connection to it.
1894
1895         Change is covered by API test.
1896
1897         * workers/service/server/SWServer.cpp:
1898         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
1899         Pass the security origin since this is called when a service worker process
1900         crashes. When a service worker process for origin A crashes, we only want
1901         to mark service workers in origin A as terminated, not ALL of them.
1902
1903         (WebCore::SWServer::registerServiceWorkerClient):
1904         (WebCore::SWServer::unregisterServiceWorkerClient):
1905         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
1906         Tweak logic so that we only relaunch a service worker process if we still
1907         have clients for its security origin.
1908
1909         * workers/service/server/SWServer.h:
1910         (WebCore::SWServer::disableServiceWorkerProcessTerminationDelay):
1911         Add a way to disable the service worker termination delay to facilitate
1912         testing.
1913
1914         * workers/service/server/SWServerToContextConnection.h:
1915
1916 2018-03-23  Brady Eidson  <beidson@apple.com>
1917
1918         Go to back/forward list items after a process-swapped navigation.
1919         <rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920
1920
1921         Reviewed by Andy Estes.
1922
1923         Covered by new API test.
1924
1925         Most of the changes to WebCore are teaching HistoryItem navigations to know when they should
1926         do a policy check or not.
1927
1928         * WebCore.xcodeproj/project.pbxproj:
1929
1930         * history/BackForwardController.cpp:
1931         (WebCore::BackForwardController::goBackOrForward):
1932         (WebCore::BackForwardController::goBack):
1933         (WebCore::BackForwardController::goForward):
1934
1935         * history/HistoryItem.cpp:
1936         (WebCore::HistoryItem::setStateObject): Actually push state object changes to the UIProcess.
1937           This was a long standing bug that made it difficult to effectively test this change.
1938
1939         * loader/FrameLoader.cpp:
1940         (WebCore::FrameLoader::loadURLIntoChildFrame):
1941         (WebCore::FrameLoader::loadDifferentDocumentItem):
1942         (WebCore::FrameLoader::loadItem):
1943         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
1944         * loader/FrameLoader.h:
1945         * loader/FrameLoaderTypes.h:
1946
1947         * loader/HistoryController.cpp:
1948         (WebCore::HistoryController::goToItem):
1949         (WebCore::HistoryController::setDefersLoading):
1950         (WebCore::HistoryController::recursiveGoToItem):
1951         * loader/HistoryController.h:
1952
1953         * loader/NavigationPolicyCheck.h:
1954
1955         * page/Page.cpp:
1956         (WebCore::Page::goToItem):
1957         * page/Page.h:
1958
1959 2018-03-23  John Wilander  <wilander@apple.com>
1960
1961         Resource Load Statistics: Fix decoder key isPrevalentResource->isVeryPrevalentResource
1962         https://bugs.webkit.org/show_bug.cgi?id=183950
1963         <rdar://problem/38806275>
1964
1965         Reviewed by Brent Fulgham.
1966
1967         * loader/ResourceLoadStatistics.cpp:
1968         (WebCore::ResourceLoadStatistics::decode):
1969             Now isVeryPrevalentResource is decoded to the correct field.
1970
1971 2018-03-23  Youenn Fablet  <youenn@apple.com>
1972
1973         WebProcessPool should not ask to register all clients for each service worker process creation
1974         https://bugs.webkit.org/show_bug.cgi?id=183941
1975
1976         Reviewed by Chris Dumez.
1977
1978         Covered by existing unit tests.
1979         Register all Documents of a process no matter its session ID when asked to.
1980         Make sure that whenever a WebProcess is asked to do so, any further Document will be registered
1981         by calling setMayHaveRegisteredServiceWorkers().
1982         This ensures that a WebProcess created before any service worker but empty at the time a service worker is created
1983         will actually register all its future clients.
1984
1985         Add some assertions to ensure that a client is not registered twice.
1986
1987         * workers/service/ServiceWorkerProvider.cpp:
1988         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
1989         * workers/service/ServiceWorkerProvider.h:
1990         * workers/service/server/SWServer.cpp:
1991         (WebCore::SWServer::registerServiceWorkerClient):
1992
1993 2018-03-23  Eric Carlson  <eric.carlson@apple.com>
1994
1995         HTMLElement factory doesn't need to call MediaPlayer::isAvailable
1996         https://bugs.webkit.org/show_bug.cgi?id=183946
1997         <rdar://problem/38802687>
1998
1999         Reviewed by Youenn Fablet.
2000
2001         Test: media/media-disabled.html
2002
2003         * dom/make_names.pl:
2004         (printConstructorInterior):
2005         * page/Settings.yaml:
2006         * page/SettingsDefaultValues.h:
2007
2008 2018-03-23  David Kilzer  <ddkilzer@apple.com>
2009
2010         Stop using dispatch_set_target_queue()
2011         <https://webkit.org/b/183908>
2012         <rdar://problem/33553533>
2013
2014         Reviewed by Daniel Bates.
2015
2016         No new tests since no change in behavior.
2017
2018         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2019         (WebCore::globaVideoCaptureSerialQueue): Remove use of
2020         dispatch_set_target_queue() by changing dispatch_queue_create()
2021         to dispatch_queue_create_with_target().
2022
2023 2018-03-23  Youenn Fablet  <youenn@apple.com>
2024
2025         Use libwebrtc ObjectiveC H264 encoder and decoder
2026         https://bugs.webkit.org/show_bug.cgi?id=183912
2027
2028         Reviewed by Eric Carlson.
2029
2030         No observable change of behavior.
2031         Made use of libwebrtc WebKit utilities.
2032         Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.
2033
2034         * Configurations/WebCore.xcconfig:
2035         * SourcesCocoa.txt:
2036         * WebCore.xcodeproj/project.pbxproj:
2037         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2038         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
2039         (WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
2040         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
2041         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
2042         (WebCore::LibWebRTCProviderCocoa::setActive):
2043         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
2044         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
2045         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
2046         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
2047         * testing/Internals.cpp: Removed commented out include.
2048
2049 2018-03-23  Youenn Fablet  <youenn@apple.com>
2050
2051         DocumentThreadableLoader should send credentials after redirections and preflight if fetch option credentials is include
2052         https://bugs.webkit.org/show_bug.cgi?id=183928
2053
2054         Reviewed by Chris Dumez.
2055
2056         Tests: imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.html
2057                imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.worker.html
2058
2059         In case mode is include, keep sending credentials even after redirection with preflight.
2060
2061         * loader/DocumentThreadableLoader.cpp:
2062         (WebCore::DocumentThreadableLoader::redirectReceived):
2063
2064 2018-03-23  Tim Horton  <timothy_horton@apple.com>
2065
2066         Fix the build after r229858
2067
2068         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2069
2070 2018-03-23  Youenn Fablet  <youenn@apple.com>
2071
2072         Allow fully whitelisted plug-ins to match non HTTP URLs
2073         https://bugs.webkit.org/show_bug.cgi?id=183938
2074         rdar://problem/38534312
2075
2076         Reviewed by Chris Dumez.
2077
2078         Covered by manual testing and unit testing.
2079
2080         * platform/URL.cpp:
2081         (WebCore::URL::isMatchingDomain const):
2082
2083 2018-03-23  Youenn Fablet  <youenn@apple.com>
2084
2085         ActiveDOMObject should assert that they are destroyed in the thread they are created
2086         https://bugs.webkit.org/show_bug.cgi?id=183671
2087
2088         Reviewed by Chris Dumez.
2089
2090         No change of behavior.
2091         Moved MessagePort assertion to ActiveDOMObject.
2092
2093         * dom/ActiveDOMObject.cpp:
2094         (WebCore::ActiveDOMObject::~ActiveDOMObject):
2095         * dom/ActiveDOMObject.h:
2096         * dom/MessagePort.cpp:
2097         (WebCore::MessagePort::~MessagePort):
2098         * dom/MessagePort.h:
2099
2100 2018-03-23  Youenn Fablet  <youenn@apple.com>
2101
2102         Safari WebKitWebRTCAudioModule crash during <video> tag update when audio track present in MediaStream
2103         https://bugs.webkit.org/show_bug.cgi?id=181180
2104         <rdar://problem/36302375>
2105
2106         Reviewed by Eric Carlson.
2107
2108         Test: webrtc/video-update-often.html
2109
2110         AudioTrackPrivateMediaStreamCocoa needs to be destroyed in the main thread since it owns a Ref to its MediaStreamTrackPrivate.
2111         We can still ref it on a background thread but we always deref it on the main thread.
2112
2113         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
2114         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
2115         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
2116
2117 2018-03-23  Sergio Villar Senin  <svillar@igalia.com>
2118
2119         [css-grid] Fix auto repeat tracks computation with definite min sizes
2120         https://bugs.webkit.org/show_bug.cgi?id=183933
2121
2122         Reviewed by Javier Fernandez.
2123
2124         Indefinitely sized containers use the specified definite min-size (if any) as available
2125         space in order to compute the number of auto repeat tracks to create. A bug in that code was
2126         causing the grid to be one track larger than expected. That was only happening in the case
2127         of the free space being a multiple of the total size of the autorepeat tracks.
2128
2129         Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html
2130
2131         * rendering/RenderGrid.cpp:
2132         (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
2133
2134 2018-03-23  Miguel Gomez  <magomez@igalia.com>
2135
2136         [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
2137         https://bugs.webkit.org/show_bug.cgi?id=183892
2138
2139         Reviewed by Žan Doberšek.
2140
2141         Always use RGBA format on BitmapTextureGL (when no other format is specifically requested). When
2142         the texture is updated from BGRA content, use a flag to indicate the shader to perform a color
2143         conversion during the painting. This way we don't need to swap the R and B components on the CPU.
2144         Also, remove one of the lists in BitmapTexturePool as now all of them have the same format, and
2145         remove the UpdateContentsFlag as we never need to modify the original image data.
2146
2147         Covered by existent tests.
2148
2149         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2150         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
2151         * platform/graphics/texmap/BitmapTexture.cpp:
2152         (WebCore::BitmapTexture::updateContents):
2153         * platform/graphics/texmap/BitmapTexture.h:
2154         * platform/graphics/texmap/BitmapTextureGL.cpp:
2155         (WebCore::BitmapTextureGL::BitmapTextureGL):
2156         (WebCore::BitmapTextureGL::didReset):
2157         (WebCore::BitmapTextureGL::updateContents):
2158         (WebCore::BitmapTextureGL::applyFilters):
2159         (WebCore::swizzleBGRAToRGBA): Deleted.
2160         (WebCore::BitmapTextureGL::updateContentsNoSwizzle): Deleted.
2161         * platform/graphics/texmap/BitmapTextureGL.h:
2162         (WebCore::BitmapTextureGL::colorConvertFlags const):
2163         * platform/graphics/texmap/BitmapTexturePool.cpp:
2164         (WebCore::BitmapTexturePool::acquireTexture):
2165         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
2166         * platform/graphics/texmap/BitmapTexturePool.h:
2167         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2168         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
2169         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
2170         (WebCore::TextureMapperContextAttributes::get):
2171         * platform/graphics/texmap/TextureMapperContextAttributes.h:
2172         * platform/graphics/texmap/TextureMapperGL.cpp:
2173         (WebCore::TextureMapperGL::drawNumber):
2174         (WebCore::TextureMapperGL::drawTexture):
2175         * platform/graphics/texmap/TextureMapperGL.h:
2176         * platform/graphics/texmap/TextureMapperLayer.cpp:
2177         (WebCore::TextureMapperLayer::paintIntoSurface):
2178         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2179         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
2180         * platform/graphics/texmap/TextureMapperTile.cpp:
2181         (WebCore::TextureMapperTile::updateContents):
2182         * platform/graphics/texmap/TextureMapperTile.h:
2183         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
2184         (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
2185         (WebCore::TextureMapperTiledBackingStore::updateContents):
2186         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
2187
2188 2018-03-23  Yusuke Suzuki  <utatane.tea@gmail.com>
2189
2190         [WTF] Add standard containers with FastAllocator specialization
2191         https://bugs.webkit.org/show_bug.cgi?id=183789
2192
2193         Reviewed by Darin Adler.
2194
2195         * Modules/indexeddb/IDBKeyData.h:
2196         * Modules/mediasource/SampleMap.h:
2197         * Modules/mediasource/SourceBuffer.cpp:
2198         * Modules/webauthn/cbor/CBORValue.h:
2199         It did not use FastAllocator for its container.
2200
2201         * page/WheelEventTestTrigger.h:
2202         * platform/audio/PlatformMediaSessionManager.h:
2203         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
2204         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2205         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2206         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2207         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2208         (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
2209         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2210         * platform/wpe/PlatformPasteboardWPE.cpp:
2211         * rendering/OrderIterator.h:
2212
2213 2018-03-23  Antoine Quint  <graouts@apple.com>
2214
2215         [Web Animations] infinite repeat counts aren't reflected for CSS Animations
2216         https://bugs.webkit.org/show_bug.cgi?id=183932
2217
2218         Reviewed by Dean Jackson.
2219
2220         The "infinite" value for animation-repeat-count is reflected as a special value which resolves to -1. We need to check
2221         for this special value before setting the iterations count on the AnimationEffectTimingReadOnly object.
2222
2223         * animation/CSSAnimation.cpp:
2224         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
2225
2226 2018-03-22  Antoine Quint  <graouts@apple.com>
2227
2228         [Web Animations] Correctly cancel animations when a parent gets a "display: none" style or when an element is removed
2229         https://bugs.webkit.org/show_bug.cgi?id=183919
2230
2231         Reviewed by Dean Jackson.
2232
2233         The old CSSAnimationController provided a cancelAnimations(Element&) method that allowed for animations for a given element
2234         to be canceled when a parent element in the hierarchy gets a "display: none" style or if an element with animations is removed.
2235         We add a similar cancelAnimationsForElement(Element&) method on AnimationTimeline and update CSSAnimationController::cancelAnimations()
2236         call sites to use AnimationTimeline::cancelAnimationsForElement() when the flag to use Web Animations is on.
2237
2238         * animation/AnimationTimeline.cpp:
2239         (WebCore::AnimationTimeline::cancelAnimationsForElement): Iterate over all animations for the provided element and call cancel() on them.
2240         * animation/AnimationTimeline.h:
2241         * animation/DocumentTimeline.cpp:
2242         (WebCore::DocumentTimeline::animatedStyleForRenderer): Drive-by fix while I was reviewed call sites to animationsForElement() to make
2243         sure we don't create extra RefPtr<> objects.
2244         * dom/Element.cpp:
2245         (WebCore::Element::removedFromAncestor): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when an
2246         element is removed.
2247         * dom/PseudoElement.cpp:
2248         (WebCore::PseudoElement::clearHostElement): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when
2249         a pseudo-element is removed.
2250         * rendering/updating/RenderTreeUpdater.cpp:
2251         (WebCore::RenderTreeUpdater::tearDownRenderers): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on
2252         for all children elements when an element gets a "display: none" style.
2253
2254 2018-03-23  Antoine Quint  <graouts@apple.com>
2255
2256         [Web Animations] Animated transform styles are ignored when calling getComputedStyle()
2257         https://bugs.webkit.org/show_bug.cgi?id=183918
2258
2259         Reviewed by Dean Jackson.
2260
2261         Strictly looking at whether the renderer has a transform is a bad idea when determining whether a
2262         transform is applied for an element. Looking at the RenderStyle is preferable because in the case
2263         of animations running on the compositor, such as a transform-only animation or transition, the
2264         renderer doesn't necessarily have a transform style on it, since we don't blend properties in
2265         software as the animation progresses. Instead, all of the blending is performed by the compositor,
2266         and only the computed style object has the software-blended transform style on it.
2267
2268         We do need to account for inline renderers though as these do not support transforms.
2269
2270         * css/CSSComputedStyleDeclaration.cpp:
2271         (WebCore::computedTransform):
2272
2273 2018-03-22  Antoine Quint  <graouts@apple.com>
2274
2275         [Web Animations] Support "transition: all" for CSS Transitions as Web Animations
2276         https://bugs.webkit.org/show_bug.cgi?id=183917
2277
2278         Reviewed by Dean Jackson.
2279
2280         We now support "transition: all" CSS Transitions by iterating over all known CSS properties should the mode
2281         of the backing animation be AnimateAll. Any property that we find to have a different value in the previous
2282         and current style will have a backing CSSTransition object created for it. To support this, we now explicitly
2283         provide a CSSPropertyID when creating a CSSTransition since we can no longer infer the transition property
2284         from the backing animation, as Animation objects with mode AnimateAll report CSSPropertyInvalid as their
2285         property.
2286
2287         * animation/AnimationTimeline.cpp:
2288         (WebCore::shouldBackingAnimationBeConsideredForCSSTransition): New method that checks whether a given backing
2289         Animation object is suitable for consideration as a CSSTransition, where the mode must not be either AnimateNone
2290         or AnimateUnknownProperty, and should the mode be AnimateSingleProperty, the property must not be CSSPropertyInvalid.
2291         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): We now assemble the list of previously animated
2292         properties by looking at the m_elementToCSSTransitionByCSSPropertyID map and getting its keys. Then we compile
2293         all backing Animation objects found in the old style that match the conditions enforced by the new method
2294         shouldBackingAnimationBeConsideredForCSSTransition(). Then as we iterate over backing Animation objects found
2295         in the new style, we iterate over all known CSS properties if the mode is AnimateAll, indicating that we're dealing
2296         with a "transition: all" style. If we're dealing with a single property, we only process that single property.
2297         * animation/CSSTransition.cpp:
2298         (WebCore::CSSTransition::create): Expect a new CSSPropertyID parameter when creating a new CSSTransition since
2299         we can no longer infer it from the backing Animation object.
2300         (WebCore::CSSTransition::CSSTransition): Expect a new CSSPropertyID parameter when creating a new CSSTransition
2301         since we can no longer infer it from the backing Animation object.
2302         (WebCore::CSSTransition::matchesBackingAnimationAndStyles const): We can no longer use the == overloaded operator
2303         for backing Animation objects to determine whether their respective properties match since this would compare the
2304         "property" member of both Animation objects and when going from a "transition: all" style to one targeting a single
2305         property, we would falsely identify mis-matching Animation objects. Instead, we pass a false flag to animationsMatch()
2306         which indicates that we don't care about matching the transition property itself.
2307         * animation/CSSTransition.h: Expose a new property() accessor which returns the CSSPropertyID passed at construction.
2308         * animation/KeyframeEffectReadOnly.cpp:
2309         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes): Use the new property() accessor on
2310         CSSTransition to get at the transition property.
2311         * platform/animation/Animation.cpp:
2312         (WebCore::Animation::animationsMatch const): Replace the boolean parameter, which was not in use in WebCore, to indicate
2313         whether we should match the property-related fields. We need this in CSSTransition::matchesBackingAnimationAndStyles().
2314         * platform/animation/Animation.h:
2315
2316 2018-03-22  Tim Horton  <timothy_horton@apple.com>
2317
2318         Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebCore
2319         https://bugs.webkit.org/show_bug.cgi?id=183930
2320         <rdar://problem/38782249>
2321
2322         Reviewed by Dan Bernstein.
2323
2324         * Configurations/Base.xcconfig:
2325         * Configurations/WebCore.xcconfig:
2326         * Configurations/WebCoreTestSupport.xcconfig:
2327
2328 2018-03-22  Commit Queue  <commit-queue@webkit.org>
2329
2330         Unreviewed, rolling out r229876.
2331         https://bugs.webkit.org/show_bug.cgi?id=183929
2332
2333         Some webrtc tests are timing out on iOS simulator (Requested
2334         by youenn on #webkit).
2335
2336         Reverted changeset:
2337
2338         "Use libwebrtc ObjectiveC H264 encoder and decoder"
2339         https://bugs.webkit.org/show_bug.cgi?id=183912
2340         https://trac.webkit.org/changeset/229876
2341
2342 2018-03-22  Megan Gardner  <megan_gardner@apple.com>
2343
2344         Expose more system colors via CSS
2345         https://bugs.webkit.org/show_bug.cgi?id=183764
2346         <rdar://problem/36975898>
2347
2348         Reviewed by Tim Horton.
2349
2350         Test: fast/css/apple-system-control-colors.html
2351
2352         Expose Apple specific system colors via CSS.
2353
2354         * rendering/RenderThemeMac.mm:
2355         (WebCore::RenderThemeMac::systemColor const):
2356
2357 2018-03-22  Nan Wang  <n_wang@apple.com>
2358
2359         AX: Web table row count is incorrect when role row is added to <tr> in DOM
2360         https://bugs.webkit.org/show_bug.cgi?id=183922
2361
2362         Reviewed by Chris Fleizach.
2363
2364         Although the parent table for an ARIA grid row should be an ARIA table, we
2365         should return the native table if the row is native <tr>.
2366
2367         Test: accessibility/row-with-aria-role-in-native-table.html
2368
2369         * accessibility/AccessibilityARIAGridRow.cpp:
2370         (WebCore::AccessibilityARIAGridRow::parentTable const):
2371
2372 2018-03-22  Chris Dumez  <cdumez@apple.com>
2373
2374         Include security origin in the service worker process name
2375         https://bugs.webkit.org/show_bug.cgi?id=183913
2376
2377         Reviewed by Youenn Fablet.
2378
2379         Updated localizable strings.
2380
2381         * English.lproj/Localizable.strings:
2382
2383 2018-03-22  Youenn Fablet  <youenn@apple.com>
2384
2385         Use libwebrtc ObjectiveC H264 encoder and decoder
2386         https://bugs.webkit.org/show_bug.cgi?id=183912
2387
2388         Reviewed by Eric Carlson.
2389
2390         No observable change of behavior.
2391         Made use of libwebrtc WebKit utilities.
2392         Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.
2393
2394         * Configurations/WebCore.xcconfig:
2395         * SourcesCocoa.txt:
2396         * WebCore.xcodeproj/project.pbxproj:
2397         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2398         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
2399         (WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
2400         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
2401         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
2402         (WebCore::LibWebRTCProviderCocoa::setActive):
2403         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
2404         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
2405         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
2406         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
2407         * testing/Internals.cpp: Removed commented out include.
2408
2409 2018-03-22  Michael Catanzaro  <mcatanzaro@gnome.org>
2410
2411         Unreviewed, fix format string warnings in service worker code
2412
2413         On Linux x86_64, uint64_t is unsigned long, not unsigned long long.
2414
2415         * workers/service/ServiceWorkerContainer.cpp:
2416         (WebCore::ServiceWorkerContainer::addRegistration):
2417         (WebCore::ServiceWorkerContainer::removeRegistration):
2418         (WebCore::ServiceWorkerContainer::updateRegistration):
2419         (WebCore::ServiceWorkerContainer::jobFailedWithException):
2420         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2421         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
2422         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
2423         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
2424         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2425
2426 2018-03-22  Daniel Bates  <dabates@apple.com>
2427
2428         Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
2429         https://bugs.webkit.org/show_bug.cgi?id=183907
2430         <rdar://problem/38759127>
2431
2432         Reviewed by Alex Christensen.
2433
2434         Exports SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() so that we can use it from WebKit.
2435
2436         * platform/SchemeRegistry.h:
2437
2438 2018-03-22  Daniel Bates  <dabates@apple.com>
2439
2440         CSS mask images should be retrieved using potentially CORS-enabled fetch
2441         https://bugs.webkit.org/show_bug.cgi?id=179983
2442         <rdar://problem/35678149>
2443
2444         Reviewed by Brent Fulgham.
2445
2446         As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor's Draft, 23 December 2017)
2447         we should fetch CSS mask images using a potentially CORS-enabled fetch.
2448
2449         Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
2450         attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
2451         For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
2452         fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
2453         closely align with the behavior in the spec.
2454
2455         Test: http/tests/security/css-mask-image.html
2456
2457         * style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
2458         LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
2459         in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
2460         (WebCore::Style::loadPendingImage): Ditto.
2461         (WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
2462         a mask image or shape-outside image.
2463
2464 2018-03-22  Zalan Bujtas  <zalan@apple.com>
2465
2466         [Simple line layout] Text with letter spacing is not positioned properly.
2467         https://bugs.webkit.org/show_bug.cgi?id=183079
2468         <rdar://problem/38762569>
2469
2470         Reviewed by Antti Koivisto.
2471
2472         We need to recompute RenderText::m_canUseSimplifiedTextMeasuring when the font cascade changes
2473         since we might not be able to use the fast path anymore.
2474
2475         Test: fast/text/simple-line-layout-dynamic-letter-word-spacing.html
2476
2477         * rendering/RenderText.cpp:
2478         (WebCore::RenderText::styleDidChange):
2479
2480 2018-03-21  Antoine Quint  <graouts@apple.com>
2481
2482         [Web Animations] Make imported/mozilla/css-animations/test_event-dispatch.html pass reliably
2483         https://bugs.webkit.org/show_bug.cgi?id=183845
2484
2485         Reviewed by Dean Jackson.
2486
2487         Finish the work to get DOM events for CSS Animations and CSS Transitions dispatching as specified.
2488
2489         * animation/AnimationEffectReadOnly.cpp: Move timeEpsilon to be shared as part of WebAnimationUtilities.h since we now need it in
2490         WebAnimation::timeToNextRequiredTick().
2491         * animation/AnimationTimeline.cpp:
2492         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): We add a pre-emptive return clause when we know that the AnimationList
2493         for previous and current styles are a match.
2494         * animation/CSSTransition.cpp:
2495         (WebCore::CSSTransition::matchesBackingAnimationAndStyles const): Ensure we have a valid effect before downcasting it.
2496         * animation/DeclarativeAnimation.cpp:
2497         (WebCore::DeclarativeAnimation::initialize): We need to call pause() for declarative animations that aren't playing so that the animation's
2498         playState is set correctly and the animation is not idle.
2499         * animation/DocumentTimeline.cpp:
2500         (WebCore::DocumentTimeline::updateAnimationSchedule): We no longer need to pass the current time to timeToNextRequiredTick() since the method has
2501         been reworked to use the animation's current time, which is based on the timeline's current time.
2502         (WebCore::DocumentTimeline::updateAnimations): Avoid creating a copy when iterating over pending hardware animations.
2503         * animation/KeyframeEffectReadOnly.cpp:
2504         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): We should never generate new blending keyframes if the
2505         old and new styles contain the same value, since there would be no transition between two equal values, and we should only look at whether the new
2506         style value and the recorded target value differ to determine if new blending keyframes are necessary.
2507         * animation/WebAnimation.cpp:
2508         (WebCore::WebAnimation::timeToNextRequiredTick const): We correct our scheduling code which was shown to be broken in several of the newly-imported
2509         Mozilla tests. Any running animation is now scheduled to invalidate again on the next tick, and we use timeEpsilon from WebAnimationUtilities.h to
2510         correctly check if we're right at the active threshold, when we also invalidate on the next tick. If our current time is negative, in other words
2511         when the animation has not yet started, we schedule this animation's next tick to be the negative of that value. In all other cases, no invalidation
2512         needs to be scheduled.
2513         * animation/WebAnimation.h: We move updateFinishedState() to private since this method is not actually used outside of WebAnimation.cpp.
2514         * animation/WebAnimationUtilities.h: Move timeEpsilon to be shared as part of WebAnimationUtilities.h.
2515
2516 2018-03-22  Tim Horton  <timothy_horton@apple.com>
2517
2518         Improve readability of WebCore's OTHER_LDFLAGS
2519         https://bugs.webkit.org/show_bug.cgi?id=183909
2520         <rdar://problem/38760992>
2521
2522         Reviewed by Dan Bernstein.
2523
2524         * Configurations/Base.xcconfig:
2525         * Configurations/FeatureDefines.xcconfig:
2526         * Configurations/WebCore.xcconfig:
2527
2528 2018-03-22  Tim Horton  <timothy_horton@apple.com>
2529
2530         Adopt USE(OPENGL[_ES]) in more places
2531         https://bugs.webkit.org/show_bug.cgi?id=183882
2532         <rdar://problem/37912195>
2533
2534         Reviewed by Dan Bernstein.
2535
2536         * platform/graphics/GraphicsContext3D.h:
2537         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2538         (WebCore::hasMuxableGPU):
2539         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
2540         (WebCore::GraphicsContext3D::GraphicsContext3D):
2541         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2542         (WebCore::GraphicsContext3D::makeContextCurrent):
2543         (WebCore::GraphicsContext3D::checkGPUStatus):
2544         (WebCore::GraphicsContext3D::texImageIOSurface2D):
2545         * platform/graphics/cocoa/WebGLLayer.h:
2546         * platform/graphics/cocoa/WebGLLayer.mm:
2547         (-[WebGLLayer initWithGraphicsContext3D:]):
2548         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
2549         (-[WebGLLayer display]):
2550         * platform/graphics/ios/GraphicsContext3DIOS.h:
2551         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
2552         (WebCore::Extensions3DOpenGL::blitFramebuffer):
2553         (WebCore::Extensions3DOpenGL::createVertexArrayOES):
2554         (WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
2555         (WebCore::Extensions3DOpenGL::isVertexArrayOES):
2556         (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
2557         * platform/graphics/opengl/Extensions3DOpenGL.h:
2558         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2559         (WebCore::GraphicsContext3D::reshapeFBOs):
2560         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
2561         (WebCore::GraphicsContext3D::renderbufferStorage):
2562         (WebCore::GraphicsContext3D::getIntegerv):
2563         (WebCore::GraphicsContext3D::texImage2D):
2564         (WebCore::GraphicsContext3D::depthRange):
2565         (WebCore::GraphicsContext3D::clearDepth):
2566         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2567         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2568         Make it a bit more clear which code is platform-dependent and which code is GL/GLES-dependent.
2569
2570 2018-03-22  Zan Dobersek  <zdobersek@igalia.com>
2571
2572         [TexMap] Make TextureMapperContextAttributes thread-specific
2573         https://bugs.webkit.org/show_bug.cgi?id=183895
2574
2575         Reviewed by Carlos Garcia Campos.
2576
2577         Store the TextureMapperContextAttributes in a thread-specific manner.
2578         The TextureMapperContextAttributes::get() method is now used to retrieve
2579         a reference to that thread-specific object. If it's not been initialized
2580         yet, then the current GL context is used for the initialization, as it
2581         used to be done in the now-removed initialize() method.
2582
2583         TextureMapperPlatformLayerBuffer::clone() method now doesn't need to
2584         be passed a TextureMapperGL object, since the texture can be created
2585         directly by calling BitmapTextureGL::create(), passing the
2586         TextureMapperContextAttributes object that's retrieved from the
2587         thread-specific storage. This further simplifies the
2588         TextureMapperPlatformLayerProxy::Compositor interface, removing the
2589         texmapGL() getter from it.
2590
2591         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2592         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2593         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
2594         (WebCore::threadSpecificAttributes):
2595         (WebCore::TextureMapperContextAttributes::get):
2596         (WebCore::TextureMapperContextAttributes::initialize): Deleted.
2597         * platform/graphics/texmap/TextureMapperContextAttributes.h:
2598         * platform/graphics/texmap/TextureMapperGL.cpp:
2599         (WebCore::TextureMapperGL::TextureMapperGL):
2600         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2601         (WebCore::TextureMapperPlatformLayerBuffer::clone):
2602         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2603         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2604         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
2605         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2606
2607 2018-03-22  Zalan Bujtas  <zalan@apple.com>
2608
2609         SVG root is skipped while marking percentage height descendants dirty.
2610         https://bugs.webkit.org/show_bug.cgi?id=183877
2611
2612         Reviewed by Antti Koivisto.
2613
2614         Calling continingBlock() to get to the correct container works as long as the ancestor inline element
2615         renderers are wrapped in anonymous blocks (continuation for example).
2616
2617         While the SVG root renderer is an inline renderer, it is not wrapped or normalized in any way,
2618         so containingBlock() will elegantly skip it and return an SVG root ancestor.
2619         dirtyForLayoutFromPercentageHeightDescendants calls containingBlock() to walk up
2620         on the ancestor chain to mark elements dirty. This fails when there's an SVG subtree in the block chain.
2621         This patch marks the SVG subtree chain dirty to ensure that layout will get to all the dirty leaf renderers 
2622         (note that the SVG subtree is supposed to have only statically positioned elements so parent == containing block).
2623
2624         Covered by existing tests.
2625
2626         * rendering/RenderBlock.cpp:
2627         (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):
2628
2629 2018-03-22  Adrian Perez de Castro  <aperez@igalia.com>
2630
2631         [WPE][GTK] Build failure when ENABLE_VIDEO, ENABLE_WEB_AUDIO and ENABLE_XSLT are disabled
2632         https://bugs.webkit.org/show_bug.cgi?id=183896
2633
2634         Reviewed by Yusuke Suzuki.
2635
2636         No new tests needed.
2637
2638         * bindings/js/JSWebAnimationCustom.cpp: Add missing #include of Document.h
2639
2640 2018-03-21  Chris Dumez  <cdumez@apple.com>
2641
2642         Regression(r229828): WebKit.NoHistoryItemScrollToFragment API test is failing on iOS
2643         https://bugs.webkit.org/show_bug.cgi?id=183886
2644
2645         Reviewed by Wenson Hsieh.
2646
2647         Since r229828, the FrameLoader needs to call FrameLoaderClient::didDecidePolicyForNavigationAction()
2648         whenever a navigation policy decision is made. I added such a call r229828 to
2649         FrameLoader::continueLoadAfterNavigationPolicy() but forgot to add one to
2650         FrameLoader::continueFragmentScrollAfterNavigationPolicy(), which is the equivalent
2651         for fragment navigations.
2652
2653         * loader/FrameLoader.cpp:
2654         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
2655
2656 2018-03-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
2657
2658         Disconnect the SVGPathSegList items from their SVGPathElement before rebuilding a new list
2659         https://bugs.webkit.org/show_bug.cgi?id=183723
2660         <rdar://problem/38517871>
2661
2662         Reviewed by Daniel Bates.
2663
2664         When setting the "d" attribute directly on a path, we rebuild the list
2665         of path segments held for creating the property tear off. The old path
2666         segments need to get disconnected from the path element. We already do 
2667         that when a path segment is replaced or removed.
2668
2669         Test: svg/dom/reuse-pathseg-after-changing-d.html
2670
2671         * svg/SVGPathElement.cpp:
2672         (WebCore::SVGPathElement::svgAttributeChanged):
2673         * svg/SVGPathSegList.cpp:
2674         (WebCore::SVGPathSegList::clear): SVGPathSegListValues::clearContextAndRoles()
2675         will now be called from SVGPathSegListValues::clear() via SVGListProperty::clearValues().
2676         (WebCore::SVGPathSegList::replaceItem):
2677         (WebCore::SVGPathSegList::removeItem):
2678         (WebCore::SVGPathSegList::clearContextAndRoles): Deleted.
2679         * svg/SVGPathSegList.h: SVGPathSegListValues::clearContextAndRoles() will
2680         now be called from SVGPathSegListValues::clear() via SVGListProperty::initializeValues().
2681         * svg/SVGPathSegListValues.cpp:
2682         (WebCore::SVGPathSegListValues::clearItemContextAndRole):
2683         (WebCore::SVGPathSegListValues::clearContextAndRoles):
2684         * svg/SVGPathSegListValues.h:
2685         (WebCore::SVGPathSegListValues::operator=):
2686         (WebCore::SVGPathSegListValues::clear):
2687
2688 2018-03-21  Antoine Quint  <graouts@apple.com>
2689
2690         [Web Animations] Ensure animationcancel and transitioncancel events are dispatched
2691         https://bugs.webkit.org/show_bug.cgi?id=183864
2692
2693         Reviewed by Dean Jackson.
2694
2695         In order to correctly dispatch animationcancel and transitioncancel events, we must call cancel() on CSSAnimation and CSSTransitions
2696         objects that are removed while in a play or pause phase. Additionally, we cancel declarative animations that are moving from a valid
2697         to a null timeline. Finally, when cancel() is called on a declarative animation, we record the timestamp and manually call
2698         invalidateDOMEvents() passing that timestamp in to ensure that the right phase change is recorded and results in the queuing of
2699         animationcancel and transitioncancel events.
2700
2701         * animation/AnimationTimeline.cpp:
2702         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Make sure we cancel all recorded CSS Animations when we newly get a
2703         "display: none" style. We also call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing animations outright,
2704         for all animations that previously existed but are no longer listed in the current style.
2705         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Like in updateCSSAnimationsForElement(), we cancel all recorded CSS
2706         Transitions when we newly get a "display: none" style. We now use the refactored removeDeclarativeAnimation() method to remove an
2707         a transition for a property that was already transitioned in the previous style but has a new backing Animation object. Finally,
2708         like in updateCSSAnimationsForElement(), we call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing transitions
2709         outright, for all transitions that previously existed but are no longer listed in the current style.
2710         (WebCore::AnimationTimeline::removeDeclarativeAnimation): Refactor code into this new method to remove a declarative animation.
2711         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Cancels a DeclarativeAnimation if it's active or removes it right away.
2712         * animation/AnimationTimeline.h:
2713         * animation/DeclarativeAnimation.cpp:
2714         (WebCore::DeclarativeAnimation::setTimeline): If we're moving from a valid timeline to a null timeline, call cancel() on this animation
2715         such that an animationcancel or transitioncancel event can be dispatched.
2716         (WebCore::DeclarativeAnimation::cancel): Cancelations require the computation of the time at which a declarative animation was canceled,
2717         so we record the animation's active time as it's canceled and manually call invalidateDOMEvents() with that time after the general cancel()
2718         code has run.
2719         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Accept an explicit timestamp for cancel events.
2720         * animation/DeclarativeAnimation.h:
2721         * animation/WebAnimation.h:
2722
2723 2018-03-21  Chris Dumez  <cdumez@apple.com>
2724
2725         ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates
2726         https://bugs.webkit.org/show_bug.cgi?id=183787
2727
2728         Reviewed by Wenson Hsieh.
2729
2730         * loader/FrameLoader.cpp:
2731         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2732         * loader/FrameLoaderClient.h:
2733
2734 2018-03-21  Eric Carlson  <eric.carlson@apple.com>
2735
2736         Clean up platform VideoFullscreenLayerManager
2737         https://bugs.webkit.org/show_bug.cgi?id=183859
2738         <rdar://problem/38715419>
2739
2740         Reviewed by Jer Noble.
2741
2742         No new tests, no functional change.
2743
2744         * WebCore.xcodeproj/project.pbxproj:
2745         * platform/graphics/VideoFullscreenLayerManager.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h.
2746         (WebCore::VideoFullscreenLayerManager::~VideoFullscreenLayerManager):
2747         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2748         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2749         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2750         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2751         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
2752         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer const):
2753         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
2754         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
2755         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
2756         (WebCore::MediaPlayerPrivateAVFoundationObjC::requiresTextTrackRepresentation const):
2757         (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds):
2758         (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation):
2759         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2760         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2761         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2762         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformLayer const):
2763         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
2764         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer):
2765         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
2766         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenFrame):
2767         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::requiresTextTrackRepresentation const):
2768         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::syncTextTrackBounds):
2769         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation):
2770         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2771         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2772         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
2773         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
2774         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers):
2775         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer const):
2776         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
2777         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenFrame):
2778         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h.
2779         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm.
2780         (-[WebVideoContainerLayer setBounds:]):
2781         (-[WebVideoContainerLayer setPosition:]):
2782         (WebCore::VideoFullscreenLayerManagerObjC::VideoFullscreenLayerManagerObjC):
2783         (WebCore::VideoFullscreenLayerManagerObjC::setVideoLayer):
2784         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
2785         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame):
2786         (WebCore::VideoFullscreenLayerManagerObjC::didDestroyVideoLayer):
2787         (WebCore::VideoFullscreenLayerManagerObjC::requiresTextTrackRepresentation const):
2788         (WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds):
2789         (WebCore::VideoFullscreenLayerManagerObjC::setTextTrackRepresentation):
2790
2791 2018-03-21  Antoine Quint  <graouts@apple.com>
2792
2793         [Web Animations] Dispatch DOM events for CSS Transitions and CSS Animations implemented as Web Animations
2794         https://bugs.webkit.org/show_bug.cgi?id=183781
2795
2796         Reviewed by Dean Jackson.
2797
2798         Now that we've implemented CSS Animations and CSS Transitions as Web Animations (webkit.org/b/183504) we can dispatch DOM events
2799         for targets of DeclarativeAnimation objects. To do that, we add a new invalidateDOMEvents() method on DeclarativeAnimations which
2800         is called when the timer scheduled after the timing model has been invalidated fires in DocumentTimeline::performInvalidationTask().
2801         When we check for DOM events to dispatch, we look at the last recorded phase and iteration and determine whether the state of the
2802         animation has changed. We use a GenericEventQueue to enqueue the events such that they are dispatched asynchronously at a moment
2803         when it is safe to evaluate script.
2804
2805         * animation/AnimationEffectReadOnly.h: Make currentIteration() public since we now need it in DeclarativeAnimation::invalidateDOMEvents().
2806         * animation/CSSAnimation.cpp:
2807         (WebCore::CSSAnimation::create): Pass the animation target to the constructor instead of its document.
2808         (WebCore::CSSAnimation::CSSAnimation): Pass the animation target to the superclass instead of its document.
2809         * animation/CSSAnimation.h:
2810         * animation/CSSTransition.cpp:
2811         (WebCore::CSSTransition::create): Pass the animation target to the constructor instead of its document.
2812         (WebCore::CSSTransition::CSSTransition): Pass the animation target to the superclass instead of its document.
2813         * animation/CSSTransition.h:
2814         * animation/DeclarativeAnimation.cpp:
2815         (WebCore::DeclarativeAnimation::DeclarativeAnimation): Expect an Element instead of a Document and use that element as the target of the
2816         GenericEventQueue that we initialize. We also register this element as our m_target.
2817         (WebCore::DeclarativeAnimation::~DeclarativeAnimation): Close the GenericEventQueue member upon destruction.
2818         (WebCore::DeclarativeAnimation::initialize): We need to call pause() for declarative animations that aren't playing so that the animation's
2819         playState is set correctly and the animation is not idle.
2820         (WebCore::DeclarativeAnimation::phaseWithoutEffect const): Because we may need to get an animation's current phase in invalidateDOMEvents()
2821         after an animation's effect has been removed, we provide an alternate way to compute the phase just by looking at the animation's current time.
2822         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Based on the previous and current pending state, iteration and phase, we enqueue animation
2823         and transition DOM events as specified by the CSS Animations Level 2 and CSS Transitions Level 2 specifications.
2824         (WebCore::DeclarativeAnimation::enqueueDOMEvent): Enqueue an event on the GenericEventQueue based on the animation type.
2825         * animation/DeclarativeAnimation.h:
2826         * animation/DocumentTimeline.cpp:
2827         (WebCore::DocumentTimeline::performInvalidationTask): We call invalidateDOMEvents() on all declarative animations registered with this timeline
2828         now that the timing model has been invalidated.
2829         * dom/EventNames.h: Add the names of newly-implemented events (animationcancel, transitioncancel, transitionrun and transitionstart).
2830         * dom/GlobalEventHandlers.idl: Add new attribute-based event handlers for the newly-implemented events.
2831         * html/HTMLAttributeNames.in: Add new attribute-based event handlers for the newly-implemented events.
2832         * html/HTMLElement.cpp:
2833         (WebCore::HTMLElement::createEventHandlerNameMap): Add new attribute-based event handlers for the newly-implemented events.
2834
2835 2018-03-21  Per Arne Vollan  <pvollan@apple.com>
2836
2837         Compile error when not using IOSurface canvas backing store.
2838         https://bugs.webkit.org/show_bug.cgi?id=183855
2839
2840         Reviewed by Brent Fulgham.
2841
2842         The method IOSurface::createFromImageBuffer is only referenced when IOSurface
2843         is used as canvas backing store.
2844
2845         * platform/graphics/cocoa/IOSurface.h:
2846         * platform/graphics/cocoa/IOSurface.mm:
2847
2848 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
2849
2850         [CoordGraphics] Track dirty rects that need update in CoordinatedGraphicsLayer
2851         https://bugs.webkit.org/show_bug.cgi?id=175376
2852
2853         Reviewed by Carlos Garcia Campos.
2854
2855         Follow the GraphicsLayerCA class and track rectangles in need of display
2856         in a Vector object. In case the whole layer needs updating, it's marked
2857         separately, and further rects are ignored.
2858
2859         During layer flush, all the rects are used to invalidate the backing
2860         store, or a single layer-sized rect is used in case the whole layer has
2861         to be updated. We can also bail early from updateContentBuffers() if
2862         there are no dirty rects recorded and there's no pending visible rect
2863         adjustment.
2864
2865         At the end of updateContentBuffers() we now test for an existing
2866         previous backing store before inquiring the backing store if the visible
2867         area is already covered, enabling deletion of this backing store.
2868
2869         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2870         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplay):
2871         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect):
2872         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
2873         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2874
2875 2018-03-21  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2876
2877         [WPE] Build failure with ENABLE_VIDEO=OFF when GStreamer is not available
2878         https://bugs.webkit.org/show_bug.cgi?id=183811
2879
2880         Reviewed by Philippe Normand.
2881
2882         Add build guards for USE_GSTREAMER.
2883
2884         No new tests, it is a build fix.
2885
2886         * platform/graphics/gstreamer/GStreamerUtilities.h:
2887
2888 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
2889
2890         [Cairo] Draw Cairo patterns with cairo_paint_with_alpha()
2891         https://bugs.webkit.org/show_bug.cgi?id=183774
2892
2893         Reviewed by Carlos Garcia Campos.
2894
2895         In the drawPatternToCairoContext() helper in CairoOperations.cpp source
2896         file, always clip the painting region to the specified rectangle and
2897         then use cairo_paint_with_alpha() to paint the passed-in pattern object,
2898         not relaying rasterization to cairo_fill() when using opaque alpha. We
2899         still clamp the alpha value to the 0.0 - 1.0 range.
2900
2901         No new tests -- no change in behavior.
2902
2903         * platform/graphics/cairo/CairoOperations.cpp:
2904         (WebCore::Cairo::drawPatternToCairoContext):
2905
2906 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
2907
2908         [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
2909         https://bugs.webkit.org/show_bug.cgi?id=183771
2910
2911         Reviewed by Carlos Garcia Campos.
2912
2913         TextureMapperLayer::applyAnimationsRecursively() should return true when
2914         the TextureMapperLayer tree has currently-running animations that
2915         require continuous scene update.
2916
2917         TextureMapperAnimation::ApplicationResult gains the hasRunningAnimation
2918         member that's set to true if any of the applied animations are still in
2919         playing state. That information is then returned in syncAnimations(),
2920         and the result is accumulated in the top applyAnimationsRecursively()
2921         call and returned there to the caller.
2922
2923         No new tests -- no change in behavior.
2924
2925         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2926         (WebCore::TextureMapperAnimation::apply):
2927         * platform/graphics/texmap/TextureMapperAnimation.h:
2928         * platform/graphics/texmap/TextureMapperLayer.cpp:
2929         (WebCore::TextureMapperLayer::applyAnimationsRecursively):
2930         (WebCore::TextureMapperLayer::syncAnimations):
2931         * platform/graphics/texmap/TextureMapperLayer.h:
2932
2933 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
2934
2935         Use-after-move in SWContextManager::terminateWorker() with Linux x86_64 calling convention
2936         https://bugs.webkit.org/show_bug.cgi?id=183783
2937
2938         Reviewed by Chris Dumez.
2939
2940         In SWContextManager::terminateWorker(), some calling conventions can
2941         end up moving the ServiceWorkerThreadProxy RefPtr into the lambda struct
2942         before that proxy's thread (on which the lambda is bound to execute) is
2943         retrieved.
2944
2945         Avoid this by taking a reference to the thread in a separate earlier
2946         expression, before the RefPtr is moved into the lambda in the following
2947         one.
2948
2949         * workers/service/context/SWContextManager.cpp:
2950         (WebCore::SWContextManager::terminateWorker):
2951
2952 2018-03-21  Timothy Horton  <timothy_horton@apple.com>
2953
2954         Fix the build
2955
2956         * platform/network/cf/FormDataStreamCFNet.cpp:
2957
2958 2018-03-20  Tim Horton  <timothy_horton@apple.com>
2959
2960         Introduce HAVE_MEDIA_PLAYER and HAVE_CORE_VIDEO
2961         https://bugs.webkit.org/show_bug.cgi?id=183803
2962         <rdar://problem/38690487>
2963
2964         Reviewed by Sam Weinig.
2965
2966         * platform/audio/ios/MediaSessionManagerIOS.mm:
2967         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
2968         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
2969         (-[WebMediaSessionHelper initWithCallback:]):
2970         (-[WebMediaSessionHelper dealloc]):
2971         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
2972         * platform/cocoa/CoreVideoSoftLink.cpp:
2973         * platform/cocoa/CoreVideoSoftLink.h:
2974         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2975         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2976         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
2977         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame const):
2978         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
2979         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2980         (WebCore::MediaSampleAVFObjC::getRGBAImageData const):
2981         * platform/graphics/cv/PixelBufferConformerCV.cpp:
2982         * platform/graphics/cv/PixelBufferConformerCV.h:
2983         * platform/graphics/cv/TextureCacheCV.h:
2984         * platform/graphics/cv/TextureCacheCV.mm:
2985         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2986         * platform/graphics/cv/VideoTextureCopierCV.h:
2987         Make it possible to disable our dependency on MediaPlayer and CoreVideo.
2988
2989 2018-03-20  Tim Horton  <timothy_horton@apple.com>
2990
2991         Enable the minimal simulator feature flag when appropriate
2992         https://bugs.webkit.org/show_bug.cgi?id=183807
2993
2994         Reviewed by Dan Bernstein.
2995
2996         * Configurations/FeatureDefines.xcconfig:
2997
2998 2018-03-19  Ryosuke Niwa  <rniwa@webkit.org>
2999
3000         Expose content attributes on _WKLinkIconParameters
3001         https://bugs.webkit.org/show_bug.cgi?id=183768
3002
3003         Reviewed by Alex Christensen.
3004
3005         Collect a vector of content attributes upon finding touch and fav-icons in order to expose it in a WebKit API.
3006
3007         Tests: IconLoading.DefaultFavicon
3008
3009         * html/LinkIconCollector.cpp:
3010         (WebCore::LinkIconCollector::iconsOfTypes): Collect attributes.
3011         * loader/DocumentLoader.cpp:
3012         (WebCore::DocumentLoader::startIconLoading): Use an empty vector for /favicon.ico.
3013         * platform/LinkIcon.h:
3014         (WebCore::LinkIcon::encode const): Encode the vector of content attributes.
3015         (WebCore::LinkIcon::decode): Ditto for decoding.
3016
3017 2018-03-20  Zalan Bujtas  <zalan@apple.com>
3018
3019         RenderTreeNeedsLayoutChecker fails with absolutely positioned svg and <use>
3020         https://bugs.webkit.org/show_bug.cgi?id=183718
3021
3022         Reviewed by Antti Koivisto.
3023
3024         This patch ensures after resolving the style for an SVG element with a corresponding element (<use>),
3025         we adjust this style for the cloned SVG element too.
3026
3027         Test: svg/in-html/path-with-absolute-positioned-svg-and-use-crash.html
3028
3029         * css/StyleResolver.cpp:
3030         (WebCore::StyleResolver::adjustSVGElementStyle):
3031         (WebCore::StyleResolver::adjustRenderStyle):
3032         * css/StyleResolver.h:
3033         * svg/SVGElement.cpp:
3034         (WebCore::SVGElement::resolveCustomStyle):
3035
3036 2018-03-20  Brady Eidson  <beidson@apple.com>
3037
3038         First piece of process swapping on navigation.
3039         https://bugs.webkit.org/show_bug.cgi?id=183665
3040
3041         Reviewed by Andy Estes.
3042
3043         Covered by API test(s)
3044
3045         This patch:
3046         - A new PolicyAction::Suspend for future use in this feature
3047         - Makes sure that loads triggered as part of a process swap do *not* re-consult the policy delegate
3048
3049         * loader/DocumentLoader.cpp:
3050         (WebCore::DocumentLoader::continueAfterContentPolicy):
3051
3052         * loader/FrameLoadRequest.h:
3053         (WebCore::FrameLoadRequest::setShouldCheckNavigationPolicy):
3054         (WebCore::FrameLoadRequest::shouldCheckNavigationPolicy const):
3055
3056         * loader/FrameLoader.cpp:
3057         (WebCore::FrameLoader::load):
3058         (WebCore::FrameLoader::loadWithDocumentLoader):
3059         * loader/FrameLoader.h:
3060
3061         * loader/FrameLoaderTypes.h: Add a new Policy type "Suspend" to be used in the future
3062           by the process-swap-on-navigation mechanism.
3063
3064         * loader/PolicyChecker.cpp:
3065         (WebCore::PolicyChecker::checkNavigationPolicy):
3066         (WebCore::PolicyChecker::checkNewWindowPolicy):
3067
3068 2018-03-20  Chris Dumez  <cdumez@apple.com>
3069
3070         QuickLook.NavigationDelegate API test is failing on iOS with async policy delegates
3071         https://bugs.webkit.org/show_bug.cgi?id=183791
3072
3073         Reviewed by Alex Christensen.
3074
3075         Update PreviewLoader to not send data (or call finishFinishLoading) until
3076         the resource response has been processed.
3077
3078         * loader/ios/PreviewLoader.mm:
3079         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
3080         (-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
3081         (-[WebPreviewLoader connectionDidFinishLoading:]):
3082
3083 2018-03-20  Antoine Quint  <graouts@apple.com>
3084
3085         [Web Animations] Update the timing model when pending tasks schedule changes
3086         https://bugs.webkit.org/show_bug.cgi?id=183785
3087
3088         Reviewed by Dean Jackson.
3089
3090         Changing the time at which a pending play or pause task is scheduled changes the pending
3091         state of the animation and thus should notify that the timing model has changed and invalidate
3092         the effect.
3093
3094         * animation/WebAnimation.cpp:
3095         (WebCore::WebAnimation::setTimeToRunPendingPlayTask):
3096         (WebCore::WebAnimation::setTimeToRunPendingPauseTask):
3097         (WebCore::WebAnimation::updatePendingTasks):
3098
3099 2018-03-20  Tim Horton  <timothy_horton@apple.com>
3100
3101         Add and adopt WK_PLATFORM_NAME and adjust default feature defines
3102         https://bugs.webkit.org/show_bug.cgi?id=183758
3103         <rdar://problem/38017644>
3104
3105         Reviewed by Dan Bernstein.
3106
3107         * Configurations/Base.xcconfig:
3108         * Configurations/FeatureDefines.xcconfig:
3109         * WebCore.xcodeproj/project.pbxproj:
3110
3111 2018-03-19  Tim Horton  <timothy_horton@apple.com>
3112
3113         Apply some SDK checks in LocalDefaultSystemAppearance
3114         https://bugs.webkit.org/show_bug.cgi?id=183767
3115         <rdar://problem/38649611>
3116
3117         Reviewed by Zalan Bujtas.
3118
3119         * platform/mac/LocalDefaultSystemAppearance.h:
3120         * platform/mac/LocalDefaultSystemAppearance.mm:
3121         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
3122         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
3123
3124 2018-03-19  Chris Dumez  <cdumez@apple.com>
3125
3126         Have one service worker process per security origin
3127         https://bugs.webkit.org/show_bug.cgi?id=183600
3128         <rdar://problem/35280128>
3129
3130         Reviewed by Brady Eidson.
3131
3132         Split service workers from different origins into their own processes
3133         for security reasons.
3134
3135         * workers/service/server/SWServer.cpp:
3136         (WebCore::SWServer::addRegistrationFromStore):
3137         (WebCore::SWServer::clear):
3138         (WebCore::SWServer::tryInstallContextData):
3139         (WebCore::SWServer::serverToContextConnectionCreated):
3140         (WebCore::SWServer::installContextData):
3141         (WebCore::SWServer::runServiceWorkerIfNecessary):
3142         (WebCore::SWServer::markAllWorkersAsTerminated):
3143         * workers/service/server/SWServer.h:
3144         * workers/service/server/SWServerToContextConnection.cpp:
3145         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
3146         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
3147         (WebCore::SWServerToContextConnection::connectionForOrigin):
3148         * workers/service/server/SWServerToContextConnection.h:
3149         (WebCore::SWServerToContextConnection::origin):
3150         * workers/service/server/SWServerWorker.cpp:
3151         (WebCore::SWServerWorker::SWServerWorker):
3152         (WebCore::SWServerWorker::securityOrigin const):
3153         (WebCore::SWServerWorker::contextConnection):
3154         * workers/service/server/SWServerWorker.h:
3155
3156 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
3157
3158         Have select element respect current appearance
3159         https://bugs.webkit.org/show_bug.cgi?id=183753
3160
3161         Reviewed by Tim Horton.
3162
3163         Not currently testable, will add tests in a later patch.
3164
3165         Have the menu lists/select elements follow the system colors.
3166
3167         * rendering/RenderThemeMac.mm:
3168         (WebCore::RenderThemeMac::adjustMenuListStyle const):
3169
3170 2018-03-19  Nan Wang  <n_wang@apple.com>
3171
3172         AX: embedded attachments do not work correctly with text marker APIs on macOS
3173         https://bugs.webkit.org/show_bug.cgi?id=183751
3174
3175         Reviewed by Chris Fleizach.
3176
3177         In WebKit1, embedded attachments are not working well with text marker APIs.
3178         We should use the corresponding attachment view in the following cases:
3179         1. Hit testing on an attachment object.
3180         2. Getting the attachment object at a text marker position.
3181         3. Asking for the associated element with NSAccessibilityAttachmentTextAttribute. 
3182
3183         Not able to construct a layout test because it relies on embedded attachments.
3184
3185         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3186         (AXAttributeStringSetElement):
3187         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
3188         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3189
3190 2018-03-19  Jiewen Tan  <jiewen_tan@apple.com>
3191
3192         Unreviewed, another quick fix for r229699
3193
3194         Restricts ENABLE_WEB_AUTHN to only macOS and iOS.
3195
3196         * Configurations/FeatureDefines.xcconfig:
3197
3198 2018-03-19  Daniel Bates  <dabates@apple.com>
3199
3200         Fix case of Strong Password localized string
3201
3202         * English.lproj/Localizable.strings:
3203         * platform/LocalizedStrings.cpp:
3204         (WebCore::autoFillStrongPasswordLabel):
3205
3206 2018-03-19  Chris Dumez  <cdumez@apple.com>
3207
3208         WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
3209         https://bugs.webkit.org/show_bug.cgi?id=183702
3210         <rdar://problem/38566060>
3211
3212         Reviewed by Alex Christensen.
3213
3214         The issue is that the test calls loadHTMLString then loadRequest right after, without
3215         waiting for the first load to complete first. loadHTMLString is special as it relies
3216         on substitute data and which schedules a timer to commit the data. When doing the
3217         navigation policy check for the following loadRequest(), the substitute data timer
3218         would fire and commit its data and load. This would in turn cancel the pending
3219         navigation policy check for the loadRequest().
3220
3221         With sync policy delegates, this is not an issue because we take care of stopping
3222         all loaders when receiving the policy decision, which happens synchronously. However,
3223         when the policy decision happens asynchronously, the pending substitute data load
3224         does not get cancelled in time and it gets committed.
3225
3226         To address the issue, we now cancel any pending provisional load before doing the
3227         navigation policy check.
3228
3229         Test: fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash-async-delegate.html
3230
3231         * loader/FrameLoader.cpp:
3232         (WebCore::FrameLoader::clearProvisionalLoadForPolicyCheck):
3233         * loader/FrameLoader.h:
3234         * loader/PolicyChecker.cpp:
3235         (WebCore::PolicyChecker::checkNavigationPolicy):
3236         Cancel any pending provisional load before starting the navigation policy check. This call
3237         needs to be here rather than in the call site of policyChecker().checkNavigationPolicy()
3238         because there is code in PolicyChecker::checkNavigationPolicy() which relies on
3239         FrameLoader::activeDocumentLoader().
3240         Also, we only cancel the provisional load if there is a policy document loader. In some
3241         rare cases (when we receive a redirect after navigation policy has been decided for the
3242         initial request), the provisional document loader needs to receive navigation policy
3243         decisions so we cannot clear the provisional document loader in such case.
3244
3245 2018-03-19  Eric Carlson  <eric.carlson@apple.com>
3246
3247         [Extra zoom mode] Require fullscreen for video playback
3248         https://bugs.webkit.org/show_bug.cgi?id=183742
3249         <rdar://problem/38235862>
3250
3251         Reviewed by Jer Noble.
3252
3253         * Modules/modern-media-controls/media/playback-support.js:
3254         (PlaybackSupport.prototype.syncControl): Always show the play button.
3255         * html/HTMLMediaElement.cpp:
3256         (WebCore::HTMLMediaElement::updatePlayState): Return immediately if playback requires fullscreen
3257         (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Call updatePlayState in case 
3258         playback is pending.
3259         * html/HTMLMediaElement.h:
3260         * platform/cocoa/VideoFullscreenModel.h:
3261         (WebCore::VideoFullscreenModel::presentingViewController): New.
3262         (WebCore::VideoFullscreenModel::createVideoFullscreenViewController): New.
3263         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3264         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
3265         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
3266         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
3267         (WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):
3268
3269         * platform/ios/VideoFullscreenInterfaceAVKit.h:
3270         * platform/ios/VideoFullscreenInterfaceAVKit.mm: Wrap AVPlayerLayerView so we can change its
3271         behavior.
3272         (WebAVPlayerLayerView_playerLayer):
3273         (WebAVPlayerLayerView_videoView):
3274         (allocWebAVPlayerLayerViewInstance):
3275         (-[WebAVPlayerViewController initWithFullscreenInterface:]):
3276         (-[WebAVPlayerViewController playerViewControllerShouldHandleDoneButtonTap:]):
3277         (-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
3278         (-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
3279         (-[WebAVPlayerViewController NO_RETURN_DUE_TO_ASSERT]):
3280         (-[WebAVPlayerViewController isPictureInPicturePossible]):
3281         (-[WebAVPlayerViewController isPictureInPictureActive]):
3282         (-[WebAVPlayerViewController isPictureInPictureSuspended]):
3283         (-[WebAVPlayerViewController pictureInPictureActive]):
3284         (-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
3285         (-[WebAVPlayerViewController view]):
3286         (-[WebAVPlayerViewController showsPlaybackControls]):
3287         (-[WebAVPlayerViewController setShowsPlaybackControls:]):
3288         (-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
3289         (-[WebAVPlayerViewController setDelegate:]):
3290         (-[WebAVPlayerViewController setPlayerController:]):
3291         (-[WebAVPlayerViewController avPlayerViewController]):
3292         (-[WebAVPlayerViewController removeFromParentViewController]):
3293         (VideoFullscreenInterfaceAVKit::setupFullscreen):
3294         (fallbackViewController):
3295         (VideoFullscreenInterfaceAVKit::presentingViewController):
3296         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
3297         (VideoFullscreenInterfaceAVKit::doSetup):
3298         (WebCore::supportsPictureInPicture):
3299
3300 2018-03-19  Per Arne Vollan  <pvollan@apple.com>
3301
3302         When the WebContent process is blocked from accessing the WindowServer, the call CVDisplayLinkCreateWithCGDisplay will fail.
3303         https://bugs.webkit.org/show_bug.cgi?id=183604
3304         <rdar://problem/38305109>
3305
3306         Reviewed by Brent Fulgham.
3307
3308         The call to CVDisplayLinkCreateWithCGDisplay can instead be made in the UIProcess. Notify the WebContent process
3309         about display updates by sending a message from the UIProcess on each screen update. This patch adds an extra
3310         IPC step when notifying the WebContent process about display updates. However, the MotionMark benchmark shows no
3311         performance regression when running it with this patch. A possible explanation for this is that the high priority
3312         display link thread is now running in the UIProcess instead of the WebContent process, which means there will be
3313         more available CPU resources for the WebContent process. A run loop observer is added to make sure that only one
3314         display callback (for each display observer) is executed in a single iteration of the run loop. This will make
3315         sure we are not filling the IPC message queue with unhandled display link messages.
3316
3317         No new tests, covered by existing tests. 
3318
3319         * platform/graphics/DisplayRefreshMonitor.h:
3320         (WebCore::DisplayRefreshMonitor::displayLinkFired):
3321         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3322         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
3323         * platform/graphics/DisplayRefreshMonitorManager.h:
3324         * platform/graphics/mac/DisplayRefreshMonitorMac.h:
3325
3326 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
3327
3328         Ensure local appearance actually mirrors the app's appearance
3329         https://bugs.webkit.org/show_bug.cgi?id=183743
3330
3331         Reviewed by Tim Horton.
3332
3333         Not currently testable, will add tests in a later patch.
3334
3335         Current appearance isn't always accurate by default and needs to be set manually.
3336
3337         * platform/mac/LocalDefaultSystemAppearance.mm:
3338         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
3339
3340 2018-03-19  Zan Dobersek  <zdobersek@igalia.com>
3341
3342         Unreviewed GCC 4.9 build-fix after r229672.
3343
3344         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
3345         (Nicosia::createCommand): Don't depend on implicit conversion of the
3346         returning std::unique_ptr<> object, and instead only wrap the
3347         heap-allocated PaintingOperation-derived in a std::unique_ptr<> at the
3348         point of return.
3349
3350 2018-03-18  Commit Queue  <commit-queue@webkit.org>
3351
3352         Unreviewed, rolling out r229689.
3353         https://bugs.webkit.org/show_bug.cgi?id=183735
3354
3355         Causes fast/loader/inner-iframe-loads-data-url-into-parent-on-
3356         unload-crash.html to fail with async delegates (Requested by
3357         cdumez_ on #webkit).
3358
3359         Reverted changeset:
3360
3361         "WebKit.WebsitePoliciesAutoplayQuirks API test times out with
3362         async policy delegates"
3363         https://bugs.webkit.org/show_bug.cgi?id=183702
3364         https://trac.webkit.org/changeset/229689
3365
3366 2018-03-17  Tim Horton  <timothy_horton@apple.com>
3367
3368         Correct redefined fnfErr type
3369         https://bugs.webkit.org/show_bug.cgi?id=183728
3370         <rdar://problem/38590063>
3371
3372         Reviewed by Dan Bernstein.
3373
3374         * platform/network/cf/FormDataStreamCFNet.cpp:
3375         CFStreamError's error parameter takes a SInt32, not an int.
3376         Make sure our redefinition has a compatible type.
3377
3378 2018-03-17  Jiewen Tan  <jiewen_tan@apple.com>
3379
3380         [WebAuthN] Implement authenticatorMakeCredential
3381         https://bugs.webkit.org/show_bug.cgi?id=183527
3382         <rdar://problem/35275886>
3383
3384         Reviewed by Brent Fulgham.
3385
3386         This patch does the following few things:
3387         1) It implements the authenticatorMakeCredential logic from the spec: https://www.w3.org/TR/webauthn/#op-make-cred.
3388         2) It tweaks enocding and deocding of PublicKeyCredentialCreationOptions between UIProccess and WebProcess.
3389         3) It soft links LocalAuthentication.Framework to WebCore, which was linked to WebKit.
3390         4) It creates SPI header for DeviceIdentity.Framework, and provides stubs to link it to WebCore.
3391
3392         Here is a detailed explanantion of 1):
3393         1. A helper class called LocalAuthenticator is crafted to represent Apple platform attached authenticator, i.e.
3394         the devices themselves. All operations are currently restricted to iOS at this moment as macOS lacks attestation
3395         support.
3396         2. To do testing, this helper class is then moved from WebKit to WebCore even though all operations can only happens
3397         in the UIProcess. We currently lack the ability to pretend a https environment in TestWebKitAPI which is required by
3398         the WebAuthN API, and thus it is moved to WebCore to perform unit tesing flavor API tests. This is not enough as it
3399         can't test message exchange between the UI and Web processes. We will address this in a subsequent patch.
3400         3. More on testing: The attestation process is abstracted into a protected method such that the testing enviroment can
3401         override it with self attestation as network access is restricted in the WebKit testing enviroment. Also, swizzlers of
3402         LocalAuthentication API are provided to override the behavoir of LAContext.
3403         4. More on testing: The actual Apple attestation can only happen in real device and with network access, therefore
3404         it can only be covered by manual tests at this moment.
3405         5. Back to LocalAuthenticator, it currently has two public methods:
3406                 5.1. makeCredential(): This method is the one does all the magic.
3407                 + It first checks some parameters.
3408                 + It then invokes LAContext to get user consent.
3409                 + It then talks to Apple Attestation Privacy CA to do attestations.
3410                 + It then stores necessary information into the Keychain.
3411                 + Finally it generates the attestation object.
3412                 5.2 isAvailable():
3413                 To check if a LocalAuthenticator is available or not.
3414         6. Even though files are of .mm format, they are written in a way that mixes NS, CF and C++ types. Here is the rule:
3415                 6.1 Use CF type only if it is requested by APIs.
3416                 6.2 Use NS type to manipulate all Objc objects.
3417                 6.3 Use C++ otherwise.
3418
3419         Covered by API tests.
3420
3421         * Configurations/WebCore.xcconfig:
3422         * Modules/credentialmanagement/CredentialsMessenger.cpp:
3423         (WebCore::getIdFromAttestationObject): Deleted.
3424         Decoding attestation object is tedious. UIProcess will instead return credential ID and attestation object
3425         at the same time. Therefore, this method is removed.
3426         * Modules/credentialmanagement/CredentialsMessenger.h:
3427         (WebCore::CreationReturnBundle::CreationReturnBundle): Deleted.
3428         (WebCore::AssertionReturnBundle::AssertionReturnBundle): Deleted.
3429         * Modules/webauthn/COSEConstants.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
3430         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
3431         (WebCore::PublicKeyCredentialCreationOptions::isolatedPartialCopyPtr const):
3432         (WebCore::PublicKeyCredentialCreationOptions::Parameters::encode const):
3433         (WebCore::PublicKeyCredentialCreationOptions::Parameters::decode):
3434         (WebCore::PublicKeyCredentialCreationOptions::encode const):
3435         (WebCore::PublicKeyCredentialCreationOptions::decode):
3436         * Modules/webauthn/PublicKeyCredentialDescriptor.h:
3437         (WebCore::PublicKeyCredentialDescriptor::encode const):
3438         (WebCore::PublicKeyCredentialDescriptor::decode):
3439         * Modules/webauthn/PublicKeyCredentialType.h:
3440         * Modules/webauthn/cocoa/LocalAuthenticator.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h.
3441         * Modules/webauthn/cocoa/LocalAuthenticator.mm: Added.
3442         (WebCore::LocalAuthenticatorInternal::freePtrs):
3443         (WebCore::LocalAuthenticator::makeCredential const):
3444         (WebCore::LocalAuthenticator::isAvailable const):
3445         (WebCore::LocalAuthenticator::issueClientCertificate const):
3446         * SourcesCocoa.txt:
3447         * WebCore.xcodeproj/project.pbxproj:
3448         * platform/cocoa/LocalAuthenticationSoftLink.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
3449         * platform/cocoa/LocalAuthenticationSoftLink.mm: Added.
3450         * testing/MockCredentialsMessenger.cpp:
3451         (WebCore::MockCredentialsMessenger::setCreationReturnBundle):
3452         (WebCore::MockCredentialsMessenger::makeCredential):
3453         (WebCore::MockCredentialsMessenger::makeCredentialReply):
3454         (WebCore::MockCredentialsMessenger::setAttestationObject): Deleted.
3455         * testing/MockCredentialsMessenger.h:
3456         * testing/MockCredentialsMessenger.idl:
3457
3458 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
3459
3460         Correct debug assertion in Range::borderAndTextRects
3461         https://bugs.webkit.org/show_bug.cgi?id=183710
3462         <rdar://problem/38466976>
3463
3464         Reviewed by Ryosuke Niwa.
3465
3466         A debug assertion will fire if Range::borderAndTextRects is asked to evaluate a set of selected elements, where one of the elements does not have a parent.
3467
3468         We should consider a nullptr parent as satisfying the condition of a parent not being present in the selection set.
3469
3470         Tests: fast/dom/range/range-selection-empty-body.html
3471
3472         * dom/Range.cpp:
3473         (WebCore::Range::borderAndTextRects const):
3474
3475 2018-03-15  Filip Pizlo  <fpizlo@apple.com>
3476
3477         Put the DOM in IsoHeaps
3478         https://bugs.webkit.org/show_bug.cgi?id=183546
3479
3480         Reviewed by Daniel Bates.
3481
3482         No new tests because no change in behavior.
3483         
3484         This puts all descendants of WebCore::Node in isoheaps, so that UAFs on the DOM cannot be
3485         used for RCE attacks. This probably also makes it harder to use UAFs for UXSS, since it means
3486         that DOM UAFs cannot be used for universal read gadgets.
3487         
3488         This looks neutral on Speedometer and membuster, though I did have one round of testing
3489         that led me to believe that membuster was regressed - I just wasn't able to reproduce that
3490         result on subsequent testing.
3491
3492         * Sources.txt:
3493         * WebCore.xcodeproj/project.pbxproj:
3494         * dom/Attr.cpp:
3495         * dom/Attr.h:
3496         * dom/CDATASection.cpp:
3497         * dom/CDATASection.h:
3498         * dom/CharacterData.cpp:
3499         * dom/CharacterData.h:
3500         * dom/Comment.cpp:
3501         * dom/Comment.h:
3502         * dom/ContainerNode.cpp:
3503         * dom/ContainerNode.h:
3504         * dom/Document.cpp:
3505         * dom/Document.h:
3506         * dom/DocumentFragment.cpp:
3507         * dom/DocumentFragment.h:
3508         * dom/DocumentType.cpp:
3509         * dom/DocumentType.h:
3510         * dom/Node.cpp:
3511         * dom/Node.h:
3512         * dom/ProcessingInstruction.cpp:
3513         * dom/ProcessingInstruction.h:
3514         * dom/PseudoElement.cpp:
3515         * dom/PseudoElement.h:
3516         * dom/ShadowRoot.cpp:
3517         * dom/ShadowRoot.h:
3518         * dom/StyledElement.cpp:
3519         * dom/StyledElement.h:
3520         * dom/TemplateContentDocumentFragment.cpp: Added.
3521         * dom/TemplateContentDocumentFragment.h:
3522         * dom/Text.cpp:
3523         * dom/Text.h:
3524         * dom/XMLDocument.cpp: Added.
3525         * dom/XMLDocument.h:
3526         * html/FTPDirectoryDocument.cpp:
3527         * html/FTPDirectoryDocument.h:
3528         * html/FileInputType.cpp:
3529         * html/HTMLAnchorElement.cpp:
3530         * html/HTMLAnchorElement.h:
3531         * html/HTMLAppletElement.cpp:
3532         * html/HTMLAppletElement.h:
3533         * html/HTMLAreaElement.cpp:
3534         * html/HTMLAreaElement.h:
3535         * html/HTMLAttachmentElement.cpp:
3536         * html/HTMLAttachmentElement.h:
3537         * html/HTMLBDIElement.cpp: Added.
3538         * html/HTMLBDIElement.h:
3539         * html/HTMLBRElement.cpp:
3540         * html/HTMLBRElement.h:
3541         * html/HTMLBaseElement.cpp:
3542         * html/HTMLBaseElement.h:
3543         * html/HTMLBodyElement.cpp:
3544         * html/HTMLBodyElement.h:
3545         * html/HTMLButtonElement.cpp:
3546         * html/HTMLButtonElement.h:
3547         * html/HTMLCanvasElement.cpp:
3548         * html/HTMLCanvasElement.h:
3549         * html/HTMLDListElement.cpp:
3550         * html/HTMLDListElement.h:
3551         * html/HTMLDataElement.cpp:
3552         * html/HTMLDataElement.h:
3553         * html/HTMLDataListElement.cpp:
3554         * html/HTMLDataListElement.h:
3555         * html/HTMLDetailsElement.cpp:
3556         * html/HTMLDetailsElement.h:
3557         * html/HTMLDirectoryElement.cpp:
3558         * html/HTMLDirectoryElement.h:
3559         * html/HTMLDivElement.cpp:
3560         * html/HTMLDivElement.h:
3561         * html/HTMLDocument.cpp:
3562         * html/HTMLDocument.h:
3563         * html/HTMLElement.cpp:
3564         * html/HTMLElement.h:
3565         * html/HTMLEmbedElement.cpp:
3566         * html/HTMLEmbedElement.h:
3567         * html/HTMLFieldSetElement.cpp:
3568         * html/HTMLFieldSetElement.h:
3569         * html/HTMLFontElement.cpp:
3570         * html/HTMLFontElement.h:
3571         * html/HTMLFormControlElement.cpp:
3572         * html/HTMLFormControlElement.h:
3573         * html/HTMLFormControlElementWithState.cpp:
3574         * html/HTMLFormControlElementWithState.h:
3575         * html/HTMLFormElement.cpp:
3576         * html/HTMLFormElement.h:
3577         * html/HTMLFrameElement.cpp:
3578         * html/HTMLFrameElement.h:
3579         * html/HTMLFrameElementBase.cpp:
3580         * html/HTMLFrameElementBase.h:
3581         * html/HTMLFrameOwnerElement.cpp:
3582         * html/HTMLFrameOwnerElement.h:
3583         * html/HTMLFrameSetElement.cpp:
3584         * html/HTMLFrameSetElement.h:
3585         * html/HTMLHRElement.cpp:
3586         * html/HTMLHRElement.h:
3587         * html/HTMLHeadElement.cpp:
3588         * html/HTMLHeadElement.h:
3589         * html/HTMLHeadingElement.cpp:
3590         * html/HTMLHeadingElement.h:
3591         * html/HTMLHtmlElement.cpp:
3592         * html/HTMLHtmlElement.h:
3593         * html/HTMLIFrameElement.cpp:
3594         * html/HTMLIFrameElement.h:
3595         * html/HTMLImageElement.cpp:
3596         * html/HTMLImageElement.h:
3597         * html/HTMLInputElement.cpp:
3598         * html/HTMLInputElement.h:
3599         * html/HTMLKeygenElement.cpp:
3600         * html/HTMLKeygenElement.h:
3601         * html/HTMLLIElement.cpp:
3602         * html/HTMLLIElement.h:
3603         * html/HTMLLabelElement.cpp:
3604         * html/HTMLLabelElement.h:
3605         * html/HTMLLegendElement.cpp:
3606         * html/HTMLLegendElement.h:
3607         * html/HTMLLinkElement.cpp:
3608         * html/HTMLLinkElement.h:
3609         * html/HTMLMapElement.cpp:
3610         * html/HTMLMapElement.h:
3611         * html/HTMLMarqueeElement.cpp:
3612         * html/HTMLMarqueeElement.h:
3613         * html/HTMLMenuElement.cpp:
3614         * html/HTMLMenuElement.h:
3615         * html/HTMLMenuItemElement.cpp:
3616         * html/HTMLMenuItemElement.h:
3617         * html/HTMLMetaElement.cpp:
3618         * html/HTMLMetaElement.h:
3619         * html/HTMLMeterElement.cpp:
3620         * html/HTMLMeterElement.h:
3621         * html/HTMLModElement.cpp:
3622         * html/HTMLModElement.h:
3623         * html/HTMLOListElement.cpp:
3624         * html/HTMLOListElement.h:
3625         * html/HTMLObjectElement.cpp:
3626         * html/HTMLObjectElement.h:
3627         * html/HTMLOptGroupElement.cpp:
3628         * html/HTMLOptGroupElement.h:
3629         * html/HTMLOptionElement.cpp:
3630         * html/HTMLOptionElement.h:
3631         * html/HTMLOutputElement.cpp:
3632         * html/HTMLOutputElement.h:
3633         * html/HTMLParagraphElement.cpp:
3634         * html/HTMLParagraphElement.h:
3635         * html/HTMLParamElement.cpp:
3636         * html/HTMLParamElement.h:
3637         * html/HTMLPictureElement.cpp:
3638         * html/HTMLPictureElement.h:
3639         * html/HTMLPlugInElement.cpp:
3640         * html/HTMLPlugInElement.h:
3641         * html/HTMLPlugInImageElement.cpp:
3642         * html/HTMLPlugInImageElement.h:
3643         * html/HTMLPreElement.cpp:
3644         * html/HTMLPreElement.h:
3645         * html/HTMLProgressElement.cpp:
3646         * html/HTMLProgressElement.h:
3647         * html/HTMLQuoteElement.cpp:
3648         * html/HTMLQuoteElement.h:
3649         * html/HTMLScriptElement.cpp:
3650         * html/HTMLScriptElement.h:
3651         * html/HTMLSelectElement.cpp:
3652         * html/HTMLSelectElement.h:
3653         * html/HTMLSlotElement.cpp:
3654         * html/HTMLSlotElement.h:
3655         * html/HTMLSourceElement.cpp:
3656         * html/HTMLSourceElement.h:
3657         * html/HTMLSpanElement.cpp:
3658         * html/HTMLSpanElement.h:
3659         * html/HTMLStyleElement.cpp:
3660         * html/HTMLStyleElement.h:
3661         * html/HTMLSummaryElement.cpp:
3662         * html/HTMLSummaryElement.h:
3663         * html/HTMLTableCaptionElement.cpp:
3664         * html/HTMLTableCaptionElement.h:
3665         * html/HTMLTableCellElement.cpp:
3666         * html/HTMLTableCellElement.h:
3667         * html/HTMLTableColElement.cpp:
3668         * html/HTMLTableColElement.h:
3669         * html/HTMLTableElement.cpp:
3670         * html/HTMLTableElement.h:
3671         * html/HTMLTablePartElement.cpp:
3672         * html/HTMLTablePartElement.h:
3673         * html/HTMLTableRowElement.cpp:
3674         * html/HTMLTableRowElement.h:
3675         * html/HTMLTableSectionElement.cpp:
3676         * html/HTMLTableSectionElement.h:
3677         * html/HTMLTemplateElement.cpp:
3678         * html/HTMLTemplateElement.h:
3679         * html/HTMLTextAreaElement.cpp:
3680         * html/HTMLTextAreaElement.h:
3681         * html/HTMLTextFormControlElement.cpp:
3682         * html/HTMLTextFormControlElement.h:
3683         * html/HTMLTimeElement.cpp:
3684         * html/HTMLTimeElement.h:
3685         * html/HTMLTitleElement.cpp:
3686         * html/HTMLTitleElement.h:
3687         * html/HTMLTrackElement.cpp:
3688         * html/HTMLTrackElement.h:
3689         * html/HTMLUListElement.cpp:
3690         * html/HTMLUListElement.h:
3691         * html/HTMLUnknownElement.cpp: Added.
3692         * html/HTMLUnknownElement.h:
3693         * html/HTMLWBRElement.cpp:
3694         * html/HTMLWBRElement.h:
3695         * html/ImageDocument.cpp:
3696         * html/ImageDocument.h:
3697         * html/LabelableElement.cpp:
3698         * html/LabelableElement.h:
3699         * html/MediaController.cpp:
3700         (MediaController::create): Deleted.
3701         (MediaController::MediaController): Deleted.
3702         (MediaController::addMediaElement): Deleted.
3703         (MediaController::removeMediaElement): Deleted.
3704         (MediaController::containsMediaElement const): Deleted.
3705         (MediaController::buffered const): Deleted.
3706         (MediaController::seekable const): Deleted.
3707         (MediaController::played): Deleted.
3708         (MediaController::duration const): Deleted.
3709         (MediaController::currentTime const): Deleted.
3710         (MediaController::setCurrentTime): Deleted.
3711         (MediaController::unpause): Deleted.
3712         (MediaController::play): Deleted.
3713         (MediaController::pause): Deleted.
3714         (MediaController::setDefaultPlaybackRate): Deleted.
3715         (MediaController::playbackRate const): Deleted.
3716         (MediaController::setPlaybackRate): Deleted.
3717         (MediaController::setVolume): Deleted.
3718         (MediaController::setMuted): Deleted.
3719         (playbackStateWaiting): Deleted.
3720         (playbackStatePlaying): Deleted.
3721         (playbackStateEnded): Deleted.
3722         (MediaController::playbackState const): Deleted.
3723         (MediaController::reportControllerState): Deleted.
3724         (eventNameForReadyState): Deleted.
3725         (MediaController::updateReadyState): Deleted.
3726         (MediaController::updatePlaybackState): Deleted.
3727         (MediaController::updateMediaElements): Deleted.
3728         (MediaController::bringElementUpToSpeed): Deleted.
3729         (MediaController::isBlocked const): Deleted.
3730         (MediaController::hasEnded const): Deleted.
3731         (MediaController::scheduleEvent): Deleted.
3732         (MediaController::asyncEventTimerFired): Deleted.
3733         (MediaController::clearPositionTimerFired): Deleted.
3734         (MediaController::hasAudio const): Deleted.
3735         (MediaController::hasVideo const): Deleted.
3736         (MediaController::hasClosedCaptions const): Deleted.
3737         (MediaController::setClosedCaptionsVisible): Deleted.
3738         (MediaController::supportsScanning const): Deleted.
3739         (MediaController::beginScrubbing): Deleted.
3740         (MediaController::endScrubbing): Deleted.
3741         (MediaController::beginScanning): Deleted.
3742         (MediaController::endScanning): Deleted.
3743         (MediaController::canPlay const): Deleted.
3744         (MediaController::isLiveStream const): Deleted.
3745         (MediaController::hasCurrentSrc const): Deleted.
3746         (MediaController::returnToRealtime): Deleted.
3747         (MediaController::startTimeupdateTimer): Deleted.
3748         (MediaController::scheduleTimeupdateEvent): Deleted.
3749         * html/MediaDocument.cpp:
3750         * html/MediaDocument.h:
3751         * html/PluginDocument.cpp:
3752         * html/PluginDocument.h:
3753         * html/RubyElement.cpp:
3754         * html/RubyElement.h:
3755         * html/RubyTextElement.cpp:
3756         * html/RubyTextElement.h:
3757         * html/TextDocument.cpp:
3758         * html/TextDocument.h:
3759         * html/shadow/AutoFillButtonElement.cpp:
3760         * html/shadow/AutoFillButtonElement.h:
3761         * html/shadow/DetailsMarkerControl.cpp:
3762         * html/shadow/DetailsMarkerControl.h:
3763         * html/shadow/ImageControlsRootElement.cpp:
3764         * html/shadow/ImageControlsRootElement.h:
3765         * html/shadow/MediaControlElementTypes.cpp:
3766         * html/shadow/MediaControlElementTypes.h:
3767         * html/shadow/MediaControlElements.cpp:
3768         * html/shadow/MediaControlElements.h:
3769         * html/shadow/MediaControls.cpp:
3770         * html/shadow/MediaControls.h:
3771         * html/shadow/ProgressShadowElement.cpp:
3772         * html/shadow/ProgressShadowElement.h:
3773         * html/shadow/SliderThumbElement.cpp:
3774         * html/shadow/SliderThumbElement.h:
3775         * html/shadow/SpinButtonElement.cpp:
3776         * html/shadow/SpinButtonElement.h:
3777         * html/shadow/TextControlInnerElements.cpp:
3778         * html/shadow/TextControlInnerElements.h:
3779         * html/shadow/YouTubeEmbedShadowElement.cpp:
3780         * html/shadow/YouTubeEmbedShadowElement.h:
3781         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
3782         * html/shadow/mac/ImageControlsButtonElementMac.h:
3783         * html/shadow/mac/ImageControlsRootElementMac.cpp:
3784         * html/shadow/mac/ImageControlsRootElementMac.h:
3785         * html/track/TextTrackCueGeneric.cpp:
3786         * html/track/VTTCue.cpp:
3787         * html/track/VTTCue.h:
3788         * html/track/WebVTTElement.cpp:
3789         * html/track/WebVTTElement.h:
3790         * loader/SinkDocument.cpp:
3791         * loader/SinkDocument.h:
3792         * mathml/MathMLAnnotationElement.cpp:
3793         * mathml/MathMLAnnotationElement.h:
3794         * mathml/MathMLElement.cpp:
3795         * mathml/MathMLElement.h:
3796         * mathml/MathMLFractionElement.cpp:
3797         * mathml/MathMLFractionElement.h:
3798         * mathml/MathMLMathElement.cpp:
3799         * mathml/MathMLMathElement.h:
3800         * mathml/MathMLMencloseElement.cpp:
3801         * mathml/MathMLMencloseElement.h:
3802         * mathml/MathMLOperatorElement.cpp:
3803         * mathml/MathMLOperatorElement.h:
3804         * mathml/MathMLPaddedElement.cpp:
3805         * mathml/MathMLPaddedElement.h:
3806         * mathml/MathMLPresentationElement.cpp:
3807         * mathml/MathMLPresentationElement.h:
3808         * mathml/MathMLRootElement.cpp:
3809         * mathml/MathMLRootElement.h:
3810         * mathml/MathMLRowElement.cpp:
3811         * mathml/MathMLRowElement.h:
3812         * mathml/MathMLScriptsElement.cpp:
3813         * mathml/MathMLScriptsElement.h:
3814         * mathml/MathMLSelectElement.cpp:
3815         * mathml/MathMLSelectElement.h:
3816         * mathml/MathMLSpaceElement.cpp:
3817         * mathml/MathMLSpaceElement.h:
3818         * mathml/MathMLTokenElement.cpp:
3819         * mathml/MathMLTokenElement.h:
3820         * mathml/MathMLUnderOverElement.cpp:
3821         * mathml/MathMLUnderOverElement.h:
3822         * mathml/MathMLUnknownElement.cpp: Added.
3823         * mathml/MathMLUnknownElement.h:
3824         * svg/SVGAElement.cpp:
3825         * svg/SVGAElement.h:
3826         * svg/SVGAltGlyphDefElement.cpp:
3827         * svg/SVGAltGlyphDefElement.h:
3828         * svg/SVGAltGlyphElement.cpp:
3829         * svg/SVGAltGlyphElement.h:
3830         * svg/SVGAltGlyphItemElement.cpp:
3831         * svg/SVGAltGlyphItemElement.h:
3832         * svg/SVGAnimateColorElement.cpp:
3833         * svg/SVGAnimateColorElement.h:
3834         * svg/SVGAnimateElement.cpp:
3835         * svg/SVGAnimateElement.h:
3836         * svg/SVGAnimateElementBase.cpp:
3837         * svg/SVGAnimateElementBase.h:
3838         * svg/SVGAnimateMotionElement.cpp:
3839         * svg/SVGAnimateMotionElement.h:
3840         * svg/SVGAnimateTransformElement.cpp:
3841         * svg/SVGAnimateTransformElement.h:
3842         * svg/SVGAnimationElement.cpp:
3843         * svg/SVGAnimationElement.h:
3844         * svg/SVGCircleElement.cpp:
3845         * svg/SVGCircleElement.h:
3846         * svg/SVGClipPathElement.cpp:
3847         * svg/SVGClipPathElement.h:
3848         * svg/SVGComponentTransferFunctionElement.cpp:
3849         * svg/SVGComponentTransferFunctionElement.h:
3850         * svg/SVGCursorElement.cpp:
3851         * svg/SVGCursorElement.h:
3852         * svg/SVGDefsElement.cpp:
3853         * svg/SVGDefsElement.h:
3854         * svg/SVGDescElement.cpp:
3855         * svg/SVGDescElement.h:
3856         * svg/SVGDocument.cpp:
3857         * svg/SVGDocument.h:
3858         * svg/SVGElement.cpp:
3859         * svg/SVGElement.h:
3860         * svg/SVGEllipseElement.cpp:
3861         * svg/SVGEllipseElement.h:
3862         * svg/SVGFEBlendElement.cpp:
3863         * svg/SVGFEBlendElement.h:
3864         * svg/SVGFEColorMatrixElement.cpp:
3865         * svg/SVGFEColorMatrixElement.h:
3866         * svg/SVGFEComponentTransferElement.cpp:
3867         * svg/SVGFEComponentTransferElement.h:
3868         * svg/SVGFECompositeElement.cpp:
3869         * svg/SVGFECompositeElement.h:
3870         * svg/SVGFEConvolveMatrixElement.cpp:
3871         * svg/SVGFEConvolveMatrixElement.h:
3872         * svg/SVGFEDiffuseLightingElement.cpp:
3873         * svg/SVGFEDiffuseLightingElement.h:
3874         * svg/SVGFEDisplacementMapElement.cpp:
3875         * svg/SVGFEDisplacementMapElement.h:
3876         * svg/SVGFEDropShadowElement.cpp:
3877         * svg/SVGFEDropShadowElement.h:
3878         * svg/SVGFEFloodElement.cpp:
3879         * svg/SVGFEFloodElement.h:
3880         * svg/SVGFEGaussianBlurElement.cpp:
3881         * svg/SVGFEGaussianBlurElement.h:
3882         * svg/SVGFEImageElement.cpp:
3883         * svg/SVGFEImageElement.h:
3884         * svg/SVGFELightElement.cpp:
3885         * svg/SVGFELightElement.h:
3886         * svg/SVGFEMergeElement.cpp:
3887         * svg/SVGFEMergeElement.h:
3888         * svg/SVGFEMergeNodeElement.cpp:
3889         * svg/SVGFEMergeNodeElement.h:
3890         * svg/SVGFEMorphologyElement.cpp:
3891         * svg/SVGFEMorphologyElement.h:
3892         * svg/SVGFEOffsetElement.cpp:
3893         * svg/SVGFEOffsetElement.h:
3894         * svg/SVGFESpecularLightingElement.cpp:
3895         * svg/SVGFESpecularLightingElement.h:
3896         * svg/SVGFETileElement.cpp:
3897         * svg/SVGFETileElement.h:
3898         * svg/SVGFETurbulenceElement.cpp:
3899         * svg/SVGFETurbulenceElement.h:
3900         * svg/SVGFilterElement.cpp:
3901         * svg/SVGFilterElement.h:
3902         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
3903         * svg/SVGFilterPrimitiveStandardAttributes.h:
3904         * svg/SVGFontFaceElement.cpp:
3905         * svg/SVGFontFaceElement.h:
3906         * svg/SVGFontFaceFormatElement.cpp:
3907         * svg/SVGFontFaceFormatElement.h:
3908         * svg/SVGFontFaceNameElement.cpp:
3909         * svg/SVGFontFaceNameElement.h:
3910         * svg/SVGFontFaceSrcElement.cpp:
3911         * svg/SVGFontFaceSrcElement.h:
3912         * svg/SVGFontFaceUriElement.cpp:
3913         * svg/SVGFontFaceUriElement.h:
3914         * svg/SVGForeignObjectElement.cpp:
3915         * svg/SVGForeignObjectElement.h:
3916         * svg/SVGGElement.cpp:
3917         * svg/SVGGElement.h:
3918         * svg/SVGGlyphElement.cpp:
3919         * svg/SVGGlyphElement.h:
3920         * svg/SVGGlyphRefElement.cpp:
3921         * svg/SVGGlyphRefElement.h:
3922         * svg/SVGGradientElement.cpp:
3923         * svg/SVGGradientElement.h:
3924         * svg/SVGGraphicsElement.cpp:
3925         * svg/SVGGraphicsElement.h:
3926         * svg/SVGHKernElement.cpp:
3927         * svg/SVGHKernElement.h:
3928         * svg/SVGImageElement.cpp:
3929         * svg/SVGImageElement.h:
3930         * svg/SVGLineElement.cpp:
3931         * svg/SVGLineElement.h:
3932         * svg/SVGLinearGradientElement.cpp:
3933         * svg/SVGLinearGradientElement.h:
3934         * svg/SVGMPathElement.cpp:
3935         * svg/SVGMPathElement.h:
3936         * svg/SVGMarkerElement.cpp:
3937         * svg/SVGMarkerElement.h:
3938         * svg/SVGMaskElement.cpp:
3939         * svg/SVGMaskElement.h:
3940         * svg/SVGMetadataElement.cpp:
3941         * svg/SVGMetadataElement.h:
3942         * svg/SVGMissingGlyphElement.cpp:
3943         * svg/SVGMissingGlyphElement.h:
3944         * svg/SVGPathElement.cpp:
3945         * svg/SVGPathElement.h:
3946         * svg/SVGPatternElement.cpp:
3947         * svg/SVGPatternElement.h:
3948         * svg/SVGPolyElement.cpp:
3949    &nb