[GTK] Wrong variable used in RenderThemeGtk
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-06-18  Tomas Popela  <tpopela@redhat.com>
2
3         [GTK] Wrong variable used in RenderThemeGtk
4         https://bugs.webkit.org/show_bug.cgi?id=186756
5
6         Reviewed by Carlos Garcia Campos.
7
8         Use SliderThumbHorizontalPart instead of SliderHorizontalPart.
9
10         * rendering/RenderThemeGtk.cpp:
11         (WebCore::RenderThemeGtk::adjustSliderThumbSize const):
12
13 2018-06-18  Philippe Normand  <pnormand@igalia.com>
14
15         [GStreamer] Crash when adding in-band text track with playbin3 enabled
16         https://bugs.webkit.org/show_bug.cgi?id=186654
17
18         Reviewed by Xabier Rodriguez-Calvar.
19
20         Text track indexes should be relative to the total amount of
21         in-band text tracks. The previous code would induce the creation
22         of in-band text tracks with indexes relative to the total amount
23         of all in-band (audio, video, text) tracks.
24
25         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
26         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
27
28 2018-06-17  Zalan Bujtas  <zalan@apple.com>
29
30         Anonymous block collapsing can destroy the renderer's parent.
31         https://bugs.webkit.org/show_bug.cgi?id=186655
32         <rdar://problem/41157554>
33
34         Reviewed by Antti Koivisto.
35
36         While destroying a chain of renderers (text renderer -> first letter renderer), we need to
37         check if the anonymous block collapsing destroyed the parent renderer (see webkit.org/b/186746).
38
39         Test: fast/text/first-letter-with-anon-wrapper-crash.html
40
41         * rendering/updating/RenderTreeBuilder.cpp:
42         (WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers):
43
44 2018-06-17  Wenson Hsieh  <wenson_hsieh@apple.com>
45
46         [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 3)
47         https://bugs.webkit.org/show_bug.cgi?id=186442
48         <rdar://problem/40879364>
49
50         Reviewed by Darin Adler.
51
52         Rename references to "Extra zoom mode". No change in behavior.
53
54         * page/DisabledAdaptations.cpp:
55         (WebCore::watchAdaptationName):
56         (WebCore::extraZoomModeAdaptationName): Deleted.
57         * page/DisabledAdaptations.h:
58         * page/ViewportConfiguration.cpp:
59         (WebCore::needsUpdateAfterChangingDisabledAdaptations):
60         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
61         * page/WindowFeatures.cpp:
62         (WebCore::parseDisabledAdaptations):
63         * testing/Internals.cpp:
64         (WebCore::Internals::extraZoomModeAdaptationName const): Deleted.
65         * testing/Internals.h:
66         * testing/Internals.idl:
67
68 2018-06-17  Youenn Fablet  <youenn@apple.com>
69
70         Rename Document::hasHadActiveMediaStreamTrack to Document::hasHadCaptureMediaStreamTrack
71         https://bugs.webkit.org/show_bug.cgi?id=186743
72         rdar://problem/41151193
73
74         Reviewed by Eric Carlson.
75
76         Covered by existing tests.
77
78         Rename setter and getter to be more accurate.
79         Move the place to call the setter to when creating a capture stream.
80
81         * Modules/mediastream/MediaDevicesRequest.cpp:
82         (WebCore::MediaDevicesRequest::start):
83         * Modules/mediastream/MediaStream.cpp:
84         (WebCore::MediaStream::statusDidChange):
85         * Modules/mediastream/UserMediaRequest.cpp:
86         (WebCore::UserMediaRequest::mediaStreamIsReady):
87         * dom/Document.h:
88         (WebCore::Document::setHasCaptureMediaStreamTrack):
89         (WebCore::Document::hasHadCaptureMediaStreamTrack const):
90         (WebCore::Document::setHasActiveMediaStreamTrack): Deleted.
91         (WebCore::Document::hasHadActiveMediaStreamTrack const): Deleted.
92
93 2018-06-17  Zalan Bujtas  <zalan@apple.com>
94
95         [LFC] DisplayBox API should be more clear about height/width vs. contentBoxHeight/width
96         https://bugs.webkit.org/show_bug.cgi?id=186744
97
98         Reviewed by Antti Koivisto.
99
100         Display::Box::height/width -> border box size.
101         Display::Box::contentBoxHeight/width -> content box size.
102         Display::Box::top/left/bottom/right -> border box position in the containing box's coordinate system.
103         Display::Box::marginBox/borderBox/paddingBox/contentBox -> relative to border box (border box is { 0, 0 })
104  
105         (This patch also removes the box-sizing logic from Display::Box. FormattingContext::Geometry should set the
106         correct contentBoxSize/borderBoxSize based on the CSS property.)
107
108         * layout/FormattingContext.cpp:
109         (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
110         (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
111         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
112         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
113         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
114         * layout/FormattingContextGeometry.cpp:
115         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
116         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
117         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
118         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
119         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
120         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
121         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
122         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
123         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
124         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
125         * layout/LayoutContext.cpp:
126         (WebCore::Layout::LayoutContext::initializeRoot):
127         * layout/blockformatting/BlockFormattingContext.cpp:
128         (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
129         (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
130         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
131         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
132         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
133         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
134         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
135         * layout/displaytree/DisplayBox.cpp:
136         (WebCore::Display::Box::marginBox const):
137         (WebCore::Display::Box::borderBox const):
138         (WebCore::Display::Box::paddingBox const):
139         (WebCore::Display::Box::contentBox const):
140         * layout/displaytree/DisplayBox.h:
141         (WebCore::Display::Box::top const):
142         (WebCore::Display::Box::left const):
143         (WebCore::Display::Box::bottom const):
144         (WebCore::Display::Box::right const):
145         (WebCore::Display::Box::topLeft const):
146         (WebCore::Display::Box::bottomRight const):
147         (WebCore::Display::Box::size const):
148         (WebCore::Display::Box::width const):
149         (WebCore::Display::Box::height const):
150         (WebCore::Display::Box::rect const):
151         (WebCore::Display::Box::setTopLeft):
152         (WebCore::Display::Box::setTop):
153         (WebCore::Display::Box::setLeft):
154         (WebCore::Display::Box::moveHorizontally):
155         (WebCore::Display::Box::moveVertically):
156         (WebCore::Display::Box::setHasValidContentHeight):
157         (WebCore::Display::Box::setHasValidContentWidth):
158         (WebCore::Display::Box::setContentBoxHeight):
159         (WebCore::Display::Box::setContentBoxWidth):
160         (WebCore::Display::Box::contentBoxHeight const):
161         (WebCore::Display::Box::contentBoxWidth const):
162         (WebCore::Display::Box::setWidth): Deleted.
163         (WebCore::Display::Box::setHeight): Deleted.
164         (WebCore::Display::Box::setSize): Deleted.
165
166 2018-06-17  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
167
168         [GTK] Correct behavior for dark themes
169         https://bugs.webkit.org/show_bug.cgi?id=186219
170
171         Reviewed by Michael Catanzaro.
172
173         Override RenderThemeGtk::isControlStyled() to not style
174         text inputs if color is set different than default.
175
176         No new tests. Manual theme test and existing layout tests already cover it.
177
178         * rendering/RenderThemeGtk.cpp:
179         (WebCore::RenderThemeGtk::isControlStyled const):
180         * rendering/RenderThemeGtk.h:
181
182 2018-06-12  Darin Adler  <darin@apple.com>
183
184         [Cocoa] Make some RetainPtr refinements to get more ready for ARC
185         https://bugs.webkit.org/show_bug.cgi?id=186526
186
187         Reviewed by Anders Carlsson.
188
189         * platform/ios/UserAgentIOS.mm:
190         (WebCore::deviceNameForUserAgent): Drop unnecessary use of RetainPtr.
191
192         * platform/mac/URLMac.mm:
193         (WebCore::URL::operator NSURL * const): Use bridgingAutorelease.
194
195 2018-06-16  Chris Dumez  <cdumez@apple.com>
196
197         Better pack ResourceResponse
198         https://bugs.webkit.org/show_bug.cgi?id=186718
199
200         Reviewed by Simon Fraser.
201
202         Better pack ResourceResponse to reduce its size on Mac from 632 to 616 bytes.
203
204         * platform/network/ResourceResponseBase.h:
205
206 2018-06-15  Chris Dumez  <cdumez@apple.com>
207
208         Better pack MediaQuery
209         https://bugs.webkit.org/show_bug.cgi?id=186716
210
211         Reviewed by Simon Fraser.
212
213         Better pack MediaQuery to reduce its size from 48 bytes to 40 and save
214         some memory.
215
216         * css/MediaQuery.cpp:
217         (WebCore::MediaQuery::MediaQuery):
218         * css/MediaQuery.h:
219
220 2018-06-15  Chris Dumez  <cdumez@apple.com>
221
222         StyleRuleMedia wastes 158KB of Vector capacity on cnn.com
223         https://bugs.webkit.org/show_bug.cgi?id=186705
224         <rdar://problem/41173637>
225
226         Reviewed by Simon Fraser.
227
228         Call shrinkToFit on RefPtr<StyleRuleBase> vectors in CSSParserImpl, after we're
229         done parsing and before constructing StyleRuleMedia, StyleRuleSupports and
230         deferred rules in StyleRuleGroup.
231
232         * css/parser/CSSParserImpl.cpp:
233         (WebCore::CSSParserImpl::parseDeferredRuleList):
234         (WebCore::CSSParserImpl::consumeMediaRule):
235         (WebCore::CSSParserImpl::consumeSupportsRule):
236
237 2018-06-15  Chris Dumez  <cdumez@apple.com>
238
239         MediaQuerySet wastes a lot of vector capacity
240         https://bugs.webkit.org/show_bug.cgi?id=186696
241         <rdar://problem/41172850>
242
243         Reviewed by Simon Fraser.
244
245         Call shrinkToFit() on the MediaQuerySet after we're done parsing it
246         to avoid wasting memory.
247
248         * css/parser/MediaQueryParser.cpp:
249         (WebCore::MediaQueryParser::parseInternal):
250
251 2018-06-15  Chris Dumez  <cdumez@apple.com>
252
253         CachedRawResource wastes 57K of Vector capacity
254         https://bugs.webkit.org/show_bug.cgi?id=186703
255         <rdar://problem/41173515>
256
257         Reviewed by Simon Fraser.
258
259         Use 0 as minimum capacity for CachedRawResource::m_redirectChain, instead of the
260         default value of 16. m_redirectChain usually contains very few items so 16 is
261         wasteful, especially considering that m_redirectChain contains fairly large
262         objects (std::pair<ResourceRequest, ResourceResponse>). CachedRawResource are
263         stored in the memory cache so it is important to not use more memory than
264         necessary.
265
266         We are also not worried about the performance cost of allocations here since
267         this vector is only populated on HTTP redirects.
268
269         * loader/cache/CachedRawResource.h:
270
271 2018-06-15  Antti Koivisto  <antti@apple.com>
272
273         Semantic colors should not be transformed by color-filter
274         https://bugs.webkit.org/show_bug.cgi?id=186566
275         <rdar://problem/40705739>
276
277         Reviewed by Simon Fraser.
278
279         Test: css3/color-filters/color-filter-ignore-semantic.html
280
281         * platform/graphics/Color.h:
282         (WebCore::Color::Color):
283         (WebCore::Color::isSemantic const):
284         (WebCore::Color::setIsSemantic):
285
286         Add a bit to Color to indicate it originated from a semantic color name.
287         Note that a color compares unequal to the semantic version of the same color.
288
289         * platform/graphics/filters/FilterOperations.cpp:
290         (WebCore::FilterOperations::transformColor const):
291         * platform/graphics/mac/ColorMac.h:
292         * platform/graphics/mac/ColorMac.mm:
293         (WebCore::semanticColorFromNSColor):
294         * rendering/RenderThemeMac.mm:
295         (WebCore::RenderThemeMac::systemColor const):
296
297         Set the bit for semantic system colors.
298
299         * rendering/RenderTreeAsText.cpp:
300         (WebCore::RenderTreeAsText::writeRenderObject):
301
302         Fix up the output to avoid unneccary render tree dump changes.
303
304 2018-06-15  Chris Dumez  <cdumez@apple.com>
305
306         Add API test coverage for SW RegistrationDatabase destruction and fix issues found by the test
307         https://bugs.webkit.org/show_bug.cgi?id=186681
308
309         Reviewed by Brady Eidson.
310
311         * workers/service/server/RegistrationDatabase.cpp:
312         (WebCore::RegistrationDatabase::RegistrationDatabase):
313         (WebCore::RegistrationDatabase::importRecords):
314         * workers/service/server/RegistrationDatabase.h:
315         Rename m_session to m_sessionID for clarity.
316
317         * workers/service/server/RegistrationStore.cpp:
318         (WebCore::RegistrationStore::~RegistrationStore):
319         Drop bad assertion now that the RegistrationDatabase is refcounted
320         and can outlive the RegistrationStore. The RegistrationDatabase will
321         take care of closing / destroying the SQLiteDatabase on the background
322         thread when destroyed.
323
324 2018-06-15  Timothy Hatcher  <timothy@apple.com>
325
326         REGRESSION (r232799): Form controls are blank in dark mode.
327
328         https://bugs.webkit.org/show_bug.cgi?id=186677
329         rdar://problem/41162899
330
331         Reviewed by Wenson Hsieh.
332
333         * rendering/RenderThemeMac.mm:
334         (-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
335         Dark mode controls don't have borders, just a semi-transparent background of shadows.
336         In the dark mode case we can't disable borders, or we will not paint anything for the control.
337
338 2018-06-15  Zalan Bujtas  <zalan@apple.com>
339
340         [LFC] Fix static position left/top
341         https://bugs.webkit.org/show_bug.cgi?id=186640
342
343         Reviewed by Antti Koivisto.
344
345         In visual formatting model, we normally go like [top, left] while LayoutPoint takes [x, y]. Let's make this less error prone.
346
347         * layout/FormattingContext.h:
348         (WebCore::Layout::FormattingContext::Geometry::Position::operator LayoutPoint const):
349         * layout/blockformatting/BlockFormattingContext.h:
350         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
351         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
352         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
353
354 2018-06-15  Chris Dumez  <cdumez@apple.com>
355
356         Crash under WebCore::SWServer::registrationStoreImportComplete()
357         https://bugs.webkit.org/show_bug.cgi?id=186644
358         <rdar://problem/40982257>
359
360         Reviewed by Brady Eidson.
361
362         Fix lifetime management issues with RegistrationDatabase. RegistrationDatabase
363         was previously subclassing CrossThreadTaskHandler. CrossThreadTaskHandler
364         currently is not safe for objects that can get destroyed (such as
365         RegistrationDatabase). This is because it does not keep the object alive
366         when going to the background thread or back to the main thread. This would
367         cause crashes such as the one in the radar.
368
369         To address the issue, stop subclassing CrossThreadTaskHandler and use a
370         simple WorkQueue instead. RegistrationDatabase is now ThreadSafeRefCounted
371         and we take care of ref'ing it whenever we dispatch a task to the work queue
372         or back to the main thread. Because the RegistrationDatabase can now outlive
373         the RegistrationStore, m_store is now a WeakPtr.
374
375         * workers/service/server/RegistrationDatabase.cpp:
376         (WebCore::RegistrationDatabase::RegistrationDatabase):
377         (WebCore::RegistrationDatabase::~RegistrationDatabase):
378         (WebCore::RegistrationDatabase::postTaskToWorkQueue):
379         (WebCore::RegistrationDatabase::openSQLiteDatabase):
380         (WebCore::RegistrationDatabase::importRecordsIfNecessary):
381         (WebCore::RegistrationDatabase::pushChanges):
382         (WebCore::RegistrationDatabase::clearAll):
383         (WebCore::RegistrationDatabase::importRecords):
384         (WebCore::RegistrationDatabase::addRegistrationToStore):
385         (WebCore::RegistrationDatabase::databaseFailedToOpen):
386         (WebCore::RegistrationDatabase::databaseOpenedAndRecordsImported):
387         * workers/service/server/RegistrationDatabase.h:
388         (WebCore::RegistrationDatabase::create):
389         * workers/service/server/RegistrationStore.cpp:
390         (WebCore::RegistrationStore::RegistrationStore):
391         (WebCore::RegistrationStore::~RegistrationStore):
392         (WebCore::RegistrationStore::pushChangesToDatabase):
393         (WebCore::RegistrationStore::clearAll):
394         * workers/service/server/RegistrationStore.h:
395
396 2018-06-15  Zalan Bujtas  <zalan@apple.com>
397
398         [LFC] Align compute functions styles.
399         https://bugs.webkit.org/show_bug.cgi?id=186649
400
401         Reviewed by Antti Koivisto.
402
403         Improve code readability.
404
405         * layout/FormattingContext.h:
406         * layout/FormattingContextGeometry.cpp:
407         (WebCore::Layout::contentHeightForFormattingContextRoot):
408         (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto):
409         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
410         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
411         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
412         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
413         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
414         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
415         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
416         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
417         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
418         (WebCore::Layout::computedValueIfNotAuto): Deleted.
419         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
420         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
421         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
422         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
423         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
424         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
425
426 2018-06-15  Zalan Bujtas  <zalan@apple.com>
427
428         [LFC] Add FormattingContextLayout logging channel
429         https://bugs.webkit.org/show_bug.cgi?id=186637
430
431         Reviewed by Antti Koivisto.
432
433         Add some basic layout logging (-WebCoreLogging "FormattingContextLayout").
434
435         * layout/FormattingContext.cpp:
436         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
437         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
438         * layout/FormattingContextGeometry.cpp:
439         (WebCore::Layout::contentHeightForFormattingContextRoot):
440         (WebCore::Layout::shrinkToFitWidth):
441         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
442         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
443         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
444         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
445         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
446         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
447         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
448         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
449         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
450         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
451         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
452         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
453         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
454         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
455         * layout/Verification.cpp:
456         (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
457         (WebCore::Layout::verifyAndOutputSubtree):
458         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
459         * layout/blockformatting/BlockFormattingContext.cpp:
460         (WebCore::Layout::BlockFormattingContext::layout const):
461         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
462         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
463         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
464         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
465         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
466         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
467         * layout/layouttree/LayoutTreeBuilder.cpp:
468         (WebCore::Layout::outputLayoutBox):
469         (WebCore::Layout::outputLayoutTree):
470         (WebCore::Layout::TreeBuilder::showLayoutTree):
471         (WebCore::Layout::printLayoutTreeForLiveDocuments):
472         * layout/layouttree/LayoutTreeBuilder.h:
473         * platform/Logging.h:
474
475 2018-06-15  Antoine Quint  <graouts@apple.com>
476
477         [Web Animations] CSS Animations should take precedence over CSS Transitions
478         https://bugs.webkit.org/show_bug.cgi?id=186651
479
480         Reviewed by Dean Jackson.
481
482         Ensure CSS Animations override CSS Transitions by modifying the order in which animations are returned by animationsForElement().
483
484         * animation/AnimationTimeline.cpp:
485         (WebCore::AnimationTimeline::animationsForElement const):
486
487 2018-06-14  Youenn Fablet  <youenn@apple.com>
488
489         Make NetworkProcess get cache storage parameters at creation of the CacheStorage engine
490         https://bugs.webkit.org/show_bug.cgi?id=186166
491
492         Reviewed by Alex Christensen.
493
494         Covered by existing tests.
495
496         * platform/network/NetworkStorageSession.h:
497         (WebCore::NetworkStorageSession::cacheStorageDirectory const): Deleted.
498         (WebCore::NetworkStorageSession::setCacheStorageDirectory): Deleted.
499         (WebCore::NetworkStorageSession::cacheStoragePerOriginQuota const): Deleted.
500         (WebCore::NetworkStorageSession::setCacheStoragePerOriginQuota): Deleted.
501
502 2018-06-14  Matt Lewis  <jlewis3@apple.com>
503
504         Unreviewed, rolling out r232823.
505
506         This caused both test timeouts and api failures.
507
508         Reverted changeset:
509
510         "[Mail] Use the Mail Viewer width as the base for resolving
511         horizontal viewport units"
512         https://bugs.webkit.org/show_bug.cgi?id=186585
513         https://trac.webkit.org/changeset/232823
514
515 2018-06-14  Nan Wang  <n_wang@apple.com>
516
517         AX: Crash in AccessibilityNodeObject::textUnderElement(WebCore::AccessibilityTextUnderElementMode) const + 536
518         https://bugs.webkit.org/show_bug.cgi?id=186629
519
520         Reviewed by Chris Fleizach.
521
522         This crashed when we passed a null node to ancestorsOfType. Fixed it
523         by adding a null check.
524
525         Test: accessibility/hidden-object-text-value-crash.html
526
527         * accessibility/AccessibilityNodeObject.cpp:
528         (WebCore::AccessibilityNodeObject::textUnderElement const):
529
530 2018-06-14  Timothy Hatcher  <timothy@apple.com>
531
532         Expose more semantic system colors.
533
534         https://bugs.webkit.org/show_bug.cgi?id=186609
535         rdar://problem/39287277
536
537         Reviewed by Tim Horton.
538
539         Add the following semantic colors:
540          -apple-system-control-accent
541          -apple-system-even-alternating-content-background
542          -apple-system-odd-alternating-content-background
543          -apple-system-selected-content-background
544          -apple-system-unemphasized-selected-content-background
545          -apple-system-selected-text
546          -apple-system-unemphasized-selected-text
547          -apple-system-selected-text-background
548          -apple-system-unemphasized-selected-text-background
549          -apple-system-placeholder-text
550          -apple-system-find-highlight-background
551          -apple-system-separator
552
553         * css/CSSValueKeywords.in:
554         * rendering/RenderThemeMac.mm:
555         (WebCore::RenderThemeMac::systemColor const):
556
557 2018-06-14  Eric Carlson  <eric.carlson@apple.com>
558
559         [iOS] WebAVPlayerController isPlayingOnSecondScreen should be declared read-write
560         https://bugs.webkit.org/show_bug.cgi?id=186621
561         <rdar://problem/40243303>
562
563         Reviewed by Jer Noble.
564
565         * platform/ios/WebAVPlayerController.h:
566
567 2018-06-13  Zalan Bujtas  <zalan@apple.com>
568
569         [LFC] Miscellaneous fixes to be able to layout <div> with fixed width/height
570         https://bugs.webkit.org/show_bug.cgi?id=186616
571
572         Reviewed by Antti Koivisto.
573
574         1. Move box horizontally/vertically when relevant margin is computed.
575         2. Fix isStretchedToViewport() logic and make sure that the width/height is adjusted with the margin when the box is stretchy.
576         3. Fix isPaddingApplicable() and add "GenericElement" for elements that don't need special handling.
577
578         With this patch LFC produces the correct geometry for the following content:
579         <html><body><div style="width: 100px; height: 100px;"></div></body></html>
580
581         * layout/FormattingContext.cpp:
582         (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
583         (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
584         * layout/blockformatting/BlockFormattingContext.cpp:
585         (WebCore::Layout::BlockFormattingContext::layout const):
586         (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
587         (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
588         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
589         (WebCore::Layout::isStretchedToViewport):
590         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
591         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
592         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
593         * layout/displaytree/DisplayBox.h:
594         (WebCore::Display::Box::moveHorizontally):
595         (WebCore::Display::Box::moveVertically):
596         (WebCore::Display::Box::Rect::setWidth):
597         (WebCore::Display::Box::Rect::setHeight):
598         (WebCore::Display::Box::Rect::moveHorizontally):
599         (WebCore::Display::Box::Rect::moveVertically):
600         * layout/layouttree/LayoutBox.cpp:
601         (WebCore::Layout::Box::isPaddingApplicable const):
602         * layout/layouttree/LayoutBox.h:
603         * layout/layouttree/LayoutTreeBuilder.cpp:
604         (WebCore::Layout::TreeBuilder::createSubTree):
605
606 2018-06-13  Chris Dumez  <cdumez@apple.com>
607
608         Crash under SWServer::unregisterConnection(Connection&)
609         https://bugs.webkit.org/show_bug.cgi?id=186584
610         <rdar://problem/40931680>
611
612         Reviewed by Youenn Fablet.
613
614         The crash was due to SWServer::Connection objects outliving their SWServer, even
615         though SWServer::Connection::m_server is a C++ reference. This was possible because
616         SWServer does not own the connections, StorageToWebProcessConnection does. This
617         started crashing recently, after r232423, because SWServer can get destroyed now.
618         The SWServer might get destroyed before the StorageToWebProcessConnection, in which
619         case the SWServer::Connection objects will get destroyed later. We were crashing
620         because the SWServer::Connection destructor tries to unregister the connection from
621         the SWServer (which is dead).
622
623         To address the issue, the SWServer now owns the connections. StorageToWebProcessConnection
624         merely has weak pointers to the connections.
625
626         * workers/service/server/SWServer.cpp:
627         (WebCore::SWServer::Connection::Connection):
628         (WebCore::SWServer::addConnection):
629         (WebCore::SWServer::removeConnection):
630         (WebCore::SWServer::resolveRegistrationReadyRequests):
631         * workers/service/server/SWServer.h:
632         (WebCore::SWServer::Connection::~Connection):
633         (WebCore::SWServer::Connection::server):
634         (WebCore::SWServer::connection):
635         * workers/service/server/SWServerRegistration.cpp:
636         (WebCore::SWServerRegistration::forEachConnection):
637         (WebCore::SWServerRegistration::notifyClientsOfControllerChange):
638         (WebCore::SWServerRegistration::controlClient):
639
640 2018-06-13  Zalan Bujtas  <zalan@apple.com>
641
642         [Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units
643         https://bugs.webkit.org/show_bug.cgi?id=186585
644         <rdar://problem/30685325>
645
646         Reviewed by Tim Horton.
647
648         Use the existing "override viewport size for viewport units" mechanism to compute the preferred
649         viewport unit values for the Mail Viewer html content. 
650
651         Test: fast/dynamic/mail-autosize-viewport-unit.html
652
653         * page/FrameView.cpp:
654         (WebCore::FrameView::FrameView):
655         (WebCore::FrameView::enableAutoSizeMode):
656         (WebCore::FrameView::clearViewportSizeOverrideForCSSViewportUnits):
657         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
658         (WebCore::FrameView::overrideViewportSizeForCSSViewportUnits):
659         (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
660         * page/FrameView.h:
661
662 2018-06-13  Dean Jackson  <dino@apple.com>
663
664         Disable AR support in WKWebView clients
665         https://bugs.webkit.org/show_bug.cgi?id=186611
666         <rdar://problem/39544684>
667
668         Reviewed by Jon Lee.
669
670         Since it hasn't been adequately tested, System Preview (AR) should
671         be disabled by default for WKWebViews.
672
673         Add a new RuntimeEnabledFeature to control this, and guard for
674         this case everywhere we use system previews.
675
676         * html/HTMLAnchorElement.cpp:
677         (WebCore::HTMLAnchorElement::isSystemPreviewLink const):
678         (WebCore::HTMLAnchorElement::handleClick):
679         * html/HTMLImageElement.cpp:
680         (WebCore::HTMLImageElement::isSystemPreviewImage const):
681         * html/HTMLPictureElement.cpp:
682         (WebCore::HTMLPictureElement::isSystemPreviewImage const):
683         * page/RuntimeEnabledFeatures.h:
684         (WebCore::RuntimeEnabledFeatures::setSystemPreviewEnabled):
685         (WebCore::RuntimeEnabledFeatures::systemPreviewEnabled const):
686         * rendering/RenderImage.cpp:
687         (WebCore::RenderImage::paintIntoRect):
688
689 2018-06-13  Youenn Fablet  <youenn@apple.com>
690
691         Supported plugin check should be based on plugin identifier
692         https://bugs.webkit.org/show_bug.cgi?id=186578
693         <rdar://problem/40523828>
694
695         Reviewed by Darin Adler.
696
697         Rename SupportedPluginName in SupportedPluginIdentifier.
698         Add cross-platform support for plug-in identifier.
699
700         Update built-in PDF plug-in to check its identifier instead of its name.
701         This is stronger as the name may change according localization.
702
703         * loader/EmptyClients.cpp:
704         * plugins/PluginData.cpp:
705         (WebCore::isBuiltInPDFPlugIn):
706         (WebCore::PluginData::initPlugins):
707         * plugins/PluginData.h:
708         (WebCore::operator==):
709         (WebCore::isSupportedPlugin):
710         (WebCore::SupportedPluginIdentifier::decode):
711         (WebCore::SupportedPluginIdentifier::encode const):
712         (WebCore::SupportedPluginName::decode): Deleted.
713         (WebCore::SupportedPluginName::encode const): Deleted.
714         * plugins/PluginInfoProvider.h:
715
716 2018-06-13  Chris Dumez  <cdumez@apple.com>
717
718         PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled
719         https://bugs.webkit.org/show_bug.cgi?id=186545
720
721         Reviewed by Brady Eidson.
722
723         Move frame navigation logging for ITP purposes from the WebProcess to the UIProcess.
724         This information was previously logged in DocumentLoader::willSendRequest() and was getting
725         sync'd to the UIProcess at regular intervals or when the layout tests call testRunner's
726         statisticsNotifyObserver(). We now do the logging directly in the UIProcess, in
727         WebPageProxy::decidePolicyForNavigationAction (which was getting called via IPC from
728         DocumentLoader::willSendRequest()).
729
730         This is more efficient and will also be needed soon due to the way process swap on navigation
731         deals with cross-origin redirects. On cross-origin redirect of the main frame, PSON cancels
732         the load and started a new load to the redirected to URL in the new WebProcess. As a result,
733         the new WebProcess is not aware that the load is a redirect, which is information that ITP
734         requires. By moving the ITP logging to the UIProcess, we still have access to this
735         information. 
736
737         * loader/DocumentLoader.cpp:
738         (WebCore::DocumentLoader::willSendRequest):
739         Stop logging the navigation now that it is logged in the UIProcess.
740
741         * loader/EmptyClients.cpp:
742         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
743         * loader/EmptyFrameLoaderClient.h:
744         * loader/FrameLoader.cpp:
745         (WebCore::FrameLoader::loadURL):
746         (WebCore::FrameLoader::loadWithDocumentLoader):
747         * loader/FrameLoaderClient.h:
748         * loader/PolicyChecker.cpp:
749         (WebCore::PolicyChecker::checkNavigationPolicy):
750         * loader/PolicyChecker.h:
751         We now pass the full redirect request to the decidePolicyForNavigationAction
752         delegate instead of a simple isRedirect boolean, so that we have the redirect
753         response URL in the UIProcess for ITP logging.
754
755         * loader/ResourceLoadObserver.cpp:
756         (WebCore::areDomainsAssociated):
757         (WebCore::ResourceLoadObserver::logSubresourceLoading):
758         (WebCore::ResourceLoadObserver::logWebSocketLoading):
759         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
760         * loader/ResourceLoadObserver.h:
761         * loader/ResourceLoadStatistics.cpp:
762         (WebCore::ResourceLoadStatistics::areDomainsAssociated):
763         (WebCore::ResourceLoadStatistics::reduceTimeResolution):
764         * loader/ResourceLoadStatistics.h:
765         - Remove ResourceLoadObserver::logFrameNavigation() now that it is on the WebResourceLoadStatisticsStore.
766         - Move some code from ResourceLoadObserver to ResourceLoadStatistics so that it can
767           be called from the UIProcess and to avoid code duplication.
768
769 2018-06-13  Mark Lam  <mark.lam@apple.com>
770
771         FloatingPointEnvironment is only needed for ARM CPUs.
772         https://bugs.webkit.org/show_bug.cgi?id=186567
773         <rdar://problem/40929441>
774
775         Reviewed by Michael Saboff.
776
777         No new tests.  This behavior is already covered by existing tests.
778
779         * platform/ios/wak/FloatingPointEnvironment.cpp:
780         * platform/ios/wak/FloatingPointEnvironment.h:
781         (WebCore::FloatingPointEnvironment::enableDenormalSupport):
782         (WebCore::FloatingPointEnvironment::saveMainThreadEnvironment):
783         (WebCore::FloatingPointEnvironment::propagateMainThreadEnvironment):
784         (WebCore::FloatingPointEnvironment::singleton):
785
786 2018-06-13  Timothy Hatcher  <timothy@apple.com>
787
788         Input form controls have a white background in dark mode, when they should not.
789
790         https://bugs.webkit.org/show_bug.cgi?id=186577
791         rdar://problem/39258325
792
793         Reviewed by Tim Horton.
794
795         * DerivedSources.make: Allow WTF_PLATFORM_MAC ifdefs to preprocess in html.css.
796         * css/CSSValueKeywords.in: Added -apple-system-control-background.
797         * css/MediaQueryExpression.cpp:
798         (WebCore::featureWithValidIdent): Allow dark mode media query in user agent stylesheets.
799         (WebCore::isFeatureValidWithoutValue): Ditto.
800         * css/MediaQueryParserContext.cpp:
801         (WebCore::MediaQueryParserContext::MediaQueryParserContext): Transfer the CSSParserMode from CSSParserContext.
802         * css/MediaQueryParserContext.h:
803         * css/html.css: Set color and background-color to semantic colors for input, textarea, and select.
804         Make input background-color transparent in dark mode to match AppKit.
805         * rendering/RenderThemeMac.mm:
806         (WebCore::RenderThemeMac::systemColor const): Added -apple-system-control-background.
807         (WebCore::RenderThemeMac::paintTextField): Adjust the drawing rect to match new artwork in macOS 10.14.
808
809 2018-06-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
810
811         TileFirstPaint strategy for async image decoding should be disabled for non root RenderLayers
812         https://bugs.webkit.org/show_bug.cgi?id=186336
813         <rdar://problem/40808099>
814
815         Reviewed by Simon Fraser.
816
817         When showing a composited RenderLayer for the first time, the images in 
818         this layer have to be decoded synchronously to avoid unwanted flashing.
819
820         To create a layout test for this patch, FrameDecodingDurationForTesting
821         needs to be generalized for large and animated images. The decoding thread
822         now forces the decoding time to be at least equal to 
823         FrameDecodingDurationForTesting.
824
825         Test: fast/images/async-image-composited-show.html
826
827         * platform/graphics/BitmapImage.cpp:
828         (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages const):
829         (WebCore::BitmapImage::internalStartAnimation):
830         (WebCore::BitmapImage::advanceAnimation):
831         * platform/graphics/BitmapImage.h:
832         * platform/graphics/ImageSource.cpp:
833         (WebCore::ImageSource::startAsyncDecodingQueue):
834         * platform/graphics/ImageSource.h:
835         (WebCore::ImageSource::setFrameDecodingDurationForTesting):
836         (WebCore::ImageSource::frameDecodingDurationForTesting const):
837         * rendering/RenderLayer.cpp:
838         (WebCore::RenderLayer::paintLayerContents):
839
840 2018-06-13  Wenson Hsieh  <wenson_hsieh@apple.com>
841
842         CSS "background-color" style no longer affects natively rendered text fields
843         https://bugs.webkit.org/show_bug.cgi?id=186597
844         <rdar://problem/41050528>
845
846         Reviewed by Tim Horton.
847
848         AppKit currently does not support rendering background color to the edges of a text field cell. This means that
849         in WebCore, when natively rendering text inputs with background color, we need to only draw the bezels of a text
850         field, such that the background color we paint behind the text field will be shown. Currently, the way we
851         accomplish this is by intercepting an internal NSTextField method that computes drawing options for CoreUI, and
852         inserting a `"borders only" => true` entry.
853
854         However, in a recent build of macOS Mojave, AppKit tweaked -_coreUIDrawOptionsWithFrame:inView:includeFocus: to
855         add an extra argument (such that it's now -_coreUIDrawOptionsWithFrame:inView:includeFocus:maskOnly:), which
856         negates the above workaround. To fix this in the short term, augment the workaround to apply to the latest macOS
857         Mojave as well. A longer-term fix is already tracked in <rdar://problem/11385461>, which would allow WebKit to
858         simply specify a background color on the text field cell, and have AppKit render it properly to the edges of the
859         bezels.
860
861         Covered by a test that is currently failing on Mojave: fast/forms/hidpi-textfield-background-bleeding.html
862
863         * rendering/RenderThemeMac.mm:
864         (-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
865         (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
866         (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:maskOnly:]):
867
868 2018-06-13  Thibault Saunier  <tsaunier@igalia.com>
869
870         [WPE] Build getUserMedia support
871         https://bugs.webkit.org/show_bug.cgi?id=186547
872
873         Reviewed by Alejandro G. Castro.
874
875         Enable mediastream tests.
876
877         * PlatformWPE.cmake: Build MediaStream support.
878         * SourcesGTK.txt: Moved GStreamer related files to GStreamer.cmake.
879         * SourcesWPE.txt: Removed `platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp`
880         which is now in GStreamer.cmake.
881         * platform/GStreamer.cmake: Build more MediaStream/webrtc related files.
882         * platform/graphics/ImageBuffer.cpp: Handle the fact that toBGRAData is
883         now built directly into the Cairo backend and not GTK anymore.
884         * platform/graphics/cairo/ImageBufferCairo.cpp: Implement `toBGRAData`
885         * platform/graphics/gtk/ImageBufferGtk.cpp: Removed `toBGRAData` as it is
886         now implemented in the Cairo backend itself.
887         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Switch an
888         ASSERT to RELEASE_ASSERT when adding the GhostPad to itself. This was making
889         test fail when built in RELEASE mode.
890         (WebCore::webkitMediaStreamSrcChain): Minor variable name change to make it
891         more accurate.
892         (WebCore::webkitMediaStreamSrcAddPad): Now add the ghost pad to the element
893         before setting its chain function, making things clearer.
894         (WebCore::webkitMediaStreamSrcSetupSrc): Remove extra new line.
895
896 2018-06-13  Philippe Normand  <pnormand@igalia.com>
897
898         [GStreamer] fast/canvas/webgl crashes
899         https://bugs.webkit.org/show_bug.cgi?id=186590
900
901         Reviewed by Carlos Alberto Lopez Perez.
902
903         After r232747 the sample managed by the player can be empty,
904         without buffer. So we need to check for this before mapping video
905         frames. Also use the GstVideoFrameHolder in more places to reduce
906         copy-paste churn.
907
908         * platform/graphics/gstreamer/ImageGStreamer.h:
909         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
910         (ImageGStreamer::ImageGStreamer):
911         (ImageGStreamer::~ImageGStreamer):
912         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
913         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
914         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
915         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
916
917 2018-06-13  Philippe Normand  <pnormand@igalia.com>
918
919         Unreviewed GTK build fix for --cmakeargs=-DUSE_GSTREAMER_GL=OFF
920
921         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
922         (WebCore::MediaPlayerPrivateGStreamer::load):
923         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
924         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
925
926 2018-06-12  Philippe Normand  <pnormand@igalia.com>
927
928         [GStreamer] Video freezes when GStreamerGL is not installed
929         https://bugs.webkit.org/show_bug.cgi?id=184925
930
931         Reviewed by Žan Doberšek.
932
933         At runtime when the GStreamer opengl plugin isn't available the
934         player will fallback to the internal WebKit video sink. The
935         VideoFrameHolder was refactored to handle both cases (opengl,
936         non-opengl).
937
938         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
939         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
940         (WebCore::GstVideoFrameHolder::~GstVideoFrameHolder):
941         (WebCore::GstVideoFrameHolder::frame const):
942         (WebCore::GstVideoFrameHolder::updateTexture):
943         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
944         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
945         (WebCore::GstVideoFrameHolder::isValid const): Deleted.
946         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Deleted.
947         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
948
949 2018-06-12  Zalan Bujtas  <zalan@apple.com>
950
951         Complex text handling should opt out of bounded text layout.
952         https://bugs.webkit.org/show_bug.cgi?id=186571
953         <rdar://problem/41060908>
954
955         Reviewed by Tim Horton.
956
957         Test: fast/text/complex-long-text-crash.html
958
959         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
960         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
961
962 2018-06-12  Ryan Haddad  <ryanhaddad@apple.com>
963
964         Unreviewed, rolling out r232774.
965
966         Breaks internal builds.
967
968         Reverted changeset:
969
970         "Complex text handling should opt out of bounded text layout."
971         https://bugs.webkit.org/show_bug.cgi?id=186571
972         https://trac.webkit.org/changeset/232774
973
974 2018-06-12  Ryosuke Niwa  <rniwa@webkit.org>
975
976         iOS WK1: Occasional crash in FrameView::setScrollPosition
977         https://bugs.webkit.org/show_bug.cgi?id=186575
978
979         Reviewed by David Kilzer.
980
981         The bug was caused by ScrollView::platformSetScrollPosition releasing the web thread lock
982         and DumpRenderTree requesting a new page load thereby destroying FrameView.
983
984         Fixed the crash by keeping FrameView alive while scrollToFocusedElementTimerFired is getting called.
985
986         No new tests since the bug is caught by existing layout tests under guard malloc.
987
988         * page/FrameView.cpp:
989         (WebCore::FrameView::scrollToFocusedElementTimerFired):
990
991 2018-06-12  Zalan Bujtas  <zalan@apple.com>
992
993         Complex text handling should opt out of bounded text layout.
994         https://bugs.webkit.org/show_bug.cgi?id=186571
995         <rdar://problem/40801429>
996
997         Reviewed by Tim Horton.
998
999         Test: fast/text/complex-long-text-crash.html
1000
1001         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1002         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1003
1004 2018-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1005
1006         Unreviewed, fix the Windows build after r232757
1007
1008         * editing/ReplaceSelectionCommand.cpp:
1009         (WebCore::ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChildren):
1010
1011 2018-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1012
1013         REGRESSION(r228724): Occasional crash when executing ReplaceSelectionCommand at the end of the document
1014         https://bugs.webkit.org/show_bug.cgi?id=186555
1015         <rdar://problem/39703004>
1016
1017         Reviewed by Ryosuke Niwa.
1018
1019         r228724 removed a null check for m_lastNodeInserted in InsertedNodes::pastLastLeaf(). This null check was
1020         guarding against the case where m_firstNodeInserted might exist, but m_lastNodeInserted is null, which may
1021         happen when inserting content at the end of the document, since InsertedNodes::willRemoveNodePreservingChildren
1022         may cause m_lastNodeInserted to be null. This is because the removed node may be at the very end of the document
1023         _and also_ not have any children, which means that both `node->lastChild()` as well as
1024         `NodeTraversal::nextSkippingChildren(*node)` will be null.
1025
1026         After getting into this state, we subsequently crash when attempting to compute InsertedNodes::pastLastLeaf().
1027         To fix this, avoid accidentally clearing out m_lastNodeInserted; if the last inserted node has neither a child
1028         nor a next node, seek backwards to the previous node in the DOM instead, and clamp to the first inserted node,
1029         such that the last inserted node's document position is at or after the first inserted node's position.
1030
1031         Test: editing/execCommand/insert-apple-style-span-at-document-end.html
1032
1033         * editing/ReplaceSelectionCommand.cpp:
1034         (WebCore::ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChildren):
1035
1036 2018-06-12  Jianjun Zhu  <jianjun.zhu@intel.com>
1037
1038         Hash deviceId and groupId of MediaTrackCapabilities.
1039         https://bugs.webkit.org/show_bug.cgi?id=186471
1040
1041         Reviewed by Eric Carlson.
1042
1043         This change makes the identifier for the source of the MediaStreamTrack
1044         has the same value returned by enumerateDevices(). It also prevents real
1045         device ID being leaked.
1046
1047         (WebCore::MediaStreamTrack::getCapabilities const):
1048         * Modules/mediastream/MediaStreamTrack.h:
1049         * Modules/mediastream/MediaStreamTrack.idl:
1050
1051 2018-06-12  Philippe Normand  <pnormand@igalia.com>
1052
1053         Unreviewed WPE build fix after r232749.
1054
1055         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
1056
1057 2018-06-12  Zalan Bujtas  <zalan@apple.com>
1058
1059         [LFC] Add vertical margin computation for inflow non-replaced box and for the (10.6.6) complicated cases.
1060         https://bugs.webkit.org/show_bug.cgi?id=186469
1061
1062         Reviewed by Antti Koivisto.
1063
1064         * layout/FormattingContextGeometry.cpp:
1065         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1066         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
1067         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1068         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1069         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1070
1071 2018-06-12  Philippe Normand  <pnormand@igalia.com>
1072
1073         [GStreamer] Bump required version to 1.8.3
1074         https://bugs.webkit.org/show_bug.cgi?id=186558
1075
1076         Reviewed by Xabier Rodriguez-Calvar.
1077
1078         * platform/GStreamer.cmake: Remove useless file.
1079         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
1080         (webKitWebAudioSrcChangeState): Remove useless version check.
1081         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
1082         Removed. createDecryptor() is dead code since the decryptors moved
1083         to the MSE playback pipeline.
1084         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
1085         (WebCore::GStreamerEMEUtilities::keySystemToUuid):
1086
1087 2018-06-11  Philippe Normand  <philn@igalia.com>
1088
1089         [GStreamer] flush video sample upon DRAIN query
1090         https://bugs.webkit.org/show_bug.cgi?id=186481
1091
1092         Reviewed by Xabier Rodriguez-Calvar.
1093
1094         Use the appsink sink pad pad probe for both event and drain query
1095         management. This patch is partially based on
1096         https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/d3a336523d123119fe1dd53da5d9006c92cf078c
1097         by Enrique Ocaña González <eocanha@igalia.com>.
1098
1099         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1100         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
1101         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
1102
1103 2018-06-11  Zalan Bujtas  <zalan@apple.com>
1104
1105         [LFC] Replace HorizontalGeometry::width and margin with WidthAndMargin (Vertical too)
1106         https://bugs.webkit.org/show_bug.cgi?id=186556
1107
1108         Reviewed by Sam Weinig.
1109
1110         HorizontalGeometry::width and margin -> WidthAndMargin
1111         VerticalGeometry::height and margin -> HeightAndMargin
1112
1113         * layout/FormattingContext.cpp:
1114         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1115         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1116         * layout/FormattingContext.h:
1117         * layout/FormattingContextGeometry.cpp:
1118         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1119         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1120         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1121         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1122         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1123         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1124         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1125
1126 2018-06-11  Youenn Fablet  <youenn@apple.com>
1127
1128         Improve error messages in case FetchEvent.respondWith has a rejected promise
1129         https://bugs.webkit.org/show_bug.cgi?id=186368
1130
1131         Reviewed by Chris Dumez.
1132
1133         Covered by rebased tests.
1134
1135         Introduce a new error domain for service worker ResourceError.
1136         Used this domain to log in the console any such error.
1137
1138         Update FetchEvent implementation to get meaningful error messages for respondWith error cases.
1139         In particular, convert the rejected promise JS value as a string to populate the error message.
1140
1141         * loader/SubresourceLoader.cpp:
1142         (WebCore::SubresourceLoader::didFail):
1143         * platform/network/ResourceErrorBase.cpp:
1144         * platform/network/ResourceErrorBase.h:
1145         * testing/ServiceWorkerInternals.cpp:
1146         (WebCore::ServiceWorkerInternals::waitForFetchEventToFinish):
1147         * workers/service/FetchEvent.cpp:
1148         (WebCore::FetchEvent::~FetchEvent):
1149         (WebCore::FetchEvent::createResponseError):
1150         (WebCore::FetchEvent::onResponse):
1151         (WebCore::FetchEvent::respondWithError):
1152         (WebCore::FetchEvent::processResponse):
1153         (WebCore::FetchEvent::promiseIsSettled):
1154         * workers/service/FetchEvent.h:
1155         * workers/service/context/ServiceWorkerFetch.cpp:
1156         (WebCore::ServiceWorkerFetch::processResponse):
1157         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
1158
1159 2018-06-11  Chris Dumez  <cdumez@apple.com>
1160
1161         http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html times out with PSON enabled
1162         https://bugs.webkit.org/show_bug.cgi?id=186546
1163
1164         Reviewed by Brady Eidson.
1165
1166         Add a hasOpenedFrames flag to NavigationAction, which we'll use in the UIProcess when deciding
1167         to process swap on navigation or not.
1168
1169         Test: http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html
1170
1171         * loader/FrameLoader.cpp:
1172         (WebCore::FrameLoader::loadURL):
1173         * loader/NavigationAction.h:
1174         (WebCore::NavigationAction::hasOpenedFrames const):
1175         (WebCore::NavigationAction::setHasOpenedFrames):
1176
1177 2018-06-11  Tim Horton  <timothy_horton@apple.com>
1178
1179         Link drag image is inconsistently unreadable in dark mode
1180         https://bugs.webkit.org/show_bug.cgi?id=186472
1181
1182         Reviewed by Timothy Hatcher.
1183
1184         * platform/mac/DragImageMac.mm:
1185         (WebCore::createDragImageForLink):
1186         Use LocalDefaultSystemAppearance so that NSColors used inside
1187         createDragImageForLink are interpreted correctly. This function
1188         always follows the system appearance regardless of what the preference
1189         is set to, because it's generating UI that isn't part of the page.
1190
1191         Use controlBackgroundColor to get a consistently contrasting background
1192         for the link drag image.
1193
1194 2018-06-11  Chris Dumez  <cdumez@apple.com>
1195
1196         http/tests/security/cors-post-redirect-307.html fails with PSON enabled
1197         https://bugs.webkit.org/show_bug.cgi?id=186441
1198
1199         Reviewed by Brady Eidson.
1200
1201         When we are continuing a load in a new process, we currently bypass the navigation policy
1202         check. We now also bypass the adding of headers such as the Origin one since the request
1203         was already processed in the previous process. This is important because in the case of
1204         a cross-origin redirect, the previous process has removed the Origin header from the
1205         request and we do not want the new process to add it again.
1206
1207         Test: http/tests/security/cors-post-redirect-307-pson.html
1208
1209         * WebCore.xcodeproj/project.pbxproj:
1210         * history/BackForwardController.cpp:
1211         (WebCore::BackForwardController::goBackOrForward):
1212         (WebCore::BackForwardController::goBack):
1213         (WebCore::BackForwardController::goForward):
1214         * loader/FrameLoadRequest.h:
1215         (WebCore::FrameLoadRequest::setShouldTreatAsContinuingLoad):
1216         (WebCore::FrameLoadRequest::shouldTreatAsContinuingLoad const):
1217         (WebCore::FrameLoadRequest::setShouldCheckNavigationPolicy): Deleted.
1218         (WebCore::FrameLoadRequest::shouldCheckNavigationPolicy const): Deleted.
1219         * loader/FrameLoader.cpp:
1220         (WebCore::FrameLoader::loadURLIntoChildFrame):
1221         (WebCore::FrameLoader::load):
1222         (WebCore::FrameLoader::loadWithNavigationAction):
1223         (WebCore::FrameLoader::loadWithDocumentLoader):
1224         (WebCore::FrameLoader::reloadWithOverrideEncoding):
1225         (WebCore::FrameLoader::reload):
1226         (WebCore::FrameLoader::addExtraFieldsToRequest):
1227         (WebCore::FrameLoader::addHTTPOriginIfNeeded):
1228         (WebCore::FrameLoader::loadDifferentDocumentItem):
1229         (WebCore::FrameLoader::loadItem):
1230         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
1231         * loader/FrameLoader.h:
1232         * loader/HistoryController.cpp:
1233         (WebCore::HistoryController::goToItem):
1234         (WebCore::HistoryController::setDefersLoading):
1235         (WebCore::HistoryController::recursiveGoToItem):
1236         * loader/HistoryController.h:
1237         * loader/ShouldTreatAsContinuingLoad.h: Renamed from Source/WebCore/loader/NavigationPolicyCheck.h.
1238         * page/Page.cpp:
1239         (WebCore::Page::goToItem):
1240         * page/Page.h:
1241
1242 2018-06-11  Youenn Fablet  <youenn@apple.com>
1243
1244         Accept request header values should be more tightly checked after r232572 in case of CORS load
1245         https://bugs.webkit.org/show_bug.cgi?id=186533
1246         <rdar://problem/40933880>
1247
1248         Reviewed by Darin Adler.
1249
1250         Covered by updated test.
1251
1252         * platform/network/HTTPParsers.cpp:
1253         (WebCore::isValidAcceptHeaderValue): Checking that Accept header value conforms with RFC7370.
1254         If not, this will trigger preflighting for CORS cross origin loads.
1255         Current checks for Accept-Language and Content-Language are sufficient to ensure values conform with RFC7370.
1256
1257 2018-06-11  Chris Dumez  <cdumez@apple.com>
1258
1259         Crash under com.apple.WebKit.Networking at WebCore: WebCore::NetworkStorageSession::hasStorageAccess const
1260         https://bugs.webkit.org/show_bug.cgi?id=186433
1261         <rdar://problem/40750907>
1262
1263         Reviewed by Geoffrey Garen.
1264
1265         Do some hardening in NetworkStorageSession::hasStorageAccess() to make sure
1266         we do not try and do a HashMap lookup with a null firstPartyDomain, as this
1267         would crash.
1268
1269         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1270         (WebCore::NetworkStorageSession::hasStorageAccess const):
1271
1272 2018-06-11  Zalan Bujtas  <zalan@apple.com>
1273
1274         [LFC] Remove redundant position functions for out-of-flow elements
1275         https://bugs.webkit.org/show_bug.cgi?id=186525
1276
1277         Reviewed by Antti Koivisto.
1278
1279         Position is computed as part of the Horizontal/Vertical geometry computation.
1280         (see outOfFlow(Non)ReplacedHorizontalGeometry/outOfFlow(Non)ReplacedVerticalGeometry functions)
1281
1282         * layout/FormattingContext.cpp:
1283         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1284         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const): Deleted.
1285         * layout/FormattingContext.h:
1286         * layout/FormattingContextGeometry.cpp:
1287         (WebCore::Layout::outOfFlowNonReplacedPosition): Deleted.
1288         (WebCore::Layout::outOfFlowReplacedPosition): Deleted.
1289         (WebCore::Layout::FormattingContext::Geometry::outOfFlowPosition): Deleted.
1290
1291 2018-06-11  Zalan Bujtas  <zalan@apple.com>
1292
1293         [LFC] Merge top, bottom, height and vertical margin computation for out-of-flow replaced elements
1294         https://bugs.webkit.org/show_bug.cgi?id=186524
1295
1296         Reviewed by Antti Koivisto.
1297
1298         Implement https://www.w3.org/TR/CSS22/visudet.html#abs-replaced-height
1299         (10.6.5 Absolutely positioned, replaced elements)
1300
1301         * layout/FormattingContextGeometry.cpp:
1302         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1303
1304 2018-06-11  Zalan Bujtas  <zalan@apple.com>
1305
1306         [LFC] Merge left, right, width and horizontal margin computation for out-of-flow replaced elements
1307         https://bugs.webkit.org/show_bug.cgi?id=186475
1308
1309         Reviewed by Antti Koivisto.
1310
1311         Implement https://www.w3.org/TR/CSS22/visudet.html#abs-replaced-width
1312         (10.3.8 Absolutely positioned, replaced elements)
1313
1314         * layout/FormattingContext.cpp:
1315         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1316         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1317         (WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const): Deleted.
1318         * layout/FormattingContext.h:
1319         * layout/FormattingContextGeometry.cpp:
1320         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1321         (WebCore::Layout::computedValueIfNotAuto):
1322         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1323         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
1324         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin): Deleted.
1325         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin): Deleted.
1326         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin): Deleted.
1327
1328 2018-06-11  Zalan Bujtas  <zalan@apple.com>
1329
1330         [LFC] Merge left, right, width and horizontal margin computation for out-of-flow non-replaced elements
1331         https://bugs.webkit.org/show_bug.cgi?id=186474
1332
1333         Reviewed by Antti Koivisto.
1334
1335         Implement https://www.w3.org/TR/CSS22/visudet.html#abs-non-replaced-width 
1336         (10.3.7 Absolutely positioned, non-replaced elements)
1337
1338         * layout/FormattingContext.cpp:
1339         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1340         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1341         (WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const): Deleted.
1342         * layout/FormattingContext.h:
1343         * layout/FormattingContextGeometry.cpp:
1344         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1345         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1346         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
1347         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin): Deleted.
1348         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin): Deleted.
1349         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin): Deleted.
1350
1351 2018-06-10  Zalan Bujtas  <zalan@apple.com>
1352
1353         [LFC] Merge top, bottom, height and vertical margin computation for out-of-flow non-replaced elements
1354         https://bugs.webkit.org/show_bug.cgi?id=186476
1355
1356         Reviewed by Antti Koivisto.
1357
1358         Implement https://www.w3.org/TR/CSS22/visudet.html#abs-non-replaced-height
1359         (10.6.4 Absolutely positioned, non-replaced elements)
1360
1361         * layout/FormattingContext.cpp:
1362         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1363         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1364         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const): Deleted.
1365         * layout/FormattingContext.h:
1366         * layout/FormattingContextGeometry.cpp:
1367         (WebCore::Layout::computedValueIfNotAuto):
1368         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1369         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1370         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
1371         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeightAndMargin): Deleted.
1372         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeightAndMargin): Deleted.
1373         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeightAndMargin): Deleted.
1374
1375 2018-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1376
1377         [GTK][WPE] Add API run run javascript from a WebKitWebView in an isolated world
1378         https://bugs.webkit.org/show_bug.cgi?id=186192
1379
1380         Reviewed by Michael Catanzaro.
1381
1382         * bindings/js/ScriptController.cpp:
1383         (WebCore::ScriptController::executeScriptInWorld): Add ExceptionDetails parameter.
1384         * bindings/js/ScriptController.h:
1385
1386 2018-06-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1387
1388         [WPE][GTK] paypal.com requires user agent quirk
1389         https://bugs.webkit.org/show_bug.cgi?id=186466
1390
1391         Reviewed by Carlos Garcia Campos.
1392
1393         * platform/UserAgentQuirks.cpp:
1394         (WebCore::urlRequiresMacintoshPlatform):
1395
1396 2018-06-09  Dan Bernstein  <mitz@apple.com>
1397
1398         [Xcode] Clean up and modernize some build setting definitions
1399         https://bugs.webkit.org/show_bug.cgi?id=186463
1400
1401         Reviewed by Sam Weinig.
1402
1403         * Configurations/Base.xcconfig: Removed definition for macOS 10.11.
1404         * Configurations/DebugRelease.xcconfig: Ditto.
1405         * Configurations/FeatureDefines.xcconfig: Simplified the definitions of ENABLE_APPLE_PAY and
1406           ENABLE_VIDEO_PRESENTATION_MODE now macOS 10.12 is the earliest supported version.
1407         * Configurations/Version.xcconfig: Removed definition for macOS 10.11.
1408         * Configurations/WebCore.xcconfig: Simplified the definition of WK_PRIVATE_FRAMEWORKS_DIR
1409           now that WK_XCODE_SUPPORTS_TEXT_BASED_STUBS is true for all supported Xcode versions.
1410         * Configurations/WebKitTargetConditionals.xcconfig: Removed definitions for macOS 10.11.
1411
1412 2018-06-09  Dan Bernstein  <mitz@apple.com>
1413
1414         Added missing file references to the Configuration group.
1415
1416         * WebCore.xcodeproj/project.pbxproj:
1417
1418 2018-06-09  Zalan Bujtas  <zalan@apple.com>
1419
1420         REGRESSION (r230480): Cannot adjust photo position on LinkedIn's profile page
1421         https://bugs.webkit.org/show_bug.cgi?id=186464
1422         <rdar://problem/40369448>
1423
1424         Reviewed by Simon Fraser.
1425
1426         The optimization logic for skipping image layout when we only need overflow computation should check if the image actually needs
1427         simplified layout only. The needsSimplifiedNormalFlowLayout() flag means that the overflow information needs to be updated but
1428         it does not mean that overflow is the only property that we need to recompute.
1429
1430         Test: fast/images/positioned-image-when-transform-is-present.html
1431
1432         * rendering/RenderImage.cpp:
1433         (WebCore::RenderImage::layout):
1434         * rendering/RenderObject.h:
1435         (WebCore::RenderObject::needsSimplifiedNormalFlowLayoutOnly const):
1436
1437 2018-06-09  Ryosuke Niwa  <rniwa@webkit.org>
1438
1439         REGRESSION(macOS Mojave): move-by-word-visually-multi-line.html fails
1440         https://bugs.webkit.org/show_bug.cgi?id=186454
1441
1442         Reviewed by Darin Adler.
1443
1444         Like r232635, this patch fixes a selection test failure caused by the change in ICU's behavior in macOS Mojave,
1445         which caused isWordTextBreak to return true in more cases.
1446
1447         In this particular failing test case, previousTextOrLineBreakBox and nextTextOrLineBreakBox were failing to find
1448         an inline text box when it found an inline box for a BR, which was mentioned by an existing FIXME comment.
1449         Consequently, visualWordPosition were erroneously detecting the end of a word followed by a blank line created by
1450         a BR as a valid word boundary to move when the Windows editing behavior is enacted.
1451
1452         Addressed the FIXME comment by finding the next inline text box skipping all inline boxes for BRs. Renamed
1453         misleadingly named previousBoxInDifferentBlock and nextBoxInDifferentBlock to previousBoxInDifferentLine and
1454         nextBoxInDifferentLine respectively, and set them to true as they're really indicating whether line boxes
1455         belong to a distinct line or not; whether an inline box belong to two (render) blocks or not is irrelevant.
1456
1457         Finally, this patch fixes a bug in visualWordPosition that it was failing to skip blank lines when a word break is
1458         found as we traversed past a line break. In those cases, we must skip all line breaks before stopping.
1459
1460         Tests: editing/selection/move-by-word-visually-mac.html
1461                editing/selection/move-by-word-visually-multi-line.htm
1462
1463         * editing/VisibleUnits.cpp:
1464         (WebCore::CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox):
1465         (WebCore::CachedLogicallyOrderedLeafBoxes::nextTextOrLineBreakBox):
1466         (WebCore::CachedLogicallyOrderedLeafBoxes::boxIndexInLeaves const):
1467         (WebCore::logicallyPreviousBox):
1468         (WebCore::logicallyNextBox):
1469         (WebCore::wordBreakIteratorForMinOffsetBoundary):
1470         (WebCore::wordBreakIteratorForMaxOffsetBoundary):
1471         (WebCore::visualWordPosition):
1472
1473 2018-06-09  Zalan Bujtas  <zalan@apple.com>
1474
1475         [LFC] MarginCollapse functions should be able to resolve non-fixed margin values
1476         https://bugs.webkit.org/show_bug.cgi?id=186461
1477
1478         Reviewed by Antti Koivisto.
1479
1480         We need the containing block's computed width to resolve vertical and horizontal margins.
1481
1482         * layout/blockformatting/BlockFormattingContext.h:
1483         * layout/blockformatting/BlockMarginCollapse.cpp:
1484         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
1485         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop):
1486         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop):
1487         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom):
1488         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
1489         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
1490         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):
1491         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom):
1492         (WebCore::Layout::collapsedMarginTopFromFirstChild): Deleted.
1493         (WebCore::Layout::nonCollapsedMarginTop): Deleted.
1494
1495 2018-06-08  Darin Adler  <darin@apple.com>
1496
1497         [Cocoa] Remove all uses of NSAutoreleasePool as part of preparation for ARC
1498         https://bugs.webkit.org/show_bug.cgi?id=186436
1499
1500         Reviewed by Anders Carlsson.
1501
1502         * bridge/objc/objc_class.mm: Use import instead of include.
1503
1504         * bridge/objc/objc_instance.h: Replaced _pool member to hold an object with
1505         m_autoreleasePool member to hold a token from objc_autoreleasePoolPush. Also
1506         initialize all data members here in the class definition.
1507
1508         * bridge/objc/objc_instance.mm:
1509         (ObjcInstance::ObjcInstance): Moved most initialization to class definition.
1510         (ObjcInstance::virtualBegin): Use objc_autoreleasePoolPush instead of
1511         NSAutoreleasePool class.
1512         (ObjcInstance::virtualEnd): Use objc_autoreleasePoolPop.
1513
1514         * bridge/objc/objc_runtime.mm: Use import instead of include.
1515         * bridge/objc/objc_utility.mm: Ditto.
1516
1517         * platform/audio/mac/AudioBusMac.mm:
1518         (WebCore::AudioBus::loadPlatformResource): Use @autoreleasepool.
1519
1520         * platform/ios/wak/WebCoreThread.mm: Re-sorted includes. Removed declaration of
1521         autorelease pool SPI and use FoundationSPI.h instead.
1522
1523         * platform/network/cocoa/ResourceResponseCocoa.mm:
1524         (WebCore::ResourceResponse::platformLazyInit): Use @autoreleasepool.
1525
1526 2018-06-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1527
1528         [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 1)
1529         https://bugs.webkit.org/show_bug.cgi?id=186442
1530         <rdar://problem/40879364>
1531
1532         Reviewed by Tim Horton.
1533
1534         No change in behavior.
1535
1536         * Configurations/FeatureDefines.xcconfig:
1537         * page/DisabledAdaptations.cpp:
1538         (WebCore::extraZoomModeAdaptationName):
1539
1540 2018-06-08  Per Arne Vollan  <pvollan@apple.com>
1541
1542         Only display refresh monitors having requested display refresh callback should get notified on screen updates.
1543         https://bugs.webkit.org/show_bug.cgi?id=186397
1544         <rdar://problem/40897835>
1545
1546         Reviewed by Brent Fulgham.
1547
1548         Since all display refresh monitors in the WebContent process share a single UI process display link,
1549         we should make sure that only the monitors having requested callback are getting notified on screen
1550         updates. I have not been able to reproduce a case where a monitor is being notified without having
1551         requested updates, but we should safeguard the code for future code changes.
1552
1553         No new tests, since this is a safeguarding measure.
1554
1555         * platform/graphics/DisplayRefreshMonitor.h:
1556         (WebCore::DisplayRefreshMonitor::hasRequestedRefreshCallback const):
1557         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1558         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
1559
1560 2018-06-07  Jer Noble  <jer.noble@apple.com>
1561
1562         REGRESSION:  Cannot listen to audio on Google Translate with side switch set to "vibrate"
1563         https://bugs.webkit.org/show_bug.cgi?id=186415
1564         <rdar://problem/40584651>
1565
1566         Reviewed by Eric Carlson.
1567
1568         Test: platform/mac/media/audio-session-category-audio-autoplay.html
1569
1570         Make sure that the PlatformMediaSession's state has already been set when calling updateSessionStates().
1571
1572         * platform/audio/PlatformMediaSession.cpp:
1573         (WebCore::PlatformMediaSession::setState):
1574         * platform/audio/PlatformMediaSessionManager.cpp:
1575         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
1576         (WebCore::PlatformMediaSessionManager::sessionStateChanged):
1577
1578 2018-06-08  Dean Jackson  <dino@apple.com>
1579
1580         'setRenderPipelineState:' is unavailable: not available on iOS
1581         https://bugs.webkit.org/show_bug.cgi?id=186449
1582         <rdar://problem/40880602>
1583
1584         Reviewed by Simon Fraser.
1585
1586         Be more explicit about the protocol type to avoid
1587         the compiler getting confused by a similar signature.
1588
1589         * platform/graphics/cocoa/GPURenderCommandEncoderMetal.mm:
1590         (WebCore::GPURenderCommandEncoder::setRenderPipelineState):
1591
1592 2018-06-08  Darin Adler  <darin@apple.com>
1593
1594         Fix iOS build.
1595
1596         * platform/ios/QuickLookSoftLink.mm: Removed QLPreviousScheme, which I said I did in the
1597         change log but looks like it didn't happen.
1598
1599 2018-06-08  Darin Adler  <darin@apple.com>
1600
1601         [Cocoa] Make more of our soft linking ARC-compatible
1602         https://bugs.webkit.org/show_bug.cgi?id=186437
1603
1604         Reviewed by Daniel Bates.
1605
1606         * editing/cocoa/DataDetection.mm:
1607         (WebCore::removeResultLinksFromAnchor): Fix comment referring to unused constant DDURLScheme.
1608
1609         * platform/cocoa/DataDetectorsCoreSoftLink.h: Removed unused DDURLScheme.
1610         * platform/cocoa/DataDetectorsCoreSoftLink.mm: Ditto.
1611
1612         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1613         Use SOFT_LINK_CONSTANT_MAY_FAIL for NSString constants instead of using
1614         SOFT_LINK_POINTER_OPTIONAL. Required moving iOS-specific items inside the
1615         #if PLATFORM(IOS) section.
1616         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Use the
1617         canLoad functions instead of checking for null to handle possibly-missing string constants.
1618         (WebCore::metadataType): Ditto.
1619
1620         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: Removed unused
1621         AVMediaTypeVideo, AVMediaTypeAudio, and AVMediaTypeText soft linking.
1622
1623         * platform/ios/QuickLook.mm:
1624         (WebCore::isQuickLookPreviewURL): Removed unneeded assertion.
1625
1626         * platform/ios/QuickLookSoftLink.h: Removed unneeded QLPreviousScheme, which was used only
1627         for an assertion, one we can do without.
1628         * platform/ios/QuickLookSoftLink.mm: Ditto.
1629
1630         * platform/mediastream/mac/AVVideoCaptureSource.mm: Removed unused soft linking of
1631         AVCaptureVideoPreviewLayer class and AVCaptureSessionPresetLow string constant. Use
1632         SOFT_LINK_CONSTANT_MAY_FAIL for NSString constants instead of using
1633         SOFT_LINK_POINTER_OPTIONAL.
1634         (WebCore::AVVideoCaptureSource::initializeCapabilities): Use the canLoad functions
1635         instead of checking for null to handle possibly-missing string constants.
1636         (WebCore::sizeForPreset): Ditto.
1637         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions const): Ditto.
1638
1639 2018-06-08  Aditya Keerthi  <akeerthi@apple.com>
1640
1641         [Datalist] Allow TextFieldInputType to show and hide suggestions
1642         https://bugs.webkit.org/show_bug.cgi?id=186151
1643
1644         Reviewed by Tim Horton.
1645
1646         TextFieldInputTypes with a list attribute should be able to display suggestions as the user
1647         interacts with the input field. In order to display suggestions for an input field with a list
1648         attribute, we need provide certain information - including the items to suggest and the location
1649         to present the suggestions. TextFieldInputType can now provide this information by conforming to
1650         the DataListSuggestionsClient interface.
1651
1652         In this initial patch, the suggestions can be shown in two ways. The first is by clicking on the
1653         input field. The other is by typing text in the field. In a later patch, we will add a third way
1654         to display suggestions, using a button. These ways to activate the suggestions are enumerated in
1655         DataListSuggestionInformation.
1656
1657         We hide the suggestions if there are no more to show, or if the input has blurred.
1658
1659         Tests to be added once work has been done in the UIProcess.
1660
1661         * WebCore.xcodeproj/project.pbxproj:
1662         * html/DataListSuggestionInformation.h: Added. Contains the information necessary to display suggestions.
1663         * html/TextFieldInputType.cpp:
1664         (WebCore::TextFieldInputType::~TextFieldInputType):
1665         (WebCore::TextFieldInputType::handleClickEvent): Show suggestions when the element is clicked.
1666         (WebCore::TextFieldInputType::handleKeydownEvent): Allow users to interact with the suggestions using the keyboard.
1667         (WebCore::TextFieldInputType::elementDidBlur): Hide the suggestions.
1668         (WebCore::TextFieldInputType::shouldRespectListAttribute):
1669         (WebCore::TextFieldInputType::didSetValueByUserEdit): Update the suggestions if the text has changed.
1670         (WebCore::TextFieldInputType::elementRectRelativeToRootView const): Provide the location where the suggestions should be shown.
1671         (WebCore::TextFieldInputType::suggestions const): Provide the list of suggestions.
1672         (WebCore::TextFieldInputType::didSelectDataListOption): Update the text once an suggestion has been selected.
1673         (WebCore::TextFieldInputType::didCloseSuggestions):
1674         (WebCore::TextFieldInputType::displaySuggestions):
1675         (WebCore::TextFieldInputType::closeSuggestions):
1676         * html/TextFieldInputType.h:
1677         * loader/EmptyClients.cpp:
1678         (WebCore::EmptyChromeClient::createDataListSuggestionPicker):
1679         * loader/EmptyClients.h:
1680         * page/Chrome.cpp:
1681         (WebCore::Chrome::createDataListSuggestionPicker):
1682         * page/Chrome.h:
1683         * page/ChromeClient.h:
1684         * platform/DataListSuggestionPicker.h: Added.
1685         (WebCore::DataListSuggestionPicker::close):
1686         (WebCore::DataListSuggestionPicker::handleKeydownWithIdentifier):
1687         (WebCore::DataListSuggestionPicker::displayWithActivationType):
1688         * platform/DataListSuggestionsClient.h: Added.
1689
1690 2018-06-07  Ryosuke Niwa  <rniwa@webkit.org>
1691
1692         REGRESSION(macOS Mojave): move-by-word-visually-inline-block-positioned-element.html fails
1693         https://bugs.webkit.org/show_bug.cgi?id=186424
1694
1695         Reviewed by Wenson Hsieh.
1696
1697         The test failure is ultimately caused by the change in ICU's behavior. With the CPU in the latest macOS Mojave,
1698         ubrk_getRuleStatus returns 200 / UBRK_WORD_LETTER at the end of a buffer given to UBreakIterator. This caused
1699         isWordTextBreak to return true instead of false in isLogicalStartOfWord at the end of the buffer.
1700
1701         This ICU behavior shouldn't have caused a problem in theory. However, WebKit had a bug in visualWordPosition which
1702         caused UBreakIterator to not include the succeeding word when traversing words to the left (backwards in LTR text)
1703         at the beginning of the last block element with exactly one line box after an non-statically positioned element.
1704
1705         In this case, visualWordPosition invokes wordBreakIteratorForMaxOffsetBoundary (because adjacentCharacterPosition
1706         is now at the end of the last word in the non-statically positioned element) to setup UBreakIterator. Because
1707         there are no line boxes left in the current line (in the last block element with exactly one line box),
1708         logicallyNextBox enters the while loop and invoke nextRootInlineBoxCandidatePosition to find the next root line box.
1709         However, the visible position given to this function is at the beginning of the first word in the block element.
1710         As a result, nextRootInlineBoxCandidatePosition skips over this entire line and finds no line box after the one
1711         we had in the non-statically positioned element.
1712
1713         Let us consider the following concrete example in which a position: static div is followed by another div, and each
1714         div contains text nodes "hello" and "world" respectively:
1715         - div position: static (1)
1716             - "hello"
1717         - div (2)
1718             - "world"
1719         Suppose we're at the offset 0 of "world", and trying to move to the left. In this case, adjacentCharacterPosition is
1720         at offset 5 of "world". The next line box should be that of "world". However, because we invoke logicallyNextBox via
1721         wordBreakIteratorForMaxOffsetBoundary with the visible position at offset 0 of "world", it skips this line and return
1722         nullptr.
1723
1724         This patch addresses this test failure by fixing visualWordPosition by passing adjacentCharacterPosition (at offset 5
1725         of "hello") as the visible position to find the next text box so that nextRootInlineBoxCandidatePosition invoked in
1726         logicallyNextBox would not skip the line ("world") from which we started the traversal to find the next line box.
1727
1728         Tests: editing/selection/move-by-word-visually-inline-block-positioned-element.html
1729
1730         * editing/VisibleUnits.cpp:
1731         (WebCore::visualWordPosition):
1732
1733 2018-06-08  Brent Fulgham  <bfulgham@apple.com>
1734
1735         REGRESSION (r230930): Link drag image is very blurry
1736         https://bugs.webkit.org/show_bug.cgi?id=186435
1737         <rdar://problem/40797202>
1738
1739         Reviewed by Tim Horton.
1740
1741         Tell NSImage the proper display scale factor it needs when performing a 'lockFocus' by passing
1742         the correct scaling transform as an NSImageHintCTM.
1743
1744         I reviewed the other drag operations (selection, image, and attachment) and confirmed through
1745         manual testing that these operations already properly scale the images. It appears that links
1746         were the only place where we relied on NSImage to determine and use the relevant device scale
1747         factor.
1748
1749         * SourcesCocoa.txt: Add new WebKitNSImageExtras.mm file.
1750         * WebCore.xcodeproj/project.pbxproj: Update for new files.
1751         * platform/graphics/mac/WebKitNSImageExtras.h: Added.
1752         * platform/graphics/mac/WebKitNSImageExtras.mm: Added.
1753         (-[NSImage _web_lockFocusWithTransform:]): Helper method that takes a device scale factor, creates the
1754         relevant scaling NSAffineTransform and passes it to the internal NSImage 'lockFocusWithRect' as the
1755         NSImageHintCTM hint.
1756         * platform/mac/DragImageMac.mm:
1757         (WebCore::createDragImageForLink): Use the new helper function.
1758
1759 2018-06-08  Zalan Bujtas  <zalan@apple.com>
1760
1761         [LFC] Add vertical margin computation for inline, block-level, inline-block and floating replaced elements
1762         https://bugs.webkit.org/show_bug.cgi?id=186432
1763
1764         Reviewed by Antti Koivisto.
1765
1766         * layout/FormattingContext.h:
1767         * layout/FormattingContextGeometry.cpp:
1768         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1769         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Use the computed non-auto values when margin is not auto.
1770         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1771         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1772         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1773
1774 2018-06-07  Yusuke Suzuki  <utatane.tea@gmail.com>
1775
1776         [WTF] Add WorkerPool
1777         https://bugs.webkit.org/show_bug.cgi?id=174569
1778
1779         Reviewed by Carlos Garcia Campos.
1780
1781         We start using WorkerPool for NicosiaPaintingEngineThreaded instead of glib thread pool.
1782         This makes NicosiaPaintingEngineThreaded platform-independent and usable for WinCairo.
1783
1784         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
1785         (Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
1786         (Nicosia::PaintingEngineThreaded::~PaintingEngineThreaded):
1787         (Nicosia::PaintingEngineThreaded::paint):
1788         (Nicosia::s_threadFunc): Deleted.
1789         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
1790
1791 2018-06-08  Miguel Gomez  <magomez@igalia.com>
1792
1793         [GTK][WPE] Wrong result when calling ImageBufferCairo's getImageData()
1794         https://bugs.webkit.org/show_bug.cgi?id=186384
1795
1796         Reviewed by Michael Catanzaro.
1797
1798         Fix calculations so the result is the expected one.
1799
1800         * platform/graphics/cairo/ImageBufferCairo.cpp:
1801         (WebCore::getImageData):
1802
1803 2018-06-07  Fujii Hironori  <Hironori.Fujii@sony.com>
1804
1805         Add base class to get WeakPtrFactory member and avoid some boilerplate code
1806         https://bugs.webkit.org/show_bug.cgi?id=186407
1807         <rdar://problem/40922716>
1808
1809         Unreviewed WinCairo build fix
1810
1811         MediaPlayerPrivateMediaFoundation.cpp(1726): error C2039: 'makeWeakPtr': is not a member of 'WebCore::MediaPlayerPrivateMediaFoundation'
1812
1813         No new tests (No behavior change).
1814
1815         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1816         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
1817
1818 2018-06-07  Chris Dumez  <cdumez@apple.com>
1819
1820         Add base class to get WeakPtrFactory member and avoid some boilerplate code
1821         https://bugs.webkit.org/show_bug.cgi?id=186407
1822
1823         Reviewed by Brent Fulgham.
1824
1825         Add CanMakeWeakPtr base class to get WeakPtrFactory member and its getter, in
1826         order to avoid some boilerplate code in every class needing a WeakPtrFactory.
1827         This also gets rid of old-style createWeakPtr() methods in favor of the newer
1828         makeWeakPtr().
1829
1830         * Modules/credentialmanagement/CredentialsMessenger.h:
1831         * Modules/credentialmanagement/NavigatorCredentials.cpp:
1832         (WebCore::NavigatorCredentials::credentials):
1833         * Modules/encryptedmedia/CDM.cpp:
1834         (WebCore::CDM::doSupportedConfigurationStep):
1835         (WebCore::CDM::getConsentStatus):
1836         * Modules/encryptedmedia/CDM.h:
1837         * Modules/encryptedmedia/MediaKeySession.cpp:
1838         (WebCore::MediaKeySession::generateRequest):
1839         (WebCore::MediaKeySession::load):
1840         (WebCore::MediaKeySession::update):
1841         (WebCore::MediaKeySession::close):
1842         (WebCore::MediaKeySession::remove):
1843         * Modules/encryptedmedia/MediaKeySession.h:
1844         * Modules/encryptedmedia/MediaKeys.cpp:
1845         (WebCore::MediaKeys::createSession):
1846         * Modules/encryptedmedia/MediaKeys.h:
1847         * Modules/gamepad/GamepadManager.cpp:
1848         (WebCore::GamepadManager::platformGamepadDisconnected):
1849         (WebCore::GamepadManager::makeGamepadVisible):
1850         * Modules/mediastream/MediaDevices.cpp:
1851         (WebCore::MediaDevices::MediaDevices):
1852         * Modules/mediastream/MediaDevices.h:
1853         * Modules/mediastream/MediaStreamTrack.cpp:
1854         (WebCore::MediaStreamTrack::applyConstraints):
1855         * Modules/mediastream/MediaStreamTrack.h:
1856         * Modules/webauthn/cocoa/LocalAuthenticator.h:
1857         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
1858         (WebCore::LocalAuthenticator::makeCredential):
1859         * accessibility/AccessibilityRenderObject.h:
1860         * accessibility/AccessibilitySVGRoot.cpp:
1861         (WebCore::AccessibilitySVGRoot::setParent):
1862         * crypto/SubtleCrypto.cpp:
1863         (WebCore::SubtleCrypto::encrypt):
1864         (WebCore::SubtleCrypto::decrypt):
1865         (WebCore::SubtleCrypto::sign):
1866         (WebCore::SubtleCrypto::verify):
1867         (WebCore::SubtleCrypto::digest):
1868         (WebCore::SubtleCrypto::generateKey):
1869         (WebCore::SubtleCrypto::deriveKey):
1870         (WebCore::SubtleCrypto::deriveBits):
1871         (WebCore::SubtleCrypto::importKey):
1872         (WebCore::SubtleCrypto::exportKey):
1873         (WebCore::SubtleCrypto::wrapKey):
1874         (WebCore::SubtleCrypto::unwrapKey):
1875         * crypto/SubtleCrypto.h:
1876         * css/CSSFontFace.cpp:
1877         (WebCore::CSSFontFace::CSSFontFace):
1878         (WebCore::CSSFontFace::wrapper):
1879         (WebCore::CSSFontFace::setWrapper):
1880         * css/DeprecatedCSSOMValue.h:
1881         * css/FontFace.cpp:
1882         * css/FontFace.h:
1883         * css/MediaQueryEvaluator.cpp:
1884         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
1885         * css/StyleSheetContents.h:
1886         * css/parser/CSSDeferredParser.cpp:
1887         (WebCore::CSSDeferredParser::CSSDeferredParser):
1888         * dom/DataTransferItemList.cpp:
1889         (WebCore::DataTransferItemList::add):
1890         (WebCore::DataTransferItemList::ensureItems const):
1891         (WebCore::DataTransferItemList::didSetStringData):
1892         * dom/DataTransferItemList.h:
1893         * dom/Document.cpp:
1894         (WebCore::Document::postTask):
1895         (WebCore::Document::hasStorageAccess):
1896         (WebCore::Document::requestStorageAccess):
1897         * dom/Document.h:
1898         (WebCore::Document::setContextDocument):
1899         * dom/MessagePort.h:
1900         * html/HTMLImageElement.cpp:
1901         (WebCore::HTMLImageElement::setPictureElement):
1902         * html/HTMLInputElement.h:
1903         * html/HTMLMediaElement.cpp:
1904         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
1905         * html/HTMLMediaElement.h:
1906         * html/HTMLPictureElement.h:
1907         * html/parser/HTMLResourcePreloader.h:
1908         * layout/layouttree/LayoutBox.h:
1909         (WebCore::Layout::Box::style const):
1910         * loader/FormState.h:
1911         * loader/LinkLoader.cpp:
1912         (WebCore::LinkLoader::preconnectIfNeeded):
1913         * loader/LinkLoader.h:
1914         * loader/LinkPreloadResourceClients.cpp:
1915         (WebCore::LinkPreloadResourceClient::LinkPreloadResourceClient):
1916         * loader/MediaResourceLoader.cpp:
1917         (WebCore::MediaResourceLoader::MediaResourceLoader):
1918         * loader/MediaResourceLoader.h:
1919         * page/DOMWindow.h:
1920         * page/EventHandler.cpp:
1921         (WebCore::widgetForElement):
1922         (WebCore::EventHandler::updateLastScrollbarUnderMouse):
1923         * platform/GenericTaskQueue.cpp:
1924         (WebCore::TaskDispatcher<Timer>::postTask):
1925         * platform/GenericTaskQueue.h:
1926         (WebCore::GenericTaskQueue::enqueueTask):
1927         (WebCore::GenericTaskQueue::cancelAllTasks):
1928         * platform/ScrollView.h:
1929         * platform/ScrollableArea.h:
1930         * platform/Scrollbar.h:
1931         * platform/Widget.cpp:
1932         (WebCore::Widget::setParent):
1933         * platform/Widget.h:
1934         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
1935         (WebCore::AudioFileReader::decodeAudioForBusCreation):
1936         * platform/audio/mac/AudioHardwareListenerMac.cpp:
1937         (WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac):
1938         * platform/audio/mac/AudioHardwareListenerMac.h:
1939         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1940         (WebCore::CDMInstanceClearKey::requestLicense):
1941         (WebCore::CDMInstanceClearKey::updateLicense):
1942         (WebCore::CDMInstanceClearKey::loadSession):
1943         (WebCore::CDMInstanceClearKey::closeSession):
1944         (WebCore::CDMInstanceClearKey::removeSessionData):
1945         * platform/encryptedmedia/clearkey/CDMClearKey.h:
1946         * platform/graphics/FontCascade.h:
1947         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1948         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
1949         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
1950         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1951         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
1952         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1953         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
1954         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
1955         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1956         (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
1957         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
1958         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1959         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1960         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
1961         (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
1962         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
1963         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
1964         (WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
1965         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
1966         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1967         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1968         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1969         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
1970         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask):
1971         * platform/graphics/cv/TextureCacheCV.h:
1972         * platform/graphics/cv/TextureCacheCV.mm:
1973         (WebCore::TextureCacheCV::textureFromImage):
1974         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1975         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
1976         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
1977         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1978         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1979         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1980         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1981         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
1982         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1983         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1984         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
1985         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
1986         (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
1987         * platform/graphics/mac/DisplayRefreshMonitorMac.h:
1988         * platform/graphics/texmap/TextureMapperLayer.cpp:
1989         (WebCore::TextureMapperLayer::setMaskLayer):
1990         (WebCore::TextureMapperLayer::setReplicaLayer):
1991         * platform/graphics/texmap/TextureMapperLayer.h:
1992         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1993         (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
1994         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
1995         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
1996         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1997         * platform/ios/RemoteCommandListenerIOS.h:
1998         * platform/ios/RemoteCommandListenerIOS.mm:
1999         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
2000         * platform/mac/RemoteCommandListenerMac.h:
2001         * platform/mac/RemoteCommandListenerMac.mm:
2002         (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac):
2003         * platform/mediastream/MediaStreamPrivate.cpp:
2004         (WebCore::MediaStreamPrivate::scheduleDeferredTask):
2005         * platform/mediastream/MediaStreamPrivate.h:
2006         * platform/mediastream/RealtimeMediaSource.cpp:
2007         (WebCore::RealtimeMediaSource::scheduleDeferredTask):
2008         * platform/mediastream/RealtimeMediaSource.h:
2009         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
2010         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2011         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
2012         * platform/vr/VRPlatformDisplay.h:
2013         * platform/vr/openvr/VRPlatformManagerOpenVR.cpp:
2014         (WebCore::VRPlatformManagerOpenVR::getVRDisplays):
2015         * rendering/FloatingObjects.h:
2016         (WebCore::FloatingObject::setOriginatingLine):
2017         * rendering/RenderObject.h:
2018         * rendering/RootInlineBox.cpp:
2019         * rendering/RootInlineBox.h:
2020         * svg/SVGPathElement.h:
2021         * svg/SVGPathSegWithContext.h:
2022         (WebCore::SVGPathSegWithContext::SVGPathSegWithContext):
2023         (WebCore::SVGPathSegWithContext::setContextAndRole):
2024         * svg/SVGTransformList.h:
2025         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2026         (WebCore::SVGAnimatedListPropertyTearOff::baseVal):
2027         (WebCore::SVGAnimatedListPropertyTearOff::animVal):
2028         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
2029         * svg/properties/SVGAnimatedPropertyTearOff.h:
2030         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
2031         * svg/properties/SVGListProperty.h:
2032         (WebCore::SVGListProperty::initializeValuesAndWrappers):
2033         (WebCore::SVGListProperty::getItemValuesAndWrappers):
2034         (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
2035         (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
2036         (WebCore::SVGListProperty::appendItemValuesAndWrappers):
2037         * svg/properties/SVGMatrixTearOff.h:
2038         * svg/properties/SVGPropertyTearOff.h:
2039         * testing/MockCDMFactory.cpp:
2040         (WebCore::MockCDMFactory::createCDM):
2041         (WebCore::MockCDM::createInstance):
2042         * testing/MockCDMFactory.h:
2043         * workers/service/ExtendableEvent.h:
2044         * workers/service/FetchEvent.cpp:
2045         (WebCore::FetchEvent::respondWith):
2046         * workers/service/server/SWServer.h:
2047         * xml/DOMParser.cpp:
2048         (WebCore::DOMParser::DOMParser):
2049
2050 2018-06-07  Chris Dumez  <cdumez@apple.com>
2051
2052         PopStateEvent should not be cancelable by default
2053         https://bugs.webkit.org/show_bug.cgi?id=186420
2054
2055         Reviewed by Darin Adler.
2056
2057         PopStateEvent should not be cancelable by default:
2058         - https://github.com/web-platform-tests/wpt/pull/11355
2059         - https://html.spec.whatwg.org/#history-traversal
2060
2061         All other browsers agree with the specification.
2062
2063         No new tests, updated existing tests.
2064
2065         * dom/PopStateEvent.cpp:
2066         (WebCore::PopStateEvent::PopStateEvent):
2067
2068 2018-06-07  Simon Fraser  <simon.fraser@apple.com>
2069
2070         Remove a log that was left in by mistake.
2071
2072         * loader/cache/MemoryCache.cpp:
2073         (WebCore::MemoryCache::pruneLiveResourcesToSize):
2074
2075 2018-06-07  Antoine Quint  <graouts@apple.com>
2076
2077         [ASan / StressGC] DumpRenderTree crashed in com.apple.WebCore: WebCore::EventTarget::ref + 16
2078         https://bugs.webkit.org/show_bug.cgi?id=186207
2079         <rdar://problem/40568747>
2080
2081         Reviewed by Dean Jackson.
2082
2083         Ensure that we clear the DOM event queue for declarative animations once an animation is cleared for
2084         an element since the element can be deleted before events get dispatched asynchronouly for this animation.
2085
2086         We also only call AnimationTimeline::removeAnimationsForElement() from RenderTreeUpdater::tearDownRenderers()
2087         in the case where we're tearing down the whole document as otherwise this would yield early clearing of the event
2088         queue in the case where an element would get a "display: none" style.
2089
2090         * animation/AnimationTimeline.cpp:
2091         (WebCore::AnimationTimeline::removeAnimationsForElement):
2092         * animation/DeclarativeAnimation.cpp:
2093         (WebCore::DeclarativeAnimation::~DeclarativeAnimation):
2094         (WebCore::DeclarativeAnimation::prepareAnimationForRemoval):
2095         * animation/DeclarativeAnimation.h:
2096         * animation/WebAnimation.cpp:
2097         (WebCore::WebAnimation::prepareAnimationForRemoval):
2098         * animation/WebAnimation.h:
2099         * rendering/updating/RenderTreeUpdater.cpp:
2100         (WebCore::RenderTreeUpdater::tearDownRenderers):
2101
2102 2018-06-07  Don Olmstead  <don.olmstead@sony.com>
2103
2104         [CoordGraphics] Fix compilation errors around USE(COORDINATED_GRAPHICS)
2105         https://bugs.webkit.org/show_bug.cgi?id=186374
2106
2107         Reviewed by Žan Doberšek.
2108
2109         No new tests. No change in behavior.
2110
2111         * page/scrolling/AsyncScrollingCoordinator.cpp:
2112         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2113         (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
2114         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
2115         * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp:
2116         * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp:
2117         * platform/PlatformWheelEvent.h:
2118         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
2119         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
2120         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2121         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2122
2123 2018-06-07  Thibault Saunier  <tsaunier@igalia.com> and Alejandro G. Castro  <alex@igalia.com>
2124
2125         [GTK][WPE] Start implementing MediaStream API
2126         https://bugs.webkit.org/show_bug.cgi?id=185787
2127
2128         Reviewed by Philippe Normand.
2129
2130         We are adding all the required classes to make the
2131         MediaStream API work, that means our own RealtimeMediaSourceCenterLibWebRTC
2132         for the platform, the GStreamerCaptureDeviceManager, the audio/video capturers
2133         and their respective audio/video sources as well as a dedicated GStreamer Source
2134         that adds support for using MediaStream stream inside playbin3.
2135         We are using the GstDeviceMonitor to list devices on the devices.
2136
2137         Enable mediastream tests.
2138
2139         * platform/GStreamer.cmake: Added the new files to the compilation.
2140         * platform/audio/AudioStreamDescription.h: Added new GStreamer type.
2141         * platform/audio/PlatformAudioData.h: Added new GStreamer type for
2142         the GStreamerAudioData class.
2143         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2144         (WebCore::simpleBusMessageCallback): This function and the next
2145         one help us to connect a monitoring callback to a pipeline for
2146         debugging.
2147         (WebCore::connectSimpleBusMessageCallback): Ditto.
2148         * platform/graphics/gstreamer/GStreamerCommon.h: Ditto
2149         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2150         (WebCore::MediaPlayerPrivateGStreamer::load): Make use of the loadFull() method.
2151         (WebCore::MediaPlayerPrivateGStreamer::loadFull): Very similar to load()
2152         but allows specifying what pipeline type to use (null to let the function determine
2153         which one should be used). This is required as we force to always use playbin3 for the
2154         mediastream source as it relies on the GstStream API.
2155         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): Style fix.
2156         (WebCore::MediaPlayerPrivateGStreamer::naturalSize const): Added, use MediaStream specific information if available.
2157         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Some style fixes.
2158         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Enhance dotfiles names.
2159         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): Minor formatting fix.
2160         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup): Set MediaStream on WebKitMediaStreamSource when setting it up.
2161         (WebCore::MediaPlayerPrivateGStreamer::supportsType): Advertise that we support MediaStream if support is built.
2162         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Make sure playbin3 is forced when loading a MediaStream.
2163         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add a reference to the MediaStream object and declare loadFull and naturalSize override.
2164         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2165         (WebCore::registerWebKitGStreamerElements): Register the new MediaStreamSrc element.
2166         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
2167         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer): Make sure that MediaStream MAIN tracks are selected by default. We have no way to do it in MediaStreamSrc now as the GstStreamCollection is recreated by parsebin.
2168         * platform/mediastream/RealtimeMediaSource.h: Make CaptureFailed a virtual method as in our mocks we require need to make
2169         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2170         (WebCore::RealtimeMediaSourceCenter::singleton): Remove the code
2171         used for compilation for the platform when we do not have a
2172         RealtimeMediaSourceCenterLibWebRTC. Now we return the proper class
2173         for the platform.
2174         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
2175         Added class representing the RealtimeMediaSource for the Audio
2176         with GStreamer.
2177         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
2178         Ditto.
2179         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: Added
2180         this class that represents the GStreamer pipeline that captures
2181         audio from the system devices, it inherits from GStreamerCapturer.
2182         * platform/mediastream/gstreamer/GStreamerAudioCapturer.h: Dito.
2183         * platform/mediastream/gstreamer/GStreamerAudioData.h: Added this
2184         class implementing PlatformAudioData for the GStreamer platform,
2185         used to pass the samples information.
2186         * platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h:
2187         Added this class implementing AudioStreamDescription to export the
2188         information about the audio stream to libwebrtc.
2189         * platform/mediastream/gstreamer/GStreamerCaptureDevice.h: Added
2190         this base class for the audio and video capturing devices, it
2191         implements general WebKit CaptureDevice class.
2192         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
2193         Added this class that implements the system monitor to get the
2194         list of available devices in the system. It uses GstDeviceMonitor
2195         to handle the operation. It uses two singleton device managers one
2196         for audio and another one for video, as required by the
2197         RealtimeMediaSourceCenter design.
2198         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: Ditto.
2199         * platform/mediastream/gstreamer/GStreamerCapturer.cpp: Added this
2200         base class representing how GStreamer captures the media from the
2201         input devices in the system. Two classes inherit from this one to
2202         capture audio and video. It setups the GStreamer pipeline and adds
2203         functions to control it.
2204         * platform/mediastream/gstreamer/GStreamerCapturer.h: Ditto.
2205         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Added.
2206         Implements a subclass of GstBin as a source element that will contain several
2207         GstAppSrc, basically one per MediaStreamTrackPrivate of the MediaStreamPrivate
2208         passed in parameter. It adds Observers on the MediaStreamTracks and
2209         pushes the data to the sources as required. The element implements the GstURIHandler
2210         interface so it can be used in playbin. The MediaPlayerPrivateGStreamer is responsible
2211         for passing the MediaStreamPrivate object to the source when required.
2212         (WebCore::webkitMediaStreamSrcPadProbeCb): Event probe that fixes stream_start events (setting the ID etc)
2213         and finally add src pads to the pipeline.
2214         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.h: Ditto.
2215         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
2216         Added this RealtimeMediaSource representing the source of the
2217         video data for the GStreamer platform. It handles the settings and
2218         capabilities of the source and creates the capturer used to
2219         control the operation of the stream.
2220         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: Ditto.
2221         * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: Added
2222         this class that inherits from the GStreamerCapturer and controls
2223         the GStreamer pipelines of the video streams of the system.
2224         * platform/mediastream/gstreamer/GStreamerVideoCapturer.h: Ditto.
2225         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp: Added. Implementation of a Mock capturer for audio stream.
2226         Subclasses GStreamerAudioCapturer and wraps a MockRealtimeAudioSource so that the behaviour is the same a MockRealtimeAudioSource
2227         but still the GStreamer implementation code paths are tested.
2228         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h: Ditto.
2229         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp: Added. Implementation of a Mock capturer for video stream.
2230         Subclasses GStreamerVideoCapturer and wraps a MockRealtimeVideoSource so that the behaviour is the same a MockRealtimeVideoSource
2231         but still the GStreamer implementation code paths are tested.
2232         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h: Ditto.
2233         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
2234         Added this class that implements the key RealtimeMediaSourceCenter
2235         functions to configure the base class for the platform, using the
2236         other GStreamer classes.
2237         * platform/mock/MockRealtimeAudioSource.cpp: Do not build ::create if GStreamer implementation is built
2238         * platform/mock/MockRealtimeVideoSource.cpp: Do not build ::create if GStreamer implementation is built
2239
2240 2018-06-07  Brent Fulgham  <bfulgham@apple.com>
2241
2242         Handle Storage Access API calls in the absence of an attached frame
2243         https://bugs.webkit.org/show_bug.cgi?id=186373
2244         <rdar://problem/40028265>
2245
2246         Reviewed by Daniel Bates.
2247
2248         Tests: http/tests/storageAccess/has-storage-access-crash.html
2249                http/tests/storageAccess/request-storage-access-crash.html
2250
2251         The new frame-specific storage access checks were done without confirming a
2252         frame was present, although the frame state was validated in other parts of
2253         the same method.
2254         
2255         This patch checks for a non-null frame before making frame-specific calls.
2256
2257         * dom/Document.cpp:
2258         (WebCore::Document::hasStorageAccess):
2259         (WebCore::Document::requestStorageAccess):
2260
2261 2018-06-07  Zalan Bujtas  <zalan@apple.com>
2262
2263         [LFC] Merge height and vertical margin computation
2264         https://bugs.webkit.org/show_bug.cgi?id=186394
2265
2266         Reviewed by Antti Koivisto.
2267
2268         To match the spec (and the width/horizontal margin computation). -currently with default values.
2269
2270         * layout/FormattingContext.cpp:
2271         (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
2272         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
2273         (WebCore::Layout::FormattingContext::computeFloatingHeight const): Deleted.
2274         * layout/FormattingContext.h:
2275         * layout/FormattingContextGeometry.cpp:
2276         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeightAndMargin):
2277         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeightAndMargin):
2278         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
2279         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
2280         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeightAndMargin):
2281         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
2282         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2283         (WebCore::Layout::outOfFlowNonReplacedHeight): Deleted.
2284         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight): Deleted.
2285         (WebCore::Layout::floatingNonReplacedHeight): Deleted.
2286         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight): Deleted.
2287         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeight): Deleted.
2288         (WebCore::Layout::FormattingContext::Geometry::floatingHeight): Deleted.
2289         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight): Deleted.
2290         * layout/blockformatting/BlockFormattingContext.cpp:
2291         (WebCore::Layout::BlockFormattingContext::layout const):
2292         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2293         (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
2294         (WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted.
2295         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const): Deleted.
2296         * layout/blockformatting/BlockFormattingContext.h:
2297         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2298         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2299         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2300         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): Deleted.
2301         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeight): Deleted.
2302
2303 2018-06-07  Antti Koivisto  <antti@apple.com>
2304
2305         Don't start service worker fetch when there is substitute data
2306         https://bugs.webkit.org/show_bug.cgi?id=186349
2307         <rdar://problem/38881568>
2308
2309         Reviewed by Youenn Fablet.
2310
2311         Loading content via WKWebView.loadData may also end up starting a main resource service worker fetch.
2312         This breaks DocumentWriter assumptions.
2313
2314         * loader/DocumentLoader.cpp:
2315         (WebCore::DocumentLoader::tryLoadingRequestFromApplicationCache):
2316         (WebCore::DocumentLoader::tryLoadingSubstituteData):
2317
2318         Factor substitute resource loading out from tryLoadingRequestFromApplicationCache.
2319
2320         (WebCore::DocumentLoader::startLoadingMainResource):
2321
2322         If we have substitute data already (typically from WKWebView.loadData), allow service worker registration
2323         but load the main resource using the substitute data.
2324
2325         (WebCore::DocumentLoader::handleSubstituteDataLoadSoon): Deleted.
2326
2327         Merge to tryLoadingSubstituteData.
2328
2329         * loader/DocumentLoader.h:
2330
2331 2018-06-07  Thibault Saunier  <tsaunier@igalia.com>
2332
2333         [GStreamer] Fix the way GstStreamCollection is handled
2334         https://bugs.webkit.org/show_bug.cgi?id=184588
2335
2336         Reviewed by Philippe Normand.
2337
2338         The stream collection message replaces the collection of stream previously
2339         advertised, this means that we should rebuild our set of Track from scratch
2340         and not update previously exposed tracks.
2341
2342         In the end, this simplifies the code as we do not care about what
2343         tracks existed previously, we just need to expose what GStreamer tells
2344         us, deleting any previous state.
2345
2346         Handle the STREAM_COLLECTION message from the sync handler so that tracks
2347         are updated before we mark the pipeline as READY for the live case (everything
2348         happen synchronously with the call to the `load()` method in that case),
2349         the update still always happens on the main thread.
2350
2351         No new tests is added as this is mostly refactoring, it is already tested and it
2352         will fix MediaStream tests that are currently disabled as the support is being
2353         implemented in #185787.
2354
2355         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2356         (WebCore::MediaPlayerPrivateGStreamer::clearTracks): Removes all tracks.
2357         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Updates configured tracks from the new GstStreamColection track.
2358         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Stop handling GST_STREAM_COLLECTION event.
2359         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Handle stream collection event synchronously.
2360         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add handleSyncMessage
2361
2362 2018-06-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2363
2364         Remove unused image encoders
2365         https://bugs.webkit.org/show_bug.cgi?id=186365
2366
2367         Reviewed by Carlos Garcia Campos.
2368
2369         * platform/image-encoders/JPEGImageEncoder.cpp: Removed.
2370         * platform/image-encoders/JPEGImageEncoder.h: Removed.
2371         * platform/image-encoders/PNGImageEncoder.cpp: Removed.
2372         * platform/image-encoders/PNGImageEncoder.h: Removed.
2373
2374 2018-06-06  Youenn Fablet  <youenn@apple.com>
2375
2376         HTTP Header values validation is too strict
2377         https://bugs.webkit.org/show_bug.cgi?id=167112
2378
2379         Reviewed by Alex Christensen.
2380
2381         Moving header values and names from DOMString to ByteString as per spec.
2382         Updating WebCore::isValidHTTPHeaderValue as per https://fetch.spec.whatwg.org/#terminology-headers.
2383
2384         Covered by rebased and updated tests.
2385         Updated test is now also passing in other browsers.
2386
2387         * platform/network/HTTPParsers.cpp:
2388         (WebCore::isValidHTTPHeaderValue):
2389
2390 2018-06-06  Youenn Fablet  <youenn@apple.com>
2391
2392         Add Accept-Encoding: identity to Range requests
2393         https://bugs.webkit.org/show_bug.cgi?id=186335
2394         <rdar://problem/40837190>
2395
2396         Reviewed by Eric Carlson.
2397
2398         Tests: imported/w3c/web-platform-tests/fetch/range/general.any.html
2399                imported/w3c/web-platform-tests/fetch/range/general.any.worker.html
2400
2401         * loader/cache/CachedResourceLoader.cpp:
2402         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
2403         * loader/cache/CachedResourceRequest.cpp:
2404         (WebCore::CachedResourceRequest::updateAcceptEncodingHeader):
2405         * loader/cache/CachedResourceRequest.h:
2406
2407 2018-06-06  Per Arne Vollan  <pvollan@apple.com>
2408
2409         Display links are sometimes not notifying WebCore when fired.
2410         https://bugs.webkit.org/show_bug.cgi?id=186367
2411         <rdar://problem/40439109>
2412
2413         Reviewed by Brent Fulgham.
2414
2415         When the WebContent process is receiving an IPC message notifying about a screen update, all display refresh monitors
2416         are notified by the manager in DisplayRefreshMonitorManager::displayWasUpdated(). The manager checks that the monitor
2417         is scheduled before notifying. This is a problem, since the scheduled flag is always set to false in the
2418         DisplayRefreshMonitor::displayDidRefresh() method, when the monitor is first notified about a screen update. This can
2419         lead to display links running without notifying the monitors, causing extra CPU usage. It can also prevent them from
2420         being deleted, since the monitors are not notified. Instead, we can check that the display refresh monitor is active
2421         before notifying it. This matches the original display link implementation used when the WebContent process has
2422         WindowServer access, where the monitors are always notified.
2423
2424         No new tests, since I have not been able to reproduce this in a test case yet.
2425
2426         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2427         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
2428
2429 2018-06-06  Antoine Quint  <graouts@apple.com>
2430
2431         Rename color-filter to -apple-color-filter and do not expose it to Web content
2432         https://bugs.webkit.org/show_bug.cgi?id=186306
2433         <rdar://problem/39874167>
2434
2435         Reviewed by Simon Fraser.
2436
2437         Rename the color-filter CSS property to -apple-color-filter.
2438
2439         * animation/KeyframeEffectReadOnly.cpp:
2440         (WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
2441         * css/CSSComputedStyleDeclaration.cpp:
2442         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2443         * css/CSSGradientValue.cpp:
2444         (WebCore::CSSGradientValue::image):
2445         (WebCore::CSSGradientValue::computeStops):
2446         (WebCore::CSSGradientValue::knownToBeOpaque const):
2447         * css/CSSProperties.json:
2448         * css/parser/CSSPropertyParser.cpp:
2449         (WebCore::CSSPropertyParser::parseSingleValue):
2450         * page/animation/CSSPropertyAnimation.cpp:
2451         (WebCore::blendFunc):
2452         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2453         * page/animation/ImplicitAnimation.cpp:
2454         (WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
2455         * page/animation/KeyframeAnimation.cpp:
2456         (WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
2457         * rendering/InlineTextBox.cpp:
2458         (WebCore::InlineTextBox::paintMarkedTextForeground):
2459         (WebCore::InlineTextBox::paintMarkedTextDecoration):
2460         * rendering/style/RenderStyle.cpp:
2461         (WebCore::RenderStyle::changeRequiresRepaint const):
2462         (WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
2463         (WebCore::RenderStyle::colorByApplyingColorFilter const):
2464         * rendering/style/RenderStyle.h:
2465         (WebCore::RenderStyle::mutableAppleColorFilter):
2466         (WebCore::RenderStyle::appleColorFilter const):
2467         (WebCore::RenderStyle::hasAppleColorFilter const):
2468         (WebCore::RenderStyle::setAppleColorFilter):
2469         (WebCore::RenderStyle::initialAppleColorFilter):
2470         (WebCore::RenderStyle::mutableColorFilter): Deleted.
2471         (WebCore::RenderStyle::colorFilter const): Deleted.
2472         (WebCore::RenderStyle::hasColorFilter const): Deleted.
2473         (WebCore::RenderStyle::setColorFilter): Deleted.
2474         (WebCore::RenderStyle::initialColorFilter): Deleted.
2475         * rendering/style/StyleRareInheritedData.cpp:
2476         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2477         (WebCore::StyleRareInheritedData::operator== const):
2478         (WebCore::StyleRareInheritedData::hasColorFilters const):
2479         * rendering/style/StyleRareInheritedData.h:
2480
2481 2018-06-06  Jer Noble  <jer.noble@apple.com>
2482
2483         REGRESSION (r231817?): Layout Test media/track/track-delete-during-setup.html is a flaky timeout
2484         https://bugs.webkit.org/show_bug.cgi?id=185889
2485         <rdar://problem/40583180>
2486
2487         Reviewed by Eric Carlson.
2488
2489         Explicitly update the network and ready states when detaching the AVPlayerItem
2490         from the AVPlayer.
2491
2492         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2493         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
2494
2495 2018-06-06  Antoine Quint  <graouts@apple.com>
2496
2497         Use the default label for snapshotted plug-ins if no mime-type is available
2498         https://bugs.webkit.org/show_bug.cgi?id=186348
2499
2500         Reviewed by Jon Lee.
2501
2502         In case the mime-type is not available, use the default labels otherwise we'd crash trying to look up the empty string in the HashMap.
2503
2504         * html/HTMLPlugInImageElement.cpp:
2505         (WebCore::titleText):
2506         (WebCore::subtitleText):
2507
2508 2018-06-06  Timothy Hatcher  <timothy@apple.com>
2509
2510         Wrong NSVisualEffectMaterial used for exit full screen overlay in dark mode.
2511
2512         https://bugs.webkit.org/show_bug.cgi?id=186350
2513         rdar://problem/39135535
2514
2515         Reviewed by Anders Carlsson.
2516
2517         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
2518         (-[WebCoreFullScreenPlaceholderView initWithFrame:]):
2519         Use the NSVisualEffectMaterialFullScreenUI on macOS 10.14 and don't
2520         set an explicit NSAppearance.
2521
2522 2018-06-06  Jer Noble  <jer.noble@apple.com>
2523
2524         Regions outside of the fullscreen window are exposed during zoom operations
2525         https://bugs.webkit.org/show_bug.cgi?id=186330
2526         <rdar://problem/34698009>
2527
2528         Reviewed by Simon Fraser.
2529
2530         Test: fullscreen/full-screen-layer-dump.html
2531
2532         Introduce the concept of "requiresBackgroundLayer" to RenderLayerBacking, for use by
2533         RenderFullScreen. Previously, the backgroundLayer in RenderLayerBacking was only used
2534         by the root renderer with fixed backgrounds. Give the RenderFullScreen a background layer
2535         that's approximately 3x as tall and wide as the renderer itself, so nothing is exposed
2536         during pinch operations.
2537
2538         * rendering/RenderLayerBacking.cpp:
2539         (WebCore::RenderLayerBacking::RenderLayerBacking):
2540         (WebCore::RenderLayerBacking::updateConfiguration):
2541         (WebCore::RenderLayerBacking::updateGeometry):
2542         (WebCore::RenderLayerBacking::updateDrawsContent):
2543         (WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
2544         (WebCore::RenderLayerBacking::updateBackgroundLayer):
2545         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
2546         (WebCore::RenderLayerBacking::paintIntoLayer):
2547         * rendering/RenderLayerBacking.h:
2548
2549 2018-06-06  Jer Noble  <jer.noble@apple.com>
2550
2551         Set the AVAssetResourceLoaderRequest's contentType to AVStreamingKeyDeliveryContentKeyType in the case of a FPS key request.
2552         https://bugs.webkit.org/show_bug.cgi?id=186328
2553         <rdar://problem/40829228>
2554
2555         Reviewed by Eric Carlson.
2556
2557         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2558         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
2559
2560 2018-06-06  Zalan Bujtas  <zalan@apple.com>
2561
2562         [LFC] Add margin computation for floating, replaced elements.
2563         https://bugs.webkit.org/show_bug.cgi?id=186337
2564
2565         Reviewed by Antti Koivisto.
2566
2567         If 'margin-left' or 'margin-right' are computed as 'auto', their used value is '0'.
2568
2569         * layout/FormattingContext.h:
2570         * layout/FormattingContextGeometry.cpp:
2571         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2572         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2573
2574 2018-06-06  Zalan Bujtas  <zalan@apple.com>
2575
2576         [LFC] Add margin computation for floating, no-replaced elements.
2577         https://bugs.webkit.org/show_bug.cgi?id=186334
2578
2579         Reviewed by Antti Koivisto.
2580
2581         If 'margin-left', or 'margin-right' are computed as 'auto', their used value is '0'.
2582
2583         * layout/FormattingContextGeometry.cpp:
2584         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2585
2586 2018-06-06  Antti Koivisto  <antti@apple.com>
2587
2588         Use minimal coverage rect for tiled layers when under memory pressure
2589         https://bugs.webkit.org/show_bug.cgi?id=186185
2590         <rdar://problem/40713608>
2591
2592         Reviewed by Darin Adler.
2593
2594         We do this for the main content layer already.
2595
2596         * platform/graphics/ca/GraphicsLayerCA.cpp:
2597         (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect):
2598
2599 2018-06-05  Antoine Quint  <graouts@apple.com>
2600
2601         [Web Animations] Only expose CSSAnimation and CSSTransition if the WebAnimationsCSSIntegration runtime flag is enabled
2602         https://bugs.webkit.org/show_bug.cgi?id=186305
2603
2604         Reviewed by Dean Jackson.
2605
2606         * animation/CSSAnimation.idl:
2607         * animation/CSSTransition.idl:
2608
2609 2018-06-05  Per Arne Vollan  <pvollan@apple.com>
2610
2611         Move OpenGL display mask to screen data struct.
2612         https://bugs.webkit.org/show_bug.cgi?id=186198
2613         <rdar://problem/40724854>
2614
2615         Reviewed by Brent Fulgham.
2616
2617         Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
2618         it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
2619         resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
2620         display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
2621         the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
2622         window is available, the OpenGL display mask of the main display is used.
2623
2624         No new tests, since testing this requires two Web views in the same WebContent process, displayed on
2625         two different monitors.
2626
2627         * html/HTMLCanvasElement.cpp:
2628         (WebCore::HTMLCanvasElement::createImageBuffer const):
2629         * platform/PlatformScreen.h:
2630         * platform/ScreenProperties.h:
2631         (WebCore::ScreenProperties::encode const):
2632         (WebCore::ScreenProperties::decode):
2633         (WebCore::ScreenData::encode const):
2634         (WebCore::ScreenData::decode):
2635         * platform/graphics/GraphicsContext3D.h:
2636         * platform/graphics/ImageBuffer.cpp:
2637         (WebCore::ImageBuffer::create):
2638         * platform/graphics/ImageBuffer.h:
2639         * platform/graphics/cg/ImageBufferCG.cpp:
2640         (WebCore::ImageBuffer::createCompatibleBuffer):
2641         (WebCore::ImageBuffer::ImageBuffer):
2642         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2643         (WebCore::GraphicsContext3D::GraphicsContext3D):
2644         (WebCore::GraphicsContext3D::allowOfflineRenderers const):
2645         (WebCore::GraphicsContext3D::setOpenGLDisplayMask): Deleted.
2646         (WebCore::GraphicsContext3D::getOpenGLDisplayMask): Deleted.
2647         * platform/graphics/cocoa/IOSurface.h:
2648         * platform/graphics/cocoa/IOSurface.mm:
2649         (WebCore::IOSurface::ensurePlatformContext):
2650         * platform/mac/PlatformScreenMac.mm:
2651         (WebCore::screenProperties):
2652         (WebCore::collectScreenProperties):
2653         (WebCore::setScreenProperties):
2654         (WebCore::screenData):
2655         (WebCore::primaryOpenGLDisplayMask):
2656         (WebCore::displayMaskForDisplay):
2657         (WebCore::getScreenProperties):
2658         (WebCore::screenIsMonochrome):
2659         (WebCore::screenHasInvertedColors):
2660         (WebCore::screenDepth):
2661         (WebCore::screenDepthPerComponent):
2662         (WebCore::screenRectForDisplay):
2663         (WebCore::screenRect):
2664         (WebCore::screenAvailableRect):
2665         (WebCore::screenColorSpace):
2666         (WebCore::screenSupportsExtendedColor):
2667
2668 2018-06-05  Jer Noble  <jer.noble@apple.com>
2669
2670         REGRESSION (231817): Videos permanently blank out after switching out of a tab and back in
2671         https://bugs.webkit.org/show_bug.cgi?id=186326
2672         <rdar://problem/40778157>
2673
2674         Reviewed by Eric Carlson.
2675
2676         Check whether the element is visible in the viewport when the web view itself becomes visible, and if so, clear the m_elementIsHiddenUntilVisibleInViewport flag.
2677
2678         * html/MediaElementSession.cpp:
2679         (WebCore::MediaElementSession::visibilityChanged):
2680         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2681
2682 2018-06-05  Zalan Bujtas  <zalan@apple.com>
2683
2684         [LFC] Move inflow, replaced width and margin computation to a dedicated function.
2685         https://bugs.webkit.org/show_bug.cgi?id=186327
2686
2687         Reviewed by Sam Weinig.
2688
2689         I was searching for the function inFlowReplacedWidthAndMargin() and there was none.
2690
2691         * layout/blockformatting/BlockFormattingContext.h:
2692         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2693         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2694         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2695
2696 2018-06-05  Zalan Bujtas  <zalan@apple.com>
2697
2698         [LFC] Add missing margins for inflow, non replaced block and replaced inline elements
2699         https://bugs.webkit.org/show_bug.cgi?id=186332
2700
2701         Reviewed by Darin Adler.
2702
2703         * layout/FormattingContextGeometry.cpp:
2704         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2705         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2706         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2707
2708 2018-06-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2709
2710         [macOS] Spelling errors in the middle of an inserted paragraph are not displayed
2711         https://bugs.webkit.org/show_bug.cgi?id=185584
2712         <rdar://problem/38676081>
2713
2714         Reviewed by Ryosuke Niwa.
2715
2716         Currently when typing, we only consider the range of adjacent words when determining where to place spelling
2717         correction markers, even though we provide NSSpellChecker with the full context of the sentence (and get back
2718         results encompassing the full range). In macOS Mojave, NSSpellChecker may now return spell checking results that
2719         include correctly spelled words that are misused in the context of the sentence. This means that while typing a
2720         sentence, a different part of the sentence may gain or lose spelling markers as a result.
2721
2722         To support this, WebKit needs to mark or unmark spelling corrections in the full range of the sentence whenever
2723         a full word is typed (since the context of other words within the sentence may have changed, resulting in
2724         different platform spellchecking results). In markMisspellingsAfterTypingToWord, we expand the spell checking
2725         range past the adjacent words so that it encompasses the largest subrange of the full sentence that includes the
2726         start of the typed word, and does not include any position that is under an element with `spellcheck=false`.
2727
2728         This guarantees that we don't erroneously place spelling document markers under elements where spellchecking is
2729         disabled, while allowing for sentence retro corrections when spellchecking is enabled. However, this doesn't
2730         handle the case where an element with spellchecking disabled lies between a sentence retro correction range and
2731         the currently typed word. In the future, we could fix this by refactoring SpellCheckRequest to track a list of
2732         non-contiguous spelling correction ranges — see the FIXME in markMisspellingsAfterTypingToWord for more detail.
2733
2734         Covered by 2 new layout tests, as well as an existing spell-checking test that should now be passing.
2735
2736         Tests: editing/spelling/retro-correction-spelling-markers.html
2737                editing/spelling/spelling-markers-after-pasting-sentence.html
2738
2739         * editing/Editor.cpp:
2740         (WebCore::Editor::markMisspellingsAfterTypingToWord):
2741         * testing/Internals.h:
2742         * testing/Internals.idl:
2743
2744         Add an internal testing helper to determine whether retro sentence corrections are enabled.
2745
2746 2018-06-05  Darin Adler  <darin@apple.com>
2747
2748         [Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other smart pointers
2749         https://bugs.webkit.org/show_bug.cgi?id=186324
2750
2751         Reviewed by Anders Carlsson.
2752
2753         * platform/FileMonitor.h: Use OSObjectPtr instead of DispatchPtr.
2754         * platform/cocoa/FileMonitorCocoa.mm:
2755         (WebCore::FileMonitor::FileMonitor): Ditto.
2756
2757 2018-06-05  Ryan Haddad  <ryanhaddad@apple.com>
2758
2759         Unreviewed, fix the macOS build with recent SDKs.
2760
2761         * page/mac/ServicesOverlayController.mm:
2762         (WebCore::ServicesOverlayController::Highlight::paintContents):
2763
2764 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
2765
2766         Adjust compile and runtime flags to match shippable state of features
2767         https://bugs.webkit.org/show_bug.cgi?id=186319
2768         <rdar://problem/40352045>
2769
2770         Reviewed by Maciej Stachowiak, Jon Lee, and others.
2771
2772         * Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
2773         or ENABLE_INPUT_TYPE_COLOR_POPOVER.
2774
2775 2018-06-05  Timothy Hatcher  <timothy@apple.com>
2776
2777         Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query
2778
2779         https://bugs.webkit.org/show_bug.cgi?id=186323
2780         rdar://problem/38382252
2781
2782         Reviewed by Tim Horton.
2783
2784         * css/MediaFeatureNames.h:
2785         * css/MediaQueryEvaluator.cpp:
2786         (WebCore::prefersDarkInterfaceEvaluate):
2787         (WebCore::defaultAppearanceEvaluate): Deleted.
2788         * css/MediaQueryExpression.cpp:
2789         (WebCore::featureWithValidIdent):
2790         (WebCore::isFeatureValidWithoutValue):
2791         * platform/mac/LocalDefaultSystemAppearance.mm:
2792         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
2793
2794 2018-06-05  Darin Adler  <darin@apple.com>
2795
2796         [Cocoa] Improve some soft linking compatibility with ARC
2797         https://bugs.webkit.org/show_bug.cgi?id=186309
2798
2799         Reviewed by Anders Carlsson.
2800
2801         * platform/audio/ios/AudioSessionIOS.mm: Use SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER
2802         for NSString constants.
2803         * platform/audio/ios/MediaSessionManagerIOS.mm: Ditto.
2804         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: Ditto.
2805         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: Ditto.
2806         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: Ditto.
2807         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
2808         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState): Use __bridge for
2809         some bridging casts.
2810         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
2811         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): Ditto.
2812         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): Ditto.
2813         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Use
2814         SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER for NSString constants.
2815         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Ditto.
2816         * platform/mediastream/mac/AVCaptureDeviceManager.mm: Ditto.
2817         * platform/mediastream/mac/AVMediaCaptureSource.mm: Ditto.
2818         * platform/mediastream/mac/AVVideoCaptureSource.mm: Ditto.
2819
2820 2018-06-05  Youenn Fablet  <youenn@apple.com>
2821
2822         ServiceWorker registration should store any script fetched through importScripts
2823         https://bugs.webkit.org/show_bug.cgi?id=182444
2824         <rdar://problem/37164835>
2825
2826         Reviewed by Chris Dumez.
2827
2828         Covered by added test http/wpt/service-workers/persistent-importScripts.html.
2829
2830         Update importScripts implementation to look for/update the resource map in case of service worker scope.
2831         This resource map is stored persistently and sent when running the service worker.
2832
2833         Add support to persistent storage of this resource map.
2834         This requires updating the schema database.
2835         The schema version is bumped to 2 and we delete any data related to old registrations.
2836
2837         When updating the service worker, the resource map is currently flushed so that all scripts will be retrieved from the network.
2838
2839         Did some limited refactoring to put more loading handling in WorkerScriptLoader.
2840
2841         * workers/WorkerGlobalScope.cpp:
2842         (WebCore::WorkerGlobalScope::importScripts):
2843         * workers/WorkerScriptLoader.cpp:
2844         (WebCore::WorkerScriptLoader::loadSynchronously):
2845         (WebCore::WorkerScriptLoader::script):
2846         * workers/WorkerScriptLoader.h:
2847         * workers/service/ServiceWorkerContextData.cpp:
2848         (WebCore::ServiceWorkerContextData::isolatedCopy const):
2849         * workers/service/ServiceWorkerContextData.h:
2850         (WebCore::ServiceWorkerContextData::ImportedScript::isolatedCopy const):
2851         (WebCore::ServiceWorkerContextData::ImportedScript::encode const):
2852         (WebCore::ServiceWorkerContextData::ImportedScript::decode):
2853         (WebCore::ServiceWorkerContextData::encode const):
2854         (WebCore::ServiceWorkerContextData::decode):
2855         * workers/service/ServiceWorkerGlobalScope.cpp:
2856         (WebCore::ServiceWorkerGlobalScope::scriptResource const):
2857         (WebCore::ServiceWorkerGlobalScope::setScriptResource):
2858         * workers/service/ServiceWorkerGlobalScope.h:
2859         * workers/service/context/SWContextManager.h:
2860         * workers/service/server/RegistrationDatabase.cpp:
2861         (WebCore::v1RecordsTableSchema):
2862         (WebCore::RegistrationDatabase::doPushChanges):
2863         (WebCore::RegistrationDatabase::importRecords):
2864         * workers/service/server/SWServer.cpp:
2865         (WebCore::SWServer::addRegistrationFromStore):
2866         (WebCore::SWServer::updateWorker):
2867         (WebCore::SWServer::installContextData):
2868         * workers/service/server/SWServer.h:
2869         * workers/service/server/SWServerJobQueue.cpp:
2870         (WebCore::SWServerJobQueue::scriptFetchFinished):
2871         * workers/service/server/SWServerToContextConnection.cpp:
2872         (WebCore::SWServerToContextConnection::setScriptResource):
2873         * workers/service/server/SWServerToContextConnection.h:
2874         * workers/service/server/SWServerWorker.cpp:
2875         (WebCore::SWServerWorker::SWServerWorker):
2876         (WebCore::m_scriptResourceMap):
2877         (WebCore::SWServerWorker::contextData const):
2878         (WebCore::SWServerWorker::setScriptResource):
2879         * workers/service/server/SWServerWorker.h:
2880
2881 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
2882
2883         Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
2884         https://bugs.webkit.org/show_bug.cgi?id=186286
2885         <rdar://problem/40782992>
2886
2887         Reviewed by Dan Bernstein.
2888
2889         Use the WK_RELOCATABLE_FRAMEWORKS flag (which is always defined for non-production builds)
2890         to define ENABLE(EXPERIMENTAL_FEATURES) so that we do not need to manually
2891         change this flag when preparing for a production release.
2892
2893         * Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
2894         whether experimental features should be enabled, and use it to properly define the
2895         feature flag.
2896
2897 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
2898
2899         Unreviewed build fix after r232511.
2900         https://bugs.webkit.org/show_bug.cgi?id=186304
2901
2902         * platform/ios/WebItemProviderPasteboard.mm: Add missing include.
2903
2904 2018-06-05  Antoine Quint  <graouts@apple.com>
2905
2906         Fix the iOS build after r232496
2907         https://bugs.webkit.org/show_bug.cgi?id=186304
2908
2909         Reviewed by Brent Fulgham.
2910
2911         The changes in r232496 changed the InputType::element() signature from HTMLInputElement&
2912         to HTMLInputElement* and some call sites did not expect that.
2913
2914         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
2915         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
2916         (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
2917         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue):
2918         (WebCore::BaseChooserOnlyDateAndTimeInputType::didChooseValue):
2919         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
2920         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent):
2921         (WebCore::BaseChooserOnlyDateAndTimeInputType::accessKeyAction):
2922         (WebCore::BaseChooserOnlyDateAndTimeInputType::isMouseFocusable const):
2923         * html/BaseDateAndTimeInputType.cpp:
2924         (WebCore::BaseDateAndTimeInputType::setValueAsDate const):
2925         (WebCore::BaseDateAndTimeInputType::valueAsDouble const):
2926         (WebCore::BaseDateAndTimeInputType::setValueAsDecimal const):
2927         (WebCore::BaseDateAndTimeInputType::typeMismatch const):
2928         (WebCore::BaseDateAndTimeInputType::serializeWithComponents const):
2929         (WebCore::BaseDateAndTimeInputType::localizeValue const):
2930         (WebCore::BaseDateAndTimeInputType::visibleValue const):
2931         (WebCore::BaseDateAndTimeInputType::valueMissing const):
2932         (WebCore::BaseDateAndTimeInputType::isKeyboardFocusable const):
2933         * html/DateInputType.cpp:
2934         (WebCore::DateInputType::createStepRange const):
2935         * html/DateTimeLocalInputType.cpp:
2936         (WebCore::DateTimeLocalInputType::createStepRange const):
2937         * html/MonthInputType.cpp:
2938         (WebCore::MonthInputType::valueAsDate const):
2939         (WebCore::MonthInputType::createStepRange const):
2940         * html/TimeInputType.cpp:
2941         (WebCore::TimeInputType::createStepRange const):
2942         * html/WeekInputType.cpp:
2943         (WebCore::WeekInputType::createStepRange const):
2944
2945 2018-06-03  Darin Adler  <darin@apple.com>
2946
2947         Simplify and remove some unused video element code (helpful for ARC-compatibility)
2948         https://bugs.webkit.org/show_bug.cgi?id=186258
2949
2950         Reviewed by Daniel Bates.
2951
2952         My main mission was to remove the PlatformMedia struct, which had a union
2953         of Objective-C object pointers in it, which doesn't work in ARC. However, I
2954         found some other unused code to remove and simple mistakes to fix.
2955
2956         * Modules/mediasource/VideoPlaybackQuality.cpp:
2957         (WebCore::VideoPlaybackQuality::create): Use unsigned instead of unsigned long,
2958         since IDL "unsigned long" really means unsigned.
2959         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality): Ditto.
2960         * Modules/mediasource/VideoPlaybackQuality.h: Updated for the above.
2961
2962         * html/HTMLMediaElement.cpp:
2963         (WebCore::HTMLMediaElement::platformMedia const): Deleted.
2964         * html/HTMLMediaElement.h: Updated for the above.
2965
2966         * platform/graphics/MediaPlayer.cpp:
2967         (WebCore::MediaPlayer::MediaPlayer): Moved initialization of many data members
2968         to the class definition.
2969         (WebCore::MediaPlayer::load): Use nullptr instead of 0.
2970         (WebCore::MediaPlayer::platformMedia const): Deleted.
2971         (WebCore::MediaPlayer::videoPlaybackQualityMetrics): Updated name of return type.
2972         (WebCore::MediaPlayer::objCAVFoundationAVPlayer const): Added. Replaces
2973         platformMedia for the one case where it was being used.
2974         * platform/graphics/MediaPlayer.h: Removed unneeded includes. Re-sorted things.
2975         Updated for the above. Removed PlatformMedia struct and NoPlatformMedia constant.
2976         Removed explicit constructor in MediaEngineSupportParameters. Renamed
2977         PlatformVideoPlaybackQualityMetrics struct to VideoPlaybackQualityMetrics,
2978         removed its constructor, and changed types from unsigned long to unsigned.
2979         Un-nested #if statements. Removed some Chromium-specific comments.
2980
2981         * platform/graphics/MediaPlayerPrivate.h: Removed unneeded includes and
2982         forward declarations. Removed platformMedia. Updated return type for
2983         videoPlaybackQualityMetrics. Added objCAVFoundationAVPlayer.
2984
2985         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2986         Removed platformMedia.
2987
2988         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2989         (WebCore::MediaPlayerPrivateAVFoundation::platformMedia const): Deleted.
2990         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2991         Updated for the above.
2992
2993         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2994         Added override of objCAVFoundationAVPlayer. Removed platformMedia.
2995         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2996         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMedia const): Deleted.
2997
2998         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2999         Removed platformMedia. Updated return type for videoPlaybackQualityMetrics.
3000         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3001         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformMedia const): Deleted.
3002         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
3003         Updated return type, changed to use aggregate initialization instead of
3004         calling a constructor, and added casts to unsigned.
3005
3006         * platform/graphics/cocoa/WebCoreDecompressionSession.h: Switched from
3007         unsigned long to unsigned for frame counts and from long to int for
3008         quality of service tier.
3009
3010         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3011         (WebCore::MediaPlayerPrivateGStreamerBase::platformMedia): Deleted.
3012         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3013         Updated for the above.
3014
3015         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
3016         Removed videoPlaybackQualityMetrics since it was overriding a derived function
3017         without changing its behavior, and the type has changed.
3018
3019         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
3020         (WebCore::MockMediaPlayerMediaSource::load): Pass two references.
3021         (WebCore::MockMediaPlayerMediaSource::videoPlaybackQualityMetrics):
3022         Updated return type.
3023         * platform/mock/mediasource/MockMediaPlayerMediaSource.h: Updated for the above.
3024
3025         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
3026         (WebCore::MockMediaSourcePrivate::create): Return a Ref, take references.
3027         (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): Moved most data
3028         member initialization into the class definition. Take references.
3029         (WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate): Use a modern for loop.
3030         (WebCore::MockMediaSourcePrivate::durationChanged): Update since m_player is a
3031         reference.
3032         (WebCore::MockMediaSourcePrivate::markEndOfStream): Ditto.
3033         (WebCore::MockMediaSourcePrivate::readyState): Ditto.
3034         (WebCore::MockMediaSourcePrivate::setReadyState): Ditto.
3035         (WebCore::MockMediaSourcePrivate::waitForSeekCompleted): Ditto.
3036         (WebCore::MockMediaSourcePrivate::seekCompleted): Ditto.
3037         (WebCore::MockMediaSourcePrivate::removeSourceBuffer): Use Vector::removeFirst
3038         instead of find/remove pairs.
3039         (WebCore::MockMediaSourcePrivate::sourceBufferPrivateDidChangeActiveState): Ditto.
3040         (WebCore::MockMediaSourcePrivate::seekToTime): Use modern for loop.
3041         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics): Updated return
3042         type, changed to use aggregate initialization instead of calling a constructor.
3043         * platform/mock/mediasource/MockMediaSourcePrivate.h: Updated for the above.
3044
3045         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
3046         (WebCore::MockSourceBufferPrivate::readyState): Updated since player is now
3047         a reference.
3048         (WebCore::MockSourceBufferPrivate::setReadyState): Ditto.
3049
3050 2018-06-04  Darin Adler  <darin@apple.com>
3051
3052         [Cocoa] Improve smart pointer support for ARC (OSObjectPtr/DispatchPtr)
3053         https://bugs.webkit.org/show_bug.cgi?id=186300
3054
3055         Reviewed by Daniel Bates.
3056
3057         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: Removed unnecessary
3058         include of OSObjectPtr.h.
3059         * platform/ios/WebItemProviderPasteboard.mm: Ditto.
3060
3061 2018-06-05  Joanmarie Diggs  <jdiggs@igalia.com>
3062
3063         AX: Implement support for new blockquote, caption, and paragraph ARIA roles
3064         https://bugs.webkit.org/show_bug.cgi?id=186274
3065
3066         Reviewed by Chris Fleizach.
3067
3068         Add the three new ARIA roles to the internal rolemap so that they are treated in
3069         the same fashion as their HTML element counterparts. Also ensure that an element
3070         with an explicit caption role does not get pruned from the macOS accessibility tree.
3071
3072         No new tests. Instead add the roles to the existing role-exposure tests.
3073
3074         * accessibility/AccessibilityObject.cpp:
3075         (WebCore::initializeRoleMap):
3076         * accessibility/mac/AccessibilityObjectMac.mm:
3077         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
3078         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3079         (createAccessibilityRoleMap):
3080
3081 2018-06-05  Zalan Bujtas  <zalan@apple.com>
3082
3083         [LFC] Merge width and margin computation for block-level, replaced elements in normal flow
3084         https://bugs.webkit.org/show_bug.cgi?id=186270
3085
3086         Reviewed by Sam Weinig.
3087
3088         https://www.w3.org/TR/CSS22/visudet.html#block-replaced-width
3089         10.3.4 Block-level, replaced elements in normal flow
3090
3091         The used value of 'width' is determined as for inline replaced elements.
3092         Then the rules for non-replaced block-level elements are applied to determine the margins.
3093
3094         * layout/blockformatting/BlockFormattingContext.h:
3095         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3096         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3097         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
3098
3099 2018-06-04  Enrique Ocaña González  <eocanha@igalia.com>
3100
3101         [GStreamer][MSE] MediaPlayerPrivateGStreamerMSE.h includes and forward declares PlaybackPipeline
3102         https://bugs.webkit.org/show_bug.cgi?id=186190
3103
3104         Reviewed by Xabier Rodriguez-Calvar.
3105
3106         This is just a compilation improvement.
3107
3108         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3109         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
3110         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3111
3112 2018-06-03  Darin Adler  <darin@apple.com>
3113
3114         [Cocoa] Update more code to be more ARC-compatible to prepare for future ARC adoption
3115         https://bugs.webkit.org/show_bug.cgi?id=186245
3116
3117         Reviewed by Daniel Bates.
3118
3119         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3120         (convertToNSArray): Explicitly cast to WebAccessibilityObjectWrapperBase so we don't
3121         make method calls on WebAccessibilityObjectWrapper, a forward-declared class.
3122         (-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]): Use CFAutorelease
3123         for the CGPathRef return value instead of Objective-C autorelease. Another option
3124         would be to use RetainPtr for the return type instead.
3125
3126         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3127         (AXObjectIsTextMarker): Use __bridge for bridging typecast.
3128         (AXObjectIsTextMarkerRange): Ditto.
3129         (AXTextMarkerRange): Ditto.
3130         (AXTextMarkerRangeStart): Ditto.
3131         (AXTextMarkerRangeEnd): Ditto.
3132         (isTextMarkerIgnored): Ditto.
3133         (accessibilityObjectForTextMarker): Ditto.
3134         (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]): Ditto.
3135         (-[WebAccessibilityObjectWrapper visiblePositionForTextMarker:]): Ditto.
3136         (visiblePositionForStartOfTextMarkerRange): Ditto.
3137         (visiblePositionForEndOfTextMarkerRange): Ditto.
3138         (AXAttributeStringSetFont): Ditto. Also use @{} syntax to make NSDictionary
3139         and @() to make NSNumber.
3140         (AXAttributeStringSetColor): Use __bridge for bridging typecast, rearranging
3141         code so that the typecasts are on function arguments, not local variables,
3142         which makes lifetimes clearer.
3143         (AXAttributeStringSetElement): Use __bridge for bridging typecast.
3144         (WebTransformCGPathToNSBezierPath):
3145         (-[WebAccessibilityObjectWrapper bezierPathFromPath:]): Added a bridging
3146         typecast when passing an NSBezierPath through as a void* context argument;
3147         silent conversion to void* is not compatible with ARC.
3148         (createAccessibilityRoleMap): Use __unsafe_unretained for a table of
3149         NSString constants.
3150
3151         * bindings/js/ScriptControllerMac.mm:
3152         (WebCore::ScriptController::createScriptInstanceForWidget): Use __bridge
3153         for bridging typecast.
3154
3155         * bridge/objc/objc_class.mm:
3156         (JSC::Bindings::ObjcClass::classForIsA): Added bridging typecasts
3157         to convert a Class into a CFTypeRef.
3158         (JSC::Bindings::ObjcClass::methodNamed const): Use __bridge for bridging
3159         typecast.
3160         (JSC::Bindings::ObjcClass::fieldNamed const): Ditto.
3161         * bridge/objc/objc_instance.mm:
3162         (ObjcInstance::invokeObjcMethod): Ditto.
3163         * bridge/objc/objc_runtime.mm:
3164         (JSC::Bindings::ObjcField::valueFromInstance const): Ditto.
3165         (JSC::Bindings::ObjcField::setValueToInstance const): Ditto.
3166         * bridge/objc/objc_utility.mm:
3167         (JSC::Bindings::convertObjcValueToValue): Ditto. Also add a missing const
3168         to make it clearer to the compiler that the code is correct.
3169         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
3170         (WebCore::createAndStoreMasterKey): Ditto.
3171         (WebCore::findMasterKey): Ditto.
3172         * editing/cocoa/DataDetection.mm:
3173         (WebCore::detectItemAtPositionWithRange): Ditto.
3174         * editing/cocoa/EditorCocoa.mm:
3175         (WebCore::Editor::fontAttributesForSelectionStart const): Ditto.
3176         * editing/cocoa/HTMLConverter.mm:
3177         (_font): Ditto.
3178         (fileWrapperForElement): Ditto.
3179         * fileapi/FileCocoa.mm:
3180         (WebCore::File::shouldReplaceFile): Ditto.
3181         * loader/archive/cf/LegacyWebArchiveMac.mm:
3182         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Ditto.
3183         * page/mac/TextIndicatorWindow.mm:
3184         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Ditto.
3185         (createContentCrossfadeAnimation): Ditto.
3186         * platform/cocoa/LocalizedStringsCocoa.mm:
3187         (WebCore::localizedString): Ditto.
3188         * platform/cocoa/SharedBufferCocoa.mm:
3189         (WebCore::SharedBuffer::create): Ditto.
3190         (WebCore::SharedBuffer::append): Ditto.
3191         * platform/graphics/FontPlatformData.h:
3192         (WebCore::toCTFont): Ditto.
3193         (WebCore::toNSFont): Ditto.
3194         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
3195         (WebCore::assetTrackMeetsHardwareDecodeRequirements): Ditto.
3196         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3197         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer): Ditto.
3198         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3199         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage): Ditto.
3200         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3201         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage): Ditto.
3202         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3203         (WebCore::MediaDescriptionAVFObjC::MediaDescriptionAVFObjC): Ditto.
3204         (WebCore::bufferWasConsumedCallback): Ditto.
3205         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
3206         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
3207         (WebCore::VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage): Ditto.
3208         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer): Ditto.
3209         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3210         (PlatformCALayerCocoa::create): Ditto.
3211         (PlatformCALayer::platformCALayer): Ditto.
3212         (PlatformCALayerCocoa::superlayer const): Ditto.
3213         (PlatformCALayerCocoa::contents const): Ditto.
3214         (PlatformCALayerCocoa::setContents): Ditto.
3215         * platform/graphics/cocoa/IOSurface.h: Ditto.
3216         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
3217         (TextTrackRepresentationCocoa::update): Ditto.
3218         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
3219         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample): Ditto.
3220         (WebCore::WebCoreDecompressionSession::resetQosTier): Ditto.
3221         * platform/graphics/cocoa/WebGLLayer.mm:
3222         (-[WebGLLayer display]): Ditto.
3223         * platform/graphics/mac/ImageMac.mm:
3224         (WebCore::BitmapImage::nsImage): Ditto.
3225         (WebCore::BitmapImage::snapshotNSImage): Ditto.
3226         * platform/graphics/mac/WebLayer.mm:
3227         (-[WebLayer drawInContext:]): Ditto.
3228         (-[WebSimpleLayer setNeedsDisplay]): Ditto.
3229         (-[WebSimpleLayer setNeedsDisplayInRect:]): Ditto.
3230         (-[WebSimpleLayer display]): Ditto.
3231         (-[WebSimpleLayer drawInContext:]): Ditto.
3232
3233         * platform/mac/CursorMac.mm:
3234         (WebCore::cursor): Mark pointer __strong to match the globals it points to.
3235
3236         * platform/mac/FileSystemMac.mm:
3237         (WebCore::FileSystem::setMetadataURL): Use RetainPtr instead of autorelease.
3238
3239         * platform/mac/PlatformPasteboardMac.mm:
3240         (WebCore::PlatformPasteboard::bufferForType): Use __bridge for bridging
3241         typecast.
3242         * platform/mac/PlatformSpeechSynthesizerMac.mm:
3243         (WebCore::speechSynthesisGetVoiceIdentifiers): Ditto.
3244         (WebCore::speechSynthesisGetDefaultVoiceIdentifierForLocale): Ditto.
3245
3246         * platform/mac/PluginBlacklist.h: Use RetainPtr instead of explicit retain
3247         and release for NSDictionary and NSSet.
3248         * platform/mac/PluginBlacklist.mm:
3249         (WebCore::PluginBlacklist::create): Use __bridge for bridging typecast.
3250         (WebCore::PluginBlacklist::~PluginBlacklist): Remove explicit CFRelease calls.
3251         (WebCore::PluginBlacklist::PluginBlacklist): Add adoptNS calls and remove
3252         explciit CFRetain/release pairs.
3253
3254         * platform/mac/PublicSuffixMac.mm:
3255         (WebCore::isPublicSuffix): Use __bridge for bridging typecast.
3256         * platform/mac/RemoteCommandListenerMac.mm:
3257         (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Ditto.
3258         * platform/mac/SerializedPlatformRepresentationMac.mm:
3259         (WebCore::jsValueWithDictionaryInContext): Ditto.
3260         * platform/mac/URLMac.mm:
3261         (WebCore::URL::URL): Ditto.
3262         (WebCore::URL::createCFURL const): Ditto.
3263
3264         * platform/mac/WebCoreNSURLExtras.mm:
3265         (WebCore::collectRangesThatNeedMapping): Mark pointer __strong to match the
3266         local variable it eventually points to.
3267         (WebCore::stringByTrimmingWhitespace): Use __bridge for bridging typecast.
3268         (WebCore::URLByTruncatingOneCharacterBeforeComponent): Use
3269         CFBridgingRelease instead of autorelease, reducing typecasts.
3270         (WebCore::URLByRemovingComponentAndSubsequentCharacter): Ditto.
3271         (WebCore::userVisibleString): Use __bridge for bridging typecast.
3272         (WebCore::isUserVisibleURL): Ditto.
3273
3274         * platform/mac/WebGLBlacklist.mm:
3275         (WebCore::WebGLBlacklist::create): Use __bridge for bridging typecast.
3276         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3277         (WebCore::AVVideoCaptureSource::setPreset): Ditto.
3278         (WebCore::AVVideoCaptureSource::setupCaptureSession): Ditto. Also use @()
3279         instead of NSNumber.
3280         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3281         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Ditto.
3282         * platform/network/cocoa/ResourceRequestCocoa.mm:
3283         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody): Ditto.
3284
3285         * platform/network/cocoa/ResourceResponseCocoa.mm: Use CFStringRef and
3286         CFSTR for constant string array commonHeaderFields rather than using
3287         NSString * and then relying on implicit bridging conversion.
3288
3289         * platform/network/mac/CertificateInfoMac.mm:
3290         (WebCore::CertificateInfo::dump const): Use __bridge for bridging typecast.
3291         * platform/network/mac/FormDataStreamMac.mm:
3292         (WebCore::createHTTPBodyNSInputStream): Ditto.
3293         (WebCore::httpBodyFromStream): Ditto.
3294         * platform/network/mac/ResourceErrorMac.mm:
3295         (WebCore::ResourceError::ResourceError): Ditto.
3296         (WebCore::ResourceError::cfError const): Ditto.
3297
3298         * rendering/RenderThemeMac.mm:
3299         (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
3300         Use CFSTR("") instead of @"" for a string that is passed to CFDIctionaryRef.
3301         (WebCore::AttachmentLayout::layOutTitle): Use __bridge for bridging typecast.
3302         (WebCore::AttachmentLayout::layOutSubtitle): Ditto.
3303
3304         * testing/cocoa/WebArchiveDumpSupport.mm:
3305         (WebCoreTestSupport::createCFURLResponseFromResponseData): Use __bridge for
3306         bridging typecast.
3307         (WebCoreTestSupport::supportedNonImageMIMETypes): Deleted.
3308         (WebCoreTestSupport::convertWebResourceDataToString): Use the
3309         MIMETypeRegistry::isSupportedNonImageMIMEType function directly instead of
3310         building a CFArray out of MIMETypeRegistry::getSupportedNonImageMIMETypes
3311         and using CFArrayContainsValue. This is both much more direct and much more
3312         efficient as well.
3313
3314 2018-06-04  Timothy Hatcher  <timothy@apple.com>
3315
3316         [Win] REGRESSION(r232486) 'WebCore::RenderTheme::activeListBoxSelectionBackgroundColor': function does not take 0 arguments
3317         https://bugs.webkit.org/show_bug.cgi?id=186296
3318
3319         Unreviewed build fix.
3320
3321         * platform/win/PopupMenuWin.cpp:
3322         (WebCore::PopupMenuWin::paint):
3323         * rendering/RenderThemeWin.cpp:
3324         (WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):
3325
3326 2018-06-04  Chris Dumez  <cdumez@apple.com>
3327
3328         Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
3329         https://bugs.webkit.org/show_bug.cgi?id=186287
3330         <rdar://problem/40783352>
3331
3332         Reviewed by Youenn Fablet.
3333
3334         Tests: http/wpt/cross-origin-window-policy/allow-postmessage-from-deny.html
3335                http/wpt/cross-origin-window-policy/allow-postmessage.html
3336                http/wpt/cross-origin-window-policy/cross-origin-window-policy-header.html
3337                http/wpt/cross-origin-window-policy/navigation-from-opener-via-open-target.html
3338                http/wpt/cross-origin-window-policy/navigation-from-subframe-via-anchor-target.html
3339
3340         * bindings/js/JSDOMBindingSecurity.cpp:
3341         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginWindowPolicy):
3342         * bindings/js/JSDOMBindingSecurity.h:
3343         * bindings/js/JSDOMWindowCustom.cpp:
3344         (WebCore::effectiveCrossOriginWindowPolicyForAccess):
3345         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
3346         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
3347         (WebCore::addCrossOriginWindowPropertyNames):
3348         (WebCore::addScopedChildrenIndexes):
3349         * bindings/scripts/CodeGeneratorJS.pm:
3350         (GenerateAttributeGetterBodyDefinition):
3351         (GetCrossOriginsOptionsFromExtendedAttributeValue):
3352         (GenerateAttributeSetterBodyDefinition):
3353         (GenerateOperationBodyDefinition):
3354         * bindings/scripts/IDLAttributes.json:
3355         * dom/Document.cpp:
3356         (WebCore::Document::canNavigate):
3357         * loader/FrameLoader.cpp:
3358         (WebCore::FrameLoader::didBeginDocument):
3359         * page/AbstractDOMWindow.cpp:
3360         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
3361         * page/AbstractDOMWindow.h:
3362         (WebCore::AbstractDOMWindow::crossOriginWindowPolicy):
3363         (WebCore::AbstractDOMWindow::setCrossOriginWindowPolicy):
3364         * page/DOMWindow.idl:
3365         * page/Settings.yaml:
3366         * platform/network/HTTPHeaderNames.in:
3367         * platform/network/HTTPParsers.cpp:
3368         (WebCore::parseCrossOriginWindowPolicyHeader):
3369         * platform/network/HTTPParsers.h:
3370
3371 2018-06-04  Brent Fulgham  <bfulgham@apple.com>
3372
3373         REGRESSION(r231291): InputType should hold a WeakPtr to its HTMLInputElement
3374         https://bugs.webkit.org/show_bug.cgi?id=186096
3375         <rdar://problem/40651015>
3376
3377         Reviewed by Ryosuke Niwa.
3378
3379         Now that the InputType may be kept alive as part of in-flight form submissions, we
3380         shouldn't assume that the referenced HTMLInputElement is still valid before using it.
3381
3382         The only time we should be lacking a referencing element is in cases where the InputType
3383         is changing, either through a change in the HTMLInputElement's type attribute. In those
3384         cases&nb