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