[Web Animations] Only expose CSSAnimation and CSSTransition if the WebAnimationsCSSIn...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-06-05  Antoine Quint  <graouts@apple.com>
2
3         [Web Animations] Only expose CSSAnimation and CSSTransition if the WebAnimationsCSSIntegration runtime flag is enabled
4         https://bugs.webkit.org/show_bug.cgi?id=186305
5
6         Reviewed by Dean Jackson.
7
8         * animation/CSSAnimation.idl:
9         * animation/CSSTransition.idl:
10
11 2018-06-05  Per Arne Vollan  <pvollan@apple.com>
12
13         Move OpenGL display mask to screen data struct.
14         https://bugs.webkit.org/show_bug.cgi?id=186198
15         <rdar://problem/40724854>
16
17         Reviewed by Brent Fulgham.
18
19         Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
20         it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
21         resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
22         display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
23         the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
24         window is available, the OpenGL display mask of the main display is used.
25
26         No new tests, since testing this requires two Web views in the same WebContent process, displayed on
27         two different monitors.
28
29         * html/HTMLCanvasElement.cpp:
30         (WebCore::HTMLCanvasElement::createImageBuffer const):
31         * platform/PlatformScreen.h:
32         * platform/ScreenProperties.h:
33         (WebCore::ScreenProperties::encode const):
34         (WebCore::ScreenProperties::decode):
35         (WebCore::ScreenData::encode const):
36         (WebCore::ScreenData::decode):
37         * platform/graphics/GraphicsContext3D.h:
38         * platform/graphics/ImageBuffer.cpp:
39         (WebCore::ImageBuffer::create):
40         * platform/graphics/ImageBuffer.h:
41         * platform/graphics/cg/ImageBufferCG.cpp:
42         (WebCore::ImageBuffer::createCompatibleBuffer):
43         (WebCore::ImageBuffer::ImageBuffer):
44         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
45         (WebCore::GraphicsContext3D::GraphicsContext3D):
46         (WebCore::GraphicsContext3D::allowOfflineRenderers const):
47         (WebCore::GraphicsContext3D::setOpenGLDisplayMask): Deleted.
48         (WebCore::GraphicsContext3D::getOpenGLDisplayMask): Deleted.
49         * platform/graphics/cocoa/IOSurface.h:
50         * platform/graphics/cocoa/IOSurface.mm:
51         (WebCore::IOSurface::ensurePlatformContext):
52         * platform/mac/PlatformScreenMac.mm:
53         (WebCore::screenProperties):
54         (WebCore::collectScreenProperties):
55         (WebCore::setScreenProperties):
56         (WebCore::screenData):
57         (WebCore::primaryOpenGLDisplayMask):
58         (WebCore::displayMaskForDisplay):
59         (WebCore::getScreenProperties):
60         (WebCore::screenIsMonochrome):
61         (WebCore::screenHasInvertedColors):
62         (WebCore::screenDepth):
63         (WebCore::screenDepthPerComponent):
64         (WebCore::screenRectForDisplay):
65         (WebCore::screenRect):
66         (WebCore::screenAvailableRect):
67         (WebCore::screenColorSpace):
68         (WebCore::screenSupportsExtendedColor):
69
70 2018-06-05  Jer Noble  <jer.noble@apple.com>
71
72         REGRESSION (231817): Videos permanently blank out after switching out of a tab and back in
73         https://bugs.webkit.org/show_bug.cgi?id=186326
74         <rdar://problem/40778157>
75
76         Reviewed by Eric Carlson.
77
78         Check whether the element is visible in the viewport when the web view itself becomes visible, and if so, clear the m_elementIsHiddenUntilVisibleInViewport flag.
79
80         * html/MediaElementSession.cpp:
81         (WebCore::MediaElementSession::visibilityChanged):
82         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
83
84 2018-06-05  Zalan Bujtas  <zalan@apple.com>
85
86         [LFC] Move inflow, replaced width and margin computation to a dedicated function.
87         https://bugs.webkit.org/show_bug.cgi?id=186327
88
89         Reviewed by Sam Weinig.
90
91         I was searching for the function inFlowReplacedWidthAndMargin() and there was none.
92
93         * layout/blockformatting/BlockFormattingContext.h:
94         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
95         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
96         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
97
98 2018-06-05  Zalan Bujtas  <zalan@apple.com>
99
100         [LFC] Add missing margins for inflow, non replaced block and replaced inline elements
101         https://bugs.webkit.org/show_bug.cgi?id=186332
102
103         Reviewed by Darin Adler.
104
105         * layout/FormattingContextGeometry.cpp:
106         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
107         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
108         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
109
110 2018-06-05  Wenson Hsieh  <wenson_hsieh@apple.com>
111
112         [macOS] Spelling errors in the middle of an inserted paragraph are not displayed
113         https://bugs.webkit.org/show_bug.cgi?id=185584
114         <rdar://problem/38676081>
115
116         Reviewed by Ryosuke Niwa.
117
118         Currently when typing, we only consider the range of adjacent words when determining where to place spelling
119         correction markers, even though we provide NSSpellChecker with the full context of the sentence (and get back
120         results encompassing the full range). In macOS Mojave, NSSpellChecker may now return spell checking results that
121         include correctly spelled words that are misused in the context of the sentence. This means that while typing a
122         sentence, a different part of the sentence may gain or lose spelling markers as a result.
123
124         To support this, WebKit needs to mark or unmark spelling corrections in the full range of the sentence whenever
125         a full word is typed (since the context of other words within the sentence may have changed, resulting in
126         different platform spellchecking results). In markMisspellingsAfterTypingToWord, we expand the spell checking
127         range past the adjacent words so that it encompasses the largest subrange of the full sentence that includes the
128         start of the typed word, and does not include any position that is under an element with `spellcheck=false`.
129
130         This guarantees that we don't erroneously place spelling document markers under elements where spellchecking is
131         disabled, while allowing for sentence retro corrections when spellchecking is enabled. However, this doesn't
132         handle the case where an element with spellchecking disabled lies between a sentence retro correction range and
133         the currently typed word. In the future, we could fix this by refactoring SpellCheckRequest to track a list of
134         non-contiguous spelling correction ranges — see the FIXME in markMisspellingsAfterTypingToWord for more detail.
135
136         Covered by 2 new layout tests, as well as an existing spell-checking test that should now be passing.
137
138         Tests: editing/spelling/retro-correction-spelling-markers.html
139                editing/spelling/spelling-markers-after-pasting-sentence.html
140
141         * editing/Editor.cpp:
142         (WebCore::Editor::markMisspellingsAfterTypingToWord):
143         * testing/Internals.h:
144         * testing/Internals.idl:
145
146         Add an internal testing helper to determine whether retro sentence corrections are enabled.
147
148 2018-06-05  Darin Adler  <darin@apple.com>
149
150         [Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other smart pointers
151         https://bugs.webkit.org/show_bug.cgi?id=186324
152
153         Reviewed by Anders Carlsson.
154
155         * platform/FileMonitor.h: Use OSObjectPtr instead of DispatchPtr.
156         * platform/cocoa/FileMonitorCocoa.mm:
157         (WebCore::FileMonitor::FileMonitor): Ditto.
158
159 2018-06-05  Ryan Haddad  <ryanhaddad@apple.com>
160
161         Unreviewed, fix the macOS build with recent SDKs.
162
163         * page/mac/ServicesOverlayController.mm:
164         (WebCore::ServicesOverlayController::Highlight::paintContents):
165
166 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
167
168         Adjust compile and runtime flags to match shippable state of features
169         https://bugs.webkit.org/show_bug.cgi?id=186319
170         <rdar://problem/40352045>
171
172         Reviewed by Maciej Stachowiak, Jon Lee, and others.
173
174         * Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
175         or ENABLE_INPUT_TYPE_COLOR_POPOVER.
176
177 2018-06-05  Timothy Hatcher  <timothy@apple.com>
178
179         Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query
180
181         https://bugs.webkit.org/show_bug.cgi?id=186323
182         rdar://problem/38382252
183
184         Reviewed by Tim Horton.
185
186         * css/MediaFeatureNames.h:
187         * css/MediaQueryEvaluator.cpp:
188         (WebCore::prefersDarkInterfaceEvaluate):
189         (WebCore::defaultAppearanceEvaluate): Deleted.
190         * css/MediaQueryExpression.cpp:
191         (WebCore::featureWithValidIdent):
192         (WebCore::isFeatureValidWithoutValue):
193         * platform/mac/LocalDefaultSystemAppearance.mm:
194         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
195
196 2018-06-05  Darin Adler  <darin@apple.com>
197
198         [Cocoa] Improve some soft linking compatibility with ARC
199         https://bugs.webkit.org/show_bug.cgi?id=186309
200
201         Reviewed by Anders Carlsson.
202
203         * platform/audio/ios/AudioSessionIOS.mm: Use SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER
204         for NSString constants.
205         * platform/audio/ios/MediaSessionManagerIOS.mm: Ditto.
206         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: Ditto.
207         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: Ditto.
208         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: Ditto.
209         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
210         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState): Use __bridge for
211         some bridging casts.
212         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
213         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): Ditto.
214         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): Ditto.
215         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Use
216         SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER for NSString constants.
217         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Ditto.
218         * platform/mediastream/mac/AVCaptureDeviceManager.mm: Ditto.
219         * platform/mediastream/mac/AVMediaCaptureSource.mm: Ditto.
220         * platform/mediastream/mac/AVVideoCaptureSource.mm: Ditto.
221
222 2018-06-05  Youenn Fablet  <youenn@apple.com>
223
224         ServiceWorker registration should store any script fetched through importScripts
225         https://bugs.webkit.org/show_bug.cgi?id=182444
226         <rdar://problem/37164835>
227
228         Reviewed by Chris Dumez.
229
230         Covered by added test http/wpt/service-workers/persistent-importScripts.html.
231
232         Update importScripts implementation to look for/update the resource map in case of service worker scope.
233         This resource map is stored persistently and sent when running the service worker.
234
235         Add support to persistent storage of this resource map.
236         This requires updating the schema database.
237         The schema version is bumped to 2 and we delete any data related to old registrations.
238
239         When updating the service worker, the resource map is currently flushed so that all scripts will be retrieved from the network.
240
241         Did some limited refactoring to put more loading handling in WorkerScriptLoader.
242
243         * workers/WorkerGlobalScope.cpp:
244         (WebCore::WorkerGlobalScope::importScripts):
245         * workers/WorkerScriptLoader.cpp:
246         (WebCore::WorkerScriptLoader::loadSynchronously):
247         (WebCore::WorkerScriptLoader::script):
248         * workers/WorkerScriptLoader.h:
249         * workers/service/ServiceWorkerContextData.cpp:
250         (WebCore::ServiceWorkerContextData::isolatedCopy const):
251         * workers/service/ServiceWorkerContextData.h:
252         (WebCore::ServiceWorkerContextData::ImportedScript::isolatedCopy const):
253         (WebCore::ServiceWorkerContextData::ImportedScript::encode const):
254         (WebCore::ServiceWorkerContextData::ImportedScript::decode):
255         (WebCore::ServiceWorkerContextData::encode const):
256         (WebCore::ServiceWorkerContextData::decode):
257         * workers/service/ServiceWorkerGlobalScope.cpp:
258         (WebCore::ServiceWorkerGlobalScope::scriptResource const):
259         (WebCore::ServiceWorkerGlobalScope::setScriptResource):
260         * workers/service/ServiceWorkerGlobalScope.h:
261         * workers/service/context/SWContextManager.h:
262         * workers/service/server/RegistrationDatabase.cpp:
263         (WebCore::v1RecordsTableSchema):
264         (WebCore::RegistrationDatabase::doPushChanges):
265         (WebCore::RegistrationDatabase::importRecords):
266         * workers/service/server/SWServer.cpp:
267         (WebCore::SWServer::addRegistrationFromStore):
268         (WebCore::SWServer::updateWorker):
269         (WebCore::SWServer::installContextData):
270         * workers/service/server/SWServer.h:
271         * workers/service/server/SWServerJobQueue.cpp:
272         (WebCore::SWServerJobQueue::scriptFetchFinished):
273         * workers/service/server/SWServerToContextConnection.cpp:
274         (WebCore::SWServerToContextConnection::setScriptResource):
275         * workers/service/server/SWServerToContextConnection.h:
276         * workers/service/server/SWServerWorker.cpp:
277         (WebCore::SWServerWorker::SWServerWorker):
278         (WebCore::m_scriptResourceMap):
279         (WebCore::SWServerWorker::contextData const):
280         (WebCore::SWServerWorker::setScriptResource):
281         * workers/service/server/SWServerWorker.h:
282
283 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
284
285         Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
286         https://bugs.webkit.org/show_bug.cgi?id=186286
287         <rdar://problem/40782992>
288
289         Reviewed by Dan Bernstein.
290
291         Use the WK_RELOCATABLE_FRAMEWORKS flag (which is always defined for non-production builds)
292         to define ENABLE(EXPERIMENTAL_FEATURES) so that we do not need to manually
293         change this flag when preparing for a production release.
294
295         * Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
296         whether experimental features should be enabled, and use it to properly define the
297         feature flag.
298
299 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
300
301         Unreviewed build fix after r232511.
302         https://bugs.webkit.org/show_bug.cgi?id=186304
303
304         * platform/ios/WebItemProviderPasteboard.mm: Add missing include.
305
306 2018-06-05  Antoine Quint  <graouts@apple.com>
307
308         Fix the iOS build after r232496
309         https://bugs.webkit.org/show_bug.cgi?id=186304
310
311         Reviewed by Brent Fulgham.
312
313         The changes in r232496 changed the InputType::element() signature from HTMLInputElement&
314         to HTMLInputElement* and some call sites did not expect that.
315
316         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
317         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
318         (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
319         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue):
320         (WebCore::BaseChooserOnlyDateAndTimeInputType::didChooseValue):
321         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
322         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent):
323         (WebCore::BaseChooserOnlyDateAndTimeInputType::accessKeyAction):
324         (WebCore::BaseChooserOnlyDateAndTimeInputType::isMouseFocusable const):
325         * html/BaseDateAndTimeInputType.cpp:
326         (WebCore::BaseDateAndTimeInputType::setValueAsDate const):
327         (WebCore::BaseDateAndTimeInputType::valueAsDouble const):
328         (WebCore::BaseDateAndTimeInputType::setValueAsDecimal const):
329         (WebCore::BaseDateAndTimeInputType::typeMismatch const):
330         (WebCore::BaseDateAndTimeInputType::serializeWithComponents const):
331         (WebCore::BaseDateAndTimeInputType::localizeValue const):
332         (WebCore::BaseDateAndTimeInputType::visibleValue const):
333         (WebCore::BaseDateAndTimeInputType::valueMissing const):
334         (WebCore::BaseDateAndTimeInputType::isKeyboardFocusable const):
335         * html/DateInputType.cpp:
336         (WebCore::DateInputType::createStepRange const):
337         * html/DateTimeLocalInputType.cpp:
338         (WebCore::DateTimeLocalInputType::createStepRange const):
339         * html/MonthInputType.cpp:
340         (WebCore::MonthInputType::valueAsDate const):
341         (WebCore::MonthInputType::createStepRange const):
342         * html/TimeInputType.cpp:
343         (WebCore::TimeInputType::createStepRange const):
344         * html/WeekInputType.cpp:
345         (WebCore::WeekInputType::createStepRange const):
346
347 2018-06-03  Darin Adler  <darin@apple.com>
348
349         Simplify and remove some unused video element code (helpful for ARC-compatibility)
350         https://bugs.webkit.org/show_bug.cgi?id=186258
351
352         Reviewed by Daniel Bates.
353
354         My main mission was to remove the PlatformMedia struct, which had a union
355         of Objective-C object pointers in it, which doesn't work in ARC. However, I
356         found some other unused code to remove and simple mistakes to fix.
357
358         * Modules/mediasource/VideoPlaybackQuality.cpp:
359         (WebCore::VideoPlaybackQuality::create): Use unsigned instead of unsigned long,
360         since IDL "unsigned long" really means unsigned.
361         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality): Ditto.
362         * Modules/mediasource/VideoPlaybackQuality.h: Updated for the above.
363
364         * html/HTMLMediaElement.cpp:
365         (WebCore::HTMLMediaElement::platformMedia const): Deleted.
366         * html/HTMLMediaElement.h: Updated for the above.
367
368         * platform/graphics/MediaPlayer.cpp:
369         (WebCore::MediaPlayer::MediaPlayer): Moved initialization of many data members
370         to the class definition.
371         (WebCore::MediaPlayer::load): Use nullptr instead of 0.
372         (WebCore::MediaPlayer::platformMedia const): Deleted.
373         (WebCore::MediaPlayer::videoPlaybackQualityMetrics): Updated name of return type.
374         (WebCore::MediaPlayer::objCAVFoundationAVPlayer const): Added. Replaces
375         platformMedia for the one case where it was being used.
376         * platform/graphics/MediaPlayer.h: Removed unneeded includes. Re-sorted things.
377         Updated for the above. Removed PlatformMedia struct and NoPlatformMedia constant.
378         Removed explicit constructor in MediaEngineSupportParameters. Renamed
379         PlatformVideoPlaybackQualityMetrics struct to VideoPlaybackQualityMetrics,
380         removed its constructor, and changed types from unsigned long to unsigned.
381         Un-nested #if statements. Removed some Chromium-specific comments.
382
383         * platform/graphics/MediaPlayerPrivate.h: Removed unneeded includes and
384         forward declarations. Removed platformMedia. Updated return type for
385         videoPlaybackQualityMetrics. Added objCAVFoundationAVPlayer.
386
387         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
388         Removed platformMedia.
389
390         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
391         (WebCore::MediaPlayerPrivateAVFoundation::platformMedia const): Deleted.
392         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
393         Updated for the above.
394
395         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
396         Added override of objCAVFoundationAVPlayer. Removed platformMedia.
397         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
398         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMedia const): Deleted.
399
400         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
401         Removed platformMedia. Updated return type for videoPlaybackQualityMetrics.
402         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
403         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformMedia const): Deleted.
404         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
405         Updated return type, changed to use aggregate initialization instead of
406         calling a constructor, and added casts to unsigned.
407
408         * platform/graphics/cocoa/WebCoreDecompressionSession.h: Switched from
409         unsigned long to unsigned for frame counts and from long to int for
410         quality of service tier.
411
412         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
413         (WebCore::MediaPlayerPrivateGStreamerBase::platformMedia): Deleted.
414         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
415         Updated for the above.
416
417         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
418         Removed videoPlaybackQualityMetrics since it was overriding a derived function
419         without changing its behavior, and the type has changed.
420
421         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
422         (WebCore::MockMediaPlayerMediaSource::load): Pass two references.
423         (WebCore::MockMediaPlayerMediaSource::videoPlaybackQualityMetrics):
424         Updated return type.
425         * platform/mock/mediasource/MockMediaPlayerMediaSource.h: Updated for the above.
426
427         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
428         (WebCore::MockMediaSourcePrivate::create): Return a Ref, take references.
429         (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): Moved most data
430         member initialization into the class definition. Take references.
431         (WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate): Use a modern for loop.
432         (WebCore::MockMediaSourcePrivate::durationChanged): Update since m_player is a
433         reference.
434         (WebCore::MockMediaSourcePrivate::markEndOfStream): Ditto.
435         (WebCore::MockMediaSourcePrivate::readyState): Ditto.
436         (WebCore::MockMediaSourcePrivate::setReadyState): Ditto.
437         (WebCore::MockMediaSourcePrivate::waitForSeekCompleted): Ditto.
438         (WebCore::MockMediaSourcePrivate::seekCompleted): Ditto.
439         (WebCore::MockMediaSourcePrivate::removeSourceBuffer): Use Vector::removeFirst
440         instead of find/remove pairs.
441         (WebCore::MockMediaSourcePrivate::sourceBufferPrivateDidChangeActiveState): Ditto.
442         (WebCore::MockMediaSourcePrivate::seekToTime): Use modern for loop.
443         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics): Updated return
444         type, changed to use aggregate initialization instead of calling a constructor.
445         * platform/mock/mediasource/MockMediaSourcePrivate.h: Updated for the above.
446
447         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
448         (WebCore::MockSourceBufferPrivate::readyState): Updated since player is now
449         a reference.
450         (WebCore::MockSourceBufferPrivate::setReadyState): Ditto.
451
452 2018-06-04  Darin Adler  <darin@apple.com>
453
454         [Cocoa] Improve smart pointer support for ARC (OSObjectPtr/DispatchPtr)
455         https://bugs.webkit.org/show_bug.cgi?id=186300
456
457         Reviewed by Daniel Bates.
458
459         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: Removed unnecessary
460         include of OSObjectPtr.h.
461         * platform/ios/WebItemProviderPasteboard.mm: Ditto.
462
463 2018-06-05  Joanmarie Diggs  <jdiggs@igalia.com>
464
465         AX: Implement support for new blockquote, caption, and paragraph ARIA roles
466         https://bugs.webkit.org/show_bug.cgi?id=186274
467
468         Reviewed by Chris Fleizach.
469
470         Add the three new ARIA roles to the internal rolemap so that they are treated in
471         the same fashion as their HTML element counterparts. Also ensure that an element
472         with an explicit caption role does not get pruned from the macOS accessibility tree.
473
474         No new tests. Instead add the roles to the existing role-exposure tests.
475
476         * accessibility/AccessibilityObject.cpp:
477         (WebCore::initializeRoleMap):
478         * accessibility/mac/AccessibilityObjectMac.mm:
479         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
480         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
481         (createAccessibilityRoleMap):
482
483 2018-06-05  Zalan Bujtas  <zalan@apple.com>
484
485         [LFC] Merge width and margin computation for block-level, replaced elements in normal flow
486         https://bugs.webkit.org/show_bug.cgi?id=186270
487
488         Reviewed by Sam Weinig.
489
490         https://www.w3.org/TR/CSS22/visudet.html#block-replaced-width
491         10.3.4 Block-level, replaced elements in normal flow
492
493         The used value of 'width' is determined as for inline replaced elements.
494         Then the rules for non-replaced block-level elements are applied to determine the margins.
495
496         * layout/blockformatting/BlockFormattingContext.h:
497         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
498         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
499         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
500
501 2018-06-04  Enrique Ocaña González  <eocanha@igalia.com>
502
503         [GStreamer][MSE] MediaPlayerPrivateGStreamerMSE.h includes and forward declares PlaybackPipeline
504         https://bugs.webkit.org/show_bug.cgi?id=186190
505
506         Reviewed by Xabier Rodriguez-Calvar.
507
508         This is just a compilation improvement.
509
510         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
511         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
512         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
513
514 2018-06-03  Darin Adler  <darin@apple.com>
515
516         [Cocoa] Update more code to be more ARC-compatible to prepare for future ARC adoption
517         https://bugs.webkit.org/show_bug.cgi?id=186245
518
519         Reviewed by Daniel Bates.
520
521         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
522         (convertToNSArray): Explicitly cast to WebAccessibilityObjectWrapperBase so we don't
523         make method calls on WebAccessibilityObjectWrapper, a forward-declared class.
524         (-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]): Use CFAutorelease
525         for the CGPathRef return value instead of Objective-C autorelease. Another option
526         would be to use RetainPtr for the return type instead.
527
528         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
529         (AXObjectIsTextMarker): Use __bridge for bridging typecast.
530         (AXObjectIsTextMarkerRange): Ditto.
531         (AXTextMarkerRange): Ditto.
532         (AXTextMarkerRangeStart): Ditto.
533         (AXTextMarkerRangeEnd): Ditto.
534         (isTextMarkerIgnored): Ditto.
535         (accessibilityObjectForTextMarker): Ditto.
536         (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]): Ditto.
537         (-[WebAccessibilityObjectWrapper visiblePositionForTextMarker:]): Ditto.
538         (visiblePositionForStartOfTextMarkerRange): Ditto.
539         (visiblePositionForEndOfTextMarkerRange): Ditto.
540         (AXAttributeStringSetFont): Ditto. Also use @{} syntax to make NSDictionary
541         and @() to make NSNumber.
542         (AXAttributeStringSetColor): Use __bridge for bridging typecast, rearranging
543         code so that the typecasts are on function arguments, not local variables,
544         which makes lifetimes clearer.
545         (AXAttributeStringSetElement): Use __bridge for bridging typecast.
546         (WebTransformCGPathToNSBezierPath):
547         (-[WebAccessibilityObjectWrapper bezierPathFromPath:]): Added a bridging
548         typecast when passing an NSBezierPath through as a void* context argument;
549         silent conversion to void* is not compatible with ARC.
550         (createAccessibilityRoleMap): Use __unsafe_unretained for a table of
551         NSString constants.
552
553         * bindings/js/ScriptControllerMac.mm:
554         (WebCore::ScriptController::createScriptInstanceForWidget): Use __bridge
555         for bridging typecast.
556
557         * bridge/objc/objc_class.mm:
558         (JSC::Bindings::ObjcClass::classForIsA): Added bridging typecasts
559         to convert a Class into a CFTypeRef.
560         (JSC::Bindings::ObjcClass::methodNamed const): Use __bridge for bridging
561         typecast.
562         (JSC::Bindings::ObjcClass::fieldNamed const): Ditto.
563         * bridge/objc/objc_instance.mm:
564         (ObjcInstance::invokeObjcMethod): Ditto.
565         * bridge/objc/objc_runtime.mm:
566         (JSC::Bindings::ObjcField::valueFromInstance const): Ditto.
567         (JSC::Bindings::ObjcField::setValueToInstance const): Ditto.
568         * bridge/objc/objc_utility.mm:
569         (JSC::Bindings::convertObjcValueToValue): Ditto. Also add a missing const
570         to make it clearer to the compiler that the code is correct.
571         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
572         (WebCore::createAndStoreMasterKey): Ditto.
573         (WebCore::findMasterKey): Ditto.
574         * editing/cocoa/DataDetection.mm:
575         (WebCore::detectItemAtPositionWithRange): Ditto.
576         * editing/cocoa/EditorCocoa.mm:
577         (WebCore::Editor::fontAttributesForSelectionStart const): Ditto.
578         * editing/cocoa/HTMLConverter.mm:
579         (_font): Ditto.
580         (fileWrapperForElement): Ditto.
581         * fileapi/FileCocoa.mm:
582         (WebCore::File::shouldReplaceFile): Ditto.
583         * loader/archive/cf/LegacyWebArchiveMac.mm:
584         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Ditto.
585         * page/mac/TextIndicatorWindow.mm:
586         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Ditto.
587         (createContentCrossfadeAnimation): Ditto.
588         * platform/cocoa/LocalizedStringsCocoa.mm:
589         (WebCore::localizedString): Ditto.
590         * platform/cocoa/SharedBufferCocoa.mm:
591         (WebCore::SharedBuffer::create): Ditto.
592         (WebCore::SharedBuffer::append): Ditto.
593         * platform/graphics/FontPlatformData.h:
594         (WebCore::toCTFont): Ditto.
595         (WebCore::toNSFont): Ditto.
596         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
597         (WebCore::assetTrackMeetsHardwareDecodeRequirements): Ditto.
598         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
599         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer): Ditto.
600         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
601         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage): Ditto.
602         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
603         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage): Ditto.
604         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
605         (WebCore::MediaDescriptionAVFObjC::MediaDescriptionAVFObjC): Ditto.
606         (WebCore::bufferWasConsumedCallback): Ditto.
607         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
608         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
609         (WebCore::VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage): Ditto.
610         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer): Ditto.
611         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
612         (PlatformCALayerCocoa::create): Ditto.
613         (PlatformCALayer::platformCALayer): Ditto.
614         (PlatformCALayerCocoa::superlayer const): Ditto.
615         (PlatformCALayerCocoa::contents const): Ditto.
616         (PlatformCALayerCocoa::setContents): Ditto.
617         * platform/graphics/cocoa/IOSurface.h: Ditto.
618         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
619         (TextTrackRepresentationCocoa::update): Ditto.
620         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
621         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample): Ditto.
622         (WebCore::WebCoreDecompressionSession::resetQosTier): Ditto.
623         * platform/graphics/cocoa/WebGLLayer.mm:
624         (-[WebGLLayer display]): Ditto.
625         * platform/graphics/mac/ImageMac.mm:
626         (WebCore::BitmapImage::nsImage): Ditto.
627         (WebCore::BitmapImage::snapshotNSImage): Ditto.
628         * platform/graphics/mac/WebLayer.mm:
629         (-[WebLayer drawInContext:]): Ditto.
630         (-[WebSimpleLayer setNeedsDisplay]): Ditto.
631         (-[WebSimpleLayer setNeedsDisplayInRect:]): Ditto.
632         (-[WebSimpleLayer display]): Ditto.
633         (-[WebSimpleLayer drawInContext:]): Ditto.
634
635         * platform/mac/CursorMac.mm:
636         (WebCore::cursor): Mark pointer __strong to match the globals it points to.
637
638         * platform/mac/FileSystemMac.mm:
639         (WebCore::FileSystem::setMetadataURL): Use RetainPtr instead of autorelease.
640
641         * platform/mac/PlatformPasteboardMac.mm:
642         (WebCore::PlatformPasteboard::bufferForType): Use __bridge for bridging
643         typecast.
644         * platform/mac/PlatformSpeechSynthesizerMac.mm:
645         (WebCore::speechSynthesisGetVoiceIdentifiers): Ditto.
646         (WebCore::speechSynthesisGetDefaultVoiceIdentifierForLocale): Ditto.
647
648         * platform/mac/PluginBlacklist.h: Use RetainPtr instead of explicit retain
649         and release for NSDictionary and NSSet.
650         * platform/mac/PluginBlacklist.mm:
651         (WebCore::PluginBlacklist::create): Use __bridge for bridging typecast.
652         (WebCore::PluginBlacklist::~PluginBlacklist): Remove explicit CFRelease calls.
653         (WebCore::PluginBlacklist::PluginBlacklist): Add adoptNS calls and remove
654         explciit CFRetain/release pairs.
655
656         * platform/mac/PublicSuffixMac.mm:
657         (WebCore::isPublicSuffix): Use __bridge for bridging typecast.
658         * platform/mac/RemoteCommandListenerMac.mm:
659         (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Ditto.
660         * platform/mac/SerializedPlatformRepresentationMac.mm:
661         (WebCore::jsValueWithDictionaryInContext): Ditto.
662         * platform/mac/URLMac.mm:
663         (WebCore::URL::URL): Ditto.
664         (WebCore::URL::createCFURL const): Ditto.
665
666         * platform/mac/WebCoreNSURLExtras.mm:
667         (WebCore::collectRangesThatNeedMapping): Mark pointer __strong to match the
668         local variable it eventually points to.
669         (WebCore::stringByTrimmingWhitespace): Use __bridge for bridging typecast.
670         (WebCore::URLByTruncatingOneCharacterBeforeComponent): Use
671         CFBridgingRelease instead of autorelease, reducing typecasts.
672         (WebCore::URLByRemovingComponentAndSubsequentCharacter): Ditto.
673         (WebCore::userVisibleString): Use __bridge for bridging typecast.
674         (WebCore::isUserVisibleURL): Ditto.
675
676         * platform/mac/WebGLBlacklist.mm:
677         (WebCore::WebGLBlacklist::create): Use __bridge for bridging typecast.
678         * platform/mediastream/mac/AVVideoCaptureSource.mm:
679         (WebCore::AVVideoCaptureSource::setPreset): Ditto.
680         (WebCore::AVVideoCaptureSource::setupCaptureSession): Ditto. Also use @()
681         instead of NSNumber.
682         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
683         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Ditto.
684         * platform/network/cocoa/ResourceRequestCocoa.mm:
685         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody): Ditto.
686
687         * platform/network/cocoa/ResourceResponseCocoa.mm: Use CFStringRef and
688         CFSTR for constant string array commonHeaderFields rather than using
689         NSString * and then relying on implicit bridging conversion.
690
691         * platform/network/mac/CertificateInfoMac.mm:
692         (WebCore::CertificateInfo::dump const): Use __bridge for bridging typecast.
693         * platform/network/mac/FormDataStreamMac.mm:
694         (WebCore::createHTTPBodyNSInputStream): Ditto.
695         (WebCore::httpBodyFromStream): Ditto.
696         * platform/network/mac/ResourceErrorMac.mm:
697         (WebCore::ResourceError::ResourceError): Ditto.
698         (WebCore::ResourceError::cfError const): Ditto.
699
700         * rendering/RenderThemeMac.mm:
701         (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
702         Use CFSTR("") instead of @"" for a string that is passed to CFDIctionaryRef.
703         (WebCore::AttachmentLayout::layOutTitle): Use __bridge for bridging typecast.
704         (WebCore::AttachmentLayout::layOutSubtitle): Ditto.
705
706         * testing/cocoa/WebArchiveDumpSupport.mm:
707         (WebCoreTestSupport::createCFURLResponseFromResponseData): Use __bridge for
708         bridging typecast.
709         (WebCoreTestSupport::supportedNonImageMIMETypes): Deleted.
710         (WebCoreTestSupport::convertWebResourceDataToString): Use the
711         MIMETypeRegistry::isSupportedNonImageMIMEType function directly instead of
712         building a CFArray out of MIMETypeRegistry::getSupportedNonImageMIMETypes
713         and using CFArrayContainsValue. This is both much more direct and much more
714         efficient as well.
715
716 2018-06-04  Timothy Hatcher  <timothy@apple.com>
717
718         [Win] REGRESSION(r232486) 'WebCore::RenderTheme::activeListBoxSelectionBackgroundColor': function does not take 0 arguments
719         https://bugs.webkit.org/show_bug.cgi?id=186296
720
721         Unreviewed build fix.
722
723         * platform/win/PopupMenuWin.cpp:
724         (WebCore::PopupMenuWin::paint):
725         * rendering/RenderThemeWin.cpp:
726         (WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):
727
728 2018-06-04  Chris Dumez  <cdumez@apple.com>
729
730         Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
731         https://bugs.webkit.org/show_bug.cgi?id=186287
732         <rdar://problem/40783352>
733
734         Reviewed by Youenn Fablet.
735
736         Tests: http/wpt/cross-origin-window-policy/allow-postmessage-from-deny.html
737                http/wpt/cross-origin-window-policy/allow-postmessage.html
738                http/wpt/cross-origin-window-policy/cross-origin-window-policy-header.html
739                http/wpt/cross-origin-window-policy/navigation-from-opener-via-open-target.html
740                http/wpt/cross-origin-window-policy/navigation-from-subframe-via-anchor-target.html
741
742         * bindings/js/JSDOMBindingSecurity.cpp:
743         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginWindowPolicy):
744         * bindings/js/JSDOMBindingSecurity.h:
745         * bindings/js/JSDOMWindowCustom.cpp:
746         (WebCore::effectiveCrossOriginWindowPolicyForAccess):
747         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
748         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
749         (WebCore::addCrossOriginWindowPropertyNames):
750         (WebCore::addScopedChildrenIndexes):
751         * bindings/scripts/CodeGeneratorJS.pm:
752         (GenerateAttributeGetterBodyDefinition):
753         (GetCrossOriginsOptionsFromExtendedAttributeValue):
754         (GenerateAttributeSetterBodyDefinition):
755         (GenerateOperationBodyDefinition):
756         * bindings/scripts/IDLAttributes.json:
757         * dom/Document.cpp:
758         (WebCore::Document::canNavigate):
759         * loader/FrameLoader.cpp:
760         (WebCore::FrameLoader::didBeginDocument):
761         * page/AbstractDOMWindow.cpp:
762         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
763         * page/AbstractDOMWindow.h:
764         (WebCore::AbstractDOMWindow::crossOriginWindowPolicy):
765         (WebCore::AbstractDOMWindow::setCrossOriginWindowPolicy):
766         * page/DOMWindow.idl:
767         * page/Settings.yaml:
768         * platform/network/HTTPHeaderNames.in:
769         * platform/network/HTTPParsers.cpp:
770         (WebCore::parseCrossOriginWindowPolicyHeader):
771         * platform/network/HTTPParsers.h:
772
773 2018-06-04  Brent Fulgham  <bfulgham@apple.com>
774
775         REGRESSION(r231291): InputType should hold a WeakPtr to its HTMLInputElement
776         https://bugs.webkit.org/show_bug.cgi?id=186096
777         <rdar://problem/40651015>
778
779         Reviewed by Ryosuke Niwa.
780
781         Now that the InputType may be kept alive as part of in-flight form submissions, we
782         shouldn't assume that the referenced HTMLInputElement is still valid before using it.
783
784         The only time we should be lacking a referencing element is in cases where the InputType
785         is changing, either through a change in the HTMLInputElement's type attribute. In those
786         cases we should check for a valid HTMLInputElement. In other cases, we should ASSERT.
787
788         * html/BaseButtonInputType.cpp:
789         (WebCore::BaseButtonInputType::createInputRenderer):
790         (WebCore::BaseButtonInputType::setValue):
791         * html/BaseCheckableInputType.cpp:
792         (WebCore::BaseCheckableInputType::saveFormControlState const):
793         (WebCore::BaseCheckableInputType::restoreFormControlState):
794         (WebCore::BaseCheckableInputType::appendFormData const):
795         (WebCore::BaseCheckableInputType::handleKeydownEvent):
796         (WebCore::BaseCheckableInputType::accessKeyAction):
797         (WebCore::BaseCheckableInputType::setValue):
798         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
799         (WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): Add a nullptr check
800         here, since this is called directly by code that causes the old InputType to be removed,
801         which could leave us with a nullptr element().
802         * html/BaseClickableWithKeyInputType.cpp:
803         (WebCore::BaseClickableWithKeyInputType::handleKeydownEvent):
804         (WebCore::BaseClickableWithKeyInputType::handleKeypressEvent):
805         (WebCore::BaseClickableWithKeyInputType::accessKeyAction):
806         * html/BaseDateAndTimeInputType.cpp:
807         (WebCore::BaseDateAndTimeInputType::attributeChanged): Add a nullptr check
808         here, since this is called directly by code that causes the old InputType to be removed,
809         which could leave us with a nullptr element().
810         * html/BaseTextInputType.cpp:
811         (WebCore::BaseTextInputType::patternMismatch const):
812         * html/CheckboxInputType.cpp:
813         (WebCore::CheckboxInputType::valueMissing const):
814         (WebCore::CheckboxInputType::willDispatchClick):
815         (WebCore::CheckboxInputType::didDispatchClick):
816         (WebCore::CheckboxInputType::shouldAppearIndeterminate const):
817         * html/ColorInputType.cpp:
818         (WebCore::ColorInputType::valueAsColor const):
819         (WebCore::ColorInputType::createShadowSubtree):
820         (WebCore::ColorInputType::handleDOMActivateEvent):
821         (WebCore::ColorInputType::didChooseColor):
822         (WebCore::ColorInputType::updateColorSwatch):
823         (WebCore::ColorInputType::shadowColorSwatch const):
824         (WebCore::ColorInputType::elementRectRelativeToRootView const):
825         (WebCore::ColorInputType::shouldShowSuggestions const):
826         (WebCore::ColorInputType::suggestions const):
827         * html/EmailInputType.cpp:
828         (WebCore::EmailInputType::typeMismatchFor const):
829         (WebCore::EmailInputType::typeMismatch const):
830         (WebCore::EmailInputType::typeMismatchText const):
831         (WebCore::EmailInputType::sanitizeValue const):
832         * html/FileInputType.cpp:
833         (WebCore::FileInputType::appendFormData const):
834         (WebCore::FileInputType::attributeChanged): Add a nullptr check here, since
835         this is called directly by code that causes the old InputType to be removed,
836         which could leave us with a nullptr element().
837         (WebCore::FileInputType::valueMissing const):
838         (WebCore::FileInputType::valueMissingText const):
839         (WebCore::FileInputType::handleDOMActivateEvent):
840         (WebCore::FileInputType::createInputRenderer):
841         (WebCore::FileInputType::setValue):
842         (WebCore::FileInputType::createShadowSubtree):
843         (WebCore::FileInputType::disabledAttributeChanged):
844         (WebCore::FileInputType::multipleAttributeChanged):
845         (WebCore::FileInputType::allowsDirectories const):
846         (WebCore::FileInputType::setFiles):
847         (WebCore::FileInputType::iconLoaded):
848         (WebCore::FileInputType::receiveDroppedFiles):
849         (WebCore::FileInputType::defaultToolTip const):
850         * html/HTMLInputElement.h:
851         (WebCore::HTMLInputElement::weakPtrFactory const):
852         * html/HiddenInputType.cpp:
853         (WebCore::HiddenInputType::saveFormControlState const):
854         (WebCore::HiddenInputType::restoreFormControlState):
855         (WebCore::HiddenInputType::setValue):
856         (WebCore::HiddenInputType::appendFormData const):
857         * html/ImageInputType.cpp:
858         (WebCore::ImageInputType::appendFormData const):
859         (WebCore::ImageInputType::handleDOMActivateEvent):
860         (WebCore::ImageInputType::createInputRenderer):
861         (WebCore::ImageInputType::altAttributeChanged):
862         (WebCore::ImageInputType::srcAttributeChanged):
863         (WebCore::ImageInputType::attach):
864         (WebCore::ImageInputType::height const):
865         (WebCore::ImageInputType::width const):
866         * html/InputType.cpp:
867         (WebCore::InputType::saveFormControlState const):
868         (WebCore::InputType::restoreFormControlState):
869         (WebCore::InputType::isFormDataAppendable const):
870         (WebCore::InputType::appendFormData const):
871         (WebCore::InputType::sizeShouldIncludeDecoration const):
872         (WebCore::InputType::validationMessage const):
873         (WebCore::InputType::createInputRenderer):
874         (WebCore::InputType::blur):
875         (WebCore::InputType::destroyShadowSubtree):
876         (WebCore::InputType::dispatchSimulatedClickIfActive const):
877         (WebCore::InputType::chrome const):
878         (WebCore::InputType::isKeyboardFocusable const):
879         (WebCore::InputType::isMouseFocusable const):
880         (WebCore::InputType::accessKeyAction):
881         (WebCore::InputType::setValue):
882         (WebCore::InputType::visibleValue const):
883         (WebCore::InputType::applyStep):
884         (WebCore::InputType::stepUpFromRenderer):
885         * html/InputType.h:
886         (WebCore::InputType::InputType):
887         (WebCore::InputType::element const):
888         * html/NumberInputType.cpp:
889         (WebCore::NumberInputType::attributeChanged): Add a nullptr check here, since
890         this is called directly by code that causes the old InputType to be removed,
891         which could leave us with a nullptr element().
892         (WebCore::NumberInputType::setValue):
893         (WebCore::NumberInputType::valueAsDouble const):
894         (WebCore::NumberInputType::setValueAsDouble const):
895         (WebCore::NumberInputType::setValueAsDecimal const):
896         (WebCore::NumberInputType::typeMismatch const):
897         (WebCore::NumberInputType::createStepRange const):
898         (WebCore::NumberInputType::sizeShouldIncludeDecoration const):
899         (WebCore::NumberInputType::decorationWidth const):
900         (WebCore::NumberInputType::localizeValue const):
901         (WebCore::NumberInputType::visibleValue const):
902         (WebCore::NumberInputType::convertFromVisibleValue const):
903         (WebCore::NumberInputType::hasBadInput const):
904         (WebCore::NumberInputType::minOrMaxAttributeChanged):
905         (WebCore::NumberInputType::stepAttributeChanged):
906         * html/RadioInputType.cpp:
907         (WebCore::RadioInputType::valueMissing const):
908         (WebCore::RadioInputType::handleKeydownEvent):
909         (WebCore::RadioInputType::handleKeyupEvent):
910         (WebCore::RadioInputType::isKeyboardFocusable const):
911         (WebCore::RadioInputType::shouldSendChangeEventAfterCheckedChanged):
912         (WebCore::RadioInputType::willDispatchClick):
913         (WebCore::RadioInputType::didDispatchClick):
914         (WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
915         * html/RangeInputType.cpp:
916         (WebCore::RangeInputType::attributeChanged): Add a nullptr check here, since
917         this is called directly by code that causes the old InputType to be removed,
918         which could leave us with a nullptr element().
919         (WebCore::RangeInputType::valueAsDouble const):
920         (WebCore::RangeInputType::setValueAsDecimal const):
921         (WebCore::RangeInputType::createStepRange const):
922         (WebCore::RangeInputType::handleMouseDownEvent):
923         (WebCore::RangeInputType::handleTouchEvent):
924         (WebCore::RangeInputType::handleKeydownEvent):
925         (WebCore::RangeInputType::createShadowSubtree):
926         (WebCore::RangeInputType::sliderTrackElement const):
927         (WebCore::RangeInputType::createInputRenderer):
928         (WebCore::RangeInputType::accessKeyAction):
929         (WebCore::RangeInputType::minOrMaxAttributeChanged):
930         (WebCore::RangeInputType::setValue):
931         (WebCore::RangeInputType::updateTickMarkValues):
932         * html/ResetInputType.cpp:
933         (WebCore::ResetInputType::handleDOMActivateEvent):
934         * html/SearchInputType.cpp:
935         (WebCore::SearchInputType::addSearchResult):
936         (WebCore::SearchInputType::maxResultsAttributeChanged):
937         (WebCore::SearchInputType::createInputRenderer):
938         (WebCore::SearchInputType::createShadowSubtree):
939         (WebCore::SearchInputType::handleKeydownEvent):
940         (WebCore::SearchInputType::startSearchEventTimer):
941         (WebCore::SearchInputType::searchEventTimerFired):
942         (WebCore::SearchInputType::searchEventsShouldBeDispatched const):
943         (WebCore::SearchInputType::didSetValueByUserEdit):
944         (WebCore::SearchInputType::sizeShouldIncludeDecoration const):
945         * html/SubmitInputType.cpp:
946         (WebCore::SubmitInputType::appendFormData const):
947         (WebCore::SubmitInputType::handleDOMActivateEvent):
948         * html/TextFieldInputType.cpp:
949         (WebCore::TextFieldInputType::attributeChanged): Add a nullptr check here, since
950         this is called directly by code that causes the old InputType to be removed,
951         which could leave us with a nullptr element().
952         (WebCore::TextFieldInputType::isKeyboardFocusable const):
953         (WebCore::TextFieldInputType::isMouseFocusable const):
954         (WebCore::TextFieldInputType::valueMissing const):
955         (WebCore::TextFieldInputType::setValue):
956         (WebCore::TextFieldInputType::handleKeydownEvent):
957         (WebCore::TextFieldInputType::handleKeydownEventForSpinButton):
958         (WebCore::TextFieldInputType::forwardEvent):
959         (WebCore::TextFieldInputType::elementDidBlur):
960         (WebCore::TextFieldInputType::handleFocusEvent):
961         (WebCore::TextFieldInputType::handleBlurEvent):
962         (WebCore::TextFieldInputType::createInputRenderer):
963         (WebCore::TextFieldInputType::shouldHaveSpinButton const):
964         (WebCore::TextFieldInputType::shouldHaveCapsLockIndicator const):
965         (WebCore::TextFieldInputType::createShadowSubtree):
966         (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
967         (WebCore::TextFieldInputType::updatePlaceholderText):
968         (WebCore::TextFieldInputType::appendFormData const):
969         (WebCore::TextFieldInputType::subtreeHasChanged):
970         (WebCore::TextFieldInputType::didSetValueByUserEdit):
971         (WebCore::TextFieldInputType::updateInnerTextValue):
972         (WebCore::TextFieldInputType::focusAndSelectSpinButtonOwner):
973         (WebCore::TextFieldInputType::shouldSpinButtonRespondToMouseEvents):
974         (WebCore::TextFieldInputType::shouldSpinButtonRespondToWheelEvents):
975         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const):
976         (WebCore::TextFieldInputType::shouldDrawAutoFillButton const):
977         (WebCore::TextFieldInputType::autoFillButtonElementWasClicked):
978         (WebCore::TextFieldInputType::createContainer):
979         (WebCore::TextFieldInputType::createAutoFillButton):
980         (WebCore::TextFieldInputType::updateAutoFillButton):
981         * html/URLInputType.cpp:
982         (WebCore::URLInputType::typeMismatch const):
983
984 2018-06-04  Chris Dumez  <cdumez@apple.com>
985
986         Unreviewed iOS build fix with recent SDKs.
987
988         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
989         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
990
991 2018-06-04  Dean Jackson  <dino@apple.com>
992
993         AR Badging on transparent thumbnail images makes the glyph look really dark
994         https://bugs.webkit.org/show_bug.cgi?id=186289
995         <rdar://problem/40627111>
996
997         Reviewed by Anders Carlsson.
998
999         Clip out the shape for the drop shadow, so that it isn't visible if
1000         there is transparent pixel data on top of it.
1001
1002         * rendering/RenderThemeIOS.mm:
1003         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
1004
1005 2018-06-04  Timothy Hatcher  <timothy@apple.com>
1006
1007         Selection color is dark when using Safari in dark mode.
1008
1009         https://bugs.webkit.org/show_bug.cgi?id=186288
1010         rdar://problem/38438625
1011
1012         Reviewed by Simon Fraser.
1013
1014         Pass StyleColor::Options to all of the selection color functions.
1015         Removed supportsSelectionForegroundColors() from RenderThemeMac,
1016         to get the default of true, since the forground colors in dark mode
1017         can be different now. Use new semantic color methods on NSColor.
1018
1019         * rendering/RenderElement.cpp:
1020         (WebCore::RenderElement::selectionColor const):
1021         (WebCore::RenderElement::selectionBackgroundColor const):
1022         * rendering/RenderListBox.cpp:
1023         (WebCore::RenderListBox::paintItemForeground):
1024         (WebCore::RenderListBox::paintItemBackground):
1025         * rendering/RenderTheme.cpp:
1026         (WebCore::RenderTheme::activeSelectionBackgroundColor const):
1027         (WebCore::RenderTheme::inactiveSelectionBackgroundColor const):
1028         (WebCore::RenderTheme::activeSelectionForegroundColor const):
1029         (WebCore::RenderTheme::inactiveSelectionForegroundColor const):
1030         (WebCore::RenderTheme::activeListBoxSelectionBackgroundColor const):
1031         (WebCore::RenderTheme::activeListBoxSelectionForegroundColor const):
1032         (WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor const):
1033         (WebCore::RenderTheme::platformActiveSelectionBackgroundColor const):
1034         (WebCore::RenderTheme::platformActiveSelectionForegroundColor const):
1035         (WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const):
1036         (WebCore::RenderTheme::platformInactiveSelectionForegroundColor const):
1037         (WebCore::RenderTheme::platformActiveListBoxSelectionBackgroundColor const):
1038         (WebCore::RenderTheme::platformActiveListBoxSelectionForegroundColor const):
1039         (WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const):
1040         (WebCore::RenderTheme::platformInactiveListBoxSelectionForegroundColor const):
1041         * rendering/RenderTheme.h:
1042         * rendering/RenderThemeGtk.cpp:
1043         (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor const):
1044         (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor const):
1045         (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor const):
1046         (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor const):
1047         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor const):
1048         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor const):
1049         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor const):
1050         * rendering/RenderThemeGtk.h:
1051         * rendering/RenderThemeIOS.h:
1052         * rendering/RenderThemeIOS.mm:
1053         (WebCore::RenderThemeIOS::platformActiveSelectionBackgroundColor const):
1054         (WebCore::RenderThemeIOS::platformInactiveSelectionBackgroundColor const):
1055         * rendering/RenderThemeMac.h:
1056         * rendering/RenderThemeMac.mm:
1057         (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const):
1058         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
1059         (WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
1060         (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
1061         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
1062         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
1063         (WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const):
1064         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
1065         * rendering/RenderThemeWin.cpp:
1066         (WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const):
1067         (WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const):
1068         (WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const):
1069         (WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):
1070         * rendering/RenderThemeWin.h:
1071
1072 2018-06-04  Chris Dumez  <cdumez@apple.com>
1073
1074         Update Fetch code to provide more useful exception messages
1075         https://bugs.webkit.org/show_bug.cgi?id=186156
1076
1077         Reviewed by Youenn Fablet.
1078
1079         Provide more useful error messages in our Loading / Fetch code.
1080
1081         * Modules/fetch/FetchBodyOwner.cpp:
1082         (WebCore::FetchBodyOwner::arrayBuffer):
1083         (WebCore::FetchBodyOwner::blob):
1084         (WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
1085         (WebCore::FetchBodyOwner::formData):
1086         (WebCore::FetchBodyOwner::json):
1087         (WebCore::FetchBodyOwner::text):
1088         * Modules/fetch/FetchHeaders.cpp:
1089         (WebCore::canWriteHeader):
1090         (WebCore::FetchHeaders::get const):
1091         (WebCore::FetchHeaders::has const):
1092         * Modules/fetch/FetchRequest.cpp:
1093         (WebCore::FetchRequest::setBody):
1094         (WebCore::FetchRequest::clone):
1095         * Modules/fetch/FetchResponse.cpp:
1096         (WebCore::FetchResponse::redirect):
1097         (WebCore::FetchResponse::clone):
1098         * workers/service/context/ServiceWorkerFetch.cpp:
1099         (WebCore::ServiceWorkerFetch::processResponse):
1100         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
1101         * workers/service/context/ServiceWorkerFetch.h:
1102
1103 2018-06-04  Daniel Bates  <dabates@apple.com>
1104
1105         Update Strong Password appearance
1106         https://bugs.webkit.org/show_bug.cgi?id=186239
1107         <rdar://problem/38183795>
1108
1109         Reviewed by Brent Fulgham.
1110
1111         Fix up the gradient mask to start half-way through the visible text and size it to the
1112         width of the visible text. Also change the color of the Strong Password label to 80% black.
1113
1114         We achieve sizing of the gradient to the width of the visible text by changing the CSS display
1115         of the inner text element to be an inline-block and specifying "max-width: 100%" so that
1116         its maximum width is less than or equal to the width of its containing block. Additionally,
1117         only apply strong password-specific inner text element styles when the field is not disabled
1118         or read-only and has a strong password appearance. Otherwise these styles, specifically the
1119         display type, will adversely effect rendering of the text when the field is disabled or readonly.
1120
1121         * css/html.css:
1122         (input::-webkit-strong-password-auto-fill-button):
1123         * html/HTMLInputElement.cpp:
1124         (WebCore::autoFillStrongPasswordMaskImage):
1125         (WebCore::HTMLInputElement::createInnerTextStyle):
1126
1127 2018-06-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1128
1129         [WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag
1130         https://bugs.webkit.org/show_bug.cgi?id=186279
1131
1132         Reviewed by Tim Horton.
1133
1134         Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS). No change in behavior.
1135
1136         * Modules/mediacontrols/MediaControlsHost.cpp:
1137         (WebCore::MediaControlsHost::compactMode const):
1138         * html/HTMLMediaElement.cpp:
1139         (WebCore::HTMLMediaElement::updatePlayState):
1140         * page/Page.cpp:
1141         (WebCore::relevantViewRect):
1142         * page/SettingsBase.cpp:
1143         (WebCore::SettingsBase::defaultMinimumZoomFontSize):
1144         (WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled):
1145         * page/ViewportConfiguration.cpp:
1146         (WebCore::platformDeviceWidthOverride):
1147         (WebCore::shouldOverrideShrinkToFitArgument):
1148         (WebCore::needsUpdateAfterChangingDisabledAdaptations):
1149         * platform/LocalizedStrings.cpp:
1150         * platform/LocalizedStrings.h:
1151         * platform/audio/ios/MediaSessionManagerIOS.mm:
1152         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
1153         (-[WebMediaSessionHelper dealloc]):
1154         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
1155         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1156         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
1157         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1158         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
1159         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1160         (WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):
1161         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1162         (-[WebAVPlayerViewController initWithFullscreenInterface:]):
1163         (-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
1164         (-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
1165         (-[WebAVPlayerViewController MY_NO_RETURN]):
1166         (-[WebAVPlayerViewController isPictureInPicturePossible]):
1167         (-[WebAVPlayerViewController isPictureInPictureActive]):
1168         (-[WebAVPlayerViewController pictureInPictureActive]):
1169         (-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
1170         (-[WebAVPlayerViewController showsPlaybackControls]):
1171         (-[WebAVPlayerViewController setShowsPlaybackControls:]):
1172         (-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
1173         (-[WebAVPlayerViewController setDelegate:]):
1174         (VideoFullscreenInterfaceAVKit::setupFullscreen):
1175         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1176         (VideoFullscreenInterfaceAVKit::doSetup):
1177         (WebCore::supportsPictureInPicture):
1178         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1179         (VideoFullscreenControllerContext::willExitFullscreen):
1180         * rendering/RenderThemeIOS.h:
1181         * rendering/RenderThemeIOS.mm:
1182
1183 2018-06-04  Youenn Fablet  <youenn@apple.com>
1184
1185         [WK1] Add an option to restrict communication to localhost sockets
1186         https://bugs.webkit.org/show_bug.cgi?id=186249
1187
1188         Reviewed by Eric Carlson.
1189
1190         Covered by existing tests.
1191         Set explicitly webrtc socket IP address to 127.0.0.1 in testing mode.
1192         For that purpose, we need WK1 to create a wrapper around a socket factory,
1193         this wrapper being responsible of setting or not the IP address to 127.0.0.1.
1194
1195         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1196         (WebCore::prepareSocketAddress):
1197         (WebCore::BasicPacketSocketFactory::BasicPacketSocketFactory):
1198         (WebCore::BasicPacketSocketFactory::setDisableNonLocalhostConnections):
1199         (WebCore::BasicPacketSocketFactory::CreateClientTcpSocket):
1200         (WebCore::LibWebRTCProvider::createPeerConnection):
1201         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1202
1203 2018-06-04  Zalan Bujtas  <zalan@apple.com>
1204
1205         [LFC] Merge width and margin computation for block-level, non-replaced and inline,replaced element in normal flow
1206         https://bugs.webkit.org/show_bug.cgi?id=186225
1207
1208         Reviewed by Antti Koivisto.
1209
1210         This patch merges the width and horizontal margin computation for
1211         https://www.w3.org/TR/CSS22/visudet.html#inline-replaced-width and https://www.w3.org/TR/CSS22/visudet.html#blockwidth
1212
1213         * layout/FormattingContextGeometry.cpp:
1214         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1215         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1216         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1217
1218 2018-06-01  Zalan Bujtas  <zalan@apple.com>
1219
1220         [LFC] Merge width and horizontal margin computation
1221         https://bugs.webkit.org/show_bug.cgi?id=186217
1222
1223         Reviewed by Antti Koivisto.
1224
1225         We could certainly compute width and maring separately, but to match each steps defined
1226         at https://www.w3.org/TR/CSS22/visudet.html, we should just merge width and horizontal margin computations
1227         (followed by height and vertical margins).
1228         Use 0 computed marings for now.
1229
1230         * layout/FormattingContext.cpp:
1231         (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
1232         (WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const):
1233         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
1234         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1235         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const): Deleted.
1236         (WebCore::Layout::FormattingContext::computeFloatingWidth const): Deleted.
1237         * layout/FormattingContext.h:
1238         * layout/FormattingContextGeometry.cpp:
1239         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin):
1240         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin):
1241         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1242         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1243         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin):
1244         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
1245         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1246         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
1247         (WebCore::Layout::outOfFlowNonReplacedWidth): Deleted.
1248         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth): Deleted.
1249         (WebCore::Layout::floatingNonReplacedWidth): Deleted.
1250         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth): Deleted.
1251         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidth): Deleted.
1252         (WebCore::Layout::FormattingContext::Geometry::floatingWidth): Deleted.
1253         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth): Deleted.
1254         * layout/LayoutContext.cpp:
1255         (WebCore::Layout::LayoutContext::initializeRoot):
1256         * layout/blockformatting/BlockFormattingContext.cpp:
1257         (WebCore::Layout::BlockFormattingContext::layout const):
1258         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1259         (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
1260         (WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted.
1261         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const): Deleted.
1262         (WebCore::Layout::BlockFormattingContext::computeMargin const): Deleted.
1263         * layout/blockformatting/BlockFormattingContext.h:
1264         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1265         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1266         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1267         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth): Deleted.
1268         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidth): Deleted.
1269         (WebCore::Layout::BlockFormattingContext::Geometry::computedMargin): Deleted.
1270         * layout/displaytree/DisplayBox.cpp:
1271         (WebCore::Display::Box::marginBox const):
1272         * layout/displaytree/DisplayBox.h:
1273         (WebCore::Display::Box::setHasValidVerticalMargin):
1274         (WebCore::Display::Box::setHasValidHorizontalMargin):
1275         (WebCore::Display::Box::invalidateMargin):
1276         (WebCore::Display::Box::setHorizontalMargin):
1277         (WebCore::Display::Box::setVerticalMargin):
1278         (WebCore::Display::Box::marginTop const):
1279         (WebCore::Display::Box::marginLeft const):
1280         (WebCore::Display::Box::marginBottom const):
1281         (WebCore::Display::Box::marginRight const):
1282         (WebCore::Display::Box::Edges::Edges): Deleted.
1283         (WebCore::Display::Box::setHasValidMargin): Deleted.
1284         (WebCore::Display::Box::setMargin): Deleted.
1285
1286 2018-06-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1287
1288         REGRESSION(r232338): [GTK] Broke a few layout tests
1289         https://bugs.webkit.org/show_bug.cgi?id=186244
1290
1291         Unreviewed, also rollout r232392.
1292
1293         * rendering/RenderTheme.cpp:
1294         (WebCore::RenderTheme::adjustStyle):
1295         * rendering/RenderTheme.h:
1296         (WebCore::RenderTheme::adjustListboxStyle const): Deleted.
1297         * rendering/RenderThemeGtk.cpp:
1298         (WebCore::RenderThemeGtk::adjustListboxStyle const): Deleted.
1299         * rendering/RenderThemeGtk.h:
1300
1301 2018-06-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1302
1303         REGRESSION(r232338): [GTK] Broke a few layout tests
1304         https://bugs.webkit.org/show_bug.cgi?id=186244
1305
1306         Unreviewed, rollout r232338.
1307
1308         * platform/gtk/RenderThemeGadget.cpp:
1309         (WebCore::RenderThemeGadget::RenderThemeGadget):
1310         (WebCore::baseStyleContext): Deleted.
1311         * rendering/RenderThemeGtk.cpp:
1312         (WebCore::RenderThemeGtk::adjustButtonStyle const):
1313         (WebCore::RenderThemeGtk::adjustTextFieldStyle const):
1314         (WebCore::RenderThemeGtk::adjustSearchFieldStyle const):
1315         (WebCore::styleColor):
1316         (WebCore::RenderThemeGtk::adjustTextAreaStyle const): Deleted.
1317         * rendering/RenderThemeGtk.h:
1318
1319 2018-06-03  Eric Carlson  <eric.carlson@apple.com>
1320
1321         [iOS] MediaPlayer.framework is not always available
1322         https://bugs.webkit.org/show_bug.cgi?id=186220
1323         <rdar://problem/40571286>
1324
1325         Reviewed by Tim Horton.
1326
1327         * platform/ios/RemoteCommandListenerIOS.mm:
1328         (WebCore::RemoteCommandListener::create):
1329
1330 2018-06-02  Darin Adler  <darin@apple.com>
1331
1332         [Cocoa] Update some code to be more ARC-compatible to prepare for future ARC adoption
1333         https://bugs.webkit.org/show_bug.cgi?id=186227
1334
1335         Reviewed by Dan Bernstein.
1336
1337         * bridge/objc/objc_instance.mm:
1338         (ObjcInstance::~ObjcInstance): Use @autoreleasepool instead of NSAutoreleasePool.
1339         * platform/ios/wak/WAKView.mm:
1340         (-[WAKView _appendDescriptionToString:atLevel:]): Ditto.
1341
1342 2018-06-03  Zan Dobersek  <zdobersek@igalia.com>
1343
1344         [WebGL] GL_EXT_robustness utilization should depend on CONTEXT_ROBUST_ACCESS value
1345         https://bugs.webkit.org/show_bug.cgi?id=186187
1346
1347         Reviewed by Carlos Garcia Campos.
1348
1349         Don't utilize the GL_EXT_robustness extension for reading pixels from
1350         the GPU if the underlying OpenGL context did not enable robust access
1351         support upon creation. For EGL contexts, this would be done by passing
1352         EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT and EGL_TRUE key-value pair in the
1353         attribute list passed to eglCreateContext() (as specified in the
1354         EGL_EXT_create_context_robustness extension), but at the moment this
1355         capability is not utilized.
1356
1357         As such, on drivers that implement GL_EXT_robustness support, pixel
1358         reads done in WebGLRenderingContextBase end up using glReadnPixels(),
1359         but that fails to successfully read anything due to the context
1360         rejecting such calls.
1361
1362         GL_EXT_robustness is specific to OpenGL ES versions, so to fix this,
1363         Extensions3DOpenGLES overrides the isEnabled() method. That override
1364         returns false immediately if the inherited isEnabled() implementation
1365         returns false. Otherwise it returns true, unless the tested extension
1366         is GL_EXT_robustness, in which case we now check that the context's
1367         CONTEXT_ROBUST_ACCESS state value is true, meaning the context was
1368         created with robust access support enabled.
1369
1370         No new tests are possible because this is optional driver-provided
1371         functionality that Web content cannot have effect on.
1372
1373         * platform/graphics/Extensions3D.h:
1374         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
1375         (WebCore::Extensions3DOpenGLES::isEnabled):
1376         * platform/graphics/opengl/Extensions3DOpenGLES.h:
1377
1378 2018-06-01  Ryosuke Niwa  <rniwa@webkit.org>
1379
1380         Editor can hold references to Documents after you navigate away
1381         https://bugs.webkit.org/show_bug.cgi?id=186215
1382
1383         Reviewed by Simon Fraser.
1384
1385         Clear the various member variables that can hold onto a document in Editor::clear and FrameSelection::prepareForDestruction.
1386
1387         Test: editing/selection/navigation-clears-editor-state.html
1388
1389         * editing/Editor.cpp:
1390         (WebCore::Editor::clear):
1391         * editing/Editor.h:
1392         * editing/FrameSelection.cpp:
1393         (WebCore::FrameSelection::FrameSelection):
1394         (WebCore::FrameSelection::prepareForDestruction):
1395         * editing/FrameSelection.h:
1396
1397 2018-06-01  Ryosuke Niwa  <rniwa@webkit.org>
1398
1399         ResourceLoader::cancel() shouldn't synchronously fire load event on document
1400         https://bugs.webkit.org/show_bug.cgi?id=185284
1401
1402         Revert the erroneous change to SSFontSelector::beginLoadTimerFired(), which broke CancelLoading.CancelFontSubresource.
1403         FrameLoader::loadDone calls checkCompleted, not checkLoadComplete so we still need to call checkLoadComplete here.
1404
1405         * css/CSSFontSelector.cpp:
1406         (WebCore::CSSFontSelector::beginLoadTimerFired): 
1407
1408 2018-06-01  Jeremy Jones  <jeremyj@apple.com>
1409
1410         Keyboard focus should exit fullscreen.
1411         https://bugs.webkit.org/show_bug.cgi?id=185617
1412         rdar://problem/34697938
1413
1414         Reviewed by Ryosuke Niwa.
1415
1416         No opensource test because feature is not enabled.
1417
1418         While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.
1419
1420         Improve fullscreen testability by exposing isAnimatingFullScreen.
1421
1422         * dom/Document.h:
1423         * testing/Internals.cpp:
1424         (WebCore::Internals::isAnimatingFullScreen const):
1425         * testing/Internals.h:
1426         * testing/Internals.idl:
1427
1428 2018-06-01  Jeremy Jones  <jeremyj@apple.com>
1429
1430         Don't continue playing in background when auto-picture-in-picture is disabled.
1431         https://bugs.webkit.org/show_bug.cgi?id=186089
1432         rdar://problem/40314314
1433
1434         Reviewed by Eric Carlson.
1435
1436         No new tests because we don't have a way to test auto-pip.
1437
1438         With the refactoring work done in VideoFullscreenInterfaceAVKit, HTMLMediaElement no longer has to anticipate 
1439         auto-pip when if it should pause on suspend. Instead VideoFullscreenInterfaceAVKit proactively updates 
1440         videoFullscreenMode, so checking for PIP is sufficient.
1441
1442         * html/HTMLMediaElement.cpp:
1443         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
1444
1445 2018-06-01  Chris Dumez  <cdumez@apple.com>
1446
1447         REGRESSION (r231456): Colloquy is broken
1448         https://bugs.webkit.org/show_bug.cgi?id=186197
1449         <rdar://problem/40722960>
1450
1451         Reviewed by Timothy Hatcher.
1452
1453         Restore pre-r231456 behavior for Colloquy app so that it works again.
1454
1455         * html/HTMLFrameElementBase.cpp:
1456         (WebCore::HTMLFrameElementBase::openURL):
1457         * page/Settings.yaml:
1458
1459 2018-06-01  Chris Dumez  <cdumez@apple.com>
1460
1461         Regression(r230567): Unable to log into twitter.com in private sessions
1462         https://bugs.webkit.org/show_bug.cgi?id=186205
1463         <rdar://problem/40670799>
1464
1465         Reviewed by Youenn Fablet.
1466
1467         We were using the same SWServer for all private sessions and the SWServer's sessionID would
1468         be legacyPrivateSessionID(). As a result, the service worker's sessionID would be legacyPrivateSessionID()
1469         as well and would not match the sessionID of its client pages. This sessionID mismatch was
1470         causing the breakage.
1471
1472         Instead of using the same SWServer of all private sessions, we now go back to using a SWServer
1473         per private session. However, we now make sure that the SWServer gets destroyed whenever its
1474         corresponding session gets destroyed.
1475
1476         * workers/service/server/SWServer.cpp:
1477         (WebCore::SWServer::~SWServer):
1478
1479 2018-06-01  Youenn Fablet  <youenn@apple.com>
1480
1481         Add an option to restrict communication to localhost sockets
1482         https://bugs.webkit.org/show_bug.cgi?id=186208
1483
1484         Reviewed by Eric Carlson.
1485
1486         Covered by existing tests.
1487         Add an option in LibWebRTCProvider to restrict to localhost sockets.
1488         Use that option when Internals is used.
1489
1490         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1491         * testing/Internals.cpp:
1492         (WebCore::Internals::resetToConsistentState):
1493
1494 2018-06-01  Ryosuke Niwa  <rniwa@webkit.org>
1495
1496         ResourceLoader::cancel() shouldn't synchronously fire load event on document
1497         https://bugs.webkit.org/show_bug.cgi?id=185284
1498
1499         Reviewed by Antti Koivisto.
1500
1501         Because a resource loading can be canceled as a node is removed a document or CachedResource is destructed,
1502         it's not safe to synchronously fire load event on document upon cancelation. This patch makes the cancellation
1503         of a resource load schedule m_checkTimer in FrameLoader to fire a load event asynchronously instead.
1504
1505         Specifically, this patch makes FrameLoader::loadDone call FrameLoader::scheduleCheckCompleted when the load
1506         had failed or cancled instead of calling FrameLoader::checkCompleted which can synchronously fire load event.
1507         To differentiate the two cases, new enum LoadCompletionType has been added to FrameLoader::loadDone and related
1508         functions. To avoid calling the navigation delegate too early, the same abstraction for checkLoadComplete()
1509         has been added in the form of FrameLoader::subresourceLoadDone.
1510
1511         Unfortunately, delaying calls to checkCompleted() and checkLoadComplete() by a timer can result in client
1512         callbacks such as didFinishLoadForFrame and didFailLoadWithError to never get called when the frame gets
1513         detached from the parent after the last resource had stopped loading but before the timer fires. To preserve
1514         these deleagte callbacks, this patch expedites the timer in FrameLoader::frameDetached and Page::goToItem by
1515         by invoking newly added stopAllLoadersAndCheckCompleteness, which stops all loading and then immediately invokes
1516         checkCompleted() and checkLoadComplete() synchronously if m_checkTimer had been started.
1517
1518         Tests: http/tests/preload/dynamic_removing_preload.html
1519
1520         * css/CSSFontSelector.cpp:
1521         (WebCore::CSSFontSelector::beginLoadTimerFired): Removed superfluous call to checkLoadComplete since
1522         cachedResourceLoader's loadDone would call checkLoadComplete anyway.
1523         * html/HTMLFrameOwnerElement.cpp:
1524         (WebCore::HTMLFrameOwnerElement::disconnectContentFrame): Removed the misleading comment added in r140090.
1525         Firefox DOES indeed fire unload event in the content document of a removed frame. While this comment made
1526         it sound like this function isn't called when a frame is removed from the tree when in reality we simply
1527         remove a frame prior to removing the node via disconnectSubframesIfNeeded.
1528         * loader/DocumentLoader.cpp:
1529         (WebCore::DocumentLoader::removeSubresourceLoader):
1530         * loader/DocumentLoader.h:
1531         * loader/FrameLoader.cpp:
1532         (WebCore::FrameLoader::FrameLoader):
1533         (WebCore::FrameLoader::loadDone):
1534         (WebCore::FrameLoader::subresourceLoadDone):
1535         (WebCore::FrameLoader::checkCompleted): Added a release assert that this function is only called when it's safe
1536         to execute scripts.
1537         (WebCore::FrameLoader::checkTimerFired):
1538         (WebCore::FrameLoader::checkCompletenessNow):Extracted from checkTimerFired.
1539         (WebCore::FrameLoader::stopAllLoaders): Removed the code to stop m_checkTimer introduced in r53655.
1540         Stopping the timer here would prevent FrameLoader::frameDetached to detect the case when stopping the loader
1541         scheduled a load completion check. Also stopping this timer without clearing the corresponding booleans:
1542         m_checkingLoadCompleteForDetachment and m_checkingLoadCompleteForDetachment is problematic. The assertion
1543         r53655 addressed is now addressed by explicitly checking & clearing the timer in frameDetached.
1544         (WebCore::FrameLoader::stopAllLoadersAndCheckCompleteness): Added.
1545         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Avoid an early exit when the newly added boolean
1546         m_checkingLoadCompleteForDetachment is set since m_isStopping is no longer set in frameDetached in order
1547         to invoke didFailLoadWithError when detaching a frame.
1548         (WebCore::FrameLoader::frameDetached): Call checkCompletenessNow in the case the frame had already been
1549         completed loading. Also call stopAllLoadersAndCheckCompleteness in the case stopping loading would complete
1550         the loading before stopping active DOM objects.
1551         * loader/FrameLoader.h:
1552         (WebCore::FrameLoader::m_checkingLoadCompleteForDetachment): Added.
1553         * loader/FrameLoaderTypes.h:
1554         (WebCore::LoadCompletionType): Added.
1555         * loader/SubresourceLoader.cpp:
1556         (WebCore::SubresourceLoader::didFinishLoading):
1557         (WebCore::SubresourceLoader::didFail):
1558         (WebCore::SubresourceLoader::didCancel):
1559         (WebCore::SubresourceLoader::notifyDone):
1560         * loader/SubresourceLoader.h:
1561         * loader/cache/CachedResourceLoader.cpp:
1562         (WebCore::CachedResourceLoader::loadDone):
1563         * loader/cache/CachedResourceLoader.h:
1564         * page/Page.cpp:
1565         (WebCore::Page::goToItem): Call stopAllLoadersAndCheckCompleteness instead of stopAllLoaders since stopping
1566         loading here may complete loading.
1567
1568 2018-06-01  Sihui Liu  <sihui_liu@apple.com>
1569
1570         Stop using StorageTracker.db in LocalStorageDatabaseTracker
1571         https://bugs.webkit.org/show_bug.cgi?id=186104
1572
1573         Reviewed by Geoffrey Garen.
1574
1575         No behavior change.
1576
1577         * platform/sql/SQLiteFileSystem.h:
1578
1579 2018-06-01  Zalan Bujtas  <zalan@apple.com>
1580
1581         [LFC] Simplify the formatting class implementation by pushing down some of the logic to the Geometry class
1582         https://bugs.webkit.org/show_bug.cgi?id=186179
1583
1584         Reviewed by Antti Koivisto.
1585
1586         * layout/FormattingContext.cpp:
1587         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
1588         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
1589         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
1590         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
1591         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
1592         * layout/FormattingContext.h:
1593         * layout/FormattingContextGeometry.cpp:
1594         (WebCore::Layout::outOfFlowNonReplacedHeight):
1595         (WebCore::Layout::outOfFlowNonReplacedWidth):
1596         (WebCore::Layout::outOfFlowReplacedHeight):
1597         (WebCore::Layout::outOfFlowReplacedWidth):
1598         (WebCore::Layout::floatingNonReplacedHeight):
1599         (WebCore::Layout::floatingNonReplacedWidth):
1600         (WebCore::Layout::floatingReplacedHeight):
1601         (WebCore::Layout::floatingReplacedWidth):
1602         (WebCore::Layout::outOfFlowNonReplacedPosition):
1603         (WebCore::Layout::outOfFlowReplacedPosition):
1604         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeight):
1605         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidth):
1606         (WebCore::Layout::FormattingContext::Geometry::floatingHeight):
1607         (WebCore::Layout::FormattingContext::Geometry::floatingWidth):
1608         (WebCore::Layout::FormattingContext::Geometry::outOfFlowPosition):
1609         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight):
1610         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth):
1611         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeight): Deleted.
1612         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidth): Deleted.
1613         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight): Deleted.
1614         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth): Deleted.
1615         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeight): Deleted.
1616         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidth): Deleted.
1617         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight): Deleted.
1618         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth): Deleted.
1619         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedPosition): Deleted.
1620         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedPosition): Deleted.
1621         (WebCore::Layout::FormattingContext::Geometry::replacedHeight): Deleted.
1622         (WebCore::Layout::FormattingContext::Geometry::replacedWidth): Deleted.
1623         * layout/blockformatting/BlockFormattingContext.cpp:
1624         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1625         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
1626         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
1627         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
1628         * layout/blockformatting/BlockFormattingContext.h:
1629         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1630         (WebCore::Layout::inFlowNonReplacedHeight):
1631         (WebCore::Layout::inFlowNonReplacedWidth):
1632         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeight):
1633         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidth):
1634         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): Deleted.
1635         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth): Deleted.
1636
1637 2018-06-01  Zalan Bujtas  <zalan@apple.com>
1638
1639         [LFC] Push FormattingContext::computeWidth/computeHeight logic from the base to the subclasses.
1640         https://bugs.webkit.org/show_bug.cgi?id=186172
1641
1642         Reviewed by Antti Koivisto.
1643
1644         FormattingContext::computeWidth/computeHeight virtual functions have very little benefit and in the long run
1645         it's better if we keep the number of virtual functions to the minimum necessary.
1646
1647         * layout/FormattingContext.cpp:
1648         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
1649         (WebCore::Layout::FormattingContext::computeStaticPosition const): Deleted.
1650         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const): Deleted.
1651         (WebCore::Layout::FormattingContext::computeWidth const): Deleted.
1652         (WebCore::Layout::FormattingContext::computeHeight const): Deleted.
1653         (WebCore::Layout::FormattingContext::computeMargin const): Deleted.
1654         * layout/FormattingContext.h:
1655         * layout/FormattingContextGeometry.cpp:
1656         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight):
1657         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth):
1658         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight):
1659         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth):
1660         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight):
1661         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth):
1662         (WebCore::Layout::FormattingContext::Geometry::replacedHeight): Deleted.
1663         (WebCore::Layout::FormattingContext::Geometry::replacedWidth): Deleted.
1664         * layout/blockformatting/BlockFormattingContext.cpp:
1665         (WebCore::Layout::BlockFormattingContext::computeWidth const):
1666         (WebCore::Layout::BlockFormattingContext::computeHeight const):
1667         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
1668         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
1669         * layout/blockformatting/BlockFormattingContext.h:
1670         * layout/inlineformatting/InlineFormattingContext.cpp:
1671         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
1672         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
1673         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const): Deleted.
1674         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const): Deleted.
1675         * layout/inlineformatting/InlineFormattingContext.h:
1676
1677 2018-06-01  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
1678
1679         [GTK] Difficult to read combo box text in dark theme
1680         https://bugs.webkit.org/show_bug.cgi?id=165072
1681
1682         Reviewed by Carlos Garcia Campos.
1683
1684         Set listbox foreground color to theme color to fix hard-to-read
1685         text color in combo box while using dark theme.
1686
1687         No new tests required. ManualTests/gtk/theme.html already covers it.
1688         See the "Option Lists" section.
1689
1690         * rendering/RenderTheme.cpp:
1691         (WebCore::RenderTheme::adjustStyle):
1692         Adjust style for ListboxPart as well.
1693         * rendering/RenderTheme.h: Add adjustListboxStyle()
1694         * rendering/RenderThemeGtk.cpp:
1695         (WebCore::RenderThemeGtk::adjustListboxStyle const):
1696         Set color to the theme foreground color.
1697         * rendering/RenderThemeGtk.h: adjustListboxStyle() overriden.
1698
1699 2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1700
1701         [GTK] Switch to use a popup window with a tree view instead of a menu for option menu default implementation
1702         https://bugs.webkit.org/show_bug.cgi?id=186146
1703
1704         Reviewed by Michael Catanzaro.
1705
1706         Make it possible to use GUniquePtr with GtkTreePath.
1707
1708         * platform/gtk/GUniquePtrGtk.h:
1709
1710 2018-05-31  Per Arne Vollan  <pvollan@apple.com>
1711
1712         Add OpenGL display mask to WebPage creation parameters.
1713         https://bugs.webkit.org/show_bug.cgi?id=186163
1714         <rdar://problem/40634504>
1715
1716         Reviewed by Brent Fulgham.
1717
1718         To make sure the OpenGL display mask is always available, include it in the WebPage creation parameters.
1719         The OpenGL display mask is sent to the WebProcess when the platform display ID changes, but that is not
1720         early enough in all cases. If the OpenGL display mask is not set, only OpenGL software rendering is offered
1721         on some hardware configurations.
1722  
1723         No new tests, since it is not trivial to test whether OpenGL rendering is hardware accelerated.
1724
1725         * platform/PlatformScreen.h:
1726         * platform/mac/PlatformScreenMac.mm:
1727         (WebCore::displayID):
1728
1729 2018-05-31  Megan Gardner  <megan_gardner@apple.com>
1730
1731         Add setting to allow override screen size to be disabled.
1732         https://bugs.webkit.org/show_bug.cgi?id=186109
1733
1734         Reviewed by Andy Estes.
1735
1736         Not Testable, and for debug only.
1737
1738         Pipe settings and use them to ignore override screen size if setting is set. 
1739
1740         * page/DeprecatedGlobalSettings.cpp:
1741         * page/DeprecatedGlobalSettings.h:
1742         (WebCore::DeprecatedGlobalSettings::setDisableScreenSizeOverride):
1743         (WebCore::DeprecatedGlobalSettings::disableScreenSizeOverride):
1744         * page/Settings.yaml:
1745         * platform/ios/PlatformScreenIOS.mm:
1746
1747 2018-05-31  Brent Fulgham  <bfulgham@apple.com>
1748
1749         REGRESSION(r216119): DocumentLoader::detachFromFrame still encounters nullptr frame
1750         https://bugs.webkit.org/show_bug.cgi?id=186081
1751         <rdar://problem/34918109>
1752
1753         Reviewed by David Kilzer.
1754
1755         The nullptr check that was removed in r216119 was still needed because when the DocumentLoader
1756         is in 'm_waitingForNavigationPolicy' or in 'm_waitingForContentPolicy', a call to the policy checker
1757         to stopCheck we will clear the frame as part of the cleanup phase.
1758
1759         If m_frame is nullptr after cancelPolicyCheckIfNeeded, our work is already done so just return.
1760
1761         * loader/DocumentLoader.cpp:
1762         (WebCore::DocumentLoader::detachFromFrame):
1763
1764 2018-05-31  Dean Jackson  <dino@apple.com>
1765
1766         Don't paint the System Preview badge if the image isn't fully decoded
1767         https://bugs.webkit.org/show_bug.cgi?id=186158
1768         <rdar://problem/40454866>
1769
1770         Reviewed by Antoine Quint.
1771
1772         Only paint the system preview badge if the image itself said
1773         that it succeeded in drawing.
1774
1775         * rendering/RenderImage.cpp:
1776         (WebCore::RenderImage::paintIntoRect): Check the ImageDrawResult.
1777
1778 2018-05-31  David Kilzer  <ddkilzer@apple.com>
1779
1780         Implement checked cast for DDResultRef once DDResultGetCFTypeID() is available
1781         <https://webkit.org/b/184554>
1782         <rdar://problem/36241894>
1783
1784         Reviewed by Brent Fulgham.
1785
1786         * editing/cocoa/DataDetection.mm:
1787         (WebCore::detectItemAtPositionWithRange): Implement checked cast
1788         for DDResultRef.
1789
1790 2018-05-31  Alex Christensen  <achristensen@webkit.org>
1791
1792         Fix Windows build after r232246.
1793         https://bugs.webkit.org/show_bug.cgi?id=186024
1794
1795         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
1796         (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
1797
1798 2018-05-31  Chris Dumez  <cdumez@apple.com>
1799
1800         Fix memory leak under NetworkStateNotifier::updateStateWithoutNotifying()
1801         https://bugs.webkit.org/show_bug.cgi?id=186149
1802         <rdar://problem/40674537>
1803
1804         Reviewed by Geoffrey Garen.
1805
1806         * platform/network/mac/NetworkStateNotifierMac.cpp:
1807         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
1808
1809 2018-05-31  Zalan Bujtas  <zalan@apple.com>
1810
1811         [LFC] Layout code needs to know the type of the Element associated with a Layout::Box
1812         https://bugs.webkit.org/show_bug.cgi?id=186117
1813
1814         Reviewed by Antti Koivisto.
1815
1816         Since these attributes don't change during layout, we could just pass them in to Layout::Box instead
1817         of keep querying the Element.
1818
1819         * layout/layouttree/LayoutBlockContainer.cpp:
1820         (WebCore::Layout::BlockContainer::BlockContainer):
1821         * layout/layouttree/LayoutBlockContainer.h:
1822         * layout/layouttree/LayoutBox.cpp:
1823         (WebCore::Layout::Box::Box):
1824         (WebCore::Layout::Box::isPaddingApplicable const):
1825         (WebCore::Layout::Box::isDocumentBox const): Deleted.
1826         (WebCore::Layout::Box::isBodyBox const): Deleted.
1827         * layout/layouttree/LayoutBox.h:
1828         (WebCore::Layout::Box::isAnonymous const):
1829         (WebCore::Layout::Box::isDocumentBox const):
1830         (WebCore::Layout::Box::isBodyBox const):
1831         (WebCore::Layout::Box::ElementAttributes::ElementAttributes):
1832         (WebCore::Layout::Box::setPreviousSibling):
1833         (WebCore::Layout::Box::setIsAnonymous): Deleted.
1834         * layout/layouttree/LayoutContainer.cpp:
1835         (WebCore::Layout::Container::Container):
1836         * layout/layouttree/LayoutContainer.h:
1837         * layout/layouttree/LayoutInlineBox.cpp:
1838         (WebCore::Layout::InlineBox::InlineBox):
1839         * layout/layouttree/LayoutInlineBox.h:
1840         * layout/layouttree/LayoutInlineContainer.cpp:
1841         (WebCore::Layout::InlineContainer::InlineContainer):
1842         * layout/layouttree/LayoutInlineContainer.h:
1843         * layout/layouttree/LayoutTreeBuilder.cpp:
1844         (WebCore::Layout::TreeBuilder::createLayoutTree):
1845         (WebCore::Layout::TreeBuilder::createSubTree):
1846
1847 2018-05-31  Chris Dumez  <cdumez@apple.com>
1848
1849         Unreviewed iOS build fix after r232335.
1850
1851         * html/BaseChooserOnlyDateAndTimeInputType.h:
1852         * html/BaseDateAndTimeInputType.h:
1853
1854 2018-05-31  Chris Dumez  <cdumez@apple.com>
1855
1856         Unreviewed, apply review comments from Darin after r232310.
1857
1858         * platform/ReferrerPolicy.cpp:
1859         (WebCore::parseReferrerPolicy):
1860
1861 2018-05-31  Zalan Bujtas  <zalan@apple.com>
1862
1863         [LFC] Margin box is border box + margins.
1864         https://bugs.webkit.org/show_bug.cgi?id=186124
1865
1866         Reviewed by Antti Koivisto.
1867
1868         * layout/displaytree/DisplayBox.cpp:
1869         (WebCore::Display::Box::marginBox const):
1870
1871 2018-05-31  Zalan Bujtas  <zalan@apple.com>
1872
1873         [LFC] Add quirks mode setter/getting to LayoutContext
1874         https://bugs.webkit.org/show_bug.cgi?id=186122
1875
1876         Reviewed by Antti Koivisto.
1877
1878         * layout/LayoutContext.h:
1879         (WebCore::Layout::LayoutContext::setInQuirksMode):
1880         (WebCore::Layout::LayoutContext::inQuirksMode const):
1881         * page/FrameViewLayoutContext.cpp:
1882         (WebCore::layoutUsingFormattingContext):
1883
1884 2018-05-30  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
1885
1886         [GTK] Hardcoded text color in input fields
1887         https://bugs.webkit.org/show_bug.cgi?id=126907
1888
1889         Reviewed by Carlos Garcia Campos.
1890
1891         Set text color in input fields to foreground theme color.
1892         Also, set "window.background" as base GtkStyleContext to mimic
1893         GTK applications and fix some theme bugs.
1894
1895         No new tests required. ManualTests/gtk/theme.html already covers it.
1896
1897         * platform/gtk/RenderThemeGadget.cpp:
1898         (WebCore::baseStyleContext): Added.
1899         (WebCore::RenderThemeGadget::RenderThemeGadget):
1900         Use "window.background" GtkStyleContext instead of
1901         null parent for RenderThemeGadgets.
1902         * rendering/RenderThemeGtk.cpp:
1903         (WebCore::RenderThemeGtk::adjustButtonStyle const):
1904         Set color as foreground theme color.
1905         (WebCore::RenderThemeGtk::adjustTextFieldStyle const): Ditto.
1906         (WebCore::RenderThemeGtk::adjustTextAreaStyle const): Ditto.
1907         (WebCore::RenderThemeGtk::adjustSearchFieldStyle const): Ditto.
1908         * rendering/RenderThemeGtk.h: adjustTextAreaStyle() overriden.
1909
1910 2018-05-30  Yusuke Suzuki  <utatane.tea@gmail.com>
1911
1912         [JSC] Pass VM& parameter as much as possible
1913         https://bugs.webkit.org/show_bug.cgi?id=186085
1914
1915         Reviewed by Saam Barati.
1916
1917         No behavior change.
1918
1919         * bindings/js/JSCSSRuleListCustom.cpp:
1920         (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
1921         * bindings/js/JSCallbackData.cpp:
1922         (WebCore::JSCallbackData::invokeCallback):
1923         * bindings/js/JSCustomXPathNSResolver.cpp:
1924         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1925         * bindings/js/JSDOMBuiltinConstructorBase.cpp:
1926         (WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments):
1927         * bindings/js/JSDOMConvertScheduledAction.h:
1928         (WebCore::Converter<IDLScheduledAction>::convert):
1929         * bindings/js/JSDOMIterator.h:
1930         (WebCore::iteratorForEach):
1931         * bindings/js/JSDOMMapLike.cpp:
1932         (WebCore::forwardFunctionCallToBackingMap):
1933         (WebCore::forwardForEachCallToBackingMap):
1934         * bindings/js/JSDOMPromise.cpp:
1935         (WebCore::callFunction):
1936         * bindings/js/JSDOMPromiseDeferred.cpp:
1937         (WebCore::DeferredPromise::callFunction):
1938         (WebCore::createRejectedPromiseWithTypeError):
1939         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
1940         (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
1941         * bindings/js/JSEventListener.cpp:
1942         (WebCore::JSEventListener::handleEvent):
1943         * bindings/js/JSNodeListCustom.cpp:
1944         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
1945         * bindings/js/JSPluginElementFunctions.cpp:
1946         (WebCore::pluginElementCustomPut):
1947         (WebCore::callPlugin):
1948         * bindings/js/JSWindowProxy.cpp:
1949         (WebCore::JSWindowProxy::setWindow):
1950         * bindings/js/ReadableStream.cpp:
1951         (WebCore::ReadableStreamInternal::callFunction):
1952         * bindings/js/ReadableStreamDefaultController.cpp:
1953         (WebCore::callFunction):
1954         * bindings/js/ScheduledAction.cpp:
1955         (WebCore::ScheduledAction::executeFunctionInContext):
1956         * bindings/js/SerializedScriptValue.cpp:
1957         (WebCore::CloneSerializer::getProperty):
1958         (WebCore::CloneSerializer::serialize):
1959         * bindings/js/StructuredClone.cpp:
1960         (WebCore::structuredCloneArrayBufferView):
1961         * bindings/js/WorkerScriptController.cpp:
1962         (WebCore::WorkerScriptController::initScript):
1963         * bridge/NP_jsobject.cpp:
1964         * bridge/objc/WebScriptObject.mm:
1965         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1966         * testing/Internals.cpp:
1967         (WebCore::Internals::cloneArrayBuffer):
1968         * testing/js/WebCoreTestSupport.cpp:
1969         (WebCoreTestSupport::injectInternalsObject):
1970
1971 2018-05-28  Darin Adler  <darin@apple.com>
1972
1973         Straighten out HTMLInputElement attribute handling
1974         https://bugs.webkit.org/show_bug.cgi?id=186043
1975
1976         Reviewed by Daniel Bates.
1977
1978         * dom/RadioButtonGroups.cpp:
1979         (WebCore::RadioButtonGroup::requiredStateChanged): Renamed from requiredAttributeChanged,
1980         and changed to take a reference.
1981         (WebCore::RadioButtonGroups::requiredStateChanged): Ditto.
1982         * dom/RadioButtonGroups.h: Updated for changes above.
1983
1984         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1985         (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree): Call
1986         updateInnerTextValue by its new name.
1987         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue): Renamed
1988         from updateAppearance.
1989         (WebCore::BaseChooserOnlyDateAndTimeInputType::setValue): Call
1990         updateInnerTextValue by its new name.
1991         (WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): Override this
1992         instead of valueAttributeChanged.
1993         * html/BaseChooserOnlyDateAndTimeInputType.h: Tighten up inheritance a bit.
1994         Also use final a bit more and update for changes above.
1995
1996         * html/BaseDateAndTimeInputType.cpp:
1997         (WebCore::BaseDateAndTimeInputType::attributeChanged): Replaced
1998         minOrMaxAttributeChanged with this override, checking for the attribute names.
1999         * html/BaseDateAndTimeInputType.h: Updated for changes above.
2000
2001         * html/FileInputType.cpp:
2002         (WebCore::FileInputType::disabledStateChanged): Renamed from disabledAttributeChanged.
2003         (WebCore::FileInputType::attributeChanged): Replaced
2004         multipleAttributeChanged with this override, checking for the attribute names.
2005         * html/FileInputType.h: Updated for changes above.
2006
2007         * html/HTMLFormControlElement.cpp:
2008         (WebCore::HTMLFormControlElement::parseAttribute): Updated function names to say
2009         "state changed" rather than "attribute changed" if they are called only when the
2010         computed value is changed, not the raw attribute value.
2011         (WebCore::HTMLFormControlElement::readOnlyStateChanged): Updated name.
2012         (WebCore::HTMLFormControlElement::requiredStateChanged): Ditto.
2013         * html/HTMLFormControlElement.h: Updated for changes above.
2014
2015         * html/HTMLInputElement.cpp:
2016         (WebCore::HTMLInputElement::parseAttribute): Removed the code to call lots of specific
2017         attribute changed functions that have now been deleted. Also removed empty code for a
2018         couple of attributes.
2019         (WebCore::HTMLInputElement::disabledStateChanged): Added. Forward call to input type.
2020         (WebCore::HTMLInputElement::readOnlyStateChanged): Ditto.
2021         (WebCore::HTMLInputElement::requiredStateChanged): Renamed from requiredAttributeChanged.
2022         * html/HTMLInputElement.h: Updated for changes above.
2023
2024         * html/HTMLTextFormControlElement.cpp:
2025         (WebCore::HTMLTextFormControlElement::readOnlyStateChanged): Renamed from
2026         readOnlyAttributeChanged. Also fixed incorrect call to base class. This may have
2027         fixed a bug: With some work we could probably create a test case to demonstrate that.
2028         * html/HTMLTextFormControlElement.h: Updated for changes above.
2029
2030         * html/ImageInputType.cpp:
2031         (WebCore::ImageInputType::attributeChanged): Replaced
2032         altAttributeChanged and srcAttributeChanged with this override, checking for the
2033         attribute names.
2034         * html/ImageInputType.h: Updated for changes above.
2035
2036         * html/InputType.cpp:
2037         (WebCore::InputType::altAttributeChanged): Deleted.
2038         (WebCore::InputType::srcAttributeChanged): Deleted.
2039         (WebCore::InputType::maxResultsAttributeChanged): Deleted.
2040         (WebCore::InputType::minOrMaxAttributeChanged): Deleted.
2041         (WebCore::InputType::stepAttributeChanged): Deleted.
2042         (WebCore::InputType::valueAttributeChanged): Deleted.
2043         (WebCore::InputType::attributeChanged): Moved to header as an inline so derived
2044         classes can call through to the base class with the empty function inlined.
2045         (WebCore::InputType::multipleAttributeChanged): Deleted.
2046         (WebCore::InputType::disabledAttributeChanged): Moved to header as an inline.
2047         (WebCore::InputType::readonlyAttributeChanged): Ditto.
2048         (WebCore::InputType::requiredAttributeChanged): Ditto.
2049         * html/InputType.h: Updated for changes above.
2050
2051         * html/NumberInputType.cpp:
2052         (WebCore::NumberInputType::attributeChanged): Replaced
2053         minOrMaxAttributeChanged and stepAttributeChanged with this override, checking
2054         for the attribute names.
2055         * html/NumberInputType.h: Updated for changes above.
2056
2057         * html/RangeInputType.cpp:
2058         (WebCore::RangeInputType::disabledStateChanged): Renamed from
2059         disabledAttributeChanged.
2060         (WebCore::RangeInputType::attributeChanged): Replaced
2061         minOrMaxAttributeChanged with this override, checking for the attribute names.
2062         * html/RangeInputType.h: Updated for changes above.
2063
2064         * html/SearchInputType.cpp:
2065         (WebCore::SearchInputType::SearchInputType): Removed unneeded initialization of
2066         RefPtr data members to nullptr.
2067         (WebCore::updateResultButtonPseudoType): Removed unneeded if statement; the two
2068         cases above cover 0, and less than 0, so there is no need to check for greater
2069         than 0 for the third case.
2070         (WebCore::SearchInputType::attributeChanged): Replaced
2071         maxResultsAttributeChanged with this override, checking for the attribute name.
2072         * html/SearchInputType.h: Updated for changes above and marked more
2073         member functions final.
2074
2075         * html/TextFieldInputType.cpp:
2076         (WebCore::TextFieldInputType::attributeChanged): Added a call through to the
2077         base class to match the style of other overrides of this function.
2078         (WebCore::TextFieldInputType::disabledStateChanged): Renamed from disabledAttributeChanged.
2079         (WebCore::TextFieldInputType::readOnlyStateChanged): Renamed from readonlyAttributeChanged.
2080         * html/TextFieldInputType.h: Updated for changes above. Also made attributeChanged no
2081         longer be marked final since derived classes now override it.
2082
2083         * html/shadow/SliderThumbElement.cpp:
2084         (WebCore::SliderThumbElement::SliderThumbElement): Moved some data member initialization
2085         from this constructor to the class definition.
2086         (WebCore::SliderThumbElement::hostDisabledStateChanged): Renamed from disabledAttributeChanged.
2087         * html/shadow/SliderThumbElement.h: Updated for changes above and marked more
2088         member functions final.
2089
2090 2018-05-30  Nan Wang  <n_wang@apple.com>
2091
2092         AX: VoiceOver on macOS does not announce fieldset description from aria-describedby when focussing inputs
2093         https://bugs.webkit.org/show_bug.cgi?id=185246
2094         <rdar://problem/39939028>
2095
2096         Reviewed by Chris Fleizach.
2097
2098         Exposed the fieldset's description to its form control children.
2099
2100         Test: accessibility/mac/aria-describedby-fieldset.html
2101
2102         * accessibility/AccessibilityNodeObject.cpp:
2103         (WebCore::AccessibilityNodeObject::helpText const):
2104
2105 2018-05-30  Chris Fleizach  <cfleizach@apple.com>
2106
2107         AX: Expose link rel type to voiceover
2108         https://bugs.webkit.org/show_bug.cgi?id=186084
2109         <rdar://problem/40640871>
2110
2111         Reviewed by Sam Weinig.
2112
2113         Make the link rel attribute available to accessibility clients.
2114
2115         Test: accessibility/mac/linkrel.html
2116
2117         * accessibility/AccessibilityObject.cpp:
2118         (WebCore::AccessibilityObject::linkRelValue const):
2119         * accessibility/AccessibilityObject.h:
2120         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2121         (-[WebAccessibilityObjectWrapper accessibilityLinkRelationshipType]):
2122         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2123         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
2124         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2125
2126 2018-05-30  Brady Eidson  <beidson@apple.com>
2127
2128         REGRESSION (r224684): User-agent seen by page does not change when modified by the develop menu options after reloading.
2129         <rdar://problem/34918109> and https://bugs.webkit.org/show_bug.cgi?id=186111
2130
2131         Reviewed by Andy Estes.
2132
2133         Test: http/tests/navigation/useragent-reload.php
2134
2135         * Modules/websockets/WebSocketHandshake.cpp:
2136         (WebCore::WebSocketHandshake::clientHandshakeRequest const): Use setUserAgent() for consistency.
2137
2138         * loader/DocumentLoader.cpp:
2139         (WebCore::DocumentLoader::startLoadingMainResource): Clear the user agent from the original DocumentLoader request
2140           before adding additional fields, as reloads should pick up user agent changes.
2141
2142 2018-05-30  Dean Jackson  <dino@apple.com>
2143
2144         WebContent crashes with system preview content
2145         https://bugs.webkit.org/show_bug.cgi?id=186118
2146
2147         Reviewed by Myles Maxfield.
2148
2149         We were receiving crash reports on iOS devices when getting
2150         platformContext() from a GraphicsContext. This usually
2151         occurred when the page was invisible. Debugging showed that
2152         it was trying to draw with a disabled context.
2153
2154         * rendering/RenderThemeIOS.mm:
2155         (WebCore::RenderThemeIOS::paintSystemPreviewBadge): Early
2156         return if the context has painting disabled.
2157
2158 2018-05-30  Daniel Bates  <dabates@apple.com>
2159
2160         Web Inspector: Annotate Same-Site cookies
2161         https://bugs.webkit.org/show_bug.cgi?id=184897
2162         <rdar://problem/35178209>
2163
2164         Reviewed by Brian Burg.
2165
2166         Store and retrieve the Same-Site cookie policy from CFNetwork.
2167
2168         * inspector/agents/InspectorPageAgent.cpp:
2169         (WebCore::cookieSameSitePolicyJSON): Added.
2170         (WebCore::buildObjectForCookie): Modified to include cookie Same-Site policy. 
2171         * platform/Cookie.h:
2172         (WebCore::Cookie::encode const): Encode Same-Site policy.
2173         (WebCore::Cookie::decode): Decode Same-Site policy.
2174         * platform/network/cocoa/CookieCocoa.mm:
2175         (WebCore::portStringFromVector):
2176         (WebCore::coreSameSitePolicy):
2177         (WebCore::nsSameSitePolicy):
2178         (WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):
2179         (WebCore::Cookie::operator NSHTTPCookie * const): Deleted.
2180
2181 2018-05-30  Daniel Bates  <dabates@apple.com>
2182
2183         NavigationAction does not need to hold initiating DOM Event
2184         https://bugs.webkit.org/show_bug.cgi?id=185958
2185         <rdar://problem/40531539>
2186
2187         Reviewed by Simon Fraser.
2188
2189         Take a similar approach as was done in <https://bugs.webkit.org/show_bug.cgi?id=185712>
2190         and have NavigationAction hold only as many details of the initiating DOM Event as
2191         necessary to support WebKit functionality. Retaining a DOM Event effectively retains
2192         the document that associated with the event. And DocumentLoader always keeps around
2193         the NavigationAction of the last navigation for the "benefit of the various policy handlers".
2194         Therefore, having NavigationAction hold only the relevant details of the DOM Event
2195         instead of the DOM Event itself we avoid keeping the document we navigated from alive
2196         longer than necessary. 
2197
2198         * dom/MouseRelatedEvent.h:
2199         * dom/UIEventWithKeyState.h:
2200         * loader/NavigationAction.cpp:
2201         (WebCore::NavigationAction::UIEventWithKeyStateData::UIEventWithKeyStateData): Added.
2202         (WebCore::NavigationAction::MouseEventData::MouseEventData): Added.
2203         (WebCore::keyStateDataForFirstEventWithKeyState): Added.
2204         (WebCore::mouseEventDataForFirstMouseEvent): Added.
2205         * loader/NavigationAction.h:
2206         (WebCore::NavigationAction::keyStateEventData const): Added.
2207         (WebCore::NavigationAction::mouseEventData const): Added
2208         (WebCore::NavigationAction::event const): Deleted.
2209
2210 2018-05-30  Youenn Fablet  <youenn@apple.com>
2211
2212         Revert changes made to URLWithUserTypedString made in https://trac.webkit.org/changeset/232281
2213         https://bugs.webkit.org/show_bug.cgi?id=186108
2214         <rdar://problem/40663065>
2215
2216         Reviewed by Alex Christensen.
2217
2218         Covered by existing API tests.
2219
2220         * platform/mac/WebCoreNSURLExtras.mm:
2221         (WebCore::URLWithUserTypedString):
2222         Return early if WebCore::URL is not able to create a CFURL.
2223         Use CFURL otherwise to keep the existing behavior as much as possible.
2224
2225 2018-05-30  Youenn Fablet  <youenn@apple.com>
2226
2227         Rename FromOrigin runtime flag to CrossOriginResourcePolicy and enable it by default
2228         https://bugs.webkit.org/show_bug.cgi?id=186082
2229
2230         Reviewed by Chris Dumez.
2231
2232         No change of behavior.
2233
2234         * page/RuntimeEnabledFeatures.h:
2235         (WebCore::RuntimeEnabledFeatures::setCrossOriginResourcePolicyEnabled):
2236         (WebCore::RuntimeEnabledFeatures::crossOriginResourcePolicyEnabled const):
2237         (WebCore::RuntimeEnabledFeatures::setFromOriginResponseHeaderEnabled): Deleted.
2238         (WebCore::RuntimeEnabledFeatures::fromOriginResponseHeaderEnabled const): Deleted.
2239
2240 2018-05-30  Chris Dumez  <cdumez@apple.com>
2241
2242         Referrer-Policy response header is ignored
2243         https://bugs.webkit.org/show_bug.cgi?id=186037
2244         <rdar://problem/40600335>
2245
2246         Reviewed by Youenn Fablet.
2247
2248         Add support for Referrer-Policy HTTP response header:
2249         - https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-header
2250
2251         Tests: http/tests/security/referrer-policy-header-and-meta-tag-emptyString.html
2252                http/tests/security/referrer-policy-header-and-meta-tag.html
2253                http/tests/security/referrer-policy-header.html
2254
2255         * dom/Document.cpp:
2256         (WebCore::Document::setReferrerPolicy):
2257         (WebCore::Document::processReferrerPolicy):
2258         * dom/Document.h:
2259         (WebCore::Document::referrerPolicy const):
2260         * html/HTMLMetaElement.cpp:
2261         (WebCore::HTMLMetaElement::process):
2262         * loader/FrameLoader.cpp:
2263         (WebCore::FrameLoader::didBeginDocument):
2264         * loader/SubresourceLoader.cpp:
2265         (WebCore::SubresourceLoader::updateReferrerPolicy):
2266         * platform/ReferrerPolicy.cpp:
2267         (WebCore::parseReferrerPolicyToken):
2268         (WebCore::parseReferrerPolicy):
2269         * platform/ReferrerPolicy.h:
2270
2271 2018-05-30  Youenn Fablet  <youenn@apple.com>
2272
2273         Rename CrossOriginResourcePolicy same to same-origin
2274         https://bugs.webkit.org/show_bug.cgi?id=186080
2275
2276         Reviewed by Chris Dumez.
2277
2278         Covered by updated tests.
2279
2280         * platform/network/HTTPParsers.cpp:
2281         (WebCore::parseCrossOriginResourcePolicyHeader):
2282         * platform/network/HTTPParsers.h:
2283
2284 2018-05-30  Aditya Keerthi  <akeerthi@apple.com>
2285
2286         Fix the ENABLE(DATALIST_ELEMENT) build
2287         https://bugs.webkit.org/show_bug.cgi?id=186105
2288
2289         Reviewed by Wenson Hsieh.
2290
2291         * WebCore.xcodeproj/project.pbxproj:
2292         * html/ColorInputType.cpp:
2293         (WebCore::ColorInputType::suggestions const):
2294         * html/HTMLInputElement.h:
2295         * html/HTMLOptionElement.cpp:
2296         (WebCore::HTMLOptionElement::ownerDataListElement const):
2297         * rendering/RenderTheme.cpp:
2298         (WebCore::RenderTheme::paintSliderTicks):
2299
2300 2018-05-30  Alex Christensen  <achristensen@webkit.org>
2301
2302         Reduce String allocations
2303         https://bugs.webkit.org/show_bug.cgi?id=186059
2304
2305         Reviewed by Darin Adler.
2306
2307         Don't allocate Strings just to convert it to another form.
2308         Based mostly on Darin's feedback on bug 185986.
2309
2310         No change in behavior.
2311
2312         * Modules/websockets/WebSocketHandshake.cpp:
2313         (WebCore::hostName):
2314         (WebCore::WebSocketHandshake::host const):
2315         * css/parser/CSSSelectorParser.cpp:
2316         (WebCore::CSSSelectorParser::consumePseudo):
2317         (WebCore::CSSSelectorParser::consumeANPlusB):
2318         * loader/mac/LoaderNSURLExtras.mm:
2319         (suggestedFilenameWithMIMEType):
2320         * page/SecurityOriginData.h:
2321         (WebCore::SecurityOriginData::fromURL):
2322         * page/csp/ContentSecurityPolicySource.cpp:
2323         (WebCore::wildcardMatches):
2324         (WebCore::ContentSecurityPolicySource::hostMatches const):
2325         * platform/URL.cpp:
2326         (WebCore::URL::hostAndPort const):
2327         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2328         (WebCore::SocketStreamHandleImpl::createStreams):
2329
2330 2018-05-30  Jer Noble  <jer.noble@apple.com>
2331
2332         Media elements outside fullscreen should not be considered main content.
2333         https://bugs.webkit.org/show_bug.cgi?id=186063
2334         <rdar://problem/40630437>
2335
2336         Reviewed by Eric Carlson.
2337
2338         Test: platform/mac/media/video-best-element-for-playback-controls-purpose.html
2339
2340         Media elements outside the current fullscreen element are not visible, and thus should not be considered
2341         main content.
2342
2343         Drive-by fix: set the m_hasEverNotifiedAboutPlaying before dispatching the 'playing' event, so that
2344         tests can check bestMediaElementForShowingPlaybackControlsManager() in the 'playing' handler.
2345
2346         * html/HTMLMediaElement.cpp:
2347         (WebCore::HTMLMediaElement::notifyAboutPlaying):
2348         * html/HTMLMediaElement.h:
2349         * html/MediaElementSession.cpp:
2350         (WebCore::MediaElementSession::canShowControlsManager const):
2351         * testing/Internals.cpp:
2352         (WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
2353         * testing/Internals.h:
2354         * testing/Internals.idl:
2355
2356 2018-05-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2357
2358         Unreviewed, silence a -Wreturn-type warning
2359
2360         * css/SVGCSSComputedStyleDeclaration.cpp:
2361         (WebCore::glyphOrientationToCSSPrimitiveValue):
2362
2363 2018-05-30  Alexey Proskuryakov  <ap@apple.com>
2364
2365         Build fix attempt after https://trac.webkit.org/r232198
2366
2367         * platform/network/cf/ResourceHandleCFNet.cpp:
2368         (WebCore::ResourceHandle::createCFURLConnection): Added some toString() calls.
2369
2370 2018-05-30  Zalan Bujtas  <zalan@apple.com>
2371
2372         [LFC] Miscellaneous fixes to get closer to geometry correctness
2373         https://bugs.webkit.org/show_bug.cgi?id=186083
2374
2375         Reviewed by Antti Koivisto.
2376
2377         * layout/FormattingContextGeometry.cpp:
2378         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
2379         * layout/LayoutContext.cpp:
2380         (WebCore::Layout::LayoutContext::initializeRoot):
2381         * layout/Verification.cpp:
2382         (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
2383         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2384         (WebCore::Layout::isStretchedToViewport):
2385         (WebCore::Layout::initialContainingBlock):
2386         (WebCore::Layout::computedInFlowNonReplacedComputedHeight):
2387         (WebCore::Layout::inFlowNonReplacedComputedWidth):
2388         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): lambda should capture the specification part. 
2389         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth):
2390         * layout/displaytree/DisplayBox.cpp:
2391         (WebCore::Display::Box::marginBox const):
2392         (WebCore::Display::Box::paddingBox const):
2393         (WebCore::Display::Box::contentBox const):
2394         * layout/layouttree/LayoutBox.cpp:
2395         (WebCore::Layout::Box::isDocumentBox const):
2396         (WebCore::Layout::Box::isBodyBox const):
2397         * layout/layouttree/LayoutBox.h:
2398         * rendering/style/BorderValue.h: ignore border-width when type is hidden or none. 
2399         (WebCore::BorderValue::boxModelWidth const):
2400
2401 2018-05-30  Stephen McGruer  <smcgruer@chromium.org>
2402
2403         iOS: setting 'defaultValue' of input type=date from script should cause a UI update
2404         https://bugs.webkit.org/show_bug.cgi?id=185982
2405
2406         Reviewed by Darin Adler.
2407
2408         Test: fast/forms/date/date-appearance-defaultValue.html
2409
2410         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
2411         (WebCore::BaseChooserOnlyDateAndTimeInputType::valueAttributeChanged):
2412         * html/BaseChooserOnlyDateAndTimeInputType.h:
2413         * html/HTMLInputElement.cpp:
2414         (WebCore::HTMLInputElement::parseAttribute):
2415         * html/InputType.cpp:
2416         (WebCore::InputType::valueAttributeChanged):
2417         * html/InputType.h:
2418
2419 2018-05-29  Nan Wang  <n_wang@apple.com>
2420
2421         Unreviewed, follow-up after r232285
2422         https://bugs.webkit.org/show_bug.cgi?id=180871
2423
2424         Removed redundant null check.
2425
2426         * accessibility/AccessibilityObject.cpp:
2427         (WebCore::AccessibilityObject::isExpanded const):
2428
2429 2018-05-29  Nan Wang  <n_wang@apple.com>
2430
2431         AX: macOS VoiceOver doesn't announce when details element is expanded when using role group
2432         https://bugs.webkit.org/show_bug.cgi?id=180866
2433         <rdar://problem/36074338>
2434
2435         Reviewed by Chris Fleizach.
2436
2437         We should use is<HTMLDetailsElement> to check for the details parent instead
2438         of using the role.
2439
2440         Added test cases to the existing test.
2441
2442         * accessibility/AccessibilityObject.cpp:
2443         (WebCore::AccessibilityObject::isExpanded const):
2444
2445 2018-05-29  Youenn Fablet  <youenn@apple.com>
2446
2447         Add a consistency check between URL and CFURL
2448         https://bugs.webkit.org/show_bug.cgi?id=186057
2449         <rdar://problem/40258457>
2450
2451         Reviewed by Geoff Garen.
2452
2453         It is important that WebCore::URL used in WebCore and CFURL that gets serialized in the network pipe remain consistent.
2454         Otherwise, we will end-up with odd bugs.
2455
2456         We add such a check when creating a CFURL from an URL.
2457         To make things more consistent, we also rely now more on WebCore::URL instead of directly creating a CFURL.
2458
2459         * platform/URL.h:
2460         * platform/cf/CFURLExtras.cpp:
2461         (WebCore::isCFURLSameOrigin):
2462         * platform/cf/CFURLExtras.h:
2463         * platform/cf/URLCF.cpp:
2464         (WebCore::URL::createCFURL const):
2465         * platform/mac/URLMac.mm:
2466         (WebCore::URL::createCFURL const):
2467         * platform/mac/WebCoreNSURLExtras.mm:
2468         (WebCore::URLWithUserTypedString):
2469
2470 2018-05-29  Timothy Hatcher  <timothy@apple.com>
2471
2472         Printing does not apply the right colors in all cases.
2473
2474         https://bugs.webkit.org/show_bug.cgi?id=186066
2475         rdar://problem/40274975
2476
2477         Reviewed by Tim Horton.
2478
2479         * inspector/agents/InspectorPageAgent.cpp:
2480         (WebCore::InspectorPageAgent::setEmulatedMedia): Call RenderTheme::platformColorsDidChange
2481         to invalidate the color cache.
2482         * page/FrameView.cpp:
2483         (WebCore::FrameView::adjustMediaTypeForPrinting): Ditto.
2484         * page/Page.cpp:
2485         (WebCore::Page::defaultAppearance const): Added. Use default when not screen.
2486         * page/Page.h:
2487         (WebCore::Page::defaultAppearance const): Deleted.
2488
2489 2018-05-29  Per Arne Vollan  <pvollan@apple.com>
2490
2491         Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
2492         https://bugs.webkit.org/show_bug.cgi?id=186056
2493
2494         Reviewed by Brent Fulgham.
2495
2496         No new tests, no change in behavior.
2497
2498         * platform/PlatformScreen.h:
2499         * platform/mac/PlatformScreenMac.mm:
2500         (WebCore::screenProperties):
2501         (WebCore::getScreenProperties):
2502         (WebCore::setScreenProperties):
2503
2504 2018-05-29  Ryosuke Niwa  <rniwa@webkit.org>
2505
2506         iOS WK1: Occasional crash in sanitizedMarkupForFragmentInDocument
2507         https://bugs.webkit.org/show_bug.cgi?id=186011
2508
2509         Reviewed by David Kilzer.
2510
2511         The crash was caused by the HTML parser in sanitizedMarkupForFragmentInDocument yielding in the web thread
2512         when _WebThreadLock() sets webThreadShouldYield to true in the main thread.
2513
2514         No new tests. This is occasionally caught by existing tests.
2515
2516         * editing/markup.cpp:
2517         (WebCore::createPageForSanitizingWebContent): Fixed the bug by making the HTML parser never yield.
2518         Also release-assert that the body is never null here.
2519         (WebCore::sanitizedMarkupForFragmentInDocument): Removed superflous call to WTFMove since appendChild
2520         takes a reference, not a Ref.
2521         * inspector/InspectorOverlay.cpp:
2522         (WebCore::InspectorOverlay::overlayPage): Deployed the same fix.
2523         * loader/DocumentWriter.cpp:
2524         (WebCore::DocumentWriter::insertDataSynchronously): Added.
2525         * loader/DocumentWriter.h:
2526
2527 2018-05-29  Chris Dumez  <cdumez@apple.com>
2528
2529         Avoid unnecessary String allocation in isPublicSuffix(const String&)
2530         https://bugs.webkit.org/show_bug.cgi?id=186054
2531
2532         Reviewed by Sam Weinig.
2533
2534         Avoid unnecessary String allocation in isPublicSuffix(const String&) by calling directly
2535         the decodeHostName() overload taking in a NSString*. This overload returns a NSString*,
2536         which is what we need. We would previously call the overloading taking in a String, which
2537         would return a String, which we would have to convert back to a NSString*.
2538
2539         * platform/mac/PublicSuffixMac.mm:
2540         (WebCore::isPublicSuffix):
2541
2542 2018-05-29  Alex Christensen  <achristensen@webkit.org>
2543
2544         Do even fewer allocations in URL host operations
2545         https://bugs.webkit.org/show_bug.cgi?id=186003
2546
2547         Reviewed by Geoffrey Garen.
2548
2549         * loader/ResourceLoadStatistics.cpp:
2550         (WebCore::ResourceLoadStatistics::primaryDomain):
2551         * loader/ResourceLoadStatistics.h:
2552         * platform/URL.cpp:
2553         (WebCore::URL::hostIsIPAddress):
2554         * platform/URL.h:
2555         * platform/mac/URLMac.mm:
2556         (WebCore::URL::hostIsIPAddress):
2557         * platform/soup/URLSoup.cpp:
2558         (WebCore::URL::hostIsIPAddress):
2559
2560 2018-05-29  Tadeu Zagallo  <tzagallo@apple.com>
2561
2562         Don't assert on m_actionsStart when setting actions on DFA nodes
2563         https://bugs.webkit.org/show_bug.cgi?id=185979
2564         <rdar://problem/39669458>
2565
2566         Reviewed by Geoffrey Garen.
2567
2568         DFANode::setActions is called immediately after the node is created, and once again to set
2569         the actions of catch-all regular expressions (.*) on the root node. That works because
2570         m_actionsStart is initially 0, since the root was the first node to be created, but may fail
2571         after minimizing the DFA, when the root may no longer be the first node, and therefore
2572         m_actionsStart would not be 0, even if there are no actions attached to that node.
2573
2574         Test: http/tests/contentextensions/root-actions.html
2575
2576         * contentextensions/DFANode.h:
2577
2578 2018-05-29  Nan Wang  <n_wang@apple.com>
2579
2580         AX: setValue on contenteditable should preserve whitespace
2581         https://bugs.webkit.org/show_bug.cgi?id=185897
2582
2583         Reviewed by Ryosuke Niwa.
2584
2585         We should mimic typing when setting value to a contenteditable from accessibility
2586         instead of mutating the DOM by using setInnerText.
2587
2588         Updated tests to cover this change.
2589
2590         * accessibility/AccessibilityRenderObject.cpp:
2591         (WebCore::AccessibilityRenderObject::setValue):
2592
2593 2018-05-29  Zalan Bujtas  <zalan@apple.com>
2594
2595         [LFC] Miscellaneous fixes to ensure no assertion in LayoutContext::layout
2596         https://bugs.webkit.org/show_bug.cgi?id=186052
2597
2598         Reviewed by Antti Koivisto.
2599
2600         With this patch, LayoutContext::layout() does not assert on <html><body><div></div></body></html> anymore.
2601
2602         * layout/LayoutContext.cpp:
2603         (WebCore::Layout::LayoutContext::initializeRoot): New context root is always a layout root.
2604         * layout/LayoutContext.h:
2605         * layout/Verification.cpp:
2606         (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
2607         * layout/blockformatting/BlockFormattingContext.cpp:
2608         (WebCore::Layout::BlockFormattingContext::layout const): we need computed margin/border/padding for width computation  
2609         * layout/displaytree/DisplayBox.cpp: Add clone() method to be able to carry over the 'hasValid*' bits.
2610         (WebCore::Display::Box::Style::Style):
2611         (WebCore::Display::Box::borderBox const):
2612         (WebCore::Display::Box::contentBox const):
2613         * layout/displaytree/DisplayBox.h:
2614         (WebCore::Display::Box::Rect::operator LayoutRect const):
2615         (WebCore::Display::Box::setSize):
2616         (WebCore::Display::Box::setHasValidMargin):
2617         (WebCore::Display::Box::setHasValidBorder):
2618         (WebCore::Display::Box::setHasValidPadding):
2619         (WebCore::Display::Box::Rect::setHasValidPosition):
2620         (WebCore::Display::Box::Rect::setHasValidSize):
2621         (WebCore::Display::Box::Rect::setSize):
2622         (WebCore::Display::Box::Rect::clone const):
2623         (WebCore::Display::Box::setMargin):
2624         (WebCore::Display::Box::setBorder):
2625         (WebCore::Display::Box::setPadding):
2626         (WebCore::Display::Box::Rect::Rect): Deleted.
2627
2628 2018-05-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2629
2630         [Extra zoom mode] "Significant area painted" rendering progress event is rarely fired
2631         https://bugs.webkit.org/show_bug.cgi?id=186042
2632         <rdar://problem/40604182>
2633
2634         Reviewed by Tim Horton.
2635
2636         Makes a minor tweak to the size of the relevant view rect in extra zoom mode, such that it's no wider than the
2637         visible content rect. Previously, the width of this rect has hard-coded to a value optimized for macOS (980),
2638         which makes it difficult for content laid out at device width in extra zoom mode to cover a significant portion
2639         of the relevant view rect.
2640
2641         Test: RenderingProgressTests.FirstPaintWithSignificantArea
2642
2643         * page/Page.cpp:
2644         (WebCore::relevantViewRect):
2645
2646 2018-05-29  Antoine Quint  <graouts@apple.com>
2647
2648         [Web Animations] Handle relative length units
2649         https://bugs.webkit.org/show_bug.cgi?id=186047
2650
2651         Reviewed by Dean Jackson.
2652
2653         In order to correctly handle relative units, such as "em", "vw" and "vh", we need to do two things.
2654
2655         First, because we need to apply the cascade to correctly compute relative lengths, we need to delay the computation of
2656         "blending keyframes" to when we have both keyframes data and a valid target. This also means that we need to reset blending
2657         keyframes when the target changes. As a result, old call sites of updateBlendingKeyframes() have been replaced by a call to
2658         m_blendingKeyframes.clear() and the method now gets called as part of apply() with the RenderStyle of the targeted element
2659         as a parameter.
2660
2661         Second, and as a result of the first change, we need to update the accelerated animation state based on animation
2662         progress rather than when calling specific methods, such as Animation.play() and Animation.pause(), since blending
2663         keyframes may not be available at those more specific call sites. We now have a new updateAcceleratedAnimationState()
2664         method that gets called as part of apply(). We also rename animationPlayStateDidChange() to animationSuspensionStateDidChange()
2665         since this method was specific to suspension and had a confusing name.
2666
2667         * animation/AnimationEffectReadOnly.h: Rename animationPlayStateDidChange() to animationSuspensionStateDidChange().
2668         * animation/KeyframeEffectReadOnly.cpp:
2669         (WebCore::KeyframeEffectReadOnly::getKeyframes): Fix a crash that revealed itself after other changes in this patch. We would later
2670         call into ComputedStyleExtractor::animationSuspensionStateDidChange() and this would yield an assertion because we'd call potentially
2671         call it with a custom CSS property.
2672         (WebCore::KeyframeEffectReadOnly::processKeyframes): Reset blending keyframes instead of calling updateBlendingKeyframes() since
2673         blending keyframes is now performed asynchronously upon style resolution.
2674         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes): Take the target's RenderStyle as a parameter and use it to reset the
2675         associated StyleResolver's state, just like we do in StyleResolver::keyframeStylesForAnimation(), so that the CSS cascade is correctly
2676         accounted for when computing values using relative length units. Since blending keyframes can now be computed several times for a
2677         given set of keyframes, since the effect's target may change, we also need to create a copy of the MutableStyleProperties to pass
2678         to StyleRuleKeyframe::create().
2679         (WebCore::KeyframeEffectReadOnly::setTarget): Reset blending keyframes instead of calling updateBlendingKeyframes() since
2680         blending keyframes is now performed asynchronously upon style resolution.
2681         (WebCore::KeyframeEffectReadOnly::apply): Update blending keyframes and the accelerated animation state.
2682         (WebCore::KeyframeEffectReadOnly::getAnimatedStyle): Make sure we have blending keyframes with a call to updateBlendingKeyframes()
2683         in case the animation hasn't naturally progressed when this method is called.
2684         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): Make sure we have blending keyframes with a call to
2685         updateBlendingKeyframes() in case the animation hasn't naturally progressed when this method is called.
2686         (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState): Account for the animation's local time and play state to update
2687         the accelerated animation state.
2688         (WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): Record the last accelerated action in a member variable which we can
2689         use to determine if we're running accelerated accounting for uncommited changes.
2690         (WebCore::KeyframeEffectReadOnly::animationDidSeek): Only record an AcceleratedAction::Seek action if we're already running accelerated.
2691         (WebCore::KeyframeEffectReadOnly::animationSuspensionStateDidChange): Only record an AcceleratedAction::Pause or AcceleratedAction::Play
2692         action if we're already running accelerated.
2693         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Ensure we clone and clear the list of accelerated actions and check that
2694         we have any cloned actions before proceeding any further. Then we can stop accounting for m_startedAccelerated since the list of accelerated
2695         actions already account for animation state changes.
2696         (WebCore::KeyframeEffectReadOnly::animationPlayStateDidChange): Deleted.
2697         * animation/KeyframeEffectReadOnly.h:
2698         (WebCore::KeyframeEffectReadOnly::isRunningAccelerated const): Account for the m_lastRecordedAcceleratedAction to identify whether we're running.
2699         * animation/WebAnimation.cpp:
2700         (WebCore::WebAnimation::play): Stop calling animationPlayStateDidChange() directly since the accelerated animation state is now updated when
2701         the animation's effect is applied.
2702         (WebCore::WebAnimation::pause): Stop calling animationPlayStateDidChange() directly since the accelerated animation state is now updated when
2703         the animation's effect is applied.
2704         (WebCore::WebAnimation::resolve): Make sure we update the finished state prior to applying the animation's effect since the play state can
2705         change when updating the finished state and KeyframeEffectReadOnly::updateAcceleratedAnimationState(), which is called when calling into
2706         KeyframeEffectReadOnly::apply(), relies on it to correctly update the accelerated animation state.
2707         (WebCore::WebAnimation::setSuspended): Rename animationPlayStateDidChange() to animationSuspensionStateDidChange().
2708         * css/StyleResolver.cpp:
2709         (WebCore::StyleResolver::setNewStateWithElement): Add a new public method to reset a StyleResolver's state such that we can call it when creating
2710         blending keyframes for JS-originated animations just like we do when creating blending keyframes for CSS Animations in keyframeStylesForAnimation().
2711         (WebCore::StyleResolver::keyframeStylesForAnimation): Use the new setNewStateWithElement() method.
2712         * css/StyleResolver.h:
2713
2714 2018-05-29  Thibault Saunier  <tsaunier@igalia.com>
2715
2716         [GStreamer] Update "qtdemux: Clarify field name about stream-encryption-system" patch
2717         https://bugs.webkit.org/show_bug.cgi?id=186040
2718
2719         Reviewed by Xabier Rodriguez-Calvar.
2720
2721         s/avalaible-stream-encryption-systems/available-stream-encryption-systems/g
2722
2723         Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-*
2724
2725         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2726         (WebCore::extractEventsAndSystemsFromMessage):
2727
2728 2018-05-28  Zalan Bujtas  <zalan@apple.com>
2729
2730         Unreviewed build fix.
2731
2732         * layout/displaytree/DisplayBox.h:
2733         (WebCore::Display::Box::Rect::operator LayoutRect const):
2734
2735 2018-05-28  Zalan Bujtas  <zalan@apple.com>
2736
2737         [LFC] Add Rect interface to Display::Box
2738         https://bugs.webkit.org/show_bug.cgi?id=186019
2739
2740         Reviewed by Antti Koivisto.
2741
2742         Having a dedicated Rect class and moving the geometry invalidation to it enables us to call
2743         displayBox.contentBox().left() even when the widht/height are not computed yet.
2744         Also having Rect with top/left/bottom/right interface is more aligned with the rest of the layout code than x/y/maxX/maxY.
2745
2746         * layout/FormattingContextGeometry.cpp:
2747         (WebCore::Layout::contentHeightForFormattingContextRoot):
2748         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2749         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
2750         * layout/displaytree/DisplayBox.cpp:
2751         (WebCore::Display::Box::marginBox const):
2752         (WebCore::Display::Box::borderBox const):
2753         (WebCore::Display::Box::paddingBox const):
2754         (WebCore::Display::Box::contentBox const):
2755         * layout/displaytree/DisplayBox.h:
2756         (WebCore::Display::Box::Rect::invalidateTop):
2757         (WebCore::Display::Box::Rect::invalidateLeft):
2758         (WebCore::Display::Box::Rect::invalidateWidth):
2759         (WebCore::Display::Box::Rect::invalidateHeight):
2760         (WebCore::Display::Box::Rect::hasValidPosition const):
2761         (WebCore::Display::Box::Rect::hasValidSize const):
2762         (WebCore::Display::Box::Rect::hasValidGeometry const):
2763         (WebCore::Display::Box::rect const):
2764         (WebCore::Display::Box::top const):
2765         (WebCore::Display::Box::left const):
2766         (WebCore::Display::Box::bottom const):
2767         (WebCore::Display::Box::right const):
2768         (WebCore::Display::Box::topLeft const):
2769         (WebCore::Display::Box::bottomRight const):
2770         (WebCore::Display::Box::size const):
2771         (WebCore::Display::Box::width const):
2772         (WebCore::Display::Box::height const):
2773         (WebCore::Display::Box::setTopLeft):
2774         (WebCore::Display::Box::setTop):
2775         (WebCore::Display::Box::setLeft):
2776         (WebCore::Display::Box::setWidth):
2777         (WebCore::Display::Box::setHeight):
2778         (WebCore::Display::Box::Rect::invalidatePosition):
2779         (WebCore::Display::Box::Rect::setHasValidPosition):
2780         (WebCore::Display::Box::Rect::Rect):
2781         (WebCore::Display::Box::Rect::top const):
2782         (WebCore::Display::Box::Rect::left const):
2783         (WebCore::Display::Box::Rect::bottom const):
2784         (WebCore::Display::Box::Rect::right const):
2785         (WebCore::Display::Box::Rect::topLeft const):
2786         (WebCore::Display::Box::Rect::bottomRight const):
2787         (WebCore::Display::Box::Rect::size const):
2788         (WebCore::Display::Box::Rect::width const):
2789         (WebCore::Display::Box::Rect::height const):
2790         (WebCore::Display::Box::Rect::setTopLeft):
2791         (WebCore::Display::Box::Rect::setTop):
2792         (WebCore::Display::Box::Rect::setLeft):
2793         (WebCore::Display::Box::Rect::setWidth):
2794         (WebCore::Display::Box::Rect::setHeight):
2795         (WebCore::Display::Box::Rect::shiftLeftTo):
2796         (WebCore::Display::Box::Rect::shiftRightTo):
2797         (WebCore::Display::Box::Rect::shiftTopTo):
2798         (WebCore::Display::Box::Rect::shiftBottomTo):
2799         (WebCore::Display::Box::Rect::expand):
2800         (WebCore::Display::Box::invalidateTop): Deleted.
2801         (WebCore::Display::Box::invalidateLeft): Deleted.
2802         (WebCore::Display::Box::invalidateWidth): Deleted.
2803         (WebCore::Display::Box::invalidateHeight): Deleted.
2804         (WebCore::Display::Box::hasValidPosition const): Deleted.
2805         (WebCore::Display::Box::hasValidSize const): Deleted.
2806         (WebCore::Display::Box::hasValidGeometry const): Deleted.
2807         (WebCore::Display::Box::invalidatePosition): Deleted.
2808         (WebCore::Display::Box::setHasValidPosition): Deleted.
2809
2810 2018-05-28  Zalan Bujtas  <zalan@apple.com>
2811
2812         [LFC] Add formatting context testing codepath in FrameViewLayoutContext
2813         https://bugs.webkit.org/show_bug.cgi?id=186036
2814
2815         Reviewed by Antti Koivisto.
2816
2817         This is to verify the formatting context layout correctness.
2818
2819         * layout/LayoutContext.cpp:
2820         (WebCore::Layout::LayoutContext::LayoutContext):
2821         (WebCore::Layout::LayoutContext::initializeRoot):
2822         * layout/LayoutContext.h:
2823         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
2824         * page/FrameViewLayoutContext.cpp:
2825         (WebCore::layoutUsingFormattingContext):
2826         (WebCore::FrameViewLayoutContext::layout):
2827
2828 2018-05-28  Zalan Bujtas  <zalan@apple.com>
2829
2830         [LFC] Add layout tree verification.
2831         https://bugs.webkit.org/show_bug.cgi?id=186018
2832
2833         Reviewed by Antti Koivisto.
2834
2835         Compare layout and render tree geometry and output the mismtaching rectangles.
2836
2837         * Sources.txt:
2838         * WebCore.xcodeproj/project.pbxproj: Add missing headers and make then private.
2839         * layout/LayoutContext.h:
2840         * layout/Verification.cpp: Added.
2841         (WebCore::Layout::outputMismatchedBoxInformationIfNeeded):
2842         (WebCore::Layout::verifySubtree):
2843         (WebCore::Layout::LayoutContext::verifyAndOutputLayoutTree const):
2844
2845 2018-05-28  Sam Weinig  <sam@webkit.org>
2846
2847         Modernize SVGRenderStyleDefs.h
2848         https://bugs.webkit.org/show_bug.cgi?id=186024
2849
2850         Reviewed by Daniel Bates.
2851
2852         Modernized the set of enums in SVGRenderStyleDefs.h and WindRule.h by:
2853             - Converting them to enum classes
2854             - Renaming them to remove unnecessary prefix 'E's
2855             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
2856             - Renaming to match modern conventions (e.g BNONE -> None)
2857
2858         Modernizes the following enums:
2859             SVGPaintType
2860             BaselineShift (renamed from EBaselineShift)
2861             TextAnchor (renamed from ETextAnchor)
2862             ColorInterpolation (renamed from EColorInterpolation)
2863             ColorRendering (renamed from EColorRendering)
2864             ShapeRendering (renamed from EShapeRendering)
2865             GlyphOrientation (renamed from EGlyphOrientation)
2866             AlignmentBaseline (renamed from EAlignmentBaseline)
2867             DominantBaseline (renamed from EDominantBaseline)
2868             VectorEffect (renamed from EVectorEffect)
2869             BufferedRendering (renamed from EBufferedRendering)
2870             MaskType (renamed from EMaskType)
2871             WindRule
2872
2873         * css/CSSBasicShapes.cpp:
2874         (WebCore::buildPathString):
2875         (WebCore::buildPolygonString):
2876         * css/CSSBasicShapes.h:
2877         * css/CSSPrimitiveValueMappings.h:
2878         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2879         (WebCore::CSSPrimitiveValue::operator WindRule const):
2880         (WebCore::CSSPrimitiveValue::operator AlignmentBaseline const):
2881         (WebCore::CSSPrimitiveValue::operator BufferedRendering const):
2882         (WebCore::CSSPrimitiveValue::operator ColorInterpolation const):
2883         (WebCore::CSSPrimitiveValue::operator ColorRendering const):
2884         (WebCore::CSSPrimitiveValue::operator DominantBaseline const):
2885         (WebCore::CSSPrimitiveValue::operator ShapeRendering const):
2886         (WebCore::CSSPrimitiveValue::operator TextAnchor const):
2887         (WebCore::CSSPrimitiveValue::operator VectorEffect const):
2888         (WebCore::CSSPrimitiveValue::operator MaskType const):
2889         (WebCore::CSSPrimitiveValue::operator EAlignmentBaseline const): Deleted.
2890         (WebCore::CSSPrimitiveValue::operator EBufferedRendering const): Deleted.
2891         (WebCore::CSSPrimitiveValue::operator EColorInterpolation const): Deleted.
2892         (WebCore::CSSPrimitiveValue::operator EColorRendering const): Deleted.
2893         (WebCore::CSSPrimitiveValue::operator EDominantBaseline const): Deleted.
2894         (WebCore::CSSPrimitiveValue::operator EShapeRendering const): Deleted.
2895         (WebCore::CSSPrimitiveValue::operator ETextAnchor const): Deleted.
2896         (WebCore::CSSPrimitiveValue::operator EVectorEffect const): Deleted.
2897         (WebCore::CSSPrimitiveValue::operator EMaskType const): Deleted.
2898         * css/SVGCSSComputedStyleDeclaration.cpp:
2899         (WebCore::glyphOrientationToCSSPrimitiveValue):
2900         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
2901         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2902         * css/StyleBuilderConverter.h:
2903         (WebCore::StyleBuilderConverter::convertGlyphOrientation):
2904         (WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
2905         * css/StyleBuilderCustom.h:
2906         (WebCore::StyleBuilderCustom::applyValueBaselineShift):
2907         (WebCore::StyleBuilderCustom::applyValueFill):
2908         (WebCore::StyleBuilderCustom::applyValueStroke):
2909         * css/parser/CSSPropertyParser.cpp:
2910         (WebCore::consumeBasicShapePolygon):
2911         (WebCore::consumeBasicShapePath):
2912         * html/canvas/CanvasRenderingContext2DBase.cpp:
2913         (WebCore::toWindRule):
2914         * page/animation/CSSPropertyAnimation.cpp:
2915         (WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
2916         * platform/graphics/FloatPolygon.cpp:
2917         (WebCore::FloatPolygon::contains const):
2918         * platform/graphics/GraphicsContext.cpp:
2919         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2920         * platform/graphics/GraphicsContext.h:
2921         * platform/graphics/GraphicsLayer.cpp:
2922         (WebCore::GraphicsLayer::shapeLayerWindRule const):
2923         * platform/graphics/GraphicsLayer.h:
2924         * platform/graphics/GraphicsTypes.cpp:
2925         (WebCore::operator<<):
2926         * platform/graphics/Path.h:
2927         * platform/graphics/ShadowBlur.cpp:
2928         (WebCore::ShadowBlur::drawInsetShadow):
2929         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
2930         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
2931         * platform/graphics/WindRule.h:
2932         (): Deleted.
2933         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2934         (PlatformCALayerCocoa::shapeWindRule const):
2935         (PlatformCALayerCocoa::setShapeWindRule):
2936         * platform/graphics/cg/GraphicsContextCG.cpp:
2937         (WebCore::calculateDrawingMode):
2938         (WebCore::GraphicsContext::fillPath):
2939         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2940         (WebCore::GraphicsContext::clipPath):
2941         * platform/graphics/cg/PathCG.cpp:
2942         (WebCore::Path::contains const):
2943         * platform/mock/MockRealtimeVideoSource.cpp:
2944         (WebCore::MockRealtimeVideoSource::drawAnimation):
2945         * rendering/FilterEffectRenderer.cpp:
2946         (WebCore::FilterEffectRenderer::buildReferenceFilter):
2947         * rendering/RenderBoxModelObject.cpp:
2948         (WebCore::RenderBoxModelObject::paintBorder):
2949         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
2950         * rendering/RenderElement.cpp:
2951         (WebCore::RenderElement::paintOutline):
2952         * rendering/RenderLayer.cpp:
2953         (WebCore::RenderLayer::computeClipPath const):
2954         * rendering/style/BasicShapes.h:
2955         (WebCore::BasicShape::windRule const):
2956         * rendering/style/RenderStyle.h:
2957         (WebCore::RenderStyle::fillPaintType const):
2958         (WebCore::RenderStyle::setFillPaintColor):
2959         (WebCore::RenderStyle::strokePaintType const):
2960         (WebCore::RenderStyle::setStrokePaintColor):
2961         * rendering/style/SVGRenderStyle.h:
2962         (WebCore::SVGRenderStyle::initialAlignmentBaseline):
2963         (WebCore::SVGRenderStyle::initialDominantBaseline):
2964         (WebCore::SVGRenderStyle::initialBaselineShift):
2965         (WebCore::SVGRenderStyle::initialVectorEffect):
2966         (WebCore::SVGRenderStyle::initialBufferedRendering):
2967         (WebCore::SVGRenderStyle::initialClipRule):
2968         (WebCore::SVGRenderStyle::initialColorInterpolation):
2969         (WebCore::SVGRenderStyle::initialColorInterpolationFilters):
2970         (WebCore::SVGRenderStyle::initialColorRendering):
2971         (WebCore::SVGRenderStyle::initialFillRule):
2972         (WebCore::SVGRenderStyle::initialShapeRendering):
2973         (WebCore::SVGRenderStyle::initialTextAnchor):
2974         (WebCore::SVGRenderStyle::initialGlyphOrientationHorizontal):
2975         (WebCore::SVGRenderStyle::initialGlyphOrientationVertical):
2976         (WebCore::SVGRenderStyle::initialFillPaintType):
2977         (WebCore::SVGRenderStyle::initialStrokePaintType):
2978         (WebCore::SVGRenderStyle::initialMaskType):
2979         (WebCore::SVGRenderStyle::setAlignmentBaseline):
2980         (WebCore::SVGRenderStyle::setDominantBaseline):
2981         (WebCore::SVGRenderStyle::setBaselineShift):
2982         (WebCore::SVGRenderStyle::setVectorEffect):
2983         (WebCore::SVGRenderStyle::setBufferedRendering):
2984         (WebCore::SVGRenderStyle::setClipRule):
2985         (WebCore::SVGRenderStyle::setColorInterpolation):
2986         (WebCore::SVGRenderStyle::setColorInterpolationFilters):
2987         (WebCore::SVGRenderStyle::setColorRendering):
2988         (WebCore::SVGRenderStyle::setFillRule):
2989         (WebCore::SVGRenderStyle::setShapeRendering):
2990         (WebCore::SVGRenderStyle::setTextAnchor):
2991         (WebCore::SVGRenderStyle::setGlyphOrientationHorizontal):
2992         (WebCore::SVGRenderStyle::setGlyphOrientationVertical):
2993         (WebCore::SVGRenderStyle::setMaskType):
2994         (WebCore::SVGRenderStyle::alignmentBaseline const):
2995         (WebCore::SVGRenderStyle::dominantBaseline const):
2996         (WebCore::SVGRenderStyle::baselineShift const):
2997         (WebCore::SVGRenderStyle::vectorEffect const):
2998         (WebCore::SVGRenderStyle::bufferedRendering const):
2999         (WebCore::SVGRenderStyle::clipRule const):
3000         (WebCore::SVGRenderStyle::colorInterpolation const):
3001         (WebCore::SVGRenderStyle::colorInterpolationFilters const):
3002         (WebCore::SVGRenderStyle::colorRendering const):
3003         (WebCore::SVGRenderStyle::fillRule const):
3004         (WebCore::SVGRenderStyle::shapeRendering const):
3005         (WebCore::SVGRenderStyle::textAnchor const):
3006         (WebCore::SVGRenderStyle::glyphOrientationHorizontal const):
3007         (WebCore::SVGRenderStyle::glyphOrientationVertical const):
3008         (WebCore::SVGRenderStyle::fillPaintType const):
3009         (WebCore::SVGRenderStyle::strokePaintType const):
3010         (WebCore::SVGRenderStyle::maskType const):
3011         (WebCore::SVGRenderStyle::visitedLinkFillPaintType const):
3012         (WebCore::SVGRenderStyle::visitedLinkStrokePaintType const):
3013         (WebCore::SVGRenderStyle::hasStroke const):
3014         (WebCore::SVGRenderStyle::hasFill const):
3015         (WebCore::SVGRenderStyle::setBitDefaults):
3016         * rendering/style/SVGRenderStyleDefs.h:
3017         (WebCore::StyleFillData::create):
3018         (WebCore::StyleFillData::operator!= const):
3019         (WebCore::StyleStrokeData::create):
3020         (WebCore::StyleStrokeData::operator!= const):
3021         (WebCore::StyleStopData::create):
3022         (WebCore::StyleStopData::operator!= const):
3023         (WebCore::StyleTextData::create):
3024         (WebCore::StyleTextData::operator!= const):
3025         (WebCore::StyleMiscData::create):
3026         (WebCore::StyleMiscData::operator!= const):
3027         (WebCore::StyleShadowSVGData::create):
3028         (WebCore::StyleShadowSVGData::operator!= const):
3029         (WebCore::StyleResourceData::create):
3030         (WebCore::StyleResourceData::operator!= const):
3031         (WebCore::StyleInheritedResourceData::create):
3032         (WebCore::StyleInheritedResourceData::operator!= const):
3033         (WebCore::StyleLayoutData::create):
3034         (WebCore::StyleLayoutData::operator!= const):
3035         (): Deleted.
3036         * rendering/svg/RenderSVGImage.cpp:
3037         (WebCore::RenderSVGImage::paint):
3038         * rendering/svg/RenderSVGRect.cpp:
3039         (WebCore::RenderSVGRect::updateShapeFromElement):
3040         * rendering/svg/RenderSVGResource.cpp:
3041         (WebCore::requestPaintingResource):
3042         * rendering/svg/RenderSVGResourceClipper.cpp:
3043         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
3044         * rendering/svg/RenderSVGResourceFilter.cpp:
3045         (WebCore::RenderSVGResourceFilter::buildPrimitives const):
3046         * rendering/svg/RenderSVGResourceGradient.cpp:
3047         (WebCore::RenderSVGResourceGradient::applyResource):
3048         * rendering/svg/RenderSVGResourceMasker.cpp:
3049         (WebCore::RenderSVGResourceMasker::applyResource):
3050         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
3051         * rendering/svg/RenderSVGResourcePattern.cpp:
3052         (WebCore::RenderSVGResourcePattern::applyResource):
3053         * rendering/svg/RenderSVGShape.cpp:
3054         (WebCore::RenderSVGShape::paint):
3055         * rendering/svg/RenderSVGShape.h:
3056         (WebCore::RenderSVGShape::hasNonScalingStroke const):
3057         * rendering/svg/SVGRenderTreeAsText.cpp:
3058         (WebCore::writeStyle):
3059         (WebCore::writeSVGInlineTextBox):
3060         * rendering/svg/SVGResources.cpp:
3061         (WebCore::paintingResourceFromSVGPaint):
3062         * rendering/svg/SVGTextChunk.cpp:
3063         (WebCore::SVGTextChunk::SVGTextChunk):
3064         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
3065         (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const):
3066         (WebCore::SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline const):
3067         (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
3068         (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
3069         * rendering/svg/SVGTextLayoutEngineBaseline.h:
3070
3071 2018-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3072
3073         [Web Animations] Test webanimations/css-animations.html is crashing
3074         https://bugs.webkit.org/show_bug.cgi?id=186031
3075
3076         Reviewed by Antoine Quint.
3077
3078         This is another case of std::optional value being used while it's nullopt, I guess this started to fail when we
3079         stopped using the WTF implementation of std::optional. The problem is that we try to get the current iteration
3080         of a declarative animation when the active time is unresolved.
3081
3082         * animation/DeclarativeAnimation.cpp:
3083         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Use value_or(0) instead of value() to get the current
3084         iteration of the effect.
3085
3086 2018-05-28  Thibault Saunier  <tsaunier@igalia.com>
3087
3088         [GStreamer] Handle changes in the "drm-preferred-decryption-system-id" NEED_CONTEXT message.
3089         https://bugs.webkit.org/show_bug.cgi?id=185948
3090
3091         Reviewed by Xabier Rodriguez-Calvar.
3092
3093         - The "stream-encryption-systems" field of the "drm-preferred-decryption-system-id" query was renamed to
3094           "avalaible-stream-encryption-systems"
3095         - It can now be NULL, meaning there is no decryptor avalaible.
3096
3097         Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-*
3098
3099         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3100         (WebCore::extractEventsAndSystemsFromMessage): Handle NULL value for "avalaible-stream-encryption-systems",
3101         moved some code to make the order of the Arrays in the pair clearer.
3102
3103 2018-05-27  Dan Bernstein  <mitz@apple.com>
3104
3105         Reverted the changes made for https://webkit.org/b/186016
3106
3107         They broke the USE(APPLE_INTERNAL_SDK) Sierra build.
3108
3109 2018-05-27  David Kilzer  <ddkilzer@apple.com>
3110
3111         [iOS] Fix warnings about leaks found by clang static analyzer
3112         <https://webkit.org/b/186009>
3113         <rdar://problem/40574267>
3114
3115         Reviewed by Daniel Bates.
3116
3117         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
3118         (WebCore::LocalAuthenticator::makeCredential):
3119         (WebCore::LocalAuthenticator::getAssertion):
3120         (WebCore::LocalAuthenticator::issueClientCertificate const):
3121         - Don't leak CF objects in early return paths, and get rid of
3122           `retained*` variables, by making original variables use
3123           RetainPtr<>.
3124         * bridge/objc/WebScriptObject.mm:
3125         (+[WebUndefined allocWithZone:]): Modernize WebUndefined by
3126         using NeverDestroyed<RetainPr<WebUndefined>> type.  Explicitly
3127         retain the object returned on each call.
3128         (+[WebUndefined undefined]): Explicitly autorelease the object
3129         returned.  Note that neither of these changes fixes the static
3130         analyzer warnings in this source file.
3131         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3132         (WebCore::exernalDeviceDisplayNameForPlayer): Use RetainPtr<> to
3133         stop leaking NSString objects in a loop.
3134         * platform/ios/wak/WAKWindow.h:
3135         (-[WAKWindow _newFirstResponderAfterResigning]): Mark as
3136         NS_RETURNS_NOT_RETAINED like the corresponding AppKit method
3137         since this doesn't return a new object.  This fixes some
3138         false-positive leaks warnings.
3139
3140 2018-05-27  Dan Bernstein  <mitz@apple.com>
3141
3142         [Cocoa] Avoid importing directly from subumbrella frameworks
3143         https://bugs.webkit.org/show_bug.cgi?id=186016
3144
3145         Reviewed by Sam Weinig.
3146
3147         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
3148           OTHER_CPLUSPLUSFLAGS.
3149         * editing/mac/DictionaryLookup.mm: Import Quartz.h instead of a PDFKit header.
3150         * html/HTMLKeygenElement.cpp: Removed "using namespace WebCore" from this WebCore
3151           implementation file.
3152         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
3153         * platform/mac/PlatformScreenMac.mm: Import ApplicationServices.h instead of ColorSync.h
3154           when using SDKs earlier than 10.13.
3155         * platform/mediastream/CaptureDeviceManager.cpp: Enclosed the definitions in the WebCore
3156           namespace and removed "using namespace WebCore" from this WebCore implementation file.
3157         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
3158
3159 2018-05-27  Fujii Hironori  <Hironori.Fujii@sony.com>
3160
3161         REGRESSION(r232198) [WinCairo] cannot convert from 'WTF::StringView' to 'const WTF::String'
3162         https://bugs.webkit.org/show_bug.cgi?id=186027
3163
3164         Unreviewed build fix
3165
3166         No new tests (No behavior change).
3167
3168         * platform/network/curl/AuthenticationChallengeCurl.cpp:
3169         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
3170         * platform/network/curl/CurlRequest.cpp:
3171         (WebCore::CurlRequest::setupTransfer):
3172         (WebCore::CurlRequest::willSetupSslCtx):
3173
3174 2018-05-27  Sam Weinig  <sam@webkit.org>
3175
3176         Modernize RenderStyleConstants.h - Part 3
3177         https://bugs.webkit.org/show_bug.cgi?id=186015
3178
3179         Reviewed by Yusuke Suzuki.
3180
3181         Modernized the third and final set of enums in RenderStyleConstants.h by:
3182             - Converting them to enum classes
3183             - Renaming them to remove unnecessary prefix 'E's
3184             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
3185
3186         Modernizes the following enums:
3187             TextDecoration
3188             TextDecorationSkip (renamed from TextDecorationSkipItems)
3189             TextUnderlinePosition
3190             HangingPunctuation
3191             SpeakAs (renamed from ESpeakAs)
3192             TextEmphasisPosition (renamed from TextEmphasisPositions)
3193
3194         This final set of enums are mostly (TextUnderlinePosition isn't really) used as bitmasks,
3195         so this change also converts their uses to use OptionSet. 
3196
3197         * accessibility/AccessibilityObject.h:
3198         (WebCore::AccessibilityObject::speakAsProperty const):
3199         * accessibility/AccessibilityRenderObject.cpp:
3200         (WebCore::AccessibilityRenderObject::speakAsProperty const):
3201         (WebCore::AccessibilityRenderObject::hasPlainText const):
3202         (WebCore::AccessibilityRenderObject::hasUnderline const):
3203         * accessibility/AccessibilityRenderObject.h:
3204         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3205         (AXAttributeStringSetStyle):
3206         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3207         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
3208         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3209         (AXAttributeStringSetStyle):
3210         * css/CSSComputedStyleDeclaration.cpp:
3211         (WebCore::renderTextDecorationFlagsToCSSValue):
3212         (WebCore::renderTextDecorationSkipFlagsToCSSValue):
3213         (WebCore::renderEmphasisPositionFlagsToCSSValue):
3214         (WebCore::speakAsToCSSValue):
3215         (WebCore::hangingPunctuationToCSSValue):
3216         * css/CSSLineBoxContainValue.h:
3217         * css/CSSPrimitiveValueMappings.h:
3218         (WebCore::CSSPrimitiveValue::operator HangingPunctuation const):
3219         (WebCore::CSSPrimitiveValue::operator TextDecoration const):
3220         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3221         (WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const):
3222         (WebCore::CSSPrimitiveValue::operator SpeakAs const):
3223         (WebCore::CSSPrimitiveValue::operator ESpeakAs const): Deleted.
3224         * css/StyleBuilderConverter.h:
3225         (WebCore::StyleBuilderConverter::convertTextDecoration):
3226         (WebCore::StyleBuilderConverter::valueToEmphasisPosition):
3227         (WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
3228         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
3229         (WebCore::StyleBuilderConverter::valueToDecorationSkip):
3230         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
3231         (WebCore::StyleBuilderConverter::convertSpeakAs):
3232         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
3233         * editing/cocoa/EditorCocoa.mm:
3234         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle const):
3235         * editing/cocoa/HTMLConverter.mm:
3236         (WebCore::editingAttributedStringFromRange):
3237         * rendering/InlineFlowBox.cpp:
3238         (WebCore::InlineFlowBox::maxLogicalBottomForTextDecorationLine const):
3239         (WebCore::InlineFlowBox::minLogicalTopForTextDecorationLine const):
3240         * rendering/InlineFlowBox.h:
3241         * rendering/InlineTextBox.cpp:
3242         (WebCore::emphasisPositionHasNeitherLeftNorRight):
3243         (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
3244         (WebCore::InlineTextBox::paint):
3245         (WebCore::InlineTextBox::paintMarkedTextDecoration):
3246         * rendering/RenderBlockFlow.cpp:
3247         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
3248         * rendering/RenderBlockLineLayout.cpp:
3249         (WebCore::setLogicalWidthForTextRun):
3250         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
3251         * rendering/RenderElement.cpp:
3252         (WebCore::RenderElement::enclosingRendererWithTextDecoration const):
3253         * rendering/RenderElement.h:
3254         * rendering/RenderTableSection.cpp:
3255         (WebCore::RenderTableSection::addCell):
3256         * rendering/SimpleLineLayout.cpp:
3257         (WebCore::SimpleLineLayout::canUseForStyle):
3258         (WebCore::SimpleLineLayout::canUseForWithReason):
3259         * rendering/SimpleLineLayoutFunctions.cpp:
3260         (WebCore::SimpleLineLayout::paintFlow):
3261         * rendering/TextDecorationPainter.cpp:
3262         (WebCore::TextDecorationPainter::TextDecorationPainter):
3263         (WebCore::TextDecorationPainter::paintTextDecoration):
3264         (WebCore::collectStylesForRenderer):
3265         (WebCore::TextDecorationPainter::stylesForRenderer):
3266         * rendering/TextDecorationPainter.h:
3267         * rendering/TextPaintStyle.cpp:
3268         (WebCore::computeTextPaintStyle):
3269         * rendering/line/BreakingContext.h:
3270         (WebCore::BreakingContext::handleText):
3271         * rendering/style/RenderStyle.cpp:
3272         (WebCore::RenderStyle::RenderStyle):
3273         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
3274         * rendering/style/RenderStyle.h:
3275         (WebCore::RenderStyle::textDecorationsInEffect const):
3276         (WebCore::RenderStyle::textDecoration const):
3277         (WebCore::RenderStyle::textDecorationSkip const):
3278         (WebCore::RenderStyle::hangingPunctuation const):
3279         (WebCore::RenderStyle::textEmphasisPosition const):
3280         (WebCore::RenderStyle::speakAs const):
3281         (WebCore::RenderStyle::addToTextDecorationsInEffect):
3282         (WebCore::RenderStyle::setTextDecorationsInEffect):
3283         (WebCore::RenderStyle::setTextDecoration):
3284         (WebCore::RenderStyle::setTextDecorationSkip):
3285         (WebCore::RenderStyle::setSpeakAs):
3286         (WebCore::RenderStyle::setTextEmphasisPosition):
3287         (WebCore::RenderStyle::setHangingPunctuation):
3288         (WebCore::RenderStyle::initialHangingPunctuation):
3289         (WebCore::RenderStyle::initialTextDecoration):
3290         (WebCore::RenderStyle::initialTextDecorationSkip):
3291         (WebCore::RenderStyle::initialTextUnderlinePosition):
3292         (WebCore::RenderStyle::initialSpeakAs):
3293         (WebCore::RenderStyle::initialTextEmphasisPosition):
3294         * rendering/style/RenderStyleConstants.h:
3295         (WebCore::operator|): Deleted.
3296         (WebCore::operator|=): Deleted.
3297         * rendering/style/StyleRareInheritedData.cpp:
3298         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3299         * rendering/style/StyleVisualData.cpp:
3300         (WebCore::StyleVisualData::StyleVisualData):
3301         * rendering/svg/SVGInlineTextBox.cpp:
3302         (WebCore::SVGInlineTextBox::paint):
3303         (WebCore::positionOffsetForDecoration):
3304         (WebCore::thicknessForDecoration):
3305         (WebCore::findRendererDefininingTextDecoration):
3306         (WebCore::SVGInlineTextBox::paintDecoration):
3307         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
3308         * rendering/svg/SVGInlineTextBox.h:
3309         * style/InlineTextBoxStyle.cpp:
3310         (WebCore::computeUnderlineOffset):
3311         (WebCore::visualOverflowForDecorations):
3312
3313 2018-05-26  Zalan Bujtas  <zalan@apple.com>
3314
3315         [LFC] Implement margin computation
3316         https://bugs.webkit.org/show_bug.cgi?id=186008
3317
3318         Reviewed by Antti Koivisto.
3319
3320         * WebCore.xcodeproj/project.pbxproj:
3321         * layout/FormattingContext.cpp:
3322         (WebCore::Layout::FormattingContext::computeMargin const):
3323         (WebCore::Layout::FormattingContext::marginTop const): Deleted.
3324         (WebCore::Layout::FormattingContext::marginLeft const): Deleted.
3325         (WebCore::Layout::FormattingContext::marginBottom const): Deleted.
3326         (WebCore::Layout::FormattingContext::marginRight const): Deleted.
3327         * layout/FormattingContext.h:
3328         * layout/blockformatting/BlockFormattingContext.cpp:
3329         (WebCore::Layout::BlockFormattingContext::layout const):
3330         (WebCore::Layout::BlockFormattingContext::computeMargin const):
3331         (WebCore::Layout::BlockFormattingContext::marginTop const): Deleted.
3332         (WebCore::Layout::BlockFormattingContext::marginBottom const): Deleted.
3333         * layout/blockformatting/BlockFormattingContext.h:
3334         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3335         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight):
3336         (WebCore::Layout::BlockFormattingContext::Geometry::computedMargin):
3337         * layout/blockformatting/BlockMarginCollapse.cpp:
3338         (WebCore::Layout::_isMarginBottomCollapsedWithParent):
3339         (WebCore::Layout::collapsedMarginBottomFromLastChild):
3340         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
3341         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
3342         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
3343         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
3344         (WebCore::Layout::BlockMarginCollapse::marginTop): Deleted.
3345         (WebCore::Layout::BlockMarginCollapse::marginBottom): Deleted.
3346         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
3347         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
3348         * layout/blockformatting/BlockMarginCollapse.h: Removed.
3349
3350 2018-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
3351
3352         [Cocoa] Delete unnecessary WebCascadeList in ComplexTextController
3353         https://bugs.webkit.org/show_bug.cgi?id=186007
3354
3355         Reviewed by Zalan Bujtas.
3356
3357         Inside ComplexTextController::collectComplexTextRuns(), we chop up text based on which fonts should be
3358         used to render which grapheme clusters. For each grapheme cluster, we run through the font-family list
3359         in FontCascade::fontForCombiningCharacterSequence() and find the first font that can render the cluster.
3360         If no items can render the cluster, we construct a WebCascadeList and let CoreText try to figure out
3361         which fonts can render which clusters.
3362
3363         Except there's no point, because we just determined that no font in the list can be used to render the
3364         cluster. CoreText isn't magic; it isn't going to somehow disagree with us. WebCascadeList is just
3365         useless code.
3366
3367         No new tests because there is no behavior change.
3368
3369         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3370         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3371         (-[WebCascadeList initWithFont:character:]): Deleted.