fff37193dfdfd65651632ba6602b7546c4bb2018
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-09-01  Simon Fraser  <simon.fraser@apple.com>
2
3         Rename FilterEffectRenderer to CSSFilter
4         https://bugs.webkit.org/show_bug.cgi?id=189223
5
6         Reviewed by Sam Weinig.
7
8         Filter was subclassed by SVGFilter for SVG, and FilterEffectRenderer for CSS,
9         which was very confusing, especially when the code uses renderer() to get it.
10         
11         Rename FilterEffectRenderer to CSSFilter, and access via filter().
12         
13         Future cleanup will deal with FilterEffectRendererHelper.
14
15         * Sources.txt:
16         * WebCore.xcodeproj/project.pbxproj:
17         * css/CSSFilterImageValue.cpp:
18         (WebCore::CSSFilterImageValue::image):
19         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
20         * platform/graphics/filters/Filter.h:
21         (WebCore::Filter::isCSSFilter const):
22         * rendering/CSSFilter.cpp: Copied from Source/WebCore/rendering/FilterEffectRenderer.cpp.
23         (WebCore::endMatrixRow):
24         (WebCore::lastMatrixRow):
25         (WebCore::CSSFilter::create):
26         (WebCore::CSSFilter::CSSFilter):
27         (WebCore::m_sourceGraphic):
28         (WebCore::CSSFilter::inputContext):
29         (WebCore::CSSFilter::buildReferenceFilter):
30         (WebCore::CSSFilter::build):
31         (WebCore::CSSFilter::updateBackingStoreRect):
32         (WebCore::CSSFilter::allocateBackingStoreIfNeeded):
33         (WebCore::CSSFilter::clearIntermediateResults):
34         (WebCore::CSSFilter::apply):
35         (WebCore::CSSFilter::computeSourceImageRectForDirtyRect):
36         (WebCore::CSSFilter::output const):
37         (WebCore::CSSFilter::setSourceImageRect):
38         (WebCore::CSSFilter::setMaxEffectRects):
39         (WebCore::CSSFilter::outputRect const):
40         * rendering/CSSFilter.h: Copied from Source/WebCore/rendering/FilterEffectRenderer.h.
41         (isType):
42         * rendering/FilterEffectRenderer.cpp:
43         (WebCore::FilterEffectRendererHelper::prepareFilterEffect):
44         (WebCore::FilterEffectRendererHelper::filterContext const):
45         (WebCore::FilterEffectRendererHelper::beginFilterEffect):
46         (WebCore::FilterEffectRendererHelper::applyFilterEffect):
47         (WebCore::endMatrixRow): Deleted.
48         (WebCore::lastMatrixRow): Deleted.
49         (WebCore::FilterEffectRenderer::FilterEffectRenderer): Deleted.
50         (WebCore::m_sourceGraphic): Deleted.
51         (WebCore::FilterEffectRenderer::create): Deleted.
52         (WebCore::FilterEffectRenderer::inputContext): Deleted.
53         (WebCore::FilterEffectRenderer::buildReferenceFilter): Deleted.
54         (WebCore::FilterEffectRenderer::build): Deleted.
55         (WebCore::FilterEffectRenderer::updateBackingStoreRect): Deleted.
56         (WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Deleted.
57         (WebCore::FilterEffectRenderer::clearIntermediateResults): Deleted.
58         (WebCore::FilterEffectRenderer::apply): Deleted.
59         (WebCore::FilterEffectRenderer::computeSourceImageRectForDirtyRect): Deleted.
60         (WebCore::FilterEffectRenderer::output const): Deleted.
61         (WebCore::FilterEffectRenderer::setMaxEffectRects): Deleted.
62         (WebCore::FilterEffectRenderer::outputRect const): Deleted.
63         * rendering/FilterEffectRenderer.h:
64         (WebCore::FilterEffectRendererHelper::FilterEffectRendererHelper):
65         (WebCore::FilterEffectRenderer::setSourceImageRect): Deleted.
66         * rendering/RenderBlockFlow.cpp:
67         * rendering/RenderFrame.cpp:
68         * rendering/RenderImage.cpp:
69         * rendering/RenderLayer.cpp:
70         (WebCore::RenderLayer::requiresFullLayerImageForFilters const):
71         (WebCore::RenderLayer::filter const):
72         (WebCore::RenderLayer::filterPainter const):
73         (WebCore::RenderLayer::setupFilters):
74         (WebCore::RenderLayer::calculateClipRects const):
75         (WebCore::RenderLayer::filterRenderer const): Deleted.
76         * rendering/RenderLayer.h:
77         * rendering/RenderLayerBacking.cpp:
78         * rendering/RenderLayerFilterInfo.cpp:
79         (WebCore::RenderLayer::FilterInfo::setFilter):
80         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
81         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
82         (WebCore::RenderLayer::FilterInfo::setRenderer): Deleted.
83         * rendering/RenderLayerFilterInfo.h:
84         * rendering/updating/RenderTreeBuilderBlock.cpp:
85
86 2018-09-01  Darin Adler  <darin@apple.com>
87
88         [CFNetwork] Update CFNetwork SPI use to use CFNetworkSPI.h more consistently
89         https://bugs.webkit.org/show_bug.cgi?id=189072
90
91         Reviewed by Dan Bernstein.
92
93         * platform/mac/WebCoreNSURLExtras.mm: Include CFNetworkSPI.h and remove a
94         declaration of +[NSURLProtocol _protocolClassForRequest:].
95
96         * platform/network/mac/ResourceHandleMac.mm: Remove a declaration of
97         -[NSURLConnection _initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:].
98         (WebCore::ResourceHandle::createNSURLConnection): Add ignore of
99         "-Wdeprecated-declarations" around use of the above method, since it
100         is deprecated.
101
102 2018-09-01  Simon Fraser  <simon.fraser@apple.com>
103
104         Add some more filter logging
105         https://bugs.webkit.org/show_bug.cgi?id=189221
106
107         Reviewed by Anders Carlsson.
108
109         Add logging in FilterEffect::apply() that shows all the filter rects, and logging
110         that brackets the application of a whole filter chain, for both SVG and CSS filters.
111
112         * platform/graphics/filters/FilterEffect.cpp:
113         (WebCore::FilterEffect::apply):
114         * rendering/FilterEffectRenderer.cpp:
115         (WebCore::FilterEffectRendererHelper::applyFilterEffect):
116         * rendering/svg/RenderSVGResourceFilter.cpp:
117         (WebCore::RenderSVGResourceFilter::postApplyResource):
118
119 2018-08-31  Youenn Fablet  <youenn@apple.com>
120
121         Move stats gathering out of LibWebRTCMediaEndpoint
122         https://bugs.webkit.org/show_bug.cgi?id=189180
123
124         Reviewed by Alejandro G. Castro.
125
126         Move stats gathering in LibWebRTCStatsCollector.
127         Make sure that the lambda given to the collector is always called and destroyed from the main thread.
128         This allows capturing the promise here instead of storing it into the peer connection backend.
129         No change of behavior.
130
131         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
132         (WebCore::LibWebRTCMediaEndpoint::getStats):
133         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
134         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
135         (WebCore::LibWebRTCPeerConnectionBackend::getStats):
136         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
137         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
138         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: Added.
139         (WebCore::LibWebRTCStatsCollector::LibWebRTCStatsCollector):
140         (WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector):
141         (WebCore::fromStdString):
142         (WebCore::fillRTCStats):
143         (WebCore::fillRTCRTPStreamStats):
144         (WebCore::fillInboundRTPStreamStats):
145         (WebCore::fillOutboundRTPStreamStats):
146         (WebCore::fillRTCMediaStreamTrackStats):
147         (WebCore::fillRTCDataChannelStats):
148         (WebCore::iceCandidatePairState):
149         (WebCore::fillRTCIceCandidatePairStats):
150         (WebCore::fillRTCCertificateStats):
151         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
152         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h: Added.
153         (WebCore::LibWebRTCStatsCollector::create):
154         * WebCore.xcodeproj/project.pbxproj:
155
156 2018-08-31  Jer Noble  <jer.noble@apple.com>
157
158         Compile error in RealtimeOutgoingVideoSource.cpp; unused parameter in libwebrtc header
159         https://bugs.webkit.org/show_bug.cgi?id=189203
160
161         Reviewed by Youenn Fablet.
162
163         If RealtimeOutgoingVideoSource.cpp is compiled alone (non-unified) or if it is the first file compiled in
164         a unified build, there is no pragma set to ignore unused parameter warnings in place.
165
166         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
167
168 2018-08-31  Wenson Hsieh  <wenson_hsieh@apple.com>
169
170         [iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm
171         https://bugs.webkit.org/show_bug.cgi?id=189054
172         <rdar://problem/43819779>
173
174         Reviewed by Tim Horton.
175
176         Remove redundant and unnecessary logic for reading from the pasteboard on iOS.
177
178         * platform/PlatformPasteboard.h:
179         * platform/ios/PlatformPasteboardIOS.mm:
180         (WebCore::PlatformPasteboard::stringForType const):
181
182         This currently grabs a string corresponding to the given type from the first item in the pasteboard. Make
183         stringForType instead call readString with pasteboard item index 0.
184
185         (WebCore::PlatformPasteboard::count const):
186         (WebCore::PlatformPasteboard::readBuffer const):
187         (WebCore::PlatformPasteboard::readString const):
188
189         Make readString with "public.url" call readURL.
190
191         (WebCore::PlatformPasteboard::readURL const):
192
193         Remove logic for reading URLs from the pasteboard as property lists deserialized from properly lists. This was
194         added in r223195 due to fix a case "when UIPasteboard serializes NSURL as a plist" when grabbing pasteboard data
195         using -valuesForPasteboardType:inItemSet:. However, this case only arises in non-UI applications (i.e. when
196         UIApplicationInitialize() has not been invoked); this is currently exercised by the test CopyURL.ValidURL, but
197         doesn't really correspond to a real-world use case, since all UI applications where a user would be able to
198         paste in a web view already invoke UIApplicationInitialize().
199
200         Instead of handling the case where the pasteboard contains a property list that has not been coerced to an
201         NSURL, simply remove the code from PlatformPasteboard::readURL and allow UIKit to perform the coercion when
202         running the test.
203
204         (WebCore::PlatformPasteboard::count): Deleted.
205         (WebCore::PlatformPasteboard::readBuffer): Deleted.
206         (WebCore::PlatformPasteboard::readString): Deleted.
207         (WebCore::PlatformPasteboard::readURL): Deleted.
208
209         Mark these functions as `const`.
210
211         * platform/wpe/PlatformPasteboardWPE.cpp:
212         (WebCore::PlatformPasteboard::readString const):
213         (WebCore::PlatformPasteboard::readString): Deleted.
214
215         Mark this function as const.
216
217 2018-08-31  Jer Noble  <jer.noble@apple.com>
218
219         Compilation error in FormData.cpp: incomplete type 'WebCore::SharedBuffer'
220         https://bugs.webkit.org/show_bug.cgi?id=189207
221
222         Reviewed by Youenn Fablet.
223
224         If FormData.cpp is compiled alone (non-unified) or if it is the first file compiled in
225         a unified build, SharedBuffer.h is not included.
226
227         * platform/network/FormData.cpp:
228
229 2018-08-31  Chris Dumez  <cdumez@apple.com>
230
231         [ WK2 ] http/tests/workers/service/client-*-page-cache.html LayoutTests are flaky
232         https://bugs.webkit.org/show_bug.cgi?id=183705
233         <rdar://problem/42440606>
234
235         Reviewed by Youenn Fablet.
236
237         Add internals.serviceWorkerClientIdentifier() utility function so that a layout test can get the
238         service worker client identifier of a document.
239
240         * testing/Internals.cpp:
241         (WebCore::Internals::serviceWorkerClientIdentifier const):
242         * testing/Internals.h:
243         * testing/Internals.idl:
244
245 2018-08-31  John Wilander  <wilander@apple.com>
246
247         Storage Access API: Maintain access through same-site navigations
248         https://bugs.webkit.org/show_bug.cgi?id=188564
249         <rdar://problem/43445160>
250
251         Reviewed by Alex Christensen.
252
253         Tests: http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html
254                http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html
255
256         * dom/Document.h:
257             Removed unused member variable m_hasFrameSpecificStorageAccess.
258         * loader/DocumentLoader.cpp:
259         (WebCore::DocumentLoader::willSendRequest):
260         * loader/FrameLoaderClient.h:
261
262 2018-08-31  Youenn Fablet  <youenn@apple.com>
263
264         WebAudioBufferList.cpp/.h is named as cocoa/WebAudioBufferList.cpp/.h
265         https://bugs.webkit.org/show_bug.cgi?id=189160
266
267         Reviewed by Jer Noble.
268
269         Add WebAudioBufferList.cpp to unified build.
270         Update XCode project so that the file names are right.
271         No change of behavior.
272
273         * PlatformMac.cmake:
274         * SourcesCocoa.txt:
275         * WebCore.xcodeproj/project.pbxproj:
276
277 2018-08-31  Chris Dumez  <cdumez@apple.com>
278
279         Assertion hit in ~CompletionHandler() from ~WebFrame()
280         https://bugs.webkit.org/show_bug.cgi?id=189199
281         <rdar://problem/42657233>
282
283         Reviewed by Youenn Fablet.
284
285         The issue was caused by WebFrame::m_willSubmitFormCompletionHandlers implicitly containing
286         CompletionHandlers (wrapped in WTF::Functions) and not calling them upon WebFrame
287         destruction.
288
289         No new tests, covered by fast/frames/iframe-target.html.
290
291         * loader/EmptyClients.cpp:
292         (WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm):
293         * loader/EmptyFrameLoaderClient.h:
294         * loader/FrameLoaderClient.h:
295
296 2018-08-31  Zalan Bujtas  <zalan@apple.com>
297
298         [LFC] Add margin box verification back now that Display::Box has non-computed horizontal margin.
299         https://bugs.webkit.org/show_bug.cgi?id=189193
300
301         Reviewed by Antti Koivisto.
302
303         Use the non-computed margin values to verify correctness.
304         This patch also fixes a margin collapsing issue when the inflow box has a float sibling. The float
305         sibling does not prevent collapsing with the parent's top/bottom margin.
306
307         Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin-with-no-border.html
308
309         * layout/Verification.cpp:
310         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
311         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
312         * layout/blockformatting/BlockMarginCollapse.cpp:
313         (WebCore::Layout::isMarginTopCollapsedWithParent):
314         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
315
316 2018-08-31  Antti Koivisto  <antti@apple.com>
317
318         Replace OptionSet |= and -= operators with add() and remove() functions
319         https://bugs.webkit.org/show_bug.cgi?id=189169
320
321         Reviewed by Anders Carlsson.
322
323         * accessibility/AccessibilityObject.cpp:
324         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
325         * css/StyleBuilderConverter.h:
326         (WebCore::StyleBuilderConverter::convertTextDecoration):
327         (WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
328         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
329         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
330         (WebCore::StyleBuilderConverter::convertSpeakAs):
331         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
332         * css/parser/CSSParser.cpp:
333         (WebCore::CSSParser::parseSystemColor):
334         * dom/Document.cpp:
335         (WebCore::Document::styleColorOptions const):
336         * dom/DocumentMarkerController.cpp:
337         (WebCore::DocumentMarkerController::addMarker):
338         (WebCore::DocumentMarkerController::removeMarkers):
339         * dom/ScriptedAnimationController.cpp:
340         (WebCore::ScriptedAnimationController::addThrottlingReason):
341         (WebCore::ScriptedAnimationController::removeThrottlingReason):
342         * dom/SecurityContext.h:
343         (WebCore::SecurityContext::setFoundMixedContent):
344         * dom/UIEventWithKeyState.cpp:
345         (WebCore::UIEventWithKeyState::modifiersFromInitializer):
346         (WebCore::UIEventWithKeyState::setModifierKeys):
347         * dom/UserActionElementSet.cpp:
348         (WebCore::UserActionElementSet::setFlags):
349         * editing/CompositeEditCommand.cpp:
350         (WebCore::CompositeEditCommand::moveParagraphs):
351         * editing/Editor.cpp:
352         (WebCore::Editor::replaceSelectionWithFragment):
353         (WebCore::Editor::appliedEditing):
354         (WebCore::Editor::markMisspellingsAfterTypingToWord):
355         (WebCore::Editor::markMisspellingsAndBadGrammar):
356         (WebCore::Editor::resolveTextCheckingTypeMask):
357         * editing/FrameSelection.cpp:
358         (WebCore::FrameSelection::moveWithoutValidationTo):
359         (WebCore::FrameSelection::setSelectedRange):
360         * editing/FrameSelection.h:
361         (WebCore::FrameSelection::defaultSetSelectionOptions):
362         * editing/MoveSelectionCommand.cpp:
363         (WebCore::MoveSelectionCommand::doApply):
364         * editing/SpellChecker.cpp:
365         (WebCore::SpellChecker::didCheckSucceed):
366         * editing/TextCheckingHelper.cpp:
367         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
368         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
369         * editing/TextIterator.cpp:
370         (WebCore::SearchBuffer::SearchBuffer):
371         * html/HTMLAnchorElement.cpp:
372         (WebCore::HTMLAnchorElement::parseAttribute):
373         * inspector/agents/InspectorPageAgent.cpp:
374         (WebCore::InspectorPageAgent::reload):
375         * page/ContextMenuController.cpp:
376         (WebCore::ContextMenuController::contextMenuItemSelected):
377         * page/DOMWindow.cpp:
378         (WebCore::DOMWindow::find const):
379         * page/DragController.cpp:
380         (WebCore::DragController::concludeEditDrag):
381         * page/FrameSnapshotting.cpp:
382         (WebCore::snapshotFrameRectWithClip):
383         * page/FrameView.cpp:
384         (WebCore::updateLayerPositionFlags):
385         (WebCore::FrameView::willPaintContents):
386         * page/Page.cpp:
387         (WebCore::Page::setIsVisible):
388         * page/PerformanceObserver.cpp:
389         (WebCore::PerformanceObserver::observe):
390         * page/TextIndicator.cpp:
391         (WebCore::TextIndicator::createWithRange):
392         * page/WindowFeatures.cpp:
393         (WebCore::parseDisabledAdaptations):
394         * page/csp/ContentSecurityPolicy.h:
395         (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts):
396         (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets):
397         * page/csp/ContentSecurityPolicySourceList.cpp:
398         (WebCore::ContentSecurityPolicySourceList::parseHashSource):
399         * platform/PlatformEvent.h:
400         (WebCore::PlatformEvent::PlatformEvent):
401         * platform/ios/PlatformEventFactoryIOS.mm:
402         (WebCore::modifiersForEvent):
403         * platform/mac/PlatformEventFactoryMac.mm:
404         (WebCore::modifiersForEvent):
405         * rendering/RenderLayer.cpp:
406         (WebCore::RenderLayer::updateLayerPositions):
407         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
408         (WebCore::RenderLayer::paintLayer):
409         (WebCore::RenderLayer::paintLayerContentsAndReflection):
410         (WebCore::RenderLayer::paintLayerContents):
411         (WebCore::RenderLayer::paintForegroundForFragments):
412         * rendering/RenderLayerBacking.cpp:
413         (WebCore::RenderLayerBacking::paintIntoLayer):
414         (WebCore::RenderLayerBacking::paintContents):
415         * rendering/RenderLayerCompositor.cpp:
416         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
417         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
418         * rendering/TextDecorationPainter.cpp:
419         (WebCore::collectStylesForRenderer):
420         * rendering/TextPaintStyle.cpp:
421         (WebCore::computeTextPaintStyle):
422         * rendering/style/RenderStyle.cpp:
423         (WebCore::RenderStyle::changeRequiresLayout const):
424         (WebCore::RenderStyle::changeRequiresLayerRepaint const):
425         (WebCore::RenderStyle::changeRequiresRepaint const):
426         * testing/Internals.cpp:
427         (WebCore::parseFindOptions):
428         (WebCore::Internals::forceReload):
429         (WebCore::Internals::setPageVisibility):
430         (WebCore::Internals::setPageIsFocusedAndActive):
431
432 2018-08-31  Aditya Keerthi  <akeerthi@apple.com>
433
434         [Datalist][iOS] Add suggestions UI for TextFieldInputTypes
435         https://bugs.webkit.org/show_bug.cgi?id=186714
436
437         Reviewed by Wenson Hsieh.
438
439         On iOS, the datalist button should appear as a downward triangle. Furthermore, the
440         button should only be displayed if the input has focus and there are suggested
441         values.
442
443         * css/html.css:
444         (input::-webkit-list-button): Draw the triangle using an SVG.
445         * html/DataListSuggestionInformation.h:
446         * html/HTMLInputElement.h:
447         * html/TextFieldInputType.cpp: Added logic to show and hide the datalist button as necessary.
448         (WebCore::TextFieldInputType::handleFocusEvent):
449         (WebCore::TextFieldInputType::handleBlurEvent):
450         (WebCore::TextFieldInputType::didSetValueByUserEdit):
451         (WebCore::TextFieldInputType::listAttributeTargetChanged):
452         (WebCore::TextFieldInputType::displaySuggestions):
453
454 2018-08-31  Youenn Fablet  <youenn@apple.com>
455
456         Move LibWebRTCMediaEndpoint data channel code to LibWebRTCDataChannelHandler
457         https://bugs.webkit.org/show_bug.cgi?id=189182
458
459         Reviewed by Alejandro G. Castro.
460
461         Moving data channel code outside of LibWebRTCMediaEndpoint.
462         This will allow future development to support unified plan.
463         No change of behavior.
464
465         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
466         (WebCore::LibWebRTCDataChannelHandler::fromRTCDataChannelInit):
467         (WebCore::LibWebRTCDataChannelHandler::channelEvent):
468         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
469         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
470         (WebCore::LibWebRTCMediaEndpoint::createDataChannel):
471         (WebCore::LibWebRTCMediaEndpoint::OnDataChannel):
472         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
473
474 2018-08-31  Youenn Fablet  <youenn@apple.com>
475
476         Move session observers outside LibWebRTCMediaEndpoint
477         https://bugs.webkit.org/show_bug.cgi?id=189181
478
479         Reviewed by Alejandro G. Castro.
480
481         Move classes of LibWebRTCMediaEndpoint to a separate file.
482         No change of behavior.
483
484         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
485         * Modules/mediastream/libwebrtc/LibWebRTCObservers.h: Added.
486         * WebCore.xcodeproj/project.pbxproj:
487
488 2018-08-31  Eric Carlson  <eric.carlson@apple.com>
489
490         [MediaStream] Remove AVMediaCaptureSource
491         https://bugs.webkit.org/show_bug.cgi?id=189159
492
493         Reviewed by Youenn Fablet.
494
495         No new tests, no change in functionality.
496
497         Refactor video capture to get rid of a base class we don't 
498         need any more.
499
500         * WebCore.xcodeproj/project.pbxproj:
501         * platform/mediastream/mac/AVMediaCaptureSource.h: Removed.
502         * platform/mediastream/mac/AVMediaCaptureSource.mm: Removed.
503         * platform/mediastream/mac/AVVideoCaptureSource.h:
504         (WebCore::AVVideoCaptureSource::session const):
505         (WebCore::AVVideoCaptureSource::device const):
506         * platform/mediastream/mac/AVVideoCaptureSource.mm:
507         (WebCore::globaVideoCaptureSerialQueue):
508         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
509         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
510         (WebCore::AVVideoCaptureSource::startProducingData):
511         (WebCore::AVVideoCaptureSource::stopProducingData):
512         (WebCore::AVVideoCaptureSource::beginConfiguration):
513         (WebCore::AVVideoCaptureSource::commitConfiguration):
514         (WebCore::AVVideoCaptureSource::settingsDidChange):
515         (WebCore::AVVideoCaptureSource::settings const):
516         (WebCore::AVVideoCaptureSource::capabilities const):
517         (WebCore::AVVideoCaptureSource::setPreset):
518         (WebCore::AVVideoCaptureSource::setupSession):
519         (WebCore::AVVideoCaptureSource::setupCaptureSession):
520         (WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange):
521         (WebCore::AVVideoCaptureSource::interrupted const):
522         (WebCore::AVVideoCaptureSource::captureSessionRuntimeError):
523         (WebCore::AVVideoCaptureSource::captureSessionBeginInterruption):
524         (WebCore::AVVideoCaptureSource::captureSessionEndInterruption):
525         (-[WebCoreAVVideoCaptureSourceObserver initWithCallback:]):
526         (-[WebCoreAVVideoCaptureSourceObserver disconnect]):
527         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
528         (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
529         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
530         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
531         (-[WebCoreAVVideoCaptureSourceObserver sessionRuntimeError:]):
532         (-[WebCoreAVVideoCaptureSourceObserver beginSessionInterrupted:]):
533         (-[WebCoreAVVideoCaptureSourceObserver endSessionInterrupted:]):
534         (WebCore::AVVideoCaptureSource::initializeCapabilities): Deleted.
535         (WebCore::AVVideoCaptureSource::initializeSupportedConstraints): Deleted.
536         (WebCore::AVVideoCaptureSource::updateSettings): Deleted.
537
538 2018-08-31  Philippe Normand  <pnormand@igalia.com>
539
540         Unreviewed, GTK Ubuntu LTS build fix after r235543.
541
542         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
543
544 2018-08-31  Philippe Normand  <pnormand@igalia.com>
545
546         Unreviewed, fix compilation warning in EME GStreamer backend.
547
548         Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:1293:19:
549         warning: format ‘%lu’ expects argument of type ‘long unsigned
550         int’, but argument 9 has type ‘unsigned int’ [-Wformat=]
551
552         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
553         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
554
555 2018-08-31  Philippe Normand  <philn@igalia.com>
556
557         [GStreamer][GL] useless ifdef in pushTextureToCompositor
558         https://bugs.webkit.org/show_bug.cgi?id=188552
559
560         Reviewed by Xabier Rodriguez-Calvar.
561
562         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
563         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
564         There's no need for an ifdef because the frame holder already
565         ensures a valid texture ID will be set if it maps a GL video frame.
566
567 2018-08-31  David Kilzer  <ddkilzer@apple.com>
568
569         REGRESSION (r235190): Fix name of WebAudioBufferList.{cpp,h} in Xcode project
570
571         * WebCore.xcodeproj/project.pbxproj:
572         - Add the 'name' parameter to the file references, then fix the
573           visual name everywhere else, so these files don't appear as
574           "cocoa/WebAudioBufferList.{cpp,h}" in the project.
575
576 2018-08-31  Frederic Wang  <fwang@igalia.com>
577
578         Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement
579         https://bugs.webkit.org/show_bug.cgi?id=182053
580
581         Reviewed by Simon Fraser.
582
583         This commit introduces a new CSSOMViewScrollingAPIEnabled flag that will be used to implement
584         the standard behavior of DOM scroll* API as specified by the CSSOM View spec (see bug 5991).
585         It changes the behavior of document.scrollingElement so that it follows the spec when the
586         flag is enabled. This will allow to pass the WPT test cssom-view/scrollingElement.html when
587         it becomes the default behavior. WPT tests cssom-view/scrollingElement-quirks-dynamic*.html
588         still fail; comparing with Chromium's code, we might need to propagate the style of <html>
589         and <body> to the viewport element. Behaviors for other scrolling attributes will be changed
590         in follow-up bugs.
591
592         Tests: fast/dom/Document/scrollingElement-quirks-mode.html
593                fast/dom/Document/scrollingElement-standard-mode.html
594
595         * dom/Document.cpp:
596         (WebCore::Document::isBodyPotentiallyScrollable): Helper function to verify whether the body
597         is potentially scrollable, as defined by the CSSOM View spec. It seems that
598         RenderObject::hasOverflowClip() may return incorrect value at this point and we might need
599         to do something similar to Chromium's style propagation to make it work. For now, we just
600         use the computed style. See bug 182292.
601         (WebCore::Document::scrollingElement): When CSSOMViewScrollingAPIEnabled is enabled, we
602         implement the algorithm of the CSSOM View spec.
603         (WebCore::Document::body const): Verify that the root is actually a <html> element or
604         otherwise return null. This is required by the CSSOM View spec and for WPT test
605         scrollingElement.html. It is consistent  with bodyOrFrameset().
606         * dom/Document.h: Add spec references for body() and bodyOrFrameset() and declare
607         isBodyPotentiallyScrollable().
608         * page/Settings.yaml: Add developer option for enabling the CSSOM View behavior.
609         * rendering/style/RenderStyle.h:
610         (WebCore::RenderStyle::isOverflowVisible const): Add helper function to check whether the
611         style implies visible overflow.
612
613 2018-08-30  Zalan Bujtas  <zalan@apple.com>
614
615         CounterMaps should hold a unique_ptr of CounterMap.
616         https://bugs.webkit.org/show_bug.cgi?id=189174
617         <rdar://problem/43686458>
618
619         Reviewed by Ryosuke Niwa.
620
621         In certain cases calls to CounterMaps might lead to unexpected deletion of the CounterMap object.
622
623         Test: fast/css/counters/crash-when-cloning-body.html
624
625         * rendering/RenderCounter.cpp:
626         (WebCore::makeCounterNode):
627         (WebCore::destroyCounterNodeWithoutMapRemoval):
628         (WebCore::RenderCounter::destroyCounterNodes):
629         (WebCore::RenderCounter::destroyCounterNode):
630         (WebCore::updateCounters):
631         (showCounterRendererTree):
632
633 2018-08-30  Ross Kirsling  <ross.kirsling@sony.com>
634
635         Speculative build fix for WPE after r235531.
636
637         * platform/graphics/filters/PointLightSource.cpp:
638         Add missing include.
639
640 2018-08-30  Ryosuke Niwa  <rniwa@webkit.org>
641
642         Add assignedElements to HTMLSlotElement
643         https://bugs.webkit.org/show_bug.cgi?id=189146
644
645         Reviewed by Darin Adler.
646
647         Added assignedElements to HTMLSlotElement. For now, we simply filter the results returned by assignedNodes.
648
649         Also fixed a bug that assignedNodes was returning the fallback content when the slot is not in a shadow tree,
650         which is specified in step 2 of the concept to find flattened slotables for a slot.
651
652         Spec: https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assignedelements
653               https://dom.spec.whatwg.org/#find-flattened-slotables
654
655         Tests: imported/w3c/web-platform-tests/shadow-dom/slots.html
656                imported/w3c/web-platform-tests/shadow-dom/slots-fallback.html
657
658         * html/HTMLSlotElement.cpp:
659         (WebCore::flattenAssignedNodes): Updated to take Vector<Ref<Node>> for consistency.
660         (WebCore::HTMLSlotElement::assignedNodes const): Ditto.
661         (WebCore::HTMLSlotElement::assignedElements const):
662         * html/HTMLSlotElement.h:
663         * html/HTMLSlotElement.idl:
664
665 2018-08-30  Don Olmstead  <don.olmstead@sony.com>
666
667         [CMake] Replace AVFoundationSupport.py using CMake
668         https://bugs.webkit.org/show_bug.cgi?id=182891
669
670         Reviewed by Per Arne Vollan.
671
672         No new tests. No change in behavior.
673
674         Remove refernces to PAL derived sources.
675
676         * PlatformWin.cmake:
677         * config.h:
678
679 2018-08-30  Olivia Barnett  <obarnett@apple.com>
680
681         REGRESSION(r235489): fast/dom/navigator-detached-no-crash.html crashes under Navigator::share
682         https://bugs.webkit.org/show_bug.cgi?id=189170
683
684         Reviewed by Tim Horton.
685
686         No new tests; fixing a failing existing test.
687
688         * page/Navigator.cpp:
689         (WebCore::Navigator::share):
690         Added null check for frame.
691
692 2018-08-30  Truitt Savell  <tsavell@apple.com>
693
694         Unreviewed, rolling out r235516.
695
696         Caused 50 Crashes on Sierra
697
698         Reverted changeset:
699
700         "The width of a nullptr TextRun should be zero"
701         https://bugs.webkit.org/show_bug.cgi?id=189154
702         https://trac.webkit.org/changeset/235516
703
704 2018-08-30  Tim Horton  <timothy_horton@apple.com>
705
706         Bundle unified sources more tightly in projects with deep directory structures
707         https://bugs.webkit.org/show_bug.cgi?id=189009
708
709         Reviewed by Simon Fraser.
710
711         Fix a variety of unification errors due to reshuffling the bundles.
712
713         * Modules/mediastream/RTCController.cpp:
714         * SourcesCocoa.txt:
715         * WebCore.xcodeproj/project.pbxproj:
716         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
717         (WebCore::CryptoAlgorithmECDSA::importKey):
718         * dom/Document.h:
719         * html/parser/HTMLTreeBuilder.cpp:
720         * loader/appcache/ApplicationCacheResourceLoader.h:
721         * page/AlternativeTextClient.h:
722         * platform/Pasteboard.h:
723         * platform/graphics/DisplayRefreshMonitor.cpp:
724         * platform/graphics/FontFamilySpecificationNull.cpp:
725         * platform/graphics/cocoa/WebGLLayer.mm:
726         (-[WebGLLayer initWithGraphicsContext3D:]):
727         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
728         (-[WebGLLayer display]):
729         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
730         * platform/graphics/cocoa/WebGPULayer.mm:
731         (-[WebGPULayer initWithGPUDevice:]):
732         * platform/graphics/metal/GPUCommandQueueMetal.mm:
733         * platform/mac/PasteboardMac.mm:
734         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
735         * platform/network/ResourceRequestBase.cpp:
736         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
737         * rendering/updating/RenderTreeBuilderInline.cpp:
738
739 2018-08-30  Andy Estes  <aestes@apple.com>
740
741         [Payment Request] Implement the PaymentMethodChangeEvent and PaymentMethodChangeEventInit interfaces
742         https://bugs.webkit.org/show_bug.cgi?id=189100
743
744         Reviewed by Daniel Bates.
745
746         Implement the PaymentMethodChangeEvent interface and PaymentMethodChangeEventInit dictionary
747         defined in the Payment Request API W3C Editor's Draft of 30 August 2018.
748
749         <https://w3c.github.io/payment-request/#paymentmethodchangeevent-interface>
750
751         The "payment method changed" algorithm will be implemented in a follow-up.
752
753         Covered by existing web platform tests.
754
755         * CMakeLists.txt:
756         * DerivedSources.make:
757         * Modules/paymentrequest/PaymentMethodChangeEvent.cpp: Added.
758         (WebCore::PaymentMethodChangeEvent::eventInterface const):
759         (WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent):
760         * Modules/paymentrequest/PaymentMethodChangeEvent.h: Added.
761         * Modules/paymentrequest/PaymentMethodChangeEvent.idl: Added.
762         * Modules/paymentrequest/PaymentMethodChangeEventInit.h: Added.
763         * Modules/paymentrequest/PaymentMethodChangeEventInit.idl: Added.
764         * Modules/paymentrequest/PaymentRequest.idl:
765         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
766         (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
767         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
768         * Modules/paymentrequest/PaymentRequestUpdateEventInit.h:
769         * Sources.txt:
770         * WebCore.xcodeproj/project.pbxproj:
771         * bindings/js/WebCoreBuiltinNames.h:
772         * dom/EventNames.h:
773         * dom/EventNames.in:
774
775 2018-08-30  Brent Fulgham  <bfulgham@apple.com>
776
777         The width of a nullptr TextRun should be zero
778         https://bugs.webkit.org/show_bug.cgi?id=189154
779         <rdar://problem/43685926>
780
781         Reviewed by Zalan Bujtas.
782
783         If a page has an empty TextRun and attempts to paint it we can crash with a nullptr.
784
785         This patch recognizes that an empty TextRun should always produce a zero width, rather than
786         attempt to compute this value from font data.
787
788         Test: fast/text/null-string-textrun.html
789
790         * platform/graphics/FontCascade.cpp:
791         (WebCore::FontCascade::widthOfTextRange const): An empty TextRun has zero width.
792         (WebCore::FontCascade::width const): Ditto.
793         (WebCore::FontCascade::codePath const): ASSERT that the TextRun is non-empty.
794
795 2018-08-30  Eric Carlson  <eric.carlson@apple.com>
796
797         Mock video devices should only support discrete sizes
798         https://bugs.webkit.org/show_bug.cgi?id=189000
799         <rdar://problem/43766551>
800
801         Reviewed by Youenn Fablet.
802         
803         While many/most video capture devices only support a finite number of discrete width/height
804         pairs, our mock video capture devices supported arbitrary width and height combinations which
805         made it difficult to write realistic tests using them. Change the mock devices to support
806         finite "presets" like those supported by AVFoundation. Create a RealtimeVideoSource base
807         class with support for these presets, so the same code will eventually be used by the mock
808         and real capture devices.
809
810         No new tests, existing tests updated for these changes.
811
812         * Sources.txt: Add RealtimeVideoSource.cpp, remove MockRealtimeMediaSource.cpp.
813
814         * WebCore.xcodeproj/project.pbxproj: Ditto.
815
816         * platform/mediastream/MediaConstraints.h: Deal with min constraint less than the supported minimum
817         and max larger than the supported maximum when there is no ideal.
818
819         * platform/mediastream/RealtimeMediaSource.cpp:
820         (WebCore::RealtimeMediaSource::selectSettings): Use supportsSizeAndFrameRate for widths,
821         heights, and framerates in advanced constraints so a width and height that are supported but
822         in the same preset are filtered out.
823         (WebCore::RealtimeMediaSource::setSize): New.
824         * platform/mediastream/RealtimeMediaSource.h:
825
826         * platform/mediastream/RealtimeMediaSourceSettings.h: Remove an unneeded include.
827
828         * platform/mediastream/RealtimeVideoSource.cpp: Added.
829         (WebCore::RealtimeVideoSource::RealtimeVideoSource):
830         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
831         (WebCore::RealtimeVideoSource::startProducingData):
832         (WebCore::RealtimeVideoSource::setSupportedFrameRates):
833         (WebCore::RealtimeVideoSource::addSupportedCapabilities const):
834         (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate):
835         (WebCore::RealtimeVideoSource::bestSupportedCaptureSizeForWidthAndHeight):
836         (WebCore::RealtimeVideoSource::applySize):
837         (WebCore::RealtimeVideoSource::applySizeAndFrameRate):
838         (WebCore::RealtimeVideoSource::videoSampleAvailable):
839         (WebCore::RealtimeVideoSource::applyFrameRate):
840         (WebCore::RealtimeVideoSource::supportsFrameRate):
841
842         * platform/mediastream/RealtimeVideoSource.h: Copied from Source/WebCore/platform/mock/MockRealtimeAudioSource.h.
843         (WebCore::RealtimeVideoSource::setSupportedCaptureSizes):
844         (WebCore::RealtimeVideoSource::setDefaultSize):
845         (WebCore::RealtimeVideoSource::observedFrameRate const):
846
847         * platform/mediastream/mac/AVMediaCaptureSource.mm:
848         (WebCore::AVMediaCaptureSource::initializeSettings): Don't set label, it isn't used.
849
850         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
851         (WebCore::MockRealtimeVideoSourceMac::applySize): Call the base class.
852
853         * platform/mock/MockMediaDevice.h:
854         (WebCore::MockCameraProperties::encode const): Add frame rates, sizes, and facing mode.
855         (WebCore::MockCameraProperties::decode): Ditto.
856
857         * platform/mock/MockRealtimeAudioSource.cpp:
858         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): No more MockRealtimeMediaSource.
859         (WebCore::MockRealtimeAudioSource::settings const): Clean up.
860         (WebCore::MockRealtimeAudioSource::capabilities const): Ditto.
861         (WebCore::MockRealtimeAudioSource::settingsDidChange): Ditto.
862         (WebCore::MockRealtimeAudioSource::stopProducingData): m_elapsedTime isn't used, delete it.
863         (WebCore::MockRealtimeAudioSource::updateSettings): Deleted.
864         (WebCore::MockRealtimeAudioSource::initializeCapabilities): Deleted.
865         (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints): Deleted.
866         (WebCore::MockRealtimeAudioSource::elapsedTime): Deleted.
867         * platform/mock/MockRealtimeAudioSource.h:
868
869         * platform/mock/MockRealtimeMediaSourceCenter.cpp: Moved all of the mock device management
870         code from MockRealtimeMediaSource.cpp here.
871         (WebCore::defaultDevices):
872         (WebCore::devices):
873         (WebCore::deviceMap):
874         (WebCore::deviceListForDevice):
875         (WebCore::createCaptureDevice):
876         (WebCore::MockRealtimeMediaSourceCenter::resetDevices):
877         (WebCore::MockRealtimeMediaSourceCenter::setDevices):
878         (WebCore::MockRealtimeMediaSourceCenter::addDevice):
879         (WebCore::MockRealtimeMediaSourceCenter::removeDevice):
880         (WebCore::MockRealtimeMediaSourceCenter::mockDeviceWithPersistentID):
881         (WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID):
882         (WebCore::MockRealtimeMediaSourceCenter::audioDevices):
883         (WebCore::MockRealtimeMediaSourceCenter::videoDevices):
884         (WebCore::MockRealtimeMediaSourceCenter::displayDevices):
885
886         * platform/mock/MockRealtimeVideoSource.cpp:
887         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Use RealtimeVideoSource, no
888         more MockRealtimeMediaSource.
889         (WebCore::MockRealtimeVideoSource::capabilities const): Ditto, cleanup.
890         (WebCore::MockRealtimeVideoSource::settings const): Ditto.
891         (WebCore::MockRealtimeVideoSource::settingsDidChange): Ditto.
892         (WebCore::MockRealtimeVideoSource::startCaptureTimer): Ditto.
893         (WebCore::MockRealtimeVideoSource::startProducingData): Ditto.
894         (WebCore::MockRealtimeVideoSource::stopProducingData): Ditto.
895         (WebCore::MockRealtimeVideoSource::elapsedTime): Ditto.
896         (WebCore::MockRealtimeVideoSource::applySize): Ditto.
897         (WebCore::MockRealtimeVideoSource::drawText): Render the actual frame rate.
898         (WebCore::MockRealtimeVideoSource::generateFrame): Use m_fillColor.
899         (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted.
900         (WebCore::MockRealtimeVideoSource::updateSettings): Deleted.
901         (WebCore::MockRealtimeVideoSource::initializeCapabilities): Deleted.
902         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints): Deleted.
903         (WebCore::MockRealtimeVideoSource::applyFrameRate): Deleted.
904         * platform/mock/MockRealtimeVideoSource.h:
905         (WebCore::MockRealtimeVideoSource::updateSampleBuffer): Deleted.
906
907 2018-08-30  Zalan Bujtas  <zalan@apple.com>
908
909         [LFC][Floating] Block formatting context roots avoid floats.
910         https://bugs.webkit.org/show_bug.cgi?id=189150
911
912         Reviewed by Antti Koivisto.
913
914         This patch implements the float avoiding behaviour for block formatting context roots.
915
916         When a box establishes a block formatting context, floats from outside of the context can't interfere with content inside. In order
917         to achive this, such formatting root boxes need to be positioned so that they don't overlap with floats (floats that share the same
918         context with the formatting root). In ltr block direction, roots start with avoiding floats on the left, while in rtl on the right.
919
920         Tests: fast/block/block-only/float-avoider-multiple-roots.html
921                fast/block/block-only/float-avoider-simple-left.html
922                fast/block/block-only/float-avoider-simple-right.html
923                fast/block/block-only/float-avoider-with-margins.html
924
925         * layout/blockformatting/BlockFormattingContext.cpp:
926         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
927         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
928         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
929         * layout/blockformatting/BlockFormattingContext.h:
930         * layout/floats/FloatAvoider.cpp:
931         (WebCore::Layout::FloatAvoider::FloatAvoider):
932         * layout/floats/FloatingContext.cpp:
933         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
934         * layout/floats/FloatingContext.h:
935
936 2018-08-30  Zalan Bujtas  <zalan@apple.com>
937
938         [LFC][Floating] Move containing block constraint logic from FloatAvoider to FloatingContext
939         https://bugs.webkit.org/show_bug.cgi?id=189145
940
941         Reviewed by Antti Koivisto.
942
943         When the float avoider is constrained horizontally, simply align it with the left/right edge of its containing block (with the combination of the constraints)
944         and check the overflow as part of the FloatingContext::floatingPosition() logic. It simplifies the constraint logic/helps implementing the non-float avoider
945         case.
946
947         * layout/floats/FloatAvoider.cpp:
948         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
949         (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
950         * layout/floats/FloatAvoider.h:
951         * layout/floats/FloatingContext.cpp:
952         (WebCore::Layout::FloatingContext::floatingPosition const):
953
954 2018-08-30  Zalan Bujtas  <zalan@apple.com>
955
956         [LFC][Floating] Use non-computed horizontal margins when intersecting floats with float avoiders.
957         https://bugs.webkit.org/show_bug.cgi?id=189143
958
959         Reviewed by Antti Koivisto.
960
961         * layout/Verification.cpp:
962         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
963         * layout/floats/FloatAvoider.cpp:
964         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
965         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
966         * layout/floats/FloatAvoider.h:
967         (WebCore::Layout::FloatAvoider::marginTop const):
968         (WebCore::Layout::FloatAvoider::marginBottom const):
969         (WebCore::Layout::FloatAvoider::marginLeft const):
970         (WebCore::Layout::FloatAvoider::marginRight const):
971         (WebCore::Layout::FloatAvoider::marginBoxWidth const):
972         * layout/floats/FloatBox.cpp:
973         (WebCore::Layout::FloatBox::rect const):
974         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
975         (WebCore::Layout::FloatBox::verticalPositionCandidate):
976         (WebCore::Layout::FloatBox::initialVerticalPosition const):
977         * layout/floats/FloatBox.h:
978
979 2018-08-30  Zalan Bujtas  <zalan@apple.com>
980
981         [LFC][Margins] Add non-computed horizontal margins to DisplayBox
982         https://bugs.webkit.org/show_bug.cgi?id=189141
983
984         Reviewed by Antti Koivisto.
985
986         Inflow block boxes' horizontal margins extend all the way to the left/right edge of their containing block.
987         See https://www.w3.org/TR/CSS22/visudet.html#blockwidth for example
988         "...
989         10.3.3 Block-level, non-replaced elements in normal flow
990         'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block
991         ..."
992
993         In certain cases (float avoiding) we need to know the original (non-extended) horiztonal margin values.
994
995         * layout/FormattingContext.cpp:
996         (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
997         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
998         * layout/FormattingContextGeometry.cpp:
999         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1000         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1001         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1002         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1003         * layout/LayoutContext.cpp:
1004         (WebCore::Layout::LayoutContext::initializeRoot):
1005         * layout/LayoutUnits.h:
1006         * layout/blockformatting/BlockFormattingContext.cpp:
1007         (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
1008         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1009         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1010         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1011         * layout/displaytree/DisplayBox.h:
1012         (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin):
1013         (WebCore::Display::Box::setHorizontalNonComputedMargin):
1014         (WebCore::Display::Box::nonComputedMarginLeft const):
1015         (WebCore::Display::Box::nonComputedMarginRight const):
1016
1017 2018-08-30  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1018
1019         Unreviewed, add comments about enum names to bitfields
1020         https://bugs.webkit.org/show_bug.cgi?id=188944
1021
1022         * xml/XMLHttpRequest.h:
1023
1024 2018-08-30  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1025
1026         Unreviewed, add comments about enum names to bitfields
1027         https://bugs.webkit.org/show_bug.cgi?id=188945
1028
1029         * html/HTMLCollection.h:
1030
1031 2018-08-29  Andy Estes  <aestes@apple.com>
1032
1033         Addressed additional review feedback after r235342.
1034
1035         * Modules/applepay/ApplePayRequestBase.cpp:
1036         (WebCore::convertAndValidate):
1037
1038         Used '"' instead of "\"" with makeString().
1039
1040 2018-08-29  Aditya Keerthi  <akeerthi@apple.com>
1041
1042         [Datalist] Display prefix-matched suggestions first
1043         https://bugs.webkit.org/show_bug.cgi?id=189106
1044
1045         Reviewed by Tim Horton.
1046
1047         In order to increase suggestion relevancy, we should display suggestions that have
1048         the same prefix as the input value first. In order to achieve this, we can place
1049         the suggestions into two buckets, one that contains prefix-matched values and
1050         another that contains only substring-matched values.
1051
1052         TextFieldInputType::suggestions() can be called up to three times before we
1053         display the values. In order to avoid generating the same suggestions multiple
1054         times, the most recent values can be stored and reused. We clear the cached values
1055         whenever the datalist element is modified or when the suggestions view is hidden.
1056
1057         Finally, removed logic to de-duplicate the list of suggested values. This behavior
1058         is not a part of the specification and leads to unnecessary slowdown when
1059         populating the suggestions view.
1060
1061         Test: fast/forms/datalist/datalist-textinput-suggestions-order.html
1062
1063         * html/TextFieldInputType.cpp:
1064         (WebCore::TextFieldInputType::listAttributeTargetChanged):
1065         (WebCore::TextFieldInputType::suggestions):
1066         (WebCore::TextFieldInputType::didCloseSuggestions):
1067         * html/TextFieldInputType.h:
1068         * platform/DataListSuggestionsClient.h:
1069
1070 2018-08-29  Olivia Barnett  <obarnett@apple.com>
1071
1072         Implement the Web Share API
1073         https://bugs.webkit.org/show_bug.cgi?id=171100
1074         <rdar://problem/31751734>
1075
1076         Reviewed by Tim Horton.
1077
1078         Added one test in fast/events/ios called share.html; adjusted expectations for existing tests.
1079
1080         * DerivedSources.make:
1081         * Sources.txt:
1082         * WebCore.xcodeproj/project.pbxproj:
1083         * features.json:
1084         * loader/EmptyClients.cpp:
1085         (WebCore::EmptyChromeClient::showShareSheet):
1086         * loader/EmptyClients.h:
1087         Added empty showShareSheet function.
1088
1089         * page/Chrome.cpp:
1090         (WebCore::Chrome::showShareSheet):
1091         * page/Chrome.h:
1092         Added call to showShareSheet on client.
1093
1094         * page/ChromeClient.h:
1095         Virtual showShareSheet function.
1096
1097         * page/Navigator.cpp:
1098         (WebCore::Navigator::share):
1099         * page/Navigator.h:
1100         Share function that returns a promise and invokes the share sheet.
1101
1102         * page/Navigator.idl:
1103         Implements NavigatorShare
1104
1105         * page/NavigatorShare.idl: Added.
1106         Added definition of share function returning a promise.
1107
1108         * page/RuntimeEnabledFeatures.h:
1109         (WebCore::RuntimeEnabledFeatures::setWebShareEnabled):
1110         (WebCore::RuntimeEnabledFeatures::webShareEnabled const):
1111         Added RuntimeEnabledFeature switch.
1112
1113         * page/ShareData.h: Added.
1114         * page/ShareData.idl: Added.
1115         Definition of ShareData struct.
1116
1117 2018-08-29  Daniel Bates  <dabates@apple.com>
1118
1119         REGRESSION (r226138): WebCore::subdivide() may return an empty vector; Web process can crash when performing find in Epiphany
1120         https://bugs.webkit.org/show_bug.cgi?id=184390
1121         <rdar://problem/41804994>
1122         And
1123         <rdar://problem/39771867>
1124
1125         Reviewed by Simon Fraser.
1126
1127         Speculative fix for Epiphany.
1128
1129         In theory, WebCore::subdivide() should never return an empty vector - no subdivisions - as such a
1130         result represents a programmer error. In practice, InlineTextBox can invoke WebCore::subdivide()
1131         such that it returns an empty vector. One way this can happen is when subdividing an empty inline
1132         text box associated with combined text (RenderCombineText). For now we add a check to bail out of
1133         resolving the style of subdivisions when WebCore::subdivide() returns no subdivisions. In a
1134         subsequent patch we will look to assert that WebCore::subdivide() always returns subdivisions.
1135
1136         Test: fast/text/text-combine-surroundContents-crash.html
1137
1138         * rendering/InlineTextBox.cpp:
1139         (WebCore::InlineTextBox::subdivideAndResolveStyle):
1140
1141 2018-08-29  Youenn Fablet  <youenn@apple.com>
1142
1143         Remove WebRTC legacy API implementation
1144         https://bugs.webkit.org/show_bug.cgi?id=189040
1145
1146         Reviewed by Eric Carlson.
1147
1148         This API is no longer needed as the runtime flag is off by default.
1149         Removing this option allows removing some code and will ease future WebRTC improvements.
1150         Covered by existing tests.
1151
1152         * CMakeLists.txt:
1153         * DerivedSources.make:
1154         * Modules/mediastream/MediaStreamEvent.cpp: Removed.
1155         * Modules/mediastream/MediaStreamEvent.h: Removed.
1156         * Modules/mediastream/MediaStreamEvent.idl: Removed.
1157         * Modules/mediastream/NavigatorUserMedia.idl: Removed.
1158         * Modules/mediastream/NavigatorUserMedia.js: Removed.
1159         * Modules/mediastream/PeerConnectionBackend.cpp:
1160         * Modules/mediastream/PeerConnectionBackend.h:
1161         * Modules/mediastream/RTCPeerConnection.h:
1162         * Modules/mediastream/RTCPeerConnection.idl:
1163         * Modules/mediastream/RTCPeerConnection.js:
1164         (initializeRTCPeerConnection):
1165         (createOffer):
1166         (createAnswer):
1167         (setLocalDescription):
1168         (setRemoteDescription):
1169         (addIceCandidate):
1170         (getLocalStreams): Deleted.
1171         (getStreamById): Deleted.
1172         (addStream): Deleted.
1173         (): Deleted.
1174         * Modules/mediastream/RTCPeerConnectionInternals.js:
1175         (callbacksAndDictionaryOverload):
1176         (if): Deleted.
1177         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1178         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
1179         (WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
1180         (WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
1181         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1182         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1183         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
1184         (WebCore::LibWebRTCPeerConnectionBackend::removeRemoteStream): Deleted.
1185         (WebCore::LibWebRTCPeerConnectionBackend::addRemoteStream): Deleted.
1186         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1187         * Sources.txt:
1188         * WebCore.xcodeproj/project.pbxproj:
1189         * bindings/js/JSDOMGlobalObject.cpp:
1190         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1191         (WebCore::isWebRTCLegacyAPIEnabled): Deleted.
1192         * bindings/js/WebCoreBuiltinNames.h:
1193         * dom/EventNames.in:
1194         * page/RuntimeEnabledFeatures.h:
1195         (WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled):
1196         (WebCore::RuntimeEnabledFeatures::webRTCLegacyAPIEnabled const): Deleted.
1197         (WebCore::RuntimeEnabledFeatures::setWebRTCLegacyAPIEnabled): Deleted.
1198
1199 2018-08-29  Ryosuke Niwa  <rniwa@webkit.org>
1200
1201         Modernize SlotAssignment
1202         https://bugs.webkit.org/show_bug.cgi?id=189075
1203
1204         Reviewed by Antti Koivisto.
1205
1206         Modernized the code related to SlotAssignment. Namely, use HashMap<>::get instead of HashMap<>::find,
1207         and use HashMap<>::ensure instead of HashMap<>::add. Also use WeakPtr to keep track of HTMLSlotElement
1208         instead of a raw pointer.
1209
1210         * dom/SlotAssignment.cpp:
1211         (WebCore::SlotAssignment::findAssignedSlot):
1212         (WebCore::SlotAssignment::addSlotElementByName):
1213         (WebCore::SlotAssignment::removeSlotElementByName):
1214         (WebCore::SlotAssignment::didChangeSlot):
1215         (WebCore::SlotAssignment::findFirstSlotElement):
1216         (WebCore::SlotAssignment::resolveAllSlotElements):
1217         (WebCore::SlotAssignment::assignToSlot):
1218         * dom/SlotAssignment.h:
1219         (WebCore::SlotAssignment::Slot::Slot): Renamed from SlotInfo since "Info" doesn't add any value.
1220         * html/HTMLSlotElement.h:
1221
1222 2018-08-29  Chris Dumez  <cdumez@apple.com>
1223
1224         [PSON] We should only process-swap when eTLD+1 changes on navigation
1225         https://bugs.webkit.org/show_bug.cgi?id=189090
1226         <rdar://problem/43799225>
1227
1228         Reviewed by Geoffrey Garen.
1229
1230         Add toRegistrableDomain() utility function to get the eTLD+1 (aka "registrable
1231         domain") from an URL.
1232
1233         * platform/network/ResourceRequestBase.h:
1234         (WebCore::toRegistrableDomain):
1235         (WebCore::registrableDomainsAreEqual):
1236
1237 2018-08-29  Youenn Fablet  <youenn@apple.com>
1238
1239         Add a runtime flag for WebRTC unified plan
1240         https://bugs.webkit.org/show_bug.cgi?id=189068
1241
1242         Reviewed by Eric Carlson.
1243
1244         Covered by existing updated tests.
1245         Main change is to call addTrack with a stream parameter so that on the other side, the track will be tied to a stream.
1246         Receive-only case in unified plan is not yet supported.
1247         This will be supported in follow-up patches.
1248
1249         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1250         (WebCore::LibWebRTCMediaEndpoint::setConfiguration): Activate unified plan based on runtime flag.
1251         (WebCore::LibWebRTCMediaEndpoint::addTrack): Do not use AddStream in case of unified plan.
1252         (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio const):
1253         (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo const):
1254         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer): Use legacy webrtc option for receive only cases only in plan B case.
1255         * page/RuntimeEnabledFeatures.h:
1256         (WebCore::RuntimeEnabledFeatures::webRTCUnifiedPlanEnabled const):
1257         (WebCore::RuntimeEnabledFeatures::setWebRTCUnifiedPlanEnabled):
1258
1259 2018-08-28  Simon Fraser  <simon.fraser@apple.com>
1260
1261         Fix crash when reflections and backdrop filter are combined
1262         https://bugs.webkit.org/show_bug.cgi?id=188504
1263         rdar://problem/43225590
1264
1265         Reviewed by Dan Bates.
1266         
1267         GraphicsLayerCA::updateBackdropFiltersRect() was confused about which hash map to modify
1268         when changes to the clipping rect affect whether we make backdrop clipping layers;
1269         we need to add/remove from backdropClippingLayerClones, not backdropLayerClones.
1270
1271         Test: compositing/filters/backdrop-filter-update-rect.html
1272
1273         * platform/graphics/ca/GraphicsLayerCA.cpp:
1274         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
1275
1276 2018-08-29  Jer Noble  <jer.noble@apple.com>
1277
1278         Muted elements do not have their Now Playing status updated when unmuted.
1279         https://bugs.webkit.org/show_bug.cgi?id=189069
1280
1281         Reviewed by Eric Carlson.
1282
1283         Schedule an updateNowPlayingInfo() when an element becomes unmuted.
1284
1285         * platform/audio/PlatformMediaSessionManager.h:
1286         * platform/audio/mac/MediaSessionManagerMac.h:
1287         * platform/audio/mac/MediaSessionManagerMac.mm:
1288         (WebCore::MediaSessionManagerMac::sessionCanProduceAudioChanged):
1289
1290 2018-08-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1291
1292         Use the null string instead of std::nullopt for missing attachment file names and content types
1293         https://bugs.webkit.org/show_bug.cgi?id=189080
1294
1295         Reviewed by Tim Horton.
1296
1297         Replace instances of std::optional<String> with just String instead, and use the null string to represent a
1298         missing value instead of std::nullopt. No change in behavior.
1299
1300         * html/HTMLAttachmentElement.cpp:
1301         (WebCore::HTMLAttachmentElement::updateAttributes):
1302         * html/HTMLAttachmentElement.h:
1303
1304 2018-08-29  David Kilzer  <ddkilzer@apple.com>
1305
1306         Remove empty directories from from svn.webkit.org repository
1307         <https://webkit.org/b/189081>
1308
1309         * Modules/proximity: Removed.
1310
1311 2018-08-28  Zalan Bujtas  <zalan@apple.com>
1312
1313         [LFC][Floating] Introduce FloatBox, a FloatAvoider subclass.
1314         https://bugs.webkit.org/show_bug.cgi?id=189074
1315
1316         Reviewed by Antti Koivisto.
1317
1318         FloatBox is a float avoider and a float positioned box as well.
1319         This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.
1320
1321         * Sources.txt:
1322         * WebCore.xcodeproj/project.pbxproj:
1323         * layout/displaytree/DisplayBox.h:
1324         * layout/floats/FloatAvoider.cpp:
1325         (WebCore::Layout::FloatAvoider::FloatAvoider):
1326         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
1327         (WebCore::Layout::FloatAvoider::setVerticalConstraint):
1328         (WebCore::Layout::FloatAvoider::horizontalPositionCandidate):
1329         (WebCore::Layout::FloatAvoider::verticalPositionCandidate):
1330         (WebCore::Layout::FloatAvoider::resetPosition):
1331         (WebCore::Layout::FloatAvoider::rectInContainingBlock const):
1332         (WebCore::Layout::FloatAvoider::initializePosition): Deleted.
1333         (WebCore::Layout::FloatAvoider::isLeftAligned const): Deleted.
1334         (WebCore::Layout::FloatAvoider::rect const): Deleted.
1335         (WebCore::Layout::FloatAvoider::resetHorizontalConstraints): Deleted.
1336         (WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted.
1337         * layout/floats/FloatAvoider.h:
1338         (WebCore::Layout::FloatAvoider::rect const):
1339         (WebCore::Layout::FloatAvoider::isLeftAligned const):
1340         (WebCore::Layout::FloatAvoider::initialVerticalPosition const):
1341         (WebCore::Layout::FloatAvoider::floatingState const):
1342         (WebCore::Layout::FloatAvoider::layoutBox const):
1343         (WebCore::Layout::FloatAvoider::displayBox const):
1344         * layout/floats/FloatBox.cpp: Copied from Source/WebCore/layout/floats/FloatAvoider.h.
1345         (WebCore::Layout::FloatBox::FloatBox):
1346         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
1347         (WebCore::Layout::FloatBox::verticalPositionCandidate):
1348         (WebCore::Layout::FloatBox::initialVerticalPosition const):
1349         * layout/floats/FloatBox.h: Copied from Source/WebCore/layout/floats/FloatAvoider.h.
1350         * layout/floats/FloatingContext.cpp:
1351         (WebCore::Layout::FloatingContext::positionForFloat const):
1352         (WebCore::Layout::FloatingContext::floatingPosition const):
1353
1354 2018-08-29  Ali Juma  <ajuma@chromium.org>
1355
1356         [IntersectionObserver]  Implement intersection logic for the same-document implicit root case
1357         https://bugs.webkit.org/show_bug.cgi?id=189055
1358
1359         Reviewed by Simon Fraser.
1360
1361         Extend the intersection logic to handle computing the intersection of the target and the
1362         viewport, for the case where the target is in the main frame.
1363
1364         Tested by existing tests in imported/w3c/web-platform-tests/intersection-observer.
1365
1366         * dom/Document.cpp:
1367         (WebCore::computeIntersectionRects):
1368         (WebCore::Document::updateIntersectionObservations):
1369
1370 2018-08-28  Ryosuke Niwa  <rniwa@webkit.org>
1371
1372         Changes to slot children should trigger slotchange
1373         https://bugs.webkit.org/show_bug.cgi?id=169718
1374         <rdar://problem/43317496>
1375
1376         Reviewed by Darin Adler.
1377
1378         Fix the bug that slotchange event is not fired when a slot's fallback content is updated now that slotchange event
1379         is more formally specified.
1380
1381         This particular behavior corresponds to step 7.5. of the concept *to insert a node* where it says:
1382         "[I]f parent’s root is a shadow root, and parent is a slot whose assigned nodes is the empty list, then run signal
1383         a slot change for parent."
1384
1385         See https://dom.spec.whatwg.org/#concept-node-insert
1386
1387         Tests: fast/shadow-dom/slotchange-in-fallback.html
1388                imported/w3c/web-platform-tests/shadow-dom/slotchange.html 
1389
1390         * dom/Element.cpp:
1391         (WebCore::Element::childrenChanged): Updated the comment.
1392         * dom/ShadowRoot.cpp:
1393         (WebCore::ShadowRoot::addSlotElementByName): Added an assertion.
1394         (WebCore::ShadowRoot::slotFallbackDidChange): Added.
1395         * dom/ShadowRoot.h:
1396         * dom/SlotAssignment.cpp:
1397         (WebCore::SlotAssignment::slotFallbackDidChange): Added. When the assigned nodes is empty, we enqueue a slotchange.
1398         Because assignedNodesForSlot invokes assignSlots, this can be O(n) but we don't expect mutating slot's fallback
1399         contents and shadow host's children in turn to be a common scenario so this shouldn't be an issue in practice.
1400         * dom/SlotAssignment.h:
1401         * html/HTMLSlotElement.cpp:
1402         (WebCore::HTMLSlotElement::insertedIntoAncestor): Be explicit about auto* being used here.
1403         (WebCore::HTMLSlotElement::childrenChanged): Added. Invokes slotFallbackDidChange whenver child node is muated.
1404         * html/HTMLSlotElement.h:
1405
1406 2018-08-28  Don Olmstead  <don.olmstead@sony.com>
1407
1408         Check for null renderer in canBeScrolledIntoView
1409         https://bugs.webkit.org/show_bug.cgi?id=188935
1410
1411         Reviewed by Simon Fraser.
1412
1413         Test: fast/spatial-navigation/snav-display-contents-crash.html
1414
1415         * page/SpatialNavigation.cpp:
1416         (WebCore::canBeScrolledIntoView):
1417
1418 2018-08-28  Youenn Fablet  <youenn@apple.com>
1419
1420         IDBDatabase should not return true to hasPendingActivity after being stopped
1421         https://bugs.webkit.org/show_bug.cgi?id=189073
1422
1423         Reviewed by Darin Adler.
1424
1425         There is a chance that IDBDatabase::hasPendingActivity returns true.
1426         The case that might happen is when stop() is called but there are still some active/being committed transactions.
1427         In that case, hasPendingActivity will return true until these transactions get finalized.
1428         While these transactions will probably be finalized at some point, it delays GC for no good reason.
1429         And we might want in a follow-up patch to assert that ActiveDOMObject are GC-able whenever their context is stopped.
1430         For that purpose, make sure hasPendingActivity returns false when context is stopped.
1431
1432         * Modules/indexeddb/IDBDatabase.cpp:
1433         (WebCore::IDBDatabase::hasPendingActivity const):
1434
1435 2018-08-28  Don Olmstead  <don.olmstead@sony.com>
1436
1437         [CMake] Use CMake's FindFreetype
1438         https://bugs.webkit.org/show_bug.cgi?id=189071
1439
1440         Reviewed by Michael Catanzaro.
1441
1442         No new tests. No change in behavior.
1443
1444         * platform/FreeType.cmake:
1445
1446 2018-08-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1447
1448         Work towards: [iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm
1449         https://bugs.webkit.org/show_bug.cgi?id=189054
1450
1451         Reviewed by Andy Estes.
1452
1453         Remove the pasteboard type argument from PlatformPasteboard::readURL(). Currently, we only ever pass it
1454         "public.url" anyways; for reading other types of strings, readString() already exists, which takes an arbitrary
1455         pasteboard type.
1456
1457         * platform/PasteboardStrategy.h:
1458         * platform/PlatformPasteboard.h:
1459         * platform/ios/PasteboardIOS.mm:
1460         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
1461         (WebCore::Pasteboard::readPlatformValueAsString):
1462         * platform/ios/PlatformPasteboardIOS.mm:
1463         (WebCore::PlatformPasteboard::readURL):
1464
1465 2018-08-28  Youenn Fablet  <youenn@apple.com>
1466
1467         MediaDevices should be collectable as soon as its document is stopped
1468         https://bugs.webkit.org/show_bug.cgi?id=189021
1469
1470         Reviewed by Eric Carlson.
1471
1472         Introduce ActiveDOMObject::isContextStopped to check whether the context is stopped.
1473         Use this check in MediaDevices::hasPendingActivity so that it returns false as soon as active dom objects are stopped.
1474
1475         Test: http/tests/media/collect-media-devices.https.html
1476
1477         * Modules/mediastream/MediaDevices.cpp:
1478         (WebCore::MediaDevices::hasPendingActivity const):
1479         * dom/ActiveDOMObject.cpp:
1480         (WebCore::ActiveDOMObject::hasPendingActivity const):
1481         (WebCore::ActiveDOMObject::isContextStopped const):
1482         * dom/ActiveDOMObject.h:
1483
1484 2018-08-28  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1485
1486         [Curl] Fix issue that extra cookie is added when redirect happens.
1487         https://bugs.webkit.org/show_bug.cgi?id=187874
1488
1489         Reviewed by Alex Christensen.
1490
1491         When initial request has cookie set and redirect happens, it add extra Cookie header to that
1492         abd request was broken. Just stop modifying the original request by passing a value.
1493
1494         Test: http/tests/cookies/multiple-redirect-and-set-cookie.php
1495
1496         * platform/network/ResourceHandle.h:
1497         * platform/network/curl/ResourceHandleCurl.cpp:
1498         (WebCore::ResourceHandle::createCurlRequest):
1499
1500 2018-08-28  Aditya Keerthi  <akeerthi@apple.com>
1501
1502         [macOS] Color wells should appear rounded and textured
1503         https://bugs.webkit.org/show_bug.cgi?id=189039
1504
1505         Reviewed by Tim Horton.
1506
1507         Color wells should have a rounded and textured appearance on macOS. We can use
1508         NSBezelStyleTexturedSquare to achieve this appearance.
1509
1510         Also updated the user-agent stylesheet to match the system appearance.
1511
1512         Rebaselined existing test: fast/forms/color/input-appearance-color.html
1513
1514         * css/html.css:
1515         (input[type="color"]::-webkit-color-swatch-wrapper):
1516         (input[type="color"]::-webkit-color-swatch):
1517         * platform/mac/ThemeMac.mm:
1518         (WebCore::setUpButtonCell):
1519         * rendering/RenderThemeMac.h: Build fix.
1520
1521 2018-08-28  Youenn Fablet  <youenn@apple.com>
1522
1523         WebKitMediaSession should be GC collectable when its document is being stopped
1524         https://bugs.webkit.org/show_bug.cgi?id=189016
1525
1526         Reviewed by Eric Carlson.
1527
1528         Make sure WebKitMediaSession is  collectable after its document is stopped.
1529         This is done by nullifying m_session when calling close.
1530         This way hasPendingActivity() returns false when stop() is called.
1531
1532         Test: http/tests/media/clearkey/collect-webkit-media-session.html
1533
1534         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1535         (WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
1536         (WebCore::WebKitMediaKeySession::close):
1537         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1538
1539 2018-08-28  Ali Juma  <ajuma@chromium.org>
1540
1541         [IntersectionObserver] Fix build after r235424
1542         https://bugs.webkit.org/show_bug.cgi?id=189051
1543
1544         Rubber-stamped by Simon Fraser.
1545
1546         Fix unused variable warning by using the variable.
1547
1548         * page/FrameView.cpp:
1549         (WebCore::FrameView::viewportContentsChanged):
1550
1551 2018-08-28  Aditya Keerthi  <akeerthi@apple.com>
1552
1553         [iOS] Support inputmode=none
1554         https://bugs.webkit.org/show_bug.cgi?id=188896
1555
1556         Reviewed by Tim Horton.
1557
1558         Updated InputMode.cpp to ensure that "none" is recognized as a valid value for the
1559         inputmode attribute. This keyword is useful for content that renders its own
1560         keyboard control.
1561
1562         Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities%3A-the-inputmode-attribute
1563
1564         Test: fast/forms/ios/inputmode-none.html
1565
1566         * html/InputMode.cpp:
1567         (WebCore::inputModeForAttributeValue):
1568         (WebCore::stringForInputMode):
1569         (WebCore::InputModeNames::none):
1570         * html/InputMode.h:
1571
1572 2018-08-28  Ali Juma  <ajuma@chromium.org>
1573
1574         [IntersectionObserver] Schedule intersection observation updates
1575         https://bugs.webkit.org/show_bug.cgi?id=189007
1576
1577         Reviewed by Simon Fraser.
1578
1579         Schedule intersection observation updates in the following situations:
1580         1) A new observation target is added.
1581         2) FrameView::viewportContentsChanged -- this covers changes to layout and
1582            to scroll positions for same-document observation. Scheduling for
1583            cross-document observation will be handled in a future patch.
1584         3) Style is resolved without triggering layout -- this handles updates that
1585            were deferred because of a pending style recalculation.
1586
1587         Tested by existing tests in imported/w3c/web-platform-tests/intersection-observer.
1588
1589         * dom/Document.cpp:
1590         (WebCore::Document::resolveStyle):
1591         (WebCore::Document::updateIntersectionObservations):
1592         (WebCore::Document::scheduleIntersectionObservationUpdate):
1593         * dom/Document.h:
1594         * page/FrameView.cpp:
1595         (WebCore::FrameView::viewportContentsChanged):
1596         * page/IntersectionObserver.cpp:
1597         (WebCore::IntersectionObserver::observe):
1598
1599 2018-08-28  Zalan Bujtas  <zalan@apple.com>
1600
1601         [LFC][Floating] Remove redundant FloatAvoider functions.
1602         https://bugs.webkit.org/show_bug.cgi?id=189035
1603
1604         Reviewed by Antti Koivisto.
1605
1606         and move some code from FloatContext to FloatAvoider.
1607
1608         * layout/floats/FloatAvoider.cpp:
1609         (WebCore::Layout::FloatAvoider::initializePosition):
1610         (WebCore::Layout::FloatAvoider::rect const):
1611         (WebCore::Layout::FloatAvoider::setVerticalConstraint):
1612         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
1613         (WebCore::Layout::FloatAvoider::resetHorizontalConstraint):
1614         (WebCore::Layout::FloatAvoider::initialVerticalPosition const):
1615         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
1616         (WebCore::Layout::FloatAvoider::rectInContainingBlock const):
1617         (WebCore::Layout::FloatAvoider::setLeft): Deleted.
1618         (WebCore::Layout::FloatAvoider::setTopLeft): Deleted.
1619         (WebCore::Layout::FloatAvoider::resetVertically): Deleted.
1620         (WebCore::Layout::FloatAvoider::resetHorizontally): Deleted.
1621         (WebCore::Layout::FloatAvoider::topLeftInContainingBlock const): Deleted.
1622         * layout/floats/FloatAvoider.h:
1623         (WebCore::Layout::FloatAvoider::top const): Deleted.
1624         (WebCore::Layout::FloatAvoider::left const): Deleted.
1625         (WebCore::Layout::FloatAvoider::marginTop const): Deleted.
1626         (WebCore::Layout::FloatAvoider::marginLeft const): Deleted.
1627         (WebCore::Layout::FloatAvoider::marginBottom const): Deleted.
1628         (WebCore::Layout::FloatAvoider::marginRight const): Deleted.
1629         (WebCore::Layout::FloatAvoider::rectWithMargin const): Deleted.
1630         (WebCore::Layout::FloatAvoider::setTop): Deleted.
1631         * layout/floats/FloatingContext.cpp:
1632         (WebCore::Layout::FloatingContext::positionForFloat const):
1633         (WebCore::Layout::FloatingContext::floatingPosition const):
1634         (WebCore::Layout::FloatingPair::horizontalConstraints const):
1635         (WebCore::Layout::FloatingPair::horiztonalPosition const): Deleted.
1636
1637 2018-08-28  Eric Carlson  <eric.carlson@apple.com>
1638
1639         Revert changes to RealtimeMediaSource.cpp made in r235086
1640         https://bugs.webkit.org/show_bug.cgi?id=189046
1641         <rdar://problem/43794875>
1642
1643         Unreviewed, reverting an accidental change.
1644
1645         * platform/mediastream/RealtimeMediaSource.cpp:
1646         (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): 
1647
1648 2018-08-28  Alejandro G. Castro  <alex@igalia.com>
1649
1650         Fix gcc compilation warnings after r235230
1651         https://bugs.webkit.org/show_bug.cgi?id=188981
1652
1653         Reviewed by Eric Carlson.
1654
1655         Replace the pragma clang with pragma GCC, it is understood by
1656         clang and gcc.
1657
1658         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
1659         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1660         * platform/mediastream/RealtimeIncomingAudioSource.h:
1661         * platform/mediastream/RealtimeIncomingVideoSource.h:
1662         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1663         * platform/mediastream/RealtimeOutgoingVideoSource.h:
1664         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
1665         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1666         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1667         * testing/MockLibWebRTCPeerConnection.h:
1668
1669 2018-08-27  Justin Fan  <justin_fan@apple.com>
1670
1671         WebGL 2 conformance: framebuffer-test
1672         https://bugs.webkit.org/show_bug.cgi?id=188812
1673
1674         Reviewed by Jon Lee.
1675
1676         Update WebGL 2 implementation to handle READ_FRAMEBUFFER and default framebuffer conformance. Also taking this
1677         chance to fix memory leak in PlatformScreenMac/gpuIDForDisplayMask().
1678
1679         Covered by existing WebGL tests as well as newly-enabled webgl/2.0.0/conformance2/renderbuffers/framebuffer-test.html.
1680
1681         * html/canvas/WebGL2RenderingContext.cpp:
1682         (WebCore::WebGL2RenderingContext::blitFramebuffer):
1683         (WebCore::WebGL2RenderingContext::framebufferTextureLayer):
1684         (WebCore::validateDefaultFramebufferAttachment):
1685         (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
1686         (WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters):
1687         (WebCore::WebGL2RenderingContext::validateFramebufferTarget):
1688         (WebCore::WebGL2RenderingContext::validateNonDefaultFramebufferAttachment):
1689         (WebCore::WebGL2RenderingContext::getParameter):
1690         * html/canvas/WebGL2RenderingContext.h:
1691         * html/canvas/WebGLFramebuffer.cpp:
1692         (WebCore::WebGLFramebuffer::isBound const):
1693         * html/canvas/WebGLRenderingContextBase.cpp:
1694         (WebCore::WebGLRenderingContextBase::initializeNewContext):
1695         (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
1696         (WebCore::WebGLRenderingContextBase::bindFramebuffer):
1697         (WebCore::WebGLRenderingContextBase::checkFramebufferStatus):
1698         (WebCore::WebGLRenderingContextBase::deleteFramebuffer):
1699         (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
1700         (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
1701         * html/canvas/WebGLRenderingContextBase.h:
1702         * platform/graphics/GraphicsContext3D.h:
1703         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1704         (WebCore::GraphicsContext3D::blitFramebuffer):
1705         * platform/mac/PlatformScreenMac.mm:
1706         (WebCore::gpuIDForDisplayMask):
1707
1708 2018-08-27  Myles C. Maxfield  <mmaxfield@apple.com>
1709
1710         Null pointer deref in WidthIterator
1711         https://bugs.webkit.org/show_bug.cgi?id=188993
1712
1713         Reviewed by Brent Fulgham.
1714
1715         Test: fast/text/rtl-justification.html
1716
1717         We simply need to guard glyphBuffer like we do in the rest of the function.
1718
1719         * platform/graphics/WidthIterator.cpp:
1720         (WebCore::WidthIterator::advanceInternal):
1721
1722 2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1723
1724         [Attachment Support] Remove WebCore::AttachmentDisplayOptions and friends
1725         https://bugs.webkit.org/show_bug.cgi?id=189004
1726
1727         Reviewed by Dan Bernstein.
1728
1729         No new tests, since there is no change in behavior.
1730
1731         * WebCore.xcodeproj/project.pbxproj:
1732         * editing/Editor.cpp:
1733         (WebCore::Editor::insertAttachment):
1734         * editing/Editor.h:
1735         * html/AttachmentTypes.h: Removed.
1736         * html/HTMLAttachmentElement.h:
1737
1738 2018-08-27  Keith Rollin  <krollin@apple.com>
1739
1740         Unreviewed build fix -- disable LTO for production builds
1741
1742         * Configurations/Base.xcconfig:
1743
1744 2018-08-27  Youenn Fablet  <youenn@apple.com>
1745
1746         Various IndexDB tests abandon documents
1747         https://bugs.webkit.org/show_bug.cgi?id=188728
1748         <rdar://problem/43651095>
1749
1750         Reviewed by Alex Christensen.
1751
1752         Some IDB objects implement hasPendingActivity but there are some possibilities that they continue returning true after being stopped.
1753         This is the case for requests that get stopped while still waiting for some pending activity.
1754         This is also the case for requests that emits upgradeneeded or blocked events.
1755
1756         Enforce that these objects return false to hasPendingActivity once being stopped.
1757         This ensures that they can be garbage collected once their context is preparing for destruction like in Document::prepareForDestruction.
1758
1759         Test: http/tests/IndexedDB/collect-IDB-objects.https.html
1760
1761         * Modules/indexeddb/IDBIndex.cpp:
1762         (WebCore::IDBIndex::hasPendingActivity const):
1763         * Modules/indexeddb/IDBObjectStore.cpp:
1764         (WebCore::IDBObjectStore::hasPendingActivity const):
1765         * Modules/indexeddb/IDBRequest.cpp:
1766         (WebCore::IDBRequest::hasPendingActivity const):
1767         (WebCore::IDBRequest::enqueueEvent):
1768         * Modules/indexeddb/IDBTransaction.cpp:
1769         (WebCore::IDBTransaction::notifyDidAbort):
1770         In case the context is stopped, IDBTransaction should not ask IDBRequest to fire an event.
1771
1772 2018-08-27  Simon Fraser  <simon.fraser@apple.com>
1773
1774         Teach WebKitTestRunner and DumpRenderTree about detecting world leaks
1775         https://bugs.webkit.org/show_bug.cgi?id=188994
1776
1777         Reviewed by Tim Horton.
1778
1779         Export Document::postTask() for use by WTR's injected bundle.
1780
1781         * dom/Document.h:
1782
1783 2018-08-27  Aditya Keerthi  <akeerthi@apple.com>
1784
1785         Consolidate ENABLE_INPUT_TYPE_COLOR and ENABLE_INPUT_TYPE_COLOR_POPOVER
1786         https://bugs.webkit.org/show_bug.cgi?id=188931
1787
1788         Reviewed by Wenson Hsieh.
1789
1790         * Configurations/FeatureDefines.xcconfig: Removed ENABLE_INPUT_TYPE_COLOR_POPOVER.
1791
1792 2018-08-27  Simon Fraser  <simon.fraser@apple.com>
1793
1794         Improve the showAllDocuments logging
1795         https://bugs.webkit.org/show_bug.cgi?id=188990
1796
1797         Reviewed by Tim Horton.
1798         
1799         Improve the output triggered by "notifyutil -p com.apple.WebKit.showAllDocuments" to denote
1800         SVG documents (which often have no URL), and to show the refCount and referencingNodeCount,
1801         which helps with leak debugging.
1802         
1803         Sample output:
1804
1805         2 live documents:
1806         Document 0x1236f1200 3 (refCount 6, referencingNodeCount 580) https://webkit.org/
1807         SVGDocument 0x134b60000 13 (refCount 1, referencingNodeCount 197) 
1808
1809         * page/mac/PageMac.mm:
1810         (WebCore::Page::platformInitialize):
1811
1812 2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1813
1814         [Cocoa] Exception (fileType 'dyn.agq8u' is not a valid UTI) raised when dragging an attachment whose file wrapper is a directory
1815         https://bugs.webkit.org/show_bug.cgi?id=188903
1816         <rdar://problem/43702993>
1817
1818         Reviewed by Tim Horton.
1819
1820         Fixes the exception for attachments that are created when dropping files with extensions that don't map to any
1821         known UTIs, and when dropping folders. See below for more detail.
1822
1823         Tests:  WKAttachmentTests.InsertFolderAndFileWithUnknownExtension
1824                 WKAttachmentTests.DropFolderAsAttachmentAndMoveByDragging
1825                 WKAttachmentTests.ChangeAttachmentDataAndFileInformation
1826
1827         * editing/Editor.cpp:
1828         (WebCore::Editor::insertAttachment):
1829         * editing/Editor.h:
1830         * editing/cocoa/WebContentReaderCocoa.mm:
1831         (WebCore::WebContentReader::readFilePaths):
1832
1833         When creating an attachment by dropping or pasting a file backed by a file path, handle the cases where…
1834         (1)     the dropped path is a directory, by setting the UTI to "public.directory". This allows us to show a
1835                 folder icon for the dropped attachment element on macOS.
1836         (2)     the dropped path is a file whose UTI is unknown, by defaulting to "public.data".
1837
1838         By ensuring that the UTI of a dropped file-backed attachment is set to a concrete type in any case, we avoid an
1839         exception when dragging the attachment on macOS, and on iOS, avoid silently failing to drag an attachment.
1840
1841         * html/HTMLAttachmentElement.cpp:
1842         (WebCore::HTMLAttachmentElement::updateAttributes):
1843
1844         Change this method to take an optional file size (the subtitle attribute will only be set if the file size is
1845         not `std::nullopt`). Furthermore, allow callers of this method to clear attributes on the attachment element by
1846         passing in `std::nullopt` for any of the three arguments. This allows us to handle the case where an
1847         attachment's file wrapper is changed from a regular file to a folder whose total size is currently unknown.
1848         Instead of showing "0 bytes", we'll simply refrain from showing a subtitle at all (in the future, this should
1849         be improved by implementing a way to estimate the size of the files in the folder, or perhaps show the number of
1850         items in the folder as the subtitle).
1851
1852         * html/HTMLAttachmentElement.h:
1853
1854 2018-08-27  Devin Rousso  <drousso@apple.com>
1855
1856         Web Inspector: provide autocompletion for event breakpoints
1857         https://bugs.webkit.org/show_bug.cgi?id=188717
1858
1859         Reviewed by Brian Burg.
1860
1861         Test: inspector/dom/getSupportedEventNames.html
1862
1863         * inspector/agents/InspectorDOMAgent.h:
1864         * inspector/agents/InspectorDOMAgent.cpp:
1865         (WebCore::InspectorDOMAgent::getSupportedEventNames): Added.
1866
1867 2018-08-27  Keith Rollin  <krollin@apple.com>
1868
1869         Build system support for LTO
1870         https://bugs.webkit.org/show_bug.cgi?id=187785
1871         <rdar://problem/42353132>
1872
1873         Reviewed by Dan Bernstein.
1874
1875         Update Base.xcconfig and DebugRelease.xcconfig to optionally enable
1876         LTO.
1877
1878         No new tests -- no new WebKit functionality.
1879
1880         * Configurations/Base.xcconfig:
1881         * Configurations/DebugRelease.xcconfig:
1882
1883 2018-08-27  Daniel Bates  <dabates@apple.com>
1884
1885         [iOS] Make color of spelling dots match UIKit
1886         https://bugs.webkit.org/show_bug.cgi?id=188861
1887
1888         Reviewed by Simon Fraser.
1889
1890         * rendering/RenderThemeCocoa.h:
1891         * rendering/RenderThemeCocoa.mm:
1892         (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Modified to call colorForMarkerLineStyle()
1893         for the color to use for the line style.
1894         (WebCore::colorForStyle): Deleted.
1895         * rendering/RenderThemeIOS.h:
1896         * rendering/RenderThemeIOS.mm:
1897         (WebCore::RenderThemeIOS::colorForMarkerLineStyle): Added.
1898         * rendering/RenderThemeMac.h:
1899         * rendering/RenderThemeMac.mm:
1900         (WebCore::RenderThemeMac::colorForMarkerLineStyle): Added.
1901
1902 2018-08-27  Daniel Bates  <dabates@apple.com>
1903
1904         Spelling dots do not scale with page on iOS; share spelling dot painting code between Mac and iOS
1905         https://bugs.webkit.org/show_bug.cgi?id=188828
1906         <rdar://problem/15966403>
1907
1908         Reviewed by Simon Fraser.
1909
1910         The look of the spelling dots on Mac and iOS are identical up to color. Towards making the
1911         spelling dots in WebKit on iOS more closely match the look of the spelling dots in UIKit-
1912         apps, standardize on using the same painting code for both Mac and iOS.
1913
1914         Currently iOS uses bitmaps to render the spelling dots and does not account for user/CSS
1915         zooming. As a result, the spelling dots on iOS render with artifacts (e.g. truncated dots).
1916         A side benefit of having iOS share the same painting code as Mac is that iOS will now paint
1917         the dots programmatically and we avoid both the need to use bitmaps and fix the bugs in
1918         the painting of the bitmap dots with respect to zooming.
1919
1920         * Resources/DictationPhraseWithAlternativesDot.png: Removed.
1921         * Resources/DictationPhraseWithAlternativesDot@2x.png: Removed.
1922         * Resources/SpellingDot.png: Removed.
1923         * Resources/SpellingDot@2x.png: Removed.
1924         * Resources/SpellingDot@3x.png: Removed.
1925         * WebCore.xcodeproj/project.pbxproj:
1926         * page/Page.cpp:
1927         (WebCore::Page::setDeviceScaleFactor):
1928         * platform/graphics/GraphicsContext.h:
1929         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1930         (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
1931         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1932         (WebCore::GraphicsContext::drawLineForDocumentMarker):
1933         (WebCore::findImage): Deleted.
1934         (WebCore::createDotPattern): Deleted.
1935         (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
1936         * platform/graphics/win/GraphicsContextCGWin.cpp:
1937         (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
1938         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1939         (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
1940         * platform/ios/wak/WKGraphics.mm:
1941         (WKRectFill): Incorporated the logic from _FillRectUsingOperation().
1942         (_FillRectUsingOperation): Deleted; moved the logic into WKRectFill() since WKRectFill()
1943         is now the only caller of this function.
1944         (WKRectFillUsingOperation): Deleted.
1945         (imageResourcePath): Deleted.
1946         (WKGraphicsCreateImageFromBundleWithName): Deleted.
1947         (WKDrawPatternBitmap): Deleted.
1948         (WKReleasePatternBitmap): Deleted.
1949         (WKSetPattern): Deleted.
1950         * platform/ios/wak/WKGraphicsInternal.h: Removed.
1951         * rendering/InlineTextBox.cpp:
1952         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
1953         * rendering/RenderThemeCocoa.h: Add headers RenderText.h and GraphicsContextCG.h. Fix some style nits while I am here;
1954         substitute #import for #include and remove some unnecessary headers TranslateTransformOperation.h, RenderStyle.h, and
1955         RenderElement.h.
1956         * rendering/RenderThemeCocoa.mm:
1957         (WebCore::colorForStyle):
1958         (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Moved from RenderThemeMac. I renamed
1959         the local variable ctx to context and fixed a type in a comment while moving this code.
1960         * rendering/RenderThemeMac.h:
1961         * rendering/RenderThemeMac.mm:
1962         (WebCore::colorForStyle): Deleted; moved to class RenderThemeCocoa.
1963         (WebCore::RenderThemeMac::drawLineForDocumentMarker): Deleted; moved to class RenderThemeCocoa.
1964
1965 2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1966
1967         [Attachment Support] [WK2] Images copied from Mail message view paste with the wrong file name in compose
1968         https://bugs.webkit.org/show_bug.cgi?id=188957
1969         <rdar://problem/43737715>
1970
1971         Reviewed by Darin Adler.
1972
1973         Allow the alt attribute of a pasted image element to determine the name of an image attachment, rather than
1974         using the source URL's last path component first. This is because in some clients, such as Mail, the source of
1975         the image element is some nondescript UUID, and the alt text contains the real name of the image.
1976
1977         Test: WKAttachmentTests.PasteWebArchiveContainingImages
1978
1979         * editing/cocoa/WebContentReaderCocoa.mm:
1980         (WebCore::replaceRichContentWithAttachments):
1981
1982 2018-08-27  Alex Christensen  <achristensen@webkit.org>
1983
1984         Fix IOSMAC build
1985         https://bugs.webkit.org/show_bug.cgi?id=188934
1986         <rdar://problem/43694979>
1987
1988         Reviewed by Darin Adler.
1989
1990         * platform/network/cf/FormDataStreamCFNet.cpp:
1991
1992 2018-08-27  Rob Buis  <rbuis@igalia.com>
1993
1994         XMLHTTPRequest.send for Document should have same Content-Type processing rules as String
1995         https://bugs.webkit.org/show_bug.cgi?id=188953
1996
1997         Reviewed by Darin Adler.
1998
1999         Processing rules for Content-Type have been implemented for send with String as parameter, but
2000         not for Document, but both should be treated the same according to the spec [1]. This patch
2001         implements this.
2002
2003         Behavior matches Firefox.
2004
2005         [1] https://xhr.spec.whatwg.org/#the-send()-method
2006
2007         Test: web-platform-tests/XMLHttpRequest/setrequestheader-content-type.htm
2008
2009         * xml/XMLHttpRequest.cpp:
2010         (WebCore::XMLHttpRequest::send):
2011
2012 2018-08-27  Ali Juma  <ajuma@chromium.org>
2013
2014         [IntersectionObserver] Implement intersection logic for the explicit root case
2015         https://bugs.webkit.org/show_bug.cgi?id=188809
2016
2017         Reviewed by Simon Fraser.
2018
2019         Add logic to Document::updateIntersectionObservations to compute the intersection
2020         between the target and root elements, for the case where an IntersectionObserver
2021         has a root element.
2022
2023         There are no changes to the scheduling of intersection observations in this patch,
2024         so observations are still only computed once for each observer.
2025
2026         * dom/Document.cpp:
2027         (WebCore::computeIntersectionRects):
2028         (WebCore::Document::updateIntersectionObservations):
2029         * page/FrameView.cpp:
2030         (WebCore::FrameView::absoluteToClientRect const):
2031         * page/FrameView.h:
2032         * page/IntersectionObserver.cpp:
2033         (WebCore::IntersectionObserver::IntersectionObserver):
2034         (WebCore::IntersectionObserver::createTimestamp const):
2035         * page/IntersectionObserver.h:
2036         * platform/graphics/FloatRect.h:
2037         (WebCore::FloatRect::area const):
2038         * rendering/RenderBlock.cpp:
2039         (WebCore::RenderBlock::isContainingBlockAncestorFor const):
2040         * rendering/RenderBlock.h:
2041
2042 2018-08-25  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2043
2044         Shrink size of HTMLCollection
2045         https://bugs.webkit.org/show_bug.cgi?id=188945
2046
2047         Reviewed by Darin Adler.
2048
2049         Shrink the size of HTMLCollection by reordering members.
2050
2051         No behavior change.
2052
2053         * html/HTMLCollection.cpp:
2054         (WebCore::HTMLCollection::HTMLCollection):
2055         * html/HTMLCollection.h:
2056
2057 2018-08-25  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2058
2059         Shrink size of XMLHttpRequest
2060         https://bugs.webkit.org/show_bug.cgi?id=188944
2061
2062         Reviewed by Saam Barati.
2063
2064         Shrink the size of XMLHttpRequest by packing bits and reordering members.
2065         It reduces the size from 1248 to 1176.
2066
2067         No behavior change.
2068
2069         * xml/XMLHttpRequest.cpp:
2070         (WebCore::XMLHttpRequest::XMLHttpRequest):
2071         (WebCore::XMLHttpRequest::responseText):
2072         (WebCore::XMLHttpRequest::createResponseBlob):
2073         (WebCore::XMLHttpRequest::createResponseArrayBuffer):
2074         (WebCore::XMLHttpRequest::setResponseType):
2075         (WebCore::XMLHttpRequest::changeState):
2076         (WebCore::XMLHttpRequest::callReadyStateChangeListener):
2077         (WebCore::XMLHttpRequest::setWithCredentials):
2078         (WebCore::XMLHttpRequest::open):
2079         (WebCore::XMLHttpRequest::prepareToSend):
2080         (WebCore::XMLHttpRequest::createRequest):
2081         (WebCore::XMLHttpRequest::abort):
2082         (WebCore::XMLHttpRequest::overrideMimeType):
2083         (WebCore::XMLHttpRequest::setRequestHeader):
2084         (WebCore::XMLHttpRequest::getAllResponseHeaders const):
2085         (WebCore::XMLHttpRequest::getResponseHeader const):
2086         (WebCore::XMLHttpRequest::status const):
2087         (WebCore::XMLHttpRequest::statusText const):
2088         (WebCore::XMLHttpRequest::didFinishLoading):
2089         (WebCore::XMLHttpRequest::createDecoder const):
2090         (WebCore::XMLHttpRequest::didReceiveData):
2091         (WebCore::XMLHttpRequest::didReachTimeout):
2092         (WebCore::XMLHttpRequest::readyState const): Deleted.
2093         * xml/XMLHttpRequest.h:
2094         (WebCore::XMLHttpRequest::responseType const):
2095         (WebCore::XMLHttpRequest::readyState const):
2096         * xml/XMLHttpRequestProgressEventThrottle.cpp:
2097         (WebCore::XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle):
2098         * xml/XMLHttpRequestProgressEventThrottle.h:
2099
2100 2018-08-26  Zalan Bujtas  <zalan@apple.com>
2101
2102         [LFC][Floating] FloatBox -> FloatAvoider
2103         https://bugs.webkit.org/show_bug.cgi?id=188941
2104
2105         Reviewed by Antti Koivisto.
2106
2107         This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.
2108
2109         * Sources.txt:
2110         * WebCore.xcodeproj/project.pbxproj:
2111         * layout/displaytree/DisplayBox.h:
2112         * layout/floats/FloatAvoider.cpp: Renamed from Source/WebCore/layout/floats/FloatBox.cpp.
2113         (WebCore::Layout::FloatAvoider::FloatAvoider):
2114         (WebCore::Layout::FloatAvoider::initializePosition):
2115         (WebCore::Layout::FloatAvoider::isLeftAligned const):
2116         (WebCore::Layout::FloatAvoider::setLeft):
2117         (WebCore::Layout::FloatAvoider::setTopLeft):
2118         (WebCore::Layout::FloatAvoider::resetVertically):
2119         (WebCore::Layout::FloatAvoider::resetHorizontally):
2120         (WebCore::Layout::FloatAvoider::topLeftInContainingBlock const):
2121         * layout/floats/FloatAvoider.h: Renamed from Source/WebCore/layout/floats/FloatBox.h.
2122         (WebCore::Layout::FloatAvoider::top const):
2123         (WebCore::Layout::FloatAvoider::left const):
2124         (WebCore::Layout::FloatAvoider::marginTop const):
2125         (WebCore::Layout::FloatAvoider::marginLeft const):
2126         (WebCore::Layout::FloatAvoider::marginBottom const):
2127         (WebCore::Layout::FloatAvoider::marginRight const):
2128         (WebCore::Layout::FloatAvoider::rectWithMargin const):
2129         (WebCore::Layout::FloatAvoider::setTop):
2130         * layout/floats/FloatingContext.cpp:
2131         (WebCore::Layout::FloatingContext::positionForFloat const):
2132         (WebCore::Layout::FloatingContext::floatingPosition const):
2133         * layout/floats/FloatingContext.h:
2134
2135 2018-08-26  Christopher Reid  <chris.reid@sony.com>
2136
2137         [Curl] Implement deleteCookie()
2138         https://bugs.webkit.org/show_bug.cgi?id=188908
2139
2140         Reviewed by Fujii Hironori.
2141
2142         Support deleting cookies from the web inspector
2143
2144         Tested from the web inspector.
2145
2146         * platform/network/curl/CookieJarCurlDatabase.cpp:
2147         (WebCore::CookieJarCurlDatabase::deleteCookie const):
2148
2149 2018-08-26  Zalan Bujtas  <zalan@apple.com>
2150
2151         [LFC][Floating] Simplify FloatingState::FloatItem class
2152         https://bugs.webkit.org/show_bug.cgi?id=188912
2153
2154         Reviewed by Antti Koivisto.
2155
2156         Let's remove some redundant code now that FloatingState::FloatItem is not used for incoming floats anymore.
2157
2158         * layout/Verification.cpp:
2159         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
2160         * layout/floats/FloatBox.cpp:
2161         (WebCore::Layout::FloatBox::resetVertically):
2162         * layout/floats/FloatingContext.cpp:
2163         (WebCore::Layout::FloatingPair::left const):
2164         (WebCore::Layout::FloatingPair::right const):
2165         (WebCore::Layout::FloatingPair::intersects const):
2166         (WebCore::Layout::previousFloatingIndex):
2167         (WebCore::Layout::Iterator::operator++):
2168         (WebCore::Layout::Iterator::set):
2169         * layout/floats/FloatingState.cpp:
2170         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
2171         (WebCore::Layout::FloatingState::remove):
2172         (WebCore::Layout::FloatingState::bottom const):
2173         * layout/floats/FloatingState.h:
2174         (WebCore::Layout::FloatingState::FloatItem::operator== const):
2175         (WebCore::Layout::FloatingState::FloatItem::isLeftPositioned const):
2176         (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const):
2177         (WebCore::Layout::FloatingState::FloatItem::bottom const):
2178         (WebCore::Layout::FloatingState::leftBottom const):
2179         (WebCore::Layout::FloatingState::rightBottom const):
2180         (WebCore::Layout::FloatingState::bottom const):
2181         (WebCore::Layout::FloatingState::FloatItem::inFormattingContext const):
2182         (WebCore::Layout::FloatingState::FloatItem::layoutBox const): Deleted.
2183         (WebCore::Layout::FloatingState::FloatItem::containingBlock const): Deleted.
2184         (WebCore::Layout::FloatingState::FloatItem::displayBox const): Deleted.
2185         (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const): Deleted.
2186
2187 2018-08-26  Andy Estes  <aestes@apple.com>
2188
2189         [Apple Pay] Introduce new values for -apple-pay-button-type
2190         https://bugs.webkit.org/show_bug.cgi?id=188949
2191         <rdar://problem/39992228>
2192
2193         Reviewed by Anders Carlsson.
2194
2195         Added "in-store", "checkout", "book", and "subscribe" keywords for -apple-pay-button-type,
2196         and mapped those values to their equivalent PKPaymentButtonTypes.
2197
2198         Tests: http/tests/ssl/applepay/ApplePayButton.html
2199                http/tests/ssl/applepay/ApplePayButtonV4.html
2200
2201         * css/CSSPrimitiveValueMappings.h:
2202         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2203         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
2204         * css/CSSValueKeywords.in:
2205         * css/parser/CSSParserFastPaths.cpp:
2206         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2207         * rendering/RenderThemeCocoa.mm:
2208         (WebCore::toPKPaymentButtonType):
2209         * rendering/style/RenderStyleConstants.h:
2210
2211 2018-08-26  Youenn Fablet  <youenn@apple.com>
2212
2213         Make IDBCursor::m_request a WeakPtr
2214         https://bugs.webkit.org/show_bug.cgi?id=188938
2215
2216         Reviewed by Alex Christensen.
2217
2218         Make m_request a WeakPtr so that if m_request is destroyed, the related cursor will not use the invalid pointer.
2219
2220         Covered by existing tests.
2221
2222         * Modules/indexeddb/IDBCursor.cpp:
2223         (WebCore::IDBCursor::continuePrimaryKey): Other continue and advance methods that are calling uncheckedIterateCursor do check for m_request.
2224         Apply the same check for continuePrimaryKey.
2225         (WebCore::IDBCursor::uncheckedIterateCursor):
2226         * Modules/indexeddb/IDBCursor.h:
2227         (WebCore::IDBCursor::setRequest):
2228         (WebCore::IDBCursor::clearRequest):
2229         (WebCore::IDBCursor::request):
2230         * Modules/indexeddb/IDBRequest.h:
2231
2232 2018-08-26  Youenn Fablet  <youenn@apple.com>
2233
2234         IDBCursor does not need to be an ActiveDOMObject
2235         https://bugs.webkit.org/show_bug.cgi?id=188937
2236
2237         Reviewed by Alex Christensen.
2238
2239         Remove ActiveDOMObject from IDBCursor IDL.
2240         Update constructors and call sites accordingly.
2241         This allows removing m_outstandingRequestCount and related code in IDBRequest.
2242
2243         Covered by existing tests.
2244
2245         * Modules/indexeddb/IDBCursor.cpp:
2246         (WebCore::IDBCursor::create):
2247         (WebCore::IDBCursor::IDBCursor):
2248         (WebCore::IDBCursor::update):
2249         (WebCore::IDBCursor::uncheckedIterateCursor):
2250         (WebCore::IDBCursor::deleteFunction):
2251         (WebCore::IDBCursor::activeDOMObjectName const): Deleted.
2252         (WebCore::IDBCursor::canSuspendForDocumentSuspension const): Deleted.
2253         (WebCore::IDBCursor::hasPendingActivity const): Deleted.
2254         (WebCore::IDBCursor::decrementOutstandingRequestCount): Deleted.
2255         * Modules/indexeddb/IDBCursor.h:
2256         * Modules/indexeddb/IDBCursor.idl:
2257         * Modules/indexeddb/IDBCursorWithValue.cpp:
2258         (WebCore::IDBCursorWithValue::create):
2259         (WebCore::IDBCursorWithValue::IDBCursorWithValue):
2260         * Modules/indexeddb/IDBCursorWithValue.h:
2261         * Modules/indexeddb/IDBCursorWithValue.idl:
2262         * Modules/indexeddb/IDBRequest.cpp:
2263         (WebCore::IDBRequest::setSource):
2264         (WebCore::IDBRequest::dispatchEvent):
2265         (WebCore::IDBRequest::willIterateCursor):
2266         (WebCore::IDBRequest::didOpenOrIterateCursor):
2267         * Modules/indexeddb/IDBRequest.h:
2268         * Modules/indexeddb/IDBTransaction.cpp:
2269         (WebCore::IDBTransaction::requestOpenCursor):
2270         * WebCore.xcodeproj/project.pbxproj:
2271
2272 2018-08-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2273
2274         [Attachment Support] Dropping and pasting images should insert inline image elements with _WKAttachments
2275         https://bugs.webkit.org/show_bug.cgi?id=188933
2276         <rdar://problem/43699724>
2277
2278         Reviewed by Darin Adler.
2279
2280         Support the ability to drop and paste images as image elements, with attachment elements, only if attachment
2281         elements are enabled. See changes below for more detail.
2282
2283         Tests:  WKAttachmentTests.CutAndPastePastedImage
2284                 WKAttachmentTests.MovePastedImageByDragging
2285                 WKAttachmentTests.RemoveNewlinesBeforePastedImage
2286
2287         * editing/Editor.h:
2288         * editing/cocoa/EditorCocoa.mm:
2289         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
2290
2291         Adjust this helper to take an Element& rather than an HTMLAttachmentElement&, and address a FIXME by writing the
2292         document origin identifier to the pasteboard via custom pasteboard data when dragging an attachment. This allows
2293         us to avoid creating extra image and attachment elements when dragging an image backed by an attachment within
2294         the same document.
2295
2296         * editing/cocoa/WebContentReaderCocoa.mm:
2297         (WebCore::contentTypeIsSuitableForInlineImageRepresentation):
2298
2299         Add a helper to determine whether a content type (UTI or MIME type) should be read as an inline image.
2300
2301         (WebCore::createFragmentForImageAttachment):
2302         (WebCore::replaceRichContentWithAttachments):
2303         (WebCore::WebContentReader::readFilePaths):
2304
2305         Teach codepaths where we currently create attachment elements to instead create image elements if the MIME type,
2306         is something suitable for display via an inline image element; add the attachment element under the shadow root
2307         of the image element.
2308
2309         * editing/markup.cpp:
2310         (WebCore::StyledMarkupAccumulator::appendCustomAttributes):
2311         (WebCore::restoreAttachmentElementsInFragment):
2312
2313         When dragging or copying an image element, we need to make sure that any attachment element backing the image
2314         is preserved in the pasted or dropped fragment. To do this, we use a technique similar to what was done for
2315         r180785 and r224593 and write a temporary "webkitattachmentid" attribute to the serialized markup on copy. Upon
2316         deserializing the markup back to a fragment, we then create an attachment element with the same identifier under
2317         the image.
2318
2319         (WebCore::createFragmentFromMarkup):
2320         * html/HTMLAttachmentElement.h:
2321         * html/HTMLImageElement.cpp:
2322         (WebCore::HTMLImageElement::setAttachmentElement):
2323         (WebCore::HTMLImageElement::attachmentElement const):
2324
2325         Helper methods to get and set an attachment element under an image element. Setting an image's attachment
2326         element puts that attachment element under the shadow root of the image, and also hides the attachment element.
2327
2328         (WebCore::HTMLImageElement::attachmentIdentifier const):
2329
2330         Returns the identifier of an attachment element associated with the image element, or null.
2331
2332         * html/HTMLImageElement.h:
2333         * html/HTMLImageElement.idl:
2334
2335         Add HTMLImageElement.webkitAttachmentIdentifier, a readonly attribute guarded by runtime-enabled attachment
2336         element feature.
2337
2338         * page/DragController.cpp:
2339         (WebCore::DragController::startDrag):
2340
2341         In the case of dragging an image, if that image element is backed by an attachment element, don't bother writing
2342         the image data to the clipboard; instead, write the attachment data as a promise.
2343
2344         (WebCore::DragController::doImageDrag):
2345
2346         Plumb promised attachment information to DragController::doSystemDrag.
2347
2348         (WebCore::DragController::promisedAttachmentInfo):
2349
2350         Teach this to handle attachment elements as well as image elements that are backed by attachment elements.
2351
2352         * page/DragController.h:
2353         * platform/PromisedAttachmentInfo.h:
2354         (WebCore::PromisedAttachmentInfo::operator bool const):
2355
2356         A valid PromisedAttachmentInfo no longer requires a contentType to be set; instead, an attachment identifier
2357         alone is sufficient, since an up-to-date content type can be requested in the UI process from the API attachment
2358         object.
2359
2360 2018-08-26  Andy Estes  <aestes@apple.com>
2361
2362         [Apple Pay] PaymentRequest.show() should reject when an unsupported ApplePayRequest version is specified
2363         https://bugs.webkit.org/show_bug.cgi?id=188954
2364
2365         Reviewed by Darin Adler.
2366
2367         In Apple Pay JS, calling the ApplePaySession constructor with an unsupported version results
2368         in an exception being thrown. We need to do something similar for Payment Request.
2369
2370         This patch moves the logic for validating the version from ApplePaySession to a common
2371         routine in ApplePayRequestBase that both APIs call to convert requests into a common format.
2372
2373         In Apple Pay JS, an exception will still be thrown when constructing an ApplePaySession. In
2374         Payment Request, the promise returned by show() will be rejected.
2375
2376         Added test cases to http/tests/ssl/applepay/PaymentRequest.https.html.
2377
2378         * Modules/applepay/ApplePayRequestBase.cpp:
2379         (WebCore::convertAndValidate):
2380         * Modules/applepay/ApplePaySession.cpp:
2381         (WebCore::ApplePaySession::create):
2382
2383 2018-08-24  Ryosuke Niwa  <rniwa@webkit.org>
2384
2385         Click event from click() is not composed
2386         https://bugs.webkit.org/show_bug.cgi?id=170211
2387
2388         Reviewed by Wenson Hsieh.
2389
2390         Fixed the bug. All simulated clicks should be composed regardless of whether it's trusted or not.
2391         See: https://html.spec.whatwg.org/multipage/interaction.html#dom-click
2392              https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-synthetic-mouse-event
2393
2394         * dom/SimulatedClick.cpp:
2395
2396 2018-08-24  Ryosuke Niwa  <rniwa@webkit.org>
2397
2398         Avoid calling setUntrusted in SimulatedMouseEvent
2399         https://bugs.webkit.org/show_bug.cgi?id=188929
2400
2401         Reviewed by Simon Fraser.
2402
2403         Added IsTrusted flag to Event constructors instead of creating a trusted event
2404         and making it untrusted in the constructor of SimulatedMouseEvent.
2405
2406         This makes EventTarget::dispatchEventForBindings the only caller of setUntrusted().
2407
2408         * dom/Event.cpp:
2409         (WebCore::Event::Event):
2410         * dom/Event.h:
2411         * dom/KeyboardEvent.cpp:
2412         (WebCore::KeyboardEvent::KeyboardEvent):
2413         * dom/MouseEvent.cpp:
2414         (WebCore::MouseEvent::create):
2415         (WebCore::MouseEvent::MouseEvent):
2416         * dom/MouseEvent.h:
2417         * dom/MouseRelatedEvent.cpp:
2418         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
2419         * dom/MouseRelatedEvent.h:
2420         * dom/SimulatedClick.cpp:
2421         * dom/UIEvent.cpp:
2422         (WebCore::UIEvent::UIEvent):
2423         * dom/UIEvent.h:
2424         * dom/UIEventWithKeyState.h:
2425         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
2426         * dom/WheelEvent.cpp:
2427         (WebCore::WheelEvent::WheelEvent):
2428
2429 2018-08-24  Jer Noble  <jer.noble@apple.com>
2430
2431         Using Touch Bar to scrub video on Youtube results in video playback freeze
2432         https://bugs.webkit.org/show_bug.cgi?id=188926
2433
2434         Reviewed by Eric Carlson.
2435
2436         Test: media/media-source/media-source-seek-twice.html
2437
2438         When converting from a double-precision float to a MediaTime, a certain amount of precision is lost. If that
2439         results in a round-trip between `float in -> MediaTime -> float out` where in != out, we will wait forever for
2440         the time jump observer to fire. Break the cycle by comparing m_lastSeekTime to the synchronizerTime only after
2441         m_lastSeekTime has been normalized into a rational-time value.
2442
2443         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2444         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
2445
2446 2018-08-24  Ryosuke Niwa  <rniwa@webkit.org>
2447
2448         Pass in IsComposed flag to Event constructors
2449         https://bugs.webkit.org/show_bug.cgi?id=188720
2450         <rdar://problem/43580387>
2451
2452         Reviewed by Simon Fraser.
2453
2454         This patch replaces the logic in Event::isComposed to decide whether an event is composed or not by
2455         explicitly passing IsComposed flag to Event constructor. This decouples being composed from whether
2456         an event is trusted and of a partciular event type, paving our way to make synthetic click event
2457         dispatched by an author script composable in webkit.org/b/170211.
2458
2459         This patch also removes IsTrusted from the argument list of event constructors and create functions
2460         to systematically eliminate the possibility of this patch making an event uncomposed by not setting
2461         IsComposed flag.
2462
2463         No new tests since there should be no behavioral change.
2464
2465         * dom/ClipboardEvent.cpp:
2466         (WebCore::ClipboardEvent::ClipboardEvent): A trusted ClipboardEvent is composed.
2467         * dom/ClipboardEvent.h:
2468         (WebCore::ClipboardEvent::ClipboardEvent): Removed IsTrusted from the variant which takes Init object
2469         to make sure this refactoring is correct.
2470         (WebCore::ClipboardEvent::create): Ditto.
2471         * dom/CompositionEvent.cpp:
2472         (WebCore::CompositionEvent::CompositionEvent): A trusted CompositionEvent is composed.
2473         * dom/CompositionEvent.h:
2474         * dom/Element.cpp:
2475         (WebCore::Element::dispatchMouseEvent): A trusted dblclick event is composed (this is a non-standard
2476         event but virtually every mouse event is composed so it makes sense to make this composed).
2477         * dom/Event.cpp:
2478         (WebCore::Event::Event):
2479         (WebCore::Event::create):
2480         (WebCore::Event::composed const): Deleted. The trival implementation moved to the header file.
2481         * dom/Event.h:
2482         (WebCore::Event::composed const):
2483         * dom/FocusEvent.cpp:
2484         (WebCore::FocusEvent::FocusEvent): A trusted Focus event is composed.
2485         * dom/FocusEvent.h:
2486         (WebCore::FocusEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
2487         (WebCore::FocusEvent::FocusEvent): Ditto.
2488         * dom/InputEvent.cpp:
2489         (WebCore::InputEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
2490         (WebCore::InputEvent::InputEvent): A trsuted InputEvent is composed.
2491         * dom/InputEvent.h:
2492         * dom/KeyboardEvent.cpp:
2493         (WebCore::KeyboardEvent::KeyboardEvent): A trsuted KeyboardEvent is composed.
2494         (WebCore::KeyboardEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
2495         * dom/KeyboardEvent.h:
2496         * dom/MouseEvent.cpp:
2497         (WebCore::MouseEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
2498         (WebCore::MouseEvent::MouseEvent): Explicitly take IsComposed flag from subclasses since simulated click
2499         does not currently compose.
2500         * dom/MouseEvent.h:
2501         * dom/MouseRelatedEvent.cpp:
2502         (WebCore::MouseRelatedEvent::MouseRelatedEvent): A trusted touch event is composed.
2503         * dom/MouseRelatedEvent.h:
2504         * dom/Node.cpp:
2505         (WebCore::Node::dispatchDOMActivateEvent): A trusted DOMActivateEvent event is composed.
2506         (WebCore::Node::dispatchInputEvent): A trusted input event is composed.
2507         * dom/SimulatedClick.cpp:
2508         (SimulatedMouseEvent::SimulatedMouseEvent): A simulated click is composed if it's a trusted event for now.
2509         This is the bug to be fixed in webkit.org/b/170211.
2510         * dom/TextEvent.cpp:
2511         (WebCore::TextEvent::TextEvent): A trsuted textInput event is composed.
2512         * dom/UIEvent.cpp:
2513         (WebCore::UIEvent::UIEvent): Added IsComposed as an argument to the variant which creates a trusted event,
2514         and removed IsTrusted from Init variant for the correctness guarantee.
2515         * dom/UIEvent.h:
2516         (WebCore::UIEvent::create): Ditto.
2517         * dom/UIEventWithKeyState.h:
2518         (WebCore::UIEventWithKeyState::UIEventWithKeyState): Ditto.
2519         * dom/WheelEvent.cpp:
2520         (WebCore::WheelEvent::WheelEvent): A trusted Wheel event, which is a subclass of MouseEvent, is composed.
2521         (WebCore::WheelEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
2522         * dom/WheelEvent.h:
2523         * editing/Editor.cpp:
2524         (WebCore::dispatchBeforeInputEvent):
2525         (WebCore::dispatchInputEvent):
2526         (WebCore::dispatchClipboardEvent): Call the newly added variant which takes DataTransfer directly so that
2527         we can remove IsTrusted from the variant which takes Init for the correctness guarantee.
2528         * page/EventHandler.cpp:
2529         (WebCore::EventHandler::dispatchDragEvent): A trusted mouse event is composed.
2530
2531 2018-08-24  Ryosuke Niwa  <rniwa@webkit.org>
2532
2533         Add getModifierState to MouseEvent
2534         https://bugs.webkit.org/show_bug.cgi?id=188913
2535         <rdar://problem/43668772>
2536
2537         Reviewed by Simon Fraser.
2538
2539         Moved getModifierState from KeyboardEvent to UIEventWithKeyState and exposed it in MouseEvent.
2540         See https://www.w3.org/TR/2016/WD-uievents-20160804/#mouseevent
2541
2542         This patch also fixes the bug that initMouseEvent was not clearing AltGraph and CapsLock states,
2543         which was preserved in the refactoring done in r235158.
2544
2545         Tests: fast/events/constructors/mouse-event-getModifierState.html
2546                fast/events/dblclick-event-getModifierState.html
2547
2548         * dom/KeyboardEvent.cpp:
2549         (WebCore::KeyboardEvent::getModifierState const): Moved to UIEventWithKeyState.
2550         * dom/KeyboardEvent.h:
2551         * dom/KeyboardEvent.idl: Insert a blank line to match the spec's IDL.
2552         * dom/MouseEvent.idl: Added getModifierState. 
2553         * dom/UIEventWithKeyState.cpp:
2554         (WebCore::UIEventWithKeyState::modifiersFromInitializer): Moved from the header file.
2555         (WebCore::UIEventWithKeyState::getModifierState const):
2556         (WebCore::UIEventWithKeyState::setModifierKeys): Moved from the header file.
2557         * dom/UIEventWithKeyState.h:
2558         (WebCore::UIEventWithKeyState::modifierKeys const):
2559         (WebCore::UIEventWithKeyState::setModifierKeys): Deleted the variant which didn't take altGraphKey
2560         since that variant behaves same as the one which takes altGraphKey.
2561
2562 2018-08-24  Youenn Fablet  <youenn@apple.com>
2563
2564         libwebrtc PeerConnection::AddTrack sometimes fail
2565         https://bugs.webkit.org/show_bug.cgi?id=188914
2566
2567         Reviewed by Eric Carlson.
2568
2569         AddTrack may fail so test the result and if not successful, make JS addTrack to throw an exception.
2570         This makes some tests to fail now.
2571         These tests should pass again when unified plan will be enabled.
2572         Covered by rebased tests.
2573
2574         * Modules/mediastream/PeerConnectionBackend.h:
2575         (WebCore::PeerConnectionBackend::notifyAddedTrack):
2576         * Modules/mediastream/RTCPeerConnection.cpp:
2577         (WebCore::RTCPeerConnection::addTrack):
2578         (WebCore::RTCPeerConnection::addTransceiver):
2579         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2580         (WebCore::LibWebRTCMediaEndpoint::addTrack):
2581         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2582         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2583         (WebCore::LibWebRTCPeerConnectionBackend::notifyAddedTrack):
2584         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2585
2586 2018-08-24  Adrian Perez de Castro  <aperez@igalia.com>
2587
2588         [FreeType] Do not cast through GLib types in FontCustomPlatformDataFreeType.cpp
2589         https://bugs.webkit.org/show_bug.cgi?id=188919
2590
2591         Reviewed by Michael Catanzaro.
2592
2593         No new tests needed.
2594
2595         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2596         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Cast
2597         through "void (*)(void)" instead of GCallback to avoid the warning
2598         produced by -Wcast-function-type.
2599
2600 2018-08-24  Andy Estes  <aestes@apple.com>
2601
2602         [Apple Pay] Allow $0 totals
2603         https://bugs.webkit.org/show_bug.cgi?id=185150
2604         <rdar://problem/39212331>
2605
2606         Reviewed by Dan Bernstein.
2607
2608         Relaxed payment request validation to allow $0 totals. This matches PassKit behavior.
2609
2610         Updated test cases in http/tests/ssl/applepay/.
2611
2612         * Modules/applepay/PaymentRequestValidator.mm:
2613         (WebCore::PaymentRequestValidator::validateTotal):
2614
2615 2018-08-24  Frederic Wang  <fwang@igalia.com>
2616
2617         Remove ScrollByPrecisePixel granularity
2618         https://bugs.webkit.org/show_bug.cgi?id=188915
2619
2620         Reviewed by Carlos Garcia Campos.
2621
2622         ScrollByPrecisePixel was introduced in bug 87535 and bug 91020 for Chromium Linux/Windows but
2623         it is no longer used.
2624
2625         No new tests, behavior unchanged.
2626
2627         * platform/ScrollAnimatorSmooth.cpp:
2628         (WebCore::ScrollAnimatorSmooth::scroll): Remove special handling for ScrollByPrecisePixel.
2629         * platform/ScrollTypes.h: Remove ScrollByPrecisePixel, it is never used.
2630         * platform/ScrollableArea.cpp:
2631         (WebCore::ScrollableArea::scroll): Remove special handling for ScrollByPrecisePixel.
2632         * platform/gtk/ScrollAnimatorGtk.cpp:
2633         (WebCore::ScrollAnimatorGtk::scroll): Remove special handling for ScrollByPrecisePixel.
2634
2635 2018-08-24  Antti Koivisto  <antti@apple.com>
2636
2637         Allow creating WeakPtrs to const objects
2638         https://bugs.webkit.org/show_bug.cgi?id=188785
2639
2640         Reviewed by Geoff Garen.
2641
2642         Remove some unneeded const_casts.
2643
2644         * css/MediaQueryEvaluator.cpp:
2645         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
2646         (WebCore::MediaQueryEvaluator::evaluate const):
2647         * css/MediaQueryEvaluator.h:
2648         * rendering/FloatingObjects.cpp:
2649         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
2650         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter):
2651         (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter):
2652         (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
2653         (WebCore::FloatingObjects::FloatingObjects):
2654         * rendering/FloatingObjects.h:
2655         (WebCore::FloatingObjects::renderer const):
2656
2657 2018-08-24  Zan Dobersek  <zdobersek@igalia.com>
2658
2659         [CoordGraphics] Move inline methods on CoordinatedGraphicsLayer out-of-line
2660         https://bugs.webkit.org/show_bug.cgi?id=188916
2661
2662         Reviewed by Carlos Garcia Campos.
2663
2664         Style checker produced complaints that CoordinatedGraphicsLayer class is
2665         using inline-defined methods despite the WEBCORE_EXPORT macro being used
2666         for the whole class. Keep the macro where it is but instead move the
2667         method definitions out-of-line.
2668
2669         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2670         (WebCore::CoordinatedGraphicsLayer::isCoordinatedGraphicsLayer const):
2671         (WebCore::CoordinatedGraphicsLayer::id const):
2672         (WebCore::CoordinatedGraphicsLayer::primaryLayerID const):
2673         (WebCore::CoordinatedGraphicsLayer::usesContentsLayer const):
2674         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2675
2676 2018-08-24  Antti Koivisto  <antti@apple.com>
2677
2678         Use OptionSet::containsAny and containsAll in some more places
2679         https://bugs.webkit.org/show_bug.cgi?id=188885
2680
2681         Reviewed by Sam Weinig.
2682
2683         * page/PerformanceMonitor.cpp:
2684         (WebCore::PerformanceMonitor::activityStateChanged):
2685         * rendering/RenderLayer.cpp:
2686         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
2687         (WebCore::RenderLayer::paintLayerContents):
2688         (WebCore::RenderLayer::calculateClipRects const):
2689         * rendering/RenderLayerBacking.cpp:
2690         (WebCore::RenderLayerBacking::~RenderLayerBacking):
2691
2692 2018-08-23  Simon Fraser  <simon.fraser@apple.com>
2693
2694         Add support for dumping GC heap snapshots, and a viewer
2695         https://bugs.webkit.org/show_bug.cgi?id=186416
2696
2697         Reviewed by Joseph Pecoraro.
2698
2699         Make a way to dump information about the GC heap that is useful for looking for leaked
2700         or abandoned objects. This dump is obtained (on Apple platforms) via:
2701             notifyutil -p com.apple.WebKit.dumpGCHeap
2702         which writes a JSON file to /tmp which can then be loaded into the viewer in Tools/GCHeapInspector.
2703
2704         This leverages the heap snapshot used by Web Inspector, adding an alternate format for
2705         the snapshot JSON that adds additional data about objects and why they are GC roots.
2706         
2707         The generated bindings code is changed to include the output root reason from isReachableFromOpaqueRoots(),
2708         and to implement heapSnapshot() which provides the address of the wrapped object. A new IDL attribute,
2709         CustomHeapSnapshot, is used to allow custom heapSnapshot() implementations for classes like JSDocument
2710         that need to decorate the heap snapshot cell data with things like the document URL.
2711
2712         GCController registers a notifyutil callback which gathers the debug heap snapshot, and dumps it
2713         to a file in /tmp. The file path is printed out to the system log.
2714
2715         * bindings/js/DOMGCOutputConstraint.cpp:
2716         (WebCore::DOMGCOutputConstraint::executeImpl):
2717         * bindings/js/GCController.cpp:
2718         (WebCore::GCController::GCController):
2719         (WebCore::GCController::dumpHeap):
2720         * bindings/js/GCController.h:
2721         * bindings/js/JSCSSRuleListCustom.cpp:
2722         (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
2723         * bindings/js/JSCallbackData.cpp:
2724         (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots):
2725         * bindings/js/JSCallbackData.h:
2726         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
2727         (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
2728         * bindings/js/JSDOMWindowCustom.cpp:
2729         (WebCore::JSDOMWindow::getOwnPropertySlot):
2730         (WebCore::JSDOMWindow::heapSnapshot):
2731         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
2732         (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
2733         * bindings/js/JSDocumentCustom.cpp:
2734         (WebCore::JSDocument::heapSnapshot):
2735         * bindings/js/JSMicrotaskCallback.h:
2736         (WebCore::JSMicrotaskCallback::call):
2737         * bindings/js/JSMutationObserverCustom.cpp:
2738         (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots):
2739         * bindings/js/JSNavigatorCustom.cpp:
2740         (WebCore::JSNavigator::visitAdditionalChildren):
2741         * bindings/js/JSNodeCustom.cpp:
2742         (WebCore::isReachableFromDOM):
2743         (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
2744         * bindings/js/JSNodeListCustom.cpp:
2745         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
2746         * bindings/js/JSOffscreenCanvasRenderingContext2DCustom.cpp:
2747         (WebCore::JSOffscreenCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
2748         * bindings/js/JSPerformanceObserverCustom.cpp:
2749         (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
2750         * bindings/js/JSPopStateEventCustom.cpp:
2751         * bindings/js/JSTextTrackCueCustom.cpp:
2752         (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
2753         * bindings/js/WebCoreTypedArrayController.cpp:
2754         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots):
2755         * bindings/js/WebCoreTypedArrayController.h:
2756         * bindings/scripts/CodeGeneratorJS.pm:
2757         (GenerateHeader):
2758         (GenerateImplementation):
2759         * bindings/scripts/IDLAttributes.json:
2760         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2761         (WebCore::JSInterfaceName::heapSnapshot):
2762         (WebCore::JSInterfaceNameOwner::isReachableFromOpaqueRoots):
2763         * bindings/scripts/test/JS/JSInterfaceName.h:
2764         * bindings/scripts/test/JS/JSMapLike.cpp:
2765         (WebCore::JSMapLike::heapSnapshot):
2766         (WebCore::JSMapLikeOwner::isReachableFromOpaqueRoots):
2767         * bindings/scripts/test/JS/JSMapLike.h:
2768         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2769         (WebCore::JSReadOnlyMapLike::heapSnapshot):
2770         (WebCore::JSReadOnlyMapLikeOwner::isReachableFromOpaqueRoots):
2771         * bindings/scripts/test/JS/JSReadOnlyMapLike.h:
2772         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2773         (WebCore::JSTestActiveDOMObject::heapSnapshot):
2774         (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots):
2775         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2776         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2777         (WebCore::JSTestCEReactions::heapSnapshot):
2778         (WebCore::JSTestCEReactionsOwner::isReachableFromOpaqueRoots):
2779         * bindings/scripts/test/JS/JSTestCEReactions.h:
2780         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2781         (WebCore::JSTestCEReactionsStringifier::heapSnapshot):
2782         (WebCore::JSTestCEReactionsStringifierOwner::isReachableFromOpaqueRoots):
2783         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
2784         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2785         (WebCore::JSTestCallTracer::heapSnapshot):
2786         (WebCore::JSTestCallTracerOwner::isReachableFromOpaqueRoots):
2787         * bindings/scripts/test/JS/JSTestCallTracer.h:
2788         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2789         (WebCore::JSTestClassWithJSBuiltinConstructor::heapSnapshot):
2790         (WebCore::JSTestClassWithJSBuiltinConstructorOwner::isReachableFromOpaqueRoots):
2791         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
2792         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2793         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::heapSnapshot):
2794         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
2795         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
2796         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2797         (WebCore::JSTestDOMJIT::heapSnapshot):
2798         * bindings/scripts/test/JS/JSTestDOMJIT.h:
2799         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2800         (WebCore::JSTestEnabledBySetting::heapSnapshot):
2801         (WebCore::JSTestEnabledBySettingOwner::isReachableFromOpaqueRoots):
2802         * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
2803         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2804         (WebCore::JSTestEventConstructor::heapSnapshot):
2805         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2806         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2807         (WebCore::JSTestEventTarget::heapSnapshot):
2808         * bindings/scripts/test/JS/JSTestEventTarget.h:
2809         * bindings/scripts/test/JS/JSTestException.cpp:
2810         (WebCore::JSTestException::heapSnapshot):
2811         (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots):
2812         * bindings/scripts/test/JS/JSTestException.h:
2813         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2814         (WebCore::JSTestGenerateIsReachable::heapSnapshot):
2815         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
2816         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2817         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2818         (WebCore::JSTestGlobalObject::heapSnapshot):
2819         (WebCore::JSTestGlobalObjectOwner::isReachableFromOpaqueRoots):
2820         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2821         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2822         (WebCore::JSTestIndexedSetterNoIdentifier::heapSnapshot):
2823         (WebCore::JSTestIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots):
2824         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
2825         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2826         (WebCore::JSTestIndexedSetterThrowingException::heapSnapshot):
2827         (WebCore::JSTestIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots):
2828         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
2829         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2830         (WebCore::JSTestIndexedSetterWithIdentifier::heapSnapshot):
2831         (WebCore::JSTestIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots):
2832         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
2833         * bindings/scripts/test/JS/JSTestInterface.cpp:
2834         (WebCore::JSTestInterface::heapSnapshot):
2835         (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots):
2836         * bindings/scripts/test/JS/JSTestInterface.h:
2837         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2838         (WebCore::JSTestInterfaceLeadingUnderscore::heapSnapshot):
2839         (WebCore::JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots):
2840         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
2841         * bindings/scripts/test/JS/JSTestIterable.cpp:
2842         (WebCore::JSTestIterable::heapSnapshot):
2843         (WebCore::JSTestIterableOwner::isReachableFromOpaqueRoots):
2844         * bindings/scripts/test/JS/JSTestIterable.h:
2845         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2846         (WebCore::JSTestMediaQueryListListener::heapSnapshot):
2847         (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots):
2848         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2849         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2850         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::heapSnapshot):
2851         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots):
2852         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
2853         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2854         (WebCore::JSTestNamedAndIndexedSetterThrowingException::heapSnapshot):
2855         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots):
2856         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
2857         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2858         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::heapSnapshot):
2859         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots):
2860         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
2861         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2862         (WebCore::JSTestNamedConstructor::heapSnapshot):
2863         (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots):
2864         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2865         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2866         (WebCore::JSTestNamedDeleterNoIdentifier::heapSnapshot):
2867         (WebCore::JSTestNamedDeleterNoIdentifierOwner::isReachableFromOpaqueRoots):
2868         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
2869         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2870         (WebCore::JSTestNamedDeleterThrowingException::heapSnapshot):
2871         (WebCore::JSTestNamedDeleterThrowingExceptionOwner::isReachableFromOpaqueRoots):
2872         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
2873         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2874         (WebCore::JSTestNamedDeleterWithIdentifier::heapSnapshot):
2875         (WebCore::JSTestNamedDeleterWithIdentifierOwner::isReachableFromOpaqueRoots):
2876         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
2877         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2878         (WebCore::JSTestNamedDeleterWithIndexedGetter::heapSnapshot):
2879         (WebCore::JSTestNamedDeleterWithIndexedGetterOwner::isReachableFromOpaqueRoots):
2880         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
2881         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2882         (WebCore::JSTestNamedGetterCallWith::heapSnapshot):
2883         (WebCore::JSTestNamedGetterCallWithOwner::isReachableFromOpaqueRoots):
2884         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
2885         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2886         (WebCore::JSTestNamedGetterNoIdentifier::heapSnapshot):
2887         (WebCore::JSTestNamedGetterNoIdentifierOwner::isReachableFromOpaqueRoots):
2888         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
2889         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2890         (WebCore::JSTestNamedGetterWithIdentifier::heapSnapshot):
2891         (WebCore::JSTestNamedGetterWithIdentifierOwner::isReachableFromOpaqueRoots):
2892         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
2893         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2894         (WebCore::JSTestNamedSetterNoIdentifier::heapSnapshot):
2895         (WebCore::JSTestNamedSetterNoIdentifierOwner::isReachableFromOpaqueRoots):
2896         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
2897         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2898         (WebCore::JSTestNamedSetterThrowingException::heapSnapshot):
2899         (WebCore::JSTestNamedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots):
2900         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
2901         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2902         (WebCore::JSTestNamedSetterWithIdentifier::heapSnapshot):
2903         (WebCore::JSTestNamedSetterWithIdentifierOwner::isReachableFromOpaqueRoots):
2904         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
2905         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2906         (WebCore::JSTestNamedSetterWithIndexedGetter::heapSnapshot):
2907         (WebCore::JSTestNamedSetterWithIndexedGetterOwner::isReachableFromOpaqueRoots):
2908         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
2909         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2910         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::heapSnapshot):
2911         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterOwner::isReachableFromOpaqueRoots):
2912         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
2913         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2914         (WebCore::JSTestNamedSetterWithOverrideBuiltins::heapSnapshot):
2915         (WebCore::JSTestNamedSetterWithOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
2916         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
2917         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2918         (WebCore::JSTestNamedSetterWithUnforgableProperties::heapSnapshot):
2919         (WebCore::JSTestNamedSetterWithUnforgablePropertiesOwner::isReachableFromOpaqueRoots):
2920         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
2921         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2922         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::heapSnapshot):
2923         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
2924         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
2925         * bindings/scripts/test/JS/JSTestNode.cpp:
2926         (WebCore::JSTestNode::heapSnapshot):
2927         * bindings/scripts/test/JS/JSTestNode.h:
2928         * bindings/scripts/test/JS/JSTestObj.cpp:
2929         (WebCore::JSTestObj::heapSnapshot):
2930         (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots):
2931         * bindings/scripts/test/JS/JSTestObj.h:
2932         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2933         (WebCore::JSTestOverloadedConstructors::heapSnapshot):
2934         (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots):
2935         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2936         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2937         (WebCore::JSTestOverloadedConstructorsWithSequence::heapSnapshot):
2938         (WebCore::JSTestOverloadedConstructorsWithSequenceOwner::isReachableFromOpaqueRoots):
2939         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
2940         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2941         (WebCore::JSTestOverrideBuiltins::heapSnapshot):
2942         (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
2943         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2944         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2945         (WebCore::JSTestPluginInterface::heapSnapshot):
2946         (WebCore::JSTestPluginInterfaceOwner::isReachableFromOpaqueRoots):
2947         * bindings/scripts/test/JS/JSTestPluginInterface.h:
2948         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2949         (WebCore::JSTestPromiseRejectionEvent::heapSnapshot):
2950         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h:
2951         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2952         (WebCore::JSTestSerialization::heapSnapshot):
2953         (WebCore::JSTestSerializationOwner::isReachableFromOpaqueRoots):
2954         * bindings/scripts/test/JS/JSTestSerialization.h:
2955         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2956         (WebCore::JSTestSerializationIndirectInheritance::heapSnapshot):
2957         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h:
2958         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2959         (WebCore::JSTestSerializationInherit::heapSnapshot):
2960         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
2961         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2962         (WebCore::JSTestSerializationInheritFinal::heapSnapshot):
2963         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
2964         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2965         (WebCore::JSTestSerializedScriptValueInterface::heapSnapshot):
2966         (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots):
2967         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2968         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2969         (WebCore::JSTestStringifier::heapSnapshot):
2970         (WebCore::JSTestStringifierOwner::isReachableFromOpaqueRoots):
2971         * bindings/scripts/test/JS/JSTestStringifier.h:
2972         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2973         (WebCore::JSTestStringifierAnonymousOperation::heapSnapshot):
2974         (WebCore::JSTestStringifierAnonymousOperationOwner::isReachableFromOpaqueRoots):
2975         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h:
2976         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2977         (WebCore::JSTestStringifierNamedOperation::heapSnapshot):
2978         (WebCore::JSTestStringifierNamedOperationOwner::isReachableFromOpaqueRoots):
2979         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h:
2980         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2981         (WebCore::JSTestStringifierOperationImplementedAs::heapSnapshot):
2982         (WebCore::JSTestStringifierOperationImplementedAsOwner::isReachableFromOpaqueRoots):
2983         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h:
2984         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2985         (WebCore::JSTestStringifierOperationNamedToString::heapSnapshot):
2986         (WebCore::JSTestStringifierOperationNamedToStringOwner::isReachableFromOpaqueRoots):
2987         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h:
2988         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2989         (WebCore::JSTestStringifierReadOnlyAttribute::heapSnapshot):
2990         (WebCore::JSTestStringifierReadOnlyAttributeOwner::isReachableFromOpaqueRoots):
2991         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h:
2992         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2993         (WebCore::JSTestStringifierReadWriteAttribute::heapSnapshot):
2994         (WebCore::JSTestStringifierReadWriteAttributeOwner::isReachableFromOpaqueRoots):
2995         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h:
2996         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2997         (WebCore::JSTestTypedefs::heapSnapshot):
2998         (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots):
2999         * bindings/scripts/test/JS/JSTestTypedefs.h:
3000         * dom/Document.idl:
3001         * page/DOMWindow.idl:
3002
3003 2018-08-23  Ryosuke Niwa  <rniwa@webkit.org>
3004
3005         initKeyboardEvent doesn't clear CapsLock state
3006         https://bugs.webkit.org/show_bug.cgi?id=188909
3007
3008         Reviewed by Wenson Hsieh.
3009
3010         Fixed the bug by not preserving CapsLock state in setModifierKeys variant which takes boolean
3011         for altGraphKey, which is only called by KeyboardEvent::initKeyboardEvent.
3012
3013         Test: fast/events/init-event-clears-capslock.html
3014
3015         * dom/UIEventWithKeyState.h:
3016         (WebCore::UIEventWithKeyState::setModifierKeys):
3017
3018 2018-08-23  Aditya Keerthi  <akeerthi@apple.com>
3019
3020         Unreviewed, fix the Windows build after r235245.
3021
3022         * html/InputMode.cpp:
3023         (WebCore::stringForInputMode):
3024
3025 2018-08-23  Saam barati  <sbarati@apple.com>
3026
3027         JSRunLoopTimer may run part of a member function after it's destroyed
3028         https://bugs.webkit.org/show_bug.cgi?id=188426
3029
3030         Reviewed by Mark Lam.
3031
3032         * page/cocoa/ResourceUsageThreadCocoa.mm:
3033         (WebCore::ResourceUsageThread::platformThreadBody):
3034         * page/linux/ResourceUsageThreadLinux.cpp:
3035         (WebCore::ResourceUsageThread::platformThreadBody):
3036
3037 2018-08-23  David Fenton  <david_fenton@apple.com>
3038
3039         Unreviewed, rolling out r235129.
3040
3041         broke internal builds
3042
3043         Reverted changeset:
3044
3045         "Allow creating WeakPtrs to const objects"
3046         https://bugs.webkit.org/show_bug.cgi?id=188785
3047         https://trac.webkit.org/changeset/235129
3048
3049 2018-08-23  Daniel Bates  <dabates@apple.com>
3050
3051         [iOS] Test editing/undo/replace-text-in-node-preserving-markers-crash.html crashes
3052         https://bugs.webkit.org/show_bug.cgi?id=188898
3053
3054         Reviewed by Simon Fraser.
3055
3056         Not all document markers may have a dictation metadata on iOS.
3057
3058         Currently we assume that every marker has dictation alternatives (i.e. DocumentMarker::alternatives()
3059         can be called) when deleting a selection preserving document markers on iOS. However, only markers
3060         for dictation may have dictation alternatives. For example, document markers for misspelled words do
3061         not have dictation metadata by definition. Instead of assuming every marker has dictation alternatives
3062         on iOS we need to check the marker type to determine whether it has associated dictation metadata and
3063         invoke the appropriate DocumentMarkerController::addMarker() overload.
3064
3065         * dom/DocumentMarker.h:
3066         (WebCore::DocumentMarker::isDictation const): Added.
3067         * editing/CompositeEditCommand.cpp:
3068         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Only access DocumentMarker::alternatives()
3069         and add a dictation marker on iOS if the marker is a dictation marker.
3070
3071 2018-08-23  Mark Lam  <mark.lam@apple.com>
3072
3073         Move vmEntryGlobalObject() to VM from CallFrame.
3074         https://bugs.webkit.org/show_bug.cgi?id=188900
3075         <rdar://problem/43655753>
3076
3077         Reviewed by Michael Saboff.
3078
3079         No new tests needed because this patch does not introduce new functionality.
3080
3081         * bindings/js/JSCustomXPathNSResolver.cpp:
3082         (WebCore::JSCustomXPathNSResolver::create):
3083         * bindings/js/JSDOMGlobalObject.cpp:
3084         (WebCore::callerGlobalObject):
3085         (WebCore::toJSDOMGlobalObject): Deleted.
3086         * bindings/js/JSDOMWindowBase.cpp:
3087         (WebCore::firstDOMWindow):
3088         * bridge/c/c_utility.cpp:
3089         (JSC::Bindings::convertValueToNPVariant):
3090         * bridge/objc/WebScriptObject.mm:
3091         (WebCore::addExceptionToConsole):
3092         * bridge/objc/objc_instance.mm:
3093         (ObjcInstance::moveGlobalExceptionToExecState):
3094         * bridge/objc/objc_runtime.mm:
3095         (JSC::Bindings::convertValueToObjcObject):
3096         * bridge/objc/objc_utility.mm:
3097         (JSC::Bindings::convertValueToObjcValue):
3098         * testing/Internals.cpp:
3099         (WebCore::Internals::cloneArrayBuffer):
3100
3101 2018-08-23  Andy Estes  <aestes@apple.com>
3102
3103         [Apple Pay] Introduce Apple Pay JS v4 on iOS 12 and macOS Mojave
3104         https://bugs.webkit.org/show_bug.cgi?id=188829
3105
3106         Reviewed by Tim Horton.
3107
3108         Test: http/tests/ssl/applepay/ApplePaySessionV4.html
3109
3110         * Configurations/FeatureDefines.xcconfig:
3111         * testing/MockPaymentCoordinator.cpp:
3112         (WebCore::MockPaymentCoordinator::supportsVersion):
3113
3114 2018-08-23  Devin Rousso  <drousso@apple.com>
3115
3116         Web Inspector: support breakpoints for timers and animation-frame events
3117         https://bugs.webkit.org/show_bug.cgi?id=188778
3118
3119         Reviewed by Brian Burg.
3120
3121         The original implementation of "instrumentation" breakpoints relied upon the frontend
3122         sending somewhat arbitrary strings when enabling breakpoints for specific events. As an
3123         example, setting a breakpoint for `requestAnimationFrame` expects `"animationFrameFired"`
3124         as the string, which doesn't make much sense. This patch removes the usage of these strings
3125         and instead expects the agent to implement a method that matches what is happening.
3126
3127         Tests: inspector/dom-debugger/event-animation-frame-breakpoints.html
3128                inspector/dom-debugger/event-listener-breakpoints.html
3129                inspector/dom-debugger/event-timer-breakpoints.html
3130
3131         * inspector/InspectorInstrumentation.h:
3132         (WebCore::InspectorInstrumentation::willFireTimer):
3133         * inspector/InspectorInstrumentation.cpp:
3134         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
3135         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
3136         (WebCore::InspectorInstrumentation::willFireTimerImpl):
3137         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
3138         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
3139         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
3140         (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded): Deleted.
3141
3142         * inspector/agents/InspectorDOMDebuggerAgent.h:
3143         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
3144         (WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint): Added.
3145         (WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint): Added.
3146         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
3147         (WebCore::InspectorDOMDebuggerAgent::willFireTimer): Added.
3148         (WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame): Added.
3149         (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Deleted.
3150         (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Deleted.
3151         (WebCore::InspectorDOMDebuggerAgent::setBreakpoint): Deleted.
3152         (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Deleted.
3153         (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Deleted.
3154         (WebCore::InspectorDOMDebuggerAgent::removeBreakpoint): Deleted.
3155         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): Deleted.
3156         Unify the event listener and instrumentation breakpoint commands into a single method,
3157         `setEventBreakpoint`, that takes in both an `EventBreakpointType` and `eventName`.
3158
3159         * page/DOMTimer.cpp:
3160         (WebCore::DOMTimer::fired):
3161
3162 2018-08-23  Aditya Keerthi  <akeerthi@apple.com>
3163
3164         [iOS] Support the inputmode attribute on contenteditable elements
3165         https://bugs.webkit.org/show_bug.cgi?id=188878
3166
3167         Reviewed by Ryosuke Niwa.
3168
3169         The inputmode attribute should apply to contenteditable elements, in addition to
3170         textfield inputs and textareas.
3171
3172         Moved the inputmode attribute from HTMLInputElement.idl and
3173         HTMLTextAreaElement.idl to HTMLElement.idl to reflect the specification.
3174
3175         Also moved all logic to convert between the InputMode enum and string values
3176         into InputMode.cpp to avoid exposing unnecessary details to WebKit. Furthermore,
3177         InputMode::Auto was renamed to InputMode::Unspecified to avoid confusion with the
3178         specification.
3179
3180         Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
3181
3182         Tests: fast/forms/inputmode-attribute-contenteditable.html
3183                fast/forms/inputmode-attribute-input.html
3184                fast/forms/inputmode-attribute-textarea.html
3185
3186         * Sources.txt:
3187         * WebCore.xcodeproj/project.pbxproj:
3188         * html/HTMLElement.cpp:
3189         (WebCore::HTMLElement::canonicalInputMode const):
3190         (WebCore::HTMLElement::inputMode const):
3191         (WebCore::HTMLElement::setInputMode):
3192         * html/HTMLElement.h:
3193         * html/HTMLElement.idl:
3194         * html/HTMLInputElement.idl:
3195         * html/HTMLTextAreaElement.idl:
3196         * html/HTMLTextFormControlElement.cpp:
3197         * html/HTMLTextFormControlElement.h:
3198         * html/InputMode.cpp: Renamed from Source/WebCore/html/InputModeNames.cpp.
3199         (WebCore::inputModeForAttributeValue):
3200         (WebCore::stringForInputMode):
3201         * html/InputMode.h: Renamed from Source/WebCore/html/InputModeNames.h.
3202
3203 2018-08-23  Eric Carlson  <eric.carlson@apple.com>
3204
3205         [MediaStream] Store video preset sizes in a map
3206         https://bugs.webkit.org/show_bug.cgi?id=188866
3207         <rdar://problem/43622643>
3208
3209         Reviewed by Youenn Fablet.
3210
3211         No new tests, tested manually.
3212
3213         * platform/mediastream/mac/AVVideoCaptureSource.h:
3214         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3215         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
3216         (WebCore::AVVideoCaptureSource::initializeCapabilities):
3217         (WebCore::AVVideoCaptureSource::sizeForPreset):
3218         (WebCore::AVVideoCaptureSource::setPreset):
3219         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
3220         (WebCore::sizeForPreset): Deleted.
3221         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions const): Deleted.
3222
3223 2018-08-23  Ryan Haddad  <ryanhaddad@apple.com>
3224
3225         Unreviewed, attempt to fix the build after r235230.
3226
3227         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
3228
3229 2018-08-23  Youenn Fablet  <youenn@apple.com>
3230
3231         Update libwebrtc up to 984f1a80c0
3232         https://bugs.webkit.org/show_bug.cgi?id=188745
3233         <rdar://problem/43539177>
3234
3235         Reviewed by Eric Carlson.
3236
3237         Updated implementation according new webrtc backend.
3238         Instead of modifying libwebrtc header files, we disable unused parameter warning for such headers included in WebCore.
3239         WebCore implementation is updated according new webrtc API, mostly AddRef/Release.
3240         RealtimeOutgoingVideoSource now uses a pixel convolver to convert RGB pixel buffers as I420.
3241
3242         Covered by existing tests.
3243
3244         * CMakeLists.txt:
3245         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
3246         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3247         (WebCore::LibWebRTCMediaEndpoint::addTrack):
3248         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
3249         (WebCore::fillEncodingParameters):
3250         (WebCore::fillRtpParameters):
3251         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3252         (WebCore::LibWebRTCMediaEndpoint::Release const):
3253         * WebCore.xcodeproj/project.pbxproj:
3254         * platform/mediastream/RealtimeIncomingAudioSource.h:
3255         * platform/mediastream/RealtimeIncomingVideoSource.h:
3256         * platform/mediastream/RealtimeMediaSource.cpp:
3257         (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
3258         (WebCore::RealtimeMediaSource::supportsConstraint const):
3259         (WebCore::RealtimeMediaSource::supportsConstraints):
3260         * platform/mediastream/RealtimeOutgoingAudioSource.h:
3261         * platform/mediastream/RealtimeOutgoingVideoSource.h:
3262         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
3263         (WebCore::GStreamerVideoDecoder::newSampleCallback):
3264         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
3265         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
3266         (WebCore::GStreamerVideoEncoder::newSampleCallback):
3267         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3268         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
3269         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3270         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3271         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3272         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
3273         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
3274         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
3275         (WebCore::ConvertToI420):
3276         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
3277         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
3278         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm: Added.
3279         (WebCore::RealtimeOutgoingVideoSourceCocoa::convertToYUV):
3280         * testing/MockLibWebRTCPeerConnection.cpp:
3281         (WebCore::MockLibWebRTCPeerConnection::AddTrack):
3282         * testing/MockLibWebRTCPeerConnection.h:
3283         (WebCore::MockRtpSender::GetParameters):
3284         (WebCore::MockRtpSender::SetParameters):
3285
3286 2018-08-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3287
3288         [Attachment Support] Attachment elements don't appear in drag images on macOS
3289         https://bugs.webkit.org/show_bug.cgi?id=188823
3290         <rdar://problem/43616378>
3291
3292         Reviewed by Tim Horton.
3293
3294         Currently, attachment elements don't show up in the drag image snapshot on macOS. This is because only the
3295         "Selection" phase is painted when generating a drag image on macOS, and many replaced renderers (with some
3296         exceptions, such as RenderImage) only paint visible content during the "Foreground" phase. To fix this, we
3297         override RenderAttachment::paintReplaced to paint the attachment in the case where the Selection phase is being
3298         painted.
3299
3300         Tests:  WKAttachmentTestsMac.DragAttachmentAsFilePromise
3301                 WKAttachmentTests.MoveAttachmentElementAsIconByDragging
3302
3303         * rendering/RenderAttachment.cpp:
3304         (WebCore::RenderAttachment::paintReplaced):
3305         * rendering/RenderAttachment.h:
3306         * rendering/RenderThemeMac.mm:
3307         (WebCore::titleTextColorForAttachment):
3308         (WebCore::AttachmentLayout::layOutTitle):
3309
3310         Plumb an AttachmentLayoutStyle (i.e. NonSelected or Selected) to AttachmentLayout, and use this bit when
3311         determining the title text color, as well whether to paint backgrounds for the icon and title.
3312
3313         (WebCore::AttachmentLayout::AttachmentLayout):
3314         (WebCore::RenderThemeMac::attachmentIntrinsicSize const):
3315         (WebCore::RenderThemeMac::attachmentBaseline const):
3316         (WebCore::paintAttachmentIconBackground):
3317         (WebCore::paintAttachmentTitleBackground):
3318
3319         Bail from painting backgrounds if a selected style is used for the attachment.
3320
3321         (WebCore::RenderThemeMac::paintAttachment):
3322
3323         Rather than check the RenderAttachment's selection state when determining whether to paint with a non-selected
3324         or selected style, only use selected style if the RenderAttachment has a selection _and_ the painting phase is
3325         not "Selection". While this sounds extremely counter-intuitive, the "Selection" painting phase refers to
3326         painting the selected foreground content _without_ including any part of the selection highlight.
3327
3328 2018-08-23  Zalan Bujtas  <zalan@apple.com>
3329
3330         [LFC][Floating] Decouple the incoming floats and floats already placed in the list
3331         https://bugs.webkit.org/show_bug.cgi?id=188886
3332
3333         Reviewed by Antti Koivisto.
3334
3335         This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.
3336
3337         1. Introduce FloatBox class for the incoming floats (This will need to be renamed when adding support for avoidance -incoming box is actually not a float).
3338         2. Use the existing FloatState::FloatItem class for placed floats.
3339
3340         * Sources.txt:
3341         * WebCore.xcodeproj/project.pbxproj:
3342         * layout/LayoutUnits.h:
3343         * layout/Verification.cpp:
3344         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
3345         * layout/displaytree/DisplayBox.h:
3346         * layout/floats/FloatBox.cpp: Added.
3347         (WebCore::Layout::FloatBox::FloatBox):
3348         (WebCore::Layout::FloatBox::initializePosition):
3349         (WebCore::Layout::FloatBox::isLeftAligned const):
3350         (WebCore::Layout::FloatBox::setLeft):
3351         (WebCore::Layout::FloatBox::setTopLeft):
3352         (WebCore::Layout::FloatBox::resetVertically):
3353         (WebCore::Layout::FloatBox::resetHorizontally):
3354         (WebCore::Layout::FloatBox::topLeftInContainingBlock const):
3355         * layout/floats/FloatBox.h: Copied from Source/WebCore/layout/floats/FloatingContext.h.
3356         (WebCore::Layout::FloatBox::top const):
3357         (WebCore::Layout::FloatBox::left const):
3358         (WebCore::Layout::FloatBox::marginTop const):
3359         (WebCore::Layout::FloatBox::marginLeft const):
3360         (WebCore::Layout::FloatBox::marginBottom const):
3361         (WebCore::Layout::FloatBox::marginRight const):
3362         (WebCore::Layout::FloatBox::rectWithMargin const):
3363         (WebCore::Layout::FloatBox::setTop):
3364         * layout/floats/FloatingContext.cpp:
3365         (WebCore::Layout::FloatingPair::verticalPosition const):
3366         (WebCore::Layout::begin):
3367         (WebCore::Layout::FloatingContext::positionForFloat const):
3368         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3369         (WebCore::Layout::FloatingContext::floatingPosition const):
3370         (WebCore::Layout::FloatingPair::horiztonalPosition const):
3371         (WebCore::Layout::FloatingPair::bottom const):
3372         (WebCore::Layout::Iterator::Iterator):
3373         (WebCore::Layout::Iterator::operator++):
3374         (WebCore::Layout::Iterator::set):
3375         (WebCore::Layout::FloatingContext::initialVerticalPosition const): Deleted.
3376         (WebCore::Layout::FloatingContext::alignWithContainingBlock const): Deleted.
3377         (WebCore::Layout::FloatingContext::alignWithFloatings const): Deleted.
3378         (WebCore::Layout::FloatingContext::toContainingBlock const): Deleted.
3379         * layout/floats/FloatingContext.h:
3380         * layout/floats/FloatingState.h:
3381         (WebCore::Layout::FloatingState::root const):
3382         (WebCore::Layout::FloatingState::layoutContext const):
3383
3384 2018-08-23  Zan Dobersek  <zdobersek@igalia.com>
3385
3386         [CoordGraphics] Remove the remaining CoordinatedGraphicsLayerState cruft
3387         https://bugs.webkit.org/show_bug.cgi?id=188881
3388
3389         Reviewed by Carlos Garcia Campos.
3390
3391         Remove what's left of CoordinatedGraphicsLayerState usage in the
3392         CoordinatedGraphics subsystem. In CoordinatedGraphicsLayer, this means
3393         dropping the m_layerState member variable since at this point it is not
3394         used anymore in any capacity. Affected helper methods and member
3395         variables are also removed where possible.
3396
3397         The syncLayerState() method on the CoordinatedGraphicsLayerClient
3398         interface is adjusted to not accept any parameters. Client should just
3399         mark frame synchronization as required while the layer state is now
3400         managed differently.
3401
3402         Instead of the CoordinatedLayerID (which is removed) the
3403         Nicosia::PlatformLayer::LayerID alias is introduced as a layer ID type,
3404         aliased to the uint64_t type.
3405
3406         CoordinatedGraphicsState.h file is rid of all structs except the
3407         basic CoordinatedGraphicsState struct that at this point contains only
3408         a reference to the Nicosia::Scene object. This will be further
3409         simplified in the patches that follow.
3410
3411         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
3412         (Nicosia::PlatformLayer::id const):
3413         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3414         (WebCore::CoordinatedGraphicsLayer::didChangeAnimations):
3415         (WebCore::CoordinatedGraphicsLayer::didChangeChildren):
3416         (WebCore::CoordinatedGraphicsLayer::didChangeFilters):
3417         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
3418         (WebCore::CoordinatedGraphicsLayer::didChangeGeometry):
3419         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
3420         (WebCore::CoordinatedGraphicsLayer::setPosition):
3421         (WebCore::CoordinatedGraphicsLayer::setAnchorPoint):
3422         (WebCore::CoordinatedGraphicsLayer::setSize):
3423         (WebCore::CoordinatedGraphicsLayer::setTransform):
3424         (WebCore::CoordinatedGraphicsLayer::setChildrenTransform):
3425         (WebCore::CoordinatedGraphicsLayer::setPreserves3D):
3426         (WebCore::CoordinatedGraphicsLayer::setMasksToBounds):
3427         (WebCore::CoordinatedGraphicsLayer::setDrawsContent):
3428         (WebCore::CoordinatedGraphicsLayer::setContentsVisible):
3429         (WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
3430         (WebCore::CoordinatedGraphicsLayer::setBackfaceVisibility):
3431         (WebCore::CoordinatedGraphicsLayer::setOpacity):
3432         (WebCore::CoordinatedGraphicsLayer::setContentsRect):
3433         (WebCore::CoordinatedGraphicsLayer::setContentsTileSize):
3434         (WebCore::CoordinatedGraphicsLayer::setContentsTilePhase):
3435         (WebCore::CoordinatedGraphicsLayer::setContentsToSolidColor):
3436         (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
3437         (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
3438         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
3439         (WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer):
3440         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplay):
3441         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect):
3442         (WebCore::CoordinatedGraphicsLayer::setDebugBorder):
3443         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3444         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
3445         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
3446         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
3447         (WebCore::toCoordinatedLayerID): Deleted.
3448         (WebCore::CoordinatedGraphicsLayer::didChangeLayerState): Deleted.
3449         (WebCore::CoordinatedGraphicsLayer::syncChildren): Deleted.
3450         (WebCore::CoordinatedGraphicsLayer::syncFilters): Deleted.
3451         (WebCore::CoordinatedGraphicsLayer::syncLayerState): Deleted.
3452         (WebCore::CoordinatedGraphicsLayer::syncAnimations): Deleted.
3453         (WebCore::CoordinatedGraphicsLayer::resetLayerState): Deleted.
3454         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3455         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3456         (): Deleted.
3457         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState): Deleted.
3458         (WebCore::CoordinatedGraphicsLayerState::hasPendingChanges const): Deleted.
3459
3460 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
3461
3462         [CoordGraphics] Drop old-school PlatformLayer management in CoordinatedGraphicsLayer
3463         https://bugs.webkit.org/show_bug.cgi?id=188850
3464
3465         Reviewed by Michael Catanzaro.
3466
3467         Remove the m_platformLayer member from the CoordinatedGraphicsLayer
3468         class as it's been unused since the rework in r235165.
3469
3470         The CoordinatedGraphicsLayer::syncPlatformLayer() helper method and the
3471         related member variable can both be removed as well. On the
3472         CoordinatedGraphicsLayerState class, we can remove the obsolete
3473         flags and the TextureMapperPlatformLayerProxy member variable that's
3474         unused now that such objects are handled through the Nicosia impl class.
3475
3476         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3477         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
3478         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
3479         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
3480         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
3481         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3482         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer): Deleted.
3483         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3484         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3485         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
3486
3487 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
3488
3489         [CoordGraphics] Remove TiledBackingStoreClient inheritance from CoordinatedGraphicsLayer
3490         https://bugs.webkit.org/show_bug.cgi?id=188849
3491
3492         Reviewed by Michael Catanzaro.
3493
3494         Remove the TiledBackingStoreClient inheritance from the
3495         CoordinatedGraphicsLayer class since it's not used anymore after changes
3496         made in r235165.
3497
3498         Related TiledBackingStore objects on this class, along with tile state
3499         tracking member variables on the CoordinatedGraphicsLayerState class,
3500         are also removed.
3501
3502         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3503         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
3504         (WebCore::CoordinatedGraphicsLayer::resetLayerState):
3505         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
3506         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreHasPendingTileCreation): Deleted.
3507         (WebCore::CoordinatedGraphicsLayer::createTile): Deleted.
3508         (WebCore::CoordinatedGraphicsLayer::updateTile): Deleted.
3509         (WebCore::CoordinatedGraphicsLayer::removeTile): Deleted.
3510         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3511         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3512         (WebCore::CoordinatedGraphicsLayerState::hasPendingChanges const):
3513
3514 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
3515
3516         [CoordGraphics] Remove CoordinatedImageBacking and related functionality
3517         https://bugs.webkit.org/show_bug.cgi?id=188847
3518
3519         Reviewed by Michael Catanzaro.
3520
3521         Remove the CoordinatedImageBacking class and its intertwining use in the
3522         CoordinatedGraphics system.
3523
3524         Remove the now-unused m_coordinatedImageBacking member variable from the
3525         CoordinatedGraphicsLayer class, along with CoordinatedImageBacking::Host
3526         inheritance. Various related helper methods are also removed.
3527
3528         In CoordinatedGraphicsState and CoordinatedGraphicsLayerState classes,
3529         we are able to drop different CoordinatedImageBacking-related state
3530         values that are not used anymore.
3531
3532         * platform/TextureMapper.cmake:
3533         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3534         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
3535         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
3536         (WebCore::CoordinatedGraphicsLayer::setContentsToImage):
3537         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
3538         (WebCore::CoordinatedGraphicsLayer::didChangeImageBacking): Deleted.
3539         (WebCore::CoordinatedGraphicsLayer::syncImageBacking): Deleted.
3540         (WebCore::CoordinatedGraphicsLayer::imageBackingVisible): Deleted.
3541         (WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded): Deleted.
3542         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3543         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3544         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
3545         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: Removed.
3546         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h: Removed.
3547
3548 2018-08-22  Ryosuke Niwa  <rniwa@webkit.org>
3549
3550         Store RefPtr in FocusNavigationScope
3551         https://bugs.webkit.org/show_bug.cgi?id=188864
3552
3553         Reviewed by Simon Fraser.
3554
3555         Use RefPtr to store the root node of a tree scope and a slot element instead of a reference and a raw pointer.
3556
3557         * page/FocusController.cpp:
3558         (WebCore::FocusNavigationScope::parentInScope const):
3559         (WebCore::FocusNavigationScope::firstNodeInScope const):
3560         (WebCore::FocusNavigationScope::lastNodeInScope const):
3561         (WebCore::FocusNavigationScope::FocusNavigationScope):
3562         (WebCore::FocusNavigationScope::owner const):
3563
3564 2018-08-22  Jiewen Tan  <jiewen_tan@apple.com>
3565
3566         Unreviewed, update "Web Authentication" from "Under Consideration" to "In Development"
3567         in features.json.
3568
3569         * features.json:
3570
3571 2018-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3572
3573         [Attachment Support] Support dragging attachment elements out as files on macOS
3574         https://bugs.webkit.org/show_bug.cgi?id=181294
3575         <rdar://problem/36298801>
3576
3577         Reviewed by Tim Horton.
3578
3579         Serialize a dragged attachment element as a web archive on macOS. This allows us to move attachment elements
3580         around a document by dragging, without performing a file upload upon every drop. Ideally, we should do this on
3581         iOS as well, but this currently causes attachment data to go missing; further investigation to fix this for iOS
3582         is tracked in <https://bugs.webkit.org/show_bug.cgi?id=181514>.
3583
3584         Tests:  WKAttachmentTestsMac.DragAttachmentAsFilePromise
3585                 WKAttachmentTests.MoveAttachmentElementAsIconByDragging
3586
3587         * editing/cocoa/EditorCocoa.mm:
3588         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
3589
3590 2018-08-22  Aditya Keerthi  <akeerthi@apple.com>
3591
3592         [iOS] Add support for the inputmode attribute
3593         https://bugs.webkit.org/show_bug.cgi?id=183621
3594
3595         Reviewed by Tim Horton.
3596
3597         Added the inputmode attribute to the HTMLInputElement and HTMLTextAreaElement IDL
3598         files. The possible values for the attribute are specified in InputModeNames.
3599
3600         Test: fast/forms/inputmode-attribute.html
3601
3602         * Sources.txt:
3603         * WebCore.xcodeproj/project.pbxproj:
3604         * html/HTMLAttributeNames.in:
3605         * html/HTMLInputElement.idl:
3606         * html/HTMLTextAreaElement.idl:
3607         * html/HTMLTextFormControlElement.cpp:
3608         (WebCore::HTMLTextFormControlElement::inputMode const):
3609         (WebCore::HTMLTextFormControlElement::setInputMode):
3610         * html/HTMLTextFormControlElement.h:
3611         * html/InputModeNames.cpp: Added.
3612         (WebCore::InputModeNames::text):
3613         (WebCore::InputModeNames::tel):
3614         (WebCore::InputModeNames::url):
3615         (WebCore::InputModeNames::email):
3616         (WebCore::InputModeNames::numeric):
3617         (WebCore::InputModeNames::decimal):
3618         (WebCore::InputModeNames::search):
3619         * html/InputModeNames.h: Added.
3620
3621 2018-08-22  Eric Carlson  <eric.carlson@apple.com>
3622
3623         Log more often during AirPlay state changes
3624         https://bugs.webkit.org/show_bug.cgi?id=188854
3625
3626         Always log some infrequent but important AirPlay state changes to make debugging easier.
3627
3628         Reviewed by Jer Noble.
3629
3630         * html/HTMLMediaElement.cpp:
3631         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Low always.
3632         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
3633         (WebCore::HTMLMediaElement::setWirelessPlaybackTarget): Ditto.
3634         (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget): Ditto.
3635
3636 2018-08-21  Ryosuke Niwa  <rniwa@webkit.org>
3637
3638         Focus navigation order in slot fallback contents is wrong
3639         https://bugs.webkit.org/show_bug.cgi?id=178001
3640         <rdar://problem/42842997>
3641
3642         Reviewed by Antti Koivisto.
3643
3644         The bug here is that when a slot uses its fallback content, the fallback content's focus order doesn't get
3645         grouped by that of the slot. Consider the following DOM tree:
3646
3647         - ShadowRoot
3648             - div tabindex = 2
3649             - slot tabindex = 1
3650                 - span tabindex = 3
3651
3652         In this example, the sequential focus navigation should be slot, span, then div. Even though span has tabindex
3653         order of 3, which is lower than that of div, the fallback content of the slot should be grouped together
3654         before the focus moves out of the slot content.
3655
3656         In WebKit, this concept of grouping elements for the sequential focus navigation ordering is implemeneted
3657         as FocusNavigationScope. Both ShadowRoot and HTMLSlotElement are treated as a focus scope owner but we had
3658         a bug that a slot element which uses its fallback content was not treated as a focus scope owner.
3659
3660         This patch addresses the bug by treating a slot wich uses its fallback content as a focus scope owner.
3661
3662         Test: fast/shadow-dom/focus-navigation-across-slots.html
3663
3664         * page/FocusController.cpp:
3665         (WebCore::isFocusScopeOwner): Treat a slot elment hs a focus scope owner regardless of whether it has assigned
3666         nodes or not.
3667         (WebCore::FocusNavigationScope::SlotKind): Added.
3668         (WebCore::FocusNavigationScope::m_slotKind): Added.
3669         (WebCore::FocusNavigationScope::parentInScope const): Return null if `node` is a child of the slot element for
3670         which this FocusNavigationScope is created (i.e. `node` is slot's fallback content).
3671         (WebCore::FocusNavigationScope::firstNodeInScope const): Return the first child node when this
3672         FocusNavigationScope is for a slot element using its fallback content.
3673         (WebCore::FocusNavigationScope::lastNodeInScope const): Ditto for the last child.
3674         (WebCore::FocusNavigationScope::FocusNavigationScope):
3675         (WebCore::FocusNavigationScope::scopeOf): The scope of a child of a slot element which uses its fallback content
3676         is its slot element (i.e. the current node is a fallback content). We can't simply check the current node is
3677         a slot element which uses a fallback content since the scope of a slot element is the parent scope. e.g. its
3678         tree scope like ShadowRoot or Document inside which this slot element appears.
3679         (WebCore::FocusNavigationScope::scopeOwnedByScopeOwner): Create the appropriate FocusNavigationScope based on
3680         whether the slot element has assigned or it uses its fallback content.
3681
3682 2018-08-22  David Kilzer  <ddkilzer@apple.com>
3683
3684         Move files in WebCore project to match Xcode folder structure
3685         <https://webkit.org/b/188851>
3686
3687         Reviewed by Tim Horton.
3688
3689         * Scripts/LocalizableStrings.pm: Renamed from Source/WebCore/LocalizableStrings.pm.
3690         * Scripts/extract-localizable-strings.pl: Renamed from Source/WebCore/extract-localizable-strings.pl.
3691         * WebCore.xcodeproj/project.pbxproj: Update to match new location of files.
3692         * platform/audio/cocoa/WebAudioBufferList.cpp: Renamed from Source/WebCore/platform/audio/WebAudioBufferList.cpp.
3693         * platform/audio/cocoa/WebAudioBufferList.h: Renamed from Source/WebCore/platform/audio/WebAudioBufferList.h.
3694         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h.
3695         * platform/ios/wak/WAKViewInternal.h: Renamed from Source/WebCore/platform/WAKViewInternal.h.
3696           Also fix 3 webkit-style warnings.
3697
3698 2018-08-22  Zalan Bujtas  <zalan@apple.com>
3699
3700         [LFC][Floating] Move files to a dedicated directory.
3701         https://bugs.webkit.org/show_bug.cgi?id=188846
3702
3703         Reviewed by Simon Fraser.
3704
3705         layout/Float* -> layout/floats
3706
3707         * WebCore.xcodeproj/project.pbxproj:
3708         * layout/floatformatting/FloatingContext.cpp: Renamed from Source/WebCore/layout/FloatingContext.cpp.
3709         (WebCore::Layout::FloatingPair::isEmpty const):
3710         (WebCore::Layout::FloatingPair::verticalPosition const):
3711         (WebCore::Layout::Iterator::operator* const):
3712         (WebCore::Layout::begin):
3713         (WebCore::Layout::end):
3714         (WebCore::Layout::FloatingContext::FloatingContext):
3715         (WebCore::Layout::FloatingContext::positionForFloat const):
3716         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3717         (WebCore::Layout::FloatingContext::floatingPosition const):
3718         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
3719         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
3720         (WebCore::Layout::FloatingContext::alignWithFloatings const):
3721         (WebCore::Layout::FloatingContext::toContainingBlock const):
3722         (WebCore::Layout::FloatingPair::FloatingPair):
3723         (WebCore::Layout::FloatingPair::left const):
3724         (WebCore::Layout::FloatingPair::right const):
3725         (WebCore::Layout::FloatingPair::intersects const):
3726         (WebCore::Layout::FloatingPair::operator == const):
3727         (WebCore::Layout::FloatingPair::bottom const):
3728         (WebCore::Layout::Iterator::Iterator):
3729         (WebCore::Layout::previousFloatingIndex):
3730         (WebCore::Layout::Iterator::operator++):
3731         (WebCore::Layout::Iterator::set):
3732         (WebCore::Layout::Iterator::operator== const):
3733         (WebCore::Layout::Iterator::operator!= const):
3734         * layout/floatformatting/FloatingContext.h: Renamed from Source/WebCore/layout/FloatingContext.h.
3735         (WebCore::Layout::FloatingContext::floatingState const):
3736         (WebCore::Layout::FloatingContext::layoutContext const):
3737         * layout/floatformatting/FloatingState.cpp: Renamed from Source/WebCore/layout/FloatingState.cpp.
3738         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
3739         (WebCore::Layout::FloatingState::FloatingState):
3740         (WebCore::Layout::belongsToThisFloatingContext):
3741         (WebCore::Layout::FloatingState::remove):
3742         (WebCore::Layout::FloatingState::append):
3743         (WebCore::Layout::FloatingState::bottom const):
3744         * layout/floatformatting/FloatingState.h: Renamed from Source/WebCore/layout/FloatingState.h.
3745         (WebCore::Layout::FloatingState::create):
3746         (WebCore::Layout::FloatingState::isEmpty const):
3747         (WebCore::Layout::FloatingState::FloatItem::layoutBox const):
3748         (WebCore::Layout::FloatingState::FloatItem::containingBlock const):
3749         (WebCore::Layout::FloatingState::FloatItem::displayBox const):
3750         (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const):
3751         (WebCore::Layout::FloatingState::floats const):
3752         (WebCore::Layout::FloatingState::last const):
3753         (WebCore::Layout::FloatingState::layoutContext const):
3754         (WebCore::Layout::FloatingState::root const):
3755         (WebCore::Layout::FloatingState::leftBottom const):
3756         (WebCore::Layout::FloatingState::rightBottom const):
3757         (WebCore::Layout::FloatingState::bottom const):
3758
3759 2018-08-22  Rob Buis  <rbuis@igalia.com>
3760
3761         Fetch: Stop checking Request.integrity's value in no-cors mode
3762         https://bugs.webkit.org/show_bug.cgi?id=188802
3763
3764         Reviewed by Frédéric Wang.
3765
3766         Remove this check since it was removed from the spec.
3767
3768         Behavior matches Chrome and Firefox.
3769
3770         Test: http/tests/subresource-integrity/sri-fetch.js:
3771
3772         * Modules/fetch/FetchRequest.cpp:
3773         (WebCore::FetchRequest::initializeOptions):
3774
3775 2018-08-22  Youenn Fablet  <youenn@apple.com>
3776
3777         Mark MediaStream Recording API as under consideration
3778         https://bugs.webkit.org/show_bug.cgi?id=188822
3779
3780         Reviewed by Jon Lee.
3781
3782         * features.json:
3783
3784 2018-08-22  Ms2ger  <Ms2ger@igalia.com>
3785
3786         [GTK] Never return an uninitialized ImageGStreamer object.
3787         https://bugs.webkit.org/show_bug.cgi?id=188305
3788
3789         Reviewed by Philippe Normand.
3790
3791         The single caller was already checking for a null return value, so
3792         make that check actually do something. Also remove the null-check on
3793         the return value of image(), which asserted that it would never return
3794         null.
3795
3796         Test: fast/canvas/canvas-createPattern-video-loading.html
3797
3798         * platform/graphics/gstreamer/ImageGStreamer.h:
3799         (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created.
3800         (WebCore::ImageGStreamer::image): Return a reference.
3801         (WebCore::ImageGStreamer::rect): Always assert that m_image is present.
3802         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3803         (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature.
3804
3805 2018-08-22  Zalan Bujtas  <zalan@apple.com>
3806
3807         Add changes missing from r234925.
3808
3809         * layout/blockformatting/BlockMarginCollapse.cpp:
3810         (WebCore::Layout::isMarginTopCollapsedWithParent):
3811         (WebCore::Layout::isMarginBottomCollapsedThrough):
3812         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
3813
3814 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
3815
3816         [CoordGraphics] Switch to Nicosia::CompositionLayer state tracking
3817         https://bugs.webkit.org/show_bug.cgi?id=188693
3818
3819         Reviewed by Carlos Garcia Campos.
3820
3821         Populate Nicosia::CompositionLayer with additional LayerState member
3822         objects. For now we're using pending, staging and committed states,
3823         though it might be possible to narrow down these to just two.
3824
3825         Pending state contains state that will be moved to staging during the
3826         final steps of the next layer flush. flushState() method accumulates all
3827         state changes in the staging state, and also allows the caller to
3828         additionally perform flushing operations that are specific to backing
3829         store, image backing or content layer containers.
3830
3831         commitState() method moves staging state over into the committed state,
3832         again allowing user to pass a functor that receives the just-committed
3833         state and apply it to their composition engine.
3834
3835         Changes in state objects are done under a thread-safe lock. This might
3836         not be completely necessary at this point, but will be useful when
3837         additonal layer state updates will be coming from e.g. the scrolling
3838         thread. It might also make sense to tie in this lock use with the
3839         Nicosia::Scene lock in the future.
3840
3841         Nicosia::ContentLayerTextureMapperImpl is modified slightly to allow
3842         determining during flushes whether an update is pending. This is
3843         necessary for a special case in ThreadedCompositor where content (i.e.
3844         platform) layers like WebGL or video require an additional level of
3845         scene update coordination. This complete special case has to go through
3846         another review to see whether it's still necessary. Ideally we would be
3847         able to remove it.
3848
3849         CoordinatedGraphicsLayer is finally switched over to using
3850         Nicosia layer objects for state updates of any kind. This patch only
3851         adds all the necessary bits, but doesn't yet remove any of the existing
3852         code (but rather disables it temporarily, before it's removed).
3853
3854         Updating of simple state values is already in place. For backing stores,
3855         the flushCompositingStateForThisLayerOnly() method now takes care of
3856         preparing the backing store object if necessary as per layer state,
3857         while the updateContentBuffers() method is switched to operate with
3858         TiledBackingStore objects now kept on the BackingStoreTextureMapperImpl
3859         instance associated with that backing store. Helper methods like
3860         adjustContentsScale() and createBackingStore(), only called from the
3861         updateContentBuffers() method, are removed and the code there inlined.
3862
3863         For image-backed layers, the update is now done directly in
3864         the flushCompositingStateForThisLayerOnly() method, if necessary. The
3865         helper syncImageBacking() method is commented out in order to prevent
3866         double-painting of image buffers for now, but all this (along with the
3867         CoordinatedImageBacking logic in CompositingCoordinator) will be removed
3868         later.
3869
3870         For layers backed by platform layer objects, integration is relatively
3871         simple. setContentsToPlatformLayer() is changed to properly handle any
3872         passed-in platform layer object, and updatePlatformLayer() invokes the
3873         swapBuffersIfNeeded() method on the ContentLayerTextureMapperImpl object
3874         during each flush, if necessary.
3875
3876         In order to ensure any Nicosia-specific state update properly triggers
3877         a composition update, m_nicosia.performLayerUpdate is added and flipped
3878         to true during the flush in case of any state change. This then triggers
3879         a layer sync in the CompositingCoordinator object when the
3880         syncPendingStateChangesIncludingSubLayers() method is called. While no
3881         old-style layer state update is provided, it causes the necessary
3882         synchronization step that properly picks up the Nicosia-provided state
3883         changes. Once the old-style layer state tracking is removed, this method
3884         of update triggering will have to be updated as well.
3885
3886         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
3887         (Nicosia::CompositionLayer::flushState):
3888         (Nicosia::CompositionLayer::commitState):
3889         (Nicosia::CompositionLayer::accessCommitted):
3890         * platform/graphics/nicosia/NicosiaScene.h:
3891         * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp:
3892         (Nicosia::ContentLayerTextureMapperImpl::flushUpdate):
3893         * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h:
3894         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3895         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
3896         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
3897         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
3898         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
3899         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3900         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
3901         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
3902         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
3903         (WebCore::CoordinatedGraphicsLayer::adjustContentsScale): Deleted.
3904         (WebCore::CoordinatedGraphicsLayer::createBackingStore): Deleted.
3905         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3906
3907 2018-08-22  David Kilzer  <ddkilzer@apple.com>
3908
3909         Remove stale file references in WebCore Xcode project
3910
3911         I manually removed these using Xcode and verified that there was
3912         a commit that removed the original files.
3913
3914         Found by tool created for Bug 188754: Tool to fix folders that
3915         should map to directories in Xcode project files.
3916
3917         * WebCore.xcodeproj/project.pbxproj:
3918         (dom/DOMExceptions.in): Removed in r219741.
3919         (Modules/modern-media-controls/start-button.js):
3920         (Modules/modern-media-controls/volume-slider.css):
3921         (Modules/modern-media-controls/icon-button.css):
3922         (Modules/modern-media-controls/volume-slider.js):
3923         (Modules/modern-media-controls/macos-media-controls.js):
3924         (Modules/modern-media-controls/ios-inline-media-controls.css):
3925         (Modules/modern-media-controls/scrubber.css):
3926         (Modules/modern-media-controls/start-button.css):
3927         (Modules/modern-media-controls/scrubber.js):
3928         (Modules/modern-media-controls/icon-button.js):
3929         (Modules/modern-media-controls/macos-compact-inline-media-controls.css):
3930         (Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png):
3931         (Modules/modern-media-controls/images/iOS/start@1x.png):
3932         (Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png):
3933         (Modules/modern-media-controls/images/iOS/pause@2x.png):
3934         (Modules/modern-media-controls/images/iOS/play@3x.png):
3935         (Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png):
3936         (Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png):
3937         (Modules/modern-media-controls/images/iOS/pip-in@2x.png):
3938         (Modules/modern-media-controls/images/iOS/start@3x.png):
3939         (Modules/modern-media-controls/images/iOS/airplay@1x.png):
3940         (Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png):
3941         (Modules/modern-media-controls/images/iOS/slider-thumb@2x.png):
3942         (Modules/modern-media-controls/images/iOS/airplay@2x.png):
3943         (Modules/modern-media-controls/images/iOS/pause@3x.png):
3944         (Modules/modern-media-controls/images/iOS/pip-in@3x.png):
3945         (Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png):
3946         (Modules/modern-media-controls/images/iOS/pause@1x.png):
3947         (Modules/modern-media-controls/images/iOS/start@2x.png):
3948         (Modules/modern-media-controls/images/iOS/play@2x.png):
3949         (Modules/modern-media-controls/images/iOS/pip-in@1x.png):
3950         (Modules/modern-media-controls/images/iOS/play@1x.png):
3951         (Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@1x.png):
3952         (Modules/modern-media-controls/images/macOS/rewind@1x.png):
3953         (Modules/modern-media-controls/images/macOS/play@2x.png):
3954         (Modules/modern-media-controls/images/macOS/volume-mute@2x.png):
3955         (Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png):
3956         (Modules/modern-media-controls/images/macOS/volume@2x.png):
3957         (Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png):
3958         (Modules/modern-media-controls/images/macOS/volume-compact@2x.png):
3959         (Modules/modern-media-controls/images/macOS/start@2x.png):
3960         (Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png):
3961         (Modules/modern-media-controls/images/macOS/airplay@2x.png):
3962         (Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png):
3963         (Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png):
3964         (Modules/modern-media-controls/images/macOS/airplay@1x.png):
3965         (Modules/modern-media-controls/images/macOS/pip-in@1x.png):
3966         (Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png):
3967         (Modules/modern-media-controls/images/macOS/rewind@2x.png):
3968         (Modules/modern-media-controls/images/macOS/play-compact@1x.png):
3969         (Modules/modern-media-controls/images/macOS/media-selection-f