Need a mechanism to override navigator.userAgent
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Need a mechanism to override navigator.userAgent
4         https://bugs.webkit.org/show_bug.cgi?id=193762
5         <rdar://problem/47504939>
6
7         Reviewed by Brent Fulgham.
8
9         Added the ability to specify user agent string just for navigator.userAgent via DocumentLoader.
10
11         * loader/DocumentLoader.h:
12         (WebCore::DocumentLoader::setCustomJavaScriptUserAgent):
13         (WebCore::DocumentLoader::customJavaScriptUserAgent const):
14         * loader/FrameLoader.cpp:
15         (WebCore::FrameLoader::userAgentForJavaScript const):
16         * loader/FrameLoader.h:
17         * page/Navigator.cpp:
18         (WebCore::Navigator::userAgent const):
19
20 2019-01-25  Devin Rousso  <drousso@apple.com>
21
22         Web Inspector: provide a way to edit page settings on a remote target
23         https://bugs.webkit.org/show_bug.cgi?id=193813
24         <rdar://problem/47359510>
25
26         Reviewed by Joseph Pecoraro.
27
28         Test: inspector/page/overrideSetting.html
29
30         * page/Settings.yaml:
31         * Scripts/GenerateSettings.rb:
32         * Scripts/SettingsTemplates/Settings.cpp.erb:
33         * Scripts/SettingsTemplates/Settings.h.erb:
34         Add support for an `inspectorOverride` boolean value for each setting that will take
35         precedence over the actual `Setting`'s value when set.
36
37         * inspector/agents/InspectorPageAgent.h:
38         * inspector/agents/InspectorPageAgent.cpp:
39         (WebCore::InspectorPageAgent::disable):
40         (WebCore::InspectorPageAgent::overrideSetting): Added.
41
42         * inspector/InspectorFrontendHost.idl:
43         * inspector/InspectorFrontendHost.h:
44         * inspector/InspectorFrontendHost.cpp:
45         (WebCore::InspectorFrontendHost::isRemote const): Added.
46         * inspector/InspectorFrontendClient.h:
47         (WebCore::InspectorFrontendClient::isRemote const): Added.
48         * inspector/InspectorFrontendClientLocal.h:
49         (WebCore::InspectorFrontendClientLocal::isRemote const): Added.
50
51 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
52
53         Document::updateMainArticleElementAfterLayout() should be a no-op when no client depends on knowing the main article element
54         https://bugs.webkit.org/show_bug.cgi?id=193843
55
56         Reviewed by Zalan Bujtas.
57
58         * dom/Document.cpp:
59         (WebCore::Document::updateMainArticleElementAfterLayout):
60
61         This function currently does a bit of wasted work after every layout, on clients that don't listen to the
62         "significant rendered text" layout milestone and therefore don't need to guess the main article element. Simply
63         don't bother keeping the main article element up to date in this scenario by bailing from
64         FrameView::updateHasReachedSignificantRenderedTextThreshold if the client doesn't care about the significant
65         rendered text milestone.
66
67         * page/FrameView.cpp:
68         (WebCore::FrameView::updateHasReachedSignificantRenderedTextThreshold):
69
70 2019-01-25  Jer Noble  <jer.noble@apple.com>
71
72         <video> elements not in the DOM should be allowed to AirPlay
73         https://bugs.webkit.org/show_bug.cgi?id=193837
74         <rdar://42559491>
75
76         Reviewed by Eric Carlson.
77
78         Test: media/airplay-allows-buffering.html
79
80         Some websites will switch between <video> elements backed by MSE to one backed by
81         a media file in order to implement an AirPlay control. But when a <video> element is
82         removed from the DOM and paused, further buffering is blocked. For some ports (namely
83         Cocoa ones), this keeps AirPlay from engaging. Relax this buffering restriction for
84         elements who have been asked to play wirelessly, but whose wireless playback has not
85         started yet.
86
87         * html/MediaElementSession.cpp:
88         (WebCore::MediaElementSession::dataBufferingPermitted const):
89         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
90
91 2019-01-25  Keith Rollin  <krollin@apple.com>
92
93         Update Xcode projects with "Check .xcfilelists" build phase
94         https://bugs.webkit.org/show_bug.cgi?id=193790
95         <rdar://problem/47201374>
96
97         Reviewed by Alex Christensen.
98
99         Support for XCBuild includes specifying inputs and outputs to various
100         Run Script build phases. These inputs and outputs are specified as
101         .xcfilelist files. Once created, these .xcfilelist files need to be
102         kept up-to-date. In order to check that they are up-to-date or not,
103         add an Xcode build step that invokes an external script that performs
104         the checking. If the .xcfilelists are found to be out-of-date, update
105         them, halt the build, and instruct the developer to restart the build
106         with up-to-date files.
107
108         At this time, the checking and regenerating is performed only if the
109         WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
110         who want to use this facility can set this variable and test out the
111         checking/regenerating. Once it seems like there are no egregious
112         issues that upset a developer's workflow, we'll unconditionally enable
113         this facility.
114
115         No new tests since there should be no observable behavior difference.
116
117         * Scripts/check-xcfilelists.sh: Added.
118         * WebCore.xcodeproj/project.pbxproj:
119
120 2019-01-25  Joseph Pecoraro  <pecoraro@apple.com>
121
122         Web Inspector: Exclude Debugger Threads from CPU Usage values in Web Inspector
123         https://bugs.webkit.org/show_bug.cgi?id=193796
124         <rdar://problem/47532910>
125
126         Reviewed by Devin Rousso.
127
128         * page/ResourceUsageData.h:
129         * inspector/agents/InspectorCPUProfilerAgent.cpp:
130         (WebCore::InspectorCPUProfilerAgent::collectSample):
131         Show the CPU usage without debugger threads in the Web Inspector's timeline.
132
133         * page/ResourceUsageThread.h:
134         * page/cocoa/ResourceUsageThreadCocoa.mm:
135         (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
136         For OS(DARWIN) ports, when starting to observe resource usage,
137         we grab the mach_port_t of SamplingProfiler on the main thread
138         in a thread safe way. For our purposes (Web Inspector timelines),
139         this will be good enough to identify the SamplingProfiler thread
140         during timeline recording. The SamplingProfiler thread won't change
141         during a timeline recording and recording start/stops will never
142         miss the SamplingProfiler changing.
143
144         (WebCore::filterThreads):
145         (WebCore::threadSendRights):
146         (WebCore::threadSendRightsExcludingDebuggerThreads):
147         (WebCore::cpuUsage):
148         (WebCore::ResourceUsageThread::platformCollectCPUData):
149         Calculate CPU usage twice, the second time excluding some threads.
150
151         * page/linux/ResourceUsageThreadLinux.cpp:
152         (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
153         (WebCore::ResourceUsageThread::platformCollectCPUData):
154         Stubs for linux ports.
155
156 2019-01-25  Zalan Bujtas  <zalan@apple.com>
157
158         Remove FrameView::m_significantRenderedTextMilestonePending
159         https://bugs.webkit.org/show_bug.cgi?id=193842
160
161         Reviewed by Wenson Hsieh.
162
163         Currently we keep processing the incoming text content until after the "SignificantRenderedTextMilestone" has been reached.
164         We can actually stop doing it right when the text content is above the threshold (regardless of whether all the conditions are met for the milestone).
165         This patch also ensures that we don't update Document::m_mainArticleElement once the threshold is reached.
166
167         * page/FrameView.cpp:
168         (WebCore::FrameView::resetLayoutMilestones):
169         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
170         (WebCore::FrameView::hasReachedSignificantRenderedTextThreashold):
171         (WebCore::FrameView::qualifiesAsSignificantRenderedText const):
172         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
173         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded): Deleted.
174         * page/FrameView.h:
175
176 2019-01-25  Keith Rollin  <krollin@apple.com>
177
178         Update Xcode projects with "Apply Configuration to XCFileLists" build target
179         https://bugs.webkit.org/show_bug.cgi?id=193781
180         <rdar://problem/47201153>
181
182         Reviewed by Alex Christensen.
183
184         Part of generating the .xcfilelists used as part of adopting XCBuild
185         includes running `make DerivedSources.make` from a standalone script.
186         It’s important for this invocation to have the same environment as
187         when the actual build invokes `make DerivedSources.make`. If the
188         environments are different, then the two invocations will provide
189         different results. In order to get the same environment in the
190         standalone script, have the script launch xcodebuild targeting the
191         "Apply Configuration to XCFileLists" build target, which will then
192         re-invoke our standalone script. The script is now running again, this
193         time in an environment with all workspace, project, target, xcconfig
194         and other environment variables established.
195
196         The "Apply Configuration to XCFileLists" build target accomplishes
197         this task via a small embedded shell script that consists only of:
198
199             eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
200
201         The process that invokes "Apply Configuration to XCFileLists" first
202         sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
203         evaluated and exports it into the shell environment. When xcodebuild
204         is invoked, it inherits the value of this variable and can `eval` the
205         contents of that variable. Our external standalone script can then set
206         WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
207         of command-line parameters needed to restart itself in the appropriate
208         state.
209
210         No new tests since there should be no observable behavior difference.
211
212         * WebCore.xcodeproj/project.pbxproj:
213
214 2019-01-25  Keith Rollin  <krollin@apple.com>
215
216         Update WebKitAdditions.xcconfig with correct order of variable definitions
217         https://bugs.webkit.org/show_bug.cgi?id=193793
218         <rdar://problem/47532439>
219
220         Reviewed by Alex Christensen.
221
222         XCBuild changes the way xcconfig variables are evaluated. In short,
223         all config file assignments are now considered in part of the
224         evaluation. When using the new build system and an .xcconfig file
225         contains multiple assignments of the same build setting:
226
227         - Later assignments using $(inherited) will inherit from earlier
228           assignments in the xcconfig file.
229         - Later assignments not using $(inherited) will take precedence over
230           earlier assignments. An assignment to a more general setting will
231           mask an earlier assignment to a less general setting. For example,
232           an assignment without a condition ('FOO = bar') will completely mask
233           an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
234
235         This affects some of our .xcconfig files, in that sometimes platform-
236         or sdk-specific definitions appear before the general definitions.
237         Under the new evaluations rules, the general definitions alway take
238         effect because they always overwrite the more-specific definitions. The
239         solution is to swap the order, so that the general definitions are
240         established first, and then conditionally overwritten by the
241         more-specific definitions.
242
243         No new tests since there should be no observable behavior difference.
244
245         * Configurations/Base.xcconfig:
246         * Configurations/Version.xcconfig:
247
248 2019-01-25  Keith Rollin  <krollin@apple.com>
249
250         Update existing .xcfilelists
251         https://bugs.webkit.org/show_bug.cgi?id=193791
252         <rdar://problem/47201706>
253
254         Reviewed by Alex Christensen.
255
256         Many .xcfilelist files were added in r238824 in order to support
257         XCBuild. Update these with recent changes to the set of build files
258         and with the current generate-xcfilelist script.
259
260         No new tests since there should be no observable behavior difference.
261
262         * DerivedSources-input.xcfilelist:
263         * DerivedSources-output.xcfilelist:
264         * UnifiedSources-input.xcfilelist:
265         * UnifiedSources-output.xcfilelist:
266
267 2019-01-25  Brent Fulgham  <bfulgham@apple.com>
268
269         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
270         https://bugs.webkit.org/show_bug.cgi?id=193297
271         <rdar://problem/47158841>
272
273         Reviewed by Alex Christensen.
274
275         Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
276
277         * Modules/websockets/WebSocket.cpp:
278         (WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
279         * loader/ResourceLoadObserver.cpp:
280         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
281         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
282         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
283         (WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
284         (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
285         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
286
287 2019-01-25  Zalan Bujtas  <zalan@apple.com>
288
289         Remove FrameView::m_firstVisuallyNonEmptyLayoutCallbackPending
290         https://bugs.webkit.org/show_bug.cgi?id=193835
291
292         Reviewed by Simon Fraser.
293
294         Currently updateIsVisuallyNonEmpty() is called from fireLayoutRelatedMilestonesIfNeeded() and from the incrementVisually*() functions.
295         By calling it from incrementVisually*() and setting the m_isVisuallyNonEmpty flag to true early does not have any impact on when the milestone is fired.
296         The milestone firing, as part of the post-layout tasks is triggered by a subsequent layout.
297         However having multiple callers of updateIsVisuallyNonEmpty() requires an extra boolen (m_firstVisuallyNonEmptyLayoutCallbackPending) to maintain.
298         Also calling updateIsVisuallyNonEmpty() repeatedly could be costly (with the current threshold of 200 characters, I don't think it is though).
299
300         This patch removes m_firstVisuallyNonEmptyLayoutCallbackPending and moves the logic from updateIsVisuallyNonEmpty() to fireLayoutRelatedMilestonesIfNeeded().
301
302         * page/FrameView.cpp:
303         (WebCore::FrameView::resetLayoutMilestones):
304         (WebCore::FrameView::loadProgressingStatusChanged):
305         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
306         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
307         (WebCore::FrameView::updateIsVisuallyNonEmpty): Deleted.
308         * page/FrameView.h:
309         (WebCore::FrameView::incrementVisuallyNonEmptyPixelCount):
310
311 2019-01-25  David Kilzer  <ddkilzer@apple.com>
312
313         Move soft-linking of Lookup.framework out of LookupSPI.h
314         <https://webkit.org/b/193815>
315
316         Reviewed by Tim Horton.
317
318         * editing/cocoa/DictionaryLookup.mm:
319         - Remove unused header.
320
321         * editing/mac/DictionaryLookupLegacy.mm:
322         (WebCore::tokenRange):
323         (WebCore::showPopupOrCreateAnimationController):
324         (WebCore::DictionaryLookup::hidePopup):
325         - Move soft-linking to LookupSoftLink.{h,mm}.
326
327         * platform/ios/ValidationBubbleIOS.mm:
328         (WebCore::ValidationBubble::show):
329         - Update for changes to UIKitSoftLink.{h,mm} now that
330           UIAccessibilityAnnouncementNotification is using
331           SOFT_LINK_CONSTANT*().
332
333 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
334
335         [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
336         https://bugs.webkit.org/show_bug.cgi?id=193829
337
338         Reviewed by Tim Horton.
339
340         No change in behavior.
341
342         * page/EventHandler.h:
343         * page/ios/EventHandlerIOS.mm:
344         (WebCore::EventHandler::tryToBeginDragAtPoint):
345         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint): Deleted.
346         * platform/ios/WebItemProviderPasteboard.mm:
347         (linkTemporaryItemProviderFilesToDropStagingDirectory):
348
349 2019-01-25  Jon Davis  <jond@apple.com>
350
351         Updated feature status for several features 
352         https://bugs.webkit.org/show_bug.cgi?id=193794
353
354         Reviewed by Joseph Pecoraro.
355         
356         Updated feature status for the following: CSS Font Display,
357         CSS Text Decoration Level 4, SVG in OpenType Fonts, Web SQL,
358         File and Directory Entries API, MediaStream Recording API,
359         Readable Streams, Subresource Integrity, Visual Viewport API,
360         and Web Audio.
361
362         * features.json:
363
364 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
365
366         Need a way for JavaScript (or bundle) code to participate in undo
367         https://bugs.webkit.org/show_bug.cgi?id=190009
368         <rdar://problem/44807048>
369
370         Reviewed by Ryosuke Niwa.
371
372         Finish hooking up `UndoManager::addItems()` to CustomUndoStep.
373
374         Tests: editing/undo-manager/undo-manager-add-item-exceptions.html
375                editing/undo-manager/undo-manager-add-item.html
376                editing/undo-manager/undo-manager-delete-stale-undo-items.html
377                editing/undo-manager/undo-manager-item-labels.html
378                editing/undo-manager/undo-manager-undo-redo-after-garbage-collection.html
379
380         * editing/CompositeEditCommand.h:
381         * editing/CustomUndoStep.cpp:
382         (WebCore::CustomUndoStep::didRemoveFromUndoManager):
383
384         Add a method to invalidate CustomUndoStep. This clears out the pointer to the undo item, and also invalidates
385         the UndoItem, removing it from its UndoManager.
386
387         * editing/CustomUndoStep.h:
388         * editing/Editor.cpp:
389         (WebCore::Editor::registerCustomUndoStep):
390
391         Add a helper method to register a CustomUndoStep as a platform undoable step.
392
393         * editing/Editor.h:
394         * editing/UndoStep.h:
395         * page/UndoItem.h:
396         (WebCore::UndoItem::undoManager const):
397         * page/UndoManager.cpp:
398         (WebCore::UndoManager::addItem):
399
400         Create a CustomUndoStep with the given UndoItem, and register it with the platform undo manager.
401
402         * page/UndoManager.h:
403         * page/UndoManager.idl:
404
405         Mark addItem() as capable of throwing exceptions.
406
407 2019-01-25  Zalan Bujtas  <zalan@apple.com>
408
409         [LFC][BFC][MarginCollapsing] Add "clear" to static position computation.
410         https://bugs.webkit.org/show_bug.cgi?id=193824
411
412         Reviewed by Antti Koivisto.
413
414         When clear property is set and floats are present, we have to estimate and set the box's vertical position during
415         static positioning to be able to properly layout its subtree.
416
417         <div style="float: left; width: 100px; height: 100px;"></div>
418         <div style="clear: left;">
419           <div style="float: left; width: 100px; height: 100px;"></div>
420         </div>
421
422         In the above example since the second float's parent clears the first float, the second float is positioned below
423         the first float. If we didn't push down (clear) the box, the float child would get placed next to the first float.
424
425         * layout/blockformatting/BlockFormattingContext.cpp:
426         (WebCore::Layout::BlockFormattingContext::layout const):
427         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
428         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
429         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
430         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
431         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
432         (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
433         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): Deleted.
434         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const): Deleted.
435         * layout/blockformatting/BlockFormattingContext.h:
436         * layout/blockformatting/BlockMarginCollapse.cpp:
437         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
438         * layout/displaytree/DisplayBox.h:
439
440 2019-01-25  Zalan Bujtas  <zalan@apple.com>
441
442         [LFC][BFC][MarginCollapsing] Move positive/negative margin value updating to a dedicated function
443         https://bugs.webkit.org/show_bug.cgi?id=193812
444
445         Reviewed by Antti Koivisto.
446
447         Move update logic to BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues().
448
449         * layout/blockformatting/BlockFormattingContext.cpp:
450         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
451         * layout/blockformatting/BlockFormattingContext.h:
452         * layout/blockformatting/BlockMarginCollapse.cpp:
453         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
454         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
455         * page/FrameViewLayoutContext.cpp:
456         (WebCore::layoutUsingFormattingContext):
457
458 2019-01-25  Antoine Quint  <graouts@apple.com>
459
460         Use ENABLE_POINTER_EVENTS for the touch-action property
461         https://bugs.webkit.org/show_bug.cgi?id=193819
462
463         Reviewed by Antti Koivisto.
464
465         Since we've added an ENABLE_POINTER_EVENTS we should be using it for anything related to the implementation of the
466         Pointer Events specification of which the touch-action property is a part.
467
468         * css/CSSComputedStyleDeclaration.cpp:
469         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
470         * css/CSSPrimitiveValueMappings.h:
471         * css/CSSProperties.json:
472         * css/CSSValueKeywords.in:
473         * css/StyleBuilderConverter.h:
474         * css/parser/CSSPropertyParser.cpp:
475         (WebCore::CSSPropertyParser::parseSingleValue):
476         * dom/Element.cpp:
477         (WebCore::Element::allowsDoubleTapGesture const):
478         * platform/TouchAction.h:
479         * rendering/style/RenderStyle.h:
480         * rendering/style/StyleRareNonInheritedData.cpp:
481         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
482         (WebCore::StyleRareNonInheritedData::operator== const):
483         * rendering/style/StyleRareNonInheritedData.h:
484
485 2019-01-24  Zalan Bujtas  <zalan@apple.com>
486
487         [LFC][BFC][MarginCollapsing] Refactor MarginCollapse::updateCollapsedMarginAfter
488         https://bugs.webkit.org/show_bug.cgi?id=193807
489
490         Reviewed by Simon Fraser.
491
492         Rename updateCollapsedMarginAfter to updateMarginAfterForPreviousSibling and make the margin updating logic more explicit.
493
494         * layout/blockformatting/BlockFormattingContext.cpp:
495         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
496         * layout/blockformatting/BlockFormattingContext.h:
497         * layout/blockformatting/BlockMarginCollapse.cpp:
498         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
499         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter): Deleted.
500
501 2019-01-24  Joseph Pecoraro  <pecoraro@apple.com>
502
503         Web Inspector: CPU Usage Timeline
504         https://bugs.webkit.org/show_bug.cgi?id=193730
505         <rdar://problem/46797201>
506
507         Reviewed by Devin Rousso.
508
509         Test: inspector/cpu-profiler/tracking.html
510
511         * Sources.txt:
512         * UnifiedSources-input.xcfilelist:
513         * WebCore.xcodeproj/project.pbxproj:
514         New files.
515
516         * inspector/InspectorController.cpp:
517         (WebCore::InspectorController::createLazyAgents):
518         * inspector/InstrumentingAgents.cpp:
519         (WebCore::InstrumentingAgents::reset):
520         * inspector/InstrumentingAgents.h:
521         (WebCore::InstrumentingAgents::inspectorCPUProfilerAgent const):
522         (WebCore::InstrumentingAgents::setInspectorCPUProfilerAgent):
523         Create and track the CPUProfilerAgent.
524
525         * inspector/agents/InspectorTimelineAgent.cpp:
526         (WebCore::InspectorTimelineAgent::toggleInstruments):
527         (WebCore::InspectorTimelineAgent::toggleCPUInstrument):
528         Handle backend auto-start of the CPU instrument / timeline.
529
530         * inspector/agents/InspectorCPUProfilerAgent.h:
531         * inspector/agents/InspectorCPUProfilerAgent.cpp: Added.
532         (WebCore::InspectorCPUProfilerAgent::InspectorCPUProfilerAgent):
533         (WebCore::InspectorCPUProfilerAgent::didCreateFrontendAndBackend):
534         (WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend):
535         (WebCore::InspectorCPUProfilerAgent::startTracking):
536         (WebCore::InspectorCPUProfilerAgent::stopTracking):
537         (WebCore::InspectorCPUProfilerAgent::collectSample):
538         CPUProfilerAgent uses the ResourceUsageThread to get CPU data.
539
540         * inspector/agents/InspectorTimelineAgent.h:
541         * inspector/agents/InspectorMemoryAgent.cpp:
542         (WebCore::InspectorMemoryAgent::startTracking):
543         (WebCore::InspectorMemoryAgent::collectSample):
544         Update the MemoryAgent to collect only Memory data and use a more accurate sample timestamp.
545
546         * page/ResourceUsageData.h:
547         * page/ResourceUsageThread.cpp:
548         (WebCore::ResourceUsageThread::addObserver):
549         (WebCore::ResourceUsageThread::removeObserver):
550         (WebCore::ResourceUsageThread::notifyObservers):
551         (WebCore::ResourceUsageThread::recomputeCollectionMode):
552         (WebCore::ResourceUsageThread::threadBody):
553         * page/ResourceUsageThread.h:
554         * page/cocoa/ResourceUsageOverlayCocoa.mm:
555         (WebCore::ResourceUsageOverlay::platformInitialize):
556         * page/cocoa/ResourceUsageThreadCocoa.mm:
557         (WebCore::ResourceUsageThread::platformCollectCPUData):
558         (WebCore::ResourceUsageThread::platformCollectMemoryData):
559         (WebCore::ResourceUsageThread::platformThreadBody): Deleted.
560         * page/linux/ResourceUsageOverlayLinux.cpp:
561         (WebCore::ResourceUsageOverlay::platformInitialize):
562         * page/linux/ResourceUsageThreadLinux.cpp:
563         (WebCore::ResourceUsageThread::platformCollectCPUData):
564         (WebCore::ResourceUsageThread::platformCollectMemoryData):
565         (WebCore::ResourceUsageThread::platformThreadBody):
566         Give each observer their own collection mode. The ResourceUsageThread
567         will then collect data that is the union of all of the active observers.
568         This allows collecting CPU and Memory data separately, reducing the cost
569         of each when gathered individually.
570
571 2019-01-24  Charles Vazac  <cvazac@akamai.com>
572
573         Implement PerformanceObserver.supportedEntryTypes
574         https://bugs.webkit.org/show_bug.cgi?id=193428
575
576         PerformanceObserver.supportedEntryTypes should return an array of
577         entryTypes that can be observed per specification
578         https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute
579
580         Reviewed by Joseph Pecoraro.
581
582         This is covered by web-platform-tests
583         LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.*.html.
584
585         * page/PerformanceObserver.cpp:
586         (WebCore::PerformanceObserver::supportedEntryTypes):
587         * page/PerformanceObserver.h:
588         * page/PerformanceObserver.idl:
589
590 2019-01-24  Truitt Savell  <tsavell@apple.com>
591
592         Unreviewed, rolling out r240446.
593
594         Casued 5 API failures
595
596         Reverted changeset:
597
598         "Activate the WebResourceLoadStatisticsStore in the
599         NetworkProcess and deactivate it in the UIProcess."
600         https://bugs.webkit.org/show_bug.cgi?id=193297
601         https://trac.webkit.org/changeset/240446
602
603 2019-01-24  Wenson Hsieh  <wenson_hsieh@apple.com>
604
605         [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
606         https://bugs.webkit.org/show_bug.cgi?id=193758
607         <rdar://problem/43614978>
608
609         Reviewed by Tim Horton.
610
611         CodeMirror's script adds a repeating timer that periodically normalizes the logical selection in the editor
612         (this is distinct from the actual DOM selection, which is inside a hidden textarea element). This script defines
613         a helper method to select all the text inside of a text form control, called `selectInput`, which normally
614         invokes `node.select()`. However, in the case of iOS, the script works around broken `select()` behavior by
615         setting `selectionStart` and `selectionEnd` to encompass all the content in the form control. When requesting
616         the desktop version of the site, CodeMirror no longer attempts to apply its iOS workaround.
617
618         This iOS-specific behavior was introduced to fix <rdar://problem/4901923>. However, the original bug no longer
619         reproduces even without this quirk. To fix CodeMirror, we make two adjustments:
620
621         1.  Roll out this ancient demo hack, in favor of standardized behavior.
622         2.  Note that `select()` is also used when focusing an input. However, when focusing an input element on iOS, we
623             want to match the platform (i.e. UITextField behavior) and move focus to the end of the text field. To
624             achieve this, we introduce a new helper on HTMLInputElement that is called when setting the default
625             selection of a text input after focus; on iOS, this helper method moves the selection to the end of the
626             input, but everywhere else, it selects all the text in the input element.
627
628         This causes 6 existing layout tests to begin passing on iOS.
629
630         * html/HTMLInputElement.cpp:
631         (WebCore::HTMLInputElement::updateFocusAppearance):
632         (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
633         * html/HTMLInputElement.h:
634         * html/HTMLTextFormControlElement.cpp:
635         (WebCore::HTMLTextFormControlElement::select):
636
637 2019-01-24  Jer Noble  <jer.noble@apple.com>
638
639         Fix leak of AVSampleBufferRenderSynchronizer boundaryObserver object.
640         https://bugs.webkit.org/show_bug.cgi?id=193778
641
642         Reviewed by Jon Lee.
643
644         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
645         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
646
647 2019-01-24  Zalan Bujtas  <zalan@apple.com>
648
649         DidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
650         https://bugs.webkit.org/show_bug.cgi?id=193741
651         <rdar://problem/47135030>
652
653         Reviewed by Antti Koivisto and Simon Fraser.
654
655         fireLayoutRelatedMilestonesIfNeeded() is part of the post-layout tasks. In certain cases when
656             1. the received data is not "contentful" yet
657             2. and we are expecting some more (loading is not complete yet)
658             3. but no layout is initiated anymore
659         nothing triggers the milestone firing.
660
661         This patch ensures that we fire the DidFirstVisuallyNonEmptyLayout when the frame load is complete unless we already did.
662
663         * page/FrameView.cpp:
664         (WebCore::FrameView::FrameView):
665         (WebCore::FrameView::loadProgressingStatusChanged):
666
667 2019-01-24  Brent Fulgham  <bfulgham@apple.com>
668
669         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
670         https://bugs.webkit.org/show_bug.cgi?id=193297
671         <rdar://problem/47158841>
672
673         Reviewed by Alex Christensen.
674
675         Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
676
677         * Modules/websockets/WebSocket.cpp:
678         (WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
679         * loader/ResourceLoadObserver.cpp:
680         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
681         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
682         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
683         (WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
684         (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
685         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
686
687 2019-01-24  John Wilander  <wilander@apple.com>
688
689         Add Ad Click Attribution as an internal/experimental feature
690         https://bugs.webkit.org/show_bug.cgi?id=193685
691         <rdar://problem/47450399>
692
693         Reviewed by Brent Fulgham.
694
695         Test: http/tests/adClickAttribution/anchor-tag-attributes-reflect.html
696
697         * html/HTMLAnchorElement.h:
698         * html/HTMLAnchorElement.idl:
699         * html/HTMLAttributeNames.in:
700             Addeed two new experimental attributes:
701             - adcampaignid: Ad campaign ID.
702             - addestination: Ad link destination site.
703         * page/RuntimeEnabledFeatures.h:
704         (WebCore::RuntimeEnabledFeatures::adClickAttributionEnabled const):
705         (WebCore::RuntimeEnabledFeatures::setAdClickAttributionEnabled):
706         * page/Settings.yaml:
707
708 2019-01-24  Youenn Fablet  <youenn@apple.com>
709
710         Use MonotonicTime in WorkerRunLoop
711         https://bugs.webkit.org/show_bug.cgi?id=193417
712
713         Reviewed by Saam Barati.
714
715         Condition is based on MonotonicTime so MessageQueue should also be based on MonotonicTime.
716         Ditto for WorkerRunLoop.
717         No easy way to test the change which should not be easily observable.
718
719         * workers/WorkerRunLoop.cpp:
720         (WebCore::WorkerRunLoop::runInMode):
721
722 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
723
724         Move FileSystem to WTF
725         https://bugs.webkit.org/show_bug.cgi?id=193602
726
727         Reviewed by Yusuke Suzuki.
728
729         * Modules/encryptedmedia/CDM.cpp:
730         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
731         * Modules/entriesapi/DOMFileSystem.cpp:
732         * Modules/entriesapi/FileSystemEntry.cpp:
733         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
734         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
735         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
736         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
737         * Modules/webdatabase/DatabaseTracker.cpp:
738         * Modules/webdatabase/OriginLock.cpp:
739         * Modules/webdatabase/OriginLock.h:
740         * Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm:
741         * PlatformMac.cmake:
742         * PlatformPlayStation.cmake:
743         * PlatformWin.cmake:
744         * Sources.txt:
745         * SourcesCocoa.txt:
746         * WebCore.xcodeproj/project.pbxproj:
747         * bindings/js/GCController.cpp:
748         * dom/DataTransferItem.cpp:
749         * editing/cocoa/WebContentReaderCocoa.mm:
750         * fileapi/File.cpp:
751         * fileapi/FileCocoa.mm:
752         * html/FileInputType.cpp:
753         * html/FileListCreator.cpp:
754         * loader/appcache/ApplicationCacheHost.cpp:
755         * loader/appcache/ApplicationCacheStorage.cpp:
756         * page/Page.cpp:
757         * page/SecurityOrigin.cpp:
758         * page/SecurityOriginData.cpp:
759         * platform/FileHandle.h:
760         * platform/FileStream.cpp:
761         * platform/FileStream.h:
762         * platform/SharedBuffer.h:
763         * platform/SourcesGLib.txt:
764         * platform/cocoa/FileMonitorCocoa.mm:
765         * platform/glib/FileMonitorGLib.cpp:
766         * platform/glib/SharedBufferGlib.cpp:
767         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
768         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
769         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
770         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
771         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
772         * platform/ios/QuickLook.mm:
773         * platform/ios/WebItemProviderPasteboard.mm:
774         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
775         * platform/network/BlobDataFileReference.cpp:
776         * platform/network/BlobRegistryImpl.cpp:
777         * platform/network/BlobResourceHandle.cpp:
778         * platform/network/FormData.cpp:
779         * platform/network/cf/FormDataStreamCFNet.cpp:
780         * platform/network/cocoa/ResourceRequestCocoa.mm:
781         * platform/network/curl/CookieJarDB.cpp:
782         * platform/network/curl/CurlCacheEntry.h:
783         * platform/network/curl/CurlCacheManager.cpp:
784         * platform/network/curl/CurlFormDataStream.h:
785         * platform/network/curl/CurlRequest.h:
786         * platform/network/curl/NetworkStorageSessionCurl.cpp:
787         * platform/network/curl/ResourceHandleCurl.cpp:
788         * platform/network/mac/BlobDataFileReferenceMac.mm:
789         * platform/network/soup/ResourceHandleSoup.cpp:
790         * platform/network/soup/SoupNetworkSession.cpp:
791         * platform/posix/SharedBufferPOSIX.cpp:
792         * platform/sql/SQLiteFileSystem.cpp:
793         * platform/text/hyphen/HyphenationLibHyphen.cpp:
794         * platform/win/SearchPopupMenuDB.cpp:
795         * rendering/RenderTheme.cpp:
796         * rendering/RenderThemeGtk.cpp:
797         * rendering/RenderThemeWin.cpp:
798         * workers/service/server/RegistrationDatabase.cpp:
799
800 2019-01-24  Zalan Bujtas  <zalan@apple.com>
801
802         [LFC][BFC][MarginCollapsing] MarginCollapse::collapsedVerticalValues should not return computed non-collapsed values.
803         https://bugs.webkit.org/show_bug.cgi?id=193768
804
805         Reviewed by Antti Koivisto.
806
807         When it comes to the actual used values it does not really matter, only from correctness point of view.
808         (This patch also moves some checks to their correct place.)
809
810         * layout/blockformatting/BlockMarginCollapse.cpp:
811         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
812         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
813         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
814         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
815         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
816         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
817
818 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
819
820         Add "frame hosting" nodes to the scrolling tree
821         https://bugs.webkit.org/show_bug.cgi?id=193753
822
823         Reviewed by Antti Koivisto.
824
825         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
826         require the iframe's scrolling node to get reparented in a new ancestor, which requires
827         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
828
829         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
830         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
831         to provide a consistent parent node for the subframe's scrolling node.
832
833         This patch adds the node types, but does not instantiate them yet.
834
835         * Sources.txt:
836         * WebCore.xcodeproj/project.pbxproj:
837         * page/scrolling/ScrollingCoordinator.cpp:
838         (WebCore::operator<<):
839         * page/scrolling/ScrollingCoordinator.h:
840         * page/scrolling/ScrollingStateFrameHostingNode.cpp: Added.
841         (WebCore::ScrollingStateFrameHostingNode::create):
842         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
843         (WebCore::ScrollingStateFrameHostingNode::clone):
844         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
845         * page/scrolling/ScrollingStateFrameHostingNode.h: Added.
846         * page/scrolling/ScrollingStateNode.h:
847         (WebCore::ScrollingStateNode::isFrameHostingNode const):
848         * page/scrolling/ScrollingStateTree.cpp:
849         (WebCore::ScrollingStateTree::createNode):
850         * page/scrolling/ScrollingTreeFrameHostingNode.cpp: Added.
851         (WebCore::ScrollingTreeFrameHostingNode::create):
852         (WebCore::ScrollingTreeFrameHostingNode::ScrollingTreeFrameHostingNode):
853         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
854         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
855         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
856         * page/scrolling/ScrollingTreeFrameHostingNode.h: Added.
857         * page/scrolling/ScrollingTreeNode.h:
858         (WebCore::ScrollingTreeNode::isFrameHostingNode const):
859         * page/scrolling/ios/ScrollingTreeIOS.cpp:
860         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
861         * page/scrolling/mac/ScrollingTreeMac.cpp:
862         (ScrollingTreeMac::createScrollingTreeNode):
863         * rendering/RenderLayerBacking.cpp:
864         (WebCore::RenderLayerBacking::~RenderLayerBacking):
865         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
866         (WebCore::operator<<):
867         * rendering/RenderLayerBacking.h:
868         * rendering/RenderLayerCompositor.cpp:
869         (WebCore::scrollCoordinationRoleForNodeType):
870         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
871         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
872         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
873         * rendering/RenderLayerCompositor.h:
874
875 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
876
877         [iOS] Enable media element volume on iPad
878         https://bugs.webkit.org/show_bug.cgi?id=193745
879         <rdar://problem/47452297>
880
881         Reviewed by Jer Noble.
882
883         * html/HTMLMediaElement.cpp:
884         (WebCore::HTMLMediaElement::setVolume):
885         (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
886         (WebCore::HTMLMediaElement::updateVolume):
887
888         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
889         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
890
891 2019-01-24  Carlos Garcia Campos  <cgarcia@igalia.com>
892
893         [GTK][WPE] Support JPEG 2000 images
894         https://bugs.webkit.org/show_bug.cgi?id=186272
895
896         Reviewed by Žan Doberšek.
897
898         Add JPEG2000ImageDecoder to support JPEG2000 images using OpenJPEG. For now only SRGB and SYCC color spaces are
899         supported.
900
901         * platform/ImageDecoders.cmake:
902         * platform/MIMETypeRegistry.cpp:
903         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
904         * platform/image-decoders/ScalableImageDecoder.cpp:
905         (WebCore::ScalableImageDecoder::create):
906         * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp: Added.
907         (WebCore::syccToRGB):
908         (WebCore::sycc444ToRGB):
909         (WebCore::sycc422ToRGB):
910         (WebCore::sycc420ToRGB):
911         (WebCore::JPEG2000ImageDecoder::JPEG2000ImageDecoder):
912         (WebCore::JPEG2000ImageDecoder::frameBufferAtIndex):
913         (WebCore::JPEG2000ImageDecoder::decode):
914         * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.h: Added.
915
916 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
917
918         Change some RenderLayerCompositor functions to use references
919         https://bugs.webkit.org/show_bug.cgi?id=193760
920
921         Reviewed by Zalan Bujtas.
922
923         RenderWidget* -> RenderWidget&
924
925         * rendering/RenderLayerBacking.cpp:
926         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
927         (WebCore::RenderLayerBacking::updateConfiguration):
928         * rendering/RenderLayerCompositor.cpp:
929         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
930         (WebCore::RenderLayerCompositor::updateBacking):
931         (WebCore::RenderLayerCompositor::frameContentsCompositor):
932         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
933         * rendering/RenderLayerCompositor.h:
934
935 2019-01-23  Benjamin Poulain  <benjamin@webkit.org>
936
937         <rdar://problem/27686430> Revert workaround AVPlayer.setMuted bug on macOS
938         https://bugs.webkit.org/show_bug.cgi?id=193742
939
940         Reviewed by Eric Carlson.
941
942         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
943         The original bug was fixed, see radar: rdar://problem/27686430
944
945 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
946
947         Clean up IndexedDB files between tests
948         https://bugs.webkit.org/show_bug.cgi?id=192796
949         <rdar://problem/46824999>
950
951         Reviewed by Geoffrey Garen.
952
953         We should clean up the IndexedDB files between tests to make sure each IDB test is independent of others.
954
955         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
956         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
957         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
958
959 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
960
961         Add CSS Logical spec to features.json
962         https://bugs.webkit.org/show_bug.cgi?id=193717
963
964         Reviewed by Manuel Rego Casasnovas.
965
966         * features.json:
967
968 2019-01-22  Conrad Shultz  <conrad_shultz@apple.com>
969
970         Clean up USE(WEB_THREAD)
971         https://bugs.webkit.org/show_bug.cgi?id=193698
972
973         Rubber-stamped by Tim Horton.
974
975         * page/CaptionUserPreferencesMediaAF.cpp:
976         (WebCore::userCaptionPreferencesChangedNotificationCallback):
977         * platform/cf/MainThreadSharedTimerCF.cpp:
978         (WebCore::applicationDidBecomeActive):
979         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
980         (WebCore::dispatchToMainThread):
981         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
982         (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
983         * platform/ios/LegacyTileCache.mm:
984         (WebCore::LegacyTileCache::layoutTiles):
985         (WebCore::LegacyTileCache::setTilingMode):
986         * platform/ios/WebCoreMotionManager.mm:
987         (-[WebCoreMotionManager sendAccelerometerData:]):
988         (-[WebCoreMotionManager sendMotionData:withHeading:]):
989         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
990         (VideoFullscreenControllerContext::requestUpdateInlineRect):
991         (VideoFullscreenControllerContext::requestVideoContentLayer):
992         (VideoFullscreenControllerContext::returnVideoContentLayer):
993         (VideoFullscreenControllerContext::didSetupFullscreen):
994         (VideoFullscreenControllerContext::willExitFullscreen):
995         (VideoFullscreenControllerContext::didExitFullscreen):
996         (VideoFullscreenControllerContext::didCleanupFullscreen):
997         (VideoFullscreenControllerContext::fullscreenMayReturnToInline):
998         (VideoFullscreenControllerContext::requestFullscreenMode):
999         (VideoFullscreenControllerContext::setVideoLayerFrame):
1000         (VideoFullscreenControllerContext::setVideoLayerGravity):
1001         (VideoFullscreenControllerContext::fullscreenModeChanged):
1002         (VideoFullscreenControllerContext::play):
1003         (VideoFullscreenControllerContext::pause):
1004         (VideoFullscreenControllerContext::togglePlayState):
1005         (VideoFullscreenControllerContext::toggleMuted):
1006         (VideoFullscreenControllerContext::setMuted):
1007         (VideoFullscreenControllerContext::setVolume):
1008         (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
1009         (VideoFullscreenControllerContext::beginScrubbing):
1010         (VideoFullscreenControllerContext::endScrubbing):
1011         (VideoFullscreenControllerContext::seekToTime):
1012         (VideoFullscreenControllerContext::fastSeek):
1013         (VideoFullscreenControllerContext::beginScanningForward):
1014         (VideoFullscreenControllerContext::beginScanningBackward):
1015         (VideoFullscreenControllerContext::endScanning):
1016         (VideoFullscreenControllerContext::selectAudioMediaOption):
1017         (VideoFullscreenControllerContext::selectLegibleMediaOption):
1018         (VideoFullscreenControllerContext::duration const):
1019         (VideoFullscreenControllerContext::currentTime const):
1020         (VideoFullscreenControllerContext::bufferedTime const):
1021         (VideoFullscreenControllerContext::isPlaying const):
1022         (VideoFullscreenControllerContext::playbackRate const):
1023         (VideoFullscreenControllerContext::seekableRanges const):
1024         (VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime const):
1025         (VideoFullscreenControllerContext::liveUpdateInterval const):
1026         (VideoFullscreenControllerContext::canPlayFastReverse const):
1027         (VideoFullscreenControllerContext::audioMediaSelectionOptions const):
1028         (VideoFullscreenControllerContext::audioMediaSelectedIndex const):
1029         (VideoFullscreenControllerContext::legibleMediaSelectionOptions const):
1030         (VideoFullscreenControllerContext::legibleMediaSelectedIndex const):
1031         (VideoFullscreenControllerContext::externalPlaybackEnabled const):
1032         (VideoFullscreenControllerContext::externalPlaybackTargetType const):
1033         (VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName const):
1034         (VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled const):
1035         (VideoFullscreenControllerContext::setUpFullscreen):
1036         (VideoFullscreenControllerContext::exitFullscreen):
1037         (VideoFullscreenControllerContext::requestHideAndExitFullscreen):
1038         (-[WebVideoFullscreenController enterFullscreen:mode:]):
1039         (-[WebVideoFullscreenController exitFullscreen]):
1040         (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
1041         * platform/ios/wak/WAKWindow.mm:
1042         (-[WAKWindow setVisible:]):
1043         (-[WAKWindow setScreenScale:]):
1044         (-[WAKWindow sendEvent:]):
1045         (-[WAKWindow sendMouseMoveEvent:contentChange:]):
1046         * platform/network/ios/NetworkStateNotifierIOS.mm:
1047         (WebCore::NetworkStateNotifier::startObserving):
1048         * rendering/RenderThemeIOS.mm:
1049         (WebCore::contentSizeCategoryDidChange):
1050
1051 2019-01-23  David Kilzer  <ddkilzer@apple.com>
1052
1053         REGRESSION (r240292): Attempt to fix WinCairo build
1054
1055         * platform/network/curl/CurlResourceHandleDelegate.cpp:
1056         (WebCore::handleCookieHeaders): Remove argument to
1057         NetworkingContext::storageSession().
1058
1059 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1060
1061         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
1062         https://bugs.webkit.org/show_bug.cgi?id=193706
1063         <rdar://problem/44807048>
1064
1065         Reviewed by Ryosuke Niwa.
1066
1067         Refactors some existing logic when registering undoable actions, such that we propagate the undoable action's
1068         label string instead of the EditAction to the client layer. This will help make handling of CustomUndoStep's
1069         undo/redo label simpler, as the client layer won't need to worry about managing an EditAction and undo/redo
1070         label simultaneously. There should be no change in behavior.
1071
1072         * editing/CompositeEditCommand.cpp:
1073         (WebCore::EditCommandComposition::label const):
1074         * editing/CompositeEditCommand.h:
1075         * editing/CustomUndoStep.cpp:
1076         (WebCore::CustomUndoStep::label const):
1077         * editing/CustomUndoStep.h:
1078         * editing/EditAction.cpp:
1079         (WebCore::undoRedoLabel):
1080         (WebCore::nameForUndoRedo): Deleted.
1081         * editing/EditAction.h:
1082
1083         Rename nameForUndoRedo to undoRedoLabel, and remove the WEBCORE_EXPORT since it's no longer needed in WebKit or
1084         WebKitLegacy.
1085
1086         * editing/UndoStep.h:
1087
1088         Add UndoStep::label(). While EditCommandComposition implements this by mapping its EditAction to a
1089         localized string, CustomUndoStep implements this by returning the undoable action label provided by script.
1090
1091 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1092
1093         [SOUP] Clean up NetworkStorageSession
1094         https://bugs.webkit.org/show_bug.cgi?id=193707
1095
1096         Reviewed by Carlos Garcia Campos.
1097
1098         A NetworkStorageSession now always has a SoupNetworkSession, so we can remove a lot of
1099         complexity that is no longer needed. getOrCreateSoupNetworkSession can go away because we
1100         know the session has always already been created. The soupNetworkSession getter can now
1101         return a reference rather than a pointer, because it will never be NULL except after it has
1102         been cleared with clearSoupNetworkSession (renamed), and that should only happen immediately
1103         before process termination after nothing else is using it. Cookie jar syncing can also go
1104         away; the NetworkStorageSession can now rely on the SoupNetworkSession to exist and just
1105         use its cookie jar.
1106
1107         * platform/network/NetworkStorageSession.h:
1108         (WebCore::NetworkStorageSession::soupNetworkSession const): Deleted.
1109         * platform/network/soup/DNSResolveQueueSoup.cpp:
1110         (WebCore::DNSResolveQueueSoup::updateIsUsingProxy):
1111         (WebCore::DNSResolveQueueSoup::platformResolve):
1112         (WebCore::DNSResolveQueueSoup::resolve):
1113         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1114         (WebCore::NetworkStorageSession::NetworkStorageSession):
1115         (WebCore::NetworkStorageSession::~NetworkStorageSession):
1116         (WebCore::NetworkStorageSession::soupNetworkSession const):
1117         (WebCore::NetworkStorageSession::clearSoupNetworkSession):
1118         (WebCore::NetworkStorageSession::cookieStorage const):
1119         (WebCore::NetworkStorageSession::setCookieStorage):
1120         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const): Deleted.
1121         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage): Deleted.
1122         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1123         (WebCore::SocketStreamHandleImpl::create):
1124
1125 2019-01-23  Zalan Bujtas  <zalan@apple.com>
1126
1127         [LFC][BFC] computeStaticPosition should include estimated computation as well.
1128         https://bugs.webkit.org/show_bug.cgi?id=193719
1129
1130         Reviewed by Antti Koivisto.
1131
1132         Consolidate all static position (non-estimated, estimated) computation in BlockFormattingContext::computeStaticPosition.
1133         It requires to compute width/horizontal margin first, since vertical top estimation needs valid horizontal widths (margin-top: 5% is computed using
1134         the containing block's width).
1135         This is also in preparation for moving 'clear' positioning to computeStaticPosition.
1136
1137         * layout/blockformatting/BlockFormattingContext.cpp:
1138         (WebCore::Layout::BlockFormattingContext::layout const):
1139         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1140         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1141         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
1142         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
1143         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
1144         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
1145         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1146         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1147         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1148         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
1149         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): Deleted.
1150         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): Deleted.
1151         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): Deleted.
1152         * layout/blockformatting/BlockFormattingContext.h:
1153         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1154         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
1155         * layout/blockformatting/BlockMarginCollapse.cpp:
1156         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
1157
1158 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
1159
1160         Compositing updates need to reparent scrolling tree nodes with a changed ancestor
1161         https://bugs.webkit.org/show_bug.cgi?id=193699
1162
1163         Reviewed by Frédéric Wang.
1164
1165         Now that compositing updates are incremental and may not do a full layer walk,
1166         we need to ensure that when a scrolling tree node is removed, we traverse to all
1167         descendant layers whose scrolling tree nodes refer to the removed node as their parent.
1168
1169         To achieve this, add a RenderLayer dirty bit for "NeedsScrollingTreeUpdate" which
1170         ensures that the updateBackingAndHierarchy part of the compositing update traverses
1171         layers with the bit set.
1172
1173         Adjust the compositing logging to make the legend easier to read.
1174
1175         Tests: scrollingcoordinator/reparent-across-compositing-layers.html
1176                scrollingcoordinator/reparent-with-layer-removal.html
1177
1178         * page/scrolling/AsyncScrollingCoordinator.cpp:
1179         (WebCore::AsyncScrollingCoordinator::childrenOfNode const):
1180         * page/scrolling/AsyncScrollingCoordinator.h:
1181         * page/scrolling/ScrollingCoordinator.h:
1182         (WebCore::ScrollingCoordinator::childrenOfNode const):
1183         * rendering/RenderLayer.cpp:
1184         (WebCore::outputPaintOrderTreeLegend):
1185         (WebCore::outputPaintOrderTreeRecursive):
1186         * rendering/RenderLayer.h:
1187         * rendering/RenderLayerCompositor.cpp:
1188         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1189         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
1190
1191 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
1192
1193         [css-logical] Implement flow-relative inset properties
1194         https://bugs.webkit.org/show_bug.cgi?id=189441
1195
1196         Reviewed by Dean Jackson.
1197
1198         Implement 'inset', 'inset-block', 'inset-block-start', 'inset-block-end',
1199         'inset-inline', 'inset-inline-start' and 'inset-inline-end' CSS properties
1200         behind the CSSLogicalEnabled runtime flag.
1201
1202         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
1203                webexposed/css-properties-behind-flags.html
1204
1205         * css/CSSComputedStyleDeclaration.cpp:
1206         (WebCore::isLayoutDependent):
1207         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1208         * css/CSSProperties.json:
1209         * css/CSSProperty.cpp:
1210         (WebCore::CSSProperty::resolveDirectionAwareProperty):
1211         (WebCore::CSSProperty::isDirectionAwareProperty):
1212         * css/StyleProperties.cpp:
1213         (WebCore::StyleProperties::getPropertyValue const):
1214         (WebCore::StyleProperties::asText const):
1215         * css/parser/CSSParserFastPaths.cpp:
1216         (WebCore::isSimpleLengthPropertyID):
1217         * css/parser/CSSPropertyParser.cpp:
1218         (WebCore::CSSPropertyParser::parseSingleValue):
1219         (WebCore::CSSPropertyParser::parseShorthand):
1220
1221 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
1222
1223         [css-grid] Properly handle static positions of abspos inside grid items
1224         https://bugs.webkit.org/show_bug.cgi?id=193657
1225
1226         Reviewed by Javier Fernandez.
1227
1228         Rename findChildLogicalPosition to setLogicalPositionForChild and let it set the position.
1229         Add setLogicalOffsetForChild like setLogicalPositionForChild but just for one offset,
1230         and only if it's needed (not for abspos descentants in their static position).
1231         Add logicalOffsetForChild that finds the value to be set by the functions above.
1232         Rename existing logicalOffsetForChild to logicalOffsetForOutOfFlowChild.
1233
1234         Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html
1235                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html
1236                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html
1237                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html
1238                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html
1239                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html
1240                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html
1241                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html
1242                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html
1243                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html
1244                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html
1245                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html
1246                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html
1247                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html
1248                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html
1249                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html
1250                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html
1251                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html
1252                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html
1253                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html
1254                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html
1255                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html
1256                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html
1257                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html
1258                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html
1259                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html
1260                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html
1261                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html
1262                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html
1263                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html
1264                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html
1265                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html
1266
1267         * rendering/RenderGrid.cpp:
1268         (WebCore::RenderGrid::layoutGridItems):
1269         (WebCore::RenderGrid::layoutPositionedObject):
1270         (WebCore::RenderGrid::logicalOffsetForOutOfFlowChild const):
1271         (WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
1272         (WebCore::RenderGrid::setLogicalPositionForChild const):
1273         (WebCore::RenderGrid::setLogicalOffsetForChild const):
1274         (WebCore::RenderGrid::logicalOffsetForChild const):
1275         * rendering/RenderGrid.h:
1276
1277 2019-01-23  Rob Buis  <rbuis@igalia.com>
1278
1279         Update MIME type parser
1280         https://bugs.webkit.org/show_bug.cgi?id=180526
1281
1282         Reviewed by Frédéric Wang.
1283
1284         Add an enum to allow two modes of MIME type parsing, one mode
1285         to keep supporting RFC2045 as before, and one mode to support
1286         the updated MIME parser from mimesniff [1]. Mimesniff support
1287         brings the following changes:
1288         - allows parameter names without matching =value.
1289         - skips whitespace after subtype, parameter value and before
1290           parameter name.
1291         - lower cases MIME type and parameter name.
1292         - parameter names parsed before are discarded.
1293
1294         The old mode is still used by CDM.cpp and MIMEHeader.cpp.
1295
1296         [1] https://mimesniff.spec.whatwg.org/
1297
1298         * Modules/encryptedmedia/CDM.cpp:
1299         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
1300         * platform/network/MIMEHeader.cpp:
1301         (WebCore::MIMEHeader::parseHeader):
1302         * platform/network/ParsedContentType.cpp:
1303         (WebCore::DummyParsedContentType::setContentType const):
1304         (WebCore::DummyParsedContentType::setContentTypeParameter const):
1305         (WebCore::isQuotedStringTokenCharacter):
1306         (WebCore::isTokenCharacter):
1307         (WebCore::parseToken):
1308         (WebCore::containsNonTokenCharacters):
1309         (WebCore::parseQuotedString):
1310         (WebCore::isNotForwardSlash):
1311         (WebCore::isNotSemicolon):
1312         (WebCore::isNotSemicolonOrEqualSign):
1313         (WebCore::parseContentType):
1314         (WebCore::isValidContentType):
1315         (WebCore::ParsedContentType::ParsedContentType):
1316         (WebCore::ParsedContentType::setContentType):
1317         (WebCore::isNonTokenCharacter):
1318         (WebCore::isNonQuotedStringTokenCharacter):
1319         (WebCore::ParsedContentType::setContentTypeParameter):
1320         * platform/network/ParsedContentType.h:
1321
1322         Test: web-platform-tests/xhr/overridemimetype-blob.html
1323
1324 2019-01-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1325
1326         Introduce CustomUndoStep.h and CustomUndoStep.cpp
1327         https://bugs.webkit.org/show_bug.cgi?id=193704
1328         <rdar://problem/44807048>
1329
1330         Reviewed by Ryosuke Niwa.
1331
1332         This patch is more work in progress towards supporting `UndoManager.addItem()`. Here, we introduce a helper
1333         class, CustomUndoStep, that holds a weak reference to a script-defined UndoItem. See below for more details.
1334
1335         No change in behavior.
1336
1337         * Sources.txt:
1338         * WebCore.xcodeproj/project.pbxproj:
1339         * editing/CustomUndoStep.cpp:
1340         (WebCore::CustomUndoStep::CustomUndoStep):
1341
1342         Subclass UndoStep.
1343
1344         (WebCore::CustomUndoStep::unapply):
1345         (WebCore::CustomUndoStep::reapply):
1346
1347         If possible, invoke the UndoItem's undo and redo handlers.
1348
1349         (WebCore::CustomUndoStep::isValid const):
1350         * editing/CustomUndoStep.h:
1351         * editing/EditingStyle.cpp:
1352         * editing/InsertEditableImageCommand.cpp:
1353         (WebCore::InsertEditableImageCommand::doApply):
1354
1355         Unified build fixes.
1356
1357         * page/UndoItem.h:
1358
1359 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
1360
1361         Adding a child to a ScrollingStateNode needs to trigger a tree state commit
1362         https://bugs.webkit.org/show_bug.cgi?id=193682
1363
1364         Reviewed by Zalan Bujtas.
1365
1366         Scrolling tree mutations that re-arrange nodes (e.g. node reordering when z-index changes)
1367         need to trigger scrolling tree updates, and currently do not.
1368
1369         Fix by adding a "ChildNodes" dirty bit to ScrollingStateNode. There isn't any code that consults
1370         this flag when committing the scrolling tree because we always eagerly traverse children, but
1371         we could use it to optimize later. The important part is that we use it to trigger a tree update.
1372         
1373         Can't test via z-reordering until webkit.org/b/192529 is fixed.
1374
1375         Tests: scrollingcoordinator/gain-scrolling-node-parent.html
1376                scrollingcoordinator/lose-scrolling-node-parent.html
1377
1378         * page/scrolling/ScrollingStateNode.cpp:
1379         (WebCore::ScrollingStateNode::appendChild):
1380         (WebCore::ScrollingStateNode::insertChild):
1381         (WebCore::ScrollingStateNode::removeChildAtIndex):
1382         * page/scrolling/ScrollingStateNode.h:
1383         * page/scrolling/ScrollingStateTree.cpp:
1384         (WebCore::ScrollingStateTree::attachNode):
1385
1386 2019-01-22  Devin Rousso  <drousso@apple.com>
1387
1388         Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
1389         https://bugs.webkit.org/show_bug.cgi?id=116191
1390         <rdar://problem/13905910>
1391
1392         Reviewed by Joseph Pecoraro.
1393
1394         Test inspector/timeline/line-column.html
1395
1396         * bindings/js/ScriptController.cpp:
1397         (WebCore::ScriptController::evaluateInWorld):
1398         (WebCore::ScriptController::evaluateModule):
1399
1400         * bindings/js/JSExecStateInstrumentation.h:
1401         (WebCore::JSExecState::instrumentFunctionInternal):
1402
1403         * inspector/InspectorInstrumentation.h:
1404         (WebCore::InspectorInstrumentation::willCallFunction):
1405         (WebCore::InspectorInstrumentation::willEvaluateScript):
1406         * inspector/InspectorInstrumentation.cpp:
1407         (WebCore::InspectorInstrumentation::willCallFunctionImpl):
1408         (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
1409
1410         * inspector/agents/InspectorTimelineAgent.h:
1411         * inspector/agents/InspectorTimelineAgent.cpp:
1412         (WebCore::InspectorTimelineAgent::willCallFunction):
1413         (WebCore::InspectorTimelineAgent::willEvaluateScript):
1414
1415         * inspector/TimelineRecordFactory.h:
1416         * inspector/TimelineRecordFactory.cpp:
1417         (WebCore::TimelineRecordFactory::createFunctionCallData):
1418         (WebCore::TimelineRecordFactory::createEvaluateScriptData):
1419
1420         * bindings/js/ScriptSourceCode.h:
1421         (WebCore::ScriptSourceCode::startColumn const): Added.
1422
1423 2019-01-22  Devin Rousso  <drousso@apple.com>
1424
1425         Web Inspector: expose Audit and Recording versions to the frontend
1426         https://bugs.webkit.org/show_bug.cgi?id=193262
1427         <rdar://problem/47130684>
1428
1429         Reviewed by Joseph Pecoraro.
1430
1431         Tests: inspector/audit/version.html
1432                inspector/recording/version.html
1433
1434         * inspector/agents/InspectorCanvasAgent.cpp:
1435         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
1436
1437 2019-01-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1438
1439         Add some bindings-related bookkeeping to UndoManager and UndoItem
1440         https://bugs.webkit.org/show_bug.cgi?id=193111
1441         <rdar://problem/44807048>
1442
1443         Reviewed by Ryosuke Niwa.
1444
1445         This patch is work in progress towards supporting `UndoManager.addItem()`. Here, we add helper methods to
1446         UndoItem and UndoManager which later patches will exercise, as well as introduce some custom bindings to
1447         properly handle the case where UndoItems are given anonymous JavaScript functions (see below for more details).
1448
1449         No new tests, because there is no script-observable change in behavior yet. When `addItems()` is hooked up, I
1450         will write a test to verify that the undo and redo JavaScript functions survive garbage collection.
1451
1452         * Sources.txt:
1453         * WebCore.xcodeproj/project.pbxproj:
1454         * bindings/js/JSUndoItemCustom.cpp:
1455         (WebCore::JSUndoItem::visitAdditionalChildren):
1456
1457         Have each JSUndoItem visit its undo and redo callback functions to ensure that the JavaScript wrapper objects
1458         for these functions are not garbage collected underneath the item.
1459
1460         (WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
1461
1462         Consider the undo item wrapper reachable from opaque roots if it is associated with its UndoManager's Document.
1463         This ensures that if script isn't holding on to a reference to the wrapper (for instance, by calling
1464         `UndoManager.addItem(new UndoItem({ ... }))`), we still protect the corresponding JSUndoItem as long as the
1465         UndoManager's Document is alive. In the case where the undo item is not associated with a document, either (1)
1466         script is keeping a reference to it, in which case it will be trivially reachable, or (2) script won't be able
1467         to observe the destruction of the wrapper anyways (e.g. calling `new UndoItem({ ... })` by itself).
1468
1469         * dom/Document.cpp:
1470         (WebCore::Document::prepareForDestruction):
1471
1472         Invalidate all undo items when the document is about to go away.
1473
1474         * page/UndoItem.cpp:
1475         (WebCore::UndoItem::setUndoManager):
1476         (WebCore::UndoItem::invalidate):
1477         (WebCore::UndoItem::isValid const):
1478
1479         Add a few helpers, to be used in a future patch. We consider an UndoItem valid if it has been added to an
1480         UndoManager, and is thus associated with a document.
1481
1482         (WebCore::UndoItem::document const):
1483         * page/UndoItem.h:
1484         * page/UndoItem.idl:
1485         * page/UndoManager.cpp:
1486         (WebCore::UndoManager::UndoManager):
1487         (WebCore::UndoManager::addItem):
1488
1489         Have an UndoManager keep its UndoItems alive. These UndoItems remain in this set until either the document will
1490         be destroyed, or the corresponding undo action is no longer needed because the platform undo stack has changed
1491         (this latter behavior is yet to be implemented).
1492
1493         (WebCore::UndoManager::removeItem):
1494         (WebCore::UndoManager::removeAllItems):
1495         * page/UndoManager.h:
1496         (WebCore::UndoManager::UndoManager): Deleted.
1497         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1498
1499         Unified build fix.
1500
1501 2019-01-22  Fujii Hironori  <Hironori.Fujii@sony.com>
1502
1503         [WinCairo][WebKitTestRunner] Null dereference of GraphicsContext::m_data in GraphicsContext::releaseWindowsContext
1504         https://bugs.webkit.org/show_bug.cgi?id=193664
1505
1506         Reviewed by Brent Fulgham.
1507
1508         WinCairo WebKitTestRunner always crash on openning test cases of
1509         HTMLMeterElement.
1510
1511         If GraphicsContext::getWindowsContext retruned null HDC,
1512         LocalWindowsContext shouldn't release the null HDC.
1513
1514         Covered by existing tests.
1515
1516         * platform/graphics/win/LocalWindowsContext.h:
1517         (WebCore::LocalWindowsContext::~LocalWindowsContext):
1518         Release m_hdc only if it isn't null.
1519
1520 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1521
1522         Unreviewed, fix -Wsign-compare warning
1523         https://bugs.webkit.org/show_bug.cgi?id=188697
1524         <rdar://problem/46105624>
1525
1526         * css/StyleProperties.cpp:
1527         (WebCore::StyleProperties::asText const):
1528
1529 2019-01-22  Devin Rousso  <drousso@apple.com>
1530
1531         Web Inspector: Audit: provide a way to get related Accessibility properties for a given node
1532         https://bugs.webkit.org/show_bug.cgi?id=193227
1533         <rdar://problem/46787862>
1534
1535         Reviewed by Joseph Pecoraro.
1536
1537         Test: inspector/audit/run-accessibility.html
1538
1539         * inspector/InspectorAuditAccessibilityObject.idl:
1540         * inspector/InspectorAuditAccessibilityObject.h:
1541         * inspector/InspectorAuditAccessibilityObject.cpp:
1542         (WebCore::InspectorAuditAccessibilityObject::getComputedProperties): Added.
1543
1544 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
1545
1546         Remove an iOS quirk where iframe renderers are identified as "RenderPartObject" in layout test results
1547         https://bugs.webkit.org/show_bug.cgi?id=193692
1548
1549         Reviewed by Zalan Bujtas.
1550
1551         Remove the iOS-specific renderName() implementation.
1552
1553         * rendering/RenderIFrame.h:
1554
1555 2019-01-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
1556
1557         Dynamic changes in the style attributes of an SVGElement do no affect the <use> instances
1558         https://bugs.webkit.org/show_bug.cgi?id=193647
1559
1560         Reviewed by Simon Fraser.
1561
1562         Changing a style attribute of an SVGELement needs to call invalidateInstances().
1563
1564         Tests: svg/custom/svg-use-style-dynamic-change-invalidate.svg
1565
1566         * svg/SVGElement.cpp:
1567         (WebCore::SVGElement::attributeChanged):
1568
1569 2019-01-22  Alex Christensen  <achristensen@webkit.org>
1570
1571         Fix more builds.
1572
1573         * platform/network/curl/CurlResourceHandleDelegate.cpp:
1574         (WebCore::handleCookieHeaders):
1575         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
1576
1577 2019-01-22  Alex Christensen  <achristensen@webkit.org>
1578
1579         Fix some builds after r240292
1580         https://bugs.webkit.org/show_bug.cgi?id=193580
1581
1582         * platform/network/curl/ResourceHandleCurl.cpp:
1583         (WebCore::ResourceHandle::createCurlRequest):
1584         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1585         (WebCore::ResourceHandle::receivedCredential):
1586         (WebCore::ResourceHandle::getCredential):
1587
1588 2019-01-22  Alex Christensen  <achristensen@webkit.org>
1589
1590         Move NetworkStorageSession ownership to NetworkProcess
1591         https://bugs.webkit.org/show_bug.cgi?id=193580
1592
1593         Reviewed by Geoff Garen.
1594
1595         NetworkStorageSessions used to be owned by a process-global map living in WebCore.
1596         This patch moves the ownership to the WebKit/WebKitLegacy layer.
1597         In WebKitLegacy they are still owned by a process-global map for compatibility.
1598         In WebKit they are owned by a map owned by the NetworkProcess object.
1599         There were three non-NetworkProcess uses of NetworkStorageSessions which have been dealt with thusly:
1600         1. The WebProcess used to clear credentials from a NetworkStorageSession.  Since this was the only use
1601         of a NetworkStorageSession in the WebProcess we can conclude there were no credentials to clear,
1602         so this code was removed with no change in behavior.
1603         2. The WebProcess used NetworkStorageSessions to get persistent credentials.  This was turned
1604         into a static method that does the same thing.  We should audit these calls and decide if we really want them.
1605         3. The UIProcess used NetworkStorageSessions in APIHTTPCookieStore to interact with the default cookie
1606         storage on Cocoa platforms.  This has been replaced by functions that do the same thing directly.
1607
1608         * platform/network/CredentialStorage.h:
1609         * platform/network/NetworkStorageSession.cpp:
1610         (WebCore::NetworkStorageSession::processMayUseCookieAPI):
1611         (WebCore::NetworkStorageSession::globalSessionMap): Deleted.
1612         (WebCore::NetworkStorageSession::storageSession): Deleted.
1613         (WebCore::NetworkStorageSession::destroySession): Deleted.
1614         (WebCore::NetworkStorageSession::forEach): Deleted.
1615         * platform/network/NetworkStorageSession.h:
1616         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1617         (WebCore::NetworkStorageSession::createCFStorageSessionForIdentifier):
1618         (WebCore::createCFStorageSessionForIdentifier): Deleted.
1619         (WebCore::defaultNetworkStorageSession): Deleted.
1620         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
1621         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
1622         (WebCore::NetworkStorageSession::ensureSession): Deleted.
1623         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1624         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
1625         * platform/network/cocoa/CookieStorageObserver.h:
1626         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1627         (WebCore::defaultSession): Deleted.
1628         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
1629         (WebCore::NetworkStorageSession::ensureSession): Deleted.
1630         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
1631         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1632         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
1633         (WebCore::defaultSession): Deleted.
1634         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
1635         (WebCore::NetworkStorageSession::ensureSession): Deleted.
1636         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
1637
1638 2019-01-22  Devin Rousso  <drousso@apple.com>
1639
1640         Web Inspector: Audit: provide a way to get related Accessibility nodes for a given node
1641         https://bugs.webkit.org/show_bug.cgi?id=193225
1642         <rdar://problem/46799956>
1643
1644         Reviewed by Joseph Pecoraro.
1645
1646         Test: inspector/audit/run-accessibility.html
1647
1648         * inspector/InspectorAuditAccessibilityObject.idl:
1649         * inspector/InspectorAuditAccessibilityObject.h:
1650         * inspector/InspectorAuditAccessibilityObject.cpp:
1651         (WebCore::InspectorAuditAccessibilityObject::getActiveDescendant): Added.
1652         (WebCore::addChildren): Added.
1653         (WebCore::InspectorAuditAccessibilityObject::getChildNodes): Added.
1654         (WebCore::InspectorAuditAccessibilityObject::getControlledNodes): Added.
1655         (WebCore::InspectorAuditAccessibilityObject::getFlowedNodes): Added.
1656         (WebCore::InspectorAuditAccessibilityObject::getMouseEventNode): Added.
1657         (WebCore::InspectorAuditAccessibilityObject::getOwnedNodes): Added.
1658         (WebCore::InspectorAuditAccessibilityObject::getParentNode): Added.
1659         (WebCore::InspectorAuditAccessibilityObject::getSelectedChildNodes): Added.
1660
1661 2019-01-22  David Kilzer  <ddkilzer@apple.com>
1662
1663         Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
1664         <https://webkit.org/b/193654>
1665         <rdar://problem/47430290>
1666
1667         Reviewed by Alex Christensen.
1668
1669         - Moves QuickLookSoftLink.{h,mm} to PAL.
1670         - Adds soft-link to 3 classes to consolidate QuickLook.framework
1671           soft-linking.
1672         - Updates existing source to work with above changes.
1673
1674         * SourcesCocoa.txt:
1675         * UnifiedSources-input.xcfilelist:
1676         * WebCore.xcodeproj/project.pbxproj:
1677         - Remove QuickLookSoftLink.{h,mm} due to move to PAL.
1678
1679         * platform/ios/QuickLook.mm:
1680         (WebCore::QLPreviewGetSupportedMIMETypesSet):
1681         (WebCore::registerQLPreviewConverterIfNeeded):
1682         - Update for QuickLookSoftLink.{h,mm} move to PAL.
1683
1684         * platform/network/ios/PreviewConverter.mm:
1685         (WebCore::optionsWithPassword):
1686         (WebCore::PreviewConverter::PreviewConverter):
1687         - Switch to using QuickLookSoftLink.{h,mm} in PAL.
1688
1689         * platform/network/ios/WebCoreURLResponseIOS.mm:
1690         (WebCore::adjustMIMETypeIfNecessary):
1691         - Update for QuickLookSoftLink.{h,mm} move to PAL.
1692
1693 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
1694
1695         Fix the position of layers nested inside of composited overflow-scroll
1696         https://bugs.webkit.org/show_bug.cgi?id=193642
1697
1698         Reviewed by Antti Koivisto and Sam Weinig.
1699
1700         Remove an iOS #ifdef so that layers inside composited overflow gets the correct
1701         positions on macOS too.
1702
1703         Test: compositing/geometry/fixed-inside-overflow-scroll.html
1704
1705         * rendering/RenderLayerBacking.cpp:
1706         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
1707
1708 2019-01-22  Claudio Saavedra  <csaavedra@igalia.com>
1709
1710         [GTK] Build fix for Ubuntu LTS 16.04
1711         https://bugs.webkit.org/show_bug.cgi?id=193672
1712
1713         Unreviewed build fix.
1714
1715         * html/canvas/CanvasStyle.h: Add default copy constructor for
1716         CMYKAColor struct.
1717
1718 2019-01-22  David Kilzer  <ddkilzer@apple.com>
1719
1720         Leak of NSMutableArray (128 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
1721         <https://webkit.org/b/193673>
1722         <rdar://problem/47448241>
1723
1724         Reviewed by Dean Jackson.
1725
1726         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1727         (WebCore::appendArgumentToArray): Use adoptNS() to fix the leak.
1728
1729 2019-01-22  Zalan Bujtas  <zalan@apple.com>
1730
1731         [LFC][Floats] Decouple clearance computation and margin collapsing reset.
1732         https://bugs.webkit.org/show_bug.cgi?id=193670
1733
1734         Reviewed by Antti Koivisto.
1735
1736         Move margin collapsing reset logic from FloatingContext to BlockFormattingContext. It's the BlockFormattingContext's job to do.
1737         This is also in preparation for adding clear to static position.
1738
1739         * layout/FormattingContext.cpp:
1740         (WebCore::Layout::FormattingContext::mapTopToAncestor):
1741         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor): Deleted.
1742         * layout/FormattingContext.h:
1743         * layout/blockformatting/BlockFormattingContext.cpp:
1744         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1745         * layout/floats/FloatingContext.cpp:
1746         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1747         * layout/floats/FloatingContext.h:
1748
1749 2019-01-22  Frederic Wang  <fwang@igalia.com>
1750
1751         Minor refactoring of the scrolling code
1752         https://bugs.webkit.org/show_bug.cgi?id=192398
1753
1754         Unreviewed build fix.
1755
1756         * page/scrolling/ScrollingTreeScrollingNode.cpp: Add missing header.
1757
1758 2019-01-22  Oriol Brufau  <obrufau@igalia.com>
1759
1760         [css-logical] Implement flow-relative margin, padding and border shorthands
1761         https://bugs.webkit.org/show_bug.cgi?id=188697
1762
1763         Reviewed by Simon Fraser and Antti Koivisto.
1764
1765         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
1766                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
1767                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
1768                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
1769                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
1770                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
1771                webexposed/css-properties-behind-flags.html
1772
1773         * css/CSSComputedStyleDeclaration.cpp:
1774         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1775         Allow the new properties to serialize their computed value.
1776
1777         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
1778         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
1779         * css/CSSComputedStyleDeclaration.h:
1780         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
1781         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
1782         shorthands.
1783
1784         * css/CSSProperties.json:
1785         Add the new properties behind the CSSLogicalEnabled runtime flag.
1786
1787         * css/CSSStyleDeclaration.cpp:
1788         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
1789         Prevent CSS properties disabled behind a runtime flag from being exposed in
1790         style declarations.
1791
1792         * css/StyleProperties.cpp:
1793         (WebCore::StyleProperties::getPropertyValue const):
1794         Allow the new properties to serialize their specified value.
1795
1796         (WebCore::StyleProperties::get2Values const):
1797         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
1798
1799         (WebCore::StyleProperties::borderPropertyValue const):
1800         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
1801         corresponding to width, style and color.
1802
1803         (WebCore::MutableStyleProperties::setProperty):
1804         Prevent CSS properties disabled behind a runtime flag from being set a value.
1805
1806         (WebCore::StyleProperties::asText const):
1807         Allow the new properties to be serialized in cssText.
1808         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
1809         and serialize the longhands instead. Note that there could be another shorthand
1810         available which is enabled, but a proper solution would require bug 190496.
1811
1812         * css/StyleProperties.h:
1813         Update declarations of borderPropertyValue and get2Values.
1814
1815         * css/makeprop.pl:
1816         (addProperty):
1817         Add isEnabledCSSProperty function for checking that a CSS property is not
1818         disabled behind a runtime flag.
1819
1820         * css/parser/CSSPropertyParser.cpp:
1821         (WebCore::cssPropertyID):
1822         Prevent CSS properties disabled behind a runtime flag from being exposed in
1823         computed styles.
1824
1825         (WebCore::CSSPropertyParser::addProperty):
1826         Prevent CSS properties disabled behind a runtime flag from being set a value.
1827
1828         (WebCore::CSSPropertyParser::consumeBorder):
1829         Change consumeBorder to provide the caller with the parsed values instead of
1830         setting properties. Then the caller can decide to which properties the values
1831         should be set, and whether border-image should be reset or not.
1832
1833         (WebCore::CSSPropertyParser::consume2ValueShorthand):
1834         (WebCore::CSSPropertyParser::consume4ValueShorthand):
1835         Rename consume4Values to consume4ValueShorthand, and add analogous
1836         consume2ValueShorthand for parsing shorthands with two longhands.
1837
1838         (WebCore::CSSPropertyParser::parseShorthand):
1839         Allow the new properties to be parsed.
1840
1841         * css/parser/CSSPropertyParser.h:
1842         Update declarations of consumeBorder, consume2ValueShorthand and
1843         consume4ValueShorthand.
1844
1845         * inspector/agents/InspectorCSSAgent.cpp:
1846         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
1847         Prevent CSS properties disabled behind a runtime flag from being exposed in
1848         the CSS inspector tool.
1849
1850         * page/RuntimeEnabledFeatures.h:
1851         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
1852         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
1853         Add the CSSLogicalEnabled runtime flag.
1854
1855 2019-01-21  Antti Koivisto  <antti@apple.com>
1856
1857         [iOS] Handle hit testing for subframes
1858         https://bugs.webkit.org/show_bug.cgi?id=192303
1859
1860         Reviewed by Frédéric Wang.
1861
1862         Don't set delegatesScrolling bit for subframes on iOS. It is meant for top level application
1863         controlled scrolling. This fixes coordinate conversions for subframes and makes events work.
1864
1865         Test by Frederic Wang.
1866
1867         Test: fast/scrolling/ios/hit-testing-iframe.html
1868
1869         * platform/ScrollView.cpp:
1870         (WebCore::ScrollView::managesScrollbars const):
1871
1872         Add a function that tells if the scrollview should deal with scrollbars at all
1873         This is always false on iOS and not connected to delegatesScrolling bit.
1874
1875         (WebCore::ScrollView::updateScrollbars):
1876         * platform/ScrollView.h:
1877         * rendering/RenderLayerCompositor.cpp:
1878         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
1879
1880 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
1881
1882         Implement message handlers for NetworkProcess-based ResourceLoadStatistics
1883         https://bugs.webkit.org/show_bug.cgi?id=193556
1884         <rdar://problem/47368501>
1885
1886         Reviewed by Alex Christensen.
1887
1888         This patch adds a new observer callback used to message the NetworkProcess when
1889         user interaction events are received. This is needed when the ResourceLoadStatistics
1890         data is not being managed by the UIProcess.
1891
1892         Tested by existing ResourceLoadStatistics and storageAccess tests.
1893
1894         * loader/ResourceLoadObserver.cpp:
1895         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
1896         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1897         * loader/ResourceLoadObserver.h:
1898         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1899         (WebCore::NetworkStorageSession::setCookiesFromDOM):
1900
1901 2019-01-21  Zalan Bujtas  <zalan@apple.com>
1902
1903         [LFC][Floats] Take float top position into account when computing containing block height.
1904         https://bugs.webkit.org/show_bug.cgi?id=193655
1905
1906         Reviewed by Antti Koivisto.
1907
1908         When computing the containing block height, we take the first in-flow child's top position and use it as the base position.
1909         However when the first in-flow child clears a previous sibling, its vertical position is not necessarily the correct base for
1910         computing the containing block's height. Let's take the relevant floats into account as well.
1911
1912         Test: fast/block/float/float-first-child-and-clear-sibling.html
1913
1914         * layout/FormattingContextGeometry.cpp:
1915         (WebCore::Layout::contentHeightForFormattingContextRoot):
1916         * layout/floats/FloatingContext.cpp:
1917         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1918         * layout/floats/FloatingState.cpp:
1919         (WebCore::Layout::FloatingState::top const):
1920         * layout/floats/FloatingState.h:
1921
1922 2019-01-21  David Kilzer  <ddkilzer@apple.com>
1923
1924         REGRESSION (r240237): Revert changes to WebCore Xcode project
1925
1926         * WebCore.xcodeproj/project.pbxproj: Revert changes that were
1927         fixed in r240135.  Darin's patch must have been made prior to
1928         r240135.
1929
1930 2019-01-21  David Kilzer  <ddkilzer@apple.com>
1931
1932         REGRESSION (r240201): Add a POINTER_EVENTS feature flag
1933         https://bugs.webkit.org/show_bug.cgi?id=193577
1934         <rdar://problem/47408511>
1935
1936         * dom/ios/PointerEventIOS.cpp: Add ENABLE(POINTER_EVENTS) macro
1937         to fix tvOS & watchOS builds.
1938
1939 2019-01-15  Darin Adler  <darin@apple.com>
1940
1941         Use references rather than pointers for register/unregister functions, and more
1942         https://bugs.webkit.org/show_bug.cgi?id=175028
1943
1944         Reviewed by Daniel Bates.
1945
1946         * Modules/applepay/ApplePaySession.cpp:
1947         (WebCore::ApplePaySession::begin): Pass a reference.
1948         (WebCore::ApplePaySession::completePayment): Ditto.
1949         (WebCore::ApplePaySession::didReachFinalState): Ditto.
1950         * Modules/cache/DOMCache.cpp:
1951         (WebCore::DOMCache::retrieveRecords): Ditto.
1952         (WebCore::DOMCache::batchDeleteOperation): Ditto.
1953         (WebCore::DOMCache::batchPutOperation): Ditto.
1954         * Modules/cache/DOMCacheStorage.cpp:
1955         (WebCore::DOMCacheStorage::match): Ditto.
1956         * Modules/fetch/FetchBodyOwner.cpp:
1957         (WebCore::FetchBodyOwner::loadBlob): Ditto.
1958         (WebCore::FetchBodyOwner::finishBlobLoading): Ditto.
1959         * Modules/fetch/FetchBodySource.cpp:
1960         (WebCore::FetchBodySource::setActive): Ditto.
1961         (WebCore::FetchBodySource::setInactive): Ditto.
1962         * Modules/fetch/FetchResponse.cpp:
1963         (WebCore::FetchResponse::BodyLoader::BodyLoader): Ditto.
1964         (WebCore::FetchResponse::BodyLoader::~BodyLoader): Ditto.
1965         * Modules/mediasource/MediaSource.cpp:
1966         (WebCore::MediaSource::addedToRegistry): Ditto.
1967         (WebCore::MediaSource::removedFromRegistry): Ditto.
1968         * Modules/mediastream/MediaStream.cpp:
1969         (WebCore::MediaStream::~MediaStream): Ditto.
1970         (WebCore::MediaStream::startProducingData): Ditto.
1971         * Modules/mediastream/MediaStreamTrack.cpp:
1972         (WebCore::MediaStreamTrack::MediaStreamTrack): Ditto.
1973         (WebCore::MediaStreamTrack::~MediaStreamTrack): Ditto.
1974         * Modules/mediastream/RTCDataChannel.cpp:
1975         (WebCore::RTCDataChannel::create): Ditto.
1976         (WebCore::RTCDataChannel::close): Ditto.
1977         * Modules/mediastream/RTCPeerConnection.cpp:
1978         (WebCore::RTCPeerConnection::create): Use auto.
1979         * Modules/notifications/Notification.cpp:
1980         (WebCore::Notification::show): Pass a reference.
1981         (WebCore::Notification::finalize): Ditto.
1982         * Modules/webaudio/AudioBasicInspectorNode.cpp:
1983         (WebCore::AudioBasicInspectorNode::updatePullStatus): Ditto.
1984
1985         * Modules/webaudio/AudioContext.cpp:
1986         (WebCore::AudioContext::constructCommon): Ditto.
1987         (WebCore::AudioContext::lazyInitialize): Ditto.
1988         (WebCore::AudioContext::clear): Ditto.
1989         (WebCore::AudioContext::uninitialize): Ditto.
1990         (WebCore::AudioContext::markForDeletion): Take a reference.
1991         (WebCore::AudioContext::addAutomaticPullNode): Ditto.
1992         (WebCore::AudioContext::removeAutomaticPullNode): Ditto.
1993         (WebCore::AudioContext::willBeginPlayback): Pass a reference.
1994         (WebCore::AudioContext::willPausePlayback): Ditto.
1995         * Modules/webaudio/AudioContext.h: Update above functions to take
1996         references rather than pointers.
1997
1998         * Modules/webaudio/AudioNode.cpp:
1999         (WebCore::AudioNode::finishDeref): Pass a reference.
2000         * Modules/websockets/WebSocket.cpp:
2001         (WebCore::WebSocket::connect): Ditto.
2002         (WebCore::WebSocket::stop): Ditto.
2003         (WebCore::WebSocket::didClose): Ditto.
2004
2005         * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to update this file.
2006
2007         * bindings/js/JSDOMWindowBase.cpp:
2008         (WebCore::JSDOMWindowBase::moduleLoaderResolve): Update since
2009         moduleLoader is now a reference.
2010         (WebCore::JSDOMWindowBase::moduleLoaderFetch): Ditto.
2011         (WebCore::JSDOMWindowBase::moduleLoaderEvaluate): Ditto.
2012         (WebCore::JSDOMWindowBase::moduleLoaderImportModule): Ditto.
2013         (WebCore::JSDOMWindowBase::moduleLoaderCreateImportMetaProperties): Ditto.
2014
2015         * dom/ActiveDOMObject.h:
2016         (WebCore::ActiveDOMObject::setPendingActivity): Take a reference.
2017         (WebCore::ActiveDOMObject::unsetPendingActivity): Ditto.
2018
2019         * dom/CharacterData.cpp:
2020         (WebCore::CharacterData::setData): Pass a reference.
2021         (WebCore::CharacterData::insertData): Ditto.
2022         (WebCore::CharacterData::deleteData): Ditto.
2023         (WebCore::CharacterData::replaceData): Ditto.
2024
2025         * dom/Document.cpp:
2026         (WebCore::Document::getElementByAccessKey): Pass a reference.
2027         (WebCore::Document::buildAccessKeyMap): Take a reference.
2028         (WebCore::Document::registerForVisibilityStateChangedCallbacks): Ditto.
2029         (WebCore::Document::unregisterForVisibilityStateChangedCallbacks): Ditto.
2030         (WebCore::Document::addAudioProducer): Ditto.
2031         (WebCore::Document::removeAudioProducer): Ditto.
2032         (WebCore::Document::hoveredElementDidDetach): Ditto.
2033         (WebCore::Document::elementInActiveChainDidDetach): Ditto.
2034         (WebCore::Document::attachNodeIterator): Ditto.
2035         (WebCore::Document::detachNodeIterator): Ditto.
2036         (WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Pass
2037         a reference.
2038         (WebCore::Document::nodeChildrenWillBeRemoved): Ditto.
2039         (WebCore::Document::nodeWillBeRemoved): Ditto.
2040         (WebCore::Document::textInserted): Take a reference.
2041         (WebCore::Document::textRemoved): Ditto.
2042         (WebCore::Document::textNodesMerged): Ditto.
2043         (WebCore::Document::textNodeSplit): Ditto.
2044         (WebCore::Document::takeDOMWindowFrom): Ditto.
2045         (WebCore::Document::registerForDocumentSuspensionCallbacks): Ditto.
2046         (WebCore::Document::unregisterForDocumentSuspensionCallbacks): Ditto.
2047         (WebCore::Document::registerForMediaVolumeCallbacks): Ditto.
2048         (WebCore::Document::unregisterForMediaVolumeCallbacks): Ditto.
2049         (WebCore::Document::registerForPrivateBrowsingStateChangedCallbacks): Ditto.
2050         (WebCore::Document::unregisterForPrivateBrowsingStateChangedCallbacks): Ditto.
2051         (WebCore::Document::registerForCaptionPreferencesChangedCallbacks): Ditto.
2052         (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks): Ditto.
2053         (WebCore::Document::registerForPageScaleFactorChangedCallbacks): Ditto.
2054         (WebCore::Document::unregisterForPageScaleFactorChangedCallbacks): Ditto.
2055         (WebCore::Document::finishedParsing): Use a reference.
2056         (WebCore::Document::attachRange): Take a reference.
2057         (WebCore::Document::detachRange): Ditto.
2058         (WebCore::Document::suspendScheduledTasks): Use a reference.
2059         (WebCore::Document::resumeScheduledTasks): Ditto.
2060         (WebCore::Document::addMediaCanStartListener): Take a reference.
2061         (WebCore::Document::removeMediaCanStartListener): Ditto.
2062         (WebCore::Document::deviceMotionController const): Return a reference.
2063         (WebCore::Document::deviceOrientationController const): Ditto.
2064         (WebCore::Document::simulateDeviceOrientationChange): Use a reference.
2065         (WebCore::Document::fullScreenIsAllowedForElement const): Take a reference.
2066         (WebCore::Document::requestFullScreenForElement): Pass a reference.
2067         (WebCore::Document::webkitExitFullscreen): Ditto.
2068         (WebCore::Document::webkitWillEnterFullScreen): Renamed to remove the
2069         "ForElement" from the function name. Take a reference rather than a pointer.
2070         (WebCore::Document::webkitDidEnterFullScreen): Renamed to remove the
2071         "ForElement" from the function name and removed the unused element argument.
2072         (WebCore::Document::webkitWillExitFullScreen): Ditto.
2073         (WebCore::Document::webkitDidExitFullScreen): Ditto.
2074         (WebCore::Document::pushFullscreenElementStack): Take a reference.
2075         (WebCore::Document::addDocumentToFullScreenChangeEventQueue): Ditto.
2076         (WebCore::DocumentParserYieldToken::DocumentParserYieldToken): Use a reference.
2077         (WebCore::DocumentParserYieldToken::~DocumentParserYieldToken): Ditto.
2078         (WebCore::Document::updateHoverActiveState): Updated name of isInActiveChain.
2079
2080         * dom/Document.h: Updated argument types as described above. Changed a couple
2081         of inline functions to return references.
2082
2083         * dom/DocumentMarkerController.cpp:
2084         (WebCore::DocumentMarkerController::addMarker): Take a reference.
2085         (WebCore::DocumentMarkerController::addMarkerToNode): Ditto.
2086         (WebCore::DocumentMarkerController::addTextMatchMarker): Ditto.
2087         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker): Ditto.
2088         (WebCore::DocumentMarkerController::addDictationResultMarker): Ditto.
2089         (WebCore::DocumentMarkerController::addDraggedContentMarker): Ditto.
2090         (WebCore::DocumentMarkerController::removeMarkers): Ditto.
2091         (WebCore::DocumentMarkerController::copyMarkers): Ditto.
2092         (WebCore::DocumentMarkerController::shiftMarkers): Ditto.
2093         (WebCore::DocumentMarkerController::setMarkersActive): DItto.
2094         * dom/DocumentMarkerController.h: Updated argument types as described above.
2095
2096         * dom/Element.cpp:
2097         (WebCore::Element::~Element): Pass a reference.
2098         (WebCore::Element::isUserActionElementInActiveChain const): Updated name of
2099         isInActiveChain.
2100         (WebCore::Element::hasEquivalentAttributes const): Take a reference.
2101         (WebCore::Element::removedFromAncestor): Pass a reference.
2102         (WebCore::Element::clearHoverAndActiveStatusBeforeDetachingRenderer):
2103         Pass a reference and updated name of isInActiveChain.
2104
2105         * dom/Element.h: Renamed inActiveChain to isInActiveChain, updated argument
2106         types to be references, and removed unneeded friend declaration and made
2107         SynchronizationOfLazyAttribute private.
2108
2109         * dom/Node.cpp:
2110         (WebCore::Node::normalize): Pass a reference.
2111         (WebCore::Node::isEqualNode const): Ditto.
2112         * dom/NodeIterator.cpp:
2113         (WebCore::NodeIterator::NodeIterator): Ditto.
2114         (WebCore::NodeIterator::~NodeIterator): Ditto.
2115
2116         * dom/RadioButtonGroups.cpp:
2117         (WebCore::RadioButtonGroup::add): Take a reference.
2118         (WebCore::RadioButtonGroup::updateCheckedState): Ditto.
2119         (WebCore::RadioButtonGroup::remove): Ditto.
2120         (WebCore::RadioButtonGroup::contains const): Ditto.
2121         (WebCore::RadioButtonGroups::addButton): Ditto.
2122         (WebCore::RadioButtonGroups::updateCheckedState): Ditto.
2123         (WebCore::RadioButtonGroups::hasCheckedButton const): Ditto.
2124         (WebCore::RadioButtonGroups::isInRequiredGroup const): Ditto.
2125         (WebCore::RadioButtonGroups::removeButton): Ditto.
2126         * dom/RadioButtonGroups.h: Updated argument types.
2127
2128         * dom/Range.cpp:
2129         (WebCore::Range::Range): Pass a reference.
2130         (WebCore::Range::~Range): Ditto.
2131         (WebCore::Range::setDocument): Ditto.
2132         (WebCore::Range::createContextualFragment): Ditto.
2133         (WebCore::boundaryTextInserted): Ditto.
2134         (WebCore::Range::textInserted): Ditto.
2135         (WebCore::boundaryTextRemoved): Ditto.
2136         (WebCore::Range::textRemoved): Ditto.
2137         (WebCore::boundaryTextNodesSplit): Ditto.
2138         (WebCore::Range::textNodeSplit): Ditto.
2139         * dom/Range.h: Take references instead of pointers.
2140
2141         * dom/ScriptElement.cpp:
2142         (WebCore::ScriptElement::prepareScript): Use reference.
2143
2144         * dom/Text.cpp:
2145         (WebCore::Text::splitText): Pass reference.
2146
2147         * dom/UserActionElementSet.h: Renamed inActiveChain to isInActiveChain to
2148         match the naming scheme of the other similar functions, like isActive.
2149
2150         * editing/AlternativeTextController.cpp:
2151         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2152         Pass a reference.
2153         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Ditto.
2154         (WebCore::AlternativeTextController::handleAlternativeTextUIResult): Ditto.
2155         (WebCore::AlternativeTextController::respondToUnappliedEditing): Ditto.
2156         (WebCore::AlternativeTextController::markReversed): Ditto.
2157         (WebCore::AlternativeTextController::markCorrection): Ditto.
2158         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection): Ditto.
2159         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Ditto.
2160         * editing/CompositeEditCommand.cpp:
2161         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Ditto.
2162         * editing/DictationCommand.cpp: Ditto.
2163         * editing/Editing.cpp:
2164         (WebCore::areIdenticalElements): Ditto.
2165         * editing/Editor.cpp:
2166         (WebCore::Editor::ignoreSpelling): Ditto.
2167         (WebCore::Editor::learnSpelling): Ditto.
2168         (WebCore::Editor::advanceToNextMisspelling): Ditto.
2169         (WebCore::Editor::clearMisspellingsAndBadGrammar): Ditto.
2170         (WebCore::Editor::markMisspellingsAfterTypingToWord): Ditto.
2171         (WebCore::Editor::markAndReplaceFor): Ditto.
2172         (WebCore::Editor::changeBackToReplacedString): Ditto.
2173         (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Ditto.
2174         (WebCore::Editor::countMatchesForText): Ditto.
2175         (WebCore::Editor::scanRangeForTelephoneNumbers): Ditto.
2176         (WebCore::Editor::editorUIUpdateTimerFired): Ditto.
2177         (WebCore::Editor::handleAcceptedCandidate): Ditto.
2178
2179         * editing/InsertTextCommand.cpp:
2180         (WebCore::InsertTextCommand::doApply): Pass a reference.
2181         * editing/InsertTextCommand.h: Take a reference.
2182
2183         * editing/SpellChecker.cpp:
2184         (WebCore::SpellChecker::didCheckSucceed): Pass a reference.
2185         * editing/SplitTextNodeCommand.cpp:
2186         (WebCore::SplitTextNodeCommand::doApply): Ditto.
2187         (WebCore::SplitTextNodeCommand::doUnapply): Ditto.
2188         * editing/TextCheckingHelper.cpp:
2189         (WebCore::TextCheckingHelper::findFirstMisspelling): Pass a reference.
2190         (WebCore::TextCheckingHelper::findFirstGrammarDetail const): Ditto.
2191         * editing/ios/DictationCommandIOS.cpp:
2192         (WebCore::DictationCommandIOS::doApply): Ditto.
2193         Also added a comment about a possible missing null check; behavior should
2194         be no different than before, but using a reference helps make clear there
2195         was never any null check.
2196         * editing/ios/EditorIOS.mm:
2197         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
2198         * fileapi/FileReader.cpp:
2199         (WebCore::FileReader::readInternal): Ditto.
2200         (WebCore::FileReader::abort): Ditto.
2201         (WebCore::FileReader::didFinishLoading): Ditto.
2202         (WebCore::FileReader::didFail): Ditto.
2203
2204         * html/HTMLAppletElement.cpp: Removed unneeded include of HTMLDocument.h.
2205         There's very little left that is truly specific to HTMLDocument vs. Document.
2206
2207         * html/HTMLDocument.h:
2208         (WebCore::HTMLDocument::create): Take a reference.
2209         (WebCore::HTMLDocument::createSynthesizedDocument): Ditto.
2210
2211         * html/HTMLFormElement.cpp:
2212         (WebCore::HTMLFormElement::~HTMLFormElement): Pass a reference.
2213         (WebCore::HTMLFormElement::parseAttribute): Ditto.
2214         (WebCore::HTMLFormElement::didMoveToNewDocument): Ditto.
2215
2216         * html/HTMLIFrameElement.cpp: Removed unneeded include of HTMLDocument.h.
2217
2218         * html/HTMLInputElement.cpp:
2219         (WebCore::HTMLInputElement::~HTMLInputElement): Pass a reference.
2220         (WebCore::HTMLInputElement::setChecked): Ditto.
2221         (WebCore::HTMLInputElement::registerForSuspensionCallbackIfNeeded): Ditto.
2222         (WebCore::HTMLInputElement::unregisterForSuspensionCallbackIfNeeded): Ditto.
2223         (WebCore::HTMLInputElement::didMoveToNewDocument): Ditto.
2224         (WebCore::HTMLInputElement::isInRequiredRadioButtonGroup): Ditto.
2225         (WebCore::HTMLInputElement::addToRadioButtonGroup): Ditto.
2226         (WebCore::HTMLInputElement::removeFromRadioButtonGroup): Ditto.
2227         * html/HTMLMediaElement.cpp:
2228         (WebCore::HTMLMediaElement::registerWithDocument): Ditto.
2229         (WebCore::HTMLMediaElement::unregisterWithDocument): Ditto.
2230         (WebCore::HTMLMediaElement::selectMediaResource): Ditto.
2231         (WebCore::HTMLMediaElement::addTextTrack): Ditto.
2232         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
2233         (WebCore::HTMLMediaElement::resume): Ditto.
2234         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor): Ditto.
2235
2236         * html/HTMLNameCollection.cpp: Removed unneeded include of HTMLDocument.h.
2237
2238         * html/HTMLPlugInImageElement.cpp:
2239         (WebCore::HTMLPlugInImageElement::~HTMLPlugInImageElement): Pass a reference.
2240         (WebCore::HTMLPlugInImageElement::createElementRenderer): Ditto.
2241         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Ditto.
2242
2243         * html/HTMLSourceElement.cpp: Removed unneeded include of HTMLDocument.h.
2244         * html/HTMLTemplateElement.cpp: Ditto.
2245
2246         * html/RadioInputType.cpp:
2247         (WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
2248         Pass a reference.
2249         * loader/DocumentWriter.cpp:
2250         (WebCore::DocumentWriter::begin): Ditto.
2251         * page/DOMWindow.cpp:
2252         (WebCore::DOMWindow::addEventListener): Ditto.
2253         (WebCore::DOMWindow::removeEventListener): Ditto.
2254         (WebCore::DOMWindow::removeAllEventListeners): Ditto.
2255
2256         * page/EventHandler.cpp:
2257         (WebCore::EventHandler::didStartDrag): Use a reference.
2258
2259         * page/EventSource.cpp:
2260         (WebCore::EventSource::create): Pass reference.
2261         (WebCore::EventSource::networkRequestEnded): Ditto.
2262         (WebCore::EventSource::close): Ditto.
2263         (WebCore::EventSource::abortConnectionAttempt): Ditto.
2264
2265         * page/Frame.cpp: Removed unneeded include of HTMLDocument.h.
2266         * page/FrameView.cpp: Ditto.
2267         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const): Use reference.
2268
2269         * page/animation/AnimationBase.cpp:
2270         (WebCore::AnimationBase::updateStateMachine): Pass reference.
2271
2272         * page/animation/CSSAnimationController.cpp:
2273         (WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStyle): Take reference.
2274         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStyle): Ditto.
2275         (WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse): Ditto.
2276         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStartTimeResponse): Ditto.
2277         (WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved): Ditto.
2278         * page/animation/CSSAnimationControllerPrivate.h: Ditto.
2279
2280         * page/animation/CompositeAnimation.cpp:
2281         (WebCore::CompositeAnimation::clearElement): Pass reference.
2282         (WebCore::CompositeAnimation::updateTransitions): Ditto.
2283         (WebCore::CompositeAnimation::updateKeyframeAnimations): Ditto.
2284         * page/ios/FrameIOS.mm:
2285         (WebCore::Frame::initWithSimpleHTMLDocument): Ditto.
2286
2287         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2288         (WebCore::layerContentsFormat): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END so
2289         I can continue to compile with latest headers.
2290
2291         * rendering/CSSFilter.cpp:
2292         (WebCore::CSSFilter::buildReferenceFilter): Pass reference, small coding style
2293         tweaks as well.
2294
2295         * rendering/svg/RenderSVGResource.cpp:
2296         (WebCore::removeFromCacheAndInvalidateDependencies): Pass reference.
2297         * rendering/svg/RenderSVGResourceContainer.cpp:
2298         (WebCore::RenderSVGResourceContainer::registerResource): Ditto.
2299         * rendering/svg/SVGResources.cpp:
2300         (WebCore::registerPendingResource): Ditto.
2301         * rendering/svg/SVGResourcesCache.cpp:
2302         (WebCore::SVGResourcesCache::resourceDestroyed): Ditto.
2303
2304         * svg/SVGDocumentExtensions.cpp:
2305         (WebCore::SVGDocumentExtensions::addTimeContainer): Take reference.
2306         (WebCore::SVGDocumentExtensions::removeTimeContainer): Ditto.
2307         (WebCore::SVGDocumentExtensions::addResource): Ditto.
2308         (WebCore::SVGDocumentExtensions::addPendingResource): Ditto.
2309         (WebCore::SVGDocumentExtensions::isElementWithPendingResources const): Ditto.
2310         (WebCore::SVGDocumentExtensions::isPendingResource const): Ditto.
2311         (WebCore::SVGDocumentExtensions::clearHasPendingResourcesIfPossible): Ditto.
2312         (WebCore::SVGDocumentExtensions::removeElementFromPendingResources): Ditto.
2313         (WebCore::SVGDocumentExtensions::setOfElementsReferencingTarget): Ditto.
2314         (WebCore::SVGDocumentExtensions::addElementReferencingTarget): Ditto.
2315         (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): Ditto.
2316         (WebCore::SVGDocumentExtensions::clearTargetDependencies): Ditto.
2317         (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): Ditto.
2318         (WebCore::SVGDocumentExtensions::registerSVGFontFaceElement): Ditto.
2319         (WebCore::SVGDocumentExtensions::unregisterSVGFontFaceElement): Ditto.
2320         * svg/SVGDocumentExtensions.h: Ditto.
2321
2322         * svg/SVGElement.cpp:
2323         (WebCore::SVGElement::~SVGElement): Pass reference.
2324         (WebCore::SVGElement::removedFromAncestor): Ditto.
2325         (WebCore::SVGElement::buildPendingResourcesIfNeeded): Ditto.
2326         * svg/SVGFEImageElement.cpp:
2327         (WebCore::SVGFEImageElement::clearResourceReferences): Ditto.
2328         (WebCore::SVGFEImageElement::buildPendingResource): Ditto.
2329         * svg/SVGFontFaceElement.cpp:
2330         (WebCore::SVGFontFaceElement::insertedIntoAncestor): Ditto.
2331         (WebCore::SVGFontFaceElement::removedFromAncestor): Ditto.
2332         * svg/SVGMPathElement.cpp:
2333         (WebCore::SVGMPathElement::buildPendingResource): Ditto.
2334         (WebCore::SVGMPathElement::clearResourceReferences): Ditto.
2335         * svg/SVGPathElement.cpp:
2336         (WebCore::SVGPathElement::invalidateMPathDependencies): Ditto.
2337         * svg/SVGSVGElement.cpp:
2338         (WebCore::SVGSVGElement::SVGSVGElement): Ditto.
2339         (WebCore::SVGSVGElement::~SVGSVGElement): Ditto.
2340         (WebCore::SVGSVGElement::didMoveToNewDocument): Ditto.
2341         (WebCore::SVGSVGElement::insertedIntoAncestor): Ditto.
2342         (WebCore::SVGSVGElement::removedFromAncestor): Ditto.
2343         * svg/SVGTRefElement.cpp:
2344         (WebCore::SVGTRefElement::detachTarget): Ditto.
2345         (WebCore::SVGTRefElement::buildPendingResource): Ditto.
2346         * svg/SVGTextPathElement.cpp:
2347         (WebCore::SVGTextPathElement::clearResourceReferences): Ditto.
2348         (WebCore::SVGTextPathElement::buildPendingResource): Ditto.
2349         * svg/SVGUseElement.cpp:
2350         (WebCore::SVGUseElement::updateShadowTree): Ditto.
2351         * svg/animation/SVGSMILElement.cpp:
2352         (WebCore::SVGSMILElement::clearResourceReferences): Ditto.
2353         (WebCore::SVGSMILElement::buildPendingResource): Ditto.
2354         * testing/Internals.cpp:
2355         (WebCore::Internals::addTextMatchMarker): Ditto.
2356         (WebCore::Internals::webkitWillEnterFullScreenForElement): Ditto.
2357         (WebCore::Internals::webkitDidEnterFullScreenForElement): Ditto.
2358         (WebCore::Internals::webkitWillExitFullScreenForElement): Ditto.
2359         (WebCore::Internals::webkitDidExitFullScreenForElement): Ditto.
2360         * workers/Worker.cpp:
2361         (WebCore::Worker::create): Ditto.
2362         (WebCore::Worker::notifyFinished): Ditto.
2363         * workers/service/ServiceWorkerContainer.cpp:
2364         (WebCore::ServiceWorkerContainer::scheduleJob): Ditto.
2365         (WebCore::ServiceWorkerContainer::jobDidFinish): Ditto.
2366         * xml/XMLHttpRequest.cpp:
2367         (WebCore::XMLHttpRequest::prepareToSend): Ditto.
2368         (WebCore::XMLHttpRequest::createRequest): Ditto.
2369         (WebCore::XMLHttpRequest::internalAbort): Ditto.
2370         (WebCore::XMLHttpRequest::networkErrorTimerFired): Ditto.
2371         (WebCore::XMLHttpRequest::didFail): Ditto.
2372         (WebCore::XMLHttpRequest::didFinishLoading): Ditto.
2373
2374         * xml/XPathStep.cpp: Removed unneeded include of HTMLDocument.h.
2375         (WebCore::XPath::nodeMatchesBasicTest): Changed code to call isHTMLDocument
2376         rather than is<HTMLDocument> since this is not a type check for a downcast,
2377         but rather a behavioral difference that does not depend on any of the data
2378         stored in an HTMLDocument or the use of a distinct C++ class for it.
2379
2380         * xml/XSLTProcessor.cpp:
2381         (WebCore::XSLTProcessor::createDocumentFromSource): Pass a reference.
2382
2383 2019-01-21  David Kilzer  <ddkilzer@apple.com>
2384
2385         Switch remaining VideoToolbox soft-linking in WebCore over to VideoToolboxSoftLink.{cpp,h}
2386         <https://webkit.org/b/193645>
2387         <rdar://problem/47421574>
2388
2389         Reviewed by Alex Christensen.
2390
2391         * platform/cocoa/VideoToolboxSoftLink.cpp:
2392         * platform/cocoa/VideoToolboxSoftLink.h:
2393         - Move soft-linking of VTPixelBufferConformer* functions from
2394           PixelBufferConformerCV.cpp to here.
2395         * platform/graphics/cv/PixelBufferConformerCV.cpp:
2396         - Remove local soft-linking of VideoToolbox.framework and switch
2397           to VideoToolboxSoftLink.h.
2398
2399 2019-01-21  Antti Koivisto  <antti@apple.com>
2400
2401         Move delegatesScrolling() tests to lower level conversion function in ScrollView
2402         https://bugs.webkit.org/show_bug.cgi?id=193649
2403
2404         Reviewed by Frédéric Wang.
2405
2406         This reduces places where these tests are needed and helps avoid mistakes.
2407
2408         * dom/Document.cpp:
2409         (WebCore::computeIntersectionState):
2410         * page/FrameView.cpp:
2411         (WebCore::FrameView::convertFromRendererToContainingView const):
2412         (WebCore::FrameView::convertFromContainingViewToRenderer const):
2413         * platform/ScrollView.cpp:
2414         (WebCore::ScrollView::viewToContents const):
2415         (WebCore::ScrollView::contentsToView const):
2416         (WebCore::ScrollView::contentsToContainingViewContents const):
2417         (WebCore::ScrollView::rootViewToContents const):
2418         (WebCore::ScrollView::contentsToRootView const):
2419         (WebCore::ScrollView::windowToContents const):
2420         (WebCore::ScrollView::contentsToWindow const):
2421
2422 2019-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2423
2424         REGRESSION(r239915): about 130 test failures on WPE
2425         https://bugs.webkit.org/show_bug.cgi?id=193395
2426
2427         Reviewed by Žan Doberšek.
2428
2429         Since r239915 we are only overriding the characters with Default_Ignorable unicode property when the font
2430         doesn't support the code point. If the font happens to provide a glyph for the character, it's later ignored by
2431         harfbuzz when shaping, but the simple text code path doesn't ignore them unless there isn't a glyph.
2432
2433         * platform/graphics/WidthIterator.cpp:
2434         (WebCore::WidthIterator::advanceInternal): Always ignore characters with Default_Ignorable unicode property.
2435         (WebCore::characterMustDrawSomething): Moved to CharacterProperties.h and renamed as isDefaultIgnorableCodePoint().
2436         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
2437         (WebCore::GlyphPage::fill): Use isDefaultIgnorableCodePoint().
2438         * platform/text/CharacterProperties.h:
2439         (WebCore::isDefaultIgnorableCodePoint): Return whether the character has Default_Ignorable unicode property.
2440
2441 2019-01-20  Myles C. Maxfield  <mmaxfield@apple.com>
2442
2443         [WHLSL] Implement Metal code generation
2444         https://bugs.webkit.org/show_bug.cgi?id=193531
2445
2446         Reviewed by Dean Jackson.
2447
2448         This implements the majority of the metal code generation piece. There are still a few pieces missing,
2449         that I'll add in follow up patches. There's still enough complexity here that this is worth reviewing
2450         on its own, though.
2451
2452         This patch includes a few pieces:
2453         - Metal typedefs for every WHLSL type. This analysis is actually pretty interesting, because complex
2454               types depend on their inner types, and the inner types need to be emitted first. Therefore,
2455               this patch implements a topological sort when emitting types. Also, WHLSL types need to be de-
2456               duped because array references are implemented in MSL as structs, and if you have two structs
2457               in MSL with the same contents, those two structs are not equal and cannot be assigned to each
2458               other. So, this patch creates a trie to de-dup all the UnnamedTypes, and implements a
2459               dependency graph which includes both nodes in the trie as well as NamedTypes which don't appear
2460               in the trie.
2461         - WHLSL enumeration code generation
2462         - A name mangler, which ensures that no text from the source program is contained within the result
2463               program
2464         - Full support for expressions. An expression like "y = *x + 7;" would be converted to something like
2465               Type1 variable1 = *x;
2466               Type2 variable2 = 7;
2467               Type3 variable3 = variable1 + variable2;
2468               y = variable3;
2469         - Mostly complete support for control flow. This is tricky because of how we transform WHLSL
2470               expressions into C++ statements. Therefore, things like "for ( ; *x + 7; )" is difficult to
2471               compile, because we can't put the "*x + 7" generated statements into the for loop itself.
2472               Instead, we have to emit this code inside the loop, in all the places that would implicitly run
2473               it. This patch doesn't fully handle this, see below. (If MSL supported lambdas, we could put
2474               the statements into a lambda and do something like "for ( ; theLambda(); )" but MSL doesn't
2475               support lambdas.)
2476
2477         Missing pieces:
2478         - Entry point pack / unpack code
2479         - Support for "continue" (See above regarding control flow)
2480         - Knowing whether or not a switch case should end with break or fallthrough
2481         - Trapping
2482         - Zero filling variables
2483         - Code generation for compiler-generated native functions (this patch supports native functions in the
2484               standard library), texture functions, and HLSL's half <-> int functions.
2485
2486         No new tests because it isn't hooked up yet. As soon as we can do entry point packing and unpacking,
2487         I'll start porting the test suite.
2488
2489         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
2490         (WebCore::WHLSL::AST::BuiltInSemantic::targetIndex):
2491         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2492         (WebCore::WHLSL::AST::Expression::resolvedType):
2493         (WebCore::WHLSL::AST::Expression::type): Deleted.
2494         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
2495         (WebCore::WHLSL::AST::FunctionDeclaration::name):
2496         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
2497         (WebCore::WHLSL::AST::StructureDefinition::find):
2498         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Added.
2499         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
2500         (WebCore::WHLSL::Metal::EntryPointScaffolding::helperTypes):
2501         (WebCore::WHLSL::Metal::EntryPointScaffolding::signature):
2502         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpack):
2503         (WebCore::WHLSL::Metal::EntryPointScaffolding::pack):
2504         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
2505         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: Added.
2506         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::FunctionDeclarationWriter):
2507         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString):
2508         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
2509         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::toString):
2510         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
2511         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::generateNextVariableName):
2512         (WebCore::WHLSL::Metal::metalFunctions):
2513         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
2514         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h.
2515         (WebCore::WHLSL::Metal::generateMetalCode):
2516         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
2517         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Added.
2518         (WebCore::WHLSL::Metal::getNativeName):
2519         (WebCore::WHLSL::Metal::mapFunctionName):
2520         (WebCore::WHLSL::Metal::convertAddressSpace):
2521         (WebCore::WHLSL::Metal::writeNativeFunction):
2522         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
2523         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: Added.
2524         (WebCore::WHLSL::Metal::BaseTypeNameNode::BaseTypeNameNode):
2525         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayTypeNameNode const):
2526         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayReferenceTypeNameNode const):
2527         (WebCore::WHLSL::Metal::BaseTypeNameNode::isPointerTypeNameNode const):
2528         (WebCore::WHLSL::Metal::BaseTypeNameNode::isReferenceTypeNameNode const):
2529         (WebCore::WHLSL::Metal::BaseTypeNameNode::children):
2530         (WebCore::WHLSL::Metal::BaseTypeNameNode::append):
2531         (WebCore::WHLSL::Metal::BaseTypeNameNode::parent):
2532         (WebCore::WHLSL::Metal::BaseTypeNameNode::mangledName const):
2533         (WebCore::WHLSL::Metal::ArrayTypeNameNode::ArrayTypeNameNode):
2534         (WebCore::WHLSL::Metal::ArrayTypeNameNode::numElements const):
2535         (WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::ArrayReferenceTypeNameNode):
2536         (WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::addressSpace const):
2537         (WebCore::WHLSL::Metal::PointerTypeNameNode::PointerTypeNameNode):
2538         (WebCore::WHLSL::Metal::PointerTypeNameNode::addressSpace const):
2539         (WebCore::WHLSL::Metal::ReferenceTypeNameNode::ReferenceTypeNameNode):
2540         (WebCore::WHLSL::Metal::ReferenceTypeNameNode::namedType):
2541         (WebCore::WHLSL::Metal::TypeNamer::TypeNamer):
2542         (WebCore::WHLSL::Metal::TypeNamer::visit):
2543         (WebCore::WHLSL::Metal::findInVector):
2544         (WebCore::WHLSL::Metal::find):
2545         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
2546         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
2547         (WebCore::WHLSL::Metal::TypeNamer::insert):
2548         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter):
2549         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::toString):
2550         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::visit):
2551         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations):
2552         (WebCore::WHLSL::Metal::toString):
2553         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
2554         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
2555         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDefinitions):
2556         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForEnumerationMember):
2557         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForStructureElement):
2558         (WebCore::WHLSL::Metal::TypeNamer::metalTypes):
2559         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h: Added.
2560         (WebCore::WHLSL::Metal::TypeNamer::generateNextTypeName):
2561         (WebCore::WHLSL::Metal::TypeNamer::generateNextStructureElementName):
2562         (WebCore::WHLSL::Metal::TypeNamer::generateNextEnumerationMemberName):
2563         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2564         (WebCore::WHLSL::checkSemantics):
2565         (WebCore::WHLSL::Checker::visit):
2566         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
2567         (WebCore::WHLSL::Gatherer::visit):
2568         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
2569         (WebCore::WHLSL::EntryPointItem::EntryPointItem):
2570         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed.
2571         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
2572         (WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
2573         (WebCore::WHLSL::checkStatementBehavior):
2574         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
2575         * Sources.txt:
2576         * WebCore.xcodeproj/project.pbxproj:
2577
2578 2019-01-20  Myles C. Maxfield  <mmaxfield@apple.com>
2579
2580         [WHLSL] Add the statement behavior checker
2581         https://bugs.webkit.org/show_bug.cgi?id=193487
2582
2583         Reviewed by Dean Jackson.
2584
2585         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Spec/source/index.rst#typing-statements
2586         into C++. It is meant to replace the ReturnChecker and UnreachableCodeChecker in the reference implementation.
2587
2588         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
2589         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
2590
2591         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed. StatementBehaviorChecker does everything that LoopChecker
2592         does.
2593         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
2594         (WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
2595         (WebCore::WHLSL::checkStatementBehavior):
2596         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
2597         * Sources.txt:
2598         * WebCore.xcodeproj/project.pbxproj:
2599
2600 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2601
2602         REGRESSION(r240174): Wrong preprocessor guards in RenderImage::paintAreaElementFocusRing
2603         https://bugs.webkit.org/show_bug.cgi?id=193630
2604
2605         Reviewed by Daniel Bates.
2606
2607         r240174 inadvertently disabled this function on non-Apple platforms.
2608
2609         This fixes layout test fast/images/image-map-outline-in-positioned-container.html.
2610
2611         * rendering/RenderImage.cpp:
2612         (WebCore::RenderImage::paintAreaElementFocusRing):
2613
2614 2019-01-20  chris fleizach  <cfleizach@apple.com>
2615
2616         AX: Support returning relative frames for accessibility
2617         https://bugs.webkit.org/show_bug.cgi?id=193414
2618         <rdar://problem/47268501>
2619
2620         Reviewed by Zalan Bujtas.
2621
2622         Create a way for assistive technologies to retrieve a frame in page space that can be transformed to its final screen space by having the AT message the UI process separately.
2623
2624         Consolidate rect/point conversion methods for macOS and iOS.
2625         This is only needed on WebKit2, where we have to reach back across to the hosting process to get the final frame, so we can skip this test on WK1.
2626
2627         Tests: accessibility/mac/relative-frame.html
2628
2629         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2630         (-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
2631         (-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
2632         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
2633         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
2634         (-[WebAccessibilityObjectWrapper accessibilityFrame]):
2635         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
2636         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
2637         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
2638         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
2639         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2640         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2641         (convertPathToScreenSpaceFunction):
2642         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
2643         (-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
2644         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2645         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
2646         (-[WebAccessibilityObjectWrapper position]):
2647         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2648         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
2649
2650 2019-01-20  Simon Fraser  <simon.fraser@apple.com>
2651
2652         On RenderBox, make client sizing be derived from padding box sizing
2653         https://bugs.webkit.org/show_bug.cgi?id=193621
2654
2655         Reviewed by Daniel Bates.
2656
2657         I never liked how clientWidth/Height, an IE-originated term, was used as the basis
2658         for various RenderBox geometry functions.
2659
2660         Fix by adding some functions which return the dimensions of the padding box (which
2661         is the inside of the border and any scrollbar), and define clientWidth/Height in
2662         terms of them.
2663
2664         Also add paddingBoxRectIncludingScrollbar() function that is used by compositing code.
2665
2666         * rendering/RenderBox.cpp:
2667         (WebCore::RenderBox::clientWidth const):
2668         (WebCore::RenderBox::clientHeight const):
2669         * rendering/RenderBox.h:
2670         (WebCore::RenderBox::borderBoxRect const):
2671         (WebCore::RenderBox::computedCSSContentBoxRect const):
2672         (WebCore::RenderBox::contentWidth const):
2673         (WebCore::RenderBox::contentHeight const):
2674         (WebCore::RenderBox::paddingBoxWidth const):
2675         (WebCore::RenderBox::paddingBoxHeight const):
2676         (WebCore::RenderBox::paddingBoxRect const):
2677         (WebCore::RenderBox::paddingBoxRectIncludingScrollbar const):
2678         (WebCore::RenderBox::hasHorizontalOverflow const):
2679         (WebCore::RenderBox::hasVerticalOverflow const):
2680         * rendering/RenderLayerBacking.cpp:
2681         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
2682         (WebCore::RenderLayerBacking::updateGeometry):
2683
2684 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2685
2686         Unreviewed, rolling out r238275.
2687
2688         Regressed css3/shapes/shape-outside/shape-image/shape-
2689         image-025.html
2690
2691         Reverted changeset:
2692
2693         "ScalableImageDecoder: don't forcefully decode image data when
2694         querying frame completeness, duration"
2695         https://bugs.webkit.org/show_bug.cgi?id=191354
2696         https://trac.webkit.org/changeset/238275
2697
2698 2019-01-19  Zalan Bujtas  <zalan@apple.com>
2699
2700         [LFC][BFC] <body>'s overflow property value is propagated to viewport
2701         https://bugs.webkit.org/show_bug.cgi?id=193617
2702
2703         Reviewed by Antti Koivisto.
2704
2705         When the root element is an HTML "HTML" element or an XHTML "html" element, and that element has an HTML "BODY" element
2706         or an XHTML "body" element as a child, user agents must instead apply the 'overflow' property from the first such child element to the viewport,
2707         if the value on the root element is 'visible'. The 'visible' value when used for the viewport must be interpreted as 'auto'.
2708         The element from which the value is propagated must have a used value for 'overflow' of 'visible'.
2709
2710         This also has impact on layout since <body style="overflow: hidden"> would establish a block formatting context.
2711
2712         * layout/layouttree/LayoutBox.cpp:
2713         (WebCore::Layout::Box::isOverflowVisible const):
2714
2715 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2716
2717         Unreviewed, rolling out r240209.
2718
2719         Broke GTK/WPE injected bundle
2720
2721         Reverted changeset:
2722
2723         "AX: Support returning relative frames for accessibility"
2724         https://bugs.webkit.org/show_bug.cgi?id=193414
2725         https://trac.webkit.org/changeset/240209
2726
2727 2019-01-12  Dan Bernstein  <mitz@apple.com>
2728
2729         [Cocoa] Avoid importing directly from subumbrella frameworks
2730         https://bugs.webkit.org/show_bug.cgi?id=186016
2731         <rdar://problem/40591038>
2732
2733         Reviewed by Sam Weinig.
2734
2735         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
2736           OTHER_CPLUSPLUSFLAGS.
2737         * editing/mac/DictionaryLookupLegacy.mm: Import Quartz.h instead of a PDFKit header.
2738         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
2739         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
2740
2741 2019-01-20  chris fleizach  <cfleizach@apple.com>
2742
2743         AX: Support returning relative frames for accessibility
2744         https://bugs.webkit.org/show_bug.cgi?id=193414
2745         <rdar://problem/47268501>
2746
2747         Reviewed by Zalan Bujtas.
2748
2749         Create a way for assistive technologies to retrieve a frame in page space that can be transformed to its final screen space by having the AT message the UI process separately.
2750
2751         Consolidate rect/point conversion methods for macOS and iOS.
2752         This is only needed on WebKit2, where we have to reach back across to the hosting process to get the final frame, so we can skip this test on WK1.
2753
2754         Tests: accessibility/mac/relative-frame.html
2755
2756         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2757         (-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
2758         (-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
2759         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
2760         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
2761         (-[WebAccessibilityObjectWrapper accessibilityFrame]):
2762         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
2763         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
2764         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
2765         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
2766         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2767         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2768         (convertPathToScreenSpaceFunction):
2769         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
2770         (-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
2771         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2772         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
2773         (-[WebAccessibilityObjectWrapper position]):
2774         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2775         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
2776
2777 2019-01-20  Antoine Quint  <graouts@apple.com>
2778
2779         Add a POINTER_EVENTS feature flag
2780         https://bugs.webkit.org/show_bug.cgi?id=193577
2781         <rdar://problem/47408511>
2782
2783         Unreviewed. Also enable Pointer Events for iosmac.
2784
2785         * Configurations/FeatureDefines.xcconfig:
2786
2787 2019-01-19  Zalan Bujtas  <zalan@apple.com>
2788
2789         [LFC][Floats] Ensure that floats in FloatingContext::m_floats are always horizontally ordered.
2790         https://bugs.webkit.org/show_bug.cgi?id=193613
2791
2792         Reviewed by Antti Koivisto.
2793
2794         Float items in m_floats list should stay in horizontal position order (left/right edge).
2795
2796         When adding a new float item to floating state list, we have to ensure that it is definitely the left(right)-most item.
2797         Normally it is, but negative horizontal margins can push the float box beyond another float box.
2798
2799         <div style="float: left; height: 10px; width: 10px;"></div>
2800         <div style="float: left; height: 10px; width: 10px; margin-left: -80px;"></div>
2801
2802         The second float's right edge beyond the first float' left edge. THe second float is not the right(inner)-most float anymore.
2803
2804         Test: fast/block/float/floats-with-negative-horizontal-margin.html
2805
2806         * layout/floats/FloatingContext.cpp:
2807         (WebCore::Layout::areFloatsHorizontallySorted):
2808         (WebCore::Layout::FloatingContext::positionForFloat const):
2809         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
2810         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2811         * layout/floats/FloatingState.cpp:
2812         (WebCore::Layout::FloatingState::append):
2813
2814 2019-01-19  Youenn Fablet  <youenn@apple.com>
2815
2816         getUserMedia with a deviceId exact constraint with an empty string value should succeed
2817         https://bugs.webkit.org/show_bug.cgi?id=193541
2818         <rdar://problem/47357218>
2819
2820         Reviewed by Eric Carlson.
2821
2822         If there is a deviceId constraint, remove any empty string from ideal/exact string list.
2823         This will make the device selection be solely based on other constraints.
2824         An improvement might be for 'exact' constraint to pick the default device.
2825         There is currently no such notion of a default device.
2826         Picking the best fitting device seems a good tradeoff.
2827         Covered by updated test.
2828
2829         * platform/mediastream/MediaConstraints.cpp:
2830         (WebCore::MediaTrackConstraintSetMap::set):
2831         * platform/mediastream/MediaConstraints.h:
2832         (WebCore::StringConstraint::removeEmptyStringConstraint):
2833
2834 2019-01-19  Eric Liang  <ericliang@apple.com>
2835
2836         AXSelected attribute on RadioButton should not be settable.
2837         https://bugs.webkit.org/show_bug.cgi?id=193371
2838
2839         Reviewed by Chris Fleizach.
2840
2841         Test: accessibility/set-selected-editable.html
2842
2843         * accessibility/AccessibilityNodeObject.cpp:
2844         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
2845
2846 2019-01-19  Antoine Quint  <graouts@apple.com>
2847
2848         Add a POINTER_EVENTS feature flag
2849         https://bugs.webkit.org/show_bug.cgi?id=193577
2850
2851         Reviewed by Dean Jackson.
2852
2853         Only expose the PointerEvent interface if the POINTER_EVENTS feature is enabled.
2854
2855         * Configurations/FeatureDefines.xcconfig:
2856         * dom/EventNames.in:
2857         * dom/PointerEvent.cpp:
2858         * dom/PointerEvent.h:
2859         * dom/PointerEvent.idl:
2860
2861 2019-01-18  Ryosuke Niwa  <rniwa@webkit.org>
2862
2863         iOS: Updating input mode should update the software keyboard
2864         https://bugs.webkit.org/show_bug.cgi?id=193565
2865         <rdar://problem/47376334>
2866
2867         Reviewed by Wenson Hsieh.
2868
2869         Let the chrome client know that the focused element's inputmode had changed.
2870
2871         Test: fast/forms/ios/inputmode-none-removed.html
2872
2873         * html/HTMLElement.cpp:
2874         (WebCore::HTMLElement::parseAttribute):
2875         * page/ChromeClient.h:
2876
2877 2019-01-18  Brian Burg  <bburg@apple.com>
2878
2879         Automation.computeElementLayout should return visual viewport-aware coordinates
2880         https://bugs.webkit.org/show_bug.cgi?id=193598
2881         <rdar://problem/35325644>
2882
2883         Reviewed by Simon Fraser.
2884
2885         * page/FrameView.h: export symbol to be usable from WebKit.
2886         * page/FrameView.cpp:
2887         (WebCore::FrameView::clientToLayoutViewportRect const): Added.
2888         Do the same thing as clientToLayoutViewportPoint with a rect instead.
2889
2890
2891 2019-01-18  Eric Carlson  <eric.carlson@apple.com>
2892
2893         Revert r238815, it broke WK1 video fullscreen on Mac
2894         https://bugs.webkit.org/show_bug.cgi?id=193586
2895         <rdar://problem/47358941>
2896
2897         Reviewed by Jer Noble.
2898
2899         * PlatformMac.cmake:
2900         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2901         (WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const):
2902
2903 2019-01-18  Devin Rousso  <drousso@apple.com>
2904
2905         Web Inspector: Audit: don't keep the injected sub-objects alive between runs
2906         https://bugs.webkit.org/show_bug.cgi?id=193594
2907         <rdar://problem/47398091>
2908
2909         Reviewed by Joseph Pecoraro.
2910
2911         Rather than save the `InspectorAuditAccessibilityObject` and `InspectorAuditDOMObject`
2912         between individual `Audit.setup` invocations, we should only keep them alive so long as the
2913         injected `WebInspectorAudit` object is alive (e.g. from `Audit.setup` to `Audit.teardown`).
2914
2915         This change fixes inspector/audit/run-accessibility.html.
2916
2917         * inspector/agents/page/PageAuditAgent.h:
2918         * inspector/agents/page/PageAuditAgent.cpp:
2919         (WebCore::PageAuditAgent::populateAuditObject):
2920
2921 2019-01-18  Daniel Bates  <dabates@apple.com>
2922
2923         Another attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
2924         (https://bugs.webkit.org/show_bug.cgi?id=193583)
2925
2926         Substitute ENABLE(FULL_KEYBOARD_ACCESS) for PLATFORM(MAC). On Mac, we always build with
2927         ENABLE(FULL_KEYBOARD_ACCESS) enabled.
2928
2929         * rendering/RenderElement.cpp:
2930         (WebCore::RenderElement::paintFocusRing):
2931
2932 2019-01-18  Daniel Bates  <dabates@apple.com>
2933
2934         Fix some build issues.
2935
2936         Including UIKitSoftLinking.h is not compatible with unified builds.
2937
2938         * SourcesCocoa.txt:
2939         * WebCore.xcodeproj/project.pbxproj:
2940
2941 2019-01-18  Justin Fan  <justin_fan@apple.com>
2942
2943         (WIP) [WebGPU] WebGPUProgrammablePassEncoder::setBindGroup prototype
2944         https://bugs.webkit.org/show_bug.cgi?id=193457
2945         <rdar://problem/47296678>
2946
2947         Reviewed by Dean Jackson.
2948
2949         Enable WebGPU developers to assign buffer bind groups and access them via render pipeline. 
2950
2951         Test: webgpu/buffer-resource-triangles.html
2952
2953         * Modules/webgpu/WebGPUBindGroup.h:
2954         (WebCore::WebGPUBindGroup::bindGroup const): Added getter.
2955         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: 
2956         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Added. Delegates call to GPUProgrammablePassEncoder.
2957         * Modules/webgpu/WebGPUProgrammablePassEncoder.h: Enable setBindGroup.
2958         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: ditto.
2959         * WebCore.xcodeproj/project.pbxproj:
2960         * platform/graphics/gpu/GPUBindGroup.h: 
2961         (WebCore::GPUBindGroup::layout const): Added getter.
2962         (WebCore::GPUBindGroup::bindings const): ditto.
2963         * platform/graphics/gpu/GPUBindGroupLayout.h: Added ArgumentEncoderBuffer struct to retain ptr to both MTLArgumentEncoders and their argument MTLBuffers.
2964         (WebCore::GPUBindGroupLayout::ArgumentEncoderBuffer::operator! const):
2965         (WebCore::GPUBindGroupLayout::vertexArguments const): Added. Getter.
2966         (WebCore::GPUBindGroupLayout::fragmentArguments const): ditto.
2967         (WebCore::GPUBindGroupLayout::computeArguments const): ditto.
2968         * platform/graphics/gpu/GPUDevice.cpp: Refactored unnecessary header include.
2969         * platform/graphics/gpu/GPUDevice.h: ditto.
2970         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
2971         (WebCore::GPUProgrammablePassEncoder::setVertexBuffer): Added. Delegates to MTLCommandEncoder call.
2972         (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer): ditto.
2973         * platform/graphics/gpu/GPURenderPassEncoder.h: 
2974         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
2975         (WebCore::tryCreateArgumentEncoderAndBuffer): Replace newEncoder(). Now create an ArgumentEncoderBuffer object from an array of MTLArgumentDescriptors, if able.
2976         (WebCore::GPUBindGroupLayout::tryCreate): Refactor to support ArgumentEncoderBuffers, and allocate MTLBuffers for argument encoders.
2977         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout): Support ArgumentEncoderBuffers.
2978         (WebCore::newEncoder): Deleted.
2979         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
2980         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
2981         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
2982         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Set a buffer resource on the MTLArgumentEncoder, and call useResource on the command encoder.
2983         (WebCore::GPUProgrammablePassEncoder::setBindGroup): Parses the bind group to assign each resource on its matching MTLArgumentEncoder.
2984         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: 
2985         (WebCore::GPURenderPassEncoder::useResource): Resolves call from GPUProgrammablePassEncoder to call on MTLRenderCommandEncoder.
2986         (WebCore::GPURenderPassEncoder::setVertexBuffer): ditto.
2987         (WebCore::GPURenderPassEncoder::setFragmentBuffer): ditto.
2988
2989 2019-01-18  Daniel Bates  <dabates@apple.com>
2990
2991         Another attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
2992         (https://bugs.webkit.org/show_bug.cgi?id=193583)
2993
2994         Only override RenderTheme::platformFocusRingColor() when building with ENABLE(FULL_KEYBOARD_ACCESS)
2995         enabled.
2996
2997         * rendering/RenderThemeIOS.h:
2998         * rendering/RenderThemeIOS.mm:
2999
3000 2019-01-18  Daniel Bates  <dabates@apple.com>
3001
3002         Attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
3003         (https://bugs.webkit.org/show_bug.cgi?id=193583)
3004
3005         Namespace qualify call to getUIColorClass().
3006
3007         * rendering/RenderThemeIOS.mm:
3008         (WebCore::RenderThemeIOS::platformFocusRingColor const):
3009
3010 2019-01-18  Jer Noble  <jer.noble@apple.com>
3011
3012         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
3013         https://bugs.webkit.org/show_bug.cgi?id=189553
3014
3015         Reviewed by Tim Horton.
3016
3017         * Configurations/Base.xcconfig:
3018         * Configurations/SDKVariant.xcconfig: Added.
3019         * Configurations/WebCore.xcconfig:
3020
3021 2019-01-18  Daniel Bates  <dabates@apple.com>
3022
3023         CSS auto focus-ring outlines don't render on iOS
3024         https://bugs.webkit.org/show_bug.cgi?id=193583
3025         <rdar://problem/6508697>
3026
3027         Reviewed by Simon Fraser.
3028
3029         Implement support for drawing focus rings on iOS when built with ENABLE(FULL_KEYBOARD_ACCESS)
3030         enabled.
3031
3032         For now the focus ring drawing for iOS is tangled up into the Mac-specific code to draw
3033         animated focus rings. I will fix this in <https://bugs.webkit.org/show_bug.cgi?id=193591>.
3034
3035         * SourcesCocoa.txt: Add file ColorIOS.mm.
3036         * WebCore.xcodeproj/project.pbxproj: Add files ColorIOS.{h, mm}.
3037
3038         * platform/graphics/GraphicsContext.h:
3039         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
3040         (WebCore::drawFocusRingAtTime):
3041         (WebCore::GraphicsContext::drawFocusRing):
3042         Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
3043         This is always enabled on Mac.
3044         
3045         * platform/ios/ColorIOS.h: Added.
3046         * platform/ios/ColorIOS.mm: Added.
3047         (WebCore::colorFromUIColor): Convert a UIColor to a WebCore::Color.
3048
3049         * rendering/RenderElement.cpp:
3050         (WebCore::RenderElement::paintFocusRing):
3051         * rendering/RenderImage.cpp:
3052         (WebCore::RenderImage::paintAreaElementFocusRing):
3053         Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
3054         This is always enabled on Mac.
3055
3056         * rendering/RenderThemeIOS.h:
3057         * rendering/RenderThemeIOS.mm:
3058         (WebCore::RenderThemeIOS::platformFocusRingColor const): Implement this override for iOS.
3059         (WebCore::RenderThemeIOS::supportsFocusRing const): Implement this override for iOS to always
3060         return false - the iOS theme code does not support painting focus rings. By returning false we
3061         will use the platform-independent, non-theme code path to draw focus rings.
3062
3063 2019-01-18  David Kilzer  <ddkilzer@apple.com>
3064
3065         Follow-up: Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
3066         <https://webkit.org/b/193568>
3067         <rdar://problem/47381130>
3068
3069         * editing/cocoa/DictionaryLookup.mm:
3070         (-[WebRevealHighlight drawHighlightContentForItem:context:]):
3071         Fix the build by changing getUIApplicationClass() to
3072         PAL::getUIApplicationClass().
3073
3074 2019-01-18  David Kilzer  <ddkilzer@apple.com>
3075
3076         Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
3077         <https://webkit.org/b/193568>
3078         <rdar://problem/47381130>
3079
3080         Reviewed by Alex Christensen.
3081
3082         This does the following:
3083         - Removes local soft-linking of UIKit.
3084         - Switches to using PAL functions for soft-linking.
3085
3086         * SourcesCocoa.txt: Add 4 source files to UnifiedSources.
3087         * WebCore.xcodeproj/project.pbxproj: Remove 4 sources files
3088         from WebCore target now that they are in UnifiedSources.
3089         * editing/cocoa/DictionaryLookup.mm:
3090         * editing/cocoa/HTMLConverter.mm: Move SPI to UIKitSPI.h. Remove
3091         declarations in public headers.
3092         (_fontForNameAndSize): Change use of getUIFontClass() to
3093         PlatformFontClass.
3094         (HTMLConverter::_processElement): Add cast here since compiler
3095         finds the wrong selector for +clearColor and thinks it returns a
3096         `CIColor *` object.  The same cast already exists in
3097         VideoFullscreenInterfaceAVKit.mm.
3098         * page/cocoa/SettingsBaseCocoa.mm:
3099         (WebCore::SettingsBase::defaultTextAutosizingEnabled):
3100         * platform/audio/ios/MediaSessionManagerIOS.mm:
3101         (-[WebMediaSessionHelper initWithCallback:]):
3102         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3103         (WebCore::exernalDeviceDisplayNameForPlayer):
3104         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3105         (WebCore::showLetterpressedGlyphsWithAdvances):
3106         * platform/ios/DragImageIOS.mm:
3107         (WebCore::scaleDragImage):
3108         (WebCore::createDragImageFromImage):
3109         (WebCore::cascadeForSystemFont):
3110         (WebCore::createDragImageForLink):
3111         (WebCore::createDragImageForSelection):
3112         (WebCore::createDragImageForRange):
3113         (WebCore::createDragImageForColor):
3114         * platform/ios/PlatformPasteboardIOS.mm:
3115         (WebCore::PlatformPasteboard::PlatformPasteboard):
3116         (WebCore::PlatformPasteboard::color):
3117         (WebCore::registerItemToPasteboard):
3118         (WebCore::PlatformPasteboard::setColor):
3119         * platform/ios/ThemeIOS.mm:
3120         (WebCore::ThemeIOS::userPrefersReducedMotion const):
3121         * platform/ios/UserAgentIOS.mm:
3122         (WebCore::isClassic):
3123         (WebCore::isClassicPad):
3124         (WebCore::isClassicPhone):
3125         * platform/ios/ValidationBubbleIOS.mm:
3126         (-[WebValidationBubbleTapRecognizer initWithPopoverController:]):
3127         (WebCore::ValidationBubble::ValidationBubble):
3128         (WebCore::ValidationBubble::show):
3129         (WebCore::fallbackViewController):
3130         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3131         (clearUIColor):
3132         (allocWebAVPictureInPicturePlayerLayerViewInstance):
3133         (WebAVPlayerLayerView_videoView):
3134         (fallbackViewController):
3135         (VideoFullscreenInterfaceAVKit::doSetup):
3136         * platform/ios/WebEvent.mm:
3137         (+[WebEvent modifierFlags]):
3138         * platform/ios/WebItemProviderPasteboard.mm:
3139         (allLoadableClasses):
3140         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3141         (VideoFullscreenControllerContext::setUpFullscreen):
3142         * platform/network/mac/WebCoreURLResponse.mm: Add missing header
3143         after unified sources were updated.
3144         * rendering/RenderThemeIOS.mm:
3145         (WebCore::contentSizeCategoryDidChange):
3146         (WebCore::RenderThemeIOS::RenderThemeIOS):
3147         (WebCore::RenderThemeIOS::contentSizeCategory):
3148         (WebCore::RenderThemeIOS::systemColor const):
3149         (WebCore::attachmentActionColor):
3150         (WebCore::attachmentTitleColor):
3151         (WebCore::attachmentSubtitleColor):
3152         (WebCore::iconForAttachment):
3153         * testing/Internals.mm:
3154         (WebCore::Internals::userPrefersReducedMotion const):
3155
3156 2019-01-18  Antti Koivisto  <antti@apple.com>
3157
3158         Implement asynchronous frame scrolling for iOS
3159         https://bugs.webkit.org/show_bug.cgi?id=193539
3160         <rdar://problem/47379873>
3161
3162         Reviewed by Simon Fraser.
3163
3164         This patch implements UIScrollView based frame scrolling on iOS, enabled by the "Async Frame Scrolling"
3165         internal setting (still off by default).
3166
3167         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
3168         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
3169         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
3170         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
3171
3172         Export ScrollingTreeFrameScrollingNodeIOS.
3173
3174         * rendering/RenderLayerCompositor.cpp:
3175         (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
3176         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
3177         (WebCore::RenderLayerCompositor::updateScrollLayerClipping):
3178
3179         If we don't have a separate clip layer, just resize and position the scroll layer.
3180
3181         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
3182         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
3183         (WebCore::RenderLayerCompositor::ensureRootLayer):
3184
3185         Use GraphicsLayer::Type::Scrolling as the scroll layer type when async frame scrolling is enabled.
3186         Don't create a separate clip layer since the scroll layer will handle clipping.
3187
3188         * rendering/RenderLayerCompositor.h:
3189
3190 2019-01-18  Ali Juma  <ajuma@chromium.org>
3191
3192         FetchResponse::url should return the empty string for tainted responses
3193         https://bugs.webkit.org/show_bug.cgi?id=193553
3194
3195         Reviewed by Youenn Fablet.
3196
3197         Check whether the response is tainted in FetchResponse::url, to match
3198         the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque.
3199
3200         * Modules/fetch/FetchResponse.cpp:
3201         (WebCore::FetchResponse::url const):
3202
3203 2019-01-18  Youenn Fablet  <youenn@apple.com>
3204
3205         A track source should be unmuted whenever reenabled after setDirection changes
3206         https://bugs.webkit.org/show_bug.cgi?id=193554
3207         <rdar://problem/47366196>
3208
3209         Reviewed by Eric Carlson.
3210
3211         Ensure that track gets unmuted after being fired as part of track event.
3212         Test is triggering some existing issues with MediaPlayerPrivateMediaStreamAVFObjC.
3213         Given the enqueuing of samples happens in a different frame than the thread used to update media stream and the active video track,
3214         some enqueued samples might not be from the right active video track or there might be no active video track.
3215
3216         Test: webrtc/video-setDirection.html
3217
3218         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3219         (WebCore::LibWebRTCMediaEndpoint::fireTrackEvent):
3220         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3221         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3222         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
3223         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
3224
3225 2019-01-18  Charlie Turner  <cturner@igalia.com>
3226
3227         [GStreamer][EME][ClearKey] Request keys from CDMInstance rather than passing via bus messages
3228         https://bugs.webkit.org/show_bug.cgi?id=192229
3229
3230         Reviewed by Xabier Rodriguez-Calvar.
3231
3232         Covered by existing tests.
3233
3234         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3235         (WebCore::parseLicenseFormat): There is a defect in some C++11
3236         compiles where they will copy this return value since the type
3237         doesn't exactly match. Force a move with WTFMove.
3238         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3239         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
3240         Deleted. No longer used by anything.
3241         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Ditto.
3242         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
3243         Rename these methods to avoid "namespacing names".
3244         (webkit_media_clear_key_decrypt_class_init):
3245         (finalize):
3246         (handleKeyResponse): This is a temporary fix, we need some more
3247         reorganisation to be full driven by CDMInstance APIs for decryption.
3248         (findAndSetKey):
3249         (decrypt):
3250         (webKitMediaClearKeyDecryptorFinalize): Deleted.
3251         (webKitMediaClearKeyDecryptorHandleKeyResponse): Deleted.
3252         (webKitMediaClearKeyDecryptorFindAndSetKey): Deleted.
3253         (webKitMediaClearKeyDecryptorDecrypt): Deleted.
3254         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Ditto.
3255         (webkit_media_common_encryption_decrypt_class_init):
3256         (finalize):
3257         (transformCaps):
3258         (transformInPlace):
3259         (isCDMInstanceAvailable):
3260         (sinkEventHandler):
3261         (queryHandler):
3262         (changeState):
3263         (setContext):
3264         (webKitMediaCommonEncryptionDecryptorFinalize): Deleted.
3265         (webkitMediaCommonEncryptionDecryptTransformCaps): Deleted.
3266         (webkitMediaCommonEncryptionDecryptTransformInPlace): Deleted.
3267         (webkitMediaCommonEncryptionDecryptIsCDMInstanceAvailable): Deleted.
3268         (webkitMediaCommonEncryptionDecryptSinkEventHandler): Deleted.
3269         (webkitMediaCommonEncryptionDecryptorQueryHandler): Deleted.
3270         (webKitMediaCommonEncryptionDecryptorChangeState): Deleted.
3271         (webKitMediaCommonEncryptionDecryptorSetContext): Deleted.
3272         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
3273         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3274         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithLocalInstance):
3275         Deleted. No longer passing key information over bus messages.
3276         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
3277
3278 2019-01-18  Zalan Bujtas  <zalan@apple.com>
3279
3280         [LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats.
3281         https://bugs.webkit.org/show_bug.cgi?id=193564
3282
3283         Reviewed by Antti Koivisto.
3284
3285         Float boxes prevent collapsing through.
3286
3287         Test: fast/block/float/float-in-descendant-formatting-context.html
3288
3289         * layout/blockformatting/BlockMarginCollapse.cpp:
3290         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
3291
3292 2019-01-18  Zalan Bujtas  <zalan@apple.com>
3293
3294         [LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom.
3295         https://bugs.webkit.org/show_bug.cgi?id=193562
3296
3297         Reviewed by Antti Koivisto.
3298
3299         The current floating context's (float) boxes could belong to descendant formatting contexts.
3300         We need to include them as well when computing height (bottom) (we essentially need to skip ancestor floats only).
3301
3302         <div id=container style="overflow: hidden"><div>foo<div style="float: left">bar</div></div></div>
3303         While computing the height for "container", the float box needs to be taken into account even though
3304         it is part of another (descendant) formatting context (the inline formatting context established by its parent div).
3305
3306         * layout/floats/FloatingState.cpp:
3307         (WebCore::Layout::FloatingState::bottom const):
3308         * layout/floats/FloatingState.h:
3309         (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
3310         (WebCore::Layout::FloatingState::FloatItem::inFormattingContext const): Deleted.
3311
3312 2019-01-18  Zalan Bujtas  <zalan@apple.com>
3313
3314         [LFC][BFC] Check for inflow children while computing height for block formatting context roots.
3315         https://bugs.webkit.org/show_bug.cgi?id=193555
3316
3317         Reviewed by Antti Koivisto.
3318
3319         This patch also extends areEssentiallyEqual to 0.125px to be able to match (essentially equal) inline runs. 
3320
3321         * layout/FormattingContextGeometry.cpp:
3322         (WebCore::Layout::contentHeightForFormattingContextRoot):
3323         * layout/Verification.cpp:
3324         (WebCore::Layout::areEssentiallyEqual):
3325         * page/FrameViewLayoutContext.cpp:
3326         (WebCore::layoutUsingFormattingContext):
3327
3328 2019-01-18  Yacine Bandou  <yacine.bandou@softathome.com>
3329
3330         [WebAudio] Release the AudioDestination when uninitializing DefaultAudioDestinationNode
3331         https://bugs.webkit.org/show_bug.cgi?id=192590
3332
3333         Reviewed by Philippe Normand.
3334
3335         When we uninitialize DefaultAudioDestinationNode, the AudioDestination is stopped but not destroyed.
3336
3337         On some platforms the resources are allocated and released with the AudioDestination, thus when we uninitialize
3338         DefaultAudioDestinationNode we don't release resources because the AudioDestination is not destroyed.
3339
3340         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
3341         (WebCore::DefaultAudioDestinationNode::uninitialize):
3342
3343 2019-01-18  Yacine Bandou  <yacine.bandou@softathome.com>
3344
3345         [WebAudio] Call AudioContext::uninitialize() immediately when the AudioContext is stopped
3346         https://bugs.webkit.org/show_bug.cgi?id=192586
3347
3348         Reviewed by Philippe Normand.
3349
3350         When WebProcess is killed, AudioContext::uninitialize() is not called immediately in the stop so
3351         the AudioDestinationNode is not destroyed.
3352
3353         In my case, I have a resource device manager, the output audio device is reserved when AudioDestinationNode
3354         is instantiated and it is released when AudioDestinationNode is destroyed, thus when the webprocess is killed,
3355         the resources leak.
3356
3357         AudioContext::uninitialize() is not called immediately since r94608.
3358         This modification can now be reverted without regression in WebAudio tests.
3359
3360         Test: webaudio/mediaelementaudiosourcenode-gc.html
3361
3362         * Modules/webaudio/AudioContext.cpp:
3363         (WebCore::AudioContext::stop):
3364
3365 2019-01-18  Simon Fraser  <simon.fraser@apple.com>
3366
3367         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() can be removed
3368         https://bugs.webkit.org/show_bug.cgi?id=193559
3369
3370         Reviewed by Antti Koivisto.
3371
3372         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() existed for CoordinatedGraphics,
3373         but the code that used it was removed in webkit.org/r229318 so we can remove it and
3374         code that calls it.
3375
3376         * page/scrolling/ScrollingCoordinator.h:
3377         (WebCore::ScrollingCoordinator::willDestroyScrollableArea):
3378         (WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange): Deleted.
3379         * rendering/RenderLayerBacking.cpp:
3380         (WebCore::RenderLayerBacking::updateGeometry):
3381         * rendering/RenderLayerCompositor.cpp:
3382         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
3383         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
3384         (WebCore::RenderLayerCompositor::scrollingLayerDidChange): Deleted.
3385         * rendering/RenderLayerCompositor.h:
3386
3387 2019-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3388
3389         [iOS] Content offset jumps erratically when autoscrolling near scroll view