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