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