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