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