Remove RenderElement::s_noLongerAffectsParentBlock
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-03-01  Zalan Bujtas  <zalan@apple.com>
2
3         Remove RenderElement::s_noLongerAffectsParentBlock
4         https://bugs.webkit.org/show_bug.cgi?id=183196
5         <rdar://problem/38030797>
6
7         Reviewed by Antti Koivisto.
8
9         Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.
10
11         Covered by existing tests.
12
13         * rendering/RenderBlockFlow.cpp:
14         (WebCore::RenderBlockFlow::styleDidChange):
15         * rendering/RenderElement.cpp:
16         (WebCore::RenderElement::styleWillChange):
17         (WebCore::RenderElement::noLongerAffectsParentBlock const):
18         (WebCore::RenderElement::styleDidChange):
19         * rendering/RenderElement.h:
20         (WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.
21
22 2018-03-01  Chris Dumez  <cdumez@apple.com>
23
24         imported/w3c/web-platform-tests/html/browsers/windows/browsing-context.html fails with async policy delegates
25         https://bugs.webkit.org/show_bug.cgi?id=183225
26         <rdar://problem/38003828>
27
28         Reviewed by Alex Christensen.
29
30         Bypass navigation policy check when loading about:blank. This does not seem necessary and it would not
31         be Web-compatible for such policy check to happen synchronously. This is because an iframe without src
32         or src="about:blank" should load synchronously as per HTML specification.
33
34         Test: http/wpt/html/browsers/windows/browsing-context.html
35
36         * loader/PolicyChecker.cpp:
37         (WebCore::PolicyChecker::checkNavigationPolicy):
38
39 2018-03-01  Christopher Reid  <chris.reid@sony.com>
40
41         [Curl] Linker errors in some curl files due to missing exports
42         https://bugs.webkit.org/show_bug.cgi?id=183238
43
44         Reviewed by Alex Christensen.
45
46         No new tests, no change in behavior.
47
48         Adding WEBCORE_EXPORT to functions now used in WebKit.
49
50         * platform/network/NetworkStorageSession.h:
51         * platform/network/curl/CookieJarDB.h:
52         * platform/network/curl/CurlContext.h:
53
54 2018-03-01  Commit Queue  <commit-queue@webkit.org>
55
56         Unreviewed, rolling out r229130.
57         https://bugs.webkit.org/show_bug.cgi?id=183244
58
59         It breaks AppleWin compilation (Requested by alexg__ on
60         #webkit).
61
62         Reverted changeset:
63
64         "Make LibWebRTCProvider port agnostic again after r215424"
65         https://bugs.webkit.org/show_bug.cgi?id=183080
66         https://trac.webkit.org/changeset/229130
67
68 2018-03-01  Alejandro G. Castro  <alex@igalia.com>
69
70         Make LibWebRTCProvider port agnostic again after r215424
71         https://bugs.webkit.org/show_bug.cgi?id=183080
72
73         Reviewed by Youenn Fablet.
74
75         In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
76         we have moved that code to the cocoa class and created a glib implementation that will be used in the future
77         to implement the LibWebRTCProviderGlib class.
78
79         No new tests, this is a refactor.
80
81         * Sources.txt: Add the compilation of the new file.
82         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
83         (WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
84         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
85         (WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
86         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
87         (WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
88         linking libwebrtc for the moment in these situations.
89
90 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
91
92         [FreeType] Color emojis in WebKitGTK+ for great justice
93         https://bugs.webkit.org/show_bug.cgi?id=183155
94
95         Reviewed by Michael Catanzaro.
96
97         Emojis are actually rendered if there's an emoji font installed in the system, but the size is so tiny that we
98         don't see them. This is because for some reason the matrix we are getting from fontconfig contains a scale,
99         which we don't expect. We only get the fontconfig matrix to apply rotations in case of oblique fonts, and then we
100         always apply the scale for the computed pixel font size. Ignoring the fontconfig matrix scale fixes the issue.
101
102         * platform/graphics/freetype/FontCacheFreeType.cpp:
103         (WebCore::fontWeightToFontconfigWeight): Moved here since it's now used by configurePatternForFontDescription().
104         (WebCore::configurePatternForFontDescription): Helper function to apply the same options for fallback pattern.
105         (WebCore::createFontConfigPatternForCharacters): Use configurePatternForFontDescription().
106         (WebCore::findBestFontGivenFallbacks): Adopt the returned reference.
107         (WebCore::FontCache::systemFallbackForCharacters): Clean it up.
108         (WebCore::FontCache::createFontPlatformData): Use configurePatternForFontDescription().
109         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
110         (WebCore::FontPlatformData::buildScaledFont): Ignore the scale returned by fontconfig matrix.
111
112 2018-02-28  Philippe Normand  <pnormand@igalia.com>
113
114         [GStreamer] text samples no longer processed
115         https://bugs.webkit.org/show_bug.cgi?id=183212
116
117         Reviewed by Xabier Rodriguez-Calvar.
118
119         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
120         (WebCore::MediaPlayerPrivateGStreamer::newTextSample): Refer to
121         track stream ID instead of (potentially) manually generated track
122         ID stored as hashmap keys.
123
124 2018-02-28  Tim Horton  <timothy_horton@apple.com>
125
126         Push WTF_PLATFORM_IOS down into preprocessor.pm instead of trying to determine it inside
127         https://bugs.webkit.org/show_bug.cgi?id=183193
128
129         Reviewed by Andy Estes.
130
131         * DerivedSources.make:
132         * bindings/scripts/preprocessor.pm:
133         (applyPreprocessor):
134         Instead of trying to discern WTF_PLATFORM_IOS inside preprocessor.pm,
135         push it down from DerivedSources.make. Also clean up DerivedSources.make
136         a tiny bit by adding a variable, FEATURE_AND_PLATFORM_DEFINES, which
137         contains both FEATURE_DEFINES and WTF_PLATFORM macros if needed.
138
139 2018-02-28  Nan Wang  <n_wang@apple.com>
140
141         AX: AOM: Dispatch accessiblesetvalue event
142         https://bugs.webkit.org/show_bug.cgi?id=183021
143         <rdar://problem/37764242>
144
145         Reviewed by Chris Fleizach.
146
147         Accessibility events.
148         Spec: https://wicg.github.io/aom/spec/phase2.html
149
150         Added a new event type AccessibleSetValueEvent. 
151
152         Test: accessibility/mac/AOM-event-accessiblesetvalue.html
153
154         * CMakeLists.txt:
155         * DerivedSources.make:
156         * Sources.txt:
157         * WebCore.xcodeproj/project.pbxproj:
158         * accessibility/AccessibilityAllInOne.cpp:
159         * accessibility/AccessibilityNodeObject.cpp:
160         (WebCore::AccessibilityNodeObject::canSetValueAttribute const):
161         * accessibility/AccessibilityObject.cpp:
162         (WebCore::AccessibilityObject::press):
163         (WebCore::AccessibilityObject::dispatchAccessibilityEvent):
164         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent):
165         * accessibility/AccessibilityObject.h:
166         * accessibility/AccessibilityRenderObject.cpp:
167         (WebCore::AccessibilityRenderObject::setValue):
168         * accessibility/AccessibilityScrollbar.cpp:
169         (WebCore::AccessibilityScrollbar::setValue):
170         * accessibility/AccessibilitySlider.cpp:
171         (WebCore::AccessibilitySlider::setValue):
172         * accessibility/AccessibleSetValueEvent.cpp: Added.
173         (WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent):
174         * accessibility/AccessibleSetValueEvent.h: Added.
175         (WebCore::AccessibleSetValueEvent::create):
176         (WebCore::AccessibleSetValueEvent::value const):
177         * accessibility/AccessibleSetValueEvent.idl: Added.
178         * dom/Element.idl:
179         * dom/EventNames.h:
180         * dom/EventNames.in:
181
182 2018-02-28  Chris Dumez  <cdumez@apple.com>
183
184         html/browsers/browsing-the-web/navigating-across-documents/006.html fails with async policy delegates
185         https://bugs.webkit.org/show_bug.cgi?id=183168
186         <rdar://problem/37951341>
187
188         Reviewed by Alex Christensen.
189
190         The test has an anchor element with both a 'click' event handler which submits a form
191         and an href attribute. When clicking the link, as per specification, things happen in
192         this order:
193         1. We fire the click event at the anchor, which will execute the event handler and submit the form.
194            Submitting the form *schedules* a navigation to 'click.html'.
195         2. We execute the anchor activation code which *navigates* to 'href.html'. The navigation to
196            'href' is supposed to cancel the pending navigation to 'click.html' and we should navigate
197            to 'href.html', which is what the test asserts.
198
199         The issue for us is that we do not cancel pending navigations until after the navigation
200         policy decision is made, when the provisional loads actually starts, in FrameLoader::provisionalLoadStarted().
201         Because the policy decision for the navigation can now be made asynchronously, the NavigationScheduler
202         timer can now fire while the decision is made and we'll submit the form, thus navigating to
203         'click.html'.
204
205         To address the issue, we now cancel any pending navigations in FrameLoader::loadWithDocumentLoader(),
206         *before* doing the policy check for the navigation.
207
208         Test: http/wpt/html/browsers/browsing-the-web/navigating-across-documents/006.html
209
210         * loader/FrameLoader.cpp:
211         (WebCore::FrameLoader::loadWithDocumentLoader):
212
213 2018-02-28  John Wilander  <wilander@apple.com>
214
215         Add a second tier of prevalence to facilitate telemetry on very prevalent domains
216         https://bugs.webkit.org/show_bug.cgi?id=183218
217         <rdar://problem/37992388>
218
219         Reviewed by Brent Fulgham.
220
221         Test: http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html
222
223         * loader/ResourceLoadStatistics.cpp:
224         (WebCore::ResourceLoadStatistics::encode const):
225         (WebCore::ResourceLoadStatistics::decode):
226         (WebCore::ResourceLoadStatistics::toString const):
227         (WebCore::ResourceLoadStatistics::merge):
228             Handling of the new boolean field isVeryPrevalentResource.
229         * loader/ResourceLoadStatistics.h:
230             Added the new boolean field isVeryPrevalentResource.
231
232 2018-02-28  Alex Christensen  <achristensen@webkit.org>
233
234         Reduce use of NetworkingContext in WebKit
235         https://bugs.webkit.org/show_bug.cgi?id=183213
236
237         Reviewed by Brady Eidson.
238
239         NetworkingContext is intended to be used only with ResourceHandle, which is now only used in WebKitLegacy.
240         Now that we don't use ResourceHandle in the WebProcess, everything that was done through the NetworkingContext
241         can now be done a cleaner way with no change in behavior.
242
243         * loader/FrameLoader.cpp:
244         (WebCore::FrameLoader::loadResourceSynchronously):
245         * loader/LinkLoader.cpp:
246         (WebCore::LinkLoader::loadLink):
247         * loader/LoaderStrategy.h:
248         * platform/network/ProxyServer.h:
249         * platform/network/cf/ProxyServerCFNet.cpp:
250         (WebCore::proxyServersForURL):
251         * platform/network/curl/ProxyServerCurl.cpp:
252         (WebCore::proxyServersForURL):
253         * platform/network/soup/ProxyServerSoup.cpp:
254         (WebCore::proxyServersForURL):
255
256 2018-02-28  Zalan Bujtas  <zalan@apple.com>
257
258         Remove RenderElement::s_affectsParentBlock
259         https://bugs.webkit.org/show_bug.cgi?id=183187
260         <rdar://problem/37961079>
261
262         Reviewed by Antti Koivisto.
263
264         Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.
265
266         Covered by existing tests.
267
268         * rendering/RenderElement.cpp:
269         (WebCore::RenderElement::styleWillChange):
270         (WebCore::RenderElement::styleDidChange):
271         * rendering/RenderElement.h:
272
273 2018-02-28  Antti Koivisto  <antti@apple.com>
274
275         Filter attribute selectors with selector filter
276         https://bugs.webkit.org/show_bug.cgi?id=183200
277
278         Reviewed by Zalan Bujtas.
279
280         Currently selector filtering is done based on tags, classes and ids. We should include attributes too.
281
282         This patch adds filtering based on attribute name (but not content).
283
284         * css/SelectorFilter.cpp:
285         (WebCore::isExcludedAttribute):
286
287             Ignore id, class and style attributes. First two are already handled and the last is common but is rarely
288             used in selectors.
289
290         (WebCore::collectElementIdentifierHashes):
291
292             Collect attributes.
293             Remove the unnecessary StyledElement casting.
294
295         (WebCore::collectSimpleSelectorHash):
296
297             Collect attribute selectors.
298
299         (WebCore::chooseSelectorHashesForFilter):
300
301             Pick attributes with high priority for the filter as it is likely a good signal.
302
303 2018-02-27  Sergio Villar Senin  <svillar@igalia.com>
304
305         [WebVR] Convert VRPlatformDisplayInfo into a class
306         https://bugs.webkit.org/show_bug.cgi?id=183162
307
308         Reviewed by Žan Doberšek.
309
310         In preparation for further changes we're transforming the
311         VRPlatformDisplayInfo into a class. All the members are now private
312         and the class provides the needed getters/setters.
313
314         Apart from that VRDisplayCapabilityFlags is now just an unsigned and
315         the different flags are defined in VRDisplayCapabilityFlag enum.
316         Another cleanup was the removal of VRDisplayCapabilities.cpp as
317         everything can be implemented in the header.
318
319         * Modules/webvr/VRDisplay.cpp:
320         (WebCore::VRDisplay::VRDisplay):
321         (WebCore::VRDisplay::isConnected const):
322         (WebCore::VRDisplay::stageParameters const):
323         * Modules/webvr/VRDisplayCapabilities.cpp: Removed.
324         * Modules/webvr/VRDisplayCapabilities.h:
325         (WebCore::VRDisplayCapabilities::hasPosition const):
326         (WebCore::VRDisplayCapabilities::hasOrientation const):
327         (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
328         (WebCore::VRDisplayCapabilities::canPresent const):
329         (WebCore::VRDisplayCapabilities::maxLayer const):
330         (WebCore::VRDisplayCapabilities::VRDisplayCapabilities):
331         * Sources.txt:
332         * platform/vr/VRPlatformDisplay.h:
333         (WebCore::VRPlatformDisplayInfo::displayName const):
334         (WebCore::VRPlatformDisplayInfo::setDisplayName):
335         (WebCore::VRPlatformDisplayInfo::isConnected const):
336         (WebCore::VRPlatformDisplayInfo::setIsConnected):
337         (WebCore::VRPlatformDisplayInfo::isMounted const):
338         (WebCore::VRPlatformDisplayInfo::setIsMounted):
339         (WebCore::VRPlatformDisplayInfo::capabilityFlags const):
340         (WebCore::VRPlatformDisplayInfo::setCapabilityFlags):
341         (WebCore::VRPlatformDisplayInfo::displayIdentifier const):
342         (WebCore::VRPlatformDisplayInfo::setDisplayIdentifier):
343         (WebCore::VRPlatformDisplayInfo::eyeTranslation const):
344         (WebCore::VRPlatformDisplayInfo::setEyeTranslation):
345         (WebCore::VRPlatformDisplayInfo::eyeFieldOfView const):
346         (WebCore::VRPlatformDisplayInfo::setEyeFieldOfView):
347         (WebCore::VRPlatformDisplayInfo::renderSize const):
348         (WebCore::VRPlatformDisplayInfo::setRenderSize):
349         (WebCore::VRPlatformDisplayInfo::setPlayAreaBounds):
350         (WebCore::VRPlatformDisplayInfo::playAreaBounds const):
351         (WebCore::VRPlatformDisplayInfo::setSittingToStandingTransform):
352         (WebCore::VRPlatformDisplayInfo::sittingToStandingTransform const):
353         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
354         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
355         (WebCore::VRPlatformDisplayOpenVR::updateEyeParameters):
356         (WebCore::VRPlatformDisplayOpenVR::updateStageParameters):
357
358 2018-02-27  Commit Queue  <commit-queue@webkit.org>
359
360         Unreviewed, rolling out r229060.
361         https://bugs.webkit.org/show_bug.cgi?id=183198
362
363         This patch causes crashes on two SVG tests (Requested by fredw
364         on #webkit).
365
366         Reverted changeset:
367
368         "Relayout frames after AsyncFrameScrolling or FrameFlattening
369         option is changed"
370         https://bugs.webkit.org/show_bug.cgi?id=183081
371         https://trac.webkit.org/changeset/229060
372
373 2018-02-27  Youenn Fablet  <youenn@apple.com>
374
375         Do not trigger a service worker match in case of document redirection if it will be already served by AppCache
376         https://bugs.webkit.org/show_bug.cgi?id=183185
377         <rdar://problem/37693796>
378
379         Reviewed by Chris Dumez.
380
381         Disabling service worker matching in case there is a substitute data.
382         Otherwise there is a risk for a double load, substitute data first and the new load
383         triggered if matching a new registration.
384         A future fix should first do service worker registration matching and if there is no registration query appcache.
385
386         Test: http/tests/appcache/main-resource-redirect-with-sw.html
387
388         * loader/DocumentLoader.cpp:
389         (WebCore::DocumentLoader::redirectReceived):
390
391 2018-02-27  Tim Horton  <timothy_horton@apple.com>
392
393         Ensure target triple is propagated correctly to DerivedSources.make
394         https://bugs.webkit.org/show_bug.cgi?id=183189
395         <rdar://problem/37959694>
396
397         Reviewed by Dan Bernstein.
398
399         If we don't propagate the target triple, we can sometimes build with
400         the wrong options enabled.
401
402         * Configurations/Base.xcconfig:
403         Mentioning LLVM_TARGET_TRIPLE_SUFFIX here is required to get it to be available to scripts.
404
405         * DerivedSources.make:
406         Propagate the target triple into our compiler invocations.
407
408 2018-02-27  Doug Russell  <doug@getitdownonpaper.com>
409
410         AX: Spell check and style attributes should be optional when fetching attributed string
411         https://bugs.webkit.org/show_bug.cgi?id=160744
412
413         Reviewed by Chris Fleizach.
414
415         The overhead of fetching a spell checked attributed string via AX API is substantial. 
416         In some cases on the order of 7/8 of the total time spent fetching the string.
417
418         This change introduces the new attribute AXAttributedStringForTextMarkerRangeWithOptions which accepts an NSDictionary as it's parameter with keys "AXTextMarkerRange" (AXTextMarkerRangeRef) and "AXSpellCheck" (NSNumber(BOOL)).
419
420         AXAttributedStringForTextMarkerRange will remain unchanged.
421
422         Tests: accessibility/mac/attributed-string/attributed-string-for-range-with-options.html
423                accessibility/mac/attributed-string/attributed-string-for-range.html
424
425         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
426         (AXAttributedStringAppendText):
427         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
428         (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
429         (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]):
430         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
431         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Deleted.
432
433 2018-02-27  Daniel Bates  <dabates@apple.com>
434
435         Standardize terminology for marked text
436         https://bugs.webkit.org/show_bug.cgi?id=180999
437
438         Reviewed by Zalan Bujtas.
439
440         The name MarkerSubrange is a misnomer for a data structure that associates a text subrange with a type
441         and optional document marker. In particular, a MarkerSubrange may not always correspond to a document
442         marker. For instance, selected text is represented using a MarkerSubrange that does not have a
443         corresponding document marker. Let's standardize on the phrase "marked text" as the canonical way to
444         describe these tagged text subranges.
445
446         * Sources.txt:
447         * WebCore.xcodeproj/project.pbxproj:
448         * rendering/InlineTextBox.cpp:
449         (WebCore::InlineTextBox::localSelectionRect const):
450         (WebCore::InlineTextBox::MarkedTextStyle::areBackgroundMarkedTextStylesEqual):
451         (WebCore::InlineTextBox::MarkedTextStyle::areForegroundMarkedTextStylesEqual):
452         (WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual):
453         (WebCore::InlineTextBox::StyledMarkedText::StyledMarkedText):
454         (WebCore::createMarkedTextFromSelectionInBox):
455         (WebCore::InlineTextBox::paint):
456         (WebCore::InlineTextBox::paintPlatformDocumentMarkers):
457         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
458         (WebCore::InlineTextBox::computeStyleForUnmarkedMarkedText const):
459         (WebCore::InlineTextBox::resolveStyleForMarkedText):
460         (WebCore::InlineTextBox::subdivideAndResolveStyle):
461         (WebCore::InlineTextBox::coalesceAdjacentMarkedTexts):
462         (WebCore::InlineTextBox::collectMarkedTextsForDraggedContent):
463         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers):
464         (WebCore::InlineTextBox::paintMarkedTexts):
465         (WebCore::InlineTextBox::paintMarkedTextBackground):
466         (WebCore::InlineTextBox::paintMarkedTextForeground):
467         (WebCore::InlineTextBox::paintMarkedTextDecoration):
468         (WebCore::InlineTextBox::paintCompositionBackground):
469         (WebCore::InlineTextBox::MarkerSubrangeStyle::areBackgroundMarkerSubrangeStylesEqual): Deleted.
470         (WebCore::InlineTextBox::MarkerSubrangeStyle::areForegroundMarkerSubrangeStylesEqual): Deleted.
471         (WebCore::InlineTextBox::MarkerSubrangeStyle::areDecorationMarkerSubrangeStylesEqual): Deleted.
472         (WebCore::InlineTextBox::StyledMarkerSubrange::StyledMarkerSubrange): Deleted.
473         (WebCore::createMarkerSubrangeFromSelectionInBox): Deleted.
474         (WebCore::InlineTextBox::computeStyleForUnmarkedMarkerSubrange const): Deleted.
475         (WebCore::InlineTextBox::resolveStyleForSubrange): Deleted.
476         (WebCore::InlineTextBox::coalesceAdjacentSubranges): Deleted.
477         (WebCore::InlineTextBox::collectSubrangesForDraggedContent): Deleted.
478         (WebCore::InlineTextBox::collectSubrangesForDocumentMarkers): Deleted.
479         (WebCore::InlineTextBox::paintMarkerSubranges): Deleted.
480         (WebCore::InlineTextBox::paintTextSubrangeBackground): Deleted.
481         (WebCore::InlineTextBox::paintTextSubrangeForeground): Deleted.
482         (WebCore::InlineTextBox::paintTextSubrangeDecoration): Deleted.
483         * rendering/InlineTextBox.h:
484         (WebCore::InlineTextBox::paintMarkedTexts):
485         (WebCore::InlineTextBox::paintMarkerSubranges): Deleted.
486         * rendering/MarkedText.cpp: Renamed from Source/WebCore/rendering/MarkerSubrange.cpp.
487         (WebCore::subdivide):
488         * rendering/MarkedText.h: Renamed from Source/WebCore/rendering/MarkerSubrange.h.
489         (WebCore::MarkedText::MarkedText):
490         (WebCore::MarkedText::isEmpty const):
491         (WebCore::MarkedText::operator!= const):
492         (WebCore::MarkedText::operator== const):
493
494 2018-02-27  Chris Dumez  <cdumez@apple.com>
495
496         Unreviewed, roll out r228430.
497
498         Roll out r228430 now that it is no longer needed after r228852.
499
500         No new tests, initial fix is still covered by WebKit.RespondToPolicyForNavigationResponseAsynchronously
501         API test.
502
503         * loader/FrameLoader.cpp:
504         (WebCore::FrameLoader::stopLoading):
505         * loader/NavigationScheduler.cpp:
506         (WebCore::NavigationScheduler::schedule):
507
508 2018-02-27  Antoine Quint  <graouts@apple.com>
509
510         [Web Animations] Correct implementation of pending tasks and promises
511         https://bugs.webkit.org/show_bug.cgi?id=183161
512
513         Reviewed by Dean Jackson.
514
515         We had an incorrect implementation of the spec due to two misinterpretations.
516
517         The first one is about pending tasks (play and pause) which the spec says should
518         be performed by "scheduling a task". In WebCore, this means using postTask() on a
519         ScriptExecutionContext, such as Document. One of the big practical changes is that
520         calling play() on an animation correctly sets its startTime to null (unresolved)
521         immediately after the call to play() returns before setting it to a resolved value
522         when the task is performed asynchronously. As a result, the playState is now always
523         accurate.
524
525         The second one is about promises where new promises need to be created in certain
526         situations called out by the spec. We used to call clear() on them, but this merely
527         resets the fulfillment or rejection state of the promise, while the spec requires
528         a different object to be returned for the promise. We now create our promises using
529         makeUniqueRef<> when new promise objects are expected to be created.
530
531         This patch also corrects a few smaller bugs and spec compliant issues, called out
532         below, related to pending tasks and promises uncovered while looking at relevant
533         WPT tests.
534
535         * animation/DocumentTimeline.h: Expose the Document used to create this timeline such
536         that it may be used by WebAnimation objects registered for this timeline when scheduling
537         a task is required via postTask().
538         * animation/WebAnimation.cpp:
539         (WebCore::WebAnimation::WebAnimation):
540         (WebCore::WebAnimation::setBindingsStartTime):
541         (WebCore::WebAnimation::setCurrentTime):
542         (WebCore::WebAnimation::cancel): Ensure the finished promise has not already been fulfilled
543         before rejecting it. While the spec does not specifically call this out, a promise may not
544         be rejected after being fulfilled, and we would hit an ASSERT if we didn't also check that
545         it was in the correct pending state before attemping to reject it.
546         (WebCore::WebAnimation::resetPendingTasks):
547         (WebCore::WebAnimation::finish):
548         (WebCore::WebAnimation::updateFinishedState):
549         (WebCore::WebAnimation::finishNotificationSteps):
550         (WebCore::WebAnimation::play): We used to only check for a pending pause task before canceling
551         that task, but the spec says to check for either a pending pause or play task (ie. pending())
552         and to cancel whichever is scheduled.
553         (WebCore::WebAnimation::runPendingPlayTask): We were missing an assertion called out by the
554         spec when running a pending task.
555         (WebCore::WebAnimation::pause):
556         (WebCore::WebAnimation::runPendingPauseTask):
557         (WebCore::WebAnimation::updatePendingTasks): We now use postTask() on the animation's associated
558         timeline's document to schedule pending tasks for which the criteria to run are met, ie. there
559         is an associated timeline.
560         * animation/WebAnimation.h:
561
562 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
563
564         [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior
565         https://bugs.webkit.org/show_bug.cgi?id=183100
566         <rdar://problem/37840987>
567
568         Reviewed by Tim Horton.
569
570         Introduce new customization options to ViewportConfiguration. The first is m_forceHorizontalShrinkToFit, which
571         (when set to true) forces the viewport to scale using shrink-to-fit heuristics, regardless of whether
572         "shrink-to-fit=no" is specified via viewport parameters or if content width did not exceed minimum layout size.
573         The second is m_viewSize, which reflects the true size of the viewport. See WebKit ChangeLog for more details.
574
575         Tests: ViewportSizingTests.ForceShrinkToFitViewportOverridesViewportParameters
576                ViewportSizingTests.ShrinkToFitViewportWithMinimumAllowedLayoutWidth
577
578         * page/ViewportConfiguration.cpp:
579         (WebCore::ViewportConfiguration::ViewportConfiguration):
580         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
581
582         Plumb the real size of the view alongside the minimum layout size when updating the minimum layout size.
583
584         (WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit):
585         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
586
587         Bail early and return true if forceHorizontalShrinkToFit is set. This forces shrink-to-fit even in cases where
588         "shrink-to-fit" is set to "no", or content dimensions don't exceed layout dimensions.
589
590         (WebCore::ViewportConfiguration::initialScaleFromSize const):
591
592         Use view dimensions rather than minimum layout dimensions when computing the initial scale. Minimum layout size
593         is no longer always equal to the size of the view if the client has specified a minimum allowed layout width. As
594         such, when computing the initial scale, to ensure that the content (which was laid out using the minimum layout
595         size) fits within the real viewport, we need to divide real viewport dimensions by content dimensions.
596
597         (WebCore::ViewportConfiguration::minimumScale const):
598
599         Similarly, use view size instead of minimum layout size to compute minimum scale.
600
601         (WebCore::ViewportConfiguration::description const):
602         * page/ViewportConfiguration.h:
603
604 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
605
606         Unreviewed, fix the debug build after r228877.
607
608         In the case where CAN_DISALLOW_USER_INSTALLED_FONTS is enabled, this function doesn't return anything when
609         allowUserInstalledFonts != AllowUserInstalledFonts::No. Fix the build by moving `return nullptr;` back out of
610         the `#else`.
611
612         * platform/graphics/cocoa/FontCacheCoreText.cpp:
613         (WebCore::installedFontMandatoryAttributes):
614
615 2018-02-27  Milan Crha  <mcrha@redhat.com>
616
617         Potential privacy issue: DNS prefetching can be re-enabled
618         https://bugs.webkit.org/show_bug.cgi?id=182924
619
620         Reviewed by Michael Catanzaro.
621
622         * dom/Document.cpp:
623         (WebCore::Document::parseDNSPrefetchControlHeader):
624
625 2018-02-26  Antoine Quint  <graouts@apple.com>
626
627         [Web Animations] Implement the procedure to set the target effect of an animation
628         https://bugs.webkit.org/show_bug.cgi?id=183146
629
630         Reviewed by Dean Jackson.
631
632         We only had a partial implementation of setEffect() and we now update it to cover the entire
633         implementation as mandated by the spec. While this doesn't yield any WPT results changes, this
634         patch will help getting a significant number of new PASS results when we get around to implement
635         correct support for async procedures (pending pause/play tasks and promises) in the next patch.
636
637         * animation/WebAnimation.cpp:
638         (WebCore::WebAnimation::setEffect):
639
640 2018-02-26  Antoine Quint  <graouts@apple.com>
641
642         [Web Animations] Update the playState implementation
643         https://bugs.webkit.org/show_bug.cgi?id=183145
644
645         Reviewed by Dean Jackson.
646
647         The Web Animations spec has changed since we first implemented the playState property and the "pending"
648         enum value has been dropped since then (there is a separate "pending" property which we also implement).
649         We update our implementation to match the latest spec text. This does not change WPT test results a lot,
650         but this patch will help getting a significant number of new PASS results when we get around to implementing
651         correct support for async procedures (pending pause/play tasks and promises) in a couple of patches.
652   
653         * animation/WebAnimation.cpp:
654         (WebCore::WebAnimation::playState const):
655         * animation/WebAnimation.h:
656         * animation/WebAnimation.idl:
657
658 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
659
660         Address post-review comment after r229049.
661         https://bugs.webkit.org/show_bug.cgi?id=183142
662
663         Reviewed by Tim Horton.
664
665         Wrap a newly added string literal with ASCIILiteral.
666
667         * rendering/RenderThemeIOS.mm:
668         (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
669
670 2018-02-26  Mark Lam  <mark.lam@apple.com>
671
672         Modernize FINALIZE_CODE and peer macros to use __VA_ARGS__ arguments.
673         https://bugs.webkit.org/show_bug.cgi?id=183159
674         <rdar://problem/37930837>
675
676         Reviewed by Keith Miller.
677
678         No new tests needed because this is just a refactoring patch.
679
680         * cssjit/SelectorCompiler.cpp:
681         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
682
683 2018-02-26  Dan Bernstein  <mitz@apple.com>
684
685         Removed references to files that were removed in r228912.
686
687         * WebCore.xcodeproj/project.pbxproj: Removed references to SourcesIOS.txt and SourcesMac.txt.
688
689 2018-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
690
691         [Extra zoom mode] Tweak UA stylesheet to improve legibility of rendered text
692         https://bugs.webkit.org/show_bug.cgi?id=183142
693         <rdar://problem/37912966>
694
695         Reviewed by Tim Horton.
696
697         Force text-size-adjust and hyphens to be always on in EXTRA_ZOOM_MODE. To accomplish this, we override the extra
698         style sheet in RenderTheme to include these two style rules.
699
700         * rendering/RenderThemeIOS.h:
701         * rendering/RenderThemeIOS.mm:
702         (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
703
704 2018-02-26  Don Olmstead  <don.olmstead@sony.com>
705
706         Fix WebCore includes within WebKitLegacy
707         https://bugs.webkit.org/show_bug.cgi?id=183147
708
709         Reviewed by Tim Horton.
710
711         No new tests. No change in behavior.
712
713         * PlatformWin.cmake:
714         * platform/win/GDIUtilities.h:
715
716 2018-02-26  Youenn Fablet  <youenn@apple.com>
717
718         Add some more release logging related to DocumentWriter::addData crash
719         https://bugs.webkit.org/show_bug.cgi?id=183141
720
721         Reviewed by Chris Dumez.
722
723         No change of behavior.
724         Add some additional release logging to verify whether DocumentWriter::begin was called and exited before updating its state.
725
726         * loader/DocumentLoader.cpp:
727         (WebCore::DocumentLoader::commitData):
728         * loader/DocumentWriter.cpp:
729         (WebCore::DocumentWriter::begin):
730         * loader/DocumentWriter.h:
731
732 2018-02-26  Antoine Quint  <graouts@apple.com>
733
734         [Web Animations] Implement the procedure to set the start time
735         https://bugs.webkit.org/show_bug.cgi?id=183137
736
737         Reviewed by Dean Jackson.
738
739         Implement the procedure to set the start time as setBindingsStartTime() and use the setStartTime() method as
740         an internal method to set the m_startTime instance variable and invalidate the timing model rather than run
741         the entire procedure which should only be called when setting the "startTime" property through the JS API.
742
743         * animation/WebAnimation.cpp:
744         (WebCore::WebAnimation::setTimeline):
745         (WebCore::WebAnimation::setBindingsStartTime):
746         (WebCore::WebAnimation::setStartTime):
747         (WebCore::WebAnimation::silentlySetCurrentTime):
748         (WebCore::WebAnimation::finish):
749         (WebCore::WebAnimation::updateFinishedState):
750         (WebCore::WebAnimation::runPendingPlayTask):
751         (WebCore::WebAnimation::runPendingPauseTask):
752
753 2018-02-26  Christopher Reid  <chris.reid@sony.com>
754
755         [Curl] Cookies are not being added to the Cookie field in Request Headers
756         https://bugs.webkit.org/show_bug.cgi?id=183095
757
758         Reviewed by Alex Christensen.
759
760         Populating the Cookie request header field now that cookies are no longer handled in libcurl.
761
762         * platform/network/curl/CookieJarCurlDatabase.cpp: Renaming the httpOnly variable as its actual use wasn't clear
763         * platform/network/curl/ResourceHandleCurl.cpp:
764
765 2018-02-26  Antoine Quint  <graouts@apple.com>
766
767         [Web Animations] Ensure setting the hold time invalidates the timing model
768         https://bugs.webkit.org/show_bug.cgi?id=183136
769
770         Reviewed by Dean Jackson.
771
772         We used to always set the m_holdTime member variable directly, but the computation of the currentTime
773         depends on the value of m_holdTime, so setting the hold time should invalidate the timing model as well
774         as setting the m_holdTime member variable. In this patch we add a new setHoldTime() private method that
775         sets the member variable and invalidates the timing model.
776
777         * animation/WebAnimation.cpp:
778         (WebCore::WebAnimation::setTimeline):
779         (WebCore::WebAnimation::setHoldTime):
780         (WebCore::WebAnimation::silentlySetCurrentTime):
781         (WebCore::WebAnimation::setCurrentTime):
782         (WebCore::WebAnimation::cancel):
783         (WebCore::WebAnimation::finish):
784         (WebCore::WebAnimation::updateFinishedState):
785         (WebCore::WebAnimation::play):
786         (WebCore::WebAnimation::runPendingPlayTask):
787         (WebCore::WebAnimation::pause):
788         (WebCore::WebAnimation::runPendingPauseTask):
789         * animation/WebAnimation.h:
790
791 2018-02-26  Youenn Fablet  <youenn@apple.com>
792
793         MessagePort is not always destroyed in the right thread
794         https://bugs.webkit.org/show_bug.cgi?id=183053
795
796         Reviewed by Chris Dumez.
797
798         Make existingMessagePortForIdentifier take a lambda so that we hold the lock until there
799         is no longer a need to keep the MessagePort around.
800         This is very time sensitive and does not happen a lot when running WPT tests.
801
802         Update existing call sites to pass a lambda.
803
804         * dom/MessagePort.cpp:
805         (WebCore::MessagePort::existingMessagePortForIdentifier):
806         * dom/MessagePort.h:
807         * dom/messageports/MessagePortChannelProviderImpl.cpp:
808         (WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
809         (WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity):
810
811 2018-02-26  Commit Queue  <commit-queue@webkit.org>
812
813         Unreviewed, rolling out r226745.
814         https://bugs.webkit.org/show_bug.cgi?id=183132
815
816         This is breaking some websites (Requested by youenn on
817         #webkit).
818
819         Reverted changeset:
820
821         "Use no-cache fetch mode when loading main documents with
822         location.reload()"
823         https://bugs.webkit.org/show_bug.cgi?id=181285
824         https://trac.webkit.org/changeset/226745
825
826 2018-02-26  Philippe Normand  <pnormand@igalia.com>
827
828         Unreviewed, USE_GSTREAMER_PLAYBIN3 build fix.
829
830         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
831         There is no such ENABLE_GSTREAMER_PLAYBIN3.
832
833 2018-02-26  Philippe Normand  <pnormand@igalia.com>
834
835         Unreviewed, manual rollout of r228866 causing EGL_BAD_CONTEXT errors
836
837         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
838         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
839         Create an EGL display, even in Wayland.
840
841 2018-02-21  Sergio Villar Senin  <svillar@igalia.com>
842
843         [WebVR][OpenVR] Retrieve displayId and the z-depth of eye view frustum
844         https://bugs.webkit.org/show_bug.cgi?id=182999
845
846         Reviewed by Žan Doberšek.
847
848         Retrieve the z-depth of the eye view frustum and the HMD unique id.
849         The unique identifier is generated by the VRPlatormManager whereas
850         we use the default values from the spec for the z-depth (those can
851         be changed by applications later via JavaScript).
852
853         Once this lands the only remaining data to be retrieved from VR
854         backends for VRDisplay is the pose (getPose() call) and the frame
855         data (getFrameData() call).
856
857         * Modules/webvr/VRDisplay.cpp:
858         (WebCore::VRDisplay::VRDisplay):
859         (WebCore::VRDisplay::displayId const): Deleted.
860         (WebCore::VRDisplay::displayName const): Deleted.
861         (WebCore::VRDisplay::depthNear const): Deleted.
862         (WebCore::VRDisplay::setDepthNear): Deleted.
863         (WebCore::VRDisplay::depthFar const): Deleted.
864         (WebCore::VRDisplay::setDepthFar): Deleted.
865         * Modules/webvr/VRDisplay.h:
866         (WebCore::VRDisplay::displayId const): Moved implementation from
867         source file.
868         (WebCore::VRDisplay::displayName const): Ditto.
869         (WebCore::VRDisplay::depthNear const):
870         (WebCore::VRDisplay::setDepthNear):
871         (WebCore::VRDisplay::depthFar const):
872         (WebCore::VRDisplay::setDepthFar):
873         * platform/vr/VRManager.cpp:
874         (WebCore::VRManager::generateUniqueDisplayIdentifier):
875         * platform/vr/VRManager.h:
876         * platform/vr/VRPlatformDisplay.h:
877         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
878         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
879
880 2018-02-26  Charlie Turner  <cturner@igalia.com>
881
882         Fix build error with !LOG_DISABLED
883         https://bugs.webkit.org/show_bug.cgi?id=183049
884
885         Reviewed by Philippe Normand.
886
887         The following error message was being reported when doing a
888         release build with -DLOG_DISABLED=0:
889
890         ../../Source/WebCore/dom/messageports/MessagePortChannel.cpp: In member function ‘void WebCore::MessagePortChannel::entanglePortWithProcess(const WebCore::MessagePortIdentifier&, WebCore::ProcessIdentifier)’:
891 ../../Source/WebCore/dom/messageports/MessagePortChannel.cpp:85:111: error: ‘logString’ was not declared in this scope
892      LOG(MessagePorts, "MessagePortChannel %s (%p) entangling port %s (that port has %zu messages available)", logString().utf8().data(), this, port.logString().utf8().data(), m_pendingMessages[i].size());
893
894         Other uses of logString are guarded by !LOG_DISABLED rather than
895         NDEBUG, which was the cause of this issue.
896
897         * dom/messageports/MessagePortChannel.h: Guard using !LOG_DISABLED
898         rather than NDEBUG.
899
900 2018-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
901
902         [GStreamer] User current executable name instead of g_get_prgname() for gst_init
903         https://bugs.webkit.org/show_bug.cgi?id=183119
904
905         Reviewed by Philippe Normand.
906
907         g_get_prgname() is only set for programs using GOptionContext, calling gtk_init or explicitly calling
908         g_set_prgname(). Use WTF::getCurrentExecutableName() instead.
909
910         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
911         (WebCore::initializeGStreamer):
912
913 2018-02-25  Wenson Hsieh  <wenson_hsieh@apple.com>
914
915         [Extra zoom mode] Disable downloadable binary fonts by default
916         https://bugs.webkit.org/show_bug.cgi?id=183102
917         <rdar://problem/37860699>
918
919         Reviewed by Tim Horton.
920
921         Disable downloadable binary fonts by default in extra zoom mode by making the initial value of
922         `downloadableBinaryFontsEnabled` conditional. Layout tests are not possible at this time; test to be added once
923         layout test support is in place.
924
925         * page/Settings.yaml:
926         * page/SettingsBase.cpp:
927         (WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled):
928         * page/SettingsBase.h:
929
930 2018-02-25  Chris Dumez  <cdumez@apple.com>
931
932         Service workers do not work well inside Web.app
933         https://bugs.webkit.org/show_bug.cgi?id=183105
934         <rdar://problem/37864140>
935
936         Reviewed by Youenn Fablet.
937
938         SessionID::defaultSessionID() was hardcoded in the ServiceWorkerThread constructor
939         instead of using the sessionID of the SWServer that created the service worker thread.
940         As a result, when the Service Worker would establish a SWClientConnection to the
941         server, it would use the wrong sessionID and would end up using a different SWServer
942         (Since we have a different SWServer instance per sessionID). As a result,
943         ServiceWorkerRegistration / ServiceWorker objects inside the service worker would not
944         be kept in sync with the server (since they registered themselves with the wrong
945         SWServer).
946
947         Covered by new API test.
948
949         * workers/service/ServiceWorkerContextData.cpp:
950         (WebCore::ServiceWorkerContextData::isolatedCopy const):
951         * workers/service/ServiceWorkerContextData.h:
952         (WebCore::ServiceWorkerContextData::encode const):
953         (WebCore::ServiceWorkerContextData::decode):
954         * workers/service/context/ServiceWorkerThread.cpp:
955         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
956         * workers/service/context/ServiceWorkerThreadProxy.cpp:
957         (WebCore::createPageForServiceWorker):
958         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
959         * workers/service/server/RegistrationDatabase.cpp:
960         (WebCore::RegistrationDatabase::importRecords):
961         * workers/service/server/RegistrationStore.h:
962         (WebCore::RegistrationStore::server):
963         * workers/service/server/SWServer.cpp:
964         (WebCore::SWServer::updateWorker):
965         * workers/service/server/SWServerWorker.cpp:
966         (WebCore::SWServerWorker::contextData const):
967
968 2018-02-24  Fujii Hironori  <Hironori.Fujii@sony.com>
969
970         Null-dereference of the second argument `resource` of DocumentLoader::scheduleSubstituteResourceLoad
971         https://bugs.webkit.org/show_bug.cgi?id=182920
972
973         Reviewed by Darin Adler.
974
975         A test case
976         imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.html
977         always crashes due to a null-dereference if compiled and optimized
978         by GCC 7.2. The second argument `resource` of
979         DocumentLoader::scheduleSubstituteResourceLoad can be null if the
980         resource can't be found in cache. I guess GCC optimizes inline
981         HashMap::add based on assuming the `resource` never becomes null
982         because its type is SubstituteResource&.
983
984         This changes introduces a new method
985         DocumentLoader::scheduleCannotShowURLError because it looks tricky
986         to pass a nullptr to the second argument of
987         scheduleSubstituteResourceLoad.
988
989         No new tests (Covered by existing tests).
990
991         * loader/DocumentLoader.cpp:
992         (WebCore::DocumentLoader::scheduleCannotShowURLError): Added a new method.
993         * loader/DocumentLoader.h:
994         * loader/appcache/ApplicationCacheHost.cpp:
995         (WebCore::ApplicationCacheHost::maybeLoadResource):
996         Call scheduleCannotShowURLError if the resource not found in the appcache.
997
998 2018-02-17  Darin Adler  <darin@apple.com>
999
1000         Prepare for ExtendedColor changes (first step)
1001         https://bugs.webkit.org/show_bug.cgi?id=182904
1002
1003         Reviewed by Sam Weinig.
1004
1005         * css/CSSValuePool.cpp:
1006         (WebCore::CSSValuePool::createColorValue): Use HashMap::ensure.
1007         (WebCore::CSSValuePool::createFontFamilyValue): Ditto.
1008         (WebCore::CSSValuePool::createFontFaceValue): Ditto.
1009
1010         * css/parser/CSSParserFastPaths.cpp:
1011         (WebCore::CSSParserFastPaths::maybeParseValue): Tightened up
1012         the logic a bit.
1013
1014         * html/canvas/CanvasRenderingContext2D.cpp: Removed many unneeded includes.
1015
1016         * inspector/InspectorCanvas.cpp:
1017         (WebCore::InspectorCanvas::recordAction): Updated for Ref instead of
1018         RefPtr and to use move semantics.
1019         (WebCore::buildArrayForAffineTransform): Return Ref instead of RefPtr.
1020         (WebCore::buildArrayForVector): Ditto.
1021         (WebCore::InspectorCanvas::buildInitialState): Ditto. Also use auto more.
1022         (WebCore::InspectorCanvas::buildAction): Ditto.
1023         (WebCore::InspectorCanvas::buildArrayForCanvasGradient): Ditto.
1024         (WebCore::InspectorCanvas::buildArrayForCanvasPattern): Ditto.
1025         (WebCore::InspectorCanvas::buildArrayForImageData): Ditto.
1026         * inspector/InspectorCanvas.h: Updated for the above. Also us "using" instead
1027         of typedef and removed unneeded ErrorString typedef and some includes.
1028
1029         * page/DragController.cpp:
1030         (WebCore::DragController::concludeEditDrag): Use auto and Ref.
1031
1032         * platform/DragData.h: Used pragma once and reorganized includes a bit.
1033
1034         * platform/graphics/ImageFrame.h:
1035         (WebCore::ImageFrame::frameBytes const): Use uint32_t instead of RGBA32 to
1036         prepare for removal of the RGBA32 type coming in a future patch.
1037         * platform/graphics/ImageSource.cpp:
1038         (WebCore::ImageSource::cacheNativeImageAtIndex): Ditto.
1039         (WebCore::ImageSource::canUseAsyncDecoding): Ditto.
1040
1041         * platform/graphics/cocoa/GraphicsContextCocoa.mm: Tweaked #if for Mac-only
1042         code to use PLATFORM(MAC) to be easier to read.
1043         (WebCore::GraphicsContext::focusRingColor): Use sRGBColorSpaceRef instead of
1044         calling CGColorSpaceCreateWithName each time.
1045
1046         * platform/graphics/texmap/TextureMapperFPSCounter.cpp: Added include needed
1047         now that it was removed from some header.
1048
1049         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: Use uint32_t
1050         instead of RGBA32 to prepare for removal of the RGBA32 type coming in a future patch.
1051         * platform/image-decoders/ScalableImageDecoder.cpp:
1052         (WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
1053         * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp:
1054         (WebCore::ImageBackingStore::image const): Ditto.
1055         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1056         (WebCore::GIFImageDecoder::haveDecodedRow): Ditto.
1057         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1058         (WebCore::setPixel): Ditto.
1059         (WebCore::JPEGImageDecoder::outputScanlines): Ditto.
1060         * platform/image-decoders/png/PNGImageDecoder.cpp:
1061         (WebCore::PNGImageDecoder::rowAvailable): Ditto.
1062         (WebCore::PNGImageDecoder::frameComplete): Ditto.
1063         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1064         (WebCore::WEBPImageDecoder::decodeFrame): Ditto.
1065         (WebCore::WEBPImageDecoder::applyPostProcessing): Ditto.
1066
1067         * platform/mac/PlatformPasteboardMac.mm:
1068         (WebCore::PlatformPasteboard::color): Added comments.
1069
1070         * rendering/EllipsisBox.cpp:
1071         (WebCore::EllipsisBox::paintSelection): Use Color::isVisible.
1072
1073 2018-02-23  Chris Dumez  <cdumez@apple.com>
1074
1075         Crash under SchemeRegistry::shouldTreatURLSchemeAsLocal(WTF::String const&)
1076         https://bugs.webkit.org/show_bug.cgi?id=183066
1077         <rdar://problem/37804111>
1078
1079         Reviewed by Ryosuke Niwa.
1080
1081         SecurityOrigin objects are constructed on various threads. However, someone added a
1082         shouldTreatAsPotentiallyTrustworthy() call to the SecurityOrigin constructor which
1083         was not thread safe. This is because this function relies on SchemeRegistry::shouldTreatURLSchemeAsSecure()
1084         and SchemeRegistry::shouldTreatURLSchemeAsLocal() which were relying on global static HashMaps without
1085         locks.
1086
1087         Update SecurityOrigin to initialize m_isPotentiallyTrustworthy lazily, to avoid paying
1088         initialization cost in the constructor. This is only queries by SecurityContext::isSecureContext().
1089
1090         Make SchemeRegistry::shouldTreatURLSchemeAsLocal() and SchemeRegistry::shouldTreatURLSchemeAsSecure()
1091         thread-safe, since they are needed to initialize SecurityOrigin::m_isPotentiallyTrustworthy from
1092         various threads.
1093
1094         SchemeRegistry::shouldTreatURLSchemeAsSecure() is only called from SecurityOrigin (which requires
1095         thread-safety), and getUserMedia() which is not hot code so the extra locking there should not
1096         be an issue.
1097
1098         SchemeRegistry::shouldTreatURLSchemeAsLocal() is called from SecurityOrigin (which requires thread-
1099         safety). It is also called from isQuickLookPreviewURL(), MHTMLArchive::create(), Page::userStyleSheetLocationChanged(),
1100         isRemoteWebArchive() and HTMLPlugInImageElement. All these are not hot code so I do not think
1101         we need a fast path.
1102
1103         * page/SecurityOrigin.cpp:
1104         (WebCore::isLoopbackIPAddress):
1105         (WebCore::shouldTreatAsPotentiallyTrustworthy):
1106         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
1107         (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress):
1108         * page/SecurityOrigin.h:
1109         * platform/SchemeRegistry.cpp:
1110         (WebCore::localURLSchemesLock):
1111         (WebCore::localURLSchemes):
1112         (WebCore::secureSchemesLock):
1113         (WebCore::secureSchemes):
1114         (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
1115         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
1116         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
1117         (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
1118         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
1119         * platform/SchemeRegistry.h:
1120
1121 2018-02-23  Christopher Reid  <chris.reid@sony.com>
1122
1123         [Curl] Cookie Database files are wrongfully getting deleted when the database is opened
1124         https://bugs.webkit.org/show_bug.cgi?id=183051
1125
1126         Reviewed by Per Arne Vollan.
1127
1128         The file stat logic was backwards causing a wrongful detection of database corruption.
1129         Fixed the logic and abstracted these calls to use FileSystem.
1130
1131         * platform/network/curl/CookieJarDB.cpp:
1132
1133 2018-02-23  Zalan Bujtas  <zalan@apple.com>
1134
1135         [RenderTreeBuilder] Make RenderTreeBuilder::* classes WTF_MAKE_FAST_ALLOCATED
1136         https://bugs.webkit.org/show_bug.cgi?id=183084
1137         <rdar://problem/37828706>
1138
1139         Reviewed by Antti Koivisto.
1140
1141         * rendering/updating/RenderTreeBuilderBlock.h:
1142         * rendering/updating/RenderTreeBuilderBlockFlow.h:
1143         * rendering/updating/RenderTreeBuilderContinuation.h:
1144         * rendering/updating/RenderTreeBuilderFirstLetter.h:
1145         * rendering/updating/RenderTreeBuilderFormControls.h:
1146         * rendering/updating/RenderTreeBuilderFullScreen.h:
1147         * rendering/updating/RenderTreeBuilderInline.h:
1148         * rendering/updating/RenderTreeBuilderList.h:
1149         * rendering/updating/RenderTreeBuilderMathML.h:
1150         * rendering/updating/RenderTreeBuilderMultiColumn.h:
1151         * rendering/updating/RenderTreeBuilderRuby.h:
1152         * rendering/updating/RenderTreeBuilderSVG.h:
1153         * rendering/updating/RenderTreeBuilderTable.h:
1154         * rendering/updating/RenderTreeUpdaterGeneratedContent.h:
1155
1156 2018-02-23  Zalan Bujtas  <zalan@apple.com>
1157
1158         [RenderTreeBuilder] Move RenderFullScreen::createPlaceholder to RenderTreeBuilder
1159         https://bugs.webkit.org/show_bug.cgi?id=183027
1160         <rdar://problem/37773058>
1161
1162         Reviewed by Antti Koivisto.
1163
1164         No change in functionality.
1165
1166         * dom/Document.cpp:
1167         (WebCore::Document::setFullScreenRenderer):
1168         * dom/Document.h:
1169         * rendering/RenderFullScreen.cpp:
1170         (WebCore::RenderFullScreenPlaceholder::RenderFullScreenPlaceholder):
1171         (WebCore::RenderFullScreenPlaceholder::isRenderFullScreenPlaceholder const):
1172         (WebCore::RenderFullScreen::wrapNewRenderer):
1173         (WebCore::RenderFullScreen::wrapExistingRenderer):
1174         (): Deleted.
1175         (WebCore::RenderFullScreen::createPlaceholder): Deleted.
1176         * rendering/RenderFullScreen.h:
1177         * rendering/updating/RenderTreeBuilder.cpp:
1178         (WebCore::RenderTreeBuilder::createPlaceholderForFullScreen):
1179         * rendering/updating/RenderTreeBuilder.h:
1180         * rendering/updating/RenderTreeBuilderFullScreen.cpp:
1181         (WebCore::RenderTreeBuilder::FullScreen::createPlaceholder):
1182         * rendering/updating/RenderTreeBuilderFullScreen.h:
1183
1184 2018-02-23  Zalan Bujtas  <zalan@apple.com>
1185
1186         [RenderTreeBuilder] Add WARN_UNUSED_RETURN to detach()
1187         https://bugs.webkit.org/show_bug.cgi?id=183073
1188         <rdar://problem/37814585>
1189
1190         Reviewed by Antti Koivisto.
1191
1192         So that we don't destroy a renderer accidentally.
1193
1194         * rendering/updating/RenderTreeBuilderBlock.h:
1195         * rendering/updating/RenderTreeBuilderRuby.h:
1196         * rendering/updating/RenderTreeBuilderSVG.h:
1197
1198 2018-02-22  Antoine Quint  <graouts@apple.com>
1199
1200         REGRESSION (r228445): A big pause button shows over YouTube videos if you tap "Tap To Unmute" on iOS
1201         https://bugs.webkit.org/show_bug.cgi?id=183074
1202         <rdar://problem/37747028>
1203
1204         Reviewed by Eric Carlson.
1205
1206         Test: media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play.html
1207
1208         In the fix for webkit.org/b/182668, we made it so that when the "controls" attribute is absent from a media
1209         element we stop listening to the bulk of media events and prevent controls from updating any DOM properties
1210         so as to minimize the amount of CPU usage by the Web process.
1211
1212         An unfortunate side effect was that, if the media controls were disabled at the time the video starts playing,
1213         the StartSupport class would thus not catch the "play" event and would not be able to set the "hasPlayed"
1214         property to "true" on the MediaController, which would then prevent the _shouldShowStartButton() from returning
1215         "false". As a result, if the "controls" attribute was turned back on after the media started playing, they
1216         would default to showing the start button, which would be then in the play state, ie. showing the pause icon.
1217
1218         We now set the "hasPlayed" property in the "play" event handler on MediaController, which is always registered
1219         regardless of the "controls" attribute setting. We also ensure we invalidate the "showStartButton" property on
1220         the media controls when StartSupport is enabled, which is the case when the "controls" attribute is toggled back
1221         to "true" from a previous "false" value.
1222
1223         * Modules/modern-media-controls/media/media-controller.js:
1224         (MediaController.prototype.handleEvent):
1225         * Modules/modern-media-controls/media/start-support.js:
1226         (StartSupport):
1227         (StartSupport.prototype.enable):
1228         (StartSupport.prototype.handleEvent):
1229         (StartSupport.prototype._updateShowsStartButton):
1230
1231 2018-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1232
1233         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
1234         https://bugs.webkit.org/show_bug.cgi?id=173655
1235         <rdar://problem/37706341>
1236
1237         Reviewed by Philippe Normand.
1238
1239         Do not assume gst is only used in the WebProcess, the MIMETypeRegistry also uses gst to get the list of
1240         supported media types. Move the code to extract gst options from the process command line to a helper function
1241         and use it in the UI process to pass the options to the WebProcess, but also in the current process when gst is
1242         initialized without providing options.
1243
1244         Fixes several unit tests that use MIMETypeRegistry in the UI process.
1245
1246         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
1247         (WebCore::extractGStreamerOptionsFromCommandLine): Helper to get the gst options from the current process
1248         command line.
1249         (WebCore::initializeGStreamer): Ensure this is called once. Get the gst options from the given vector or extract
1250         it from the command line if not provided.
1251         * platform/graphics/gstreamer/GStreamerUtilities.h:
1252         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1253         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Bring back the gst
1254         initialization here.
1255
1256 2018-02-23  Philippe Normand  <pnormand@igalia.com>
1257
1258         [GStreamer] HTTP totalBytes query returns 0 after seeking (sometimes)
1259         https://bugs.webkit.org/show_bug.cgi?id=183002
1260
1261         Reviewed by Xabier Rodriguez-Calvar.
1262
1263         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1264         (webkit_web_src_init): Initialize member variables. Also no need
1265         to set the appsrc size at that point.
1266         (webKitWebSrcStop): There is no need to reset the size when
1267         seeking. Size should in most cases represent the Content-Length
1268         response attribute, even when seeking.
1269         (webKitWebSrcStart): No need to reset the size attribute.
1270         (webKitWebSrcQueryWithParent): Let appsrc handle DURATION queries.
1271         (CachedResourceStreamingClient::responseReceived): Emit duration notification one time only.
1272
1273 2018-02-23  Philippe Normand  <pnormand@igalia.com>
1274
1275         [GStreamer] media/video-src-blob-using-open-panel.html crashes in Debug
1276         https://bugs.webkit.org/show_bug.cgi?id=183005
1277
1278         Reviewed by Xabier Rodriguez-Calvar.
1279
1280         Test: media/video-src-blob-using-open-panel.html
1281
1282         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1283         (WebCore::convertToInternalProtocol): Also convert blob URIs
1284         because they're handled by our httpsrc element.
1285         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1286         (webKitWebSrcGetProtocols): Prefix blob URIs too, for consistency purpose.
1287
1288 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
1289
1290         Remove currentTime() / currentTimeMS()
1291         https://bugs.webkit.org/show_bug.cgi?id=183052
1292
1293         Reviewed by Mark Lam.
1294
1295         * Modules/geolocation/Geolocation.cpp:
1296         (WebCore::Geolocation::haveSuitableCachedPosition):
1297         * dom/DOMTimeStamp.h:
1298         (WebCore::convertSecondsToDOMTimeStamp):
1299         * fileapi/File.cpp:
1300         (WebCore::File::File):
1301         (WebCore::File::lastModified const):
1302         * history/HistoryItem.cpp:
1303         (WebCore::generateSequenceNumber):
1304         * html/BaseDateAndTimeInputType.cpp:
1305         (WebCore::BaseDateAndTimeInputType::defaultValueForStepUp const):
1306         * html/DateTimeInputType.cpp:
1307         (WebCore::DateTimeInputType::defaultValueForStepUp const):
1308         * html/MonthInputType.cpp:
1309         (WebCore::MonthInputType::defaultValueForStepUp const):
1310         * html/TimeInputType.cpp:
1311         (WebCore::TimeInputType::defaultValueForStepUp const):
1312         * inspector/agents/InspectorNetworkAgent.cpp:
1313         (WebCore::InspectorNetworkAgent::willSendRequest):
1314         (WebCore::InspectorNetworkAgent::willSendWebSocketHandshakeRequest):
1315         * loader/EmptyFrameLoaderClient.h:
1316         * loader/FormSubmission.cpp:
1317         (WebCore::generateFormDataIdentifier):
1318         * loader/FrameLoader.cpp:
1319         (WebCore::FrameLoader::clientRedirected):
1320         * loader/FrameLoader.h:
1321         * loader/FrameLoaderClient.h:
1322         * loader/NavigationScheduler.cpp:
1323         * page/History.cpp:
1324         (WebCore::History::stateObjectAdded):
1325         * page/History.h:
1326         * page/PageOverlay.cpp:
1327         (WebCore::PageOverlay::startFadeAnimation):
1328         (WebCore::PageOverlay::fadeAnimationTimerFired):
1329         * page/PageOverlay.h:
1330         * platform/graphics/cg/GraphicsContextCG.cpp:
1331         (WebCore::GraphicsContext::drawNativeImage):
1332         * platform/ios/LegacyTileLayerPool.h:
1333         * platform/ios/LegacyTileLayerPool.mm:
1334         (WebCore::LegacyTileLayerPool::LegacyTileLayerPool):
1335         (WebCore::LegacyTileLayerPool::addLayer):
1336         (WebCore::LegacyTileLayerPool::decayedCapacity const):
1337         (WebCore::LegacyTileLayerPool::prune):
1338         * platform/ios/SystemMemoryIOS.cpp:
1339         (WebCore::systemMemoryLevel):
1340         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
1341         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1342
1343 2018-02-22  Per Arne Vollan  <pvollan@apple.com>
1344
1345         The WebContent process should not use NSScreen in the screenDepth implementation.
1346         https://bugs.webkit.org/show_bug.cgi?id=183048
1347
1348         Reviewed by Brent Fulgham.
1349
1350         NSScreen method calls should be done in the UIProcess, since these calls will communicate with
1351         the WindowServer. The screen depth property can be retrieved in the UIProcess, and sent to the
1352         WebContent process, where it is cached. Whenever screen properties change, the UIProcess will
1353         send the new screen properties to the WebProcess.
1354
1355         No new tests, covered by existing tests.
1356
1357         * platform/ScreenProperties.h:
1358         (WebCore::ScreenProperties::encode const):
1359         (WebCore::ScreenProperties::decode):
1360         * platform/mac/PlatformScreenMac.mm:
1361         (WebCore::getScreenProperties):
1362         (WebCore::screenDepth):
1363         (WebCore::screenDepthPerComponent):
1364         (WebCore::screenRect):
1365         (WebCore::screenAvailableRect):
1366
1367 2018-02-22  Zalan Bujtas  <zalan@apple.com>
1368
1369         [RenderTreeBuilder] Rename insertChild() -> attach(), takeChild() -> detach() and removeAndDestroy() -> destroy()
1370         https://bugs.webkit.org/show_bug.cgi?id=183061
1371         <rdar://problem/37800269>
1372
1373         Reviewed by Ryosuke Niwa.
1374
1375         ...and moveChildTo() -> move() (moveChildrenTo() -> moveChildren()),
1376         removeFromParentAndDestroyCleaningUpAnonymousWrappers() -> destroyAndCleanUpAnonymousWrappers()
1377
1378         No change in functionality.
1379
1380         * dom/Document.cpp:
1381         (WebCore::Document::destroyRenderTree):
1382         (WebCore::Document::setFullScreenRenderer):
1383         * rendering/RenderBlockFlow.cpp:
1384         (WebCore::RenderBlockFlow::styleDidChange):
1385         * rendering/RenderButton.cpp:
1386         (WebCore::RenderButton::setText):
1387         * rendering/RenderElement.cpp:
1388         (WebCore::RenderElement::didAttachChild):
1389         (WebCore::RenderElement::didInsertChild): Deleted.
1390         * rendering/RenderElement.h:
1391         * rendering/RenderFullScreen.cpp:
1392         (WebCore::RenderFullScreen::wrapNewRenderer):
1393         (WebCore::RenderFullScreen::wrapExistingRenderer):
1394         (WebCore::RenderFullScreen::unwrapRenderer):
1395         (WebCore::RenderFullScreen::createPlaceholder):
1396         * rendering/RenderMenuList.cpp:
1397         (RenderMenuList::didAttachChild):
1398         (RenderMenuList::setText):
1399         (RenderMenuList::didInsertChild): Deleted.
1400         * rendering/RenderMenuList.h:
1401         * rendering/RenderQuote.cpp:
1402         (WebCore::RenderQuote::updateTextRenderer):
1403         * rendering/RenderTextFragment.cpp:
1404         (WebCore::RenderTextFragment::setText):
1405         * rendering/updating/RenderTreeBuilder.cpp:
1406         (WebCore::RenderTreeBuilder::destroy):
1407         (WebCore::RenderTreeBuilder::attach):
1408         (WebCore::RenderTreeBuilder::attachIgnoringContinuation):
1409         (WebCore::RenderTreeBuilder::detach):
1410         (WebCore::RenderTreeBuilder::attachToRenderElement):
1411         (WebCore::RenderTreeBuilder::attachToRenderElementInternal):
1412         (WebCore::RenderTreeBuilder::move):
1413         (WebCore::RenderTreeBuilder::moveAllChildren):
1414         (WebCore::RenderTreeBuilder::moveChildren):
1415         (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloats):
1416         (WebCore::RenderTreeBuilder::makeChildrenNonInline):
1417         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
1418         (WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
1419         (WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers):
1420         (WebCore::RenderTreeBuilder::detachFromRenderGrid):
1421         (WebCore::RenderTreeBuilder::detachFromRenderElement):
1422         (WebCore::RenderTreeBuilder::attachToRenderGrid):
1423         (WebCore::RenderTreeBuilder::removeAndDestroy): Deleted.
1424         (WebCore::RenderTreeBuilder::insertChild): Deleted.
1425         (WebCore::RenderTreeBuilder::insertChildIgnoringContinuation): Deleted.
1426         (WebCore::RenderTreeBuilder::takeChild): Deleted.
1427         (WebCore::RenderTreeBuilder::insertChildToRenderElement): Deleted.
1428         (WebCore::RenderTreeBuilder::insertChildToRenderElementInternal): Deleted.
1429         (WebCore::RenderTreeBuilder::moveChildTo): Deleted.
1430         (WebCore::RenderTreeBuilder::moveAllChildrenTo): Deleted.
1431         (WebCore::RenderTreeBuilder::moveChildrenTo): Deleted.
1432         (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo): Deleted.
1433         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
1434         (WebCore::RenderTreeBuilder::takeChildFromRenderGrid): Deleted.
1435         (WebCore::RenderTreeBuilder::takeChildFromRenderElement): Deleted.
1436         (WebCore::RenderTreeBuilder::insertChildToRenderGrid): Deleted.
1437         * rendering/updating/RenderTreeBuilder.h:
1438         * rendering/updating/RenderTreeBuilderBlock.cpp:
1439         (WebCore::RenderTreeBuilder::Block::attach):
1440         (WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
1441         (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
1442         (WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
1443         (WebCore::RenderTreeBuilder::Block::detach):
1444         (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
1445         (WebCore::RenderTreeBuilder::Block::insertChild): Deleted.
1446         (WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation): Deleted.
1447         (WebCore::RenderTreeBuilder::Block::takeChild): Deleted.
1448         * rendering/updating/RenderTreeBuilderBlock.h:
1449         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
1450         (WebCore::RenderTreeBuilder::BlockFlow::attach):
1451         (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloats):
1452         (WebCore::RenderTreeBuilder::BlockFlow::insertChild): Deleted.
1453         (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo): Deleted.
1454         * rendering/updating/RenderTreeBuilderBlockFlow.h:
1455         * rendering/updating/RenderTreeBuilderContinuation.cpp:
1456         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
1457         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
1458         (WebCore::RenderTreeBuilder::FirstLetter::cleanupOnDestroy):
1459         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
1460         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
1461         * rendering/updating/RenderTreeBuilderFormControls.cpp:
1462         (WebCore::RenderTreeBuilder::FormControls::attach):
1463         (WebCore::RenderTreeBuilder::FormControls::detach):
1464         (WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
1465         (WebCore::RenderTreeBuilder::FormControls::insertChild): Deleted.
1466         (WebCore::RenderTreeBuilder::FormControls::takeChild): Deleted.
1467         * rendering/updating/RenderTreeBuilderFormControls.h:
1468         * rendering/updating/RenderTreeBuilderFullScreen.cpp:
1469         (WebCore::RenderTreeBuilder::FullScreen::cleanupOnDestroy):
1470         * rendering/updating/RenderTreeBuilderInline.cpp:
1471         (WebCore::RenderTreeBuilder::Inline::attach):
1472         (WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
1473         (WebCore::RenderTreeBuilder::Inline::attachIgnoringContinuation):
1474         (WebCore::RenderTreeBuilder::Inline::splitFlow):
1475         (WebCore::RenderTreeBuilder::Inline::splitInlines):
1476         (WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
1477         (WebCore::RenderTreeBuilder::Inline::insertChild): Deleted.
1478         (WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation): Deleted.
1479         * rendering/updating/RenderTreeBuilderInline.h:
1480         * rendering/updating/RenderTreeBuilderList.cpp:
1481         (WebCore::RenderTreeBuilder::List::updateItemMarker):
1482         * rendering/updating/RenderTreeBuilderMathML.cpp:
1483         (WebCore::RenderTreeBuilder::MathML::makeFences):
1484         (WebCore::RenderTreeBuilder::MathML::attach):
1485         (WebCore::RenderTreeBuilder::MathML::insertChild): Deleted.
1486         * rendering/updating/RenderTreeBuilderMathML.h:
1487         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
1488         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
1489         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
1490         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
1491         (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
1492         * rendering/updating/RenderTreeBuilderRuby.cpp:
1493         (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
1494         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
1495         (WebCore::RenderTreeBuilder::Ruby::attach):
1496         (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
1497         (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
1498         (WebCore::RenderTreeBuilder::Ruby::detach):
1499         (WebCore::RenderTreeBuilder::Ruby::insertChild): Deleted.
1500         (WebCore::RenderTreeBuilder::Ruby::takeChild): Deleted.
1501         * rendering/updating/RenderTreeBuilderRuby.h:
1502         * rendering/updating/RenderTreeBuilderSVG.cpp:
1503         (WebCore::RenderTreeBuilder::SVG::attach):
1504         (WebCore::RenderTreeBuilder::SVG::detach):
1505         (WebCore::RenderTreeBuilder::SVG::insertChild): Deleted.
1506         (WebCore::RenderTreeBuilder::SVG::takeChild): Deleted.
1507         * rendering/updating/RenderTreeBuilderSVG.h:
1508         * rendering/updating/RenderTreeBuilderTable.cpp:
1509         (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
1510         (WebCore::RenderTreeBuilder::Table::attach):
1511         (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
1512         (WebCore::RenderTreeBuilder::Table::insertChild): Deleted.
1513         * rendering/updating/RenderTreeBuilderTable.h:
1514         * rendering/updating/RenderTreeUpdater.cpp:
1515         (WebCore::RenderTreeUpdater::createRenderer):
1516         (WebCore::RenderTreeUpdater::createTextRenderer):
1517         (WebCore::RenderTreeUpdater::tearDownRenderers):
1518         (WebCore::RenderTreeUpdater::tearDownTextRenderer):
1519         (WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
1520         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
1521         (WebCore::createContentRenderers):
1522
1523 2018-02-22  Chris Dumez  <cdumez@apple.com>
1524
1525         ResourceRequestBase::isolatedCopy() fails to isolate copy the cachePartition
1526         https://bugs.webkit.org/show_bug.cgi?id=183059
1527         <rdar://problem/37800202>
1528
1529         Reviewed by Youenn Fablet.
1530
1531         Update ResourceRequestBase::setAsIsolatedCopy() to call isolatedCopy() on the cachePartition as well,
1532         given that it is a String and it would not be safe to send it to another thread otherwise.
1533
1534         * platform/network/ResourceRequestBase.cpp:
1535         (WebCore::ResourceRequestBase::setAsIsolatedCopy):
1536
1537 2018-02-22  Chris Dumez  <cdumez@apple.com>
1538
1539         ServiceWorkerContainer::startScriptFetchForJob() fails to isolate copy the registrationKey before passing it to the main thread
1540         https://bugs.webkit.org/show_bug.cgi?id=183050
1541         <rdar://problem/37796881>
1542
1543         Reviewed by Youenn Fablet.
1544
1545         Create an isolated copy of the registrationKey before passing it to the main thread in ServiceWorkerContainer's
1546         startScriptFetchForJob() / jobFinishedLoadingScript() / jobFailedLoadingScript().
1547
1548         * workers/service/ServiceWorkerContainer.cpp:
1549         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
1550         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
1551         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
1552
1553 2018-02-22  Chris Dumez  <cdumez@apple.com>
1554
1555         ServiceWorkerContainer::scheduleJob() fails to isolate copy the jobData before passing it to the main thread
1556         https://bugs.webkit.org/show_bug.cgi?id=183046
1557         <rdar://problem/37793395>
1558
1559         Reviewed by Youenn Fablet.
1560
1561         Make sure we isolate copy the jobData before passing it to the main thread in ServiceWorkerContainer::scheduleJob().
1562         The jobData contains Strings / URLs so it is not safe to have non-isolated copies of it on various threads.
1563
1564         * workers/service/ServiceWorkerContainer.cpp:
1565         (WebCore::ServiceWorkerContainer::scheduleJob):
1566
1567 2018-02-22  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1568
1569         [Curl] Fix warning on clang.
1570         https://bugs.webkit.org/show_bug.cgi?id=182986
1571
1572         Reviewed by Konstantin Tokarev.
1573
1574         No new tests because there's no behaviro changes.
1575
1576         * platform/network/curl/CurlResourceHandleDelegate.cpp:
1577         (WebCore::CurlResourceHandleDelegate::curlDidSendData):
1578         (WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer):
1579         (WebCore::CurlResourceHandleDelegate::curlDidFailWithError):
1580         * platform/network/curl/CurlResourceHandleDelegate.h:
1581
1582 2018-02-22  Youenn Fablet  <youenn@apple.com>
1583
1584         WorkerCacheStorageConnection::doRemove can assert in case two frames try to delete the same cache at the same time
1585         https://bugs.webkit.org/show_bug.cgi?id=183041
1586
1587         Reviewed by Chris Dumez.
1588
1589         * Modules/cache/WorkerCacheStorageConnection.cpp:
1590         (WebCore::WorkerCacheStorageConnection::doRemove): Update the assertion to accept the
1591         case of an already deleted cache, i.e. returned identifer is 0.
1592
1593 2018-02-22  Alejandro G. Castro  <alex@igalia.com>
1594
1595         Remove some code leftovers in LibWebRTCMediaEndpoint and RealtimeOutgoingVideoSource classes
1596         https://bugs.webkit.org/show_bug.cgi?id=183031
1597
1598         Reviewed by Youenn Fablet.
1599
1600         This include and namespace are not required in the file.
1601
1602         Just removing unused code, no tests required.
1603
1604         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1605
1606 2018-02-22  Chris Dumez  <cdumez@apple.com>
1607
1608         Document.open() cancels existing provisional load but not navigation policy check
1609         https://bugs.webkit.org/show_bug.cgi?id=183012
1610         <rdar://problem/37755831>
1611
1612         Reviewed by Alex Christensen.
1613
1614         Test: fast/dom/Document/open-with-pending-load-async-policy.html
1615
1616         * dom/Document.cpp:
1617         (WebCore::Document::open):
1618         The existing code was calling FrameLoader::stopAllLoaders() when the loader's state
1619         is FrameStateProvisional. The issue is that the FrameLoader's state only gets set
1620         to FrameStateProvisional after the policy decision for the navigation is made.
1621         This means that we fail to cancel a pending load if is still in the policy decision
1622         stage, which can happen when the policy decision is made asynchronously. We now
1623         also cancel such pending navigation policy checks as well.
1624
1625         * loader/PolicyChecker.cpp:
1626         (WebCore::PolicyChecker::checkNavigationPolicy):
1627         Make sure the m_delegateIsDecidingNavigationPolicy flag gets reset inside the
1628         lambda. Otherwise, it gets reset too early when the policy decision is made
1629         asynchronously.
1630
1631 2018-02-22  Youenn Fablet  <youenn@apple.com>
1632
1633         Add release asserts for service worker fetch and postMessage events
1634         https://bugs.webkit.org/show_bug.cgi?id=183025
1635         rdar://problem/37765052
1636
1637         Reviewed by Daniel Bates.
1638
1639         Add release assertion so that a service worker will only dispatch a message event
1640         for clients and service workers with the same origin.
1641         No change of behavior.
1642
1643         * platform/network/ResourceRequestBase.h:
1644         * workers/service/context/ServiceWorkerThread.cpp:
1645         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
1646         * workers/service/context/ServiceWorkerThreadProxy.h:
1647
1648 2018-02-22  Miguel Gomez  <magomez@igalia.com>
1649
1650         including both gl3.h and gl2.h when USE_OPENGL_ES is enabled
1651         https://bugs.webkit.org/show_bug.cgi?id=183008
1652
1653         Reviewed by Michael Catanzaro.
1654
1655         Don't include GLES3 headers as we stick to GLES2 API resources.
1656
1657         No new tests, no behavior change.
1658
1659         * platform/graphics/GLContext.cpp:
1660
1661 2018-02-22  Ms2ger  <Ms2ger@igalia.com>
1662
1663         [GTK][WPE] Fix some build errors in service workers code
1664         https://bugs.webkit.org/show_bug.cgi?id=182966
1665
1666         Reviewed by Žan Doberšek.
1667
1668         No new tests: no change in behavior.
1669
1670         * workers/service/ServiceWorkerProvider.h: add missing forward declaration.
1671
1672 2018-02-21  Zalan Bujtas  <zalan@apple.com>
1673
1674         [RenderTreeBuilder] Move RenderObject::insertedInto() mutation logic to RenderTreeBuilder
1675         https://bugs.webkit.org/show_bug.cgi?id=183022
1676         <rdar://problem/37764326>
1677
1678         Reviewed by Antti Koivisto.
1679
1680         No change in functionality.
1681
1682         * rendering/RenderObject.cpp:
1683         (WebCore::RenderObject::insertedIntoTree):
1684         * rendering/updating/RenderTreeBuilder.cpp:
1685         (WebCore::RenderTreeBuilder::insertChildToRenderElementInternal):
1686         (WebCore::RenderTreeBuilder::moveChildrenTo):
1687         (WebCore::RenderTreeBuilder::multiColumnDescendantInserted): Deleted.
1688         * rendering/updating/RenderTreeBuilder.h:
1689
1690 2018-02-21  Tim Horton  <timothy_horton@apple.com>
1691
1692         Include all Cocoa sources in all Cocoa platform builds
1693         https://bugs.webkit.org/show_bug.cgi?id=183026
1694         <rdar://problem/37513101>
1695
1696         Reviewed by Dan Bernstein.
1697
1698         Similar to r228571, don't have separate Sources files for iOS and Mac.
1699         All sources now have #ifdefs that ensure that only the right ones
1700         build on the right platforms. This makes it much easier to reason
1701         about what builds where by just looking at the sources.
1702
1703         * SourcesCocoa.txt:
1704         * SourcesIOS.txt: Removed.
1705         * SourcesMac.txt: Removed.
1706         * WebCore.xcodeproj/project.pbxproj:
1707         * editing/WebContentReader.h:
1708         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
1709
1710 2018-02-21  Youenn Fablet  <youenn@apple.com>
1711
1712         Make SubstituteResource take a ResourceResponse r-value
1713         https://bugs.webkit.org/show_bug.cgi?id=183020
1714
1715         Reviewed by Alex Christensen.
1716
1717         No change of behavior.
1718         Make SubstituteResource take a ResourceResponse r-value.
1719         Update ArchiveResource accordingly.
1720         Take benefit of that in ApplicationCacheResource to set the response source to ApplicationCache
1721         before passing it to SubstituteResource constructor.
1722
1723         * loader/SubstituteResource.h:
1724         (WebCore::SubstituteResource::SubstituteResource):
1725         (WebCore::SubstituteResource::resourceResponse): Deleted.
1726         * loader/appcache/ApplicationCacheResource.cpp:
1727         (WebCore::ApplicationCacheResource::create):
1728         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
1729         * loader/appcache/ApplicationCacheResource.h:
1730         (WebCore::ApplicationCacheResource::create): Deleted.
1731         * loader/archive/ArchiveResource.cpp:
1732         (WebCore::ArchiveResource::ArchiveResource):
1733
1734 2018-02-21  Zalan Bujtas  <zalan@apple.com>
1735
1736         [RenderTreeBuilder] ::willBeRemoved() does not need RenderTreeBuilder anymore.
1737         https://bugs.webkit.org/show_bug.cgi?id=183019
1738         <rdar://problem/37761421>
1739
1740         Reviewed by Antti Koivisto.
1741
1742         All the willBeDestroyed() mutations have been moved over to RenderTreeBuilder. 
1743
1744         No change in functionality.
1745
1746         * rendering/RenderBlock.cpp:
1747         (WebCore::RenderBlock::willBeDestroyed):
1748         * rendering/RenderBlock.h:
1749         * rendering/RenderBlockFlow.cpp:
1750         (WebCore::RenderBlockFlow::willBeDestroyed):
1751         * rendering/RenderBlockFlow.h:
1752         * rendering/RenderBox.cpp:
1753         (WebCore::RenderBox::willBeDestroyed):
1754         * rendering/RenderBox.h:
1755         * rendering/RenderBoxModelObject.cpp:
1756         (WebCore::RenderBoxModelObject::willBeDestroyed):
1757         * rendering/RenderBoxModelObject.h:
1758         * rendering/RenderCounter.cpp:
1759         (WebCore::RenderCounter::willBeDestroyed):
1760         * rendering/RenderCounter.h:
1761         * rendering/RenderElement.cpp:
1762         (WebCore::RenderElement::willBeDestroyed):
1763         * rendering/RenderElement.h:
1764         * rendering/RenderEmbeddedObject.cpp:
1765         (WebCore::RenderEmbeddedObject::willBeDestroyed):
1766         * rendering/RenderEmbeddedObject.h:
1767         * rendering/RenderFragmentedFlow.cpp:
1768         (WebCore::RenderFragmentedFlow::willBeDestroyed):
1769         * rendering/RenderFragmentedFlow.h:
1770         * rendering/RenderImage.cpp:
1771         (WebCore::RenderImage::willBeDestroyed):
1772         * rendering/RenderImage.h:
1773         * rendering/RenderInline.cpp:
1774         (WebCore::RenderInline::willBeDestroyed):
1775         * rendering/RenderInline.h:
1776         * rendering/RenderLayerModelObject.cpp:
1777         (WebCore::RenderLayerModelObject::willBeDestroyed):
1778         * rendering/RenderLayerModelObject.h:
1779         * rendering/RenderListBox.cpp:
1780         (WebCore::RenderListBox::willBeDestroyed):
1781         * rendering/RenderListBox.h:
1782         * rendering/RenderListMarker.cpp:
1783         (WebCore::RenderListMarker::willBeDestroyed):
1784         * rendering/RenderListMarker.h:
1785         * rendering/RenderMenuList.cpp:
1786         (WebCore::RenderMenuList::willBeDestroyed):
1787         * rendering/RenderMenuList.h:
1788         * rendering/RenderObject.cpp:
1789         (WebCore::RenderObject::willBeDestroyed):
1790         (WebCore::RenderObject::destroy):
1791         * rendering/RenderObject.h:
1792         * rendering/RenderReplaced.cpp:
1793         (WebCore::RenderReplaced::willBeDestroyed):
1794         * rendering/RenderReplaced.h:
1795         * rendering/RenderSearchField.cpp:
1796         (WebCore::RenderSearchField::willBeDestroyed):
1797         * rendering/RenderSearchField.h:
1798         * rendering/RenderSnapshottedPlugIn.cpp:
1799         (WebCore::RenderSnapshottedPlugIn::willBeDestroyed):
1800         * rendering/RenderSnapshottedPlugIn.h:
1801         * rendering/RenderText.cpp:
1802         (WebCore::RenderText::willBeDestroyed):
1803         * rendering/RenderText.h:
1804         * rendering/RenderTextControlMultiLine.cpp:
1805         (WebCore::RenderTextControlMultiLine::willBeDestroyed):
1806         * rendering/RenderTextControlMultiLine.h:
1807         * rendering/RenderVideo.cpp:
1808         (WebCore::RenderVideo::willBeDestroyed):
1809         * rendering/RenderVideo.h:
1810         * rendering/RenderWidget.cpp:
1811         (WebCore::RenderWidget::willBeDestroyed):
1812         * rendering/RenderWidget.h:
1813         * rendering/svg/RenderSVGBlock.cpp:
1814         (WebCore::RenderSVGBlock::willBeDestroyed):
1815         * rendering/svg/RenderSVGBlock.h:
1816         * rendering/svg/RenderSVGImage.cpp:
1817         (WebCore::RenderSVGImage::willBeDestroyed):
1818         * rendering/svg/RenderSVGImage.h:
1819         * rendering/svg/RenderSVGInline.cpp:
1820         (WebCore::RenderSVGInline::willBeDestroyed):
1821         * rendering/svg/RenderSVGInline.h:
1822         * rendering/svg/RenderSVGModelObject.cpp:
1823         (WebCore::RenderSVGModelObject::willBeDestroyed):
1824         * rendering/svg/RenderSVGModelObject.h:
1825         * rendering/svg/RenderSVGResourceContainer.cpp:
1826         (WebCore::RenderSVGResourceContainer::willBeDestroyed):
1827         * rendering/svg/RenderSVGResourceContainer.h:
1828         * rendering/svg/RenderSVGRoot.cpp:
1829         (WebCore::RenderSVGRoot::willBeDestroyed):
1830         * rendering/svg/RenderSVGRoot.h:
1831         * rendering/svg/RenderSVGText.cpp:
1832         (WebCore::RenderSVGText::willBeDestroyed):
1833         * rendering/svg/RenderSVGText.h:
1834
1835 2018-02-21  Per Arne Vollan  <pvollan@apple.com>
1836
1837         The WebContent process should not use NSScreen in the screenAvailableRect/screenRect implementations.
1838         https://bugs.webkit.org/show_bug.cgi?id=182855
1839
1840         Reviewed by Brent Fulgham.
1841
1842         On macOS, the functions screenAvailableRect and screenRect is implemented using NSScreen, which is communicating
1843         with the WindowServer. To avoid this WindowServer communication from the WebContent process when calling
1844         screenAvailableRect and screenRect, it is possible to let the UIProcess send a message to the WebContent
1845         process whenever there is a change in the display properties, and have the WebContent process cache these
1846         display properties. This message should also be sent to a newly started WebContent process.
1847
1848         No new tests, covered by existing tests.
1849
1850         * WebCore.xcodeproj/project.pbxproj:
1851         * platform/PlatformScreen.h:
1852         * platform/mac/PlatformScreenMac.mm:
1853         (WebCore::getScreenProperties):
1854         (WebCore::screenProperties):
1855         (WebCore::setScreenProperties):
1856         (WebCore::screenRect):
1857         (WebCore::screenAvailableRect):
1858         * platform/ScreenProperties.h: Added.
1859         (WebCore::ScreenProperties::encode const):
1860         (WebCore::ScreenProperties::decode):
1861
1862 2018-02-21  Christopher Reid  <chris.reid@sony.com>
1863
1864         [Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationParameters
1865         https://bugs.webkit.org/show_bug.cgi?id=182751
1866
1867         Reviewed by Youenn Fablet.
1868
1869         No change in behavior.
1870
1871         Adding support to set a custom CookieJar Database.
1872         Took CookieJarDB::open() out of its constructor because both the Network and Web process
1873         were trying to open the journal files but one process was failing due to a lack of permission.
1874         Now the database file is lazily opened and only the Network process will try to open the database.
1875         Some cleanup was done to CookieJarDB too.
1876
1877         * platform/network/NetworkStorageSession.h:
1878         * platform/network/curl/CookieJarDB.cpp:
1879         * platform/network/curl/CookieJarDB.h:
1880         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1881
1882 2018-02-21  Chris Dumez  <cdumez@apple.com>
1883
1884         Regression(r228708): Crash under WebCore::MediaResource::responseReceived(WebCore::CachedResource&, WebCore::ResourceResponse const&)
1885         https://bugs.webkit.org/show_bug.cgi?id=183018
1886         <rdar://problem/37754154>
1887
1888         Reviewed by Eric Carlson.
1889
1890         The fix at r228708 was trying to address the fact that avplayer sometimes
1891         deallocates WebCoreNSURLSessionDataTask objects on a non-main thread, which
1892         was not safe because its _resource data member needs to be deallocated on
1893         the main thread.
1894
1895         The issue is that r228708 caused _resource to outlive its WebCoreNSURLSessionDataTask.
1896         This is an issue because _resource has a client data member (of type WebCoreNSURLSessionDataTaskClient)
1897         which has a raw pointer to the WebCoreNSURLSessionDataTask. This means that the main thread could
1898         call methods like responseReceived() on the resource, which would call responseReceived() on the
1899         client, which would try to call [WebCoreNSURLSessionDataTask receivedResponse:] with an invalid
1900         m_task pointer.
1901
1902         To address the issue, I introduced a clearTask() method on WebCoreNSURLSessionDataTaskClient, which
1903         gets called from a non-main thread to clear the client's m_task pointer when the task is destroyed
1904         on a non-main thread. So that this is safe, every time the client tries to use m_task, we now
1905         acquire a lock for thread-safety and do a null-check on m_task.
1906
1907         No new tests, no known reproduction case.
1908
1909         * platform/graphics/PlatformMediaResourceLoader.h:
1910         (WebCore::PlatformMediaResource::client):
1911         * platform/network/cocoa/WebCoreNSURLSession.mm:
1912         (WebCore::WebCoreNSURLSessionDataTaskClient::clearTask):
1913         (WebCore::WebCoreNSURLSessionDataTaskClient::dataSent):
1914         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
1915         (WebCore::WebCoreNSURLSessionDataTaskClient::shouldCacheResponse):
1916         (WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived):
1917         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
1918         (WebCore::WebCoreNSURLSessionDataTaskClient::accessControlCheckFailed):
1919         (WebCore::WebCoreNSURLSessionDataTaskClient::loadFailed):
1920         (WebCore::WebCoreNSURLSessionDataTaskClient::loadFinished):
1921         (-[WebCoreNSURLSessionDataTask dealloc]):
1922
1923 2018-02-21  Youenn Fablet  <youenn@apple.com>
1924
1925         Move AppCache loading to the NetworkProcess
1926         https://bugs.webkit.org/show_bug.cgi?id=178540
1927         <rdar://problem/37119346>
1928
1929         Reviewed by Alex Christensen.
1930
1931         Covered by existing tests.
1932
1933         Use ApplicationResourceLoader for cache entry loading.
1934         Remove all ResourceHandle use from ApplicationCacheGroup.
1935         Renamed m_loader in m_manifestLoader and added a new m_entryLoader to load cache entries.
1936
1937         Updated ApplicationCacheResourceLoader to handle different types of CachedResource.
1938         This allows in particular to handle redirections based on the resource type and create the ApplicationCacheResource with the right type.
1939         Use Include as credentials mode as per specification.
1940
1941         Add a new ApplicationCache ResourceResonse::Source.
1942         This allows fixing an assertion and should allow better inspector support if needs be.
1943
1944         * inspector/agents/InspectorNetworkAgent.cpp:
1945         (WebCore::responseSource):
1946         * loader/ResourceLoader.cpp:
1947         (WebCore::logResourceResponseSource):
1948         * loader/SubstituteResource.h:
1949         (WebCore::SubstituteResource::resourceResponse):
1950         * loader/appcache/ApplicationCacheGroup.cpp:
1951         (WebCore::ApplicationCacheGroup::stopLoading):
1952         (WebCore::ApplicationCacheGroup::update):
1953         (WebCore::ApplicationCacheGroup::didFinishLoading):
1954         (WebCore::ApplicationCacheGroup::didFinishLoadingEntry):
1955         (WebCore::ApplicationCacheGroup::didFail):
1956         (WebCore::ApplicationCacheGroup::didFailLoadingEntry):
1957         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
1958         (WebCore::ApplicationCacheGroup::startLoadingEntry):
1959         * loader/appcache/ApplicationCacheGroup.h:
1960         * loader/appcache/ApplicationCacheResource.cpp:
1961         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
1962         * loader/appcache/ApplicationCacheResourceLoader.cpp:
1963         (WebCore::ApplicationCacheResourceLoader::create):
1964         (WebCore::ApplicationCacheResourceLoader::ApplicationCacheResourceLoader):
1965         (WebCore::ApplicationCacheResourceLoader::responseReceived):
1966         (WebCore::ApplicationCacheResourceLoader::redirectReceived):
1967         * loader/appcache/ApplicationCacheResourceLoader.h:
1968         * platform/network/ResourceResponseBase.h:
1969         * platform/network/cocoa/ResourceResponseCocoa.mm:
1970         (WebCore::ResourceResponse::platformCertificateInfo const):
1971         * testing/Internals.cpp:
1972         (WebCore::responseSourceToString):
1973
1974 2018-02-21  Zalan Bujtas  <zalan@apple.com>
1975
1976         [RenderTreeBuilder] Move RenderBoxModelObject::willBeRemoved() mutation logic to RenderTreeBuilder
1977         https://bugs.webkit.org/show_bug.cgi?id=183014
1978         <rdar://problem/37757428>
1979
1980         Reviewed by Antti Koivisto.
1981
1982         No change in functionality.
1983
1984         * Sources.txt:
1985         * WebCore.xcodeproj/project.pbxproj:
1986         * rendering/RenderBoxModelObject.cpp:
1987         (WebCore::RenderBoxModelObject::~RenderBoxModelObject):
1988         (WebCore::RenderBoxModelObject::willBeDestroyed):
1989         (WebCore::RenderBoxModelObject::continuationChainNode const):
1990         (): Deleted.
1991         (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations): Deleted.
1992         * rendering/RenderBoxModelObject.h:
1993         * rendering/updating/RenderTreeBuilder.cpp:
1994         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
1995         (WebCore::RenderTreeBuilder::removeAndDestroy):
1996         * rendering/updating/RenderTreeBuilder.h:
1997         (WebCore::RenderTreeBuilder::continuationBuilder):
1998         * rendering/updating/RenderTreeBuilderContinuation.cpp: Added.
1999         (WebCore::RenderTreeBuilder::Continuation::Continuation):
2000         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
2001         * rendering/updating/RenderTreeBuilderContinuation.h: Added.
2002
2003 2018-02-21  Youenn Fablet  <youenn@apple.com>
2004
2005         ServiceWorkerJob::m_lastResponse is unneeded
2006         https://bugs.webkit.org/show_bug.cgi?id=183013
2007
2008         Reviewed by Chris Dumez.
2009
2010         Remove this field since not used anywhere.
2011
2012         * workers/service/ServiceWorkerJob.cpp:
2013         (WebCore::ServiceWorkerJob::didReceiveResponse):
2014         * workers/service/ServiceWorkerJob.h:
2015
2016 2018-02-21  Youenn Fablet  <youenn@apple.com>
2017
2018         Use ResourceLoader to load appcache manifest
2019         https://bugs.webkit.org/show_bug.cgi?id=182861
2020
2021         Reviewed by Alex Christensen.
2022
2023         Covered by updated tests.
2024
2025         Add ApplicationCacheResourceLoader to load an ApplicationCacheResource from a ResourceLoader.
2026         Make use of it to load the app cache manifest.
2027         Future work should load entries using the same loader.
2028
2029         Remove manifest handle.
2030         Ensure that DocumentLoader does not register the manifest resource loader as its lifetime
2031         is handled by its ApplicationCacheGroup.
2032
2033         Add a ResourceLoader option to bypass the application cache.
2034         Use it for manifest loading.
2035
2036         * Sources.txt:
2037         * WebCore.xcodeproj/project.pbxproj:
2038         * loader/DocumentLoader.cpp:
2039         (WebCore::DocumentLoader::addSubresourceLoader):
2040         * loader/ResourceLoaderOptions.h:
2041         * loader/appcache/ApplicationCacheGroup.cpp:
2042         (WebCore::ApplicationCacheGroup::stopLoading):
2043         (WebCore::ApplicationCacheGroup::update):
2044         (WebCore::ApplicationCacheGroup::createRequest):
2045         (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
2046         (WebCore::ApplicationCacheGroup::didReceiveData):
2047         (WebCore::ApplicationCacheGroup::didFinishLoading):
2048         (WebCore::ApplicationCacheGroup::didFail):
2049         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
2050         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
2051         * loader/appcache/ApplicationCacheGroup.h:
2052         * loader/appcache/ApplicationCacheHost.cpp:
2053         (WebCore::ApplicationCacheHost::maybeLoadResource):
2054         (WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect):
2055         (WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse):
2056         (WebCore::ApplicationCacheHost::maybeLoadFallbackForError):
2057         * loader/appcache/ApplicationCacheResourceLoader.cpp: Added.
2058         * loader/appcache/ApplicationCacheResourceLoader.h: Added.
2059
2060 2018-02-21  Don Olmstead  <don.olmstead@sony.com>
2061
2062         [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
2063         https://bugs.webkit.org/show_bug.cgi?id=182883
2064
2065         Reviewed by Per Arne Vollan.
2066
2067         No new tests. No change in behavior.
2068
2069         * WebCorePrefix.h:
2070         * config.h:
2071         * testing/js/WebCoreTestSupportPrefix.h:
2072
2073 2018-02-21  Zalan Bujtas  <zalan@apple.com>
2074
2075         [RenderTreeBuilder] Move RenderView::willBeRemoved() mutation logic to RenderTreeBuilder
2076         https://bugs.webkit.org/show_bug.cgi?id=183009
2077
2078         Reviewed by Antti Koivisto.
2079
2080         No change in functionality.
2081
2082         * dom/Document.cpp:
2083         (WebCore::Document::destroyRenderTree):
2084         * rendering/RenderView.cpp:
2085         (WebCore::RenderView::~RenderView):
2086         (WebCore::RenderView::willBeDestroyed): Deleted.
2087         * rendering/RenderView.h:
2088
2089 2018-02-21  Michael Catanzaro  <mcatanzaro@igalia.com>
2090
2091         [GTK] USE_UPOWER causes crashes inside a chroot or on systems with broken dbus/upower
2092         https://bugs.webkit.org/show_bug.cgi?id=181825
2093
2094         Reviewed by Carlos Garcia Campos.
2095
2096         We could fix this crash, but that would not be good enough, because upower-glib is a
2097         synchronous API that wraps D-Bus calls. That's not acceptable for use in the web process.
2098         Rewrite LowPowerModeNotifierGLib to use upower's D-Bus API directly, instead.
2099
2100         Note that this also enables LowPowerModeNotifier for WPE, since the USE(UPOWER) build
2101         flag is no longer needed.
2102
2103         * platform/LowPowerModeNotifier.cpp:
2104         * platform/LowPowerModeNotifier.h:
2105         * platform/glib/LowPowerModeNotifierGLib.cpp:
2106         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
2107         (WebCore::LowPowerModeNotifier::updateWarningLevel):
2108         (WebCore::LowPowerModeNotifier::warningLevelChanged):
2109         (WebCore::LowPowerModeNotifier::gPropertiesChangedCallback):
2110         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
2111         (WebCore::LowPowerModeNotifier::updateState): Deleted.
2112         (WebCore::LowPowerModeNotifier::warningLevelCallback): Deleted.
2113
2114 2018-02-21  Chris Dumez  <cdumez@apple.com>
2115
2116         VTTCue constructor should use 'double' type for startTime / endTime
2117         https://bugs.webkit.org/show_bug.cgi?id=182988
2118
2119         Reviewed by Eric Carlson.
2120
2121         VTTCue constructor should use 'double' type for startTime / endTime, not
2122         'unrestricted double':
2123         - https://w3c.github.io/webvtt/#the-vttcue-interface
2124
2125         Otherwise, we end up potentially returning NaN for TextTrackCue.startTime / endTime,
2126         even though those correctly use type 'double':
2127         - https://html.spec.whatwg.org/multipage/media.html#texttrackcue
2128
2129         The new behavior is consistent with Firefox and Chrome.
2130
2131         No new tests, updated existing test.
2132
2133         * bindings/js/JSDOMConvertNumbers.h:
2134         (WebCore::JSConverter<IDLDouble>::convert):
2135         Add assertion to make sure our implementation never tries to return NaN
2136         for an IDL attribute of type 'double'. This would be invalid as per Web
2137         IDL spec and would crash if the NaN being returned was impure as JSValue
2138         could not store it as a double.
2139
2140         * html/track/VTTCue.idl:
2141         Update constructor parameters to use 'double' type instead of 'unrestricted
2142         double', as per:
2143         - https://w3c.github.io/webvtt/#the-vttcue-interface
2144
2145 2018-02-21  Zalan Bujtas  <zalan@apple.com>
2146
2147         [RenderTreeBuilder] Move RenderTextFragment::willBeRemoved() mutation logic to RenderTreeBuilder
2148         https://bugs.webkit.org/show_bug.cgi?id=182946
2149         <rdar://problem/37690039>
2150
2151         Reviewed by Antti Koivisto.
2152
2153         No change in functionality.
2154
2155         * rendering/RenderTextFragment.cpp:
2156         (WebCore::RenderTextFragment::willBeDestroyed):
2157         * rendering/updating/RenderTreeBuilder.cpp:
2158         (WebCore::RenderTreeBuilder::takeChild):
2159         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2160         (WebCore::RenderTreeBuilder::FirstLetter::cleanupOnRemoval):
2161         * rendering/updating/RenderTreeBuilderFirstLetter.h:
2162
2163 2018-02-21  Ms2ger  <Ms2ger@igalia.com>
2164
2165         [GCrypt] Remove unsound assertion from CryptoKeyRSA::exportData().
2166         https://bugs.webkit.org/show_bug.cgi?id=183001
2167
2168         Reviewed by Philippe Normand.
2169
2170         This function is called from structured cloning, in particular when storing
2171         a key in IndexedDB. This would trip the assertion if the key in question is
2172         non-exportable.
2173
2174         The assertion was copied from the macOS implementation in r172389; it was
2175         subsequently removed there in r172898 to handle this case.
2176
2177         Test: crypto/subtle/rsa-indexeddb-non-exportable.html
2178
2179         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
2180         (WebCore::CryptoKeyRSA::exportData const): remove assertion.
2181
2182 2018-02-21  Myles C. Maxfield  <mmaxfield@apple.com>
2183
2184         [Cocoa] Make system-ui obey the user-installed-font policy
2185         https://bugs.webkit.org/show_bug.cgi?id=182860
2186         <rdar://problem/36158249>
2187
2188         Reviewed by Antti Koivisto.
2189
2190         We have a completely different codepath for system-ui which makes it follow the system's
2191         font cascade list. This codepath (along with all the other relevant places which create
2192         system fonts) needs to obey the AllowUserInstalledFonts enum. This patch is fairly
2193         mechanical; we simply are hooking up the flag across SystemFontDatabase.
2194
2195         There are a few places which creates system fonts which this patch doesn't touch. This is
2196         not a problem because all the remaining places either:
2197         1) Simply pull out some attributes of the font (name, weight, size, etc.) and then throw
2198         away the font object itself, or
2199         2) Use the font in an environment where script cannot access the characters rendered (such
2200         as DragImages or the fullscreen placeholder view or the inside of the attachment element).
2201
2202         Test: fast/text/user-installed-fonts/system-ui.html
2203
2204         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2205         (WebCore::FontDatabase::collectionForFamily):
2206         (WebCore::FontDatabase::fontForPostScriptName):
2207         (WebCore::fontWithFamily):
2208         (WebCore::installedFontMandatoryAttributes):
2209         (WebCore::createSpecificFontForInstalledFonts):
2210         * platform/graphics/cocoa/FontCacheCoreText.h:
2211         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2212         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const):
2213         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const):
2214         (WebCore::SystemFontDatabase::systemFontCascadeList):
2215         (WebCore::SystemFontDatabase::removeCascadeList):
2216         (WebCore::SystemFontDatabase::computeCascadeList):
2217         (WebCore::systemFontParameters):
2218         (WebCore::systemFontCascadeList):
2219         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
2220         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
2221         * platform/graphics/ios/FontCacheIOS.mm:
2222         (WebCore::platformFontWithFamilySpecialCase):
2223         * platform/graphics/mac/FontCacheMac.mm:
2224         (WebCore::platformFontWithFamilySpecialCase):
2225
2226 2018-02-21  Chris Dumez  <cdumez@apple.com>
2227
2228         Unreviewed attempt to fix build after r228867.
2229
2230         * Modules/webvr/VRStageParameters.cpp:
2231
2232 2018-02-21  Philippe Normand  <pnormand@igalia.com>
2233
2234         [GStreamer] Rewrite purgeInvalid*Tracks methods
2235         https://bugs.webkit.org/show_bug.cgi?id=183004
2236
2237         Reviewed by Carlos Garcia Campos.
2238
2239         Removing items from a hashmap while iterating is bad.
2240
2241         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2242         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks):
2243         Safely remove items from the hashmap using removeIf().
2244         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
2245         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
2246
2247 2018-02-21  Chris Dumez  <cdumez@apple.com>
2248
2249         Unreviewed attempt to fix build after r228867.
2250
2251         * Modules/webvr/VRStageParameters.cpp:
2252
2253 2018-02-21  Philippe Normand  <pnormand@igalia.com>
2254
2255         [GStreamer] Crash in Debug build when purging invalid tracks
2256         https://bugs.webkit.org/show_bug.cgi?id=182997
2257
2258         Reviewed by Xabier Rodriguez-Calvar.
2259
2260         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2261         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Clear the hashmap when there is no valid track left.
2262         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
2263         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
2264         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
2265         (WebCore::TrackPrivateBaseGStreamer::getLanguageCode): Demote debugging, this appears too much at least with playbin2.
2266         (WebCore::TrackPrivateBaseGStreamer::getTag): Ditto.
2267
2268 2018-02-21  Philippe Normand  <pnormand@igalia.com>
2269
2270         [GStreamer] We need to adopt GstGlDisplays after GStreamer 1.13.1
2271         https://bugs.webkit.org/show_bug.cgi?id=182996
2272
2273         Reviewed by Xabier Rodriguez-Calvar.
2274
2275         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2276         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2277         Adopt references when running with GStreamer 1.13.1 to avoid
2278         memory leaks.
2279
2280 2018-02-20  Philippe Normand  <pnormand@igalia.com>
2281
2282         [GTK] Layout test media/track/track-in-band-duplicate-tracks-when-source-changes.html failing since r228617
2283         https://bugs.webkit.org/show_bug.cgi?id=160131
2284         <rdar://problem/35873985>
2285
2286         Reviewed by Michael Catanzaro.
2287
2288         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2289         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): We
2290         can't assume the pad has a sticky event here like implemented in
2291         InbandTextTrackPrivateGStreamer because it might be emitted after
2292         the track was created. So fallback to a dummy stream ID like in
2293         the Audio and Video tracks.
2294
2295 2018-02-20  Sergio Villar Senin  <svillar@igalia.com>
2296
2297         [WebVR][OpenVR] Retrieve stage parameters
2298         https://bugs.webkit.org/show_bug.cgi?id=182976
2299
2300         Reviewed by Žan Doberšek.
2301
2302         Use OpenVR to retrieve stage parameters, i.e., play area size and
2303         the transformation from sitting to standing position. It includes
2304         the same fallback used by Firefox to provide sensible values in case
2305         we cannot get the required information from the VR SDK (it's quite
2306         common not to have defined a play area).
2307
2308         * Modules/webvr/VRDisplay.cpp:
2309         (WebCore::VRDisplay::stageParameters const):
2310         * Modules/webvr/VRDisplay.h:
2311         * Modules/webvr/VRStageParameters.cpp:
2312         (WebCore::VRStageParameters::VRStageParameters):
2313         (WebCore::VRStageParameters::sittingToStandingTransform const):
2314         (WebCore::VRStageParameters::sizeX const):
2315         (WebCore::VRStageParameters::sizeZ const):
2316         * Modules/webvr/VRStageParameters.h:
2317         (WebCore::VRStageParameters::create):
2318         * platform/vr/VRPlatformDisplay.h:
2319         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
2320         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
2321         (WebCore::VRPlatformDisplayOpenVR::updateStageParameters):
2322         * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
2323
2324 2018-02-21  Philippe Normand  <pnormand@igalia.com>
2325
2326         [GStreamer] Create a Wayland GL display instead of EGL
2327         https://bugs.webkit.org/show_bug.cgi?id=182968
2328
2329         Reviewed by Xabier Rodriguez-Calvar.
2330
2331         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2332         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2333         Add logging and instantiate a GstDisplayWayland display instead of
2334         an EGL display when running under a Wayland compositor.
2335
2336 2018-02-21  Zalan Bujtas  <zalan@apple.com>
2337
2338         [RenderTreeBuilder] Move RenderFullScreen::willBeRemoved() mutation logic to RenderTreeBuilder
2339         https://bugs.webkit.org/show_bug.cgi?id=182947
2340         <rdar://problem/37690848>
2341
2342         Reviewed by Antti Koivisto.
2343
2344         No change in functionality.
2345
2346         * Sources.txt:
2347         * WebCore.xcodeproj/project.pbxproj:
2348         * rendering/RenderFullScreen.cpp:
2349         (WebCore::RenderFullScreen::willBeDestroyed):
2350         * rendering/updating/RenderTreeBuilder.cpp:
2351         (WebCore::RenderTreeBuilder::takeChild):
2352         * rendering/updating/RenderTreeBuilder.h:
2353         (WebCore::RenderTreeBuilder::fullScreenBuilder):
2354         * rendering/updating/RenderTreeBuilderFullScreen.cpp: Added.
2355         (WebCore::RenderTreeBuilder::FullScreen::FullScreen):
2356         (WebCore::RenderTreeBuilder::FullScreen::cleanupOnRemoval):
2357         * rendering/updating/RenderTreeBuilderFullScreen.h: Added.
2358         * rendering/updating/RenderTreeBuilderMathML.cpp:
2359
2360 2018-02-20  Zalan Bujtas  <zalan@apple.com>
2361
2362         [RenderTreeBuilder] Move RenderListItem::willBeRemoved() mutation logic to RenderTreeBuilder
2363         https://bugs.webkit.org/show_bug.cgi?id=182943
2364         <rdar://problem/37689029>
2365
2366         Reviewed by Antti Koivisto.
2367
2368         We don't need to destroy the marker in RenderListItem::willBeRemoved(), because it gets deleted
2369         in RenderTreeBuilder::removeAndDestroy() together with RenderListItem (as long as the marker is
2370         the RenderListItem's descendent). 
2371
2372         Covered by existing tests.
2373
2374         * rendering/RenderListItem.cpp:
2375         (WebCore::RenderListItem::~RenderListItem):
2376         (WebCore::RenderListItem::willBeDestroyed): Deleted.
2377         * rendering/RenderListItem.h:
2378
2379 2018-02-20  Nan Wang  <n_wang@apple.com>
2380
2381         AX: Keyboard focus not following VoiceOver cursor into web content or within web content.
2382         https://bugs.webkit.org/show_bug.cgi?id=182752
2383         <rdar://problem/37518233>
2384
2385         Reviewed by Ryosuke Niwa.
2386
2387         Call the assistive technology specific method for becoming first responder.
2388
2389         Test: accessibility/mac/accessibility-make-first-responder.html
2390
2391         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2392         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2393         * page/ChromeClient.h:
2394
2395 2018-02-20  Tim Horton  <timothy_horton@apple.com>
2396
2397         Introduce HAVE(IOSURFACE_ACCELERATOR)
2398         https://bugs.webkit.org/show_bug.cgi?id=182955
2399         <rdar://problem/37699510>
2400
2401         Reviewed by Sam Weinig.
2402
2403         No new tests, no change in behavior.
2404
2405         Introduce HAVE(IOSURFACE_ACCELERATOR) and guard all uses of
2406         IOSurfaceAccelerator behind it.
2407
2408         Rename USE(IOSURFACE) to HAVE(IOSURFACE) for accuracy.
2409
2410         * page/cocoa/MemoryReleaseCocoa.mm:
2411         * platform/graphics/ca/TileController.cpp:
2412         * platform/graphics/cg/IOSurfacePool.cpp:
2413         * platform/graphics/cg/IOSurfacePool.h:
2414         * platform/graphics/cg/ImageBufferCG.cpp:
2415         * platform/graphics/cocoa/IOSurface.h:
2416         * platform/graphics/cocoa/IOSurface.mm:
2417         * platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
2418         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2419         * platform/graphics/cv/VideoTextureCopierCV.h:
2420
2421 2018-02-20  Chris Dumez  <cdumez@apple.com>
2422
2423         Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
2424         https://bugs.webkit.org/show_bug.cgi?id=182720
2425         <rdar://problem/37515204>
2426
2427         Reviewed by Alex Christensen.
2428
2429         Wait for the policy response from the client after receiving a resource response,
2430         before sending the NetworkResourceLoader::ContinueDidReceiveResponse IPC back to
2431         the NetworkProcess. Otherwise, the network process may start sending us data and
2432         we may end up committing the provisional load before receiving the policy decision
2433         fron the client.
2434
2435         Change is covered by new API test.
2436
2437         * loader/DocumentLoader.cpp:
2438         (WebCore::DocumentLoader::responseReceived):
2439         * loader/NetscapePlugInStreamLoader.cpp:
2440         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
2441         * loader/NetscapePlugInStreamLoader.h:
2442         * loader/ResourceLoader.cpp:
2443         (WebCore::ResourceLoader::deliverResponseAndData):
2444         (WebCore::ResourceLoader::loadDataURL):
2445         (WebCore::ResourceLoader::didReceiveResponse):
2446         (WebCore::ResourceLoader::didReceiveResponseAsync):
2447         * loader/ResourceLoader.h:
2448         * loader/SubresourceLoader.cpp:
2449         (WebCore::SubresourceLoader::didReceiveResponse):
2450         (WebCore::SubresourceLoader::didReceiveResponsePolicy):
2451         (WebCore::SubresourceLoader::willCancel):
2452         * loader/SubresourceLoader.h:
2453         * loader/ios/PreviewLoader.mm:
2454         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
2455
2456 2018-02-20  Chris Dumez  <cdumez@apple.com>
2457
2458         Crash under JSC::JSCell::toNumber(JSC::ExecState*)
2459         https://bugs.webkit.org/show_bug.cgi?id=182984
2460         <rdar://problem/37694346>
2461
2462         Reviewed by Mark Lam.
2463
2464         The issue was caused by DOMMatrix attributes potentially returning "impure"
2465         NaN values. We would call JSC::jsNumber(double) to construct the JSValue
2466         but this is only safe for pure NaN values. Make sure we purify the double
2467         returned by the implementation for IDL attributes of type 'unrestricted double'
2468         before calling JSC::jsNumber(double).
2469
2470         No new tests, extended existing test.
2471
2472         * bindings/js/JSDOMConvertNumbers.h:
2473         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
2474         * testing/TypeConversions.h:
2475         (WebCore::TypeConversions::testImpureNaNUnrestrictedDouble const):
2476         (WebCore::TypeConversions::testImpureNaN2UnrestrictedDouble const):
2477         (WebCore::TypeConversions::testQuietNaNUnrestrictedDouble const):
2478         * testing/TypeConversions.idl:
2479
2480 2018-02-20  Tim Horton  <timothy_horton@apple.com>
2481
2482         Make more use of USE(OPENGL_ES) where it makes sense
2483         https://bugs.webkit.org/show_bug.cgi?id=182957
2484         <rdar://problem/37699443>
2485
2486         Reviewed by Dan Bernstein.
2487
2488         No new tests, no behavior change.
2489
2490         Make use of USE(OPENGL_ES) for CoreVideo functions that differ based
2491         on GL availability. Also adjust GraphicsContext3D in the same way.
2492
2493         * platform/cocoa/CoreVideoSoftLink.cpp:
2494         * platform/cocoa/CoreVideoSoftLink.h:
2495         * platform/graphics/GraphicsContext3D.h:
2496         * platform/graphics/cv/TextureCacheCV.mm:
2497         (WebCore::TextureCacheCV::create):
2498         (WebCore::TextureCacheCV::textureFromImage):
2499         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2500         (WebCore::enumToStringMap):
2501         (WebCore::VideoTextureCopierCV::initializeContextObjects):
2502         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
2503         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
2504         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
2505
2506 2018-02-20  Nan Wang  <n_wang@apple.com>
2507
2508         AX: AOM: Dispatch accessibleclick event
2509         https://bugs.webkit.org/show_bug.cgi?id=180898
2510         <rdar://problem/36086710>
2511
2512         Reviewed by Ryosuke Niwa.
2513
2514         Accessibility events.
2515         Spec: https://wicg.github.io/aom/spec/phase2.html
2516
2517         This patch allows developers to register event handlers on Elements
2518         for custom accessibility events.
2519
2520         Accessibility events go through a capturing and bubbling phase just
2521         like DOM events, but in the accessibility tree.
2522
2523         Implemented "accessibleclick" event.
2524
2525         Test: accessibility/mac/AOM-events.html
2526
2527         * accessibility/AccessibilityObject.cpp:
2528         (WebCore::AccessibilityObject::press):
2529         (WebCore::AccessibilityObject::dispatchAccessibilityEvent):
2530         * accessibility/AccessibilityObject.h:
2531         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2532         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
2533         * dom/Element.idl:
2534         * dom/EventDispatcher.cpp:
2535         (WebCore::dispatchEventWithType):
2536         (WebCore::EventDispatcher::dispatchEvent):
2537         * dom/EventDispatcher.h:
2538         * dom/EventNames.h:
2539         * dom/EventPath.cpp:
2540         (WebCore::EventPath::EventPath):
2541         * dom/EventPath.h:
2542
2543 2018-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2544
2545         [iOS 11.3 Beta] Can't copy a URL from Safari and paste it into the Gmail app
2546         https://bugs.webkit.org/show_bug.cgi?id=182952
2547         <rdar://problem/37636190>
2548
2549         Reviewed by Tim Horton.
2550
2551         After r220865 refactored the iOS copy codepaths to use NSItemProviders, we stopped writing the URL as plain text
2552         to the pasteboard. However, this means clients that only check for "text/plain" (or one of its aliases) on the
2553         pasteboard won't read any data on paste.
2554
2555         To fix this, we restore the pre-iOS 11.3 behavior of writing both the URL and plain text to the pasteboard.
2556         Since we're using item providers, we also ensure that the NSURL is at a higher fidelity than the string to make
2557         it clear that the data should be consumed as a URL.
2558
2559         This patch also rebaselines an existing drag and drop test to cover this change, and adds a new API test,
2560         ActionSheetTests.CopyLinkWritesURLAndPlainText, which simulates copying a link using the share sheet and pasting
2561         into a DataTransfer-dumping test harness.
2562
2563         * platform/ios/PlatformPasteboardIOS.mm:
2564         (WebCore::PlatformPasteboard::write):
2565
2566 2018-02-20  Eric Carlson  <eric.carlson@apple.com>
2567
2568         [iOS] Returning from Auto-PiP causes Safari to be unresponsive
2569         https://bugs.webkit.org/show_bug.cgi?id=182977
2570         <rdar://problem/37685981>
2571
2572         Reviewed by Jer Noble.
2573
2574         Remove the error handling added in r228115, it breaks auto-pip.
2575
2576         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2577         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
2578         (VideoFullscreenInterfaceAVKit::enterFullscreenStandard):
2579         (VideoFullscreenInterfaceAVKit::exitFullscreen):
2580         (VideoFullscreenInterfaceAVKit::cleanupFullscreen):
2581         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
2582         (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
2583         (VideoFullscreenInterfaceAVKit::exitFullscreenHandler):
2584         (VideoFullscreenInterfaceAVKit::enterFullscreenHandler):
2585
2586 2018-02-20  Jer Noble  <jer.noble@apple.com>
2587
2588         [EME] Adopt new AVContentKeySession success delegate callback
2589         https://bugs.webkit.org/show_bug.cgi?id=182974
2590         <rdar://problem/36079035>
2591
2592         Reviewed by Eric Carlson.
2593
2594         Store the updateLicenseCallback if the new protocol method is present and supported.
2595
2596         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
2597         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2598         (-[WebCoreFPSContentKeySessionDelegate contentKeySession:contentKeyRequestDidSucceed:]):
2599         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
2600         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
2601         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed):
2602
2603 2018-02-19  Dean Jackson  <dino@apple.com>
2604
2605         Handle all writing-modes in downcast
2606         https://bugs.webkit.org/show_bug.cgi?id=182949
2607         <rdar://problem/37710687>
2608
2609         Reviewed by Myles Maxfield.
2610
2611         It appears we forgot to handle the deprecated "lr"
2612         writing-mode value.
2613
2614         Test: fast/writing-mode/svg-writing-modes.html
2615
2616         * css/CSSPrimitiveValueMappings.h:
2617         (WebCore::CSSPrimitiveValue::operator WritingMode const):
2618
2619 2018-02-20  Zan Dobersek  <zdobersek@igalia.com>
2620
2621         [Cairo] Drop target GraphicsContext usage in Cairo operations
2622         https://bugs.webkit.org/show_bug.cgi?id=182964
2623
2624         Reviewed by Carlos Garcia Campos.
2625
2626         The GraphicsContext parameters in various Cairo operations are not used
2627         anymore, so they can be removed. Callsites are updated to reflect this.
2628
2629         * platform/graphics/cairo/CairoOperations.cpp:
2630         (WebCore::Cairo::drawShadowLayerBuffer):
2631         (WebCore::Cairo::fillShadowBuffer):
2632         (WebCore::Cairo::drawPathShadow):
2633         (WebCore::Cairo::drawGlyphsShadow):
2634         (WebCore::Cairo::fillRect):
2635         (WebCore::Cairo::fillRoundedRect):
2636         (WebCore::Cairo::fillRectWithRoundedHole):
2637         (WebCore::Cairo::fillPath):
2638         (WebCore::Cairo::strokeRect):
2639         (WebCore::Cairo::strokePath):
2640         (WebCore::Cairo::drawGlyphs):
2641         (WebCore::Cairo::drawNativeImage):
2642         (WebCore::Cairo::drawSurface):
2643         * platform/graphics/cairo/CairoOperations.h:
2644         * platform/graphics/cairo/FontCairo.cpp:
2645         (WebCore::FontCascade::drawGlyphs):
2646         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2647         (WebCore::GraphicsContext::drawNativeImage):
2648         (WebCore::GraphicsContext::fillPath):
2649         (WebCore::GraphicsContext::strokePath):
2650         (WebCore::GraphicsContext::fillRect):
2651         (WebCore::GraphicsContext::strokeRect):
2652         (WebCore::GraphicsContext::platformFillRoundedRect):
2653         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2654         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
2655         (WebCore::GraphicsContextImplCairo::fillRect):
2656         (WebCore::GraphicsContextImplCairo::fillRoundedRect):
2657         (WebCore::GraphicsContextImplCairo::fillRectWithRoundedHole):
2658         (WebCore::GraphicsContextImplCairo::fillPath):
2659         (WebCore::GraphicsContextImplCairo::strokeRect):
2660         (WebCore::GraphicsContextImplCairo::strokePath):
2661         (WebCore::GraphicsContextImplCairo::drawGlyphs):
2662         (WebCore::GraphicsContextImplCairo::drawNativeImage):
2663         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2664         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
2665
2666 2018-02-20  Sergio Villar Senin  <svillar@igalia.com>
2667
2668         [WebVR][OpenVR] Retrieve eye parameters and field of view
2669         https://bugs.webkit.org/show_bug.cgi?id=182962
2670
2671         Reviewed by Žan Doberšek.
2672
2673         Get the required data from OpenVR to fill in the VREyeParameters and
2674         the VRFieldOfView objects.
2675
2676         * Modules/webvr/VRDisplay.cpp: Create some attributes in the
2677         body of the constructor instead in the member initialization list to
2678         avoid calling getDisplayInfo() multiple times.
2679         (WebCore::VRDisplay::VRDisplay):
2680         (WebCore::VRDisplay::capabilities const):
2681         (WebCore::VRDisplay::getEyeParameters const):
2682         * Modules/webvr/VRDisplay.h:
2683         * Modules/webvr/VREyeParameters.cpp:
2684         (WebCore::VREyeParameters::VREyeParameters): Added new attributes to
2685         the constructor.
2686         (WebCore::VREyeParameters::offset const): Return a Ref instead of
2687         a raw pointer.
2688         (WebCore::VREyeParameters::renderWidth const):
2689         (WebCore::VREyeParameters::renderHeight const):
2690         * Modules/webvr/VREyeParameters.h:
2691         (WebCore::VREyeParameters::create):
2692         * Modules/webvr/VRFieldOfView.cpp: Removed. All the impletementation
2693         fits perfectly in the header file.
2694         * Modules/webvr/VRFieldOfView.h:
2695         (WebCore::VRFieldOfView::create):
2696         (WebCore::VRFieldOfView::upDegrees const):
2697         (WebCore::VRFieldOfView::rightDegrees const):
2698         (WebCore::VRFieldOfView::downDegrees const):
2699         (WebCore::VRFieldOfView::leftDegrees const):
2700         (WebCore::VRFieldOfView::VRFieldOfView):
2701         * Sources.txt:
2702         * platform/vr/VRPlatformDisplay.h: Added some more data to the
2703         VRPlatformDisplayInfo struct.
2704         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
2705         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
2706         (WebCore::VRPlatformDisplayOpenVR::computeFieldOfView): Computes the
2707         up/down/left/right FOV angles in degrees from the raw project
2708         values returned by OpenVR.
2709         (WebCore::VRPlatformDisplayOpenVR::updateEyeParameters): Fills in
2710         the eye parameter info.
2711         (WebCore::VRPlatformDisplayOpenVR::~VRPlatformDisplayOpenVR):
2712         * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
2713
2714 2018-02-20  Philippe Normand  <pnormand@igalia.com>
2715
2716         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
2717         https://bugs.webkit.org/show_bug.cgi?id=173655
2718
2719         Reviewed by Xabier Rodriguez-Calvar.
2720
2721         The FIXME in GStreamerUtilities.cpp asks to pass the command line
2722         parameters to the GStreamer initialization function.
2723
2724         Based on initial patch by: Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
2725
2726         * Modules/webaudio/AudioContext.cpp:
2727         (WebCore::AudioContext::constructCommon): Removes the call to the method
2728         that GStreamer initializes. It is no longer necessary.
2729         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2730         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Ditto
2731         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2732         (WebCore::initializeGStreamerAndRegisterWebKitMSEElement): Ditto
2733         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
2734         (WebCore::initializeGStreamer): Receive the GStreamer options and initialize GStreamer.
2735         * platform/graphics/gstreamer/GStreamerUtilities.h: Add vector which contains
2736         GStreamer options as the input parameter of the initializeGStreamer() method.
2737
2738 2018-02-20  Miguel Gomez  <magomez@igalia.com>
2739
2740         [GTK] whatsapp web blurry in some parts, sharp on others
2741         https://bugs.webkit.org/show_bug.cgi?id=182673
2742
2743         Reviewed by Carlos Garcia Campos.
2744
2745         CoordinatedGraphicsLayer::createBackingStore() uses the scale factor returned by effectiveContentsScale(),
2746         which is always 1 if selfOrAncestorHaveNonAffineTransforms() returns true. But this fuction always returns
2747         true if the layer has an AnimatedPropertyTransform animation, which means that layers with those animations
2748         won't use the appropriate scale factor, causing blurry renderings.
2749
2750         This patch removes the animations check, so animated layers properly use the required scale factor.
2751
2752         No new tests, no behavior change.
2753
2754         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2755         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
2756
2757 2018-02-20  Zan Dobersek  <zdobersek@igalia.com>
2758
2759         [Cairo] Leverage ShadowBlur without using scratch buffer, target GraphicsContext
2760         https://bugs.webkit.org/show_bug.cgi?id=182958
2761
2762         Reviewed by Carlos Garcia Campos.
2763
2764         To allow ShadowBlur usage in different threads, avoid the ShadowBlur
2765         class using the scratch buffer internally. The current implementation of
2766         that scratch buffer is not thread-safe and its usage in such conditions
2767         can lead to crashes.
2768
2769         Instead, the new methods use a temporary ImageBuffer object for drawing.
2770         This does negate the efficiency of possibly reusing the scratch buffer,
2771         but at this point that is not yet the priority. This only affects ports
2772         using Cairo for drawing.
2773
2774         The added methods don't require a target GraphicsContext object to be
2775         passed in, instead they accept buffer draw callbacks that are invoked
2776         with the temporary ImageBuffer object containing the rasterized shadow,
2777         as well as position and size parameters. The CTM and clip bounds values
2778         also have to be passed in manually. In CairoOperations.cpp, the provided
2779         callbacks invoke commands that are equivalent in effect to those that
2780         would otherwise be invoked on the target GraphicsContext object in the
2781         ShadowBlur class.
2782
2783         For now, this approach has to avoid the tiling-based drawing of the
2784         rectangular shadows in drawRectShadow() and inset shadows in
2785         drawInsetShadow(), and instead stick to the non-tiling fallback. While
2786         only affecting Cairo-using ports, with some refactoring it should be
2787         possible to again leverage the tiling-based approach as well.
2788
2789         The beginShadowLayer() and endShadowLayer() functions, which are only
2790         used in CairoOperations.cpp, are replaced with the drawShadowLayer()
2791         method. This one accepts an additional callback that allows the caller
2792         to explicitly draw the shadow shape using the provided shadowing
2793         GraphicsContext object. As with the other two new methods, a temporary
2794         ImageBuffer object is used, and the buffer draw callback is invoked to
2795         allow caller to properly handle the shadowing output.
2796
2797         In CairoOperations.cpp, the new ShadowBlur methods are exercised, with
2798         direct Cairo operation invocation replacing the GraphicsContext calls
2799         otherwise done through ShadowBlur. ShadowState object now also has to
2800         track the global alpha and the global composite operator values so that
2801         it can properly rasterize the resulting shadow into the final image.
2802
2803         No new tests -- no change in behavior.
2804
2805         * platform/graphics/ShadowBlur.cpp:
2806         (WebCore::ShadowBlur::adjustBlurRadius):
2807         (WebCore::ShadowBlur::calculateLayerBoundingRect):
2808         (WebCore::ShadowBlur::drawRectShadow):
2809         (WebCore::ShadowBlur::drawInsetShadow):
2810         (WebCore::ShadowBlur::drawShadowLayer):
2811         (WebCore::ShadowBlur::beginShadowLayer): Deleted.
2812         (WebCore::ShadowBlur::endShadowLayer): Deleted.
2813         * platform/graphics/ShadowBlur.h:
2814         * platform/graphics/cairo/CairoOperations.cpp:
2815         (WebCore::Cairo::drawShadowLayerBuffer):
2816         (WebCore::Cairo::fillShadowBuffer):
2817         (WebCore::Cairo::drawPathShadow):
2818         (WebCore::Cairo::drawGlyphsShadow):
2819         (WebCore::Cairo::ShadowState::ShadowState):
2820         (WebCore::Cairo::fillRect):
2821         (WebCore::Cairo::fillRoundedRect):
2822         (WebCore::Cairo::fillRectWithRoundedHole):
2823         (WebCore::Cairo::drawSurface):
2824         * platform/graphics/cairo/CairoOperations.h:
2825         Default-initialize FillSource::fillRule to RULE_NONZERO.
2826         * platform/graphics/cairo/PlatformContextCairo.h:
2827         Drop the ShadowBlur.h include, it's moved to CairoOperations.cpp.
2828         * rendering/RenderThemeGtk.cpp:
2829         Explicitly include the FloatRoundedRect.h header now that it's not
2830         included through the ShadowBlur.h header via PlatformContextCairo.h.
2831
2832 2018-02-20  Sergio Villar Senin  <svillar@igalia.com>
2833
2834         [WebVR] Use RuntimeEnabledFeatures to enable/disable WebVR
2835         https://bugs.webkit.org/show_bug.cgi?id=182961
2836
2837         Reviewed by Xabier Rodriguez-Calvar.
2838
2839         The shared feature was properly added to RuntimeEnabledFeatures some
2840         time ago but the code was instead using a private method in
2841         NavigatorWebVR to temporarily disable it. WebVR is enabled in
2842         WebPreferences.yaml for GTK+ & WPE as default experimental feature.
2843
2844         * Modules/webvr/NavigatorWebVR.cpp:
2845         (WebCore::NavigatorWebVR::getVRDisplays):
2846         (WebCore::NavigatorWebVR::vrEnabled): Deleted.
2847
2848 2018-02-19  Antti Koivisto  <antti@apple.com>
2849
2850         Use selector filter when invalidating descendants
2851         https://bugs.webkit.org/show_bug.cgi?id=182839
2852         <rdar://problem/37581072>
2853
2854         Reviewed by Zalan Bujtas.
2855
2856         We can make descendant invalidation faster by enabling filtering.
2857
2858         * css/SelectorFilter.cpp:
2859         (WebCore::SelectorFilter::initializeParentStack):
2860
2861             Traverse and reverse the ancestor chain, and push it.
2862
2863         (WebCore::SelectorFilter::pushParent):
2864         (WebCore::SelectorFilter::pushParentInitializingIfNeeded):
2865
2866             Add a version of pushParent that can initialize the stack.
2867
2868         (WebCore::SelectorFilter::popParent):
2869         (WebCore::SelectorFilter::popParentsUntil):
2870
2871             Pop until a given parent element.
2872
2873         (WebCore::SelectorFilter::pushParentStackFrame): Deleted.
2874         (WebCore::SelectorFilter::popParentStackFrame): Deleted.
2875
2876             These were the same as push/popParent.
2877
2878         * css/SelectorFilter.h:
2879         (WebCore::SelectorFilter::popParent): Deleted.
2880         * style/StyleInvalidator.cpp:
2881         (WebCore::Style::Invalidator::invalidateStyleForDescendants):
2882
2883             Use pushParentInitializingIfNeeded.
2884
2885         (WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
2886
2887             Use selector filter when doing descendant tree invalidation.
2888             Make sure to pop it until the parent when reusing.
2889
2890 2018-02-19  Fujii Hironori  <Hironori.Fujii@sony.com>
2891
2892         null m_lastNodeInserted dereference at ReplaceSelectionCommand::InsertedNodes::lastLeafInserted
2893         https://bugs.webkit.org/show_bug.cgi?id=161947
2894
2895         Reviewed by Ryosuke Niwa.
2896
2897         InsertedNodes happened to be empty if the inserted nodes were
2898         removed. Add more checks if InsertedNodes is empty.
2899
2900         No new tests (Covered by existing tests).
2901
2902         * editing/ReplaceSelectionCommand.cpp:
2903         (WebCore::ReplaceSelectionCommand::doApply): Return early if InsertedNodes becomes empty.
2904         * editing/ReplaceSelectionCommand.h:
2905         (WebCore::ReplaceSelectionCommand::InsertedNodes::isEmpty): New method.
2906         (WebCore::ReplaceSelectionCommand::InsertedNodes::lastLeafInserted const):
2907         Assert m_lastNodeInserted is not null.
2908         (WebCore::ReplaceSelectionCommand::InsertedNodes::pastLastLeaf const): Ditto.
2909
2910 2018-02-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
2911
2912         Add SVGPropertyTraits::fromString() to all the SVG animated types
2913         https://bugs.webkit.org/show_bug.cgi?id=182901
2914
2915         Reviewed by Dean Jackson.
2916
2917         This is a work toward https://bugs.webkit.org/show_bug.cgi?id=168586. The
2918         goal is is to templatize the SVGAnimatedType class and to use SVGPropertyTraits
2919         methods inside the template functions.
2920
2921         * WebCore.xcodeproj/project.pbxproj: Move the enum and the SVGPropertyTraits
2922         from SVGMarkerElement.h to SVGMarkerTypes.h.
2923         * svg/SVGAngle.h:
2924         (WebCore::SVGAngle::SVGAngle): Delete unused constructor and create() method.
2925         * svg/SVGAngleValue.h:
2926         * svg/SVGAnimateMotionElement.cpp:
2927         (WebCore::parsePoint): Deleted. Move this function to SVGParserUtilities.cpp
2928         * svg/SVGAnimatedAngle.cpp:
2929         (WebCore::SVGAnimatedAngleAnimator::constructFromString): Use SVGPropertyTraits::fromString().
2930         * svg/SVGAnimatedBoolean.cpp:
2931         (WebCore::SVGAnimatedBooleanAnimator::constructFromString): Ditto.
2932         * svg/SVGAnimatedColor.cpp:
2933         (WebCore::SVGAnimatedColorAnimator::constructFromString): Ditto.
2934         (WebCore::SVGAnimatedColorAnimator::addAnimatedTypes): Use const.
2935         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue): Ditto.
2936         * svg/SVGAnimatedEnumeration.cpp:
2937         (WebCore::SVGAnimatedEnumerationAnimator::constructFromString): Ditto.
2938         * svg/SVGAnimatedInteger.cpp:
2939         (WebCore::SVGAnimatedIntegerAnimator::constructFromString): Ditto.
2940         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
2941         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString): Ditto.
2942         * svg/SVGAnimatedLength.cpp:
2943         * svg/SVGAnimatedLengthList.cpp:
2944         (WebCore::SVGAnimatedLengthListAnimator::constructFromString): Ditto.
2945         * svg/SVGAnimatedNumber.cpp:
2946         (WebCore::SVGAnimatedNumberAnimator::constructFromString): Ditto
2947         (WebCore::parseNumberFromString):
2948         * svg/SVGAnimatedNumberList.cpp:
2949         (WebCore::SVGAnimatedNumberListAnimator::constructFromString): Ditto.
2950         * svg/SVGAnimatedNumberOptionalNumber.cpp:
2951         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::constructFromString): Ditto.
2952         * svg/SVGAnimatedPath.cpp:
2953         (WebCore::SVGAnimatedPathAnimator::constructFromString): Ditto.
2954         * svg/SVGAnimatedPointList.cpp:
2955         (WebCore::SVGAnimatedPointListAnimator::constructFromString): Ditto.
2956         * svg/SVGAnimatedPreserveAspectRatio.cpp:
2957         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString): Ditto.
2958         * svg/SVGAnimatedRect.cpp:
2959         (WebCore::SVGAnimatedRectAnimator::constructFromString): Ditto.
2960         * svg/SVGAnimatedString.cpp:
2961         (WebCore::SVGAnimatedStringAnimator::constructFromString): Ditto.
2962         * svg/SVGAnimatedTransformList.cpp:
2963         (WebCore::SVGAnimatedTransformListAnimator::constructFromString): Ditto.
2964         * svg/SVGLength.h:
2965         (WebCore::SVGLength::SVGLength): Delete unused constructor and create() method.
2966         * svg/SVGLengthListValues.h:
2967         (WebCore::SVGPropertyTraits<SVGLengthListValues>::fromString): New SVGPropertyTraits method.
2968         (WebCore::SVGPropertyTraits<SVGLengthListValues>::parse): Ditto.
2969         * svg/SVGMarkerElement.h:
2970         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::highestEnumValue): Deleted.
2971         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString): Deleted.
2972         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::fromString): Deleted.
2973         (WebCore::SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue): Deleted.
2974         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::highestEnumValue): Deleted.
2975         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString): Deleted.
2976         * svg/SVGMarkerTypes.h: Added.
2977         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::highestEnumValue):
2978         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString):
2979         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::fromString):
2980         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::highestEnumValue):
2981         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
2982         (WebCore::SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue):
2983         * svg/SVGMatrix.h: Delete unused constructor and create method.
2984         * svg/SVGNumber.h:
2985         (WebCore::SVGNumber::SVGNumber): Ditto.
2986         * svg/SVGNumberListValues.h:
2987         (WebCore::SVGPropertyTraits<SVGNumberListValues>::fromString): New SVGPropertyTraits method.
2988         * svg/SVGParserUtilities.cpp:
2989         (WebCore::parsePoint): This is moved from SVGAnimateMotionElement.cpp
2990         * svg/SVGParserUtilities.h:
2991         * svg/SVGPathByteStream.h:
2992         (WebCore::SVGPathByteStream::SVGPathByteStream):
2993         (WebCore::SVGPathByteStream::operator=): Add copy and move assignment operators.
2994         (WebCore::SVGPathByteStream::copy const): Use the copy assignment.
2995         (WebCore::SVGPathByteStream::isEmpty const): Use Data.isEmpty().
2996         (WebCore::SVGPropertyTraits<SVGPathByteStream>::initialValue): New SVGPropertyTraits method.
2997         (WebCore::SVGPropertyTraits<SVGPathByteStream>::fromString): Ditto.
2998         * svg/SVGPathUtilities.cpp:
2999         (WebCore::addToSVGPathByteStream): Answer Simon's questions which were added in r190844.
3000         * svg/SVGPoint.h:
3001         (WebCore::SVGPoint::SVGPoint): Delete unused constructor and create method.
3002         * svg/SVGPointListValues.h:
3003         (WebCore::SVGPropertyTraits<SVGPointListValues>::fromString): New SVGPropertyTraits method.
3004         * svg/SVGPolyElement.cpp:
3005         (WebCore::SVGPolyElement::parseAttribute): Use the move assignment operator.
3006         * svg/SVGPreserveAspectRatio.h:
3007         (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Delete unused constructor and create method.
3008         * svg/SVGPreserveAspectRatioValue.cpp:
3009         (WebCore::SVGPreserveAspectRatioValue::SVGPreserveAspectRatioValue): Add new constructor.
3010         * svg/SVGPreserveAspectRatioValue.h:
3011         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString): New SVGPropertyTraits method.
3012         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::toString): Ditto.
3013         * svg/SVGRect.h:
3014         (WebCore::SVGRect::SVGRect): Delete unused constructor and create method.
3015         * svg/SVGRectTraits.h: Removed.
3016         * svg/SVGTransform.h:
3017         (WebCore::SVGTransform::SVGTransform): Delete unused constructor and create method.
3018         * svg/SVGTransformListValues.h:
3019         (WebCore::SVGPropertyTraits<SVGTransformListValues>::fromString): New SVGPropertyTraits method.
3020         * svg/properties/SVGPropertyTearOff.h: Delete unused create method.
3021         * svg/properties/SVGPropertyTraits.h: New SVGPropertyTraits methods.
3022         (WebCore::SVGPropertyTraits<bool>::fromString): 
3023         (WebCore::SVGPropertyTraits<Color>::initialValue):
3024         (WebCore::SVGPropertyTraits<Color>::fromString):
3025         (WebCore::SVGPropertyTraits<Color>::parse):
3026         (WebCore::SVGPropertyTraits<Color>::toString):
3027         (WebCore::SVGPropertyTraits<int>::fromString):
3028         (WebCore::SVGPropertyTraits<float>::fromString):
3029         (WebCore::SVGPropertyTraits<float>::parse):
3030         (WebCore::SVGPropertyTraits<FloatPoint>::initialValue):
3031         (WebCore::SVGPropertyTraits<FloatPoint>::fromString):
3032         (WebCore::SVGPropertyTraits<FloatPoint>::parse):
3033         (WebCore::SVGPropertyTraits<FloatPoint>::toString):
3034         (WebCore::SVGPropertyTraits<FloatRect>::initialValue):
3035         (WebCore::SVGPropertyTraits<FloatRect>::fromString):
3036         (WebCore::SVGPropertyTraits<FloatRect>::parse):
3037         (WebCore::SVGPropertyTraits<FloatRect>::toString):
3038         (WebCore::SVGPropertyTraits<String>::fromString):
3039         (WebCore::SVGPropertyTraits<String>::parse):
3040         (WebCore::SVGPropertyTraits<String>::toString):
3041
3042 2018-02-19  Antoine Quint  <graouts@apple.com>
3043
3044         [Modern Media Controls] Implement a compact set of media controls
3045         https://bugs.webkit.org/show_bug.cgi?id=182937
3046         <rdar://problem/37682257>
3047
3048         Reviewed by Eric Carlson.
3049
3050         We add a new type of media controls used when we need stripped down and compact controls. The new
3051         CompactMediaControls only show a play/pause button and an invalid placard and disregard all media
3052         events that are not relevant to the display of these controls.
3053
3054         To distinguish cases where we need to show compact media controls, we expose a new property on
3055         MediaControlsHost called "compactMode".
3056
3057         Tests: media/modern-media-controls/compact-media-controls/compact-media-controls-constructor.html
3058                media/modern-media-controls/compact-media-controls/compact-media-controls-layout.html
3059
3060         * Modules/mediacontrols/MediaControlsHost.cpp:
3061         (WebCore::MediaControlsHost::base64StringForIconNameAndType const):
3062         (WebCore::MediaControlsHost::compactMode const):
3063         * Modules/mediacontrols/MediaControlsHost.h:
3064         (WebCore::MediaControlsHost::setSimulateCompactMode):
3065         * Modules/mediacontrols/MediaControlsHost.idl:
3066         * Modules/modern-media-controls/controls/compact-media-controls.js: Added.
3067         (CompactMediaControls.prototype.get scaleFactor):
3068         (CompactMediaControls.prototype.set scaleFactor):
3069         (CompactMediaControls.prototype.get shouldCenterControlsVertically):
3070         (CompactMediaControls.prototype.set shouldCenterControlsVertically):
3071         (CompactMediaControls.prototype.get placard):
3072         (CompactMediaControls.prototype.set placard):
3073         (CompactMediaControls.prototype.layout):
3074         (CompactMediaControls.prototype.commitProperty):
3075         * Modules/modern-media-controls/controls/icon-service.js:
3076         (const.iconService.new.IconService.prototype._fileNameAndPlatformForIconAndLayoutTraits):
3077         (const.iconService.new.IconService):
3078         * Modules/modern-media-controls/controls/inline-media-controls.js:
3079         * Modules/modern-media-controls/controls/layout-item.js:
3080         * Modules/modern-media-controls/js-files:
3081         * Modules/modern-media-controls/main.js:
3082         * Modules/modern-media-controls/media/media-controller.js:
3083         (MediaController.prototype.get layoutTraits):
3084         (MediaController.prototype._supportingObjectClasses): Compute the set of MediaControllerSupport classes based
3085         on the layout traits such that in compact mode we only return PlacardSupport and PlaybackSupport.
3086         (MediaController.prototype._updateControlsIfNeeded):
3087         (MediaController.prototype._controlsClassForLayoutTraits):
3088         (MediaController.prototype._shouldControlsBeAvailable):
3089         * Modules/modern-media-controls/media/placard-support.js:
3090         (PlacardSupport.prototype.get mediaEvents): Only track the "error" event in compact mode since this is the only
3091         relevant placard.
3092         * Modules/modern-media-controls/media/playback-support.js:
3093         (PlaybackSupport.prototype.syncControl): Only show or hide the play/pause button based on the playback state
3094         when in compact mode.
3095         (PlaybackSupport):
3096         * WebCore.xcodeproj/project.pbxproj:
3097
3098 2018-02-19  Antoine Quint  <graouts@apple.com>
3099
3100         [Web Animations] Make KeyframeEffect target nullable and read-write
3101         https://bugs.webkit.org/show_bug.cgi?id=182741
3102
3103         Reviewed by Dean Jackson.
3104
3105         We used to completely disregard null targets, for instance not parsing keyframes, but targets
3106         can be null and are also supposed to be read-write for KeyframeEffect. We now update the IDL
3107         for KeyframeEffect to mark the target property as read-write and update the implementation
3108         to correctly handle null targets.
3109
3110         This revealed a few issues in our implementation by allowing more WPT tests to run. So we also
3111         ensure that:
3112         
3113         - we don't crash when parsing font-related properties by calling update() on the generated
3114         RenderStyle's FontCascade when parsing keyframes.
3115
3116         - CSS properties are provided as camel-case and not as hyphenated form
3117
3118         - values provided in keyframes dictionaries are only read for valid properties
3119
3120         - styles for effect targets are invalidated as soon as the timing model for that animation
3121         is changed
3122
3123         * animation/KeyframeEffect.idl:
3124         * animation/KeyframeEffectReadOnly.cpp:
3125         (WebCore::invalidateElement): Add a new utility method to invalidate a given element since
3126         we may want to invalidate not only the current target (m_target) but also a previous target.
3127         (WebCore::IDLAttributeNameToAnimationPropertyName): Move this function below CSSPropertyIDToIDLAttributeName
3128         so that it can call that function. We also check that we reject CSS properties that are not provided in
3129         camel-case form (eg. "font-size" vs. "fontSize").
3130         (WebCore::processIterableKeyframes): Only read the JS values if we know that the provided JS property name
3131         maps to a valid CSS property.
3132         (WebCore::KeyframeEffectReadOnly::processKeyframes): Allow keyframes to be processed even if the effect's
3133         target is null.
3134         (WebCore::KeyframeEffectReadOnly::setTarget): Notify the animation that the effect target has changed and
3135         invalidate the style of the new target and the old targets, if any. We also update the blending keyframes
3136         since this task may not have been completed in a previous call to processKeyframes() due to the target being
3137         null at that time.
3138         (WebCore::KeyframeEffectReadOnly::invalidate): Use the invalidateElement() utility.
3139         * animation/KeyframeEffectReadOnly.h:
3140         * animation/WebAnimation.cpp:
3141         (WebCore::WebAnimation::effectTargetDidChange): This method is called in KeyframeEffectReadOnly::setTarget()
3142         to inform the animation of the previous effect target and the new one upon a target change. This allows us to
3143         forward this information onto the timeline so that we correctly add or remove the targets from the list of
3144         animated elements.
3145         * animation/WebAnimation.h:
3146
3147 2018-02-19  Chris Dumez  <cdumez@apple.com>
3148
3149         Crash under MIMETypeRegistry::isSupportedJavaScriptMIMEType()
3150         https://bugs.webkit.org/show_bug.cgi?id=182927
3151         <rdar://problem/37675748>
3152
3153         Reviewed by Antti Koivisto.
3154
3155         Make it safe to call MIMETypeRegistry::isSupportedJavaScriptMIMEType() from the non-main thread.
3156         It is currently being called from a background thread in the following places:
3157         - ServiceWorkerJob::didReceiveResponse()
3158         - WorkerGlobalScope::importScripts()
3159
3160         These call sites on non-main threads were added recently with the support for service workers.
3161
3162         No new tests, already covered by existing tests that flakily experience service worker
3163         process crashes.
3164
3165         * platform/MIMETypeRegistry.cpp:
3166         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
3167
3168 2018-02-19  Dean Jackson  <dino@apple.com>
3169
3170         SIGFPE @ int WebCore::SVGToOTFFontConverter::scaleUnitsPerEm<int> const + 45
3171         https://bugs.webkit.org/show_bug.cgi?id=182944
3172         <rdar://problem/35369984>
3173
3174         Reviewed by Myles Maxfield.
3175
3176         Avoid a divide-by-zero.
3177
3178         Test: svg/text/font-bad-unitsperem.html
3179
3180         * svg/SVGFontFaceElement.cpp:
3181         (WebCore::SVGFontFaceElement::unitsPerEm const):
3182
3183 2018-02-19  Tim Horton  <timothy_horton@apple.com>
3184
3185         REGRESSION (r219342): Touch event coordinates and elementFromPoint coordinates differ
3186         https://bugs.webkit.org/show_bug.cgi?id=182910
3187         <rdar://problem/37533950>
3188
3189         Reviewed by Simon Fraser.
3190
3191         We reverted other changes to the definition of client coordinates
3192         in r219829 due to compatibility concerns. However, we failed to revert
3193         r219342 on trunk, leaving elementFromPoint() using coordinates relative
3194         to the layout viewport.
3195
3196         Add a currently off-by-default setting to switch on layout-viewport-relative
3197         client coordinates and guard the elementFromPoint changes behind it.
3198         A future patch should roll r219829 back in also behind this setting, so
3199         that everything remains consistent regardless of which coordinate space we choose.
3200
3201         * dom/TreeScope.cpp:
3202         (WebCore::absolutePointIfNotClipped):
3203         * page/Settings.yaml:
3204         * rendering/RenderLayer.cpp:
3205         (WebCore::RenderLayer::hitTest):
3206
3207 2018-02-19  Eric Carlson  <eric.carlson@apple.com>
3208
3209         [Extra zoom mode] Don't allow PiP media playback
3210         https://bugs.webkit.org/show_bug.cgi?id=182930
3211         <rdar://problem/37676259>
3212
3213         Reviewed by Andy Estes.
3214
3215         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3216         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Don't call setPIPModeEnabled:
3217         if it isn't implemented.
3218         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto.
3219
3220 2018-02-19  Antoine Quint  <graouts@apple.com>
3221
3222         [Web Animations] Decouple parsing JS keyframes and computing blending keyframes
3223         https://bugs.webkit.org/show_bug.cgi?id=182939
3224         <rdar://problem/37678364>
3225
3226         Reviewed by Dean Jackson.
3227
3228         Move all the code used to create the KeyframeList into a dedicated updateBlendingKeyframes() method.
3229
3230         No new tests since this code change has no user-visible impact.
3231
3232         * animation/KeyframeEffectReadOnly.cpp:
3233         (WebCore::KeyframeEffectReadOnly::processKeyframes):
3234         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
3235         * animation/KeyframeEffectReadOnly.h:
3236
3237 2018-02-19  Jer Noble  <jer.noble@apple.com>
3238
3239         [EME] Add mechanism for MediaKeySession to react to HDCP changes
3240         https://bugs.webkit.org/show_bug.cgi?id=182935
3241
3242         Reviewed by Eric Carlson.
3243
3244         Add a client callback interface to CDMInterface to allow subclasses to communicate up to
3245         MediaKeySEssion. Add a virtual method to CDMInterface to allow it to be notified of HDCP
3246         status changes. Override this method in CDMInstanceFairPlayStreamingAVFObjC. Hook up the
3247         outputObscuredDueToInsufficientExternalProtectionChanged() methods in both
3248         MediaPlayerPrivateAVFoundationObjC and MediaPlayerPrivateMediaSourceAVFObjC to this new
3249         CDMInstance method. Add an Internals method to simulate an HDCP error for testing purposes.
3250
3251         * Modules/encryptedmedia/MediaKeySession.cpp:
3252         (WebCore::MediaKeySession::MediaKeySession):
3253         (WebCore::MediaKeySession::~MediaKeySession):
3254         (WebCore::MediaKeySession::updateKeyStatuses):
3255         * Modules/encryptedmedia/MediaKeySession.h:
3256         * platform/encryptedmedia/CDMInstance.h:
3257         (WebCore::CDMInstance::setHDCPStatus):
3258         (WebCore::CDMInstance::setClient):
3259         (WebCore::CDMInstance::clearClient):
3260         * platform/graphics/MediaPlayer.cpp:
3261         (WebCore::MediaPlayer::beginSimulatedHDCPError):
3262         (WebCore::MediaPlayer::endSimulatedHDCPError):
3263         * platform/graphics/MediaPlayer.h:
3264         * platform/graphics/MediaPlayerPrivate.h:
3265         (WebCore::MediaPlayerPrivateInterface::beginSimulatedHDCPError):
3266         (WebCore::MediaPlayerPrivateInterface::endSimulatedHDCPError):
3267         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
3268         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3269         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setClient):
3270         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::clearClient):
3271         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged):
3272         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3273         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3274         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3275         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3276         (WebCore::playerKVOProperties):
3277         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3278         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3279         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3280         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3281         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3282         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3283         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
3284         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3285         * testing/Internals.cpp:
3286         (WebCore::Internals::beginSimulatedHDCPError):
3287         (WebCore::Internals::endSimulatedHDCPError):
3288         * testing/Internals.h:
3289         * testing/Internals.idl:
3290
3291 2018-02-19  Chris Dumez  <cdumez@apple.com>
3292
3293         CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::TimerBase::~TimerBase
3294         https://bugs.webkit.org/show_bug.cgi?id=182931
3295         <rdar://problem/37602962>
3296
3297         Reviewed by Antti Koivisto.
3298
3299         Make sure PlatformMediaResource is ThreadSafeRefCounted since it is being
3300         used from several threads in WebCoreNSURLSession. Also make sure it is
3301         always destroyed on the main thread since it ends up destroying a
3302         CachedRawResource object.
3303
3304         No new tests, no known reproduction case.
3305
3306         * platform/graphics/PlatformMediaResourceLoader.h:
3307         * platform/network/cocoa/WebCoreNSURLSession.mm:
3308         (-[WebCoreNSURLSessionDataTask dealloc]):
3309
3310 2018-02-19  Zalan Bujtas  <zalan@apple.com>
3311
3312         [RenderTreeBuilder] Rename RenderTreeBuilder::removeAndDestroyChild() -> removeAndDestroy()
3313         https://bugs.webkit.org/show_bug.cgi?id=182934
3314         <rdar://problem/37678241>
3315
3316         Reviewed by Antti Koivisto.
3317
3318         No change in functionality.
3319
3320         * dom/Document.cpp:
3321         (WebCore::Document::setFullScreenRenderer):
3322         * rendering/RenderBoxModelObject.cpp:
3323         (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):
3324         * rendering/RenderButton.cpp:
3325         (WebCore::RenderButton::setText):
3326         * rendering/RenderFullScreen.cpp:
3327         (WebCore::RenderFullScreen::willBeDestroyed):
3328         (WebCore::RenderFullScreen::unwrapRenderer):
3329         * rendering/RenderListItem.cpp:
3330         (WebCore::RenderListItem::willBeDestroyed):
3331         * rendering/RenderTextFragment.cpp:
3332         (WebCore::RenderTextFragment::willBeDestroyed):
3333         (WebCore::RenderTextFragment::setText):
3334         * rendering/RenderView.cpp:
3335         (WebCore::RenderView::willBeDestroyed):
3336         * rendering/updating/RenderTreeBuilder.cpp:
3337         (WebCore::RenderTreeBuilder::removeAndDestroy):
3338         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
3339         (WebCore::RenderTreeBuilder::removeAndDestroyChild): Deleted.
3340         * rendering/updating/RenderTreeBuilder.h:
3341         * rendering/updating/RenderTreeBuilderBlock.cpp:
3342         (WebCore::RenderTreeBuilder::Block::takeChild):
3343         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
3344         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
3345         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
3346         * rendering/updating/RenderTreeBuilderList.cpp:
3347         (WebCore::RenderTreeBuilder::List::updateItemMarker):
3348         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
3349         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
3350         (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
3351         * rendering/updating/RenderTreeBuilderRuby.cpp:
3352         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
3353         (WebCore::RenderTreeBuilder::Ruby::takeChild):
3354
3355 2018-02-19  Daniel Bates  <dabates@apple.com>
3356
3357         Do not block authentication challenge to navigated resources
3358         https://bugs.webkit.org/show_bug.cgi?id=182807
3359         <rdar://problem/37481619>
3360
3361         Reviewed by Brent Fulgham.
3362
3363         Blocking the main resource from asking for credentials depending on how it was
3364         navigated to could be confusing to a person and breaks web compatibility. Restore
3365         the behavior before r224134.
3366
3367         * loader/FrameLoader.cpp:
3368         (WebCore::FrameLoader::receivedFirstData):
3369         * loader/ResourceLoader.cpp:
3370         (WebCore::ResourceLoader::init):
3371         (WebCore::ResourceLoader::willSendRequestInternal):
3372         (WebCore::ResourceLoader::didBlockAuthenticationChallenge):
3373         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const):
3374         (WebCore::ResourceLoader::isMixedContent const): Deleted.
3375         * loader/ResourceLoader.h:
3376         (WebCore::ResourceLoader::wasAuthenticationChallengeBlocked const):
3377         (WebCore::ResourceLoader::wasInsecureRequestSeen const): Deleted.
3378
3379 2018-02-17  Antoine Quint  <graouts@apple.com>
3380
3381         [Web Animations] Store all parsed keyframe input information in a single structure
3382         https://bugs.webkit.org/show_bug.cgi?id=182903
3383
3384         Reviewed by Dean Jackson.
3385
3386         When parsing keyframe input provided through the JS API, we used to create several data structures.
3387         During parsing we would create a Vector<ProcessedKeyframe> where we would store the validated values
3388         for "offset", "easing" and "composite" as well as CSS properties and CSS values as strings. 
3389
3390         Then we would create a KeyframeList, a class that pre-dates the work on Web Animations and is used
3391         for hardware animations, with RenderStyle objects that are used for CSS property blending at runtime.
3392         Once the KeyframeList was created, the Vector<ProcessedKeyframe> was discarded.
3393
3394         Since KeyframeList did not know about nullable offsets, timing functions and composite operations, and
3395         because we do not with to modify a legacy class that we will eventually remove once all the Web Animations
3396         work is complete, we also stored the parsed offsets as m_offsets, the timing functions as m_timingFunctions
3397         and the composite operations as m_compositeOperations.
3398
3399         In this patch we rename the ProcessedKeyframe structure used temporarily during parsing to ParsedKeyframe and
3400         store both the input and processed data related to a given keyframe in that single structure which we keep
3401         around as m_parsedKeyframes when we finished processing the keyframes input. This update ParsedKeyframe structure
3402         allows to keep around the original nullable offsets, the original CSS properties and CSS values as strings as
3403         a HashMap<CSSPropertyID, String>, as well as the CSS properties and CSS values as CSSValue objects using a
3404         MutableStyleProperties object. 
3405
3406         This has the benefit of reducing the number of members, but also pave the way for supporting read-write targets
3407         where we will be able to decouple pa