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