Cleanup CookieRequestHeaderFieldProxy
[WebKit.git] / Source / WebCore / ChangeLog
1 2018-04-21  Daniel Bates  <dabates@apple.com>
2
3         Cleanup CookieRequestHeaderFieldProxy
4         https://bugs.webkit.org/show_bug.cgi?id=184868
5
6         Remove extraneous whitespace that I inadvertently added.
7
8         * platform/network/CookieRequestHeaderFieldProxy.h:
9         (WebCore::CookieRequestHeaderFieldProxy::decode):
10
11 2018-04-21  Daniel Bates  <dabates@apple.com>
12
13         Cleanup CookieRequestHeaderFieldProxy
14         https://bugs.webkit.org/show_bug.cgi?id=184868
15
16         Reviewed by Youenn Fablet.
17
18         Simplify the struct CookieRequestHeaderFieldProxy and make it consistent with other structs.
19         Among other changes, remove constructors for CookieRequestHeaderFieldProxy as they are
20         unnecessary as all supported compilers support non-static data member initializers (NSDMI)
21         for aggregates, remove prefix "m_" from the name of fields as this is struct exists for
22         convenience and offers no encapsulation and simplify decoding logic of this struct.
23
24         No functionality changed. So, no new tests.
25
26         * loader/CookieJar.cpp:
27         (WebCore::cookieRequestHeaderFieldProxy):
28         * platform/network/CookieRequestHeaderFieldProxy.h:
29         (WebCore::CookieRequestHeaderFieldProxy::encode const):
30         (WebCore::CookieRequestHeaderFieldProxy::decode):
31         (WebCore::CookieRequestHeaderFieldProxy::CookieRequestHeaderFieldProxy): Deleted.
32         * platform/network/SocketStreamHandleImpl.cpp:
33         (WebCore::cookieDataForHandshake):
34         * platform/network/cf/CookieJarCFNet.cpp:
35         (WebCore::cookieRequestHeaderFieldValue):
36         * platform/network/curl/CookieJarCurl.cpp:
37         (WebCore::cookieRequestHeaderFieldValue):
38         * platform/network/curl/CookieJarCurlDatabase.cpp:
39         (WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const):
40         * platform/network/mac/CookieJarMac.mm:
41         (WebCore::cookieRequestHeaderFieldValue):
42         * platform/network/soup/CookieJarSoup.cpp:
43         (WebCore::cookieRequestHeaderFieldValue):
44
45 2018-04-21  Antoine Quint  <graouts@apple.com>
46
47         [Modern Media Controls] Show a loading indicator after pressing the play button in compact mode
48         https://bugs.webkit.org/show_bug.cgi?id=184863
49         <rdar://problem/38939468>
50
51         Reviewed by Dean Jackson.
52
53         We now display a loading indicator after pressing the play button when in compact mode. We also update the
54         behavior to use assets provided through WebKitAdditions (see webkit.org/b/184862) for the play button and
55         the invalid icon. Additionally, we always show a 20% opaque black overlay in the background while any piece
56         of user interface is up.
57
58         * Modules/modern-media-controls/controls/compact-activity-indicator.css: Added.
59         (button.compact-activity-indicator > picture): The loading indicator asset is a sprite made of 23 frames, so
60         we specify the mask size (since all buttons are rendered via a mask) to be 23 * 100% the rendered size. The
61         display of the loading indicator is performed with a first intro animation which runs once through the first
62         8 frames and then a continuously looping animation going through the remaining frames. We use a frames()
63         timing function to achieve the frame-by-frame effect while using only from/to keyframe animations. When we
64         fade out, we use a simply opacity fade, which is combined with the spinning animation. We use CSS variables
65         to encode both animations so they can be used combined or one at a time without redefining the whole animation
66         property.
67         (button.compact-activity-indicator.spins > picture): Use the "spins" animation variable when spinning.
68         (button.compact-activity-indicator.spins.fades-out > picture): Combine the "spins" and "fades-out" animation
69         variables when fading out.
70         (@keyframes compact-activity-indicator-intro): Animation going through the first 8 frames of the loading indicator.
71         (@keyframes compact-activity-indicator-loop): Animation going through the remaining frames of the loading indicator.
72         (@keyframes compact-activity-indicator-fades-out): Animation fading opacity from 1 to 0.
73         * Modules/modern-media-controls/controls/compact-activity-indicator.js: Added.
74         (CompactActivityIndicator):
75         (CompactActivityIndicator.prototype.show): Add the "spins" CSS class to show the control spinning with the intro animation.
76         (CompactActivityIndicator.prototype.hide): Add the "fades-out" CSS class to hide the control, removing both this class and
77         the "spins" class when the fade-out animation completes.
78         * Modules/modern-media-controls/controls/compact-media-controls.css: Added.
79         (.media-controls.compact:before): Add a 20% black overlay over the video frame to provide contrast for controls.
80         (.media-controls.compact button): Ensure buttons are sized to use the entire video frame so that their hit region
81         comprises the whole video frame.
82         (.media-controls.compact button > picture): Override default blending styles for a simple solid white mask.
83         (.media-controls.compact button:active > picture): Turn off the scale down effect when pressing a button.
84         * Modules/modern-media-controls/controls/compact-media-controls.js: Expose a "state" property for the compact media controls,
85         which can be exlusively one of three: "paused", "pending" and "invalid".
86         (CompactMediaControls.):
87         (CompactMediaControls.prototype.get state):
88         (CompactMediaControls.prototype.set state):
89         (CompactMediaControls.prototype.layout): In the "paused" state, show the play button. In the "pending" state show
90         the loading indicator. In the "invalid" state show the invalid button.
91         (CompactMediaControls.prototype.get placard): Deleted.
92         (CompactMediaControls.prototype.set placard): Deleted.
93         * Modules/modern-media-controls/js-files:
94         * Modules/modern-media-controls/media/compact-media-controls-support.js: Added.
95         (CompactMediaControlsSupport.prototype.get mediaEvents):
96         (CompactMediaControlsSupport.prototype.handleEvent): Make the controls enter the "paused" state when receiving a "pause"
97         event. Make the controls enter the "invalid" state when receiving an "error" event. 
98         (CompactMediaControlsSupport.prototype.enable):
99         (CompactMediaControlsSupport.prototype.disable):
100         (CompactMediaControlsSupport.prototype.buttonWasPressed): Play the media when pressing the play button and make the controls
101         enter the "pending" state. When pressing the loading indicator, pause the media and make the controls enter the "paused" state.
102         (CompactMediaControlsSupport.prototype._buttons):
103         (CompactMediaControlsSupport):
104         * Modules/modern-media-controls/media/media-controller.js:
105         (MediaController.prototype._supportingObjectClasses): Only use CompactMediaControlsSupport as a media controller supporting object
106         in the compact mode.
107         * Modules/modern-media-controls/media/placard-support.js:
108         (PlacardSupport.prototype.get mediaEvents): This media controller support object no longer needs to deal with compact mode.
109         * Modules/modern-media-controls/media/playback-support.js:
110         (PlaybackSupport.prototype.syncControl): This media controller support object no longer needs to deal with compact mode.
111         (PlaybackSupport):
112
113 2018-04-21  Antoine Quint  <graouts@apple.com>
114
115         [Modern Media Controls] Obtain compact mode icons through WebKitAdditions
116         https://bugs.webkit.org/show_bug.cgi?id=184862
117         <rdar://problem/39621645>
118
119         Reviewed by Jon Lee.
120
121         * Modules/modern-media-controls/controls/button.js:
122         (Button.prototype._updateImageMetrics): Handle PDF assets where the image source's intrinsic size needs
123         to be adjusted for the device pixel density.
124         (Button):
125         * Modules/modern-media-controls/controls/icon-service.js: Expect three additional icons provided through
126         WebKitAdditions, including two in the PDF format, so we add support for this format.
127         * WebCore.xcodeproj/project.pbxproj: Copy additional assets from the WebKitAdditions build directory should
128         any be present.
129
130 2018-04-21  Dean Jackson  <dino@apple.com>
131
132         Expose whether you've build with the Apple Internal SDK
133         https://bugs.webkit.org/show_bug.cgi?id=184864
134
135         Reviewed by Wenson Hsieh.
136
137         Internals API to let a test know if it is running with the
138         Apple internal SDK.
139
140         * testing/Internals.cpp:
141         (WebCore::usingAppleInternalSDK const):
142         * testing/Internals.h:
143         * testing/Internals.idl:
144
145 2018-04-20  Nan Wang  <n_wang@apple.com>
146
147         AX: AOM does not work with DOM Level 1 events
148         https://bugs.webkit.org/show_bug.cgi?id=184847
149
150         Reviewed by Chris Fleizach.
151
152         Added the accessibility events to the HTML attribute names.
153
154         Test cases are added to the existing layout tests.
155
156         * html/HTMLAttributeNames.in:
157         * html/HTMLElement.cpp:
158         (WebCore::HTMLElement::createEventHandlerNameMap):
159
160 2018-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
161
162         REGRESSION(r228088): [SOUP] Check TLS errors for WebSockets on GTlsConnection::accept-certificate
163         https://bugs.webkit.org/show_bug.cgi?id=184804
164
165         Reviewed by Michael Catanzaro.
166
167         * platform/network/soup/SocketStreamHandleImpl.h: Add a public url getter.
168         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
169         (WebCore::acceptCertificateCallback): Call SoupNetworkSession::checkTLSErrors() to decide whether to accept the
170         certificate or not.
171         (WebCore::connectProgressCallback): Receive the SocketStreamHandle and pass it to acceptCertificateCallback callback.
172         (WebCore::socketClientEventCallback): Ditto.
173         (WebCore::SocketStreamHandleImpl::create): Always connect to network events.
174         (WebCore::wssConnectionAcceptCertificateCallback): Deleted.
175         (WebCore::wssSocketClientEventCallback): Deleted.
176
177 2018-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
178
179         [SOUP] Do TLS error checking on GTlsConnection::accept-certificate
180         https://bugs.webkit.org/show_bug.cgi?id=184480
181
182         Reviewed by Michael Catanzaro.
183
184         * platform/network/soup/ResourceError.h: Change tlsError to recieve a failing URL instead of a SoupRequest,
185         since the request was only used to get the failing URL.
186         * platform/network/soup/ResourceErrorSoup.cpp:
187         (WebCore::ResourceError::tlsError): Use the given failing URL.
188         * platform/network/soup/SoupNetworkSession.cpp:
189         (WebCore::SoupNetworkSession::SoupNetworkSession): Use ssl-strict when creating the SoupSession to handle the
190         certificates ourselves by connecting to GTlsConnection::accept-certificate.
191         (WebCore::SoupNetworkSession::checkTLSErrors): Updated to receive a URL, certificate and errors instead of
192         receiving a SoupRequest and SoupMessage and extract the url, certirficate and errors from them. Also return the
193         optional error directly instead of using a completion handler since the function is always synchronous.
194         * platform/network/soup/SoupNetworkSession.h:
195
196 2018-04-20  Tim Horton  <timothy_horton@apple.com>
197
198         Adjust geolocation feature flag
199         https://bugs.webkit.org/show_bug.cgi?id=184856
200
201         Reviewed by Wenson Hsieh.
202
203         * Configurations/FeatureDefines.xcconfig:
204
205 2018-04-20  Chris Dumez  <cdumez@apple.com>
206
207         Unreviewed attempt to fix Windows build after r230875.
208
209         * platform/network/cf/CookieJarCFNet.cpp:
210         (WebCore::cookieRequestHeaderFieldValue):
211         * platform/network/curl/CookieJarCurlDatabase.cpp:
212
213 2018-04-20  Chris Dumez  <cdumez@apple.com>
214
215         REGRESSION (r229828): web view doesn’t update or respond to resizing until client calls policy decision handler
216         https://bugs.webkit.org/show_bug.cgi?id=184210
217         <rdar://problem/39072354>
218
219         Reviewed by Wenson Hsieh.
220
221         r229828 tried to have some API tests happy on iOS by freezing the layer tree
222         during the navigation policy decision. However, this is observable by the client
223         application and a regression from when the policy delegate was synchronous.
224
225         To address the issue, this patch reverts r229828 and instead updates the iOS
226         API tests to wait for the next presentation update after navigating
227         before interacting with the view.
228
229         * loader/FrameLoaderClient.h:
230         * loader/PolicyChecker.cpp:
231         (WebCore::PolicyChecker::checkNavigationPolicy):
232
233 2018-04-20  Brent Fulgham  <bfulgham@apple.com>
234
235         Limit cookie header access to Network process
236         https://bugs.webkit.org/show_bug.cgi?id=184764
237         <rdar://problem/36785285>
238
239         Reviewed by Youenn Fablet.
240
241         Revise the handling of cookie request headers so that we don't interact with them in the
242         WebContent process. They are only needed for interaction with the server and the network
243         process, so we should limit their scope to just the Network process.
244
245         Instead, we should handle a token that represents the cookie headers in the WebContent
246         process, which can be converted to the relevant cookie data in the network process when
247         needed.
248
249         * Modules/websockets/WebSocketChannel.cpp:
250         (WebCore::WebSocketChannel::didOpenSocketStream):
251         * Modules/websockets/WebSocketHandshake.cpp:
252         (WebCore::WebSocketHandshake::clientHandshakeMessage const):
253         (WebCore::WebSocketHandshake::clientHandshakeRequest const):
254         (WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const):
255         (WebCore::WebSocketHandshake::clientHandshakeMessage): Deleted.
256         (WebCore::WebSocketHandshake::clientHandshakeRequest): Deleted.
257         * Modules/websockets/WebSocketHandshake.h:
258         * WebCore.xcodeproj/project.pbxproj:
259         * loader/CookieJar.cpp:
260         (WebCore::cookieRequestHeaderFieldProxy):
261         * loader/CookieJar.h:
262         * platform/network/CookieRequestHeaderFieldProxy.h: Added.
263         (WebCore::CookieRequestHeaderFieldProxy::CookieRequestHeaderFieldProxy):
264         (WebCore::CookieRequestHeaderFieldProxy::isolatedCopy const):
265         (WebCore::CookieRequestHeaderFieldProxy::encode const):
266         (WebCore::CookieRequestHeaderFieldProxy::decode):
267         * platform/network/PlatformCookieJar.h:
268         * platform/network/SocketStreamHandle.cpp:
269         (WebCore::SocketStreamHandle::sendHandshake):
270         * platform/network/SocketStreamHandle.h:
271         * platform/network/SocketStreamHandleImpl.cpp:
272         (WebCore::SocketStreamHandleImpl::platformSendHandshake):
273         * platform/network/cf/SocketStreamHandleImpl.h:
274         * platform/network/curl/CookieJarCurl.cpp:
275         (WebCore::cookieRequestHeaderFieldValue):
276         * platform/network/curl/CookieJarCurl.h:
277         * platform/network/curl/SocketStreamHandleImpl.h:
278         * platform/network/mac/CookieJarMac.mm:
279         (WebCore::cookieRequestHeaderFieldValue):
280         * platform/network/soup/CookieJarSoup.cpp:
281         (WebCore::cookieRequestHeaderFieldValue):
282         * platform/network/soup/SocketStreamHandleImpl.h:
283
284 2018-04-20  Daniel Bates  <dabates@apple.com>
285
286         Hide Strong Password label when text field is too narrow
287         https://bugs.webkit.org/show_bug.cgi?id=184785
288         <rdar://problem/38183939>
289
290         Reviewed by Zalan Bujtas.
291
292         We accomplish this illusion by allowing the text field's decorations to wrap, specifying flex
293         shrink factors, a flex basis and hiding overflow. Hiding overflow is accomplished by a
294         combination of setting "overflow: hidden", "text-overflow: clip", and patching RenderTextControlSingleLine::layout()
295         to ensure that the height of the container element is equal to the intrinsic height of the
296         inner elements. Because the container is a flex box and we want to vertically center its
297         contents we also need to fix up the y-position of the container element as it may have flexed
298         as a result of forcing its height to match the intrinsic height of the inner elements.
299
300         * css/html.css:
301         (input::-webkit-strong-password-auto-fill-button): Specify a flex-shrink factor and prevent
302         wrapping of the "Strong Password" text when flexed.
303         * html/shadow/TextControlInnerElements.cpp:
304         (WebCore::TextControlInnerContainer::TextControlInnerContainer): Register for a custom style
305         resolution callback so that we can style the container if it is a Strong Password or Strong
306         Confirmation Password text field. Ideally we could accomplish this effect with a user agent-
307         specific pseudo class together with a selector definition in the user agent style sheet,
308         html.css. Unfortunately the style resolver does not seem to apply pseudo classes to
309         shadow DOM pseudo elements (why?). Therefore we use a custom style resolution callback to
310         achieve the same effect.
311         (WebCore::isStrongPasswordTextField): Returns whether the specified DOM element is a Strong
312         Password text field.
313         (WebCore::TextControlInnerContainer::resolveCustomStyle): Conditionally apply CSS properties
314         "flex-wrap: wrap" and overflow: hidden" if the shadow host of this container is a Strong
315         Password text field.
316         (WebCore::TextControlInnerElement::resolveCustomStyle): Conditionally style the inner text
317         if the shadow host of this container is a Strong Password text field. We need to apply these
318         styles here as opposed to in html.css for the same reason we need to apply the styles to
319         the container in a custom style resolution callback. See the comments for TextControlInnerContainer()
320         above for more details
321         * html/shadow/TextControlInnerElements.h:
322         * rendering/RenderTextControlSingleLine.cpp:
323         (WebCore::resetOverriddenHeight): Added. Incorporates the logic from setNeedsLayoutOnAncestors().
324         (WebCore::RenderTextControlSingleLine::layout): Override the height of the container element to
325         match the height of the inner elements when this text field is a Strong Password field. We cache
326         the container's logical top before adjusting its height so that we can restore it after performing
327         a second layout of this renderer. This is needed because we vertically center the elements in this
328         renderer and adjusting the height of the container may cause it to flex and re-position along its
329         cross axis when the container's height is taller than the inner element's height (e.g. the "Strong
330         Password" label wraps to the next line). This re-positioning causes a noticeable jitter when
331         transitioning from a field that has a visible "Strong Password" label to one that does not. Caching
332         and restoring the logical top of the container element avoids this jitter.
333         (WebCore::setNeedsLayoutOnAncestors): Deleted. Moved its implementation into resetOverriddenHeight().
334
335 2018-04-20  Dean Jackson  <dino@apple.com>
336
337         Render a badge on system preview images
338         https://bugs.webkit.org/show_bug.cgi?id=184854
339         <rdar://problem/39615154>
340
341         Reviewed by Tim Horton.
342
343         At paint time, if a RenderImage is an image element
344         which is identified as a system preview, then draw
345         a little badge in the top right corner.
346
347         It is expected that platforms will override the
348         default rendering with something that identifies
349         how a system preview will operate. e.g. QuickLook
350         on Apple systems.
351
352         Test: system-preview/badge.html
353
354         * rendering/RenderImage.cpp:
355         (WebCore::RenderImage::paintIntoRect): If we are
356         a system preview, call RenderTheme to draw a badge.
357         * rendering/RenderTheme.cpp:
358         (WebCore::RenderTheme::paintSystemPreviewBadge): A default
359         implementation that draws a red circle.
360         * rendering/RenderTheme.h:
361
362 2018-04-20  Brian Burg  <bburg@apple.com>
363
364         Web Inspector: remove some dead code in IdentifiersFactory
365         https://bugs.webkit.org/show_bug.cgi?id=184839
366
367         Reviewed by Timothy Hatcher.
368
369         * inspector/InspectorController.cpp:
370         (WebCore::InspectorController::setProcessId): Deleted.
371         * inspector/InspectorController.h:
372
373 2018-04-20  Chris Dumez  <cdumez@apple.com>
374
375         Use WindowProxy in DOMWindow.idl
376         https://bugs.webkit.org/show_bug.cgi?id=184820
377
378         Reviewed by Sam Weinig.
379
380         Use WindowProxy in DOMWindow.idl to match the specification more closely.
381
382         * bindings/js/JSWindowProxy.h:
383         * bindings/js/WindowProxy.cpp:
384         (WebCore::WindowProxy::window const):
385         * bindings/js/WindowProxy.h:
386         * bindings/scripts/CodeGeneratorJS.pm:
387         (NativeToJSValueDOMConvertNeedsState):
388         * dom/Document.cpp:
389         * dom/Document.h:
390         * dom/Document.idl:
391         * page/DOMWindow.cpp:
392         (WebCore::DOMWindow::focus):
393         (WebCore::DOMWindow::self const):
394         (WebCore::DOMWindow::opener const):
395         (WebCore::DOMWindow::parent const):
396         (WebCore::DOMWindow::top const):
397         (WebCore::DOMWindow::open):
398         * page/DOMWindow.h:
399         * page/DOMWindow.idl:
400         * testing/Internals.cpp:
401         (WebCore::Internals::openDummyInspectorFrontend):
402         * testing/Internals.h:
403         * testing/Internals.idl:
404
405 2018-04-20  Chris Dumez  <cdumez@apple.com>
406
407         Update cross-origin SecurityError messages to not include the target origin
408         https://bugs.webkit.org/show_bug.cgi?id=184803
409         <rdar://problem/39547724>
410
411         Reviewed by Sam Weinig.
412
413         No new tests, rebaselined existing tests.
414
415         * bindings/js/JSDOMBindingSecurity.cpp:
416         (WebCore::canAccessDocument):
417         (WebCore::BindingSecurity::shouldAllowAccessToFrame):
418         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
419         * page/DOMWindow.cpp:
420         (WebCore::DOMWindow::crossDomainAccessErrorMessage):
421         (WebCore::DOMWindow::isInsecureScriptAccess):
422         * page/DOMWindow.h:
423         * page/Location.cpp:
424         (WebCore::Location::reload):
425
426 2018-04-20  Chris Nardi  <cnardi@chromium.org>
427
428         Update HSL/HSLA parsing to match CSS Color 4
429         https://bugs.webkit.org/show_bug.cgi?id=180528
430         <rdar://problem/35926675>
431
432         CSS Color 4 specifies a comma optional syntax for HSL/HSLA, as well as allowing angle values for the
433         hue and percent alpha values. Update our parsing to match this.
434
435         Reviewed by Simon Fraser.
436
437         This change also updates the import of WPT css-color to test the changes.
438
439         Tests: LayoutTests/imported/w3c/web-platform-tests/css/css-color/hsl{a}-{001-008}.html
440
441         * css/parser/CSSPropertyParserHelpers.cpp:
442         (WebCore::CSSPropertyParserHelpers::parseHSLParameters):
443         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
444         (WebCore::CSSPropertyParserHelpers::consumeColor):
445         * platform/graphics/Color.cpp:
446         (WebCore::calcHue):
447         (WebCore::makeRGBAFromHSLA):
448
449 2018-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>
450
451         [Extra zoom mode] Injected bundle form client should be notified when editing text fields
452         https://bugs.webkit.org/show_bug.cgi?id=184822
453         <rdar://problem/38807319>
454
455         Reviewed by Tim Horton.
456
457         Export the constructor and destructor of UserTypingGestureIndicator for use in WebKit (see WebPage.cpp).
458
459         Test: fast/forms/extrazoom/edit-text-field-calls-injected-bundle.html
460
461         * dom/UserTypingGestureIndicator.h:
462
463 2018-04-18  Jer Noble  <jer.noble@apple.com>
464
465         Don't put build products into WK_ALTERNATE_WEBKIT_SDK_PATH for engineering builds
466         https://bugs.webkit.org/show_bug.cgi?id=184762
467
468         Reviewed by Dan Bernstein.
469
470         * Configurations/WebCore.xcconfig:
471         * WebCore.xcodeproj/project.pbxproj:
472
473 2018-04-20  Daniel Bates  <dabates@apple.com>
474
475         Remove code for compilers that did not support NSDMI for aggregates
476         https://bugs.webkit.org/show_bug.cgi?id=184599
477
478         Reviewed by Per Arne Vollan.
479
480         Remove workaround for earlier Visual Studio versions that did not support non-static data
481         member initializers (NSDMI) for aggregates. We have since updated all the build.webkit.org
482         and EWS bots to a newer version that supports this feature.
483
484         * Modules/cache/CacheQueryOptions.h:
485         (WebCore::CacheQueryOptions::CacheQueryOptions): Deleted.
486         * dom/Node.h:
487         (WebCore::Node::InsertionType::InsertionType): Deleted.
488         (WebCore::Node::RemovalType::RemovalType): Deleted.
489         * html/canvas/CanvasStyle.h:
490         (WebCore::CanvasStyle::CMYKAColor::CMYKAColor): Deleted.
491         * page/EventHandler.h:
492         (WebCore::EventHandler::DragTargetResponse::DragTargetResponse): Deleted.
493         * page/animation/CSSAnimationController.h:
494         (WebCore::AnimationUpdate::AnimationUpdate): Deleted.
495         * platform/graphics/FontSelectionAlgorithm.h:
496         (WebCore::FontSelectionRequest::tied const):
497         (WebCore::FontSelectionRequest::FontSelectionRequest): Deleted.
498         (WebCore::FontSelectionCapabilities::FontSelectionCapabilities): Deleted.
499         * platform/mediastream/IceCandidate.h:
500         (WebCore::IceCandidate::IceCandidate): Deleted.
501         * platform/text/StringWithDirection.h:
502         (WebCore::StringWithDirection::StringWithDirection): Deleted.
503         * rendering/MarkedText.h:
504         (WebCore::MarkedText::MarkedText): Deleted.
505         * style/StyleUpdate.h:
506         (WebCore::Style::ElementUpdate::ElementUpdate): Deleted.
507         (WebCore::Style::ElementUpdates::ElementUpdates): Deleted.
508         (WebCore::Style::TextUpdate::TextUpdate): Deleted.
509
510 2018-04-20  Youenn Fablet  <youenn@apple.com>
511
512         WebPage sometimes incorrectly rules out PDF as a mime type that can be showed
513         https://bugs.webkit.org/show_bug.cgi?id=184369
514
515         Reviewed by Chris Dumez.
516
517         WebPage does need to check for plugins at reception of the response.
518         In that case, the page URL is the URL from which we are navigating out.
519         Add plugin API to check for plugin availability with an extra URL parameter to cover that case.
520
521         Covered by API test.
522
523         * plugins/PluginData.cpp:
524         (WebCore::PluginData::supportsWebVisibleMimeTypeForURL const):
525         (WebCore::PluginData::supportsWebVisibleMimeType const):
526         * plugins/PluginData.h:
527
528 2018-04-20  Daniel Bates  <dabates@apple.com>
529
530         Remove Strong Password decoration when text field type changes
531         https://bugs.webkit.org/show_bug.cgi?id=184795
532         <rdar://problem/38325108>
533
534         Reviewed by Antti Koivisto.
535
536         Remove the Strong Password decoration when the text field's type changes to avoid interfering
537         with web sites that allow a person to show/hide their password.
538
539         Test: fast/forms/auto-fill-button/hide-strong-password-when-field-type-changes.html
540
541         * html/HTMLInputElement.cpp:
542         (WebCore::HTMLInputElement::updateType):
543
544 2018-04-20  Javier Fernandez  <jfernandez@igalia.com>
545
546         Update Alignment shorthands to the spec now that they are not ambiguous
547         https://bugs.webkit.org/show_bug.cgi?id=184812
548
549         Reviewed by Antti Koivisto.
550
551         Now that the issue [1] about the syntax ambiguity has been resolved we
552         don't need to use the custom syntax anymore. The Alignment shorthands
553         use now the simple syntax, defined based on the longhands' syntax.
554
555         Since we allow all the values valid for each longhand, we'll update
556         in this CL the corresponding web platform tests. Additionally, this CL
557         updates also the shorthand serialization tests [2], which didn't
558         consider the new value 'legacy' for justify-items (and place-items) due
559         to the bug [3] Firefox still has pending to be fixed.
560
561         [1] https://github.com/w3c/csswg-drafts/issues/1001
562         [2] css/css-align/default-alignment/shorthand-serialization-001.html
563         [3] https://bugzilla.mozilla.org/show_bug.cgi?id=1363875
564
565         Tests: imported/w3c/web-platform-tests/css/css-align/default-alignment/shorthand-serialization-001.html
566                imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-computed-001.html
567                imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-001.html
568                imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-002.html
569
570         * css/parser/CSSPropertyParser.cpp:
571         (WebCore::CSSPropertyParser::consumePlaceContentShorthand): Using the justify-content and align-content parsing logic to parse the shorthand.
572         (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): Using the justify-items and align-items parsing logic to parse the shorthand.
573         (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): Using the justify-self and align-self parsing logic to parse the shorthand.
574
575 2018-04-20  Daniel Bates  <dabates@apple.com>
576
577         Unreviewed, rolling out r230117.
578
579         Broke find-in-page for PDFs
580
581         Reverted changeset:
582
583         "ASSERTION FAILED: ASSERT(!containsImage ||
584         MIMETypeRegistry::isSupportedImageResourceMIMEType([resource
585         MIMEType])) in -[NSPasteboard(WebExtras)
586         _web_writePromisedRTFDFromArchive:containsImage:]"
587         https://bugs.webkit.org/show_bug.cgi?id=184161
588         https://trac.webkit.org/changeset/230117
589
590 2018-04-20  Eric Carlson  <eric.carlson@apple.com>
591
592         Pausing should clear m_waitingToEnterFullscreen
593         https://bugs.webkit.org/show_bug.cgi?id=184831
594         <rdar://problem/39602852>
595
596         Reviewed by Jer Noble.
597
598         * html/HTMLMediaElement.cpp:
599         (WebCore::HTMLMediaElement::pause): Clear m_waitingToEnterFullscreen
600
601 2018-04-20  Eric Carlson  <eric.carlson@apple.com>
602
603         [Extra zoom mode] Disable CA transactions while setting up for fullscreen
604         https://bugs.webkit.org/show_bug.cgi?id=184817
605         <rdar://problem/39596075>
606
607         Reviewed by Jer Noble.
608
609         This was tested manually as it is not possible to write an automated test for this.
610
611         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
612         (VideoFullscreenInterfaceAVKit::doSetup): Move the call to disable CA transactions outside
613         of the EXTRA_ZOOM_MODE check, the [CATransaction commit] was already unguarded.
614
615 2018-04-20  Youenn Fablet  <youenn@apple.com>
616
617         Make PluginData cache its web visible plugins
618         https://bugs.webkit.org/show_bug.cgi?id=184421
619
620         Reviewed by Chris Dumez.
621
622         Buffer visible plugins until the page URL changes.
623         For that purpose, we now cache the visible plugins and the URL it was computed from in PluginData.
624
625         Update plugin info provider API to pass the URL used to check for plugin visibility.
626
627         No observable change of behavior.
628
629         * loader/EmptyClients.cpp:
630         * plugins/PluginData.cpp:
631         (WebCore::PluginData::webVisiblePlugins const):
632         (WebCore::PluginData::publiclyVisiblePlugins const):
633         (WebCore::PluginData::supportsMimeType const):
634         * plugins/PluginData.h:
635         * plugins/PluginInfoProvider.h:
636
637 2018-04-20  Chris Dumez  <cdumez@apple.com>
638
639         Unreviewed build fix after r230840.
640
641         * bindings/js/JSWindowProxy.cpp:
642         (WebCore::JSWindowProxy::attachDebugger):
643
644 2018-04-20  Chris Dumez  <cdumez@apple.com>
645
646         Unreviewed attempt to fix the Windows build after r230831.
647
648         * bindings/js/JSWindowProxy.cpp:
649         (WebCore::JSWindowProxy::create):
650         (WebCore::JSWindowProxy::attachDebugger):
651
652 2018-04-20  Chris Nardi  <cnardi@chromium.org>
653
654         Omit default value when serializing font-feature-settings
655         https://bugs.webkit.org/show_bug.cgi?id=182382
656
657         Reviewed by Myles C. Maxfield.
658
659         According to the shortest-serialization principle [1], values should be omitted if their omission
660         wouldn't change the value of reparsing. As "1"/"on" is the default value for font-feature-settings,
661         omit this when serializing, matching the behavior of Firefox and Chrome.
662
663         [1]: https://github.com/w3c/csswg-drafts/issues/1564
664
665         Updated css3/font-feature-settings-parsing.html, fast/css/inherited-properties-rare-text.html,
666         and fast/text/font-face-javascript.html.
667
668         * css/CSSFontFeatureValue.cpp:
669         (WebCore::CSSFontFeatureValue::customCSSText const):
670
671 2018-04-19  Alexey Proskuryakov  <ap@apple.com>
672
673         More WK_ALTERNATE_FRAMEWORKS_DIR adoption in WebCore
674         https://bugs.webkit.org/show_bug.cgi?id=184805
675
676         Reviewed by Dan Bernstein.
677
678         * Configurations/WebCoreTestShim.xcconfig:
679         * Configurations/WebCoreTestSupport.xcconfig:
680
681 2018-04-19  Brady Eidson  <beidson@apple.com>
682
683         Make back forward cache work with process swapping.
684         <rdar://problem/38676604> and https://bugs.webkit.org/show_bug.cgi?id=184793
685
686         Reviewed by Chris Dumez.
687
688         Covered by API tests.
689
690         * loader/FrameLoader.cpp:
691         (WebCore::FrameLoader::loadWithNavigationAction):
692         (WebCore::FrameLoader::load):
693         (WebCore::FrameLoader::loadWithDocumentLoader):
694         (WebCore::FrameLoader::reloadWithOverrideEncoding):
695         (WebCore::FrameLoader::reload):
696         (WebCore::FrameLoader::commitProvisionalLoad):
697         (WebCore::FrameLoader::loadDifferentDocumentItem):
698         * loader/FrameLoader.h:
699
700 2018-04-19  Chris Dumez  <cdumez@apple.com>
701
702         Rename JSDOMWindowProxy to JSWindowProxy
703         https://bugs.webkit.org/show_bug.cgi?id=184797
704
705         Reviewed by Sam Weinig.
706
707         Rename JSDOMWindowProxy to JSWindowProxy for consistency with WindowProxy.
708
709         * Sources.txt:
710         * WebCore.xcodeproj/project.pbxproj:
711         * bindings/IDLTypes.h:
712         * bindings/js/JSBindingsAllInOne.cpp:
713         * bindings/js/JSDOMConvertWindowProxy.h:
714         * bindings/js/JSDOMWindowBase.cpp:
715         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
716         (WebCore::JSDOMWindowBase::finishCreation):
717         (WebCore::JSDOMWindowBase::proxy const):
718         (WebCore::toJSDOMWindow):
719         * bindings/js/JSDOMWindowBase.h:
720         * bindings/js/JSDOMWindowCustom.cpp:
721         (WebCore::JSDOMWindow::toWrapped):
722         * bindings/js/JSEventTargetCustom.cpp:
723         (WebCore::JSEventTarget::toWrapped):
724         * bindings/js/JSRemoteDOMWindowBase.cpp:
725         (WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase):
726         (WebCore::toJSRemoteDOMWindow):
727         * bindings/js/JSRemoteDOMWindowBase.h:
728         * bindings/js/JSWindowProxy.cpp: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.cpp.
729         (WebCore::JSWindowProxy::JSWindowProxy):
730         (WebCore::JSWindowProxy::finishCreation):
731         (WebCore::JSWindowProxy::create):
732         (WebCore::JSWindowProxy::destroy):
733         (WebCore::JSWindowProxy::setWindow):
734         (WebCore::JSWindowProxy::attachDebugger):
735         (WebCore::JSWindowProxy::wrapped const):
736         (WebCore::JSWindowProxy::toWrapped):
737         (WebCore::toJS):
738         (WebCore::toJSWindowProxy):
739         * bindings/js/JSWindowProxy.h: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.h.
740         (WebCore::toJS):
741         (WebCore::toJSWindowProxy):
742         * bindings/js/ScriptController.cpp:
743         (WebCore::ScriptController::initScriptForWindowProxy):
744         * bindings/js/ScriptController.h:
745         * bindings/js/WindowProxy.cpp:
746         (WebCore::WindowProxy::createJSWindowProxy):
747         (WebCore::WindowProxy::jsWindowProxiesAsVector const):
748         (WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
749         * bindings/js/WindowProxy.h:
750         (WebCore::WindowProxy::jsWindowProxy):
751         (WebCore::WindowProxy::existingJSWindowProxy const):
752         * bindings/scripts/CodeGeneratorJS.pm:
753         (AddToIncludesForIDLType):
754         (GenerateHeader):
755         (GenerateOverloadDispatcher):
756         (GenerateImplementation):
757         * bindings/scripts/test/JS/JSTestObj.cpp:
758         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
759         * page/Frame.cpp:
760         * page/csp/ContentSecurityPolicy.cpp:
761         (WebCore::ContentSecurityPolicy::didCreateWindowProxy const):
762         * page/csp/ContentSecurityPolicy.h:
763
764 2018-04-19  Dirk Schulze  <krit@webbkit.org>
765
766         Introduce SVGGeometryElement interface
767         https://bugs.webkit.org/show_bug.cgi?id=184768
768
769         Reviewed by Antti Koivisto.
770
771         Start implementing SVGGeometryElement interface from SVG2.
772         https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
773
774         Start with SVGPathElement only for now. Also, just inferface gets implemented
775         by this patch. No new functionality like isPointInFill yet.
776         Fix getPointAtLength and make it more restrictive. This follows the spec and
777         all other implementations.
778
779         Added additional test scenarios to existing tests.
780
781         * CMakeLists.txt:
782         * DerivedSources.make:
783         * Sources.txt:
784         * WebCore.xcodeproj/project.pbxproj:
785         * bindings/scripts/CodeGeneratorJS.pm:
786         (GetGnuVTableOffsetForType):
787         * svg/SVGAllInOne.cpp:
788         * svg/SVGGeometryElement.cpp: Added.
789         (WebCore::SVGGeometryElement::SVGGeometryElement):
790         (WebCore::SVGGeometryElement::isSupportedAttribute):
791         (WebCore::SVGGeometryElement::parseAttribute):
792         (WebCore::SVGGeometryElement::svgAttributeChanged):
793         (WebCore::SVGGeometryElement::createElementRenderer):
794         * svg/SVGGeometryElement.h: Added.
795         * svg/SVGGeometryElement.idl: Added.
796         * svg/SVGGradientElement.cpp:
797         * svg/SVGPathElement.cpp:
798         (WebCore::SVGPathElement::SVGPathElement):
799         (WebCore::SVGPathElement::parseAttribute):
800         (WebCore::SVGPathElement::svgAttributeChanged):
801         (WebCore::SVGPathElement::insertedIntoAncestor):
802         (WebCore::SVGPathElement::removedFromAncestor):
803         * svg/SVGPathElement.h:
804         * svg/SVGPathElement.idl:
805
806 2018-04-19  Tadeu Zagallo  <tzagallo@apple.com>
807
808         REGRESSION(r227340): ArrayBuffers were not being serialized when sent via MessagePorts
809         https://bugs.webkit.org/show_bug.cgi?id=184254
810         <rdar://problem/39140200>
811
812         Reviewed by Daniel Bates.
813
814         Add a new encoding method to SerializedScriptValue that includes ArrayBuffers.
815
816         Test: workers/message-port.html
817
818         * bindings/js/SerializedScriptValue.h:
819         (WebCore::SerializedScriptValue::encode const):
820         (WebCore::SerializedScriptValue::decode):
821         * dom/messageports/MessageWithMessagePorts.h:
822         (WebCore::MessageWithMessagePorts::encode const):
823         (WebCore::MessageWithMessagePorts::decode):
824
825 2018-04-19  David Kilzer  <ddkilzer@apple.com>
826
827         Enable Objective-C weak references
828         <https://webkit.org/b/184789>
829         <rdar://problem/39571716>
830
831         Reviewed by Dan Bernstein.
832
833         * Configurations/Base.xcconfig:
834         (CLANG_ENABLE_OBJC_WEAK): Enable.
835
836 2018-04-19  Antti Koivisto  <antti@apple.com>
837
838         Don't use RenderTreeBuilder::current() in RenderTreeUpdater
839         https://bugs.webkit.org/show_bug.cgi?id=184794
840
841         Reviewed by Zalan Bujtas.
842
843         Pass the builder as a parameter where needed.
844
845         * rendering/updating/RenderTreeUpdater.cpp:
846         (WebCore::RenderTreeUpdater::updateElementRenderer):
847         (WebCore::RenderTreeUpdater::updateTextRenderer):
848         (WebCore::RenderTreeUpdater::tearDownRenderers):
849         (WebCore::RenderTreeUpdater::tearDownRenderer):
850         (WebCore::RenderTreeUpdater::tearDownTextRenderer):
851         (WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
852         (WebCore::RenderTreeUpdater::tearDownLeftoverShadowHostChildren):
853         * rendering/updating/RenderTreeUpdater.h:
854         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
855         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
856         (WebCore::RenderTreeUpdater::GeneratedContent::removeBeforePseudoElement):
857         (WebCore::RenderTreeUpdater::GeneratedContent::removeAfterPseudoElement):
858         * rendering/updating/RenderTreeUpdaterGeneratedContent.h:
859
860 2018-04-19  Eric Carlson  <eric.carlson@apple.com>
861
862         Runtime logging during GC can cause crash
863         https://bugs.webkit.org/show_bug.cgi?id=184792
864         <rdar://problem/39567927>
865
866         Reviewed by Jer Noble.
867
868         Test: media/destructor-logging-crash.html
869
870         * dom/Document.cpp:
871         (WebCore::Document::~Document): Clear the logger observer immediately so anything logged
872         as a side effect of the destructor won't cause a problem.
873         (WebCore::Document::didLogMessage): Create the ConsoleMessage in a task.
874         * dom/Document.h:
875
876 2018-04-19  Youenn Fablet  <youenn@apple.com>
877
878         Web Inspector backend should get headers & cookies from network process separately from resource requests
879         https://bugs.webkit.org/show_bug.cgi?id=184396
880         <rdar://problem/38877384>
881
882         Reviewed by Brian Burg.
883
884         Add two new loader strategies to get response and network metrics directly from
885         NetworkProcess based on resource loader identifier.
886         Use these methods in InspectorNetworkAgent when response/metrics might be filtered.
887
888         Covered by existing tests, in particular http/tests/inspector/network/fetch-network-data.html which would fail
889         without this since we are now setting the sourceOrigin for NetworkResourceLoader, which is used to sanitize response headers.
890
891         * inspector/agents/InspectorNetworkAgent.cpp:
892         (WebCore::InspectorNetworkAgent::didReceiveResponse):
893         (WebCore::InspectorNetworkAgent::didFinishLoading):
894         * loader/LoaderStrategy.cpp:
895         (WebCore::LoaderStrategy::responseFromResourceLoaIdentifier):
896         (WebCore::LoaderStrategy::networkMetricsFromResourceLoaIdentifier):
897         * loader/LoaderStrategy.h:
898
899 2018-04-19  Wenson Hsieh  <wenson_hsieh@apple.com>
900
901         [Extra zoom mode] Add a mechanism to extend the height of the layout viewport in extra zoom mode
902         https://bugs.webkit.org/show_bug.cgi?id=184782
903         <rdar://problem/38346712>
904
905         Reviewed by Tim Horton.
906
907         Add a new helper on FrameView to compute an expanded layout viewport size, as well as a new setting for the
908         height expansion factor when computing visual viewport dimensions. See WebKit/ChangeLog for more detail.
909
910         Test: fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html
911
912         * page/FrameView.cpp:
913         (WebCore::FrameView::expandedLayoutViewportSize):
914         * page/FrameView.h:
915         * page/Settings.yaml:
916
917 2018-04-19  Chris Dumez  <cdumez@apple.com>
918
919         REGRESSION (r229133): decidePolicyForNavigationAction not called for loading an HTML string
920         https://bugs.webkit.org/show_bug.cgi?id=184209
921         <rdar://problem/39145306>
922
923         Reviewed by Ryosuke Niwa.
924
925         In r229133, we stopped doing navigation policy checks for about:blank because about:blank
926         loads need to happen synchronously for Web-compatibility. However, this regressed loading
927         an HTML string in a WebView because in such cases, the URL is also about:blank with
928         substitute data.
929
930         In this patch, we take a more conservative approach and restore policy checking for
931         'about:blank' but using synchronous IPC.
932
933         * loader/PolicyChecker.cpp:
934         (WebCore::PolicyChecker::checkNavigationPolicy):
935
936 2018-04-19  Chris Nardi  <cnardi@chromium.org>
937
938         Support calc() in webkit-gradient and cross-fade
939         https://bugs.webkit.org/show_bug.cgi?id=182225
940
941         Reviewed by Simon Fraser.
942
943         calc() was previously unsupported in webkit-gradient and webkit-cross-fade, but both should take calc() values.
944         Update the code to support calc() values.
945
946         Tests: LayoutTests/css3/calc/cross-fade-calc.html
947                LayoutTests/css3/calc/webkit-gradient-calc.html
948
949         * css/parser/CSSPropertyParserHelpers.cpp:
950         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
951         (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
952
953 2018-04-17  Filip Pizlo  <fpizlo@apple.com>
954
955         The InternalFunction hierarchy should be in IsoSubspaces
956         https://bugs.webkit.org/show_bug.cgi?id=184721
957
958         Reviewed by Saam Barati.
959
960         No new tests because no new behavior.
961
962         * bindings/js/WebCoreJSClientData.cpp:
963         (WebCore::JSVMClientData::JSVMClientData):
964         * bindings/js/WebCoreJSClientData.h:
965         (WebCore::JSVMClientData::runtimeMethodSpace):
966         * bridge/runtime_method.cpp:
967         (JSC::RuntimeMethod::subspaceForImpl):
968         * bridge/runtime_method.h:
969
970 2018-04-19  Brady Eidson  <beidson@apple.com>
971
972         Add globally-unique HistoryItem identifiers (and have WebKit2 adopt them).
973         <rdar://problem/39533949> and https://bugs.webkit.org/show_bug.cgi?id=184750
974
975         Reviewed by Ryosuke Niwa.
976
977         No new tests (Refactor, no behavior change).
978
979         In WebCore, we:
980         - Add a process-unique "BackForwardItemIdentifier"
981         - Make all HistoryItems have such an identifier as a member
982
983         * WebCore.xcodeproj/project.pbxproj:
984
985         * history/BackForwardItemIdentifier.h: Added.
986         (WebCore::BackForwardItemIdentifier::logString const):
987         (WebCore::operator==):
988         (WebCore::BackForwardItemIdentifier::encode const):
989         (WebCore::BackForwardItemIdentifier::decode):
990         (WebCore::BackForwardItemIdentifier::hash const):
991         (WTF::BackForwardItemIdentifierHash::hash):
992         (WTF::BackForwardItemIdentifierHash::equal):
993         (WTF::HashTraits<WebCore::BackForwardItemIdentifier>::emptyValue):
994         (WTF::HashTraits<WebCore::BackForwardItemIdentifier>::constructDeletedValue):
995         (WTF::HashTraits<WebCore::BackForwardItemIdentifier>::isDeletedValue):
996
997         * history/HistoryItem.cpp:
998         (WebCore::HistoryItem::generateSequenceNumber):
999         (WebCore::HistoryItem::HistoryItem):
1000         (WebCore::generateSequenceNumber): Deleted.
1001
1002         * history/HistoryItem.h:
1003         (WebCore::HistoryItem::create):
1004         (WebCore::HistoryItem::identifier const):
1005
1006 2018-04-19  Nan Wang  <n_wang@apple.com>
1007
1008         AX: AOM: respect the accessibility setting for dispatching the accessible events
1009         https://bugs.webkit.org/show_bug.cgi?id=184619
1010
1011         Reviewed by Ryosuke Niwa.
1012
1013         Added accessibilityEventsEnabled as a setting on the page.
1014
1015         Test: accessibility/ios-simulator/accessibility-events-setting.html
1016
1017         * accessibility/AccessibilityObject.cpp:
1018         (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const):
1019         * page/Settings.yaml:
1020         * testing/InternalSettings.cpp:
1021         (WebCore::InternalSettings::Backup::Backup):
1022         (WebCore::InternalSettings::Backup::restoreTo):
1023         (WebCore::InternalSettings::setAccessibilityEventsEnabled):
1024         * testing/InternalSettings.h:
1025         * testing/InternalSettings.idl:
1026
1027 2018-04-18  Jer Noble  <jer.noble@apple.com>
1028
1029         Fix build when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value
1030         https://bugs.webkit.org/show_bug.cgi?id=184693
1031         <rdar://problem/39491884>
1032
1033         Reviewed by Tim Horton.
1034
1035         * Configurations/WebCore.xcconfig:
1036
1037 2018-04-19  Eric Stobbart  <ericstobbart@gmail.com>
1038
1039         Change MediaSource WebCore to return NewObject for SourceBuffers
1040         https://bugs.webkit.org/show_bug.cgi?id=184642
1041
1042         Reviewed by Chris Dumez.
1043
1044         Minor change inline with IDL documentation
1045
1046         * Modules/mediasource/MediaSource.cpp:
1047         (WebCore::MediaSource::addSourceBuffer):
1048         (): Deleted.
1049         * Modules/mediasource/MediaSource.h:
1050         * Modules/mediasource/MediaSource.idl:
1051
1052 2018-04-19  Yusuke Suzuki  <utatane.tea@gmail.com>
1053
1054         Unreviewed, build fix for Ubuntu LTS GCC
1055         https://bugs.webkit.org/show_bug.cgi?id=184756
1056
1057         The variable name "windowProxy" (with auto&) conflicts with the function name "windowProxy".
1058
1059         * bindings/js/ScriptController.cpp:
1060         (WebCore::ScriptController::updateDocument):
1061         (WebCore::ScriptController::collectIsolatedContexts):
1062
1063 2018-04-19  Manuel Rego Casasnovas  <rego@igalia.com>
1064
1065         Caret rendered at incorrect location inside empty table cell
1066         https://bugs.webkit.org/show_bug.cgi?id=85385
1067
1068         Reviewed by Zalan Bujtas.
1069
1070         This is based on a previous patch by Shezan Baig <shezbaig.wk@gmail.com>.
1071
1072         This fixes the position of the caret in empty cells,
1073         that was painted lower than expected
1074         (and then modified when you start to edit the cell).
1075
1076         Ensures that editable table cells have at least one line when
1077         they are laid out. This ensures that the cell's intrinsic before/after
1078         padding is calculated correctly, which results in the caret location
1079         being calculated correctly.
1080
1081         Test: editing/caret/caret-in-empty-cell.html
1082
1083         * rendering/RenderTableCell.cpp:
1084         (WebCore::RenderTableCell::hasLineIfEmpty): Override method to consider
1085         that it has an an empty line if the table cell is editable.
1086         * rendering/RenderTableCell.h:
1087
1088 2018-04-18  Daniel Bates  <dabates@apple.com>
1089
1090         Cleanup TextControlInnerElements
1091         https://bugs.webkit.org/show_bug.cgi?id=184475
1092
1093         Reviewed by Antti Koivisto.
1094
1095         Clean up TextControlInnerElement::resolveCustomStyle(), move the implementation of
1096         TextControlPlaceholderElement::create() from the header to the cpp file, replace
1097         fancy comments to demarcate classes with MARK: so that they show up in Xcode's
1098         function menu.
1099
1100         * html/shadow/TextControlInnerElements.cpp:
1101         (WebCore::TextControlInnerElement::resolveCustomStyle):
1102         (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
1103         (WebCore::TextControlPlaceholderElement::create):
1104         * html/shadow/TextControlInnerElements.h:
1105
1106 2018-04-18  Chris Dumez  <cdumez@apple.com>
1107
1108         Rename WindowProxyController to WindowProxy
1109         https://bugs.webkit.org/show_bug.cgi?id=184756
1110
1111         Reviewed by Sam Weinig.
1112
1113         Rename WindowProxyController to WindowProxy for clarity. When the IDL uses WindowProxy, the implementation
1114         needed use WindowProxyController type, which was a bit confusing.
1115
1116         * Sources.txt:
1117         * WebCore.xcodeproj/project.pbxproj:
1118         * bindings/js/DOMWrapperWorld.cpp:
1119         (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
1120         (WebCore::DOMWrapperWorld::clearWrappers):
1121         * bindings/js/DOMWrapperWorld.h:
1122         (WebCore::DOMWrapperWorld::didCreateWindowProxy):
1123         (WebCore::DOMWrapperWorld::didDestroyWindowProxy):
1124         * bindings/js/JSBindingsAllInOne.cpp:
1125         * bindings/js/JSDOMWindowBase.cpp:
1126         (WebCore::toJS):
1127         * bindings/js/JSDOMWindowProxy.cpp:
1128         (WebCore::toJS):
1129         (WebCore::toJSDOMWindowProxy):
1130         * bindings/js/JSDOMWindowProxy.h:
1131         (WebCore::toJS):
1132         (WebCore::toJSDOMWindowProxy):
1133         * bindings/js/ScriptCachedFrameData.cpp:
1134         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
1135         (WebCore::ScriptCachedFrameData::restore):
1136         * bindings/js/ScriptController.cpp:
1137         (WebCore::ScriptController::evaluateInWorld):
1138         (WebCore::ScriptController::loadModuleScriptInWorld):
1139         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
1140         (WebCore::ScriptController::evaluateModule):
1141         (WebCore::ScriptController::setupModuleScriptHandlers):
1142         (WebCore::ScriptController::windowProxy):
1143         (WebCore::ScriptController::enableEval):
1144         (WebCore::ScriptController::enableWebAssembly):
1145         (WebCore::ScriptController::disableEval):
1146         (WebCore::ScriptController::disableWebAssembly):
1147         (WebCore::ScriptController::updateDocument):
1148         (WebCore::ScriptController::collectIsolatedContexts):
1149         (WebCore::ScriptController::windowScriptNPObject):
1150         (WebCore::ScriptController::executeIfJavaScriptURL):
1151         * bindings/js/ScriptController.h:
1152         (WebCore::ScriptController::globalObject):
1153         * bindings/js/ScriptControllerMac.mm:
1154         (WebCore::ScriptController::windowScriptObject):
1155         * bindings/js/ScriptState.cpp:
1156         (WebCore::mainWorldExecState):
1157         * bindings/js/WindowProxy.cpp: Renamed from Source/WebCore/bindings/js/WindowProxyController.cpp.
1158         (WebCore::WindowProxy::WindowProxy):
1159         (WebCore::WindowProxy::~WindowProxy):
1160         (WebCore::WindowProxy::destroyJSWindowProxy):
1161         (WebCore::WindowProxy::createJSWindowProxy):
1162         (WebCore::WindowProxy::jsWindowProxiesAsVector const):
1163         (WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
1164         (WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
1165         (WebCore::WindowProxy::setDOMWindow):
1166         (WebCore::WindowProxy::attachDebugger):
1167         * bindings/js/WindowProxy.h: Renamed from Source/WebCore/bindings/js/WindowProxyController.h.
1168         (WebCore::WindowProxy::jsWindowProxies const):
1169         (WebCore::WindowProxy::releaseJSWindowProxies):
1170         (WebCore::WindowProxy::setJSWindowProxies):
1171         (WebCore::WindowProxy::jsWindowProxy):
1172         (WebCore::WindowProxy::existingJSWindowProxy const):
1173         (WebCore::WindowProxy::globalObject):
1174         * loader/FrameLoader.cpp:
1175         (WebCore::FrameLoader::clear):
1176         (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
1177         * page/AbstractFrame.cpp:
1178         (WebCore::AbstractFrame::AbstractFrame):
1179         * page/AbstractFrame.h:
1180         (WebCore::AbstractFrame::windowProxy):
1181         (WebCore::AbstractFrame::windowProxy const):
1182         * page/Page.cpp:
1183         (WebCore::Page::setDebugger):
1184         * page/RemoteDOMWindow.cpp:
1185         (WebCore::RemoteDOMWindow::self const):
1186         (WebCore::RemoteDOMWindow::top const):
1187         (WebCore::RemoteDOMWindow::opener const):
1188         (WebCore::RemoteDOMWindow::parent const):
1189         * page/RemoteDOMWindow.h:
1190
1191 2018-04-18  Chris Dumez  <cdumez@apple.com>
1192
1193         Set RemoteDOMWindow's initial opener
1194         https://bugs.webkit.org/show_bug.cgi?id=184716
1195
1196         Reviewed by Sam Weinig.
1197
1198         Add support for WindowProxy type in the IDL. The implementation should
1199         return a WindowProxyController and toJS() will take care of converting
1200         this into a JSValue via JSDOMWindowProxy.
1201
1202         No new tests, rebaselined existing test.
1203
1204         * WebCore.xcodeproj/project.pbxproj:
1205         * bindings/IDLTypes.h:
1206         * bindings/js/JSDOMConvertWindowProxy.h: Added.
1207         (WebCore::JSConverter<IDLWindowProxy>::convert):
1208         * bindings/js/JSDOMWindowBase.cpp:
1209         (WebCore::toJS):
1210         * bindings/js/JSDOMWindowBase.h:
1211         (WebCore::toJS):
1212         * bindings/js/JSDOMWindowProxy.cpp:
1213         (WebCore::toJS):
1214         (WebCore::toJSDOMWindowProxy):
1215         * bindings/js/JSDOMWindowProxy.h:
1216         (WebCore::toJS):
1217         (WebCore::toJSDOMWindowProxy):
1218         * bindings/js/JSRemoteDOMWindowBase.cpp:
1219         * bindings/js/JSRemoteDOMWindowBase.h:
1220         * bindings/scripts/CodeGenerator.pm:
1221         (IsBuiltinType):
1222         * bindings/scripts/CodeGeneratorJS.pm:
1223         (AddToIncludesForIDLType):
1224         (GetBaseIDLType):
1225         * page/RemoteDOMWindow.cpp:
1226         (WebCore::RemoteDOMWindow::self const):
1227         (WebCore::RemoteDOMWindow::top const):
1228         (WebCore::RemoteDOMWindow::opener const):
1229         (WebCore::RemoteDOMWindow::parent const):
1230         * page/RemoteDOMWindow.h:
1231         * page/RemoteDOMWindow.idl:
1232         * page/RemoteFrame.h:
1233
1234 2018-04-18  Dean Jackson  <dino@apple.com>
1235
1236         Detect system preview links
1237         https://bugs.webkit.org/show_bug.cgi?id=184753
1238         <rdar://problem/39500514>
1239
1240         Reviewed by Antoine Quint.
1241
1242         Detect a special type of link anchor, which we're calling System Previews.
1243         Ultimately this will allow WebKit to present such links in a special
1244         way.
1245
1246         A System Preview link is an <a> element, with a rel attribute that
1247         includes "system-preview". It has a single element child, which is
1248         either an <img> or a <picture>.
1249
1250         Test: system-preview/detection.html
1251
1252         * html/HTMLAnchorElement.cpp:
1253         (WebCore::HTMLAnchorElement::relList): Add braces.
1254         (WebCore::HTMLAnchorElement::isSystemPreviewLink const): New
1255         function.
1256         * html/HTMLAnchorElement.h:
1257
1258         * html/HTMLImageElement.cpp:
1259         (WebCore::HTMLImageElement::isSystemPreviewImage const): Ask the
1260         parent if it is a system preview link.
1261         * html/HTMLImageElement.h:
1262         * html/HTMLPictureElement.cpp:
1263         (WebCore::HTMLPictureElement::isSystemPreviewImage const): Ditto.
1264         * html/HTMLPictureElement.h:
1265
1266         * testing/Internals.cpp: Testing helpers.
1267         (WebCore::Internals::systemPreviewRelType):
1268         (WebCore::Internals::isSystemPreviewLink const):
1269         (WebCore::Internals::isSystemPreviewImage const):
1270         * testing/Internals.h:
1271         * testing/Internals.idl:
1272
1273 2018-04-18  Antti Koivisto  <antti@apple.com>
1274
1275         :active pseudo class doesn't deactivate when using pressure sensitive trackpad
1276         https://bugs.webkit.org/show_bug.cgi?id=181680
1277
1278         Reviewed by Beth Dakin.
1279
1280         Trackpad sends a mouse force event with force of zero after mouse up event. This causes the element under cursor
1281         activate again.
1282
1283         Even a fake event test doesn't appear to be currently possible as TestRunner crashes if you try to send mouseForceChanged.
1284         All the tests using it are skipped.
1285
1286         * page/EventHandler.cpp:
1287         (WebCore::EventHandler::handleMouseForceEvent):
1288
1289         Don't add HitTestRequest::Active if the force of the force event is zero.
1290
1291 2018-04-18  Megan Gardner  <megan_gardner@apple.com>
1292
1293         Ensure correct screen sizes
1294         https://bugs.webkit.org/show_bug.cgi?id=184757
1295         
1296         Reviewed by Wenson Hsieh.
1297         
1298         Make sure that the screen sizes are actually correct.
1299
1300         Not currently testable, will add tests when it is.
1301
1302         * platform/ios/PlatformScreenIOS.mm:
1303
1304 2018-04-18  Nan Wang  <n_wang@apple.com>
1305
1306         AX: [macOS] WebKit hangs when triggering an alert from an AOM increment event
1307         https://bugs.webkit.org/show_bug.cgi?id=184742
1308
1309         Reviewed by Chris Fleizach.
1310
1311         Made increment and decrement actions on the macOS to be async. So that VoiceOver
1312         won't hang indefinitely if performing the actions causes an alert or other modal
1313         behaviors.
1314
1315         Test: accessibility/mac/async-increment-decrement-action.html
1316
1317         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1318         (-[WebAccessibilityObjectWrapper accessibilityPerformIncrementAction]):
1319         (-[WebAccessibilityObjectWrapper _accessibilityPerformIncrementAction]):
1320         (-[WebAccessibilityObjectWrapper accessibilityPerformDecrementAction]):
1321         (-[WebAccessibilityObjectWrapper _accessibilityPerformDecrementAction]):
1322         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
1323
1324 2018-04-18  Youenn Fablet  <youenn@apple.com>
1325
1326         MediaResourceLoader should set its fetch destination
1327         https://bugs.webkit.org/show_bug.cgi?id=184746
1328
1329         Reviewed by Eric Carlson.
1330
1331         Covered by updated test.
1332
1333         * loader/MediaResourceLoader.cpp:
1334         (WebCore::MediaResourceLoader::requestResource):
1335
1336 2018-04-18  Jer Noble  <jer.noble@apple.com>
1337
1338         Fix runtime errors in simulator while playing media
1339         https://bugs.webkit.org/show_bug.cgi?id=184751
1340
1341         Reviewed by Eric Carlson.
1342
1343         AVURLAssetHTTPCookiesKey may not be present, and AVPlayer may not respond to certain methods.
1344
1345         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1346         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1347         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1348         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
1349         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
1350
1351 2018-04-18  Jer Noble  <jer.noble@apple.com>
1352
1353         Ignore ASSERT when setting AVAudioSessionCategory returns an error on simulator.
1354         https://bugs.webkit.org/show_bug.cgi?id=184698
1355
1356         Reviewed by Eric Carlson.
1357
1358         * platform/audio/ios/AudioSessionIOS.mm:
1359         * platform/audio/mac/AudioSessionMac.cpp:
1360
1361 2018-04-18  Sihui Liu  <sihui_liu@apple.com>
1362
1363         REGRESSION: Using the reload button while offline pushes identical pages onto the back/forward list
1364         https://bugs.webkit.org/show_bug.cgi?id=184570
1365         <rdar://problem/34807323>
1366
1367         Reviewed by Chris Dumez.
1368
1369         Set FrameLoadType properly when error occurs in reload.
1370
1371         tests: Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadAlternateHTMLString.mm
1372
1373         * loader/FrameLoader.cpp:
1374         (WebCore::FrameLoader::load):
1375
1376 2018-04-18  Chris Dumez  <cdumez@apple.com>
1377
1378         Add support for converting a local window to a remote window
1379         https://bugs.webkit.org/show_bug.cgi?id=184515
1380         <rdar://problem/39011318>
1381
1382         Reviewed by Ryosuke Niwa.
1383
1384         Add initial support for process-swapping when navigating cross-origin as a result
1385         of a window.open(). The window object returned by window.open() is initially same
1386         origin and is for about:blank. The navigation cross-origin then happens and the
1387         JS wrappers for the window then point to a cross-origin window which is remote (i.e.
1388         hosted in another WebProcess).
1389
1390         The RemoteDOMWindow exposed to JS looks like a regular cross-origin Window with a few
1391         exceptions due to our incomplete implementation (e.g. w.location returns null) and 
1392         most of its API is currently not functional. The RemoteDOMWindow API will be implemented
1393         in a follow-up by relying on IPC.
1394
1395         Test: http/tests/navigation/process-swap-window-open.html
1396
1397         * bindings/js/JSDOMGlobalObject.cpp:
1398         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
1399         * bindings/js/JSDOMPromiseDeferred.h:
1400         * bindings/js/JSDOMWindowProperties.cpp:
1401         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
1402         * bindings/js/JSDOMWindowProxy.cpp:
1403         (WebCore::JSDOMWindowProxy::finishCreation):
1404         (WebCore::JSDOMWindowProxy::create):
1405         * bindings/js/JSDOMWindowProxy.h:
1406         * bindings/js/JSDOMWrapper.cpp:
1407         (WebCore::JSDOMObject::JSDOMObject):
1408         * bindings/js/JSDOMWrapper.h:
1409         * bindings/js/WindowProxyController.cpp:
1410         (WebCore::WindowProxyController::createWindowProxy):
1411         (WebCore::WindowProxyController::setDOMWindowForWindowProxy):
1412         * bridge/objc/WebScriptObject.mm:
1413         (-[WebScriptObject _isSafeScript]):
1414         Teach more of our bindings code about RemoteDOMWindows.
1415
1416         * dom/Document.cpp:
1417         (WebCore::Document::createDOMWindow):
1418         * loader/FrameLoaderClient.h:
1419         Add FrameLoaderClient function to notify the client when a DOMWindow is constructed in
1420         the frame. This is needed for WebKit2 to link the old window to its new representation
1421         in the new WebProcess.
1422
1423 2018-04-17  Zan Dobersek  <zdobersek@igalia.com>
1424
1425         [CMake] Add and enable the ENABLE_CSS_ANIMATIONS_LEVEL_2 feature define
1426         https://bugs.webkit.org/show_bug.cgi?id=184681
1427
1428         Reviewed by Carlos Garcia Campos.
1429
1430         * Sources.txt: Include CSSAnimationTriggerScrollValue.cpp in the build.
1431         * WebCore.xcodeproj/project.pbxproj: Remove CSSAnimationTriggerScrollValue.cpp
1432         build target now that it's built via Sources.txt.
1433
1434 2018-04-17  Zan Dobersek  <zdobersek@igalia.com>
1435
1436         [CoordGraphics] CoordinatedImageBacking can simplify image drawing
1437         https://bugs.webkit.org/show_bug.cgi?id=183986
1438
1439         Reviewed by Michael Catanzaro.
1440
1441         In CoordinatedImageBacking::update(), when drawing the image into a
1442         freshly-created image backing, we can avoid save-and-restoring the
1443         painting context. We also don't have to clip it, since the clipping area
1444         is the same as the image (and buffer) bounds. Since the buffer is
1445         initialized to transparent color, we can use the CompositeCopy operator
1446         to just copy image data into the destination since there's nothing to
1447         paint the source over.
1448
1449         No new tests -- no change in functionality.
1450
1451         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
1452         (WebCore::CoordinatedImageBacking::update):
1453
1454 2018-04-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1455
1456         [GTK] Webkit should spoof as Safari on a Mac for Outlook.com
1457         https://bugs.webkit.org/show_bug.cgi?id=184573
1458
1459         Reviewed by Carlos Alberto Lopez Perez.
1460
1461         Add quirk for outlook.live.com.
1462
1463         * platform/UserAgentQuirks.cpp:
1464         (WebCore::urlRequiresMacintoshPlatform):
1465
1466 2018-04-17  Mark Lam  <mark.lam@apple.com>
1467
1468         Templatize CodePtr/Refs/FunctionPtrs with PtrTags.
1469         https://bugs.webkit.org/show_bug.cgi?id=184702
1470         <rdar://problem/35391681>
1471
1472         Reviewed by Filip Pizlo and Saam Barati.
1473
1474         No new tests. This is covered by existing tests.
1475
1476         * WebCore.xcodeproj/project.pbxproj:
1477         * css/ElementRuleCollector.cpp:
1478         (WebCore::ElementRuleCollector::ruleMatches):
1479         * cssjit/CSSPtrTag.h: Added.
1480         * cssjit/CompiledSelector.h:
1481         * cssjit/FunctionCall.h:
1482         (WebCore::FunctionCall::FunctionCall):
1483         (WebCore::FunctionCall::setFunctionAddress):
1484         (WebCore::FunctionCall::prepareAndCall):
1485         * cssjit/SelectorCompiler.cpp:
1486         (WebCore::SelectorCompiler::compileSelector):
1487         (WebCore::SelectorCompiler::SelectorFragment::appendUnoptimizedPseudoClassWithContext):
1488         (WebCore::SelectorCompiler::addPseudoClassType):
1489         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
1490         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
1491         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementFunctionCallTest):
1492         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateContextFunctionCallTest):
1493         * cssjit/SelectorCompiler.h:
1494         (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
1495         (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
1496         (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
1497         (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
1498         * dom/SelectorQuery.cpp:
1499         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
1500         (WebCore::SelectorDataList::execute const):
1501         * dom/SelectorQuery.h:
1502
1503 2018-04-17  Tadeu Zagallo  <tzagallo@apple.com>
1504
1505         Retain MessagePortChannel for transfer when disentangling ports
1506         https://bugs.webkit.org/show_bug.cgi?id=184502
1507         <rdar://problem/39372771>
1508
1509         Reviewed by Geoffrey Garen.
1510
1511         MessagePortChannels should be retained while ports are being transferred, but that was only
1512         happening when sending a port through another port, but not when sending it through a worker.
1513
1514         Test: workers/worker-to-worker.html
1515
1516         * dom/messageports/MessagePortChannel.cpp:
1517         (WebCore::MessagePortChannel::entanglePortWithProcess):
1518         (WebCore::MessagePortChannel::disentanglePort):
1519         (WebCore::MessagePortChannel::postMessageToRemote):
1520         (WebCore::MessagePortChannel::takeAllMessagesForPort):
1521
1522 2018-04-17  Tadeu Zagallo  <tzagallo@apple.com>
1523
1524         References from CSSStyleDeclaration to CSSValues should be weak
1525         https://bugs.webkit.org/show_bug.cgi?id=180280
1526         <rdar://problem/35804869>
1527
1528         Reviewed by Geoffrey Garen.
1529
1530         No new tests - used the existing test to verify the leak
1531
1532         * css/DeprecatedCSSOMValue.h:
1533         (WebCore::DeprecatedCSSOMValue::weakPtrFactory):
1534         * css/PropertySetCSSStyleDeclaration.cpp:
1535         (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
1536         * css/PropertySetCSSStyleDeclaration.h:
1537
1538 2018-04-17  Jonathan Bedard  <jbedard@apple.com>
1539
1540         Unreviewed rollout of r230632. Regression in memory usage.
1541
1542         That bug tracked in https://bugs.webkit.org/show_bug.cgi?id=184569.
1543
1544         Tests: animations/animation-internals-api-multiple-keyframes.html
1545                animations/animation-internals-api.html
1546                transitions/transition-drt-api-delay.html
1547                transitions/transition-drt-api.html
1548
1549         * page/RuntimeEnabledFeatures.h:
1550         * testing/Internals.cpp:
1551         (WebCore::Internals::pseudoElement): Deleted.
1552         * testing/Internals.h:
1553         * testing/Internals.idl:
1554
1555 2018-04-17  Tadeu Zagallo  <tzagallo@apple.com>
1556
1557         Do not unregister MessagePorts on deallocation if it has been disentangled
1558         https://bugs.webkit.org/show_bug.cgi?id=184285
1559         <rdar://problem/39256714>
1560
1561         Reviewed by Darin Adler.
1562
1563         Test: workers/message-port-gc.html
1564
1565         * dom/MessagePort.cpp:
1566         (WebCore::MessagePort::deref const):
1567
1568 2018-04-17  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1569
1570         [Curl] Fix timing of reporting error to the client
1571         https://bugs.webkit.org/show_bug.cgi?id=184707
1572
1573         Before checking the result code, check the status of callback invocation and
1574         do the right thing.
1575
1576         Reviewed by Youenn Fablet.
1577
1578         No new tests because there's no new behavior.
1579
1580         * platform/network/curl/CurlRequest.cpp:
1581         (WebCore::CurlRequest::didCompleteTransfer):
1582         * platform/network/curl/CurlRequest.h:
1583         (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
1584
1585 2018-04-17  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1586
1587         [Curl] Export authentication information to be used by the client.
1588         https://bugs.webkit.org/show_bug.cgi?id=184709
1589
1590         Just added getters for username and password member variables.
1591
1592         Reviewed by Alex Christensen.
1593
1594         No new tests because there's no new behavior.
1595
1596         * platform/network/curl/CurlRequest.h:
1597         (WebCore::CurlRequest::user const):
1598         (WebCore::CurlRequest::password const):
1599
1600 2018-04-17  Chris Dumez  <cdumez@apple.com>
1601
1602         REGRESSION (r229831): CMD-clicking an iCloud web app link unexpectedly opens that link in a new tab and the current tab
1603         https://bugs.webkit.org/show_bug.cgi?id=184678
1604         <rdar://problem/39422122>
1605
1606         Reviewed by Alex Christensen.
1607
1608         Frament navigations need to happen synchronously for Web-compatibility. Because of this,
1609         r225657 added code to make sure that if the client does not make the navigation policy
1610         decision synchronously for frament navigations, then we'll stop waiting for the client
1611         and proceed with the navigation. However, r229831 make the navigation policy decision
1612         IPC decision, meaning that even if the client responds synchronously, it would be
1613         asynchronously from WebCore's point of view. As a result, we would always ignore the
1614         client's policy decision when doing a fragment navigation.
1615
1616         This is an issue on iclould.com because the web-app links are fragment URLs. When you
1617         CMD+click one of these link, we do the navigation policy check. As a result of this
1618         check, Safari responds IGNORE to the policy decision and instead decides to load the
1619         link in a new tab (because CMD key is pressed). Due to the bug mentioned above, we
1620         would not obey the IGNORE policy decision from Safari and load the link in the current
1621         tab, even though Safari would already be loading it in a new tab.
1622
1623         To address the issue, I reintroduced a synchronous code path for navigation policy
1624         decision making, backed by synchronous IPC. This synchronous code path is now used for
1625         fragment navigations to restore pre-r229831 behavior. If the client does not answer
1626         synchronously, we'll proceed with the navigation anyway, as was happening pre-r229831.
1627
1628         Test: http/tests/navigation/fragment-navigation-policy-ignore.html
1629
1630         * loader/EmptyClients.cpp:
1631         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1632         * loader/EmptyFrameLoaderClient.h:
1633         * loader/FrameLoader.cpp:
1634         (WebCore::FrameLoader::loadURL):
1635         (WebCore::FrameLoader::loadWithDocumentLoader):
1636         * loader/FrameLoaderClient.h:
1637         * loader/PolicyChecker.cpp:
1638         (WebCore::PolicyChecker::checkNavigationPolicy):
1639         * loader/PolicyChecker.h:
1640
1641 2018-04-17  Matt Lewis  <jlewis3@apple.com>
1642
1643         Unreviewed, rolling out r230713.
1644
1645         This caused internal build failures.
1646
1647         Reverted changeset:
1648
1649         "Implement checked cast for DDResultRef once
1650         DDResultGetTypeID() is available"
1651         https://bugs.webkit.org/show_bug.cgi?id=184554
1652         https://trac.webkit.org/changeset/230713
1653
1654 2018-04-17  Chris Dumez  <cdumez@apple.com>
1655
1656         Add bindings code for RemoteDOMWindow
1657         https://bugs.webkit.org/show_bug.cgi?id=184653
1658
1659         Reviewed by Ryosuke Niwa.
1660
1661         Add bindings code for RemoteDOMWindow. A RemoteDOMWindow behaves exactly like a cross-origin
1662         DOMWindow, which is backed by a RemoteDOMWindow object instead of a DOMWindow one. Since
1663         a RemoteDOMWindow is always cross origin, we do not need cross-origin checks and the bindings
1664         code is identical to the DOMWindow code paths from cross-origin handling.
1665
1666         No new tests, this code will be used and tested via Bug 184515.
1667
1668         * CMakeLists.txt:
1669         * DerivedSources.make:
1670         * Sources.txt:
1671         * WebCore.xcodeproj/project.pbxproj:
1672         * bindings/js/JSBindingsAllInOne.cpp:
1673         * bindings/js/JSDOMWindowCustom.cpp:
1674         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1675         (WebCore::JSDOMWindow::getOwnPropertySlot):
1676         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1677         (WebCore::addCrossOriginWindowOwnPropertyNames):
1678         * bindings/js/JSDOMWindowCustom.h:
1679
1680         * bindings/js/JSRemoteDOMWindowBase.cpp: Added.
1681         (WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase):
1682         (WebCore::JSRemoteDOMWindowBase::destroy):
1683         (WebCore::JSRemoteDOMWindowBase::javaScriptRuntimeFlags):
1684         (WebCore::toJS):
1685         (WebCore::toJSRemoteDOMWindow):
1686         * bindings/js/JSRemoteDOMWindowBase.h: Added.
1687         JSRemoteDOMWindow unfortunately currently needs to be a global object because of:
1688         1. a JSProxy's target needs to be a JSGlobalObject currently
1689         2. The 'structure()->setGlobalObject(vm, &window);' call in
1690            JSDOMWindowProxy::setWindow(VM&, JSDOMGlobalObject&) which requires a JSGlobalObject.
1691         Ideally, this wouldn't be the case in the future but this would require some code refactoring.
1692         Our DOM global objects normally subclass JSDOMGlobalObject so I decided to subclass JSDOMGlobalObject,
1693         which brings some things our bindings code expect. However, subclassing JSDOMGlobalObject directly is
1694         problematic because it does not hold the m_wrapped implementation pointer. To address this issue, all
1695         our our DOM global objects have a JS*Base base class which subclasses JSDOMGlobalObject and stores the
1696         m_wrapped implementation pointer. I followed the same pattern here.
1697
1698         (WebCore::toJS):
1699         * bindings/js/JSRemoteDOMWindowCustom.cpp: Added.
1700         (WebCore::JSRemoteDOMWindow::getOwnPropertySlot):
1701         (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex):
1702         (WebCore::JSRemoteDOMWindow::put):
1703         (WebCore::JSRemoteDOMWindow::putByIndex):
1704         (WebCore::JSRemoteDOMWindow::deleteProperty):
1705         (WebCore::JSRemoteDOMWindow::deletePropertyByIndex):
1706         (WebCore::JSRemoteDOMWindow::getOwnPropertyNames):
1707         (WebCore::JSRemoteDOMWindow::defineOwnProperty):
1708         (WebCore::JSRemoteDOMWindow::getPrototype):
1709         (WebCore::JSRemoteDOMWindow::preventExtensions):
1710         (WebCore::JSRemoteDOMWindow::toStringName):
1711         * bindings/scripts/CodeGeneratorJS.pm:
1712         (IsDOMGlobalObject):
1713         (GenerateHeader):
1714         (GenerateOverloadDispatcher):
1715         (GenerateImplementation):
1716         * page/RemoteDOMWindow.idl: Added.
1717
1718 2018-04-17  David Kilzer  <ddkilzer@apple.com>
1719
1720         Implement checked cast for DDResultRef once DDResultGetTypeID() is available
1721         <https://webkit.org/b/184554>
1722         <rdar://problem/36241894>
1723
1724         Reviewed by Brent Fulgham.
1725
1726         * editing/cocoa/DataDetection.mm:
1727         (WebCore::detectItemAtPositionWithRange): Implement checked cast
1728         for DDResultRef.
1729
1730 2018-04-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
1731
1732         Animated GIF imagery with finite looping are falling one loop short
1733         https://bugs.webkit.org/show_bug.cgi?id=183153
1734
1735         Reviewed by Simon Fraser.
1736
1737         The Netscape Looping Application Extension is a block which may be added
1738         to a GIF file to tell the viewer to loop through the entire GIF frames.
1739         This is communicated through two bytes designated for the "loopCount" in
1740         this block.
1741
1742         The entire block may not be found in the GIF, in which case the GIF is 
1743         supposed to animate its entire frames only once.
1744
1745         If the block exists and loopCount = 0, this means the image has to loop
1746         through its frames indefinitely.
1747
1748         If the block exist and loopCount > 0, this should mean the image has to
1749         loop through its frames loopCount + 1 times. The extra loop seems to be
1750         the consensus among most of the GIF generators and viewers. For example,
1751         if the image designer wants the image to loop through its frames n times:
1752         -- The GIF generator (e.g. Adobe Photoshop and https://ezgif.com/maker) 
1753            will write n - 1 for loopCount. However http://gifmaker.me and 
1754            http://gifmaker.org write n for loopCount.
1755         -- The browser (e.g. Chrome 65.0.3325 181 and FireFox Quantum 59.0.2) will
1756            translate loopCount = n - 1 to: animate GIF once + loop n - 1, which 
1757            means loop the GIF n times.
1758
1759         Because the specs are not really clear about this, we are going to consider
1760         the agreed-upon behavior among most of the web browsers the specs here.
1761
1762         * platform/graphics/cg/ImageDecoderCG.cpp:
1763         (WebCore::ImageDecoderCG::repetitionCount const):
1764         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1765         (WebCore::GIFImageDecoder::repetitionCount const):
1766
1767 2018-04-17  Saam Barati  <sbarati@apple.com>
1768
1769         Add system trace points for process launch and for initializeWebProcess
1770         https://bugs.webkit.org/show_bug.cgi?id=184669
1771
1772         Reviewed by Simon Fraser.
1773
1774         No testing needed because there is no new functionality here.
1775
1776         * loader/FrameLoader.cpp:
1777         (WebCore::FrameLoader::provisionalLoadStarted):
1778         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1779         * loader/SubresourceLoader.cpp:
1780         (WebCore::SubresourceLoader::willSendRequestInternal):
1781         (WebCore::SubresourceLoader::didFinishLoading):
1782         (WebCore::SubresourceLoader::didFail):
1783         (WebCore::SubresourceLoader::didCancel):
1784
1785 2018-04-17  Eric Carlson  <eric.carlson@apple.com>
1786
1787         [iOS] AirPlay device name is sometimes wrong
1788         https://bugs.webkit.org/show_bug.cgi?id=184543
1789         <rdar://problem/39105498>
1790
1791         Reviewed by Jer Noble.
1792
1793         No new tests, this can only be tested with a specific hardware setup.
1794
1795         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1796         (WebCore::exernalDeviceDisplayNameForPlayer): Get the device name from the AVOutputContext
1797         when possible.
1798
1799 2018-04-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1800
1801         [GTK] Build fix after r230529 (WaylandCompositorDisplay leaks its wl_display)
1802         https://bugs.webkit.org/show_bug.cgi?id=184406
1803
1804         Rubber-stamped by Michael Catanzaro.
1805
1806         Fix build with clang 3.8
1807
1808         No new tests, it is a build fix.
1809
1810         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1811         (WebCore::PlatformDisplayWayland::create):
1812
1813 2018-04-16  Antoine Quint  <graouts@apple.com>
1814
1815         Layout Test animations/needs-layout.html is a flaky Image Failure.
1816         https://bugs.webkit.org/show_bug.cgi?id=172397
1817
1818         Reviewed by Dean Jackson.
1819
1820         Animations that animate a transform and uses a relative value for either the x or y components
1821         require a layout before starting, which CSSAnimationController would perform in the call to
1822         CSSAnimationControllerPrivate::animationTimerFired() made immediately after a CSS animation was
1823         created.
1824
1825         We now perform a similar task where upon setting new blending keyframes we compute a flag indicating
1826         if the keyframe effect is animating a transform with relative x or y components. Then, when we perform
1827         the first invalidation task, which runs in the next run loop after a change to the timing model has
1828         been made, such as a call to play() on a CSSAnimation made in the TreeResolver::createAnimatedElementUpdate()
1829         where the CSSAnimation was created, we call forceLayout() on this element's FrameView. We also ensure
1830         we commit animations on the compositor immediately after that too, instead of waiting until the next
1831         DisplayRefreshMonitor callback.
1832
1833         * animation/DocumentTimeline.cpp:
1834         (WebCore::DocumentTimeline::performInvalidationTask):
1835         (WebCore::DocumentTimeline::updateAnimations):
1836         * animation/KeyframeEffectReadOnly.cpp:
1837         (WebCore::KeyframeEffectReadOnly::forceLayoutIfNeeded):
1838         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
1839         (WebCore::KeyframeEffectReadOnly::computedNeedsForcedLayout):
1840         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
1841         * animation/KeyframeEffectReadOnly.h:
1842
1843 2018-04-16  Pablo Saavedra  <psaavedra@igalia.com>
1844
1845         Inconsistent EGL defines in ImageBufferCairo
1846         https://bugs.webkit.org/show_bug.cgi?id=184661
1847
1848         Reviewed by Žan Doberšek.
1849
1850         On revision r219391 libepoxy is added. The headers in
1851         ImageBufferCairo.cpp become inconsistent when 2D canvas is enabled
1852         (-DENABLE_ACCELERATED_2D_CANVAS=ON) due to a redefinition error during
1853         the Webkit build:
1854
1855             ...
1856             /usr/include/GLES2/gl2.h:503:82: error: 'voi
1857             epoxy_glAttachShader(GLuint, GLuint)' redeclared as different kind
1858             of symbol
1859             GL_APICALL void         GL_APIENTRY glAttachShader (GLuint
1860             program, GLuint shader);
1861
1862         No new tests.
1863
1864         * platform/graphics/cairo/ImageBufferCairo.cpp:
1865
1866 2018-04-16  Filip Pizlo  <fpizlo@apple.com>
1867
1868         MutationObserver should be in an IsoHeap
1869         https://bugs.webkit.org/show_bug.cgi?id=184671
1870         <rdar://problem/36081981>
1871
1872         Reviewed by Sam Weinig.
1873
1874         No new tests because no new behavior.
1875
1876         * dom/MutationObserver.cpp:
1877         * dom/MutationObserver.h:
1878
1879 2018-04-16  Youenn Fablet  <youenn@apple.com>
1880
1881         Use NetworkLoadChecker to handle synchronous HTTP loads
1882         https://bugs.webkit.org/show_bug.cgi?id=184240
1883
1884         Reviewed by Chris Dumez.
1885
1886         Update LoaderStrategy::loadResourceSynchronously to pass FetchOptions directly.
1887         Update various call sites accordingly. This allows NetworkProcess to do all necessary checks.
1888         Add an option to disable security checks if NetworkProcess does it for WebProcess.
1889         This option will be also used for regular asynchronous loads in future patches.
1890
1891         Update DocumentThreadableLoader to bypass preflighting and response validation checks in case they are done in NetworkProcess.
1892
1893         Covered by existing and rebased tests.
1894
1895         * loader/CrossOriginPreflightChecker.cpp:
1896         (WebCore::CrossOriginPreflightChecker::doPreflight):
1897         * loader/DocumentThreadableLoader.cpp:
1898         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1899         (WebCore::DocumentThreadableLoader::loadRequest):
1900         * loader/FrameLoader.cpp:
1901         (WebCore::FrameLoader::loadResourceSynchronously):
1902         * loader/FrameLoader.h:
1903         * loader/LoaderStrategy.h:
1904         * xml/XSLTProcessorLibxslt.cpp:
1905         (WebCore::docLoaderFunc):
1906         * xml/parser/XMLDocumentParserLibxml2.cpp:
1907         (WebCore::openFunc):
1908
1909 2018-04-16  Christopher Reid  <chris.reid@sony.com>
1910
1911         [WinCairo] Media elements should be enabled by default
1912         https://bugs.webkit.org/show_bug.cgi?id=184597
1913
1914         Reviewed by Per Arne Vollan.
1915
1916         Enabling media elements by default with media foundation.
1917
1918         * page/SettingsDefaultValues.h:
1919
1920 2018-04-16  Christopher Reid  <chris.reid@sony.com>
1921
1922         [Curl] Add the Accept-Language field to curl request headers
1923         https://bugs.webkit.org/show_bug.cgi?id=184605
1924
1925         Reviewed by Alex Christensen.
1926
1927         Add Accept-Language field to curl request headers
1928
1929         * platform/network/curl/CurlRequest.cpp:
1930         * platform/network/curl/CurlRequest.h:
1931
1932 2018-04-16  Chris Dumez  <cdumez@apple.com>
1933
1934         Move more WindowProxy-related logic from ScriptController to WindowProxyController
1935         https://bugs.webkit.org/show_bug.cgi?id=184640
1936
1937         Reviewed by Ryosuke Niwa.
1938
1939         Move more WindowProxy-related logic from ScriptController to WindowProxyController,
1940         for clarity.
1941
1942         * bindings/js/JSDOMWindowProxy.cpp:
1943         (WebCore::JSDOMWindowProxy::attachDebugger):
1944         * bindings/js/JSDOMWindowProxy.h:
1945         * bindings/js/ScriptCachedFrameData.cpp:
1946         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
1947         (WebCore::ScriptCachedFrameData::restore):
1948         * bindings/js/ScriptController.cpp:
1949         (WebCore::ScriptController::~ScriptController):
1950         (WebCore::ScriptController::initScriptForWindowProxy):
1951         * bindings/js/ScriptController.h:
1952         (WebCore::ScriptController::existingCacheableBindingRootObject const):
1953         * bindings/js/WindowProxyController.cpp:
1954         (WebCore::collectGarbageAfterWindowProxyDestruction):
1955         (WebCore::WindowProxyController::~WindowProxyController):
1956         (WebCore::WindowProxyController::clearWindowProxiesNotMatchingDOMWindow):
1957         (WebCore::WindowProxyController::setDOMWindowForWindowProxy):
1958         (WebCore::WindowProxyController::attachDebugger):
1959         * bindings/js/WindowProxyController.h:
1960         * loader/FrameLoader.cpp:
1961         (WebCore::FrameLoader::clear):
1962         * page/Page.cpp:
1963         (WebCore::Page::setDebugger):
1964
1965 2018-04-16  Thibault Saunier  <tsaunier@igalia.com>
1966
1967         [GStreamer] Set *TrackPrivateGStreamer::active based on GstStream default select in constructor
1968         https://bugs.webkit.org/show_bug.cgi?id=184652
1969
1970         Reviewed by Philippe Normand.
1971
1972         In the constructor we should mark selected streams based on the default values from GstStream,
1973         if the user changes them, they will be updated as required later on.
1974
1975         No new tests are added as we already have a few ones that are currently disabled in
1976         the mediastream testsuite. This patch is part of the work to enable them.
1977
1978         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
1979         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
1980         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
1981         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
1982
1983 2018-04-16  Thibault Saunier  <tsaunier@igalia.com>
1984
1985         [GStreamer] Set TrackPrivateBaseGStreamer metadata information even if no client is avalaible
1986         https://bugs.webkit.org/show_bug.cgi?id=184651
1987
1988         Reviewed by Philippe Normand.
1989
1990         We can't notify the client if none is connected, but still we need to fill our metadatas from
1991         the provided GstTagList, especially in the case of playbin3 where the client is not set yet
1992         at construct time but the metadata might already be preset (and won't be updated later on).
1993
1994         No new tests are added as we already have a few ones that are currently disabled in
1995         the mediastream testsuite. This patch is part of the work to enable them.
1996
1997         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1998         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
1999
2000 2018-04-16  Antoine Quint  <graouts@apple.com>
2001
2002         [Web Animations] Ensure we never return -0 through the API
2003         https://bugs.webkit.org/show_bug.cgi?id=184644
2004
2005         Reviewed by Dean Jackson.
2006
2007         We could sometimes return -0 instead of 0, which is surprising and leads to an error in WPT tests.
2008         This would happen when playbackRate < 0.
2009
2010         * animation/WebAnimationUtilities.h:
2011         (WebCore::secondsToWebAnimationsAPITime):
2012
2013 2018-04-15  Antoine Quint  <graouts@apple.com>
2014
2015         [Web Animations] Animations do not naturally get a finish event
2016         https://bugs.webkit.org/show_bug.cgi?id=184639
2017         <rdar://problem/39397649>
2018
2019         Reviewed by Jon Lee.
2020
2021         We must call updateFinishedState() when an animation gets sampled as it means its timeline's time has progressed
2022         and it may have crossed to a finished state. Calling updateFinishedState() when sampling means that we'll correctly
2023         set the animation's hold time to its end value, which means that currentTime() will now always be clamped to return
2024         the end time once its has reached it, so we must not schedule animations to resolve immediately anymore since otherwise
2025         they will keep being scheduled in a loop.
2026
2027         * animation/WebAnimation.cpp:
2028         (WebCore::WebAnimation::timeToNextRequiredTick const):
2029         (WebCore::WebAnimation::resolve):
2030
2031 2018-04-15  Chris Dumez  <cdumez@apple.com>
2032
2033         Change Event's returnValue so it doesn't expose a new primitive
2034         https://bugs.webkit.org/show_bug.cgi?id=184415
2035
2036         Reviewed by Darin Adler.
2037
2038         Update Event.returnValue setter to match the latest DOM specification after:
2039         - https://github.com/whatwg/dom/pull/626
2040
2041         In particular, the returnValue setter is now a no-op if the new flag value
2042         is true. If the input flag value is false, it only sets the 'canceled' flag
2043         if the event is cancelable and the event’s in passive listener flag is unset.
2044
2045         Test: imported/w3c/web-platform-tests/dom/events/Event-returnValue.html
2046
2047         * dom/Event.cpp:
2048         (WebCore::Event::setLegacyReturnValue):
2049         (WebCore::Event::setCanceledFlagIfPossible):
2050         (WebCore::Event::preventDefault):
2051         * dom/Event.h:
2052
2053 2018-04-14  Thibault Saunier  <tsaunier@igalia.com>
2054
2055         [GStreamer] Expose a method to retrieve the GstStream from a TrackPrivateBaseGStreamer
2056         https://bugs.webkit.org/show_bug.cgi?id=184620
2057
2058         Reviewed by Philippe Normand.
2059
2060         This is a minor change, a dedicated test doesn't really make sense here.
2061
2062         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2063         (WebCore::TrackPrivateBaseGStreamer::stream):
2064
2065 2018-04-13  Ryosuke Niwa  <rniwa@webkit.org>
2066
2067         WebKit crashes when libwebrtc.dylib is missing
2068         https://bugs.webkit.org/show_bug.cgi?id=184607
2069
2070         Rubber-stamped by Jer Noble.
2071
2072         Don't call LibWebRTC related code when libwebrtc is not available.
2073
2074         * dom/Document.cpp:
2075         (WebCore::Document::prepareForDestruction):
2076         (WebCore::Document::suspend):
2077
2078 2018-04-13  Chris Dumez  <cdumez@apple.com>
2079
2080         Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame
2081         https://bugs.webkit.org/show_bug.cgi?id=184591
2082
2083         Reviewed by Sam Weinig.
2084
2085         Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame.
2086         RemoteFrames do not need a ScriptController but do need to maintain WindowProxies.
2087         This is work towards fixing Bug 184515.
2088
2089         * Sources.txt:
2090         * WebCore.xcodeproj/project.pbxproj:
2091         * bindings/js/DOMWrapperWorld.cpp:
2092         (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
2093         (WebCore::DOMWrapperWorld::clearWrappers):
2094         * bindings/js/DOMWrapperWorld.h:
2095         (WebCore::DOMWrapperWorld::didCreateWindowProxy):
2096         (WebCore::DOMWrapperWorld::didDestroyWindowProxy):
2097         * bindings/js/JSBindingsAllInOne.cpp:
2098         * bindings/js/JSDOMWindowBase.cpp:
2099         (WebCore::toJSDOMWindow):
2100         * bindings/js/JSDOMWindowProxy.cpp:
2101         (WebCore::toJS):
2102         (WebCore::toJSDOMWindowProxy):
2103         * bindings/js/ScriptCachedFrameData.cpp:
2104         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
2105         (WebCore::ScriptCachedFrameData::restore):
2106         * bindings/js/ScriptController.cpp:
2107         (WebCore::ScriptController::~ScriptController):
2108         (WebCore::ScriptController::evaluateInWorld):
2109         (WebCore::ScriptController::loadModuleScriptInWorld):
2110         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
2111         (WebCore::ScriptController::evaluateModule):
2112         (WebCore::ScriptController::clearWindowProxiesNotMatchingDOMWindow):
2113         (WebCore::ScriptController::setDOMWindowForWindowProxy):
2114         (WebCore::ScriptController::initScriptForWindowProxy):
2115         (WebCore::ScriptController::setupModuleScriptHandlers):
2116         (WebCore::ScriptController::windowProxyController):
2117         (WebCore::ScriptController::enableEval):
2118         (WebCore::ScriptController::enableWebAssembly):
2119         (WebCore::ScriptController::disableEval):
2120         (WebCore::ScriptController::disableWebAssembly):
2121         (WebCore::ScriptController::attachDebugger):
2122         (WebCore::ScriptController::updateDocument):
2123         (WebCore::ScriptController::collectIsolatedContexts):
2124         (WebCore::ScriptController::windowScriptNPObject):
2125         (WebCore::ScriptController::executeIfJavaScriptURL):
2126         * bindings/js/ScriptController.h:
2127         (WebCore::ScriptController::globalObject):
2128         * bindings/js/ScriptControllerMac.mm:
2129         (WebCore::ScriptController::windowScriptObject):
2130         * bindings/js/ScriptState.cpp:
2131         (WebCore::mainWorldExecState):
2132         * bindings/js/WindowProxyController.cpp: Added.
2133         (WebCore::WindowProxyController::WindowProxyController):
2134         (WebCore::WindowProxyController::destroyWindowProxy):
2135         (WebCore::WindowProxyController::createWindowProxy):
2136         (WebCore::WindowProxyController::windowProxies):
2137         (WebCore::WindowProxyController::createWindowProxyWithInitializedScript):
2138         * bindings/js/WindowProxyController.h: Added.
2139         (WebCore::WindowProxyController::releaseWindowProxies):
2140         (WebCore::WindowProxyController::setWindowProxies):
2141         (WebCore::WindowProxyController::windowProxy):
2142         (WebCore::WindowProxyController::existingWindowProxy const):
2143         (WebCore::WindowProxyController::globalObject):
2144         * loader/FrameLoader.cpp:
2145         (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
2146         * page/AbstractFrame.cpp:
2147         (WebCore::AbstractFrame::AbstractFrame):
2148         * page/AbstractFrame.h:
2149         (WebCore::AbstractFrame::windowProxyController):
2150         (WebCore::AbstractFrame::windowProxyController const):
2151
2152 2018-04-13  Brady Eidson  <beidson@apple.com>
2153
2154         Introduce SuspendedPageProxy to keep old web processes around after their WebPageProxy has been swapped to a new one.
2155         https://bugs.webkit.org/show_bug.cgi?id=184559
2156
2157         Reviewed by Alex Christensen.
2158
2159         Covered by new API test.
2160
2161         WebCore changes rework the meaning of a "ForSuspension" policy to simply navigate the page to about:blank.
2162
2163         * loader/DocumentLoader.cpp:
2164         (WebCore::DocumentLoader::redirectReceived):
2165         (WebCore::DocumentLoader::willSendRequest):
2166         (WebCore::DocumentLoader::startLoadingMainResource):
2167         * loader/DocumentLoader.h:
2168
2169         * loader/FrameLoader.cpp:
2170         (WebCore::FrameLoader::init):
2171         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2172
2173 2018-04-13  Chris Dumez  <cdumez@apple.com>
2174
2175         input.webkitEntries does not work as expected when folder contains accented chars
2176         https://bugs.webkit.org/show_bug.cgi?id=184517
2177         <rdar://problem/39265537>
2178
2179         Reviewed by Alex Christensen.
2180
2181         Use String::fromUTF8() to construct a WTF String from the char* returned by
2182         dirname() in FileSystem::directoryName(). Previously, we were just calling
2183         the String constructor, which would treat the input as latin 1 instead of
2184         UTF-8.
2185
2186         Change is covered by an API test rather than a layout test due to file versioning
2187         limitations.
2188
2189         * platform/posix/FileSystemPOSIX.cpp:
2190         (WebCore::FileSystem::directoryName):
2191
2192 2018-04-13  Yusuke Suzuki  <utatane.tea@gmail.com>
2193
2194         [WebCore] Use @getByIdDirectPrivate / @putByIdDirectPrivate in WebCore JS
2195         https://bugs.webkit.org/show_bug.cgi?id=184401
2196
2197         Rubber stamped by Saam Barati.
2198
2199         Apply bug 183970 changes to WebCore JS too. This offers solid type checking
2200         with @getByIdDirectPrivate().
2201
2202         * Modules/mediastream/RTCPeerConnection.js:
2203         (initializeRTCPeerConnection):
2204         (getLocalStreams):
2205         (getStreamById):
2206         (addStream):
2207         * Modules/mediastream/RTCPeerConnectionInternals.js:
2208         (isRTCPeerConnection):
2209         * Modules/streams/ReadableByteStreamController.js:
2210         (enqueue):
2211         (error):
2212         (close):
2213         (getter.byobRequest):
2214         * Modules/streams/ReadableByteStreamInternals.js:
2215         (privateInitializeReadableStreamBYOBReader):
2216         (privateInitializeReadableByteStreamController):
2217         (privateInitializeReadableStreamBYOBRequest):
2218         (isReadableByteStreamController):
2219         (isReadableStreamBYOBRequest):
2220         (isReadableStreamBYOBReader):
2221         (readableByteStreamControllerCancel):
2222         (readableByteStreamControllerError):
2223         (readableByteStreamControllerClose):
2224         (readableByteStreamControllerClearPendingPullIntos):
2225         (readableByteStreamControllerGetDesiredSize):
2226         (readableStreamHasBYOBReader):
2227         (readableStreamHasDefaultReader):
2228         (readableByteStreamControllerHandleQueueDrain):
2229         (readableByteStreamControllerPull):
2230         (readableByteStreamControllerShouldCallPull):
2231         (readableByteStreamControllerCallPullIfNeeded):
2232         (readableByteStreamControllerEnqueue):
2233         (readableByteStreamControllerEnqueueChunk):
2234         (readableByteStreamControllerRespondWithNewView):
2235         (readableByteStreamControllerRespond):
2236         (readableByteStreamControllerRespondInternal):
2237         (readableByteStreamControllerRespondInReadableState):
2238         (readableByteStreamControllerRespondInClosedState):
2239         (readableByteStreamControllerProcessPullDescriptors):
2240         (readableByteStreamControllerFillDescriptorFromQueue):
2241         (readableByteStreamControllerShiftPendingDescriptor):
2242         (readableByteStreamControllerInvalidateBYOBRequest):
2243         (readableByteStreamControllerCommitDescriptor):
2244         (readableStreamFulfillReadIntoRequest):
2245         (readableByteStreamControllerPullInto):
2246         (readableStreamAddReadIntoRequest):
2247         * Modules/streams/ReadableStream.js:
2248         (initializeReadableStream):
2249         (pipeThrough):
2250         * Modules/streams/ReadableStreamBYOBReader.js:
2251         (cancel):
2252         (read):
2253         (releaseLock):
2254         (getter.closed):
2255         * Modules/streams/ReadableStreamBYOBRequest.js:
2256         (respond):
2257         (respondWithNewView):
2258         (getter.view):
2259         * Modules/streams/ReadableStreamDefaultController.js:
2260         (error):
2261         * Modules/streams/ReadableStreamDefaultReader.js:
2262         (cancel):
2263         (read):
2264         (releaseLock):
2265         (getter.closed):
2266         * Modules/streams/ReadableStreamInternals.js:
2267         (privateInitializeReadableStreamDefaultReader):
2268         (readableStreamReaderGenericInitialize):
2269         (readableStreamDefaultControllerError):
2270         (readableStreamPipeTo):
2271         (readableStreamTee):
2272         (isReadableStream):
2273         (isReadableStreamDefaultReader):
2274         (isReadableStreamDefaultController):
2275         (readableStreamError):
2276         (readableStreamDefaultControllerCallPullIfNeeded):
2277         (readableStreamDefaultControllerGetDesiredSize):
2278         (readableStreamReaderGenericCancel):
2279         (readableStreamCancel):
2280         (readableStreamDefaultControllerCancel):
2281         (readableStreamDefaultControllerPull):
2282         (readableStreamDefaultControllerClose):
2283         (readableStreamClose):
2284         (readableStreamFulfillReadRequest):
2285         (readableStreamDefaultReaderRead):
2286         (readableStreamAddReadRequest):
2287         (isReadableStreamDisturbed):
2288         (readableStreamReaderGenericRelease):
2289         (readableStreamDefaultControllerCanCloseOrEnqueue):
2290         (privateInitializeReadableStreamDefaultController): Deleted.
2291         * Modules/streams/StreamInternals.js:
2292         (validateAndNormalizeQueuingStrategy):
2293         * Modules/streams/WritableStream.js:
2294         (initializeWritableStream):
2295         (abort):
2296         (close):
2297         (write):
2298         (getter.closed):
2299         (getter.ready):
2300         (getter.state):
2301         * Modules/streams/WritableStreamInternals.js:
2302         (isWritableStream):
2303         (syncWritableStreamStateWithQueue):
2304         (errorWritableStream):
2305         (callOrScheduleWritableStreamAdvanceQueue):
2306         * bindings/js/JSDOMBindingInternals.js:
2307         (mapLikeForEach):
2308
2309 2018-04-12  Antoine Quint  <graouts@apple.com>
2310
2311         [Web Animations] Turn CSS Animations and CSS Transitions as Web Animations on by default
2312         https://bugs.webkit.org/show_bug.cgi?id=184569
2313         <rdar://problem/38671301>
2314
2315         Reviewed by Jon Lee.
2316
2317         We now set the CSS Animations and CSS Transitions as Web Animations flag on by default. To ensure that some remaining
2318         tests pass with this flag on, we expose a way to get to a PseudoElement via a new internals.pseudoElement() method. This
2319         allows tests that used internals.pauseAnimationAtTimeOnPseudoElement() and internals.pauseTransitionAtTimeOnPseudoElement()
2320         to now work with the Web Animations API.
2321
2322         * page/RuntimeEnabledFeatures.h:
2323         * testing/Internals.cpp:
2324         (WebCore::Internals::pseudoElement):
2325         * testing/Internals.h:
2326         * testing/Internals.idl:
2327
2328 2018-04-13  Sergio Villar Senin  <svillar@igalia.com>
2329
2330         [WebVR][OpenVR] Implement requestPresent()/exitPresent() and getLayers()
2331         https://bugs.webkit.org/show_bug.cgi?id=184530
2332
2333         Reviewed by Žan Doberšek.
2334
2335         WebVR apps should invoke requestPresent() to start presenting contents of a VRLayerInit
2336         (right now a HTML canvas with a WebGL context) on the VRDisplay. This request might fail for
2337         a variety of reasons and can be eventually cancelled with exitPresent(). Once we are
2338         presenting we could access the presenting layers (right now just one) with getLayers().
2339
2340         Note that we are not presenting anything to the HMD yet, that will be done later in a follow
2341         up patch.
2342
2343         I took the chance to correct a mistak in the VRDisplayCapabilities object which has a method
2344         that should be called maxLayers instead of maxLayer.
2345
2346         * Modules/webvr/VRDisplay.cpp:
2347         (WebCore::VRDisplay::requestPresent):
2348         (WebCore::VRDisplay::stopPresenting):
2349         (WebCore::VRDisplay::exitPresent):
2350         (WebCore::VRDisplay::getLayers const):
2351         (WebCore::VRDisplay::isPresenting const): Deleted. Implemented in the header file.
2352         * Modules/webvr/VRDisplay.h:
2353         (WebCore::VRDisplay::isPresenting const):
2354         * Modules/webvr/VRDisplayCapabilities.h:
2355         (WebCore::VRDisplayCapabilities::maxLayers const): Renamed from maxLayer().
2356         (WebCore::VRDisplayCapabilities::maxLayer const): Deleted.
2357         * Modules/webvr/VRDisplayCapabilities.idl:
2358
2359 2018-04-13  Miguel Gomez  <magomez@igalia.com>
2360
2361         REGRESSION(r230627): [GTK][WPE] Possible deadlock when destroying the player in non AC mode
2362         https://bugs.webkit.org/show_bug.cgi?id=184583
2363
2364         Reviewed by Carlos Garcia Campos.
2365
2366         In non AC mode, ensure that a deadlock can't happen when destroying MediaPlayerPrivateGStreamerBase.
2367
2368         Covered by existent tests.
2369
2370         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2371         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2372         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2373         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
2374         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2375
2376 2018-04-13  Miguel Gomez  <magomez@igalia.com>
2377
2378         [GTK] [gstreamer] video won't unpause when built with -DUSE_GSTREAMER_GL=OFF
2379         https://bugs.webkit.org/show_bug.cgi?id=183362
2380
2381         Reviewed by Carlos Garcia Campos.
2382
2383         Remove the drawCancelled flag and use a new one to indicate that the player is being destroyed.
2384         That new flag is only enabled on destruction and it's not modified by cancelRepaint(), which
2385         can be used to handle the pause event without avoiding future renderings. Also cancelRepaint()
2386         has only effect when not in AC mode.
2387
2388         Covered by existent tests.
2389
2390         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2391         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2392         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2393         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
2394         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2395
2396 2018-04-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2397
2398         [GStreamer] Convert GStreamerUtilities in GStreamerCommon and include the GStreamer smart pointer traits
2399         https://bugs.webkit.org/show_bug.cgi?id=184533
2400
2401         Reviewed by Philippe Normand.
2402
2403         Renamed GStreamerUtilities* files into GStreamerCommon* and
2404         modified files including them accordingly. Include
2405         GRefPtrGStreamer.h and GUniquePtrGStreamer.h in GStreamerCommon.h
2406         to avoid problems destroying objects when those files are
2407         forgotten to be included.
2408
2409         * Modules/webaudio/AudioContext.cpp:
2410         * platform/GStreamer.cmake:
2411         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
2412         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
2413         * platform/graphics/gstreamer/GStreamerCommon.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp.
2414         * platform/graphics/gstreamer/GStreamerCommon.h: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h.
2415         * platform/graphics/gstreamer/ImageGStreamer.h:
2416         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
2417         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
2418         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
2419         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2420         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2421         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2422         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2423         * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
2424         * platform/graphics/gstreamer/MediaSampleGStreamer.h:
2425         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
2426         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
2427         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2428         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
2429         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2430         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2431         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
2432         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
2433         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2434         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2435         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2436         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2437         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp:
2438         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.h:
2439         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2440         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2441         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
2442         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2443         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
2444         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
2445         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h:
2446
2447 2018-04-12  Christopher Reid  <chris.reid@sony.com>
2448
2449         [Curl] Fix clang build error in CurlContext.cpp
2450         https://bugs.webkit.org/show_bug.cgi?id=184561
2451
2452         Reviewed by Darin Adler.
2453
2454         MSVC allows explicit template specialization in classes but gcc/clang do not.
2455
2456         * platform/network/curl/CurlContext.cpp:
2457
2458 2018-04-12  Christopher Reid  <chris.reid@sony.com>
2459
2460         [Curl] Cookie Database on memory path should be :memory:
2461         https://bugs.webkit.org/show_bug.cgi?id=184572
2462
2463         Reviewed by Alex Christensen.
2464
2465         CookieJarDB::isOnMemory is comparing the database path with :onmemory: but it should be using :memory:
2466         For reference, see: https://www.sqlite.org/inmemorydb.html
2467
2468         * platform/network/curl/CookieJarDB.h:
2469
2470 2018-04-12  Daniel Bates  <dabates@apple.com>
2471
2472         Attmept to fix the Windows build following <https://trac.webkit.org/changeset/230602/>
2473         (https://bugs.webkit.org/show_bug.cgi?id=184386)
2474
2475         Visual Studio cannot prove that all cases in the switch are covered :(
2476         So, add an ASSERT_NOT_REACHED() and a return a value outside of the switch block. 
2477
2478         * loader/cache/CachedResourceLoader.cpp:
2479         (WebCore::destinationForType):
2480
2481 2018-04-12  Chris Dumez  <cdumez@apple.com>
2482
2483         Introduce remote variants of Frame / DOMWindow classes
2484         https://bugs.webkit.org/show_bug.cgi?id=184467
2485         <rdar://problem/39011267>
2486
2487         Reviewed by Ryosuke Niwa.
2488
2489         Introduce remote variants of Frame / DOMWindow classes, for when these frames / windows
2490         are hosted on another WebProcess. Those will be used in a follow-up patch.
2491
2492         The hierarchy is as follows (class naming will be improved in a follow-up patch to minimise
2493         patch size):
2494         - AbstractFrame: A frame that can be either local or remote (hosted on another WebProcess)
2495             - Frame: A local frame
2496             - RemoteFrame: A frame hosted on another WebProcess. A RemoteFrame's window is also remote.
2497         - AbstractDOMWindow: A window that be either local or remote (hosted on another WebProcess)
2498             - DOMWindow: A local DOMWindow
2499             - RemoteDOMWindow: A window hosted on another WebProcess. A RemoteDOMWindow's frame is also
2500               remote. A RemoteDOMWindow is always cross-origin.
2501
2502         This patch introduces global identifiers (unique across all WebProcesses) for both Frames and
2503         Windows. This is useful as we need to know which Frame / DOMWindow a particular RemoteFrame /
2504         RemoteDOMWindow is pointing to.
2505
2506         Follow-up patch will add support for converting a local DOMWindow / Frame into a remote ones,
2507         when a newly opened window (via window.open) is navigated cross-origin (Bug 184515).
2508
2509         Other things we'll need to implement in follow-ups:
2510         - RemoteDOMWindow will need to know about its opener in order to support the window.opener
2511           API. Internally, the opener will be stored as a RemoteFrame so that window.opener always
2512           returns the current window in the opener frame (which changes upon navigation).
2513         - Nullify a RemoteDOMWindow's frame whenever the window it is pointing to becomes frameless.
2514           A frameless window behaves very differently (e.g. very little API is exposed to the Web).
2515           This happens when either the newly opened window is either closed or navigated.
2516
2517         * Sources.txt:
2518         * WebCore.xcodeproj/project.pbxproj:
2519         * loader/ContentFilter.cpp:
2520         (WebCore::ContentFilter::didDecide):
2521         * page/AbstractDOMWindow.cpp: Added.
2522         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
2523         (WebCore::AbstractDOMWindow::~AbstractDOMWindow):
2524         * page/AbstractDOMWindow.h: Added.
2525         (WebCore::AbstractDOMWindow::identifier const):
2526         * page/AbstractFrame.cpp: Added.
2527         (WebCore::AbstractFrame::AbstractFrame):
2528         (WebCore::AbstractFrame::~AbstractFrame):
2529         * page/AbstractFrame.h: Added.
2530         (WebCore::AbstractFrame::window const):
2531         * page/DOMWindow.cpp:
2532         (WebCore::DOMWindow::DOMWindow):
2533         * page/DOMWindow.h:
2534         (isType):
2535         * page/Frame.cpp:
2536         (WebCore::Frame::window const):
2537         (WebCore::Frame::virtualWindow const):
2538         * page/Frame.h:
2539         (isType):
2540         * page/GlobalFrameIdentifier.h: Added.
2541         (WebCore::GlobalFrameIdentifier::encode const):
2542         (WebCore::GlobalFrameIdentifier::decode):
2543         * page/GlobalWindowIdentifier.h: Added.
2544         (WebCore::operator==):
2545         (WebCore::GlobalWindowIdentifier::hash const):
2546         (WebCore::GlobalWindowIdentifier::encode const):
2547         (WebCore::GlobalWindowIdentifier::decode):
2548         (WTF::GlobalWindowIdentifierHash::hash):
2549         (WTF::GlobalWindowIdentifierHash::equal):
2550         (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::emptyValue):
2551         (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::constructDeletedValue):
2552         (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::isDeletedValue):
2553
2554         * page/RemoteDOMWindow.cpp: Added.
2555         (WebCore::RemoteDOMWindow::RemoteDOMWindow):
2556         (WebCore::RemoteDOMWindow::~RemoteDOMWindow):
2557         (WebCore::RemoteDOMWindow::self const):
2558         (WebCore::RemoteDOMWindow::location const):
2559         (WebCore::RemoteDOMWindow::close):
2560         (WebCore::RemoteDOMWindow::closed const):
2561         (WebCore::RemoteDOMWindow::focus):
2562         (WebCore::RemoteDOMWindow::blur):
2563         (WebCore::RemoteDOMWindow::length const):
2564         (WebCore::RemoteDOMWindow::top const):
2565         (WebCore::RemoteDOMWindow::opener const):
2566         (WebCore::RemoteDOMWindow::parent const):
2567         (WebCore::RemoteDOMWindow::postMessage):
2568         The DOM API exposed on RemoteDOMWindow is only the subset of the DOMWindow API that is exposed cross origin,
2569         since remote DOMWindow are always from a different origin. The short-term plan is to implement these in a
2570         follow-up by relying on IPC (synchronous when necessary) to fetch the information from the real window in
2571         the WebProcess where it lives. Longer term, we should probably keep RemoteDOMWindow members in sync with the
2572         DOMWindow they're pointing to, so we do not have to rely on synchronous IPC.
2573
2574         * page/RemoteDOMWindow.h: Added.
2575         (isType):
2576         * page/RemoteFrame.cpp: Added.
2577         (WebCore::RemoteFrame::RemoteFrame):
2578         (WebCore::RemoteFrame::~RemoteFrame):
2579         (WebCore::RemoteFrame::virtualWindow const):
2580         * page/RemoteFrame.h: Added.
2581         (isType):
2582
2583 2018-04-12  Daniel Bates  <dabates@apple.com>
2584
2585         Content-Type not enforced for <script> allows for XSS
2586         https://bugs.webkit.org/show_bug.cgi?id=184386
2587         <rdar://problem/39112268>
2588
2589         Reviewed by Brady Eidson.
2590
2591         As per the Fetch standard, <https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-mime-type?> (16 March 2018),
2592         we should block JavaScript scripts that are served with MIME type text/csv, or a MIME type
2593         that begins with "audio/", "image/" or "video/".
2594
2595         As a side benefit of this change we now set the destination property [1] on preload requests.
2596
2597         [1] <https://fetch.spec.whatwg.org/#concept-request-destination>
2598
2599         Tests: http/tests/security/script-with-banned-mimetype.html
2600                http/tests/workers/worker-importScripts-banned-mimetype.html
2601
2602         * Sources.txt: Add file FetchIdioms.cpp.
2603         * WebCore.xcodeproj/project.pbxproj: Add files FetchIdioms.{cpp, h}.
2604         * dom/LoadableClassicScript.cpp:
2605         (WebCore::LoadableClassicScript::notifyFinished): Check the MIME type of the response and
2606         block the script if applicable.
2607         * dom/LoadableScript.h: Add error type MIMEType.
2608         * loader/FetchIdioms.cpp: Added.
2609         (WebCore::shouldBlockResponseDueToMIMEType): Implements the "Should response to request be blocked
2610         due to its MIME type?" algorithm from the Fetch standard.
2611         * loader/FetchIdioms.h: Added.
2612         * loader/FetchOptions.h:
2613         (WebCore::isScriptLikeDestination): Implements the definition of "script like" as per <https://fetch.spec.whatwg.org/#request-destination-script-like>.
2614         * loader/cache/CachedResourceLoader.cpp:
2615         (WebCore::CachedResourceLoader::requestImage): Removed logic to set the destination property as
2616         CachedResourceLoader::requestResource() is now responsible for doing this.
2617         (WebCore::CachedResourceLoader::requestFont): Ditto.
2618         (WebCore::CachedResourceLoader::requestTextTrack): Ditto.
2619         (WebCore::CachedResourceLoader::requestCSSStyleSheet): Ditto.
2620         (WebCore::CachedResourceLoader::requestScript): Ditto.
2621         (WebCore::CachedResourceLoader::requestXSLStyleSheet): Ditto.
2622         (WebCore::CachedResourceLoader::requestMedia): Update comment to express that we should assert
2623         that the destination property is either video or audio.
2624         (WebCore::CachedResourceLoader::requestIcon): Remove logic to set the destination property as
2625         CachedResourceLoader::requestResource() is now responsible for doing this.
2626         (WebCore::CachedResourceLoader::requestRawResource): Removed assertion as this function is used to
2627         load many kinds of requests that have different destination properties. The caller is responsible
2628         for setting the appropriate destintion property.
2629         (WebCore::CachedResourceLoader::requestMainResource): Remove logic to set the destination property
2630         as CachedResourceLoader::requestResource() is now responsible for doing this.
2631         (WebCore::destinationForType): Helper function that maps CachedResource::Type to FetchOptions::Destination.
2632         (WebCore::CachedResourceLoader::requestResource): Set the destination property on the request if not
2633         already set.
2634         * loader/cache/CachedResourceLoader.h: Segregate requestRawResource() from the other request functions
2635         and add a comment to explain what it is used for.
2636         * workers/Worker.cpp:
2637         (WebCore::Worker::create):
2638         * workers/WorkerScriptLoader.cpp:
2639         (WebCore::WorkerScriptLoader::loadSynchronously): Set the destination property to FetchOptions::Destination::Script
2640         and store it in an instance variable as we will need to reference it once we receive the HTTP response.
2641         Note that this function is only used to support the Web API importScripts().
2642         (WebCore::WorkerScriptLoader::loadAsynchronously): Store the passed destination property in an
2643         instance as we will need to reference it once we receive the HTTP response.
2644         (WebCore::WorkerScriptLoader::didReceiveResponse): Check the MIME type of the response and
2645         block the script if applicable.
2646         * workers/WorkerScriptLoader.h:
2647         * workers/service/ServiceWorkerJob.cpp:
2648         (WebCore::ServiceWorkerJob::fetchScriptWithContext): Set the destination property to FetchOptions::Destination::Serviceworker.
2649
2650 2018-04-12  Antoine Quint  <graouts@apple.com>
2651
2652         [Web Animations] Fix a host of small CSS Animations and CSS Transitions issues
2653         https://bugs.webkit.org/show_bug.cgi?id=184555
2654
2655         Reviewed by Dean Jackson.
2656
2657         A series of small and intertwined issues were preventing a number of CSS Animations and CSS Trantions
2658         tests to fail when expressed as Web Animations.
2659
2660         * animation/AnimationTimeline.cpp:
2661         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Pass the old and new RenderStyles to CSSAnimation::create()
2662         since we're refactoring DeclarativeAnimation to create blending keyframes in initialize(), no longer requiring each subclass
2663         to create them.
2664         (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): Return the animation, if any, for a property animated by
2665         a CSS animation, so that we can determine if a property is already being animated when running a CSS Transition.
2666         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Since a property can be specified twice in a "transition" property,
2667         once via "all" and once explicitly, ensure we look at all currently running transitions for the currently-processed property to
2668         see if we need to cancel this transition. Previously, we used to only see if it had been transitioned in the old style. We also
2669         start transitions even if the duration is 0 provided the delay is a positive, non-zero value. Then, if there is a CSS Animation
2670         for this property already running, use that animation's original unanimated style as the from value.
2671         * animation/AnimationTimeline.h:
2672         * animation/CSSAnimation.cpp:
2673         (WebCore::CSSAnimation::create): The animation name is now set in the CSSAnimation constructor.
2674         (WebCore::CSSAnimation::CSSAnimation): Set the animation name and keep a copy of the unanimated style such that we can
2675         get it when a CSS Transition is created and takes precedence over this CSS Animation.
2676         (WebCore::CSSAnimation::initialize): Deleted.
2677         * animation/CSSAnimation.h:
2678         * animation/CSSTransition.cpp:
2679         (WebCore::CSSTransition::create):
2680         (WebCore::CSSTransition::initialize):
2681         * animation/CSSTransition.h:
2682         * animation/DeclarativeAnimation.cpp:
2683         (WebCore::DeclarativeAnimation::initialize): Call the new computeDeclarativeAnimationBlendingKeyframes() on the KeyframeEffect
2684         directly in this method so that subclasses don't need to create it manually, but most important so that keyframes are created
2685         before timing properties are set based on the backing animation.
2686         * animation/DeclarativeAnimation.h:
2687         * animation/KeyframeEffectReadOnly.cpp:
2688         (WebCore::KeyframeEffectReadOnly::getKeyframes): Ensure we have a CSSValue before trying to serialize it.
2689         (WebCore::KeyframeEffectReadOnly::computeDeclarativeAnimationBlendingKeyframes):
2690         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): Use the animation's unanimated style to compute keyframes,
2691         instead of a default RenderStyle which would not use the right values for implicit keyframes.
2692         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Look at the property used to create
2693         the transition rather than that specified on the backing Animation object since it can be CSSPropertyInvalid in the case of
2694         "transition: all".
2695         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): If we're dealing with a CSS animation, we consider the first and
2696         last keyframes to always have the property listed since the underlying style was provided and should be captured.
2697         * animation/KeyframeEffectReadOnly.h:
2698         * style/StyleTreeResolver.cpp:
2699         (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Apply CSS Animations after CSS Trasitions since they take precedence.
2700
2701 2018-04-12  Antoine Quint  <graouts@apple.com>
2702
2703         [Web Animations] Only cancel declarative animations upon element removal
2704         https://bugs.webkit.org/show_bug.cgi?id=184553
2705
2706         Reviewed by Dean Jackson.
2707
2708         Ensure we only call cancel() on CSSAnimation and CSSTransition objects as we might otherwise reject
2709         the ready promise and produce spurious logging from WPT tests.
2710
2711         * animation/AnimationTimeline.cpp:
2712         (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
2713         (WebCore::AnimationTimeline::cancelAnimationsForElement): Deleted.
2714         * animation/AnimationTimeline.h:
2715         * dom/Element.cpp:
2716         (WebCore::Element::removedFromAncestor):
2717         * dom/PseudoElement.cpp:
2718         (WebCore::PseudoElement::clearHostElement):
2719         * rendering/updating/RenderTreeUpdater.cpp:
2720         (WebCore::RenderTreeUpdater::tearDownRenderers):
2721
2722 2018-04-12  Ryan Haddad  <ryanhaddad@apple.com>
2723
2724         Unreviewed, rolling out r230554.
2725
2726         The non-ASCII character in the filename causes issues with SVN
2727
2728         Reverted changeset:
2729
2730         "input.webkitEntries does not work as expected when folder
2731         contains accented chars"
2732         https://bugs.webkit.org/show_bug.cgi?id=184517
2733         https://trac.webkit.org/changeset/230554
2734
2735 2018-04-12  Alicia Boya García  <aboya@igalia.com>
2736
2737         [MSE] Add isValid() assertions on PlatformTimeRanges::add() range ends
2738         https://bugs.webkit.org/show_bug.cgi?id=180253
2739
2740         Right now it's checked that start <= end but it's not checked that
2741         neither of them is undefined.
2742
2743         When this happens, the bug can be hard to track down.
2744
2745         The assertion is not enabled for Mac because there is currently a test
2746         that is hitting it.
2747
2748         Reviewed by Jer Noble.
2749
2750         * platform/graphics/PlatformTimeRanges.cpp:
2751         (WebCore::PlatformTimeRanges::add):
2752
2753 2018-04-12  Chris Dumez  <cdumez@apple.com>
2754
2755         Process::setIdentifier() / Process::identifier() do not need a lock
2756         https://bugs.webkit.org/show_bug.cgi?id=184544
2757
2758         Reviewed by Brady Eidson.
2759
2760         Process::setIdentifier() / Process::identifier() do not need a lock.
2761         Process::setIdentifier() gets called in ChildProcess::initialize(),
2762         before we start any background threads. It is then safe to query
2763         this process identifier later on from background threads without
2764         locks.
2765
2766         * platform/Process.cpp:
2767         (WebCore::Process::setIdentifier):
2768         (WebCore::Process::identifier):
2769
2770 2018-04-12  Antoine Quint  <graouts@apple.com>
2771
2772         Unreviewed, fix the Windows build.
2773
2774         * animation/DocumentTimeline.cpp:
2775         (WebCore::DocumentTimeline::computeExtentOfAnimation const):
2776
2777 2018-04-12  Antoine Quint  <graouts@apple.com>
2778
2779         [Web Animations] Suspend animations when required
2780         https://bugs.webkit.org/show_bug.cgi?id=184541
2781
2782         Reviewed by Jon Lee.
2783
2784         Animations managed by CSSAnimationController get suspended under a number of scenarios, we now add the possibility
2785         to suspend animations on a DocumentTimeline as well such that Web Animations and CSS Animations and CSS Transitions
2786         implemented as Web Animations get suspended under the same conditions as well. We also update the implementation for
2787         Internals::numberOfActiveAnimations() such that tests checking that animations get suspended pass.
2788
2789         * animation/DocumentTimeline.cpp:
2790         (WebCore::DocumentTimeline::suspendAnimations): When asked to be suspended, the DocumentTimeline cancels pending
2791         invalidation tasks and updates all of the animations it manages, including those running on the compositor.
2792         (WebCore::DocumentTimeline::resumeAnimations): When asked to be resumed, the DocumentTimeline resumes animations
2793         it manages and rewinds its invalidation timer.
2794         (WebCore::DocumentTimeline::animationsAreSuspended):
2795         (WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const): Called by Internals::numberOfActiveAnimations(),
2796         this returns the number of animations managed by this timeline that are not suspended.
2797         (WebCore::DocumentTimeline::currentTime):
2798         (WebCore::DocumentTimeline::timingModelDidChange): Ensure the invalidation timer is not rewound if the timeline
2799         is suspended.
2800         * animation/DocumentTimeline.h:
2801         * animation/WebAnimation.cpp:
2802         (WebCore::WebAnimation::setTimeline): When moving to a new timeline, ensure we match the new timeline's animation state.
2803         (WebCore::WebAnimation::setSuspended): Toggle the accelerated running state of any backing hardware animations when
2804         the suspension state of an animation changes.
2805         * animation/WebAnimation.h:
2806         (WebCore::WebAnimation::isSuspended const):
2807         * dom/Document.cpp:
2808         (WebCore::Document::didBecomeCurrentDocumentInFrame):
2809         (WebCore::Document::resume):
2810         * dom/Document.h:
2811         * history/CachedFrame.cpp:
2812         (WebCore::CachedFrameBase::restore):
2813         * page/Frame.cpp:
2814         (WebCore::Frame::clearTimers):
2815         * page/Page.cpp:
2816         (WebCore::Page::setIsVisibleInternal):
2817         (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
2818         * testing/Internals.cpp:
2819         (WebCore::Internals::numberOfActiveAnimations const):
2820         (WebCore::Internals::animationsAreSuspended const):
2821         (WebCore::Internals::suspendAnimations const):
2822         (WebCore::Internals::resumeAnimations const):
2823
2824 2018-04-12  Antoine Quint  <graouts@apple.com>
2825
2826         [Web Animations] Throttle animations when lowPowerMode is on
2827         https://bugs.webkit.org/show_bug.cgi?id=184540
2828
2829         Reviewed by Jon Lee.
2830
2831         Ensure animations are sampled at a lower frequency when lowPowerMode is on.
2832
2833         * animation/DocumentTimeline.cpp:
2834         (WebCore::DocumentTimeline::updateThrottlingState):
2835         (WebCore::DocumentTimeline::animationInterval const):
2836         (WebCore::DocumentTimeline::updateAnimationSchedule):
2837         (WebCore::DocumentTimeline::scheduleAnimationResolution):
2838         * animation/DocumentTimeline.h:
2839         * page/Page.cpp:
2840         (WebCore::Page::handleLowModePowerChange):
2841         * testing/Internals.cpp:
2842         (WebCore::Internals::animationsInterval const):
2843
2844 2018-04-12  Antoine Quint  <graouts@apple.com>
2845
2846         [Web Animations] Ensure elements overlapping with elements animating also get composited
2847         https://bugs.webkit.org/show_bug.cgi?id=184539
2848
2849         Reviewed by Jon Lee.
2850
2851         A number of compositing tests failed because we didn't call into the Web Animations engine while various calls
2852         on RenderLayer and RenderLayerBacking were made. We bring the functionality over from CSSAnimationController to
2853         DocumentTimeline and KeyframeAnimation to KeyframeEffectReadOnly.
2854
2855         * animation/AnimationTimeline.cpp:
2856         (WebCore::AnimationTimeline::animationsForElement const): Update this method's signature to be const since it
2857         should be callable by other const method.
2858         (WebCore::AnimationTimeline::animationsForElement): Deleted.
2859         * animation/AnimationTimeline.h:
2860         * animation/DocumentTimeline.cpp:
2861         (WebCore::DocumentTimeline::computeExtentOfAnimation const): Adapt this method from CSSAnimationController.
2862         (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): Adapt this method from CSSAnimationController.
2863         (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): Adapt this method from CSSAnimationController.
2864         * animation/DocumentTimeline.h:
2865         * animation/KeyframeEffectReadOnly.cpp:
2866         (WebCore::KeyframeEffectReadOnly::computeExtentOfTransformAnimation const): Bring this method over from KeyframeAnimation.
2867         (WebCore::containsRotation): Bring this method over from KeyframeAnimation.
2868         (WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaTransformList const): Bring this method over from KeyframeAnimation.
2869         (WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaMatrix const): Bring this method over from KeyframeAnimation.
2870         * animation/KeyframeEffectReadOnly.h:
2871         (WebCore::KeyframeEffectReadOnly::animatedProperties const): DocumentTimeline::computeExtentOfAnimation() needs to get a list
2872         of all animated properties to see if a transform is animated, so we now expose such a list.
2873         * rendering/RenderLayer.cpp:
2874         (WebCore::RenderLayer::currentTransform const): Update this method to call into DocumentTimeline if the CSS Animations
2875         and CSS Transitions as Web Animations flag is on.
2876         (WebCore::RenderLayer::calculateClipRects const): Update this method to call into DocumentTimeline if the CSS Animations
2877         and CSS Transitions as Web Animations flag is on.
2878         * rendering/RenderLayerBacking.cpp:
2879         (WebCore::RenderLayerBacking::updateGeometry): Update this method to call into DocumentTimeline if the CSS Animations
2880         and CSS Transitions as Web Animations flag is on.
2881         * rendering/RenderLayerCompositor.cpp:
2882         (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): Update this method to call into DocumentTimeline
2883         if the CSS Animations and CSS Transitions as Web Animations flag is on.
2884         * rendering/RenderObject.h:
2885         (WebCore::RenderObject::documentTimeline const):
2886
2887 2018-04-11  Antoine Quint  <graouts@apple.com>
2888
2889         [Web Animations] Enable seeking for hardware animations
2890         https://bugs.webkit.org/show_bug.cgi?id=184518
2891
2892         Reviewed by Dean Jackson.
2893
2894         Hardware animations had lagged behind software animations in support and this patch bring their respective level
2895         of support closer to one another. Importantly, we add the ability to seek an animation added to a GraphicsLayerCA
2896         since many tests pause and seek animations to test their state. Animations may also have their playback state changed
2897         along with their current time in the same run loop, so we now maintain a list of pending processing actions for
2898         hardware animations.
2899
2900         * animation/DocumentTimeline.cpp:
2901         (WebCore::DocumentTimeline::updateAnimationSchedule): If we have animations queued up for updates to their accelerated
2902         state we can schedule animation resolution immediately since we've already established we'll have work to do.
2903         (WebCore::DocumentTimeline::updateAnimations): Factor the updates of pending accelerated animations out in a dedicated
2904         method.
2905         (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): Go through all pending accelerated animations and update
2906         their state.
2907         * animation/KeyframeEffectReadOnly.cpp:
2908         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes): Update the m_shouldRunAccelerated flag when setting blending keyframes.
2909         (WebCore::KeyframeEffectReadOnly::apply): Ensure we finish accelerated animations if the progress is 1 or null (no longer active).
2910         start accelerated animations if the animation is starting and always resolve styles in software as well to ensure that
2911         hit testing will work as expected.
2912         (WebCore::KeyframeEffectReadOnly::computeShouldRunAccelerated):
2913         (WebCore::KeyframeEffectReadOnly::animationPlayStateDidChange): Called by WebAnimation when play() or pause() is called
2914         with the appropriate flag.
2915         (WebCore::KeyframeEffectReadOnly::animationDidSeek): Called by WebAnimation when the currentTime property is set.
2916         (WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): Add the provided action to the list of pending accelerated
2917         actions and notify the animation that the accelerated state needs changing.
2918         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Called by DocumentTimeline, through WebAnimation, to apply
2919         all pending accelerated actions.
2920         (WebCore::KeyframeEffectReadOnly::backingAnimationForCompositedRenderer const): If we're dealing with a declarative animation,
2921         we already have a backing Animation object, so use it directly. Otherwise, create one and ensure it reflects all timing properties
2922         for the animation.
2923         (WebCore::KeyframeEffectReadOnly::shouldRunAccelerated): Deleted.
2924         (WebCore::KeyframeEffectReadOnly::startOrStopAccelerated): Deleted.
2925         * animation/WebAnimation.cpp:
2926         (WebCore::WebAnimation::setCurrentTime): Call animationDidSeek() on the effect to ensure its accelerated animation gets seeked.
2927         (WebCore::WebAnimation::play): Call animationPlayStateDidChange() on the effect to ensure its accelerated animation is started or resumed.
2928         (WebCore::WebAnimation::pause): Call animationPlayStateDidChange() on the effect to ensure its accelerated animation gets paused.
2929         (WebCore::WebAnimation::acceleratedStateDidChange): 
2930         (WebCore::WebAnimation::applyPendingAcceleratedActions):
2931         (WebCore::WebAnimation::acceleratedRunningStateDidChange): Deleted.
2932         (WebCore::WebAnimation::startOrStopAccelerated): Deleted.
2933         * platform/graphics/GraphicsLayer.h:
2934         (WebCore::GraphicsLayer::seekAnimation):
2935         * platform/graphics/ca/GraphicsLayerCA.cpp:
2936         (WebCore::GraphicsLayerCA::addProcessingActionForAnimation): Add an AnimationProcessingAction to the list of such actions for a
2937         given animation name. In case we already have a Remove action, we ignore the action since the hardware animation will have been
2938         removed by the time we try to apply this processing action.
2939         (WebCore::GraphicsLayerCA::pauseAnimation): Add a Pause processing action.
2940         (WebCore::GraphicsLayerCA::seekAnimation): Add a Seek processing action.
2941         (WebCore::GraphicsLayerCA::removeAnimation): Add a Remove processing action.
2942         (WebCore::GraphicsLayerCA::updateAnimations): First ensure that all animations pending commit are committed and then update
2943         all animations based on the actions added through addProcessingActionForAnimation().
2944         (WebCore::GraphicsLayerCA::seekCAAnimationOnLayer): Generate a new animation based on the new seek time provided.
2945         * platform/graphics/ca/GraphicsLayerCA.h:
2946         (WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction):
2947         * rendering/RenderBoxModelObject.cpp:
2948         (WebCore::RenderBoxModelObject::animationSeeked):
2949         * rendering/RenderLayerBacking.cpp:
2950         (WebCore::RenderLayerBacking::animationSeeked):
2951         * rendering/RenderLayerCompositor.cpp:
2952         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): Fix an issue where we would run the CSSAnimationController
2953         logic even when the legacy animation engine was disabled.
2954
2955 2018-04-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2956
2957         Unreviewed, fix GStreamer builds
2958
2959         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2960         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): We were
2961         passing a String to a GST_WARNING call.
2962
2963 2018-04-11  Chris Dumez  <cdumez@apple.com>
2964
2965         input.webkitEntries does not work as expected when folder contains accented chars
2966         https://bugs.webkit.org/show_bug.cgi?id=184517
2967         <rdar://problem/39265537>
2968
2969         Reviewed by Ryosuke Niwa.
2970
2971         Use String::fromUTF8() to construct a WTF String from the char* returned by
2972         dirname() in FileSystem::directoryName(). Previously, we were just calling
2973         the String constructor, which would treat the input as latin 1 instead of
2974         UTF-8.
2975
2976         Test: fast/forms/file/entries-api/webkitEntries-nonascii-folder-name.html
2977
2978         * platform/posix/FileSystemPOSIX.cpp:
2979         (WebCore::FileSystem::directoryName):
2980
2981 2018-04-11  Youenn Fablet  <youenn@apple.com>
2982
2983         Preventively expect UTF8 strings from libwebrtc SDP and error messages
2984         https://bugs.webkit.org/show_bug.cgi?id=184509
2985
2986         Reviewed by Eric Carlson.
2987
2988         Make WebCore code expect any libwebrtc string to contain UTF-8.
2989         Currently SDPs do not contain any UTF-8 specific character
2990         but https://tools.ietf.org/html/rfc4566 allows it.
2991
2992         Add Internals API to set track id so that we can inject UTF-8 inside some WebRTC tests.
2993         Test: webrtc/utf8-sdp.html
2994
2995         * Modules/mediastream/MediaStreamTrack.h:
2996         (WebCore::MediaStreamTrack::setIdForTesting):
2997         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2998         (WebCore::fromStdString):
2999         (WebCore::fromSessionDescription):
3000         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
3001         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
3002         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
3003         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
3004         (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
3005         (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
3006         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
3007         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
3008         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
3009         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
3010         (WebCore::trackId): Deleted.
3011         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3012         (WebCore::fromStdString):
3013         (WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
3014         (WebCore::createReceiverForSource):
3015         * platform/mediastream/MediaStreamTrackPrivate.h:
3016         (WebCore::MediaStreamTrackPrivate::setIdForTesting):
3017         * testing/Internals.cpp:
3018         (WebCore::Internals::setMediaStreamTrackIdentifier):
3019         * testing/Internals.h:
3020         * testing/Internals.idl:
3021
3022 2018-04-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
3023
3024         Cache glyphs (using display lists) when painting at high frequency
3025         https://bugs.webkit.org/show_bug.cgi?id=178750
3026         <rdar://problem/35201729>
3027
3028         Reviewed by Antti Koivisto.
3029
3030         This patch adds support for caching of glyph drawing commands when painting
3031         at high frequency. Caching the glyph drawing will be done using DisplayLists.
3032
3033         GlyphDisplayListCache is basically a hash map which maps InlineTextBox
3034         or SimpleLineLayout::Run to DisplayList. Before adding a new entry to it
3035         we have to check whether the conditions for caching the glyph DisplayList
3036         are met or not. If no entry is found for a given run, a new DisplayList
3037         is created and a new entry is add to the cache.
3038
3039         * WebCore.xcodeproj/project.pbxproj:
3040         * page/MemoryRelease.cpp:
3041         (WebCore::releaseNoncriticalMemory): Make GlyphDisplayListCache respond
3042         to memory pressure.
3043
3044         * platform/graphics/FontCascade.cpp:
3045         (WebCore::FontCascade::displayListForTextRun const):
3046         * platform/graphics/FontCascade.h:
3047         (WebCore::FontCascade::displayListForTextRun):
3048         Record the drawing of a glyph run into a DisplayList.
3049
3050         * rendering/GlyphDisplayListCache.h: Added.
3051         (WebCore::GlyphDisplayListCache::singleton):
3052         (WebCore::GlyphDisplayListCache::get):
3053         (WebCore::GlyphDisplayListCache::remove):
3054         (WebCore::GlyphDisplayListCache::clear):
3055         (WebCore::GlyphDisplayListCache::size const):
3056         (WebCore::GlyphDisplayListCache::sizeInBytes const):
3057         A simple cache for the TextRun DisplayList. Adding a new entry in the
3058         cache happens under restricted conditions. So this cache is not expected
3059         to grow much.
3060
3061         * rendering/InlineTextBox.cpp:
3062         (WebCore::InlineTextBox::~InlineTextBox):
3063         (WebCore::InlineTextBox::paint):
3064         (WebCore::InlineTextBox::paintMarkedTexts):
3065         (WebCore::InlineTextBox::paintMarkedTextBackground):
3066         (WebCore::InlineTextBox::paintMarkedTextForeground):
3067         (WebCore::InlineTextBox::paintMarkedTextDecoration):
3068         (WebCore::InlineTextBox::paintCompositionBackground):
3069         (WebCore::InlineTextBox::paintCompositionUnderlines const):
3070         (WebCore::InlineTextBox::paintCompositionUnderline const):
3071         * rendering/InlineTextBox.h:
3072         (WebCore::InlineTextBox::paintMarkedTexts):
3073         InlineTextBox::paintMarkedTextForeground() now requires PaintInfo to know
3074         whether the entry in the GlyphDisplayListCache should be removed or not.
3075         Change all the GraphicsContext arguments to be PaintInfo.
3076
3077         * rendering/SimpleLineLayout.cpp:
3078         (WebCore::SimpleLineLayout::Layout::~Layout):
3079         * rendering/SimpleLineLayout.h:
3080         * rendering/SimpleLineLayoutFunctions.cpp:
3081         (WebCore::SimpleLineLayout::paintFlow):
3082         (WebCore::SimpleLineLayout::simpleLineLayoutWillBeDeleted):
3083         * rendering/SimpleLineLayoutFunctions.h:
3084         * rendering/SimpleLineLayoutResolver.h:
3085         (WebCore::SimpleLineLayout::RunResolver::Run::simpleRun const):
3086         Implement the glyph caching for SimpleLineLayout::Run.
3087
3088         * rendering/TextPainter.cpp:
3089         (WebCore::TextPainter::paintTextOrEmphasisMarks): If the DisplayList is
3090         available, replay it back into the GraphicsContext. Make sure to reset to
3091         the DisplayList pointer to nullptr after painting.
3092
3093         (WebCore::TextPainter::clearGlyphDisplayLists):
3094         (WebCore::TextPainter::shouldUseGlyphDisplayList): Check whether we should
3095         use DisplayList to the draw glyph run.
3096
3097         * rendering/TextPainter.h:
3098         (WebCore::TextPainter::setGlyphDisplayListIfNeeded): Check whether we should
3099         should use DisplayList to the draw glyph run and if we should, ensure first
3100         the DisplayList is cached and set it in the TextPainter so it uses it when
3101         the run is painted.
3102
3103         (WebCore::TextPainter::removeGlyphDisplayList): Remove the cached DisplayList
3104         entry for a glyph layout run.
3105
3106 2018-04-11  Brent Fulgham  <bfulgham@apple.com>
3107
3108         GraphicsLayerCA::createPlatformCALayer always disables extended color in its backing store
3109         https://bugs.webkit.org/show_bug.cgi?id=184367
3110         <rdar://problem/39249074>
3111
3112         Reviewed by Simon Fraser.
3113
3114         'createPlatformCALayer' always passes a nil widget, which early returns from 'screenSupportsExtendedColor'
3115         with false. Instead, we should just pass the widget (nil or not) to the screen properties methods,
3116         which will use the primary screen if no screen is specified. I.e., we shouldn't do an early return
3117         here if the passed widget is nil.
3118
3119         * platform/mac/PlatformScreenMac.mm:
3120         (WebCore::screenSupportsExtendedColor):
3121
3122 2018-04-11  Youenn Fablet  <youenn@apple.com>
3123
3124         Pass FetchOptions and SecurityOrigin as load parameters from WebProcess to NetworkProcess
3125         https://bugs.webkit.org/show_bug.cgi?id=184374
3126
3127         Reviewed by Chris Dumez.
3128
3129         Add support for SecurityOrigin encode/decode routines.
3130
3131         * page/SecurityOrigin.h:
3132
3133 2018-04-11  Thibault Saunier  <tsaunier@igalia.com>
3134
3135         [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
3136         https://bugs.webkit.org/show_bug.cgi?id=184498
3137
3138         Reviewed by Philippe Normand.
3139
3140         [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
3141
3142         This is the same behaviour as with playbin itself.
3143
3144         Make sure to keep using "playbin" for MediaSource.
3145
3146         No test added as this is basically a small rework of the way we expose a feature.
3147
3148         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
3149         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
3150         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
3151         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
3152         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
3153         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
3154         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3155         (WebCore::MediaPlayerPrivateGStreamer::load):
3156         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
3157         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3158         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3159         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3160         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3161         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
3162         (WebCore::TrackPrivateBaseGStreamer::disconnect):
3163         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
3164         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
3165         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
3166         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
3167
3168 2018-04-10  Alex Christensen  <achristensen@webkit.org>
3169
3170         IDN spoofing with Hebrew combining characters
3171         https://bugs.webkit.org/show_bug.cgi?id=184472
3172         <rdar://problem/39148687>
3173
3174         Reviewed by Brent Fulgham.
3175
3176         Covered by new API tests.
3177
3178         * platform/mac/WebCoreNSURLExtras.mm:
3179         (WebCore::isLookalikeCharacter):
3180         Punycode-encode hosts with Hebrew combining marks that look like dots
3181         and Vav with a combining dot above like we do with dotless i and j.
3182
3183 2018-04-11  Brent Fulgham  <bfulgham@apple.com>
3184
3185         Show punycode if URL contains Latin dum character
3186         https://bugs.webkit.org/show_bug.cgi?id=184477
3187         <rdar://problem/39121999>
3188
3189         Reviewed by David Kilzer.
3190
3191         Revise our "lookalike character" logic to include the small
3192         Latin dum character.
3193
3194         Test: fast/url/host.html
3195
3196         * platform/mac/WebCoreNSURLExtras.mm:
3197         (WebCore::isLookalikeCharacter):
3198
3199 2018-04-11  Michael Catanzaro  <mcatanzaro@igalia.com>
3200
3201         [GTK] WaylandCompositorDisplay leaks its wl_display
3202         https://bugs.webkit.org/show_bug.cgi?id=184406
3203
3204         Reviewed by Carlos Garcia Campos.
3205
3206         Well, this was harder than expected. We really just want to fix a small leak in the WebKit
3207         layer, but that requires a change in how WaylandCompositorDisplay calls the
3208         PlatformDisplayWayland constructor, to pass NativeDisplayOwned::Yes. That means
3209         WaylandCompositorDisplay can no longer use PlatformDisplayWayland's protected default
3210         constructor. Problem is that the normal PlatformDisplayWayland constructor calls
3211         PlatformDisplayWayland::initialize, which calls PlatformDisplayWayland::registryGlobal,
3212         which is a virtual function. The WaylandCompositorDisplay portion of the object is not
3213         constructed yet at this point, so WaylandCompositorDisplay::registryGlobal will never be
3214         called if we do that. I had to revert the previous version of this fix due to this problem.
3215         It had broken accelerated compositing.
3216
3217         I'm reminded of Effective C++ item #9: Never call virtual functions during construction or
3218         destruction ("because such calls will never go to a more derived class than that of the
3219         currently executing constructor or destructor"). This code is fragile and likely to break
3220         again in the future, so let's refactor it a bit. Instead of calling initialize in the
3221         constructor, we'll call it from create functions. We'll have to add a couple create
3222         functions, and make the constructor protected to ensure it's not possible to create a
3223         PlatformDisplayWayland without initializing it. For good parallelism, do the same for the
3224         other PlatformDisplay classes.
3225
3226         This commit additionally removes PlatformDisplayWayland's protected default constructor,
3227         since it's not needed anymore.
3228
3229         The NativeDisplayOwned arguments to the PlatformDisplay constructors are now mandatory,
3230         instead of using NativeDisplayOwned::No as the default value, since that was dangerously
3231         close to being the cause of this leak, and the constructors are now accessed from private
3232         create functions anyway. Some more caution when using default parameter values is warranted
3233         in the future.
3234
3235         Lastly, since we have to change PlatformDisplay::createPlatformDisplay to use the new create
3236         functions, take the opportunity to move things around a bit for clarity. There should be no
3237         change in behavior. I was just disappointed that the PlatformDisplayWPE creation was at the
3238         bottom of the function, after a comment indicating that normal display creation has failed,
3239         which is not the case for WPE.
3240
3241         This all might have been a bit overkill, since the leak could probably have been fixed by
3242         passing nullptr to the PlatformDisplayWayland constructor for the wl_display and not
3243         removing WaylandCompositorDisplay's call to PlatformDisplayWayland::initialize. But the
3244         correctness of that code would then rely on implementation details of initialize, so this
3245         refactor seems better.
3246
3247         No new tests since there *should* be no behavior change. Then again, I'm touching
3248         PlatformDisplay, and history shows we don't have the greatest track record of touching this
3249         code without introducing problems.
3250
3251         * platform/graphics/PlatformDisplay.cpp:
3252         (WebCore::PlatformDisplay::createPlatformDisplay):
3253         * platform/graphics/PlatformDisplay.h:
3254         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
3255         (WebCore::PlatformDisplayWayland::create):
3256         (WebCore::PlatformDisplayWayland::create):
3257         (WebCore::PlatformDisplayWayland::createHeadless):
3258         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
3259         (WebCore::PlatformDisplayWayland::initialize):
3260         * platform/graphics/wayland/PlatformDisplayWayland.h:
3261         * platform/graphics/win/PlatformDisplayWin.h:
3262         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
3263         (WebCore::create):
3264         * platform/graphics/wpe/PlatformDisplayWPE.h:
3265         * platform/graphics/x11/PlatformDisplayX11.cpp:
3266         (WebCore::PlatformDisplayX11::create):
3267         (WebCore::PlatformDisplayX11::create):
3268         (WebCore::PlatformDisplayX11::createHeadless):
3269         * platform/graphics/x11/PlatformDisplayX11.h:
3270
3271 2018-04-11  Jianjun Zhu  <jianjun.zhu@intel.com>
3272
3273         Fix a WebRTC data channel issue for non-ASCII characters.
3274
3275         At the sender side, buffer size are calulcated after UTF8 encoding. At the
3276         receiver side, strings are constructed with UTF8 data.
3277
3278         https://bugs.webkit.org/show_bug.cgi?id=184481
3279
3280         Reviewed by Youenn Fablet.
3281
3282         Updated test:
3283         LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-expected.txt
3284
3285         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
3286         (WebCore::LibWebRTCDataChannelHandler::sendStringData):
3287         (WebCore::LibWebRTCDataChannelHandler::OnMessage):
3288
3289 2018-04-11  Antti Koivisto  <antti@apple.com>
3290
3291         ImageFrame type used by non-Cocoa image decoder should not be the same as that used by ImageSource
3292         https://bugs.webkit.org/show_bug.cgi?id=184418
3293
3294         Reviewed by Said Abou-Hallawa.
3295
3296         ScalableImageDecoder uses ImageFrame class which is meant to be an implementation detail of ImageSource.
3297         There are bunch of fields and methods in the type that are only used by one or the other client. For hackability
3298         there should be an unrelated frame type for ScalableImageDecoder.
3299
3300         This patch adds ScalableImageDecoderFrame type used in ScalableImageDecoder only. It then cleans up
3301         unneeded things from both ImageFrame and ScalableImageDecoderFrame.
3302
3303         * platform/ImageDecoders.cmake:
3304         * platform/graphics/ImageFrame.cpp:
3305         (WebCore::ImageFrame::operator=):
3306         (WebCore::ImageFrame::clearImage):
3307         (WebCore::ImageFrame::size const):
3308         (WebCore::ImageFrame::initialize): Deleted.
3309         * platform/graphics/ImageFrame.h:
3310         (WebCore::ImageFrame::setDisposalMethod): Deleted.
3311         (WebCore::ImageFrame::disposalMethod const): Deleted.
3312         (WebCore::ImageFrame::backingStore const): Deleted.
3313         (WebCore::ImageFrame::hasBackingStore const): Deleted.
3314         * platform/image-decoders/ScalableImageDecoder.cpp:
3315         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
3316         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
3317         (WebCore::ScalableImageDecoder::createFrameImageAtIndex):
3318         * platform/image-decoders/ScalableImageDecoder.h:
3319         * platform/image-decoders/ScalableImageDecoderFrame.cpp: Copied from Source/WebCore/platform/graphics/ImageFrame.cpp.
3320         (WebCore::ScalableImageDecoderFrame::ScalableImageDecoderFrame):
3321         (WebCore::ScalableImageDecoderFrame::~ScalableImageDecoderFrame):
3322         (WebCore::ScalableImageDecoderFrame::operator=):
3323         (WebCore::ScalableImageDecoderFrame::setDecodingStatus):
3324         (WebCore::ScalableImageDecoderFrame::decodingStatus const):
3325         (WebCore::ScalableImageDecoderFrame::clearImage):
3326         (WebCore::ScalableImageDecoderFrame::clear):
3327         (WebCore::ScalableImageDecoderFrame::initialize):
3328         (WebCore::ScalableImageDecoderFrame::size const):
3329         (WebCore::ImageFrame::ImageFrame): Deleted.
3330         (WebCore::ImageFrame::~ImageFrame): Deleted.
3331         (WebCore::ImageFrame::defaultFrame): Deleted.
3332         (WebCore::ImageFrame::operator=): Deleted.
3333         (WebCore::ImageFrame::setDecodingStatus): Deleted.
3334         (WebCore::ImageFrame::decodingStatus const): Deleted.
3335         (WebCore::ImageFrame::clearImage): Deleted.
3336         (WebCore::ImageFrame::clear): Deleted.
3337         (WebCore::ImageFrame::initialize): Deleted.
3338         (WebCore::ImageFrame::size const): Deleted.
3339         (WebCore::ImageFrame::hasNativeImage const): Deleted.
3340         (WebCore::ImageFrame::hasFullSizeNativeImage const): Deleted.
3341         (WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions const): Deleted.
3342         (WebCore::ImageFrame::singlePixelSolidColor const): Deleted.
3343         * platform/image-decoders/ScalableImageDecoderFrame.h: Copied from Source/WebCore/platform/graphics/ImageFrame.h.
3344         (WebCore::ScalableImageDecoderFrame::ScalableImageDecoderFrame):
3345         (WebCore::ScalableImageDecoderFrame::disposalMethod const):
3346         (WebCore::ScalableImageDecoderFrame::hasAlpha const):
3347         (WebCore::ScalableImageDecoderFrame::hasBackingStore const):
3348         (WebCore::ImageFrame::ImageFrame): Deleted.
3349         (WebCore::ImageFrame::isInvalid const): Deleted.
3350         (WebCore::ImageFrame::isPartial const): Deleted.
3351         (WebCore::ImageFrame::isComplete const): Deleted.
3352         (WebCore::ImageFrame::sizeRespectingOrientation const): Deleted.
3353         (WebCore::ImageFrame::frameBytes const): Deleted.
3354         (WebCore::ImageFrame::subsamplingLevel const): Deleted.
3355         (WebCore::ImageFrame::setDisposalMethod): Deleted.
3356         (WebCore::ImageFrame::disposalMethod const): Deleted.
3357         (WebCore::ImageFrame::nativeImage const): Deleted.
3358         (WebCore::ImageFrame::setOrientation): Deleted.
3359         (WebCore::ImageFrame::orientation const): Deleted.
3360         (WebCore::ImageFrame::setDuration): Deleted.
3361         (WebCore::ImageFrame::duration const): Deleted.
3362         (WebCore::ImageFrame::setHasAlpha): Deleted.
3363         (WebCore::ImageFrame::hasAlpha const): Deleted.
3364         (WebCore::ImageFrame::hasNativeImage): Deleted.
3365         (WebCore::ImageFrame::hasFullSizeNativeImage): Deleted.
3366         (WebCore::ImageFrame::hasMetadata const): Deleted.
3367         (WebCore::ImageFrame::backingStore const): Deleted.
3368         (WebCore::ImageFrame::hasBackingStore const): Deleted.
3369         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
3370         (WebCore::BMPImageDecoder::frameBufferAtIndex):
3371         * platform/image-decoders/bmp/BMPImageDecoder.h:
3372         * platform/image-decoders/bmp/BMPImageReader.h:
3373         (WebCore::BMPImageReader::setBuffer):
3374         * platform/image-decoders/gif/GIFImageDecoder.cpp:
3375         (WebCore::GIFImageDecoder::findFirstRequiredFrameToDecode):
3376         (WebCore::GIFImageDecoder::frameBufferAtIndex):
3377         (WebCore::GIFImageDecoder::clearFrameBufferCache):
3378         (WebCore::GIFImageDecoder::haveDecodedRow):
3379         (WebCore::GIFImageDecoder::frameComplete):
3380         (WebCore::GIFImageDecoder::initFrameBuffer):
3381         * platform/image-decoders/gif/GIFImageDecoder.h:
3382         * platform/image-decoders/gif/GIFImageReader.cpp:
3383         (GIFImageReader::parse):
3384         * platform/image-decoders/gif/GIFImageReader.h:
3385         (GIFFrameContext::GIFFrameContext):
3386         * platform/image-decoders/ico/ICOImageDecoder.cpp:
3387         (WebCore::ICOImageDecoder::frameBufferAtIndex):
3388         * platform/image-decoders/ico/ICOImageDecoder.h:
3389         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
3390         (WebCore::JPEGImageDecoder::frameBufferAtIndex):
3391         (WebCore::setPixel):
3392         (WebCore::JPEGImageDecoder::outputScanlines):
3393         (WebCore::JPEGImageDecoder::jpegComplete):
3394         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
3395         * platform/image-decoders/png/PNGImageDecoder.cpp:
3396         (WebCore::PNGImageDecoder::frameBufferAtIndex):
3397         (WebCore::PNGImageDecoder::rowAvailable):
3398         (WebCore::PNGImageDecoder::readChunks):
3399         (WebCore::PNGImageDecoder::clearFrameBufferCache):
3400         (WebCore::PNGImageDecoder::initFrameBuffer):
3401         (WebCore::PNGImageDecoder::frameComplete):
3402         * platform/image-decoders/png/PNGImageDecoder.h:
3403         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
3404         (WebCore::WEBPImageDecoder::frameBufferAtIndex):
3405         (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
3406         (WebCore::WEBPImageDecoder::decodeFrame):
3407         (WebCore::WEBPImageDecoder::initFrameBuffer):
3408         (WebCore::WEBPImageDecoder::applyPostProcessing):
3409         (WebCore::WEBPImageDecoder::clearFrameBufferCache):
3410         * platform/image-decoders/webp/WEBPImageDecoder.h:
3411
3412 2018-04-11  Antoine Quint  <graouts@apple.com>
3413
3414         [Web Animations] Turn Web Animations on by default
3415         https://bugs.webkit.org/show_bug.cgi?id=184491
3416
3417         Reviewed by Simon Fraser.
3418
3419         * page/RuntimeEnabledFeatures.h:
3420
3421 2018-04-11  Ryosuke Niwa  <rniwa@webkit.org>
3422
3423         Fix warning in HashTools.h for newer versions of clang
3424         https://bugs.webkit.org/show_bug.cgi?id=184489
3425
3426         Reviewed by Alexey Proskuryakov.
3427
3428         Removed "register" storage class specififer as it has been deprecated in C++11.
3429
3430         * platform/HashTools.h:
3431
3432 2018-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>
3433
3434         FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it
3435         https://bugs.webkit.org/show_bug.cgi?id=183395
3436         <rdar://problem/38055732>
3437
3438         Reviewed by Zalan Bujtas.
3439
3440         In the case where a FrameSelection updates its appearance when m_appearanceUpdateTimer is fired, the
3441         FrameSelection's Frame is unprotected, and can be removed by arbitrary script. This patch applies a simple
3442         mitigation by wrapping the Frame in a Ref when firing the appearance update timer.
3443
3444         Test: editing/selection/iframe-update-selection-appearance.html
3445
3446         * editing/FrameSelection.cpp:
3447         (WebCore::FrameSelection::appearanceUpdateTimerFired):
3448
3449 2018-04-10  Brent Fulgham  <bfulgham@apple.com>
3450
3451         Unreviewed follow-up to r230468.
3452
3453         Switch some RELEASE_ASSERTs in hot codepaths to normal DEBUG asserts.
3454
3455         * page/mac/EventHandlerMac.mm:
3456         (WebCore::lastEventIsMouseUp):
3457         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
3458         * platform/mac/EventLoopMac.mm:
3459         (WebCore::EventLoop::cycle):
3460
3461 2018-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>
3462