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