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