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