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