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